Imported Upstream version 2.6.0 upstream/2.6.0
authorBdale Garbee <bdale@gag.com>
Sun, 6 Jul 2008 07:30:56 +0000 (01:30 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 6 Jul 2008 07:30:56 +0000 (01:30 -0600)
786 files changed:
AUTHORS
ChangeLog
DEVELOPING [new file with mode: 0644]
INSTALL
Makefile.am
Makefile.in
NEWS
ReleaseNotes
UPGRADING [new file with mode: 0644]
acinclude.m4 [deleted file]
aclocal.m4
amandad-src/Makefile.am
amandad-src/Makefile.in
amandad-src/amandad.c
amandad-src/amandad_util.c
amplot/Makefile.am
amplot/Makefile.in
amplot/amplot.sh [new file with mode: 0644]
amplot/amplot.sh.in [deleted file]
autogen
changer-src/Makefile.am
changer-src/Makefile.in
changer-src/chg-chio.pl [new file with mode: 0644]
changer-src/chg-chio.pl.in [deleted file]
changer-src/chg-chs.sh [new file with mode: 0644]
changer-src/chg-chs.sh.in [deleted file]
changer-src/chg-disk.sh [new file with mode: 0644]
changer-src/chg-disk.sh.in [deleted file]
changer-src/chg-iomega.pl [new file with mode: 0644]
changer-src/chg-iomega.pl.in [deleted file]
changer-src/chg-juke.sh [new file with mode: 0755]
changer-src/chg-juke.sh.in [deleted file]
changer-src/chg-lib.sh.in
changer-src/chg-manual.sh [new file with mode: 0644]
changer-src/chg-manual.sh.in [deleted file]
changer-src/chg-mcutil.sh [new file with mode: 0644]
changer-src/chg-mcutil.sh.in [deleted file]
changer-src/chg-mtx.sh [new file with mode: 0644]
changer-src/chg-mtx.sh.in [deleted file]
changer-src/chg-multi.sh [new file with mode: 0644]
changer-src/chg-multi.sh.in [deleted file]
changer-src/chg-null.sh [new file with mode: 0644]
changer-src/chg-null.sh.in [deleted file]
changer-src/chg-rait.sh [new file with mode: 0644]
changer-src/chg-rait.sh.in [deleted file]
changer-src/chg-rth.pl [new file with mode: 0644]
changer-src/chg-rth.pl.in [deleted file]
changer-src/chg-scsi-chio.c
changer-src/chg-scsi.c
changer-src/chg-zd-mtx.sh [new file with mode: 0644]
changer-src/chg-zd-mtx.sh.in [deleted file]
changer-src/scsi-aix.c
changer-src/scsi-bsd.c
changer-src/scsi-cam.c
changer-src/scsi-changer-driver.c
changer-src/scsi-chio.c
changer-src/scsi-hpux.c
changer-src/scsi-hpux_new.c
changer-src/scsi-irix.c
changer-src/scsi-linux.c
changer-src/scsi-proto.c
changer-src/scsi-solaris.c
changer-src/sense.c
client-src/Makefile.am
client-src/Makefile.in
client-src/amandates.c
client-src/amhpfixdevs.sh [deleted file]
client-src/amsinixfixdevs.sh [deleted file]
client-src/calcsize.c
client-src/client_util.c
client-src/client_util.h
client-src/getfsent.c
client-src/killpgrp.c
client-src/noop.c
client-src/patch-system.sh [new file with mode: 0644]
client-src/patch-system.sh.in [deleted file]
client-src/rundump.c
client-src/runtar.c
client-src/selfcheck.c
client-src/sendbackup-dump.c
client-src/sendbackup-gnutar.c
client-src/sendbackup.c
client-src/sendsize.c
client-src/unctime.c
client-src/versionsuffix.c
common-src/Makefile.am
common-src/Makefile.in
common-src/alloc.c
common-src/amaespipe.sh [new file with mode: 0755]
common-src/amanda-sh-lib.sh.in [new file with mode: 0644]
common-src/amanda.h
common-src/amcrypt-ossl-asym.sh [new file with mode: 0644]
common-src/amcrypt-ossl.sh [new file with mode: 0644]
common-src/amcrypt.sh [new file with mode: 0755]
common-src/amcryptsimple.pl [new file with mode: 0755]
common-src/amfeatures.c
common-src/amflock-flock.c [new file with mode: 0644]
common-src/amflock-lnlock.c [new file with mode: 0644]
common-src/amflock-lockf.c [new file with mode: 0644]
common-src/amflock-posix.c [new file with mode: 0644]
common-src/amflock-test.c [new file with mode: 0644]
common-src/amflock.c
common-src/amflock.h [new file with mode: 0644]
common-src/amgpgcrypt.pl [new file with mode: 0755]
common-src/arglist.h
common-src/bsd-security.c
common-src/bsdtcp-security.c
common-src/bsdudp-security.c
common-src/clock.c
common-src/clock.h
common-src/columnar.c [new file with mode: 0644]
common-src/columnar.h [new file with mode: 0644]
common-src/conffile.c
common-src/conffile.h
common-src/debug.c
common-src/debug.h [new file with mode: 0644]
common-src/dgram.c
common-src/dgram.h
common-src/error.c [deleted file]
common-src/event.c
common-src/event.h
common-src/file.c
common-src/file.h [new file with mode: 0644]
common-src/fileheader.c
common-src/fileheader.h
common-src/genversion.c
common-src/genversion.h [new file with mode: 0644]
common-src/glib-util.c [new file with mode: 0644]
common-src/glib-util.h [new file with mode: 0644]
common-src/krb4-security.c
common-src/krb5-security.c
common-src/local-security.c [new file with mode: 0644]
common-src/match.c
common-src/packet.c
common-src/packet.h
common-src/pipespawn.c
common-src/protocol.c
common-src/rsh-security.c
common-src/security-util.c
common-src/security-util.h
common-src/security.c
common-src/security.h
common-src/sockaddr-util.c [new file with mode: 0644]
common-src/sockaddr-util.h [new file with mode: 0644]
common-src/ssh-security.c
common-src/statfs.c [deleted file]
common-src/statfs.h [deleted file]
common-src/stream.c
common-src/stream.h
common-src/svn-info.h [new file with mode: 0644]
common-src/tapelist.c
common-src/tapelist.h
common-src/timestamp.c [new file with mode: 0644]
common-src/timestamp.h [new file with mode: 0644]
common-src/token.c
common-src/token.h
common-src/util.c
common-src/util.h
common-src/version.c [deleted file]
common-src/versuff.c
config/Makefile.am
config/Makefile.in
config/acinclude.m4i [deleted file]
config/amanda/amplot.m4 [new file with mode: 0644]
config/amanda/bsd-security.m4 [new file with mode: 0644]
config/amanda/bsdtcp-security.m4 [new file with mode: 0644]
config/amanda/bsdudp-security.m4 [new file with mode: 0644]
config/amanda/changer.m4 [new file with mode: 0644]
config/amanda/components.m4 [new file with mode: 0644]
config/amanda/compress.m4 [new file with mode: 0644]
config/amanda/config.m4 [new file with mode: 0644]
config/amanda/debugging.m4 [new file with mode: 0644]
config/amanda/defaults.m4 [new file with mode: 0644]
config/amanda/devprefix.m4 [new file with mode: 0644]
config/amanda/dirs.m4 [new file with mode: 0644]
config/amanda/documentation.m4 [new file with mode: 0644]
config/amanda/dumpers.m4 [new file with mode: 0644]
config/amanda/file-list [new file with mode: 0644]
config/amanda/flags.m4 [new file with mode: 0644]
config/amanda/flock.m4 [new file with mode: 0644]
config/amanda/funcs.m4 [new file with mode: 0644]
config/amanda/getfsent.m4 [new file with mode: 0644]
config/amanda/i18n.m4 [new file with mode: 0644]
config/amanda/ipv6.m4 [new file with mode: 0644]
config/amanda/krb4-security.m4 [new file with mode: 0644]
config/amanda/krb5-security.m4 [new file with mode: 0644]
config/amanda/lfs.m4 [new file with mode: 0644]
config/amanda/libs.m4 [new file with mode: 0644]
config/amanda/net.m4 [new file with mode: 0644]
config/amanda/progs.m4 [new file with mode: 0644]
config/amanda/readdir.m4 [new file with mode: 0644]
config/amanda/readline.m4 [new file with mode: 0644]
config/amanda/rsh-security.m4 [new file with mode: 0644]
config/amanda/s3-device.m4 [new file with mode: 0644]
config/amanda/shmem.m4 [new file with mode: 0644]
config/amanda/ssh-security.m4 [new file with mode: 0644]
config/amanda/summary.m4 [new file with mode: 0644]
config/amanda/swig.m4 [new file with mode: 0644]
config/amanda/syshacks.m4 [new file with mode: 0644]
config/amanda/tape.m4 [new file with mode: 0644]
config/amanda/types.m4 [new file with mode: 0644]
config/amanda/userid.m4 [new file with mode: 0644]
config/amanda/version.m4 [new file with mode: 0644]
config/automake/file-list [new file with mode: 0644]
config/automake/installperms.am [new file with mode: 0644]
config/automake/precompile.am [new file with mode: 0644]
config/automake/scripts.am [new file with mode: 0644]
config/automake/vars.am [new file with mode: 0644]
config/compile [new file with mode: 0644]
config/config.guess
config/config.h.in
config/config.rpath
config/config.sub
config/depcomp
config/gettext-macros/codeset.m4 [new file with mode: 0644]
config/gettext-macros/file-list [new file with mode: 0644]
config/gettext-macros/gettext.m4 [new file with mode: 0644]
config/gettext-macros/glibc2.m4 [new file with mode: 0644]
config/gettext-macros/glibc21.m4 [new file with mode: 0644]
config/gettext-macros/iconv.m4 [new file with mode: 0644]
config/gettext-macros/intdiv0.m4 [new file with mode: 0644]
config/gettext-macros/intmax.m4 [new file with mode: 0644]
config/gettext-macros/inttypes-pri.m4 [new file with mode: 0644]
config/gettext-macros/inttypes.m4 [new file with mode: 0644]
config/gettext-macros/inttypes_h.m4 [new file with mode: 0644]
config/gettext-macros/isc-posix.m4 [new file with mode: 0644]
config/gettext-macros/lcmessage.m4 [new file with mode: 0644]
config/gettext-macros/lib-ld.m4 [new file with mode: 0644]
config/gettext-macros/lib-link.m4 [new file with mode: 0644]
config/gettext-macros/lib-prefix.m4 [new file with mode: 0644]
config/gettext-macros/longdouble.m4 [new file with mode: 0644]
config/gettext-macros/longlong.m4 [new file with mode: 0644]
config/gettext-macros/nls.m4 [new file with mode: 0644]
config/gettext-macros/po.m4 [new file with mode: 0644]
config/gettext-macros/printf-posix.m4 [new file with mode: 0644]
config/gettext-macros/progtest.m4 [new file with mode: 0644]
config/gettext-macros/signed.m4 [new file with mode: 0644]
config/gettext-macros/size_max.m4 [new file with mode: 0644]
config/gettext-macros/stdint_h.m4 [new file with mode: 0644]
config/gettext-macros/uintmax_t.m4 [new file with mode: 0644]
config/gettext-macros/ulonglong.m4 [new file with mode: 0644]
config/gettext-macros/wchar_t.m4 [new file with mode: 0644]
config/gettext-macros/wint_t.m4 [new file with mode: 0644]
config/gettext-macros/xsize.m4 [new file with mode: 0644]
config/gnulib.m4i [deleted file]
config/gnulib/absolute-header.m4
config/gnulib/base64.m4 [new file with mode: 0644]
config/gnulib/extensions.m4
config/gnulib/file-list [new file with mode: 0644]
config/gnulib/float_h.m4 [new file with mode: 0644]
config/gnulib/fsusage.m4 [new file with mode: 0644]
config/gnulib/getaddrinfo.m4
config/gnulib/gettimeofday.m4 [new file with mode: 0644]
config/gnulib/gnulib-cache.m4
config/gnulib/gnulib-comp.m4
config/gnulib/include_next.m4 [new file with mode: 0644]
config/gnulib/lock.m4
config/gnulib/longdouble.m4 [deleted file]
config/gnulib/malloc.m4 [new file with mode: 0644]
config/gnulib/mkdtemp.m4 [new file with mode: 0644]
config/gnulib/netinet_in_h.m4
config/gnulib/physmem.m4 [new file with mode: 0644]
config/gnulib/safe-read.m4 [new file with mode: 0644]
config/gnulib/safe-write.m4 [new file with mode: 0644]
config/gnulib/snprintf.m4
config/gnulib/socklen.m4
config/gnulib/ssize_t.m4 [new file with mode: 0644]
config/gnulib/stdint.m4 [new file with mode: 0644]
config/gnulib/stdio_h.m4 [new file with mode: 0644]
config/gnulib/stdlib_h.m4 [new file with mode: 0644]
config/gnulib/string_h.m4
config/gnulib/sys_socket_h.m4
config/gnulib/sys_stat_h.m4 [new file with mode: 0644]
config/gnulib/sys_time_h.m4 [new file with mode: 0644]
config/gnulib/tempname.m4 [new file with mode: 0644]
config/gnulib/ulonglong.m4 [new file with mode: 0644]
config/gnulib/unistd_h.m4 [new file with mode: 0644]
config/gnulib/vasnprintf.m4
config/gnulib/wchar.m4 [new file with mode: 0644]
config/gnulib/wint_t.m4
config/install-sh
config/libtool.m4 [new file with mode: 0644]
config/libtool.m4i [deleted file]
config/link-warning.h [new file with mode: 0644]
config/ltmain.sh
config/macro-archive/ac_define_dir.m4 [new file with mode: 0644]
config/macro-archive/ac_prog_perl_version.m4 [new file with mode: 0644]
config/macro-archive/ac_prog_swig.m4 [new file with mode: 0644]
config/macro-archive/ax_compare_version.m4 [new file with mode: 0644]
config/macro-archive/docbook-dtd.m4 [new file with mode: 0644]
config/macro-archive/docbook-xslt-min.m4 [new file with mode: 0644]
config/macro-archive/docbook-xslt.m4 [new file with mode: 0644]
config/macro-archive/file-list [new file with mode: 0644]
config/macro-archive/xsltproc.m4 [new file with mode: 0644]
config/missing
config/mkinstalldirs
config/ylwrap [new file with mode: 0755]
configure
configure.in
contrib/set_prod_link.pl
device-src/Makefile.am [new file with mode: 0644]
device-src/Makefile.in [new file with mode: 0644]
device-src/activate-devpay.c [new file with mode: 0644]
device-src/device.c [new file with mode: 0644]
device-src/device.h [new file with mode: 0644]
device-src/null-device.c [new file with mode: 0644]
device-src/null-device.h [new file with mode: 0644]
device-src/property.c [new file with mode: 0644]
device-src/property.h [new file with mode: 0644]
device-src/queueing.c [new file with mode: 0644]
device-src/queueing.h [new file with mode: 0644]
device-src/rait-device.c [new file with mode: 0644]
device-src/rait-device.h [new file with mode: 0644]
device-src/s3-device.c [new file with mode: 0644]
device-src/s3-device.h [new file with mode: 0644]
device-src/s3.c [new file with mode: 0644]
device-src/s3.h [new file with mode: 0644]
device-src/semaphore.c [new file with mode: 0644]
device-src/semaphore.h [new file with mode: 0644]
device-src/tape-aix.c [new file with mode: 0644]
device-src/tape-device.c [new file with mode: 0644]
device-src/tape-device.h [new file with mode: 0644]
device-src/tape-ops.h [new file with mode: 0644]
device-src/tape-posix.c [new file with mode: 0644]
device-src/tape-uware.c [new file with mode: 0644]
device-src/tape-xenix.c [new file with mode: 0644]
device-src/tests/Makefile.am [new file with mode: 0644]
device-src/tests/Makefile.in [new file with mode: 0644]
device-src/tests/device_test.c [new file with mode: 0644]
device-src/tests/queue_test.c [new file with mode: 0644]
device-src/tests/semaphore-test.c [new file with mode: 0644]
device-src/tests/vfs_test.c [new file with mode: 0644]
device-src/vfs-device.c [new file with mode: 0644]
device-src/vfs-device.h [new file with mode: 0644]
docs/Appendix.txt [deleted file]
docs/Makefile.am [deleted file]
docs/Makefile.in [deleted file]
docs/amadmin.8.txt [deleted file]
docs/amaespipe.8.txt [deleted file]
docs/amanda-client.conf.5.txt [deleted file]
docs/amanda.8.txt [deleted file]
docs/amanda.conf.5.txt [deleted file]
docs/amcheck.8.txt [deleted file]
docs/amcheckdb.8.txt [deleted file]
docs/amcleanup.8.txt [deleted file]
docs/amcrypt-asym-ossl.8.txt [deleted file]
docs/amcrypt-ossl.8.txt [deleted file]
docs/amcrypt.8.txt [deleted file]
docs/amdd.8.txt [deleted file]
docs/amdump.8.txt [deleted file]
docs/amfetchdump.8.txt [deleted file]
docs/amflush.8.txt [deleted file]
docs/amgetconf.8.txt [deleted file]
docs/amlabel.8.txt [deleted file]
docs/ammt.8.txt [deleted file]
docs/amoverview.8.txt [deleted file]
docs/amplot.8.txt [deleted file]
docs/amrecover.8.txt [deleted file]
docs/amreport.8.txt [deleted file]
docs/amrestore.8.txt [deleted file]
docs/amrmtape.8.txt [deleted file]
docs/amstatus.8.txt [deleted file]
docs/amtape.8.txt [deleted file]
docs/amtapetype.8.txt [deleted file]
docs/amtoc.8.txt [deleted file]
docs/amverify.8.txt [deleted file]
docs/amverifyrun.8.txt [deleted file]
docs/chgscsi.txt [deleted file]
docs/dumperapi.txt [deleted file]
docs/eventapi.txt [deleted file]
docs/exclude.txt [deleted file]
docs/faq.txt [deleted file]
docs/historical.txt [deleted file]
docs/howto-afs.txt [deleted file]
docs/howto-auth.txt [deleted file]
docs/howto-cygwin.txt [deleted file]
docs/howto-filedriver.txt [deleted file]
docs/howto-wrapper.txt [deleted file]
docs/howtos.txt [deleted file]
docs/index.txt [deleted file]
docs/indexing.txt [deleted file]
docs/install.txt [deleted file]
docs/internals.txt [deleted file]
docs/introduction.txt [deleted file]
docs/ix01.txt [deleted file]
docs/kerberos.txt [deleted file]
docs/labelprinting.txt [deleted file]
docs/links.txt [deleted file]
docs/manpages.txt [deleted file]
docs/multitape.txt [deleted file]
docs/portusage.txt [deleted file]
docs/pr01.txt [deleted file]
docs/pr02.txt [deleted file]
docs/pr03.txt [deleted file]
docs/pr04.txt [deleted file]
docs/rait.txt [deleted file]
docs/references.txt [deleted file]
docs/restore.txt [deleted file]
docs/samba.txt [deleted file]
docs/security-api.txt [deleted file]
docs/security.txt [deleted file]
docs/strategy-api.txt [deleted file]
docs/survey.txt [deleted file]
docs/systemnotes.txt [deleted file]
docs/tapechangers.txt [deleted file]
docs/tapesnchangers.txt [deleted file]
docs/tapetypes.txt [deleted file]
docs/technical.txt [deleted file]
docs/topten.txt [deleted file]
docs/upgrade.txt [deleted file]
docs/using.txt [deleted file]
docs/various.txt [deleted file]
docs/vtape-api.txt [deleted file]
docs/whatwasnew.txt [deleted file]
docs/wishlist.txt [deleted file]
docs/y2k.txt [deleted file]
docs/zftape.txt [deleted file]
dumper-src/Makefile.am
dumper-src/Makefile.in
dumper-src/amgtar.pl [new file with mode: 0644]
dumper-src/amgtar.pl.in [deleted file]
dumper-src/generic-dumper.pl [new file with mode: 0644]
dumper-src/generic-dumper.pl.in [deleted file]
example/DLT-A4.ps [new file with mode: 0644]
example/Makefile.am
example/Makefile.in
example/amanda-client.conf [new file with mode: 0644]
example/amanda-client.conf.in
example/amanda.conf [new file with mode: 0644]
example/amanda.conf.in
example/chg-mcutil.conf
example/config.site
example/inetd.conf.amandaclient [new file with mode: 0644]
example/template.d/README [new file with mode: 0644]
example/template.d/advanced.conf [new file with mode: 0644]
example/template.d/advanced.conf.in [new file with mode: 0644]
example/template.d/amanda-S3.conf [new file with mode: 0644]
example/template.d/amanda-S3.conf.in [new file with mode: 0644]
example/template.d/amanda-harddisk.conf [new file with mode: 0644]
example/template.d/amanda-harddisk.conf.in [new file with mode: 0644]
example/template.d/amanda-single-tape.conf [new file with mode: 0644]
example/template.d/amanda-single-tape.conf.in [new file with mode: 0644]
example/template.d/amanda-tape-changer.conf [new file with mode: 0644]
example/template.d/amanda-tape-changer.conf.in [new file with mode: 0644]
example/template.d/chg-manual.conf [new file with mode: 0644]
example/template.d/dumptypes [new file with mode: 0644]
example/template.d/tapetypes [new file with mode: 0644]
example/xinetd.amandaclient [new file with mode: 0644]
example/xinetd.amandaserver [new file with mode: 0644]
gnulib/Makefile.am
gnulib/Makefile.in
gnulib/alloca_.h
gnulib/base64.c [new file with mode: 0644]
gnulib/base64.h [new file with mode: 0644]
gnulib/float+.h [new file with mode: 0644]
gnulib/float_.h [new file with mode: 0644]
gnulib/fsusage.c [new file with mode: 0644]
gnulib/fsusage.h [new file with mode: 0644]
gnulib/full-read.c [new file with mode: 0644]
gnulib/full-read.h [new file with mode: 0644]
gnulib/full-write.c [new file with mode: 0644]
gnulib/full-write.h [new file with mode: 0644]
gnulib/getaddrinfo.c
gnulib/gettimeofday.c [new file with mode: 0644]
gnulib/malloc.c [new file with mode: 0644]
gnulib/mkdtemp.c [new file with mode: 0644]
gnulib/netinet_in_.h [new file with mode: 0644]
gnulib/physmem.c [new file with mode: 0644]
gnulib/physmem.h [new file with mode: 0644]
gnulib/printf-args.c
gnulib/printf-args.h
gnulib/printf-parse.c
gnulib/printf-parse.h
gnulib/regenerate/getaddrinfo-cygwin.patch
gnulib/regenerate/no-error.patch
gnulib/regenerate/regenerate [changed mode: 0644->0755]
gnulib/safe-read.c [new file with mode: 0644]
gnulib/safe-read.h [new file with mode: 0644]
gnulib/safe-write.c [new file with mode: 0644]
gnulib/safe-write.h [new file with mode: 0644]
gnulib/snprintf.c
gnulib/snprintf.h [deleted file]
gnulib/socket_.h [deleted file]
gnulib/stdbool_.h
gnulib/stdint_.h [new file with mode: 0644]
gnulib/stdio_.h [new file with mode: 0644]
gnulib/stdlib_.h [new file with mode: 0644]
gnulib/string_.h
gnulib/sys_socket_.h [new file with mode: 0644]
gnulib/sys_stat_.h [new file with mode: 0644]
gnulib/sys_time_.h [new file with mode: 0644]
gnulib/tempname.c [new file with mode: 0644]
gnulib/tempname.h [new file with mode: 0644]
gnulib/unistd_.h [new file with mode: 0644]
gnulib/vasnprintf.c
gnulib/vasnprintf.h
gnulib/wchar_.h [new file with mode: 0644]
installcheck/Amanda_Changer.pl [new file with mode: 0644]
installcheck/Amanda_Cmdline.pl [new file with mode: 0644]
installcheck/Amanda_Config.pl [new file with mode: 0644]
installcheck/Amanda_Logfile.pl [new file with mode: 0644]
installcheck/Amanda_Types.pl [new file with mode: 0644]
installcheck/Amconfig.pm.in [new file with mode: 0644]
installcheck/Makefile.am [new file with mode: 0644]
installcheck/Makefile.in [new file with mode: 0644]
installcheck/amcheckdump.pl [new file with mode: 0644]
installcheck/amdevcheck.pl [new file with mode: 0644]
installcheck/amgetconf.pl [new file with mode: 0644]
man/Makefile.am
man/Makefile.in
man/amaddclient.8 [new file with mode: 0644]
man/amadmin.8
man/amaespipe.8
man/amanda-client.conf.5
man/amanda.8
man/amanda.conf.5
man/amcheck.8
man/amcheckdb.8
man/amcheckdump.8 [new file with mode: 0644]
man/amcleanup.8
man/amcrypt-ossl-asym.8
man/amcrypt-ossl.8
man/amcrypt.8
man/amcryptsimple.8 [new file with mode: 0644]
man/amdd.8
man/amdevcheck.8 [new file with mode: 0644]
man/amdump.8
man/amfetchdump.8
man/amflush.8
man/amgetconf.8
man/amgpgcrypt.8 [new file with mode: 0644]
man/amlabel.8
man/ammt.8
man/amoverview.8
man/amplot.8
man/amrecover.8
man/amreport.8
man/amrestore.8
man/amrmtape.8
man/amserverconfig.8 [new file with mode: 0644]
man/amstatus.8
man/amtape.8
man/amtapetype.8
man/amtoc.8
man/amverify.8
man/amverifyrun.8
man/xml-source/amaddclient.8.xml [new file with mode: 0644]
man/xml-source/amadmin.8.xml
man/xml-source/amaespipe.8.xml
man/xml-source/amanda-client.conf.5.xml
man/xml-source/amanda.8.xml
man/xml-source/amanda.conf.5.xml
man/xml-source/amcheck.8.xml
man/xml-source/amcheckdb.8.xml
man/xml-source/amcheckdump.8.xml [new file with mode: 0644]
man/xml-source/amcleanup.8.xml
man/xml-source/amcrypt-ossl-asym.8.xml
man/xml-source/amcrypt-ossl.8.xml
man/xml-source/amcrypt.8.xml
man/xml-source/amcryptsimple.8.xml [new file with mode: 0644]
man/xml-source/amdd.8.xml
man/xml-source/amdevcheck.8.xml [new file with mode: 0644]
man/xml-source/amdump.8.xml
man/xml-source/amfetchdump.8.xml
man/xml-source/amflush.8.xml
man/xml-source/amgetconf.8.xml
man/xml-source/amgpgcrypt.8.xml [new file with mode: 0644]
man/xml-source/amlabel.8.xml
man/xml-source/ammt.8.xml
man/xml-source/amoverview.8.xml
man/xml-source/amplot.8.xml
man/xml-source/amrecover.8.xml
man/xml-source/amreport.8.xml
man/xml-source/amrestore.8.xml
man/xml-source/amrmtape.8.xml
man/xml-source/amserverconfig.8.xml [new file with mode: 0644]
man/xml-source/amstatus.8.xml
man/xml-source/amtape.8.xml
man/xml-source/amtapetype.8.xml
man/xml-source/amtoc.8.xml
man/xml-source/amverify.8.xml
man/xml-source/amverifyrun.8.xml
oldrecover-src/Makefile.am
oldrecover-src/Makefile.in
oldrecover-src/amrecover.c
oldrecover-src/display_commands.c
oldrecover-src/extract_list.c
oldrecover-src/help.c
oldrecover-src/set_commands.c
oldrecover-src/uparse.c
oldrecover-src/uparse.y
oldrecover-src/uscan.c
oldrecover-src/uscan.l
packaging/Makefile.am [new file with mode: 0644]
packaging/Makefile.in [new file with mode: 0644]
packaging/README [new file with mode: 0644]
packaging/deb/amanda-backup-client.README.Debian [new file with mode: 0644]
packaging/deb/amanda-backup-client.dirs [new file with mode: 0644]
packaging/deb/amanda-backup-client.install [new file with mode: 0644]
packaging/deb/amanda-backup-client.lintian [new file with mode: 0644]
packaging/deb/amanda-backup-client.postinst [new file with mode: 0755]
packaging/deb/amanda-backup-client.postrm [new file with mode: 0755]
packaging/deb/amanda-backup-client.substvars [new file with mode: 0644]
packaging/deb/amanda-backup-server.README.Debian [new file with mode: 0644]
packaging/deb/amanda-backup-server.dirs [new file with mode: 0644]
packaging/deb/amanda-backup-server.install [new file with mode: 0644]
packaging/deb/amanda-backup-server.lintian [new file with mode: 0644]
packaging/deb/amanda-backup-server.postinst [new file with mode: 0755]
packaging/deb/amanda-backup-server.postrm [new file with mode: 0755]
packaging/deb/amanda-backup-server.substvars [new file with mode: 0644]
packaging/deb/buildpkg [new file with mode: 0755]
packaging/deb/changelog [new file with mode: 0644]
packaging/deb/compat [new file with mode: 0644]
packaging/deb/control [new file with mode: 0644]
packaging/deb/copyright [new file with mode: 0644]
packaging/deb/debian-binary [new file with mode: 0644]
packaging/deb/docs [new file with mode: 0644]
packaging/deb/postrm [new file with mode: 0755]
packaging/deb/preinst [new file with mode: 0755]
packaging/deb/rules [new file with mode: 0755]
packaging/deb/watch [new file with mode: 0644]
packaging/rpm/amanda.spec [new file with mode: 0644]
packaging/rpm/amanda.spec.rej [new file with mode: 0644]
packaging/rpm/buildpkg [new file with mode: 0755]
perl/Amanda/Changer.pm [new file with mode: 0644]
perl/Amanda/Cmdline.c [new file with mode: 0644]
perl/Amanda/Cmdline.pm [new file with mode: 0644]
perl/Amanda/Cmdline.swg [new file with mode: 0644]
perl/Amanda/Config.c [new file with mode: 0644]
perl/Amanda/Config.pm [new file with mode: 0644]
perl/Amanda/Config.swg [new file with mode: 0644]
perl/Amanda/Debug.c [new file with mode: 0644]
perl/Amanda/Debug.pm [new file with mode: 0644]
perl/Amanda/Debug.swg [new file with mode: 0644]
perl/Amanda/Device.c [new file with mode: 0644]
perl/Amanda/Device.pm [new file with mode: 0644]
perl/Amanda/Device.swg [new file with mode: 0644]
perl/Amanda/Logfile.c [new file with mode: 0644]
perl/Amanda/Logfile.pm [new file with mode: 0644]
perl/Amanda/Logfile.swg [new file with mode: 0644]
perl/Amanda/Paths.pm.in [new file with mode: 0644]
perl/Amanda/Tapefile.c [new file with mode: 0644]
perl/Amanda/Tapefile.pm [new file with mode: 0644]
perl/Amanda/Tapefile.swg [new file with mode: 0644]
perl/Amanda/Types.c [new file with mode: 0644]
perl/Amanda/Types.pm [new file with mode: 0644]
perl/Amanda/Types.swg [new file with mode: 0644]
perl/Amanda/Util.c [new file with mode: 0644]
perl/Amanda/Util.pm [new file with mode: 0644]
perl/Amanda/Util.swg [new file with mode: 0644]
perl/Makefile.am [new file with mode: 0644]
perl/Makefile.in [new file with mode: 0644]
perl/amglue/amglue.h [new file with mode: 0644]
perl/amglue/amglue.swg [new file with mode: 0644]
perl/amglue/bigint.c [new file with mode: 0644]
perl/amglue/constants.swg [new file with mode: 0644]
perl/amglue/exports.swg [new file with mode: 0644]
perl/amglue/ghashtable.c [new file with mode: 0644]
perl/amglue/glib.swg [new file with mode: 0644]
perl/amglue/integers.swg [new file with mode: 0644]
po/Makefile.am [new file with mode: 0755]
po/Makefile.in [new file with mode: 0644]
po/Makevars [new file with mode: 0755]
po/Rules-quot [new file with mode: 0755]
po/boldquot.sed [new file with mode: 0755]
po/en@boldquot.header [new file with mode: 0755]
po/en@quot.header [new file with mode: 0755]
po/insert-header.sin [new file with mode: 0755]
po/quot.sed [new file with mode: 0755]
po/remove-potcdate.sin [new file with mode: 0755]
po/stamp-po [new file with mode: 0644]
recover-src/Makefile.am
recover-src/Makefile.in
recover-src/amrecover.c
recover-src/amrecover.h
recover-src/display_commands.c
recover-src/extract_list.c
recover-src/help.c
recover-src/set_commands.c
recover-src/uparse.c
recover-src/uparse.h
recover-src/uparse.y
recover-src/uscan.c
recover-src/uscan.l
restore-src/Makefile.am
restore-src/Makefile.in
restore-src/amfetchdump.c
restore-src/amidxtaped.c
restore-src/amrestore.c
restore-src/restore.c
restore-src/restore.h
server-src/Makefile.am
server-src/Makefile.in
server-src/amaddclient.pl [new file with mode: 0755]
server-src/amadmin.c
server-src/amaespipe.sh.in [deleted file]
server-src/amcheck.c
server-src/amcheckdb.sh [new file with mode: 0644]
server-src/amcheckdb.sh.in [deleted file]
server-src/amcheckdump.pl [new file with mode: 0644]
server-src/amcleanup.sh [new file with mode: 0644]
server-src/amcleanup.sh.in [deleted file]
server-src/amcleanupdisk.c
server-src/amcrypt-ossl-asym.sh.in [deleted file]
server-src/amcrypt-ossl.sh.in [deleted file]
server-src/amcrypt.sh.in [deleted file]
server-src/amdevcheck.pl [new file with mode: 0644]
server-src/amdump.sh [new file with mode: 0644]
server-src/amdump.sh.in [deleted file]
server-src/amflush.c
server-src/amfreetapes.sh.in [deleted file]
server-src/amindex.c
server-src/amindexd.c
server-src/amlabel.c
server-src/amlogroll.c
server-src/amoverview.pl [new file with mode: 0644]
server-src/amoverview.pl.in [deleted file]
server-src/amrmtape.sh [new file with mode: 0644]
server-src/amrmtape.sh.in [deleted file]
server-src/amserverconfig.pl [new file with mode: 0755]
server-src/amstatus.pl [new file with mode: 0644]
server-src/amstatus.pl.in [deleted file]
server-src/amtape.c
server-src/amtoc.pl [new file with mode: 0644]
server-src/amtoc.pl.in [deleted file]
server-src/amtrmidx.c
server-src/amtrmlog.c
server-src/amverify.sh [new file with mode: 0644]
server-src/amverify.sh.in [deleted file]
server-src/amverifyrun.sh [new file with mode: 0644]
server-src/amverifyrun.sh.in [deleted file]
server-src/changer.c
server-src/chunker.c
server-src/cmdline.c
server-src/cmdline.h
server-src/disk_history.c
server-src/disk_history.h
server-src/diskfile.c
server-src/diskfile.h
server-src/driver.c
server-src/driverio.c
server-src/driverio.h
server-src/dumper.c
server-src/find.c
server-src/find.h
server-src/getconf.c
server-src/holding.c
server-src/holding.h
server-src/infofile.c
server-src/infofile.h
server-src/logfile.c
server-src/logfile.h
server-src/planner.c
server-src/reporter.c
server-src/server_util.c
server-src/server_util.h
server-src/tapefile.c
server-src/taper-disk-port-source.c [new file with mode: 0644]
server-src/taper-disk-port-source.h [new file with mode: 0644]
server-src/taper-file-source.c [new file with mode: 0644]
server-src/taper-file-source.h [new file with mode: 0644]
server-src/taper-mem-port-source.c [new file with mode: 0644]
server-src/taper-mem-port-source.h [new file with mode: 0644]
server-src/taper-port-source.c [new file with mode: 0644]
server-src/taper-port-source.h [new file with mode: 0644]
server-src/taper-source-test.c [new file with mode: 0644]
server-src/taper-source.c [new file with mode: 0644]
server-src/taper-source.h [new file with mode: 0644]
server-src/taper.c
server-src/taperscan.c
server-src/taperscan.h
tape-src/Makefile.am
tape-src/Makefile.in
tape-src/amdd.c
tape-src/ammt.c
tape-src/output-file.c
tape-src/output-file.h
tape-src/output-null.c
tape-src/output-null.h
tape-src/output-rait.c
tape-src/output-rait.h
tape-src/output-tape.c
tape-src/output-tape.h
tape-src/tapeio.c
tape-src/tapeio.h
tape-src/tapetype.c

diff --git a/AUTHORS b/AUTHORS
index 1c7e95f924249df2907f82b5e885c1f470f07153..3f98f3dd065c66671821b8ecf8bbe6ec9ee8ebb1 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -33,8 +33,7 @@ point after release 2.3.0.4.
 - John R. Jackson <jrj@gandalf.cc.purdue.edu>: security fixes, active
 developer and supporter
 
-- Jean-Louis Martineau <martinea@iro.umontreal.ca>: active developer
-and supporter
+- Jean-Louis Martineau <martineau@amanda.com>: active developer and supporter
 
 - Thomas Hepper <th@ant.han.de>: active developer of changer-src
 
@@ -50,5 +49,7 @@ and supporter
 
 - Ian Turner (ian@zmanda.com>: active developer and supporter
 
+- Dustin J. Mitchell (dustin@zmanda.com>: active developer and supporter
+
 Many other people have contributed to the development of Amanda; check
 the ChangeLog for their names and e-mail addresses.
index fbba979bcf8e7110cd49ef1200d6476b11d988f7..c531c6d56629cd9ea37cd5e9cf6e865f0027a67b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * Amanda 2.5.2p1 released.
+ 2008-03-31  Dan Locks <dwlocks@zmanda.com>
+       * packaging/deb/buildpkg
+         packaging/rpm/buildpkg: added -p to cp to preserve file timestamps.
+
+2008-03-31  Dan Locks <dwlocks@zmanda.com>
+       * packaging/Makefile.am: add deb subdirectory.
+
+2008-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/activate-devpay.c (parse_commandline): Always return.
+
+2008-03-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/readline.m4: Don't add READLINE_LIBS to LIBS.
+       * oldrecover-src/Makefile.am (LDAAD): Add READLINE_LIBS.
+       * recover-src/Makefile.am (LDAAD): Add READLINE_LIBS.
+       * config/amanda/swig.m4: AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL)
+       * config/amanda/swig.m4: Add library to PERLEXTLIBS on cygwin.
+       * config/amanda/syshacks.m4: Add '-no-undefined' to AMANDA_ADD_LDFLAGS.
+       * amandad-src/Makefile.am,
+       * client-src/Makefile.am, device-src/Makefile.am,
+         server-src/Makefile.am, server-src/server_util.c,
+         tape-src/Makefile.am: Add library to many *_LIBADD.
+       * perl/Makefile.am (install-data-hook): Copy cygwin ddl if
+         WANT_CYGWIN_COPY_PERL_DLL.
+
+2008-03-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Check difference between origsize and outsize
+         to find if the image is compressed.
+
+2008-03-25  Jean-Louis Martineau <martineau@zmanda.com>
+       Greg Troxel reported the bug and possible solution.
+       * common-src/stream.c (stream_server): New family argument, it is used
+                                              to create the socket.
+       * common-src/stream.h (stream_server): New prototype.
+       * server-src/chunker.c, server-src/taper.c: Call stream_server with
+         family of 'localhost', it's the name dumper use to contact them.
+       * restore-src/amidxtaped.c: Call stream_server with AF_INET.
+       * common-src/bsd-security.c, common-src/security-util.c: Call
+         stream_server with family of incoming packet.
+
+2008-03-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c (show_stat_info): Use getpwuid_r
+                                                      and getgrgid_r.
+
+2008-03-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/swig.m4: fix the fix to the fix for FreeBSD systems'
+         peculiar linking of threading libraries.
+
+2008-03-20  Dan Locks <dwlocks@zmanda.com>
+       * packaging/deb/control: removed grep dependency
+       * packaging/deb/amanda-backup-client.postinst 
+         packaging/deb/amanda-backup-server.postinst 
+         packaging/deb/amanda-backup-server.postrm
+         packaging/deb/amanda-backup-client.postrm:  removed call to
+         ldconfig to satisfy lintian
+       * packaging/deb/amanda-backup-server.lintian
+         packaging/deb/amanda-backup-client.lintian: sorted and added new
+         overrides
+       * packaging/deb/amanda-backup-client.dirs: removed var/amanda
+
+2008-03-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.6.0 released.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0")
+       * packaging/rpm/amanda.spec: %define amanda_version 2.6.0
+       * packaging/rpm/buildpkg: AMVER=amanda-2.6.0
+
+2008-03-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/diskfile.c: Correctly check if two hosts map to the same
+                                name.
+
+2008-03-14  Dan Locks <dwlocks@zmanda.com>
+       * packaging/deb/*: Initial debian package release.  This package is 
+         based on Bdale Garbee's work as the official debian maintainer for 
+         amanda.
+
+2008-03-13  Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec: changed the PKG_CONFIG_PATH macro so that
+         it works with rpm versions earlier than 4.4
+
+2008-03-12  Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/buildpkg: made the script quieter, simplified its
+         usage by creating the required tarball on the fly.
+       * packaging/rpm/amanda.spec: fixed a number of complaints from rpmlint,
+         added --quiet to the configure invocation
+
+2008-03-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/tests/semaphore-test.c,
+         device-src/tests/vfs_test.c: Call amanda_thread_init(NULL).
+
+2008-03-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.6.0b3 released.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b3")
+       * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b3
+       * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b3
+
+2008-03-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/Makefile.am: dest=$(amlibexecdir).
+
+2008-03-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/Makefile.am: Rename SCRIPTSDATA to SCRIPTS_INCLUDE,
+                                  Add chg-lib.sh.in to EXTRA_DIST.
+       * dumper-src/Makefile.am: Rename SCRIPTSDATA to SCRIPTS_INCLUDE,
+                                 Add generic-dumper.pl to EXTRA_DIST.
+       * common-src/Makefile.am: Add amanda-sh-lib.sh to SCRIPTS_INCLUDE,
+                                 Add amanda-sh-lib.sh.in to EXTRA_DIST.
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/Makefile.am: Move chg-lib.sh to SCRIPTSDATA.
+       * dumper-src/Makefile.am: Move generic-dumper to SCRIPTSDATA.
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/swig.m4: Check for *freebsd[123456]*
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-scsi-chio.c: Compile fix.
+       * changer-src/scsi-chio.c: Compile fix.
+       * config/amanda/changer.m4: Check for linux/chio.h
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/rpm/amanda.spec: Give CFLAGS after ./configure
+
+2008-03-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/swig.m4: With many thanks to John E. Hein
+         <jhein@timing.com>, fix the comment and make the change committed
+         yesterday apply to all FreeBSD < 7.0.
+
+2008-03-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/summary.m4: quote all warning messages that will be
+         included in heredocs, to avoid spurious interpretation of backquotes
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/rpm/amanda.spec: Add %{PERLSITELIB} in %files sections.
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * restore-src/amidxtaped: Use default config if amrecover doesn't send                         a config name.  (amoldrecover doesn't send a config).
+       * restore-src/restore.c: amrecover from 2.4.5 doesn't send the filenum,          so desired_tape->numfiles == 0.
+         If amidxtaped is launched directly from xinetd, then
+         flags->pipe_to_fd == STDOUT_FILENO, but this test should only
+         succeed for amrestore of amfetchdump.
+
+2008-03-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/tape-device.c: Set d_self->is_eof to FALSE.
+
+2008-03-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am config/amanda/swig.m4: add a special case for
+         FreeBSD-6.2: include -lpthread in the linking of each perl
+         extension, because libgthread does not pull in libpthread as
+         it does on other platforms.
+
+2008-03-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: getnameinfo return != 0 on error.
+
+2008-03-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/dumpers.m4: Typo.
+
+2008-03-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/tests/vfs_test.c: Fix ignoring
+         return value of 'pipe', declared with attribute warn_unused_result.
+
+2008-02-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h: add <stdint.h>
+
+2008-02-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Config.pl: fix Amanda_Config's use of the
+         missing Amanda::Tests
+
+2008-02-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: remove Amconfig.pm from EXTRA_DIST, as it
+         is a generated file.
+
+2008-02-28  Dustin J. Mitchell <dustin@zmanda.com>
+       Thanks to John E. Hein <jhein@timing.com> for identifying this problem
+       * installcheck/Amanda_Config.pl: use a properly-sized constant to
+         check parsing of large configuration values
+
+2008-02-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amindexd.c: Compute maxpart, call clean_dump.
+       * server-src/disk_history.h (DUMP_ITEM): Add maxpart field.
+       * server-src/disk_history.h (add_dump): New prototype,
+                                               add maxpart argument.
+       * server-src/disk_history.c (add_dump): Remove a DUMP_ITEM if the
+                                       previous part is not already added.
+       * server-src/disk_history.c (clean_dump): New function to remove
+                                       DUMP_ITEM if all part are not added.
+       * common-src/tapelist.h (tapelist_t): Add partnum field.
+       * common-src/tapelist.h (append_to_tapelist): New prototype,
+                                                     add partnum argument.
+       * common-src/tapelist.c (append_to_tapelist): New partnum argument.
+       * restore-src/amfetchdump.c: Use new append_to_tapelist prototype.
+
+2008-02-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Use sort_key in switch statement.
+
+2008-02-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Document --with-amlibdir.
+       * config/amanda/dirs.m4: Add AS_HELP_STRING for --without-amlibdir and
+                               --without-amlibexecdir,
+                               Set AMPERLLIB to $amlibdir/perl.
+
+2008-02-26  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Makefile.am config/amanda/dirs.m4 config/amanda/summary.m4:
+         add --with-amperldir, --without-amperldir, and install perl modules
+         in Perl's installsitearch by default; thanks to Orion Poplawski
+         <orion@cora.nwra.com> for help and suggestions.
+
+2008-02-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/getfsent.c: Don't fail if stat of mount point fail.
+
+2008-02-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c: Don't log a note if CLIENT_LOGIN == dumpuser for
+                            RUNNING_AS_DUMPUSER_PREFERRED.
+
+2008-02-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Report size of data on holding disk.
+
+2008-02-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/dirs.m4: Add --with-amlibdir and --with-amlibexecdir.
+       * NEWS, ReleaseNotes: Document it.
+
+2008-02-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c, server-src/dumper.c,
+         server-src/planner.c: Call waitpid to cleanup defunct process.
+
+2008-02-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tape-posix.c: keep ioctl error message in
+         debug log
+
+2008-02-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/device.c, device-src/null-device.c,
+         device-src/s3.c, device-src/tape-device.c,
+         device-src/queueing.h, device-src/s3.h,
+         device-src/vfs-device.c, device-src/rait-device.c,
+         server-src/taper-source-test.c, server-src/server_util.c,
+         server-src/taper-disk-port-source.c, perl/Amanda/Device.swg,
+         perl/amglue/integers.swg, restore-src/restore.c,
+         common-src/glib-util.c: Fix solaris compiler warning.
+
+2008-02-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (quote_string): Quote single quote (').
+       * server-src/find.c:Correctly compute length of diskname.
+
+2008-02-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/progs.m4 config/amanda/flags.m4:
+         use AC_PROG_EGREP instead of the Amanda version
+       * server-src/find.c: fix compiler warning on Solaris 8
+
+2008-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/rpm/amanda.spec: Fix typo.
+
+2008-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * oldrecover-src/Makefile.am: Build all files in the build directory.
+       * recover-src/Makefile.am: Build all files in the build directory.
+       * config/amanda/config.m4: Use $srcdir to buld common-src/svn-info.h
+       * configure.in: execute AMANDA_GET_SVN_INFO after AC_OUTPUT because
+         AC_OUTPUT create the common-src directory.
+
+2008-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c: Use 'long long' and '%lld' to sscanf.
+       * file server-src/infofile.c: Use %jd to print intmax_t value.
+       * file server-src/driver.c: Use 'long long' and '%lld' to sscanf.
+
+2008-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdump.sh: Don't use 'date -d', use sed.
+
+2008-02-13  Dan Locks <dwlocks@zmanda.com>
+        * packaging/rpm/amanda.spec: added a check for PKG_CONFIG_PATH in the
+          build environment as well as if provided on rpmbuild commandline.
+          Conditionalized this var to handle cross compiling on FC8.
+
+2008-02-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c: Fail if no header or no data.
+
+2008-02-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: Report failure if dumper succeed and
+                                 chunker failed.
+
+2008-02-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Add notes about rsh/ssh and amandad_path.
+
+2008-02-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.6.0b2 released.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b2")
+       * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b2
+       * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b2
+
+2008-02-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/amrecover.c: Use tapedev from server if it is not set
+                                  in amanda.client.conf
+       * example/amanda-client.conf.in: Document it.
+
+2008-02-07  Jean-Louis Martineau <martineau@zmanda.com>
+        * device-src/tape-device.c (tape_device_init): Init min_block_size
+          and fixed_block_size to 32768.
+
+2008-02-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/tape-posix.c (tape_is_ready): Don't use GMT_ONLINE.
+
+2008-02-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amcheckdump.8.xml: add -o option
+       * man/Makefile.am: build amcheckdump manpage
+       * server-src/amdevcheck.pl: tweak @ARGV parsing
+       * server-src/amcheckdump.pl installcheck/Installcheck/Run.pm
+         installcheck/amcheckdump.pl: significant rewrite to catch more errors
+         and not loop for ever on some errors.
+
+2008-02-01  Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec: added amdumpcheck.8.gz to the %files list
+         for both client and server, removed amplot from client, added missing
+         directory %{SYSCONFDIR}/amanda
+
+2008-01-29  Dan Locks <dwlocks@zmanda.com>
+       * packaging/rpm/amanda.spec: changed %{SYSCONFDIR} to %{LOCALSTATEDIR}
+         where amanda/amandates is concerned.  also added %{LOCALSTATEDIR} to
+         the %files list.
+
+2008-01-29  Dan Locks <dwlocks@zmanda.com>
+       * man/xml-src/*: added wiki.zmanda.com to "see also" section of all
+         man pages.
+
+2008-01-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup.c: Check for g_options.
+       * client-src/sendsize.c: Check for g_options.
+       * client-src/selfcheck.c: Check for g_options.
+       * amandad-src/amandad_util.c (free_g_options): Check g_options != NULL.
+
+2008-01-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: Fix "Use of uninitialized value in string".
+
+2008-01-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amanda_Config.pl common-src/conffile.c: uppercase
+         displayunit, and add a unit test to be sure.
+
+2008-01-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: handle lowercase displayunit.
+
+2008-01-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/ipv6.m4 common-src/amanda.h: check
+         for netinet/in.h and in_port_t, and define the latter if
+         necessary.  Thanks to Craig Dewick <cdewick@lios.apana.org.au>
+         for the suggestion.
+
+2008-01-28  Paddy Sreenivasan <paddy@zmanda.com>
+       * man/xml-source/amanda.8.xml: Update amanda(8) to reflect 2.6.0
+         status
+
+2008-01-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Send service stderr to amandad debug file,
+         Wait for service termination and send error message to server.
+
+2008-01-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/device.c: Set PROPERTY_BLOCK_SIZE with a G_TYPE_INT
+                              Set PROPERTY_READ_BUFFER_SIZE with a G_TYPE_UINT
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/Makefile.am man/xml-source/amcheckdump.8.xml: new manpage
+       * server-src/amcheckdump.pl: fix usage message
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/userid.m4: add --with-single-userid
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/amglue/amglue.h perl/amglue/bigint.c: Include integer limits
+         for all amglue files where they are missing from glib headers
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: condition installchecks on the selected
+         components
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am Makefile.am: distribute
+         installcheck/Installcheck scripts, make sure enough parameters
+         are passed along to distcheck for it to succeed, and also clean
+         up properly after tests are run.
+
+2008-01-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/dumpers.m4: eliminate strange warning when
+         --without-smbclient is given
+
+2008-01-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Makefile.am: Require user to specify
+         CLOBBER_MY_CONFIG=OK when running installchecks
+
+2008-01-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/rpm/amanda.spec: Don't set PKG_CONFIG_PATH.
+
+2008-01-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * oldrecover-src/extract_list.c, client-src/sendbackup.c,
+         client-src/sendsize.c, client-src/selfcheck.c,
+         recover-src/extract_list.c, server-src/changer.c,
+         server-src/amflush.c, server-src/driverio.c,
+         common-src/pipespawn.c: Call safe_fd before exec*.
+
+2008-01-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/rpm/amanda.spec: Remove build_host.
+
+2008-01-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Types.swg perl/Amanda/Config.swg perl/Amanda/Device.swg
+         perl/amglue/integers.swg: fix typos and compiler warnings
+
+2008-01-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * packaging/Makefile.am: New file.
+       * packaging/README: New file.
+       * packaging/rpm/buildpkg: New file.
+       * packaging/rpm/amanda.spec: New file.
+       * configure.in
+       * config/amanda/dirs.m4 (AMANDA_WITH_DUMPERDIR): Give a warning if used.
+       * config/amanda/dirs.m4 (AMANDA_EXPAND_DIRS): Expand DUMPER_DIR to
+                                        ${amlibexecdir}/application
+       * Makefile.am (SUBDIRS): Add packaging.
+       * amanda.spec: Remove file.
+
+2008-01-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/Makefile.am (AM_CFLAGS): Set to $(AMANDA_WARNING_CFLAGS)
+       * device-src/tape-device.c, device-src/tape-posix.c,
+         device-src/vfs-device.c: include "util.h"
+       * device-src/rait-device.c: fix compiler warning.
+
+2008-01-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/amglue/bigint.c: fix the range-checking mechanics for large
+         integers, since the precompiler seems to get confused by large
+         constants.
+
+2008-01-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/krb5-security.m4: abort configure run if krb5
+         is requested by libraries aren't found
+
+2008-01-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: use &#215; instead of &times;
+
+2008-01-11  Paddy Sreenivasan <paddy@zmanda.com>
+       * device-src/Makefile.am: Don't install queueing.h and device.h
+
+2008-01-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Config.swg perl/Amanda/Debug.swg: complete documentation
+
+2008-01-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/Makefile.am: Install amandad in $libexecdir/amanda
+       * installcheck/amgetconf.pl: usetimestamps defaults to yes.
+       * NEWS, ReleaseNotes: Notes about make installcheck.
+
+2008-01-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS: Add amcryptsimple, amgpgcrypt, amserverconfig and amaddclient.
+       * ReleaseNotes: Ditto.
+
+2008-01-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * ReleaseNotes: Update for amanda-2.6.0
+       * News: Update for amanda-2.6.0
+       * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b1")
+       * Makefile.am (pkgdata_DATA): Add NEWS, ChangeLog and amanda.spec
+       * amanda.spec: %{!?amanda_version: %define amanda_version 2.6.0b1}
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (usetimestamps): Default ot yes.
+       * man/xml-source/amanda.conf.5.xml (usetimestamps): Document it.
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amverifyrun.sh, server-src/amverify.sh,
+         tape-src/ammt.c, tape-src/amdd.c: Write deprecated message.
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/defaults.m4: Set amandates to $localstatedir/amanda/amandate
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amfreetapes.sh: Use amlibexecdir.
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/dirs.m4: Set amlibexecdir to $libexecdir/amanda.
+       * amandad-src/amandad.c, amplot/amplot.sh,
+         amplot/Makefile.am, changer-src/chg-chs.sh,
+         changer-src/chg-disk.sh, changer-src/chg-juke.sh,
+         changer-src/chg-lib.sh.in, changer-src/chg-manual.sh,
+         changer-src/chg-mcutil.sh, changer-src/chg-mtx.sh,
+         changer-src/chg-multi.sh, changer-src/chg-null.sh,
+         changer-src/chg-rait.sh, changer-src/chg-rth.pl,
+         changer-src/chg-zd-mtx.sh, changer-src/Makefile.am,
+         client-src/Makefile.am, client-src/patch-system.sh,
+         client-src/selfcheck.c, client-src/sendbackup-dump.c,
+         client-src/sendbackup-gnutar.c, client-src/sendsize.c,
+         common-src/amaespipe.sh, common-src/amanda-sh-lib.sh.in,
+         common-src/amcrypt-ossl-asym.sh, common-src/amcrypt-ossl.sh,
+         common-src/amcrypt.sh, common-src/genversion.c,
+         common-src/local-security.c, common-src/Makefile.am,
+         common-src/rsh-security.c, common-src/ssh-security.c,
+         dumper-src/amgtar.pl, example/xinetd.amandaclient,
+         example/xinetd.amandaserver, installcheck/amgetconf.pl,
+         perl/Amanda/Changer.pm, perl/Amanda/Paths.pm.in,
+         restore-src/Makefile.am, server-src/amcheck.c,
+         server-src/amcheckdb.sh, server-src/amcleanup.sh,
+         server-src/amdump.sh, server-src/amflush.c,
+         server-src/amoverview.pl, server-src/amrmtape.sh,
+         server-src/amverifyrun.sh, server-src/amverify.sh,
+         server-src/changer.c, server-src/driver.c,
+         server-src/getconf.c, server-src/Makefile.am,
+         tape-src/Makefile.am: Use amlibexecdir.
+
+2008-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/flags.m4 (AMANDA_STATIC_FLAGS):
+         Set AMANDA_STATIC_LDFLAGS to '-static' if set.
+       * configure.in: Call AMANDA_STATIC_FLAGS.
+       * amandad-src/Makefile.am, changer-src/Makefile.am,
+         client-src/Makefile.am, common-src/Makefile.am,
+         dumper-src/Makefile.am, oldrecover-src/Makefile.am,
+         recover-src/Makefile.am, restore-src/Makefile.am,
+         server-src/Makefile.am,
+         tape-src/Makefile.am(AM_LDFLAGS): Set to AMANDA_STATIC_LDFLAGS.
+
+2008-01-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in (AC_CONFIG_FILES): Add example/template.d/amanda-S3.conf
+       * example/Makefile.am (dist_template_DATA): Add
+                                                   template.d/amanda-S3.conf
+
+2008-01-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/scsi-solaris.c: Cleanup.
+
+2008-01-09  Ian Turner <ian@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: Don't write a corrupt changerfile
+         when a tape has no barcode label.
+
+2008-01-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheckdump.pl: call critical() rather than
+         using die().
+
+2008-01-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheckdump.pl: Parse 'amflush: starttime' and
+                                    'planner: timestamp' line.
+       * server-src/amflush.c: Print correct starttime line.
+
+2008-01-08  Ian Turner <ian@zmanda.com>
+       Most of this work was done by Dustin J. Mitchell
+       <dustin@zmanda.com>, with contributions by Ian Turner <ian@zmanda.com>.
+       * example/template.d/amanda-S3.conf.in: Example configuration
+         using Amazon S3.
+       * device-src/device.c: Register the S3 device.
+       * device-src/tests/get-activation-key.pl: Tool to retrieve 
+         a DevPay activation key.
+       * device-src/s3-device.c, device-src/s3-device.h: S3 device driver.
+       * device-src/s3.c, device-src/s3.h: Network support for S3 driver.
+       * device-src/property.c, device-src/property.h: Register S3
+         authentication properties.
+       * device-src/activate-devpay.c: Tool to convert a devpay 
+         activation key into user tokens.
+       * device-src/Makefile.am: Support all these new files.
+       * configure.in: Check S3 prerequesites.
+       * config/amanda/s3-device.m4: Check if the S3 device should be
+         built.
+       * config/amanda/libs.m4: Code to check for libcurl version and
+         features.
+       * common-src/util.c: Use libcurl header.
+
+2008-01-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheckdump.pl: call critical() rather than
+         using die().
+
+2008-01-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/local-security.c: New 'local' security driver.
+       * common-src/security.c (drivers): Add local_security_driver
+       * common-src/Makefile.am (libamanda_la_SOURCES): Add local-security.c
+       * man/xml-source/amanda.conf.5.xml,
+         man/xml-source/amanda-client.conf.5.xml,
+         example/amanda-client.conf.in,
+         example/template.d/dumptypes: Document 'local' security driver.
+
+2008-01-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheckdump.pl perl/Amanda/Util.swg: don't use
+         the C safe_fd, which kills the Perl debugger; just check
+         that fd's 0-2 are open
+
+2008-01-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Types.swg perl/Makefile.am: add new Amanda::Types module
+       to contain data structures common to several other modules.
+       * perl/Amanda/Device.swg: move dumpfile_t to Amanda::Types
+       * installcheck/Amanda_Types.pl installcheck/Makefile.am: simple tests
+         for the new module
+       * common-src/fileheader.c common-src/fileheader.h: build_header
+         now takes a precise size, not a minimum.
+
+2008-01-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/amrecover.c: Call apply_config_overwrites before
+                                  config_init(CONFIG_INIT_EXPLICIT_NAME ...)
+
+2008-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (strquotedstr, hexdump): Remove function.
+       * common-src/util.h (strquotedstr, hexdump): Remove prototype.
+       * common-src/fileheader.c (strquotedstr, hexdump): Add function.
+       * common-src/fileheader.c (strquotedstr): Fix.
+
+2008-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: Use Amanda::Config::get_config_dir().
+
+2008-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/automake/scripts.am: Don't set CHECK_PERL.
+       * changer-src/Makefile.am: Set CHECK_PERL.
+       * client-src/Makefile.am: Set CHECK_PERL.
+       * dumper-src/Makefile.am: Set CHECK_PERL.
+       * common-src/Makefile.am: Set CHECK_PERL.
+
+2008-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Fix argument to resolve_hostname.
+       * config/amanda/krb4-security.m4: Check .a or .so lib.
+       * config/amanda/krb5-security.m4: Check .a or .so lib.
+
+2008-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/Makefile.am: Merge typo.
+       * example/Makefile.am: Merge Typo.
+
+2007-12-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/printf.m4: remove unused
+         configure checks
+
+2007-12-27  Paddy Sreenivasan <paddy@zmanda.com>
+       * server-src/reporter.c: Check for NULL mailto
+
+2007-12-27  Satya Ganga <gsat@zmanda.com>
+       * server-src/amserverconfig.pl: holding disk will be created
+         only if we have at least 1G free space in the Amanda home dir
+
+2007-12-27  Ian Turner <ian@zmanda.com>
+       * server-src/taperscan.c server-src/taper.c: only print error_message
+         if it is non-NULL
+
+2007-12-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amrmtape.sh: remove @DB_EXT@, which no longer
+         exists (since 2007-10-09).
+
+2007-12-26  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amverify.sh: fix multiple non-portable shell
+         techniques
+
+2007-12-23  Dustin J. Mitchell <dustin@zmanda.com>
+       Large-scale merge of perl interface to Amanda, along with
+       a fleet of related changes.  Patch authors are given for
+       changes not made by Dustin.
+
+       * perl/Makefile.am config/amanda/swig.m4: use
+         ExtUtils::Embed::perl_inc() to get the include directory
+         and let Amanda's compiler/linker flags and libtool take
+         care of the rest
+       * perl/Amanda/Config.swg: use accessors for config_name, 
+         config_filename, and config_dir 
+       * server-src/amcheckdump.pl server-src/amdevcheck.pl
+         perl/Amanda/Util.swg installcheck/Amanda_Config.pl: use
+         new accessors
+       * perl/Amanda/Util.swg common-src/amanda.h: use a .-relative
+         path in two #include directives to avoid accidentally 
+         including perl's headers of the same name; this is a temporary
+         hack until a larger-scale overhaul of Amanda's headers is done.
+       * config/amanda/swig.m4: error out if shared libraries are disabled
+       * server-src/amcheckdump.pl: Use timestamp from latest
+         amdump.1 or amflush.1 log file.  (Jean-Louis Martineau
+         <martineau@zmanda.com>)
+       * server-src/amcheckdump.pl: Output partnum.  (Jean-Louis
+         Martineau <martineau@zmanda.com>)
+       * server-src/amcheckdump.pl: Add a '/' after the config name.
+       (Jean-Louis Martineau <martineau@zmanda.com>)
+       * perl/Amanda/Logfile.swg perl/Amanda/Device.swg perl/Makefile.am
+         perl/amglue/integers.swg perl/amglue/amglue.h
+         perl/amglue/amglue.swg perl/amglue/glib.swg
+         perl/amglue/bigint.c: Always use Math::BigInt to convert numeric 
+         quantities from C to Perl, to avoid integer overflow and automatic
+         promotion to double.
+       * perl/Amanda/Debug.swg client-src/versionsuffix.c
+         common-src/util.c common-src/util.h common-src/debug.c
+         common-src/debug.h common-src/conffile.c
+         common-src/conffile.h common-src/file.c common-src/file.h:
+         - move get_/set_pname to util.c
+         - rename RunningAsWho to running_as_flags
+         - cache original cwd before changing it in safe_cd, and use the
+           cached value in conffile
+       * server-src/logfile.c: call set_logerror in open_log
+       * client-src/runtar.c common-src/debug.c common-src/amanda.h
+         common-src/file.c common-src/file.h: replace client_uid,
+         client_gid globals with functions, to eliminate the need
+         for initialization
+       * server-src/logfile.c: Update warning about globals
+       * server-src/find.c: Update search_logfile to possibly search
+         all tapes in a logfile. Also, other miscellaneous
+         refactoring.  (Ian Turner <ian@zmanda.com>)
+       * server-src/find.h: Document new interface.
+       * server-src/amindexd.c, server-src/amadmin.c,
+         server-src/amtrmidx.c, restore-src/amfetchdump.c: Use new
+         find_dump interface.
+       * common-src/util.c, common-src/util.h: New function
+         compare_possibly_null_strings, which is like strcmp() but
+         orders NULL pointers before non-null strings.
+       * Makefile.am: reflect BINARY_OWNER into distcheck-triggered
+         ./configure
+       * common-src/conffile.c common-src/conffile.h: completely
+         new API, almost complete rewrite
+       * common-src/columnar.c common-src/columnar.h
+         common-src/Makefile.am: new files, extracted from
+         conffile.[ch]
+       * oldrecover-src/amrecover.c oldrecover-src/extract_list.c
+         changer-src/chg-scsi-chio.c changer-src/chg-scsi.c
+         client-src/sendbackup.c client-src/sendsize.c
+         client-src/selfcheck.c amandad-src/amandad.c
+         device-src/device.c recover-src/amrecover.c
+         recover-src/extract_list.c server-src/diskfile.h
+         server-src/logfile.c server-src/amlogroll.c
+         server-src/amindexd.c server-src/amcheck.c
+         server-src/dumper.c server-src/planner.c
+         server-src/chunker.c server-src/amadmin.c
+         server-src/amtape.c server-src/amcleanupdisk.c
+         server-src/getconf.c server-src/amflush.c
+         server-src/amtrmlog.c server-src/driverio.c
+         server-src/holding.c server-src/driverio.h
+         server-src/driver.c server-src/reporter.c server-src/taper.c
+         server-src/find.c server-src/amindex.c server-src/amtrmidx.c
+         server-src/diskfile.c server-src/amlabel.c
+         perl/Amanda/Config.swg config/amanda/defaults.m4
+         restore-src/amidxtaped.c restore-src/amrestore.c
+         restore-src/restore.c restore-src/amfetchdump.c
+         common-src/util.h common-src/glib-util.c tape-src/tapeio.c
+         common-src/amanda.h tape-src/tapeio.h: use new conffile API
+       * installcheck/Makefile.am installcheck/Amconfig.pm.in
+         installcheck/Installdirs.pm.in installcheck/Amanda_Config.pl
+         installcheck/Amanda_Changer.pl installcheck/Amanda_Cmdline.pl
+         installcheck/Amanda_Logfile.pl installcheck/amcheckdump.pl
+         installcheck/amdevcheck.pl installcheck/amgetconf.pl:
+         new unit tests for new modules, applications
+       * server-src/amdevcheck.pl server-src/amcheckdump.pl: new pure-
+         Perl applications; amcheckdump.pl is by Ian Turner
+         <ian@zmanda.com>
+       * perl/Amanda perl/Makefile.am perl/Amanda/Paths.pm.in
+         perl/Amanda/Logfile.swg perl/Amanda/Changer.pm
+         perl/Amanda/Config.swg perl/Amanda/Debug.swg
+         perl/Amanda/Tapefile.swg perl/Amanda/Cmdline.swg
+         perl/Amanda/Util.swg perl/Amanda/Device.swg: new directory
+         containing perl interfaces to Amanda modules
+       * perl/amglue perl/amglue/integers.swg perl/amglue/amglue.h
+         perl/amglue/exports.swg perl/amglue/ghashtable.c
+         perl/amglue/amglue.swg perl/amglue/constants.swg
+         perl/amglue/glib.swg perl/amglue/bigint.c: functions and
+         macros to glue Amanda to perl
+
+2007-12-21  Satya Ganga <gsat@zmanda.com>
+       * server-src/amserverconfig.pl: correct holding disk size
+         validation logic so that it works on solaris too
+
+2007-12-21  Satya Ganga <gsat@zmanda.com>
+       * server-src/amserverconfig.pl: amserverconfig needs to create a empty
+         changer.conf file
+
+2007-12-21  Jean-Louis Martineau <martineau@zmanda.com>
+       Bug reported by Tim Bunnell.
+       * client-src/getfsent.c (dev2rdev): Do it only for block device.
+
+2007-12-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: Unquote holding_disk_file.
+
+2007-12-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/debug.h: fix (cosmetic, but confusing) typo
+
+2007-12-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (quote_string): Quote ':'.
+
+2007-12-19  Ian Turner <ian@zmanda.com>
+       * server-src/taper.c: Don't crash if there is a problem writing a
+         brand new tape.
+
+2007-12-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Correctly set planner_timestamp if
+                               usetimestamps is set to no.
+
+2007-12-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driverio.c (childstr): Check dumper->chunker.
+
+2007-12-14  Ian Turner <ian@zmanda.com>
+       * device-src/tape-device.c: Try to open tape devices as O_NONBLOCK
+         at first; if the device is not ready, we will let the changer script
+         retry, instead of having the kernel do it for us.
+       * device-src/tape-ops.h, device-src/tape-aix.c,
+         device-src/tape-uware.c, device-src/tape-xenix.c,
+         device-src/tape-posix.c: Add new tape_is_ready() function.
+
+2007-12-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/dumpers.m4: Don't set STAR in AMANDA_PROG_SAMBA_CLIENT.
+
+2007-12-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c (search_logfile): Parse taper result line before
+                                             merging part_find.
+
+2007-12-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c (find_log): Result should not have duplicate
+                                       logfile.
+
+2007-12-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: Parse NEW-TAPE line
+       * server-src/taper.c: Add the handle in NEW-TAPE result.
+       * server-src/driver.c: Check number of arguments in NEW-TAPE result.
+
+2007-12-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/progs.m4: Define AMLINT To 'echo;false' to no lint
+                                 are found.
+
+2007-12-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsdudp-security.c: Loop over all address until a bind
+                                       is successful.
+       * common-src/bsd-security.c: Loop over all address until a bind
+                                    is successful.
+       * common-src/stream.c: Loop over all address until a connect is
+                              successful.
+
+2007-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amindexd.c: Don't use duplicate part.
+
+2007-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * restore-src/amfetchdump.c: Don't use duplicate part.
+
+2007-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/holding.c (holding_get_all_datestamps): Don't add
+         duplicate datestamp.
+
+2007-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Don't complain about correct unlabeled
+                               volumes.
+
+2007-12-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup.c, client-src/sendsize.c,
+         client-src/selfcheck.c, client-src/calcsize.c,
+         amandad-src/amandad.c, device-src/device.c,
+         device-src/vfs-device.c, server-src/changer.c,
+         server-src/dumper.c, server-src/planner.c,
+         server-src/chunker.c, server-src/server_util.c,
+         server-src/taperscan.c, server-src/driver.c,
+         server-src/taper.c, server-src/find.c,
+         server-src/diskfile.c, common-src/pipespawn.c,
+         common-src/util.c, common-src/conffile.c: Fix memory leak.
+
+2007-12-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c (search_logfile): Parse PARTPARTIAL line.
+
+2007-12-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: Use g_strdup if pointer can be NULL.
+
+2007-12-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taperscan.c: Don't output the latest changer result.
+
+2007-12-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (resolve_hostname): Take a new socktype argument.
+       * common-src/util.h (resolve_hostname): New prototype.
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/krb5-security.c,
+         common-src/rsh-security.c, common-src/security-util.c,
+         common-src/ssh-security.c, common-src/stream.c,
+         recover-src/set_commands.c, server-src/amcheck.c,
+         server-src/dumper.c: Call resolve_hostname with socktype argument.
+
+2007-12-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (resolve_hostname): Don't return V4MAPPED address.
+       * common-src/amanda.h (AI_V4MAPPED, AI_ALL): Don't define.
+
+2007-12-04  Ian Turner <ian@zmanda.com>
+       * server-src/taperscan.c, server-src/taperscan.h: Support persistence
+         between invocations of taper_scan(), so that you can get second-best
+         and further tapes.
+       * server-src/amcheck.c, server-src/amtape.c: Use the new taperscan 
+         interface.
+       * server-src/taper.c: Do the right thing if there is an error writing
+         the tape label.
+
+2007-12-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amtape.c: Correctly output the result of taper scan.
+
+2007-12-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c, server-src/dumper.c
+         server-src/planner.c: Don't crash is securoty driver is not found.
+
+2007-12-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/changer.c: Print better message if the changer script
+                               has no output.
+
+2007-12-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amserverconfig.8.xml: Fix indentation.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper-mem-port-source.c, server-src/taper-file-source.c
+         server-src/taper.c: Cast guint64 to uintmax_t and use %ju to print.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: Improve documentation.
+       * example/amanda.conf.in: Ditto.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/server_util.c (cmdstr): Remove SPLIT-NEEDNEXT
+                                            and SPLIT-CONTINUE
+       * server-src/server_util.h (cmd_t): Remove SPLIT_NEEDNEXT
+                                           and SPLIT_CONTINUE.
+       * server-src/taper.c: Send part_kbyte in PARTDONE result.
+       * server-src/amstatus.pl: Parse part_kbyte in PARTDONE result line.
+                                 Parse REQUEST-NEW_TAPE line.
+       * common-src/conffile.h: CONF_FLUSH_THRESHOLD_DUMPED,
+                               CONF_FLUSH_THRESHOLD_SCHEDULE, CONF_TAPERFLUSH.
+       * common-src/conffile.c: CNF_FLUSH_THRESHOLD_DUMPED,
+                                CNF_FLUSH_THRESHOLD_SCHEDULE, CNF_TAPERFLUSH.
+       * server-src/driverio.h: Add Many globals.
+       * server-src/driver.c: Split runq in runq and directq.
+                              Implement flush-threshold-*/taperflush.
+       * example/amanda.conf.in: Example for flush-threshold-* and taperflush.
+       * man/xml-source/amanda.conf.5.xml: Document flush-threshold-*
+                                          and taperflush.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taperscan.c: Fix output formating.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/set_commands.c: Add a terminating '/' in cd_regex.
+                                     Never add it in cd_dir.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/automake/scripts.am: Build of the scripts also depend on
+                                     $(top_builddir)/config.status
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdump.sh: Pass a --startime argument to planner.
+       * server-src/planner.c: Get the --starttime command line argument.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: New --locale-independent-date-format option.
+       * man/xml-source/amstatus.8.xml: Document it.
+       * server-src/amflush.c: Output a "starttime-locale-independent" line.
+       * server-src/amdump.sh: Output a "starttime-locale-independent" line.
+
+2007-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Remove seen_chunk_of function.
+
+2007-11-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/macro-archive/docbook-dtd.m4: Check return code of 5.
+
+2007-11-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * installcheck/Amconfig.pm.in: fix quoting error leading to
+       directories named '"'
+
+2007-11-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/file.c: only chown new directories when running as root
+
+2007-11-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/automake/installperms.am: strip directory names from build
+         filenames when setting permissions; fixes errors from examples/
+         install
+
+2007-11-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/Makefile.am: Allow installs, but not tarballs, without
+         manpages
+
+2007-11-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Check dp->todo before using (est)->dp.
+
+2007-11-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/device.c (default_device_start): Overwrite label only
+                                                     if mode == ACCESS_WRITE.
+
+2007-11-20  Ian Turner <ian@zmanda.com>
+       * device-src/device.c, device-src/device.h
+         device-src/tape-device.c, device-src/rait-device.c: Change API
+         semantics with respect to label reading. This patch makes it
+         possible to open and read a volume with properties while only
+         reading its label once. Thanks to Jean-Louis Martineau
+         <martineau@zmanda.com> for suggesting this change.
+
+2007-11-20  Ian Turner <ian@zmanda.com>
+       * device-src/vfs-device.c: Be more thourough about updating volume
+         usage statistics.
+
+2007-11-20  Ian Turner <ian@zmanda.com>
+       * changer-src/chg-lib.sh.in: Use a more robust check for MT path.
+       * server-src/amverify.sh.in: Use amrestore instead of amdd/ammt.
+
+2007-11-09  Ian Turner <ian@zmanda.com>
+       * server-src/taperscan.c: Fix a memory allocation bug and be a little
+         more paranoid.
+
+2007-11-06  Ian Turner <ian@zmada.com>
+       * server-src/taperscan.c: Print a proper message if there is
+         only one flag from device_read_label().
+
+2007-11-26  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in config/amanda/config.m4 common-src/genversion.c
+         common-src/Makefile.am: explicitly generate svn info at configure
+         time, rather than relying on svn keywords
+
+2007-11-26  Ian Turner <ian@zmanda.com>
+       * server-src/Makefile.am: Move amdevcheck from libexec/ to sbin/.
+         Thanks to Satya Ganga <gsat@zmanda.com> for noticing this problem.
+       
+2007-11-26  John Franks <jrfranks@zmanda.com>
+       * common-src/debug.c    For cygwin builds: change to
+         close and reopen log file handle on successful rename.
+         This is to ensure that Windows has no possibility of
+         preventing access to the original file name if processes
+         collide.
+               
+2007-11-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amflush.c: Send config option (-o) to child process.
+
+2007-11-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Don't set est(dp)->state before testing it.
+
+2007-11-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/readline.m4: Include termcap, curses or ncurese in LIBS.
+
+2007-11-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/diskfile.c (match_disklist): Fix for disk not found.
+
+2007-11-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Don't release taper_ev_read in
+                               start_degraded_mode.
+
+2007-11-20  Paddy Sreenivasan <paddy@zmanda.com>
+        * amanda.spec: Added calls to Zmanda
+       * example/amanda-client.conf.in: Switch to bsdtcp
+
+2007-11-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl: Handle taper FAILED message.
+
+2007-11-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/userid.m4: Use $enableval in AC_ARG_ENABLE.
+
+2007-11-07  Paddy Sreenivasan <paddy@zmanda.com>
+       * server-src/amserverconfig.pl server-src/amaddclient.pl: 
+          new configuration tools
+       * common-src/amgpgcrypt.pl common-src/amcryptsimple.pl: 
+          new encryption plugins
+       * man/xml-source/amaddclient.8.xml man/xml-source/amgpgcrypt.8.xml 
+          man/xml-source/amcryptsimple.8.xml 
+         man/xml-source/amserverconfig.8.xml: man pages for new tools
+       * example/template.d/* - Configuration file templates
+       * example/amanda-client.conf.in: Updated amanda configuration file
+       * example/Makefile.am man/Makefile.am server-src/Makefile.am
+          common-src/Makefile.am: Added amserverconfig, amaddclient, 
+          amgpgcrypt and amcryptsimple
+       * device-src/Makefile.am: Fixed libamdevice version
+       * configure.in: Added template files
+        * amanda.spec: Updated spec file for new utilities
+
+2007-11-01  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/automake/installperms.am: new method of specifying
+         permissions on installed files
+       * config/amanda/userid.m4 configure.in: add --disable-installperms
+         to disable any permsisions settings (useful for packaging builds)
+       * oldrecover-src/Makefile.am example/Makefile.am
+         changer-src/Makefile.am amplot/Makefile.am
+         client-src/Makefile.am amandad-src/Makefile.am man/Makefile.am
+         dumper-src/Makefile.am recover-src/Makefile.am
+         server-src/Makefile.am restore-src/Makefile.am
+         Makefile.am support/Makefile.am common-src/Makefile.am
+         tape-src/Makefile.am: use installperms.am
+
+2007-11-01  Dustin J. Mitchell <dustin@zmanda.com>
+       Suggested by Jon LaBadie
+       * config/automake/precompile.am: new rule to make
+         precompiler output files; useful for debugging
+       * */Makefile.am: include precompile.am
+
+2007-11-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * AUTHORS: Add Dustin J. Mitchell.
+
+2007-10-31  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * most C files, amanda.h: Switch to using the g_printf family, which
+         supports a consistent set of %-conversions, including the 'z'
+         (size_t) and 'j' (intmax_t) size specifiers.  Convert various
+         printf format strings accordingly.
+
+2007-10-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/genversion.c common-src/Makefile.am: fix BUILD_REV
+         and BUILD_BRANCH to work even when packages are built from
+         distribution tarballs
+
+2007-10-31  Ian Turner <ian@zmanda.com>
+       * server-src/taperscan.c: Don't segfault if there is an error opening
+         a device during taperscan.
+
+2007-10-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * docs autogen INSTALL UPGRADING configure.in 
+         DEVELOPING Makefile.am: remove docs/ directory in favor of
+         manpages and online reference; most docs/* were outdated
+
+2007-10-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh: fix typo
+
+2007-10-29  Ian Turner <ian@zmanda.com>
+       * restore-src/restore.c: Don't mention slot numbers when running
+         without a changer.
+
+2007-10-29  Ian Turner <ian@zmanda.com>
+       * man/xml-source/amfetchdump.8.xml: Remove documentation for
+         amfetchdump -i.
+
+2007-10-26  Dustin J. Mitchell <dustin@zmanda.com>
+       Add support for post-install tests, which can be more thorough than
+       unit tests.
+       * configure.in Makefile.am installcheck/*: new directory
+       * installcheck/amgetconf.pl: test some of amgetconf's functionality
+       * docs/developing.txt: notes on various test mechanisms
+       * config/automake/scripts.am: add CHECK_PERL_FLAGS
+       * common-src/debug.c: only try to chown debug files if running as root
+
+2007-10-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/mkinstalldirs config/depcomp config/config.guess
+         config/ltmain.sh config/config.sub config/missing
+         config/install-sh config/ylwrap: update files with automake-1.10, 
+         libtool-1.5.24
+       * autogen: don't call automake with --add-missing, as it stomps all
+         over the working copy
+
+2007-10-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/* config/*: updated to latest gnulib
+       * gnulib/regenerate/regenerate: update gnulib date
+       * gnulib/regenerate/getaddrinfo-cygwin.patch: update to patch new
+         getaddrinfo.c
+       * device-src/tests/vfs_test.c: mkdtemp.h no longer exists
+
+2007-10-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/Makefile.am: Remove duplicate entry for
+                                 libamclient_la_SOURCES.
+
+2007-10-23  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/automake/scripts.am: rules to build (substitute) scripts
+       * config/automake/vars.am: define empty variables for later appending
+       * config/automake/check-perl.am config/automake/check-shell.pm:
+         removed
+       * changer-src/Makefile.am amplot/Makefile.am client-src/Makefile.am
+         dumper-src/Makefile.am server-src/Makefile.am 
+         common-src/Makefile.am: Use new include files
+       * configure.in: remove now-unnecessary AC_CONFIG_FILES
+       * *.sh.in *.pl.in *.awk.in: renamed
+
+2007-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Always call sort_disks.
+
+2007-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: Correctly document portrange.
+       * common-src/conffile.c: Fix portrange.
+
+2007-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Allow reserved-udp-port and reserved-tcp-port
+                                in amanda-client.conf.
+
+2007-10-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h: remove amflock cruft
+
+2007-10-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/defaults.m4: Change EXAMPLE_TAPEDEV to use the 'tape:'
+       syntax, and to indicate "you need to change this!" more explicitly
+
+2007-10-16  Ian Turner <ian@zmanda.com>
+       * common-src/glib-util.c: Allow use of units in parsing GValues; in
+         particular, this allows use of units when specifying device
+         properties in the configuration file.
+       * common-src/conffile.c, common-src/conffile.h: Make unit suffixes
+         available outside of conffile.c.
+
+2007-10-16  Ian Turner <ian@zmanda.com>
+       * device-src/device.c: Fix a compilation error in
+         device_set_startup_properties_from_config().
+
+2007-10-16  Ian Turner <ian@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml, server-src/taper.c,
+         common-src/conffile.c, common-src/conffile.h: Add new
+         configuration directive device_output_buffer_size to replace
+         tapebufs.
+
+2007-10-15  Ian Turner <ian@zmanda.com>
+       * device-src/device.c: Don't complain about problems setting
+         MAX_VOLUME_USAGE; do complain about problems setting
+         READ_BUFFER_SIZE.
+
+2007-10-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup-gnutar.c: Use GNUTAR.
+
+2007-10-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/device.c: do not fall back to tape:/foo if the tape
+         device is not available (WANT_TAPE_DEVICE is not set)
+
+2007-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-mtx.sh.in changer-src/chg-zd-mtx.sh.in
+         changer-src/chg-multi.sh.in: add missing definition of prefix
+
+2007-10-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/protocol.c (s_repwait): return PA_FINISH on P_NAK.
+
+2007-10-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/amanda/tape.m4: fix typo (have_MTIOCTOP -> HAVE_MTIOCTOP)
+
+2007-10-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amflock-test.c common-src/amflock-lnlock.c: don't use
+         AMANDA_TMPDIR during build-time testing
+
+2007-09-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * recover-src/uscan.l recover-src/extract_list.c 
+         recover-src/uparse.y recover-src/amrecover.h 
+         recover-src/help.c recover-src/set_commands.c: deprecate
+         'settape', add 'setdevice'
+       * man/xml-source/amrecover.8.xml: corresponding doc update
+       * example/amanda.conf.in: update comments in example config, 
+         change default value of amrecover_changer from the confusing
+         "/dev/null"
+
+2007-10-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amflock-test.c: lock files in the cwd, rather than /tmp,
+         and pay attention to errors from unlink()
+
+2007-10-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/regenerate/regenerate gnulib/mkdtemp.c gnulib/mkdtemp.h
+         gnulib/gettimeofday.c gnulib/sys_time_.h gnulib/tempname.c
+         gnulib/tempname.h gnulib/stat_.h gnulib/Makefile.am
+         device-src/tests/vfs_test.c config/gnulib/mkdtemp.m4
+         config/gnulib/sys_time_h.m4 config/gnulib/tempname.m4
+         config/gnulib/gnulib-comp.m4 config/gnulib/sys_stat_h.m4
+         config/gnulib/gnulib-cache.m4 config/gnulib/gettimeofday.m4:
+         add 'mkdtemp' gnulib module, use it in vfs_test.c
+
+2007-10-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (portable_readdir): Don't use reentrant function.
+
+2007-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * autogen configure.in config/macro-archive/*.m4
+         config/amanda/*.m4 config/libtool/*.m4: move most autoconf
+         checks to macros in .m4 files.  Hilights of changes along the way:
+         - use AC_REQUIRES to enforce check ordering
+         - Add a post-configure summary of important results
+         - use AM_CONDITIONAL to control conditional compilation of whole
+           files, instead of preprocessor macros
+         - correct spelling of PRINCIPLE -> PRINCIPAL
+         - remove support for dbmalloc (we use valgrind, coverity, etc. now)
+         - remove support for infofiles in anything but text format
+         - change DONT_SUID_ROOT to !WANT_SETUID_ROOT
+         - remove unused --with-broken-fsf
+         - remove multiple unused function and header checks, the defines
+           from which do not appear in any source file
+         - remove LTLIBOBJS cruft based on
+           http://www.delorie.com/gnu/docs/autoconf/autoconf_165.html
+         - remove unused LTALLOCA definition based on
+           http://www.delorie.com/gnu/docs/libtool/libtool_30.html
+         - use autoconf macro archive's
+           AC_DEFINE_DIR to expand $prefix, etc. in directory variables
+         - do not *require* --with-{user,group}; this allows 'make distcheck'
+           to run successfully
+       * docs/developing.txt: describe how to update gnulib, libtool, and
+         gettext
+       * po/reautopoint.patch po/reautopoint: script to update gettext,
+         parallel to gnulib/regenerate/regenerate
+       * amandad-src/amandad.c changer-src/scsi-aix.c
+         changer-src/scsi-bsd.c changer-src/scsi-cam.c
+         changer-src/scsi-changer-driver.c changer-src/scsi-chio.c
+         changer-src/scsi-hpux.c changer-src/scsi-hpux_new.c
+         changer-src/scsi-irix.c changer-src/scsi-linux.c
+         changer-src/scsi-proto.c changer-src/scsi-solaris.c
+         changer-src/sense.c client-src/calcsize.c client-src/getfsent.c
+         client-src/selfcheck.c client-src/sendbackup.c
+         client-src/sendsize.c common-src/alloc.c common-src/amanda.h
+         common-src/conffile.c common-src/debug.c common-src/file.c
+         common-src/genversion.c common-src/krb4-security.c
+         common-src/writev.c device-src/tape-posix.c server-src/amadmin.c
+         server-src/amcheck.c server-src/amlabel.c server-src/amlogroll.c
+         server-src/amtape.c server-src/amtrmidx.c server-src/amtrmlog.c
+         server-src/changer.c server-src/chunker.c server-src/diskfile.c
+         server-src/driver.c server-src/dumper.c server-src/getconf.c
+         server-src/infofile.c server-src/infofile.h server-src/planner.c
+         server-src/reporter.c tape-src/output-tape.c: changes corresponding
+         to simplifications and fixes in autoconf
+       * gnulib/regenerate/no-error.patch gnulib/regenerate/regenerate: no
+         need to create gnulib.m4i anymore
+
+2007-10-08  Kevin Till <ktill@zmanda.com>  (merged by dustin@zmanda.com)
+       * example/amanda.conf.in: add segate LTO tapetype
+
+2007-10-08  Paddy Sreenivasan <paddy@zmanda.com>
+       * changer-src/chg-lib.sh.in
+         changer-src/chg-null.sh.in changer-src/chg-disk.sh.in
+         changer-src/chg-juke.sh.in changer-src/chg-rait.sh.in
+         changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in
+         amplot/amplot.sh.in client-src/patch-system.sh.in
+         server-src/amcheckdb.sh.in server-src/amverifyrun.sh.in
+         server-src/amrmtape.sh.in server-src/amverify.sh.in
+         server-src/amfreetapes.sh.in server-src/amcleanup.sh.in
+         server-src/amdump.sh.in common-src/amanda-sh-lib.sh.in
+         common-src/amcrypt-ossl-asym.sh.in common-src/amcrypt.sh.in
+         common-src/amaespipe.sh.in common-src/Makefile.am
+         common-src/amcrypt-ossl.sh.in: move amanda-sh-lib.sh from
+         $libexecdir/amanda to just $libexecdir
+
+2007-10-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tests/Makefile.am device-src/tests/vfs_test.c: add a test
+         for the vfs device
+       * device-src/property.c device-src/vfs-device.c: add
+         PROPERTY_FREE_SPACE
+
+2007-10-04  Dan Locks <dwlocks@zmanda.com>
+       * amanda.spec: add .spec file Zmanda uses for community builds
+       
+2007-10-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/device.c device-src/Makefile.am configure.in: add
+         WANT_TAPE_DEVICE conditional, for machines that have no tape
+         support whatsoever (Mac OS X)
+
+2007-10-03  Dan Locks <dwlocks@zmanda.com>
+       * configure.in: Added /opt/local/bin AC_PATH_PROG(PKG_CONFIG.. for 
+         mac osx and macports
+
+2007-10-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Go in degraded mode after out of tape.
+
+2007-10-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: Fix indentation.
+
+2007-10-02  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheck.c: Fix typo in merge found by
+         martineau@zmanda.com
+
+2007-10-01  Ian Turner <ian@zmanda.com>
+       * device-src/rait-device.c, device-src/queueing.c,
+         device-src/tests/device_test.c, device-src/device.h,
+         device-src/device.c: Remove device_is_eof() function in favor of
+         accessing is_eof member directly.
+
+2007-10-01  Dustin J. Mitchell <dustin@zmanda.com>
+       Coverity bug #237
+       * amandad-src/amandad.c: fix a use-after-free
+
+2007-10-01  Ian Turner <ian@zmanda.com>
+       * device-src/device.c: Automatically register the CANONICAL_NAME
+         property for all devices.
+
+2007-10-01  Ian Turner <ian@zmanda.com>
+       * device-src/tape-posix.c: Use MTEOD on systems that have it but not
+         MTEOM.
+
+2007-10-01  Ian Turner <ian@zmanda.com>
+       * device-src/device.c, device-src/vfs-device.c,
+         device-src/rait-device.c: Use g_strdup() instead of strdup().
+
+2007-10-01  Ian Turner <ian@zmanda.com>
+       * changer-src/chg-lib.sh.in: Fix some compilation problems on
+         Solaris 10.
+
+2007-09-25  Dan Locks <dwlocks@zmanda.com>
+       * common-src/util.c: cast uid_t to long long for printf formatting
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * oldrecover-src/Makefile.am changer-src/Makefile.am
+         client-src/Makefile.am amandad-src/Makefile.am
+         recover-src/Makefile.am server-src/Makefile.am
+         restore-src/Makefile.am common-src/Makefile.am
+         tape-src/Makefile.am: replace -I../config with 
+         -I$(top_builddir)/config
+       * device-src/tests/Makefile.am: Replace -I.. with 
+         -I$(top_srcdir)/device-src
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendsize.c: change "smbclient" to SAMBA_CLIENT to allow
+         configurable name
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amflock-flock.c common-src/amflock-posix.c
+         common-src/amflock-lockf.c common-src/amflock-lnlock.c
+         common-src/amflock.c: use G_GNUC_UNUSED to avoid compiler
+         warnings
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h common-src/file.h: move declaration of 
+         canonicalize_pathname to file.h
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c common-src/util.h: only check euid==uid
+         if not RUNNING_AS_UID_ONLY; set_root_privs() checks that euid=0
+       * client-src/runstar.c client-src/noop.c client-src/runtar.c
+         client-src/sendbackup.c client-src/killpgrp.c
+         client-src/sendsize.c client-src/selfcheck.c
+         client-src/rundump.c amandad-src/amandad.c
+         server-src/amlogroll.c server-src/amindexd.c
+         server-src/amcheck.c server-src/dumper.c server-src/planner.c
+         server-src/chunker.c server-src/amadmin.c server-src/amtape.c
+         server-src/amcleanupdisk.c server-src/amflush.c
+         server-src/amtrmlog.c server-src/amdevcheck.c
+         server-src/driver.c server-src/reporter.c server-src/taper.c
+         server-src/amtrmidx.c server-src/amlabel.c
+         restore-src/amidxtaped.c restore-src/amfetchdump.c:
+         remove RUNNING_WITHOUT_SETUID and change RUNNING_AS_SETUID_ROOT
+         to RUNNING_AS_UID_ONLY (with corresponding checks for root-ness)
+       * client-src/calcsize.c: drop root privs immediately, and only
+         regain them for stat() and opendir() operations
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/property.c device-src/property.h: create VERBOSE property
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/device.h device-src/queueing.h: expand comments
+       * tape-src/output-rait.h tape-src/output-null.c 
+         tape-src/output-null.h tape-src/output-file.c 
+         tape-src/output-file.h tape-src/output-tape.c 
+         tape-src/output-tape.h tape-src/output-rait.c: add deprecation
+         comment
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * changer-src/chg-zd-mtx.sh.in: Don't pass stripped device names back
+         to Amanda.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * changer-src/chg-mtx.sh.in, changer-src/chg-manual.sh.in,
+         changer-src/chg-zd-mtx.sh.in, changer-src/chg-juke.sh.in,
+         changer-src/chg-chs.sh.in, changer-src/chg-multi.sh.in: Don't use
+         ammt for anything; use system mt and only for device operations that
+         require it.
+       * changer-src/chg-lib.sh.in: Support for above change.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/tape-device.c: Fix a border case bug where
+         tape_device_robust_read() would abort when called with a buffer
+         exactly equal to the minimum read size.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/tape-device.c: Use g_strdup() instead of strdup().
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/vfs-device.h, device-src/fd-device.c,
+         device-src/tape-device.c, device-src/Makefile.am,
+         device-src/fd-device.h, device-src/tape-device.h,
+         device-src/vfs-device.c: Delete the FdDevice and make TapeDevice
+         and VfsDevice direct descendants of Device. Also, correct all
+         reading and writing of volume and part labels for both drivers.
+       * server-src/amcheck.c: Unlabeled tapes are OK, at least with
+         label_new_tapes_option.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taperscan.c: Fix the order of arguments to
+         scan_read_label(). Patch by Dustin J. Mitchell <dustin@zmanda.com>.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/restore.c: Change "no tapedev specified" message.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amtape.c: changer_label should be called only on success.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/restore.c: init cur_tapedev.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/regenerate/regenerate gnulib/* config/gnulib/*: add
+         gnulib module 'fsusage'
+       * common-src/statfs-test.c common-src/statfs.c
+         common-src/statfs.h common-src/Makefile.am: remove old statfs
+       * client-src/selfcheck.c client-src/calcsize.c
+         server-src/amcheck.c server-src/driver.c: use fsusage instead of
+         statfs
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/alloc.c: Do away with debug_amfree(), which makes invalid
+         assumptions about the way system malloc() works.
+       * common-src/amanda.h: Update definition of amtable_free() accordingly.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amadmin.c: Allow 'f' sort order.
+       * server-src/find.c: Fix parsing of log files.
+       * server-src/find.h (DEFAULT_SORT_ORDER): Set to "hkdlpbf".
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/driverio.h (sched_t): Split attempted in dump_attempted
+                                          and taper_attempted.
+       * server-src/driver.c: Split attempted in dump_attempted
+                              and taper_attempted.
+       * server-src/driver.c (file_taper_result): Retry dump if INPUT-ERROR.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/dumper.c (add_msg_data): Remove bogus handling of "
+                                             in mesg stream.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper-file-source.c: If there's a problem reading the
+         holding disk, log the error as we get it from the OS.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper-source.c, server-src/taper.c: Do the right thing
+         if the connection to dumper is severed before we recieve a header.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper-source.c, server-src/taper-source.h,
+         server-src/taper-source-test.c, server-src/taper-port-source.c,
+         server-src/taper-port-source.h: Don't have TaperPortSource track
+         the control FD, and make it responsible for closing the data FD.
+       * server-src/taper.c: ditto, plus close control socket correctly.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/vfs-device.c: Fix a bug where all VFS device volumes
+         were thought unlabeled. Also do the right thing when there are
+         extra files in the VFS volume directory.
+       * server-src/amlabel.c: Fail if there is a problem re-reading the
+         volume label.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/device.c: Set the device name before reading the label.
+       * device-src/fd-device.c: An invalid header indicates an unlabeled
+         volume, not a volume error.
+       * device-src/taper-device.c: Insufficient buffer space causes
+         ENOMEM, not ENOSPC, at least on Linux.
+       * server-src/amlabel.c: Correctly handle the case where
+         device_read_label() returns exactly 1 set bit.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper-source.c, server-src/taper-disk-port-source.c,
+         server-src/taper.c: Be careful not to use strings from getcwd()
+         past the next invocation of getcwd().
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/vfs-device.c: Use old VFS device specification.
+
+2007-09-25  Ian Turner <ian@zmanad.com> (merged by dustin@zmanda.com)
+       * server-src/amlabel.c: Don't dump core on successful labeling.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tests/semaphore-test.c device-src/tests/Makefile.am:
+         test semaphore module
+       * device-src/semaphore.c: bugfixes, optimizations
+       * device-src/semaphore.h: inline documentation
+
+2007-09-25  Nikhil Bandiwadekar <nikhil@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/driver.c: Added quoting to directory name while logging
+           in statistics section
+       * server-src/reporter.c: Handled quoted string for directory name in
+           statistics section
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/device.c, device-src/device.h, device-src/s3-device.c,
+         device-src/fd-device.c, device-src/tape-device.c,
+         device-src/vfs-device.c, device-src/rait-device.c: Implement new,
+         more nuanced device_read_label() interface.
+       * server-src/amcheck.c, server-src/amtape.c, server-src/taperscan.c,
+         server-src/amlabel.c, restore-src/amrestore.c,
+         restore-src/restore.c: Use new interface.
+       * common-src/glib-util.c, common-src/glib-util.h: New Flags->string
+         interface.
+       * server-src/amdevcheck.c: New tool to check device/volume status.
+       * man/xml-source/amdevcheck.8.xml: Document it.
+       * server-src/Makefile.am: Add amdevcheck
+       * man/Makefile.am: Add amdevcheck.8
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/s3-device.c: adjust glib logging calls to match debug.h's
+         definitions.
+       * common-src/debug.c: typo
+       * common-src/debug.h: add definitions for g_info() and g_debug() if
+         they are missing
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       Thanks to Pavel Pragin <ppragin@zmanda.com> for finding these issues.
+       * server-src/amtape.c: Update the changer database in 'amtape update'.
+         Thanks to Dustin J. Mitchell <dustin@zmanda.com> for this fix.
+       * server-src/taperscan.c: Update the changer database during the
+         taper scan algorithm.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       Thanks to Jean-Louis Martineau <martineau@zmanda.com> for these fixes:
+       * server-src/dumper.c: Log packet to debug file.
+       * server-src/planner.c: Improve quoting.
+       * server-src/driver.c: Don't call free_serial if we still need it.
+       * server-src/driver.c: Wait for dumper result if taper fail.
+       * server-src/amstatus.pl.in: Improve parsing of initial schedule.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/tape-device.c: Use the right default block size for
+         reading.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/vfs-device.c: add forgotten device_add_property() call
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper.c: Remove an erroneous assertion. Thanks to
+         Jean-Louis Martineau <martineau@zmanda.com> for noticing this issue.
+
+2007-09-25  Patch by Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/driverio.h server-src/driver.c: Record
+         information from first PARTDONE result.  Remove duplicate
+         update_info_dumper.  Call update_info_taper as needed.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/restore.c: Don't send text to prompt_out if amidxtaped.
+
+2007-09-25  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/amfetchdump.c: Fix a bug where amfetchdump will never
+                                    try to use the changer.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/amfetchdump.c: Fix a bug where amfetchdump will
+         still try to use the changer even with the -d parameter.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amadmin.8.xml server-src/amadmin.c: add an
+         'outd' column to 'amadmin CONF holding list -l', indicating
+         an "outdated" dump, and a '-d' option to list only outdated
+         holding disk files.  Outdated dumps are described in the
+         amadmin documentation.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendsize.c configure.in server-src/getconf.c
+         restore-src/amrestore.c restore-src/amfetchdump.c
+         common-src/util.c common-src/genversion.c common-src/util.h
+         common-src/debug.c common-src/error.c common-src/amanda.h
+         common-src/Makefile.am:
+         - support the glib logging infrastructure by feeding messages
+           into debug logs
+         - merge the error module into the debug module
+         - document debug.h with verbose comments
+         - call g_critical() for error() and g_error() for errordump()
+         - remove double dgettext() call in debug_printf
+         - remove --without-debugging (so debugging is always on)
+         - remove mostly unused debug prefix support
+         - remove onerror(), replacing its few uses with alternatives
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tests/device_test.c configure.in
+         recover-src/extract_list.c recover-src/uparse.y
+         server-src/amlogroll.c server-src/dumper.c server-src/reporter.c
+         common-src/conffile.c common-src/amanda.h common-src/getcwd.c
+         common-src/getcwd.h common-src/Makefile.am: Replace calls
+         to safe_getcwd with calls to g_get_current_dir(), which
+         has the same signature and semantics.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/restore.c: Fix a bug where amfetchdump would not
+         restore anything when given the -p option. Thanks to Jean-Louis
+         Martineau <martineau@zmanda.com> for help in the development of
+         this patch.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: note that includefile can
+         take relative paths
+       * server-src/amcleanupdisk.c: fix local variable shadowing 
+         config_dir
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/holding.c (holding_walk_file): amfree(filename).
+
+2007-09-25  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * man/Makefile.am: fixes for conditional compiles
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/conffile.c: Clean up some bad warning suppression and
+         obselete unused code.
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * example/config.site man/xml-source/amanda.conf.5.xml
+         device-src/device.c device-src/device.h device-src/property.c
+         device-src/fd-device.c device-src/tape-device.c
+         device-src/property.h device-src/tape-device.h
+         device-src/tape-ops.h server-src/amcheck.c server-src/amtape.c
+         server-src/taperscan.c server-src/taper.c server-src/amlabel.c
+         restore-src/amrestore.c restore-src/restore.c:
+         This patch adds a new property READ_BUFFER_SIZE which is used
+         only by the tape device. The VFS device still uses BLOCK_SIZE
+         for reading; other devices don't need the property.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheck.c: remove debugging message
+       * device-src/tape-posix.c: fix compilation
+         errors when MTCOMPRESSION is not defined
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * Makefile.am config/Makefile.am config/ax_create_stdint_h.m4i
+         autogen configure.in: remove AX_CREATE_STDINT_H
+       * configure.in: add system-specific glib configuration
+       * changer-src/scsi-cam.c device-src/device.c
+         device-src/device.h device-src/tests/device_test.c
+         device-src/rait-device.c server-src/amcheck.c
+         server-src/taper.c server-src/amlabel.c
+         restore-src/amrestore.c restore-src/restore.c
+         common-src/glib-util.c common-src/security-util.c
+         common-src/amanda.h common-src/krb4-security.c:
+         replace references to stdint types and defines with glib
+         equivalents
+
+2007-09-25  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/s3.c, device-src/tape-device.c,
+         device-src/rait-device.c: Fix a number of compiler warnings, some
+         legimate, others not. Thanks to Dustin J. Mitchell
+         <dustin@zmanda.com> and Jean-Louis Martineau <martineau@zmanda.com>
+         for help identifying warnings that need fixing.
+
+2007-09-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amcleanup.8.xml server-src/amcleanupdisk.c
+         server-src/amcleanup.sh.in: add -v option for verbose output
+       * server-src/holding.c server-src/holding.h: rewrite 
+         implementation of the holding API to use functors
+       * server-src/driver.c: modifications to holding API changes
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/device.c: Suppress a compiler warning.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/device.h, device-src/device.c, device-src/fd-device.c,
+         device-src/tape-device.c, device-src/vfs-device.c,
+         device-src/rait-device.c: Update the seek_file API skip missing
+         files. Thanks to Dustin J. Mitchell <dustin@zmanda.com> and
+         Jean-Louis Martineau <martineau@zmanda.com> for help with this patch.
+       * restore-src/restore.c: Use the new API.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * client-src/Makefile.am, device-src/tests/Makefile.am,
+         device-src/Makefile.am, configure.in, common-src/Makefile.am,
+         tape-src/Makefile.am: Use AM_CFLAGS and LDFLAGS when
+         compiling. These changes by Dustin J. Mitchell <dustin@zmanda.com>.
+       * device-src/device.c, device-src/null-device.c,
+         device-src/device.c, device-src/queueing.c, device-src/property.c,
+         device-src/fd-device.c, device-src/s3-device.c,
+         device-src/semaphore.h, device-src/property.h,
+         device-src/vfs-device.c: Fix compiler warnings revealed by above
+         change. Thanks to Jean-Louis Martineau Jean-Louis Martineau
+         <martineau@zmanda.com> for help with these fixes.
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * restore-src/restore.c restore-src/restore.h:
+       Allow NULLs in arguments to dump_match(); make it a static
+       function.
 
-2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/device.c device-src/vfs-device.h
+         device-src/rait-device.h device-src/device.h
+         device-src/null-device.c device-src/tape-aix.c
+         device-src/tape-uware.c device-src/null-device.h
+         device-src/tape-xenix.c device-src/queueing.c
+         device-src/semaphore.c device-src/property.c
+         device-src/fd-device.c device-src/tape-device.c 
+         device-src/queueing.h device-src/semaphore.h
+         device-src/property.h device-src/tape-posix.c
+         device-src/fd-device.h device-src/tape-device.h
+         device-src/vfs-device.c device-src/rait-device.c
+         device-src/tape-ops.h common-src/glib-util.c
+         common-src/glib-util.h: restrict to GPLv2
+
+2007-09-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * Correct Cygwin build errors:
+         common-src/Makefile.am
+         common-src/amanda.h
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/cmdline.c server-src/planner.c server-src/amadmin.c
+         server-src/amcleanupdisk.c server-src/amflush.c
+         server-src/holding.c server-src/holding.h server-src/driver.c
+         server-src/find.c common-src/glib-util.c common-src/glib-util.h:
+         remove 'verbose' flag, remove holding directories from API (they 
+         will be gone soon anyway), and rework the holding module to use 
+         glib data structures
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/regenerate/regenerate gnulib/Makefile.am
+         device-src/tests/Makefile.am device-src/Makefile.am
+         server-src/taper-mem-port-source.c server-src/taper.c
+         config/gnulib/gnulib-comp.m4 config/gnulib/gnulib-cache.m4
+         config/gnulib.m4i common-src/physmem.c common-src/physmem.h
+         common-src/amanda.h common-src/base64.c common-src/Makefile.am
+         common-src/base64.h: move base64, physmem into gnulib and set
+         device API to include libgnu.
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/Makefile.am: remove redundant use of EXTRA_DIST
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/device.c device-src/tests/device_test.c
+         device-src/rait-device.c server-src/amcheck.c
+         server-src/amtape.c server-src/taperscan.c server-src/taper.c
+         server-src/amlabel.c restore-src/restore.c: device_open() no
+         longer free()s the device name it is given.
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * restore-src/restore.c: fix uninitialized value error
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/changer.c server-src/amindexd.c
+         restore-src/amidxtaped.c common-src/debug.c common-src/amanda.h
+         common-src/alloc.c: fix support for builds without --with-debugging
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * device-src/tests/queue_test.c: simplify signal handling to
+         be more portable
+
+2007-09-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/cmdline.c server-src/cmdline.h:
+         Optionally parse datestamps and levels
+       * server-src/amadmin.c: pass flags to cmdline functions
+       * server-src/find.c restore-src/amidxtaped.c
+         restore-src/amrestore.c restore-src/restore.c
+         restore-src/restore.h restore-src/amfetchdump.c:
+         Use cmdline module in amrestore, amidxtaped, and amfetchdump
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * restore-src/amrestore.c: Fix a segmentation fault that occurs
+         when the user specifies hostname, diskname, and date. Thanks to
+         Jean-Louis Martineau <martineau@zmanda.com> for finding and 
+         fixing this bug.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/device.c (device_set_startup_properties_from_config):
+         Use tapetype parameters as well as device_property directives.
+       * device-src/device.h: ditto.
+       * common-src/conffile.c: Use a new macro DEFAULT_TAPE_LENGTH
+         as default tapetype length.
+       * common-src/conffile.h: ditto.
+       * restore-src/amrestore.c: Use new interface to
+         devic_set_startup_properties_from_config().
+       * restore-src/restore.c: ditto.
+       * server-src/amcheck.c: ditto.
+       * server-src/amlabel.c: ditto.
+       * server-src/amtape.c: ditto.
+       * server-src/taper.c: ditto.
+       * server-src/taperscan.c: ditto.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amcheck.c: Return 0 if everything is good with the
+         tape. Thanks to Dustin Mitchell <dustin@zmanda.com> for 
+         reporting this issue, and to Jean-Louis Martineau 
+         <martineau@zmanda.com> for suggesting the form of the fix.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/restore.c: Only restore files matching requested
+         disknames. Report and patch by Jean-Louis Martineau
+         <martineau@zmanda.com>.
+
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/restore.c: Drop some globals, use data types
+         responsibly.
+       
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/taper.c: Be slightly more rigorous in sanity-checking
+         the expected number of splits.
+       * server-src/taper-file-source.c: Correctly predict the number
+         of splits.
+       
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * device-src/vfs-device.c: Accept device names without a
+         terminating '/'.
+       
+2007-09-24  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       Merge in new Device API. Thanks to Jean-Louis and Dustin for their
+       code contributions to this patch.
+
+2007-09-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * oldrecover-src/extract_list.c recover-src/extract_list.c: 
+         change stralloc2 to newstralloc2 to avoid possible memory
+         leak (coverity bug #214)
+
+2007-09-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/client_util.c: Parse kencrypt in option string.
+       * client-src/sendbackup.c: Send KENCRYPT keyword in REP packet.
+       * client-src/client_util.h: Add kencrypt field in option_t.
+       * amandad-src/amandad.c: Enable kencrypt.
+       * server-src/dumper.c: Enable kencrypt.
+       * common-src/security.h (accept): New prototype, add conf_fn and datap.
+       * common-src/bsdtcp-security.c (bsdtcp_accept): Use new param.
+       * common-src/ssh-security.c (ssh_connect): Set rh->rc->conf_fn and
+                                                  rh->rc->datap
+       * common-src/security-util.c (sec_accept): Set rc->conf_fn and
+                                                  rc->datap
+       * common-src/amanda.h (kencrypt_type): New enum.
+       * common-src/bsdudp-security.c (bsdudp_accept): Use new param.
+       * common-src/security-util.h (sec_accept): New prototype.
+       * common-src/krb5-security.c: encryption enabled based on kencrypt.
+       * common-src/bsd-security.c (bsd_accept):  Use new param.
+
+2007-09-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/util.c common-src/util.h: add euid checks to
+         check_running_as
+       * client-src/runstar.c client-src/noop.c client-src/runtar.c
+         client-src/sendbackup.c client-src/killpgrp.c
+         client-src/sendsize.c client-src/selfcheck.c
+         client-src/rundump.c client-src/calcsize.c
+         amandad-src/amandad.c configure.in server-src/amlogroll.c
+         server-src/amindexd.c server-src/dumper.c server-src/planner.c
+         server-src/chunker.c server-src/amadmin.c server-src/amtape.c
+         server-src/amcleanupdisk.c server-src/amflush.c
+         server-src/amtrmlog.c server-src/amdevcheck.c
+         server-src/driver.c server-src/reporter.c server-src/taper.c
+         server-src/amtrmidx.c server-src/amlabel.c
+         restore-src/amidxtaped.c restore-src/amfetchdump.c: use them
+       * common-src/krb5-security.c: remove unused variable
+
+2007-09-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/getconf.c: Don't check running_as in amgetconf, as
+         it may not have a configuration file (e.g., for build params)
+
+2007-09-12  Dustin J. Mitchell <dustin@zmanda.com>
+       Bug identified by Satya Ganga <gsat@zmanda.com>
+       * common-src/util.c: handle bad call to check_running_as correctly
+
+2007-09-11  Dustin J. Mitchell <dustin@zmanda.com>
+       Bug reported by Bill Bartlett; patch by Jean-Louis Martineau
+       <martineau@zmanda.com>
+       * common-src/statfs.c: fix error in available-space calculations
+
+2007-09-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcheck.c: quiet compiler warnings when SINGLE_USERID is
+         defined
+
+2007-09-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: change FORCE_USERID to CHECK_USERID, add SINGLE_USERID
+         (when all of Amanda runs as the same userid) and WANT_SETUID_CLIENT
+         (clint binaries should be setuid-root), currently only used on
+         Cygwin.
+       * common-src/util.c common-src/util.h: utility functions for userid
+         checks and manipulations
+       * oldrecover-src/amrecover.c client-src/runstar.c
+         client-src/noop.c client-src/runtar.c client-src/sendbackup.c
+         client-src/killpgrp.c client-src/sendsize.c
+         client-src/selfcheck.c client-src/rundump.c
+         client-src/calcsize.c amandad-src/amandad.c
+         recover-src/amrecover.c server-src/amlogroll.c
+         server-src/amindexd.c server-src/amcheck.c server-src/dumper.c
+         server-src/planner.c server-src/chunker.c server-src/amadmin.c
+         server-src/amtape.c server-src/amcleanupdisk.c
+         server-src/getconf.c server-src/amflush.c server-src/amtrmlog.c
+         server-src/amdevcheck.c server-src/driver.c
+         server-src/reporter.c server-src/taper.c server-src/amdump.sh.in
+         server-src/amtrmidx.c server-src/amlabel.c common-src/genversion.c 
+         restore-src/amidxtaped.c restore-src/amfetchdump.c
+         common-src/bsdtcp-security.c common-src/bsdudp-security.c
+         common-src/krb5-security.c common-src/krb4-security.c
+         common-src/bsd-security.c: use utility functions to check userids.
+
+2007-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       Change by Paul Bijnens
+       * man/xml-source/amanda.conf.5.xml: Clarify 'etimeout'
+
+2007-09-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * gnulib/regenerate/no-error.patch gnulib/Makefile.am: remove
+         spurious sign-compare warnings from gnulib
+
+2007-09-05  Dustin J. Mitchell <dustin@zmanda.com>
+       Bug identified downstream in Debian packaging
+       * changer-src/chg-null.sh.in: fix typo
+
+2007-08-29  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/genversion.c common-src/Makefile.am: add subversion revision 
+         and branch info to 'amadmin x version'
+
+2007-08-23  Dustin J. Mitchell <dustin@zmanda.com>
+       sf bug #1775316 reported by joerg <altix@users.sourceforge.net>
+       * configure.in: use 'sed' instead of shell substitutions to C-quote
+         ssh arguments
+
+2007-08-22  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/Makefile.am: adjust dependencies so that 'make dist' can
+         run without a 'make all'
+
+2007-08-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendbackup-gnutar.c client-src/sendsize.c: use
+         sanitized, canonicalized, and quoted filenames where necessary
+       * server-src/driver.c: quote diskname in logfile
+       * common-src/amanda.h common-src/file.c: Add ':' to the list
+         of characters sanitised when constructing filenames from
+         disknames; add canonicalize_pathname()
+
+2007-08-14  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h common-src/util.h: move readline headers
+         out of amanda.h and into util.h, since the corresponding
+         functions are in util.c
+       * common-src/util.c: comments
+       * configure.in: check for both headers and libraries and define
+         HAVE_READLINE if both are found; add new --with-readline
+         to require readline and --without-readline to not search
+         for it at all.
+       * oldrecover-src/Makefile.am recover-src/Makefile.am: remove explicit
+         use of READLINE_LIBS
+
+2007-08-09  Dustin J. Mitchell <dustin@zmanda.com>
+       Patch by C R Ritson <c.r.ritson@newcastle.ac.uk>
+       * server-src/amverifyrun.sh.in: "lock" the logfile by creating a 
+         symlink.
+
+2007-08-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * example/DLT-A4.ps example/Makefile.am: add new template contributed
+         by Terry Burton <tez@terryburton.co.uk>.
+
+2007-08-01  Dustin J. Mitchell <dustin@zmanda.com>
+       Patch by Satya Ganga <gsat@zmanda.com>
+       * server-src/amcleanup.sh.in: shell-compatibility fixes for bash-2.03
+         (Solaris 8)
+
+2007-07-31  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/statfs-test.c common-src/statfs.c common-src/statfs.h
+         common-src/Makefile.am: Add a statfs-test to make sure that
+         statfs works on target systems.
+
+2007-07-27  Ian Turner <ian@zmanda.com>
+       * restore-src/amfetchdump.c: Check for required arguments in
+         all cases.
+
+2007-07-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * config/automake/check-perl.am: new automake fragment to check perl scripts
+       * config/automake/check-shell.am: new automake fragment to check shell scripts
+       * configure.in changer-src/Makefile.am client-src/Makefile.am dumper-src/Makefile.am
+         server-src/Makefile.am common-src/Makefile.am: use new checks
+       * changer-src/chg-lib.sh.in: add newline for Solaris's 'bash'
+       * changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in: fix errors found by
+         new checks
+
+2007-07-26  Ian Turner <ian@zmanda.com>
+       * restore-src/restore.c: If tpchanger is not defined, then (duh)
+         don't use the changer. This patch by Jean-Louis Martineau 
+         <martineau@zmanda.com>.
+
+2007-07-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-lib.sh.in common-src/amanda-sh-lib.sh.in
+         configure.in common-src/Makefile.am: new general-purpose
+         shell-script library
+       * configure.in: check for prog 'gettext'
+       * changer-src/chg-null.sh.in
+         changer-src/chg-manual.sh.in changer-src/chg-disk.sh.in
+         changer-src/chg-juke.sh.in changer-src/chg-rait.sh.in
+         changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in
+         amplot/amplot.sh.in client-src/patch-system.sh.in
+         server-src/amcheckdb.sh.in server-src/amverifyrun.sh.in
+         server-src/amrmtape.sh.in server-src/amverify.sh.in
+         server-src/amfreetapes.sh.in server-src/amcleanup.sh.in
+         server-src/amdump.sh.in common-src/amcrypt-ossl-asym.sh.in
+         common-src/amcrypt.sh.in common-src/amaespipe.sh.in
+         common-src/amcrypt-ossl.sh.in: use new library to function
+         correctly even when gettext is missing.
+
+2007-07-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Set MaxWidth for numerical value
+       * server-src/reporter.c: Calculate the size if a numerical value.
+
+2007-07-20  Jean-Louis Martineau <martineau@zmanda.com>
+        Patch by Dimitri Gorokhovik
+        * changer-src/chg-multi.sh.in: Typo.
+
+2007-07-18  Ian Turner <ian@zmanda.com> (merged by dustin@zmanda.com)
+       * changer-src/chg-lib.sh.in, changer-src/chg-zd-mtx.sh.in: Correctly
+         accept the use of tape:/dev/nst0 notation in chg-zd-mtx.
+
+2007-07-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/reporter.c: fix reporting of STRANGE messages
+
+2007-07-16  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: check for validity of 'mt' and 'mtx'
+         binaries early, and produce appropriate error messages
+
+2007-07-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: add /usr/sfw/bin to SYSPATH for Solaris 10
+
+2007-07-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-lib.sh.in: Remoce duplicate amdd, add ammt.
+
+2007-07-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * autogen config/Makefile.am config/ax_compare_version.m4i
+         Makefile.am: new m4 file
+       * config/docbook-xslt-min.m4i config/docbook-dtd.m4i
+         config/docbook-xslt.m4i: major bug fixing
+
+2007-07-11  Dustin J. Mitchell <dustin@zmanda.com>
+       * recover-src/amrecover.c recover-src/extract_list.c: Add detailed
+         logging of the amrecover user conversation.
+
+2007-07-11  Jean-Louis Martineau <martineau@zmanda.com>
+       Patch by Paul Bijnens
+       * changer-src/chg-multi.sh.in: Typo.
+
+2007-07-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: an empty 'MAILER' is no longer an error, just a
+         warning
+       * changer-src/chg-manual.sh.in changer-src/chg-scsi-chio.c
+         changer-src/chg-scsi.c server-src/amverify.sh.in
+         server-src/getconf.c common-src/genversion.c: conditionalize
+         references to MAILER, to handle the situation when it is not
+         set.
+
+2007-07-09  Dustin J. Mitchell <dustin@zmanda.com>
+       Documentation patch as suggested by Chris Hoogendyk and Olivier
+       Nicole.
+       * man/xml-source/amanda.8.xml: add better documentation about the 
+         -o command-line option for configuration override.
+
+2007-07-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * restore-src/restore.c: Don't do superfluous fsf,
+                                improve error handling.
+
+2007-07-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amadmin.c: correct misalignment of 'amadmin x balance'
+         output, as reported by Stefan G. Weichinger <sgw@amanda.org>.
+
+2007-07-03  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/amanda.h common-src/amflock.c: remove unused 
+         CONFIGURE_TEST conditionals
+
+2007-06-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/security-util.c: Change authorization error message to
+       "Please add the line "HOST USER SERVICE" to AMANDAHOSTS on the client"
+       as suggested by Paddy Sreenivasan <paddy@zmanda.com>.
+
+2007-06-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in common-src/amflock-flock.c
+         common-src/amflock-posix.c common-src/amanda.h
+         common-src/amflock-lockf.c common-src/amflock-test.c
+         common-src/amflock-lnlock.c common-src/amflock.c
+         common-src/amflock.h common-src/Makefile.am:
+         refactor file locking support into multiple implementations,
+         only test for availability (not functionality) at configure
+         time, and add a 'make check' test script.  Fixes a bug reported
+         by Paul Crittenden.  Chris Hoogendyk, Jon LaBadie, and Jean-Louis
+         Martineau helped track it down.
+
+2007-06-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * autogen config/ax_create_stdint_h.m4i config/acinclude.m4i
+         Makefile.am: use updated version of ax_create_stdint_h.m4
+         from http://autoconf-archive.cryp.to/ax_create_stdint_h.html.
+         Original by Guido U. Draheim <guidod@gmx.de>, patched locally
+         to avoid spurious "command not found" on Solaris 10.
+       * config/Makefile.am: add ax_create_stdint_h.m4i
+
+2007-06-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/cmdline.c server-src/cmdline.h server-src/taperscan.c
+         server-src/taperscan.h config/docbook-dtd.m4i
+         config/docbook-xslt-min.m4i config/docbook-xslt.m4i
+         config/xsltproc.m4i common-src/sockaddr-util.c
+         common-src/sockaddr-util.h common-src/amaespipe.sh.in:
+         restrict to GPLv2
+
+2007-06-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendbackup.c client-src/killpgrp.c
+         client-src/sendsize.c client-src/selfcheck.c
+         server-src/amcheck.c server-src/reporter.c common-src/util.c
+         common-src/util.h common-src/security-util.c: add str_exit_status()
+         to interpret the status resulting from wait(), use it throughout
+         the codebase.
+
+2007-06-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/planner.c common-src/bsdudp-security.c
+         common-src/krb5-security.c common-src/bsd-security.c:
+         remove dead/unused code
+
+2007-06-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendsize.c: call dbfn(), not debug_fn()
+       * common-src/amanda.h: make dbfn() return a meaningful string
+         when debugging is disabled
+
+2007-06-19  Dustin J. Mitchell <dustin@zmanda.com>
+       * tape-src/tapetype.c: close and re-open tape after rewind
+         (patch from Franz Fischer <amanda@franz-fischer.de>, modified
+         by Jean-Louis Martineau <martineau@zmanda.com>)
 
 2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * NEWS: Change in 2.5.2p1.
-       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2p1).
+        * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES
 
-2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * configure.in: Fix check backup is not from gnutar.
+2007-06-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Set and use chunk_time.
 
-2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
-       Original patch by franz Fischer
-       * tape-src/tapetype.c: close and open after a rewind.
+2007-06-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amcleanupdisk.c: don't try to clean up holding disks
+         if they are empty.
 
-2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/krb5-security.c, common-src/bsdtcp-security.c,
-         common-src/security-util.c: Check return code of getnameinfo.
+2007-06-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendbackup.c: remove bogus check for unknown program
+
+2007-06-07  Jean-Louis Martineau <martineau@zmanda.com>
+       Christopher McCrory found the cause of the problem.
+       * server-src/find.c: Send ouput to stderr.
+
+2007-06-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: detect GNU tar's 'backup' and ignore it.  Thanks
+         to Jeanna Geier <jeanna@webteam.net> for spotting this.
+
+2007-06-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c: Don't use -w flags for od execution.
+
+2007-06-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/selfcheck.c: fix formatting typo
+       * common-src/security.h: fix prototypes in comments
+       * common-src/security-util.c common-src/util.c: fix 
+         vstralloc errors
+       * common-src/debug.c common-src/amanda.h: remove 
+         debug_prefix_time
+       * changer-src/scsi-linux.c changer-src/chg-scsi-chio.c
+         changer-src/scsi-cam.c client-src/calcsize.c
+         recover-src/amrecover.c server-src/driver.c
+         client-src/sendbackup-gnutar.c server-src/find.c
+         server-src/diskfile.c : format string / i18n tweaks
+       * common-src/amcrypt-ossl.sh.in: fix shell quoting
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/sense.c server-src/driver.c server-src/reporter.c
+         server-src/amadmin.c server-src/amtape.c common-src/amanda.h:
+         use T_() instead of _T() as the macro flagging static strings
+         in need of translation; fixes compilation error on Mac OS X, where
+         _T is defined in the system headers.
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in changer-src/chg-multi.sh.in:
+         use chg-lib.sh fully, fix i18n problems.
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/krb5-security.c common-src/bsdtcp-security.c
+         common-src/security-util.c: check results from getnameinfo()
+         correctly
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amstatus.pl.in: use perl flags -Tw
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/debug.c common-src/error.c: fix compilation errors
+         on strict platforms.
 
 2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amstatus.pl.in: Perl argument are '-Tw'.
+       * common-src/bsd-security.c common-src/bsdudp-security.c: 
+         Make bsd, bsdudp open an IPv4 and an IPv6 socket; fixes bug reported
+         by Marc Muehlfeld.
 
 2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
-       * server-src/holding.c: Forgotten ==0 in strcmp().
+       * oldrecover-src/Makefile.am changer-src/Makefile.am
+         amplot/Makefile.am client-src/Makefile.am
+         amandad-src/Makefile.am dumper-src/Makefile.am
+         recover-src/Makefile.am restore-src/Makefile.am
+         tape-src/Makefile.am: add quotes to allow spaces in user
+         and group names
 
-2007-05-31  Jean-Louis Martineau <martineau@zmanda.com>
-       * configure.in: Check backup is not from gnutar.
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-scsi.c: use long int for tape sleep time
+       * client-src/selfcheck.c: error out if no calcsize program is found
+       * server-src/amindexd.c: run 'sort' in the C locale
+       * server-src/amcheck.c: flag localhost not resolving as an error
+       * server-src/diskfile.c: improve error handling
+       * common-src/amcrypt.sh.in common-src/amcrypt-ossl-asym.sh.in
+         common-src/amcrypt-ossl.sh.in: search /opt/csw/bin for openssl
+         binaries; improve error handling
 
-2007-05-31  Jean-Louis Martineau <martineau@zmanda.com>
-       * recover-src/set_commands.c (cd_dir): Validate regex.
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/planner.c server-src/amcleanupdisk.c
+         server-src/amflush.c server-src/holding.c server-src/holding.h:
+         do not assume anything about the names of holding
+         directories; use holding disk files themselves to discover
+         dump time/datestamps
 
-2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/krb5-security.c: Use keytab_name.
-       * server-src/holding.c: Remove unused date_matches variable.
+2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Typo.
 
-2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amstatus.pl.in: Set and use chunk_time.
+2007-06-01  Ian Turner <ian@zmanda.com>
+       * restore-src/restore.c: Set flags->fsf = 0 by default.
 
-2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c: Don't use -w flags for od execution.
+2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Check dumper->down.
+       * server-src/dumper.c (sendbackup_response): Only call
+         security_close_connection if pkt != NULL.
+
+2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Use compressed size.
 
 2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/planner.c: Don't report overwrite if no label.
 2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
        * changer-src/chg-manual.sh.in: Don't reset the slot to 0 on eject.
 
-2007-05-25  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amstatus.pl.in: Put all flags in one arguments.
+2007-05-25  Kevin Till <ktill@zmanda.com>
+       * example/amanda.conf.in: ditto
+       * man/xml-source/amanda.conf.5.xml: ditto
+       * common-src/conffile.c: ditto
+
+2007-05-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/scsi-changer-driver.c changer-src/scsi-cam.c
+         client-src/sendbackup.c client-src/selfcheck.c
+         recover-src/extract_list.c server-src/amindexd.c
+         server-src/amcheck.c server-src/driver.c server-src/dumper.c
+         server-src/planner.c server-src/amadmin.c server-src/diskfile.c
+         contrib/set_prod_link.pl common-src/krb5-security.c
+         common-src/bsd-security.c common-src/security-util.c
+         common-src/conffile.c common-src/bsdudp-security.c:
+         trivial changes to add _(), etc. -- harmonization of branch
+         divergence caused by manual resolution of merge conflicts
+
+2007-05-24  Satya Ganga <gsat@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amcleanup.sh.in: rewrite to find all the active
+       process/children for a given configuration
+
+2007-05-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/fileheader.c:
+         Remove ".exe" extension from program name is tape header.
+
+2007-05-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * config/gettext-macros/gettext.m4
+       config/gettext-macros/inttypes-pri.m4:
+         Change name gl_HEADER_INTTYPES_H to gl_AC_HEADER_INTTYPES_H
+
+2007-05-24  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: add configure.in recognition for Mac OS X
+
+2007-05-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * configure.in: IPV6 on cygwin only partially works.
+               Force WORKING_IPV6 to false.
+
+2007-05-24  Kevin Till <ktill@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/driver.c: use amanda text domain in driver
+
+2007-05-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * config/libtool.m4i:
+               Fix to pass loader variables correctly on Solaris systems
+               with a gcc that does not use -static or -shared.
+
+2007-05-24  Kevin Till <ktill@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amstatus.pl.in: parse directory and holding_disk_dir with
+         space correctly
+
+2007-05-24  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * client-src/sendbackup.c client-src/sendsize.c client-src/sendbackup-star.c
+         configure.in server-src/amindexd.c server-src/taper.c server-src/diskfile.c
+         config/acinclude.m4i common-src/amanda.h common-src/util.c
+         common-src/security-util.c:
+               Fix compilation problems using GCC on solaris.
+
+2007-05-24  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/reporter.c: Split FAILED and STRANGE section.
+
+2007-05-23  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/conffile.c: Fix windows compilation warning.
+
+2007-05-23  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * po/Makefile.am changer-src/scsi-changer-driver.c changer-src/sense.c
+         client-src/unctime.c server-src/amadmin.c server-src/amtape.c
+         server-src/driver.c server-src/reporter.c common-src/amanda.h
+         tape-src/tapeio.h tape-src/tapetype.c:
+               Change _() gettext macro to call gettext()
+               Create _T() to allow gettext translation of static strings.
+       * common-src/security.c:  Create larger buffers for error messages.
+
+2007-05-23  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * configure.in: Prevent annoying lint usage message from
+         being displayed in configure console output.
+
+2007-05-23  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * autogen:
+               Fix problem of not generating po/Makefile.in on fresh checkout.
+       * server-src/logfile.c:
+               Always output to logfile in "C" locale.
+       * amandad-src/amandad.c changer-src/chg-scsi-chio.c
+         changer-src/chg-scsi.c client-src/calcsize.c client-src/getfsent.c
+         client-src/killpgrp.c client-src/noop.c client-src/rundump.c
+         client-src/runstar.c client-src/runtar.c client-src/selfcheck.c
+         client-src/sendbackup.c client-src/sendsize.c
+         client-src/versionsuffix.c common-src/amfeatures.c
+         common-src/amflock.c common-src/file.c common-src/genversion.c
+         common-src/statfs.c common-src/token.c oldrecover-src/amrecover.c
+         recover-src/amrecover.c restore-src/amfetchdump.c
+         restore-src/amidxtaped.c restore-src/amrestore.c server-src/amadmin.c
+         server-src/amcheck.c server-src/amcleanupdisk.c server-src/amflush.c
+         server-src/amindexd.c server-src/amlabel.c server-src/amlogroll.c
+         server-src/amtape.c server-src/amtrmidx.c server-src/amtrmlog.c
+         server-src/chunker.c server-src/diskfile.c server-src/driver.c
+         server-src/dumper.c server-src/getconf.c server-src/infofile.c
+         server-src/planner.c server-src/reporter.c server-src/taper.c
+         tape-src/amdd.c tape-src/ammt.c tape-src/tapeio.c tape-src/tapetype.c:
+               Change back to always run in "C" locale.
+
+2007-05-23  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * changer-src/chg-manual.sh.in: Fix quoting; fix gettext usage.
+
+2007-05-23  John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * configure.in:
+               New gettext routines.
+       * server-src/amcheckdb.sh.in server-src/amcleanup.sh.in
+         server-src/amverifyrun.sh.in server-src/amrmtape.sh.in
+         server-src/amverify.sh.in server-src/amdump.sh.in
+         server-src/amfreetapes.sh.in amplot/amplot.sh.in
+         changer-src/chg-mtx.sh.in changer-src/chg-null.sh.in
+         changer-src/chg-manual.sh.in changer-src/chg-zd-mtx.sh.in
+         changer-src/chg-disk.sh.in changer-src/chg-juke.sh.in
+         changer-src/chg-rait.sh.in changer-src/chg-scsi.c
+         changer-src/chg-chs.sh.in changer-src/chg-multi.sh.in
+         changer-src/chg-mcutil.sh.in client-src/patch-system.sh.in
+         common-src/amcrypt.sh.in common-src/amaespipe.sh.in
+         common-src/amcrypt-ossl-asym.sh.in common-src/amcrypt-ossl.sh.in:
+               Internationalize shell messages
+       * autogen config/gettext-macros/nls.m4
+         config/gettext-macros/lib-link.m4:
+               Update for autoconf version 2.6 autogen
+       * oldrecover-src/amrecover.c recover-src/amrecover.c
+         server-src/amflush.c server-src/logfile.c server-src/amtrmlog.c
+         server-src/amlogroll.c server-src/amindexd.c server-src/amcheck.c
+         server-src/driver.c server-src/dumper.c server-src/chunker.c
+         server-src/planner.c server-src/reporter.c server-src/amadmin.c
+         server-src/amtape.c server-src/taper.c server-src/server_util.c
+         client-src/versionsuffix.c client-src/runtar.c
+         server-src/amtrmidx.c server-src/amcleanupdisk.c
+         server-src/getconf.c server-src/diskfile.c
+         changer-src/chg-scsi-chio.c client-src/noop.c server-src/infofile.c
+         server-src/amlabel.c client-src/sendbackup.c client-src/getfsent.c
+         client-src/killpgrp.c client-src/sendsize.c client-src/selfcheck.c
+         client-src/rundump.c client-src/calcsize.c restore-src/amidxtaped.c
+         restore-src/amrestore.c restore-src/amfetchdump.c Makefile.am
+         amandad-src/amandad.c common-src/genversion.c common-src/debug.c
+         common-src/error.c common-src/statfs.c common-src/amflock.c
+         common-src/file.c common-src/token.c common-src/security-util.c
+         common-src/conffile.c common-src/amanda.h common-src/amfeatures.c
+         tape-src/ammt.c tape-src/amdd.c tape-src/tapeio.c
+         tape-src/tapetype.c:
+               Use amanda domain for LC_MESSAGES.
+
+2007-05-22  Maitreyee Karmarkar <maitreyee@zmanda.com> (merged by dustin@zmanda.com)
+       * server-src/amcheck.c : Changed some amcheck messages
+       * common-src/conffile.c : Changed some amcheck messages
+       
+2007-05-22  Maitreyee Karmarkar <maitreyee@zmanda.com> (merged by dustin@zmanda.com)
+       * client-src/selfcheck.c, server-src/changer.c, server-src/amcheck.c,
+         server-src/taperscan.c, server-src/diskfile.c,
+         common-src/conffile.c:
+         Change in some amcheck error messages
+
+2007-05-22   John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/krb5-security.c common-src/security-util.c
+         server-src/taper.c server-src/taperscan.c:
+               Fix botched *vstrallocf conversions.
+       * oldrecover-src/extract_list.c server-src/amlogroll.c
+         server-src/chunker.c server-src/driver.c server-src/dumper.c
+         server-src/getconf.c server-src/holding.c server-src/planner.c
+         server-src/reporter.c server-src/taper.c:
+               Add errno text when printing getcwd() error message.
+
+2007-05-22  Kevin Till <ktill@zmanda.com> (merged by dustin@zmanda.com)
+       * configure.in: move crypt scripts to common-src since they are needed
+         by both server and client
+       * common-src/Makefile.am: ditto
+       * server-src/Makefile.am: ditto
 
-2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c: Fix missing NULL in vstralloc call.
+2007-05-17   John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * configure.in oldrecover-src/amrecover.c
+         oldrecover-src/extract_list.c oldrecover-src/display_commands.c
+         oldrecover-src/help.c oldrecover-src/set_commands.c
+         recover-src/amrecover.c recover-src/extract_list.c
+         recover-src/display_commands.c recover-src/help.c
+         recover-src/set_commands.c server-src/amflush.c
+         server-src/changer.c server-src/taperscan.c server-src/logfile.c
+         server-src/amtrmlog.c server-src/driverio.c
+         server-src/amlogroll.c server-src/tapefile.c
+         server-src/amindexd.c server-src/driver.c server-src/amcheck.c
+         server-src/dumper.c server-src/chunker.c server-src/planner.c
+         server-src/reporter.c server-src/server_util.c
+         server-src/amadmin.c server-src/amtape.c server-src/taper.c
+         server-src/amcleanupdisk.c server-src/find.c
+         server-src/amtrmidx.c server-src/getconf.c
+         server-src/diskfile.c server-src/infofile.c
+         server-src/amlabel.c changer-src/scsi-linux.c
+         changer-src/chg-scsi-chio.c changer-src/scsi-chio.c
+         changer-src/scsi-hpux.c changer-src/scsi-changer-driver.c
+         changer-src/scsi-cam.c changer-src/chg-scsi.c
+         changer-src/scsi-bsd.c changer-src/scsi-irix.c
+         changer-src/scsi-solaris.c changer-src/sense.c
+         changer-src/scsi-aix.c changer-src/scsi-hpux_new.c
+         autogen client-src/unctime.c client-src/versionsuffix.c
+         client-src/noop.c client-src/client_util.c client-src/runtar.c
+         client-src/sendbackup-gnutar.c client-src/getfsent.c
+         client-src/sendbackup.c client-src/sendbackup-dump.c
+         client-src/killpgrp.c client-src/sendsize.c
+         client-src/selfcheck.c client-src/rundump.c
+         client-src/calcsize.c client-src/amandates.c
+         restore-src/amidxtaped.c restore-src/amrestore.c
+         restore-src/restore.c restore-src/amfetchdump.c Makefile.am
+         amandad-src/amandad_util.c amandad-src/amandad.c
+         common-src/rsh-security.c common-src/pipespawn.c
+         common-src/security.c common-src/krb5-security.c
+         common-src/util.c common-src/genversion.c
+         common-src/bsdtcp-security.c common-src/debug.c
+         common-src/fileheader.c common-src/dgram.c
+         common-src/stream.c common-src/match.c
+         common-src/protocol.c common-src/ssh-security.c
+         common-src/statfs.c common-src/krb4-security.c
+         common-src/amflock.c common-src/bsd-security.c
+         common-src/file.c common-src/token.c common-src/event.c
+         common-src/security-util.c common-src/conffile.c
+         common-src/amanda.h common-src/bsdudp-security.c
+         common-src/alloc.c common-src/clock.c common-src/amfeatures.c
+         tape-src/ammt.c tape-src/amdd.c tape-src/output-file.c
+         tape-src/tapeio.c tape-src/tapeio.h tape-src/output-tape.c
+         tape-src/tapetype.c tape-src/output-rait.c:
+         o First stage of internationalization.
+           - Add GNU gettext to configuration.
+           - Add _() macro to flag translatable strings and modify
+             code to use it.  Macros like SSIZE_T_FMT are included in
+             this call, even though xgettext will not parse them; this
+             will be fixed later.
+           - Add plural() function for selecting singular or plural form
+             of string and modify code to use it.
+           - Add amanda.po target to Makefile.
 
-2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amstatus.pl.in: Use compressed size.
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Remove bogus amfree(newtapefile).
 
-2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/driver.c: Check dumper->down.
-       * server-src/dumper.c (sendbackup_response): Only call
-         security_close_connection if pkt != NULL.
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Check all tapelist filename.
 
-2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/find.c: Send ouput to stderr.
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c (read_datafd): Reset timeout after the write.
 
 2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
        * amplot/amplot.sh.in: Remove function keyword.
        * changer-src/chg-multi.sh.in: Remove function keyword.
        * changer-src/chg-zd-mtx.sh.in: Remove function keyword.
 
-2007-05-16  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/dumper.c (read_datafd): Reset timeout after the write.
-
-2007-05-15  Jean-Louis Martineau <martineau@zmanda.com>
-       * client-src/sendsize.c: Set qlist before using it.
-
-2007-05-15  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amadmin.c, server-src/cmdline.c,
-         server-src/find.c: Call holding_get_files will NULL date_list.
-       * server-src/holding.c (holding_get_directories_per_disk): New
-         date_list param, scan only the date_list directories.
-       * server-src/holding.c (holding_get_directories): New
-         date_list param.
-       * server-src/holding.c (holding_get_files): New
-         date_list param.
-       * server-src/holding.c (holding_get_files_for_flush): Don't loop over
-         date.
-       * server-src/holding.h (holding_get_directories,
-         holding_get_files): New prototype.
-
-2007-05-14  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/bsd-security.c: Open an IPv4 and an IPv6 socket.
-       * common-src/bsdudp-security.c: Open an IPv4 and an IPv6 socket.
-
-2007-05-11  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amcrypt-ossl-asym.sh.in: Use CLIENT_LOGIN.
-       * server-src/amcrypt-ossl.sh.in: Use CLIENT_LOGIN.
-
-2007-05-10  Jean-Louis Martineau <martineau@zmanda.com>
-       * util.c (cmp_sockaddr): Fix compilation.
-
-2007-05-10  Jean-Louis Martineau <martineau@zmanda.com>
-       * util.c (cmp_sockaddr): un-map V4mapped address before comparison.
-       * common-src/security-util.c: add debugging.
-
-2007-05-08  Jean-Louis Martineau <martineau@zmanda.com>
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/diskfile.c: Fix double free.
 
-2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/alloc.c (debug_vstrallocf): Remove file and line.
-       * common-src/amanda.h (vstrallocf): Change define.
-
-2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/amanda.h: define sockaddr_storage and ss_family.
        * common-src/amanda.h: define INET_ADDRSTRLEN.
        * config/acinclude.m4i (AC_SOCKADDR_STORAGE): New macro.
        * configure.in: AC_SOCKADDR_STORAGE.
 
-2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/amanda.h: Define AI_V4MAPPED and AI_ALL.
 
-2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
-         common-src/bsdudp-security.c, common-src/krb5-security.c,
-         common-src/stream.c, server-src/amcheck.c,
-         server-src/dumper.c: Retry getaddrinfo with ai_flags = AI_CANONNAME
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * util.c (cmp_sockaddr): un-map V4mapped address before comparison.
+       * common-src/security-util.c: add debugging.
+
+2007-05-17  Dustin J. Mitchell <dustin@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/amanda.h: fix typo (missing 'extern') in erroutput_type
+
+2007-05-16     John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * oldrecover-src/amrecover.c oldrecover-src/extract_list.c
+         oldrecover-src/display_commands.c oldrecover-src/set_commands.c
+         recover-src/amrecover.c recover-src/extract_list.c
+         recover-src/display_commands.c recover-src/set_commands.c
+         server-src/changer.c server-src/taperscan.c
+         server-src/amtrmlog.c server-src/amindexd.c server-src/driver.c
+         server-src/amcheck.c server-src/dumper.c server-src/chunker.c
+         server-src/planner.c server-src/reporter.c server-src/taper.c
+         server-src/amtrmidx.c changer-src/scsi-linux.c
+         changer-src/chg-scsi-chio.c changer-src/scsi-chio.c
+         changer-src/scsi-hpux.c changer-src/scsi-cam.c
+         changer-src/scsi-changer-driver.c changer-src/chg-scsi.c
+         changer-src/scsi-bsd.c changer-src/scsi-irix.c
+         changer-src/scsi-solaris.c changer-src/sense.c
+         changer-src/scsi-aix.c changer-src/scsi-hpux_new.c
+         client-src/client_util.c client-src/runtar.c
+         client-src/sendbackup-gnutar.c client-src/sendbackup.c
+         client-src/sendbackup-dump.c client-src/killpgrp.c
+         client-src/sendsize.c client-src/selfcheck.c
+         client-src/rundump.c client-src/calcsize.c
+         client-src/amandates.c restore-src/amidxtaped.c
+         restore-src/restore.c amandad-src/amandad_util.c
+         amandad-src/amandad.c common-src/rsh-security.c
+         common-src/sockaddr-util.c common-src/pipespawn.c
+         common-src/security.c common-src/krb5-security.c
+         common-src/util.c common-src/util.h common-src/bsdtcp-security.c
+         common-src/tapelist.c common-src/debug.c common-src/fileheader.c
+         common-src/error.c common-src/dgram.c common-src/stream.c
+         common-src/protocol.c common-src/ssh-security.c
+         common-src/krb4-security.c common-src/bsd-security.c
+         common-src/event.c common-src/security-util.c
+         common-src/conffile.c common-src/amanda.h
+         common-src/bsdudp-security.c common-src/security-util.h
+         common-src/alloc.c tape-src/output-file.c tape-src/tapeio.c
+         tape-src/output-tape.c:
+               - Change dbprintf() to use __VA_ARGS__. (Remove extra parens)
+               - Prepend program name and nano second accuracy time stamp
+                 to each line in debug file.
+               - Emove any resulting duplicate timestamps from functions that
+                 inserted them in each dbprintf() line.
+               - Fix dballoc compilation.
+               - Fix dbmalloc compilation.
+               - Fix amfree() to report file and line # of amfree line during
+                 errors.
+               - Add vstrallocf() and newvstrallocf() functions. These are
+                 the same as vstralloc() and newvstralloc() except they use
+                 printf style format strings.  (Required to eliminate
+                 untranslateable string concatenations in messages.)
+               - Change files to use *allocf() functions where it seemed
+                 appropriate..
+               - Fix kerberos 4 compilation.
+               - Fix kerberos 5 compilation.
+
+2007-05-16  Jean-Louis Martineau <martineau@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/debug.c (debug_rename): Fix for cygwin: rename
+         will not overwrite an existing file
+
+2007-05-15   John Franks <jrfranks@zmanda.com> (merged by dustin@zmanda.com)
+       * client-src/sendbackup.c common-src/dgram.c common-src/event.c
+         server-src/changer.c server-src/driverio.c:
+               Cast FD_SETSIZE to int to avoid compilation problems.
+
+2007-05-15   Kevin Till <ktill@zmanda.com> (merged by dustin@zmanda.com)
+       * common-src/debug.c: dbrename patch by Jean-Louis Martineau to
+         unlink the target of the rename operation before renaming.
+
+2007-05-15  Dustin J. Mitchell <dustin@zmanda.com>
+       * client-src/sendsize.c: fix parsing of include/excludes for 
+         old clients
+
+2007-05-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcrypt-ossl-asym.sh.in: Use CLIENT_LOGIN.
+       * server-src/amcrypt-ossl.sh.in: Use CLIENT_LOGIN.
+
+2007-05-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Fix compilation.
+
+2007-05-09     Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/stream.c: add errno's to stream_client_internal
+
+2007-05-09     Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amadmin.c server-src/infofile.c
+         common-src/security-util.c common-src/krb5-security.c:
+         fix type-punning warnings
+
+2007-05-09     Dustin J. Mitchell <dustin@zmanda.com>
+       * recover-src/set_commands.c server-src/amcheck.c
+         server-src/dumper.c common-src/rsh-security.c
+         common-src/krb5-security.c common-src/util.c common-src/util.h
+         common-src/bsdtcp-security.c common-src/stream.c
+         common-src/ssh-security.c common-src/bsd-security.c
+         common-src/security-util.c common-src/bsdudp-security.c
+         common-src/security-util.h: Add IPv6-savvy resolve_hostname() and use it
+         everywhere
+
+2007-05-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/Makefile.am (EXTRA_DIST): Add docbook-dtd.m4i,
+         docbook-xslt.m4i, docbook-xslt-min.m4i and xsltproc.m4i.
 
 2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/stream.c: pass correct sockaddr size to bind()
 
 2007-05-07  Pieter Bowman <bowman@math.utah.edu>
        * common-src/file.c: reverse the order of chown/chmod to correctly
-                            create temporary files.
+         create temporary files.
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Fix compilation.
+
+2007-05-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/cmdline.c server-src/holding.c server-src/holding.h
+         server-src/amadmin.c server-src/amcleanupdisk.c: remove 
+         holding_file_read_header()
+
+2007-05-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/sockaddr-util.h common-src/bsdtcp-security.c common-src/security-util.c
+         common-src/krb5-security.c common-src/stream.c: add and use a copy_sockaddr() macro
+
+2007-05-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in common-src/rsh-security.c common-src/bsdtcp-security.c
+         common-src/ssh-security.c common-src/bsdudp-security.c
+         common-src/krb5-security.c common-src/krb4-security.c common-src/bsd-security.c
+         common-src/Makefile.am: use AM_CONDITIONAL to select security modules to compile
+
+2007-05-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * autogen man/Makefile.am configure.in config/acinclude.m4i
+         config/docbook-xslt-min.m4i config/docbook-dtd.m4i config/docbook-xslt.m4i
+         config/xsltproc.m4i Makefile.am: detect xsltproc, docbook xslt, and docbook
+         dtd versions better, to ensure proper creation of manpages.
+
+2007-05-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amindexd.c common-src/sockaddr-util.c common-src/sockaddr-util.h
+         common-src/util.c common-src/security-util.c common-src/amanda.h
+         common-src/dgram.c common-src/stream.c common-src/Makefile.am: add new
+         sockaddr-util.[ch] containing sockaddr-related functions.
+
+2007-05-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.3alpha)
 
 2007-05-03  Jean-Louis Martineau <martineau@zmanda.com>
        * docs/*.txt: Update from xml-docs.
 2007-01-23  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/security-util.c (tcpm_recv_token): Check size < 0.
 
+
 2007-01-23  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/diskfile.c: Check duplicate DLE with match_host and
                                 match_disk.
diff --git a/DEVELOPING b/DEVELOPING
new file mode 100644 (file)
index 0000000..8ba7d32
--- /dev/null
@@ -0,0 +1,53 @@
+Notes For Developers
+====================
+
+This document describes a few basic tasks for managing the codebase;
+see http://wiki.zmanda.com/ for more detailed developer-oriented
+documentation.
+
+Adding Gnulib Modules
+---------------------
+
+Edit the clearly marked section in gnulib/regenerate/regenerate,
+then re-run that script as directed below.
+
+Updating Gnulib
+---------------
+
+This should probably be done after most releases, so that we have
+adequate time to uncover any bugs or problems in the new gnulib before
+we make another release.
+
+To update the gnulib files included with Amanda, you'll first need a
+CVS checkout of gnulib; let's call it $GNULIB_CO.  Then, in the root
+of the Amanda source, run
+
+  GNULIB_TOOL=$GNULIB_CO/gnulib-tool ./gnulib/regenerate/regenerate
+
+Use 'svn status' to figure out what changed, and 'svn add' / 'svn rm'
+to inform Subversion.  Then re-run autogen, configure, make, and test
+the result.  If all is well, commit.
+
+Updating Libtool
+----------------
+
+Libtool includes such useful files as config/config.guess.
+Occasionally (probably right after a release), these files should be
+updated.  On a machine with libtool installed, simply run 
+  libtoolize --force --copy
+
+Then use 'svn status' to see what changed, test it out, and commit.
+
+Updating Gettext
+----------------
+
+The gettext library contains a significant number of files.  Assuming
+you have the proper version of gettext installed, these files can be
+updated by running
+
+  po/reautopoint
+
+and then adjusting as appropriate with 'svn add' / 'svn rm', testing,
+and committing.  Note that this script post-processes the results of
+autopoint rather extensively, and will probably need to be adjusted
+for a new version of autopoint.
diff --git a/INSTALL b/INSTALL
index 3b50ea95726f7ecc22188d5b672d3d06d2170da4..47bae08c3096d8bd74eed8ecc42a1b9cc1faf356 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,10 @@
 Basic Installation
 ==================
 
-   These are generic installation instructions.
+   These are generic installation instructions, and describe in
+general how to use ./configure.  For Amanda-specific installation
+instructions, including system-specific notes, please see
+http://wiki.zmanda.com.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
index 532bccec18301ebcf6d94f9ac5c615626a02dae0..b6824ac0578d82e12055982a74c3687032f5e64a 100644 (file)
@@ -1,11 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 AUTOMAKE_OPTIONS = 1.4 foreign
 
-ACINCLUDE_M4 = $(srcdir)/acinclude.m4
-ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i
-LIBTOOL_M4I = $(srcdir)/config/libtool.m4i
-GNULIB_M4I  = $(srcdir)/config/gnulib.m4i
-ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
+ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive
 
 if WANT_CLIENT
 CLIENT_SUBDIRS = client-src dumper-src
@@ -14,7 +10,7 @@ if WANT_TAPE
 TAPE_SUBDIRS = tape-src
 endif
 if WANT_SERVER
-SERVER_SUBDIRS = server-src changer-src
+SERVER_SUBDIRS = device-src server-src changer-src
 endif
 if WANT_RESTORE
 RESTORE_SUBDIRS = restore-src
@@ -37,11 +33,18 @@ SUBDIRS = \
        $(RESTORE_SUBDIRS) \
        $(RECOVER_SUBDIRS) \
        $(PLOT_SUBDIRS) \
-       man docs example
+       perl \
+       po \
+       man \
+       example \
+       packaging \
+       installcheck
 
 pkgdata_DATA = \
-       ReleaseNotes                    \
-       COPYRIGHT
+       ReleaseNotes    \
+       COPYRIGHT       \
+       NEWS            \
+       ChangeLog
 
 EXTRA_DIST = $(SNAPSHOT_STAMP) \
        $(pkgdata_DATA)                 \
@@ -64,11 +67,9 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \
        contrib/gsc/ucfggsc.c           \
        patches/regex-3.6alpha.patch    \
        patches/samba-largefs.patch     \
-       patches/tar-1.12.patch
-
-$(ACINCLUDE_M4): $(ACINCLUDE_M4_DEPS)
-       @-rm -f $@
-       @cat $(ACINCLUDE_M4_DEPS) > $@
+       patches/tar-1.12.patch          \
+       UPGRADING                       \
+       DEVELOPING
 
 libtool: $(LIBTOOL_DEPS)
        $(SHELL) ./config.status --recheck
@@ -96,3 +97,7 @@ lint:
 
 dist-hook:
        find $(distdir)/. -name '*.test.c' -exec rm {} \;
+
+# ensure that configure gets the right arguments for distcheck; this keeps the
+# user/group through to the distcheck, rather than defaulting back to 'amanda'.
+DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes
index 1679e3c85ebad42c0fbe63692dd1361a305afe06..7119e180d223a9a10ff413387ead870f73d9b808 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 @SET_MAKE@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -39,61 +35,139 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS \
-       ChangeLog INSTALL NEWS
+       $(srcdir)/Makefile.in $(top_srcdir)/configure \
+       $(top_srcdir)/example/template.d/advanced.conf.in \
+       $(top_srcdir)/example/template.d/amanda-S3.conf.in \
+       $(top_srcdir)/example/template.d/amanda-harddisk.conf.in \
+       $(top_srcdir)/example/template.d/amanda-single-tape.conf.in \
+       $(top_srcdir)/example/template.d/amanda-tape-changer.conf.in \
+       AUTHORS ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
+ configure.lineno config.status.lineno
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = example/template.d/amanda-S3.conf \
+       example/template.d/advanced.conf \
+       example/template.d/amanda-harddisk.conf \
+       example/template.d/amanda-single-tape.conf \
+       example/template.d/amanda-tape-changer.conf
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        html-recursive info-recursive install-data-recursive \
-       install-exec-recursive install-info-recursive \
-       install-recursive installcheck-recursive installdirs-recursive \
-       pdf-recursive ps-recursive uninstall-info-recursive \
-       uninstall-recursive
+       install-dvi-recursive install-exec-recursive \
+       install-html-recursive install-info-recursive \
+       install-pdf-recursive install-ps-recursive install-recursive \
+       installcheck-recursive installdirs-recursive pdf-recursive \
+       ps-recursive uninstall-recursive
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -103,11 +177,14 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 am__installdirs = "$(DESTDIR)$(pkgdatadir)"
 pkgdataDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(pkgdata_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = gnulib config common-src amandad-src tape-src \
-       client-src dumper-src server-src changer-src restore-src \
-       recover-src oldrecover-src amplot man docs example
+       client-src dumper-src device-src server-src changer-src \
+       restore-src recover-src oldrecover-src amplot perl po man \
+       example packaging installcheck
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -119,15 +196,14 @@ DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -135,14 +211,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -153,20 +234,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -180,60 +260,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -243,10 +432,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -257,24 +460,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -286,59 +523,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -347,34 +571,37 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = 1.4 foreign
-ACINCLUDE_M4 = $(srcdir)/acinclude.m4
-ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i
-LIBTOOL_M4I = $(srcdir)/config/libtool.m4i
-GNULIB_M4I = $(srcdir)/config/gnulib.m4i
-ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
+ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive
 @WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src dumper-src
 @WANT_TAPE_TRUE@TAPE_SUBDIRS = tape-src
-@WANT_SERVER_TRUE@SERVER_SUBDIRS = server-src changer-src
+@WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src
 @WANT_RESTORE_TRUE@RESTORE_SUBDIRS = restore-src
 @WANT_RECOVER_TRUE@RECOVER_SUBDIRS = recover-src oldrecover-src
 @WANT_AMPLOT_TRUE@PLOT_SUBDIRS = amplot
@@ -390,11 +617,18 @@ SUBDIRS = \
        $(RESTORE_SUBDIRS) \
        $(RECOVER_SUBDIRS) \
        $(PLOT_SUBDIRS) \
-       man docs example
+       perl \
+       po \
+       man \
+       example \
+       packaging \
+       installcheck
 
 pkgdata_DATA = \
-       ReleaseNotes                    \
-       COPYRIGHT
+       ReleaseNotes    \
+       COPYRIGHT       \
+       NEWS            \
+       ChangeLog
 
 EXTRA_DIST = $(SNAPSHOT_STAMP) \
        $(pkgdata_DATA)                 \
@@ -417,9 +651,15 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \
        contrib/gsc/ucfggsc.c           \
        patches/regex-3.6alpha.patch    \
        patches/samba-largefs.patch     \
-       patches/tar-1.12.patch
+       patches/tar-1.12.patch          \
+       UPGRADING                       \
+       DEVELOPING
 
 CONFIG_STATUS = config.status
+
+# ensure that configure gets the right arguments for distcheck; this keeps the
+# user/group through to the distcheck, rather than defaulting back to 'amanda'.
+DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes
 all: all-recursive
 
 .SUFFIXES:
@@ -456,6 +696,16 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+example/template.d/amanda-S3.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-S3.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+example/template.d/advanced.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/advanced.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+example/template.d/amanda-harddisk.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-harddisk.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+example/template.d/amanda-single-tape.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-single-tape.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+example/template.d/amanda-tape-changer.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-tape-changer.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -465,10 +715,9 @@ clean-libtool:
 
 distclean-libtool:
        -rm -f libtool
-uninstall-info-am:
 install-pkgdataDATA: $(pkgdata_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)"
+       test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
        @list='$(pkgdata_DATA)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          f=$(am__strip_dir) \
@@ -515,8 +764,7 @@ $(RECURSIVE_TARGETS):
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
 
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
+$(RECURSIVE_CLEAN_TARGETS):
        @failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
@@ -618,24 +866,22 @@ distclean-tags:
 
 distdir: $(DISTFILES)
        $(am__remove_distdir)
-       mkdir $(distdir)
-       $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/config/gnulib $(distdir)/contrib $(distdir)/contrib/gsc $(distdir)/dumper-src $(distdir)/example $(distdir)/patches $(distdir)/server-src
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -649,7 +895,7 @@ distdir: $(DISTFILES)
        list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
            test -d "$(distdir)/$$subdir" \
-           || $(mkdir_p) "$(distdir)/$$subdir" \
+           || $(MKDIR_P) "$(distdir)/$$subdir" \
            || exit 1; \
            distdir=`$(am__cd) $(distdir) && pwd`; \
            top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
@@ -657,6 +903,8 @@ distdir: $(DISTFILES)
              $(MAKE) $(AM_MAKEFLAGS) \
                top_distdir="$$top_distdir" \
                distdir="$$distdir/$$subdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
                distdir) \
              || exit 1; \
          fi; \
@@ -667,7 +915,7 @@ distdir: $(DISTFILES)
        -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+         ! -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
@@ -742,7 +990,7 @@ distcheck: dist
        $(am__remove_distdir)
        @(echo "$(distdir) archives ready for distribution: "; \
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
-         sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
        @cd $(distuninstallcheck_dir) \
        && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
@@ -767,7 +1015,7 @@ all-am: Makefile $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
        for dir in "$(DESTDIR)$(pkgdatadir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-recursive
 install-exec: install-exec-recursive
@@ -815,12 +1063,20 @@ info-am:
 
 install-data-am: install-pkgdataDATA
 
+install-dvi: install-dvi-recursive
+
 install-exec-am:
 
+install-html: install-html-recursive
+
 install-info: install-info-recursive
 
 install-man:
 
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -841,30 +1097,28 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pkgdataDATA
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
-       check-am clean clean-generic clean-libtool clean-recursive \
-       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-       dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
-       distclean-generic distclean-libtool distclean-recursive \
-       distclean-tags distcleancheck distdir distuninstallcheck dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-exec install-exec-am \
-       install-info install-info-am install-man install-pkgdataDATA \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       maintainer-clean-recursive mostlyclean mostlyclean-generic \
-       mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
-       tags tags-recursive uninstall uninstall-am uninstall-info-am \
-       uninstall-pkgdataDATA
+uninstall-am: uninstall-pkgdataDATA
 
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+       install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+       all all-am am--refresh check check-am clean clean-generic \
+       clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
+       distclean distclean-generic distclean-libtool distclean-tags \
+       distcleancheck distdir distuninstallcheck dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-pkgdataDATA install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags tags-recursive uninstall uninstall-am \
+       uninstall-pkgdataDATA
 
-$(ACINCLUDE_M4): $(ACINCLUDE_M4_DEPS)
-       @-rm -f $@
-       @cat $(ACINCLUDE_M4_DEPS) > $@
 
 libtool: $(LIBTOOL_DEPS)
        $(SHELL) ./config.status --recheck
diff --git a/NEWS b/NEWS
index 2fb19021f21cf9c0ef85571abe61a0e275e6a39b..02362b7ee8e241025f4b64791e056434e145d58b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,43 @@
+Changes in release 2.6.0
+
+   * configure --disable-shared doesn't work because perl modules require
+     shared libraries.  Use configure --with-static-binaries to build
+     statically linked binaries.
+   * 'amverify' and 'amverifyrun' are deprecated and replaced with the
+     new, more flexible 'amcheckdump'
+   * 'amdd' and 'ammt' are deprecated.
+   * Some Amanda files are now installed in new "amanda/" subdirectories:
+     libraries are now installed in $libdir/amanda and internal programs
+     are now installed in $libexecdir/amanda. You can set --with-amlibdir
+     and --with-amlibexecdir if you don't want the amanda suffix.
+     If you mix 2.6.0 and earlier version with rsh/ssh auth, you need to
+     add an 'amandad_path' to the dumptype and to amanda-client.conf
+   * The amandates file, previously at /etc/amandates, is now at
+     $localstatedir/amanda/amandates.  You may want to move your existing
+     /etc/amandates when you upgrade Amanda.
+   * New 'amcryptsimple', 'amgpgcrypt' - encryption plugins based on gpg.
+   * New 'amserverconfig', 'amaddclient' - Initial Amanda configuration tools
+     these tools make assumptions, please see man page.
+   * Many bugs fixed and code rewrite/cleanup.
+     Speedup in 'amrecover find' and starting amrecover.
+   * glib is required to compile and run amanda.
+   * Device API: pluggable interface to storage devices, supporting tapes,
+     vtapes, RAIT, and Amazon S3
+   * New perl modules link directly to Amanda, to support writing Amanda
+     applications in Perl. Perl module are installed by default in the perl
+     installsitelib directory. It can be changed with
+     'configure --with-amperldir'.
+   * New 'local' security driver supports backups of the amanda server
+     without any network connection or other configuration.
+   * Almost 200 unit tests are available via 'make installcheck'.
+   * Amanda configuration file changes
+         o amanda.conf changes
+               + flush-threshold-dumped
+               + flush-threshold-scheduled
+               + taperflush
+               + device_property
+               + usetimestamps default to yes
+
 Changes in release 2.5.2p1
 
    * Many bugs fixed
@@ -24,8 +64,6 @@ Changes in release 2.5.2
                  see all debug_* config option
                + tapetype 'readblocksize', if maxtapeblocksize is set too
                  larger for your hardware
-   * Amanda command changes
-         o amadmin: new 'holding list' and 'holding delete' subcommand.
 
 Changes in release 2.5.1p3
 
index 47d9399bd864a8a7c7b2dc482b0cf0ef5143b58a..e6f11b26a9e126fa8854ea44e024b022ff00afa3 100644 (file)
@@ -1,3 +1,102 @@
+               Release Notes for amanda-2.6.0
+
+amcheckdump
+  New program written entirely in perl, it replaces 'amverify' and
+  'amveryfyrun'
+
+amcryptsimple, amgpgcrypt
+  New encryption plugins based on gpg.
+
+amserverconfig, amaddclient
+  New Initial Amanda configuration tools, these tools make assumptions,
+   please see man page.
+
+Deprecated programs
+  'amverify' and 'amveryfyrun' are deprecated -- use amcheckdump.
+  'amdd' and 'ammt' are also deprecated. If you have scripts that use
+  them, then you must rewrite them in perl using the new perl modules.
+
+Configure options
+  --disable-shared doesn't work because perl modules require shared library.
+  Instead, use --with-static-binaries to build statically linked binaries.
+  --with-amlibdir, libraries are now installed in $amlibdir
+    --without-amlibdir              : amlibdir=$libdir
+    --with-amlibdir=yes             : amlibdir=$libdir/amanda  (default value)
+    --with-amlibdir=/path/to/libdir : amlibdir=/path/to/libdir
+  --with-amlibexecdir, internal programs are installed in $amlibexecdir
+    --without-amlibexecdir                  : amlibdir=$libexecdir
+    --with-amlibexecdir=yes                 : amlibdir=$libexecdir/amanda
+                                                             (default value)
+    --with-amlibexecdir=/path/to/libexecdir : amlibdir=/path/to/libexecdir
+  --with-amperldir, Where to install perl modules
+    --without-amperldir               : amperldir=$amlibdir/perl
+    --with-amperldir=yes              : amperldir= $(perl installsitelib)
+                                                                (default value)
+    --with-amperldir=/path/to/perldir : amperldir=/path/to/perldir
+
+Path changes
+  Libraries are installed in $amlibdir (previously $libdir)
+  Internal programs are installed in $amlibexecdir (previously $libexecdir)
+  You must change your inetd/xinetd config for the new amandad path.
+  The amandad path change affect rsh/ssh auth, amanda-2.6.0 installations
+  will need to add an 'amandad_path' parameter to configuration files in
+  order to talk to older versions of Amanda:
+     amanda-2.6.0 client -> amanda-2.5.2 or earlier server: add
+       'amandad_path "/usr/libexec/amandad"' (or the appropriate path) to
+       /etc/amanda/amanda-client.conf
+     amanda-2.5.2 or earlier client -> amanda-2.6.0 server: add
+       'amandad_path "/usr/libexec/amanda/amandad"' (or the appropriate path)
+       to /etc/amanda/amanda-client.conf
+     amanda-2.6.0 server -> amanda-2.5.2 or earlier client: add
+       'amandad_path "/usr/libexec/amandad"' (or the appropriate path) to the
+       dumptype
+     amanda-2.5.2 or earlier server -> amanda-2.6.0 client: add
+       'amandad_path "/usr/libexec/amanda/amandad"' (or the appropriate path)
+       to the dumptype
+  The amandates files is now $localstatedir/amanda/amandates, previously it
+  was /etc/amandates, this file must be created on all client.
+
+usetimestamps
+  It now defaults to 'yes'.
+
+Glib
+  glib is required to compile and run amanda.
+  It is free and can be downloaded form http://www.gtk.org/download/
+
+Device API
+  The Device API is a complete rewrite of all tape-access functionality.
+  To use the Device API, all devices must be specified by their full
+  name, e.g., tape:/dev/nst0.  Existing functionality is now available
+  in the tape, file, and rait devices, and a new Amazon S3 backend named
+  's3' is also available.
+
+Perl Module
+  Link directly to Amanda, to support writing Amanda applications in Perl
+  Available Modules:
+    Changer (Execute changer scripts)
+    Cmdline (Parse command line argument)
+    Config (Parse config files)
+    Device (device-api)
+    Debug (Write to debug files)
+    Logfile (Parse log files)
+    Tapefile (Parse tapelist file)
+  Perl modules are installed in $amperldir
+
+local security driver (auth)
+  Allows backups of the Amanda server without any need for network
+  configuration, and similarly allows amrecover to work on the Amanda
+  server without any network configuration.
+
+make installcheck
+  Almost 200 unit tests are available, which should be run on an installed
+  copy of Amanda.  See http://wiki.zmanda.com/index.php/Testing for more
+  information.
+
+flush-threshold-dumped, flush-threshold-scheduled, taperflush
+  These three config options allow to better fill your tapes.
+  They are what was known as the taperstart/taperflush feature.
+
+
                Release Notes for amanda-2.5.2
 
 IPv6
diff --git a/UPGRADING b/UPGRADING
new file mode 100644 (file)
index 0000000..4e012b7
--- /dev/null
+++ b/UPGRADING
@@ -0,0 +1,69 @@
+Upgrading
+=========
+
+This file describes the process for ugprading Amanda from a previous
+version.  In general, the Amanda development team aims for seamless
+upgrades.  In the rare cases where an upgrade requires other changes
+on your system, they are described in this file.
+
+The file is organized from oldest to newest.  Please follow all of
+the directions, in order, for the range of versions over which you
+are upgrading.
+
+See also http://wiki.zmanda.com/index.php/Version_compatibility for notes
+on the compatibility of various versions of Amanda.
+
+Upgrading from pre-2.4.0
+------------------------
+
+Amanda 2.4.0 has introduced a major incompatibility in the Amanda protocol.
+This means that pre-2.4.0 clients won't interoperate with a 2.4.0 server, nor
+will 2.4.0 clients interoperate with pre-2.4.0 servers. You have to upgrade
+them all at the same time.
+
+To ease the upgrade process Amanda has, from release 2.4.0 on, a configure flag
+(--with-testing) that will cause Amanda to use alternate service names (Amanda-
+test) instead of the standard ones. This allows you to keep using your old
+version of Amanda while you test the new one.
+
+Depending upon the version of Amanda you are upgrading from, Amanda may use a
+different database library to store the backup information, and the new Amanda
+may not be able to read the old Amanda database files. In this case, you will
+want to do something like the following:
+
+Before the upgrade (using the old version of amadmin):
+
+       # cd /var/AMANDA/CONFIG
+       # amadmin CONFIG export > zzz
+       # mkdir backup
+       # mv curinfo* backup
+       
+
+and after the upgrade (using the new version of amadmin):
+
+       # cd /var/AMANDA/CONFIG
+       # amadmin CONFIG import < zzz
+       
+
+and a month :-) after you are happy with the new version:
+
+       # cd /var/AMANDA/CONFIG
+       # rm -rf backup
+       
+
+After 2.4.0, the structure of the directory holding the index files was changed
+to have three levels instead of being flat. This greatly reduces the number of
+files in a given directory, which was a problem for some systems.
+
+The new layout is:
+
+  [indexdir]/hostname/filesystem/YYYYMMDD_L.gz
+
+where hostname and filesystem are "sanitized" versions of the names from
+disklist, i.e. '/' characters are converted to '_' and so on. This new naming
+convention matches the one used for the text formatted database.
+
+A script is available to convert the flat directory structure to the new
+layout:
+
+  http://www.amanda.org/2.4-conv/msg00428.html
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644 (file)
index 0451d2a..0000000
+++ /dev/null
@@ -1,7475 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.
-
-# serial 47 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-                [m4_ifdef([AC_PROVIDE_$1],
-                          [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-       [AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-            [define([LT_AC_PROG_GCJ],
-               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-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
-
-# 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 to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-       [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/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.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# 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.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-        [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-[$]*
-EOF
-  exit 0
-fi
-
-# 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
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
-
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
-
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
-       fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-    [AC_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 __oline__ "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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          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-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          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_TRY_LINK([],[],[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
-  ;;
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-  ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
-else
-    ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   printf "$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 "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
-       $SED '/^$/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
-else
-    ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# 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*)
-    # 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;
-    ;;
-
-  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`
-    ;;
-  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
-    ;;
-  *)
-    # 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.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-              = "XX$teststring") >/dev/null 2>&1 &&
-           new_result=`expr "X$teststring" : ".*" 2>&1` &&
-           lt_cv_sys_max_cmd_len=$new_result &&
-           test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    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`
-    ;;
-  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
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
-[#line __oline__ "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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=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;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}]
-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_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_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*)
-    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="-dld"],
-       [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="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  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"
-    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_AC_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
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_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
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_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 ..
-   rmdir conftest
-   $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_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
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_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
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[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"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
-  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'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  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*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  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*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # 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}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  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
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-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='GNU ld.so'
-  ;;
-
-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[[123]]*) 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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-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
-  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'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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 Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;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'
-  ;;
-
-knetbsd*-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='GNU ld.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
-  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=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=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  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"
-  ;;
-
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
-
-solaris*)
-  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=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.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      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
-    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
-  ;;
-
-uts4*)
-  version_type=linux
-  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
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-    fi
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-       ;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-           (test "X$CXX" != "Xg++"))) ; then
-         AC_LIBTOOL_LANG_CXX_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      F77)
-       if test -n "$F77" && test "X$F77" != "Xno"; then
-         AC_LIBTOOL_LANG_F77_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      GCJ)
-       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-         AC_LIBTOOL_LANG_GCJ_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      RC)
-       AC_LIBTOOL_LANG_RC_CONFIG
-       ;;
-
-      *)
-       AC_MSG_ERROR([Unsupported tag name: $tagname])
-       ;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-       [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-#- set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-       [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
-
-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
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_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
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_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])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])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])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-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
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[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
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise 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
-aix4* | aix5*)
-  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'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | kfreebsd*-gnu | 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
-  ;;
-
-gnu*)
-  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]) 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
-  ;;
-
-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 Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  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=unknown
-  ;;
-
-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
-  ;;
-
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  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
-    ;;
-  esac
-  ;;
-
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-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
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}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"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ---------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-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
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# --------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[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_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
-    ;;
-  esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
-  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
-  else
-    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
-    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
-  fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
-
-## 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...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-# Report which librarie types wil 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
-  ;;
-
-aix4* | aix5*)
-  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])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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_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
-  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
-  unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  aix4* | aix5*)
-    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]].*|aix5*)
-       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_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    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
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-       else
-         # We have old collect2
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_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
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-       # -bexpall does not export symbols beginning with underscore (_)
-       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-       # Exported symbols can be pulled into shared objects from archives
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-       # This is similar to how AIX traditionally builds its shared libraries.
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-  chorus*)
-    case $cc_basename in
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          _LT_AC_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'
-        fi
-        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      ghcx*)
-       # Green Hills C++ Compiler
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      case $host_cpu in
-      hppa*64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-        ;;
-      ia64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        ;;
-      *)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                             # but as the default
-                                             # location of the library.
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      aCC*)
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-         ;;
-       *)
-         _LT_AC_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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test $with_gnu_ld = no; then
-           case $host_cpu in
-           ia64*|hppa*64*)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-             ;;
-           *)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-       # SGI C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-         else
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-         fi
-       fi
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-       ;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux*)
-    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_AC_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_AC_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; echo $list'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-       _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-       ;;
-      icpc*)
-       # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-       ;;
-      pgCC*)
-        # Portland Group C++ compiler
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-       _LT_AC_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'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-       # Compaq C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_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::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    _LT_AC_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_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-         _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_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 "\-L"'
-
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       # Archives containing C++ object files must be created using
-       # the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_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 "\-L"'
-
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sco*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case $cc_basename in
-      CC*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.x
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      lcc*)
-       # Lucid
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       case $host_os in
-         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-         *)
-           # The C++ compiler is used as linker so we must use $wl
-           # flag to pass the commands to the underlying system
-           # linker. We must also pass each convience library through
-           # to the system linker between allextract/defaultextract.
-           # The C++ compiler will combine linker options so we
-           # cannot just pass the convience library names through
-           # without $wl.
-           # Supported since Solaris 2.6 (maybe 2.5.1?)
-           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-           ;;
-       esac
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-       output_verbose_link_cmd='echo'
-
-       # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-       ;;
-      gcx*)
-       # Green Hills C++ Compiler
-       _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-         if $CC --version | grep -v '^2\.7' > /dev/null; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $CC -shared -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 \"\-L\""
-         else
-           # g++ 2.7 appears to require `-G' NOT `-shared' on this
-           # platform.
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_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 \"\-L\""
-         fi
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-       fi
-       ;;
-    esac
-    ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-       # NonStop-UX NCC 3.20
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_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...
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-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
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([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.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-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...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-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
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $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
-       else
-        prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        case $p 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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-          else
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
-          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-        else
-          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-        fi
-       fi
-       ;;
-
-    *.$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_AC_TAGVAR(predep_objects, $1)"; then
-          _LT_AC_TAGVAR(predep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-        fi
-       else
-        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-solaris*)
-  case $cc_basename in
-  CC*)
-    # 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.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
-    ;;
-  esac
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-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
-  ;;
-aix4* | aix5*)
-  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])
-
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_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...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# 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_AC_SYS_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"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then 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
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
-
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
-
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
-
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# 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.
-
-# 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//"
-
-# 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
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
-  case $host_os in
-  aix3*)
-    cat <<\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
-EOF
-    ;;
-  esac
-
-  # 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)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-])
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# 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]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDGIRSTW]]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris* | sysv5*)
-  symcode='[[BDRT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# 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
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, 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.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-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 <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_save_LIBS="$LIBS"
-         lt_save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$_LT_AC_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_save_LIBS"
-         CFLAGS="$lt_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 -f 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
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | os2* | pw32*)
-      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # 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*)
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix4* | aix5*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       else
-         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_AC_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
-       ;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           if test "$host_cpu" != ia64; then
-             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-           fi
-           ;;
-         aCC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux*)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         icpc* | ecpc*)
-           # Intel C++
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         pgCC*)
-           # Portland Group C++ compiler.
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      sco*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      unixware*)
-       ;;
-      vxworks*)
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-       ;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | pw32* | os2*)
-      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    sco3.2v5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # 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
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-],[
-  runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
-  # 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.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # 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
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [[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
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_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'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       _LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       case $cc_basename,$host_cpu in
-       pgcc*)                          # Portland Group C compiler
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
-       esac
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-       if test $supports_anon_versioning = yes; then
-         _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-       fi
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<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.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix4* | aix5*)
-      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
-       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-       else
-         _LT_AC_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]].*|aix5*)
-         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_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-      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
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         else
-         # We have old collect2
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_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
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-       if test "$host_cpu" = ia64; then
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        _LT_AC_SYS_LIBPATH_AIX
-        _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         # -bexpall does not export symbols beginning with underscore (_)
-         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-         # Exported symbols can be pulled into shared objects from archives
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # 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.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-         ;;
-       ia64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       *)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    openbsd*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      else
-       case $host_os in
-        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-          ;;
-        *)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-          ;;
-       esac
-      fi
-      ;;
-
-    os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_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~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    sco3.2v5*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       wlarc=''
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_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'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-       # The compiler driver will combine linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
-       *)
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-        ;;
-       motorola)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4.2uw2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
-
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv5*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_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'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
-      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-        then
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-############################################################
-# 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.                               #
-############################################################
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_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
-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_MSG_RESULT([$SED])
-])
-m4_include([config/gnulib/absolute-header.m4])
-m4_include([config/gnulib/alloca.m4])
-m4_include([config/gnulib/arpa_inet_h.m4])
-m4_include([config/gnulib/eoverflow.m4])
-m4_include([config/gnulib/extensions.m4])
-m4_include([config/gnulib/getaddrinfo.m4])
-m4_include([config/gnulib/gnulib-cache.m4])
-m4_include([config/gnulib/gnulib-common.m4])
-m4_include([config/gnulib/gnulib-comp.m4])
-m4_include([config/gnulib/gnulib-tool.m4])
-m4_include([config/gnulib/inet_ntop.m4])
-m4_include([config/gnulib/intmax_t.m4])
-m4_include([config/gnulib/inttypes_h.m4])
-m4_include([config/gnulib/lib-ld.m4])
-m4_include([config/gnulib/lib-link.m4])
-m4_include([config/gnulib/lib-prefix.m4])
-m4_include([config/gnulib/lock.m4])
-m4_include([config/gnulib/longdouble.m4])
-m4_include([config/gnulib/longlong.m4])
-m4_include([config/gnulib/netinet_in_h.m4])
-m4_include([config/gnulib/onceonly_2_57.m4])
-m4_include([config/gnulib/size_max.m4])
-m4_include([config/gnulib/snprintf.m4])
-m4_include([config/gnulib/socklen.m4])
-m4_include([config/gnulib/sockpfaf.m4])
-m4_include([config/gnulib/stdbool.m4])
-m4_include([config/gnulib/stdint_h.m4])
-m4_include([config/gnulib/strdup.m4])
-m4_include([config/gnulib/string_h.m4])
-m4_include([config/gnulib/sys_socket_h.m4])
-m4_include([config/gnulib/vasnprintf.m4])
-m4_include([config/gnulib/visibility.m4])
-m4_include([config/gnulib/wchar_t.m4])
-m4_include([config/gnulib/wint_t.m4])
-m4_include([config/gnulib/xsize.m4])
-dnl Check if the compiler can handle unsigned long constants, ie 2ul.
-AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS],
-    [
-       AC_CACHE_CHECK(
-           [for working unsigned long constants],
-           amanda_cv_c_unsigned_long_constants,
-           [
-               AC_TRY_COMPILE(
-                   [
-                   ],
-                   [
-                       long l = 1ul;
-                   ],
-                   amanda_cv_c_unsigned_long_constants=yes,
-                   amanda_cv_c_unsigned_long_constants=no
-               )
-           ]
-       )
-       if test "$amanda_cv_c_unsigned_long_constants" = yes; then
-           AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ])
-       fi
-    ]
-)
-
-dnl Check for the argument type for shmat() and shmdt()
-AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for shmdt() argument type],
-           amanda_cv_shmdt_arg_type,
-           [
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
-
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ])
-    ]
-)
-
-dnl Figure out the select() argument type.
-AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for select() argument type],
-           amanda_cv_select_arg_type,
-           [
-               rm -f conftest.c
-               cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#  include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int main()
-{
-#ifdef FD_SET_POINTER
-       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
-#else
-       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
-#endif
-       return 0;
-}
-EOF
-
-               dnl Figure out the select argument type by first trying to
-               dnl compile with the fd_set argument.  If the compile fails,
-               dnl then we know to use the int.  If it suceeds, then try to
-               dnl use the int.  If the int fails, then use fd_set.  If
-               dnl both suceeed, then do a line count on the number of
-               dnl lines that the compiler spit out, assuming that the
-               dnl compile outputing more lines had more errors.
-               amanda_cv_select_arg_type=no
-               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
-               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
-               if test $? -ne 0; then
-                   amanda_cv_select_arg_type=int
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
-                   if test $? -ne 0; then
-                       amanda_cv_select_arg_type=fd_set
-                   fi
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   wc_fdset=`wc -l <conftest.fd_set`
-                   wc_int=`wc -l <conftest.int`
-                   if test "$wc_fdset" -le "$wc_int"; then
-                       amanda_cv_select_arg_type=fd_set
-                   else
-                       amanda_cv_select_arg_type=int
-                   fi
-               fi
-               rm -f conftest*
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
-    ]
-)
-
-dnl Check if setsockopt can use the SO_SNDTIMEO option.
-dnl This defines HAVE_SO_SNDTIMEO if setsockopt works
-dnl with SO_SNDTIMEO.
-AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
-    [
-       AC_CACHE_CHECK(
-           [for setsockopt SO_SNDTIMEO option],
-           amanda_cv_setsockopt_SO_SNDTIMEO,
-           [
-               AC_TRY_RUN(
-                   [
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
-
-main() {
-#ifdef SO_SNDTIMEO
-    int sock = socket(AF_INET, SOCK_STREAM, 0);
-    struct timeval timeout;
-    timeout.tv_sec = 1;
-    timeout.tv_usec = 0;
-    return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
-             (void *)&timeout, sizeof(timeout)));
-#else
-    return -1;
-#endif
-}
-                   ],
-                   amanda_cv_setsockopt_SO_SNDTIMEO=yes,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no
-               )
-           ]
-       )
-       if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
-           AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
-       fi
-    ]
-)
-
-dnl Check for the one or two argument version of gettimeofday.
-AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
-    [
-       AC_REQUIRE([AC_HEADER_TIME])
-       AC_CACHE_CHECK(
-           [for gettimeofday number of arguments],
-           amanda_cv_gettimeofday_args,
-           [
-               AC_TRY_COMPILE(
-                   [
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
-                   ],
-                   [
-                       struct timeval val;
-                       struct timezone zone;
-                       gettimeofday(&val, &zone);
-                   ],
-                   amanda_cv_gettimeofday_args=2,
-                   amanda_cv_gettimeofday_args=1
-               )
-           ]
-       )
-       if test "$amanda_cv_gettimeofday_args" = 2; then
-           AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
-       fi
-    ]
-)
-
-
-
-dnl Check for if pid_t is a long, int, or short.
-AC_DEFUN([AMANDA_TYPE_PID_T],
-    [
-       AC_REQUIRE([AC_TYPE_PID_T])
-       AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
-           [
-               amanda_cv_pid_type=unknown
-               if test "$ac_cv_type_pid_t" = no; then
-                   amanda_cv_pid_type=int
-               fi
-               for TEST_amanda_cv_pid_type in long short int; do
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                           ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                               ZZZZ pid_t
-                       ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-               done
-               if test $amanda_cv_pid_type = unknown; then
-                   amanda_cv_pid_type=int
-               fi
-           ]
-       )
-       case $amanda_cv_pid_type in
-           int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
-           long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
-           short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
-       esac
-    ]
-)
-
-dnl
-dnl
-dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
-dnl If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
-dnl in one of the headers named in the whitespace-separated list 
-dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
-dnl
-AC_DEFUN([ICE_CHECK_DECL],
-[
-ice_have_$1=no
-AC_CHECK_FUNCS($1, ice_have_$1=yes)
-if test "${ice_have_$1}" = yes; then
-AC_MSG_CHECKING(for $1 declaration in $2)
-AC_CACHE_VAL(ice_cv_have_$1_decl,
-[
-ice_cv_have_$1_decl=no
-changequote(,)dnl
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-changequote([,])dnl
-for header in $2; do
-# Check for ordinary declaration
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*$ice_re_params\(\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-done
-])
-AC_MSG_RESULT($ice_cv_have_$1_decl)
-if test "$ice_cv_have_$1_decl" = yes; then
-AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
-fi
-fi
-])dnl
-dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
-dnl by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
-dnl
-dnl     FIXME: These tests should have been in autoconf 1.11!
-dnl
-dnl     Note that we cannot simply grep for 'union wait' in the wait.h file,
-dnl     because some Posix systems turn this on only when a BSD variable is
-dnl     defined. Since I'm trying to do without special defines, I'll live
-dnl     with the default behavior of the include-file.
-dnl
-dnl     I do _2_ compile checks, because we may have union-wait, but the
-dnl     prototype for 'wait()' may want an int.
-dnl
-dnl     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
-dnl     that if we've got union-wait, we'll automatically use it.
-dnl
-dnl Garrett Wollman adds:
-dnl    The tests described above don't quite do the right thing,
-dnl    since some systems have hacks which allow `union wait' to
-dnl    still work even though `int' is preferred (and generates
-dnl    fewer warnings).  Since all of these systems use prototypes,
-dnl    we can use the prototype of wait(2) to disambiguate them.
-dnl
-dnl Alexandre Oliva adds:
-dnl     A single compile check is enough.  If we don't have union wait,
-dnl     it's obvious that the test will fail, and that we must use int.
-dnl     If we do, the prototype (on STDC systems) and WIFEXITED will tell
-dnl     whether we're supposed to be using union wait instead of int.
-dnl
-AC_DEFUN([CF_WAIT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
-
-#ifdef __STDC__
-pid_t wait(union wait *);
-#endif
-], [
-  union wait x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
-if test $cf_cv_arg_union_wait = yes; then
-       AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ])
-fi
-])dnl
-AC_DEFUN([CF_WAIT_INT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
-
-#ifdef __STDC__
-pid_t wait(int *);
-#endif
-], [
-  int x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
-if test $cf_cv_arg_int = yes; then
-        AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ])
-fi
-])dnl
-
-dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
-dnl
-dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
-dnl existence of an include file <stdint.h> that defines a set of 
-dnl typedefs, especially uint8_t,int32_t,uintptr_t.
-dnl Many older installations will not provide this file, but some will
-dnl have the very same definitions in <inttypes.h>. In other enviroments
-dnl we can use the inet-types in <sys/types.h> which would define the
-dnl typedefs int8_t and u_int8_t respectivly.
-dnl
-dnl This macros will create a local "_stdint.h" or the headerfile given as 
-dnl an argument. In many cases that file will just "#include <stdint.h>" 
-dnl or "#include <inttypes.h>", while in other environments it will provide 
-dnl the set of basic 'stdint's definitions/typedefs: 
-dnl   int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
-dnl   int_least32_t.. int_fast32_t.. intmax_t
-dnl which may or may not rely on the definitions of other files,
-dnl or using the AC_CHECK_SIZEOF macro to determine the actual
-dnl sizeof each type.
-dnl
-dnl if your header files require the stdint-types you will want to create an
-dnl installable file mylib-int.h that all your other installable header
-dnl may include. So if you have a library package named "mylib", just use
-dnl      AX_CREATE_STDINT_H(mylib-int.h) 
-dnl in configure.ac and go to install that very header file in Makefile.am
-dnl along with the other headers (mylib.h) - and the mylib-specific headers
-dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
-dnl
-dnl Remember, if the system already had a valid <stdint.h>, the generated
-dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
-dnl
-dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
-dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp
-dnl @author  Guido Draheim <guidod@gmx.de> 
-
-AC_DEFUN([AX_CHECK_DATA_MODEL],[
-   AC_CHECK_SIZEOF(char)
-   AC_CHECK_SIZEOF(short)
-   AC_CHECK_SIZEOF(int)
-   AC_CHECK_SIZEOF(long)
-   AC_CHECK_SIZEOF(void*)
-   ac_cv_char_data_model=""
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model=""
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
-   AC_MSG_CHECKING([data model])
-   case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
-    122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
-    122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
-    122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
-    124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
-    124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
-    124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
-    124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
-    128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
-    128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;         
-    222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
-    333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
-    444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
-    666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
-    888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
-    222/*|333/*|444/*|666/*|888/*) :
-                 ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
-     *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
-   esac
-   AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
-])
-
-dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
-AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
-AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
- ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_uintptr_t 
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-  done
-  AC_MSG_CHECKING([for stdint uintptr_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
-AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
- ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint uint32_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
-AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
- ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint u_int32_t])
- ])
-])
-
-AC_DEFUN([AX_CREATE_STDINT_H],
-[# ------ AX CREATE STDINT H -------------------------------------
-AC_MSG_CHECKING([for stdint types])
-ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
-# try to shortcircuit - if the default include path of the compiler
-# can find a "stdint.h" header then we assume that all compilers can.
-AC_CACHE_VAL([ac_cv_header_stdint_t],[
-old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
-old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
-old_CFLAGS="$CFLAGS"     ; CFLAGS=""
-AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
-[ac_cv_stdint_result="(assuming C99 compatible system)"
- ac_cv_header_stdint_t="stdint.h"; ],
-[ac_cv_header_stdint_t=""])
-CXXFLAGS="$old_CXXFLAGS"
-CPPFLAGS="$old_CPPFLAGS"
-CFLAGS="$old_CFLAGS" ])
-
-v="... $ac_cv_header_stdint_h"
-if test "$ac_stdint_h" = "stdint.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
-elif test "_$ac_cv_header_stdint_t" = "_" ; then
- AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
-else
- ac_cv_header_stdint="$ac_cv_header_stdint_t"
- AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
-fi
-
-if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
-
-dnl .....intro message done, now do a few system checks.....
-dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, 
-dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW 
-dnl instead that is triggered with 3 or more arguments (see types.m4)
-
-inttype_headers=`echo $2 | sed -e 's/,/ /g'`
-
-ac_cv_stdint_result="(no helpful system typedefs seen)"
-AX_CHECK_HEADER_STDINT_X(dnl
-   stdint.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-AX_CHECK_HEADER_STDINT_O(dnl,
-   inttypes.h sys/inttypes.h stdint.h $inttype_headers,
-   ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
-fi
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-if test "_$ac_cv_header_stdint_o" = "_" ; then
-AX_CHECK_HEADER_STDINT_U(dnl,
-   sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
-fi fi
-
-dnl if there was no good C99 header file, do some typedef checks...
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-   AC_MSG_CHECKING([for stdint datatype model])
-   AC_MSG_RESULT([(..)])
-   AX_CHECK_DATA_MODEL
-fi
-
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "_$ac_cv_header_stdint_o" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "_$ac_cv_header_stdint_u" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
-   ac_cv_header_stdint="stddef.h"
-fi
-
-AC_MSG_CHECKING([for extra inttypes in chosen header])
-AC_MSG_RESULT([($ac_cv_header_stdint)])
-dnl see if int_least and int_fast types are present in _this_ header.
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
-AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
-AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
-
-fi # shortcircut to system "stdint.h"
-# ------------------ PREPARE VARIABLES ------------------------------
-if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` 
-else
-ac_cv_stdint_message="using $CC"
-fi
-
-AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
-$ac_cv_stdint_result])
-
-dnl -----------------------------------------------------------------
-# ----------------- DONE inttypes.h checks START header -------------
-AC_CONFIG_COMMANDS([$ac_stdint_h],[
-AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
-ac_stdint=$tmp/_stdint.h
-
-echo "#ifndef" $_ac_stdint_h >$ac_stdint
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
-echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_t" != "_" ; then 
-echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
-echo "#include <stdint.h>" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-else
-
-cat >>$ac_stdint <<STDINT_EOF
-
-/* ................... shortcircuit part ........................... */
-
-#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <stddef.h>
-
-/* .................... configured part ............................ */
-
-STDINT_EOF
-
-echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-  ac_header="$ac_cv_header_stdint_x"
-  echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
-fi
-
-echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_o" != "_" ; then
-  ac_header="$ac_cv_header_stdint_o"
-  echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
-fi
-
-echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_u" != "_" ; then
-  ac_header="$ac_cv_header_stdint_u"
-  echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
-fi
-
-echo "" >>$ac_stdint
-
-if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
-  echo "#include <$ac_header>" >>$ac_stdint
-  echo "" >>$ac_stdint
-fi fi
-
-echo "/* which 64bit typedef has been found */" >>$ac_stdint
-if test "$ac_cv_type_uint64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
-fi
-if test "$ac_cv_type_u_int64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* which type model has been detected */" >>$ac_stdint
-if test "_$ac_cv_char_data_model" != "_" ; then
-echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
-echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
-else
-echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
-echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* whether int_least types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_least32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
-fi
-echo "/* whether int_fast types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_fast32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
-fi
-echo "/* whether intmax_t type was detected */" >>$ac_stdint
-if test "$ac_cv_type_intmax_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-  cat >>$ac_stdint <<STDINT_EOF
-/* .................... detections part ............................ */
-
-/* whether we need to define bitspecific types from compiler base types */
-#ifndef _STDINT_HEADER_INTPTR
-#ifndef _STDINT_HEADER_UINT32
-#ifndef _STDINT_HEADER_U_INT32
-#define _STDINT_NEED_INT_MODEL_T
-#else
-#define _STDINT_HAVE_U_INT_TYPES
-#endif
-#endif
-#endif
-
-#ifdef _STDINT_HAVE_U_INT_TYPES
-#undef _STDINT_NEED_INT_MODEL_T
-#endif
-
-#ifdef  _STDINT_CHAR_MODEL
-#if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
-#ifndef _STDINT_BYTE_MODEL
-#define _STDINT_BYTE_MODEL 12
-#endif
-#endif
-#endif
-
-#ifndef _STDINT_HAVE_INT_LEAST32_T
-#define _STDINT_NEED_INT_LEAST_T
-#endif
-
-#ifndef _STDINT_HAVE_INT_FAST32_T
-#define _STDINT_NEED_INT_FAST_T
-#endif
-
-#ifndef _STDINT_HEADER_INTPTR
-#define _STDINT_NEED_INTPTR_T
-#ifndef _STDINT_HAVE_INTMAX_T
-#define _STDINT_NEED_INTMAX_T
-#endif
-#endif
-
-
-/* .................... definition part ............................ */
-
-/* some system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-#endif
-
-#ifndef _HAVE_UINT64_T
-/* .. here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-/* note: all ELF-systems seem to have loff-support which needs 64-bit */
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-  /* compiler/cpu type to define int64_t */
-#endif
-#endif
-#endif
-
-#if defined _STDINT_HAVE_U_INT_TYPES
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
-/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
-/* (btw, those nibble-addressable systems are way off, or so we assume) */
-
-dnl   /* have a look at "64bit and data size neutrality" at */
-dnl   /* http://unix.org/version2/whatsnew/login_64bit.html */
-dnl   /* (the shorthand "ILP" types always have a "P" part) */
-
-#if defined _STDINT_BYTE_MODEL
-#if _STDINT_LONG_MODEL+0 == 242
-/* 2:4:2 =  IP16 = a normal 16-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
-/* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
-/* 4:4:4 = ILP32 = a normal 32-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
-/* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
-/* 4:8:8 =  LP64 = a normal 64-bit system                 */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* this system has a "long" of 64bit */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef unsigned long   uint64_t;
-typedef          long    int64_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 448
-/*      LLP64   a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* assuming the system has a "long long" */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef unsigned long long uint64_t;
-typedef          long long  int64_t;
-#endif
-#else
-#define _STDINT_NO_INT32_T
-#endif
-#else
-#define _STDINT_NO_INT8_T
-#define _STDINT_NO_INT32_T
-#endif
-#endif
-
-/*
- * quote from SunOS-5.8 sys/inttypes.h:
- * Use at your own risk.  As of February 1996, the committee is squarely
- * behind the fixed sized types; the "least" and "fast" types are still being
- * discussed.  The probability that the "fast" types may be removed before
- * the standard is finalized is high enough that they are not currently
- * implemented.
- */
-
-#if defined _STDINT_NEED_INT_LEAST_T
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_least64_t;
-#endif
-
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-  /* least types */
-#endif
-
-#if defined _STDINT_NEED_INT_FAST_T
-typedef  int8_t    int_fast8_t; 
-typedef  int       int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_fast64_t;
-#endif
-
-typedef uint8_t   uint_fast8_t; 
-typedef unsigned  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-  /* fast types */
-#endif
-
-#ifdef _STDINT_NEED_INTMAX_T
-#ifdef _HAVE_UINT64_T
-typedef  int64_t       intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef          long  intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INTPTR_T
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-/* we encourage using "long" to store pointer values, never use "int" ! */
-#if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
-typedef  unsinged int   uintptr_t;
-typedef           int    intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
-typedef        uint64_t uintptr_t;
-typedef         int64_t  intptr_t;
-#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#endif
-#endif
-#endif
-
-/* The ISO C99 standard specifies that in C++ implementations these
-   should only be defined if explicitly requested.  */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-#ifndef UINT32_C
-
-/* Signed.  */
-# define INT8_C(c)      c
-# define INT16_C(c)     c
-# define INT32_C(c)     c
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INT64_C(c)    c ## L
-# else
-#  define INT64_C(c)    c ## LL
-# endif
-
-/* Unsigned.  */
-# define UINT8_C(c)     c ## U
-# define UINT16_C(c)    c ## U
-# define UINT32_C(c)    c ## U
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define UINT64_C(c)   c ## UL
-# else
-#  define UINT64_C(c)   c ## ULL
-# endif
-
-/* Maximal type.  */
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INTMAX_C(c)   c ## L
-#  define UINTMAX_C(c)  c ## UL
-# else
-#  define INTMAX_C(c)   c ## LL
-#  define UINTMAX_C(c)  c ## ULL
-# endif
-
-  /* literalnumbers */
-#endif
-#endif
-
-/* These limits are merily those of a two complement byte-oriented system */
-
-/* Minimum of signed integral types.  */
-# define INT8_MIN               (-128)
-# define INT16_MIN              (-32767-1)
-# define INT32_MIN              (-2147483647-1)
-# define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
-/* Maximum of signed integral types.  */
-# define INT8_MAX               (127)
-# define INT16_MAX              (32767)
-# define INT32_MAX              (2147483647)
-# define INT64_MAX              (__INT64_C(9223372036854775807))
-
-/* Maximum of unsigned integral types.  */
-# define UINT8_MAX              (255)
-# define UINT16_MAX             (65535)
-# define UINT32_MAX             (4294967295U)
-# define UINT64_MAX             (__UINT64_C(18446744073709551615))
-
-/* Minimum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MIN         INT8_MIN
-# define INT_LEAST16_MIN        INT16_MIN
-# define INT_LEAST32_MIN        INT32_MIN
-# define INT_LEAST64_MIN        INT64_MIN
-/* Maximum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MAX         INT8_MAX
-# define INT_LEAST16_MAX        INT16_MAX
-# define INT_LEAST32_MAX        INT32_MAX
-# define INT_LEAST64_MAX        INT64_MAX
-
-/* Maximum of unsigned integral types having a minimum size.  */
-# define UINT_LEAST8_MAX        UINT8_MAX
-# define UINT_LEAST16_MAX       UINT16_MAX
-# define UINT_LEAST32_MAX       UINT32_MAX
-# define UINT_LEAST64_MAX       UINT64_MAX
-
-  /* shortcircuit*/
-#endif
-  /* once */
-#endif
-#endif
-STDINT_EOF
-fi
-    if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
-      AC_MSG_NOTICE([$ac_stdint_h is unchanged])
-    else
-      ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
-      AS_MKDIR_P(["$ac_dir"])
-      rm -f $ac_stdint_h
-      mv $ac_stdint $ac_stdint_h
-    fi
-],[# variables for create stdint.h replacement
-PACKAGE="$PACKAGE"
-VERSION="$VERSION"
-ac_stdint_h="$ac_stdint_h"
-_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
-ac_cv_stdint_message="$ac_cv_stdint_message"
-ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
-ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
-ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
-ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
-ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
-ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
-ac_cv_char_data_model="$ac_cv_char_data_model"
-ac_cv_long_data_model="$ac_cv_long_data_model"
-ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
-ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
-ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
-])
-])
-
-# AC_PROG_XSLTPROC
-# -----------------------------------------------------------------
-# Find an xsltproc executable.
-#
-# Input:
-#  $1 is the default $XSLTPROC_FLAGS, which will be overridden if the
-#  user specifies --with-xsltproc-flags.
-# Output:
-#  $XSLTPROC contains the path to xsltproc, or is empty if none was
-#  found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
-#  contains the flags to use with xsltproc.
-
-AC_DEFUN([AC_PROG_XSLTPROC],
-[
-XSLTPROC_FLAGS="$1"
-AC_SUBST(XSLTPROC_FLAGS)
-
-# The (lack of) whitespace and overquoting here are all necessary for
-# proper formatting.
-AC_ARG_WITH(xsltproc,
-AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
-               [Use the xsltproc binary in in PATH.]),
-    [ ac_with_xsltproc=$withval; ],
-    [ ac_with_xsltproc=maybe; ])
-
-AC_ARG_WITH(xsltproc-flags,
-AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
-               [Flags to pass to xsltproc (default $1)]),
-    [ if test "x$withval" == "xno"; then
-       XSLTPROC_FLAGS=''
-    else
-       if test "x$withval" != "xyes"; then
-           XSLTPROC_FLAGS="$withval"
-       fi
-    fi
-       ])
-
-# search for xsltproc if it wasn't specified
-if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
-    AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
-else
-    if test "$ac_with_xsltproc" != "no"; then
-        if test -x "$ac_with_xsltproc"; then
-            XSLTPROC="$ac_with_xsltproc";
-        else
-            AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't])
-            AC_MSG_WARN([executable; searching for an alternative.])
-            AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
-        fi
-    fi
-fi
-])
-
-# AC_CHECK_DOCBOOK_XSLT
-# -----------------------------------------------------------------
-# Check for access to docbook stylesheets of a particular revision.
-# This macro can be used for multiple versions within the same script.
-#
-# Input:
-#  $1 is the version of docbook to search for; default 'current'
-# Output:
-#  $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending
-#  on the results of the test, where VERS is $1, with '_' substituted
-#  for '.'  $HAVE_DOCBOOK_XSLT will also be set to the same value.
-AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
-[
-    AC_REQUIRE([AC_PROG_XSLTPROC])
-
-    dnl define a temporary variable for the version, so this macro can be
-    dnl used with multiple versions
-    define([_VERS], $1)
-    ifelse(_VERS, [], [define([_VERS], [current])])
-    define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
-    define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
-
-    AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
-    [
-       ac_cv_docbook_xslt_VERS=no
-       if test -n "$XSLTPROC"; then
-           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
-           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&1
-
-           if test "$?" = 0; then
-               ac_cv_docbook_xslt_VERS=yes
-           fi
-       fi
-    ])
-
-    HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
-    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_VERS
-    undefine([_VERS])
-])
-
-# AC_CHECK_DOCBOOK_DTD
-# -----------------------------------------------------------------
-# Check for access to docbook DTD of a particular revision.
-# This macro can be used for multiple versions within the same script.
-#
-# Input:
-#  $1 is the version of docbook to search for; default 'current'
-# Output:
-#  $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending
-#  on the results of the test, where VERS is $1, with '_' substituted
-#  for '.'  $HAVE_DOCBOOK_DTD will also be set to the same value.
-AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
-[
-    AC_REQUIRE([AC_PROG_XSLTPROC])
-
-    dnl define a temporary variable for the version, so this macro can be
-    dnl used with multiple versions
-    define([_VERS], $1)
-    ifelse(_VERS, [], [define([_VERS], [current])])
-    define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
-    define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
-
-    AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
-    [
-       ac_cv_docbook_dtd_VERS=no
-       if test -n "$XSLTPROC"; then
-           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
-           cat <<EOF >conftest.xml
-<?xml version="1.0" encoding='ISO-8859-1'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
-<book id="empty">
-</book>
-EOF
-           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
-           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
-           if test "$?" = 0; then
-               # failing to load the DTD is just a warning, so check for it in the output.
-               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
-                   : # no good..
-               else
-                   ac_cv_docbook_dtd_VERS=yes
-               fi
-           fi
-           cat conftest.out >&AS_MESSAGE_LOG_FD
-
-           rm -f conftest.xml conftest.out
-       fi
-    ])
-
-    HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
-    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_VERS
-    undefine([_VERS])
-])
-dnl
-dnl Checks to see if there's a sockaddr_storage structure
-dnl
-dnl usage:
-dnl
-dnl    AC_SOCKADDR_STORAGE
-dnl
-dnl results:
-dnl
-dnl    HAVE_SOCKADDR_STORAGE (defined)
-dnl
-AC_DEFUN([AC_SOCKADDR_STORAGE],
-    [AC_MSG_CHECKING(if sockaddr_storage struct exists)
-    AC_CACHE_VAL(ac_cv_has_sockaddr_storage,
-       AC_TRY_COMPILE([
-#      include <sys/types.h>
-#      include <sys/socket.h>],
-       [u_int i = sizeof (struct sockaddr_storage)],
-       ac_cv_has_sockaddr_storage=yes,
-       ac_cv_has_sockaddr_storage=no))
-    AC_MSG_RESULT($ac_cv_has_sockaddr_storage)
-    if test $ac_cv_has_sockaddr_storage = yes ; then
-           AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists])
-    fi])
-
-
index 8358075e93cc10415e0caa0794892d04229da355..89cd353bc1a1e58eb1122b76bc709b5301503816 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005  Free Software Foundation, Inc.
+# 2005, 2006  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf.  If you want to use that,
+you should regenerate the build system entirely.], [63])])
+
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
+dnl gthread is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+                   , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+  PKG_PROG_PKG_CONFIG([0.16])
+
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+         echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+         enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+         :
+    else
+         no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.glibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+          (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+            glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  rm -f conf.glibtest
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# 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.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+               
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                        [pkg_failed=yes])
+    fi
+else
+       pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+               [AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+       ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+               [$4])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+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.10], [],
+      [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 so it can be traced.
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.9.6])])
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -85,14 +472,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 7
+# serial 8
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -101,8 +488,10 @@ AC_DEFUN([AM_CONDITIONAL],
 [AC_PREREQ(2.52)dnl
  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -116,15 +505,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 9
 
 # 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,
@@ -152,6 +540,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
                    [depcc="$$1"   am_compiler_list=])
 
@@ -217,6 +606,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
@@ -269,7 +659,8 @@ if test "x$enable_dependency_tracking" != xno; then
   AMDEPBACKSLASH='\'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
@@ -294,8 +685,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # 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.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+  # 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 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
     dirpart=`AS_DIRNAME("$mf")`
   else
     continue
@@ -340,22 +732,10 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -378,16 +758,20 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
+[AC_PREREQ([2.60])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
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+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
@@ -407,6 +791,9 @@ m4_ifval([$2],
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_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
 
@@ -442,6 +829,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
                   [_AM_DEPENDENCIES(CXX)],
                   [define([AC_PROG_CXX],
                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
 ])
 
@@ -477,7 +868,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
 AC_SUBST(install_sh)])
 
 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
@@ -576,14 +967,14 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -599,6 +990,7 @@ AC_SUBST($1)])
 # If it does, 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
 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
@@ -609,7 +1001,7 @@ else
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -617,60 +1009,23 @@ fi
 
 # AM_PROG_MKDIR_P
 # ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake.  There are at least two reasons why we must not
-# use `-m 0755':
-#   - it causes special bits like SGID to be ignored,
-#   - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out.  Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
+# Check for `mkdir -p'.
 AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
-AC_SUBST([mkdir_p])])
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
@@ -782,9 +1137,21 @@ 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="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
+# Copyright (C) 2006  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 outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
@@ -881,4 +1248,107 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
-m4_include([acinclude.m4])
+m4_include([config/macro-archive/ac_define_dir.m4])
+m4_include([config/macro-archive/ac_prog_perl_version.m4])
+m4_include([config/macro-archive/ac_prog_swig.m4])
+m4_include([config/macro-archive/ax_compare_version.m4])
+m4_include([config/macro-archive/docbook-dtd.m4])
+m4_include([config/macro-archive/docbook-xslt-min.m4])
+m4_include([config/macro-archive/docbook-xslt.m4])
+m4_include([config/macro-archive/xsltproc.m4])
+m4_include([config/amanda/amplot.m4])
+m4_include([config/amanda/bsd-security.m4])
+m4_include([config/amanda/bsdtcp-security.m4])
+m4_include([config/amanda/bsdudp-security.m4])
+m4_include([config/amanda/changer.m4])
+m4_include([config/amanda/components.m4])
+m4_include([config/amanda/compress.m4])
+m4_include([config/amanda/config.m4])
+m4_include([config/amanda/debugging.m4])
+m4_include([config/amanda/defaults.m4])
+m4_include([config/amanda/devprefix.m4])
+m4_include([config/amanda/dirs.m4])
+m4_include([config/amanda/documentation.m4])
+m4_include([config/amanda/dumpers.m4])
+m4_include([config/amanda/flags.m4])
+m4_include([config/amanda/flock.m4])
+m4_include([config/amanda/funcs.m4])
+m4_include([config/amanda/getfsent.m4])
+m4_include([config/amanda/i18n.m4])
+m4_include([config/amanda/ipv6.m4])
+m4_include([config/amanda/krb4-security.m4])
+m4_include([config/amanda/krb5-security.m4])
+m4_include([config/amanda/lfs.m4])
+m4_include([config/amanda/libs.m4])
+m4_include([config/amanda/net.m4])
+m4_include([config/amanda/progs.m4])
+m4_include([config/amanda/readdir.m4])
+m4_include([config/amanda/readline.m4])
+m4_include([config/amanda/rsh-security.m4])
+m4_include([config/amanda/s3-device.m4])
+m4_include([config/amanda/shmem.m4])
+m4_include([config/amanda/ssh-security.m4])
+m4_include([config/amanda/summary.m4])
+m4_include([config/amanda/swig.m4])
+m4_include([config/amanda/syshacks.m4])
+m4_include([config/amanda/tape.m4])
+m4_include([config/amanda/types.m4])
+m4_include([config/amanda/userid.m4])
+m4_include([config/amanda/version.m4])
+m4_include([config/gnulib/alloca.m4])
+m4_include([config/gnulib/arpa_inet_h.m4])
+m4_include([config/gnulib/base64.m4])
+m4_include([config/gnulib/eoverflow.m4])
+m4_include([config/gnulib/extensions.m4])
+m4_include([config/gnulib/float_h.m4])
+m4_include([config/gnulib/fsusage.m4])
+m4_include([config/gnulib/getaddrinfo.m4])
+m4_include([config/gnulib/gettimeofday.m4])
+m4_include([config/gnulib/gnulib-comp.m4])
+m4_include([config/gnulib/include_next.m4])
+m4_include([config/gnulib/inet_ntop.m4])
+m4_include([config/gnulib/intmax_t.m4])
+m4_include([config/gnulib/lock.m4])
+m4_include([config/gnulib/longlong.m4])
+m4_include([config/gnulib/malloc.m4])
+m4_include([config/gnulib/mkdtemp.m4])
+m4_include([config/gnulib/netinet_in_h.m4])
+m4_include([config/gnulib/onceonly_2_57.m4])
+m4_include([config/gnulib/physmem.m4])
+m4_include([config/gnulib/safe-read.m4])
+m4_include([config/gnulib/safe-write.m4])
+m4_include([config/gnulib/snprintf.m4])
+m4_include([config/gnulib/socklen.m4])
+m4_include([config/gnulib/sockpfaf.m4])
+m4_include([config/gnulib/ssize_t.m4])
+m4_include([config/gnulib/stdbool.m4])
+m4_include([config/gnulib/stdint.m4])
+m4_include([config/gnulib/stdio_h.m4])
+m4_include([config/gnulib/stdlib_h.m4])
+m4_include([config/gnulib/strdup.m4])
+m4_include([config/gnulib/string_h.m4])
+m4_include([config/gnulib/sys_socket_h.m4])
+m4_include([config/gnulib/sys_stat_h.m4])
+m4_include([config/gnulib/sys_time_h.m4])
+m4_include([config/gnulib/tempname.m4])
+m4_include([config/gnulib/ulonglong.m4])
+m4_include([config/gnulib/unistd_h.m4])
+m4_include([config/gnulib/vasnprintf.m4])
+m4_include([config/gnulib/visibility.m4])
+m4_include([config/gnulib/wchar.m4])
+m4_include([config/gettext-macros/gettext.m4])
+m4_include([config/gettext-macros/iconv.m4])
+m4_include([config/gettext-macros/inttypes_h.m4])
+m4_include([config/gettext-macros/lib-ld.m4])
+m4_include([config/gettext-macros/lib-link.m4])
+m4_include([config/gettext-macros/lib-prefix.m4])
+m4_include([config/gettext-macros/longlong.m4])
+m4_include([config/gettext-macros/nls.m4])
+m4_include([config/gettext-macros/po.m4])
+m4_include([config/gettext-macros/progtest.m4])
+m4_include([config/gettext-macros/size_max.m4])
+m4_include([config/gettext-macros/stdint_h.m4])
+m4_include([config/gettext-macros/wchar_t.m4])
+m4_include([config/gettext-macros/wint_t.m4])
+m4_include([config/gettext-macros/xsize.m4])
+m4_include([config/libtool.m4])
index a673cb597195007de8b12d5fc64af3a1be1bdd91..f62a51e0f32624e02845801f794581396967f3ed 100644 (file)
@@ -1,23 +1,26 @@
 # Makefile for Amanda client programs.
 
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
 
-lib_LTLIBRARIES =       libamandad.la
+amlib_LTLIBRARIES =       libamandad.la
 LIB_EXTENSION = la
 
-libexec_PROGRAMS =     amandad
-
-if WANT_RUNTIME_PSEUDO_RELOC
-AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
-endif
+amlibexec_PROGRAMS =   amandad
 
 libamandad_la_SOURCES= amandad_util.c
 libamandad_la_LDFLAGS = -release $(VERSION)
+libamandad_la_LIBADD = ../common-src/libamanda.la
 
 noinst_HEADERS  = amandad.h
 
@@ -33,25 +36,23 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
 
-install-exec-hook:
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+INSTALLPERMS_exec = \
+       dest=$(amlibexecdir) chown=amanda \
+               $(amlibexec_PROGRAMS)
+
+INSTALLPERMS_data = \
+       dest=$(amlibexecdir) chown=amanda \
+               $(amlibexec_SCRIPTS)
 
 lint:
-       @ for p in $(libexec_PROGRAMS); do                                      \
+       @ for p in $(amlibexec_PROGRAMS); do                                    \
                f="$$p.c $(libamandad_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                (cd ../server-src; make listlibsrc);                            \
                f="$$f "`cat ../server-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index 9ea0a5c0563d3ce9175b1bdc9852950e6ac0fcf1..3959987da3a74bd04c9c04ec7a5c770c9371222b 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda client programs.
 
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -41,48 +78,118 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-libexec_PROGRAMS = amandad$(EXEEXT)
-subdir = amandad-src
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am
+amlibexec_PROGRAMS = amandad$(EXEEXT)
+subdir = amandad-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -94,14 +201,17 @@ am__vpath_adj = case $$p in \
     *) f=$$p;; \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libamandad_la_LIBADD =
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamandad_la_DEPENDENCIES = ../common-src/libamanda.la
 am_libamandad_la_OBJECTS = amandad_util.lo
 libamandad_la_OBJECTS = $(am_libamandad_la_OBJECTS)
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
+libamandad_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamandad_la_LDFLAGS) $(LDFLAGS) -o $@
+amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(amlibexec_PROGRAMS)
 amandad_SOURCES = amandad.c
 amandad_OBJECTS = amandad.$(OBJEXT)
 amandad_LDADD = $(LDADD)
@@ -109,32 +219,32 @@ amandad_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamandad.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libamandad_la_SOURCES) amandad.c
 DIST_SOURCES = $(libamandad_la_SOURCES) amandad.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -142,14 +252,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -160,20 +275,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -187,60 +301,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -250,10 +473,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -264,24 +501,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -293,59 +564,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -354,36 +612,49 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
-lib_LTLIBRARIES = libamandad.la
+amlib_LTLIBRARIES = libamandad.la
 LIB_EXTENSION = la
-@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
 libamandad_la_SOURCES = amandad_util.c
 libamandad_la_LDFLAGS = -release $(VERSION)
+libamandad_la_LIBADD = ../common-src/libamanda.la
 noinst_HEADERS = amandad.h
 
 ###
@@ -397,11 +668,19 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
 
+INSTALLPERMS_exec = \
+       dest=$(amlibexecdir) chown=amanda \
+               $(amlibexec_PROGRAMS)
+
+INSTALLPERMS_data = \
+       dest=$(amlibexecdir) chown=amanda \
+               $(amlibexec_SCRIPTS)
+
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -430,66 +709,66 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 libamandad.la: $(libamandad_la_OBJECTS) $(libamandad_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(libamandad_la_LDFLAGS) $(libamandad_la_OBJECTS) $(libamandad_la_LIBADD) $(LIBS)
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
+       $(libamandad_la_LINK) -rpath $(amlibdir) $(libamandad_la_OBJECTS) $(libamandad_la_LIBADD) $(LIBS)
+install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
             || test -f $$p1 \
          ; then \
            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \
          else :; fi; \
        done
 
-uninstall-libexecPROGRAMS:
+uninstall-amlibexecPROGRAMS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
-clean-libexecPROGRAMS:
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+clean-amlibexecPROGRAMS:
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          echo " rm -f $$p $$f"; \
          rm -f $$p $$f ; \
        done
 amandad$(EXEEXT): $(amandad_OBJECTS) $(amandad_DEPENDENCIES) 
        @rm -f amandad$(EXEEXT)
-       $(LINK) $(amandad_LDFLAGS) $(amandad_OBJECTS) $(amandad_LDADD) $(LIBS)
+       $(LINK) $(amandad_OBJECTS) $(amandad_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -501,22 +780,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandad_util.Plo@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -527,10 +806,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -580,22 +855,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -610,8 +884,8 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -637,16 +911,18 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
+clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
        clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -658,16 +934,26 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
-install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS
+install-exec-am: install-amlibexecPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -688,43 +974,94 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-libexecPROGRAMS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool ctags \
-       distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-exec install-exec-am install-exec-hook \
-       install-info install-info-am install-libLTLIBRARIES \
-       install-libexecPROGRAMS install-man install-strip installcheck \
-       installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-info-am \
-       uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS
-
-
-install-exec-hook:
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+       clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
+       clean-libtool ctags distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-amlibLTLIBRARIES install-amlibexecPROGRAMS \
+       install-data install-data-am install-data-hook install-dvi \
+       install-dvi-am install-exec install-exec-am install-exec-hook \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amlibLTLIBRARIES \
+       uninstall-amlibexecPROGRAMS
+
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 lint:
-       @ for p in $(libexec_PROGRAMS); do                                      \
+       @ for p in $(amlibexec_PROGRAMS); do                                    \
                f="$$p.c $(libamandad_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                (cd ../server-src; make listlibsrc);                            \
                f="$$f "`cat ../server-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index f04d4e3f1508095441b1d0a7ef35ce86beec410c..ca3bde92305d14e36f4ecbaa8e4fff7a606a733e 100644 (file)
@@ -48,9 +48,9 @@
 #define        REP_TIMEOUT     (6*60*60)       /* secs for service to reply */
 #define        ACK_TIMEOUT     10              /* XXX should be configurable */
 
-#define amandad_debug(i,x) do {                \
+#define amandad_debug(i, ...) do {     \
        if ((i) <= debug_amandad) {     \
-               dbprintf(x);            \
+               dbprintf(__VA_ARGS__);  \
        }                               \
 } while (0)
 
@@ -133,20 +133,10 @@ static struct {
     TAILQ_HEAD_INITIALIZER(serviceq.tailq), 0
 };
 
-/*
- * Data for dbmalloc to check for memory leaks
- */
-#ifdef USE_DBMALLOC
-static struct {
-    struct {
-       unsigned long size, hist;
-    } start, end;
-} dbmalloc_info;
-#endif
-
 static int wait_30s = 1;
 static int exit_on_qlength = 1;
 static char *auth = NULL;
+static kencrypt_type amandad_kencrypt = KENCRYPT_NONE;
 
 int main(int argc, char **argv);
 
@@ -171,31 +161,11 @@ static struct active_service *service_new(security_handle_t *,
 static void service_delete(struct active_service *);
 static int writebuf(struct active_service *, const void *, size_t);
 static ssize_t do_sendpkt(security_handle_t *handle, pkt_t *pkt);
-
-static void child_signal(int signal);
+static char *amandad_get_security_conf (char *, void *);
 
 static const char *state2str(state_t);
 static const char *action2str(action_t);
 
-/*
- * Harvests defunct processes...
- */
-
-static void
-child_signal(
-    int                signal)
-{
-    pid_t      rp;
-
-    (void)signal;      /* Quite compiler warning */
-    /*
-     * Reap and child status and promptly ignore since we don't care...
-     */
-    do {
-       rp = waitpid(-1, NULL, WNOHANG);
-    } while (rp > 0);
-}
-
 int
 main(
     int                argc,
@@ -206,13 +176,20 @@ main(
     int in, out;
     const security_driver_t *secdrv;
     int no_exit = 0;
-    struct sigaction act, oact;
     char *pgm = "amandad";             /* in case argv[0] is not set */
 #if defined(USE_REUSEADDR)
     const int on = 1;
     int r;
 #endif
-    char *conffile;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
@@ -232,49 +209,19 @@ main(
     dbopen(DBG_SUBDIR_AMANDAD);
 
     if(argv == NULL) {
-       error("argv == NULL\n");
+       error(_("argv == NULL\n"));
        /*NOTREACHED*/
     }
 
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    /* Tell me when a child exits or dies... */
-    act.sa_handler = child_signal;
-    sigemptyset(&act.sa_mask);
-    act.sa_flags = 0;
-    if(sigaction(SIGCHLD, &act, &oact) != 0) {
-       error("error setting SIGCHLD handler: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    config_init(CONFIG_INIT_CLIENT, NULL);
 
-#ifdef USE_DBMALLOC
-    dbmalloc_info.start.size = malloc_inuse(&dbmalloc_info.start.hist);
-#endif
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
 
-#ifdef FORCE_USERID
-    /* we'd rather not run as root */
-    if (geteuid() == 0) {
-       if(client_uid == (uid_t) -1) {
-           error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-           /*NOTREACHED*/
-       }
-       initgroups(CLIENT_LOGIN, client_gid);
-       setgid(client_gid);
-       setegid(client_gid);
-       seteuid(client_uid);
-    }
-#endif /* FORCE_USERID */
-
     /*
      * ad-hoc argument parsing
      *
@@ -305,7 +252,7 @@ main(
            secdrv = security_getdriver(argv[i]);
            auth = argv[i];
            if (secdrv == NULL) {
-               error("no driver for security type '%s'\n", argv[i]);
+               error(_("no driver for security type '%s'\n"), argv[i]);
                 /*NOTREACHED*/
            }
            continue;
@@ -338,16 +285,15 @@ main(
            in = out = socket(AF_INET, SOCK_DGRAM, 0);
 #endif
            if (in < 0) {
-               error("can't create dgram socket: %s\n", strerror(errno));
+               error(_("can't create dgram socket: %s\n"), strerror(errno));
                /*NOTREACHED*/
            }
 #ifdef USE_REUSEADDR
            r = setsockopt(in, SOL_SOCKET, SO_REUSEADDR,
                (void *)&on, (socklen_t)sizeof(on));
            if (r < 0) {
-               dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n",
-                         debug_prefix_time(NULL),
-                         strerror(errno)));
+               dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"),
+                         strerror(errno));
            }
 #endif
 
@@ -361,7 +307,7 @@ main(
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
 #endif
            if (bind(in, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
-               error("can't bind to port %d: %s\n", atoi(argv[i]),
+               error(_("can't bind to port %d: %s\n"), atoi(argv[i]),
                    strerror(errno));
                /*NOTREACHED*/
            }
@@ -385,16 +331,15 @@ main(
            sock = socket(AF_INET, SOCK_STREAM, 0);
 #endif
            if (sock < 0) {
-               error("can't create tcp socket: %s\n", strerror(errno));
+               error(_("can't create tcp socket: %s\n"), strerror(errno));
                /*NOTREACHED*/
            }
 #ifdef USE_REUSEADDR
            r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
                (void *)&on, (socklen_t)sizeof(on));
            if (r < 0) {
-               dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n",
-                         debug_prefix_time(NULL),
-                         strerror(errno)));
+               dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"),
+                         strerror(errno));
            }
 #endif
 #ifdef WORKING_IPV6
@@ -407,7 +352,7 @@ main(
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
 #endif
            if (bind(sock, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
-               error("can't bind to port %d: %s\n", atoi(argv[i]),
+               error(_("can't bind to port %d: %s\n"), atoi(argv[i]),
                    strerror(errno));
                /*NOTREACHED*/
            }
@@ -437,8 +382,7 @@ main(
                    if (strcmp(services[j].name, argv[i]) == 0)
                        break;
                if (j == (int)NSERVICES) {
-                   dbprintf(("%s: %s: invalid service\n",
-                             debug_prefix_time(NULL), argv[i]));
+                   dbprintf(_("%s: invalid service\n"), argv[i]);
                    exit(1);
                }
                services[j].active = 1;
@@ -453,7 +397,7 @@ main(
        secdrv = security_getdriver("BSD");
        auth = "bsd";
        if (secdrv == NULL) {
-           error("no driver for default security type 'BSD'\n");
+           error(_("no driver for default security type 'BSD'\n"));
            /*NOTREACHED*/
        }
     }
@@ -469,21 +413,20 @@ main(
 
     startclock();
 
-    dbprintf(("%s: version %s\n", get_pname(), version()));
+    dbprintf(_("version %s\n"), version());
     for (i = 0; version_info[i] != NULL; i++) {
-       dbprintf(("%s: %s", debug_prefix_time(NULL), version_info[i]));
+       dbprintf("    %s", version_info[i]);
     }
 
     if (! (argc >= 1 && argv != NULL && argv[0] != NULL)) {
-       dbprintf(("%s: WARNING: argv[0] not defined: check inetd.conf\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n"));
     }
 
     /*
      * Schedule to call protocol_accept() when new security handles
      * are created on stdin.
      */
-    security_accept(secdrv, in, out, protocol_accept);
+    security_accept(secdrv, amandad_get_security_conf, in, out, protocol_accept, NULL);
 
     /*
      * Schedule an event that will try to exit every 30 seconds if there
@@ -529,15 +472,6 @@ exit_check(
     if (no_exit)
        return;
 
-#ifdef USE_DBMALLOC
-    dbmalloc_info.end.size = malloc_inuse(&dbmalloc_info.end.hist);
-
-    if (dbmalloc_info.start.size != dbmalloc_info.end.size) {
-       malloc_list(dbfd(), dbmalloc_info.start.hist,
-           dbmalloc_info.end.hist);
-    }
-#endif
-
     dbclose();
     exit(0);
 }
@@ -570,8 +504,7 @@ protocol_accept(
      * If pkt is NULL, then there was a problem with the new connection.
      */
     if (pkt == NULL) {
-       dbprintf(("%s: accept error: %s\n",
-           debug_prefix_time(NULL), security_geterror(handle)));
+       dbprintf(_("accept error: %s\n"), security_geterror(handle));
        pkt_init(&pkt_out, P_NAK, "ERROR %s\n", security_geterror(handle));
        do_sendpkt(handle, &pkt_out);
        amfree(pkt_out.body);
@@ -579,15 +512,15 @@ protocol_accept(
        return;
     }
 
-    dbprintf(("%s: accept recv %s pkt:\n<<<<<\n%s>>>>>\n",
-       debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body));
+    dbprintf(_("accept recv %s pkt:\n<<<<<\n%s>>>>>\n"),
+       pkt_type2str(pkt->type), pkt->body);
 
     /*
      * If this is not a REQ packet, just forget about it.
      */
     if (pkt->type != P_REQ) {
-       dbprintf(("%s: received unexpected %s packet:\n<<<<<\n%s>>>>>\n\n",
-           debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body));
+       dbprintf(_("received unexpected %s packet:\n<<<<<\n%s>>>>>\n\n"),
+           pkt_type2str(pkt->type), pkt->body);
        security_close(handle);
        return;
     }
@@ -623,18 +556,16 @@ protocol_accept(
        if (services[i].active == 1 && strcmp(services[i].name, service) == 0)
            break;
     if (i == (int)NSERVICES) {
-       dbprintf(("%s: %s: invalid service\n",
-           debug_prefix_time(NULL), service));
-       pkt_init(&pkt_out, P_NAK, "ERROR %s: invalid service, add '%s' as argument to amandad\n", service, service);
+       dbprintf(_("%s: invalid service\n"), service);
+       pkt_init(&pkt_out, P_NAK, _("ERROR %s: invalid service, add '%s' as argument to amandad\n"), service, service);
        goto send_pkt_out;
     }
 
-    service_path = vstralloc(libexecdir, "/", service, versionsuffix(), NULL);
+    service_path = vstralloc(amlibexecdir, "/", service, versionsuffix(), NULL);
     if (access(service_path, X_OK) < 0) {
-       dbprintf(("%s: can't execute %s: %s\n",
-           debug_prefix_time(NULL), service_path, strerror(errno)));
+       dbprintf(_("can't execute %s: %s\n"), service_path, strerror(errno));
            pkt_init(&pkt_out, P_NAK,
-                    "ERROR execute access to \"%s\" denied\n",
+                    _("ERROR execute access to \"%s\" denied\n"),
                     service_path);
        goto send_pkt_out;
     }
@@ -644,8 +575,8 @@ protocol_accept(
        as = TAILQ_NEXT(as, tq)) {
            if (strcmp(as->cmd, service_path) == 0 &&
                strcmp(as->arguments, arguments) == 0) {
-                   dbprintf(("%s: %s %s: already running, acking req\n",
-                       debug_prefix_time(NULL), service, arguments));
+                   dbprintf(_("%s %s: already running, acking req\n"),
+                       service, arguments);
                    pkt_init_empty(&pkt_out, P_ACK);
                    goto send_pkt_out_no_delete;
            }
@@ -655,14 +586,12 @@ protocol_accept(
      * create a new service instance, and send the arguments down
      * the request pipe.
      */
-    dbprintf(("%s: creating new service: %s\n%s\n",
-       debug_prefix_time(NULL), service, arguments));
+    dbprintf(_("creating new service: %s\n%s\n"), service, arguments);
     as = service_new(handle, service_path, arguments);
     if (writebuf(as, arguments, strlen(arguments)) < 0) {
        const char *errmsg = strerror(errno);
-       dbprintf(("%s: error sending arguments to %s: %s\n",
-           debug_prefix_time(NULL), service, errmsg));
-       pkt_init(&pkt_out, P_NAK, "ERROR error writing arguments to %s: %s\n",
+       dbprintf(_("error sending arguments to %s: %s\n"), service, errmsg);
+       pkt_init(&pkt_out, P_NAK, _("ERROR error writing arguments to %s: %s\n"),
            service, errmsg);
        goto send_pkt_out;
     }
@@ -682,9 +611,9 @@ protocol_accept(
     return;
 
 badreq:
-    pkt_init(&pkt_out, P_NAK, "ERROR invalid REQ\n");
-    dbprintf(("%s: received invalid %s packet:\n<<<<<\n%s>>>>>\n\n",
-       debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body));
+    pkt_init(&pkt_out, P_NAK, _("ERROR invalid REQ\n"));
+    dbprintf(_("received invalid %s packet:\n<<<<<\n%s>>>>>\n\n"),
+       pkt_type2str(pkt->type), pkt->body);
 
 send_pkt_out:
     if(as)
@@ -713,26 +642,22 @@ state_machine(
     state_t curstate;
     pkt_t nak;
 
-    amandad_debug(1, ("%s: state_machine: %p entering\n",
-                     debug_prefix_time(NULL), as));
+    amandad_debug(1, _("state_machine: %p entering\n"), as);
     for (;;) {
        curstate = as->state;
-       amandad_debug(1, ("%s: state_machine: %p curstate=%s action=%s\n",
-                         debug_prefix_time(NULL), as,
-                         state2str(curstate), action2str(action)));
+       amandad_debug(1, _("state_machine: %p curstate=%s action=%s\n"), as,
+                         state2str(curstate), action2str(action));
        retaction = (*curstate)(as, action, pkt);
-       amandad_debug(1, ("%s: state_machine: %p curstate=%s returned %s (nextstate=%s)\n",
-                         debug_prefix_time(NULL),
+       amandad_debug(1, _("state_machine: %p curstate=%s returned %s (nextstate=%s)\n"),
                          as, state2str(curstate), action2str(retaction),
-                         state2str(as->state)));
+                         state2str(as->state));
 
        switch (retaction) {
        /*
         * State has queued up and is now blocking on input.
         */
        case A_PENDING:
-           amandad_debug(1, ("%s: state_machine: %p leaving (A_PENDING)\n",
-                             debug_prefix_time(NULL), as));
+           amandad_debug(1, _("state_machine: %p leaving (A_PENDING)\n"), as);
            return;
 
        /*
@@ -746,25 +671,23 @@ state_machine(
         * Send a nak, and return.
         */
        case A_SENDNAK:
-           dbprintf(("%s: received unexpected %s packet\n",
-               debug_prefix_time(NULL), pkt_type2str(pkt->type)));
-           dbprintf(("<<<<<\n%s----\n\n", pkt->body));
-           pkt_init(&nak, P_NAK, "ERROR unexpected packet type %s\n",
+           dbprintf(_("received unexpected %s packet\n"),
+               pkt_type2str(pkt->type));
+           dbprintf(_("<<<<<\n%s----\n\n"), pkt->body);
+           pkt_init(&nak, P_NAK, _("ERROR unexpected packet type %s\n"),
                pkt_type2str(pkt->type));
            do_sendpkt(as->security_handle, &nak);
            amfree(nak.body);
            security_recvpkt(as->security_handle, protocol_recv, as, -1);
-           amandad_debug(1, ("%s: state_machine: %p leaving (A_SENDNAK)\n",
-                             debug_prefix_time(NULL), as));
+           amandad_debug(1, _("state_machine: %p leaving (A_SENDNAK)\n"), as);
            return;
 
        /*
         * Service is done.  Remove it and finish.
         */
        case A_FINISH:
+           amandad_debug(1, _("state_machine: %p leaving (A_FINISH)\n"), as);
            service_delete(as);
-           amandad_debug(1, ("%s: state_machine: %p leaving (A_FINISH)\n",
-                             debug_prefix_time(NULL), as));
            return;
 
        default:
@@ -792,8 +715,8 @@ s_sendack(
 
     pkt_init_empty(&ack, P_ACK);
     if (do_sendpkt(as->security_handle, &ack) < 0) {
-       dbprintf(("%s: error sending ACK: %s\n",
-           debug_prefix_time(NULL), security_geterror(as->security_handle)));
+       dbprintf(_("error sending ACK: %s\n"),
+           security_geterror(as->security_handle));
        amfree(ack.body);
        return (A_FINISH);
     }
@@ -826,8 +749,14 @@ s_repwait(
     action_t                   action,
     pkt_t *                    pkt)
 {
-    ssize_t n;
-    char *repbuf_temp;
+    ssize_t   n;
+    char     *repbuf_temp;
+    char     *what;
+    char     *msg;
+    int       code = 0;
+    int       t;
+    int       pid;
+    amwait_t  retstat;
 
     /*
      * We normally shouldn't receive any packets while waiting
@@ -840,8 +769,7 @@ s_repwait(
         * and go back and wait for more data.
         */
        if (pkt->type == P_REQ) {
-           dbprintf(("%s: received dup P_REQ packet, ACKing it\n",
-               debug_prefix_time(NULL)));
+           dbprintf(_("received dup P_REQ packet, ACKing it\n"));
            amfree(as->rep_pkt.body);
            pkt_init_empty(&as->rep_pkt, P_ACK);
            do_sendpkt(as->security_handle, &as->rep_pkt);
@@ -854,9 +782,8 @@ s_repwait(
 
     if (action == A_TIMEOUT) {
        amfree(as->rep_pkt.body);
-       pkt_init(&as->rep_pkt, P_NAK, "ERROR timeout on reply pipe\n");
-       dbprintf(("%s: %s timed out waiting for REP data\n",
-           debug_prefix_time(NULL), as->cmd));
+       pkt_init(&as->rep_pkt, P_NAK, _("ERROR timeout on reply pipe\n"));
+       dbprintf(_("%s timed out waiting for REP data\n"), as->cmd);
        do_sendpkt(as->security_handle, &as->rep_pkt);
        return (A_FINISH);
     }
@@ -873,14 +800,55 @@ s_repwait(
     } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN)));
     if (n < 0) {
        const char *errstr = strerror(errno);
-       dbprintf(("%s: read error on reply pipe: %s\n",
-                 debug_prefix_time(NULL), errstr));
+       dbprintf(_("read error on reply pipe: %s\n"), errstr);
        amfree(as->rep_pkt.body);
-       pkt_init(&as->rep_pkt, P_NAK, "ERROR read error on reply pipe: %s\n",
+       pkt_init(&as->rep_pkt, P_NAK, _("ERROR read error on reply pipe: %s\n"),
                 errstr);
        do_sendpkt(as->security_handle, &as->rep_pkt);
        return (A_FINISH);
     }
+
+    /* If end of service, wait for process status */
+    if (n == 0) {
+       t = 0;
+       pid = waitpid(as->pid, &retstat, WNOHANG);
+       while (t<5 && pid == 0) {
+           sleep(1);
+           t++;
+           pid = waitpid(as->pid, &retstat, WNOHANG);
+       }
+
+       if (pid > 0) {
+           what = NULL;
+           if (! WIFEXITED(retstat)) {
+               what = _("signal");
+               code = WTERMSIG(retstat);
+           } else if (WEXITSTATUS(retstat) != 0) {
+               what = _("code");
+               code = WEXITSTATUS(retstat);
+           }
+           if (what) {
+               dbprintf(_("service %s failed: pid %u exited with %s %d\n"),
+                        (as->cmd)?as->cmd:_("??UNKONWN??"),
+                        (unsigned)as->pid,
+                        what, code);
+               msg = vstrallocf(
+                    _("ERROR service %s failed: pid %u exited with %s %d\n"),
+                    (as->cmd)?as->cmd:_("??UNKONWN??"), (unsigned)as->pid,
+                    what, code);
+               if (as->repbufsize + strlen(msg) >= (as->bufsize - 1)) {
+                       as->bufsize *= 2;
+                       repbuf_temp = alloc(as->bufsize);
+                       memcpy(repbuf_temp, as->repbuf, as->repbufsize + 1);
+                       amfree(as->repbuf);
+                       as->repbuf = repbuf_temp;
+               }
+               strcpy(as->repbuf + as->repbufsize, msg);
+               as->repbufsize += strlen(msg);
+           }
+       }
+    }
+
     /*
      * If we got some data, go back and wait for more, or EOF.  Nul terminate
      * the buffer first.
@@ -953,7 +921,12 @@ s_processrep(
      * We need to map these to security streams and pass them back
      * to the amanda server.  If the handle is -1, then we don't map.
      */
-    repbuf = stralloc(as->repbuf);
+    if (strncmp_const(as->repbuf,"KENCRYPT\n") == 0) {
+        amandad_kencrypt = KENCRYPT_WILL_DO;
+       repbuf = stralloc(as->repbuf + 9);
+    } else {
+       repbuf = stralloc(as->repbuf);
+    }
     amfree(as->rep_pkt.body);
     pkt_init_empty(&as->rep_pkt, P_REP);
     tok = strtok(repbuf, " ");
@@ -1046,18 +1019,15 @@ s_ackwait(
            as->state = s_sendrep;
            return (A_CONTINUE);
        }
-       dbprintf(("%s: timeout waiting for ACK for our REP\n",
-           debug_prefix_time(NULL)));
+       dbprintf(_("timeout waiting for ACK for our REP\n"));
        return (A_FINISH);
     }
-    amandad_debug(1, ("%s: received ACK, now opening streams\n",
-                     debug_prefix_time(NULL)));
+    amandad_debug(1, _("received ACK, now opening streams\n"));
 
     assert(action == A_RECVPKT);
 
     if (pkt->type == P_REQ) {
-       dbprintf(("%s: received dup P_REQ packet, resending REP\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("received dup P_REQ packet, resending REP\n"));
        as->state = s_sendrep;
        return (A_CONTINUE);
     }
@@ -1065,6 +1035,10 @@ s_ackwait(
     if (pkt->type != P_ACK)
        return (A_SENDNAK);
 
+    if (amandad_kencrypt == KENCRYPT_WILL_DO) {
+       amandad_kencrypt = KENCRYPT_YES;
+    }
+
     /*
      * Got the ack, now open the pipes
      */
@@ -1072,9 +1046,8 @@ s_ackwait(
        if (dh->netfd == NULL)
            continue;
        if (security_stream_accept(dh->netfd) < 0) {
-           dbprintf(("%s: stream %td accept failed: %s\n",
-               debug_prefix_time(NULL),
-               dh - &as->data[0], security_geterror(as->security_handle)));
+           dbprintf(_("stream %td accept failed: %s\n"),
+               dh - &as->data[0], security_geterror(as->security_handle));
            security_stream_close(dh->netfd);
            dh->netfd = NULL;
            continue;
@@ -1109,8 +1082,7 @@ s_ackwait(
      * If no pipes are open, then we're done.  Otherwise, just start running.
      * The event handlers on all of the pipes will take it from here.
      */
-    amandad_debug(1, ("%s: at end of s_ackwait, npipes is %d\n",
-                     debug_prefix_time(NULL), npipes));
+    amandad_debug(1, _("at end of s_ackwait, npipes is %d\n"), npipes);
     if (npipes == 0)
        return (A_FINISH);
     else {
@@ -1165,17 +1137,17 @@ protocol_recv(
 
     switch (status) {
     case S_OK:
-       dbprintf(("%s: received %s pkt:\n<<<<<\n%s>>>>>\n",
-           debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body));
+       dbprintf(_("received %s pkt:\n<<<<<\n%s>>>>>\n"),
+           pkt_type2str(pkt->type), pkt->body);
        state_machine(as, A_RECVPKT, pkt);
        break;
     case S_TIMEOUT:
-       dbprintf(("%s: timeout\n", debug_prefix_time(NULL)));
+       dbprintf(_("timeout\n"));
        state_machine(as, A_TIMEOUT, NULL);
        break;
     case S_ERROR:
-       dbprintf(("%s: receive error: %s\n",
-           debug_prefix_time(NULL), security_geterror(as->security_handle)));
+       dbprintf(_("receive error: %s\n"),
+           security_geterror(as->security_handle));
        break;
     }
 }
@@ -1203,7 +1175,7 @@ process_readnetfd(
      * Process has died.
      */
     if (n < 0) {
-       pkt_init(&nak, P_NAK, "A ERROR data descriptor %d broken: %s\n",
+       pkt_init(&nak, P_NAK, _("A ERROR data descriptor %d broken: %s\n"),
            dh->fd_read, strerror(errno));
        goto sendnak;
     }
@@ -1227,7 +1199,7 @@ process_readnetfd(
     }
     if (security_stream_write(dh->netfd, as->databuf, (size_t)n) < 0) {
        /* stream has croaked */
-       pkt_init(&nak, P_NAK, "ERROR write error on stream %d: %s\n",
+       pkt_init(&nak, P_NAK, _("ERROR write error on stream %d: %s\n"),
            security_stream_id(dh->netfd),
            security_stream_geterror(dh->netfd));
        goto sendnak;
@@ -1256,8 +1228,7 @@ process_writenetfd(
     dh = cookie;
 
     if (dh->fd_write <= 0) {
-       dbprintf(("%s: process_writenetfd: dh->fd_write <= 0\n",
-           debug_prefix_time(NULL)));
+       dbprintf(_("process_writenetfd: dh->fd_write <= 0\n"));
     } else if (size > 0) {
        fullwrite(dh->fd_write, buf, (size_t)size);
        security_stream_read(dh->netfd, process_writenetfd, dh);
@@ -1299,8 +1270,8 @@ allocstream(
     /* allocate a stream from the security layer and return */
     dh->netfd = security_stream_server(as->security_handle);
     if (dh->netfd == NULL) {
-       dbprintf(("%s: couldn't open stream to server: %s\n",
-           debug_prefix_time(NULL), security_geterror(as->security_handle)));
+       dbprintf(_("couldn't open stream to server: %s\n"),
+           security_geterror(as->security_handle));
        return (-1);
     }
 
@@ -1334,18 +1305,18 @@ service_new(
     /* a plethora of pipes */
     for (i = 0; i < DATA_FD_COUNT + 1; i++) {
        if (pipe(data_read[i]) < 0) {
-           error("pipe: %s\n", strerror(errno));
+           error(_("pipe: %s\n"), strerror(errno));
            /*NOTREACHED*/
        }
        if (pipe(data_write[i]) < 0) {
-           error("pipe: %s\n", strerror(errno));
+           error(_("pipe: %s\n"), strerror(errno));
            /*NOTREACHED*/
        }
     }
 
     switch(pid = fork()) {
     case -1:
-       error("could not fork service %s: %s\n", cmd, strerror(errno));
+       error(_("could not fork service %s: %s\n"), cmd, strerror(errno));
        /*NOTREACHED*/
     default:
        /*
@@ -1416,16 +1387,12 @@ service_new(
         * The child.  Put our pipes in their advertised locations
         * and start up.
         */
-#ifdef FORCE_USERID
-       seteuid((uid_t)0);
-       setuid(client_uid);
-#endif
 
        /*
         * The data stream is stdin in the new process
         */
         if (dup2(data_read[0][0], 0) < 0) {
-           error("dup %d to %d failed: %s\n", data_read[0][0], 0,
+           error(_("dup %d to %d failed: %s\n"), data_read[0][0], 0,
                strerror(errno));
            /*NOTREACHED*/
        }
@@ -1436,7 +1403,7 @@ service_new(
         * The reply stream is stdout
         */
         if (dup2(data_write[0][1], 1) < 0) {
-           error("dup %d to %d failed: %s\n", data_write[0][1], 1,
+           error(_("dup %d to %d failed: %s\n"), data_write[0][1], 1,
                strerror(errno));
        }
         aclose(data_write[0][0]);
@@ -1456,14 +1423,14 @@ service_new(
                  data_read[i + 1][1] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) {
                newfd = dup(data_read[i + 1][1]);
                if(newfd == -1)
-                   error("Can't dup out off DATA_FD range");
+                   error(_("Can't dup out off DATA_FD range"));
                data_read[i + 1][1] = newfd;
            }
            while(data_write[i + 1][0] >= DATA_FD_OFFSET &&
                  data_write[i + 1][0] <= DATA_FD_OFFSET + DATA_FD_COUNT*2 - 1) {
                newfd = dup(data_write[i + 1][0]);
                if(newfd == -1)
-                   error("Can't dup out off DATA_FD range");
+                   error(_("Can't dup out off DATA_FD range"));
                data_write[i + 1][0] = newfd;
            }
        }
@@ -1476,24 +1443,25 @@ service_new(
         */
        for (i = 0; i < DATA_FD_COUNT; i++) {
            if (dup2(data_read[i + 1][1], i*2 + DATA_FD_OFFSET) < 0) {
-               error("dup %d to %d failed: %s\n", data_read[i + 1][1],
+               error(_("dup %d to %d failed: %s\n"), data_read[i + 1][1],
                    i + DATA_FD_OFFSET, strerror(errno));
            }
            aclose(data_read[i + 1][1]);
 
            if (dup2(data_write[i + 1][0], i*2 + 1 + DATA_FD_OFFSET) < 0) {
-               error("dup %d to %d failed: %s\n", data_write[i + 1][0],
+               error(_("dup %d to %d failed: %s\n"), data_write[i + 1][0],
                    i + DATA_FD_OFFSET, strerror(errno));
            }
            aclose(data_write[i + 1][0]);
        }
 
        /* close all unneeded fd */
+       close(STDERR_FILENO);
+       debug_dup_stderr_to_debug();
        safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2);
-       close(2);
 
        execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env());
-       error("could not exec service %s: %s\n", cmd, strerror(errno));
+       error(_("could not exec service %s: %s\n"), cmd, strerror(errno));
        /*NOTREACHED*/
     }
     return NULL;
@@ -1509,9 +1477,8 @@ service_delete(
     int i;
     struct datafd_handle *dh;
 
-    amandad_debug(1, ("%s: closing service: %s\n",
-                     debug_prefix_time(NULL),
-                     (as->cmd)?as->cmd:"??UNKONWN??"));
+    amandad_debug(1, _("closing service: %s\n"),
+                     (as->cmd)?as->cmd:_("??UNKONWN??"));
 
     assert(as != NULL);
 
@@ -1604,8 +1571,8 @@ do_sendpkt(
     security_handle_t *        handle,
     pkt_t *            pkt)
 {
-    dbprintf(("%s: sending %s pkt:\n<<<<<\n%s>>>>>\n",
-       debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body));
+    dbprintf(_("sending %s pkt:\n<<<<<\n%s>>>>>\n"),
+       pkt_type2str(pkt->type), pkt->body);
     if (handle)
        return security_sendpkt(handle, pkt);
     else
@@ -1636,7 +1603,7 @@ state2str(
     for (i = 0; i < (int)(sizeof(states) / sizeof(states[0])); i++)
        if (state == states[i].state)
            return (states[i].str);
-    return ("INVALID STATE");
+    return (_("INVALID STATE"));
 }
 
 /*
@@ -1666,5 +1633,25 @@ action2str(
     for (i = 0; i < (int)(sizeof(actions) / sizeof(actions[0])); i++)
        if (action == actions[i].action)
            return (actions[i].str);
-    return ("UNKNOWN ACTION");
+    return (_("UNKNOWN ACTION"));
 }
+
+static char *
+amandad_get_security_conf(
+    char *      string,
+    void *      arg)
+{
+    (void)arg;      /* Quiet unused parameter warning */
+
+    if (!string || !*string)
+       return(NULL);
+
+    if (strcmp(string, "kencrypt")==0) {
+       if (amandad_kencrypt == KENCRYPT_YES)
+           return ("yes");
+       else
+           return (NULL);
+    }
+    return(NULL);
+}
+
index 9ce31fdebddaeb3dc5ac68228b3befff300a1d63..7444c5ea3e051dd5553900d2abfbbaa5f5416ae6 100644 (file)
@@ -65,46 +65,41 @@ parse_g_options(
     while (tok != NULL) {
        if(strncmp(tok,"features=", 9) == 0) {
            if(g_options->features != NULL) {
-               dbprintf(("%s: multiple features option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple features option\n"));
                if(verbose) {
-                   printf("ERROR [multiple features option]\n");
+                   g_printf(_("ERROR [multiple features option]\n"));
                }
            }
            if((g_options->features = am_string_to_feature(tok+9)) == NULL) {
-               dbprintf(("%s: bad features value \"%s\n",
-                         debug_prefix_time(NULL), tok+10));
+               dbprintf(_("bad features value \"%s\"\n"), tok+10);
                if(verbose) {
-                   printf("ERROR [bad features value \"%s\"]\n", tok+10);
+                   g_printf(_("ERROR [bad features value \"%s\"]\n"), tok+10);
                }
            }
        }
        else if(strncmp(tok,"hostname=", 9) == 0) {
            if(g_options->hostname != NULL) {
-               dbprintf(("%s: multiple hostname option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple hostname option\n"));
                if(verbose) {
-                   printf("ERROR [multiple hostname option]\n");
+                   g_printf(_("ERROR [multiple hostname option]\n"));
                }
            }
            g_options->hostname = stralloc(tok+9);
        }
        else if(strncmp(tok,"auth=", 5) == 0) {
            if(g_options->auth != NULL) {
-               dbprintf(("%s: multiple auth option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple auth option\n"));
                if(verbose) {
-                   printf("ERROR [multiple auth option]\n");
+                   g_printf(_("ERROR [multiple auth option]\n"));
                }
            }
            g_options->auth = stralloc(tok+5);
        }
        else if(strncmp(tok,"maxdumps=", 9) == 0) {
            if(g_options->maxdumps != 0) {
-               dbprintf(("%s: multiple maxdumps option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple maxdumps option\n"));
                if(verbose) {
-                   printf("ERROR [multiple maxdumps option]\n");
+                   g_printf(_("ERROR [multiple maxdumps option]\n"));
                }
            }
            if(sscanf(tok+9, "%d;", &new_maxdumps) == 1) {
@@ -115,46 +110,41 @@ parse_g_options(
                    g_options->maxdumps = new_maxdumps;
                }
                else {
-                   dbprintf(("%s: bad maxdumps value \"%s\"\n",
-                             debug_prefix_time(NULL), tok+9));
+                   dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9);
                    if(verbose) {
-                       printf("ERROR [bad maxdumps value \"%s\"]\n",
+                       g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"),
                               tok+9);
                    }
                }
            }
            else {
-               dbprintf(("%s: bad maxdumps value \"%s\"\n",
-                         debug_prefix_time(NULL), tok+9));
+               dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9);
                if(verbose) {
-                   printf("ERROR [bad maxdumps value \"%s\"]\n",
+                   g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"),
                           tok+9);
                }
            }
        }
        else if(strncmp(tok,"config=", 7) == 0) {
            if(g_options->config != NULL) {
-               dbprintf(("%s: multiple config option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple config option\n"));
                if(verbose) {
-                   printf("ERROR [multiple config option]\n");
+                   g_printf(_("ERROR [multiple config option]\n"));
                }
            }
            g_options->config = stralloc(tok+7);
            if (strchr(g_options->config, '/')) {
                amfree(g_options->config);
-               dbprintf(("%s: invalid character in config option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("invalid character in config option\n"));
                if(verbose) {
-                   printf("ERROR [invalid character in config option]\n");
+                   g_printf(_("ERROR [invalid character in config option]\n"));
                }
            }
        }
        else {
-           dbprintf(("%s: unknown option \"%s\"\n",
-                                  debug_prefix_time(NULL), tok));
+           dbprintf(_("unknown option \"%s\"\n"), tok);
            if(verbose) {
-               printf("ERROR [unknown option \"%s\"]\n", tok);
+               g_printf(_("ERROR [unknown option \"%s\"]\n"), tok);
            }
        }
        tok = strtok(NULL, ";");
@@ -172,10 +162,12 @@ void
 free_g_options(
     g_option_t *       g_options)
 {
-    amfree(g_options->str);
-    am_release_feature_set(g_options->features);
-    amfree(g_options->hostname);
-    amfree(g_options->auth);
-    amfree(g_options->config);
-    amfree(g_options);
+    if (g_options != NULL) {
+       amfree(g_options->str);
+       am_release_feature_set(g_options->features);
+       amfree(g_options->hostname);
+       amfree(g_options->auth);
+       amfree(g_options->config);
+       amfree(g_options);
+    }
 }
index 7723ed9ab859c19d82028125d23ac40b196a5a40..f0b0c109e19fe51fda7053d8291ccdea0563f082 100644 (file)
@@ -1,44 +1,28 @@
 # Makefile for amplot.
 
-SUFFIXES =             .sh
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
 
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+SCRIPTS_SHELL = amplot
+SCRIPTS_AWK = amcat.awk
 
-sbin_SCRIPTS =         amplot
+sbin_SCRIPTS =         $(SCRIPTS_SHELL)
+amplotdir =            $(amlibexecdir)
+amplot_DATA =          $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp
 
-amplot_DATA =          amcat.awk amplot.awk amplot.g amplot.gp
+EXTRA_DIST +=          amplot.awk              amplot.g
 
-amplotdir =            $(libexecdir)
+CLEANFILES += amplot.gp.new
+DISTCLEANFILES += amplot.gp
 
-EXTRA_DIST =           amplot.awk              amplot.g
+amplot.gp: amplot.g
+       cat $(srcdir)/amplot.g > amplot.gp.new
+       echo "pause -1;" >> amplot.gp.new
+       rm -f amplot.gp
+       mv amplot.gp.new amplot.gp
 
-CLEANFILES = amplot.gp.new
-DISTCLEANFILES = amplot.gp amplot
-
-amplot.gp:             amplot.g
-                       cat $(srcdir)/amplot.g > amplot.gp.new
-                       echo "pause -1;" >> amplot.gp.new
-                       rm -f amplot.gp
-                       mv amplot.gp.new amplot.gp
-
-install-exec-hook:
-       @list="$(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-
-install-data-hook:
-       @list="$(amplot_DATA)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/$$p; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-        done
+INSTALLPERMS_data = \
+       dest=$(amplotdir) chown=amanda $(amplot_DATA) \
+       dest=$(sbindir) chown=amanda $(sbin_SCRIPTS)
index a0c2eda6918db2e468f1b1b1f18ffb396a51ef41..cf7bc5e94578e9ff3e708d37d0c1ced43e782e90 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for amplot.
 
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,52 +159,123 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-subdir = amplot
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/amcat.awk.in $(srcdir)/amplot.sh.in
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+subdir = amplot
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = amcat.awk amplot.sh
+CONFIG_CLEAN_FILES =
 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amplotdir)"
 sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(sbin_SCRIPTS)
@@ -100,15 +290,14 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 amplotDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(amplot_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -116,14 +305,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -134,20 +328,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -161,60 +354,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -224,10 +526,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -238,24 +554,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -267,59 +617,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -328,37 +665,66 @@ 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@
 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@
-SUFFIXES = .sh
-sbin_SCRIPTS = amplot
-amplot_DATA = amcat.awk amplot.awk amplot.g amplot.gp
-amplotdir = $(libexecdir)
-EXTRA_DIST = amplot.awk                amplot.g
-CLEANFILES = amplot.gp.new
-DISTCLEANFILES = amplot.gp amplot
-all: all-am
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = amplot.awk amplot.g
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log amplot.gp.new
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \
+       amplot.gp
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
+SCRIPTS_SHELL = amplot
+SCRIPTS_AWK = amcat.awk
+sbin_SCRIPTS = $(SCRIPTS_SHELL)
+amplotdir = $(amlibexecdir)
+amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp
+INSTALLPERMS_data = \
+       dest=$(amplotdir) chown=amanda $(amplot_DATA) \
+       dest=$(sbindir) chown=amanda $(sbin_SCRIPTS)
+
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sh
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+.SUFFIXES: 
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -387,13 +753,9 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-amcat.awk: $(top_builddir)/config.status $(srcdir)/amcat.awk.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amplot.sh: $(top_builddir)/config.status $(srcdir)/amplot.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
@@ -416,13 +778,9 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
-
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
 install-amplotDATA: $(amplot_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(amplotdir)" || $(mkdir_p) "$(DESTDIR)$(amplotdir)"
+       test -z "$(amplotdir)" || $(MKDIR_P) "$(DESTDIR)$(amplotdir)"
        @list='$(amplot_DATA)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          f=$(am__strip_dir) \
@@ -445,22 +803,21 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -471,14 +828,20 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(SCRIPTS) $(DATA)
 installdirs:
        for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amplotdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -493,6 +856,7 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -504,13 +868,17 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -526,14 +894,22 @@ install-data-am: install-amplotDATA
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
+install-dvi: install-dvi-am
+
 install-exec-am: install-sbinSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -552,51 +928,160 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-amplotDATA uninstall-info-am \
-       uninstall-sbinSCRIPTS
+uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS
 
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       distclean distclean-generic distclean-libtool distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-amplotDATA install-data install-data-am \
-       install-data-hook install-exec install-exec-am \
-       install-exec-hook install-info install-info-am install-man \
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: all all-am check check-am check-local clean clean-generic \
+       clean-libtool dist-hook distclean distclean-generic \
+       distclean-libtool distdir dvi dvi-am html html-am info info-am \
+       install install-am install-amplotDATA install-data \
+       install-data-am install-data-hook install-dvi install-dvi-am \
+       install-exec install-exec-am install-exec-hook install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
        install-sbinSCRIPTS install-strip installcheck installcheck-am \
        installdirs maintainer-clean maintainer-clean-generic \
        mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
        ps ps-am uninstall uninstall-am uninstall-amplotDATA \
-       uninstall-info-am uninstall-sbinSCRIPTS
-
-
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
-
-amplot.gp:             amplot.g
-                       cat $(srcdir)/amplot.g > amplot.gp.new
-                       echo "pause -1;" >> amplot.gp.new
-                       rm -f amplot.gp
-                       mv amplot.gp.new amplot.gp
-
-install-exec-hook:
-       @list="$(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+       uninstall-sbinSCRIPTS
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
-install-data-hook:
-       @list="$(amplot_DATA)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/$$p; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-        done
+amplot.gp: amplot.g
+       cat $(srcdir)/amplot.g > amplot.gp.new
+       echo "pause -1;" >> amplot.gp.new
+       rm -f amplot.gp
+       mv amplot.gp.new amplot.gp
 # 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/amplot/amplot.sh b/amplot/amplot.sh
new file mode 100644 (file)
index 0000000..fe47bcc
--- /dev/null
@@ -0,0 +1,202 @@
+#!@SHELL@
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1992-1998 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: Olafur Gudumundsson, (ogud@tis.com)  Trusted Information Systems
+# Formerly at:                   Systems Design and Analysis Group
+#                        Computer Science Department
+#                        University of Maryland at College Park
+#
+#      Amplot: a program to generate postscript plots of each nights amanda 
+#      performance 
+# 
+#      Author: Olafur Gudmundsson (ogud@tis.com) 
+#      Creation Date: April 1992 
+#      Last modified: April 1995 
+#      Input: list of amdumps 
+#      Output: Plot of amdump files as either gnuplots on the screen or
+#              Postscript files 
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+confdir=@CONFIG_DIR@
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+# we use a different version of the compression variable than amanda itself.
+COMPRESS=@AMPLOT_COMPRESS@
+
+# Function to check that awk can do command-line variable
+# substitution.  If no, then exit; if yes, set $AVARFLAG
+# to the commandline switch used to introduce a variable. This
+# check used to be performed at build time in configure; it's
+# now performed at runtime.
+test_awk() {
+       local tmpfile result
+       tmpfile=`mktemp /tmp/amplot.XXXXXX`
+       echo 'BEGIN{print i; exit}' > ${tmpfile}
+       result=`$AWK -f ${tmpfile} i=xx | wc -c`
+       if test "$result" -le 1; then
+               result=`$AWK -f ${tmpfile} -v i=xx | wc -c`
+               if test "$result" -le 1; then
+                       echo "$AWK does not support command-line variable assignment; amplot cannot run" >&2
+                       rm -fr $tmpfile
+                       exit 1
+               else
+                       AVARFLAG=-v
+               fi
+       else
+               AVARFLAG=''
+       fi
+
+       rm -fr $tmpfile
+}
+
+# Function to search for gnuplot and ensure it's working.  This
+# first tries the location detected/configured when amanda was built,
+# then tries 'gnuplot', assuming it's in the user's path.  If no
+# working gnuplot executable is found, it exits with an error.  The
+# variable $GNUPLOT is set to the resulting executable.
+find_gnuplot() {
+       if test "x$GNUPLOT" = "x"; then
+               # look for it in the user's PATH
+               GNUPLOT=gnuplot
+       fi
+
+       if ${GNUPLOT} --version 2>/dev/null | grep '^gnuplot' >/dev/null; then
+               : # looks OK
+       else
+               echo "${GNUPLOT} was not found; amplot cannot run"
+               exit 1
+       fi
+}
+
+# check our environment, using functions from above
+test_awk
+find_gnuplot
+
+if [ $# -eq 0 ] ; then
+       _ 'Usage: %s [-c] [-e] [-g] [-l] [-p] [-t hours] <amdump_files.[gz,z,Z]>\n' $0
+       _ '%s generates plot for screen with fixed dimensions\n' $0
+       _ '     -c      Compress the input amdump files after plotting\n'
+       _ '     -e      Extends x (time) axes if needed\n'
+       _ '     -g      Run gnuplot directly no postscript file generated DEFAULT\n'
+       _ '     -l      Landscape mode suitable for printing\n'
+       _ '     -p      Postscript output (color)\n'
+       _ '     -b      The postscipt will be b/w\n'
+       _ '     -t T    Set the right edge of the plot to be T hours\n'
+       exit 1 
+fi
+
+tmp_files="bandw_free disk_alloc dump_idle finished run_queue tape_* title" 
+
+my_plot=$amlibexecdir/amplot.g
+paper=0 
+gnuplot=1
+cmpres=0
+para=""
+maxtime=4
+bw=0
+
+# setting up the parameters to pass to [gn]awk 
+while :; do 
+   case "$1" in
+   -c)  cmpres=1; shift;;
+   -e)  para=$para"$AVARFLAG extend=1 "; shift;;
+   -g)  gnuplot=1; shift;;
+   -l)  paper=1; para=$para"$AVARFLAG paper=1 "; shift;;
+   -p)  gnuplot=0; shift;;
+   -b) bw=1; shift;;
+   -t)  shift
+       if test "$#" -eq 0; then
+           _ '%s: no argument for -t option\n' $0 1>&2
+           exit 5
+       fi
+       maxtime="$1"; shift;;
+   *) break;;
+   esac
+done
+if [ $# -eq 0 ] ; then 
+       _ '%s: no input files\n' $0 1>&2
+       exit 5
+fi
+para=$para"$AVARFLAG maxtime=$maxtime"
+
+if [ $gnuplot  -eq 1 ] ; then
+       my_plot=$my_plot"p"             # use the plot prog that pauses
+       plot=" -geometry 800x700+40+0" 
+       para=$para"$AVARFLAG gnuplot=1 "
+       _ "Displaying graph on the screen, <CR> for next graph"
+
+       if [ "$paper" -eq 1 ] ; then
+               _ '%s: -l requires -p flag at the same time\n' $0 1>&2
+               exit 6 
+       fi
+       if [ "$bw" -eq 1 ] ; then
+               _ '%s: -b requires -p flag at the same time\n' $0 1>&2
+               exit 6 
+       fi
+fi
+
+if [ $bw -eq 1 ]; then
+       para=$para" bw=1"
+fi
+
+list="";               # files to compress at the end
+
+for i in ${1+"$@"}             # for all the input files
+do
+       f="$i";
+       if [ ! -f "$f" ] ; then 
+               f=`ls "$i" "$i".*[zZ] 2>/dev/null`
+       fi
+       if [ -f "$f" ] ; then           # found file 
+                disp=`$AWK -f $amlibexecdir/amcat.awk $AVARFLAG f="$f"`
+               if [ -z "$disp" ] ; then 
+                       _ 'Do not know how to [gz|z]cat this file\n'
+               else
+                       /bin/rm -f $tmp_files 
+                       $disp "$f" | $AWK -f $amlibexecdir/amplot.awk $para
+                       $GNUPLOT $plot $my_plot
+                       if [ $disp = "cat" -a  $cmpres -eq 1 ] ; then
+                               list=$list" "$f
+                       fi
+               fi
+       else                            # check if file has been compressed
+               _ 'No such file %s or %s\n' "$i" "$i.*[zZ]"
+       fi
+done
+
+/bin/rm -f $tmp_files 
+
+if [ "$list" != "" ] ; then            # now compress the files we worked on
+# comment out next line if you do not want compression at the end
+       _ 'Compressing %s\n' "$list"
+       $COMPRESS $list
+fi
+exit 0
diff --git a/amplot/amplot.sh.in b/amplot/amplot.sh.in
deleted file mode 100644 (file)
index f771e74..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-#!@SHELL@
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1992-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: Olafur Gudumundsson, (ogud@tis.com)  Trusted Information Systems
-# Formerly at:                   Systems Design and Analysis Group
-#                        Computer Science Department
-#                        University of Maryland at College Park
-#
-#      Amplot: a program to generate postscript plots of each nights amanda 
-#      performance 
-# 
-#      Author: Olafur Gudmundsson (ogud@tis.com) 
-#      Creation Date: April 1992 
-#      Last modified: April 1995 
-#      Input: list of amdumps 
-#      Output: Plot of amdump files as either gnuplots on the screen or
-#              Postscript files 
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-confdir=@CONFIG_DIR@
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:$PATH
-export PATH
-
-AWK=@AWK@
-GNUPLOT=@GNUPLOT@
-COMPRESS=@AMPLOT_COMPRESS@
-
-#+
-# Function to:
-#    Simplify gettext usage by allowing printf format
-#    strings for translators, use _() identifier for
-#    xgettext extraction similar to "C" usage and
-#    collapsing "printf `gettext fmt` ...", which is
-#    used everywhere, into one function.
-#-
-_() {
-       fmt="$1"
-       shift
-       printf "$fmt" $*
-}
-
-# Function to check that awk can do command-line variable
-# substitution.  If no, then exit; if yes, set $AVARFLAG
-# to the commandline switch used to introduce a variable. This
-# check used to be performed at build time in configure; it's
-# now performed at runtime.
-test_awk() {
-       local tmpfile result
-       tmpfile=`mktemp /tmp/amplot.XXXXXX`
-       echo 'BEGIN{print i; exit}' > ${tmpfile}
-       result=`$AWK -f ${tmpfile} i=xx | wc -c`
-       if test "$result" -le 1; then
-               result=`$AWK -f ${tmpfile} -v i=xx | wc -c`
-               if test "$result" -le 1; then
-                       echo "$AWK does not support command-line variable assignment; amplot cannot run" >&2
-                       rm -fr $tmpfile
-                       exit 1
-               else
-                       AVARFLAG=-v
-               fi
-       else
-               AVARFLAG=''
-       fi
-
-       rm -fr $tmpfile
-}
-
-# Function to search for gnuplot and ensure it's working.  This
-# first tries the location detected/configured when amanda was built,
-# then tries 'gnuplot', assuming it's in the user's path.  If no
-# working gnuplot executable is found, it exits with an error.  The
-# variable $GNUPLOT is set to the resulting executable.
-find_gnuplot() {
-       if test "x$GNUPLOT" = "x"; then
-               # look for it in the user's PATH
-               GNUPLOT=gnuplot
-       fi
-
-       if ${GNUPLOT} --version 2>/dev/null | grep '^gnuplot' >/dev/null; then
-               : # looks OK
-       else
-               echo "${GNUPLOT} was not found; amplot cannot run"
-               exit 1
-       fi
-}
-
-# check our environment, using functions from above
-test_awk
-find_gnuplot
-
-if [ $# -eq 0 ] ; then
-       _ 'Usage: %s [-c] [-e] [-g] [-l] [-p] [-t hours] <amdump_files.[gz,z,Z]>\n' $0
-       _ '%s generates plot for screen with fixed dimensions\n' $0
-       _ '     -c      Compress the input amdump files after plotting\n'
-       _ '     -e      Extends x (time) axes if needed\n'
-       _ '     -g      Run gnuplot directly no postscript file generated DEFAULT\n'
-       _ '     -l      Landscape mode suitable for printing\n'
-       _ '     -p      Postscript output (color)\n'
-       _ '     -b      The postscipt will be b/w\n'
-       _ '     -t T    Set the right edge of the plot to be T hours\n'
-       exit 1 
-fi
-
-tmp_files="bandw_free disk_alloc dump_idle finished run_queue tape_* title" 
-
-my_plot=$libexecdir/amplot.g
-paper=0 
-gnuplot=1
-cmpres=0
-para=""
-maxtime=4
-bw=0
-
-# setting up the parameters to pass to [gn]awk 
-while :; do 
-   case "$1" in
-   -c)  cmpres=1; shift;;
-   -e)  para=$para"$AVARFLAG extend=1 "; shift;;
-   -g)  gnuplot=1; shift;;
-   -l)  paper=1; para=$para"$AVARFLAG paper=1 "; shift;;
-   -p)  gnuplot=0; shift;;
-   -b) bw=1; shift;;
-   -t)  shift
-       if test "$#" -eq 0; then
-           _ '%s: no argument for -t option\n' $0 1>&2
-           exit 5
-       fi
-       maxtime="$1"; shift;;
-   *) break;;
-   esac
-done
-if [ $# -eq 0 ] ; then 
-       _ '%s: no input files\n' $0 1>&2
-       exit 5
-fi
-para=$para"$AVARFLAG maxtime=$maxtime"
-
-if [ $gnuplot  -eq 1 ] ; then
-       my_plot=$my_plot"p"             # use the plot prog that pauses
-       plot=" -geometry 800x700+40+0" 
-       para=$para"$AVARFLAG gnuplot=1 "
-       _ "Displaying graph on the screen, <CR> for next graph"
-
-       if [ "$paper" -eq 1 ] ; then
-               _ '%s: -l requires -p flag at the same time\n' $0 1>&2
-               exit 6 
-       fi
-       if [ "$bw" -eq 1 ] ; then
-               _ '%s: -b requires -p flag at the same time\n' $0 1>&2
-               exit 6 
-       fi
-fi
-
-if [ $bw -eq 1 ]; then
-       para=$para" bw=1"
-fi
-
-list="";               # files to compress at the end
-
-for i in ${1+"$@"}             # for all the input files
-do
-       f="$i";
-       if [ ! -f "$f" ] ; then 
-               f=`ls "$i" "$i".*[zZ] 2>/dev/null`
-       fi
-       if [ -f "$f" ] ; then           # found file 
-                disp=`$AWK -f $libexecdir/amcat.awk $AVARFLAG f="$f"`
-               if [ -z "$disp" ] ; then 
-                       _ 'Do not know how to [gz|z]cat this file\n'
-               else
-                       /bin/rm -f $tmp_files 
-                       $disp "$f" | $AWK -f $libexecdir/amplot.awk $para
-                       $GNUPLOT $plot $my_plot
-                       if [ $disp = "cat" -a  $cmpres -eq 1 ] ; then
-                               list=$list" "$f
-                       fi
-               fi
-       else                            # check if file has been compressed
-               _ 'No such file %s or %s\n' "$i" "$i.*[zZ]"
-       fi
-done
-
-/bin/rm -f $tmp_files 
-
-if [ "$list" != "" ] ; then            # now compress the files we worked on
-# comment out next line if you do not want compression at the end
-       _ 'Compressing %s\n' "$list"
-       $COMPRESS $list
-fi
-exit 0
diff --git a/autogen b/autogen
index e15c807cb6ce84813a00429034d6c4d15981d557..2e6bf5a19a32bdc5d0896669215420c6d8d9e74b 100755 (executable)
--- a/autogen
+++ b/autogen
@@ -1,19 +1,46 @@
 #! /bin/sh
-# rebuilds files generated by autoconf&automake.
-# autoconf 2.13 and automake 1.4 or newer are required
-# arguments are forwarded to the autoreconf script.
 
+# cd to the directory we're run from
 cd `dirname $0`
 
-touch config/config.h.in
+# if you change this, please also change it in the root Makefile.am
+includes="-I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive"
+
+# clean up
+rm -f aclocal.m4
+rm -rf autom4te*.cache
+rm -f configure
+
+die() {
+    echo x"${@}" | sed s/^x//
+    exit 1
+}
+
+echo "See DEVELOPING for instructions on updating:"
+echo " * gettext macros"
+echo " * gnulib"
+echo " * libtool files"
+
+echo "..creating file lists"
+(   cd config
+    for m4dir in amanda gettext-macros gnulib macro-archive; do
+       echo "## this file is automatically generated by autogen" > "$m4dir/file-list"
+       for f in $m4dir/*.m4; do echo "EXTRA_DIST += $f" >> "$m4dir/file-list"; done
+    done
 
-if test x`ls -1t acinclude.m4 2>/dev/null \
-           config/gnulib.m4i config/acinclude.m4i config/libtool.m4i |
-         sed 1q` != x"acinclude.m4"; then
-    rm -f acinclude.m4
-    # keep libtool.m4i first here, as it has a "serial number" comment that it wants
-    # first in the file
-    cat config/libtool.m4i config/gnulib.m4i config/acinclude.m4i > acinclude.m4
-fi
+    echo "## this file is automatically generated by autogen" > "automake/file-list"
+    for f in automake/*.am; do echo "EXTRA_DIST += $f" >> "automake/file-list"; done
+)
+
+echo "..aclocal"
+aclocal $includes || die "aclocal failed"
+
+echo "..autoconf"
+autoconf || die "autoconf failed"
+
+echo "..autoheader"
+autoheader || die "autoheader failed"
+touch config/config.h.in
 
-autoreconf --warning=syntax --warning=no-portability --force ${1+"$@"} || exit 1
+echo "..automake"
+automake --force --copy --warnings=none || die "automake failed"
index 76328451193a830dfd94a398352539c22c891198..8fa0c371c69832da8bac98c88f0493538e204422 100644 (file)
@@ -1,17 +1,22 @@
 # Makefile for Amanda tape changer programs.
 
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/server-src   \
                -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/gnulib
 
-LINT=@AMLINT@
-LINTFLAGS=@AMLINTFLAGS@
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 
-LIB_EXTENSION = la
+LINT=$(AMLINT)
+LINTFLAGS=$(AMLINTFLAGS)
 
-if WANT_CHIO_SCSI
+if WANT_CHG_SCSI_CHIO
 CHIO_SCSI = chg-scsi-chio
 endif
 
@@ -19,16 +24,35 @@ if WANT_CHG_SCSI
 CHG_SCSI = chg-scsi
 endif
 
-libexec_PROGRAMS =     $(CHG_SCSI)
+amlibexec_PROGRAMS =   $(CHG_SCSI)
 EXTRA_PROGRAMS =       $(CHIO_SCSI)
 
-libexec_SCRIPTS =      chg-manual      chg-multi       chg-mtx         \
-                       chg-rth         chg-chs         chg-chio        \
-                       chg-zd-mtx      chg-juke        chg-rait        \
-                       chg-null        chg-mcutil      chg-disk        \
-                       chg-iomega  chg-lib.sh
+CHECK_PERL = \
+               chg-chio \
+               chg-iomega \
+               chg-rth
+
+SCRIPTS_PERL = $(CHECK_PERL)
+
+SCRIPTS_SHELL = \
+               chg-manual \
+               chg-multi \
+               chg-mtx \
+               chg-chs \
+               chg-zd-mtx \
+               chg-juke \
+               chg-rait \
+               chg-null \
+               chg-mcutil \
+               chg-disk
+
+SCRIPTS_INCLUDE = \
+               chg-lib.sh
 
-CLEANFILES = $(libexec_SCRIPTS)
+EXTRA_DIST += chg-lib.sh.in
+
+amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+amlibexec_DATA = $(SCRIPTS_INCLUDE)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -37,54 +61,60 @@ CLEANFILES = $(libexec_SCRIPTS)
 # routines, and second to pick up any references in the other libraries.
 ###
 
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../server-src/libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../gnulib/libgnu.$(LIB_EXTENSION) \
+LDADD = ../common-src/libamanda.la \
+       ../tape-src/libamtape.la \
+       ../common-src/libamanda.la \
+       ../gnulib/libgnu.la \
        $(READLINE_LIBS)
 
-SUFFIXES =             .pl .sh
+chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c 
+if WANT_SCSI_AIX
+chg_scsi_CSRC += scsi-aix.c
+endif
+if WANT_SCSI_HPUX_NEW
+chg_scsi_CSRC += scsi-hpux_new.c
+endif
+if WANT_SCSI_IRIX
+chg_scsi_CSRC += scsi-irix.c
+endif
+if WANT_SCSI_LINUX
+chg_scsi_CSRC += scsi-linux.c
+endif
+if WANT_SCSI_SOLARIS
+chg_scsi_CSRC += scsi-solaris.c
+endif
+if WANT_SCSI_BSD
+chg_scsi_CSRC += scsi-bsd.c
+endif
+if WANT_SCSI_CAM
+chg_scsi_CSRC += scsi-cam.c
+endif
 
-chg_scsi_CSRC = chg-scsi.c scsi-aix.c scsi-changer-driver.c            \
-               scsi-hpux_new.c scsi-irix.c scsi-linux.c scsi-solaris.c \
-               scsi-bsd.c scsi-cam.c sense.c 
 chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
 
-chg_scsi_chio_CSRC = chg-scsi-chio.c scsi-hpux.c scsi-chio.c
+chg_scsi_chio_CSRC = chg-scsi-chio.c
+if WANT_SCSI_HPUX
+chg_scsi_chio_CSRC += scsi-hpux.c
+endif
+if WANT_SCSI_CHIO
+chg_scsi_chio_CSRC += scsi-chio.c
+endif
 chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
 
-EXTRA_DIST = scsi-proto.c
-
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
-
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
-
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+EXTRA_DIST += scsi-proto.c
+
+INSTALLPERMS_exec = \
+       chown=amanda \
+       dest=$(sbindir) $(sbin_PROGRAMS) \
+       dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
+
+INSTALLPERMS_data = \
+       chown=amanda \
+       dest=$(sbindir) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(EXTRA_PROGRAMS); do                    \
+       @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
                f="$$p.c $(libamandad_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
@@ -93,7 +123,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index a1617971abd79e54e5b5d9daadd7b021758869c7..65dad199f89938605bb33b6e1d4a94f3e25f2f72 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda tape changer programs.
 
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
+
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,118 +160,209 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-libexec_PROGRAMS = $(am__EXEEXT_2)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+amlibexec_PROGRAMS = $(am__EXEEXT_2)
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
+@WANT_SCSI_AIX_TRUE@am__append_1 = scsi-aix.c
+@WANT_SCSI_HPUX_NEW_TRUE@am__append_2 = scsi-hpux_new.c
+@WANT_SCSI_IRIX_TRUE@am__append_3 = scsi-irix.c
+@WANT_SCSI_LINUX_TRUE@am__append_4 = scsi-linux.c
+@WANT_SCSI_SOLARIS_TRUE@am__append_5 = scsi-solaris.c
+@WANT_SCSI_BSD_TRUE@am__append_6 = scsi-bsd.c
+@WANT_SCSI_CAM_TRUE@am__append_7 = scsi-cam.c
+@WANT_SCSI_HPUX_TRUE@am__append_8 = scsi-hpux.c
+@WANT_SCSI_CHIO_TRUE@am__append_9 = scsi-chio.c
 subdir = changer-src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/chg-chio.pl.in $(srcdir)/chg-chs.sh.in \
-       $(srcdir)/chg-disk.sh.in $(srcdir)/chg-iomega.pl.in \
-       $(srcdir)/chg-juke.sh.in $(srcdir)/chg-lib.sh.in \
-       $(srcdir)/chg-manual.sh.in $(srcdir)/chg-mcutil.sh.in \
-       $(srcdir)/chg-mtx.sh.in $(srcdir)/chg-multi.sh.in \
-       $(srcdir)/chg-null.sh.in $(srcdir)/chg-rait.sh.in \
-       $(srcdir)/chg-rth.pl.in $(srcdir)/chg-zd-mtx.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = chg-manual.sh chg-multi.sh chg-mtx.sh chg-chs.sh \
-       chg-rth.pl chg-chio.pl chg-zd-mtx.sh chg-juke.sh chg-rait.sh \
-       chg-null.sh chg-mcutil.sh chg-disk.sh chg-iomega.pl chg-lib.sh
-@WANT_CHIO_SCSI_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT)
+CONFIG_CLEAN_FILES =
+@WANT_CHG_SCSI_CHIO_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT)
 @WANT_CHG_SCSI_TRUE@am__EXEEXT_2 = chg-scsi$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)"
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
-am__objects_1 = chg-scsi.$(OBJEXT) scsi-aix.$(OBJEXT) \
-       scsi-changer-driver.$(OBJEXT) scsi-hpux_new.$(OBJEXT) \
-       scsi-irix.$(OBJEXT) scsi-linux.$(OBJEXT) \
-       scsi-solaris.$(OBJEXT) scsi-bsd.$(OBJEXT) scsi-cam.$(OBJEXT) \
-       sense.$(OBJEXT)
-am_chg_scsi_OBJECTS = $(am__objects_1)
+am__installdirs = "$(DESTDIR)$(amlibexecdir)" \
+       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"
+amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(amlibexec_PROGRAMS)
+am__chg_scsi_SOURCES_DIST = libscsi.h scsi-defs.h chg-scsi.c \
+       scsi-changer-driver.c sense.c scsi-aix.c scsi-hpux_new.c \
+       scsi-irix.c scsi-linux.c scsi-solaris.c scsi-bsd.c scsi-cam.c
+@WANT_SCSI_AIX_TRUE@am__objects_1 = scsi-aix.$(OBJEXT)
+@WANT_SCSI_HPUX_NEW_TRUE@am__objects_2 = scsi-hpux_new.$(OBJEXT)
+@WANT_SCSI_IRIX_TRUE@am__objects_3 = scsi-irix.$(OBJEXT)
+@WANT_SCSI_LINUX_TRUE@am__objects_4 = scsi-linux.$(OBJEXT)
+@WANT_SCSI_SOLARIS_TRUE@am__objects_5 = scsi-solaris.$(OBJEXT)
+@WANT_SCSI_BSD_TRUE@am__objects_6 = scsi-bsd.$(OBJEXT)
+@WANT_SCSI_CAM_TRUE@am__objects_7 = scsi-cam.$(OBJEXT)
+am__objects_8 = chg-scsi.$(OBJEXT) scsi-changer-driver.$(OBJEXT) \
+       sense.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
+       $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+       $(am__objects_6) $(am__objects_7)
+am_chg_scsi_OBJECTS = $(am__objects_8)
 chg_scsi_OBJECTS = $(am_chg_scsi_OBJECTS)
 chg_scsi_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
-chg_scsi_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../server-src/libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-am__objects_2 = chg-scsi-chio.$(OBJEXT) scsi-hpux.$(OBJEXT) \
-       scsi-chio.$(OBJEXT)
-am_chg_scsi_chio_OBJECTS = $(am__objects_2)
+chg_scsi_DEPENDENCIES = ../common-src/libamanda.la \
+       ../tape-src/libamtape.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
+am__chg_scsi_chio_SOURCES_DIST = libscsi.h chg-scsi-chio.c scsi-hpux.c \
+       scsi-chio.c
+@WANT_SCSI_HPUX_TRUE@am__objects_9 = scsi-hpux.$(OBJEXT)
+@WANT_SCSI_CHIO_TRUE@am__objects_10 = scsi-chio.$(OBJEXT)
+am__objects_11 = chg-scsi-chio.$(OBJEXT) $(am__objects_9) \
+       $(am__objects_10)
+am_chg_scsi_chio_OBJECTS = $(am__objects_11)
 chg_scsi_chio_OBJECTS = $(am_chg_scsi_chio_OBJECTS)
 chg_scsi_chio_LDADD = $(LDADD)
-chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../server-src/libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(libexec_SCRIPTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.la \
+       ../tape-src/libamtape.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
+amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(amlibexec_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES)
-DIST_SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES)
+DIST_SOURCES = $(am__chg_scsi_SOURCES_DIST) \
+       $(am__chg_scsi_chio_SOURCES_DIST)
+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 = `echo $$p | sed -e 's|^.*/||'`;
+amlibexecDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(amlibexec_DATA)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -159,14 +370,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -177,20 +393,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -204,60 +419,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -267,10 +591,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -281,24 +619,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -310,59 +682,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -371,43 +730,84 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = chg-lib.sh.in scsi-proto.c
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/server-src   \
                -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/gnulib
 
-LINT = @AMLINT@
-LINTFLAGS = @AMLINTFLAGS@
-LIB_EXTENSION = la
-@WANT_CHIO_SCSI_TRUE@CHIO_SCSI = chg-scsi-chio
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+LINT = $(AMLINT)
+LINTFLAGS = $(AMLINTFLAGS)
+@WANT_CHG_SCSI_CHIO_TRUE@CHIO_SCSI = chg-scsi-chio
 @WANT_CHG_SCSI_TRUE@CHG_SCSI = chg-scsi
-libexec_SCRIPTS = chg-manual   chg-multi       chg-mtx         \
-                       chg-rth         chg-chs         chg-chio        \
-                       chg-zd-mtx      chg-juke        chg-rait        \
-                       chg-null        chg-mcutil      chg-disk        \
-                       chg-iomega  chg-lib.sh
+CHECK_PERL = \
+               chg-chio \
+               chg-iomega \
+               chg-rth
 
-CLEANFILES = $(libexec_SCRIPTS)
+SCRIPTS_PERL = $(CHECK_PERL)
+SCRIPTS_SHELL = \
+               chg-manual \
+               chg-multi \
+               chg-mtx \
+               chg-chs \
+               chg-zd-mtx \
+               chg-juke \
+               chg-rait \
+               chg-null \
+               chg-mcutil \
+               chg-disk
+
+SCRIPTS_INCLUDE = \
+               chg-lib.sh
+
+amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+amlibexec_DATA = $(SCRIPTS_INCLUDE)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -415,27 +815,35 @@ CLEANFILES = $(libexec_SCRIPTS)
 # need to list libamanda twice here, first to override the system library
 # routines, and second to pick up any references in the other libraries.
 ###
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../server-src/libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../gnulib/libgnu.$(LIB_EXTENSION) \
+LDADD = ../common-src/libamanda.la \
+       ../tape-src/libamtape.la \
+       ../common-src/libamanda.la \
+       ../gnulib/libgnu.la \
        $(READLINE_LIBS)
 
-SUFFIXES = .pl .sh
-chg_scsi_CSRC = chg-scsi.c scsi-aix.c scsi-changer-driver.c            \
-               scsi-hpux_new.c scsi-irix.c scsi-linux.c scsi-solaris.c \
-               scsi-bsd.c scsi-cam.c sense.c 
-
+chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c \
+       $(am__append_1) $(am__append_2) $(am__append_3) \
+       $(am__append_4) $(am__append_5) $(am__append_6) \
+       $(am__append_7)
 chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
-chg_scsi_chio_CSRC = chg-scsi-chio.c scsi-hpux.c scsi-chio.c
+chg_scsi_chio_CSRC = chg-scsi-chio.c $(am__append_8) $(am__append_9)
 chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
-EXTRA_DIST = scsi-proto.c
-all: all-am
+INSTALLPERMS_exec = \
+       chown=amanda \
+       dest=$(sbindir) $(sbin_PROGRAMS) \
+       dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
+
+INSTALLPERMS_data = \
+       chown=amanda \
+       dest=$(sbindir) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
+
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .pl .sh .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -464,86 +872,58 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-chg-manual.sh: $(top_builddir)/config.status $(srcdir)/chg-manual.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-multi.sh: $(top_builddir)/config.status $(srcdir)/chg-multi.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-mtx.sh: $(top_builddir)/config.status $(srcdir)/chg-mtx.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-chs.sh: $(top_builddir)/config.status $(srcdir)/chg-chs.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-rth.pl: $(top_builddir)/config.status $(srcdir)/chg-rth.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-chio.pl: $(top_builddir)/config.status $(srcdir)/chg-chio.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-zd-mtx.sh: $(top_builddir)/config.status $(srcdir)/chg-zd-mtx.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-juke.sh: $(top_builddir)/config.status $(srcdir)/chg-juke.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-rait.sh: $(top_builddir)/config.status $(srcdir)/chg-rait.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-null.sh: $(top_builddir)/config.status $(srcdir)/chg-null.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-mcutil.sh: $(top_builddir)/config.status $(srcdir)/chg-mcutil.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-disk.sh: $(top_builddir)/config.status $(srcdir)/chg-disk.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-iomega.pl: $(top_builddir)/config.status $(srcdir)/chg-iomega.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-chg-lib.sh: $(top_builddir)/config.status $(srcdir)/chg-lib.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
+install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
             || test -f $$p1 \
          ; then \
            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \
          else :; fi; \
        done
 
-uninstall-libexecPROGRAMS:
+uninstall-amlibexecPROGRAMS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
-clean-libexecPROGRAMS:
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+clean-amlibexecPROGRAMS:
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          echo " rm -f $$p $$f"; \
          rm -f $$p $$f ; \
        done
 chg-scsi$(EXEEXT): $(chg_scsi_OBJECTS) $(chg_scsi_DEPENDENCIES) 
        @rm -f chg-scsi$(EXEEXT)
-       $(LINK) $(chg_scsi_LDFLAGS) $(chg_scsi_OBJECTS) $(chg_scsi_LDADD) $(LIBS)
+       $(LINK) $(chg_scsi_OBJECTS) $(chg_scsi_LDADD) $(LIBS)
 chg-scsi-chio$(EXEEXT): $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_DEPENDENCIES) 
        @rm -f chg-scsi-chio$(EXEEXT)
-       $(LINK) $(chg_scsi_chio_LDFLAGS) $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_LDADD) $(LIBS)
-install-libexecSCRIPTS: $(libexec_SCRIPTS)
+       $(LINK) $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_LDADD) $(LIBS)
+install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_SCRIPTS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
            f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-           echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-           $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \
+           echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+           $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libexecSCRIPTS:
+uninstall-amlibexecSCRIPTS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_SCRIPTS)'; for p in $$list; do \
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
 mostlyclean-compile:
@@ -567,22 +947,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sense.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -592,10 +972,23 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
+install-amlibexecDATA: $(amlibexec_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(amlibexecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         $(amlibexecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \
+       done
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+uninstall-amlibexecDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlibexec_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -646,22 +1039,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -672,14 +1064,20 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
 installdirs:
-       for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -694,26 +1092,32 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
+clean-am: clean-amlibexecPROGRAMS clean-generic clean-libtool \
        mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -726,15 +1130,26 @@ info: info-am
 info-am:
 
 install-data-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
-install-exec-am: install-libexecPROGRAMS install-libexecSCRIPTS
+install-exec-am: install-amlibexecDATA install-amlibexecPROGRAMS \
+       install-amlibexecSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -755,53 +1170,161 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS \
-       uninstall-libexecSCRIPTS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libexecPROGRAMS clean-libtool ctags distclean \
-       distclean-compile distclean-generic distclean-libtool \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-exec \
-       install-exec-am install-exec-hook install-info install-info-am \
-       install-libexecPROGRAMS install-libexecSCRIPTS install-man \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-       pdf pdf-am ps ps-am tags uninstall uninstall-am \
-       uninstall-info-am uninstall-libexecPROGRAMS \
-       uninstall-libexecSCRIPTS
-
-
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
-
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
-
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \
+       uninstall-amlibexecSCRIPTS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+       clean-amlibexecPROGRAMS clean-generic clean-libtool ctags \
+       dist-hook distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-amlibexecDATA \
+       install-amlibexecPROGRAMS install-amlibexecSCRIPTS \
+       install-data install-data-am install-data-hook install-dvi \
+       install-dvi-am install-exec install-exec-am install-exec-hook \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amlibexecDATA \
+       uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(EXTRA_PROGRAMS); do                    \
+       @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
                f="$$p.c $(libamandad_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
@@ -810,7 +1333,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
diff --git a/changer-src/chg-chio.pl b/changer-src/chg-chio.pl
new file mode 100644 (file)
index 0000000..56bb358
--- /dev/null
@@ -0,0 +1,488 @@
+#! @PERL@ -w
+
+# Catch for sh/csh on systems without #! ability.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+        & eval 'exec @PERL@ -S $0 $argv:q'
+                if 0;
+
+# 
+# This changer script controls tape libraries on operating systems that have a
+# chgio program
+#      DSL 7000 on FreeBSD is an example
+#
+# The changer being used is a n tape juke, that can be used with 1, n-1 or n
+# tapes in the juke. The special slot is slot n. The script does not
+# make assumptions about the number of slots, except that the special slot
+# is the highest number. The slot is special in the sense that it contains the
+# the only tape if the juke contains 1 tape and contains no tape if the juke
+# contains n-1 tapes. See getCurrentTape.
+#
+# Furthermore, the script uses drive 0 and assumes that the device is able to
+# figure itself how to move a type from slot m to drive 0 if asked to do so and
+# multiple pickers are present.
+#
+# The numbering of the slots is by the way from 1 to n with slots. The chio
+# program returns the slot numbers numbered from 0 to n-1 however.
+# 
+# This script is built up out of bits and pieces of the other scripts
+# and no credits are claimed. Most notably the chg-rth.pl script was used. That
+# script was written by Erik Frederick, <edf@tyrell.mc.duke.edu>.
+# 
+# Permission to freely use and distribute is granted (by me and was granted by
+# the original authors).
+#
+# Nick Hibma - nick.hibma@jrc.it
+#
+
+require 5.001;
+
+($progname = $0) =~ s#/.*/##;
+
+use English;
+use Getopt::Long;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$| = 1;
+
+if (-d "@AMANDA_DBGDIR@") {
+       $logfile = "@AMANDA_DBGDIR@/changer.debug";
+} else {
+       $logfile = "/dev/null";
+}
+die "$progname: cannot open $logfile: $ERRNO\n"
+       unless (open (LOG, ">> $logfile"));
+
+#
+# get the information from the configuration file
+#
+
+$prefix="@prefix@";
+$prefix=$prefix;               # avoid warnings about possible typo
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;     # Ditto
+$sbindir="@sbindir@";
+if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) {
+    $SUF = "-@VERSION@";
+} else {
+    $SUF = "";
+}
+
+chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`);
+die "tapedev not found in amanda.conf"
+       if !$tapeDevice or $tapeDevice eq "" or
+           $tapeDevice =~ m/no such parameter/;
+chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`);
+chomp $changerDevice;
+die "changerdev not found in amanda.conf"
+       if !$changerDevice or $changerDevice eq "" or
+           $changerDevice =~ m/no such parameter/;
+
+#
+# Initialise a few global variables
+#
+
+@slots = ();
+@drives = ();
+$max_slot = 0;
+$max_drive = 0;
+$nr_tapes = 0;
+
+@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
+@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
+       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
+
+sub do_time {
+       my (@t);
+       my ($r);
+
+       ###
+       # Get the local time for the value.
+       ###
+
+       @t = localtime (time ());
+
+       ###
+       # Return the result.
+       ###
+
+       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
+         $dow[$t[6]],
+         $moy[$t[4]],
+         $t[3],
+         $t[2], $t[1], $t[0],
+         1900 + $t[5];
+
+       return $r;
+}
+
+sub getCurrentTape {
+       print LOG &do_time(), ": enter: getCurrentTape\n";
+
+       #
+       # Determines the slot number for the tape that is currently in the
+       # drive. getTapeParams and getTapeStatus should have been called.
+       # If there is no tape in the drive, no current tape, 0 is returned.
+       #
+
+       my($slot, $i);
+
+       if ( !$drives[0] ) {            # drive empty
+               $i = 0;
+       } elsif ( $nr_tapes == 1 ) {    # one tape -> comes from slot max_slot
+               $i = $max_slot;
+       } else {                        # find first empty slot
+               $i = 0;
+               while ( $i < $#slots and $slots[$i] ) {
+                       $i++
+               }
+               $i++;
+       }
+
+       print LOG &do_time(), ": leave: getCurrentTape: $i\n";
+       return $i;
+}
+
+sub getTapeStatus {
+       print LOG &do_time(), ": enter: getTapeStatus\n";
+
+       #
+       # Sets $nr_tapes, @slots, @drives, $current_tape
+       #
+
+       my($type,$num,$status);
+
+       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice status\n";
+       if ( !(open(FH,"@CHIO@ -f $changerDevice status|")) ) {
+               print "$progname: '@CHIO@ -f $changerDevice status' failed, $!\n";
+               exit(2);
+       }
+
+       #
+       # This routine requires the format of the output of 'chio status' to 
+       # be as follows:
+       #   picker 0: 
+       #   slot 0: <ACCESS>
+       #   slot 1: <ACCESS,FULL>
+       #   slot 2: <ACCESS,FULL>
+       #   (etc.)
+       #   drive 0: <ACCESS,FULL>
+
+
+       @slots=();
+       @drives=();
+
+       while( defined ($line = <FH>) ) {
+               chomp( $line );
+               print LOG &do_time(), ": $line\n";
+               next unless $line =~ m/(\w+)\s+(\d+):\s*<([^>]+)>/;
+               ($type,$num,$status) = ($1,$2,$3);
+               if ( $type =~ m/slot/i ) {
+                       $slots[$num] = ( $status =~ m/full/i ) ? 1 : 0;
+                       if ($slots[ $num ]) { $nr_tapes++ }
+               } elsif ( $type =~ m/drive/i ) {
+                       $drives[$num] = 0;
+                       if (  $status =~ m/full/i ) {
+                               $drives[$num] = 1;
+                               $nr_tapes++;
+                       }
+               } else {
+                       # ignore 'picker', empty ones, etc...
+               }
+       }
+       close(FH);
+
+       if ( $nr_tapes == 0 ) {
+               print "$progname: No tapes in changer!\n";
+               exit(2);
+       }
+
+       $currentTape = &getCurrentTape(); 
+
+       print LOG &do_time(), ": leave: getTapeStatus: $nr_tapes\n";
+       return($nr_tapes);
+}
+
+sub getTapeParams {
+       print LOG &do_time(), ": enter: getTapeParams\n";
+  
+       #
+       # Requests information on the number of slots, pickers and drives
+       # from the changer.
+       #
+
+       my($max_slot,$max_drive,$max_picker);
+  
+       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice params\n";
+       if ( !open(FH,"@CHIO@ -f $changerDevice params|") ) {
+               print "$progname: '@CHIO@ -f $changerDevice params' failed, $!\n";
+               exit(2);
+       }
+  
+       #
+       # the format of the output of 'chio params' should be
+       #  /dev/ch0: 8 slots, 1 drive, 1 picker
+       #  /dev/ch0: current picker: 0
+       #
+
+       $max_slot = 0;
+       $max_picker = -1;
+       $max_drive = 0;
+
+       while( defined ($line = <FH>) ) {
+               chomp $line;
+               print LOG &do_time(), ": $line\n";
+               $max_slot       = $1 if $line =~ m/(\d+) slot/i;
+               $max_drive      = $1 if $line =~ m/(\d+) drive/i;
+               $max_picker     = $1 if $line =~ m/(\d+) picker/i;
+
+       }
+       close(FH);
+       if ( $max_drive == 0 or $max_picker == -1 ) {
+               print "$progname: No drive or picker ? ($max_drive/$max_picker)\n";
+               exit(2);
+       }
+
+       print LOG &do_time(), ": leave: getTapeParams: $max_slot, $max_drive, $max_picker\n";
+       return ($max_slot, $max_drive, $max_picker);
+}
+
+sub testTape {
+       my($tape) = @_;
+
+       #
+       # Check a few parameters to avoid the most serious problems
+       #
+
+       return
+               if $currentTape == $tape;
+
+       if( $slots[$tape-1] == 0 ) {
+               print "<none> $progname: no tape in slot requested\n";
+               exit(1);
+       }
+       if( $tape > $max_slot ) {
+               print $tape," $progname: requested a tape > $max_slot\n";
+               exit(2);
+       }
+       if( $tape < 1 ) {
+               print $tape," $progname: requested a tape < 1\n";
+               exit(2);
+       }
+       return;
+}
+
+sub Load {
+       my($tape) = @_;
+       print LOG &do_time(), ": enter: Load: $tape\n";
+
+       #
+       # Load tape $tape into drive 0
+       #
+
+       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice move slot ", $tape - 1, " drive 0\n";
+       if ( system("@CHIO@ -f $changerDevice move slot ".($tape-1)." drive 0") ) {
+               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n";
+               exit(2);
+       }
+
+       # wait for tape to load
+       $count = 1800;
+       while ( $count > 0 &&
+               system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) {
+               print LOG &do_time(), ": waiting for tape to load\n";
+               sleep 30;
+               $count -= 30;
+       }
+
+       print LOG &do_time(), ": leave: Load\n";
+}
+
+sub Unload {
+       my($tape) = @_;
+       print LOG &do_time(), ": enter: Unload: $tape\n";
+
+       #
+       # Unload the tape from drive 0 and put it into the slot specified by
+       # $tape.
+       #
+
+       #
+       # Ecrix AutoPAK devices (based on the Spectra Logics 215 changer)
+       # can lock up if you try to move a tape from a drive to an open slot
+       # without first rewinding and ejecting the tape.  This appears to
+       # occur when the operation times out and the ch driver sends a device
+       # or bus reset. Ecrix claims this is about to be fixed with a new
+       # firmware rev but for now it's safest to just explicitly eject
+       # the tape before moving the cartridge.
+       #
+       if ( system ("$MT $MTF $tapeDevice offline") ) {
+               print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n";
+               # NB: not fatal; let chio try it's thing
+       }
+
+       if ( system("@CHIO@ -f $changerDevice move drive 0 slot ".($tape-1)." ") ) {
+               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape from drive 0\n";
+               exit(2);
+       }
+       print LOG &do_time(), ": leave: Unload\n";
+}
+
+sub changeTape {
+       my($tape) = @_;
+       print LOG &do_time(), ": enter: changeTape: $tape\n";
+
+       #
+       # Unload current tape and load a new tape from slot $tape.
+       #
+
+       if ($tape != $currentTape) {
+
+               &testTape($tape);
+
+               if( $currentTape != 0 ) {
+                       &Unload($currentTape);
+               }
+               &Load($tape);
+               $currentTape = $tape;
+       }
+       print LOG &do_time(), ": leave: changeTape\n";
+}
+
+
+#
+# Main program
+#
+
+#
+# Initialise
+#
+
+($max_slot, $max_drive) = &getTapeParams();
+
+$opt_slot = 0;                                 # perl -w fodder
+$opt_info = 0;                                 # perl -w fodder
+$opt_reset = 0;                                        # perl -w fodder
+$opt_eject = 0;                                        # perl -w fodder
+
+GetOptions("slot=s", "info", "reset", "eject"); 
+
+$nr_tapes = &getTapeStatus();
+
+#
+# Before we do anything with the tape changer we'll have to rewind the tape
+#
+
+if (-x "$sbindir/ammt$SUF") {
+       $MT="$sbindir/ammt$SUF";
+       $MTF="-f";
+} elsif (-x "@MT@") {
+       $MT="@MT@";
+       $MTF="@MT_FILE_FLAG@";
+} else {
+       print LOG &do_time(), ": mt program not found\n";
+       print "<none> mt program not found\n";
+       exit(1);
+}
+print LOG &do_time(), ": MT -> $MT $MTF\n";
+
+system ("$MT $MTF $tapeDevice rewind")
+       unless $currentTape == 0;
+
+
+if ( $opt_slot ) {
+       if ( $opt_slot =~ /first/ ) {
+               &changeTape(1);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /last/ ) {
+               &changeTape($max_slot);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /current/ ) {
+               &changeTape($currentTape);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /next/ ) {
+               $tape = $currentTape+1;
+               if ( $tape > $max_slot ) {
+                       $tape = 1;
+               }
+               while ( $slots[$tape-1] == 0 ) {        # there is at least 1 
+                       if ( ++$tape > $max_slot ) {
+                               $tape = 1;
+                       }
+               }
+               &changeTape($tape);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /prev/ ) {
+               $tape = $currentTape-1;
+               if ( $tape < 1 ) {
+                       $tape = $max_slot;
+               }
+               while ( $slots[$tape-1] == 0 ) {        # there is at least 1
+                       if ( --$tape < 1 ) {
+                               $tape = $max_slot;
+                       }
+               }
+               &changeTape($tape);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /^\d+$/ ) {
+               &changeTape($opt_slot);
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape $tapeDevice\n";
+       }
+       if ( $opt_slot =~ /advance/ ) {
+               $tape=$currentTape+1;
+               if ( $tape > $max_slot ) {
+                       $tape = 1;
+               }
+               if ( $currentTape ) { 
+                       &Unload($currentTape);
+               }
+               print LOG &do_time(), ": $currentTape $tapeDevice\n";
+               print "$currentTape , /dev/null\n";
+       }
+
+       exit 0;
+}
+
+if ( $opt_info ) {
+       if ( $currentTape == 0 ) {
+               &Load(1);                       # load random tape
+               $currentTape = 1;
+       }
+
+       print LOG &do_time(), ": $currentTape $max_slot 1\n";
+       print "$currentTape $max_slot 1\n";
+       exit 0;
+}
+
+if ( $opt_reset ) {
+       &changeTape(1);
+       print LOG &do_time(), ": $currentTape $tapeDevice\n";
+       print "$currentTape $tapeDevice\n";
+       exit 0;
+}
+
+if ( $opt_eject ) {
+       if ( $currentTape ) { 
+               &Unload($currentTape);
+               print "0 $tapeDevice\n";
+               exit 0;
+       } else {
+               print "$progname: drive was not loaded\n";
+               exit 1;
+       }
+}
+
+print "$progname: No command was received.  Exiting.\n";
+exit 1;
diff --git a/changer-src/chg-chio.pl.in b/changer-src/chg-chio.pl.in
deleted file mode 100644 (file)
index 56bb358..0000000
+++ /dev/null
@@ -1,488 +0,0 @@
-#! @PERL@ -w
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-        & eval 'exec @PERL@ -S $0 $argv:q'
-                if 0;
-
-# 
-# This changer script controls tape libraries on operating systems that have a
-# chgio program
-#      DSL 7000 on FreeBSD is an example
-#
-# The changer being used is a n tape juke, that can be used with 1, n-1 or n
-# tapes in the juke. The special slot is slot n. The script does not
-# make assumptions about the number of slots, except that the special slot
-# is the highest number. The slot is special in the sense that it contains the
-# the only tape if the juke contains 1 tape and contains no tape if the juke
-# contains n-1 tapes. See getCurrentTape.
-#
-# Furthermore, the script uses drive 0 and assumes that the device is able to
-# figure itself how to move a type from slot m to drive 0 if asked to do so and
-# multiple pickers are present.
-#
-# The numbering of the slots is by the way from 1 to n with slots. The chio
-# program returns the slot numbers numbered from 0 to n-1 however.
-# 
-# This script is built up out of bits and pieces of the other scripts
-# and no credits are claimed. Most notably the chg-rth.pl script was used. That
-# script was written by Erik Frederick, <edf@tyrell.mc.duke.edu>.
-# 
-# Permission to freely use and distribute is granted (by me and was granted by
-# the original authors).
-#
-# Nick Hibma - nick.hibma@jrc.it
-#
-
-require 5.001;
-
-($progname = $0) =~ s#/.*/##;
-
-use English;
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$| = 1;
-
-if (-d "@AMANDA_DBGDIR@") {
-       $logfile = "@AMANDA_DBGDIR@/changer.debug";
-} else {
-       $logfile = "/dev/null";
-}
-die "$progname: cannot open $logfile: $ERRNO\n"
-       unless (open (LOG, ">> $logfile"));
-
-#
-# get the information from the configuration file
-#
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # Ditto
-$sbindir="@sbindir@";
-if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) {
-    $SUF = "-@VERSION@";
-} else {
-    $SUF = "";
-}
-
-chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`);
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`);
-chomp $changerDevice;
-die "changerdev not found in amanda.conf"
-       if !$changerDevice or $changerDevice eq "" or
-           $changerDevice =~ m/no such parameter/;
-
-#
-# Initialise a few global variables
-#
-
-@slots = ();
-@drives = ();
-$max_slot = 0;
-$max_drive = 0;
-$nr_tapes = 0;
-
-@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
-@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
-       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
-
-sub do_time {
-       my (@t);
-       my ($r);
-
-       ###
-       # Get the local time for the value.
-       ###
-
-       @t = localtime (time ());
-
-       ###
-       # Return the result.
-       ###
-
-       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
-         $dow[$t[6]],
-         $moy[$t[4]],
-         $t[3],
-         $t[2], $t[1], $t[0],
-         1900 + $t[5];
-
-       return $r;
-}
-
-sub getCurrentTape {
-       print LOG &do_time(), ": enter: getCurrentTape\n";
-
-       #
-       # Determines the slot number for the tape that is currently in the
-       # drive. getTapeParams and getTapeStatus should have been called.
-       # If there is no tape in the drive, no current tape, 0 is returned.
-       #
-
-       my($slot, $i);
-
-       if ( !$drives[0] ) {            # drive empty
-               $i = 0;
-       } elsif ( $nr_tapes == 1 ) {    # one tape -> comes from slot max_slot
-               $i = $max_slot;
-       } else {                        # find first empty slot
-               $i = 0;
-               while ( $i < $#slots and $slots[$i] ) {
-                       $i++
-               }
-               $i++;
-       }
-
-       print LOG &do_time(), ": leave: getCurrentTape: $i\n";
-       return $i;
-}
-
-sub getTapeStatus {
-       print LOG &do_time(), ": enter: getTapeStatus\n";
-
-       #
-       # Sets $nr_tapes, @slots, @drives, $current_tape
-       #
-
-       my($type,$num,$status);
-
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice status\n";
-       if ( !(open(FH,"@CHIO@ -f $changerDevice status|")) ) {
-               print "$progname: '@CHIO@ -f $changerDevice status' failed, $!\n";
-               exit(2);
-       }
-
-       #
-       # This routine requires the format of the output of 'chio status' to 
-       # be as follows:
-       #   picker 0: 
-       #   slot 0: <ACCESS>
-       #   slot 1: <ACCESS,FULL>
-       #   slot 2: <ACCESS,FULL>
-       #   (etc.)
-       #   drive 0: <ACCESS,FULL>
-
-
-       @slots=();
-       @drives=();
-
-       while( defined ($line = <FH>) ) {
-               chomp( $line );
-               print LOG &do_time(), ": $line\n";
-               next unless $line =~ m/(\w+)\s+(\d+):\s*<([^>]+)>/;
-               ($type,$num,$status) = ($1,$2,$3);
-               if ( $type =~ m/slot/i ) {
-                       $slots[$num] = ( $status =~ m/full/i ) ? 1 : 0;
-                       if ($slots[ $num ]) { $nr_tapes++ }
-               } elsif ( $type =~ m/drive/i ) {
-                       $drives[$num] = 0;
-                       if (  $status =~ m/full/i ) {
-                               $drives[$num] = 1;
-                               $nr_tapes++;
-                       }
-               } else {
-                       # ignore 'picker', empty ones, etc...
-               }
-       }
-       close(FH);
-
-       if ( $nr_tapes == 0 ) {
-               print "$progname: No tapes in changer!\n";
-               exit(2);
-       }
-
-       $currentTape = &getCurrentTape(); 
-
-       print LOG &do_time(), ": leave: getTapeStatus: $nr_tapes\n";
-       return($nr_tapes);
-}
-
-sub getTapeParams {
-       print LOG &do_time(), ": enter: getTapeParams\n";
-  
-       #
-       # Requests information on the number of slots, pickers and drives
-       # from the changer.
-       #
-
-       my($max_slot,$max_drive,$max_picker);
-  
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice params\n";
-       if ( !open(FH,"@CHIO@ -f $changerDevice params|") ) {
-               print "$progname: '@CHIO@ -f $changerDevice params' failed, $!\n";
-               exit(2);
-       }
-  
-       #
-       # the format of the output of 'chio params' should be
-       #  /dev/ch0: 8 slots, 1 drive, 1 picker
-       #  /dev/ch0: current picker: 0
-       #
-
-       $max_slot = 0;
-       $max_picker = -1;
-       $max_drive = 0;
-
-       while( defined ($line = <FH>) ) {
-               chomp $line;
-               print LOG &do_time(), ": $line\n";
-               $max_slot       = $1 if $line =~ m/(\d+) slot/i;
-               $max_drive      = $1 if $line =~ m/(\d+) drive/i;
-               $max_picker     = $1 if $line =~ m/(\d+) picker/i;
-
-       }
-       close(FH);
-       if ( $max_drive == 0 or $max_picker == -1 ) {
-               print "$progname: No drive or picker ? ($max_drive/$max_picker)\n";
-               exit(2);
-       }
-
-       print LOG &do_time(), ": leave: getTapeParams: $max_slot, $max_drive, $max_picker\n";
-       return ($max_slot, $max_drive, $max_picker);
-}
-
-sub testTape {
-       my($tape) = @_;
-
-       #
-       # Check a few parameters to avoid the most serious problems
-       #
-
-       return
-               if $currentTape == $tape;
-
-       if( $slots[$tape-1] == 0 ) {
-               print "<none> $progname: no tape in slot requested\n";
-               exit(1);
-       }
-       if( $tape > $max_slot ) {
-               print $tape," $progname: requested a tape > $max_slot\n";
-               exit(2);
-       }
-       if( $tape < 1 ) {
-               print $tape," $progname: requested a tape < 1\n";
-               exit(2);
-       }
-       return;
-}
-
-sub Load {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: Load: $tape\n";
-
-       #
-       # Load tape $tape into drive 0
-       #
-
-       print LOG &do_time(), ": running: @CHIO@ -f $changerDevice move slot ", $tape - 1, " drive 0\n";
-       if ( system("@CHIO@ -f $changerDevice move slot ".($tape-1)." drive 0") ) {
-               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n";
-               exit(2);
-       }
-
-       # wait for tape to load
-       $count = 1800;
-       while ( $count > 0 &&
-               system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) {
-               print LOG &do_time(), ": waiting for tape to load\n";
-               sleep 30;
-               $count -= 30;
-       }
-
-       print LOG &do_time(), ": leave: Load\n";
-}
-
-sub Unload {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: Unload: $tape\n";
-
-       #
-       # Unload the tape from drive 0 and put it into the slot specified by
-       # $tape.
-       #
-
-       #
-       # Ecrix AutoPAK devices (based on the Spectra Logics 215 changer)
-       # can lock up if you try to move a tape from a drive to an open slot
-       # without first rewinding and ejecting the tape.  This appears to
-       # occur when the operation times out and the ch driver sends a device
-       # or bus reset. Ecrix claims this is about to be fixed with a new
-       # firmware rev but for now it's safest to just explicitly eject
-       # the tape before moving the cartridge.
-       #
-       if ( system ("$MT $MTF $tapeDevice offline") ) {
-               print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n";
-               # NB: not fatal; let chio try it's thing
-       }
-
-       if ( system("@CHIO@ -f $changerDevice move drive 0 slot ".($tape-1)." ") ) {
-               print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape from drive 0\n";
-               exit(2);
-       }
-       print LOG &do_time(), ": leave: Unload\n";
-}
-
-sub changeTape {
-       my($tape) = @_;
-       print LOG &do_time(), ": enter: changeTape: $tape\n";
-
-       #
-       # Unload current tape and load a new tape from slot $tape.
-       #
-
-       if ($tape != $currentTape) {
-
-               &testTape($tape);
-
-               if( $currentTape != 0 ) {
-                       &Unload($currentTape);
-               }
-               &Load($tape);
-               $currentTape = $tape;
-       }
-       print LOG &do_time(), ": leave: changeTape\n";
-}
-
-
-#
-# Main program
-#
-
-#
-# Initialise
-#
-
-($max_slot, $max_drive) = &getTapeParams();
-
-$opt_slot = 0;                                 # perl -w fodder
-$opt_info = 0;                                 # perl -w fodder
-$opt_reset = 0;                                        # perl -w fodder
-$opt_eject = 0;                                        # perl -w fodder
-
-GetOptions("slot=s", "info", "reset", "eject"); 
-
-$nr_tapes = &getTapeStatus();
-
-#
-# Before we do anything with the tape changer we'll have to rewind the tape
-#
-
-if (-x "$sbindir/ammt$SUF") {
-       $MT="$sbindir/ammt$SUF";
-       $MTF="-f";
-} elsif (-x "@MT@") {
-       $MT="@MT@";
-       $MTF="@MT_FILE_FLAG@";
-} else {
-       print LOG &do_time(), ": mt program not found\n";
-       print "<none> mt program not found\n";
-       exit(1);
-}
-print LOG &do_time(), ": MT -> $MT $MTF\n";
-
-system ("$MT $MTF $tapeDevice rewind")
-       unless $currentTape == 0;
-
-
-if ( $opt_slot ) {
-       if ( $opt_slot =~ /first/ ) {
-               &changeTape(1);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /last/ ) {
-               &changeTape($max_slot);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /current/ ) {
-               &changeTape($currentTape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /next/ ) {
-               $tape = $currentTape+1;
-               if ( $tape > $max_slot ) {
-                       $tape = 1;
-               }
-               while ( $slots[$tape-1] == 0 ) {        # there is at least 1 
-                       if ( ++$tape > $max_slot ) {
-                               $tape = 1;
-                       }
-               }
-               &changeTape($tape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /prev/ ) {
-               $tape = $currentTape-1;
-               if ( $tape < 1 ) {
-                       $tape = $max_slot;
-               }
-               while ( $slots[$tape-1] == 0 ) {        # there is at least 1
-                       if ( --$tape < 1 ) {
-                               $tape = $max_slot;
-                       }
-               }
-               &changeTape($tape);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /^\d+$/ ) {
-               &changeTape($opt_slot);
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape $tapeDevice\n";
-       }
-       if ( $opt_slot =~ /advance/ ) {
-               $tape=$currentTape+1;
-               if ( $tape > $max_slot ) {
-                       $tape = 1;
-               }
-               if ( $currentTape ) { 
-                       &Unload($currentTape);
-               }
-               print LOG &do_time(), ": $currentTape $tapeDevice\n";
-               print "$currentTape , /dev/null\n";
-       }
-
-       exit 0;
-}
-
-if ( $opt_info ) {
-       if ( $currentTape == 0 ) {
-               &Load(1);                       # load random tape
-               $currentTape = 1;
-       }
-
-       print LOG &do_time(), ": $currentTape $max_slot 1\n";
-       print "$currentTape $max_slot 1\n";
-       exit 0;
-}
-
-if ( $opt_reset ) {
-       &changeTape(1);
-       print LOG &do_time(), ": $currentTape $tapeDevice\n";
-       print "$currentTape $tapeDevice\n";
-       exit 0;
-}
-
-if ( $opt_eject ) {
-       if ( $currentTape ) { 
-               &Unload($currentTape);
-               print "0 $tapeDevice\n";
-               exit 0;
-       } else {
-               print "$progname: drive was not loaded\n";
-               exit 1;
-       }
-}
-
-print "$progname: No command was received.  Exiting.\n";
-exit 1;
diff --git a/changer-src/chg-chs.sh b/changer-src/chg-chs.sh
new file mode 100644 (file)
index 0000000..8679711
--- /dev/null
@@ -0,0 +1,393 @@
+#!@SHELL@
+#
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1991-1998 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: James da Silva, Systems Design and Analysis Group
+#                         Computer Science Department
+#                         University of Maryland at College Park
+#
+
+#
+# chg-chs.sh - chs tape changer script
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+pname="chg-chs"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       logfile=@AMANDA_DBGDIR@/changer.debug
+else
+       logfile=/dev/null
+fi
+
+CHS=@CHS@
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+ourconf=`amgetconf$SUF changerfile`
+changerdev=`amgetconf$SUF changerdev`
+if test -n "$changerdev" && test x"$changerdev" != x/dev/null; then
+       CHS="$CHS -f$changerdev"
+fi
+
+# read in some config parameters
+
+if [ \! -f $ourconf ]; then
+       answer=`_ '<none> %s: %s does not exist' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
+if [ "$firstslot" = "" ]; then
+       answer=`_ '<none> %s: firstslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
+if [ "$lastslot" = "" ]; then
+       answer=`_ '<none> %s: lastslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+nslots=`expr $lastslot - $firstslot + 1`
+
+gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
+if [ "$gravity" = "" ]; then
+       answer=`_ '<none> %s: gravity not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
+if [ "$needeject" = "" ]; then
+       answer=`_ '<none> %s: needeject not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
+if [ "$multieject" = "" ]; then
+       echo `_ 'Note -> multieject not specified in %s' "$ourconf"` >> $logfile
+       multieject=0
+fi
+
+ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
+if [ "$ejectdelay" = "" ]; then
+       echo `_ 'Note -> ejectdelay not specified in %s' "$ourconf"` >> $logfile
+       ejectdelay=0
+fi
+
+ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
+if [ "$ourstate" = "" ]; then
+       answer=`_ '<none> %s: statefile not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+# read in state: only curslot and curloaded at the present time
+
+curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null`
+if [ "$curslot" = "" ]; then
+       curslot=$firstslot
+fi
+
+curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null`
+if [ "$curloaded" = "" ]; then
+       curloaded=0
+fi
+
+
+# process the command-line
+
+# control vars to avoid code duplication: not all shells have functions!
+usage=0
+checkgravity=0
+ejectslot=0
+loadslot=0
+slotempty=0
+
+if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi
+
+case "$command" in
+
+-info) # return basic information about changer
+
+       backwards=`expr 1 - $gravity`
+       answer="$curslot $nslots $backwards"
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+       ;;
+
+-reset) # reset changer
+
+       checkgravity=0
+       loadslot=1
+       newslot=$firstslot
+
+       # XXX put changer-specific reset here, if applicable
+       ;;
+
+-eject) # eject tape if loaded
+
+       checkgravity=0
+       loadslot=0
+       newslot=$curslot
+       ejectslot=1
+
+       if [ $curloaded -eq 0 ]; then
+               answer=`_ '%s %s: slot already empty' "$curslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+       fi
+       ;;
+
+-slot) # change to slot
+
+       checkgravity=1
+       loadslot=1
+
+       slotparm=$2
+       case "$slotparm" in
+       [0-9]*) 
+               newslot=$slotparm
+               if [ \( $newslot -gt $lastslot \) -o \
+                    \( $newslot -lt $firstslot \) ]; then
+                       answer =`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 1
+               fi
+               ;;
+       current)
+               newslot=$curslot
+               ;;
+       first)
+               newslot=$firstslot
+               ;;
+       last)
+               newslot=$lastslot
+               ;;
+       next|advance)
+               newslot=`expr $curslot + 1`
+               if [ $newslot -gt $lastslot ]; then
+                       newslot=$firstslot
+               fi
+               if [ $slotparm = advance ]; then
+                       loadslot=0
+               fi
+               ;;
+       prev)
+               newslot=`expr $curslot - 1`
+               if [ $newslot -lt $firstslot ]; then
+                       newslot=$lastslot
+               fi
+               ;;
+       *)
+               answer=`_ '<none> %s: bad slot name "%s"' "$pname" "$slotparm"`
+               echo `_ 'Exit ->'` "$answer" >> $logfile
+               echo $answer
+               exit 1
+               ;;
+       esac
+       ;;
+*)
+       usage=1
+       ;;
+esac
+
+
+if [ $usage -eq 1 ]; then
+       answer=`_ '<none> usage: %s {-reset | -slot [<slot-number>|current|next|prev|advance]}' "$pname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+
+# check for legal move
+
+if [ \( $checkgravity -eq 1 \) -a \( $gravity -ne 0 \) ]; then
+       if [ \( $newslot -lt $curslot \) -o \( "$slotparm" = "prev" \) ]
+       then
+               answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+       fi
+fi
+
+# get tape device name
+
+device=`awk '$1 == "slot" && $2 == '$newslot' {print $3}' $ourconf 2>/dev/null`
+if [ "$device" = "" ]; then
+       answer=`_ '%s %s: slot %s device not specified in %s' "$newslot" "$pname" "$newslot" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+# check if load needs an eject first
+
+if [ \( $needeject -eq 1 \) -a \( $loadslot -eq 1 \) -a \
+     \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) ]; then
+       ejectslot=1
+fi
+
+
+if [ $ejectslot -eq 1 ]; then  # eject the tape from the drive
+
+       # XXX put changer-specific load command here, if applicable
+
+       curloaded=0             # unless something goes wrong
+       slotempty=0
+
+       # generically, first check that the device is there
+
+       if [ ! -c $device ]; then
+               answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       fi
+
+       # if multiple eject is required, do it now
+       if [ $multieject -eq 1 ]; then
+               loopslot=$curslot
+               while [ $loopslot -lt $newslot ]; do
+                        try_eject_device $device
+                       if [ $? -ne 0 ]; then
+                               answer=`_ '%s %s: %s: unable to change slot %s' "$newslot" "$pname" "$device" "$loopslot"`
+                               echo `_ 'Exit ->'` $answer >> $logfile
+                               echo $answer
+                               exit 2
+                       fi
+                       loopslot=`/usr/bin/expr $loopslot + 1`
+               done
+       fi
+  
+       # second, try to unload the device
+        try_eject_device $device
+       $CHS deselect -d1 -s$curslot >/dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               #
+               # XXX if the changer-specific eject command can distinguish
+               # betweeen "slot empty" and more serious errors, return 1
+               # for the first case, 2 for the second case.  Generically,
+               # we just presume an error signifies an empty slot.
+               #
+               #slotempty=1
+               answer=`_ '<none> %s: tape unload to slot %s failed' "$pname" "$curslot"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       else
+               sleep $ejectdelay
+       fi
+fi
+
+if [ \( $loadslot -eq 1 \) -a \( \( $curloaded -ne 1 \) -o \( \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) \) \) ]; then      # load the tape from the slot
+
+       # XXX put changer-specific load command here, if applicable
+
+       curloaded=1             # unless something goes wrong
+       slotempty=0
+
+       # generically, first check that the device is there
+
+       if [ ! -c $device ]; then
+               answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       fi
+
+       $CHS select -s$newslot -d1 >/dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               answer=`_ '<none> %s: tape load from slot %s failed' "$pname" "$newslot"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       fi
+       sleep 60
+
+       # second, try to rewind the device
+        amdevcheck_status $device
+       if [ $? -ne 0 ]; then
+               #
+               # XXX if the changer-specific load command can distinguish
+               # betweeen "slot empty" and more serious errors, return 1
+               # for the first case, 2 for the second case.  Generically,
+               # we just presume an error signifies an empty slot.
+               #
+               slotempty=1
+               curloaded=0
+       fi
+fi
+
+# update state
+
+echo "# $pname state cache: DO NOT EDIT!"      >  $ourstate
+echo curslot $newslot                          >> $ourstate
+echo curloaded $curloaded                      >> $ourstate
+
+# return slot info
+
+if [ $slotempty -eq 1 ]; then
+       answer=`_ '<none> %s: %s slot is empty' "$pname" "$newslot"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
+fi
+
+if [ "$command" = -slot -a "$slotparm" = advance ]; then
+       device=/dev/null
+fi
+
+answer="$newslot $device"
+echo `_ 'Exit ->'` $answer >> $logfile
+echo $answer
+exit 0
diff --git a/changer-src/chg-chs.sh.in b/changer-src/chg-chs.sh.in
deleted file mode 100644 (file)
index 5980436..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-#!@SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# chg-chs.sh - chs tape changer script
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-pname="chg-chs"
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-CHS=@CHS@
-
-if [ -x $sbindir/ammt$SUF ]; then
-       MT=$sbindir/ammt$SUF
-       MTF=-f
-elif [ -x "@MT@" ]; then
-       MT=@MT@
-       MTF=@MT_FILE_FLAG@
-else
-       answer="<none> $myname: mt program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-echo MT "->" $MT $MTF >> $logfile
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-ourconf=`amgetconf$SUF changerfile`
-changerdev=`amgetconf$SUF changerdev`
-if test -n "$changerdev" && test x"$changerdev" != x/dev/null; then
-       CHS="$CHS -f$changerdev"
-fi
-
-# read in some config parameters
-
-if [ \! -f $ourconf ]; then
-       answer="<none> $pname: $ourconf does not exist"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
-if [ "$firstslot" = "" ]; then
-       answer="<none> $pname: firstslot not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
-if [ "$lastslot" = "" ]; then
-       answer="<none> $pname: lastslot not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-nslots=`expr $lastslot - $firstslot + 1`
-
-gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
-if [ "$gravity" = "" ]; then
-       answer="<none> $pname: gravity not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
-if [ "$needeject" = "" ]; then
-       answer="<none> $pname: needeject not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
-if [ "$multieject" = "" ]; then
-       echo "Note -> multieject not specified in $ourconf" >> $logfile
-       multieject=0
-fi
-
-ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
-if [ "$ejectdelay" = "" ]; then
-       echo "Note -> ejectdelay not specified in $ourconf" >> $logfile
-       ejectdelay=0
-fi
-
-ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
-if [ "$ourstate" = "" ]; then
-       answer="<none> $pname: statefile not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-# read in state: only curslot and curloaded at the present time
-
-curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null`
-if [ "$curslot" = "" ]; then
-       curslot=$firstslot
-fi
-
-curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null`
-if [ "$curloaded" = "" ]; then
-       curloaded=0
-fi
-
-
-# process the command-line
-
-# control vars to avoid code duplication: not all shells have functions!
-usage=0
-checkgravity=0
-ejectslot=0
-loadslot=0
-slotempty=0
-
-if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi
-
-case "$command" in
-
--info) # return basic information about changer
-
-       backwards=`expr 1 - $gravity`
-       answer="$curslot $nslots $backwards"
-       code=0
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-       ;;
-
--reset) # reset changer
-
-       checkgravity=0
-       loadslot=1
-       newslot=$firstslot
-
-       # XXX put changer-specific reset here, if applicable
-       ;;
-
--eject) # eject tape if loaded
-
-       checkgravity=0
-       loadslot=0
-       newslot=$curslot
-       ejectslot=1
-
-       if [ $curloaded -eq 0 ]; then
-               answer="$curslot $pname: slot already empty"
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       fi
-       ;;
-
--slot) # change to slot
-
-       checkgravity=1
-       loadslot=1
-
-       slotparm=$2
-       case "$slotparm" in
-       [0-9]*) 
-               newslot=$slotparm
-               if [ \( $newslot -gt $lastslot \) -o \
-                    \( $newslot -lt $firstslot \) ]; then
-                       answer="$newslot $pname: no slot $newslot: legal range is $firstslot ... $lastslot"
-                       code=1
-                       echo "Exit -> $answer" >> $logfile
-                       echo "$answer"
-                       exit $code
-               fi
-               ;;
-       current)
-               newslot=$curslot
-               ;;
-       first)
-               newslot=$firstslot
-               ;;
-       last)
-               newslot=$lastslot
-               ;;
-       next|advance)
-               newslot=`expr $curslot + 1`
-               if [ $newslot -gt $lastslot ]; then
-                       newslot=$firstslot
-               fi
-               if [ $slotparm = advance ]; then
-                       loadslot=0
-               fi
-               ;;
-       prev)
-               newslot=`expr $curslot - 1`
-               if [ $newslot -lt $firstslot ]; then
-                       newslot=$lastslot
-               fi
-               ;;
-       *)
-               answer="<none> $pname: bad slot name \"$slotparm\""
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-               ;;
-       esac
-       ;;
-*)
-       usage=1
-       ;;
-esac
-
-
-if [ $usage -eq 1 ]; then
-       answer="<none> usage: $pname {-reset | -slot [<slot-number>|current|next|prev|advance]}"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-
-# check for legal move
-
-if [ \( $checkgravity -eq 1 \) -a \( $gravity -ne 0 \) ]; then
-       if [ \( $newslot -lt $curslot \) -o \( "$slotparm" = "prev" \) ]
-       then
-               answer="$newslot $pname: cannot go backwards in gravity stacker"
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       fi
-fi
-
-# get tape device name
-
-device=`awk '$1 == "slot" && $2 == '$newslot' {print $3}' $ourconf 2>/dev/null`
-if [ "$device" = "" ]; then
-       answer="$newslot $pname: slot $newslot device not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-# check if load needs an eject first
-
-if [ \( $needeject -eq 1 \) -a \( $loadslot -eq 1 \) -a \
-     \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) ]; then
-       ejectslot=1
-fi
-
-
-if [ $ejectslot -eq 1 ]; then  # eject the tape from the drive
-
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=0             # unless something goes wrong
-       slotempty=0
-
-       # generically, first check that the device is there
-
-       if [ ! -c $device ]; then
-               answer="$newslot $pname: $device: not a device file"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       fi
-
-       # if multiple eject is required, do it now
-       if [ $multieject -eq 1 ]; then
-               loopslot=$curslot
-               while [ $loopslot -lt $newslot ]; do
-                       $MT $MTF $device offline >/dev/null 2>&1
-                       if [ $? -ne 0 ]; then
-                               answer="$newslot $pname: $device: unable to change slot $loopslot"
-                               code=2
-                               echo "Exit -> $answer" >> $logfile
-                               echo "$answer"
-                               exit $code
-                       fi
-                       loopslot=`/usr/bin/expr $loopslot + 1`
-               done
-       fi
-  
-       # second, try to unload the device
-       $MT $MTF $device offline >/dev/null 2>&1
-       $CHS deselect -d1 -s$curslot >/dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific eject command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               #slotempty=1
-               answer="<none> $pname: tape unload to slot $curslot failed"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       else
-               sleep $ejectdelay
-       fi
-fi
-
-if [ \( $loadslot -eq 1 \) -a \( \( $curloaded -ne 1 \) -o \( \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) \) \) ]; then      # load the tape from the slot
-
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=1             # unless something goes wrong
-       slotempty=0
-
-       # generically, first check that the device is there
-
-       if [ ! -c $device ]; then
-               answer="$newslot $pname: $device: not a device file"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       fi
-
-       $CHS select -s$newslot -d1 >/dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               answer="<none> $pname: tape load from slot $newslot failed"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
-       fi
-       sleep 60
-
-       # second, try to rewind the device
-       $MT $MTF $device rewind >/dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific load command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               slotempty=1
-               curloaded=0
-       fi
-fi
-
-# update state
-
-echo "# $pname state cache: DO NOT EDIT!"      >  $ourstate
-echo curslot $newslot                          >> $ourstate
-echo curloaded $curloaded                      >> $ourstate
-
-# return slot info
-
-if [ $slotempty -eq 1 ]; then
-       answer="<nonw> $pname: $newslot slot is empty"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-
-if [ "$command" = -slot -a "$slotparm" = advance ]; then
-       device=/dev/null
-fi
-
-answer="$newslot $device"
-code=0
-echo "Exit -> $answer" >> $logfile
-echo "$answer"
-exit $code
diff --git a/changer-src/chg-disk.sh b/changer-src/chg-disk.sh
new file mode 100644 (file)
index 0000000..d876584
--- /dev/null
@@ -0,0 +1,319 @@
+#! @SHELL@
+#
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1991-1999 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: Jean-Christian SIMONETTI, System and Network Engineer
+#                                  Wanadoo Portails
+#                                  Sophia Antipolis, France
+#
+#      This changer script is based on a directory structure like:
+#      slot_root_dir -|
+#                     |- info
+#                     |- data -> slot1
+#                     |- slot1
+#                     |- slot2
+#                     |- ...
+#                     |- slotn
+#      where 'slot_root_dir' is the tapedev 'file:xxx' parameter and 'n'
+#      is the LASTSLOT value of your changerfile config file. If LASTSLOT is
+#      not defined, the value of the tapecycle parameter is used.
+#
+#      To use this driver, just put the line 'tpchanger "chg-disk"' in your
+#      amanda.conf.
+#
+#      Example of use (amanda.conf):
+#      --- cut here ---
+#      tapedev  "file:/BACKUP2/slots/"
+#      changerdev "/dev/null"
+#      changerfile "chg-disk"
+#      tpchanger "chg-disk"
+#      changerfile "/usr/local/amanda/etc/changer"
+#      tapetype HARD-DISK
+#      define tapetype HARD-DISK {
+#          length 12000 mbytes
+#      }
+#      --- cut here ---
+#
+#      Example changerfile (chg-disk.conf):
+#      --- cut here ---
+#      LASTSLOT=12
+#      --- cut here ---
+#
+#      The number of slot is equal to your LASTSLOT or tapecycle.
+#      You must create the slots and data directory.
+#
+
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+    SUF="-@VERSION@"
+else
+    SUF=
+fi
+
+MYNAME=$0
+
+TAPE=`amgetconf$SUF tapedev`
+if test X"$TAPE" == X""; then
+    echo `_ '<none> tapedev not specified in amanda.conf.'`
+    exit 2
+fi
+SLOTDIR=`echo $TAPE | sed 's/^file://'`
+
+isinteger() {
+           # should be exactly one arg
+       [ $# = 1 ]  || return 1
+           # if arg is null, no expr needed
+       [ "${1}" = '' ] && return 1
+           # expr will return 0 on match
+       expr "$1" : '[0-9][0-9]*$' > /dev/null 2>&1
+}
+
+# Need rwx access to the virtual tape itself.
+if ! test -d $SLOTDIR; then
+    echo `_ '<none> Virtual-tape directory %s does not exist.' "$SLOTDIR"`
+    exit 2
+fi
+if ! test -w $SLOTDIR; then
+    echo `_ '<none> Virtual-tape directory %s is not writable.' "$SLOTDIR"`
+    exit 2
+fi
+
+
+# need rwx access to directory of changer file
+CHANGERFILE=`amgetconf$SUF changerfile`
+conf_match=`expr "$CHANGERFILE" : .\*\.conf\$`
+if [ $conf_match -ge 6 ]; then
+        CONFIGFILE=$CHANGERFILE
+        CHANGERFILE=`echo $CHANGERFILE | sed 's/.conf$//g'`
+else
+        CONFIGFILE=$CHANGERFILE.conf
+fi
+
+CFDir=`dirname ${CHANGERFILE}`
+[ -d ${CFDir} -a -r ${CFDir} -a -w ${CFDir} -a -x ${CFDir} ] ||
+       { echo `_ "<none> %s: need 'rwx' access to '%s'" "$MYNAME" "$CFDir"` ; exit 2 ; }
+
+# check or create changer metadata files
+ACCESSFILE=$CHANGERFILE-access
+[ -f $ACCESSFILE -a -r $ACCESSFILE -a -w $ACCESSFILE ] ||
+       echo 0 > $ACCESSFILE ||
+       { echo `_ "<none> %s: could not access or create '%s'" "$MYNAME" "$ACCESSFILE"` ; exit 2; }
+CLEANFILE=$CHANGERFILE-clean
+[ -f $CLEANFILE -a -r $CLEANFILE -a -w $CLEANFILE ] ||
+       echo 0 > $CLEANFILE ||
+       { echo `_ "<none> %s: could not access or create '%s'" "$MYNAME" "$CLEANFILE"` ; exit 2 ; }
+SLOTFILE=$CHANGERFILE-slot
+[ -f $SLOTFILE -a -r $SLOTFILE -a -w $SLOTFILE ] ||
+       echo 0 > $SLOTFILE ||
+       { echo `_ "<none> %s: could not access or create '%s'" "$MYNAME" "$SLOTFILE"` ; exit 2; }
+
+# read and check metadata
+ACCESSCOUNT=`cat $ACCESSFILE`
+isinteger $ACCESSCOUNT || { ACCESSCOUNT=0 ; echo 0 > $ACCESSFILE ; }
+CLEANCOUNT=`cat $CLEANFILE`
+isinteger $CLEANCOUNT || { CLEANCOUNT=0 ; echo 0 > $CLEANFILE ; }
+
+FIRSTSLOT=1
+LASTSLOT=`amgetconf$SUF tapecycle`
+if test -r $CONFIGFILE; then
+    . $CONFIGFILE
+fi
+CURSLOT=0
+CLEANSLOT=$LASTSLOT
+NSLOT=`expr $LASTSLOT - $FIRSTSLOT + 1`
+
+load() {
+  WHICHSLOT=$1;
+  # unload should have been called, but just in case ...
+  [ -h $SLOTDIR/data ] && unload
+  ln -s $SLOTDIR/slot$WHICHSLOT $SLOTDIR/data
+  echo $WHICHSLOT > $SLOTFILE
+}
+
+unload() {
+  rm -f $SLOTDIR/data
+  echo "0" > $SLOTFILE
+}
+
+readstatus() {
+  CURSLOT=`cat $SLOTFILE`
+}
+
+loadslot() {
+  WHICHSLOT=$1
+
+  TYPE=string  # default if not numeric
+  isinteger $WHICHSLOT && TYPE=digit
+
+  readstatus
+  NEWSLOT=0
+  if [ $WHICHSLOT = "current" ]; then
+    if [ $CURSLOT -le 0 ]; then
+      load $FIRSTSLOT
+      echo "$FIRSTSLOT $TAPE"
+      exit 0
+    else
+      echo "$CURSLOT $TAPE"
+      exit 0
+    fi
+  elif [ $WHICHSLOT = "next" -o $WHICHSLOT = "advance" ]; then
+    NEWSLOT=`expr $CURSLOT + 1`
+    [ $NEWSLOT -gt $LASTSLOT ] && NEWSLOT=$FIRSTSLOT
+  elif [ $WHICHSLOT = "prev" ]; then
+      NEWSLOT=`expr $CURSLOT - 1`
+      [ $NEWSLOT -lt $FIRSTSLOT ] && NEWSLOT=$LASTSLOT
+  elif [ $WHICHSLOT = "first" ]; then
+      NEWSLOT=$FIRSTSLOT
+  elif [ $WHICHSLOT = "last" ]; then
+      NEWSLOT=$LASTSLOT
+  elif [ $TYPE = "digit" ]; then
+    if [ $WHICHSLOT -ge $FIRSTSLOT -a $WHICHSLOT -le $LASTSLOT ]; then
+      NEWSLOT=$WHICHSLOT
+    else
+      echo `_ '%s illegal slot' "$WHICHSLOT"`
+      exit 1
+    fi
+  elif [ $WHICHSLOT = "clean" ]; then
+    NEWSLOT=$CLEANSLOT
+  else
+    echo `_ '%s illegal request' "$WHICHSLOT"`
+    exit 1
+  fi
+  if [ $NEWSLOT = $CURSLOT ]; then
+    echo "$CURSLOT $TAPE"
+    exit 0
+  fi
+  if [ $NEWSLOT = $CLEANSLOT ]; then
+    expr ${CLEANCOUNT:=0} + 1 > $CLEANFILE
+    echo 0 > $ACCESSFILE
+  else
+    expr ${ACCESSCOUNT:=0} + 1 > $ACCESSFILE
+    if [ $ACCESSCOUNT -gt $LASTSLOT ]; then
+      $MYNAME -slot clean >/dev/null
+    fi
+  fi
+
+  readstatus
+  if [ $CURSLOT -ne 0 ]; then
+    unload
+  fi
+
+  if [ $WHICHSLOT = "advance" ]; then
+    echo "$NEWSLOT /dev/null"
+    exit 0
+  fi
+  load $NEWSLOT
+  echo "$NEWSLOT $TAPE"
+  exit 0
+}
+
+info() {
+  readstatus
+  echo "$CURSLOT $NSLOT 1"
+  exit 0
+}
+
+reset() {
+  readstatus
+  [ $CURSLOT -gt 0 ] && unload
+  load $FIRSTSLOT
+  echo "$FIRSTSLOT $tape"
+  exit 0
+}
+
+eject() {
+  readstatus
+  if [ $CURSLOT -le 0 ]; then
+    echo `_ '0 Drive was not loaded'`
+    exit 1
+  else
+    unload
+    echo $CURSLOT
+    exit 0
+  fi
+}
+
+
+while [ $# -ge 1 ];do
+  case $1 in
+    -slot)
+           shift
+           loadslot $*
+           ;;
+    -clean)
+           shift
+           loadslot clean
+           ;;
+    -current)
+           shift
+           loadslot current
+           ;;
+    -next)
+           shift
+           loadslot next
+           ;;
+    -advance)
+           shift
+           loadslot advance
+           ;;
+    -prev)
+           shift
+           loadslot prev
+           ;;
+    -first)
+           shift
+           loadslot first
+           ;;
+    -last)
+           shift
+           loadslot last
+           ;;
+    -info)
+           shift
+           info
+           ;;
+    -reset)
+            shift
+            reset
+            ;;
+    -eject)
+            shift
+            eject
+            ;;
+    *)
+       echo `_ '<none> Unknown option %s' "$1"`
+       exit 2
+       ;;
+  esac
+done
+
diff --git a/changer-src/chg-disk.sh.in b/changer-src/chg-disk.sh.in
deleted file mode 100644 (file)
index 5ac3783..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-#! @SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1999 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: Jean-Christian SIMONETTI, System and Network Engineer
-#                                  Wanadoo Portails
-#                                  Sophia Antipolis, France
-#
-#      This changer script is based on a directory structure like:
-#      slot_root_dir -|
-#                     |- info
-#                     |- data -> slot1
-#                     |- slot1
-#                     |- slot2
-#                     |- ...
-#                     |- slotn
-#      where 'slot_root_dir' is the tapedev 'file:xxx' parameter and 'n'
-#      is the LASTSLOT value of your changerfile config file. If LASTSLOT is
-#      not defined, the value of the tapecycle parameter is used.
-#
-#      To use this driver, just put the line 'tpchanger "chg-disk"' in your
-#      amanda.conf.
-#
-#      Example of use (amanda.conf):
-#      --- cut here ---
-#      tapedev  "file:/BACKUP2/slots/"
-#      rawtapedev "file:/BACKUP2/slots/"
-#      changerdev "/dev/null"
-#      changerfile "chg-disk"
-#      tpchanger "chg-disk"
-#      changerfile "/usr/local/amanda/etc/changer"
-#      tapetype HARD-DISK
-#      define tapetype HARD-DISK {
-#          length 12000 mbytes
-#      }
-#      --- cut here ---
-#
-#      Example changerfile (chg-disk.conf):
-#      --- cut here ---
-#      LASTSLOT=12
-#      --- cut here ---
-#
-#      The number of slot is equal to your LASTSLOT or tapecycle.
-#      You must create the slots and data directory.
-#
-
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-    SUF="-@VERSION@"
-else
-    SUF=
-fi
-
-MYNAME=$0
-
-TAPE=`amgetconf$SUF tapedev`
-if test X"$TAPE" == X""; then
-    echo "<none> tapedev not specified in amanda.conf."
-    exit 2
-fi
-SLOTDIR=`echo $TAPE | sed 's/^file://'`
-
-isinteger() {
-           # should be exactly one arg
-       [ $# = 1 ]  || return 1
-           # if arg is null, no expr needed
-       [ "${1}" = '' ] && return 1
-           # expr will return 0 on match
-       expr "$1" : '[0-9][0-9]*$' > /dev/null 2>&1
-}
-
-# Need rwx access to the virtual tape itself.
-if ! test -d $SLOTDIR; then
-    echo "<none> Virtual-tape directory $SLOTDIR does not exist."
-    exit 2
-fi
-if ! test -w $SLOTDIR; then
-    echo "<none> Virtual-tape directory $SLOTDIR is not writable."
-    exit 2
-fi
-
-
-# need rwx access to directory of changer file
-CHANGERFILE=`amgetconf$SUF changerfile`
-conf_match=`expr "$CHANGERFILE" : .\*\.conf\$`
-if [ $conf_match -ge 6 ]; then
-        CONFIGFILE=$CHANGERFILE
-        CHANGERFILE=`echo $CHANGERFILE | sed 's/.conf$//g'`
-else
-        CONFIGFILE=$CHANGERFILE.conf
-fi
-
-CFDir=`dirname ${CHANGERFILE}`
-[ -d ${CFDir} -a -r ${CFDir} -a -w ${CFDir} -a -x ${CFDir} ] ||
-       { echo "<none> $MYNAME: need 'rwx' access to '$CFDir'"; exit 2 ; }
-
-# check or create changer metadata files
-ACCESSFILE=$CHANGERFILE-access
-[ -f $ACCESSFILE -a -r $ACCESSFILE -a -w $ACCESSFILE ] ||
-       echo 0 > $ACCESSFILE ||
-       { echo "<none> $MYNAME: could not access or create '$ACCESSFILE'" ; exit 2 ; }
-CLEANFILE=$CHANGERFILE-clean
-[ -f $CLEANFILE -a -r $CLEANFILE -a -w $CLEANFILE ] ||
-       echo 0 > $CLEANFILE ||
-       { echo "<none> $MYNAME: could not access or create '$CLEANFILE'" ; exit 2 ; }
-SLOTFILE=$CHANGERFILE-slot
-[ -f $SLOTFILE -a -r $SLOTFILE -a -w $SLOTFILE ] ||
-       echo 0 > $SLOTFILE ||
-       { echo "<none> $MYNAME: could not access or create '$SLOTFILE'" ; exit 2 ; }
-
-# read and check metadata
-ACCESSCOUNT=`cat $ACCESSFILE`
-isinteger $ACCESSCOUNT || { ACCESSCOUNT=0 ; echo 0 > $ACCESSFILE ; }
-CLEANCOUNT=`cat $CLEANFILE`
-isinteger $CLEANCOUNT || { CLEANCOUNT=0 ; echo 0 > $CLEANFILE ; }
-
-FIRSTSLOT=1
-LASTSLOT=`amgetconf$SUF tapecycle`
-if test -r $CONFIGFILE; then
-    . $CONFIGFILE
-fi
-CURSLOT=0
-CLEANSLOT=$LASTSLOT
-NSLOT=`expr $LASTSLOT - $FIRSTSLOT + 1`
-
-load() {
-  WHICHSLOT=$1;
-  # unload should have been called, but just in case ...
-  [ -h $SLOTDIR/data ] && unload
-  ln -s $SLOTDIR/slot$WHICHSLOT $SLOTDIR/data
-  echo $WHICHSLOT > $SLOTFILE
-}
-
-unload() {
-  rm -f $SLOTDIR/data
-  echo "0" > $SLOTFILE
-}
-
-readstatus() {
-  CURSLOT=`cat $SLOTFILE`
-}
-
-loadslot() {
-  WHICHSLOT=$1
-
-  TYPE=string  # default if not numeric
-  isinteger $WHICHSLOT && TYPE=digit
-
-  readstatus
-  NEWSLOT=0
-  if [ $WHICHSLOT = "current" ]; then
-    if [ $CURSLOT -le 0 ]; then
-      load $FIRSTSLOT
-      echo "$FIRSTSLOT $TAPE"
-      exit 0
-    else
-      echo "$CURSLOT $TAPE"
-      exit 0
-    fi
-  elif [ $WHICHSLOT = "next" -o $WHICHSLOT = "advance" ]; then
-    NEWSLOT=`expr $CURSLOT + 1`
-    [ $NEWSLOT -gt $LASTSLOT ] && NEWSLOT=$FIRSTSLOT
-  elif [ $WHICHSLOT = "prev" ]; then
-      NEWSLOT=`expr $CURSLOT - 1`
-      [ $NEWSLOT -lt $FIRSTSLOT ] && NEWSLOT=$LASTSLOT
-  elif [ $WHICHSLOT = "first" ]; then
-      NEWSLOT=$FIRSTSLOT
-  elif [ $WHICHSLOT = "last" ]; then
-      NEWSLOT=$LASTSLOT
-  elif [ $TYPE = "digit" ]; then
-    if [ $WHICHSLOT -ge $FIRSTSLOT -a $WHICHSLOT -le $LASTSLOT ]; then
-      NEWSLOT=$WHICHSLOT
-    else
-      echo "$WHICHSLOT illegal slot"
-      exit 1
-    fi
-  elif [ $WHICHSLOT = "clean" ]; then
-    NEWSLOT=$CLEANSLOT
-  else
-    echo "$WHICHSLOT illegal request"
-    exit 1
-  fi
-  if [ $NEWSLOT = $CURSLOT ]; then
-    echo "$CURSLOT $TAPE"
-    exit 0
-  fi
-  if [ $NEWSLOT = $CLEANSLOT ]; then
-    expr ${CLEANCOUNT:=0} + 1 > $CLEANFILE
-    echo 0 > $ACCESSFILE
-  else
-    expr ${ACCESSCOUNT:=0} + 1 > $ACCESSFILE
-    if [ $ACCESSCOUNT -gt $LASTSLOT ]; then
-      $MYNAME -slot clean >/dev/null
-    fi
-  fi
-
-  readstatus
-  if [ $CURSLOT -ne 0 ]; then
-    unload
-  fi
-
-  if [ $WHICHSLOT = "advance" ]; then
-    echo "$NEWSLOT /dev/null"
-    exit 0
-  fi
-  load $NEWSLOT
-  echo "$NEWSLOT $TAPE"
-  exit 0
-}
-
-info() {
-  readstatus
-  echo "$CURSLOT $NSLOT 1"
-  exit 0
-}
-
-reset() {
-  readstatus
-  [ $CURSLOT -gt 0 ] && unload
-  load $FIRSTSLOT
-  echo "$FIRSTSLOT $tape"
-  exit 0
-}
-
-eject() {
-  readstatus
-  if [ $CURSLOT -le 0 ]; then
-    echo "0 Drive was not loaded"
-    exit 1
-  else
-    unload
-    echo $CURSLOT
-    exit 0
-  fi
-}
-
-
-while [ $# -ge 1 ];do
-  case $1 in
-    -slot)
-           shift
-           loadslot $*
-           ;;
-    -clean)
-           shift
-           loadslot clean
-           ;;
-    -current)
-           shift
-           loadslot current
-           ;;
-    -next)
-           shift
-           loadslot next
-           ;;
-    -advance)
-           shift
-           loadslot advance
-           ;;
-    -prev)
-           shift
-           loadslot prev
-           ;;
-    -first)
-           shift
-           loadslot first
-           ;;
-    -last)
-           shift
-           loadslot last
-           ;;
-    -info)
-           shift
-           info
-           ;;
-    -reset)
-            shift
-            reset
-            ;;
-    -eject)
-            shift
-            eject
-            ;;
-    *)
-       echo "<none> Unknown option $1"
-       exit 2
-       ;;
-  esac
-done
-
diff --git a/changer-src/chg-iomega.pl b/changer-src/chg-iomega.pl
new file mode 100644 (file)
index 0000000..56a1329
--- /dev/null
@@ -0,0 +1,290 @@
+#! @PERL@ -w
+
+# Catch for sh/csh on systems without #! ability.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+        & eval 'exec @PERL@ -S $0 $argv:q'
+                if 0;
+
+# 
+# This changer script is designed for IOMEGA or JAZZ disks of various sizes
+# as well as any other removable disk media.
+#
+# This is a PURELY MANUAL changer. It requests insertion of disk media via
+# messages on /dev/tty. So it cannot be used via crontab.
+#
+# Make sure you comply with any of the following.
+# - Add statements 
+#         tpchanger "chg-iomega"
+#         tapedev "file:<mount_point_of_removable_disk>"
+#         # (e.g. tapedev "file:/mnt/iomega" )
+#         tapetype IOMEGA      
+#
+#         
+#         define tapetype IOMEGA {
+#             comment "IOMega 250 MB floppys"
+#             length 250 mbytes
+#             filemark 100 kbytes
+#             speed 1 mbytes
+#         }
+#   to your /etc/amanda/<backup_set>/amanda.conf file
+# - Add entry to /etc/fstab to specify mount point of removable disk
+#   and make this disk mountable by any user.
+# - Format all disks, add a "data" sub directory and label all disks
+#   by a call to amlabel.
+# - Be aware that as of version 2.4.4p1, amanda can't handle backups that are
+#   larger than the size of the removable disk media. So make sure
+#   /etc/amanda/<backup_set>/disklist specifies chunks smaller than the 
+#   disk size.
+#
+# This script is built up out of bits and pieces of other scripts, in
+# particular chg-chio.pl. That script was written by 
+# Nick Hibma - nick.hibma@jrc.it
+# 
+# Permission to freely use and distribute is granted (by me and was granted by
+# the original authors).
+#
+# Christoph Pospiech <pospiech@de.ibm.com>
+#
+
+require 5.001;
+
+($progname = $0) =~ s#/.*/##;
+
+use English;
+use Getopt::Long;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$| = 1;
+
+if (-d "@AMANDA_DBGDIR@") {
+       $logfile = "@AMANDA_DBGDIR@/changer.debug";
+} else {
+       $logfile = "/dev/null";
+}
+die "$progname: cannot open $logfile: $ERRNO\n"
+       unless (open (LOG, ">> $logfile"));
+
+
+#
+# get the information from the configuration file
+#
+
+$prefix="@prefix@";
+$prefix=$prefix;               # avoid warnings about possible typo
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;     # Ditto
+$sbindir="@sbindir@";
+if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) {
+    $SUF = "-@VERSION@";
+} else {
+    $SUF = "";
+}
+
+chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`);
+die "tapedev not found in amanda.conf"
+       if !$tapeDevice or $tapeDevice eq "" or
+           $tapeDevice =~ m/no such parameter/;
+chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`);
+chomp $changerDevice;
+die "changerdev not found in amanda.conf"
+       if !$changerDevice or $changerDevice eq "" or
+           $changerDevice =~ m/no such parameter/;
+
+#
+# Initialise a few global variables
+#
+
+$current_label = "";
+#$current_slot = 0;
+$max_slot = 1;
+
+@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
+@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
+       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
+
+sub do_time {
+       my (@t);
+       my ($r);
+
+       ###
+       # Get the local time for the value.
+       ###
+
+       @t = localtime (time ());
+
+       ###
+       # Return the result.
+       ###
+
+       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
+         $dow[$t[6]],
+         $moy[$t[4]],
+         $t[3],
+         $t[2], $t[1], $t[0],
+         1900 + $t[5];
+
+       return $r;
+}
+
+
+sub is_mounted {
+    my $device = shift @_;
+    my ($directory) = ($device =~ m/file\:(.*)$/);
+    if ( -d "$directory/data" ) { return 1;}
+    else {return 0;}
+}
+
+sub request {
+    my $label = shift @_;
+    my $answer;
+    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
+    print TTY "Insert Disk with label $label\n";
+    read TTY,$answer,1;
+    close TTY;
+    return $answer;
+}
+
+sub print_label {
+    my $label = shift @_;
+    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
+    print TTY "The current Disk has label $label\n";
+    close TTY;
+}
+
+sub get_label {
+    my $device = shift @_;
+    my ($directory) = ($device =~ m/file\:(.*)$/);
+    my @dir_list =  glob("$directory/data/*");
+    while ( ($_= shift(@dir_list)) ) {
+       if ( /0+\.([\w\d]+)/ ) {return $1;}
+    }
+    return "no label";
+}
+
+
+sub Load {
+    my $device = shift @_;
+    my ($directory) = ($device =~ m/file\:(.*)$/);
+    my $label;
+    print LOG &do_time(), ": enter: Load $device\n";
+    if ( ! &is_mounted($device) ) {
+       print LOG &do_time(), ": mounting $directory\n";
+       system "mount $directory";
+    }
+    $label = get_label $device;
+    &print_label($label);
+    print LOG &do_time(), ": current label: $label\n";
+    print LOG &do_time(), ": leave: Load\n";
+
+}
+
+sub Unload {
+    my $device = shift @_;
+    my ($directory) = ($device =~ m/file\:(.*)$/);
+    print LOG &do_time(), ": enter: Unload $device\n";
+    if ( &is_mounted($device) ) {
+       print LOG &do_time(), ": ejecting $directory\n";
+       system "eject $directory";
+    }
+    print LOG &do_time(), ": leave: Unload\n";
+}
+
+
+
+#
+# Main program
+#
+
+#
+# Initialise
+#
+
+
+$opt_slot = 0;                                 # perl -w fodder
+$opt_info = 0;                                 # perl -w fodder
+$opt_reset = 0;                                        # perl -w fodder
+$opt_eject = 0;                                        # perl -w fodder
+$opt_search = 0;                                       # perl -w fodder
+$opt_label = 0;                                        # perl -w fodder
+
+GetOptions("slot=s", "info", "reset", "eject", "search=s", "label=s"); 
+
+
+if ( $opt_slot ) {
+    print LOG &do_time(), ": Loading slot $opt_slot requested\n";
+    if ( ! &is_mounted ($tapeDevice) ) {
+       &request ("any");
+       &Load ($tapeDevice);
+    }
+    $current_label = &get_label ($tapeDevice);
+    print LOG &do_time(), ": current label: $current_label\n";
+    print LOG &do_time(), ": 1 $tapeDevice\n";
+    print "1 $tapeDevice\n";
+    exit 0;
+}
+
+if ( $opt_info ) {
+    print LOG &do_time(), ": info requested\n";
+    $current_label = &get_label ($tapeDevice);
+    print LOG &do_time(), ": current label: $current_label\n";
+    print LOG &do_time(), ": 1 $max_slot 1 1\n";
+    print "1 $max_slot 1 1\n";
+    exit 0;
+}
+
+if ( $opt_reset ) {
+    print LOG &do_time(), ": reset requested\n";
+    &Unload ($tapeDevice);
+    &request ("any");
+    &Load ($tapeDevice);
+    $current_label = &get_label ($tapeDevice);
+    print LOG &do_time(), ": current label: $current_label\n";
+    print LOG &do_time(), ": 1 $tapeDevice\n";
+    print "1 $tapeDevice\n";
+    exit 0;
+}
+
+if ( $opt_eject ) {
+    print LOG &do_time(), ": eject requested\n";
+    &Unload ($tapeDevice);
+    print LOG &do_time(), ": 1 $tapeDevice\n";
+    print "1 $tapeDevice\n";
+    exit 0;
+}
+
+if ( $opt_search ) {
+    print LOG &do_time(), ": search label $opt_search requested\n";
+    $retry = 0;
+    $current_label = &get_label ($tapeDevice);
+    print LOG &do_time(), ": current label: $current_label\n";
+    while ( $opt_search ne $current_label && ++$retry < 5) {
+       &Unload ($tapeDevice);
+       &request ($opt_search);
+       &Load ($tapeDevice);
+       $current_label = &get_label ($tapeDevice);
+       print LOG &do_time(), ": search label: $opt_search\n";
+       print LOG &do_time(), ": current label: $current_label\n";
+    }
+    if ( $retry >= 5) {
+       print LOG &do_time(), ": disk not found\n";
+       print "disk not found\n";
+       exit 1;
+    } else {
+       print LOG &do_time(), ": 1 $tapeDevice\n";
+       print "1 $tapeDevice\n";
+       exit 0;
+    }
+}
+
+if ( $opt_label ) {
+    print LOG &do_time(), ": label $opt_label requested\n";
+    # no operation
+    print LOG &do_time(), ": 1 $tapeDevice\n";
+    print "1 $tapeDevice\n";
+    exit 0;
+}
+
+print "$progname: No command was received.  Exiting.\n";
+exit 1;
diff --git a/changer-src/chg-iomega.pl.in b/changer-src/chg-iomega.pl.in
deleted file mode 100644 (file)
index 56a1329..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-#! @PERL@ -w
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-        & eval 'exec @PERL@ -S $0 $argv:q'
-                if 0;
-
-# 
-# This changer script is designed for IOMEGA or JAZZ disks of various sizes
-# as well as any other removable disk media.
-#
-# This is a PURELY MANUAL changer. It requests insertion of disk media via
-# messages on /dev/tty. So it cannot be used via crontab.
-#
-# Make sure you comply with any of the following.
-# - Add statements 
-#         tpchanger "chg-iomega"
-#         tapedev "file:<mount_point_of_removable_disk>"
-#         # (e.g. tapedev "file:/mnt/iomega" )
-#         tapetype IOMEGA      
-#
-#         
-#         define tapetype IOMEGA {
-#             comment "IOMega 250 MB floppys"
-#             length 250 mbytes
-#             filemark 100 kbytes
-#             speed 1 mbytes
-#         }
-#   to your /etc/amanda/<backup_set>/amanda.conf file
-# - Add entry to /etc/fstab to specify mount point of removable disk
-#   and make this disk mountable by any user.
-# - Format all disks, add a "data" sub directory and label all disks
-#   by a call to amlabel.
-# - Be aware that as of version 2.4.4p1, amanda can't handle backups that are
-#   larger than the size of the removable disk media. So make sure
-#   /etc/amanda/<backup_set>/disklist specifies chunks smaller than the 
-#   disk size.
-#
-# This script is built up out of bits and pieces of other scripts, in
-# particular chg-chio.pl. That script was written by 
-# Nick Hibma - nick.hibma@jrc.it
-# 
-# Permission to freely use and distribute is granted (by me and was granted by
-# the original authors).
-#
-# Christoph Pospiech <pospiech@de.ibm.com>
-#
-
-require 5.001;
-
-($progname = $0) =~ s#/.*/##;
-
-use English;
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$| = 1;
-
-if (-d "@AMANDA_DBGDIR@") {
-       $logfile = "@AMANDA_DBGDIR@/changer.debug";
-} else {
-       $logfile = "/dev/null";
-}
-die "$progname: cannot open $logfile: $ERRNO\n"
-       unless (open (LOG, ">> $logfile"));
-
-
-#
-# get the information from the configuration file
-#
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # Ditto
-$sbindir="@sbindir@";
-if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) {
-    $SUF = "-@VERSION@";
-} else {
-    $SUF = "";
-}
-
-chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`);
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`);
-chomp $changerDevice;
-die "changerdev not found in amanda.conf"
-       if !$changerDevice or $changerDevice eq "" or
-           $changerDevice =~ m/no such parameter/;
-
-#
-# Initialise a few global variables
-#
-
-$current_label = "";
-#$current_slot = 0;
-$max_slot = 1;
-
-@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
-@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
-       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
-
-sub do_time {
-       my (@t);
-       my ($r);
-
-       ###
-       # Get the local time for the value.
-       ###
-
-       @t = localtime (time ());
-
-       ###
-       # Return the result.
-       ###
-
-       $r = sprintf "%s %s %2d %2d:%02d:%02d %4d",
-         $dow[$t[6]],
-         $moy[$t[4]],
-         $t[3],
-         $t[2], $t[1], $t[0],
-         1900 + $t[5];
-
-       return $r;
-}
-
-
-sub is_mounted {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    if ( -d "$directory/data" ) { return 1;}
-    else {return 0;}
-}
-
-sub request {
-    my $label = shift @_;
-    my $answer;
-    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
-    print TTY "Insert Disk with label $label\n";
-    read TTY,$answer,1;
-    close TTY;
-    return $answer;
-}
-
-sub print_label {
-    my $label = shift @_;
-    open (TTY, "+</dev/tty") or die "Can't open tty.\n";
-    print TTY "The current Disk has label $label\n";
-    close TTY;
-}
-
-sub get_label {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    my @dir_list =  glob("$directory/data/*");
-    while ( ($_= shift(@dir_list)) ) {
-       if ( /0+\.([\w\d]+)/ ) {return $1;}
-    }
-    return "no label";
-}
-
-
-sub Load {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    my $label;
-    print LOG &do_time(), ": enter: Load $device\n";
-    if ( ! &is_mounted($device) ) {
-       print LOG &do_time(), ": mounting $directory\n";
-       system "mount $directory";
-    }
-    $label = get_label $device;
-    &print_label($label);
-    print LOG &do_time(), ": current label: $label\n";
-    print LOG &do_time(), ": leave: Load\n";
-
-}
-
-sub Unload {
-    my $device = shift @_;
-    my ($directory) = ($device =~ m/file\:(.*)$/);
-    print LOG &do_time(), ": enter: Unload $device\n";
-    if ( &is_mounted($device) ) {
-       print LOG &do_time(), ": ejecting $directory\n";
-       system "eject $directory";
-    }
-    print LOG &do_time(), ": leave: Unload\n";
-}
-
-
-
-#
-# Main program
-#
-
-#
-# Initialise
-#
-
-
-$opt_slot = 0;                                 # perl -w fodder
-$opt_info = 0;                                 # perl -w fodder
-$opt_reset = 0;                                        # perl -w fodder
-$opt_eject = 0;                                        # perl -w fodder
-$opt_search = 0;                                       # perl -w fodder
-$opt_label = 0;                                        # perl -w fodder
-
-GetOptions("slot=s", "info", "reset", "eject", "search=s", "label=s"); 
-
-
-if ( $opt_slot ) {
-    print LOG &do_time(), ": Loading slot $opt_slot requested\n";
-    if ( ! &is_mounted ($tapeDevice) ) {
-       &request ("any");
-       &Load ($tapeDevice);
-    }
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_info ) {
-    print LOG &do_time(), ": info requested\n";
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $max_slot 1 1\n";
-    print "1 $max_slot 1 1\n";
-    exit 0;
-}
-
-if ( $opt_reset ) {
-    print LOG &do_time(), ": reset requested\n";
-    &Unload ($tapeDevice);
-    &request ("any");
-    &Load ($tapeDevice);
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_eject ) {
-    print LOG &do_time(), ": eject requested\n";
-    &Unload ($tapeDevice);
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-if ( $opt_search ) {
-    print LOG &do_time(), ": search label $opt_search requested\n";
-    $retry = 0;
-    $current_label = &get_label ($tapeDevice);
-    print LOG &do_time(), ": current label: $current_label\n";
-    while ( $opt_search ne $current_label && ++$retry < 5) {
-       &Unload ($tapeDevice);
-       &request ($opt_search);
-       &Load ($tapeDevice);
-       $current_label = &get_label ($tapeDevice);
-       print LOG &do_time(), ": search label: $opt_search\n";
-       print LOG &do_time(), ": current label: $current_label\n";
-    }
-    if ( $retry >= 5) {
-       print LOG &do_time(), ": disk not found\n";
-       print "disk not found\n";
-       exit 1;
-    } else {
-       print LOG &do_time(), ": 1 $tapeDevice\n";
-       print "1 $tapeDevice\n";
-       exit 0;
-    }
-}
-
-if ( $opt_label ) {
-    print LOG &do_time(), ": label $opt_label requested\n";
-    # no operation
-    print LOG &do_time(), ": 1 $tapeDevice\n";
-    print "1 $tapeDevice\n";
-    exit 0;
-}
-
-print "$progname: No command was received.  Exiting.\n";
-exit 1;
diff --git a/changer-src/chg-juke.sh b/changer-src/chg-juke.sh
new file mode 100755 (executable)
index 0000000..9e3809b
--- /dev/null
@@ -0,0 +1,267 @@
+#!@SHELL@
+
+# chg-juke
+#
+# This assumes we have possibly rait-striped drives in several
+# jukeboxes, controlled by the Fermilab "juke" package
+#
+# So we could have 3 drives in 3 jukeboxes:
+#   changerscript="chg-juke"
+#   changerfile=/some/file
+#   tapedev="rait:/dev/nst{1,2,3}"
+#   changerdev="myjuke{0,1,2}"
+# Or, if the jukebox has multiple drives:
+#   changerscript="chg-juke"
+#   changerfile=/some/file
+#   tapedev="rait:/dev/nst{1,2,3}"
+#   changerdev="myjuke"
+# We need therefore to generate lists with csh to expand the tapedev 
+# and changerdev, and deal with the possibility that there are several 
+# jukeboxes and several drives in each jukebox involved.
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+
+#
+# debugging...
+#
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       DBGFILE=@AMANDA_DBGDIR@/changer.debug
+else
+       DBGFILE=/dev/null
+fi
+exec 2>$DBGFILE
+echo `_ 'args:'` $0 $* >&2
+set -x 
+
+#
+# the usual config fun
+#
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+        SUF="-@VERSION@";
+else
+       SUF=
+fi
+getconf=$sbindir/amgetconf$SUF
+
+#
+# make sure we can find JUKE later
+#
+JUKE_DIR=/usr/local
+# Fermilab specific
+if [ -f /usr/local/etc/setups.sh ]
+then
+    . /usr/local/etc/setups.sh
+    setup juke
+fi
+
+# add sbin, ucb, and the JUKE_DIR to PATH
+PATH="$PATH:$JUKE_DIR/bin:/usr/sbin:/sbin:/usr/ucb"
+export PATH JUKE_DIR
+
+build_drivelists() {
+    #
+    # figure out which drives are in which jukebox
+    #
+    count=0
+    for juke in $jlist
+    do
+       for d in $dlist
+       do
+           if juke list -j $juke drive $d | grep 'drive [0-9]' >&2
+           then
+               eval "drives_in_$juke=\"\$drives_in_$juke $d\""
+           fi
+       done
+    done
+}
+
+unload_drive_n_clean() {
+
+    #
+    # $1 is whether to clean it
+    #
+    cleanit=$1
+
+    #
+    # if the drive is ONLINE, mt unload it
+    #
+    if amdevcheck_status $tapedev; then
+        try_eject_device $tapedev
+    fi
+
+    #
+    # unload any tapes present, maybe load/unload a cleaning cartridge
+    #
+    for juke in $jlist
+    do
+       eval "jdlist=\"\$drives_in_$juke\""
+       for drive in $jdlist
+       do
+           juke unload -j $juke drive $drive >&2 || true
+           if juke list -j $juke drive $drive | grep '(empty)' >&2
+           then
+               :
+           else
+               echo `_ '%s %s unable to empty preceding tape from drive %s' "$slot" "$tapedev" "$drive"`
+               exit 1
+           fi
+
+           if $cleanit
+            then
+                juke load -j $juke drive $drive clean
+               sleep 120
+                juke unload -j $juke drive $drive
+            fi
+       done
+    done
+}
+
+load_drives() {
+    #
+    # load slots.  If it's a stripe, load several...
+    #
+    for juke in $jlist
+    do
+       eval "jdlist=\"\$drives_in_$juke\""
+       jndrives=`echo $jdlist | wc -w`
+       count=0
+       for drive in $jdlist
+       do
+           rslot=`expr $newslot '*' $jndrives + $count`
+           juke load -j $changerdev drive $drive slot $rslot >&2
+           if juke list -j $changerdev drive $drive | grep '(empty)' >&2
+           then
+               echo `_ '$slot $tapedev unable to load tape into drive' "$slot" "$tapedev"`
+               exit 1
+           fi
+           count=`expr $count + 1`
+       done
+    done
+
+    #
+    # wait for drive(s) to come online
+    #
+    count=0
+    until amdevcheck_status $tapedev; do
+       count=`expr $count + 1`
+       if [ $count -gt 24 ] 
+       then
+           echo `_ '%s %s never came online' "$slot" "$tapedev"`
+           exit 1
+       fi
+       sleep 5
+    done
+}
+
+
+ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$"
+
+#
+# get config variables
+#
+changerfile=`$getconf changerfile`
+    tapedev=`$getconf tapedev`
+ changerdev=`$getconf changerdev`
+      dlist=`csh -c "echo $tapedev" | sed -e 's/rait://g' -e 's/tape://g'`
+    ndrives=`echo $dlist | wc -w`
+      jlist=`csh -c "echo $changerdev"`
+     njukes=`echo $jlist | wc -w`
+ totalslots=`for juke in $jlist ; do juke list -j $juke; done | 
+               grep -v '^clean' | 
+               grep 'slot [0-9]' | 
+               wc -l`
+
+if [ $ndrives -gt 1 ]
+then
+   #
+   # if it's a 3 tape stripe and we have 30 actual slots
+   # we only have 10 virtual slots...
+   #
+   totalslots=`expr $totalslots / $ndrives`
+fi
+
+build_drivelists
+
+#
+# get current slot if we have one
+#
+if [ -f "$changerfile" ] 
+then
+    slot="`cat $changerfile`"
+else
+    slot=0
+    echo $slot > $changerfile
+fi
+
+#
+# We treat -reset just like -slot 0
+#
+if [ x$1 = 'x-reset' ]
+then
+    set : -slot 0
+    shift
+fi
+
+case x$1 in
+
+x-slot) 
+
+    #
+    # handle special slots...
+    #
+    case "$2" in
+    current)   newslot=$slot           ; load=true;;
+    next)      newslot=`expr $slot + 1`; load=true;;
+    advance)   newslot=`expr $slot + 1`; load=false;;
+    prev)      newslot=`expr $slot - 1`; load=true;;
+    first)     newslot=0               ; load=true;;
+    last)      newslot=-1              ; load=true;;
+    *)         newslot=$2              ; load=true;;
+    esac
+
+    if [ $newslot = "clean" ]
+    then
+       unload_drive_n_clean true
+    else 
+       if [ 0 -gt $newslot ]
+       then
+           newslot=`expr $totalslots - 1`
+       fi
+
+       if [ $totalslots -le  $newslot ]
+       then
+           newslot=0
+       fi
+
+       echo $newslot > $changerfile
+       slot=$newslot
+
+       if $load
+       then
+           unload_drive_n_clean false
+           load_drives
+       fi
+    fi
+
+    echo $slot $tapedev
+    ;;
+
+x-info)
+    echo $slot $totalslots 1
+    exit 0
+    ;;
+
+x-eject)
+    unload_drive_n_clean false
+    echo $slot $tapedev
+    ;;
+esac
+
+exit $rc
diff --git a/changer-src/chg-juke.sh.in b/changer-src/chg-juke.sh.in
deleted file mode 100755 (executable)
index b894623..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-#!@SHELL@
-
-# chg-juke
-#
-# This assumes we have possibly rait-striped drives in several
-# jukeboxes, controlled by the Fermilab "juke" package
-#
-# So we could have 3 drives in 3 jukeboxes:
-#   changerscript="chg-juke"
-#   changerfile=/some/file
-#   tapedev="rait:/dev/nst{1,2,3}"
-#   changerdev="myjuke{0,1,2}"
-# Or, if the jukebox has multiple drives:
-#   changerscript="chg-juke"
-#   changerfile=/some/file
-#   tapedev="rait:/dev/nst{1,2,3}"
-#   changerdev="myjuke"
-# We need therefore to generate lists with csh to expand the tapedev 
-# and changerdev, and deal with the possibility that there are several 
-# jukeboxes and several drives in each jukebox involved.
-
-#
-# debugging...
-#
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       DBGFILE=@AMANDA_DBGDIR@/changer.debug
-else
-       DBGFILE=/dev/null
-fi
-exec 2>$DBGFILE
-echo "args: $0 $*" >&2
-set -x 
-
-#
-# the usual config fun
-#
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-MT=ammt
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-        SUF="-@VERSION@";
-else
-       SUF=
-fi
-getconf=$sbindir/amgetconf$SUF
-
-#
-# make sure we can find JUKE later
-#
-JUKE_DIR=/usr/local
-# Fermilab specific
-if [ -f /usr/local/etc/setups.sh ]
-then
-    . /usr/local/etc/setups.sh
-    setup juke
-fi
-
-PATH=$sbindir:$libexecdir:$JUKE_DIR/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH JUKE_DIR
-
-build_drivelists() {
-    #
-    # figure out which drives are in which jukebox
-    #
-    count=0
-    for juke in $jlist
-    do
-       for d in $dlist
-       do
-           if juke list -j $juke drive $d | grep 'drive [0-9]' >&2
-           then
-               eval "drives_in_$juke=\"\$drives_in_$juke $d\""
-           fi
-       done
-    done
-}
-
-unload_drive_n_clean() {
-
-    #
-    # $1 is whether to clean it
-    #
-    cleanit=$1
-
-    #
-    # if the drive is ONLINE, mt unload it
-    #
-    if $MT -t $tapedev status | egrep "$ONLINEREGEX" >&2
-    then
-       $MT -t $tapedev offline >&2 || true
-    fi
-
-    #
-    # unload any tapes present, maybe load/unload a cleaning cartridge
-    #
-    for juke in $jlist
-    do
-       eval "jdlist=\"\$drives_in_$juke\""
-       for drive in $jdlist
-       do
-           juke unload -j $juke drive $drive >&2 || true
-           if juke list -j $juke drive $drive | grep '(empty)' >&2
-           then
-               :
-           else
-               echo "$slot $tapedev unable to empty preceding tape from drive $drive"
-               exit 1
-           fi
-
-           if $cleanit
-            then
-                juke load -j $juke drive $drive clean
-               sleep 120
-                juke unload -j $juke drive $drive
-            fi
-       done
-    done
-}
-
-load_drives() {
-    #
-    # load slots.  If it's a stripe, load several...
-    #
-    for juke in $jlist
-    do
-       eval "jdlist=\"\$drives_in_$juke\""
-       jndrives=`echo $jdlist | wc -w`
-       count=0
-       for drive in $jdlist
-       do
-           rslot=`expr $newslot '*' $jndrives + $count`
-           juke load -j $changerdev drive $drive slot $rslot >&2
-           if juke list -j $changerdev drive $drive | grep '(empty)' >&2
-           then
-               echo "$slot $tapedev unable to load tape into drive"
-               exit 1
-           fi
-           count=`expr $count + 1`
-       done
-    done
-
-    #
-    # wait for drive(s) to come online
-    #
-    count=0
-    until  $MT -t $tapedev status | egrep "$ONLINEREGEX" >&2
-    do
-       count=`expr $count + 1`
-       if [ $count -gt 24 ] 
-       then
-           echo "$slot $tapedev never came online"
-           exit 1
-       fi
-       sleep 5
-    done
-}
-
-
-ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$"
-
-#
-# get config variables
-#
-changerfile=`$getconf changerfile`
-    tapedev=`$getconf tapedev`
- changerdev=`$getconf changerdev`
-      dlist=`csh -c "echo $tapedev" | sed -e 's/rait://g' -e 's/tape://g'`
-    ndrives=`echo $dlist | wc -w`
-      jlist=`csh -c "echo $changerdev"`
-     njukes=`echo $jlist | wc -w`
- totalslots=`for juke in $jlist ; do juke list -j $juke; done | 
-               grep -v '^clean' | 
-               grep 'slot [0-9]' | 
-               wc -l`
-
-if [ $ndrives -gt 1 ]
-then
-   #
-   # if it's a 3 tape stripe and we have 30 actual slots
-   # we only have 10 virtual slots...
-   #
-   totalslots=`expr $totalslots / $ndrives`
-fi
-
-build_drivelists
-
-#
-# get current slot if we have one
-#
-if [ -f "$changerfile" ] 
-then
-    slot="`cat $changerfile`"
-else
-    slot=0
-    echo $slot > $changerfile
-fi
-
-#
-# We treat -reset just like -slot 0
-#
-if [ x$1 = 'x-reset' ]
-then
-    set : -slot 0
-    shift
-fi
-
-case x$1 in
-
-x-slot) 
-
-    #
-    # handle special slots...
-    #
-    case "$2" in
-    current)   newslot=$slot           ; load=true;;
-    next)      newslot=`expr $slot + 1`; load=true;;
-    advance)   newslot=`expr $slot + 1`; load=false;;
-    prev)      newslot=`expr $slot - 1`; load=true;;
-    first)     newslot=0               ; load=true;;
-    last)      newslot=-1              ; load=true;;
-    *)         newslot=$2              ; load=true;;
-    esac
-
-    if [ $newslot = "clean" ]
-    then
-       unload_drive_n_clean true
-    else 
-       if [ 0 -gt $newslot ]
-       then
-           newslot=`expr $totalslots - 1`
-       fi
-
-       if [ $totalslots -le  $newslot ]
-       then
-           newslot=0
-       fi
-
-       echo $newslot > $changerfile
-       slot=$newslot
-
-       if $load
-       then
-           unload_drive_n_clean false
-           load_drives
-       fi
-    fi
-
-    echo $slot $tapedev
-    ;;
-
-x-info)
-    echo $slot $totalslots 1
-    exit 0
-    ;;
-
-x-eject)
-    unload_drive_n_clean false
-    echo $slot $tapedev
-    ;;
-esac
-
-exit $rc
index 2df29bf0d1ab7b833f7ddfdd16da6395ade04166..7ed4e5a98a8b6cfacb4116ae8efa8482a67af44e 100644 (file)
@@ -17,53 +17,116 @@ MTF=@MT_FILE_FLAG@
 # No user-level customization should be required beyond this point.
 ################################################################################
 
-####
-# Set up paths, including PATH for finding amanda executables
-
-PATH="$PATH:@sbindir@:@libexecdir@"
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 sbindir="@sbindir@"
 libexecdir="@libexecdir@"
-
-####
-# Gettext
-
-#+
-# Function to:
-#    Simplify gettext usage by allowing printf format
-#    strings for translators, use _() identifier for
-#    xgettext extraction similar to "C" usage and
-#    collapsing "printf `gettext fmt` ...", which is
-#    used everywhere, into one function.
-#-
-_() {
-       fmt=`gettext -d amanda "$1"`
-       shift
-       printf "$fmt" $*
-}
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
 
 ####
 # Eponymous functions to access various amanda apps
+# TODO: move to amanda-sh-lib.sh
 
 if test "@USE_VERSION_SUFFIXES@" = "yes"; then
     amgetconf() {
         "${sbindir}/amgetconf-@VERSION@" "${@}"
     }
-    ammt() {
-        "${sbindir}/ammt-@VERSION@" "${@}"
-    }
-    amdd() {
-        "${sbindir}/amdd-@VERSION@" "${@}"
+    amdevcheck() {
+        "${sbindir}/amdevcheck-@VERSION@" "${@}"
     }
 else
     amgetconf() {
         "${sbindir}/amgetconf" "${@}"
     }
-    amdd() {
-        "${sbindir}/amdd" "${@}"
-    }
-    amdd() {
-        "${sbindir}/amdd" "${@}"
+    amdevcheck() {
+        "${sbindir}/amdevcheck" "${@}"
     }
 fi
+
+# This function tries to find a useable mt binary. If a fully-qualified path
+# was provided at configure time or via a config file, we check that it
+# exists and is executable. If an incomplete path was specified (e.g., "mt"),
+# we ask the shell to search the path. Returns 0 on success, 1 on failure.
+
+try_find_mt() {
+    # Only do this once.
+    if test -n $mt_found; then
+        return 0
+    fi
+
+    if test -z $MT; then
+        MT=mt
+    fi
+
+    if "`echo $MT | dd bs=1 count=1`" = "/"; then
+        if ! test -f "${MT}"; then
+            echo `_ "mt binary at '%s' not found" "$MTX"`
+            return 1
+        fi
+        if ! test -x "${MT}"; then
+            echo `_ "mt binary at '%s' is not executable" "$MTX"`
+            return 1
+        fi
+    else
+        # try running it to see if the shell can find it
+        "$MT" >/dev/null 2>/dev/null
+        if test $? -eq 127 -o $? -eq 126; then
+            echo `_ "Could not run mt binary at '%s'" "$MTX"`
+            return 1
+        fi
+    fi
+
+    mt_found=yes
+    return 0
+}
+
+# This function strips the tape: from the front of device names.
+# Capture its output with ``.
+tape_device_filename() {
+    # Easy (?) to express this in Perl.
+    perl -e '$ARGV[0] =~ /^(?:([^:]+):)?(.*)$/;
+             print $2 if ($1 || "tape") eq "tape"' "$1"
+}
+
+# Runs amdevcheck to find out if a particular device is usable. Finds the
+# config name based on pwd, so run it from the config directory. The sole
+# argument should be the device name to check. Note that amdevcheck can FP
+# on device status, since some devices can't differentiate between device
+# problems and an unlabeled volume.
+amdevcheck_status() {
+    amdevcheck_config_dir=`pwd`
+    amdevcheck_config_name=`basename $amdevcheck_config_dir`
+    amdevcheck_output=`amdevcheck $amdevcheck_config_name $@`
+
+    if test $? -eq 0 || \
+        echo $amdevcheck_output | grep UNLABELED > /dev/null; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+# This attempts to eject a device using whatever system tools are available.
+# At the moment, that means mt for tapes, and nothing otherwise, but might
+# be extended at some later time.
+
+try_eject_device() {
+    if echo "$1" | grep -e '^tape:' > /dev/null; then
+        try_eject_device_tape="`echo \"$1\" | cut -b6-`"
+    elif echo "$1" | grep -v : > /dev/null; then
+        try_eject_device_tape="$1"
+    else
+        try_eject_device_tape=
+    fi
+
+    if test -n "$try_eject_device_tape"; then
+        if try_find_mt; then
+            $MT $MTF "$try_eject_device_tape" eject
+        fi
+    else
+        # Technically we failed to eject the device, but we presume that's
+        # because it doesn't require ejection.
+        return 0
+    fi
+}
diff --git a/changer-src/chg-manual.sh b/changer-src/chg-manual.sh
new file mode 100644 (file)
index 0000000..d480de9
--- /dev/null
@@ -0,0 +1,323 @@
+#!@SHELL@ 
+#
+# Exit Status:
+# 0 Alles Ok
+# 1 Illegal Request
+# 2 Fatal Error
+#
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+amlibexecdir=@amlibexecdir@
+. ${amlibexecdir}/chg-lib.sh
+
+#
+#      Changer config file (changerfile)
+#
+#      resend_mail=900         # 15 minutes
+#      timeout_mail=604800     # 7 days
+#      request="tty"           # Use the tty to ask the user to change tape.
+#                              # Can't be use by cron
+#      request="email"         # Send an email to ask the user to change tape.
+#      request="tty_email"     # Use the tty if it exist or send an email.
+#                      #Default is "tty_email"
+#       mtx_binary="/path/to/mtx" # path of 'mtx'; default is value discovered by
+#                               # configure
+#
+#
+
+
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       logfile=@AMANDA_DBGDIR@/changer.debug
+else
+       logfile=/dev/null
+fi
+
+myname=$0
+
+EGREP='@EGREP@'
+
+if ! error=`try_find_mt`; then
+    echo <none> $error
+    exit 2
+fi
+
+MAILER=@MAILER@
+ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$"
+REPORTTO=`amgetconf mailto`
+tape=`amgetconf tapedev`
+
+if [ -z "$tape" ]; then
+  echo `_ '<none> tapedev not specified in amanda.conf.'`
+  exit 2
+fi
+
+ORG=`amgetconf ORG`
+
+firstslot=1
+lastslot=99
+resend_mail=900                # 15 minutes
+timeout_mail=604800    # 7 days
+
+changerfile=`amgetconf changerfile`
+
+conf_match=`expr "$changerfile" : .\*\.conf\$`
+if [ $conf_match -ge 6 ]; then
+        configfile=$changerfile
+        changerfile=`echo $changerfile | sed 's/.conf$//g'`
+else
+        configfile=$changerfile.conf
+fi
+
+cleanfile=$changerfile-clean
+accessfile=$changerfile-access
+slotfile=$changerfile-slot
+[ ! -f $cleanfile ] && echo 0 > $cleanfile
+[ ! -f $accessfile ] && echo 0 > $accessfile
+[ ! -f $slotfile ] && echo $firstslot > $slotfile
+cleancount=`cat $cleanfile`
+accesscount=`cat $accessfile`
+slot=`cat $slotfile`
+
+# define these functions early so that they can be overridden in changerfile.conf
+
+request_tty() {
+       if > /dev/tty; then
+               echo -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty
+               read ANSWER < /dev/tty
+       else
+               echo -n `_ 'no /dev/tty to ask to change tape'`
+               exit 1
+       fi
+}
+
+###
+# If $changerfile exists, source it into this script.  One reason is to
+# override the request() function above which gets called to request
+# that a tape be mounted.  Here is an alternate versions of request()
+# that does things more asynchronous:
+#
+request_email() {
+       # Send E-mail about the mount request and wait for the drive
+       # to go ready by checking the status once a minute.  Repeat
+       # the E-mail once an hour in case it gets lost.
+       timeout=0
+       gtimeout=$timeout_mail
+       while true;do
+           if [ $gtimeout -le 0 ]; then
+               echo -n `_ 'timeout waiting for tape online'`
+               exit 1;
+           fi
+           if [ $timeout -le 0 ]; then
+               msg=`_ 'insert Amanda tape into slot %s (%s)' "$1" "$tape"`
+               subject=`_ '%s AMANDA TAPE MOUNT REQUEST FOR SLOT %s' "$ORG" "$1"`
+               echo "$msg" | $MAILER -s "$subject" $REPORTTO
+               timeout=$resend_mail
+           fi
+            echo `_ '     -> status %s' "$tape"` >> $logfile
+            if amdevcheck_status $tape; then
+               break
+           fi
+           sleep 60
+           timeout=`expr $timeout - 60`
+           gtimeout=`expr $gtimeout - 60`
+       done
+}
+
+request_tty_email() {
+       if > /dev/tty; then
+               echo -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty
+               read ANSWER < /dev/tty
+       else
+               request_email "$1"
+       fi
+}
+
+request() {
+       if [ X"$request" = X"tty" ]; then
+               request_tty "$1"
+       else if [ X"$request" = X"email" ]; then
+               request_email "$1"
+       else
+               request_tty_email "$1"
+       fi
+       fi
+}
+
+# source the changer configuration file (see description, top of file)
+if [ -f $configfile ]; then
+       . $configfile
+fi
+
+# adjust MTX, if necessary
+test -n "${mtx_binary}" && MTX="${mtx_binary}"
+
+# check that MAILER is defined
+if test -z "$MAILER"; then
+    if test x"$request" = x"email" || test x"$request" = x"tty-email"; then
+       answer=`_ "<none> %s: Can't send email because MAILER is not defined" "$myname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
+    fi
+fi
+
+#
+
+eject() { 
+       echo `_ '     -> status %s' "$tape"` >> $logfile
+        if amdevcheck_status $tape; then
+           echo `_ '     -> offline %s' "$tape"` >> $logfile
+            try_eject_device $tape
+           answer="$slot $tape"
+           code=0
+       else
+           answer=`_ '<none> %s: Drive was not loaded' "$myname"`
+           code=1
+       fi
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit $code
+}
+
+#
+
+reset() {
+       echo `_ '     -> status %s' "$tape"` >> $logfile
+        if amdevcheck_status $tape; then
+               answer="$slot $tape"
+       else
+               answer="0 $tape"
+       fi
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+}
+
+# load #
+
+loadslot() {
+       echo `_ '     -> status %s' "$tape"` >> $logfile
+        # amdevcheck returns zero if the tape exists.
+        amdevcheck_status $tape;
+        tape_status=$?
+
+       whichslot=$1
+       case $whichslot in
+       current)
+               load=$slot
+               [ $load -eq 0 ] && load=$firstslot
+               [ $load -gt $lastslot ] && load=$firstslot
+               [ $load -lt $firstslot ] && load=$lastslot
+               ;;
+       next|advance)
+               load=`expr $slot + 1`
+               [ $load -gt $lastslot ] && load=$firstslot
+               ;;
+       prev)
+               load=`expr $slot - 1`
+               [ $load -lt $firstslot ] && load=$lastslot
+               ;;
+       first)
+               load=$firstslot
+               ;;
+       last)
+               load=$lastslot
+               ;;
+       [0-9]|[0-9][0-9])
+               if [ $1 -lt $firstslot -o $1 -gt $lastslot ]; then
+                       answer=`_ '<none> %s: slot must be %s .. %s' "$myname" "firstslot" "$lastslot"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 1
+               fi
+               load=$1
+               ;;
+       *)
+               answer=`_ '<none> %s: illegal slot: %s' "$myname" "$1"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+               ;;
+       esac
+       #
+       if [ $tape_status -eq 0 -a $load = $slot ];then
+               # already loaded
+               answer="$slot $tape"
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 0
+       fi
+
+       expr $accesscount + 1 > $accessfile
+
+       if [ $tape_status -eq 0 ]; then
+               echo `_ "     -> offline %s" "$tape"` >> $logfile
+                try_eject_device $tape
+               tape_status=1
+       fi
+       if [ $whichslot = advance ]; then
+               tape=/dev/null
+       else
+               echo `_ '     -> load   %s' "$load"` >> $logfile
+               while true; do
+                       request $load
+                       echo `_ '     -> status %s' "$tape"` >> $logfile
+                        if amdevcheck_status $tape; then
+                            break;
+                        fi
+               done
+       fi
+       echo $load > $slotfile
+       answer="$load $tape"
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+}
+
+#
+
+info() {
+       echo `_ '     -> status %s' "$tape"` >> $logfile
+        if amdevcheck_status $tape; then
+               answer="$slot $lastslot 1"
+       else
+               answer="0 $lastslot 1"
+       fi
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+}
+
+#
+# main part
+#
+
+echo `gettext "args ->"` "$@" >> $logfile
+while [ $# -ge 1 ];do
+       case $1 in
+       -slot)
+               shift
+               loadslot $*
+               ;;
+       -info)
+               shift
+               info
+               ;;
+       -reset)
+               shift
+               reset
+               ;;
+       -eject)
+               shift
+               eject
+               ;;
+       *)
+               fmt`gettext "<none> %s: Unknown option %s\n"`
+               printf $fmt $myname $1
+               exit 2
+               ;;
+       esac
+done
+
+exit 0
diff --git a/changer-src/chg-manual.sh.in b/changer-src/chg-manual.sh.in
deleted file mode 100644 (file)
index 1c45651..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-#!@SHELL@ 
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-# try to hit all the possibilities here
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-#
-#      Changer config file (changerfile)
-#
-#      resend_mail=900         # 15 minutes
-#      timeout_mail=604800     # 7 days
-#      request="tty"           # Use the tty to ask the user to change tape.
-#                              # Can't be use by cron
-#      request="email"         # Send an email to ask the user to change tape.
-#      request="tty_email"     # Use the tty if it exist or send an email.
-#                      #Default is "tty_email"
-#
-#
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-myname=$0
-
-EGREP='@EGREP@'
-
-if [ -x $sbindir/ammt$SUF ]; then
-       MT=$sbindir/ammt$SUF
-       MTF=-f
-elif [ -x "@MT@" ]; then
-       MT=@MT@
-       MTF=@MT_FILE_FLAG@
-else
-       answer="<none> $myname: mt program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-echo MT "->" $MT $MTF >> $logfile
-
-if [ -x $sbindir/amdd$SUF ]; then
-       DD=$sbindir/amdd$SUF
-elif [ -x "@DD@" ]; then
-       DD=@DD@
-else
-       answer="<none> $myname: dd program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-echo DD "->" $DD >> $logfile
-
-MAILER=@MAILER@
-ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$"
-REPORTTO=`amgetconf$SUF mailto`
-tape=`amgetconf$SUF tapedev`
-
-if [ -z "$tape" ]; then
-  echo "<none> tapedev not specified in amanda.conf."
-  exit 2
-fi
-
-ORG=`amgetconf$SUF ORG`
-
-firstslot=1
-lastslot=99
-resend_mail=900                # 15 minutes
-timeout_mail=604800    # 7 days
-
-changerfile=`amgetconf$SUF changerfile`
-
-conf_match=`expr "$changerfile" : .\*\.conf\$`
-if [ $conf_match -ge 6 ]; then
-        configfile=$changerfile
-        changerfile=`echo $changerfile | sed 's/.conf$//g'`
-else
-        configfile=$changerfile.conf
-fi
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-slotfile=$changerfile-slot
-[ ! -f $cleanfile ] && echo 0 > $cleanfile
-[ ! -f $accessfile ] && echo 0 > $accessfile
-[ ! -f $slotfile ] && echo $firstslot > $slotfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-slot=`cat $slotfile`
-
-request_tty() {
-       if > /dev/tty; then
-               echo -n "Insert tape into slot $1 and press return" > /dev/tty
-               read ANSWER < /dev/tty
-       else
-               echo "no /dev/tty to ask to change tape"
-               exit 1
-       fi
-}
-
-
-###
-# If $changerfile exists, source it into this script.  One reason is to
-# override the request() function above which gets called to request
-# that a tape be mounted.  Here is an alternate versions of request()
-# that does things more asynchronous:
-#
-request_email() {
-       # Send E-mail about the mount request and wait for the drive
-       # to go ready by checking the status once a minute.  Repeat
-       # the E-mail once an hour in case it gets lost.
-       timeout=0
-       gtimeout=$timeout_mail
-       while true;do
-               if [ $gtimeout -le 0 ]; then
-                       echo "timeout waiting for tape online"
-                       exit 1;
-               fi
-               if [ $timeout -le 0 ]; then
-                       msg="insert Amanda tape into slot $1 ($tape)"
-                       subject="$ORG AMANDA TAPE MOUNT REQUEST FOR SLOT $1"
-                       echo "$msg" | $MAILER -s "$subject" $REPORTTO
-                       timeout=$resend_mail
-               fi
-               echo "     -> rewind $tape" >> $logfile
-               $MT $MTF $tape rewind >> $logfile 2>&1
-               echo "     -> status $tape" >> $logfile
-               used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-               echo "     -> loaded <$used>" >> $logfile
-               if [ ! -z "$used" ];then
-               break
-               fi
-               sleep 60
-               timeout=`expr $timeout - 60`
-               gtimeout=`expr $gtimeout - 60`
-       done
-}
-request_tty_email() {
-       if > /dev/tty; then
-               echo -n "Insert tape into slot $1 and press return" > /dev/tty
-               read ANSWER < /dev/tty
-       else
-               request_email "$1"
-       fi
-}
-
-request() {
-       if [ X"$request" = X"tty" ]; then
-               request_tty "$1"
-       else if [ X"$request" = X"email" ]; then
-               request_email "$1"
-       else
-               request_tty_email "$1"
-       fi
-       fi
-}
-
-if [ -f $configfile ]; then
-       . $configfile
-fi
-
-#
-
-eject() { 
-       echo "     -> rewind $tape" >> $logfile
-       $MT $MTF $tape rewind >> $logfile 2>&1
-       echo "     -> status $tape" >> $logfile
-       used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-       echo "     -> loaded <$used>" >> $logfile
-       if [ ! -z "$used" ];then
-               echo "     -> offline $tape" >> $logfile
-               $MT $MTF $tape offline >> $logfile 2>&1
-               answer="$slot $tape"
-               code=0
-       else
-               answer="<none> $myname: Drive was not loaded"
-               code=1
-       fi
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-}
-
-#
-
-reset() {
-       echo "     -> rewind $tape" >> $logfile
-       $MT $MTF $tape rewind >> $logfile 2>&1
-       echo "     -> status $tape" >> $logfile
-       used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-       echo "     -> loaded <$used>" >> $logfile
-       if [ ! -z "$used" ];then
-               answer="$slot $tape"
-       else
-               answer="0 $tape"
-       fi
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit 0
-}
-
-# load #
-
-loadslot() {
-       echo "     -> rewind $tape" >> $logfile
-       $MT $MTF $tape rewind >> $logfile 2>&1
-       echo "     -> status $tape" >> $logfile
-       used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-       echo "     -> loaded <$used>" >> $logfile
-       whichslot=$1
-       case $whichslot in
-       current)
-               load=$slot
-               [ $load -eq 0 ] && load=$firstslot
-               [ $load -gt $lastslot ] && load=$firstslot
-               [ $load -lt $firstslot ] && load=$lastslot
-               ;;
-       next|advance)
-               load=`expr $slot + 1`
-               [ $load -gt $lastslot ] && load=$firstslot
-               ;;
-       prev)
-               load=`expr $slot - 1`
-               [ $load -lt $firstslot ] && load=$lastslot
-               ;;
-       first)
-               load=$firstslot
-               ;;
-       last)
-               load=$lastslot
-               ;;
-       [0-9]|[0-9][0-9])
-               if [ $1 -lt $firstslot -o $1 -gt $lastslot ]; then
-                       answer="<none> $myname: slot must be $firstslot .. $lastslot"
-                       echo "Exit -> $answer" >> $logfile
-                       echo "$answer"
-                       exit 1
-               fi
-               load=$1
-               ;;
-       *)
-               answer="<none> $myname: illegal slot: $1"
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit 1
-               ;;
-       esac
-       #
-       if [ ! -z "$used" -a $load = $slot ];then
-               # already loaded
-               answer="$slot $tape"
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit 0
-       fi
-
-       # if [ $load = $ecleanslot ]; then
-       # expr $cleancount + 1 > $cleanfile
-       # echo 0 > $accessfile
-       # else
-       expr $accesscount + 1 > $accessfile
-       # if [ $accesscount -gt 9 ]; then
-       # $myname -slot $cleanslot >/dev/null
-       # used=0
-       # fi
-       # fi    
-
-       #
-       if [ ! -z "$used" ]; then
-               echo "     -> offline $tape" >> $logfile
-               $MT $MTF $tape offline >> $logfile 2>&1
-               used=""
-       fi
-       if [ $whichslot = advance ]; then
-               tape=/dev/null
-       else
-               echo "     -> load   $load" >> $logfile
-               while [ -z "$used" ]; do
-                       request $load
-                       echo "     -> rewind $tape" >> $logfile
-                       $MT $MTF $tape rewind >> $logfile 2>&1
-                       echo "     -> status $tape" >> $logfile
-                       used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-                       echo "     -> loaded <$used>" >> $logfile
-               done
-               $DD if=$tape bs=32k count=1 >> $logfile 2>&1
-       fi
-       echo $load > $slotfile
-       answer="$load $tape"
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit 0
-}
-
-#
-
-info() {
-       echo "     -> rewind $tape" >> $logfile
-       $MT $MTF $tape rewind >> $logfile 2>&1
-       echo "     -> status $tape" >> $logfile
-       used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-       echo "     -> loaded <$used>" >> $logfile
-       if [ -z "$used" ];then
-               answer="0 $lastslot 1"
-       else
-               answer="$slot $lastslot 1"
-       fi
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit 0
-}
-
-#
-# main part
-#
-
-echo Args "->" "$@" >> $logfile
-while [ $# -ge 1 ];do
-       case $1 in
-       -slot)
-               shift
-               loadslot $*
-               ;;
-       -info)
-               shift
-               info
-               ;;
-       -reset)
-               shift
-               reset
-               ;;
-       -eject)
-               shift
-               eject
-               ;;
-       *)
-               echo "<none> $myname: Unknown option $1"
-               exit 2
-               ;;
-       esac
-done
-
-exit 0
diff --git a/changer-src/chg-mcutil.sh b/changer-src/chg-mcutil.sh
new file mode 100644 (file)
index 0000000..16b56f1
--- /dev/null
@@ -0,0 +1,578 @@
+#!@SHELL@ 
+#
+# Author: Robert Dege
+#
+#
+# version 1.2
+# -----------
+# fixed last_cleaned file so that if it doesn't exist, it gets created with current date, not '0,0'
+# fixed a bug that was reporting the wrong slot # to amcheck
+#
+# version 1.1
+# -----------
+# amverify was failing when using -slot current.  Fixed exit $code from 1 -> 0.
+# removed useless $current variables from movetape() function.
+#
+#
+#
+# Exit Status:
+# 0 Alles Ok
+# 1 Illegal Request
+# 2 Fatal Error
+#
+
+
+#
+# Set Path so that it includes Amanda binaries, and access to tapechanger & drive programs
+#
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+
+#
+# Define Suffix for amanda binaries
+#
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+        SUF="-@VERSION@"
+else
+        SUF=
+fi
+
+#
+# Load configuration data from the config file
+#
+
+ourconf=`amgetconf$SUF changerfile`
+myname=$0
+
+
+if [ ! -f "$ourconf" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+       echo `_ 'Exit(%s): %s not found as listed in amanda.conf' "$code" "$ourconf"` 1>&2
+        exit $code
+fi
+
+
+# grab mcutil info
+tmpval1=`grep ^mcutil $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^mcutil $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+       echo `_ 'Exit(%s): mcutil not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       MCUTIL=$tmpval2
+else
+       MCUTIL=$tmpval1
+fi
+
+
+# grab tape info
+tmpval1=`grep ^tape $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^tape $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+       echo `_ 'Exit(%s): tape not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       tape=$tmpval2
+else
+       tape=$tmpval1
+fi
+
+
+# grab firstslot info
+tmpval1=`grep ^firstslot $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^firstslot $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): firstslot not specified in %s' "$code" "$ourconf"` 1>&2
+        exit $code
+elif [ -z "$tmpval1" ]; then
+        firstslot=$tmpval2
+else
+        firstslot=$tmpval1
+fi
+
+
+# grab lastslot info
+tmpval1=`grep ^lastslot $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^lastslot $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): lastslot not specified in %s' "$code" "$ourconf"` 1>&2
+elif [ -z "$tmpval1" ]; then
+        lastslot=$tmpval2
+else
+        lastslot=$tmpval1
+fi
+
+
+# grab use_cleaning info
+tmpval1=`grep ^use_cleaning $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^use_cleaning $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): use_cleaning not specified in %s' "$code" "$ourconf"` 1>&2
+        exit $code
+elif [ -z "$tmpval1" ]; then
+        use_cleaning=$tmpval2
+else
+        use_cleaning=$tmpval1
+fi
+
+
+# grab cleanslot info
+tmpval1=`grep ^cleanslot $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^cleanslot $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): cleanslot not specified in %s' "$code" "$ourconf"` 1>&2
+        exit $code
+elif [ -z "$tmpval1" ]; then
+        cleanslot=$tmpval2
+else
+        cleanslot=$tmpval1
+fi
+
+
+# grab cleansleep info
+tmpval1=`grep ^cleansleep $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^cleansleep $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): cleansleep not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       cleansleep=$tmpval2
+else
+       cleansleep=$tmpval1
+fi
+
+
+# grab cleanme info
+tmpval1=`grep ^cleanme $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^cleanme $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): cleanme not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       cleanme=$tmpval2
+else
+       cleanme=$tmpval1
+fi
+
+
+# grab cleanfile info
+tmpval1=`grep ^cleanfile $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^cleanfile $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+        code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): cleanfile not specified in %s' "$code" "$ourconf"` 1>&2
+        exit $code
+elif [ -z "$tmpval1" ]; then
+        cleanfile=$tmpval2
+else
+        cleanfile=$tmpval1
+fi
+
+
+# grab lastfile info
+tmpval1=`grep ^lastfile $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^lastfile $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): lastfile not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       lastfile=$tmpval2
+else
+       lastfile=$tmpval1
+fi
+
+
+# grab currentslot info
+tmpval1=`grep ^currentslot $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^currentslot $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): currentslot not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       currentslot=$tmpval2
+else
+       currentslot=$tmpval1
+fi
+
+
+# grab logfile info
+tmpval1=`grep ^logfile $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^logfile $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): logfile not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       logfile=$tmpval2
+else
+       logfile=$tmpval1
+fi
+
+[ ! -w $logfile ] && logfile=/dev/null
+
+
+# grab slot0source info
+tmpval1=`grep ^slot0source $ourconf | awk -F\  '{print $2}'`
+tmpval2=`grep ^slot0source $ourconf | awk -F= '{print $2}'`
+if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
+       code=2
+        echo `_ 'Command Line ->'` $myname $@
+        echo `_ 'Exit(%s): slot0source not specified in %s' "$code" "$ourconf"` 1>&2
+       exit $code
+elif [ -z "$tmpval1" ]; then
+       slot0source=$tmpval2
+else
+       slot0source=$tmpval1
+fi
+
+
+
+#
+# Verify currentslot contains a value
+#
+if [ ! -f $currentslot ] || [ `cat $currentslot` -lt $firstslot ];then
+   readstatus
+   echo $used > $currentslot
+fi
+
+current=`cat $currentslot`
+
+
+# Start logging to $logfile
+echo "\n\n==== `date` ====" >> $logfile
+echo `_ 'Command Line ->'` $myname $@ >> $logfile
+
+
+#
+# is Use Cleaning activated?
+#
+if [ $use_cleaning -eq 1 ]; then
+   curday=`date +%j`
+   curyear=`date +%Y`
+
+   [ ! -f $cleanfile ] && echo 0 > $cleanfile
+   [ ! -f $lastfile ] && echo $curday,$curyear > $lastfile
+
+
+#
+# Check to see when tape drive was last cleaned
+# output warning message if it's been too long
+# Currently, if it's been more than 45days, then
+# an error message is displayed everytime the
+# script is called, until the clean parameter
+# is run
+#
+   cleaned=`cat $cleanfile`
+   lastcleaned=`cut -d, -f1 $lastfile`
+   yearcleaned=`cut -d, -f2 $lastfile`
+
+  if [ `expr $curday - $lastcleaned`  -lt 0 ];then
+     diffday=`expr $curday - $lastcleaned + 365`
+     diffyear=`expr $curyear - $yearcleaned - 1`
+  else
+     diffday=`expr $curday - $lastcleaned`
+     diffyear=`expr $curyear - $yearcleaned`
+  fi
+
+  if [ $diffday -gt $cleanme ] || [ $diffyear -ge 1 ];then
+     if [ $diffyear -ge 1 ];then
+         echo `_ "Warning, it's been %s year(s) & %s day(s) since you last cleaned the tape drive!" "$diffyear" "$diffday"`
+     else
+         echo `_ "Warning, it's been %s day(s) since you last cleaned the tape drive!" "$diffday"`
+     fi
+  fi
+
+fi
+
+
+#
+# Read if there is a tape in the tape drive
+# If so, determine what slot is the tape from
+#
+readstatus() {
+  echo `_ "querying tape drive....."` >> $logfile
+  used=`expr \`$MCUTIL -e drive | tr = \] | cut -d\] -f2\` - $slot0source`
+  echo `_ " Done"` >> $logfile
+
+  # Give changer a chance to reset itself
+  sleep 3
+}
+
+
+#
+# If tape is in the drive, eject it
+#
+eject() {
+  echo `_ "tape drive eject was called"` >> $logfile
+
+  readstatus 
+
+  if [ $used -ge $firstslot ];then
+    $MCUTIL -m drive slot:$used
+    code=$?
+  else
+    code=1
+  fi
+
+  if [ $code -eq 0 ];then
+    answer=`_ 'Cartridge %s successfully ejected from %s' "$used" "$tape"`
+    echo `_ "Exit(%s): %s" "$code" "$answer"` >> $logfile
+    echo $current $answer      #For amtape output  
+    return $code
+  elif [ $code -eq 1 ];then
+    answer=`_ "No Cartridge in Tape Drive"`
+    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+    echo $current $answer      #For amtape output
+    exit $code
+  else
+    answer=`_ 'Tape abnormally failed'`
+    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+    echo $current $answer      #For amtape output
+    exit $code
+  fi
+}
+
+
+#
+# reset tape drive to a current state.
+# This involves ejecting the current tape (if occupied)
+# and inserting the tape in $firstslot
+#
+reset() {
+  echo `_ 'tape drive reset was called'` >> $logfile
+
+  readstatus
+
+  if [ $used -ge $firstslot ];then
+     eject
+  fi
+
+  res=`$MCUTIL -m slot:$firstslot drive`
+  code=$?
+
+
+  if [ $code -eq 0 ];then
+    echo $firstslot > $currentslot
+    answer=`_ '%s - Tape drive was successfully reset' "$firstslot"`
+  elif [ $code -eq 1 ];then
+    answer=`_ '%s - Tape drive reset failed\nCommand -> %s' "$firstslot" "$res"`
+  else
+    code=2
+    answer=`_ '%s - Tape abnormally failed -> %s' "$firstslot" "$res"`
+  fi
+
+  echo `_ 'Exit(%s): slot %s' "$code" "$answer"` >> $logfile
+  echo $firstslot      #For amtape output 
+  exit $code
+}
+
+
+
+
+#
+# Load a specific cartridge into the changer
+#
+loadslot() {
+  echo `_ "loadslot was called"` >> $logfile
+
+  readstatus
+
+  whichslot=$1
+
+  case $whichslot in
+    current)
+       if [ $current -ge $firstslot ];then
+          load=$current
+       else
+          load=$used
+       fi
+
+       movetape
+       ;;
+    next|advance)
+         [ $used -lt $firstslot ] && used=$current
+
+         load=`expr $used + 1`
+         [ $load -gt $lastslot ] && load=$firstslot
+
+         if [ $whichslot = advance ];then
+            echo $load > $currentslot
+            code=0
+            answer=`_ 'advancing to slot %s' "$load"`
+            echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+            echo $load $code
+            exit $code
+         else
+            movetape
+         fi
+         ;;
+    prev)
+         [ $used -lt $firstslot ] && used=$current
+
+         load=`expr $used - 1`
+         [ $load -lt $firstslot ] && load=$lastslot
+         movetape
+         ;;
+    first)
+         load=$firstslot
+         movetape
+         ;;
+    last)
+         load=$lastslot
+         movetape
+         ;;
+    [$firstslot-$lastslot])
+            load=$1
+            movetape
+         ;;
+    clean)
+         if [ use_cleaning -eq 1 ];then
+            current=$cleanslot
+            eject
+            $MCUTIL slot:$cleanslot drive
+            sleep $cleansleep
+            echo "$curday,$curyear" > $lastfile
+            echo `expr $cleaned + 1` > $cleanfile
+            reset
+         else
+            code=1
+            answer=`_ "Cleaning not enabled in config"`
+            echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+            echo $cleanslot $answer
+            exit $code
+         fi
+         ;;
+    *)
+       code=1
+       answer=`_ '"%s" invalid menu option' "$whichslot"`
+       echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+       echo "$answer"
+       exit $code
+       ;;
+    esac
+}
+
+
+#
+# sub-function that slot calls to actually eject the tape
+# & load in the correct slot cartridge
+#
+movetape() {
+
+    # If the requested slot is already loaded in the tape drive
+    if [ $load -eq $used ]; then
+        code=0
+       answer=`_ 'slot %s is already loaded' "$load"`
+        echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+        echo $load $tape       # For amtape output
+        exit $code
+    elif [ $used -ge $firstslot ];then
+       current=$load
+       eject
+    else
+       echo $load $tape        # For amtape output
+    fi
+
+    echo `_ 'Loading slot %s into Tape drive' "$load"` >> $logfile
+    $MCUTIL -m  slot:$load drive
+    code=$?
+
+    if [ $code -eq 0 ];then
+       echo $load > $currentslot
+       answer=`_ 'Cartridge %s successfully loaded in Tape drive' "$load"`
+    else
+       answer=`_ 'Cartridge %s failed to load in Tape drive' "$load"`
+    fi
+    echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+    exit $code
+}
+
+
+info() {
+  echo `_ 'tape drive info was called'` >> $logfile
+
+  readstatus
+
+  if [ $used -lt 0 ];then
+    used=0
+  fi
+
+  code=0
+  answer="$used $lastslot 1"
+  echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile
+  echo "$answer"
+  exit $code
+}
+
+
+  case $1 in
+    -slot)
+          shift
+          loadslot $*
+          ;;
+    -device)
+          echo $tape
+          ;;
+    -info)
+           shift
+           info
+           ;;
+    -reset)
+           shift
+           reset
+           ;;
+    -eject)
+           shift
+           eject
+           ;;
+    --help|-help)
+           echo `_ '-slot {current|next|previous|first|last|%s-%s|clean}' "$firstslot" "$lastslot"`
+           echo `_ '   current  - show contents of current slot'`
+           echo `_ '   next     - load tape from next slot'`
+           echo `_ '   previous - load tape from previous slot'`
+           echo `_ '   first    - load tape from first slot'`
+           echo `_ '   last     - load tape from last slot'`
+           echo `_ '   %s - %s  - load tape from slot <slot #>' "$firstslot" "$lastslot"`
+           echo `_ '   clean    - Clean the drive'`
+           echo `_ '-device   : Show current tape device'`
+           echo `_ '-reset    : Reset changer to known state'`
+           echo `_ '-eject    : Eject current tape from drive'`
+           echo `_ '-info     : Output {current slot | # of slots | can changer go backwards}'`
+           echo `_ '-help     : Display this help'`
+           ;;
+    *)
+       echo `_ "<usage> %s -{slot|device|reset|eject|help}" "$myname"`
+       ;;
+ esac
diff --git a/changer-src/chg-mcutil.sh.in b/changer-src/chg-mcutil.sh.in
deleted file mode 100644 (file)
index d31201f..0000000
+++ /dev/null
@@ -1,564 +0,0 @@
-#!@SHELL@ 
-#
-# Author: Robert Dege
-#
-#
-# version 1.2
-# -----------
-# fixed last_cleaned file so that if it doesn't exist, it gets created with current date, not '0,0'
-# fixed a bug that was reporting the wrong slot # to amcheck
-#
-# version 1.1
-# -----------
-# amverify was failing when using -slot current.  Fixed exit $code from 1 -> 0.
-# removed useless $current variables from movetape() function.
-#
-#
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-
-#
-# Set Path so that it includes Amanda binaries, and access to tapechanger & drive programs
-#
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin
-export PATH
-
-
-#
-# Define Suffix for amanda binaries
-#
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-        SUF="-@VERSION@"
-else
-        SUF=
-fi
-
-
-#
-# Load configuration data from the config file
-#
-
-ourconf=`amgetconf$SUF changerfile`
-myname=$0
-
-
-if [ ! -f "$ourconf" ]; then
-        code=2
-        echo "Command Line -> $myname $@\nExit($code): $ourconf not found as listed in amanda.conf"
-        exit $code
-fi
-
-
-# grab mcutil info
-tmpval1=`grep ^mcutil $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^mcutil $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): mcutil not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       MCUTIL=$tmpval2
-else
-       MCUTIL=$tmpval1
-fi
-
-
-# grab tape info
-tmpval1=`grep ^tape $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^tape $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): tape not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       tape=$tmpval2
-else
-       tape=$tmpval1
-fi
-
-
-# grab firstslot info
-tmpval1=`grep ^firstslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^firstslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo "Command Line -> $myname $@ \nExit($code): firstslot not specified in $ourconf"
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        firstslot=$tmpval2
-else
-        firstslot=$tmpval1
-fi
-
-
-# grab lastslot info
-tmpval1=`grep ^lastslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^lastslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo "Command Line -> $myname $@ \nExit($code): lastslot not specified in $ourconf"
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        lastslot=$tmpval2
-else
-        lastslot=$tmpval1
-fi
-
-
-# grab use_cleaning info
-tmpval1=`grep ^use_cleaning $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^use_cleaning $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo "Command Line -> $myname $@ \nExit($code): use_cleaning not specified in $ourconf"
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        use_cleaning=$tmpval2
-else
-        use_cleaning=$tmpval1
-fi
-
-
-# grab cleanslot info
-tmpval1=`grep ^cleanslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo "Command Line -> $myname $@ \nExit($code): cleanslot not specified in $ourconf"
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        cleanslot=$tmpval2
-else
-        cleanslot=$tmpval1
-fi
-
-
-# grab cleansleep info
-tmpval1=`grep ^cleansleep $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleansleep $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): cleansleep not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       cleansleep=$tmpval2
-else
-       cleansleep=$tmpval1
-fi
-
-
-# grab cleanme info
-tmpval1=`grep ^cleanme $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanme $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): cleanme not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       cleanme=$tmpval2
-else
-       cleanme=$tmpval1
-fi
-
-
-# grab cleanfile info
-tmpval1=`grep ^cleanfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^cleanfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-        code=2
-        echo "Command Line -> $myname $@ \nExit($code): cleanfile not specified in $ourconf"
-        exit $code
-elif [ -z "$tmpval1" ]; then
-        cleanfile=$tmpval2
-else
-        cleanfile=$tmpval1
-fi
-
-
-# grab lastfile info
-tmpval1=`grep ^lastfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^lastfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): lastfile not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       lastfile=$tmpval2
-else
-       lastfile=$tmpval1
-fi
-
-
-# grab currentslot info
-tmpval1=`grep ^currentslot $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^currentslot $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): currentslot not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       currentslot=$tmpval2
-else
-       currentslot=$tmpval1
-fi
-
-
-# grab logfile info
-tmpval1=`grep ^logfile $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^logfile $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): logfile not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       logfile=$tmpval2
-else
-       logfile=$tmpval1
-fi
-
-[ ! -w $logfile ] && logfile=/dev/null
-
-
-# grab slot0source info
-tmpval1=`grep ^slot0source $ourconf | awk -F\  '{print $2}'`
-tmpval2=`grep ^slot0source $ourconf | awk -F= '{print $2}'`
-if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then
-       code=2
-       echo "Command Line -> $myname $@ \nExit($code): slot0source not specified in $ourconf"
-       exit $code
-elif [ -z "$tmpval1" ]; then
-       slot0source=$tmpval2
-else
-       slot0source=$tmpval1
-fi
-
-
-
-#
-# Verify currentslot contains a value
-#
-if [ ! -f $currentslot ] || [ `cat $currentslot` -lt $firstslot ];then
-   readstatus
-   echo $used > $currentslot
-fi
-
-current=`cat $currentslot`
-
-
-# Start logging to $logfile
-echo "\n\n==== `date` ====" >> $logfile
-echo "Command Line -> $myname $@" >> $logfile
-
-
-#
-# is Use Cleaning activated?
-#
-if [ $use_cleaning -eq 1 ]; then
-   curday=`date +%j`
-   curyear=`date +%Y`
-
-   [ ! -f $cleanfile ] && echo 0 > $cleanfile
-   [ ! -f $lastfile ] && echo $curday,$curyear > $lastfile
-
-
-#
-# Check to see when tape drive was last cleaned
-# output warning message if it's been too long
-# Currently, if it's been more than 45days, then
-# an error message is displayed everytime the
-# script is called, until the clean parameter
-# is run
-#
-   cleaned=`cat $cleanfile`
-   lastcleaned=`cut -d, -f1 $lastfile`
-   yearcleaned=`cut -d, -f2 $lastfile`
-
-  if [ `expr $curday - $lastcleaned`  -lt 0 ];then
-     diffday=`expr $curday - $lastcleaned + 365`
-     diffyear=`expr $curyear - $yearcleaned - 1`
-  else
-     diffday=`expr $curday - $lastcleaned`
-     diffyear=`expr $curyear - $yearcleaned`
-  fi
-
-  if [ $diffday -gt $cleanme ] || [ $diffyear -ge 1 ];then
-     if [ $diffyear -ge 1 ];then
-         echo "Warning, it's been $diffyear year(s) & $diffday days since you last cleaned the tape drive!"
-     else
-         echo "Warning, it's been $diffday days since you last cleaned the tape drive!"
-     fi
-  fi
-
-fi
-
-
-#
-# Read if there is a tape in the tape drive
-# If so, determine what slot is the tape from
-#
-readstatus() {
-  echo -n "querying tape drive....." >> $logfile
-  used=`expr \`$MCUTIL -e drive | tr = \] | cut -d\] -f2\` - $slot0source`
-  echo " Done" >> $logfile
-
-  # Give changer a chance to reset itself
-  sleep 3
-}
-
-
-#
-# If tape is in the drive, eject it
-#
-eject() {
-  echo "tape drive eject was called" >> $logfile
-
-  readstatus 
-
-  if [ $used -ge $firstslot ];then
-    $MCUTIL -m drive slot:$used
-    code=$?
-  else
-    code=1
-  fi
-
-  if [ $code -eq 0 ];then
-    answer="Cartridge $used successfully ejected from $tape"
-    echo "Exit($code): $answer" >> $logfile
-    echo $current $tape                #For amtape output  
-    return $code
-  elif [ $code -eq 1 ];then
-    answer="No Cartridge in Tape Drive"
-    echo "Exit($code): $answer" >> $logfile
-    echo $current $answer      #For amtape output
-    exit $code
-  else
-    answer="Tape abnormally failed"
-    echo "Exit($code): $answer" >> $logfile
-    echo $current $answer      #For amtape output
-    exit $code
-  fi
-}
-
-
-#
-# reset tape drive to a current state.
-# This involves ejecting the current tape (if occupied)
-# and inserting the tape in $firstslot
-#
-reset() {
-  echo "tape drive reset was called" >> $logfile
-
-  readstatus
-
-  if [ $used -ge $firstslot ];then
-     eject
-  fi
-
-  res=`$MCUTIL -m slot:$firstslot drive`
-  code=$?
-
-
-  if [ $code -eq 0 ];then
-    echo $firstslot > $currentslot
-    answer="$firstslot - Tape drive was successfully reset"
-  elif [ $code -eq 1 ];then
-    answer="$firstslot - Tape drive reset failed\nCommand -> $res"
-  else
-    code=2
-    answer="$firstlot - Tape abnormally failed -> $res"
-  fi
-
-  echo "Exit($code): slot $answer" >> $logfile
-  echo $firstslot      #For amtape output 
-  exit $code
-}
-
-
-
-
-#
-# Load a specific cartridge into the changer
-#
-loadslot() {
-  echo "loadslot was called" >> $logfile
-
-  readstatus
-
-  whichslot=$1
-
-  case $whichslot in
-    current)
-       if [ $current -ge $firstslot ];then
-          load=$current
-       else
-          load=$used
-       fi
-
-       movetape
-       ;;
-    next|advance)
-         [ $used -lt $firstslot ] && used=$current
-
-         load=`expr $used + 1`
-         [ $load -gt $lastslot ] && load=$firstslot
-
-         if [ $whichslot = advance ];then
-            echo $load > $currentslot
-            code=0
-            answer="advancing to slot $load"
-            echo "Exit($code): $answer" >> $logfile
-            echo $load $code
-            exit $code
-         else
-            movetape
-         fi
-         ;;
-    prev)
-         [ $used -lt $firstslot ] && used=$current
-
-         load=`expr $used - 1`
-         [ $load -lt $firstslot ] && load=$lastslot
-         movetape
-         ;;
-    first)
-         load=$firstslot
-         movetape
-         ;;
-    last)
-         load=$lastslot
-         movetape
-         ;;
-    [$firstslot-$lastslot])
-            load=$1
-            movetape
-         ;;
-    clean)
-         if [ use_cleaning -eq 1 ];then
-            current=$cleanslot
-            eject
-            $MCUTIL slot:$cleanslot drive
-            sleep $cleansleep
-            echo "$curday,$curyear" > $lastfile
-            echo `expr $cleaned + 1` > $cleanfile
-            reset
-         else
-            code=1
-            answer="Cleaning not enabled in config" >> $logfile
-            echo "Exit($code): $answer" >> $logfile
-            echo $cleanslot $answer
-            exit $code
-         fi
-         ;;
-    *)
-       code=1
-       answer="\"$whichslot\" invalid menu option"
-       echo "Exit($code): slot $answer" >> $logfile
-       echo "$answer"
-       exit $code
-       ;;
-    esac
-}
-
-
-#
-# sub-function that slot calls to actually eject the tape
-# & load in the correct slot cartridge
-#
-movetape() {
-
-    # If the requested slot is already loaded in the tape drive
-    if [ $load -eq $used ]; then
-        code=0
-       answer="$load is already loaded"
-        echo "Exit($code): slot $answer" >> $logfile
-        echo $load $tape       # For amtape output
-        exit $code
-    elif [ $used -ge $firstslot ];then
-       current=$load
-       eject
-    else
-       echo $load $tape        # For amtape output
-    fi
-
-    echo "Loading slot $load into Tape drive" >> $logfile
-    $MCUTIL -m  slot:$load drive
-    code=$?
-
-    if [ $code -eq 0 ];then
-       echo $load > $currentslot
-       answer="Cartridge $load successfully loaded in Tape drive"
-    else
-       answer="Cartridge $load failed to load in Tape drive"
-    fi
-       echo "Exit($code): $answer" >> $logfile
-       exit $code
-}
-
-
-info() {
-  echo "tape drive info was called" >> $logfile
-
-  readstatus
-
-  if [ $used -lt 0 ];then
-    used=0
-  fi
-
-  code=0
-  answer="$used $lastslot 1"
-  echo "Exit($code): $answer" >> $logfile
-  echo "$answer"
-  exit $code
-}
-
-
-  case $1 in
-    -slot)
-          shift
-          loadslot $*
-          ;;
-    -device)
-          echo $tape
-          ;;
-    -info)
-           shift
-           info
-           ;;
-    -reset)
-           shift
-           reset
-           ;;
-    -eject)
-           shift
-           eject
-           ;;
-    --help|-help)
-           echo "-slot {current|next|previous|first|last|$firstslot-$lastslot|clean}"
-           echo "      current  - show contents of current slot"
-           echo "      next     - load tape from next slot"
-           echo "      previous - load tape from previous slot"
-           echo "      first    - load tape from first slot"
-           echo "      last     - load tape from last slot"
-           echo "      $firstslot - $lastslot   - load tape from slot <slot #>"
-           echo "      clean    - Clean the drive"
-           echo "-device   : Show current tape device"
-           echo "-reset    : Reset changer to known state"
-           echo "-eject    : Eject current tape from drive"
-           echo "-info     : Output {current slot | # of slots | can changer go backwards}"
-           echo "-help     : Display this help"
-           ;;
-    *)
-       echo "<usage> $myname -{slot|device|reset|eject|help}"
-       ;;
- esac
diff --git a/changer-src/chg-mtx.sh b/changer-src/chg-mtx.sh
new file mode 100644 (file)
index 0000000..72ffe89
--- /dev/null
@@ -0,0 +1,243 @@
+#!@SHELL@ 
+#
+# Exit Status:
+# 0 Alles Ok
+# 1 Illegal Request
+# 2 Fatal Error
+#
+
+# source utility functions and values from configure
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+amlibexecdir=@amlibexecdir@
+. ${amlibexecdir}/chg-lib.sh
+
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       logfile=@AMANDA_DBGDIR@/changer.debug
+else
+       logfile=/dev/null
+fi
+
+myname=$0
+
+tape=`amgetconf tapedev`
+if [ -z "$tape" ]; then
+  echo "<none> tapedev not specified in amanda.conf";
+  exit 2;
+fi
+
+TAPE=`amgetconf changerdev`; export TAPE # for mtx command
+if [ -z "$TAPE" ]; then
+  echo "<none> changerdev not specified in amanda.conf";
+  exit 2;
+fi
+
+if [ "$tape" = "/dev/null" -o "$TAPE" = "/dev/null" ]; then
+  echo "<none> Both tapedev and changerdev must be specified in config file";
+  exit 2;
+fi
+
+firstslot=1
+lastslot=5
+# counted from 1 !!!
+cleanslot=6
+
+changerfile=`amgetconf changerfile`
+
+cleanfile=$changerfile-clean
+accessfile=$changerfile-access
+[ ! -f $cleanfile ] && echo 0 > $cleanfile
+[ ! -f $accessfile ] && echo 0 > $accessfile
+cleancount=`cat $cleanfile`
+accesscount=`cat $accessfile`
+#
+
+readstatus() {
+  used=`$MTX -s |
+    sed -n 's/Drive: No tape Loaded/-1/p;s/Drive: tape \(.\) loaded/\1/p'`
+
+  if [ -z "$used" ]; then
+    used="-1";
+  fi
+}
+
+
+eject() {
+  readstatus 
+  if [ $used -gt 0 ];then
+    $MTX -u $used
+    answer="0 $tape"
+    echo `_ 'Exit ->'` $answer >> $logfile
+    echo $answer
+    exit 0
+  else
+    answer=`_ '<none> %s: Drive was not loaded' "$myname"`     
+    echo `_ 'Exit ->'` $answer >> $logfile
+    echo $answer
+    exit 1
+  fi
+}
+
+reset() {
+  readstatus
+  if [ $used -gt 0 ];then
+    $MTX -u $used
+  fi
+  res=`$MTX -l 1`
+  if [ $? -eq 0 ];then
+    answer="1 $tape"
+    echo `_ 'Exit ->'` $answer >> $logfile
+    echo $answer
+    exit 0
+  else
+    answer="1 $res"
+    echo `_ 'Exit ->'` $answer >> $logfile
+    echo $answer
+    exit 1
+  fi
+}
+#
+#
+loadslot() {
+  readstatus
+  echo "     -> loaded $used" >> $logfile
+  whichslot=$1
+  case $whichslot in
+    current)
+            if [ $used -lt 0 ];then
+              $MTX -l 1
+              used=1
+            fi
+            answer="$used $tape"
+            echo `_ 'Exit ->'` $answer >> $logfile
+            echo $answer
+            exit 0
+            ;;
+    next|advance)
+         load=`expr $used + 1`
+         [ $load -gt $lastslot ] && load=$firstslot
+         ;;
+    prev)
+         load=`expr $used - 1`
+         [ $load -lt $firstslot ] && load=$lastslot
+         ;;
+    first)
+         load=$firstslot
+         ;;
+    last)
+         load=$lastslot
+         ;;
+    [$firstslot-$lastslot])
+         load=$1
+         ;;
+    clean)
+         load=$cleanslot
+         ;;
+    *)
+       answer=`_ '<none> %s: illegal request: "%s"' "$myname" "$whichslot"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
+       ;;
+    esac
+
+    if [ $load = $used ]; then
+        answer="$used $tape"
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+    fi
+
+    if [ $load = $cleanslot ]; then
+       expr $cleancount + 1 > $cleanfile
+       echo 0 > $accessfile
+    else
+       expr $accesscount + 1 > $accessfile
+       if [ $accesscount -gt 9 ]; then
+               $myname -slot clean >/dev/null
+       fi
+    fi
+
+    # Slot 6 might contain an ordinary tape rather than a cleaning
+    # tape. A cleaning tape auto-ejects; an ordinary tape does not.
+    # We therefore have to read the status again to check what
+    # actually happened.
+    readstatus
+       
+
+    if [ $used -gt 0 ];then
+      echo "     -> unload $used" >> $logfile
+      res=`$MTX -u $used`
+      status=$?
+      echo "     -> status $status" >> $logfile
+      echo "     -> res    $res" >> $logfile
+      if [ $status -ne 0 ];then
+        answer=`_ '<none> %s: %s' "$myname" "$res"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+      fi
+    fi
+    if [ $whichslot = advance ];then
+      answer="$load /dev/null"
+      echo `_ 'Exit ->'` $answer >> $logfile
+      echo $answer
+      exit 0
+    fi
+    echo `_ '     -> load   %s' "$load"` >> $logfile
+    res=`$MTX -l $load`
+    status=$?
+    echo `_ '     -> status %s' "$status"` >> $logfile
+    echo `_ '     -> result %s' "$res"` >> $logfile
+    if [ $status -eq 0 ];then
+      amdevcheck_status $tape
+      answer="$load $tape"
+      code=0
+    else
+      answer="$load $res"
+      code=2
+    fi
+    echo `_ 'Exit ->'` $answer >> $logfile
+    echo $answer
+    exit $code
+}
+#
+info() {
+  readstatus
+  echo "     -> info   $used" >> $logfile
+  if [ $used -lt 0 ];then
+    used=0
+  fi
+  answer="$used $lastslot 1"
+  echo `_ 'Exit ->'` $answer >> $logfile
+  echo $answer
+  exit 0
+}
+#
+echo Args "->" "$@" >> $logfile
+while [ $# -ge 1 ];do
+  case $1 in
+    -slot)
+          shift
+          loadslot $*
+          ;;
+    -info)
+          shift
+          info
+          ;;
+    -reset)
+           shift
+           reset
+           ;;
+    -eject)
+           shift
+           eject
+           ;;
+    *)
+       answer=`_ '<none> %s: Unknown option %s' "$myname" "$1"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+       ;;
+  esac
+done
diff --git a/changer-src/chg-mtx.sh.in b/changer-src/chg-mtx.sh.in
deleted file mode 100644 (file)
index 3c8086d..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-#!@SHELL@ 
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-# try to hit all the possibilities here
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin
-export PATH
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-myname=$0
-
-tape=`amgetconf$SUF tapedev`
-if [ -z "$tape" ]; then
-  echo "<none> tapedev not specified in amanda.conf";
-  exit 2;
-fi
-
-TAPE=`amgetconf$SUF changerdev`; export TAPE # for mtx command
-if [ -z "$TAPE" ]; then
-  echo "<none> changerdev not specified in amanda.conf";
-  exit 2;
-fi
-
-if [ "$tape" = "/dev/null" -o "$TAPE" = "/dev/null" ]; then
-  echo "<none> Both tapedev and changerdev must be specified in config file";
-  exit 2;
-fi
-
-MTX=@MTX@
-
-if [ -x $sbindir/ammt$SUF ]; then
-       MT=$sbindir/ammt$SUF
-       MTF=-f
-elif [ -x "@MT@" ]; then
-       MT=@MT@
-       MTF=@MT_FILE_FLAG@
-else
-       answer="<none> $myname: mt program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-echo MT "->" $MT $MTF >> $logfile
-
-if [ -x $sbindir/amdd$SUF ]; then
-       DD=$sbindir/amdd$SUF
-elif [ -x "@DD@" ]; then
-       DD=@DD@
-else
-       answer="<none> $myname: dd program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-fi
-echo DD "->" $DD >> $logfile
-
-firstslot=1
-lastslot=5
-# counted from 1 !!!
-cleanslot=6
-
-changerfile=`amgetconf$SUF changerfile`
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-[ ! -f $cleanfile ] && echo 0 > $cleanfile
-[ ! -f $accessfile ] && echo 0 > $accessfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-#
-
-readstatus() {
-  used=`$MTX -s |
-    sed -n 's/Drive: No tape Loaded/-1/p;s/Drive: tape \(.\) loaded/\1/p'`
-
-  if [ -z "$used" ]; then
-    used="-1";
-  fi
-}
-
-
-eject() {
-  readstatus 
-  if [ $used -gt 0 ];then
-    $MTX -u $used
-    answer="0 $tape"
-    code=0
-    echo "Exit -> $answer" >> $logfile
-    echo "$answer"
-    exit $code
-  else
-    answer="<none> $myname: Drive was not loaded"
-    code=1
-    echo "Exit -> $answer" >> $logfile
-    echo "$answer"
-    exit $code
-  fi
-}
-
-reset() {
-  readstatus
-  if [ $used -gt 0 ];then
-    $MTX -u $used
-  fi
-  res=`$MTX -l 1`
-  if [ $? -eq 0 ];then
-    answer="1 $tape"
-    code=0
-    echo "Exit -> $answer" >> $logfile
-    echo "$answer"
-    exit $code
-  else
-    answer="1 $res"
-    code=1
-    echo "Exit -> $answer" >> $logfile
-    echo "$answer"
-    exit $code
-  fi
-}
-#
-#
-loadslot() {
-  readstatus
-  echo "     -> loaded $used" >> $logfile
-  whichslot=$1
-  case $whichslot in
-    current)
-            if [ $used -lt 0 ];then
-              $MTX -l 1
-              used=1
-            fi
-            answer="$used $tape"
-            code=0
-            echo "Exit -> $answer" >> $logfile
-            echo "$answer"
-            exit $code
-            ;;
-    next|advance)
-         load=`expr $used + 1`
-         [ $load -gt $lastslot ] && load=$firstslot
-         ;;
-    prev)
-         load=`expr $used - 1`
-         [ $load -lt $firstslot ] && load=$lastslot
-         ;;
-    first)
-         load=$firstslot
-         ;;
-    last)
-         load=$lastslot
-         ;;
-    [$firstslot-$lastslot])
-         load=$1
-         ;;
-    clean)
-         load=$cleanslot
-         ;;
-    *)
-       answer="<none> $myname: illegal request: \"$whichslot\""
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-       ;;
-    esac
-
-    if [ $load = $used ]; then
-        answer="$used $tape"
-        code=0
-        echo "Exit -> $answer" >> $logfile
-        echo "$answer"
-        exit $code
-    fi
-
-    if [ $load = $cleanslot ]; then
-       expr $cleancount + 1 > $cleanfile
-       echo 0 > $accessfile
-    else
-       expr $accesscount + 1 > $accessfile
-       if [ $accesscount -gt 9 ]; then
-               $myname -slot clean >/dev/null
-       fi
-    fi
-
-    # Slot 6 might contain an ordinary tape rather than a cleaning
-    # tape. A cleaning tape auto-ejects; an ordinary tape does not.
-    # We therefore have to read the status again to check what
-    # actually happened.
-    readstatus
-       
-
-    if [ $used -gt 0 ];then
-      echo "     -> unload $used" >> $logfile
-      res=`$MTX -u $used`
-      status=$?
-      echo "     -> status $status" >> $logfile
-      echo "     -> res    $res" >> $logfile
-      if [ $status -ne 0 ];then
-        answer="<none> $myname: $res"
-        code=2
-        echo "Exit -> $answer" >> $logfile
-        echo "$answer"
-        exit $code
-      fi
-    fi
-    if [ $whichslot = advance ];then
-      answer="$load /dev/null"
-      code=0
-      echo "Exit -> $answer" >> $logfile
-      echo "$answer"
-      exit $code
-    fi
-    echo "     -> load   $load" >> $logfile
-    res=`$MTX -l $load`
-    status=$?
-    echo "     -> status $status" >> $logfile
-    echo "     -> res    $res" >> $logfile
-    if [ $status -eq 0 ];then
-      echo "     -> rew $load" >> $logfile
-      $MT $MTF $tape rewind
-      $DD if=$tape bs=32k count=1 >> $logfile 2>&1
-      answer="$load $tape"
-      code=0
-    else
-      answer="$load $res"
-      code=2
-    fi
-    echo "Exit -> $answer" >> $logfile
-    echo "$answer"
-    exit $code
-}
-#
-info() {
-  readstatus
-  echo "     -> info   $used" >> $logfile
-  if [ $used -lt 0 ];then
-    used=0
-  fi
-  answer="$used $lastslot 1"
-  code=0
-  echo "Exit -> $answer" >> $logfile
-  echo "$answer"
-  exit $code
-}
-#
-echo Args "->" "$@" >> $logfile
-while [ $# -ge 1 ];do
-  case $1 in
-    -slot)
-          shift
-          loadslot $*
-          ;;
-    -info)
-          shift
-          info
-          ;;
-    -reset)
-           shift
-           reset
-           ;;
-    -eject)
-           shift
-           eject
-           ;;
-    *)
-       answer="<none> $myname: Unknown option $1"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
-       ;;
-  esac
-done
diff --git a/changer-src/chg-multi.sh b/changer-src/chg-multi.sh
new file mode 100644 (file)
index 0000000..ddb5301
--- /dev/null
@@ -0,0 +1,421 @@
+#! @SHELL@
+#
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1991-1999 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: James da Silva, Systems Design and Analysis Group
+#                         Computer Science Department
+#                         University of Maryland at College Park
+#
+
+#
+# chg-multi.sh - generic tape changer script
+#
+
+# source utility functions and values from configure
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+amlibexecdir=@amlibexecdir@
+. ${amlibexecdir}/chg-lib.sh
+
+pname="chg-multi"
+
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       logfile=@AMANDA_DBGDIR@/changer.debug
+else
+       logfile=/dev/null
+fi
+
+echo `_ "arguments ->"` "$@" >> $logfile
+
+ourconf=`amgetconf changerfile`
+
+if ! error=try_find_mt; then
+    echo <none> $error
+    exit 2
+fi
+
+EXPR=expr
+# EXPR=/usr/local/bin/expr # in case you need a more powerful expr...
+
+# read in some config parameters
+
+if [ ! -f "$ourconf" ]; then
+       answer=`_ '<none> %s: %s does not exist' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$firstslot" ]; then
+       answer=`_ '<none> %s: firstslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$lastslot" ]; then
+       answer=`_ '<none> %s: lastslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+nslots=`$EXPR $lastslot - $firstslot + 1`
+
+gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$gravity" ]; then
+       answer=`_ '<none> %s: gravity not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$needeject" ]; then
+       answer=`_ '<none> %s: needeject not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$multieject" ]; then
+       echo `_ 'Note: setting multieject to a default of zero'` >> $logfile
+       multieject=0
+fi
+
+ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$ejectdelay" ]; then
+       echo `_ 'Note: setting ejectdelay to a default of zero'` >> $logfile
+       ejectdelay=0
+fi
+
+posteject=`awk '$1 == "posteject" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$posteject" ]; then
+       echo `_ 'Note: setting posteject to a default of "true"'` >> $logfile
+       posteject=true
+fi
+
+ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
+if [ -z "$ourstate" ]; then
+       answer=`_ '<none> %s: statefile not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+# needeject and multieject are incompatible
+if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then
+       answer=`_ '<none> %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+# read in state: only curslot and curloaded at the present time
+
+curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null`
+if [ -z "$curslot" ]; then
+       curslot=$firstslot
+fi
+
+curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null`
+if [ -z "$curloaded" ]; then
+       curloaded=0
+fi
+
+
+# process the command-line
+
+# control vars to avoid code duplication: not all shells have functions!
+usage=0
+checkgravity=0
+ejectslot=0
+loadslot=0
+slotempty=0
+ejectonly=0
+
+if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi
+
+case "$command" in
+
+-info) # return basic information about changer
+
+       backwards=`$EXPR 1 - $gravity`
+       answer="$curslot $nslots $backwards"
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
+       ;;
+
+-reset) # reset changer. Actually, we only reset changer state. We
+       # trust that the operator has reloaded a stack and reset the
+       # hardware. In most cases, we do not want to actually do
+       # anything: if the operator has done something with the
+       # hardware, we have no way to know what the actual current
+       # slot is. If the hardware state has not changed, and what is
+       # really wanted is to load the first slot, use "slot first"
+       # instead 
+
+       checkgravity=0
+       loadslot=1
+       newslot=$firstslot
+       curslot=$firstslot
+       # XXX put changer-specific reset here, if applicable
+       ;;
+
+-eject) # eject tape if loaded. Note that if multieject is set, this
+        # only can make sense if the position is last and gravity 1
+
+       checkgravity=0
+       loadslot=0
+       newslot=$curslot
+       ejectslot=1
+       ejectonly=1
+       if [ $multieject -eq 1 ] && \
+           ([ $gravity -eq 0 ] || [ $curslot -ne $lastslot ]) ; then 
+               # Can't do this: if we eject, the stacker is going to
+               # load the next tape, and our state will be botched
+               answer=`_ '%s %s: Cannot use -eject with multieject/nogravity/notlastslot' "$curslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+       fi    
+       if [ $curloaded -eq 0 ]; then
+               answer=`_ '%s %s: slot already empty' "$curslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+       fi
+       ;;
+
+-slot) # change to slot
+
+       checkgravity=1
+       loadslot=1
+
+       slotparm=$2
+       case "$slotparm" in
+       [0-9]*) 
+               newslot=$slotparm
+               if [ $newslot -gt $lastslot ] || \
+                    [ $newslot -lt $firstslot ] ; then
+                       answer=`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 1
+               fi
+               ;;
+       current)
+               newslot=$curslot
+               ;;
+       first)
+               newslot=$firstslot
+               ;;
+       last)
+               newslot=$lastslot
+               ;;
+       next|advance)
+               newslot=`$EXPR $curslot + 1`
+               if [ $newslot -gt $lastslot ]; then
+                       newslot=$firstslot
+               fi
+               if [ $slotparm = advance ]; then
+                       loadslot=0
+               fi
+               ;;
+       prev)
+               newslot=`$EXPR $curslot - 1`
+               if [ $newslot -lt $firstslot ]; then
+                       newslot=$lastslot
+               fi
+               ;;
+       *)
+               answer=`_ '<none> %s: bad slot name "%s"' "$pname" "$slotparm"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+               ;;
+       esac
+       ;;
+*)
+       usage=1
+       ;;
+esac
+
+
+if [ $usage -eq 1 ]; then
+       answer=`_ '<none> usage: %s {-reset | -slot [<slot-number>|current|next|prev|advance] | -info | -eject}' "$pname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
+fi
+
+
+# check for legal move
+
+if [ $checkgravity -eq 1 ] && [ $gravity -ne 0 ] ; then
+       if [ $newslot -lt $curslot ] || [ "$slotparm" = "prev" ] ; then
+               answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
+       fi
+fi
+
+# Do the 'mt offline' style of stacker control if applicable
+if [ $multieject -eq 1 ] && [ $loadslot -eq 1 ] && [ $newslot -ne $curslot ]
+then
+       # XXX put changer-specific load command here, if applicable
+
+       curloaded=0             # unless something goes wrong
+       slotempty=0
+
+       while [ $curslot -ne $newslot ]; do
+           device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
+           if [ "$device" = "" ]; then
+               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+           fi
+           echo `_ '     -> offline'` "$device" >> $logfile
+            if ! try_eject_device $device; then
+               answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+           fi
+           [ $ejectdelay -gt 0 ] && sleep $ejectdelay
+           echo `_ '     -> running'` $posteject $device >> $logfile
+           $posteject $device >> $logfile 2>&1
+           status=$?
+           if [ $status -ne 0 ]; then
+               answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+           fi
+           curslot=`$EXPR $curslot + 1`
+           if [ $curslot -gt $lastslot ] ; then
+               curslot=$firstslot
+           fi
+       done
+fi
+
+if [ $ejectonly -eq 1 ] \
+     || ([ $needeject -eq 1 ] \
+           && [ $loadslot -eq 1 ] \
+           && [ $curloaded -eq 1 ] \
+           && [ $newslot -ne $curslot ])
+then
+       # XXX put changer-specific load command here, if applicable
+
+       curloaded=0             # unless something goes wrong
+       slotempty=0
+
+       # try to unload the current device
+       device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
+       if [ "$device" = "" ]; then
+               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       fi
+       echo `_ '     -> offline'` $device >> $logfile
+        try_eject_device $device
+       if [ $? -ne 0 ]; then
+               #
+               # XXX if the changer-specific eject command can distinguish
+               # betweeen "slot empty" and more serious errors, return 1
+               # for the first case, 2 for the second case.  Generically,
+               # we just presume an error signifies an empty slot.
+               #
+               slotempty=1
+       else
+               [ $ejectonly -eq 0 ] && [ $ejectdelay -gt 0 ] && sleep $ejectdelay
+               echo `_ '     -> running '` $posteject $device >> $logfile
+               $posteject $device >> $logfile 2>&1
+               status=$?
+               if [ $status -ne 0 ]; then
+                       answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 2
+               fi
+       fi
+fi
+
+if [ $loadslot -eq 1 ]; then   # load the tape from the slot
+
+       # XXX put changer-specific load command here, if applicable
+
+       curloaded=1             # unless something goes wrong
+       slotempty=0
+       curslot=$newslot
+
+       # try to rewind the device
+       device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
+       if [ "$device" = "" ]; then
+               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
+       fi
+        amdevcheck_status $device
+       if [ $? -ne 0 ]; then
+               #
+               # XXX if the changer-specific load command can distinguish
+               # betweeen "slot empty" and more serious errors, return 1
+               # for the first case, 2 for the second case.  Generically,
+               # we just presume an error signifies an empty slot.
+               #
+               slotempty=1
+               curloaded=0
+       fi
+fi
+
+# update state
+
+echo `_ '# multi-changer state cache: DO NOT EDIT!'` >  $ourstate
+echo curslot $newslot                           >> $ourstate
+echo curloaded $curloaded                       >> $ourstate
+
+# return slot info
+
+if [ $slotempty -eq 1 ]; then
+       answer=`_ '%s %s: slot is empty' "$newslot" "$pname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
+fi
+
+if [ "$command" = -slot -a "$slotparm" = advance ]; then
+       device=/dev/null
+fi
+
+answer="$newslot $device"
+echo `_ 'Exit ->'` $answer >> $logfile
+echo $answer
+exit 0
diff --git a/changer-src/chg-multi.sh.in b/changer-src/chg-multi.sh.in
deleted file mode 100644 (file)
index 0eea3e9..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-#! @SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1999 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# chg-multi.sh - generic tape changer script
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-pname="chg-multi"
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       logfile=@AMANDA_DBGDIR@/changer.debug
-else
-       logfile=/dev/null
-fi
-
-# support simultaneous development with and without gettext
-_() {
-        fmt="$1"
-        shift
-        printf "$fmt" $*
-}
-
-echo `_ "arguments ->"` "$@" >> $logfile
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-ourconf=`amgetconf$SUF changerfile`
-
-if [ -x $sbindir/ammt$SUF ]; then
-       MT=$sbindir/ammt$SUF
-       MTF=-f
-elif [ -x "@MT@" ]; then
-       MT=@MT@
-       MTF=@MT_FILE_FLAG@
-else
-       answer=`_ '<none> %s: mt program not found' "$myname"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 1
-fi
-echo "MT ->" $MT $MTF >> $logfile
-
-EXPR=expr
-# EXPR=/usr/local/bin/expr # in case you need a more powerful expr...
-
-# read in some config parameters
-
-if [ ! -f "$ourconf" ]; then
-       answer=`_ '<none> %s: %s does not exist' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$firstslot" ]; then
-       answer=`_ '<none> %s: firstslot not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$lastslot" ]; then
-       answer=`_ '<none> %s: lastslot not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-nslots=`$EXPR $lastslot - $firstslot + 1`
-
-gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$gravity" ]; then
-       answer=`_ '<none> %s: gravity not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$needeject" ]; then
-       answer=`_ '<none> %s: needeject not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$multieject" ]; then
-       echo `_ 'Note: setting multieject to a default of zero'` >> $logfile
-       multieject=0
-fi
-
-ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$ejectdelay" ]; then
-       echo `_ 'Note: setting ejectdelay to a default of zero'` >> $logfile
-       ejectdelay=0
-fi
-
-posteject=`awk '$1 == "posteject" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$posteject" ]; then
-       echo `_ 'Note: setting posteject to a default of "true"'` >> $logfile
-       posteject=true
-fi
-
-ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
-if [ -z "$ourstate" ]; then
-       answer=`_ '<none> %s: statefile not specified in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-# needeject and multieject are incompatible
-if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then
-       answer=`_ '<none> %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-# read in state: only curslot and curloaded at the present time
-
-curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null`
-if [ -z "$curslot" ]; then
-       curslot=$firstslot
-fi
-
-curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null`
-if [ -z "$curloaded" ]; then
-       curloaded=0
-fi
-
-
-# process the command-line
-
-# control vars to avoid code duplication: not all shells have functions!
-usage=0
-checkgravity=0
-ejectslot=0
-loadslot=0
-slotempty=0
-ejectonly=0
-
-if [ $# -ge 1 ]; then command=$1; else command="-usage"; fi
-
-case "$command" in
-
--info) # return basic information about changer
-
-       backwards=`$EXPR 1 - $gravity`
-       answer="$curslot $nslots $backwards"
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 0
-       ;;
-
--reset) # reset changer. Actually, we only reset changer state. We
-       # trust that the operator has reloaded a stack and reset the
-       # hardware. In most cases, we do not want to actually do
-       # anything: if the operator has done something with the
-       # hardware, we have no way to know what the actual current
-       # slot is. If the hardware state has not changed, and what is
-       # really wanted is to load the first slot, use "slot first"
-       # instead 
-
-       checkgravity=0
-       loadslot=1
-       newslot=$firstslot
-       curslot=$firstslot
-       # XXX put changer-specific reset here, if applicable
-       ;;
-
--eject) # eject tape if loaded. Note that if multieject is set, this
-        # only can make sense if the position is last and gravity 1
-
-       checkgravity=0
-       loadslot=0
-       newslot=$curslot
-       ejectslot=1
-       ejectonly=1
-       if [ $multieject -eq 1 ] && \
-           ([ $gravity -eq 0 ] || [ $curslot -ne $lastslot ]) ; then 
-               # Can't do this: if we eject, the stacker is going to
-               # load the next tape, and our state will be botched
-               answer=`_ '%s %s: Cannot use -eject with multieject/nogravity/notlastslot' "$curslot" "$pname"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-       fi    
-       if [ $curloaded -eq 0 ]; then
-               answer=`_ '%s %s: slot already empty' "$curslot" "$pname"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-       fi
-       ;;
-
--slot) # change to slot
-
-       checkgravity=1
-       loadslot=1
-
-       slotparm=$2
-       case "$slotparm" in
-       [0-9]*) 
-               newslot=$slotparm
-               if [ $newslot -gt $lastslot ] || \
-                    [ $newslot -lt $firstslot ] ; then
-                       answer=`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"`
-                       echo `_ 'Exit ->'` $answer >> $logfile
-                       echo $answer
-                       exit 1
-               fi
-               ;;
-       current)
-               newslot=$curslot
-               ;;
-       first)
-               newslot=$firstslot
-               ;;
-       last)
-               newslot=$lastslot
-               ;;
-       next|advance)
-               newslot=`$EXPR $curslot + 1`
-               if [ $newslot -gt $lastslot ]; then
-                       newslot=$firstslot
-               fi
-               if [ $slotparm = advance ]; then
-                       loadslot=0
-               fi
-               ;;
-       prev)
-               newslot=`$EXPR $curslot - 1`
-               if [ $newslot -lt $firstslot ]; then
-                       newslot=$lastslot
-               fi
-               ;;
-       *)
-               answer=`_ '<none> %s: bad slot name "%s"' "$pname" "$slotparm"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-               ;;
-       esac
-       ;;
-*)
-       usage=1
-       ;;
-esac
-
-
-if [ $usage -eq 1 ]; then
-       answer=`_ '<none> usage: %s {-reset | -slot [<slot-number>|current|next|prev|advance] | -info | -eject}' "$pname"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 2
-fi
-
-
-# check for legal move
-
-if [ $checkgravity -eq 1 ] && [ $gravity -ne 0 ] ; then
-       if [ $newslot -lt $curslot ] || [ "$slotparm" = "prev" ] ; then
-               answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 1
-       fi
-fi
-
-# Do the 'mt offline' style of stacker control if applicable
-if [ $multieject -eq 1 ] && [ $loadslot -eq 1 ] && [ $newslot -ne $curslot ]
-then
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=0             # unless something goes wrong
-       slotempty=0
-
-       while [ $curslot -ne $newslot ]; do
-           device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
-           if [ "$device" = "" ]; then
-               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-           fi
-           echo `_ '     -> offline'` "$device"` >> $logfile
-           $MT $MTF $device offline >> $logfile 2>&1
-           if [ $? -ne 0 ]; then
-               answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-           fi
-           [ $ejectdelay -gt 0 ] && sleep $ejectdelay
-           echo `_ '     -> running'` $posteject $device >> $logfile
-           $posteject $device >> $logfile 2>&1
-           status=$?
-           if [ $status -ne 0 ]; then
-               answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-           fi
-           curslot=`$EXPR $curslot + 1`
-           if [ $curslot -gt $lastslot ] ; then
-               curslot=$firstslot
-           fi
-       done
-fi
-
-if [ $ejectonly -eq 1 ] \
-     || ([ $needeject -eq 1 ] \
-           && [ $loadslot -eq 1 ] \
-           && [ $curloaded -eq 1 ] \
-           && [ $newslot -ne $curslot ])
-then
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=0             # unless something goes wrong
-       slotempty=0
-
-       # try to unload the current device
-       device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
-       if [ "$device" = "" ]; then
-               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       fi
-       echo `_ '     -> offline'` $device >> $logfile
-       $MT $MTF $device offline >> $logfile 2>&1
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific eject command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               slotempty=1
-       else
-               [ $ejectonly -eq 0 ] && [ $ejectdelay -gt 0 ] && sleep $ejectdelay
-               echo `_ '     -> running '` $posteject $device >> $logfile
-               $posteject $device >> $logfile 2>&1
-               status=$?
-               if [ $status -ne 0 ]; then
-                       answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
-                       echo `_ 'Exit ->'` $answer >> $logfile
-                       echo $answer
-                       exit 2
-               fi
-       fi
-fi
-
-if [ $loadslot -eq 1 ]; then   # load the tape from the slot
-
-       # XXX put changer-specific load command here, if applicable
-
-       curloaded=1             # unless something goes wrong
-       slotempty=0
-       curslot=$newslot
-
-       # try to rewind the device
-       device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
-       if [ "$device" = "" ]; then
-               answer=`_ "%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
-               echo `_ 'Exit ->'` $answer >> $logfile
-               echo $answer
-               exit 2
-       fi
-       echo `_ '     -> rewind'` $device >> $logfile
-       $MT $MTF $device rewind >> $logfile 2>&1
-       if [ $? -ne 0 ]; then
-               #
-               # XXX if the changer-specific load command can distinguish
-               # betweeen "slot empty" and more serious errors, return 1
-               # for the first case, 2 for the second case.  Generically,
-               # we just presume an error signifies an empty slot.
-               #
-               slotempty=1
-               curloaded=0
-       fi
-fi
-
-# update state
-
-echo `_ '# multi-changer state cache: DO NOT EDIT!'` >  $ourstate
-echo curslot $newslot                           >> $ourstate
-echo curloaded $curloaded                       >> $ourstate
-
-# return slot info
-
-if [ $slotempty -eq 1 ]; then
-       answer=`_ '%s %s: slot is empty' "$newslot" "$pname"`
-       echo `_ 'Exit ->'` $answer >> $logfile
-       echo $answer
-       exit 1
-fi
-
-if [ "$command" = -slot -a "$slotparm" = advance ]; then
-       device=/dev/null
-fi
-
-answer="$newslot $device"
-echo `_ 'Exit ->'` $answer >> $logfile
-echo $answer
-exit 0
diff --git a/changer-src/chg-null.sh b/changer-src/chg-null.sh
new file mode 100644 (file)
index 0000000..2f9a90c
--- /dev/null
@@ -0,0 +1,101 @@
+#!@SHELL@ 
+#
+# Exit Status:
+# 0 Alles Ok
+# 1 Illegal Request
+# 2 Fatal Error
+#
+
+# try to hit all the possibilities here
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+debugdir=@AMANDA_DBGDIR@
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+if [ -d "$debugdir" ]
+then
+       logfile=$debugdir/changer.debug
+else
+       logfile=/dev/null
+fi
+exec 2> $logfile
+set -x
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+myname=$0
+
+EGREP='@EGREP@'
+
+firstslot=1
+totalslots=200
+
+changerfile=`amgetconf$SUF changerfile`
+
+tapedev="null:/dev/xxx$$"
+
+cleanfile=$changerfile-clean
+accessfile=$changerfile-access
+slotfile=$changerfile-slot
+[ ! -f $cleanfile ] && echo 0 > $cleanfile
+[ ! -f $accessfile ] && echo 0 > $accessfile
+[ ! -f $slotfile ] && echo $firstslot > $slotfile
+cleancount=`cat $cleanfile`
+accesscount=`cat $accessfile`
+slot=`cat $slotfile`
+
+rc=0
+
+case x$1 in
+
+x-slot) 
+
+    #
+    # handle special slots...
+    #
+    case "$2" in
+    current)   newslot=$slot           ; load=true;;
+    next)      newslot=`expr $slot + 1`; load=true;;
+    advance)   newslot=`expr $slot + 1`; load=false;;
+    prev)      newslot=`expr $slot - 1`; load=true;;
+    first)     newslot=0               ; load=true;;
+    last)      newslot=-1              ; load=true;;
+    *)         newslot=$2              ; load=true;;
+    esac
+
+    if [ 0 -gt $newslot ]
+    then
+       newslot=`expr $totalslots - 1`
+    fi
+
+    if [ $totalslots -le  $newslot ]
+    then
+       newslot=0
+    fi
+    echo $newslot > $changerfile-slot
+    slot=$newslot
+    echo $slot $tapedev
+    ;;
+
+x-info)
+    echo $slot $totalslots 1
+    ;;
+
+x-eject)
+    echo $slot $tapedev
+    ;;
+esac
+
+exit $rc
diff --git a/changer-src/chg-null.sh.in b/changer-src/chg-null.sh.in
deleted file mode 100644 (file)
index 60683c7..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#!@SHELL@ 
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-
-# try to hit all the possibilities here
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-debugdir=@AMANDA_DEBUGDIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-if [ -d "$debugdir" ]
-then
-       logfile=$debugdir/changer.debug
-else
-       logfile=/dev/null
-fi
-exec 2> $logfile
-set -x
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-myname=$0
-
-EGREP='@EGREP@'
-
-firstslot=1
-totalslots=200
-
-changerfile=`amgetconf$SUF changerfile`
-
-tapedev="null:/dev/xxx$$"
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-slotfile=$changerfile-slot
-[ ! -f $cleanfile ] && echo 0 > $cleanfile
-[ ! -f $accessfile ] && echo 0 > $accessfile
-[ ! -f $slotfile ] && echo $firstslot > $slotfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-slot=`cat $slotfile`
-
-rc=0
-
-case x$1 in
-
-x-slot) 
-
-    #
-    # handle special slots...
-    #
-    case "$2" in
-    current)   newslot=$slot           ; load=true;;
-    next)      newslot=`expr $slot + 1`; load=true;;
-    advance)   newslot=`expr $slot + 1`; load=false;;
-    prev)      newslot=`expr $slot - 1`; load=true;;
-    first)     newslot=0               ; load=true;;
-    last)      newslot=-1              ; load=true;;
-    *)         newslot=$2              ; load=true;;
-    esac
-
-    if [ 0 -gt $newslot ]
-    then
-       newslot=`expr $totalslots - 1`
-    fi
-
-    if [ $totalslots -le  $newslot ]
-    then
-       newslot=0
-    fi
-    echo $newslot > $changerfile-slot
-    slot=$newslot
-    echo $slot $tapedev
-    ;;
-
-x-info)
-    echo $slot $totalslots 1
-    ;;
-
-x-eject)
-    echo $slot $tapedev
-    ;;
-esac
-
-exit $rc
diff --git a/changer-src/chg-rait.sh b/changer-src/chg-rait.sh
new file mode 100644 (file)
index 0000000..757661f
--- /dev/null
@@ -0,0 +1,217 @@
+#!@SHELL@
+
+# chg-rait
+#
+# This assumes we have rait-striped drives in several
+# other amanda changer configs.
+#
+# so we have a changerfile that lists other changers and
+# changer files.
+#   nchangers=3
+#   tpchanger_1="chg-mtx"
+#   changerdev_1="/dev/mtx1"
+#   changerfile_1="/some/file1"
+#   tapedev_1="/some/dev"
+#   tpchanger_2="chg-mtx"
+#   changerdev_2="/dev/mtx2"
+#   changerfile_2="/some/file2"
+#   tapedev_2="/some/dev"
+#   tpchanger_3="chg-mtx"
+#   changerdev_3="/dev/mtx3"
+#   changerfile_3="/some/file3"
+#   tapedev_3="/some/dev"
+#
+# the tapedev_n entries are only needed if the changer script in question
+# uses tapedev.
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH 
+
+#
+# debugging...
+#
+if [ -d "@AMANDA_DBGDIR@" ]; then
+       DBGFILE=@AMANDA_DBGDIR@/rait-changer.debug
+       KIDDEBUG=@AMANDA_DBGDIR@/changer.debug
+       WORK=@AMANDA_DBGDIR@/chgwork$$
+else
+       DBGFILE=/dev/null
+       KIDDEBUG=/dev/null
+       WORK=/tmp/chgwork$$
+fi
+
+exec 2>$DBGFILE
+echo `_ "arguments: "` $0 $* >&2
+set -x 
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+        SUF="-@VERSION@";
+else
+       SUF=
+fi
+getconf=$sbindir/amgetconf$SUF
+
+
+changerfile=`$getconf changerfile`
+. $changerfile
+
+#
+# get config items that other changers use to put in our
+# fake amanda.conf files.
+#
+org=`$getconf ORG`
+mailto=`$getconf mailto`
+
+#
+# make a working directory (with amanda.conf) for each changer, and start the
+# changer script in background for each one
+#
+
+i=1
+while [ $i -le $nchangers ]
+do
+   eval tpchanger=\$tpchanger_$i
+   eval changerdev=\$changerdev_$i
+   eval changerfile=\$changerfile_$i
+   eval tapedev=\$tapedev_$i
+
+   mkdir -p $WORK/$i
+   cd $WORK/$i
+
+   cat >> amanda.conf <<EOF
+org            "$ORG"
+mailto         "$mailto"
+tpchanger      "$tpchanger"
+changerdev     "$changerdev"
+changerfile    "$changerfile"
+tapedev        "$tapedev"
+
+define tapetype EXABYTE {
+    comment "default tapetype"
+    length 4200 mbytes
+    filemark 48 kbytes
+    speed 474 kbytes                   
+}
+EOF
+
+    (
+       $tpchanger "$@"
+       echo "$?"> exitcode 
+    )  > stdout 2>stderr &
+
+   i=`expr $i + 1`
+done
+
+wait
+
+#
+# once they've all finished, collect up the results
+#
+
+myexit=0
+myslot=-1
+mymax=65536
+myflag=1
+mydev=""
+mysep="{"
+
+case x$1 in
+x-slot|x-reset|x-eject|x-search|x-label)
+
+    #
+    # read slot number and device from each
+    # slot numbers must match(?!), and is our resulting slot number
+    # resulting device is {dev1,dev2,...} from each one
+    #
+    i=1
+    while [ $i -le $nchangers ]
+    do
+       read exitcode < $WORK/$i/exitcode
+       read n dev < $WORK/$i/stdout
+       echo -------------- >&2
+        cat $WORK/$i/stderr >&2
+       cat $KIDDEBUG >&2
+       echo -------------- >&2
+
+       if [ "$exitcode" != 0 ]
+       then
+           myexit=$exitcode
+       fi
+       if [ $myslot = -1 ]
+       then
+           myslot=$n
+       fi
+       if [ $n != $myslot ]
+       then
+            # synch error!
+           myexit=1
+           echo `_ 'stackers are out of synch, issue a reset'` >&2
+       fi
+       mydev="$mydev$mysep$dev"
+       mysep=","
+
+       i=`expr $i + 1`
+    done
+    mydev="rait:$mydev}"
+    echo $myslot $mydev
+    ;;
+x-info)
+    #
+    # read info from each
+    # slot numbers must match(?!), and is our resulting slot number
+    # minimum max slots is our resulting max slots
+    # if any can't go backwards, the aggregate can't either
+    #
+    i=1
+    while [ $i -le $nchangers ]
+    do
+       read exitcode < $WORK/$i/exitcode
+       read n max flag < $WORK/$i/stdout
+       echo -------------- >&2
+        cat $WORK/$i/stderr >&2
+       cat $KIDDEBUG >&2
+       echo -------------- >&2
+
+       if [ "$exitcode" != 0 ]
+       then
+            myexit=$exitcode
+       fi
+       if [ $myslot = -1 ]
+       then
+           myslot=$n
+       fi
+       if [ $n != $myslot ]
+       then
+            # synch error!
+           myexit=1
+           echo `_ 'stackers are out of synch, issue a -reset'` >&2
+       fi
+       if [ $max -lt $mymax ]
+       then
+           mymax=$max
+       fi
+       if [ $flag = 0 ]
+       then
+           myflag=0
+       fi
+       i=`expr $i + 1`
+    done
+    echo $myslot $mymax $myflag
+
+esac
+
+#
+# clean up work directories
+#
+rm -rf $WORK
+
+exit $myexit
diff --git a/changer-src/chg-rait.sh.in b/changer-src/chg-rait.sh.in
deleted file mode 100644 (file)
index 550709d..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#!@SHELL@
-
-# chg-rait
-#
-# This assumes we have rait-striped drives in several
-# other amanda changer configs.
-#
-# so we have a changerfile that lists other changers and
-# changer files.
-#   nchangers=3
-#   tpchanger_1="chg-mtx"
-#   changerdev_1="/dev/mtx1"
-#   changerfile_1="/some/file1"
-#   tapedev_1="/some/dev"
-#   tpchanger_2="chg-mtx"
-#   changerdev_2="/dev/mtx2"
-#   changerfile_2="/some/file2"
-#   tapedev_2="/some/dev"
-#   tpchanger_3="chg-mtx"
-#   changerdev_3="/dev/mtx3"
-#   changerfile_3="/some/file3"
-#   tapedev_3="/some/dev"
-#
-# the tapedev_n entries are only needed if the changer script in question
-# uses tapedev.
-#
-
-#
-# debugging...
-#
-if [ -d "@AMANDA_DBGDIR@" ]; then
-       DBGFILE=@AMANDA_DBGDIR@/rait-changer.debug
-       KIDDEBUG=@AMANDA_DBGDIR@/changer.debug
-       WORK=@AMANDA_DBGDIR@/chgwork$$
-else
-       DBGFILE=/dev/null
-       KIDDEBUG=/dev/null
-       WORK=/tmp/chgwork$$
-fi
-
-exec 2>$DBGFILE
-echo "args: $0 $*" >&2
-set -x 
-
-#
-# the usual config fun
-#
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-        SUF="-@VERSION@";
-else
-       SUF=
-fi
-getconf=$sbindir/amgetconf$SUF
-
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH 
-
-changerfile=`$getconf changerfile`
-. $changerfile
-
-#
-# get config items that other changers use to put in our
-# fake amanda.conf files.
-#
-org=`$getconf ORG`
-mailto=`$getconf mailto`
-
-#
-# make a working directory (with amanda.conf) for each changer, and start the
-# changer script in background for each one
-#
-
-i=1
-while [ $i -le $nchangers ]
-do
-   eval tpchanger=\$tpchanger_$i
-   eval changerdev=\$changerdev_$i
-   eval changerfile=\$changerfile_$i
-   eval tapedev=\$tapedev_$i
-
-   mkdir -p $WORK/$i
-   cd $WORK/$i
-
-   cat >> amanda.conf <<EOF
-org            "$ORG"
-mailto         "$mailto"
-tpchanger      "$tpchanger"
-changerdev     "$changerdev"
-changerfile    "$changerfile"
-tapedev        "$tapedev"
-
-define tapetype EXABYTE {
-    comment "default tapetype"
-    length 4200 mbytes
-    filemark 48 kbytes
-    speed 474 kbytes                   
-}
-EOF
-
-    (
-       $tpchanger "$@"
-       echo "$?"> exitcode 
-    )  > stdout 2>stderr &
-
-   i=`expr $i + 1`
-done
-
-wait
-
-#
-# once they've all finished, collect up the results
-#
-
-myexit=0
-myslot=-1
-mymax=65536
-myflag=1
-mydev=""
-mysep="{"
-
-case x$1 in
-x-slot|x-reset|x-eject|x-search|x-label)
-
-    #
-    # read slot number and device from each
-    # slot numbers must match(?!), and is our resulting slot number
-    # resulting device is {dev1,dev2,...} from each one
-    #
-    i=1
-    while [ $i -le $nchangers ]
-    do
-       read exitcode < $WORK/$i/exitcode
-       read n dev < $WORK/$i/stdout
-       echo -------------- >&2
-        cat $WORK/$i/stderr >&2
-       cat $KIDDEBUG >&2
-       echo -------------- >&2
-
-       if [ "$exitcode" != 0 ]
-       then
-           myexit=$exitcode
-       fi
-       if [ $myslot = -1 ]
-       then
-           myslot=$n
-       fi
-       if [ $n != $myslot ]
-       then
-            # synch error!
-           myexit=1
-           echo "stackers are out of synch, issue a reset" >&2
-       fi
-       mydev="$mydev$mysep$dev"
-       mysep=","
-
-       i=`expr $i + 1`
-    done
-    mydev="rait:$mydev}"
-    echo $myslot $mydev
-    ;;
-x-info)
-    #
-    # read info from each
-    # slot numbers must match(?!), and is our resulting slot number
-    # minimum max slots is our resulting max slots
-    # if any can't go backwards, the aggregate can't either
-    #
-    i=1
-    while [ $i -le $nchangers ]
-    do
-       read exitcode < $WORK/$i/exitcode
-       read n max flag < $WORK/$i/stdout
-       echo -------------- >&2
-        cat $WORK/$i/stderr >&2
-       cat $KIDDEBUG >&2
-       echo -------------- >&2
-
-       if [ "$exitcode" != 0 ]
-       then
-            myexit=$exitcode
-       fi
-       if [ $myslot = -1 ]
-       then
-           myslot=$n
-       fi
-       if [ $n != $myslot ]
-       then
-            # synch error!
-           myexit=1
-           echo "stackers are out of synch, issue a -reset" >&2
-       fi
-       if [ $max -lt $mymax ]
-       then
-           mymax=$max
-       fi
-       if [ $flag = 0 ]
-       then
-           myflag=0
-       fi
-       i=`expr $i + 1`
-    done
-    echo $myslot $mymax $myflag
-
-esac
-
-#
-# clean up work directories
-#
-rm -rf $WORK
-
-exit $myexit
diff --git a/changer-src/chg-rth.pl b/changer-src/chg-rth.pl
new file mode 100644 (file)
index 0000000..9f75559
--- /dev/null
@@ -0,0 +1,307 @@
+#!@PERL@
+
+# Catch for sh/csh on systems without #! ability.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+       & eval 'exec @PERL@ -S $0 $argv:q'
+               if 0;
+
+# rth-changer - 
+#   A tape changer script for the Robotic Tape Handling system OEM'd
+#   by Andataco (RTH-406) for use with Amanda, the Advanced Maryland
+#   Network Disk Archiver.
+#
+#    Author: Erik Frederick 1/10/97
+#            edf@tyrell.mc.duke.edu
+#
+# This changer script controls the HP c1553 tape drive via a
+# Peripheral Vision Inc. SCSI control subsystem that interprets
+# commands sent on the SCSI bus.  It may work with other tape drives
+# containing the PVI board.
+#
+# Permission to freely use and distribute is granted.
+#
+
+require 5.001;
+
+use Getopt::Long;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$pname = "rth-changer";
+
+$prefix="@prefix@";
+$prefix=$prefix;               # avoid warnings about possible typo
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;     # ditto
+$sbindir="@sbindir@";
+$amlibexecdir="@amlibexecdir@";
+if ("@USE_VERSION_SUFFIXES@" eq "yes") {
+    $suf = "-@VERSION@";
+} else {
+    $suf = "";
+}
+
+if (-x "$sbindir/ammt$SUF") {
+       $MT="$sbindir/ammt$SUF";
+       $MTF="-f";
+} elsif (-x "@MT@") {
+       $MT="@MT@";
+       $MTF="@MT_FILE_FLAG@";
+} else {
+       print "<none> $pname: mt program not found\n";
+       exit(1);
+}
+
+$tapeDevice=`$sbindir/amgetconf$SUF tapedev`;
+die "tapedev not found in amanda.conf"
+       if !$tapeDevice or $tapeDevice eq "" or
+           $tapeDevice =~ m/no such parameter/;
+
+sub getCurrentTape {
+
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
+    exit(2);
+  }
+  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
+    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
+    exit(2);
+  }
+  if (!close(RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
+    exit(2);
+  }
+
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
+    exit(2);
+  }
+  if (sysread(RTH, $status, 136) != 136) {
+    print "$currentTape $pname: error in reading rth status.\n";
+    exit(2);
+  }
+  if (!close(RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
+    exit(2);
+  }
+
+  @statusBits=unpack("c*",$status);
+
+  if( ($statusBits[18] == 0x1) || ($statusBits[18]== 0x9)) {
+    return ($statusBits[27]-1);
+  }
+
+  return (0);
+}
+
+
+sub getTapeStatus {
+
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
+    exit(2);
+  }
+  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
+    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
+    exit(2);
+  }
+  if (!close(RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' for getting tpae status: $!\n";
+    exit(2);
+  }
+
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
+    exit(2);
+  }
+  if (sysread(RTH, $status, 136) != 136) {
+    print "$currentTape $pname: error in reading rth status for tape $currentTape.\n";
+    exit(2);
+  }
+  if (!close(RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' for getting tape status: $!\n";
+    exit(2);
+  }
+
+  @statusBits=unpack("c*",$status);
+
+  $curTape=0;
+  for($i=42;$i<187;$i+=16) {
+    if($statusBits[$i] == 0x9) {
+      $slots[$curTape] = 1;
+    }
+    else {
+      $slots[$curTape] = 0;
+    }
+    $curTape++;
+  }
+
+  return (@slots);
+}
+
+sub rthLoad {
+  my($tape) = @_;
+
+  $command = sprintf "GeT%d", $tape;
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for loading tape: $!\n";
+    exit(2);
+  }
+  if (syswrite(RTH, $command, 4) != 4) {
+    print "$currentTape $pname: error in loading tape by writing `$command' to `$tapeDevice': $!\n";
+    exit(2);
+  }
+  if (!close (RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' when trying to load tape: $!\n";
+    exit(2);
+  }
+}
+
+sub rthUnload {
+  my($tape) = @_;
+
+  $command = sprintf "PuT%d", $tape;
+  if (!sysopen(RTH, $tapeDevice, 2)) {
+    print "$currentTape $pname: error in opening `$tapeDevice' for unloading tape: $!\n";
+    exit(2);
+  }
+  if (syswrite(RTH, $command, 4) != 4) {
+    print "$currentTape $pname: error in unloading tape by writing `$command' to `$tapeDevice': $!\n";
+    exit(2);
+  }
+  if (!close (RTH)) {
+    print "$currentTape $pname: error in closing `$tapeDevice' when trying to unload tape: $!\n";
+    exit(2);
+  }
+}
+
+sub testTape {
+  my($tape) = @_;
+
+  @slots=getTapeStatus();
+
+  if($currentTape == $tape) {
+    return;
+  }
+
+  if($slots[$tape-1] == 0) {
+    print "<none> $pname: no tape in slot requested\n";
+    exit(1);
+  }
+  if($tape>6) {
+    print $tape," $pname: requested a tape > 6\n";
+    exit(2);
+  }
+  if($tape<1) {
+    print $tape," $pname: requested a tape < 1\n";
+    exit(2);
+  }
+  return;
+}
+
+sub changeTape {
+  my($tape) = @_;
+
+  if($tape==$currentTape) {
+    return;
+  }
+
+  testTape($tape);
+
+  if($currentTape==0) {
+    rthLoad($tape);
+    $currentTape=$tape;
+    return;
+  }
+  else {
+    rthUnload($currentTape);
+    rthLoad($tape);
+    $currentTape=$tape;
+  }
+}
+    
+
+$result = &GetOptions("slot=s", "info", "reset", "eject"); 
+
+system($MT, 'rewind');
+
+$nSlots=6;
+$firstTape=1;
+$lastTape=6;
+$currentTape=getCurrentTape(); 
+
+if($opt_slot) {
+  if($opt_slot =~ /first/) {
+    changeTape(1);
+    print $currentTape, " ", $tapeDevice, "\n";
+  }
+  if($opt_slot =~ /last/) {
+    changeTape(6);
+    print $currentTape, " ", $tapeDevice, "\n";
+  }
+  if($opt_slot =~ /current/) {
+    changeTape($currentTape);
+    print $currentTape, " ", $tapeDevice, "\n";
+  }
+  if($opt_slot =~ /next/) {
+    $tape=$currentTape+1;
+    if ($tape>6) {
+      $tape=1;
+    }
+    changeTape($tape);
+    print $currentTape, " ", $tapeDevice,"\n";
+  }
+  if($opt_slot =~ /prev/) {
+    $tape=$currentTape-1;
+    if($tape<1) {
+      $tape=6;
+    }
+    changeTape($tape);
+    print $currentTape, " ", $tapeDevice,"\n";
+  }
+  if($opt_slot =~ /\d/) {
+    changeTape($opt_slot);
+    print $currentTape, " ", $tapeDevice,"\n";
+  }
+  if($opt_slot =~ /advance/) {
+    $tape=$currentTape+1;
+    if ($tape>6) {
+      $tape=1;
+    }
+    if($currentTape) { 
+      rthUnload($currentTape);
+    }
+    print $currentTape, " ", "/dev/null","\n";
+  }
+
+  exit 0;
+}
+
+if($opt_info) {
+  print $currentTape, " 6 1\n";
+
+  exit 0;
+}
+
+if($opt_reset) {
+  changeTape(1);
+  print $currentTape, " ",$tapeDevice,"\n";
+  exit 0;
+}
+
+if($opt_eject) {
+  if($currentTape) { 
+    rthUnload($currentTape);
+    print "0 ",$tapeDevice,"\n";
+    exit 0;
+  } 
+  else {
+    print "0 $pname: drive was not loaded\n";
+    exit 1;
+  }
+}
+
+print "$pname: No command was received.  Exiting.\n";
+exit 1;
diff --git a/changer-src/chg-rth.pl.in b/changer-src/chg-rth.pl.in
deleted file mode 100644 (file)
index 19f3981..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-#!@PERL@
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-# rth-changer - 
-#   A tape changer script for the Robotic Tape Handling system OEM'd
-#   by Andataco (RTH-406) for use with Amanda, the Advanced Maryland
-#   Network Disk Archiver.
-#
-#    Author: Erik Frederick 1/10/97
-#            edf@tyrell.mc.duke.edu
-#
-# This changer script controls the HP c1553 tape drive via a
-# Peripheral Vision Inc. SCSI control subsystem that interprets
-# commands sent on the SCSI bus.  It may work with other tape drives
-# containing the PVI board.
-#
-# Permission to freely use and distribute is granted.
-#
-
-require 5.001;
-
-use Getopt::Long;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$pname = "rth-changer";
-
-$prefix="@prefix@";
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # ditto
-$sbindir="@sbindir@";
-$libexecdir="@libexecdir@";
-if ("@USE_VERSION_SUFFIXES@" eq "yes") {
-    $suf = "-@VERSION@";
-} else {
-    $suf = "";
-}
-
-if (-x "$sbindir/ammt$SUF") {
-       $MT="$sbindir/ammt$SUF";
-       $MTF="-f";
-} elsif (-x "@MT@") {
-       $MT="@MT@";
-       $MTF="@MT_FILE_FLAG@";
-} else {
-       print "<none> $pname: mt program not found\n";
-       exit(1);
-}
-
-$tapeDevice=`$sbindir/amgetconf$SUF tapedev`;
-die "tapedev not found in amanda.conf"
-       if !$tapeDevice or $tapeDevice eq "" or
-           $tapeDevice =~ m/no such parameter/;
-
-sub getCurrentTape {
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
-    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-  if (sysread(RTH, $status, 136) != 136) {
-    print "$currentTape $pname: error in reading rth status.\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n";
-    exit(2);
-  }
-
-  @statusBits=unpack("c*",$status);
-
-  if( ($statusBits[18] == 0x1) || ($statusBits[18]== 0x9)) {
-    return ($statusBits[27]-1);
-  }
-
-  return (0);
-}
-
-
-sub getTapeStatus {
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, "Rd_ElS", 6) != 6) {
-    print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting tpae status: $!\n";
-    exit(2);
-  }
-
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-  if (sysread(RTH, $status, 136) != 136) {
-    print "$currentTape $pname: error in reading rth status for tape $currentTape.\n";
-    exit(2);
-  }
-  if (!close(RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' for getting tape status: $!\n";
-    exit(2);
-  }
-
-  @statusBits=unpack("c*",$status);
-
-  $curTape=0;
-  for($i=42;$i<187;$i+=16) {
-    if($statusBits[$i] == 0x9) {
-      $slots[$curTape] = 1;
-    }
-    else {
-      $slots[$curTape] = 0;
-    }
-    $curTape++;
-  }
-
-  return (@slots);
-}
-
-sub rthLoad {
-  my($tape) = @_;
-
-  $command = sprintf "GeT%d", $tape;
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for loading tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, $command, 4) != 4) {
-    print "$currentTape $pname: error in loading tape by writing `$command' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close (RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' when trying to load tape: $!\n";
-    exit(2);
-  }
-}
-
-sub rthUnload {
-  my($tape) = @_;
-
-  $command = sprintf "PuT%d", $tape;
-  if (!sysopen(RTH, $tapeDevice, 2)) {
-    print "$currentTape $pname: error in opening `$tapeDevice' for unloading tape: $!\n";
-    exit(2);
-  }
-  if (syswrite(RTH, $command, 4) != 4) {
-    print "$currentTape $pname: error in unloading tape by writing `$command' to `$tapeDevice': $!\n";
-    exit(2);
-  }
-  if (!close (RTH)) {
-    print "$currentTape $pname: error in closing `$tapeDevice' when trying to unload tape: $!\n";
-    exit(2);
-  }
-}
-
-sub testTape {
-  my($tape) = @_;
-
-  @slots=getTapeStatus();
-
-  if($currentTape == $tape) {
-    return;
-  }
-
-  if($slots[$tape-1] == 0) {
-    print "<none> $pname: no tape in slot requested\n";
-    exit(1);
-  }
-  if($tape>6) {
-    print $tape," $pname: requested a tape > 6\n";
-    exit(2);
-  }
-  if($tape<1) {
-    print $tape," $pname: requested a tape < 1\n";
-    exit(2);
-  }
-  return;
-}
-
-sub changeTape {
-  my($tape) = @_;
-
-  if($tape==$currentTape) {
-    return;
-  }
-
-  testTape($tape);
-
-  if($currentTape==0) {
-    rthLoad($tape);
-    $currentTape=$tape;
-    return;
-  }
-  else {
-    rthUnload($currentTape);
-    rthLoad($tape);
-    $currentTape=$tape;
-  }
-}
-    
-
-$result = &GetOptions("slot=s", "info", "reset", "eject"); 
-
-system($MT, 'rewind');
-
-$nSlots=6;
-$firstTape=1;
-$lastTape=6;
-$currentTape=getCurrentTape(); 
-
-if($opt_slot) {
-  if($opt_slot =~ /first/) {
-    changeTape(1);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /last/) {
-    changeTape(6);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /current/) {
-    changeTape($currentTape);
-    print $currentTape, " ", $tapeDevice, "\n";
-  }
-  if($opt_slot =~ /next/) {
-    $tape=$currentTape+1;
-    if ($tape>6) {
-      $tape=1;
-    }
-    changeTape($tape);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /prev/) {
-    $tape=$currentTape-1;
-    if($tape<1) {
-      $tape=6;
-    }
-    changeTape($tape);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /\d/) {
-    changeTape($opt_slot);
-    print $currentTape, " ", $tapeDevice,"\n";
-  }
-  if($opt_slot =~ /advance/) {
-    $tape=$currentTape+1;
-    if ($tape>6) {
-      $tape=1;
-    }
-    if($currentTape) { 
-      rthUnload($currentTape);
-    }
-    print $currentTape, " ", "/dev/null","\n";
-  }
-
-  exit 0;
-}
-
-if($opt_info) {
-  print $currentTape, " 6 1\n";
-
-  exit 0;
-}
-
-if($opt_reset) {
-  changeTape(1);
-  print $currentTape, " ",$tapeDevice,"\n";
-  exit 0;
-}
-
-if($opt_eject) {
-  if($currentTape) { 
-    rthUnload($currentTape);
-    print "0 ",$tapeDevice,"\n";
-    exit 0;
-  } 
-  else {
-    print "0 $pname: drive was not loaded\n";
-    exit 1;
-  }
-}
-
-print "$pname: No command was received.  Exiting.\n";
-exit 1;
index d6bf467012d8bb425af400b039f810807afe296c..b5b76bdfee84c59a650aab7f4a94f5e1ccd12d07 100644 (file)
@@ -59,6 +59,7 @@
 #include "conffile.h"
 #include "libscsi.h"
 #include "scsi-defs.h"
+int Tape_Ready1 ( char *tapedev , int wait);
 
 char *tapestatfile = NULL;
 
@@ -104,7 +105,6 @@ int read_config(char *configfile, changer_t *chg);
 int    get_current_slot(char *count_file);
 void   put_current_slot(char *count_file,int slot);
 void   usage(char *argv[]);
-void   parse_args(int argc, char *argv[],command *rval);
 int    get_relative_target(int fd,int nslots,char *parameter,int loaded, 
                         char *changer_file,int slot_offset,int maxslot);
 int    is_positive_number(char *tmp);
@@ -122,14 +122,14 @@ init_changer_struct(
     changer_t *        chg,
     size_t     number_of_config)
 {
-  int i;
+  size_t i;
  
   memset(chg, 0, SIZEOF(*chg));
   chg->number_of_configs = number_of_config;
   chg->eject = 1;
   chg->sleep = 0;
   chg->cleanmax = 0;
-  chg->device = NULL
+  chg->device = NULL;
   chg->conf = alloc(SIZEOF(config_t) * number_of_config);
   for (i=0; i < number_of_config; i++){
     chg->conf[i].drivenum     = 0;
@@ -156,41 +156,41 @@ dump_changer_struct(
 {
   int i;
 
-  dbprintf(("Number of configurations: %d\n", chg->number_of_configs));
-  dbprintf(("Tapes need eject: %s\n", (chg->eject>0 ? "Yes" : "No")));
-  dbprintf(("Tapes need sleep: %d seconds\n", chg->sleep));
-  dbprintf(("Cleancycles     : %d\n", chg->cleanmax));
-  dbprintf(("Changerdevice   : %s\n", chg->device));
+  dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs);
+  dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No")));
+  dbprintf(_("Tapes need sleep: %lld seconds\n"), (long long)chg->sleep);
+  dbprintf(_("Clean cycles    : %d\n"), chg->cleanmax);
+  dbprintf(_("Changer device  : %s\n"), chg->device);
   for (i = 0; i < chg->number_of_configs; i++){
-    dbprintf(("Tapeconfig Nr: %d\n", i));
-    dbprintf(("  Drivenumber   : %d\n", chg->conf[i].drivenum));
-    dbprintf(("  Startslot     : %d\n", chg->conf[i].start));
-    dbprintf(("  Endslot       : %d\n", chg->conf[i].end));
-    dbprintf(("  Cleanslot     : %d\n", chg->conf[i].cleanslot));
+    dbprintf(_("Tape config Nr: %d\n"), i);
+    dbprintf(_("  Drive number  : %d\n"), chg->conf[i].drivenum);
+    dbprintf(_("  Start slot    : %d\n"), chg->conf[i].start);
+    dbprintf(_("  End slot      : %d\n"), chg->conf[i].end);
+    dbprintf(_("  Clean slot    : %d\n"), chg->conf[i].cleanslot);
     if (chg->conf[i].device != NULL)
-      dbprintf(("  Devicename    : %s\n", chg->conf[i].device));
+      dbprintf(_("  Device name   : %s\n"), chg->conf[i].device);
     else
-      dbprintf(("  Devicename    : none\n"));
+      dbprintf(_("  Device name   : none\n"));
     if (chg->conf[i].scsitapedev != NULL)
-      dbprintf(("  SCSITapedev   : %s\n", chg->conf[i].scsitapedev));
+      dbprintf(_("  SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev);
     else
-      dbprintf(("  SCSITapedev   : none\n"));
+      dbprintf(_("  SCSI Tape dev : none\n"));
     if (chg->conf[i].tapestatfile != NULL)
-      dbprintf(("  statfile      : %s\n", chg->conf[i].tapestatfile));
+      dbprintf(_("  stat file     : %s\n"), chg->conf[i].tapestatfile);
     else
-      dbprintf(("  statfile      : none\n"));
+      dbprintf(_("  stat file     : none\n"));
     if (chg->conf[i].slotfile != NULL)
-      dbprintf(("  Slotfile      : %s\n", chg->conf[i].slotfile));
+      dbprintf(_("  Slot file     : %s\n"), chg->conf[i].slotfile);
     else
-      dbprintf(("  Slotfile      : none\n"));
+      dbprintf(_("  Slot file     : none\n"));
     if (chg->conf[i].cleanfile != NULL)
-      dbprintf(("  Cleanfile     : %s\n", chg->conf[i].cleanfile));
+      dbprintf(_("  Clean file    : %s\n"), chg->conf[i].cleanfile);
     else
-      dbprintf(("  Cleanfile     : none\n"));
+      dbprintf(_("  Clean file    : none\n"));
     if (chg->conf[i].timefile != NULL)
-      dbprintf(("  Usagecount    : %s\n", chg->conf[i].timefile));
+      dbprintf(_("  Usage count   : %s\n"), chg->conf[i].timefile);
     else
-      dbprintf(("  Usagecount    : none\n"));
+      dbprintf(_("  Usage count   : none\n"));
   }
 }
 
@@ -271,7 +271,7 @@ read_config(
   size_t numconf;
   FILE *file;
   int init_flag = 0;
-  int drivenum=0;
+  size_t drivenum=0;
   char *linebuffer;
   int token;
   char *value;
@@ -300,9 +300,9 @@ read_config(
           init_flag=1;
         }
         switch (token){
-        case NUMDRIVE: if (atoi(value) != numconf)
-          fprintf(stderr,"Error: number_drives at wrong place, should be "\
-                  "first in file\n");
+        case NUMDRIVE: if ((size_t)atoi(value) != numconf)
+          g_fprintf(stderr,_("Error: number_drives at wrong place, should be "
+                  "first in file\n"));
         break;
         case EJECT:
           chg->eject = atoi(value);
@@ -325,75 +325,75 @@ read_config(
         case DRIVE:
           drivenum = atoi(value);
           if(drivenum >= numconf){
-            fprintf(stderr,"Error: drive must be less than number_drives\n");
+            g_fprintf(stderr,_("Error: drive must be less than number_drives\n"));
           }
           break;
         case DRIVENUM:
           if (drivenum < numconf){
             chg->conf[drivenum].drivenum = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " drivenum ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " drivenum ignored\n"));
           }
           break;
         case START:
           if (drivenum < numconf){
             chg->conf[drivenum].start = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " startuse ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " startuse ignored\n"));
           }
           break;
         case END:
           if (drivenum < numconf){
             chg->conf[drivenum].end = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " enduse ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " enduse ignored\n"));
           }
           break;
         case CLEAN:
           if (drivenum < numconf){
             chg->conf[drivenum].cleanslot = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " cleanslot ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " cleanslot ignored\n"));
           }
           break;
         case DEVICE:
           if (drivenum < numconf){
             chg->conf[drivenum].device = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " device ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " device ignored\n"));
           }
           break;
         case STATFILE:
           if (drivenum < numconf){
             chg->conf[drivenum].slotfile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " slotfile ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " slotfile ignored\n"));
           }
           break;
         case CLEANFILE:
           if (drivenum < numconf){
             chg->conf[drivenum].cleanfile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " cleanfile ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " cleanfile ignored\n"));
           }
           break;
         case USAGECOUNT:
           if (drivenum < numconf){
             chg->conf[drivenum].timefile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " usagecount ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " usagecount ignored\n"));
           }
           break;
         default:
-          fprintf(stderr,"Error: Unknown token\n");
+          g_fprintf(stderr,_("Error: Unknown token\n"));
           break;
         }
       }
@@ -416,13 +416,13 @@ int get_current_slot(char *count_file)
   FILE *inf;
   int retval;
   if ((inf=fopen(count_file,"r")) == NULL) {
-    fprintf(stderr, "%s: unable to open current slot file (%s)\n",
+    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
             get_pname(), count_file);
     return 0;
   }
 
   if (fscanf(inf, "%d", &retval) != 1) {
-    fprintf(stderr, "%s: unable to read current slot file (%s)\n",
+    g_fprintf(stderr, _("%s: unable to read current slot file (%s)\n"),
             get_pname(), count_file);
     retval = 0;
   }
@@ -436,11 +436,11 @@ void put_current_slot(char *count_file,int slot)
   FILE *inf;
 
   if ((inf=fopen(count_file,"w")) == NULL) {
-    fprintf(stderr, "%s: unable to open current slot file (%s)\n",
+    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
             get_pname(), count_file);
     exit(2);
   }
-  fprintf(inf, "%d\n", slot);
+  g_fprintf(inf, "%d\n", slot);
   fclose(inf);
 }
 
@@ -462,6 +462,8 @@ typedef struct com_stru
 } command;
 
 
+void   parse_args(int argc, char *argv[], command *rval);
+
 /* major command line args */
 #define COMCOUNT 5
 #define COM_SLOT 0
@@ -505,13 +507,13 @@ int is_positive_number(char *tmp) /* is the string a valid positive int? */
 void usage(char *argv[])
 {
   int cnt;
-  printf("%s: Usage error.\n", argv[0]);
+  g_printf(_("%s: Usage error.\n"), argv[0]);
   for (cnt=0; cnt < COMCOUNT; cnt++){
-    printf("      %s    %s",argv[0],argdefs[cnt].str);
+    g_printf("      %s    %s",argv[0],argdefs[cnt].str);
     if (argdefs[cnt].takesparam)
-      printf(" <param>\n");
+      g_printf(_(" <param>\n"));
     else
-      printf("\n");
+      g_printf("\n");
   }
   exit(2);
 }
@@ -600,7 +602,7 @@ get_relative_target(
     return maxslot;
 
   default: 
-    printf("<none> no slot `%s'\n",parameter);
+    g_printf(_("<none> no slot `%s'\n"),parameter);
     close(fd);
     exit(2);
     /*NOTREACHED*/
@@ -646,34 +648,38 @@ clean_tape(
       char *mail_cmd;
       FILE *mailf;
       int mail_pipe_opened = 1;
+#ifdef MAILER
       if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && 
          validate_mailto(getconf_str(CNF_MAILTO))) {
         mail_cmd = vstralloc(MAILER,
-                           " -s", " \"", "AMANDA PROBLEM: PLEASE FIX", "\"",
+                           " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"",
                            " ", getconf_str(CNF_MAILTO),
                            NULL);
         if((mailf = popen(mail_cmd, "w")) == NULL){
-               printf("Mail failed\n");
-               error("could not open pipe to \"%s\": %s",
+               g_printf(_("Mail failed\n"));
+               error(_("could not open pipe to \"%s\": %s"),
                mail_cmd, strerror(errno));
                /*NOTREACHED*/
        }
-      }
-      else{
+      } else {
         mail_pipe_opened = 0;
         mailf = stderr;
-         fprintf(mailf, "\nNo mail recipient specified, output redirected to stderr");
-       }
-       
-      fprintf(mailf,"\nThe usage count of your cleaning tape in slot %d",
+         g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr"));
+      }
+#else
+      mail_pipe_opened = 0;
+      mailf = stderr;
+      g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr"));
+#endif
+      g_fprintf(mailf, _("\nThe usage count of your cleaning tape in slot %d"),
              cleancart);
-      fprintf(mailf,"\nis more than %d. (cleanmax)",maxclean);
-      fprintf(mailf,"\nTapedrive %s needs to be cleaned",tapedev);
-      fprintf(mailf,"\nPlease insert a new cleaning tape and reset");
-      fprintf(mailf,"\nthe countingfile %s",cnt_file);
+      g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean);
+      g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev);
+      g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset"));
+      g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file);
 
       if(mail_pipe_opened == 1 && pclose(mailf) != 0) {
-        error("mail command failed: %s", mail_cmd);
+        error(_("mail command failed: %s"), mail_cmd);
                /*NOTREACHED*/
       }
       
@@ -693,7 +699,7 @@ clean_tape(
 int
 main(
     int                argc,
-    char *     argv[])
+    char **    argv)
 {
   int loaded;
   int target = -1;
@@ -725,6 +731,15 @@ main(
   char *changer_file = NULL;
   char *scsitapedevice = NULL;
 
+  /*
+   * Configure program for internationalization:
+   *   1) Only set the message locale for now.
+   *   2) Set textdomain for all amanda related programs to "amanda"
+   *      We don't want to be forced to support dozens of message catalogs.
+   */  
+  setlocale(LC_MESSAGES, "C");
+  textdomain("amanda"); 
+
   set_pname("chg-scsi");
 
   /* Don't die when child closes pipe */
@@ -734,14 +749,10 @@ main(
   parse_args(argc,argv,&com);
 
   changer = alloc(SIZEOF(changer_t));
-  if(read_conffile(CONFFILE_NAME)) {
-    fprintf(stderr, "%s: could not find config file \"%s\"",
-                   changer_dev, conffile);
-    exit(1);
-  }
+  config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL);
 
-  changer_dev = getconf_str(CNF_CHNGRDEV);
-  changer_file = getconf_str(CNF_CHNGRFILE);
+  changer_dev = getconf_str(CNF_CHANGERDEV);
+  changer_file = getconf_str(CNF_CHANGERFILE);
   tape_device = getconf_str(CNF_TAPEDEV);
 
   /* Get the configuration parameters */
@@ -777,11 +788,10 @@ main(
                        "changer_dev", changer->conf[confnum].changerident);
     if (fd == -1) {
       int localerr = errno;
-      fprintf(stderr, "%s: open: %s: %s\n", get_pname(), 
+      g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
               changer_dev, strerror(localerr));
-      printf("%s open: %s: %s\n", "<none>", changer_dev, strerror(localerr));
-      dbprintf(("%s: open: %s: %s\n", get_pname(),
-                changer_dev, strerror(localerr)));
+      g_printf(_("%s open: %s: %s\n"), "<none>", changer_dev, strerror(localerr));
+      dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
       return 2;
     }
 
@@ -808,11 +818,10 @@ main(
                        "changer_dev", changer->conf[confnum].changerident);
     if (fd == -1) {
       int localerr = errno;
-      fprintf(stderr, "%s: open: %s: %s\n", get_pname(), 
+      g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
               changer_dev, strerror(localerr));
-      printf("%s open: %s: %s\n", "<none>", changer_dev, strerror(localerr));
-      dbprintf(("%s: open: %s: %s\n", get_pname(),
-                changer_dev, strerror(localerr)));
+      g_printf(_("%s open: %s: %s\n"), _("<none>"), changer_dev, strerror(localerr));
+      dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
       return 2;
     }
     slotcnt = get_slot_count(fd);
@@ -826,14 +835,13 @@ main(
   drivecnt = get_drive_count(fd);
 
   if (drive_num > drivecnt) {
-    printf("%s drive number error (%d > %d)\n", "<none>"
+    g_printf(_("%s drive number error (%d > %d)\n"), _("<none>")
            drive_num, drivecnt);
-    fprintf(stderr, "%s: requested drive number (%d) greater than "
-            "number of supported drives (%d)\n", get_pname(), 
+    g_fprintf(stderr, _("%s: requested drive number (%d) greater than "
+            "number of supported drives (%d)\n"), get_pname(), 
             drive_num, drivecnt);
-    dbprintf(("%s: requested drive number (%d) greater than "
-              "number of supported drives (%d)\n", get_pname(), 
-              drive_num, drivecnt));
+    dbprintf(_("requested drive number (%d) greater than "
+              "number of supported drives (%d)\n"), drive_num, drivecnt);
     CloseDevice("", fd);
     return 2;
   }
@@ -844,7 +852,7 @@ main(
   case COM_SLOT:  /* slot changing command */
     if (is_positive_number(com.parameter)) {
       if ((target = atoi(com.parameter))>=use_slots) {
-        printf("<none> no slot `%d'\n",target);
+        g_printf(_("<none> no slot `%d'\n"),target);
         close(fd);
         endstatus = 2;
         break;
@@ -878,7 +886,7 @@ main(
       put_current_slot(changer_file, target);
     }
     if (!loaded && isempty(fd, target)) {
-      printf("%d slot %d is empty\n",target-slot_offset,
+      g_printf(_("%d slot %d is empty\n"),target-slot_offset,
              target-slot_offset);
       close(fd);
       endstatus = 1;
@@ -886,25 +894,25 @@ main(
     }
     if (!loaded)
       if (load(fd, drive_num, target) != 0) {
-        printf("%d slot %d move failed\n",target-slot_offset,
+        g_printf(_("%d slot %d move failed\n"),target-slot_offset,
                target-slot_offset);  
         close(fd);
         endstatus = 2;
         break;
       }
     if (need_sleep)
-      Tape_Ready(scsitapedevice, need_sleep);
-    printf("%d %s\n", target-slot_offset, tape_device);
+      Tape_Ready1(scsitapedevice, need_sleep);
+    g_printf(_("%d %s\n"), target-slot_offset, tape_device);
     break;
 
   case COM_INFO:
     if (changer_file != NULL)
       {
-        printf("%d ", get_current_slot(changer_file)-slot_offset);
+        g_printf("%d ", get_current_slot(changer_file)-slot_offset);
       } else {
-        printf("%d ", GetCurrentSlot(fd, drive_num)-slot_offset);
+        g_printf("%d ", GetCurrentSlot(fd, drive_num)-slot_offset);
       }
-    printf("%d 1\n", use_slots);
+    g_printf("%d 1\n", use_slots);
     break;
 
   case COM_RESET:
@@ -926,14 +934,14 @@ main(
     }
 
     if (isempty(fd, slot_offset)) {
-      printf("0 slot 0 is empty\n");
+      g_printf(_("0 slot 0 is empty\n"));
       close(fd);
       endstatus = 1;
       break;
     }
 
     if (load(fd, drive_num, slot_offset) != 0) {
-      printf("%d slot %d move failed\n",slot_offset,
+      g_printf(_("%d slot %d move failed\n"),slot_offset,
              slot_offset);  
       close(fd);
       endstatus = 2;
@@ -944,12 +952,12 @@ main(
       put_current_slot(changer_file, slot_offset);
     }
     if (need_sleep)
-      Tape_Ready(scsitapedevice, need_sleep);
+      Tape_Ready1(scsitapedevice, need_sleep);
     if (changer_file != NULL)
       {
-        printf("%d %s\n", get_current_slot(changer_file), tape_device);
+        g_printf("%d %s\n", get_current_slot(changer_file), tape_device);
       } else {
-        printf("%d %s\n", GetCurrentSlot(fd, drive_num), tape_device);
+        g_printf("%d %s\n", GetCurrentSlot(fd, drive_num), tape_device);
       }
     break;
 
@@ -967,9 +975,9 @@ main(
       if (ask_clean(scsitapedevice))
         clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
                    maxclean,time_file);
-      printf("%d %s\n", target, tape_device);
+      g_printf("%d %s\n", target, tape_device);
     } else {
-      printf("%d %s\n", target, "drive was not loaded");
+      g_printf(_("%d drive was not loaded\n"), target);
       endstatus = 1;
     }
     break;
@@ -987,7 +995,7 @@ main(
     } 
     clean_tape(fd,tape_device,clean_file,drive_num,clean_slot,
                maxclean,time_file);
-    printf("%s cleaned\n", tape_device);
+    g_printf(_("%s cleaned\n"), tape_device);
     break;
   };
 
index f4b904efd38be9d56385b9c2e6ea32dd2115fd1d..46d4801621da68e7c6a0a6cc0b9f25680f3741a5 100644 (file)
@@ -189,68 +189,68 @@ dump_changer_struct(
 {
   int i;
 
-  dbprintf(("Number of configurations: %d\n",chg->number_of_configs));
-  dbprintf(("Tapes need eject: %s\n",(chg->eject>0?"Yes":"No")));
-       dbprintf (("\traw: %d\n",chg->eject));
-  dbprintf(("Inv. auto update: %s\n",(chg->autoinv>0?"Yes":"No")));
-  dbprintf (("\traw: %d\n",chg->autoinv));
-  dbprintf(("barcode reader  : %s\n",(chg->havebarcode>0?"Yes":"No")));
-  dbprintf (("\traw: %d\n",chg->havebarcode));
-  dbprintf(("Emulate Barcode : %s\n",(chg->emubarcode>0?"Yes":"No")));
-  dbprintf (("\traw: %d\n",chg->emubarcode));
+  dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs);
+  dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No")));
+       dbprintf (_("\traw: %d\n"),chg->eject);
+  dbprintf(_("Inv. auto update: %s\n"), (chg->autoinv>0 ? _("Yes") : _("No")));
+  dbprintf (_("\traw: %d\n"),chg->autoinv);
+  dbprintf(_("barcode reader  : %s\n"), (chg->havebarcode>0 ? _("Yes") : _("No")));
+  dbprintf (_("\traw: %d\n"),chg->havebarcode);
+  dbprintf(_("Emulate Barcode : %s\n"), (chg->emubarcode>0 ? _("Yes") : _("No")));
+  dbprintf (_("\traw: %d\n"),chg->emubarcode);
   if (chg->debuglevel != NULL)
-     dbprintf(("debug level     : %s\n", chg->debuglevel));
-  dbprintf(("Tapes need sleep: %d seconds\n", (int)chg->sleep));
-  dbprintf(("Cleancycles     : %d\n",chg->cleanmax));
-  dbprintf(("Changerdevice   : %s\n",chg->device));
+     dbprintf(_("debug level     : %s\n"), chg->debuglevel);
+  dbprintf(_("Tapes need sleep: %ld seconds\n"), (long int)chg->sleep);
+  dbprintf(_("Clean cycles    : %d\n"), chg->cleanmax);
+  dbprintf(_("Changer device  : %s\n"), chg->device);
   if (chg->labelfile != NULL)
-    dbprintf(("Labelfile       : %s\n", chg->labelfile));
+    dbprintf(_("Label file      : %s\n"), chg->labelfile);
   for (i=0; i<chg->number_of_configs; i++){
-    dbprintf(("Tapeconfig Nr: %d\n",i));
-    dbprintf(("  Drivenumber   : %d\n",chg->conf[i].drivenum));
-    dbprintf(("  Startslot     : %d\n",chg->conf[i].start));
-    dbprintf(("  Endslot       : %d\n",chg->conf[i].end));
-    dbprintf(("  Cleanslot     : %d\n",chg->conf[i].cleanslot));
+    dbprintf(_("Tape config Nr: %d\n"), i);
+    dbprintf(_("  Drive number  : %d\n"), chg->conf[i].drivenum);
+    dbprintf(_("  Start slot    : %d\n"), chg->conf[i].start);
+    dbprintf(_("  End slot      : %d\n"), chg->conf[i].end);
+    dbprintf(_("  Clean slot    : %d\n"), chg->conf[i].cleanslot);
 
     if (chg->conf[i].device != NULL)
-      dbprintf(("  Devicename    : %s\n",chg->conf[i].device));
+      dbprintf(_("  Device name   : %s\n"), chg->conf[i].device);
     else
-      dbprintf(("  Devicename    : none\n"));
+      dbprintf(_("  Device name   : none\n"));
 
     if (chg->conf[i].changerident != NULL)
-      dbprintf(("  changerident  : %s\n",chg->conf[i].changerident));
+      dbprintf(_("  changer ident : %s\n"), chg->conf[i].changerident);
     else
-      dbprintf(("  changerident  : none\n"));
+      dbprintf(_("  changer ident : none\n"));
 
     if (chg->conf[i].scsitapedev != NULL)
-      dbprintf(("  SCSITapedev   : %s\n",chg->conf[i].scsitapedev));
+      dbprintf(_("  SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev);
     else
-      dbprintf(("  SCSITapedev   : none\n"));
+      dbprintf(_("  SCSI Tape dev : none\n"));
 
     if (chg->conf[i].tapeident != NULL)
-      dbprintf(("  tapeident     : %s\n",chg->conf[i].tapeident));
+      dbprintf(_("  tape ident    : %s\n"), chg->conf[i].tapeident);
     else
-      dbprintf(("  tapeident     : none\n"));
+      dbprintf(_("  tape ident    : none\n"));
 
     if (chg->conf[i].tapestatfile != NULL)
-      dbprintf(("  statfile      : %s\n", chg->conf[i].tapestatfile));
+      dbprintf(_("  stat file     : %s\n"), chg->conf[i].tapestatfile);
     else
-      dbprintf(("  statfile      : none\n"));
+      dbprintf(_("  stat file     : none\n"));
 
     if (chg->conf[i].slotfile != NULL)
-      dbprintf(("  Slotfile      : %s\n",chg->conf[i].slotfile));
+      dbprintf(_("  Slot file     : %s\n"), chg->conf[i].slotfile);
     else
-      dbprintf(("  Slotfile      : none\n"));
+      dbprintf(_("  Slot file     : none\n"));
 
     if (chg->conf[i].cleanfile != NULL)
-      dbprintf(("  Cleanfile     : %s\n",chg->conf[i].cleanfile));
+      dbprintf(_("  Clean file    : %s\n"), chg->conf[i].cleanfile);
     else
-      dbprintf(("  Cleanfile     : none\n"));
+      dbprintf(_("  Clean file    : none\n"));
 
     if (chg->conf[i].timefile != NULL)
-      dbprintf(("  Usagecount    : %s\n",chg->conf[i].timefile));
+      dbprintf(_("  Usage count   : %s\n"), chg->conf[i].timefile);
     else
-      dbprintf(("  Usagecount    : none\n"));
+      dbprintf(_("  Usage count   : none\n"));
   }
 }
 
@@ -351,7 +351,7 @@ read_config(
           } else {
             numconf = atoi(value);
            if (numconf < 1 || numconf > 100) {
-               fprintf(stderr,"numconf %d is bad\n", numconf);
+               g_fprintf(stderr,_("numconf %d is bad\n"), numconf);
                numconf = 1;
            }
             init_changer_struct(chg, numconf);
@@ -360,8 +360,8 @@ read_config(
         }
         switch (token) {
         case NUMDRIVE: if (atoi(value) != numconf)
-          fprintf(stderr,"Error: number_drives at wrong place, should be "\
-                  "first in file\n");
+          g_fprintf(stderr,_("Error: number_drives at wrong place, should be "
+                  "first in file\n"));
         break;
         case AUTOINV:
           chg->autoinv = 1;
@@ -396,7 +396,7 @@ read_config(
         case CHANGERIDENT:
           chg->conf[drivenum].changerident = stralloc(value);
          if (drivenum < 0 || drivenum > 100) {
-           fprintf(stderr,"drivenum %d is bad\n", drivenum);
+           g_fprintf(stderr,_("drivenum %d is bad\n"), drivenum);
            drivenum = 0;
          }
          if (strcmp(chg->conf[drivenum].changerident,"generic_changer") != 0) {
@@ -420,10 +420,10 @@ read_config(
         case DRIVE:
           drivenum = atoi(value);
           if (drivenum < 0) {
-            fprintf(stderr,"Error: drive must be >= 0\n");
+            g_fprintf(stderr,_("Error: drive must be >= 0\n"));
            drivenum = 0;
           } else if (drivenum >= numconf) {
-            fprintf(stderr,"Error: drive must be less than number_drives\n");
+            g_fprintf(stderr,_("Error: drive must be less than number_drives\n"));
            drivenum = numconf;
           }
           break;
@@ -431,68 +431,68 @@ read_config(
           if (drivenum < numconf){
             chg->conf[drivenum].drivenum = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " drivenum ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " drivenum ignored\n"));
           }
           break;
         case START:
           if (drivenum < numconf){
             chg->conf[drivenum].start = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " startuse ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " startuse ignored\n"));
           }
           break;
         case END:
           if (drivenum < numconf){
             chg->conf[drivenum].end = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " enduse ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " enduse ignored\n"));
           }
           break;
         case CLEAN:
           if (drivenum < numconf){
             chg->conf[drivenum].cleanslot = atoi(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " cleanslot ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " cleanslot ignored\n"));
           }
           break;
         case DEVICE:
           if (drivenum < numconf){
             chg->conf[drivenum].device = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " device ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " device ignored\n"));
           }
           break;
         case STATFILE:
           if (drivenum < numconf){
             chg->conf[drivenum].slotfile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " slotfile ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " slotfile ignored\n"));
           }
           break;
         case CLEANFILE:
           if (drivenum < numconf){
             chg->conf[drivenum].cleanfile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " cleanfile ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " cleanfile ignored\n"));
           }
           break;
         case USAGECOUNT:
           if (drivenum < numconf){
             chg->conf[drivenum].timefile = stralloc(value);
           } else {
-            fprintf(stderr,"Error: drive is not less than number_drives"\
-                    " usagecount ignored\n");
+            g_fprintf(stderr,_("Error: drive is not less than number_drives"
+                    " usagecount ignored\n"));
           }
           break;
         default:
-          fprintf(stderr,"Error: Unknown token\n");
+          g_fprintf(stderr,_("Error: Unknown token\n"));
           break;
         }
       }
@@ -518,7 +518,7 @@ get_current_slot(
   int retval = -1;
   int ret;          /* return value for the fscanf function */
   if ((inf=fopen(count_file,"r")) == NULL) {
-    fprintf(stderr, "%s: unable to open (%s)\n",
+    g_fprintf(stderr, _("%s: unable to open (%s)\n"),
             get_pname(), count_file);
     exit(2);
   }
@@ -552,11 +552,11 @@ put_current_slot(
     return;
 
   if ((inf=fopen(count_file,"w")) == NULL) {
-    fprintf(stderr, "%s: unable to open current slot file (%s)\n",
+    g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"),
             get_pname(), count_file);
     exit(2);
   }
-  fprintf(inf, "%d\n", slot);
+  g_fprintf(inf, "%d\n", slot);
   fclose(inf);
 }
 
@@ -589,8 +589,8 @@ MapBarCode(
   long pos;
   int rc;
 
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : Parameter\n");
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"labelfile -> %s, vol -> %s, barcode -> %s, action -> %c, slot -> %d, from -> %d\n",
+  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : Parameter\n"));
+  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("labelfile -> %s, vol -> %s, barcode -> %s, action -> %c, slot -> %d, from -> %d\n"),
              labelfile,
              result->data.voltag,
              result->data.barcode,
@@ -600,47 +600,47 @@ MapBarCode(
   
   if (labelfile == NULL)
     {
-      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"Got empty labelfile (NULL)\n");
-      ChgExit("MapBarCode", "MapBarCode name of labelfile is not set\n",FATAL);
+      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("Got empty labelfile (NULL)\n"));
+      ChgExit("MapBarCode", _("MapBarCode name of labelfile is not set\n"),FATAL);
       /*NOTREACHED*/
     }
   if (access(labelfile, F_OK) == -1)
     {
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "MapBarCode : creating %s", labelfile);
+      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("MapBarCode : creating %s"), labelfile);
       if ((fp = fopen(labelfile, "w+")) == NULL)
         {
-          DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE," failed\n");
-          ChgExit("MapBarCode", "MapBarCode, creating labelfile failed\n", FATAL);
+          DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_(" failed\n"));
+          ChgExit("MapBarCode", _("MapBarCode, creating labelfile failed\n"), FATAL);
          /*NOTREACHED*/
         }
-      fprintf(fp,":%d:", LABEL_DB_VERSION);
+      g_fprintf(fp,":%d:", LABEL_DB_VERSION);
       fclose(fp);
     }
   
   if ((fp = fopen(labelfile, "r+")) == NULL)
     {
-       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"MapBarCode : failed to open %s\n", labelfile);
-       ChgExit("MapBarCode", "MapBarCode, opening labelfile for read/write failed\n", FATAL);
+       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : failed to open %s\n"), labelfile);
+       ChgExit("MapBarCode", _("MapBarCode, opening labelfile for read/write failed\n"), FATAL);
        /*NOTREACHED*/
     }
   
   if (fscanf(fp,":%d:", &version) != 1) {
-     ChgExit("MapBarCode", "MapBarCode, DB Version unreadable.\n", FATAL);
+     ChgExit("MapBarCode", _("MapBarCode, DB Version unreadable.\n"), FATAL);
      /*NOTREACHED*/
   }
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : DB version %d\n", version);
+  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : DB version %d\n"), version);
   
   pos = ftell(fp);
   if (version != LABEL_DB_VERSION)
     {
-      ChgExit("MapBarCode", "MapBarCode, DB Version does not match\n", FATAL);
+      ChgExit("MapBarCode", _("MapBarCode, DB Version does not match\n"), FATAL);
       /*NOTREACHED*/
     }
 
   if (( plabelv2 = (LabelV2_T *)alloc(SIZEOF(LabelV2_T))) == NULL)
     {
-      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"MapBarCode : alloc failed\n");
-      ChgExit("MapBarCode", "MapBarCode alloc failed\n", FATAL);
+      DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : alloc failed\n"));
+      ChgExit("MapBarCode", _("MapBarCode alloc failed\n"), FATAL);
       /*NOTREACHED*/
     }
   
@@ -652,7 +652,7 @@ MapBarCode(
       if (rsize == SIZEOF(LabelV2_T))
       {
       record++;
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : (%d) VolTag \"%s\", BarCode %s, inuse %d, slot %d, from %d, loadcount %d\n",record,
+      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : (%d) VolTag \"%s\", BarCode %s, inuse %d, slot %d, from %d, loadcount %d\n"),record,
                  plabelv2->voltag,
                  plabelv2->barcode,
                  plabelv2->valid,
@@ -665,7 +665,7 @@ MapBarCode(
            * Only dump the info
            */ 
         case BARCODE_DUMP:
-          printf("Slot -> %d, from -> %d, valid -> %d, Tag -> %s, Barcode -> %s, Loadcount %u\n",
+          g_printf(_("Slot -> %d, from -> %d, valid -> %d, Tag -> %s, Barcode -> %s, Loadcount %u\n"),
                  plabelv2->slot,
                  plabelv2->from,
                  plabelv2->valid,
@@ -713,7 +713,7 @@ MapBarCode(
           if (strcmp(plabelv2->barcode, result->data.barcode) == 0)
             {
 
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : update entry\n");
+              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : update entry\n"));
              if (fseek(fp, pos, SEEK_SET) == -1) {
                fclose(fp);
                amfree(plabelv2);
@@ -740,7 +740,7 @@ MapBarCode(
         case FIND_SLOT:
           if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
             {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode FIND_SLOT : \n");
+              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode FIND_SLOT : \n"));
               memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
              amfree(plabelv2);
               return(1);
@@ -754,7 +754,7 @@ MapBarCode(
         case UPDATE_SLOT:
           if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
             {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode UPDATE_SLOT : update entry\n");
+              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode UPDATE_SLOT : update entry\n"));
              if (fseek(fp, pos, SEEK_SET) == -1) {
                fclose(fp);
                amfree(plabelv2);
@@ -781,12 +781,12 @@ MapBarCode(
            */
         case BARCODE_VOL:
          /*
-          * DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode: (%d) inside BARCODE_VOL\n", record);
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"file value: %s, searched for value: %s\n", plabelv2->voltag, result->data.voltag);
+          * DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode: (%d) inside BARCODE_VOL\n"), record);
+         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("file value: %s, searched for value: %s\n"), plabelv2->voltag, result->data.voltag);
          */
           if (strcmp(plabelv2->voltag, result->data.voltag) == 0)
             {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : VOL %s match\n", result->data.voltag);
+              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : VOL %s match\n"), result->data.voltag);
               fclose(fp);
               
               memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
@@ -801,7 +801,7 @@ MapBarCode(
         case BARCODE_BARCODE:
           if (strcmp(plabelv2->barcode, result->data.barcode) == 0)
             {
-              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : BARCODE %s match\n", result->data.barcode);
+              DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : BARCODE %s match\n"), result->data.barcode);
               fclose(fp);
               
               memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T));
@@ -811,13 +811,13 @@ MapBarCode(
           break;
 
         default:
-          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : unknown action\n");
+          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : unknown action\n"));
           break;
         }
       pos = ftell(fp);
       } else {
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : feof (%d)\n", feof(fp));
-         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : error in read record expect %d, got %d\n",SIZEOF(LabelV2_T), rsize);
+         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : feof (%d)\n"), feof(fp));
+         DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : error in read record expect %d, got %d\n"),SIZEOF(LabelV2_T), rsize);
        loop=0;
       }
     }
@@ -836,7 +836,7 @@ MapBarCode(
        */
       if (unusedpos != 0)
         {
-          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : reuse record %d\n", unusedrec);
+          DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : reuse record %d\n"), unusedrec);
           if (fseek(fp, unusedpos, SEEK_SET) == -1) {
            fclose(fp);
            amfree(plabelv2);
@@ -957,13 +957,13 @@ usage(
     char *argv[])
 {
   int cnt;
-  printf("%s: Usage error.\n", argv[0]);
+  g_printf(_("%s: Usage error.\n"), argv[0]);
   for (cnt=0; cnt < COMCOUNT; cnt++){
-    printf("      %s    %s",argv[0],argdefs[cnt].str);
+    g_printf("      %s    %s",argv[0],argdefs[cnt].str);
     if (argdefs[cnt].takesparam)
-      printf(" <param>\n");
+      g_printf(" <param>\n");
     else
-      printf("\n");
+      g_printf("\n");
   }
   exit(2);
 }
@@ -978,7 +978,7 @@ parse_args(
   int i;
 
   for (i=0; i < argc; i++)
-    dbprintf(("ARG [%d] : %s\n", i, argv[i]));
+    dbprintf(_("ARG [%d] : %s\n"), i, argv[i]);
   i = 0;
   if ((argc<2)||(argc>3))
     usage(argv);
@@ -1048,7 +1048,7 @@ get_relative_target(
   default: 
     break;
   }
-  printf("<none> no slot `%s'\n",parameter);
+  g_printf(_("<none> no slot `%s'\n"),parameter);
   close(fd);
   exit(2);
   /*NOTREACHED*/
@@ -1096,33 +1096,38 @@ clean_tape(
       char *mail_cmd = NULL;
       FILE *mailf = NULL;
       int mail_pipe_opened = 1;
+#ifdef MAILER
       if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 &&
          validate_mailto(getconf_str(CNF_MAILTO))) {
         mail_cmd = vstralloc(MAILER,
-                           " -s", " \"", "AMANDA PROBLEM: PLEASE FIX", "\"",
+                           " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"",
                            " ", getconf_str(CNF_MAILTO),
                            NULL);
         if((mailf = popen(mail_cmd, "w")) == NULL){
-               printf("Mail failed\n");
-               error("could not open pipe to \"%s\": %s",
-               mail_cmd, strerror(errno));
+               g_printf(_("Mail failed\n"));
+               error(_("could not open pipe to \"%s\": %s"),
+                       mail_cmd, strerror(errno));
                /*NOTREACHED*/
        }
-      }
-      else {
+      } else {
        mail_pipe_opened = 0;
         mailf = stderr;
-        fprintf(mailf, "\nNo mail recipient specified, output redirected to stderr");
+        g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr"));
       }   
-      fprintf(mailf,"\nThe usage count of your cleaning tape in slot %d",
+#else
+      mail_pipe_opened = 0;
+      mailf = stderr;
+      g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr"));
+#endif
+      g_fprintf(mailf,_("\nThe usage count of your cleaning tape in slot %d"),
               cleancart);
-      fprintf(mailf,"\nis more than %d. (cleanmax)",maxclean);
-      fprintf(mailf,"\nTapedrive %s needs to be cleaned",tapedev);
-      fprintf(mailf,"\nPlease insert a new cleaning tape and reset");
-      fprintf(mailf,"\nthe countingfile %s",cnt_file);
+      g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean);
+      g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev);
+      g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset"));
+      g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file);
 
       if(mail_pipe_opened == 1 && pclose(mailf) != 0) {
-               error("mail command failed: %s", mail_cmd);
+               error(_("mail command failed: %s"), mail_cmd);
        /*NOTREACHED*/
       }
       return;
@@ -1145,8 +1150,8 @@ clean_tape(
 
 int
 main(
-    int argc,
-    char *argv[])
+    int                argc,
+    char **    argv)
 {
   int loaded;
   int target, oldtarget;
@@ -1190,6 +1195,15 @@ main(
 
   int param_index = 0;
 
+  /*
+   * Configure program for internationalization:
+   *   1) Only set the message locale for now.
+   *   2) Set textdomain for all amanda related programs to "amanda"
+   *      We don't want to be forced to support dozens of message catalogs.
+   */  
+  setlocale(LC_MESSAGES, "C");
+  textdomain("amanda"); 
+
   changer = alloc(SIZEOF(changer_t));
   pbarcoderes = alloc(SIZEOF(MBC_T));
 
@@ -1202,7 +1216,7 @@ main(
   changer->labelfile = NULL;
   changer->conf = NULL;
 #ifdef CHG_SCSI_STANDALONE
-  printf("Ups standalone\n");
+  g_printf(_("Ups standalone\n"));
 #else
   set_pname("chg-scsi");
 
@@ -1211,7 +1225,7 @@ main(
 
   dbopen(DBG_SUBDIR_SERVER);
 
-  dbprintf(("chg-scsi: %s\n", rcsid));
+  dbprintf("chg-scsi: %s\n", rcsid);
   ChangerDriverVersion();
 
   if (debug_file == NULL)
@@ -1240,13 +1254,9 @@ main(
       break;
     }
 
-  if(read_conffile(CONFFILE_NAME)) {
-    perror(CONFFILE_NAME);
-    exit(1);
-    /*NOTREACHED*/
-  }
+  config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL);
 
-  chg_scsi_conf = getconf_str(CNF_CHNGRFILE);
+  chg_scsi_conf = getconf_str(CNF_CHANGERFILE);
   tape_device = getconf_str(CNF_TAPEDEV);
 
   /* Get the configuration parameters */
@@ -1255,18 +1265,18 @@ main(
   if (strlen(tape_device)==1){
     if (read_config(chg_scsi_conf, changer) == -1)
     {
-      fprintf(stderr, "%s open: of %s failed\n", get_pname(), chg_scsi_conf);
+      g_fprintf(stderr, _("%s open: of %s failed\n"), get_pname(), chg_scsi_conf);
       return (2);
     }
     confnum=atoi(tape_device);
     if (changer->number_of_configs == 0)
     {
-       fprintf(stderr,"%s: changer->conf[%d] == NULL\n",
+       g_fprintf(stderr,_("%s: changer->conf[%d] == NULL\n"),
                get_pname(), confnum);
        return (2);
     }
     if (confnum >= changer->number_of_configs) {
-       fprintf(stderr,"%s: Configuration %s config # out of range (%d >= %d)\n",
+       g_fprintf(stderr,_("%s: Configuration %s config # out of range (%d >= %d)\n"),
                get_pname(), chg_scsi_conf,
                confnum, 
                changer->number_of_configs);
@@ -1328,11 +1338,10 @@ main(
     if (OpenDevice(INDEX_CHANGER , changer_dev, "changer_dev", changer->conf[confnum].changerident) == 0)
       {
         int localerr = errno;
-        fprintf(stderr, "%s: open: %s: %s\n", get_pname(), 
+        g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), 
                 changer_dev, strerror(localerr));
-        printf("%s open: %s: %s\n", "<none>", changer_dev, strerror(localerr));
-        dbprintf(("%s: open: %s: %s\n", get_pname(),
-                  changer_dev, strerror(localerr)));
+        g_printf(_("%s open: %s: %s\n"), _("<none>"), changer_dev, strerror(localerr));
+        dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr));
         return 2;
       }
 
@@ -1348,7 +1357,7 @@ main(
       {
         if (OpenDevice(INDEX_TAPE, tape_device, "tape_device", changer->conf[confnum].tapeident) == 0)
           {
-            dbprintf(("warning open of %s: failed\n",  tape_device));
+            dbprintf(_("warning open of %s: failed\n"),  tape_device);
           }
       }
 
@@ -1359,7 +1368,7 @@ main(
       {
         if (OpenDevice(INDEX_TAPECTL, scsitapedevice, "scsitapedevice", changer->conf[confnum].tapeident) == 0)
           {
-            dbprintf(("warning open of %s: failed\n", scsitapedevice));
+            dbprintf(_("warning open of %s: failed\n"), scsitapedevice);
           }
       }
     
@@ -1373,7 +1382,7 @@ main(
       {
         if (pDev[INDEX_TAPE].avail == 0 && pDev[INDEX_TAPECTL].avail == 0)
           {
-            printf("No device found for tape eject");
+            g_printf(_("No device found for tape eject"));
             return(2);
           }
       }
@@ -1395,39 +1404,38 @@ main(
       {
         if (changer->labelfile == NULL)
           {
-            printf("labelfile param not set in your config\n");
+            g_printf(_("labelfile param not set in your config\n"));
             return(2);
           }
       }
     
     if (slot_file == NULL)
       {
-        printf("slotfile param. not set in your config\n");
+        g_printf(_("slotfile param. not set in your config\n"));
         return(2);
       }
     
     if (access(slot_file,R_OK|W_OK) != 0)
       {
-        printf("slotfile %s does not exsist or is not read/write\n", slot_file);
+        g_printf(_("slotfile %s does not exsist or is not read/write\n"), slot_file);
         return(2);
       }
 
   } else { /* if (strlen(tape_device)==1) */
-       printf("please check your config and use a config file for chg-scsi\n");
+       g_printf(_("please check your config and use a config file for chg-scsi\n"));
        return(2);
   }
 
   drivecnt = get_drive_count(fd);
 
   if (drive_num > drivecnt) {
-    printf("%s drive number error (%d > %d)\n", "<none>"
+    g_printf(_("%s drive number error (%d > %d)\n"), _("<none>")
            drive_num, drivecnt);
-    fprintf(stderr, "%s: requested drive number (%d) greater than "
-            "number of supported drives (%d)\n", get_pname(), 
+    g_fprintf(stderr, _("%s: requested drive number (%d) greater than "
+            "number of supported drives (%d)\n"), get_pname(), 
             drive_num, drivecnt);
-    dbprintf(("%s: requested drive number (%d) greater than "
-              "number of supported drives (%d)\n", get_pname(), 
-              drive_num, drivecnt));
+    dbprintf(_("requested drive number (%d) is greater than "
+              "number of supported drives (%d)\n"), drive_num, drivecnt);
     return 2;
   }
 
@@ -1456,7 +1464,7 @@ main(
     strncpy(pbarcoderes->data.barcode, pDTE[drive_num].VolTag,
           SIZEOF(pbarcoderes->data.barcode));
     MapBarCode(changer->labelfile, pbarcoderes);
-    printf("0 0 0\n");
+    g_printf("0 0 0\n");
     break;
 
     /*
@@ -1469,9 +1477,9 @@ main(
         oldtarget = get_current_slot(slot_file);
         if (oldtarget < 0)
           {
-            dbprintf(("COM_INVENTORY: get_current_slot %d\n", oldtarget));
+            dbprintf(_("COM_INVENTORY: get_current_slot %d\n"), oldtarget);
             oldtarget = find_empty(fd, slot_offset, use_slots);
-            dbprintf(("COM_INVENTORY: find_empty %d\n", oldtarget));
+            dbprintf(_("COM_INVENTORY: find_empty %d\n"), oldtarget);
           }
 
         if (need_eject)
@@ -1504,7 +1512,7 @@ main(
      */
     if (BarCode(fd) == 1 && emubarcode != 1)
       {
-        dbprintf(("search : look for %s\n", com.parameter));
+        dbprintf(_("search : look for %s\n"), com.parameter);
         pbarcoderes->action = BARCODE_VOL;
         pbarcoderes->data.slot = -1;
         strncpy(pbarcoderes->data.voltag, com.parameter,
@@ -1517,7 +1525,7 @@ main(
              */
             if (pbarcoderes->data.slot == -1 && pbarcoderes->data.barcode == NULL)
               {
-                printf("Label %s not found (1)\n",com.parameter);
+                g_printf(_("Label %s not found (1)\n"),com.parameter);
                 endstatus = 2;
                 close(fd);
                 break;
@@ -1535,7 +1543,7 @@ main(
                   {
                     if (strcmp(pSTE[x].VolTag, pbarcoderes->data.barcode) == 0)
                       {
-                        dbprintf(("search : found slot %d\n", x));
+                        dbprintf(_("search : found slot %d\n"), x);
                         target = x;
                       }
                   }
@@ -1549,15 +1557,15 @@ main(
                   {
                     if (strcmp(pDTE[x].VolTag, pbarcoderes->data.barcode) == 0)
                       {
-                        dbprintf(("search : found in tape %d\n", x));
+                        dbprintf(_("search : found in tape %d\n"), x);
                         /*
                          */
                         if (x == drive_num) {
                           oldtarget = get_current_slot(slot_file);
-                          printf("%d %s\n", oldtarget - slot_offset, tape_device);
+                          g_printf("%d %s\n", oldtarget - slot_offset, tape_device);
                           return(0);
                         } else {
-                          printf("LABEL in wrong tape Unit\n");
+                          g_printf(_("LABEL in wrong tape Unit\n"));
                           return(2);
                         }
                       }
@@ -1567,7 +1575,7 @@ main(
                  */               
                 if (target == -1)
                   {
-                    printf("Label %s not found (2) \n",com.parameter);
+                    g_printf(_("Label %s not found (2) \n"),com.parameter);
                     close(fd);
                     endstatus = 2;
                     break;
@@ -1589,7 +1597,7 @@ main(
              */
             if (target == -1)
               {
-                printf("Label %s not found (3)\n",com.parameter);
+                g_printf(_("Label %s not found (3)\n"),com.parameter);
                 close(fd);
                 endstatus = 2;
                 break;
@@ -1604,7 +1612,7 @@ main(
      */
     if (emubarcode == 1 && BarCode(fd) != 1)
       {
-        dbprintf(("search : look for %s\n", com.parameter));
+        dbprintf(_("search : look for %s\n"), com.parameter);
         pbarcoderes->action = FIND_SLOT;
         pbarcoderes->data.slot = -1;
         strncpy(pbarcoderes->data.voltag, com.parameter,
@@ -1616,13 +1624,13 @@ main(
               {
                 target = pbarcoderes->data.slot;
               } else {
-                printf("Barcode DB out of sync \n");
+                g_printf(_("Barcode DB out of sync \n"));
                 close(fd);
                 endstatus=2;
                 break;
               }
           } else {
-            printf("Label %s not found \n",com.parameter);
+            g_printf(_("Label %s not found \n"),com.parameter);
             close(fd);
             endstatus = 2;
             break;
@@ -1637,7 +1645,7 @@ main(
       {
         if (is_positive_number(com.parameter)) {
           if ((target = atoi(com.parameter))>=use_slots) {
-            printf("<none> no slot `%d'\n",target);
+            g_printf(_("<none> no slot `%d'\n"),target);
             close(fd);
             endstatus = 2;
             break;
@@ -1663,9 +1671,9 @@ main(
       oldtarget = get_current_slot(slot_file);
       if (oldtarget < 0)
         {
-          dbprintf(("COM_SLOT: get_current_slot %d\n", oldtarget));
+          dbprintf(_("COM_SLOT: get_current_slot %d\n"), oldtarget);
           oldtarget = find_empty(fd, slot_offset, use_slots);
-          dbprintf(("COM_SLOT: find_empty %d\n", oldtarget));
+          dbprintf(_("COM_SLOT: find_empty %d\n"), oldtarget);
         }
       
       /*
@@ -1699,7 +1707,7 @@ main(
     put_current_slot(slot_file, target);
     
     if (!loaded && isempty(fd, target)) {
-      printf("%d slot %d is empty\n",target - slot_offset,
+      g_printf(_("%d slot %d is empty\n"),target - slot_offset,
              target - slot_offset);
       close(fd);
       endstatus = 1;
@@ -1712,7 +1720,7 @@ main(
           clean_tape(fd, tape_device, clean_file, drive_num,
                      clean_slot, maxclean, time_file);
         if (load(fd, drive_num, target) != 0) {
-          printf("%d slot %d move failed\n",target - slot_offset,
+          g_printf(_("%d slot %d move failed\n"),target - slot_offset,
                  target - slot_offset);  
           close(fd);
           endstatus = 2;
@@ -1726,21 +1734,21 @@ main(
           {
             if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
               {
-                printf("tape not ready\n");
+                g_printf(_("tape not ready\n"));
                 endstatus = 2;
                 break;
               }
           } else {
             if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
               {
-                printf("tape not ready\n");
+                g_printf(_("tape not ready\n"));
                 endstatus = 2;
                 break;
               }          
         }
       }
 
-    printf("%d %s\n", target - slot_offset, tape_device);
+    g_printf("%d %s\n", target - slot_offset, tape_device);
     break;
 
   case COM_INFO:
@@ -1752,13 +1760,13 @@ main(
       }
     loaded = loaded - (int)slot_offset;
       
-    printf("%d %d 1", loaded, use_slots);
+    g_printf("%d %d 1", loaded, use_slots);
 
     if (BarCode(fd) == 1 || emubarcode == 1)
       {
-        printf(" 1\n");
+        g_printf(" 1\n");
       } else {
-        printf(" 0\n");
+        g_printf(" 0\n");
       }
     break;
 
@@ -1767,9 +1775,9 @@ main(
 
     if (target < 0)
     {
-      dbprintf(("COM_RESET: get_current_slot %d\n", target));
+      dbprintf(_("COM_RESET: get_current_slot %d\n"), target);
       target = find_empty(fd, slot_offset, use_slots);
-      dbprintf(("COM_RESET: find_empty %d\n", target));
+      dbprintf(_("COM_RESET: find_empty %d\n"), target);
     }
 
     if (loaded) {
@@ -1798,14 +1806,14 @@ main(
     }
     
     if (isempty(fd, slot_offset)) {
-      printf("0 slot 0 is empty\n");
+      g_printf(_("0 slot 0 is empty\n"));
       close(fd);
       endstatus = 1;
       break;
     }
     
     if (load(fd, drive_num, slot_offset) != 0) {
-      printf("%d slot %d move failed\n",
+      g_printf(_("%d slot %d move failed\n"),
             drive_num, slot_offset);  
       close(fd);
       put_current_slot(slot_file, slot_offset);
@@ -1821,21 +1829,21 @@ main(
           {
             if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
               {
-                printf("tape not ready\n");
+                g_printf(_("tape not ready\n"));
                 endstatus = 2;
                 break;
               }
           } else {
             if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1)
               {
-                printf("tape not ready\n");
+                g_printf(_("tape not ready\n"));
                 endstatus = 2;
                 break;
               }          
           }
       }
     
-    printf("%d %s\n", slot_offset, tape_device);
+    g_printf(_("%d %s\n"), slot_offset, tape_device);
     break;
 
   case COM_EJECT:
@@ -1843,9 +1851,9 @@ main(
       target = get_current_slot(slot_file);
       if (target < 0)
         {
-          dbprintf(("COM_EJECT: get_current_slot %d\n", target));
+          dbprintf(_("COM_EJECT: get_current_slot %d\n"), target);
           target = find_empty(fd, slot_offset, use_slots);
-          dbprintf(("COM_EJECT: find_empty %d\n", target));
+          dbprintf(_("COM_EJECT: find_empty %d\n"), target);
         }
       
       if (need_eject)
@@ -1863,9 +1871,9 @@ main(
       if (ask_clean(scsitapedevice))
         clean_tape(fd, tape_device, clean_file, drive_num, clean_slot,
                    maxclean, time_file);
-      printf("%d %s\n", target, tape_device);
+      g_printf("%d %s\n", target, tape_device);
     } else {
-      printf("%d %s\n", target, "drive was not loaded");
+      g_printf(_("%d drive was not loaded\n"), target);
       endstatus = 1;
     }
     break;
@@ -1874,9 +1882,9 @@ main(
       target = get_current_slot(slot_file);
       if (target < 0)
         {
-          dbprintf(("COM_CLEAN: get_current_slot %d\n", target));
+          dbprintf(_("COM_CLEAN: get_current_slot %d\n"), target);
           target = find_empty(fd, slot_offset, use_slots);
-          dbprintf(("COM_CLEAN: find_empty %d\n",target));
+          dbprintf(_("COM_CLEAN: find_empty %d\n"),target);
         }
 
       if (need_eject)
@@ -1894,7 +1902,7 @@ main(
 
     clean_tape(fd, tape_device, clean_file, drive_num, clean_slot,
                maxclean, time_file);
-    printf("%s cleaned\n", tape_device);
+    g_printf(_("%s cleaned\n"), tape_device);
     break;
   };
 
@@ -1914,18 +1922,18 @@ main(
     {
       if (changer->autoinv == 1)
         {
-          DebugPrint(DEBUG_INFO,SECTION_INFO, "Do an inventory \n");
+          DebugPrint(DEBUG_INFO,SECTION_INFO, _("Do an inventory \n"));
           Inventory(changer->labelfile, drive_num, changer->eject,
                0, 0, clean_slot);
         } else {
-          DebugPrint(DEBUG_INFO,SECTION_INFO, "Set all entrys in DB to invalid\n");
+          DebugPrint(DEBUG_INFO,SECTION_INFO, _("Set all entrys in DB to invalid\n"));
           memset(pbarcoderes, 0 , SIZEOF(MBC_T));
           pbarcoderes->action = RESET_VALID;
           MapBarCode(changer->labelfile,pbarcoderes);
         }
     }
 
-  DebugPrint(DEBUG_INFO,SECTION_INFO,"Exit status -> %d\n", endstatus);
+  DebugPrint(DEBUG_INFO,SECTION_INFO,_("Exit status -> %d\n"), endstatus);
   dbclose();
   return endstatus;
 }
diff --git a/changer-src/chg-zd-mtx.sh b/changer-src/chg-zd-mtx.sh
new file mode 100644 (file)
index 0000000..1588c2e
--- /dev/null
@@ -0,0 +1,1367 @@
+#!@SHELL@ 
+#
+# Exit Status:
+# 0 Alles Ok
+# 1 Illegal Request
+# 2 Fatal Error
+#
+# Contributed by Eric DOUTRELEAU <Eric.Doutreleau@int-evry.fr>
+# This is supposed to work with Zubkoff/Dandelion version of mtx
+#
+# Modified by Joe Rhett <jrhett@isite.net>
+# to work with MTX 1.2.9 by Eric Lee Green http://mtx.sourceforge.net
+#
+# Modified by Jason Hollinden <jhollind@sammg.com> on 13-Feb-2001
+# to work with MTX 1.2.10, >9 slots, has barcode support, and works with
+# multiple configs at once.
+# NOTE:  Only tested the 2 additions with an ADIC Scalar 100.
+
+################################################################################
+# Here are the things you need to do and know to configure this script:
+#
+#   * Figure out what the robot device name is and what the tape drive
+#     device name is.  They will be different!
+#
+#     You cannot send robot commands to a tape drive and vice versa.
+#     Both should respond to "mtx -f /dev/... inquiry".  Hopefully,
+#     that output will make it obvious which is which.
+#
+#     For instance, here is what mtx has to say about my current robot:
+#
+#       Product Type: Medium Changer
+#       Vendor ID: 'ATL     '
+#       Product ID: 'ACL2640 206     '
+#       Revision: '2A5A'
+#       Attached Changer: No
+#
+#     and here is what it says about a tape drive:
+#
+#       Product Type: Tape Drive
+#       Vendor ID: 'Quantum '
+#       Product ID: 'DLT4000         '
+#       Revision: 'CD50'
+#       Attached Changer: No
+#
+#     Note the "Product Type" value makes it clear which is which.
+#
+#     If it is not obvious, "mf -f /dev/... rewind" should be happy when
+#     talking to a (loaded) tape drive but the changer should give some
+#     kind of error.  Similarly, "mtx -f /dev/... status" should show good
+#     results with the changer but fail with a tape drive device name.
+#
+#     Once you have this figured out, set "changerdev" in amanda.conf
+#     to the changer device and "tapedev" to the tape device.
+#
+#   * Find out what the first and last storage slots are.  Running
+#     "mtx -f /dev/... status" should give you something like this
+#     (although the output will vary widely based on the version of mtx
+#     and the specifics of your robot):
+#
+#        Storage Changer /dev/changer:1 Drives, 9 Slots ( 0 Import/Export )
+#      Data Transfer Element 0:Empty
+#            Storage Element 1:Full :VolumeTag=SR0001
+#            Storage Element 2:Full :VolumeTag=SR0002
+#            Storage Element 3:Full :VolumeTag=SR0003
+#            Storage Element 4:Full :VolumeTag=SR0004
+#            Storage Element 5:Full :VolumeTag=SR0005
+#            Storage Element 6:Full :VolumeTag=SR0006
+#            Storage Element 7:Full :VolumeTag=SR0007
+#            Storage Element 8:Full :VolumeTag=SR0008
+#            Storage Element 9:Full :VolumeTag=SR0009
+#            Storage Element 10 IMPORT/EXPORT:Full :VolumeTag=SR0009
+#
+#     This says the first storage slot (element) is "1" and the last
+#     is "9".  If you allocate the entire robot to Amanda, you do not need
+#     to set the "firstslot" or "lastslot" configuration file variables --
+#     the script will compute these values for you.
+#
+#     You do not have to allocate all of the slots for Amanda use,
+#     but whatever slots you use must be contiguous (i.e. 4 through 9
+#     in the above would be OK but 1, 2, 5, 6, 9 would not).  The one
+#     exception to this is that if one of the slots contains a cleaning
+#     cartridge, it may be in any slot (Amanda will just skip over it if
+#     it is between firstslot and lastslot).
+#
+#   * Speaking of cleaning cartridges, if you have a storage slot dedicated
+#     to one, figure out what slot it is in.  That slot number will go in
+#     the "cleanslot" variable.
+#
+#     Also, decide if you want the changer script to automatically run
+#     the cleaning tape through the drive after every so many mounts,
+#     and how many mounts you want to do between cleanings.  If you
+#     want the script to do this, set the "autoclean" variable to 1 and
+#     the "autocleancount" to the number of mounts between cleanings.
+#     If you do not want to do automatic cleanings (including not having
+#     a cleaning cartridge in the robot), set "autoclean" to 0.
+#
+#     Note that only a count of mounts is used to determine when it is
+#     time to clean.  The script does not try to detect if the drive is
+#     requesting cleaning, or how much the drive was used on a given
+#     mount.
+#
+#   * If you tell Amanda about a cleaning cartridge, whether for automatic
+#     operation or manual (amtape <config> clean), you must also tell
+#     the script how long it takes to run the cleaning cycle.  It is
+#     impossible for the script to determine when the cleaning operation
+#     is done, so the "cleancycle" variable is the number of seconds
+#     the longest cleaning operation takes (you'll just have to figure
+#     this out by watching it a few times, or maybe finding it in a tape
+#     drive hardware manual).  The script will sleep for this length of
+#     time whenever the cleaning tape is referenced.  The default is 120
+#     seconds (two minutes).
+#
+#   * Figure out the drive slot number.  By default, it is set to 0.
+#     In the example above, the tape drive ("Data Transfer Element")
+#     is in slot 0. If your drive slot is not 0, you
+#     need to set the drive slot number with the "driveslot" variable.
+#
+#   * Figure out whether your robot has a barcode reader and whether
+#     your version of mtx supports it.  If you see "VolumeTag" entries
+#     in the "mtx -f /dev/xxx status" output you did above, you have
+#     a reader and mtx can work with it, so you may set the "havereader"
+#     variable to 1.  The default is 0 (do not use a reader).
+#
+#   * Pick any tape to load and then determine if the robot can put it
+#     away directly or whether an "offline" must be done first.
+#
+#     With the tape still mounted and ready, try to put the tape away
+#     with "mtx".  If you get some kind of error, which is the most
+#     common response, try "mt -f /dev/... offline", wait for the drive
+#     to unload and make sure the robot takes no action on its own to
+#     store the tape.  Assuming it does not, try the "mtx" command again
+#     to store the tape.
+#
+#     If you had to issue the "mt -f /dev/... offline" before you could
+#     use "mtx" to store the tape, set the "offline_before_unload"
+#     variable to 1.  If "mtx" unloaded the drive and put the tape away
+#     all by itself, set it to 0.
+#
+#   * Some drives and robots require a small delay between unloading the
+#     tape and instructing the robot to move it back to storage.
+#     For instance, if you try to grab the tape too soon on an ATL robot
+#     with DLT tape drives, it will rip the leader out of the drive and
+#     require sincerely painful hardware maintenance.
+#
+#     If you need a little delay, set the "unloadpause" variable to
+#     the number of seconds to wait before trying to take a tape from
+#     a drive back to storage.  The default is 0.
+#
+#   * Some drives also require a short pause after loading, or the drive
+#     will return an I/O error during a test to see if it's online (which
+#     this script uses "mt rewind" to test).  My drives don't recover from
+#     this, and must be reloaded before they will come online after failing
+#     such a test.  For this reason there is an "initial_poll_delay"
+#     variable which will pause for a certain number of seconds before
+#     looping through the online test for the first time.  The default is 0.
+####
+
+####
+# Now you are ready to set up the variables in the changer configuration
+# file.
+#
+# All variables are in "changerfile".conf where "changerfile" is set
+# in amanda.conf.  For example, if amanda.conf has:
+#
+#      changerfile="/etc/amanda/Dailyset1/CHANGER"
+#    or changerfile="/etc/amanda/Dailyset1/CHANGER.conf"
+#
+# the variables must be in "/etc/amanda/Dailyset1/CHANGER.conf".
+# The ".conf" is appended only if it's not there".
+#
+# If "changerfile" is a relative path, it is relative to the directory
+# that contains amanda.conf.  That also happens to be the directory Amanda
+# makes current before running this script.
+#
+# Here is a commented out example file with all the variables and showing
+# their default value (if any):
+####
+# firstslot=?              #### First storage slot (element) -- required
+# lastslot=?               #### Last storage slot (element) -- required
+# cleanslot=-1             #### Slot with cleaner tape -- default is "-1"
+#                          #### Set negative to indicate no cleaner available
+# driveslot=0              #### Drive slot number.  Defaults to 0
+#                          #### Use the 'Data Transfer Element' you want
+#
+#   # Do you want to clean the drive after a certain number of accesses?
+#   # NOTE - This is unreliable, since 'accesses' aren't 'uses', and we
+#   #        have no reliable way to count this.  A single amcheck could
+#   #        generate as many accesses as slots you have, plus 1.
+#   # ALSO NOTE - many modern tape loaders handle this automatically.
+#
+# autoclean=0              #### Set to '1' or greater to enable
+#
+# autocleancount=99        #### Number of access before a clean.
+#
+# havereader=0             #### If you have a barcode reader, set to 1.
+#
+# offline_before_unload=0   #### Does your robot require an
+#                          #### 'mt offline' before mtx unload?
+#
+# poll_drive_ready=NN      #### Time (seconds) between tests to see if
+#                          #### the tape drive has gone ready (default: 3).
+#
+# max_drive_wait=NN        #### Maximum time (seconds) to wait for the
+#                          #### tape drive to become ready (default: 120).
+#
+# initial_poll_delay=NN            #### initial delay after load before polling for
+#                          #### readiness
+#
+####
+
+####
+# Now it is time to test the setup.  Do all of the following in the
+# directory that contains the amanda.conf file, and do all of it as
+# the Amanda user.
+#
+#   * Run this:
+#
+#       .../chg-zd-mtx -info
+#       echo $?             #### (or "echo $status" if you use csh/tcsh)
+#
+#     You should get a single line from the script like this (the actual
+#     numbers will vary):
+#
+#       5 9 1 1
+#
+#     The first number (5) is the "current" slot.  This may or may not be
+#     the slot actually loaded at the moment (if any).  It is the slot
+#     Amanda will try to use next.
+#
+#     The second number (9) is the number of slots.
+#
+#     The third number will always be "1" and indicates the changer is
+#     capable of going backward.
+#
+#     The fourth number is optional.  If you set $havereader to 1, it
+#     will be "1", otherwise it will not be present.
+#
+#     The exit code ($? or $status) should be zero.
+#
+#   * Run this:
+#
+#       .../chg-zd-mtx -reset
+#       echo $?
+#
+#     The script should output a line like this:
+#
+#       1 /dev/rmt/0mn
+#
+#     The number at the first should match $firstslot.  The device name
+#     after that should be your tape device.
+#
+#     The exit code ($? or $status) should be zero.
+#
+#   * Run this:
+#
+#       .../chg-zd-mtx -slot next
+#       echo $?
+#
+#     The script should output a line like this:
+#
+#       2 /dev/rmt/0mn
+#
+#     The number at the first should be one higher than $firstslot.
+#     The device name after that should be your tape device.
+#
+#     The exit code ($? or $status) should be zero.
+#
+#   * Run this:
+#
+#       .../chg-zd-mtx -slot current
+#       echo $?
+#
+#     Assuming the tape is still loaded from the previous test, the
+#     robot should not move and the script should report the same thing
+#     the previous command did.
+#
+#   * If you continue to run "-slot next" commands, the robot should load
+#     each tape in turn then wrap back around to the first when it
+#     reaches $lasttape.  If $cleanslot is within the $firstslot to
+#     $lastslot range, the script will skip over that entry.
+#
+#   * Finally, try some of the amtape commands and make sure they work:
+#
+#       amtape <config> reset
+#       amtape <config> slot next
+#       amtape <config> slot current
+#
+#   * If you set $havereader non-zero, now would be a good time to create
+#     the initial barcode database:
+#
+#       amtape <config> update
+####
+
+################################################################################
+# To debug this script, first look in @AMANDA_DBGDIR@.  The script
+# uses one of two log files there, depending on what version of Amanda
+# is calling it.  It may be chg-zd-mtx.YYYYMMDD*.debug, or it may be
+# changer.debug.driveN where 'N' is the drive number.
+#
+# If the log file does not help, try running the script, **as the Amanda
+# user**, in the amanda.conf directory with whatever set of args the log
+# said were used when you had a problem.  If nothing else useful shows up
+# in the output, try running the script with the DEBUG environment variable
+# set non-null, e.g.:
+#
+#      env DEBUG=yes .../chg-zd-mtx ...
+################################################################################
+
+# source utility functions and values from configure
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+amlibexecdir=@amlibexecdir@
+. ${amlibexecdir}/chg-lib.sh
+
+test -n "$DEBUG" && set -x
+TMPDIR="@AMANDA_TMPDIR@"
+DBGDIR="@AMANDA_DBGDIR@"
+
+argv0=$0
+myname=`expr "$argv0" : '.*/\(.*\)'`
+
+config=`pwd 2>/dev/null`
+config=`expr "$config" : '.*/\(.*\)'`
+
+###
+# Functions to write a new log file entry and append more log information.
+###
+
+ds=`date '+%H:%M:%S' 2>/dev/null`
+if [ $? -eq 0  -a  -n "$ds" ]; then
+       logprefix=`echo "$ds" | sed 's/./ /g'`
+else
+       logprefix=""
+fi
+
+LogAppend() {
+       if [ -z "$logprefix" ]; then
+               echo "$@" >> $DBGFILE
+       else
+               echo "$logprefix" "$@" >> $DBGFILE
+       fi
+}
+
+Log() {
+       if [ -z "$logprefix" ]; then
+               echo "===" "`date`" "===" >> $DBGFILE
+               echo "$@" >> $DBGFILE
+       else
+               ds=`date '+%H:%M:%S' 2>/dev/null`
+               echo "$ds" "$@" >> $DBGFILE
+       fi
+}
+
+###
+# Common exit function.
+#
+#   $1 = exit code
+#   $2 = slot result
+#   $3 = additional information (error message, tape devive, etc)
+###
+
+internal_call=0
+Exit() {
+       if [ $internal_call -gt 0 ]; then
+               call_type=Return
+       else
+               call_type=Exit
+       fi
+       code=$1
+       shift
+       exit_slot=$1
+       shift
+       exit_answer="$@"
+       Log $call_type "($code) -> $exit_slot $@"
+       echo "$exit_slot" "$@"
+       if [ $call_type = Return ]; then
+               return $code
+       fi
+       amgetconf dbclose.$argv0:$DBGFILE > /dev/null 2>&1
+       exit $code
+}
+
+###
+# Function to run another command and log it.
+###
+
+Run() {
+       Log `_ 'Running: %s' "$@"`
+       rm -f $stdout $stderr
+       "$@" > $stdout 2> $stderr
+       exitcode=$?
+       Log `_ 'Exit code: %s' "$exitcode"`
+       if [ -s $stdout ]
+       then
+               LogAppend Stdout:
+               cat $stdout >> $DBGFILE
+       fi
+       if [ -s $stderr ]
+       then
+               LogAppend Stderr:
+               cat $stderr >> $DBGFILE
+       fi
+       cat $stdout
+       cat $stderr 1>&2
+       return $exitcode
+}
+
+###
+# Return success if the arg is numeric.
+###
+
+IsNumeric() {
+       test -z "$1" && return 1
+       x="`expr "$1" : '\([-0-9][0-9]*\)' 2>/dev/null`"
+       return `expr X"$1" != X"$x"`
+}
+
+###
+# Run $MTX status unless the previous output is still valid.
+###
+
+mtx_status_valid=0
+get_mtx_status() {
+       test -n "$DEBUG" && set -x
+       if [ $mtx_status_valid -ne 0 ]; then
+               return 0
+       fi
+       rm -f $mtx_status
+       Run $MTX status > $mtx_status 2>&1
+       status=$?
+       if [ $status -eq 0 ]; then
+               mtx_status_valid=1
+       fi
+       return $status
+}
+
+###
+# Determine the slot currently loaded.  Set $loadedslot to the slot
+# currently loaded, or "-1", and $loadedbarcode to the corresponding
+# barcode (or nothing).
+###
+
+get_loaded_info() {
+       test -n "$DEBUG" && set -x
+       get_mtx_status
+
+       set x `sed -n '
+/^Data Transfer Element:Empty/                          {
+    s/.*/-1/p
+    q
+}
+/^Data Transfer Element '$driveslot':Empty/             {
+    s/.*/-1/p
+    q
+}
+/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/               {
+    s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/\1 \2/p
+    q
+}
+/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/  {
+    s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/\1 \2/p
+    q
+}
+/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded):VolumeTag *= *\([^     ]*\)/        {
+    s/.*:VolumeTag *= *\([^     ]*\)/-2 \1/p
+    q
+}
+/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/                           {
+    s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p
+    q
+}
+/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/              {
+    s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p
+    q
+}
+/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/    {
+    s/.*/-2/p
+    q
+}
+' < $mtx_status 2>&1`
+       shift                                   # get rid of the "x"
+       loadedslot=$1
+       loadedbarcode=$2
+       if [ -z "$loadedslot" ]; then
+               Exit 2 \
+                   `_ '<none>'` \
+                   "could not determine current slot, are you sure your drive slot is $driveslot"
+               return $?                       # in case we are internal
+       fi
+
+       #Use the current slot if it's empty and we don't know which slot is loaded'
+       if [ $loadedslot -eq -2 ]; then
+               set x `sed -n '
+{
+    /^.*Storage Element '$currentslot':Empty/ {
+       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
+        q
+    }
+    /^.*Storage Element '$currentslot':Full/ {
+       s/.*Storage Element \([0-9][0-9]*\):Full/-2/p
+        q
+    }
+    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Empty/ {
+       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
+        q
+    }
+    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Full/ {
+       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/-2/p
+        q
+    }
+}
+' < $mtx_status 2>& 1`
+               shift                           # get rid of the "x"
+               loadedslotx=$1
+               if [ ! -z $loadedslotx ]; then
+                       loadedslot=$loadedslotx
+               fi
+       fi
+
+       #Use the first empty slot if we don't know which slot is loaded'
+       if [ $loadedslot -eq -2 ]; then
+               set x `sed -n '
+{
+    /^.*Storage Element \([0-9][0-9]*\):Empty/ {
+       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
+        q
+    }
+    /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/ {
+       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
+        q
+    }
+}
+' < $mtx_status 2>& 1`
+               shift                           # get rid of the "x"
+               loadedslot=$1
+       fi
+
+       if IsNumeric "$loadedslot" ; then
+               :
+       else
+               Exit 2 \
+                    `_ '<none>'` \
+                    "currently loaded slot ($loadedslot) not numeric"
+               return $?                       # in case we are internal
+       fi
+       Log       `_ 'STATUS   -> currently loaded slot = %s' "$loadedslot"`
+       LogAppend `_ '         -> currently loaded barcode = "%s"' "$loadedbarcode"`
+}
+
+###
+# Get a list of slots between $firstslot and $lastslot, if they are set.
+# If they are not set, set them to the first and last slot seen on the
+# assumption the entire robot is to be used (???).
+###
+
+slot_list=
+get_slot_list() {
+       test -n "$DEBUG" && set -x
+       if [ -n "$slot_list" ]; then
+               return
+       fi
+       get_mtx_status
+       slot_list=`sed -n '
+/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ {
+    s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p
+}
+/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ {
+    s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p
+}
+/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ {
+    : loop
+    n
+    /^.*Storage Element \([0-9][0-9]*\):Full/ {
+        s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p
+        b loop
+    }
+    /^.*Storage Element \([0-9][0-9]*\):Empty/ {
+       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
+    }
+}
+/^.*Storage Element \([0-9][0-9]*\):Full/ {
+    s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p
+}
+/^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/ {
+    s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full.*/\1/p
+}
+' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n`
+       slot_list=`echo $slot_list`             # remove the newlines
+       if [ $firstslot -lt 0 -o $lastslot -lt 0 ]; then
+               last=$lastslot
+               for slot in $slot_list; do
+                       if [ $firstslot -lt 0 ]; then
+                               Log `_ 'SLOTLIST -> firstslot set to %s' "$slot"`
+                               firstslot=$slot
+                       fi
+                       if [ $lastslot -lt 0 ]; then
+                               last=$slot
+                       fi
+               done
+               if [ $lastslot -lt 0 -a $last -ge 0 ]; then
+                       Log `_ 'SLOTLIST -> lastslot set to %s' "$last"`
+                       lastslot=$last
+               fi
+               if [ $firstslot -lt 0 ]; then
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ 'cannot determine first slot'`
+                       return $?               # in case we are internal
+               elif [ $lastslot -lt 0 ]; then
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ 'cannot determine last slot'`
+                       return $?               # in case we are internal
+               fi
+       fi
+       amanda_slot_list=
+       for slot in $slot_list; do
+               if [ $slot -ge $firstslot -a $slot -le $lastslot ]; then
+                       amanda_slot_list="$amanda_slot_list $slot"
+               fi
+       done
+       if [ -z "$amanda_slot_list" ]; then
+               Exit 2 \
+                    `_ '<none>'` \
+                    "no slots available"
+               return $?                       # in case we are internal
+       fi
+       slot_list="$amanda_slot_list"
+}
+
+DBGFILE=`amgetconf dbopen.$argv0 2>/dev/null`
+if [ -z "$DBGFILE" ]
+then
+       DBGFILE=/dev/null                       # will try this again below
+fi
+
+changerfile=`amgetconf changerfile 2>/dev/null`
+if [ -z "$changerfile" ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "changerfile must be specified in amanda.conf"
+fi
+
+rawtape=`amgetconf tapedev 2>/dev/null`
+if [ -z "$rawtape" ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "tapedev may not be empty"
+fi
+tape=`tape_device_filename "$rawtape"`
+if [ -z "$tape" ]; then
+        Exit 2 \
+             ` _ '<none>'` \
+             "tapedev $rawtape is not a tape device."
+elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "tapedev ($tape) may not be the null device"
+fi
+# Confusingly, TAPE is the name of the changer device...
+TAPE=`amgetconf changerdev 2>/dev/null`
+if [ -z "$TAPE" ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "changerdev may not be empty"
+elif [ $TAPE = "/dev/null" ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "changerdev ($TAPE) may not be the null device"
+fi
+export TAPE                                    # for mtx command
+
+CHANGER=$TAPE 
+export CHANGER                                 # for mtx command
+
+#### Set up the various config files.
+
+conf_match=`expr "$changerfile" : .\*\.conf\$`
+if [ $conf_match -ge 6 ]; then
+       configfile=$changerfile
+       changerfile=`echo $changerfile | sed 's/.conf$//g'`
+else
+       configfile=$changerfile.conf
+fi
+
+if [ ! -e $configfile ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "configuration file \"$configfile\" doesn't exist"
+fi
+if [ ! -f $configfile ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "configuration file \"$configfile\" is not a file"
+fi
+
+cleanfile=$changerfile-clean
+accessfile=$changerfile-access
+slotfile=$changerfile-slot
+labelfile=$changerfile-barcodes
+[ ! -s $cleanfile ] && echo 0 > $cleanfile
+[ ! -s $accessfile ] && echo 0 > $accessfile
+[ ! -s $slotfile ] && echo -1 > $slotfile
+[ ! -f $labelfile ] && > $labelfile
+cleancount=`cat $cleanfile`
+accesscount=`cat $accessfile`
+
+#### Dig out of the config file what is needed
+
+varlist=
+varlist="$varlist firstslot"
+varlist="$varlist lastslot"
+varlist="$varlist cleanslot"
+varlist="$varlist cleancycle"
+varlist="$varlist OFFLINE_BEFORE_UNLOAD"       # old name
+varlist="$varlist offline_before_unload"
+varlist="$varlist unloadpause"
+varlist="$varlist AUTOCLEAN"                   # old name
+varlist="$varlist autoclean"
+varlist="$varlist autocleancount"
+varlist="$varlist havereader"
+varlist="$varlist driveslot"
+varlist="$varlist poll_drive_ready"
+varlist="$varlist initial_poll_delay"
+varlist="$varlist max_drive_wait"
+
+for var in $varlist
+do
+       val="`cat $configfile 2>/dev/null | sed -n '
+# Ignore comment lines (anything starting with a #).
+/^[    ]*#/d
+# Find the first var=val line in the file, print the value and quit.
+/^[    ]*'$var'[       ]*=[    ]*\([^  ][^     ]*\).*/ {
+       s/^[    ]*'$var'[       ]*=[    ]*\([^  ][^     ]*\).*/\1/p
+       q
+}
+'`"
+       eval $var=\"$val\"
+done
+
+# Deal with driveslot first so we can get DBGFILE set if we are still
+# using the old amgetconf.
+
+if [ -z "$driveslot" ]; then
+       driveslot=0;
+fi
+
+# Get DBGFILE set if it is not already.
+
+if [ $DBGFILE = /dev/null ]; then
+       if [ -d "$DBGDIR" ]; then
+               DBGFILE=$DBGDIR/changer.debug.drive$driveslot
+       else
+               DBGFILE=/dev/null
+       fi
+       Log `_ '=== Start %s ===' "\`date\`"`
+fi
+
+stdout=$TMPDIR/$myname.1.$$
+stderr=$TMPDIR/$myname.2.$$
+mtx_status=$TMPDIR/$myname.status.$$
+trap "rm -f $stdout $stderr $mtx_status" 0     # exit cleanup
+
+Log `_ 'Using config file %s' "$configfile"`
+
+# Log the argument list.
+
+Log `_ "Arg info:"`
+LogAppend "\$# = $#"
+i=0
+LogAppend "\$$i = \"$argv0\""
+for arg in "$@"; do
+       i=`expr $i + 1`
+       LogAppend "\$$i = \"$arg\""
+done
+
+# Set the default config values for those not in the file.  Log the
+# results and make sure each is valid (numeric).
+
+firstslot=${firstslot:-'-1'}                           # default: mtx status
+lastslot=${lastslot:-'-1'}                             # default: mtx status
+cleanslot=${cleanslot:-'-1'}                           # default: -1
+cleancycle=${cleancycle:-'120'}                                # default: two minutes
+if [ -z "$offline_before_unload" -a -n "$OFFLINE_BEFORE_UNLOAD" ]; then
+       offline_before_unload=$OFFLINE_BEFORE_UNLOAD    # (old name)
+fi
+offline_before_unload=${offline_before_unload:-'0'}    # default: 0
+unloadpause=${unloadpause:-'0'}                                # default: 0
+if [ -z "$autoclean" -a -n "$AUTOCLEAN" ]; then
+       autoclean=$AUTOCLEAN                            # (old name)
+fi
+autoclean=${autoclean:-'0'}                            # default: 0
+autocleancount=${autocleancount:-'99'}                 # default: 99
+havereader=${havereader:-'0'}                          # default: 0
+poll_drive_ready=${poll_drive_ready:-'3'}              # default: three seconds
+initial_poll_delay=${initial_poll_delay:-'0'}          # default: zero zeconds
+max_drive_wait=${max_drive_wait:-'120'}                        # default: two minutes
+
+# check MT and MTX for sanity
+if test "${MTX:0:1}" = "/"; then
+    if ! test -f "${MTX}"; then
+       Exit 2 \
+           `_ '<none>'` \
+           `_ "mtx binary at '%s' not found" "$MTX"`
+    fi
+    if ! test -x "${MTX}"; then
+       Exit 2 \
+           `_ '<none>'` \
+           `_ "mtx binary at '%s' is not executable" "$MTX"`
+    fi
+else
+    # try running it to see if the shell can find it
+    "$MTX" >/dev/null 2>/dev/null
+    if test $? -eq 127 -o $? -eq 126; then
+       Exit 2 \
+           `_ '<none>'` \
+           `_ "Could not run mtx binary at '%s'" "$MTX"`
+    fi
+fi
+
+error=`try_find_mt`
+if test $? -ne 0; then
+    Exit 2 '<none>' $error
+fi
+
+get_slot_list
+
+Log `_ "Config info:"`
+for var in $varlist; do
+       if [ $var = "OFFLINE_BEFORE_UNLOAD" ]; then
+               continue                        # old name
+       elif [ $var = "AUTOCLEAN" ]; then
+               continue                        # old name
+       fi
+       eval val=\"'$'$var\"
+       if [ -z "$val" ]; then
+               Exit 2 \
+                    `_ '<none>'` \
+                    `_ '%s missing in %s' "$var" "$configfile"`
+       fi
+       if IsNumeric "$val" ; then
+               :
+       else
+               Exit 2 \
+                    `_ '<none>'` \
+                    `_ '%s (%s) not numeric in %s' "$var" "$val" "$configfile"`
+       fi
+       LogAppend $var = \"$val\"
+done
+
+# Run the rest of the config file sanity checks.
+
+if [ $firstslot -gt $lastslot ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            `_ 'firstslot (%s) greater than lastslot (%s) in %s' "$firstslot" "$lastslot" "$configfile"`
+fi
+if [ $autoclean -ne 0 -a $cleanslot -lt 0 ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            `_ 'autoclean set but cleanslot not valid (%s)' "$cleanslot"`
+fi
+
+# Set up the current slot
+
+currentslot=`cat $slotfile`
+if IsNumeric "$currentslot" ; then
+       if [ $currentslot -lt $firstslot ]; then
+               Log `_ 'SETUP    -> current slot %s less than %s ... resetting to %s' "$currentslot" "$firstslot" "$firstslot"`
+               currentslot=$firstslot
+       elif [ $currentslot -gt $lastslot ]; then
+               Log `_ 'SETUP    -> current slot %s greater than %s ... resetting to %s' "$currentslot" "$lastslot" "$lastslot"`
+               currentslot=$lastslot
+       fi
+else
+       Log `_ 'SETUP    -> contents of %s (%s) invalid, setting current slot to first slot (%s)' "$slotfile" "$currentslot" "$firstslot"`
+       currentslot=$firstslot
+fi
+
+found_current=0
+first_slot_in_list=-1
+next_slot_after_current=-1
+for slot in $slot_list; do
+       if [ $first_slot_in_list -lt 0 ]; then
+               first_slot_in_list=$slot        # in case $firstslot is missing
+       fi
+       if [ $slot -eq $currentslot ]; then
+               found_current=1
+               break
+       elif [ $slot -gt $currentslot ]; then
+               next_slot_after_current=$slot   # $currentslot is missing
+               break
+       fi
+done
+if [ $found_current -eq 0 ]; then
+       if [ $next_slot_after_current -lt 0 ]; then
+               new_currentslot=$first_slot_in_list
+       else
+               new_currentslot=$next_slot_after_current
+       fi
+       Log `_ 'WARNING  -> current slot %s not available, setting current slot to next slot (%s)' "$currentslot" "$new_currentslot"`
+       currentslot=$new_currentslot
+fi
+
+# More routines.
+
+###
+# Eject the current tape and put it away.
+###
+
+eject() {
+       test -n "$DEBUG" && set -x
+       Log `_ 'EJECT    -> ejecting tape from %s' "$tape"`
+       get_loaded_info 
+       if [ $loadedslot -gt 0 ]; then
+               Log `_ 'EJECT    -> moving tape from drive %s to storage slot %s' "$driveslot" "$loadedslot"`
+               if [ $offline_before_unload -ne 0 ]; then
+                        Run try_eject_device $tape
+               fi
+               sleep $unloadpause
+               result=`Run $MTX unload $loadedslot $driveslot 2>&1`
+               status=$?
+               Log `_ '         -> status %s, result "%s"' "$status" "$result"`
+               mtx_status_valid=0
+               if [ $status -ne 0 ]; then
+                       answer="$result"
+                       code=2
+               else
+                       answer="$rawtape"
+                       code=0
+               fi
+       else
+               answer=`_ 'Drive was not loaded'`
+               code=1
+       fi
+       Exit $code "$loadedslot" "$answer"
+       return $?                               # in case we are internal
+}
+
+###
+# Reset the robot back to the first slot.
+###
+
+reset() {
+       test -n "$DEBUG" && set -x
+       Log `_ 'RESET    -> loading tape from slot %s to drive %s (%s)' "$firstslot" "$driveslot" "$tape"`
+       # Call loadslot without doing it as an internal and let it finish
+       # things up.
+       loadslot $firstslot
+       # NOTREACHED
+       Exit 2 `_ '<none>'` `_ 'reset: should not get here'`
+       return $?                               # in case we are internal
+}
+
+###
+# Unload the current tape (if necessary) and load a new one (unless
+# "advance").  If no tape is loaded, get the value of "current" from
+# $slotfile.
+###
+
+loadslot() {
+       test -n "$DEBUG" && set -x
+       if [ $# -lt 1 ]; then
+               Exit 2 `_ '<none>'` `_ 'Missing -slot argument'`
+               return $?                       # in case we are internal
+       fi
+       whichslot=$1
+       Log `_ 'LOADSLOT -> load drive %s (%s) from slot %s' "$driveslot" "$tape" "$whichslot"`
+
+       numeric=`echo $whichslot | sed 's/[^0-9]//g'`
+       case $whichslot in
+       current|prev|next|advance)
+               find_slot=$currentslot
+               ;;
+       first)
+               find_slot=$firstslot
+               ;;
+       last)
+               find_slot=$lastslot
+               ;;
+       $numeric)
+               find_slot=$numeric
+               ;;
+       clean)
+               find_slot=$cleanslot
+               ;;
+       *)
+               Exit 2 `_ '<none>'` `_ 'Illegal slot: "%s"' "$whichslot"`
+               return $?                       # in case we are internal
+               ;;
+       esac
+
+       # Find the requested slot in the slot list.  By loading the "set"
+       # command with multiple copies, we guarantee that if the slot is
+       # found, we can look both forward and backward without running
+       # off the end.  Putting $cleanslot at the end allows us to find
+       # that slot since it is not in $slot_list.
+       get_slot_list
+       set x $slot_list $slot_list $slot_list $cleanslot
+       shift                                   # get rid of the "x"
+       prev_slot=$1
+       shift
+       while [ $# -gt 0 ]; do
+               if [ $1 -eq $find_slot ]; then
+                       break
+               fi
+               prev_slot=$1
+               shift
+       done
+       if [ $# -le 0 ]; then
+               Exit 2 \
+                    `_ '<none>'` \
+                    `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"`
+               return $?                       # in case we are internal
+       fi
+
+       # Determine the slot to load.
+       case $whichslot in
+       next|advance)
+               shift
+               loadslot=$1
+               ;;
+       prev)
+               loadslot=$prev_slot
+               ;;
+       *)
+               loadslot=$find_slot
+       esac
+
+       # If the desired slot is already loaded, we are done.  Only update
+       # current slot if this is not the cleaning slot.
+       get_loaded_info
+       if [ $loadslot = $loadedslot ]; then
+               if [ $loadslot -ne $cleanslot ]; then
+                       rm -f $slotfile
+                       echo $loadslot > $slotfile
+               fi
+               Exit 0 "$loadedslot" "$rawtape"
+               return $?                       # in case we are internal
+       fi
+       if [ $loadedslot -eq -2 ]; then
+               Exit 0 "$loadedslot" "$rawtape"
+               return $?                       # in case we are internal
+        fi
+
+       # If we are loading the cleaning tape, bump the cleaning count
+       # and reset the access count.  Otherwise, bump the access count
+       # and see if it is time to do a cleaning.
+       if [ $loadslot = $cleanslot ]; then
+               rm -f $cleanfile $accessfile
+               expr $cleancount + 1 > $cleanfile
+               echo 0 > $accessfile
+       else
+               rm -f $accessfile
+               expr $accesscount + 1 > $accessfile
+               if [ $autoclean -ne 0 -a $accesscount -gt $autocleancount ]
+               then
+                       internal_call=`expr $internal_call + 1`
+                       loadslot clean > /dev/null 2>&1
+                       status=$?
+                       internal_call=`expr $internal_call - 1`
+                       if [ $status -ne 0 ]; then
+                               Exit $status "$loadslot" "$exit_answer"
+                               return $?       # in case we are internal
+                       fi
+
+                       # Slot $cleanslot might contain an ordinary tape
+                       # rather than a cleaning tape.  A cleaning tape
+                       # *MIGHT* auto-eject; an ordinary tape does not.
+                       # We therefore have to read the status again to
+                       # check what actually happened.
+                       mtx_status_valid=0
+                       get_loaded_info
+               fi
+       fi
+
+       # Unload whatever tape is in the drive.
+       internal_call=`expr $internal_call + 1`
+       eject > /dev/null 2>&1
+       status=$?
+       internal_call=`expr $internal_call - 1`
+       if [ $status -gt 1 ]; then
+               Exit $status "$exit_slot" "$exit_answer"
+               return $?                       # in case we are internal
+       fi
+
+       # If we were doing an "advance", we are done.
+       if [ $whichslot = advance ]; then
+               if [ $loadslot -ne $cleanslot ]; then
+                       rm -f $slotfile
+                       echo $loadslot > $slotfile
+               fi
+               Exit 0 "$loadslot" "/dev/null"
+               return $?                       # in case we are internal
+       fi
+
+       # Load the tape, finally!
+       Log `_ "LOADSLOT -> loading tape from slot %s to drive %s (%s)" "$loadslot" "$driveslot" "$tape"`
+       result=`Run $MTX load $loadslot $driveslot 2>&1`
+       status=$?
+       Log `_ '         -> status %s, result "%s"' "$status" "$result"`
+       mtx_status_valid=0
+       if [ $status -ne 0 ]; then
+               Exit 2 "$loadslot" "$result"
+               return $?                       # in case we are internal
+       fi
+
+       ###
+       # Cleaning tapes never go "ready", so instead we just sit here
+       # for "long enough" (as determined empirically by the user),
+       # then return success.
+       ###
+       if [ $loadslot -eq $cleanslot ]; then
+               Run sleep $cleancycle
+               Exit 0 "$loadslot" "$rawtape"
+               return $?                       # in case we are internal
+       fi
+
+       ###
+       # Wait for the drive to go online.
+       ###
+       waittime=0
+       ready=0
+       sleep $initial_poll_delay
+       while [ $waittime -lt $max_drive_wait ]; do
+                amdevcheck_status $tape
+               if [ $? -eq 0 ]; then
+                       ready=1
+                       break
+               fi
+               sleep $poll_drive_ready
+               waittime=`expr $waittime + $poll_drive_ready`
+       done
+       if [ $ready -eq 0 ]; then
+               Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds, rewind said "%s"' "$max_drive_wait" "$result"`
+               return $?                       # in case we are internal
+       fi
+
+       if [ $loadslot -ne $cleanslot ]; then
+               rm -f $slotfile
+               echo $loadslot > $slotfile
+       fi
+       Exit 0 "$loadslot" "$rawtape"
+       return $?                               # in case we are internal
+}
+
+###
+# Return information about how the changer is configured and the current
+# state of the robot.
+###
+
+info() {
+       test -n "$DEBUG" && set -x
+       get_loaded_info
+       get_slot_list
+       Log       `_ 'INFO     -> first slot: %s' "$firstslot"`
+       LogAppend `_ '         -> current slot: %s' "$currentslot"`
+       LogAppend `_ '         -> loaded slot: %s' "$loadedslot"`
+       LogAppend `_ '         -> last slot: %s' "$lastslot"`
+       LogAppend `_ '         -> slot list: %s' "$slot_list"`
+       LogAppend `_ '         -> can go backwards: 1'`
+       LogAppend `_ '         -> havereader: %s' "$havereader"`
+
+        ###
+       # Check if a barcode reader is configured or not.  If so, it
+       # passes the 4th item in the echo back to amtape signifying it
+       # can search based on barcodes.
+       ###
+       reader=
+        if [ $havereader -eq 1 ]; then
+               reader=1
+        fi
+
+       if [ $currentslot -lt $firstslot -o $currentslot -gt $lastslot ]; then
+               currentslot=$firstslot          # what "current" will get
+       fi
+       numslots=`expr $lastslot - $firstslot + 1`
+       Exit 0 "$currentslot" "$numslots 1 $reader"
+       return $?                               # in case we are internal
+}
+
+###
+# Read the labelfile and scan for a particular entry.
+###
+
+read_labelfile() {
+       labelfile_entry_found=0
+       labelfile_label=
+       labelfile_barcode=
+
+       lbl_search=$1
+       bc_search=$2
+
+       line=0
+       while read lbl bc junk; do
+               line=`expr $line + 1`
+               if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then
+                       Log       `_ 'ERROR    -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"`
+                       LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"`
+                       return $?               # in case we are internal
+               fi
+               if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then
+                       if [ $labelfile_entry_found -ne 0 ]; then
+                               Log       `_ 'ERROR    -> Duplicate entries: %s line %s' "$labelfile" "$line"`
+                               LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
+                               Exit 2 \
+                                    `_ '<none>'` \
+                                    `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"`
+                               return $?       # in case we are internal
+                       fi
+                       labelfile_entry_found=1
+                       labelfile_label=$lbl
+                       labelfile_barcode=$bc
+               fi
+       done
+}
+
+###
+# Adds the label and barcode for the currently loaded tape to the
+# barcode file.  Return an error if the database is messed up.
+###
+
+addlabel() {
+       test -n "$DEBUG" && set -x
+       if [ $# -lt 1 ]; then
+               Exit 2 `_ '<none>'` `_ 'Missing -label argument'`
+               return $?                       # in case we are internal
+       fi
+        tapelabel=$1
+       if [ $havereader -eq 0 ]; then
+               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
+               return $?                       # in case we are internal
+       fi
+        get_loaded_info
+       if [ $loadedslot -lt 0 ]; then
+               Exit 1 `_ '<none>'` `_ 'No tape currently loaded'`
+               return $?                       # in case we are internal
+       fi
+       if [ -z "$loadedbarcode" ]; then
+               Exit 1 `_ '<none>'` `_ 'No barcode found for tape %s.' $tapelabel`
+               return $?                       # in case we are internal
+       fi
+       Log       `_ 'LABEL    -> Adding label "%s" with barcode "%s" for slot %s into %s' "$tapelabel" "$loadedbarcode" "$loadedslot" "$labelfile"`
+       read_labelfile "$tapelabel" "$loadedbarcode" < $labelfile
+       if [ $labelfile_entry_found -ne 0 ]; then
+               lf_val=
+               if [ "$labelfile_barcode" != "$loadedbarcode" ]; then
+                       lf_type=label
+                       lf_val=$tapelabel
+                       val_type=barcode
+                       old_val=$labelfile_barcode
+                       new_val=$loadedbarcode
+               elif [ "$labelfile_label" != "$tapelabel" ]; then
+                       lf_type=barcode
+                       lf_val=$loadedbarcode
+                       val_type=label
+                       old_val=$labelfile_label
+                       new_val=$tapelabel
+               fi
+               if [ -n "$lf_val" ]; then
+                       LogAppend `_ 'ERROR    -> !!! Label database corrupted !!!'`
+                       LogAppend `_ '         -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
+                       Exit 2 \
+                            `_ '<none>'` \
+                            `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
+                       return $?               # in case we are internal
+               fi
+               LogAppend `_ "         -> already synced"`
+       else
+               echo "$tapelabel $loadedbarcode" >> $labelfile
+               LogAppend `_ '         -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"`
+       fi
+       Exit 0 "$loadedslot" "$rawtape"
+       return $?                               # in case we are internal
+}
+
+###
+# Look for a label in the barcode file.  If found, locate the slot it's
+# in by looking for the barcode in the mtx output, then load that tape.
+###
+
+searchtape() {
+       test -n "$DEBUG" && set -x
+       if [ $# -lt 1 ]; then
+               Exit 2 `_ '<none>'` `_ 'Missing -search argument'`
+               return $?                       # in case we are internal
+       fi
+        tapelabel=$1
+       if [ $havereader -eq 0 ]; then
+               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
+               return $?                       # in case we are internal
+       fi
+       Log `_ 'SEARCH   -> Hunting for label "%s"' "$tapelabel"`
+       read_labelfile "$tapelabel" "" < $labelfile
+       if [ $labelfile_entry_found -eq 0 ]; then
+               LogAppend `_ '         -> !!! label "%s" not found in %s !!!' "$tapelabel" "$labelfile"`
+               LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
+               Exit 2 \
+                    `_ '<none>'` \
+                    `_ '%s: label "%s" not found in %s' "$tapelabel" "$tapelabel" "$labelfile"`
+               return $?                       # in case we are internal
+       fi
+       LogAppend `_ '         -> barcode is "%s"' "$labelfile_barcode"`
+       get_mtx_status
+       foundslot=`sed -n '
+/VolumeTag *= *'$labelfile_barcode' *$/                        {
+       s/.*Storage Element \([0-9][0-9]*\).*/\1/p
+       q
+}
+' < $mtx_status`
+       LogAppend `_ '         -> foundslot is %s' "$foundslot"`
+       if [ -z "$foundslot" ]; then
+               LogAppend `_ 'ERROR    -> !!! Could not find slot for barcode "%s"!!!' "$labelfile_barcode"`
+               LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
+               Exit 2 \
+                    `_ '<none>'` \
+                    `_ 'barcode "%s" not found in mtx status output' "$labelfile_barcode"`
+               return $?                       # in case we are internal
+       fi
+       # Call loadslot without doing it as an internal and let it finish
+       # things up.
+       loadslot $foundslot
+       # NOTREACHED
+       Exit 2 `_ '<none>'` `_ 'searchtape: should not get here'`
+       return $?                               # in case we are internal
+}
+
+###
+# Program invocation begins here
+###
+
+if [ $# -lt 1 ]; then
+       Exit 2 `_ '<none>'` `_ 'Usage: %s -command args' "$myname"`
+fi
+cmd=$1
+shift
+case "$cmd" in
+-slot)
+       loadslot "$@"
+       ;;
+-info)
+       info "$@"
+       ;;
+-reset)
+       reset "$@"
+       ;;
+-eject)
+       eject "$@"
+       ;;
+-label) 
+       addlabel "$@"
+       ;;
+-search)
+       searchtape "$@"
+       ;;
+-clean)
+       loadslot clean
+       ;;
+*)
+       Exit 2 `_ '<none>'` `_ 'unknown option: %s' "$cmd"`
+       ;;
+esac
+
+Exit 2 `_ '<none>'` `_ '%s: should not get here' "$myname"`
diff --git a/changer-src/chg-zd-mtx.sh.in b/changer-src/chg-zd-mtx.sh.in
deleted file mode 100644 (file)
index a36e901..0000000
+++ /dev/null
@@ -1,1355 +0,0 @@
-#!@SHELL@ 
-#
-# Exit Status:
-# 0 Alles Ok
-# 1 Illegal Request
-# 2 Fatal Error
-#
-# Contributed by Eric DOUTRELEAU <Eric.Doutreleau@int-evry.fr>
-# This is supposed to work with Zubkoff/Dandelion version of mtx
-#
-# Modified by Joe Rhett <jrhett@isite.net>
-# to work with MTX 1.2.9 by Eric Lee Green http://mtx.sourceforge.net
-#
-# Modified by Jason Hollinden <jhollind@sammg.com> on 13-Feb-2001
-# to work with MTX 1.2.10, >9 slots, has barcode support, and works with
-# multiple configs at once.
-# NOTE:  Only tested the 2 additions with an ADIC Scalar 100.
-
-################################################################################
-# Here are the things you need to do and know to configure this script:
-#
-#   * Figure out what the robot device name is and what the tape drive
-#     device name is.  They will be different!
-#
-#     You cannot send robot commands to a tape drive and vice versa.
-#     Both should respond to "mtx -f /dev/... inquiry".  Hopefully,
-#     that output will make it obvious which is which.
-#
-#     For instance, here is what mtx has to say about my current robot:
-#
-#       Product Type: Medium Changer
-#       Vendor ID: 'ATL     '
-#       Product ID: 'ACL2640 206     '
-#       Revision: '2A5A'
-#       Attached Changer: No
-#
-#     and here is what it says about a tape drive:
-#
-#       Product Type: Tape Drive
-#       Vendor ID: 'Quantum '
-#       Product ID: 'DLT4000         '
-#       Revision: 'CD50'
-#       Attached Changer: No
-#
-#     Note the "Product Type" value makes it clear which is which.
-#
-#     If it is not obvious, "mf -f /dev/... rewind" should be happy when
-#     talking to a (loaded) tape drive but the changer should give some
-#     kind of error.  Similarly, "mtx -f /dev/... status" should show good
-#     results with the changer but fail with a tape drive device name.
-#
-#     Once you have this figured out, set "changerdev" in amanda.conf
-#     to the changer device and "tapedev" to the tape device.
-#
-#   * Find out what the first and last storage slots are.  Running
-#     "mtx -f /dev/... status" should give you something like this
-#     (although the output will vary widely based on the version of mtx
-#     and the specifics of your robot):
-#
-#        Storage Changer /dev/changer:1 Drives, 9 Slots ( 0 Import/Export )
-#      Data Transfer Element 0:Empty
-#            Storage Element 1:Full :VolumeTag=SR0001
-#            Storage Element 2:Full :VolumeTag=SR0002
-#            Storage Element 3:Full :VolumeTag=SR0003
-#            Storage Element 4:Full :VolumeTag=SR0004
-#            Storage Element 5:Full :VolumeTag=SR0005
-#            Storage Element 6:Full :VolumeTag=SR0006
-#            Storage Element 7:Full :VolumeTag=SR0007
-#            Storage Element 8:Full :VolumeTag=SR0008
-#            Storage Element 9:Full :VolumeTag=SR0009
-#            Storage Element 10 IMPORT/EXPORT:Full :VolumeTag=SR0009
-#
-#     This says the first storage slot (element) is "1" and the last
-#     is "9".  If you allocate the entire robot to Amanda, you do not need
-#     to set the "firstslot" or "lastslot" configuration file variables --
-#     the script will compute these values for you.
-#
-#     You do not have to allocate all of the slots for Amanda use,
-#     but whatever slots you use must be contiguous (i.e. 4 through 9
-#     in the above would be OK but 1, 2, 5, 6, 9 would not).  The one
-#     exception to this is that if one of the slots contains a cleaning
-#     cartridge, it may be in any slot (Amanda will just skip over it if
-#     it is between firstslot and lastslot).
-#
-#   * Speaking of cleaning cartridges, if you have a storage slot dedicated
-#     to one, figure out what slot it is in.  That slot number will go in
-#     the "cleanslot" variable.
-#
-#     Also, decide if you want the changer script to automatically run
-#     the cleaning tape through the drive after every so many mounts,
-#     and how many mounts you want to do between cleanings.  If you
-#     want the script to do this, set the "autoclean" variable to 1 and
-#     the "autocleancount" to the number of mounts between cleanings.
-#     If you do not want to do automatic cleanings (including not having
-#     a cleaning cartridge in the robot), set "autoclean" to 0.
-#
-#     Note that only a count of mounts is used to determine when it is
-#     time to clean.  The script does not try to detect if the drive is
-#     requesting cleaning, or how much the drive was used on a given
-#     mount.
-#
-#   * If you tell Amanda about a cleaning cartridge, whether for automatic
-#     operation or manual (amtape <config> clean), you must also tell
-#     the script how long it takes to run the cleaning cycle.  It is
-#     impossible for the script to determine when the cleaning operation
-#     is done, so the "cleancycle" variable is the number of seconds
-#     the longest cleaning operation takes (you'll just have to figure
-#     this out by watching it a few times, or maybe finding it in a tape
-#     drive hardware manual).  The script will sleep for this length of
-#     time whenever the cleaning tape is referenced.  The default is 120
-#     seconds (two minutes).
-#
-#   * Figure out the drive slot number.  By default, it is set to 0.
-#     In the example above, the tape drive ("Data Transfer Element")
-#     is in slot 0. If your drive slot is not 0, you
-#     need to set the drive slot number with the "driveslot" variable.
-#
-#   * Figure out whether your robot has a barcode reader and whether
-#     your version of mtx supports it.  If you see "VolumeTag" entries
-#     in the "mtx -f /dev/xxx status" output you did above, you have
-#     a reader and mtx can work with it, so you may set the "havereader"
-#     variable to 1.  The default is 0 (do not use a reader).
-#
-#   * Pick any tape to load and then determine if the robot can put it
-#     away directly or whether an "offline" must be done first.
-#
-#     With the tape still mounted and ready, try to put the tape away
-#     with "mtx".  If you get some kind of error, which is the most
-#     common response, try "mt -f /dev/... offline", wait for the drive
-#     to unload and make sure the robot takes no action on its own to
-#     store the tape.  Assuming it does not, try the "mtx" command again
-#     to store the tape.
-#
-#     If you had to issue the "mt -f /dev/... offline" before you could
-#     use "mtx" to store the tape, set the "offline_before_unload"
-#     variable to 1.  If "mtx" unloaded the drive and put the tape away
-#     all by itself, set it to 0.
-#
-#   * Some drives and robots require a small delay between unloading the
-#     tape and instructing the robot to move it back to storage.
-#     For instance, if you try to grab the tape too soon on an ATL robot
-#     with DLT tape drives, it will rip the leader out of the drive and
-#     require sincerely painful hardware maintenance.
-#
-#     If you need a little delay, set the "unloadpause" variable to
-#     the number of seconds to wait before trying to take a tape from
-#     a drive back to storage.  The default is 0.
-#
-#   * Some drives also require a short pause after loading, or the drive
-#     will return an I/O error during a test to see if it's online (which
-#     this script uses "mt rewind" to test).  My drives don't recover from
-#     this, and must be reloaded before they will come online after failing
-#     such a test.  For this reason there is an "initial_poll_delay"
-#     variable which will pause for a certain number of seconds before
-#     looping through the online test for the first time.  The default is 0.
-####
-
-####
-# Now you are ready to set up the variables in the changer configuration
-# file.
-#
-# All variables are in "changerfile".conf where "changerfile" is set
-# in amanda.conf.  For example, if amanda.conf has:
-#
-#      changerfile="/etc/amanda/Dailyset1/CHANGER"
-#    or changerfile="/etc/amanda/Dailyset1/CHANGER.conf"
-#
-# the variables must be in "/etc/amanda/Dailyset1/CHANGER.conf".
-# The ".conf" is appended only if it's not there".
-#
-# If "changerfile" is a relative path, it is relative to the directory
-# that contains amanda.conf.  That also happens to be the directory Amanda
-# makes current before running this script.
-#
-# Here is a commented out example file with all the variables and showing
-# their default value (if any):
-####
-# firstslot=?              #### First storage slot (element) -- required
-# lastslot=?               #### Last storage slot (element) -- required
-# cleanslot=-1             #### Slot with cleaner tape -- default is "-1"
-#                          #### Set negative to indicate no cleaner available
-# driveslot=0              #### Drive slot number.  Defaults to 0
-#                          #### Use the 'Data Transfer Element' you want
-#
-#   # Do you want to clean the drive after a certain number of accesses?
-#   # NOTE - This is unreliable, since 'accesses' aren't 'uses', and we
-#   #        have no reliable way to count this.  A single amcheck could
-#   #        generate as many accesses as slots you have, plus 1.
-#   # ALSO NOTE - many modern tape loaders handle this automatically.
-#
-# autoclean=0              #### Set to '1' or greater to enable
-#
-# autocleancount=99        #### Number of access before a clean.
-#
-# havereader=0             #### If you have a barcode reader, set to 1.
-#
-# offline_before_unload=0   #### Does your robot require an
-#                          #### 'mt offline' before mtx unload?
-#
-# poll_drive_ready=NN      #### Time (seconds) between tests to see if
-#                          #### the tape drive has gone ready (default: 3).
-#
-# max_drive_wait=NN        #### Maximum time (seconds) to wait for the
-#                          #### tape drive to become ready (default: 120).
-#
-# initial_poll_delay=NN            #### initial delay after load before polling for
-#                          #### readiness
-#
-####
-
-####
-# Now it is time to test the setup.  Do all of the following in the
-# directory that contains the amanda.conf file, and do all of it as
-# the Amanda user.
-#
-#   * Run this:
-#
-#       .../chg-zd-mtx -info
-#       echo $?             #### (or "echo $status" if you use csh/tcsh)
-#
-#     You should get a single line from the script like this (the actual
-#     numbers will vary):
-#
-#       5 9 1 1
-#
-#     The first number (5) is the "current" slot.  This may or may not be
-#     the slot actually loaded at the moment (if any).  It is the slot
-#     Amanda will try to use next.
-#
-#     The second number (9) is the number of slots.
-#
-#     The third number will always be "1" and indicates the changer is
-#     capable of going backward.
-#
-#     The fourth number is optional.  If you set $havereader to 1, it
-#     will be "1", otherwise it will not be present.
-#
-#     The exit code ($? or $status) should be zero.
-#
-#   * Run this:
-#
-#       .../chg-zd-mtx -reset
-#       echo $?
-#
-#     The script should output a line like this:
-#
-#       1 /dev/rmt/0mn
-#
-#     The number at the first should match $firstslot.  The device name
-#     after that should be your tape device.
-#
-#     The exit code ($? or $status) should be zero.
-#
-#   * Run this:
-#
-#       .../chg-zd-mtx -slot next
-#       echo $?
-#
-#     The script should output a line like this:
-#
-#       2 /dev/rmt/0mn
-#
-#     The number at the first should be one higher than $firstslot.
-#     The device name after that should be your tape device.
-#
-#     The exit code ($? or $status) should be zero.
-#
-#   * Run this:
-#
-#       .../chg-zd-mtx -slot current
-#       echo $?
-#
-#     Assuming the tape is still loaded from the previous test, the
-#     robot should not move and the script should report the same thing
-#     the previous command did.
-#
-#   * If you continue to run "-slot next" commands, the robot should load
-#     each tape in turn then wrap back around to the first when it
-#     reaches $lasttape.  If $cleanslot is within the $firstslot to
-#     $lastslot range, the script will skip over that entry.
-#
-#   * Finally, try some of the amtape commands and make sure they work:
-#
-#       amtape <config> reset
-#       amtape <config> slot next
-#       amtape <config> slot current
-#
-#   * If you set $havereader non-zero, now would be a good time to create
-#     the initial barcode database:
-#
-#       amtape <config> update
-####
-
-################################################################################
-# To debug this script, first look in @AMANDA_DBGDIR@.  The script
-# uses one of two log files there, depending on what version of Amanda
-# is calling it.  It may be chg-zd-mtx.YYYYMMDD*.debug, or it may be
-# changer.debug.driveN where 'N' is the drive number.
-#
-# If the log file does not help, try running the script, **as the Amanda
-# user**, in the amanda.conf directory with whatever set of args the log
-# said were used when you had a problem.  If nothing else useful shows up
-# in the output, try running the script with the DEBUG environment variable
-# set non-null, e.g.:
-#
-#      env DEBUG=yes .../chg-zd-mtx ...
-################################################################################
-
-# source utility functions and values from configure
-exec_prefix=@exec_prefix@
-libexecdir=@libexecdir@
-. ${libexecdir}/chg-lib.sh
-
-test -n "$DEBUG" && set -x
-TMPDIR="@AMANDA_TMPDIR@"
-DBGDIR="@AMANDA_DBGDIR@"
-
-argv0=$0
-myname=`expr "$argv0" : '.*/\(.*\)'`
-
-config=`pwd 2>/dev/null`
-config=`expr "$config" : '.*/\(.*\)'`
-
-###
-# Functions to write a new log file entry and append more log information.
-###
-
-ds=`date '+%H:%M:%S' 2>/dev/null`
-if [ $? -eq 0  -a  -n "$ds" ]; then
-       logprefix=`echo "$ds" | sed 's/./ /g'`
-else
-       logprefix=""
-fi
-
-LogAppend() {
-       if [ -z "$logprefix" ]; then
-               echo "$@" >> $DBGFILE
-       else
-               echo "$logprefix" "$@" >> $DBGFILE
-       fi
-}
-
-Log() {
-       if [ -z "$logprefix" ]; then
-               echo "===" "`date`" "===" >> $DBGFILE
-               echo "$@" >> $DBGFILE
-       else
-               ds=`date '+%H:%M:%S' 2>/dev/null`
-               echo "$ds" "$@" >> $DBGFILE
-       fi
-}
-
-###
-# Common exit function.
-#
-#   $1 = exit code
-#   $2 = slot result
-#   $3 = additional information (error message, tape devive, etc)
-###
-
-internal_call=0
-Exit() {
-       if [ $internal_call -gt 0 ]; then
-               call_type=Return
-       else
-               call_type=Exit
-       fi
-       code=$1
-       shift
-       exit_slot=$1
-       shift
-       exit_answer="$@"
-       Log $call_type "($code) -> $exit_slot $@"
-       echo "$exit_slot" "$@"
-       if [ $call_type = Return ]; then
-               return $code
-       fi
-       amgetconf$SUF dbclose.$argv0:$DBGFILE > /dev/null 2>&1
-       exit $code
-}
-
-###
-# Function to run another command and log it.
-###
-
-Run() {
-       Log `_ 'Running: %s' "$@"`
-       rm -f $stdout $stderr
-       "$@" > $stdout 2> $stderr
-       exitcode=$?
-       Log `_ 'Exit code: %s' "$exitcode"`
-       if [ -s $stdout ]
-       then
-               LogAppend Stdout:
-               cat $stdout >> $DBGFILE
-       fi
-       if [ -s $stderr ]
-       then
-               LogAppend Stderr:
-               cat $stderr >> $DBGFILE
-       fi
-       cat $stdout
-       cat $stderr 1>&2
-       return $exitcode
-}
-
-###
-# Return success if the arg is numeric.
-###
-
-IsNumeric() {
-       test -z "$1" && return 1
-       x="`expr "$1" : '\([-0-9][0-9]*\)' 2>/dev/null`"
-       return `expr X"$1" != X"$x"`
-}
-
-###
-# Run $MTX status unless the previous output is still valid.
-###
-
-mtx_status_valid=0
-get_mtx_status() {
-       test -n "$DEBUG" && set -x
-       if [ $mtx_status_valid -ne 0 ]; then
-               return 0
-       fi
-       rm -f $mtx_status
-       Run $MTX status > $mtx_status 2>&1
-       status=$?
-       if [ $status -eq 0 ]; then
-               mtx_status_valid=1
-       fi
-       return $status
-}
-
-###
-# Determine the slot currently loaded.  Set $loadedslot to the slot
-# currently loaded, or "-1", and $loadedbarcode to the corresponding
-# barcode (or nothing).
-###
-
-get_loaded_info() {
-       test -n "$DEBUG" && set -x
-       get_mtx_status
-
-       set x `sed -n '
-/^Data Transfer Element:Empty/                          {
-    s/.*/-1/p
-    q
-}
-/^Data Transfer Element '$driveslot':Empty/             {
-    s/.*/-1/p
-    q
-}
-/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/               {
-    s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/\1 \2/p
-    q
-}
-/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/  {
-    s/.*(Storage Element \([0-9][0-9]*\) Loaded):VolumeTag *= *\([^     ]*\)/\1 \2/p
-    q
-}
-/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded):VolumeTag *= *\([^     ]*\)/        {
-    s/.*:VolumeTag *= *\([^     ]*\)/-2 \1/p
-    q
-}
-/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/                           {
-    s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p
-    q
-}
-/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/              {
-    s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p
-    q
-}
-/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/    {
-    s/.*/-2/p
-    q
-}
-' < $mtx_status 2>&1`
-       shift                                   # get rid of the "x"
-       loadedslot=$1
-       loadedbarcode=$2
-       if [ -z "$loadedslot" ]; then
-               Exit 2 \
-                   `_ '<none>'` \
-                   "could not determine current slot, are you sure your drive slot is $driveslot"
-               return $?                       # in case we are internal
-       fi
-
-       #Use the current slot if it's empty and we don't know which slot is loaded'
-       if [ $loadedslot -eq -2 ]; then
-               set x `sed -n '
-{
-    /^.*Storage Element '$currentslot':Empty/ {
-       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
-        q
-    }
-    /^.*Storage Element '$currentslot':Full/ {
-       s/.*Storage Element \([0-9][0-9]*\):Full/-2/p
-        q
-    }
-    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Empty/ {
-       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
-        q
-    }
-    /^.*Storage Element '$currentslot' IMPORT\/EXPORT:Full/ {
-       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/-2/p
-        q
-    }
-}
-' < $mtx_status 2>& 1`
-               shift                           # get rid of the "x"
-               loadedslotx=$1
-               if [ ! -z $loadedslotx ]; then
-                       loadedslot=$loadedslotx
-               fi
-       fi
-
-       #Use the first empty slot if we don't know which slot is loaded'
-       if [ $loadedslot -eq -2 ]; then
-               set x `sed -n '
-{
-    /^.*Storage Element \([0-9][0-9]*\):Empty/ {
-       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
-        q
-    }
-    /^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/ {
-       s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Empty/\1/p
-        q
-    }
-}
-' < $mtx_status 2>& 1`
-               shift                           # get rid of the "x"
-               loadedslot=$1
-       fi
-
-       if IsNumeric "$loadedslot" ; then
-               :
-       else
-               Exit 2 \
-                    `_ '<none>'` \
-                    "currently loaded slot ($loadedslot) not numeric"
-               return $?                       # in case we are internal
-       fi
-       Log       `_ 'STATUS   -> currently loaded slot = %s' "$loadedslot"`
-       LogAppend `_ '         -> currently loaded barcode = "%s"' "$loadedbarcode"`
-}
-
-###
-# Get a list of slots between $firstslot and $lastslot, if they are set.
-# If they are not set, set them to the first and last slot seen on the
-# assumption the entire robot is to be used (???).
-###
-
-slot_list=
-get_slot_list() {
-       test -n "$DEBUG" && set -x
-       if [ -n "$slot_list" ]; then
-               return
-       fi
-       get_mtx_status
-       slot_list=`sed -n '
-/^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ {
-    s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p
-}
-/^Data Transfer Element '$driveslot':Full (Storage Element \([0-9][0-9]*\) Loaded)/ {
-    s/.*Storage Element \([0-9][0-9]*\) Loaded.*/\1/p
-}
-/^Data Transfer Element '$driveslot':Full (Unknown Storage Element Loaded)/ {
-    : loop
-    n
-    /^.*Storage Element \([0-9][0-9]*\):Full/ {
-        s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p
-        b loop
-    }
-    /^.*Storage Element \([0-9][0-9]*\):Empty/ {
-       s/.*Storage Element \([0-9][0-9]*\):Empty/\1/p
-    }
-}
-/^.*Storage Element \([0-9][0-9]*\):Full/ {
-    s/.*Storage Element \([0-9][0-9]*\):Full.*/\1/p
-}
-/^.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full/ {
-    s/.*Storage Element \([0-9][0-9]*\) IMPORT\/EXPORT:Full.*/\1/p
-}
-' < $mtx_status 2>&1 | grep -v "^${cleanslot}\$" | sort -n`
-       slot_list=`echo $slot_list`             # remove the newlines
-       if [ $firstslot -lt 0 -o $lastslot -lt 0 ]; then
-               last=$lastslot
-               for slot in $slot_list; do
-                       if [ $firstslot -lt 0 ]; then
-                               Log `_ 'SLOTLIST -> firstslot set to %s' "$slot"`
-                               firstslot=$slot
-                       fi
-                       if [ $lastslot -lt 0 ]; then
-                               last=$slot
-                       fi
-               done
-               if [ $lastslot -lt 0 -a $last -ge 0 ]; then
-                       Log `_ 'SLOTLIST -> lastslot set to %s' "$last"`
-                       lastslot=$last
-               fi
-               if [ $firstslot -lt 0 ]; then
-                       Exit 2 \
-                            `_ '<none>'` \
-                            `_ 'cannot determine first slot'`
-                       return $?               # in case we are internal
-               elif [ $lastslot -lt 0 ]; then
-                       Exit 2 \
-                            `_ '<none>'` \
-                            `_ 'cannot determine last slot'`
-                       return $?               # in case we are internal
-               fi
-       fi
-       amanda_slot_list=
-       for slot in $slot_list; do
-               if [ $slot -ge $firstslot -a $slot -le $lastslot ]; then
-                       amanda_slot_list="$amanda_slot_list $slot"
-               fi
-       done
-       if [ -z "$amanda_slot_list" ]; then
-               Exit 2 \
-                    `_ '<none>'` \
-                    "no slots available"
-               return $?                       # in case we are internal
-       fi
-       slot_list="$amanda_slot_list"
-}
-
-# Paths
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-# try to hit all the possibilities here
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-DBGFILE=`amgetconf$SUF dbopen.$argv0 2>/dev/null`
-if [ -z "$DBGFILE" ]
-then
-       DBGFILE=/dev/null                       # will try this again below
-fi
-
-changerfile=`amgetconf$SUF changerfile 2>/dev/null`
-if [ -z "$changerfile" ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "changerfile must be specified in amanda.conf"
-fi
-
-tape=`amgetconf$SUF tapedev 2>/dev/null`
-if [ -z "$tape" ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "tapedev may not be empty"
-elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "tapedev ($tape) may not be the null device"
-fi
-TAPE=`amgetconf$SUF changerdev 2>/dev/null`
-if [ -z "$TAPE" ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "changerdev may not be empty"
-elif [ $TAPE = "/dev/null" ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "changerdev ($TAPE) may not be the null device"
-fi
-export TAPE                                    # for mtx command
-
-CHANGER=$TAPE
-export CHANGER                                 # for mtx command
-
-#### Set up the various config files.
-
-conf_match=`expr "$changerfile" : .\*\.conf\$`
-if [ $conf_match -ge 6 ]; then
-       configfile=$changerfile
-       changerfile=`echo $changerfile | sed 's/.conf$//g'`
-else
-       configfile=$changerfile.conf
-fi
-
-if [ ! -e $configfile ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "configuration file \"$configfile\" doesn't exist"
-fi
-if [ ! -f $configfile ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            "configuration file \"$configfile\" is not a file"
-fi
-
-cleanfile=$changerfile-clean
-accessfile=$changerfile-access
-slotfile=$changerfile-slot
-labelfile=$changerfile-barcodes
-[ ! -s $cleanfile ] && echo 0 > $cleanfile
-[ ! -s $accessfile ] && echo 0 > $accessfile
-[ ! -s $slotfile ] && echo -1 > $slotfile
-[ ! -f $labelfile ] && > $labelfile
-cleancount=`cat $cleanfile`
-accesscount=`cat $accessfile`
-
-test -z "$MT" && Exit 2 "<none>" "No mt command defined"
-test ! -f "$MT" && Exit 2 "<none>" "mt command ($MT) doesn't exist"
-test -z "$MTX" && Exit 2 "<none>" "No mtx command defined"
-test ! -f "$MTX" && Exit 2 "<none>" "mtx command ($MTX) doesn't exist"
-
-#### Dig out of the config file what is needed
-
-varlist=
-varlist="$varlist firstslot"
-varlist="$varlist lastslot"
-varlist="$varlist cleanslot"
-varlist="$varlist cleancycle"
-varlist="$varlist OFFLINE_BEFORE_UNLOAD"       # old name
-varlist="$varlist offline_before_unload"
-varlist="$varlist unloadpause"
-varlist="$varlist AUTOCLEAN"                   # old name
-varlist="$varlist autoclean"
-varlist="$varlist autocleancount"
-varlist="$varlist havereader"
-varlist="$varlist driveslot"
-varlist="$varlist poll_drive_ready"
-varlist="$varlist initial_poll_delay"
-varlist="$varlist max_drive_wait"
-
-for var in $varlist
-do
-       val="`cat $configfile 2>/dev/null | sed -n '
-# Ignore comment lines (anything starting with a #).
-/^[    ]*#/d
-# Find the first var=val line in the file, print the value and quit.
-/^[    ]*'$var'[       ]*=[    ]*\([^  ][^     ]*\).*/ {
-       s/^[    ]*'$var'[       ]*=[    ]*\([^  ][^     ]*\).*/\1/p
-       q
-}
-'`"
-       eval $var=\"$val\"
-done
-
-# Deal with driveslot first so we can get DBGFILE set if we are still
-# using the old amgetconf.
-
-if [ -z "$driveslot" ]; then
-       driveslot=0;
-fi
-
-# Get DBGFILE set if it is not already.
-
-if [ $DBGFILE = /dev/null ]; then
-       if [ -d "$DBGDIR" ]; then
-               DBGFILE=$DBGDIR/changer.debug.drive$driveslot
-       else
-               DBGFILE=/dev/null
-       fi
-       Log `_ '=== Start %s ===' "\`date\`"`
-fi
-if [ -z "$driveslot" ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            `_ 'cannot determine drive slot from %s' "$tape"`
-fi
-
-stdout=$TMPDIR/$myname.1.$$
-stderr=$TMPDIR/$myname.2.$$
-mtx_status=$TMPDIR/$myname.status.$$
-trap "rm -f $stdout $stderr $mtx_status" 0     # exit cleanup
-
-Log `_ 'Using config file %s' "$configfile"`
-
-# Log the argument list.
-
-Log `_ "Arg info:"`
-LogAppend "\$# = $#"
-i=0
-LogAppend "\$$i = \"$argv0\""
-for arg in "$@"; do
-       i=`expr $i + 1`
-       LogAppend "\$$i = \"$arg\""
-done
-
-# Set the default config values for those not in the file.  Log the
-# results and make sure each is valid (numeric).
-
-firstslot=${firstslot:-'-1'}                           # default: mtx status
-lastslot=${lastslot:-'-1'}                             # default: mtx status
-cleanslot=${cleanslot:-'-1'}                           # default: -1
-cleancycle=${cleancycle:-'120'}                                # default: two minutes
-if [ -z "$offline_before_unload" -a -n "$OFFLINE_BEFORE_UNLOAD" ]; then
-       offline_before_unload=$OFFLINE_BEFORE_UNLOAD    # (old name)
-fi
-offline_before_unload=${offline_before_unload:-'0'}    # default: 0
-unloadpause=${unloadpause:-'0'}                                # default: 0
-if [ -z "$autoclean" -a -n "$AUTOCLEAN" ]; then
-       autoclean=$AUTOCLEAN                            # (old name)
-fi
-autoclean=${autoclean:-'0'}                            # default: 0
-autocleancount=${autocleancount:-'99'}                 # default: 99
-havereader=${havereader:-'0'}                          # default: 0
-poll_drive_ready=${poll_drive_ready:-'3'}              # default: three seconds
-initial_poll_delay=${initial_poll_delay:-'0'}          # default: zero zeconds
-max_drive_wait=${max_drive_wait:-'120'}                        # default: two minutes
-
-get_slot_list
-
-Log `_ "Config info:"`
-for var in $varlist; do
-       if [ $var = "OFFLINE_BEFORE_UNLOAD" ]; then
-               continue                        # old name
-       elif [ $var = "AUTOCLEAN" ]; then
-               continue                        # old name
-       fi
-       eval val=\"'$'$var\"
-       if [ -z "$val" ]; then
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ '%s missing in %s' "$var" "$configfile"`
-       fi
-       if IsNumeric "$val" ; then
-               :
-       else
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ '%s (%s) not numeric in %s' "$var" "$val" "$configfile"`
-       fi
-       LogAppend $var = \"$val\"
-done
-
-# Run the rest of the config file sanity checks.
-
-if [ $firstslot -gt $lastslot ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            `_ 'firstslot (%s) greater than lastslot (%s) in %s' "$firstslot" "$lastslot" "$configfile"`
-fi
-if [ $autoclean -ne 0 -a $cleanslot -lt 0 ]; then
-       Exit 2 \
-            `_ '<none>'` \
-            `_ 'autoclean set but cleanslot not valid (%s)' "$cleanslot"`
-fi
-
-# Set up the current slot
-
-currentslot=`cat $slotfile`
-if IsNumeric "$currentslot" ; then
-       if [ $currentslot -lt $firstslot ]; then
-               Log `_ 'SETUP    -> current slot %s less than %s ... resetting to %s' "$currentslot" "$firstslot" "$firstslot"`
-               currentslot=$firstslot
-       elif [ $currentslot -gt $lastslot ]; then
-               Log `_ 'SETUP    -> current slot %s greater than %s ... resetting to %s' "$currentslot" "$lastslot" "$lastslot"`
-               currentslot=$lastslot
-       fi
-else
-       Log `_ 'SETUP    -> contents of %s (%s) invalid, setting current slot to first slot (%s)' "$slotfile" "$currentslot" "$firstslot"`
-       currentslot=$firstslot
-fi
-
-found_current=0
-first_slot_in_list=-1
-next_slot_after_current=-1
-for slot in $slot_list; do
-       if [ $first_slot_in_list -lt 0 ]; then
-               first_slot_in_list=$slot        # in case $firstslot is missing
-       fi
-       if [ $slot -eq $currentslot ]; then
-               found_current=1
-               break
-       elif [ $slot -gt $currentslot ]; then
-               next_slot_after_current=$slot   # $currentslot is missing
-               break
-       fi
-done
-if [ $found_current -eq 0 ]; then
-       if [ $next_slot_after_current -lt 0 ]; then
-               new_currentslot=$first_slot_in_list
-       else
-               new_currentslot=$next_slot_after_current
-       fi
-       Log `_ 'WARNING  -> current slot %s not available, setting current slot to next slot (%s)' "$currentslot" "$new_currentslot"`
-       currentslot=$new_currentslot
-fi
-
-# More routines.
-
-###
-# Eject the current tape and put it away.
-###
-
-eject() {
-       test -n "$DEBUG" && set -x
-       Log `_ 'EJECT    -> ejecting tape from %s' "$tape"`
-       get_loaded_info 
-       if [ $loadedslot -gt 0 ]; then
-               Log `_ 'EJECT    -> moving tape from drive %s to storage slot %s' "$driveslot" "$loadedslot"`
-               if [ $offline_before_unload -ne 0 ]; then
-                       Run $MT $MTF $tape offline > /dev/null 2>&1
-               fi
-               sleep $unloadpause
-               result=`Run $MTX unload $loadedslot $driveslot 2>&1`
-               status=$?
-               Log `_ '         -> status %s, result "%s"' "$status" "$result"`
-               mtx_status_valid=0
-               if [ $status -ne 0 ]; then
-                       answer="$result"
-                       code=2
-               else
-                       answer="$tape"
-                       code=0
-               fi
-       else
-               answer=`_ 'Drive was not loaded'`
-               code=1
-       fi
-       Exit $code "$loadedslot" "$answer"
-       return $?                               # in case we are internal
-}
-
-###
-# Reset the robot back to the first slot.
-###
-
-reset() {
-       test -n "$DEBUG" && set -x
-       Log `_ 'RESET    -> loading tape from slot %s to drive %s (%s)' "$firstslot" "$driveslot" "$tape"`
-       # Call loadslot without doing it as an internal and let it finish
-       # things up.
-       loadslot $firstslot
-       # NOTREACHED
-       Exit 2 `_ '<none>'` `_ 'reset: should not get here'`
-       return $?                               # in case we are internal
-}
-
-###
-# Unload the current tape (if necessary) and load a new one (unless
-# "advance").  If no tape is loaded, get the value of "current" from
-# $slotfile.
-###
-
-loadslot() {
-       test -n "$DEBUG" && set -x
-       if [ $# -lt 1 ]; then
-               Exit 2 `_ '<none>'` `_ 'Missing -slot argument'`
-               return $?                       # in case we are internal
-       fi
-       whichslot=$1
-       Log `_ 'LOADSLOT -> load drive %s (%s) from slot %s' "$driveslot" "$tape" "$whichslot"`
-
-       numeric=`echo $whichslot | sed 's/[^0-9]//g'`
-       case $whichslot in
-       current|prev|next|advance)
-               find_slot=$currentslot
-               ;;
-       first)
-               find_slot=$firstslot
-               ;;
-       last)
-               find_slot=$lastslot
-               ;;
-       $numeric)
-               find_slot=$numeric
-               ;;
-       clean)
-               find_slot=$cleanslot
-               ;;
-       *)
-               Exit 2 `_ '<none>'` `_ 'Illegal slot: "%s"' "$whichslot"`
-               return $?                       # in case we are internal
-               ;;
-       esac
-
-       # Find the requested slot in the slot list.  By loading the "set"
-       # command with multiple copies, we guarantee that if the slot is
-       # found, we can look both forward and backward without running
-       # off the end.  Putting $cleanslot at the end allows us to find
-       # that slot since it is not in $slot_list.
-       get_slot_list
-       set x $slot_list $slot_list $slot_list $cleanslot
-       shift                                   # get rid of the "x"
-       prev_slot=$1
-       shift
-       while [ $# -gt 0 ]; do
-               if [ $1 -eq $find_slot ]; then
-                       break
-               fi
-               prev_slot=$1
-               shift
-       done
-       if [ $# -le 0 ]; then
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"`
-               return $?                       # in case we are internal
-       fi
-
-       # Determine the slot to load.
-       case $whichslot in
-       next|advance)
-               shift
-               loadslot=$1
-               ;;
-       prev)
-               loadslot=$prev_slot
-               ;;
-       *)
-               loadslot=$find_slot
-       esac
-
-       # If the desired slot is already loaded, we are done.  Only update
-       # current slot if this is not the cleaning slot.
-       get_loaded_info
-       if [ $loadslot = $loadedslot ]; then
-               if [ $loadslot -ne $cleanslot ]; then
-                       rm -f $slotfile
-                       echo $loadslot > $slotfile
-               fi
-               Exit 0 "$loadedslot" "$tape"
-               return $?                       # in case we are internal
-       fi
-       if [ $loadedslot -eq -2 ]; then
-               Exit 0 "$loadedslot" "$tape"
-               return $?                       # in case we are internal
-        fi
-
-       # If we are loading the cleaning tape, bump the cleaning count
-       # and reset the access count.  Otherwise, bump the access count
-       # and see if it is time to do a cleaning.
-       if [ $loadslot = $cleanslot ]; then
-               rm -f $cleanfile $accessfile
-               expr $cleancount + 1 > $cleanfile
-               echo 0 > $accessfile
-       else
-               rm -f $accessfile
-               expr $accesscount + 1 > $accessfile
-               if [ $autoclean -ne 0 -a $accesscount -gt $autocleancount ]
-               then
-                       internal_call=`expr $internal_call + 1`
-                       loadslot clean > /dev/null 2>&1
-                       status=$?
-                       internal_call=`expr $internal_call - 1`
-                       if [ $status -ne 0 ]; then
-                               Exit $status "$loadslot" "$exit_answer"
-                               return $?       # in case we are internal
-                       fi
-
-                       # Slot $cleanslot might contain an ordinary tape
-                       # rather than a cleaning tape.  A cleaning tape
-                       # *MIGHT* auto-eject; an ordinary tape does not.
-                       # We therefore have to read the status again to
-                       # check what actually happened.
-                       mtx_status_valid=0
-                       get_loaded_info
-               fi
-       fi
-
-       # Unload whatever tape is in the drive.
-       internal_call=`expr $internal_call + 1`
-       eject > /dev/null 2>&1
-       status=$?
-       internal_call=`expr $internal_call - 1`
-       if [ $status -gt 1 ]; then
-               Exit $status "$exit_slot" "$exit_answer"
-               return $?                       # in case we are internal
-       fi
-
-       # If we were doing an "advance", we are done.
-       if [ $whichslot = advance ]; then
-               if [ $loadslot -ne $cleanslot ]; then
-                       rm -f $slotfile
-                       echo $loadslot > $slotfile
-               fi
-               Exit 0 "$loadslot" "/dev/null"
-               return $?                       # in case we are internal
-       fi
-
-       # Load the tape, finally!
-       Log `_ "LOADSLOT -> loading tape from slot %s to drive %s (%s)" "$loadslot" "$driveslot" "$tape"`
-       result=`Run $MTX load $loadslot $driveslot 2>&1`
-       status=$?
-       Log `_ '         -> status %s, result "%s"' "$status" "$result"`
-       mtx_status_valid=0
-       if [ $status -ne 0 ]; then
-               Exit 2 "$loadslot" "$result"
-               return $?                       # in case we are internal
-       fi
-
-       ###
-       # Cleaning tapes never go "ready", so instead we just sit here
-       # for "long enough" (as determined empirically by the user),
-       # then return success.
-       ###
-       if [ $loadslot -eq $cleanslot ]; then
-               Run sleep $cleancycle
-               Exit 0 "$loadslot" "$tape"
-               return $?                       # in case we are internal
-       fi
-
-       ###
-       # Wait for the drive to go online.
-       ###
-       waittime=0
-       ready=0
-       sleep $initial_poll_delay
-       while [ $waittime -lt $max_drive_wait ]; do
-               result=`Run $MT $MTF $tape rewind 2>&1`
-               if [ $? -eq 0 ]; then
-                       ready=1
-                       break
-               fi
-               sleep $poll_drive_ready
-               waittime=`expr $waittime + $poll_drive_ready`
-       done
-       if [ $ready -eq 0 ]; then
-               Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds, rewind said "%s"' "$max_drive_wait" "$result"`
-               return $?                       # in case we are internal
-       fi
-
-       if [ $loadslot -ne $cleanslot ]; then
-               rm -f $slotfile
-               echo $loadslot > $slotfile
-       fi
-       Exit 0 "$loadslot" "$tape"
-       return $?                               # in case we are internal
-}
-
-###
-# Return information about how the changer is configured and the current
-# state of the robot.
-###
-
-info() {
-       test -n "$DEBUG" && set -x
-       get_loaded_info
-       get_slot_list
-       Log       `_ 'INFO     -> first slot: %s' "$firstslot"`
-       LogAppend `_ '         -> current slot: %s' "$currentslot"`
-       LogAppend `_ '         -> loaded slot: %s' "$loadedslot"`
-       LogAppend `_ '         -> last slot: %s' "$lastslot"`
-       LogAppend `_ '         -> slot list: %s' "$slot_list"`
-       LogAppend `_ '         -> can go backwards: 1'`
-       LogAppend `_ '         -> havereader: %s' "$havereader"`
-
-        ###
-       # Check if a barcode reader is configured or not.  If so, it
-       # passes the 4th item in the echo back to amtape signifying it
-       # can search based on barcodes.
-       ###
-       reader=
-        if [ $havereader -eq 1 ]; then
-               reader=1
-        fi
-
-       if [ $currentslot -lt $firstslot -o $currentslot -gt $lastslot ]; then
-               currentslot=$firstslot          # what "current" will get
-       fi
-       numslots=`expr $lastslot - $firstslot + 1`
-       Exit 0 "$currentslot" "$numslots 1 $reader"
-       return $?                               # in case we are internal
-}
-
-###
-# Read the labelfile and scan for a particular entry.
-###
-
-read_labelfile() {
-       labelfile_entry_found=0
-       labelfile_label=
-       labelfile_barcode=
-
-       lbl_search=$1
-       bc_search=$2
-
-       line=0
-       while read lbl bc junk; do
-               line=`expr $line + 1`
-               if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then
-                       Log       `_ 'ERROR    -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"`
-                       LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
-                       Exit 2 \
-                            `_ '<none>'` \
-                            `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"`
-                       return $?               # in case we are internal
-               fi
-               if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then
-                       if [ $labelfile_entry_found -ne 0 ]; then
-                               Log       `_ 'ERROR    -> Duplicate entries: %s line %s' "$labelfile" "$line"`
-                               LogAppend `_ '         -> Remove $labelfile and run "$sbindir/amtape $config update"' "$labelfile" "$sbindir/amtape" "$config"`
-                               Exit 2 \
-                                    `_ '<none>'` \
-                                    `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"`
-                               return $?       # in case we are internal
-                       fi
-                       labelfile_entry_found=1
-                       labelfile_label=$lbl
-                       labelfile_barcode=$bc
-               fi
-       done
-}
-
-###
-# Adds the label and barcode for the currently loaded tape to the
-# barcode file.  Return an error if the database is messed up.
-###
-
-addlabel() {
-       test -n "$DEBUG" && set -x
-       if [ $# -lt 1 ]; then
-               Exit 2 `_ '<none>'` `_ 'Missing -label argument'`
-               return $?                       # in case we are internal
-       fi
-        tapelabel=$1
-       if [ $havereader -eq 0 ]; then
-               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
-               return $?                       # in case we are internal
-       fi
-        get_loaded_info
-       if [ $loadedslot -lt 0 ]; then
-               Exit 1 `_ '<none>'` `_ 'No tape currently loaded'`
-               return $?                       # in case we are internal
-       fi
-       Log       `_ 'LABEL    -> Adding label "%s" with barcode "%s" for slot %s into %s' "$tapelabel" "$loadedbarcode" "$loadedslot" "$labelfile"`
-       read_labelfile "$tapelabel" "$loadedbarcode" < $labelfile
-       if [ $labelfile_entry_found -ne 0 ]; then
-               lf_val=
-               if [ "$labelfile_barcode" != "$loadedbarcode" ]; then
-                       lf_type=label
-                       lf_val=$tapelabel
-                       val_type=barcode
-                       old_val=$labelfile_barcode
-                       new_val=$loadedbarcode
-               elif [ "$labelfile_label" != "$tapelabel" ]; then
-                       lf_type=barcode
-                       lf_val=$loadedbarcode
-                       val_type=label
-                       old_val=$labelfile_label
-                       new_val=$tapelabel
-               fi
-               if [ -n "$lf_val" ]; then
-                       LogAppend `_ 'ERROR    -> !!! Label database corrupted !!!'`
-                       LogAppend `_ '         -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
-                       Exit 2 \
-                            `_ '<none>'` \
-                            `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
-                       return $?               # in case we are internal
-               fi
-               LogAppend `_ "         -> already synced"`
-       else
-               echo "$tapelabel $loadedbarcode" >> $labelfile
-               LogAppend `_ '         -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"`
-       fi
-       Exit 0 "$loadedslot" "$tape"
-       return $?                               # in case we are internal
-}
-
-###
-# Look for a label in the barcode file.  If found, locate the slot it's
-# in by looking for the barcode in the mtx output, then load that tape.
-###
-
-searchtape() {
-       test -n "$DEBUG" && set -x
-       if [ $# -lt 1 ]; then
-               Exit 2 `_ '<none>'` `_ 'Missing -search argument'`
-               return $?                       # in case we are internal
-       fi
-        tapelabel=$1
-       if [ $havereader -eq 0 ]; then
-               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
-               return $?                       # in case we are internal
-       fi
-       Log `_ 'SEARCH   -> Hunting for label "%s"' "$tapelabel"`
-       read_labelfile "$tapelabel" "" < $labelfile
-       if [ $labelfile_entry_found -eq 0 ]; then
-               LogAppend `_ '         -> !!! label "%s" not found in %s !!!' "$tapelabel" "$labelfile"`
-               LogAppend `_ '         -> Remove $labelfile and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ '%s: label "%s" not found in %s' "$tapelabel" "$tapelabel" "$labelfile"`
-               return $?                       # in case we are internal
-       fi
-       LogAppend `_ '         -> barcode is "%s"' "$labelfile_barcode"`
-       get_mtx_status
-       foundslot=`sed -n '
-/VolumeTag *= *'$labelfile_barcode' *$/                        {
-       s/.*Storage Element \([0-9][0-9]*\).*/\1/p
-       q
-}
-' < $mtx_status`
-       LogAppend `_ '         -> foundslot is %s' "$foundslot"`
-       if [ -z "$foundslot" ]; then
-               LogAppend `_ 'ERROR    -> !!! Could not find slot for barcode "%s"!!!' "$labelfile_barcode"`
-               LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
-               Exit 2 \
-                    `_ '<none>'` \
-                    `_ 'barcode "%s" not found in mtx status output' "$labelfile_barcode"`
-               return $?                       # in case we are internal
-       fi
-       # Call loadslot without doing it as an internal and let it finish
-       # things up.
-       loadslot $foundslot
-       # NOTREACHED
-       Exit 2 `_ '<none>'` `_ 'searchtape: should not get here'`
-       return $?                               # in case we are internal
-}
-
-###
-# Program invocation begins here
-###
-
-if [ $# -lt 1 ]; then
-       Exit 2 `_ '<none>'` `_ 'Usage: %s -command args' "$myname"`
-fi
-cmd=$1
-shift
-case "$cmd" in
--slot)
-       loadslot "$@"
-       ;;
--info)
-       info "$@"
-       ;;
--reset)
-       reset "$@"
-       ;;
--eject)
-       eject "$@"
-       ;;
--label) 
-       addlabel "$@"
-       ;;
--search)
-       searchtape "$@"
-       ;;
--clean)
-       loadslot clean
-       ;;
-*)
-       Exit 2 `_ '<none>'` `_ 'unknown option: %s' "$cmd"`
-       ;;
-esac
-
-Exit 2 `_ '<none>'` `_ '%s: should not get here' "$myname"`
index 5e0dba86f44fa1aa1c4979d0d13e15c6292c8ef0..b768c7396cb1a396b79c24ff12bbbee735b7b618 100644 (file)
@@ -34,8 +34,6 @@
 
 #include <amanda.h>
 
-#ifdef HAVE_AIX_LIKE_SCSI
-
 #include <scsi-defs.h>
 
 #ifdef HAVE_SYS_TYPES_H
@@ -133,7 +131,7 @@ int SCSI_OpenDevice(int ip)
            pDev[ip].inquiry = NULL;
            return(1);
        } else {
-        dbprintf(("SCSI_OpenDevice %s failed\n", pDev[ip].dev));
+        dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev);
          return(0);
        }
     } else {
@@ -313,17 +311,17 @@ int SCSI_ExecuteCommand(int DeviceFD,
                DecodeExtSense(&ExtendedRequestSense, "SCSI_ExecuteCommand:", debug_file);
                bcopy(&ExtendedRequestSense, RequestSenseBuf, RequestSenseLength);
               */
-              dbprintf(("ioctl on %d return %d\n", pDev[DeviceFD].fd, Result));
-              dbprintf(("ret: %d errno: %d (%s)\n", Result, errno, ""));
-              dbprintf(("data_length:     %d\n", ds.data_length));
-              dbprintf(("buffer:          0x%X\n", ds.buffer));
-              dbprintf(("timeout_value:   %d\n", ds.timeout_value));
-              dbprintf(("status_validity: %d\n", ds.status_validity));
-              dbprintf(("scsi_bus_status: 0x%X\n", ds.scsi_bus_status));
-              dbprintf(("adapter_status:  0x%X\n", ds.adapter_status));
-              dbprintf(("adap_q_status:   0x%X\n", ds.adap_q_status));
-              dbprintf(("q_tag_msg:       0x%X\n", ds.q_tag_msg));
-              dbprintf(("flags:           0X%X\n", ds.flags));
+              dbprintf(_("ioctl on %d return %d\n"), pDev[DeviceFD].fd, Result);
+              dbprintf(_("ret: %d errno: %d (%s)\n"), Result, errno, "");
+              dbprintf(_("data_length:     %d\n"), ds.data_length);
+              dbprintf(_("buffer:          0x%X\n"), ds.buffer);
+              dbprintf(_("timeout_value:   %d\n"), ds.timeout_value);
+              dbprintf(_("status_validity: %d\n"), ds.status_validity);
+              dbprintf(_("scsi_bus_status: 0x%X\n"), ds.scsi_bus_status);
+              dbprintf(_("adapter_status:  0x%X\n"), ds.adapter_status);
+              dbprintf(_("adap_q_status:   0x%X\n"), ds.adap_q_status);
+              dbprintf(_("q_tag_msg:       0x%X\n"), ds.q_tag_msg);
+              dbprintf(_("flags:           0X%X\n"), ds.flags);
               return(SCSI_ERROR);
             }
         }
@@ -349,10 +347,10 @@ int SCSI_Scan(void)
     {
       for (lun = 0; lun < 7; lun++)
         {
-          printf("Target:Lun %d:%d\n", target,lun);
+          g_printf(_("Target:Lun %d:%d\n"), target,lun);
           if (ioctl(fd, SCIOSTART, IDLUN(target, lun)) == -1) {
             if (errno == EINVAL) {
-              printf("is in use\n");
+              g_printf(_("is in use\n"));
               isbusy = 1;
             } else {
               return(1);
@@ -368,12 +366,12 @@ int SCSI_Scan(void)
           si.inquiry_ptr = (char *)&buf;
           if (ioctl(fd, SCIOINQU, &si) == -1)
             {
-              printf("SCIOINQU: %s\n", strerror(errno));
+              g_printf("SCIOINQU: %s\n", strerror(errno));
             } else {
               dump_hex(&buf, 255, DEBUG_INFO, SECTION_SCSI);
               type = buf[0] & 0x1lf;
               buf[8+28] = 0;
-              printf("%-28s|Device Type %d\n",buf[8], type);
+              g_printf(_("%-28s|Device Type %d\n"),buf[8], type);
             }
           if (!isbusy && ioctl(fd, SCIOSTOP, IDLUN(target, lun)) == -1)
             return(1);
@@ -405,7 +403,6 @@ int ScanBus(int print)
   return(-1);
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index 0850c9e6f4ddebb278a980ee97b51ddcff67b58b..bff9495212da01eb1d4c9fc35e5a77c854532c8c 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_BSD_LIKE_SCSI
-
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#include "amanda.h"
 
 #include <sys/scsiio.h>
 #include <sys/mtio.h>
@@ -231,10 +212,10 @@ int SCSI_ExecuteCommand(int DeviceFD,
     memcpy(pRequestSense, ds.sense, RequestSenseLength);
     if (Result < 0)
       {
-        dbprintf(("errno : %s\n",strerror(errno)));
+        dbprintf("errno : %s\n",strerror(errno));
         return (SCSI_ERROR);
       }
-    dbprintf(("SCSI_ExecuteCommand(BSD) %02X STATUS(%02X) \n", CDB[0], ds.retsts));
+    dbprintf("SCSI_ExecuteCommand(BSD) %02X STATUS(%02X) \n", CDB[0], ds.retsts);
     switch (ds.retsts)
       {
       case SCCMD_BUSY:                /*  BUSY */
@@ -279,7 +260,7 @@ int Tape_Ioctl( int DeviceFD, int command)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
     {
-      dbprintf(("Tape_Ioctl error ioctl %s\n",strerror(errno)));
+      dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -304,7 +285,6 @@ int ScanBus(int print)
   return(-1);
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index 9f0c497f1aa51272e20a77c2b1e319111722fe67..d01d2d489f216e49e5cdc4a2f6f1c42494acd49b 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_CAM_LIKE_SCSI
-
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#include "amanda.h"
 
 #ifdef HAVE_CAMLIB_H
 # include <camlib.h>
@@ -97,28 +78,28 @@ int parse_btl(char *DeviceName,
   if (sscanf(p,"%d", path) != 1) {
       free(DeviceName);
       ChgExit("SCSI_OpenDevice",
-       "Path conversion error. Digits expected", FATAL);
+       _("Path conversion error. Digits expected"), FATAL);
   }
           
   if ((p = strtok(NULL,":")) == NULL) {
       free(DeviceName);
-      ChgExit("SCSI_OpenDevice", "target in Device Name not found", FATAL);
+      ChgExit("SCSI_OpenDevice", _("target in Device Name not found"), FATAL);
   }
 
   if (sscanf(p,"%d", target) != 1) {
       free(DeviceName);
       ChgExit("SCSI_OpenDevice",
-       "Target conversion error. Digits expected", FATAL);
+       _("Target conversion error. Digits expected"), FATAL);
   }
 
   if ((p = strtok(NULL,":")) == NULL) {
       free(DeviceName);
-      ChgExit("SCSI_OpenDevice", "lun in Device Name not found", FATAL);
+      ChgExit("SCSI_OpenDevice", _("lun in Device Name not found"), FATAL);
   }
   if (sscanf(p,"%d", lun) != 1) {
       free(DeviceName);
       ChgExit("SCSI_OpenDevice",
-       "LUN conversion error. Digits expected", FATAL);
+       _("LUN conversion error. Digits expected"), FATAL);
   }
 
   return 1;
@@ -191,7 +172,7 @@ int SCSI_OpenDevice(int ip)
         return(1);
       }
     } else { /* Device open failed */
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n");
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
       return(0);
     }
   }
@@ -238,7 +219,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
   extern OpenFiles_T *pDev;
   union ccb *ccb;
   int ret;
-  uint32_t ccb_flags;
+  guint32 ccb_flags;
   OpenFiles_T *pwork = NULL;
 
   /* Basic sanity checks */
@@ -294,7 +275,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
                 /* cbfncp */ NULL,
                 /* flags */ ccb_flags,
                 /* tag_action */ MSG_SIMPLE_Q_TAG,
-                /* data_ptr */ (u_int8_t*)DataBuffer,
+                /* data_ptr */ (guint8*)DataBuffer,
                 /* dxfer_len */ DataBufferLength,
                 /* sense_len */ SSD_FULL_SIZE,
                 /* cdb_len */ CDB_Length,
@@ -327,7 +308,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
   /* ToDo add error handling */
   if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
     {
-      dbprintf(("SCSI_ExecuteCommand return %d\n", (ccb->ccb_h.status & CAM_STATUS_MASK)));
+      dbprintf(_("SCSI_ExecuteCommand return %d\n"), (ccb->ccb_h.status & CAM_STATUS_MASK));
       return(SCSI_ERROR);
     }
 
@@ -361,7 +342,7 @@ int Tape_Ioctl( int DeviceFD, int command)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
     {
-      dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno)));
+      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -382,13 +363,13 @@ int Tape_Status( int DeviceFD)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
   {
-     dbprintf(("Tape_Status error ioctl %s\n", strerror(errno)));
+     dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
      SCSI_CloseDevice(DeviceFD);
      return(-1);
   }
 
-  dbprintf(("ioctl -> mtget.mt_dsreg %lX\n",mtget.mt_dsreg));
-  dbprintf(("ioctl -> mtget.mt_erreg %lX\n",mtget.mt_erreg));
+  dbprintf("ioctl -> mtget.mt_dsreg %lX\n",mtget.mt_dsreg);
+  dbprintf("ioctl -> mtget.mt_erreg %lX\n",mtget.mt_erreg);
 
   /*
    * I have no idea what is the meaning of the bits in mt_erreg
@@ -426,7 +407,7 @@ int ScanBus(int print)
         {
           for (lun = 0; lun < 8; lun++)
             {
-              sprintf(pDev[count].dev, "%d:%d:%d", bus, target, lun);
+              g_sprintf(pDev[count].dev, "%d:%d:%d", bus, target, lun);
               pDev[count].inqdone = 0;
               if (OpenDevice(count, pDev[count].dev, "Scan", NULL))
                 {
@@ -438,45 +419,45 @@ int ScanBus(int print)
                     } else {
                       if (print)
                         {
-                          printf("bus:target:lun -> %s == ",pDev[count].dev);
+                          g_printf(_("bus:target:lun -> %s == "),pDev[count].dev);
                           
                           switch (pDev[count].inquiry->type)
                             {
                             case TYPE_DISK:
-                              printf("Disk");
+                              g_printf(_("Disk"));
                               break;
                             case TYPE_TAPE:
-                              printf("Tape");
+                              g_printf(_("Tape"));
                               break;
                             case TYPE_PRINTER:
-                              printf("Printer");
+                              g_printf(_("Printer"));
                               break;
                             case TYPE_PROCESSOR:
-                              printf("Processor");
+                              g_printf(_("Processor"));
                               break;
                             case TYPE_WORM:
-                              printf("Worm");
+                              g_printf(_("Worm"));
                               break;
                             case TYPE_CDROM:
-                              printf("Cdrom");
+                              g_printf(_("Cdrom"));
                               break;
                             case TYPE_SCANNER:
-                              printf("Scanner");
+                              g_printf(_("Scanner"));
                               break;
                             case TYPE_OPTICAL:
-                              printf("Optical");
+                              g_printf(_("Optical"));
                               break;
                             case TYPE_CHANGER:
-                              printf("Changer");
+                              g_printf(_("Changer"));
                               break;
                             case TYPE_COMM:
-                              printf("Comm");
+                              g_printf(_("Comm"));
                               break;
                             default:
-                              printf("unknown %d",pDev[count].inquiry->type);
+                              g_printf(_("unknown %d"),pDev[count].inquiry->type);
                               break;
                             }
-                          printf("\n");
+                          g_printf("\n");
                         }
                     } 
                 }
@@ -486,7 +467,6 @@ int ScanBus(int print)
     return 0;
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index 776e184a9ddb369aa03717ee7f62399790e85954..93ed793d7d61123f4475b1f99c6ab5b05176802e 100644 (file)
@@ -5,37 +5,9 @@ static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52 2006/07/21 00:25:50 mar
  * Copyright (c) Thomas Hepper th@ant.han.de
  */
 
-#include <amanda.h>
+#include "amanda.h"
 
 #include "arglist.h"
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef  HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#
-#ifdef STDC_HEADERS
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 
 #include "scsi-defs.h"
 
@@ -507,28 +479,34 @@ PrintConf(void)
   int count;
   char *cwd;
 
-  printf("# Please replace every ??? with the correct parameter. It is not possible\n");
-  printf("# to guess everything :-)\n");
-  printf("# If the option is not needed, cleanmax for example if you have no cleaning\n");
-  printf("# tape remove the line.\n");
-  printf("#\n");
-  printf("number_configs   1   # Number of configs, you can have more than 1 config\n");
-  printf("                     # if you have for example more than one drive, or you\n");
-  printf("                     # to split your lib to use different dump levels\n");
-  printf("                     #\n");
-  printf("emubarcode       1   # If you drive has no barcode reader this will try\n");
-  printf("                     # keep an inventory of your tapes to find them faster\n");
-  printf("                     #\n");
-  printf("havebarcode      0   # Set this to 1 if you have an library with an installed\n");
-  printf("                     # barcode reader\n");
-  printf("                     #\n");
-  printf("debuglevel       0:0 # For debuging, see the docs /docs/TAPE-CHANGER\n");
-  printf("                     #\n");
-  printf("eject            ??? # set this to 1 if your drive needs an eject before move\n");
-  printf("                     #\n");
-  printf("sleep            ??? # How long to wait after an eject command before moving\n");
-  printf("                     # the tape\n");
-  printf("                     #\n");
+  g_printf(_("# Please replace every ??? with the correct parameter.\n"));
+  g_printf(_("# It is not possible to guess everything :-)\n"));
+  g_printf(_("# Remove the line if the option is not needed."));
+  g_printf(_("#   Example: cleanmax if you have no cleaning tape"));
+  g_printf(_("#\n"));
+  g_printf(_(
+   "number_configs  1 # Number of configs, you can have more than 1 config\n"
+   "                  # if you have for example more than one drive, or you\n"
+   "                  # to split your lib to use different dump levels\n"
+   "                  #\n"));
+  g_printf(_(
+   "emubarcode      1 # If you drive has no barcode reader this will try\n"
+   "                  # keep an inventory of your tapes to find them faster\n"
+   "                  #\n"));
+  g_printf(_(
+   "havebarcode     0 # Set this to 1 if you have a library with a\n"
+   "                  # barcode reader\n"
+   "                  #\n"));
+  g_printf(_(
+   "debuglevel    0:0 # For debuging, see the docs /docs/TAPE-CHANGER\n"
+   "                  #\n"));
+  g_printf(_(
+   "eject         ??? # set this to 1 if your drive needs an eject before move\n"
+   "                  #\n"));
+  g_printf(_(
+   "sleep         ??? # How long to wait after an eject command before moving\n"
+   "                  # the tape\n"
+   "                  #\n"));
 
   for (count = 0; count < CHG_MAXDEV ; count++)
     {
@@ -536,7 +514,7 @@ PrintConf(void)
        {
          if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_CHANGER)
            {
-             printf("changerdev   %s # This is the device to communicate with the robot\n", pDev[count].dev);
+             g_printf(_("changerdev   %s # This is the device to communicate with the robot\n"), pDev[count].dev);
              break;
            }
        }
@@ -551,24 +529,30 @@ PrintConf(void)
     {
       pDev[count].functions->function_status(count, 1);
     } else {
-      printf("changerdev   ??? # Ups nothing found. Please check the docs\n");
+      g_printf(_("changerdev ???       # Ups nothing found. Please check the docs\n"));
     }
 
-  printf("                     #\n");
-  printf("                     # Here now comes the config for the first tape\n");
-  printf("config             0 # This value is the one which is used in the amanda\n");
-  printf("                     # config file to tell the chg-scsi programm which tape\n");
-  printf("                     # and which slots to use\n");
-  printf("                     #\n");
-  printf("cleancart        ??? # The slot where the cleaning tape is located\n");
-  printf("                     # remove it if you have no cleaning tape\n");
-  printf("                     #\n");
-  printf("drivenum           0 # Which tape drive to use if there are more than one drive\n");
-  printf("                     #\n");
-  printf("dev              ??? # Which is the raw device to read/write data from the tape\n");
-  printf("                     # It is important to use the non rewinding tape, like\n");
-  printf("                     # /dev/nrst0 on linux, /dev/nrsa0 on BSD ....\n");
-  printf("                     #\n");
+  g_printf(_(
+   "                     #\n"));
+  g_printf(_(
+   "                     # Here now comes the config for the first tape\n"));
+  g_printf(_(
+   "config             0 # This value is the one which is used in the amanda\n"
+   "                     # config file to tell the chg-scsi programm which tape\n"
+   "                     # and which slots to use\n"
+   "                     #\n"));
+  g_printf(_(
+   "cleancart        ??? # The slot where the cleaning tape is located\n"
+   "                     # remove it if you have no cleaning tape\n"
+   "                     #\n"));
+  g_printf(_(
+   "drivenum           0 # Which tape drive to use if there are more than one drive\n"
+   "                     #\n"));
+  g_printf(_(
+   "dev              ??? # Which is the raw device to read/write data from the tape\n"
+   "                     # It is important to use the non rewinding tape, like\n"
+   "                     # /dev/nrst0 on linux, /dev/nrsa0 on BSD ....\n"
+   "                     #\n"));
 
   /*
    * OK now lets see if we have an direct SCSI channel
@@ -581,10 +565,11 @@ PrintConf(void)
        {
          if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_TAPE)
            {
-             printf("scsitapedev   %s # This is the device to communicate with the tape\n", pDev[count].dev);
-             printf("                     # to get some device stats, not so importatn, and\n");
-             printf("                     # if you run in problems delete it complete\n");
-             printf("                     #\n");
+             g_printf(_(
+               "scsitapedev   %s # This is the device to communicate with the tape\n"
+               "                 # to get some device stats, not so important, and\n"
+               "                 # if you run into problems delete it completely\n"
+               "                 #\n"), pDev[count].dev);
              break;
            }
        }
@@ -593,27 +578,32 @@ PrintConf(void)
 
   if (STE != 0)
     {
-      printf("startuse          0  # Which is the first slot to use\n");
-      printf("                     #\n");
-      printf("enduse            " SIZE_T_FMT "  # Which is the last slot to use\n", STE);
+      g_printf(_(
+       "startuse          0  # Which is the first slot to use\n"
+       "                     #\n"));
+      g_printf(_(
+       "enduse            %zu  # Which is the last slot to use.\n"), STE);
     } else {
-      printf("startuse         ??? # Which is the first slot to use\n");
-      printf("                     #\n");
-      printf("enduse           ??? # Which is the last slot to use\n");
+      g_printf(_(
+       "startuse         ??? # Which is the first slot to use\n"
+       "                     #\n"));
+      g_printf(_(
+       "enduse           ??? # Which is the last slot to use.\n"));
     }
-      printf("                     # decrement this value by 1 if you have an\n");
-      printf("                     # cleaning tape in the last slot\n");
-      printf("                     #\n");
+    g_printf(_(
+       "                     # Decrement this value by 1 if you have a\n"
+       "                     # cleaning tape in the last slot\n"
+       "                     #\n"));
 
   if ((cwd = getcwd(NULL, 0)) == NULL) {
-      cwd = "<unknown>";
+      cwd = _("<unknown>");
   }
 
-  printf("statfile %s/tape0-slot #\n",cwd);
-  printf("cleanfile %s/tape0-clean #\n", cwd);
-  printf("usagecount %s/tape0-totaltime #\n", cwd);
-  printf("tapestatus %s/tape0-tapestatus #\n", cwd);
-  printf("labelfile %s/labelfile #\n", cwd);
+  g_printf(_("statfile %s/tape0-slot #\n"),cwd);
+  g_printf(_("cleanfile %s/tape0-clean #\n"), cwd);
+  g_printf(_("usagecount %s/tape0-totaltime #\n"), cwd);
+  g_printf(_("tapestatus %s/tape0-tapestatus #\n"), cwd);
+  g_printf(_("labelfile %s/labelfile #\n"), cwd);
 }
 
 
@@ -655,13 +645,13 @@ Inventory(
   (void)start; /* Quiet unused parameter warning */
   (void)stop;  /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### START Inventory\n");
+  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### START Inventory\n"));
   pbarcoderes = alloc(SIZEOF(MBC_T));
   memset(pbarcoderes, 0 , SIZEOF(MBC_T));
 
   if (inv_done != 0)
     {
-      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### STOP inv_done -> %d Inventory\n",inv_done);
+      DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP inv_done -> %d Inventory\n"),inv_done);
       free(pbarcoderes);
       return;
       /*NOTREACHED*/
@@ -702,7 +692,7 @@ Inventory(
        */
       if (load(INDEX_CHANGER, drive, x ) != 0)
        {
-         DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, "Load drive(%d) from(%d) failed\n", drive, x);
+         DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Load drive(%d) from(%d) failed\n"), drive, x);
          continue;
        }
 
@@ -730,7 +720,7 @@ Inventory(
            MapBarCode(labelfile, pbarcoderes);
          }
       } else {
-       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, "Read label failed\n");
+       DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Read label failed\n"));
       }
 
       if (eject)
@@ -740,7 +730,7 @@ Inventory(
 
       (void)unload(INDEX_TAPE, drive, x);
     }
-  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### STOP Inventory\n");
+  DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP Inventory\n"));
   free(pbarcoderes);
 }
 
@@ -754,13 +744,13 @@ isempty(
     int                slot)
 {
   extern OpenFiles_T *pDev;
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START isempty\n");
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START isempty\n"));
 
   if (ElementStatusValid == 0)
     {
       if ( pDev[fd].functions->function_status(fd, 1) != 0)
         {
-          DebugPrint(DEBUG_ERROR,SECTION_TAPE,"##### STOP isempty [-1]\n");
+          DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP isempty [-1]\n"));
           return(-1);
          /*NOTREACHED*/
         }
@@ -768,11 +758,11 @@ isempty(
 
   if (pSTE[slot].status == 'E')
     {
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP isempty [1]\n");
+      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [1]\n"));
       return(1);
       /*NOTREACHED*/
     }
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP isempty [0]\n");
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [0]\n"));
   return(0);
 }
 
@@ -784,16 +774,16 @@ get_clean_state(
   /* Return 1 if cleaning is needed */
   int ret;
 
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START get_clean_state\n");
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START get_clean_state\n"));
 
   if (pDev[INDEX_TAPECTL].SCSI == 0)
     {
-      DebugPrint(DEBUG_ERROR,SECTION_TAPE,"##### STOP get_clean_state [-1]\n");
+      DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP get_clean_state [-1]\n"));
       return(-1);
       /*NOTREACHED*/
     }
   ret=pDev[INDEX_TAPECTL].functions->function_clean(tapedev);
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP get_clean_state [%d]\n", ret);
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP get_clean_state [%d]\n"), ret);
   return(ret);
 }
 
@@ -813,7 +803,7 @@ eject_tape(
   extern OpenFiles_T *pDev;
   int ret;
 
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START eject_tape %s\n",tapedev);
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START eject_tape %s\n"),tapedev);
   if (pDev[INDEX_TAPECTL].functions == NULL)
     return(-1);
 
@@ -845,7 +835,7 @@ eject_tape(
     {
       DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### tape_eject eject\n");
       ret=pDev[INDEX_TAPECTL].functions->function_eject(tapedev, type);
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP (SCSI)eject_tape [%d]\n", ret);
+      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (SCSI)eject_tape [%d]\n"), ret);
       return(ret);
       /*NOTREACHED*/
     }
@@ -853,12 +843,12 @@ eject_tape(
   if (pDev[INDEX_TAPE].avail == 1)
     {
       ret=Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT);
-      DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP (ioctl)eject_tape [%d]\n", ret);
+      DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (ioctl)eject_tape [%d]\n"), ret);
       return(ret);
       /*NOTREACHED*/
     }
 
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP eject_tape [-1]\n");
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP eject_tape [-1]\n"));
   return(-1);
 }
 
@@ -874,14 +864,14 @@ find_empty(
   size_t x;
   size_t end;
 
-  DebugPrint(DEBUG_INFO,SECTION_ELEMENT,"###### START find_empty\n");
+  DebugPrint(DEBUG_INFO,SECTION_ELEMENT,_("###### START find_empty\n"));
 
   if (ElementStatusValid == 0)
     {
       if ( pDev[fd].functions->function_status(fd , 1) != 0)
         {
           DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,
-                    "###### END find_empty [-1]\n");
+                    _("###### END find_empty [-1]\n"));
           return((ssize_t)-1);
          /*NOTREACHED*/
         }
@@ -900,21 +890,21 @@ find_empty(
     }
 
   DebugPrint(DEBUG_INFO, SECTION_ELEMENT,
-            "start at " SIZE_T_FMT ", end at " SIZE_T_FMT "\n",
-            (SIZE_T_FMT_TYPE)start,
-            (SIZE_T_FMT_TYPE)end);
+            _("start at %zu, end at %zu\n"),
+            (size_t)start,
+            (size_t)end);
 
   for (x = start; x < end; x++)
     {
       if (pSTE[x].status == 'E')
         {
           DebugPrint(DEBUG_INFO,SECTION_ELEMENT,
-                    "###### END find_empty [" SIZE_T_FMT "]\n", x);
+                    _("###### END find_empty [%lu]\n"), x);
           return((ssize_t)x);
          /*NOTREACHED*/
         }
     }
-  DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,"###### END find_empty [-1]\n");
+  DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,_("###### END find_empty [-1]\n"));
   return((ssize_t)-1);
 }
 
@@ -933,26 +923,27 @@ drive_loaded(
 {
   extern OpenFiles_T *pDev;
 
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### START drive_loaded\n");
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"%-20s : fd %d drivenum %d \n", "drive_loaded", fd, drivenum);
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### START drive_loaded\n"));
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,
+               _("        drive_loaded : fd %d drivenum %d \n"), fd, drivenum);
 
 
   if (ElementStatusValid == 0)
     {
       if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER, 1) != 0)
        {
-         DebugPrint(DEBUG_ERROR,SECTION_TAPE,"Fatal error\n");
+         DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("Fatal error\n"));
          return(-1);
          /*NOTREACHED*/
        }
     }
 
   if (pDTE[drivenum].status == 'E') {
-    DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### STOP drive_loaded (empty)\n");
+    DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (empty)\n"));
     return(0);
     /*NOTREACHED*/
   }
-  DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### STOP drive_loaded (not empty)\n");
+  DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (not empty)\n"));
   return(1);
 }
 
@@ -974,8 +965,10 @@ unload(
   extern int do_inventory;
   MBC_T *pbarcoderes;
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"###### START unload\n");
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"%-20s : fd %d, slot %d, drive %d \n", "unload", fd, slot, drive);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("###### START unload\n"));
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,
+                       _("              unload : fd %d, slot %d, drive %d \n"),
+                       fd, slot, drive);
   pbarcoderes = alloc(SIZEOF(MBC_T));
   memset(pbarcoderes, 0, SIZEOF(MBC_T));
 
@@ -987,19 +980,17 @@ unload(
     {
       if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0)
        {
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Element Status not valid, reset failed\n");
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1)\n");
+         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Element Status not valid, reset failed\n"));
+         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n"));
          free(pbarcoderes);
          return(-1);
          /*NOTREACHED*/
        }
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"%-20s : unload drive %d[%d] slot %d[%d]\n", "unload",
-            drive,
-            pDTE[drive].address,
-            slot,
-            pSTE[slot].address);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,
+               _("              unload : unload drive %d[%d] slot %d[%d]\n"),
+               drive, pDTE[drive].address, slot, pSTE[slot].address);
 
   /*
    * Unloading an empty tape unit makes no sense
@@ -1007,8 +998,8 @@ unload(
    */
   if (pDTE[drive].status == 'E')
     {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,"unload : Drive %d address %d is empty\n", drive, pDTE[drive].address);
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("unload : Drive %d address %d is empty\n"), drive, pDTE[drive].address);
+      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n"));
       free(pbarcoderes);
       return(-1);
       /*NOTREACHED*/
@@ -1020,10 +1011,10 @@ unload(
    */
   if (pSTE[slot].status == 'F')
     {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"unload : Slot %d address %d is full\n", drive, pSTE[slot].address);
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : Slot %d address %d is full\n"), drive, pSTE[slot].address);
       if ( ElementStatusValid == 0)
        {
-         DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "unload: Element Status not valid, can't find an empty slot\n");
+         DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: Element Status not valid, can't find an empty slot\n"));
          free(pbarcoderes);
          return(-1);
          /*NOTREACHED*/
@@ -1032,12 +1023,12 @@ unload(
       slot = find_empty(fd, 0, 0);
       if (slot == -1 )
       {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "unload: No Empty slot found\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: No Empty slot found\n"));
              free(pbarcoderes);
              return(-1);
              /*NOTREACHED*/
       }
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"unload : found empty one, try to unload to slot %d\n", slot);
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : found empty one, try to unload to slot %d\n"), slot);
     }
 
 
@@ -1071,7 +1062,7 @@ unload(
    */
   if (pDev[INDEX_CHANGER].functions->function_move(INDEX_CHANGER,
            pDTE[drive].address, pSTE[slot].address) != 0) {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1 move failed)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 move failed)\n"));
       free(pbarcoderes);
       return(-1);
       /*NOTREACHED*/
@@ -1083,7 +1074,7 @@ unload(
    */
   if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1 update status failed)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 update status failed)\n"));
       free(pbarcoderes);
       return(-1);
       /*NOTREACHED*/
@@ -1124,14 +1115,14 @@ unload(
          } else {
            if (slot != pbarcoderes->data.slot)
              {
-               DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Slot DB out of sync, slot %d != map %d",slot, pbarcoderes->data.slot);
+               DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot);
                do_inventory = 1;
              }
          }
       }
   }
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP unload(0)\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP unload(0)\n"));
   free(pbarcoderes);
   return(0);
 }
@@ -1159,8 +1150,8 @@ load(
   extern int do_inventory;
   MBC_T *pbarcoderes;
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"###### START load\n");
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"%-20s : fd %d, drive %d, slot %d \n", "load", fd, drive, slot);
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START load\n"));
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d, drive %d, slot %d \n"), "load", fd, drive, slot);
   pbarcoderes = alloc(SIZEOF(MBC_T));
   memset(pbarcoderes, 0 , SIZEOF(MBC_T));
 
@@ -1168,8 +1159,8 @@ load(
       {
           if (pDev[fd].functions->function_status(fd, 1) != 0)
               {
-               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1)\n");
-               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n");
+               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1)\n"));
+               DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
                free(pbarcoderes);
                return(-1);
                /*NOTREACHED*/
@@ -1184,8 +1175,8 @@ load(
    */
   if ((size_t)slot >= STE)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : slot %d ge STE %d\n",slot, STE);
-      ChgExit("load", "slot >= STE", FATAL);
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : slot %d ge STE %d\n"),slot, STE);
+      ChgExit("load", _("slot >= STE"), FATAL);
       /*NOTREACHED*/
     }
 
@@ -1194,20 +1185,20 @@ load(
    */
   if (drive >= (int)DTE)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : drive %d ge DTE %d\n",drive, DTE);
-      ChgExit("load", "drive >= DTE", FATAL);
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : drive %d ge DTE %d\n"),drive, DTE);
+      ChgExit("load", _("drive >= DTE"), FATAL);
       /*NOTREACHED*/
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"load : load drive %d[%d] slot %d[%d]\n",drive,
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("load : load drive %d[%d] slot %d[%d]\n"),drive,
             pDTE[drive].address,
             slot,
             pSTE[slot].address);
 
   if (pDTE[drive].status == 'F')
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : Drive %d address %d is full\n", drive, pDTE[drive].address);
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Drive %d address %d is full\n"), drive, pDTE[drive].address);
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
       free(pbarcoderes);
       return(-1);
       /*NOTREACHED*/
@@ -1215,8 +1206,8 @@ load(
 
   if (pSTE[slot].status == 'E')
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : Slot %d address %d is empty\n", drive, pSTE[slot].address);
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Slot %d address %d is empty\n"), drive, pSTE[slot].address);
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
       free(pbarcoderes);
       return(-1);
       /*NOTREACHED*/
@@ -1229,7 +1220,7 @@ load(
    */
   if (pDev[fd].functions->function_status(fd, 1) != 0)
       {
-       DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n");
+       DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n"));
        free(pbarcoderes);
        return(-1);
        /*NOTREACHED*/
@@ -1299,8 +1290,8 @@ load(
            } else { /* We got something, is it correct ? */
              if (slot != pbarcoderes->data.slot && do_inventory == 0)
                {
-                 DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Slot DB out of sync, slot %d != map %d",slot, pbarcoderes->data.slot);
-                 ChgExit("Load", "Label DB out of sync", FATAL);
+                 DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot);
+                 ChgExit("Load", _("Label DB out of sync"), FATAL);
                  /*NOTREACHED*/
                } else { /* OK, so increment the load count */
                  pbarcoderes->action = UPDATE_SLOT;
@@ -1313,16 +1304,16 @@ load(
 
       if (BarCode(INDEX_CHANGER) == 1 && changer->emubarcode == 1)
        {
-         ChgExit("Load", "BarCode == 1 and emubarcode == 1", FATAL);
+         ChgExit("Load", _("BarCode == 1 and emubarcode == 1"), FATAL);
          /*NOTREACHED*/
        }
 
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### STOP load (%d)\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret);
       free(pbarcoderes);
       return(ret);
       /*NOTREACHED*/
     }
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### STOP load (%d)\n",ret);
+    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret);
     free(pbarcoderes);
     return(ret);
 }
@@ -1338,16 +1329,15 @@ get_slot_count(
 {
   extern OpenFiles_T *pDev;
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"###### START get_slot_count\n");
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"%-20s : fd %d\n", "get_slot_count", fd);
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START get_slot_count\n"));
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d\n"), "get_slot_count", fd);
 
   if (ElementStatusValid == 0)
     {
       pDev[fd].functions->function_status(fd, 1);
     }
   DebugPrint(DEBUG_INFO, SECTION_ELEMENT,
-            "##### STOP get_slot_count (" SIZE_T_FMT ")\n",
-            (SIZE_T_FMT_TYPE)STE);
+            _("##### STOP get_slot_count (%zu)\n"), STE);
   return((ssize_t)STE);
   /*
    * return the number of slots in the robot
@@ -1368,22 +1358,21 @@ get_drive_count(
 
   extern OpenFiles_T *pDev;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### START get_drive_count\n");
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-20s : fd %d\n", "get_drive_count", fd);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### START get_drive_count\n"));
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-20s : fd %d\n"), "get_drive_count", fd);
 
   if (ElementStatusValid == 0)
       {
           if ( pDev[fd].functions->function_status(fd, 1) != 0)
            {
-               DebugPrint(DEBUG_ERROR, SECTION_SCSI, "Error getting drive count\n");
-               DebugPrint(DEBUG_ERROR, SECTION_SCSI, "##### STOP get_drive_count (-1)\n");
+               DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Error getting drive count\n"));
+               DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("##### STOP get_drive_count (-1)\n"));
                return(-1);
                /*NOTREACHED*/
            }
       }
   DebugPrint(DEBUG_INFO, SECTION_SCSI,
-            "###### STOP get_drive_count (" SIZE_T_FMT " drives)\n",
-            (SIZE_T_FMT_TYPE)DTE);
+            _("###### STOP get_drive_count (%zu drives)\n"), DTE);
   return((ssize_t)DTE);
 }
 
@@ -1412,8 +1401,8 @@ OpenDevice(
   if (!DeviceName)
        return 1;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START OpenDevice\n");
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"OpenDevice : %s\n", DeviceName);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START OpenDevice\n"));
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("OpenDevice : %s\n"), DeviceName);
 
   pDev[ip].ConfigName = strdup(ConfigName);
   pDev[ip].dev = strdup(DeviceName);
@@ -1428,14 +1417,14 @@ OpenDevice(
               {
                 pDev[ip].functions = p;
                strncpy(pDev[ip].ident, ident, 17);
-                DebugPrint(DEBUG_INFO, SECTION_SCSI,"override using ident = %s, type = %s\n",p->ident, p->type);
-               DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n");
+                DebugPrint(DEBUG_INFO, SECTION_SCSI,_("override using ident = %s, type = %s\n"),p->ident, p->type);
+               DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
                 return(1);
                /*NOTREACHED*/
               }
             p++;
           }
-         ChgExit("OpenDevice", "ident not found", FATAL);
+         ChgExit("OpenDevice", _("ident not found"), FATAL);
          /*NOTREACHED*/
       } else {
         while(p->ident != NULL)
@@ -1443,8 +1432,8 @@ OpenDevice(
             if (strcmp(pDev[ip].ident, p->ident) == 0)
               {
                 pDev[ip].functions = p;
-                DebugPrint(DEBUG_INFO, SECTION_SCSI,"using ident = %s, type = %s\n",p->ident, p->type);
-               DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n");
+                DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type);
+               DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
                 return(1);
                /*NOTREACHED*/
               }
@@ -1455,25 +1444,25 @@ OpenDevice(
       /* divide generic in generic_type, where type is the */
       /* num returned by the inquiry command */
       p = (ChangerCMD_T *)&ChangerIO;
-      snprintf(&tmpstr[0], SIZEOF(tmpstr), "%s_%s","generic",pDev[0].type);
+      g_snprintf(&tmpstr[0], SIZEOF(tmpstr), "%s_%s","generic",pDev[0].type);
       DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### OpenDevice trying GENERIC Device %s\n",tmpstr);
       while(p->ident != NULL)
         {
           if (strcmp(tmpstr, p->ident) == 0)
             {
               pDev[ip].functions = p;
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"using ident = %s, type = %s\n",p->ident, p->type);
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type);
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n"));
               return(1);
              /*NOTREACHED*/
             }
           p++;
         }
     } else { /* Something failed, lets see what */
-      DebugPrint(DEBUG_ERROR, SECTION_SCSI,"##### STOP OpenDevice failed\n");
+      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("##### STOP OpenDevice failed\n"));
     }
   pDev[ip].functions = NULL;
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice (nothing found) !!\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice (nothing found) !!\n"));
   return(0);
 }
 
@@ -1489,13 +1478,13 @@ BarCode(
   int ret;
   extern OpenFiles_T *pDev;
 
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START BarCode\n");
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"%-20s : fd %d\n", "BarCode", fd);
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START BarCode\n"));
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("%-20s : fd %d\n"), "BarCode", fd);
 
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"Ident = [%s], function = [%s]\n", pDev[fd].ident,
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("Ident = [%s], function = [%s]\n"), pDev[fd].ident,
             pDev[fd].functions->ident);
   ret = pDev[fd].functions->function_barcode(fd);
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP BarCode (%d)\n",ret);
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP BarCode (%d)\n"),ret);
   return(ret);
 }
 
@@ -1518,7 +1507,7 @@ Tape_Ready(
   time_t cnt = 0;
 
   RequestSense_T *pRequestSense;
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START Tape_Ready\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START Tape_Ready\n"));
 
   /*
    * Which device should we use to get the
@@ -1544,7 +1533,7 @@ Tape_Ready(
 
   if (pDev[fd].avail == 1 && pDev[fd].SCSI == 0)
     {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : Can't send SCSI commands, try ioctl\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Can't send SCSI commands, try ioctl\n"));
       /*
        * Do we get an non negative result.
        * If yes this function is available
@@ -1558,8 +1547,8 @@ Tape_Ready(
            {
              if ( ret & TAPE_ONLINE)
                {
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : Ready after %d seconds\n",cnt);
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n");
+                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Ready after %d seconds\n"),cnt);
+                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
                  return(0);
                  /*NOTREACHED*/
                }
@@ -1568,15 +1557,15 @@ Tape_Ready(
              ret = Tape_Status(fd);
            }
 
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : not ready, stop after %d seconds\n",cnt);
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n");
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : not ready, stop after %d seconds\n"),cnt);
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
          return(0);
          /*NOTREACHED*/
 
        }
-       DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : no ioctl interface, will sleep for %d seconds\n", wait_time);
+       DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : no ioctl interface, will sleep for %d seconds\n"), wait_time);
        sleep(wait_time);
-       DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n");
+       DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
        return(0);
        /*NOTREACHED*/
     }
@@ -1605,43 +1594,43 @@ Tape_Ready(
          switch (SenseHandler(fd, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
            {
            case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_NO\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_NO\n"));
              done = 1;
              break;
            case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
              break;
            case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_IGNORE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_IGNORE\n"));
              done = 1;
              break;
            case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_ABORT\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_ABORT\n"));
              amfree(pRequestSense);
              return(-1);
              /*NOTREACHED*/
            case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_RETRY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_RETRY\n"));
              break;
            default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) default (SENSE)\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) default (SENSE)\n"));
              done = 1;
              break;
            }
          break;
        case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_ERROR\n");
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_ERROR\n"));
          free(pRequestSense);
          return(-1);
          /*NOTREACHED*/
        case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_BUSY\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_BUSY\n"));
          break;
        case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_CHECK\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_CHECK\n"));
          break;
        default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) unknown (%d)\n",ret);
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) unknown (%d)\n"),ret);
          break;
        }
       sleep(1);
@@ -1649,8 +1638,8 @@ Tape_Ready(
     }
 
   amfree(pRequestSense);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready after %d sec\n", cnt);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready after %d sec\n"), cnt);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n"));
   return(0);
 }
 
@@ -1663,27 +1652,27 @@ DecodeSCSI(
   SC_COM_T *pSCSICommand;
   int x;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, "##### START DecodeSCSI\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START DecodeSCSI\n"));
   pSCSICommand = (SC_COM_T *)&SCSICommand;
 
   while (pSCSICommand->name != NULL)
     {
       if (CDB[0] == pSCSICommand->command)
         {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"%s %s", string, pSCSICommand->name);
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%s %s"), string, pSCSICommand->name);
           for (x=0; x < pSCSICommand->length; x++)
             {
               DebugPrint(DEBUG_INFO, SECTION_SCSI," %02X", CDB[x]);
             }
           DebugPrint(DEBUG_INFO, SECTION_SCSI,"\n");
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP DecodeSCSI\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n"));
           return(0);
          /*NOTREACHED*/
        }
       pSCSICommand++;
     }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"Not found %X\n", CDB[0]);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP DecodeSCSI\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Not found %X\n"), CDB[0]);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n"));
   return(0);
 }
 
@@ -1701,7 +1690,7 @@ DecodeModeSense(
 
   (void)pstring;       /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START DecodeModeSense\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START DecodeModeSense\n"));
 
   dump_hex(buffer, 255, DEBUG_INFO, SECTION_SCSI);
 
@@ -1711,20 +1700,20 @@ DecodeModeSense(
    */
   buffer = buffer + 4 + offset;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"buffer length = %d\n", length);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("buffer length = %d\n"), length);
 
   if (block) /* Do we have an block descriptor page ?*/
     {
       if (out != NULL)
-        fprintf(out, "DecodeModeSense : Density Code %x\n", (unsigned)buffer[0]);
+        g_fprintf(out, _("DecodeModeSense : Density Code %x\n"), (unsigned)buffer[0]);
       buffer++;
 
       if (out != NULL)
-       fprintf(out, "DecodeModeSense : Number of Blocks %d\n", V3(buffer));
+       g_fprintf(out, _("DecodeModeSense : Number of Blocks %d\n"), V3(buffer));
       buffer = buffer + 4;
 
       if (out != NULL)
-       fprintf(out, "DecodeModeSense : Block Length %d\n", V3(buffer));
+       g_fprintf(out, _("DecodeModeSense : Block Length %d\n"), V3(buffer));
       buffer = buffer + 3;
     }
 
@@ -1740,14 +1729,14 @@ DecodeModeSense(
           prp = (ReadWriteErrorRecoveryPage_T *)buffer;
          if (out != NULL)
           {
-               fprintf(out, "DecodeModeSense : Read/Write Error Recovery Page\n");
-               fprintf(out,"\tTransfer Block            %d\n", prp->tb);
-               fprintf(out,"\tEnable Early Recovery     %d\n", prp->eer);
-               fprintf(out,"\tPost Error                %d\n", prp->per);
-               fprintf(out,"\tDisable Transfer on Error %d\n", prp->dte);
-               fprintf(out,"\tDisable ECC Correction    %d\n", prp->dcr);
-               fprintf(out,"\tRead Retry Count          %d\n", prp->ReadRetryCount);
-               fprintf(out,"\tWrite Retry Count         %d\n", prp->WriteRetryCount);
+               g_fprintf(out, _("DecodeModeSense : Read/Write Error Recovery Page\n"));
+               g_fprintf(out,_("\tTransfer Block            %d\n"), prp->tb);
+               g_fprintf(out,_("\tEnable Early Recovery     %d\n"), prp->eer);
+               g_fprintf(out,_("\tPost Error                %d\n"), prp->per);
+               g_fprintf(out,_("\tDisable Transfer on Error %d\n"), prp->dte);
+               g_fprintf(out,_("\tDisable ECC Correction    %d\n"), prp->dcr);
+               g_fprintf(out,_("\tRead Retry Count          %d\n"), prp->ReadRetryCount);
+               g_fprintf(out,_("\tWrite Retry Count         %d\n"), prp->WriteRetryCount);
          }
           buffer++;
           break;
@@ -1755,18 +1744,18 @@ DecodeModeSense(
           pdrp = (DisconnectReconnectPage_T *)buffer;
          if (out != NULL)
           {
-               fprintf(out, "DecodeModeSense : Disconnect/Reconnect Page\n");
-               fprintf(out,"\tBuffer Full Ratio     %d\n", pdrp->BufferFullRatio);
-               fprintf(out,"\tBuffer Empty Ratio    %d\n", pdrp->BufferEmptyRatio);
-               fprintf(out,"\tBus Inactivity Limit  %d\n",
+               g_fprintf(out, _("DecodeModeSense : Disconnect/Reconnect Page\n"));
+               g_fprintf(out,_("\tBuffer Full Ratio     %d\n"), pdrp->BufferFullRatio);
+               g_fprintf(out,_("\tBuffer Empty Ratio    %d\n"), pdrp->BufferEmptyRatio);
+               g_fprintf(out,_("\tBus Inactivity Limit  %d\n"),
                   V2(pdrp->BusInactivityLimit));
-               fprintf(out,"\tDisconnect Time Limit %d\n",
+               g_fprintf(out,_("\tDisconnect Time Limit %d\n"),
                   V2(pdrp->DisconnectTimeLimit));
-               fprintf(out,"\tConnect Time Limit    %d\n",
+               g_fprintf(out,_("\tConnect Time Limit    %d\n"),
                   V2(pdrp->ConnectTimeLimit));
-               fprintf(out,"\tMaximum Burst Size    %d\n",
+               g_fprintf(out,_("\tMaximum Burst Size    %d\n"),
                   V2(pdrp->MaximumBurstSize));
-               fprintf(out,"\tDTDC                  %d\n", pdrp->DTDC);
+               g_fprintf(out,_("\tDTDC                  %d\n"), pdrp->DTDC);
          }
           buffer++;
           break;
@@ -1774,22 +1763,22 @@ DecodeModeSense(
           pEAAPage = (EAAPage_T *)buffer;
          if (out != NULL)
          {
-               fprintf(out,"DecodeModeSense : Element Address Assignment Page\n");
-               fprintf(out,"\tMedium Transport Element Address     %d\n",
+               g_fprintf(out,_("DecodeModeSense : Element Address Assignment Page\n"));
+               g_fprintf(out,_("\tMedium Transport Element Address     %d\n"),
                     V2(pEAAPage->MediumTransportElementAddress));
-               fprintf(out,"\tNumber of Medium Transport Elements  %d\n",
+               g_fprintf(out,_("\tNumber of Medium Transport Elements  %d\n"),
                     V2(pEAAPage->NoMediumTransportElements));
-               fprintf(out, "\tFirst Storage Element Address       %d\n",
+               g_fprintf(out, _("\tFirst Storage Element Address       %d\n"),
                     V2(pEAAPage->FirstStorageElementAddress));
-               fprintf(out, "\tNumber of  Storage Elements         %d\n",
+               g_fprintf(out, _("\tNumber of  Storage Elements         %d\n"),
                     V2(pEAAPage->NoStorageElements));
-               fprintf(out, "\tFirst Import/Export Element Address %d\n",
+               g_fprintf(out, _("\tFirst Import/Export Element Address %d\n"),
                     V2(pEAAPage->FirstImportExportElementAddress));
-               fprintf(out, "\tNumber of  ImportExport Elements    %d\n",
+               g_fprintf(out, _("\tNumber of  ImportExport Elements    %d\n"),
                     V2(pEAAPage->NoImportExportElements));
-               fprintf(out, "\tFirst Data Transfer Element Address %d\n",
+               g_fprintf(out, _("\tFirst Data Transfer Element Address %d\n"),
                     V2(pEAAPage->FirstDataTransferElementAddress));
-               fprintf(out, "\tNumber of  Data Transfer Elements   %d\n",
+               g_fprintf(out, _("\tNumber of  Data Transfer Elements   %d\n"),
                     V2(pEAAPage->NoDataTransferElements));
          }
           buffer++;
@@ -1798,43 +1787,43 @@ DecodeModeSense(
           pDeviceCapabilitiesPage = (DeviceCapabilitiesPage_T *)buffer;
          if (out != NULL)
          {
-               fprintf(out, "DecodeModeSense : MT can store data cartridges %d\n",
+               g_fprintf(out, _("DecodeModeSense : MT can store data cartridges %d\n"),
                     pDeviceCapabilitiesPage->MT);
-               fprintf(out, "DecodeModeSense : ST can store data cartridges %d\n",
+               g_fprintf(out, _("DecodeModeSense : ST can store data cartridges %d\n"),
                     pDeviceCapabilitiesPage->ST);
-               fprintf(out, "DecodeModeSense : IE can store data cartridges %d\n",
+               g_fprintf(out, _("DecodeModeSense : IE can store data cartridges %d\n"),
                     pDeviceCapabilitiesPage->IE);
-               fprintf(out, "DecodeModeSense : DT can store data cartridges %d\n",
+               g_fprintf(out, _("DecodeModeSense : DT can store data cartridges %d\n"),
                     pDeviceCapabilitiesPage->DT);
-               fprintf(out, "DecodeModeSense : MT to MT %d\n",
+               g_fprintf(out, _("DecodeModeSense : MT to MT %d\n"),
                     pDeviceCapabilitiesPage->MT2MT);
-               fprintf(out, "DecodeModeSense : MT to ST %d\n",
+               g_fprintf(out, _("DecodeModeSense : MT to ST %d\n"),
                     pDeviceCapabilitiesPage->MT2ST);
-               fprintf(out, "DecodeModeSense : MT to IE %d\n",
+               g_fprintf(out, _("DecodeModeSense : MT to IE %d\n"),
                     pDeviceCapabilitiesPage->MT2IE);
-               fprintf(out, "DecodeModeSense : MT to DT %d\n",
+               g_fprintf(out, _("DecodeModeSense : MT to DT %d\n"),
                     pDeviceCapabilitiesPage->MT2DT);
-               fprintf(out, "DecodeModeSense : ST to MT %d\n",
+               g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"),
                     pDeviceCapabilitiesPage->ST2ST);
-               fprintf(out, "DecodeModeSense : ST to MT %d\n",
+               g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"),
                     pDeviceCapabilitiesPage->ST2ST);
-               fprintf(out, "DecodeModeSense : ST to DT %d\n",
+               g_fprintf(out, _("DecodeModeSense : ST to DT %d\n"),
                     pDeviceCapabilitiesPage->ST2DT);
-               fprintf(out, "DecodeModeSense : IE to MT %d\n",
+               g_fprintf(out, _("DecodeModeSense : IE to MT %d\n"),
                     pDeviceCapabilitiesPage->IE2MT);
-               fprintf(out, "DecodeModeSense : IE to ST %d\n",
+               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
                     pDeviceCapabilitiesPage->IE2IE);
-               fprintf(out, "DecodeModeSense : IE to ST %d\n",
+               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
                     pDeviceCapabilitiesPage->IE2DT);
-               fprintf(out, "DecodeModeSense : IE to ST %d\n",
+               g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"),
                     pDeviceCapabilitiesPage->IE2DT);
-               fprintf(out, "DecodeModeSense : DT to MT %d\n",
+               g_fprintf(out, _("DecodeModeSense : DT to MT %d\n"),
                     pDeviceCapabilitiesPage->DT2MT);
-               fprintf(out, "DecodeModeSense : DT to ST %d\n",
+               g_fprintf(out, _("DecodeModeSense : DT to ST %d\n"),
                     pDeviceCapabilitiesPage->DT2ST);
-               fprintf(out, "DecodeModeSense : DT to IE %d\n",
+               g_fprintf(out, _("DecodeModeSense : DT to IE %d\n"),
                     pDeviceCapabilitiesPage->DT2IE);
-               fprintf(out, "DecodeModeSense : DT to DT %d\n",
+               g_fprintf(out, _("DecodeModeSense : DT to DT %d\n"),
                     pDeviceCapabilitiesPage->DT2DT);
          }
           buffer++;
@@ -1868,67 +1857,67 @@ DecodeSense(
       return(0);
       /*NOTREACHED*/
     }
-  fprintf(out,"##### START DecodeSense\n");
-  fprintf(out,"%sSense Keys\n", pstring);
+  g_fprintf(out,_("##### START DecodeSense\n"));
+  g_fprintf(out,_("%sSense Keys\n"), pstring);
   if (sense->ErrorCode == 0x70)
     {
-    fprintf(out,"\tExtended Sense                     \n");
+    g_fprintf(out,_("\tExtended Sense                     \n"));
     } else {
-      fprintf(out,"\tErrorCode                     %02x\n", sense->ErrorCode);
-      fprintf(out,"\tValid                         %d\n", sense->Valid);
+      g_fprintf(out,_("\tErrorCode                     %02x\n"), sense->ErrorCode);
+      g_fprintf(out,_("\tValid                         %d\n"), sense->Valid);
     }
-  fprintf(out,"\tASC                           %02X\n", sense->AdditionalSenseCode);
-  fprintf(out,"\tASCQ                          %02X\n", sense->AdditionalSenseCodeQualifier);
-  fprintf(out,"\tSense key                     %02X\n", sense->SenseKey);
+  g_fprintf(out,_("\tASC                           %02X\n"), sense->AdditionalSenseCode);
+  g_fprintf(out,_("\tASCQ                          %02X\n"), sense->AdditionalSenseCodeQualifier);
+  g_fprintf(out,_("\tSense key                     %02X\n"), sense->SenseKey);
   switch (sense->SenseKey)
     {
     case 0:
-      fprintf(out,"\t\tNo Sense\n");
+      g_fprintf(out,_("\t\tNo Sense\n"));
       break;
     case 1:
-      fprintf(out,"\t\tRecoverd Error\n");
+      g_fprintf(out,_("\t\tRecoverd Error\n"));
       break;
     case 2:
-      fprintf(out,"\t\tNot Ready\n");
+      g_fprintf(out,_("\t\tNot Ready\n"));
       break;
     case 3:
-      fprintf(out,"\t\tMedium Error\n");
+      g_fprintf(out,_("\t\tMedium Error\n"));
       break;
     case 4:
-      fprintf(out,"\t\tHardware Error\n");
+      g_fprintf(out,_("\t\tHardware Error\n"));
       break;
     case 5:
-      fprintf(out,"\t\tIllegal Request\n");
+      g_fprintf(out,_("\t\tIllegal Request\n"));
       break;
     case 6:
-      fprintf(out,"\t\tUnit Attention\n");
+      g_fprintf(out,_("\t\tUnit Attention\n"));
       break;
     case 7:
-      fprintf(out,"\t\tData Protect\n");
+      g_fprintf(out,_("\t\tData Protect\n"));
       break;
     case 8:
-      fprintf(out,"\t\tBlank Check\n");
+      g_fprintf(out,_("\t\tBlank Check\n"));
       break;
     case 9:
-      fprintf(out,"\t\tVendor uniq\n");
+      g_fprintf(out,_("\t\tVendor uniq\n"));
       break;
     case 0xa:
-      fprintf(out,"\t\tCopy Aborted\n");
+      g_fprintf(out,_("\t\tCopy Aborted\n"));
       break;
     case 0xb:
-      fprintf(out,"\t\tAborted Command\n");
+      g_fprintf(out,_("\t\tAborted Command\n"));
       break;
     case 0xc:
-      fprintf(out,"\t\tEqual\n");
+      g_fprintf(out,_("\t\tEqual\n"));
       break;
     case 0xd:
-      fprintf(out,"\t\tVolume Overflow\n");
+      g_fprintf(out,_("\t\tVolume Overflow\n"));
       break;
     case 0xe:
-      fprintf(out,"\t\tMiscompare\n");
+      g_fprintf(out,_("\t\tMiscompare\n"));
       break;
     case 0xf:
-      fprintf(out,"\t\tReserved\n");
+      g_fprintf(out,_("\t\tReserved\n"));
       break;
     }
   return(0);
@@ -1942,65 +1931,65 @@ DecodeExtSense(
 {
   ExtendedRequestSense_T *p;
 
-  fprintf(out,"##### START DecodeExtSense\n");
+  g_fprintf(out,_("##### START DecodeExtSense\n"));
   p = sense;
 
-  fprintf(out,"%sExtended Sense\n", pstring);
+  g_fprintf(out,_("%sExtended Sense\n"), pstring);
   DecodeSense((RequestSense_T *)p, pstring, out);
-  fprintf(out,"\tLog Parameter Page Code         %02X\n", sense->LogParameterPageCode);
-  fprintf(out,"\tLog Parameter Code              %02X\n", sense->LogParameterCode);
-  fprintf(out,"\tUnderrun/Overrun Counter        %02X\n", sense->UnderrunOverrunCounter);
-  fprintf(out,"\tRead/Write Error Counter        %d\n", V3((char *)sense->ReadWriteDataErrorCounter));
+  g_fprintf(out,_("\tLog Parameter Page Code         %02X\n"), sense->LogParameterPageCode);
+  g_fprintf(out,_("\tLog Parameter Code              %02X\n"), sense->LogParameterCode);
+  g_fprintf(out,_("\tUnderrun/Overrun Counter        %02X\n"), sense->UnderrunOverrunCounter);
+  g_fprintf(out,_("\tRead/Write Error Counter        %d\n"), V3((char *)sense->ReadWriteDataErrorCounter));
   if (sense->AdditionalSenseLength > (u_char)sizeof(RequestSense_T))
     {
       if (sense->PF)
-        fprintf(out,"\tPower Fail\n");
+        g_fprintf(out,_("\tPower Fail\n"));
       if (sense->BPE)
-        fprintf(out,"\tSCSI Bus Parity Error\n");
+        g_fprintf(out,_("\tSCSI Bus Parity Error\n"));
       if (sense->FPE)
-        fprintf(out,"\tFormatted Buffer parity Error\n");
+        g_fprintf(out,_("\tFormatted Buffer parity Error\n"));
       if (sense->ME)
-        fprintf(out,"\tMedia Error\n");
+        g_fprintf(out,_("\tMedia Error\n"));
       if (sense->ECO)
-        fprintf(out,"\tError Counter Overflow\n");
+        g_fprintf(out,_("\tError Counter Overflow\n"));
       if (sense->TME)
-        fprintf(out,"\tTapeMotion Error\n");
+        g_fprintf(out,_("\tTapeMotion Error\n"));
       if (sense->TNP)
-        fprintf(out,"\tTape Not Present\n");
+        g_fprintf(out,_("\tTape Not Present\n"));
       if (sense->LBOT)
-        fprintf(out,"\tLogical Beginning of tape\n");
+        g_fprintf(out,_("\tLogical Beginning of tape\n"));
       if (sense->TMD)
-        fprintf(out,"\tTape Mark Detect Error\n");
+        g_fprintf(out,_("\tTape Mark Detect Error\n"));
       if (sense->WP)
-        fprintf(out,"\tWrite Protect\n");
+        g_fprintf(out,_("\tWrite Protect\n"));
       if (sense->FMKE)
-        fprintf(out,"\tFilemark Error\n");
+        g_fprintf(out,_("\tFilemark Error\n"));
       if (sense->URE)
-        fprintf(out,"\tUnder Run Error\n");
+        g_fprintf(out,_("\tUnder Run Error\n"));
       if (sense->WEI)
-        fprintf(out,"\tWrite Error 1\n");
+        g_fprintf(out,_("\tWrite Error 1\n"));
       if (sense->SSE)
-        fprintf(out,"\tServo System Error\n");
+        g_fprintf(out,_("\tServo System Error\n"));
       if (sense->FE)
-        fprintf(out,"\tFormatter Error\n");
+        g_fprintf(out,_("\tFormatter Error\n"));
       if (sense->UCLN)
-        fprintf(out,"\tCleaning Cartridge is empty\n");
+        g_fprintf(out,_("\tCleaning Cartridge is empty\n"));
       if (sense->RRR)
-        fprintf(out,"\tReverse Retries Required\n");
+        g_fprintf(out,_("\tReverse Retries Required\n"));
       if (sense->CLND)
-        fprintf(out,"\tTape Drive has been cleaned\n");
+        g_fprintf(out,_("\tTape Drive has been cleaned\n"));
       if (sense->CLN)
-        fprintf(out,"\tTape Drive needs to be cleaned\n");
+        g_fprintf(out,_("\tTape Drive needs to be cleaned\n"));
       if (sense->PEOT)
-        fprintf(out,"\tPhysical End of Tape\n");
+        g_fprintf(out,_("\tPhysical End of Tape\n"));
       if (sense->WSEB)
-        fprintf(out,"\tWrite Splice Error\n");
+        g_fprintf(out,_("\tWrite Splice Error\n"));
       if (sense->WSEO)
-        fprintf(out,"\tWrite Splice Error\n");
-      fprintf(out,"\tRemaing 1024 byte tape blocks   %d\n", V3((char *)sense->RemainingTape));
-      fprintf(out,"\tTracking Retry Counter          %02X\n", sense->TrackingRetryCounter);
-      fprintf(out,"\tRead/Write Retry Counter        %02X\n", sense->ReadWriteRetryCounter);
-      fprintf(out,"\tFault Sympton Code              %02X\n", sense->FaultSymptomCode);
+        g_fprintf(out,_("\tWrite Splice Error\n"));
+      g_fprintf(out,_("\tRemaing 1024 byte tape blocks   %d\n"), V3((char *)sense->RemainingTape));
+      g_fprintf(out,_("\tTracking Retry Counter          %02X\n"), sense->TrackingRetryCounter);
+      g_fprintf(out,_("\tRead/Write Retry Counter        %02X\n"), sense->ReadWriteRetryCounter);
+      g_fprintf(out,_("\tFault Sympton Code              %02X\n"), sense->FaultSymptomCode);
     }
   return(0);
 }
@@ -2009,19 +1998,19 @@ int
 PrintInquiry(
     SCSIInquiry_T *    SCSIInquiry)
 {
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START PrintInquiry\n");
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "qualifier", SCSIInquiry->qualifier);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "type", SCSIInquiry->type);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "data_format", SCSIInquiry->data_format);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "ansi_version", SCSIInquiry->ansi_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "ecma_version", SCSIInquiry->ecma_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "iso_version", SCSIInquiry->iso_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "type_modifier", SCSIInquiry->type_modifier);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "removable", SCSIInquiry->removable);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.8s\n", "vendor_info", SCSIInquiry->vendor_info);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.16s\n", "prod_ident", SCSIInquiry->prod_ident);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.4s\n", "prod_version", SCSIInquiry->prod_version);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.19s\n", "vendor_specific", SCSIInquiry->vendor_specific);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START PrintInquiry\n"));
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "qualifier", SCSIInquiry->qualifier);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "type", SCSIInquiry->type);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "data_format", SCSIInquiry->data_format);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ansi_version", SCSIInquiry->ansi_version);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ecma_version", SCSIInquiry->ecma_version);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "iso_version", SCSIInquiry->iso_version);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "type_modifier", SCSIInquiry->type_modifier);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "removable", SCSIInquiry->removable);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.8s\n"), "vendor_info", SCSIInquiry->vendor_info);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.16s\n"), "prod_ident", SCSIInquiry->prod_ident);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.4s\n"), "prod_version", SCSIInquiry->prod_version);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.19s\n"), "vendor_specific", SCSIInquiry->vendor_specific);
   return(0);
 }
 
@@ -2029,7 +2018,7 @@ PrintInquiry(
 int
 DoNothing0(void)
 {
-  dbprintf(("##### START DoNothing\n"));
+  dbprintf(_("##### START DoNothing\n"));
   return(0);
 }
 
@@ -2039,7 +2028,7 @@ DoNothing1(
 {
   (void)unused1;       /* Quiet unused parameter warning */
 
-  dbprintf(("##### START DoNothing\n"));
+  dbprintf(_("##### START DoNothing\n"));
   return(0);
 }
 
@@ -2051,7 +2040,7 @@ DoNothing2(
   (void)unused1;       /* Quiet unused parameter warning */
   (void)unused2;       /* Quiet unused parameter warning */
 
-  dbprintf(("##### START DoNothing\n"));
+  dbprintf(_("##### START DoNothing\n"));
   return(0);
 }
 
@@ -2065,21 +2054,21 @@ DoNothing3(
   (void)unused2;       /* Quiet unused parameter warning */
   (void)unused3;       /* Quiet unused parameter warning */
 
-  dbprintf(("##### START DoNothing\n"));
+  dbprintf(_("##### START DoNothing\n"));
   return(0);
 }
 
 int
 GenericFree(void)
 {
-  dbprintf(("##### START GenericFree\n"));
+  dbprintf(_("##### START GenericFree\n"));
   return(0);
 }
 
 int
 GenericSearch(void)
 {
-  dbprintf(("##### START GenericSearch\n"));
+  dbprintf(_("##### START GenericSearch\n"));
   return(0);
 }
 
@@ -2091,7 +2080,7 @@ TreeFrogBarCode(
 
   ModePageTreeFrogVendorUnique_T *pVendor;
 
-  dbprintf(("##### START TreeFrogBarCode\n"));
+  dbprintf(_("##### START TreeFrogBarCode\n"));
   if (pModePage == NULL)
     {
       pModePage = alloc(0xff);
@@ -2099,18 +2088,18 @@ TreeFrogBarCode(
 
   if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x0, 0x3f) == 0)
     {
-      DecodeModeSense(pModePage, 0, "TreeFrogBarCode :", 0, debug_file);
+      DecodeModeSense(pModePage, 0, _("TreeFrogBarCode :"), 0, debug_file);
 
       if (pVendorUnique == NULL)
       {
-         dbprintf(("TreeFrogBarCode : no pVendorUnique\n"));
+         dbprintf(_("TreeFrogBarCode : no pVendorUnique\n"));
          return(0);
         /*NOTREACHED*/
       }
       pVendor = ( ModePageTreeFrogVendorUnique_T *)pVendorUnique;
 
-      dbprintf(("TreeFrogBarCode : EBARCO %d\n", pVendor->EBARCO));
-      dbprintf(("TreeFrogCheckSum : CHKSUM  %d\n", pVendor->CHKSUM));
+      dbprintf(_("TreeFrogBarCode : EBARCO %d\n"), pVendor->EBARCO);
+      dbprintf(_("TreeFrogCheckSum : CHKSUM  %d\n"), pVendor->CHKSUM);
 
       dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_ELEMENT);
       return(pVendor->EBARCO);
@@ -2128,14 +2117,14 @@ EXB_BarCode(
   ModePageEXB120VendorUnique_T *pVendor;
   ModePageEXB120VendorUnique_T *pVendorWork;
 
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START EXB_BarCode\n");
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START EXB_BarCode\n"));
   if (pModePage == NULL && LibModeSenseValid == 0)
     {
       pModePage = alloc(0xff);
 
       if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
        {
-         DecodeModeSense(pModePage, 0, "EXB_BarCode :", 0, debug_file);
+         DecodeModeSense(pModePage, 0, _("EXB_BarCode :"), 0, debug_file);
          LibModeSenseValid = 1;
        } else {
          LibModeSenseValid = -1;
@@ -2146,25 +2135,25 @@ EXB_BarCode(
     {
       if (pVendorUnique == NULL)
        {
-         DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : no pVendorUnique\n");
+         DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : no pVendorUnique\n"));
          return(0);
         /*NOTREACHED*/
       }
       pVendor = ( ModePageEXB120VendorUnique_T *)pVendorUnique;
 
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : NBL %d\n", pVendor->NBL);
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : PS  %d\n", pVendor->PS);
+      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : NBL %d\n"), pVendor->NBL);
+      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : PS  %d\n"), pVendor->PS);
       if (pVendor->NBL == 1 && pVendor->PS == 1 )
         {
           pVendorWork = alloc((size_t)pVendor->ParameterListLength + 2);
-          DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : setting NBL to 1\n");
+          DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : setting NBL to 1\n"));
           memcpy(pVendorWork, pVendor, (size_t)pVendor->ParameterListLength + 2);
           pVendorWork->NBL = 0;
           pVendorWork->PS = 0;
           pVendorWork->RSVD0 = 0;
           if (SCSI_ModeSelect(DeviceFD, (u_char *)pVendorWork, (u_char)(pVendorWork->ParameterListLength + 2), 0, 1, 0) == 0)
             {
-              DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : SCSI_ModeSelect OK\n");
+              DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect OK\n"));
               /* Hack !!!!!!
                */
               pVendor->NBL = 0;
@@ -2173,12 +2162,12 @@ EXB_BarCode(
                */
               GenericResetStatus(DeviceFD);
             } else {
-              DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : SCSI_ModeSelect failed\n");
+              DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect failed\n"));
             }
             amfree(pVendorWork);
         }
       dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_BARCODE);
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : vendor_specific[19] %x\n",
+      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : vendor_specific[19] %x\n"),
                 pDev[INDEX_CHANGER].inquiry->vendor_specific[19]);
     }
   return(1);
@@ -2190,8 +2179,8 @@ NoBarCode(
 {
   (void)DeviceFD;      /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START NoBarCode\n");
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP  NoBarCode\n");
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START NoBarCode\n"));
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP  NoBarCode\n"));
   return(0);
 }
 
@@ -2201,14 +2190,14 @@ GenericBarCode(
 {
   (void)DeviceFD;      /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START GenericBarCode\n");
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START GenericBarCode\n"));
   if ( changer->havebarcode  >= 1)
     {
-      DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP GenericBarCode (havebarcode) => %d\n",changer->havebarcode);
+      DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode (havebarcode) => %d\n"),changer->havebarcode);
       return(1);
       /*NOTREACHED*/
     }
-  DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP GenericBarCode => 0\n");
+  DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode => 0\n"));
   return(0);
 }
 
@@ -2223,16 +2212,16 @@ SenseHandler(
 {
   extern OpenFiles_T *pDev;
   int ret = 0;
-  dbprintf(("##### START SenseHandler\n"));
+  dbprintf(_("##### START SenseHandler\n"));
   if (pDev[DeviceFD].inqdone == 1)
     {
-      dbprintf(("Ident = [%s], function = [%s]\n", pDev[DeviceFD].ident,
-               pDev[DeviceFD].functions->ident));
+      dbprintf(_("Ident = [%s], function = [%s]\n"), pDev[DeviceFD].ident,
+               pDev[DeviceFD].functions->ident);
       ret = pDev[DeviceFD].functions->function_error(DeviceFD, flag, SenseKey, AdditionalSenseCode, AdditionalSenseCodeQualifier, buffer);
     } else {
-      dbprintf(("    Ups no sense\n"));
+      dbprintf(_("    Ups no sense\n"));
     }
-  dbprintf(("#### STOP SenseHandler\n"));
+  dbprintf(_("#### STOP SenseHandler\n"));
   return(ret);
 }
 
@@ -2256,7 +2245,7 @@ TapeStatus(void)
   int cnt;
   RequestSense_T *pRequestSense;
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START TapeStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START TapeStatus\n"));
 
   /*
    * If it is an device which understand SCSI commands the
@@ -2271,7 +2260,7 @@ TapeStatus(void)
       for (done = 0, cnt = 0; !done && (cnt < 60); cnt++)
        {
          ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, "TapeStatus TestUnitReady ret %d\n",ret);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("TapeStatus TestUnitReady ret %d\n"),ret);
          switch (ret)
            {
            case SCSI_OK:
@@ -2280,49 +2269,49 @@ TapeStatus(void)
                {
                case SENSE_IGNORE:
                case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_NO\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_NO\n"));
                  pDTE[0].status = 'F';
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### FULL\n");
+                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n"));
                  done = 1;
                  break;
 
                case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
                  pDTE[0].status = 'E';
-                 DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### EMPTY\n");
+                 DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n"));
                  done = 1;
                  break;
 
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_ABORT\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_ABORT\n"));
                  done = 1;
                  break;
 
                case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_RETRY\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_RETRY\n"));
                  break;
 
                default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) default (SENSE)\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) default (SENSE)\n"));
                  break;
                }
              break;
 
            case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_ERROR\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_ERROR\n"));
              done = 1;
              break;
 
            case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_BUSY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_BUSY\n"));
              break;
 
            case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_CHECK\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_CHECK\n"));
              break;
 
            default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) unknown (%d)\n",ret);
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) unknown (%d)\n"),ret);
              break;
 
            }
@@ -2335,12 +2324,12 @@ TapeStatus(void)
       if ( ret & TAPE_ONLINE)
        {
          pDTE[0].status ='F';
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### FULL\n");
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n"));
        } else {
          pDTE[0].status = 'E';
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### EMPTY\n");
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n"));
        }
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP TapeStatus\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP TapeStatus\n"));
     }
     return(0);
 }
@@ -2360,14 +2349,14 @@ DLT4000Eject(
 
   (void)Device;        /* Quiet unused parameter warning */
 
-  dbprintf(("##### START DLT4000Eject\n"));
+  dbprintf(_("##### START DLT4000Eject\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
   pExtendedRequestSense = alloc(SIZEOF(ExtendedRequestSense_T));
 
   if ( type > 1)
     {
-      dbprintf(("DLT4000Eject : use mtio ioctl for eject on %s\n", pDev[INDEX_TAPE].dev));
+      dbprintf(_("DLT4000Eject : use mtio ioctl for eject on %s\n"), pDev[INDEX_TAPE].dev);
       free(pExtendedRequestSense);
       free(pRequestSense);
       return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT));
@@ -2378,7 +2367,7 @@ DLT4000Eject(
 
   if (pDev[INDEX_TAPECTL].SCSI == 0)
     {
-      dbprintf(("DLT4000Eject : Device %s not able to receive SCSI commands\n", pDev[INDEX_TAPE].dev));
+      dbprintf(_("DLT4000Eject : Device %s not able to receive SCSI commands\n"), pDev[INDEX_TAPE].dev);
       free(pExtendedRequestSense);
       free(pRequestSense);
       return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT));
@@ -2386,17 +2375,17 @@ DLT4000Eject(
     }
 
 
-  dbprintf(("DLT4000Eject : SCSI eject on %s = %s\n", pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName));
+  dbprintf(_("DLT4000Eject : SCSI eject on %s = %s\n"), pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName);
 
   RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0);
-  DecodeExtSense(pExtendedRequestSense, "DLT4000Eject : ", debug_file);
+  DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file);
   /* Unload the tape, 0 ==  wait for success
    * 0 == unload
    */
   ret = SCSI_LoadUnload(INDEX_TAPECTL, pRequestSense, 0, 0);
 
   RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0);
-  DecodeExtSense(pExtendedRequestSense, "DLT4000Eject : ", debug_file);
+  DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file);
 
   /* < 0 == fatal */
   if (ret >= 0) {
@@ -2410,7 +2399,7 @@ DLT4000Eject(
   while (!done && cnt < 300)
     {
       ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-      DebugPrint(DEBUG_INFO, SECTION_SCSI, "DLT4000Eject TestUnitReady ret %d\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI, _("DLT4000Eject TestUnitReady ret %d\n"),ret);
       switch (ret)
        {
        case SCSI_OK:
@@ -2420,46 +2409,46 @@ DLT4000Eject(
          switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
            {
            case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_NO\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_NO\n"));
              done = 1;
              break;
            case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
              done = 1;
              break;
            case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_IGNORE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_IGNORE\n"));
              done = 1;
              break;
            case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_ABORT\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_ABORT\n"));
              free(pExtendedRequestSense);
              free(pRequestSense);
              return(-1);
              /*NOTREACHED*/
            case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_RETRY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_RETRY\n"));
              break;
            default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) default (SENSE)\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) default (SENSE)\n"));
              done = 1;
              break;
            }
          break;
        case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_ERROR\n");
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_ERROR\n"));
          free(pExtendedRequestSense);
          free(pRequestSense);
          return(-1);
          /*NOTREACHED*/
        case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_BUSY\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_BUSY\n"));
          break;
        case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_CHECK\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_CHECK\n"));
          break;
        default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) unknown (%d)\n",ret);
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) unknown (%d)\n"),ret);
          break;
        }
 
@@ -2467,7 +2456,7 @@ DLT4000Eject(
       sleep(2);
     }
 
-  dbprintf(("DLT4000Eject : Ready after %d sec, done = %d\n", cnt * 2, done));
+  dbprintf(_("DLT4000Eject : Ready after %d sec, done = %d\n"), cnt * 2, done);
 
   free(pExtendedRequestSense);
   free(pRequestSense);
@@ -2497,11 +2486,11 @@ GenericEject(
   (void)Device;        /* Quiet unused parameter warning */
   (void)type;  /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, "##### START GenericEject\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("##### START GenericEject\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericEject : SCSI eject on %s = %s\n",
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : SCSI eject on %s = %s\n"),
              pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName);
 
   /*
@@ -2528,7 +2517,7 @@ GenericEject(
       while (!done && cnt < 300)
        {
          ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, "GenericEject TestUnitReady ret %d\n",ret);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericEject TestUnitReady ret %d\n"),ret);
          switch (ret)
            {
            case SCSI_OK:
@@ -2536,52 +2525,52 @@ GenericEject(
              switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
                {
                case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_NO\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_NO\n"));
                  break;
                case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
                  done = 1;
                  break;
                case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_IGNORE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_IGNORE\n"));
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_ABORT\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_ABORT\n"));
                  free(pRequestSense);
                  return(-1);
                  /*NOTREACHED*/
                case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_RETRY\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_RETRY\n"));
                  break;
                default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) default (SENSE)\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) default (SENSE)\n"));
                  break;
                }
              break;
            case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_ERROR\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_ERROR\n"));
              free(pRequestSense);
              return(-1);
              /*NOTREACHED*/
            case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_BUSY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_BUSY\n"));
              break;
            case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_CHECK\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_CHECK\n"));
              break;
            default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) unknown (%d)\n",ret);
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) unknown (%d)\n"),ret);
              break;
            }
          cnt++;
          sleep(2);
        }
     } else {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericEject : Device can't understand SCSI try ioctl\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : Device can't understand SCSI try ioctl\n"));
       Tape_Ioctl(INDEX_TAPECTL, IOCTL_EJECT);
     }
   DebugPrint(DEBUG_INFO, SECTION_TAPE,
-            "GenericEject : Ready after %d sec\n", cnt * 2);
+            _("GenericEject : Ready after %d sec\n"), cnt * 2);
   free(pRequestSense);
   return(0);
 }
@@ -2608,7 +2597,7 @@ GenericRewind(
   int cnt = 0;
   int done;
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START GenericRewind pDEV -> %d\n",DeviceFD);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericRewind pDEV -> %d\n"),DeviceFD);
 
 
   /*
@@ -2627,7 +2616,7 @@ GenericRewind(
       while (!done)
        {
          ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense );
-         DebugPrint(DEBUG_INFO, SECTION_TAPE, "GenericRewind (TestUnitReady) ret %d\n",ret);
+         DebugPrint(DEBUG_INFO, SECTION_TAPE, _("GenericRewind (TestUnitReady) ret %d\n"),ret);
          switch (ret)
            {
            case SCSI_OK:
@@ -2637,55 +2626,55 @@ GenericRewind(
              switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
                {
                case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_NO\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n"));
                  done = 1;
                  break;
                case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
                  free(pRequestSense);
                  return(-1);
                  /*NOTREACHED*/
                case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_IGNORE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n"));
                  done = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_ABORT\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n"));
                  free(pRequestSense);
                  return(-1);
                  /*NOTREACHED*/
                case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_RETRY\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n"));
                  break;
                default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) default (SENSE)\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n"));
                  done = 1;
                  break;
                }  /* switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey.... */
              break;
 
            case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_ERROR\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n"));
              free(pRequestSense);
              return(-1);
              /*NOTREACHED*/
 
            case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_BUSY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n"));
              break;
            case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_CHECK\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n"));
              break;
            default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) unknown (%d)\n",ret);
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret);
              break;
            }
 
          sleep(1);
-         DebugPrint(DEBUG_INFO, SECTION_TAPE," Wait .... (%d)\n",cnt);
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_(" Wait .... (%d)\n"),cnt);
          if (cnt > 180)
            {
-             DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP GenericRewind (-1)\n");
+             DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n"));
              free(pRequestSense);
              return(-1);
              /*NOTREACHED*/
@@ -2709,7 +2698,7 @@ GenericRewind(
                         pRequestSense,
                         SIZEOF(RequestSense_T));
 
-         DecodeSense(pRequestSense, "GenericRewind : ", debug_file);
+         DecodeSense(pRequestSense, _("GenericRewind : "), debug_file);
 
          if (ret > 0)
            {
@@ -2724,7 +2713,7 @@ GenericRewind(
            }
          if (ret < 0)
            {
-             DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : failed %d\n", ret);
+             DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : failed %d\n"), ret);
              done = 1;
            }
        }
@@ -2733,7 +2722,7 @@ GenericRewind(
       while (!done && (cnt < 300))
        {
          ret = SCSI_TestUnitReady(DeviceFD, pRequestSense);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI, "GenericRewind TestUnitReady ret %d\n",ret);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericRewind TestUnitReady ret %d\n"),ret);
          switch (ret)
            {
            case SCSI_OK:
@@ -2743,45 +2732,45 @@ GenericRewind(
              switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
                {
                case SENSE_NO:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_NO\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n"));
                  done = 1;
                  break;
                case SENSE_TAPE_NOT_ONLINE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
                  free(pRequestSense);
                  return(-1);
                  /*NOTREACHED*/
                case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_IGNORE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n"));
                  done = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_ABORT\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n"));
                  free(pRequestSense);
                  return(-1);
                  /*NOTREACHED*/
                case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_RETRY\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n"));
                  break;
                default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) default (SENSE)\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n"));
                  done = 1;
                  break;
                }
              break;
            case SCSI_ERROR:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_ERROR\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n"));
              return(-1);
              /*NOTREACHED*/
 
            case SCSI_BUSY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_BUSY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n"));
              break;
            case SCSI_CHECK:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_CHECK\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n"));
              break;
            default:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) unknown (%d)\n",ret);
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret);
              break;
            }
 
@@ -2791,26 +2780,26 @@ GenericRewind(
 
       amfree(pRequestSense);
 
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : Ready after %d sec, "
-                       "done = %d\n", cnt * 2, done);
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (0)\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : Ready after %d sec, "
+                       "done = %d\n"), cnt * 2, done);
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n"));
     } else {
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : use ioctl rewind\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : use ioctl rewind\n"));
       if (pDev[DeviceFD].devopen == 1)
        {
-         DebugPrint(DEBUG_INFO, SECTION_TAPE,"Close Device\n");
+         DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Close Device\n"));
          SCSI_CloseDevice(DeviceFD);
        }
       /* We don't retry if it fails; that is left to the vtape driver. */
       if ((errstr = tape_rewind(pDev[DeviceFD].dev)) == NULL) {
-          DebugPrint(DEBUG_INFO, SECTION_TAPE,"Rewind OK,\n", cnt);
+          DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Rewind OK,\n"), cnt);
       } else {
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Rewind failed %s\n",errstr);
-          DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (-1)\n");
+          DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Rewind failed %s\n"),errstr);
+          DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n"));
           return(-1);
          /*NOTREACHED*/
       }
-      DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (0)\n");
+      DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n"));
     }
 
   return(0);
@@ -2832,11 +2821,11 @@ GenericClean(
 
   (void)Device;        /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START GenericClean\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericClean\n"));
   if (pDev[INDEX_TAPECTL].SCSI == 0)
       {
-          DebugPrint(DEBUG_ERROR, SECTION_TAPE,"GenericClean : can't send SCSI commands\n");
-         DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP GenericClean\n");
+          DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("GenericClean : can't send SCSI commands\n"));
+         DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericClean\n"));
           return(0);
          /*NOTREACHED*/
       }
@@ -2847,16 +2836,16 @@ GenericClean(
   if ( RequestSense(INDEX_TAPECTL, &ExtRequestSense, 1) == 0)
     {
 
-      DecodeExtSense(&ExtRequestSense, "GenericClean : ", debug_file);
+      DecodeExtSense(&ExtRequestSense, _("GenericClean : "), debug_file);
       if(ExtRequestSense.CLN) {
        ret = 1;
       } else {
        ret = 0;
       }
     } else {
-      DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Got error from RequestSense\n");
+      DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Got error from RequestSense\n"));
     }
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericClean (%d)\n",ret);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericClean (%d)\n"),ret);
   return(ret);
 }
 
@@ -2937,7 +2926,7 @@ GenericResetStatus(
   int ret = 0;
   int retry = 1;
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START GenericResetStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericResetStatus\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
@@ -2958,11 +2947,11 @@ GenericResetStatus(
 
       if (ret < 0)
         {
-          /*        fprintf(stderr, "%s: Request Sense[Inquiry]: %02X", */
+          /*        g_fprintf(stderr, _("%s: Request Sense[Inquiry]: %02X"), */
           /*                "chs", ((u_char *) &pRequestSense)[0]); */
           /*        for (i = 1; i < SIZEOF(RequestSense_T); i++)                */
-          /*          fprintf(stderr, " %02X", ((u_char *) &pRequestSense)[i]); */
-          /*        fprintf(stderr, "\n");    */
+          /*          g_fprintf(stderr, " %02X", ((u_char *) &pRequestSense)[i]); */
+          /*        g_fprintf(stderr, "\n");    */
          free(pRequestSense);
           return(ret);
          /*NOTREACHED*/
@@ -2983,17 +2972,17 @@ GenericResetStatus(
               retry++;
               if (retry < MAX_RETRIES )
                 {
-                  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "GenericResetStatus : retry %d\n", retry);
+                  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericResetStatus : retry %d\n"), retry);
                   sleep(2);
                 } else {
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericResetStatus : return (-1)\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus : return (-1)\n"));
                  free(pRequestSense);
                   return(-1);
                  /*NOTREACHED*/
                 }
               break;
             default:
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericResetStatus :  (default) return (-1)\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus :  (default) return (-1)\n"));
              free(pRequestSense);
               return(-1);
               /*NOTREACHED*/
@@ -3002,7 +2991,7 @@ GenericResetStatus(
       if (ret == 0)
         retry = 0;
     }
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "##### STOP GenericResetStatus (%d)\n",ret);
+  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("##### STOP GenericResetStatus (%d)\n"),ret);
   free(pRequestSense);
   return(ret);
 }
@@ -3034,9 +3023,9 @@ GenericSenseHandler(
   int ret;
   char *info = NULL;
 
-  dbprintf(("##### START GenericSenseHandler\n"));
+  dbprintf(_("##### START GenericSenseHandler\n"));
 
-  DecodeSense(pRequestSense, "GenericSenseHandler : ", debug_file);
+  DecodeSense(pRequestSense, _("GenericSenseHandler : "), debug_file);
 
   ret = Sense2Action(pDev[ip].ident,
                     pDev[ip].inquiry->type,
@@ -3045,7 +3034,7 @@ GenericSenseHandler(
                     AdditionalSenseCodeQualifier,
                     &info);
 
-  dbprintf(("##### STOP GenericSenseHandler\n"));
+  dbprintf(_("##### STOP GenericSenseHandler: %s\n"), _(info));
   return(ret);
 }
 
@@ -3077,31 +3066,31 @@ SDXMove(
   int SDX_STE = -1;     /* to                          */
   int SDX_DTE = -1;     /* AlignElements               */
 
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### START SDXMove\n");
+  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### START SDXMove\n"));
 
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,"%-20s : from = %d, to = %d\n", "SDXMove", from, to);
+  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("%-20s : from = %d, to = %d\n"), "SDXMove", from, to);
 
 
   if ((pfrom = LookupElement(from)) == NULL)
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : ElementInfo for %d not found\n", from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), from);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   if ((pto = LookupElement(to)) == NULL)
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : ElementInfo for %d not found\n", to);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), to);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   if (pfrom->status == 'E')
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : from %d is empty\n", from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : from %d is empty\n"), from);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
@@ -3113,20 +3102,20 @@ SDXMove(
          case CHANGER:
            break;
          case STORAGE:
-           DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : Destination Element %d Type %d is full\n",
+           DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Destination Element %d Type %d is full\n"),
                 pto->address, pto->type);
             to = find_empty(DeviceFD, 0, 0);
            if (to == -1 )
            {
-                   DebugPrint(DEBUG_ERROR, SECTION_MOVE,"SDXMove : no empty slot found for unload\n");
+                   DebugPrint(DEBUG_ERROR, SECTION_MOVE,_("SDXMove : no empty slot found for unload\n"));
                    return(-1);
                    /*NOTREACHED*/
            }
-            DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : Unload to %d\n", to);
+            DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Unload to %d\n"), to);
             if ((pto = LookupElement(to)) == NULL)
             {
-             DebugPrint(DEBUG_INFO, SECTION_MOVE, "SDXMove : ElementInfo for %d not found\n", to);
-             DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+             DebugPrint(DEBUG_INFO, SECTION_MOVE, _("SDXMove : ElementInfo for %d not found\n"), to);
+             DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
              return(-1);
              /*NOTREACHED*/
             }
@@ -3169,16 +3158,16 @@ SDXMove(
   if (SDX_DTE >= 0 && SDX_STE >= 0)
   {
     ret = SCSI_AlignElements(DeviceFD, SDX_MTE, SDX_DTE, SDX_STE);
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### SCSI_AlignElemnts ret = %d\n",ret);
+    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### SCSI_AlignElemnts ret = %d\n"),ret);
     if (ret != 0 )
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
   } else {
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### Error setting STE/DTE %d/%d\n", SDX_STE, SDX_DTE);
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### Error setting STE/DTE %d/%d\n"), SDX_STE, SDX_DTE);
+    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
     return(-1);
     /*NOTREACHED*/
   }
@@ -3205,11 +3194,11 @@ SDXMove(
   {
     ret = SCSI_Move(DeviceFD, 0, from, to);
   } else {
-    DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+    DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
     return(ret);
     /*NOTREACHED*/
   }
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n");
+  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n"));
   return(ret);
 }
 
@@ -3233,51 +3222,51 @@ GenericMove(
   ElementInfo_T *pto;
   int ret = 0;
 
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, "##### START GenericMove\n");
+  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START GenericMove\n"));
 
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, "%-20s : from = %d, to = %d\n", "GenericMove", from, to);
+  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("%-20s : from = %d, to = %d\n"), "GenericMove", from, to);
 
 
   if ((pfrom = LookupElement(from)) == NULL)
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : ElementInfo for %d not found\n", from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), from);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   if ((pto = LookupElement(to)) == NULL)
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : ElementInfo for %d not found\n", to);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), to);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   if (pfrom->status == 'E')
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : from %d is empty\n", from);
-      DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n");
+      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : from %d is empty\n"), from);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   if (pto->status == 'F')
     {
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : Destination Element %d Type %d is full\n",
+      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Destination Element %d Type %d is full\n"),
                 pto->address, pto->type);
       to = find_empty(DeviceFD, 0, 0);
       if ( to == -1)
       {
-             DebugPrint(DEBUG_ERROR, SECTION_MOVE, "GenericMove : no empty slot found\n");
+             DebugPrint(DEBUG_ERROR, SECTION_MOVE, _("GenericMove : no empty slot found\n"));
              return(-1);
              /*NOTREACHED*/
       }
-      DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : Unload to %d\n", to);
+      DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Unload to %d\n"), to);
       if ((pto = LookupElement(to)) == NULL)
         {
-          DebugPrint(DEBUG_ERROR, SECTION_MOVE, " Ups should not happen\n");
-         DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n");
+          DebugPrint(DEBUG_ERROR, SECTION_MOVE, _(" Ups should not happen\n"));
+         DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
          return(-1);
          /*NOTREACHED*/
         }
@@ -3288,8 +3277,8 @@ GenericMove(
       ret = SCSI_Move(DeviceFD, 0, from, to);
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : SCSI_Move return (%d)\n", ret);
-  DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n");
+  DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : SCSI_Move return (%d)\n"), ret);
+  DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n"));
   return(ret);
 }
 
@@ -3308,41 +3297,41 @@ CheckMove(
 {
        int moveok = 0;
 
-       DebugPrint(DEBUG_INFO, SECTION_MOVE, "##### START CheckMove\n");
+       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START CheckMove\n"));
        if (pDeviceCapabilitiesPage != NULL )
          {
-           DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : checking if move from %d to %d is legal\n", from->address, to->address);
+           DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : checking if move from %d to %d is legal\n"), from->address, to->address);
            switch (from->type)
              {
              case CHANGER:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : MT2");
+               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : MT2"));
                switch (to->type)
                  {
                  case CHANGER:
                    if (pDeviceCapabilitiesPage->MT2MT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
                        moveok = 1;
                      }
                    break;
                  case STORAGE:
                    if (pDeviceCapabilitiesPage->MT2ST == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
                        moveok = 1;
                      }
                    break;
                  case IMPORT:
                    if (pDeviceCapabilitiesPage->MT2IE == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
                        moveok = 1;
                      }
                    break;
                  case TAPETYPE:
                    if (pDeviceCapabilitiesPage->MT2DT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
                        moveok = 1;
                      }
                    break;
@@ -3351,34 +3340,34 @@ CheckMove(
                  }
                break;
              case STORAGE:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : ST2");
+               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : ST2"));
                switch (to->type)
                  {
                  case CHANGER:
                    if (pDeviceCapabilitiesPage->ST2MT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
                        moveok = 1;
                      }
                    break;
                  case STORAGE:
                    if (pDeviceCapabilitiesPage->ST2ST == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
                        moveok = 1;
                      }
                    break;
                  case IMPORT:
                    if (pDeviceCapabilitiesPage->ST2IE == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
                        moveok = 1;
                      }
                    break;
                  case TAPETYPE:
                    if (pDeviceCapabilitiesPage->ST2DT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
                        moveok = 1;
                      }
                    break;
@@ -3387,34 +3376,34 @@ CheckMove(
                  }
                break;
              case IMPORT:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : IE2");
+               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : IE2"));
                switch (to->type)
                  {
                  case CHANGER:
                    if (pDeviceCapabilitiesPage->IE2MT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
                        moveok = 1;
                      }
                    break;
                  case STORAGE:
                    if (pDeviceCapabilitiesPage->IE2ST == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
                        moveok = 1;
                      }
                    break;
                  case IMPORT:
                    if (pDeviceCapabilitiesPage->IE2IE == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
                        moveok = 1;
                      }
                    break;
                  case TAPETYPE:
                    if (pDeviceCapabilitiesPage->IE2DT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
                        moveok = 1;
                      }
                    break;
@@ -3423,34 +3412,34 @@ CheckMove(
                  }
                break;
              case TAPETYPE:
-               DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : DT2");
+               DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : DT2"));
                switch (to->type)
                  {
                  case CHANGER:
                    if (pDeviceCapabilitiesPage->DT2MT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n"));
                        moveok = 1;
                      }
                    break;
                  case STORAGE:
                    if (pDeviceCapabilitiesPage->DT2ST == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n"));
                        moveok = 1;
                      }
                    break;
                  case IMPORT:
                    if (pDeviceCapabilitiesPage->DT2IE == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n"));
                        moveok = 1;
                      }
                    break;
                  case TAPETYPE:
                    if (pDeviceCapabilitiesPage->DT2DT == 1)
                      {
-                       DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n");
+                       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n"));
                        moveok = 1;
                      }
                    break;
@@ -3462,14 +3451,14 @@ CheckMove(
                break;
              }
          } else {
-           DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : pDeviceCapabilitiesPage == NULL");
+           DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : pDeviceCapabilitiesPage == NULL"));
            /*
-             ChgExit("CheckMove", "DeviceCapabilitiesPage == NULL", FATAL);
+             ChgExit("CheckMove", _("DeviceCapabilitiesPage == NULL"), FATAL);
            */
            moveok=1;
          }
 
-       DebugPrint(DEBUG_INFO, SECTION_MOVE, "###### STOP CheckMove\n");
+       DebugPrint(DEBUG_INFO, SECTION_MOVE, _("###### STOP CheckMove\n"));
        return(moveok);
 }
 
@@ -3483,13 +3472,13 @@ GetCurrentSlot(
 {
   extern OpenFiles_T *pDev;
   size_t x;
-  dbprintf(("##### START GetCurrentSlot\n"));
+  dbprintf(_("##### START GetCurrentSlot\n"));
 
   (void)fd;    /* Quiet unused parameter warning */
 
   if (pDev[0].SCSI == 0)
       {
-          dbprintf(("GetCurrentSlot : can't send SCSI commands\n"));
+          dbprintf(_("GetCurrentSlot : can't send SCSI commands\n"));
           return(-1);
          /*NOTREACHED*/
       }
@@ -3557,7 +3546,7 @@ GenericElementStatus(
 
   (void)InitStatus;    /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START GenericElementStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericElementStatus\n"));
 
   if (pEAAPage == NULL)
     {
@@ -3573,9 +3562,9 @@ GenericElementStatus(
          if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
            {
              LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 0, "GenericElementStatus :", 0, debug_file);
+             DecodeModeSense(pModePage, 0, _("GenericElementStatus :"), 0, debug_file);
            } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"GetElementStatus : failed SCSI_ModeSense\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : failed SCSI_ModeSense\n"));
              LibModeSenseValid = -1;
            }
         }
@@ -3594,7 +3583,7 @@ GenericElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on MTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on MTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3612,7 +3601,7 @@ GenericElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on IEE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IEE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3631,7 +3620,7 @@ GenericElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on IES\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IES\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3649,7 +3638,7 @@ GenericElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on DTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on DTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3666,7 +3655,7 @@ GenericElementStatus(
          if (GenericResetStatus(DeviceFD) != 0)
            {
              ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Can't init status STEError(%d) MTEError(%d) DTEError(%d) IEEError(%d)\n", STEError, MTEError, DTEError, IEEError);
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status STEError(%d) MTEError(%d) DTEError(%d) IEEError(%d)\n"), STEError, MTEError, DTEError, IEEError);
              return(-1);
              /*NOTREACHED*/
            }
@@ -3682,7 +3671,7 @@ GenericElementStatus(
           */
          if (pDTE[0].status == 'E')
            {
-             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "GenericElementStatus : try to move tape to tape drive\n");
+             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericElementStatus : try to move tape to tape drive\n"));
              pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address);
            }
        }
@@ -3691,13 +3680,13 @@ GenericElementStatus(
 
   if (error != 0)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Can't init status (after loop)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status (after loop)\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   ElementStatusValid = 1;
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP GenericElementStatus\n");
+  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP GenericElementStatus\n"));
   return(0);
 }
 
@@ -3721,7 +3710,7 @@ DLT448ElementStatus(
 
   (void)InitStatus;    /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START DLT448ElementStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START DLT448ElementStatus\n"));
 
   if (pEAAPage == NULL)
     {
@@ -3737,9 +3726,9 @@ DLT448ElementStatus(
          if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
            {
              LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 12, "DLT448ElementStatus :", 0, debug_file);
+             DecodeModeSense(pModePage, 12, _("DLT448ElementStatus :"), 0, debug_file);
            } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"DLT448ElementStatus : failed SCSI_ModeSense\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("DLT448ElementStatus : failed SCSI_ModeSense\n"));
              LibModeSenseValid = -1;
            }
         }
@@ -3757,7 +3746,7 @@ DLT448ElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on MTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on MTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3774,7 +3763,7 @@ DLT448ElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on IEE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IEE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3796,7 +3785,7 @@ DLT448ElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on IES\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IES\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3814,7 +3803,7 @@ DLT448ElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on DTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on DTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3831,7 +3820,7 @@ DLT448ElementStatus(
          if (GenericResetStatus(DeviceFD) != 0)
            {
              ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Can't init status\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status\n"));
              return(-1);
              /*NOTREACHED*/
            }
@@ -3847,7 +3836,7 @@ DLT448ElementStatus(
           */
          if (pDTE[0].status == 'E')
            {
-             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "DLT448ElementStatus : try to move tape to tape drive\n");
+             DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("DLT448ElementStatus : try to move tape to tape drive\n"));
              pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address);
            }
        }
@@ -3856,13 +3845,13 @@ DLT448ElementStatus(
 
   if (error != 0)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Can't init status (after loop)\n");
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status (after loop)\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   ElementStatusValid = 1;
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP DLT448ElementStatus\n");
+  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP DLT448ElementStatus\n"));
   return(0);
 }
 
@@ -3883,7 +3872,7 @@ SDXElementStatus(
 
   (void)InitStatus;    /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START SDXElementStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START SDXElementStatus\n"));
 
   if (pEAAPage == NULL)
     {
@@ -3899,9 +3888,9 @@ SDXElementStatus(
          if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0)
            {
              LibModeSenseValid = 1;
-             DecodeModeSense(pModePage, 0, "SDXElementStatus :", 0, debug_file);
+             DecodeModeSense(pModePage, 0, _("SDXElementStatus :"), 0, debug_file);
            } else {
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"SDXElementStatus : failed SCSI_ModeSense\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("SDXElementStatus : failed SCSI_ModeSense\n"));
              LibModeSenseValid = -1;
            }
         }
@@ -3920,7 +3909,7 @@ SDXElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on MTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on MTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3937,7 +3926,7 @@ SDXElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on IEE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IEE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3955,7 +3944,7 @@ SDXElementStatus(
                  error = 1;
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on IES\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IES\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3974,7 +3963,7 @@ SDXElementStatus(
                  */
                  break;
                case SENSE_ABORT:
-                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on DTE\n");
+                 DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on DTE\n"));
                  return(-1);
                  /*NOTREACHED*/
                }
@@ -3991,7 +3980,7 @@ SDXElementStatus(
          if (GenericResetStatus(DeviceFD) != 0)
            {
              ElementStatusValid = 0;
-             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Can't init status\n");
+             DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n"));
              return(-1);
              /*NOTREACHED*/
            }
@@ -4002,14 +3991,14 @@ SDXElementStatus(
 
   if (error != 0)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Can't init status\n");
+      DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n"));
       return(-1);
       /*NOTREACHED*/
     }
 
   ElementStatusValid = 1;
   TapeStatus();
-  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP SDXElementStatus\n");
+  DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP SDXElementStatus\n"));
   return(0);
 }
 
@@ -4045,7 +4034,7 @@ GetElementStatus(
   size_t length;       /* Length of an Element */
   size_t NoOfElements;
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### START GetElementStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### START GetElementStatus\n"));
 
   barcode = BarCode(DeviceFD);
 
@@ -4054,7 +4043,7 @@ GetElementStatus(
    */
   if (pEAAPage != NULL)
     {
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Reading Element Status with the info from mode sense\n");
+      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status with the info from mode sense\n"));
       /* First the Medim Transport*/
       if (V2(pEAAPage->NoMediumTransportElements)  > 0)
         {
@@ -4071,7 +4060,7 @@ GetElementStatus(
                                     SIZEOF(MediumTransportElementDescriptor_T),
                                      &DataBuffer) != 0)
             {
-              ChgExit("genericElementStatus","Can't read MTE status", FATAL);
+              ChgExit("genericElementStatus",_("Can't read MTE status"), FATAL);
              /*NOTREACHED*/
             }
           // ElementStatusData = (ElementStatusData_T *)DataBuffer;
@@ -4081,7 +4070,7 @@ GetElementStatus(
           offset = offset + SIZEOF(ElementStatusPage_T);
          length = V2(ElementStatusPage->length);
 
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"MTE Length %d(%d)\n", length,
+          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("MTE Length %d(%d)\n"), length,
                        SIZEOF(MediumTransportElementDescriptor_T));
 
           for (x = 0; x < MTE; x++)
@@ -4111,14 +4100,14 @@ GetElementStatus(
                {
                  pMTE[x].ASC = MediumTransportElementDescriptor->asc;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC MTE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n"));
                }
 
              if (length >= 6)
                {
                  pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ MTE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n"));
                }
 
              if (length >= 0xa)
@@ -4130,7 +4119,7 @@ GetElementStatus(
                      pMTE[x].from = -1;
                    }
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source MTE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n"));
                }
              offset = offset + length;
             }
@@ -4156,7 +4145,7 @@ GetElementStatus(
                                     SIZEOF(StorageElementDescriptor_T),
                                      &DataBuffer) != 0)
             {
-              ChgExit("GetElementStatus", "Can't read STE status", FATAL);
+              ChgExit("GetElementStatus", _("Can't read STE status"), FATAL);
              /*NOTREACHED*/
             }
          assert(DataBuffer != NULL);
@@ -4167,7 +4156,7 @@ GetElementStatus(
           ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
           offset = offset + SIZEOF(ElementStatusPage_T);
          length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"STE Length %d\n",length);
+          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("STE Length %d\n"),length);
 
           for (x = 0; x < STE; x++)
             {
@@ -4196,14 +4185,14 @@ GetElementStatus(
                {
                  pSTE[x].ASC = StorageElementDescriptor->asc;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC STE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n"));
                }
 
              if (length >= 6)
                {
                  pSTE[x].ASCQ = StorageElementDescriptor->ascq;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ STE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n"));
                }
 
              if (length >= 0xa)
@@ -4215,7 +4204,7 @@ GetElementStatus(
                      pSTE[x].from = -1;
                    }
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
                }
 
               offset = offset + length;
@@ -4242,7 +4231,7 @@ GetElementStatus(
                                     SIZEOF(ImportExportElementDescriptor_T),
                                      &DataBuffer) != 0)
             {
-              ChgExit("GetElementStatus", "Can't read IEE status", FATAL);
+              ChgExit("GetElementStatus", _("Can't read IEE status"), FATAL);
              /*NOTREACHED*/
             }
          assert(DataBuffer != NULL);
@@ -4253,7 +4242,7 @@ GetElementStatus(
           ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
           offset = offset + SIZEOF(ElementStatusPage_T);
          length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"IEE Length %d\n",length);
+          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("IEE Length %d\n"),length);
 
           for (x = 0; x < IEE; x++)
             {
@@ -4280,14 +4269,14 @@ GetElementStatus(
                {
                  pIEE[x].ASC = ImportExportElementDescriptor->asc;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC IEE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n"));
                }
 
              if (length >= 6)
                {
                  pIEE[x].ASCQ = ImportExportElementDescriptor->ascq;
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ IEE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n"));
                }
 
              if (length >= 0xa)
@@ -4299,7 +4288,7 @@ GetElementStatus(
                      pIEE[x].from = -1;
                    }
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source IEE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n"));
                }
 
               offset = offset + length;
@@ -4326,7 +4315,7 @@ GetElementStatus(
                                     SIZEOF(DataTransferElementDescriptor_T),
                                      &DataBuffer) != 0)
             {
-              ChgExit("GenericElementStatus", "Can't read DTE status", FATAL);
+              ChgExit("GenericElementStatus", _("Can't read DTE status"), FATAL);
              /*NOTREACHED*/
             }
          assert(DataBuffer != NULL);
@@ -4337,7 +4326,7 @@ GetElementStatus(
           ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset];
           offset = offset + SIZEOF(ElementStatusPage_T);
          length = V2(ElementStatusPage->length);
-          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"DTE Length %d\n",length);
+          DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("DTE Length %d\n"),length);
 
           for (x = 0; x < DTE; x++)
             {
@@ -4365,14 +4354,14 @@ GetElementStatus(
              {
                pDTE[x].ASC = DataTransferElementDescriptor->asc;
              } else {
-               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC DTE\n");
+               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n"));
              }
 
              if (length >= 6)
                {
                  pDTE[x].ASCQ = DataTransferElementDescriptor->ascq;
              } else {
-               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ DTE\n");
+               DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n"));
              }
 
              if (length >= 0xa)
@@ -4384,7 +4373,7 @@ GetElementStatus(
                      pDTE[x].from = -1;
                    }
                } else {
-                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
                }
 
               offset = offset + length;
@@ -4396,7 +4385,7 @@ GetElementStatus(
       /*
        * And now the old way, when we get here the read mode sense page has failed ...
        */
-      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Reading Element Status the old way .... (max 255 elements)\n");
+      DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status the old way .... (max 255 elements)\n"));
       if (SCSI_ReadElementStatus(DeviceFD,
                                  0,
                                  0,
@@ -4406,7 +4395,7 @@ GetElementStatus(
                                 (size_t)0x7f,
                                  &DataBuffer) != 0)
         {
-          ChgExit("GenericElementStatus","Can't get ElementStatus", FATAL);
+          ChgExit("GenericElementStatus",_("Can't get ElementStatus"), FATAL);
          /*NOTREACHED*/
         }
       assert(DataBuffer != NULL);
@@ -4456,14 +4445,14 @@ GetElementStatus(
                    {
                      pMTE[x].ASC = MediumTransportElementDescriptor->asc;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC MTE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n"));
                    }
 
                  if (length >= 6)
                    {
                      pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ MTE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n"));
                    }
 
                  if (length >= 0xa)
@@ -4475,7 +4464,7 @@ GetElementStatus(
                          pMTE[x].from = -1;
                        }
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source MTE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n"));
                    }
 
                  offset = offset + length;
@@ -4513,14 +4502,14 @@ GetElementStatus(
                    {
                      pSTE[x].ASC = StorageElementDescriptor->asc;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC STE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n"));
                    }
 
                  if (length >= 6)
                    {
                      pSTE[x].ASCQ = StorageElementDescriptor->ascq;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ STE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n"));
                    }
 
                  if (length >= 0xa)
@@ -4532,7 +4521,7 @@ GetElementStatus(
                          pSTE[x].from = -1;
                        }
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
                    }
 
                   offset = offset + length;
@@ -4570,14 +4559,14 @@ GetElementStatus(
                    {
                      pIEE[x].ASC = ImportExportElementDescriptor->asc;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC IEE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n"));
                    }
 
                  if (length >= 6)
                    {
                      pIEE[x].ASCQ = ImportExportElementDescriptor->ascq;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ IEE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n"));
                    }
 
                  if (length >= 0xa)
@@ -4589,7 +4578,7 @@ GetElementStatus(
                          pIEE[x].from = -1;
                        }
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source IEE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n"));
                    }
 
                  offset = offset + length;
@@ -4627,14 +4616,14 @@ GetElementStatus(
                    {
                      pDTE[x].ASC = DataTransferElementDescriptor->asc;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC DTE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n"));
                    }
 
                  if (length >= 6)
                    {
                      pDTE[x].ASCQ = DataTransferElementDescriptor->ascq;
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ DTE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n"));
                    }
 
                  if (length >= 0xa)
@@ -4646,7 +4635,7 @@ GetElementStatus(
                          pDTE[x].from = -1;
                        }
                    } else {
-                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n");
+                     DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n"));
                    }
 
                  offset = offset + length;
@@ -4654,38 +4643,38 @@ GetElementStatus(
               break;
             default:
               offset = offset + length;
-              DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"GetElementStatus : UnGknown Type %d\n",ElementStatusPage->type);
+              DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : UnGknown Type %d\n"),ElementStatusPage->type);
               break;
             }
         }
        free(DataBuffer);
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tMedia Transport Elements (robot arms) :\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tMedia Transport Elements (robot arms) :\n"));
 
   for ( x = 0; x < MTE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02x\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n",
+    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02x\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
               pMTE[x].address, pMTE[x].status, pMTE[x].except, pMTE[x].ASC,
               pMTE[x].ASCQ, pMTE[x].type, pMTE[x].from, pMTE[x].VolTag);
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tStorage Elements (Media slots) :\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tStorage Elements (Media slots) :\n"));
 
   for ( x = 0; x < STE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n",
+    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
               pSTE[x].address, pSTE[x].status, pSTE[x].except, pSTE[x].ASC,
               pSTE[x].ASCQ, pSTE[x].type, pSTE[x].from, pSTE[x].VolTag);
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tData Transfer Elements (tape drives) :\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tData Transfer Elements (tape drives) :\n"));
 
   for ( x = 0; x < DTE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n\t\t\tSCSI ADDRESS = %d\n",
+    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n\t\t\tSCSI ADDRESS = %d\n"),
               pDTE[x].address, pDTE[x].status, pDTE[x].except, pDTE[x].ASC,
               pDTE[x].ASCQ, pDTE[x].type, pDTE[x].from, pDTE[x].VolTag,pDTE[x].scsi);
 
-  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tImport/Export Elements  :\n");
+  DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tImport/Export Elements  :\n"));
 
   for ( x = 0; x < IEE; x++)
-    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n",
+    DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"),
               pIEE[x].address, pIEE[x].status, pIEE[x].except, pIEE[x].ASC,
               pIEE[x].ASCQ, pIEE[x].type, pIEE[x].from, pIEE[x].VolTag);
 
@@ -4710,7 +4699,7 @@ RequestSense(
   CDB_T CDB;
   int ret;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START RequestSense\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START RequestSense\n"));
 
   CDB[0] = SC_COM_REQUEST_SENSE;               /* REQUEST SENSE */
   CDB[1] = 0;                                  /* Logical Unit Number = 0, Reserved */
@@ -4730,7 +4719,7 @@ RequestSense(
 
   if (ret < 0)
     {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (%d)\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"),ret);
       return(ret);
       /*NOTREACHED*/
     }
@@ -4738,7 +4727,7 @@ RequestSense(
   if ( ret > 0)
     {
       DecodeExtSense(ExtendedRequestSense, "RequestSense : ",debug_file);
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (%d)\n", ExtendedRequestSense->SenseKey);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"), ExtendedRequestSense->SenseKey);
       return(ExtendedRequestSense->SenseKey);
       /*NOTREACHED*/
     }
@@ -4746,7 +4735,7 @@ RequestSense(
   dump_hex((u_char *)ExtendedRequestSense ,
           SIZEOF(ExtendedRequestSense_T),
           DEBUG_INFO, SECTION_SCSI);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (0)\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (0)\n"));
   return(0);
 }
 
@@ -4762,7 +4751,7 @@ LookupElement(
 {
   size_t x;
 
-  dbprintf(("##### START LookupElement\n"));
+  dbprintf(_("##### START LookupElement\n"));
 
   if (DTE > 0)
     {
@@ -4770,7 +4759,7 @@ LookupElement(
         {
           if (pDTE[x].address == address)
          {
-            dbprintf(("##### STOP LookupElement (DTE)\n"));
+            dbprintf(_("##### STOP LookupElement (DTE)\n"));
             return(&pDTE[x]);
            /*NOTREACHED*/
          }
@@ -4783,7 +4772,7 @@ LookupElement(
         {
           if (pMTE[x].address == address)
          {
-            dbprintf(("##### STOP LookupElement (MTE)\n"));
+            dbprintf(_("##### STOP LookupElement (MTE)\n"));
             return(&pMTE[x]);
            /*NOTREACHED*/
          }
@@ -4796,7 +4785,7 @@ LookupElement(
         {
           if (pSTE[x].address == address)
          {
-            dbprintf(("##### STOP LookupElement (STE)\n"));
+            dbprintf(_("##### STOP LookupElement (STE)\n"));
             return(&pSTE[x]);
            /*NOTREACHED*/
          }
@@ -4809,7 +4798,7 @@ LookupElement(
         {
           if (pIEE[x].address == address)
          {
-            dbprintf(("##### STOP LookupElement (IEE)\n"));
+            dbprintf(_("##### STOP LookupElement (IEE)\n"));
             return(&pIEE[x]);
            /*NOTREACHED*/
          }
@@ -4849,7 +4838,7 @@ LogSense(
 
   (void)DeviceFD;      /* Quiet unused parameter warning */
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START LogSense\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START LogSense\n"));
 
   if ((tapestatfile != NULL) && (pDev[INDEX_TAPECTL].SCSI == 1) &&
       ((StatFile = fopen(tapestatfile,"a")) != NULL))
@@ -4858,7 +4847,7 @@ LogSense(
 
       if (GenericRewind(INDEX_TAPECTL) < 0)
         {
-          DebugPrint(DEBUG_INFO, SECTION_TAPE,"LogSense : Rewind failed\n");
+          DebugPrint(DEBUG_INFO, SECTION_TAPE,_("LogSense : Rewind failed\n"));
           free(pRequestSense);
          fclose(StatFile);
           return(0);
@@ -4876,9 +4865,9 @@ LogSense(
 
          if ((chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label)) == NULL)
            {
-             fprintf(StatFile, "==== %s ==== %s ====\n", chgscsi_datestamp, chgscsi_label);
+             g_fprintf(StatFile, _("==== %s ==== %s ====\n"), chgscsi_datestamp, chgscsi_label);
            } else {
-             fprintf(StatFile, "%s\n", chgscsi_result);
+             g_fprintf(StatFile, "%s\n", chgscsi_result);
            }
        }
 
@@ -4960,14 +4949,14 @@ LogSense(
             if ((strcmp(pDev[INDEX_TAPECTL].ident, p->ident) == 0 ||strcmp("*", p->ident) == 0)  && p->LogPage == logpages[count]) {
               p->decode(LogParameter, length);
               found = 1;
-              fprintf(StatFile, "\n");
+              g_fprintf(StatFile, "\n");
               break;
             }
             p++;
           }
 
           if (!found) {
-            fprintf(StatFile, "Logpage No %d = %x\n", count ,logpages[count]);
+            g_fprintf(StatFile, _("Logpage No %d = %x\n"), count ,logpages[count]);
 
             while ((u_char *)LogParameter < (buffer + length)) {
               i = LogParameter->ParameterLength;
@@ -4975,30 +4964,30 @@ LogSense(
               switch (i) {
               case 1:
                 value = V1((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i);
+                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
                 break;
               case 2:
                 value = V2((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i);
+                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
                 break;
               case 3:
                 value = V3((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i);
+                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
                 break;
               case 4:
                 value = V4((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i);
+                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
                 break;
               case 5:
                 value = V5((u_char *)LogParameter + SIZEOF(LogParameter_T));
-                fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i);
+                g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i);
                 break;
               default:
-                fprintf(StatFile, "ParameterCode %02X size %d\n", ParameterCode, i);
+                g_fprintf(StatFile, _("ParameterCode %02X size %d\n"), ParameterCode, i);
               }
               LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
             }
-            fprintf(StatFile, "\n");
+            g_fprintf(StatFile, "\n");
           }
         }
       }
@@ -5042,7 +5031,7 @@ LogSense(
       /*@end@*/
       fclose(StatFile);
     }
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP LogSense\n");
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP LogSense\n"));
   return(0);
 }
 
@@ -5057,7 +5046,7 @@ WriteErrorCountersPage(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tWrite Error Counters Page\n");
+  g_fprintf(StatFile, _("\tWrite Error Counters Page\n"));
 
   while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5067,38 +5056,38 @@ WriteErrorCountersPage(
     if (Decode(LogParameter, &value) == 0) {
       switch (ParameterCode) {
       case 2:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Rewrites",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Rewrites"),
                 value);
         break;
       case 3:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Errors Corrected",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Errors Corrected"),
                 value);
         break;
       case 4:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Times E. Processed",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Times E. Processed"),
                 value);
         break;
       case 5:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Bytes Processed",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Bytes Processed"),
                 value);
         break;
       case 6:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Unrecoverable Errors",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Unrecoverable Errors"),
                 value);
         break;
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
       }
     } else {
-      fprintf(StatFile, "Error decoding Result\n");
+      g_fprintf(StatFile, _("Error decoding Result\n"));
     }
     LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
   }
@@ -5115,7 +5104,7 @@ ReadErrorCountersPage(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tRead Error Counters Page\n");
+  g_fprintf(StatFile, _("\tRead Error Counters Page\n"));
 
   while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5125,38 +5114,38 @@ ReadErrorCountersPage(
     if (Decode(LogParameter, &value) == 0) {
       switch (ParameterCode) {
       case 2:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Rereads",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Rereads"),
                 value);
         break;
       case 3:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Errors Corrected",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Errors Corrected"),
                 value);
         break;
       case 4:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Times E. Processed",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Times E. Processed"),
                 value);
         break;
       case 5:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Bytes Processed",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Bytes Processed"),
                 value);
         break;
       case 6:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Unrecoverable Errors",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Unrecoverable Errors"),
                 value);
         break;
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
       }
     } else {
-      fprintf(StatFile, "Error decoding Result\n");
+      g_fprintf(StatFile, _("Error decoding Result\n"));
     }
     LogParameter = (LogParameter_T *)((u_char *)LogParameter +  SIZEOF(LogParameter_T) + i);
   }
@@ -5173,7 +5162,7 @@ C1553APage30(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tData compression transfer Page\n");
+  g_fprintf(StatFile, _("\tData compression transfer Page\n"));
 
   while ((u_char *)LogParameter < ((u_char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5183,7 +5172,7 @@ C1553APage30(
     if (Decode(LogParameter, &value) == 0) {
       switch (ParameterCode) {
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
@@ -5204,7 +5193,7 @@ C1553APage37(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tDrive Counters Page\n");
+  g_fprintf(StatFile, _("\tDrive Counters Page\n"));
 
   while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5214,22 +5203,22 @@ C1553APage37(
     if (Decode(LogParameter, &value) == 0) {
       switch (ParameterCode) {
       case 1:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total loads",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total loads"),
                 value);
         break;
       case 2:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total write drive errors",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total write drive errors"),
                 value);
         break;
       case 3:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total read drive errors",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total read drive errors"),
                 value);
         break;
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
@@ -5250,7 +5239,7 @@ EXB85058HEPage39(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tData Compression Page\n");
+  g_fprintf(StatFile, _("\tData Compression Page\n"));
 
   while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5260,17 +5249,17 @@ EXB85058HEPage39(
     if (Decode(LogParameter, &value) == 0) {
       switch (ParameterCode) {
       case 5:
-        fprintf(StatFile, "%-30s = %u\n",
-                "KB to Compressor",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("KB to Compressor"),
                 value);
         break;
       case 7:
-        fprintf(StatFile, "%-30s = %u\n",
-                "KB to tape",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("KB to tape"),
                 value);
         break;
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
@@ -5291,7 +5280,7 @@ EXB85058HEPage3c(
   unsigned ParameterCode;
   LogParameter = buffer;
 
-  fprintf(StatFile, "\tDrive Usage Information Page\n");
+  g_fprintf(StatFile, _("\tDrive Usage Information Page\n"));
 
   while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) {
     i = LogParameter->ParameterLength;
@@ -5307,21 +5296,21 @@ EXB85058HEPage3c(
       case 5:
         break;
       case 6:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Total Load Count",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Total Load Count"),
                 value);
         break;
       case 7:
-        fprintf(StatFile, "%-30s = %u\n",
-                "MinutesSince Last Clean",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("MinutesSince Last Clean"),
                 value);
         break;
       case 8:
       case 9:
         break;
       case 0xa:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Cleaning Count",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Cleaning Count"),
                 value);
         break;
       case 0xb:
@@ -5332,8 +5321,8 @@ EXB85058HEPage3c(
       case 0x10:
         break;
       case 0x11:
-        fprintf(StatFile, "%-30s = %u\n",
-                "Time to clean",
+        g_fprintf(StatFile, _("%-30s = %u\n"),
+                _("Time to clean"),
                 value);
         break;
       case 0x12:
@@ -5341,7 +5330,7 @@ EXB85058HEPage3c(
       case 0x14:
         break;
       default:
-        fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n",
+        g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"),
                 ParameterCode,
                 value, i);
         break;
@@ -5357,8 +5346,8 @@ Decode(
     unsigned *         value)
 {
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START Decode\n");
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"Decode Parameter with length %d\n", LogParameter->ParameterLength);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START Decode\n"));
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Decode Parameter with length %d\n"), LogParameter->ParameterLength);
 
   *value = 0;
   switch (LogParameter->ParameterLength) {
@@ -5381,14 +5370,14 @@ Decode(
     *value = V6((u_char *)LogParameter + SIZEOF(LogParameter_T));
     break;
   default:
-    fprintf(StatFile, "Can't decode ParameterCode %02X size %d\n",
+    g_fprintf(StatFile, _("Can't decode ParameterCode %02X size %d\n"),
             V2(LogParameter->ParameterCode), LogParameter->ParameterLength);
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP Decode (1)\n");
+    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode (1)\n"));
     return(1);
     /*NOTREACHED*/
   }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"Result = %d\n", *value);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP Decode(0)\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Result = %d\n"), *value);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode(0)\n"));
   return(0);
 }
 
@@ -5399,14 +5388,14 @@ DumpDev(
 {
        if (p != NULL)
        {
-               printf("%s Devicefd   %d\n", device, p->fd);
-               printf("%s Can SCSI   %d\n", device, p->SCSI);
-               printf("%s Device     %s\n", device, (p->dev != NULL)? p->dev:"No set");
-               printf("%s ConfigName %s\n", device, (p->ConfigName != NULL) ? p->ConfigName:"Not ser");
+               g_printf(_("%s Devicefd   %d\n"), device, p->fd);
+               g_printf(_("%s Can SCSI   %d\n"), device, p->SCSI);
+               g_printf(_("%s Device     %s\n"), device, (p->dev != NULL)? p->dev:_("No set"));
+               g_printf(_("%s ConfigName %s\n"), device, (p->ConfigName != NULL) ? p->ConfigName:_("Not ser"));
        } else {
-               printf("%s Null Pointer ....\n", device);
+               g_printf(_("%s Null Pointer ....\n"), device);
        }
-       printf("\n");
+       g_printf(_("\n"));
 }
 
 void
@@ -5468,7 +5457,7 @@ ChangerStatus(
 
   if ((out = fdopen(1 , "w")) == NULL)
     {
-      printf("Error fdopen stdout\n");
+      g_printf(_("Error fdopen stdout\n"));
       free(pbarcoderes);
       return;
       /*NOTREACHED*/
@@ -5478,7 +5467,7 @@ ChangerStatus(
   {
     while(p->ident != NULL)
       {
-         printf ("Ident = %s, type = %s\n",p->ident, p->type);
+         g_printf (_("Ident = %s, type = %s\n"),p->ident, p->type);
          p++;
       }
     DumpSense();
@@ -5490,7 +5479,7 @@ ChangerStatus(
           {
             if (pDev[INDEX_CHANGER].functions->function_status(pDev[INDEX_CHANGER].fd, 1) != 0)
               {
-                printf("Can not initialize changer status\n");
+                g_printf(_("Can not initialize changer status\n"));
                free(pbarcoderes);
                fclose(out);
                 return;
@@ -5500,18 +5489,18 @@ ChangerStatus(
         /*      0123456789012345678901234567890123456789012 */
        if (HasBarCode)
        {
-               printf("Address Type Status From Barcode Label\n");
+               g_printf(_("Address Type Status From Barcode Label\n"));
        } else {
-               printf("Address Type Status From\n");
+               g_printf(_("Address Type Status From\n"));
        }
-        printf("-------------------------------------------\n");
+        g_printf(_("-------------------------------------------\n"));
 
 
         for ( x = 0; x < MTE; x++)
        if (HasBarCode)
        {
-          printf("%07d MTE  %s  %04d %s ",pMTE[x].address,
-                 (pMTE[x].full ? "Full " :"Empty"),
+          g_printf(_("%07d MTE  %s  %04d %s "),pMTE[x].address,
+                 (pMTE[x].full ? _("Full ") :_("Empty")),
                  pMTE[x].from, pMTE[x].VolTag);
 
          if (pMTE[x].full == 1)
@@ -5522,16 +5511,16 @@ ChangerStatus(
 
              if (MapBarCode(labelfile, pbarcoderes) == 0 )
                {
-                 printf("No mapping\n");
+                 g_printf(_("No mapping\n"));
                } else {
-                 printf("%s \n",pbarcoderes->data.voltag);
+                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
                }
            } else {
-             printf("\n");
+             g_printf("\n");
            }
        } else {
-          printf("%07d MTE  %s  %04d \n",pMTE[x].address,
-                 (pMTE[x].full ? "Full " :"Empty"),
+          g_printf(_("%07d MTE  %s  %04d \n"),pMTE[x].address,
+                 (pMTE[x].full ? _("Full ") :_("Empty")),
                  pMTE[x].from);
        }
 
@@ -5539,8 +5528,8 @@ ChangerStatus(
         for ( x = 0; x < STE; x++)
        if (HasBarCode)
        {
-          printf("%07d STE  %s  %04d %s ",pSTE[x].address,
-                 (pSTE[x].full ? "Full ":"Empty"),
+          g_printf(_("%07d STE  %s  %04d %s "),pSTE[x].address,
+                 (pSTE[x].full ? _("Full "):_("Empty")),
                  pSTE[x].from, pSTE[x].VolTag);
 
          if (pSTE[x].full == 1)
@@ -5551,16 +5540,16 @@ ChangerStatus(
 
              if (MapBarCode(labelfile, pbarcoderes) == 0 )
                {
-                 printf("No mapping\n");
+                 g_printf(_("No mapping\n"));
                } else {
-                 printf("%s \n",pbarcoderes->data.voltag);
+                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
                }
            } else {
-             printf("\n");
+             g_printf("\n");
            }
        } else {
-          printf("%07d STE  %s  %04d %s\n",pSTE[x].address,
-                 (pSTE[x].full ? "Full ":"Empty"),
+          g_printf(_("%07d STE  %s  %04d %s\n"),pSTE[x].address,
+                 (pSTE[x].full ? _("Full"):_("Empty")),
                  pSTE[x].from, pSTE[x].VolTag);
        }
 
@@ -5568,8 +5557,8 @@ ChangerStatus(
         for ( x = 0; x < DTE; x++)
        if (HasBarCode)
        {
-          printf("%07d DTE  %s  %04d %s ",pDTE[x].address,
-                 (pDTE[x].full ? "Full " : "Empty"),
+          g_printf(_("%07d DTE  %s  %04d %s "),pDTE[x].address,
+                 (pDTE[x].full ? _("Full") : _("Empty")),
                  pDTE[x].from, pDTE[x].VolTag);
 
          if (pDTE[x].full == 1)
@@ -5580,25 +5569,25 @@ ChangerStatus(
 
              if (MapBarCode(labelfile, pbarcoderes) == 0 )
                {
-                 printf("No mapping\n");
+                 g_printf(_("No mapping\n"));
                } else {
-                 printf("%s \n",pbarcoderes->data.voltag);
+                 g_printf("%s \n",pbarcoderes->data.voltag);
                }
            } else {
-             printf("\n");
+             g_printf("\n");
            }
 
        } else {
-          printf("%07d DTE  %s  %04d %s\n",pDTE[x].address,
-                 (pDTE[x].full ? "Full " : "Empty"),
+          g_printf(_("%07d DTE  %s  %04d %s\n"),pDTE[x].address,
+                 (pDTE[x].full ?_( "Full ") : _("Empty")),
                  pDTE[x].from, pDTE[x].VolTag);
        }
 
         for ( x = 0; x < IEE; x++)
        if (HasBarCode)
        {
-          printf("%07d IEE  %s  %04d %s ",pIEE[x].address,
-                 (pIEE[x].full ? "Full " : "Empty"),
+          g_printf(_("%07d IEE  %s  %04d %s "),pIEE[x].address,
+                 (pIEE[x].full ? _("Full ") : _("Empty")),
                  pIEE[x].from, pIEE[x].VolTag);
 
          if (pIEE[x].full == 1)
@@ -5609,17 +5598,17 @@ ChangerStatus(
 
              if (MapBarCode(labelfile, pbarcoderes) == 0 )
                {
-                 printf("No mapping\n");
+                 g_printf(_("No mapping\n"));
                } else {
-                 printf("%s \n",pbarcoderes->data.voltag);
+                 g_printf(_("%s \n"),pbarcoderes->data.voltag);
                }
            } else {
-             printf("\n");
+             g_printf("\n");
            }
 
        } else {
-          printf("%07d IEE  %s  %04d %s\n",pIEE[x].address,
-                 (pIEE[x].full ? "Full " : "Empty"),
+          g_printf(_("%07d IEE  %s  %04d %s\n"),pIEE[x].address,
+                 (pIEE[x].full ? _("Full ") : _("Empty")),
                  pIEE[x].from, pIEE[x].VolTag);
        }
 
@@ -5629,23 +5618,23 @@ ChangerStatus(
     {
       if (pDev[INDEX_CHANGER].SCSI == 1)
        {
-           printf("\nSense Status from robot:\n");
+           g_printf(_("\nSense Status from robot:\n"));
            RequestSense(INDEX_CHANGER , &ExtRequestSense, 0);
            DecodeExtSense(&ExtRequestSense, "", out);
        }
 
       if (pDev[INDEX_TAPE].SCSI == 1)
         {
-          printf("\n");
-          printf("Sense Status from tape (tapectl):\n");
+          g_printf("\n");
+          g_printf(_("Sense Status from tape (tapectl):\n"));
           RequestSense(INDEX_TAPE, &ExtRequestSense, 0);
           DecodeExtSense(&ExtRequestSense, "", out);
         }
 
       if (pDev[INDEX_TAPECTL].SCSI == 1)
         {
-          printf("\n");
-          printf("Sense Status from tape (tapectl):\n");
+          g_printf("\n");
+          g_printf(_("Sense Status from tape (tapectl):\n"));
           RequestSense(INDEX_TAPECTL, &ExtRequestSense, 0);
           DecodeExtSense(&ExtRequestSense, "", out);
         }
@@ -5653,7 +5642,7 @@ ChangerStatus(
 
     if (strcmp("ModeSenseRobot", option) == 0 || strcmp("all", option) == 0)
       {
-        printf("\n");
+        g_printf("\n");
         if (SCSI_ModeSense(INDEX_CHANGER, pModePage, 0xff, 0x08, 0x3f) == 0)
           {
             DecodeModeSense(pModePage, 0, "Changer :" , 0, out);
@@ -5664,7 +5653,7 @@ ChangerStatus(
       {
         if (pDev[INDEX_TAPECTL].SCSI == 1)
         {
-          printf("\n");
+          g_printf("\n");
           if (SCSI_ModeSense(INDEX_TAPECTL, pModePage, 0xff, 0x0, 0x3f) == 0)
             {
               DecodeModeSense(pModePage, 0, "Tape :" , 1, out);
@@ -5674,16 +5663,16 @@ ChangerStatus(
 
     if (strcmp("fd", option) == 0 || strcmp("all", option) == 0)
     {
-      printf("changer_dev  %s\n",changer_dev);
-      printf("changer_file %s\n", changer_file);
-      printf("tape_device  %s\n\n", tape_device);
+      g_printf("changer_dev  %s\n",changer_dev);
+      g_printf("changer_file %s\n", changer_file);
+      g_printf("tape_device  %s\n\n", tape_device);
       DumpDev(&pDev[INDEX_TAPE], "pTapeDev");
       DumpDev(&pDev[INDEX_TAPECTL], "pTapeDevCtl");
       DumpDev(&pDev[INDEX_CHANGER], "pChangerDev");
     }
 
   if (GenericClean("") == 1)
-    printf("Tape needs cleaning\n");
+    g_printf(_("Tape needs cleaning\n"));
 
   free(pbarcoderes);
   fclose(out);
@@ -5704,7 +5693,7 @@ dump_hex(
         DebugPrint(level, section,"%02X ", (u_char)p[row_count]);
         if (((row_count + 1) % 16) == 0)
           {
-            dbprintf(("   "));
+            dbprintf("   ");
             for (x = 16; x > 0; x--)
               {
                if (isalnum((u_char)p[row_count - x + 1 ]))
@@ -5738,8 +5727,8 @@ ChgExit(
 {
     (void)level;       /* Quiet unused parameter warning */
 
-   dbprintf(("ChgExit in %s, reason %s\n", where, reason));
-   fprintf(stderr,"%s\n",reason);
+   dbprintf(_("ChgExit in %s, reason %s\n"), where, reason);
+   g_fprintf(stderr,"%s\n",reason);
    exit(2);
 }
 
@@ -5776,11 +5765,11 @@ SCSI_Run(
 
   pRqS = (RequestSense_T *)pRequestSense;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Run TestUnitReady\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady\n"));
   while (!ok && maxtries < MAXTRIES)
     {
       ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense );
-      DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Run TestUnitReady ret %d\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady ret %d\n"),ret);
       switch (ret)
        {
        case SCSI_OK:
@@ -5790,42 +5779,42 @@ SCSI_Run(
          switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS))
            {
            case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_NO\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_NO\n"));
              ok=1;
              break;
            case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"));
              ok=1;
              break;
            case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_IGNORE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_IGNORE\n"));
              ok=1;
              break;
            case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_ABORT\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_ABORT\n"));
              return(-1);
              /*NOTREACHED*/
            case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_RETRY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_RETRY\n"));
              break;
            default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) default (SENSE)\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) default (SENSE)\n"));
              ok=1;
              break;
            }
          break;
        case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_ERROR\n");
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_ERROR\n"));
          return(-1);
          /*NOTREACHED*/
        case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_BUSY\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_BUSY\n"));
          break;
        case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_CHECK\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n"));
          break;
        default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) unknown (%d)\n",ret);
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret);
          break;
        }
       if (!ok)
@@ -5835,11 +5824,11 @@ SCSI_Run(
       }
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run TestUnitReady after %d sec:\n",maxtries);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run TestUnitReady after %d sec:\n"),maxtries);
 
   if (ok != 1)
     {
-      DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run Exit %d\n",ret);
+      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret);
       return(-1);
       /*NOTREACHED*/
     }
@@ -5857,7 +5846,7 @@ SCSI_Run(
                                pRequestSense,
                                RequestSenseLength);
 
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run Exit %d\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret);
       switch (ret)
        {
        case SCSI_OK:
@@ -5867,42 +5856,42 @@ SCSI_Run(
          switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS))
            {
            case SENSE_NO:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_NO\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_NO\n"));
              ok=1;
              break;
            case SENSE_TAPE_NOT_ONLINE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_TAPE_NOT_ONLINE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_TAPE_NOT_ONLINE\n"));
              ok=1;
              break;
            case SENSE_IGNORE:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_IGNORE\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_IGNORE\n"));
              ok=1;
              break;
            case SENSE_ABORT:
-             DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run SENSE_ABORT\n");
+             DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SENSE_ABORT\n"));
              return(-1);
              /*NOTREACHED*/
            case SENSE_RETRY:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_RETRY\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_RETRY\n"));
              break;
            default:
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run default (SENSE)\n");
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run default (SENSE)\n"));
              ok=1;
              break;
            }
          break;
        case SCSI_ERROR:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run SCSI_ERROR\n");
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SCSI_ERROR\n"));
          return(-1);
          /*NOTREACHED*/
        case SCSI_BUSY:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SCSI_BUSY\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SCSI_BUSY\n"));
          break;
        case SCSI_CHECK:
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_CHECK\n");
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n"));
          break;
        default:
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) unknown (%d)\n",ret);
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret);
          break;
        }
       maxtries++;
@@ -5934,7 +5923,7 @@ SCSI_AlignElements(
   int ret;
   int i;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_AlignElements\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_AlignElements\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
@@ -5953,12 +5942,12 @@ SCSI_AlignElements(
       ret = SCSI_Run(DeviceFD, Input, CDB, 12,
                                 NULL, 0, pRequestSense, SIZEOF(RequestSense_T));
 
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SCSI_Run = %d\n", ret);
-      DecodeSense(pRequestSense, "SCSI_AlignElements :",debug_file);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SCSI_Run = %d\n"), ret);
+      DecodeSense(pRequestSense, _("SCSI_AlignElements :"),debug_file);
 
       if (ret < 0)
         {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X",
+          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
                     "chs", ((u_char *) &pRequestSense)[0]);
           for (i = 1; i < (int)sizeof(RequestSense_T); i++)
             DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]);
@@ -5971,35 +5960,35 @@ SCSI_AlignElements(
           switch(SenseHandler(DeviceFD, 0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
             {
             case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SENSE_IGNORE\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_IGNORE\n"));
               return(0);
               /*NOTREACHED*/
             case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SENSE_RETRY no %d\n", retry);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_RETRY no %d\n"), retry);
               break;
             case SENSE_ABORT:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements : SENSE_ABORT\n");
+              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : SENSE_ABORT\n"));
               return(-1);
               /*NOTREACHED*/
             case SENSE_TAPE_NOT_UNLOADED:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements : Tape still loaded, eject failed\n");
+              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : Tape still loaded, eject failed\n"));
               return(-1);
               /*NOTREACHED*/
             default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : end %d\n", pRequestSense->SenseKey);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), pRequestSense->SenseKey);
               return(pRequestSense->SenseKey);
               /*NOTREACHED*/
             }
         }
       if (ret == 0)
         {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : end %d\n", ret);
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), ret);
           return(ret);
          /*NOTREACHED*/
         }
     }
-  DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements :"
-            "Retries exceeded = %d\n", retry);
+  DebugPrint(DEBUG_ERROR, SECTION_SCSI,
+           _("SCSI_AlignElements: Retries exceeded = %d\n"), retry);
   return(-1);
 }
 
@@ -6017,7 +6006,7 @@ SCSI_Move(
   int ret = -1;
   int i;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_Move\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_Move\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
@@ -6037,12 +6026,12 @@ SCSI_Move(
       ret = SCSI_Run(DeviceFD, Input, CDB, 12,
                                 NULL, 0, pRequestSense, SIZEOF(RequestSense_T));
 
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Move : SCSI_Run = %d\n", ret);
-      DecodeSense(pRequestSense, "SCSI_Move :",debug_file);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Move : SCSI_Run = %d\n"), ret);
+      DecodeSense(pRequestSense, _("SCSI_Move :"),debug_file);
 
       if (ret < 0)
         {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X",
+          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
                     "chs", ((u_char *) &pRequestSense)[0]);
           for (i = 1; i < (int)sizeof(RequestSense_T); i++)
             DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]);
@@ -6055,28 +6044,28 @@ SCSI_Move(
           switch(SenseHandler(DeviceFD,  0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
             {
             case SENSE_IGNORE:
-              dbprintf(("SCSI_Move : SENSE_IGNORE\n"));
+              dbprintf(_("SCSI_Move : SENSE_IGNORE\n"));
               return(0);
               /*NOTREACHED*/
             case SENSE_RETRY:
-              dbprintf(("SCSI_Move : SENSE_RETRY no %d\n", retry));
+              dbprintf(_("SCSI_Move : SENSE_RETRY no %d\n"), retry);
               break;
             case SENSE_ABORT:
-              dbprintf(("SCSI_Move : SENSE_ABORT\n"));
+              dbprintf(_("SCSI_Move : SENSE_ABORT\n"));
               return(-1);
               /*NOTREACHED*/
             case SENSE_TAPE_NOT_UNLOADED:
-              dbprintf(("SCSI_Move : Tape still loaded, eject failed\n"));
+              dbprintf(_("SCSI_Move : Tape still loaded, eject failed\n"));
               return(-1);
               /*NOTREACHED*/
             default:
-              dbprintf(("SCSI_Move : end %d\n", pRequestSense->SenseKey));
+              dbprintf(_("SCSI_Move : end %d\n"), pRequestSense->SenseKey);
               return(pRequestSense->SenseKey);
               /*NOTREACHED*/
             }
         }
     }
-  dbprintf(("SCSI_Move : end %d\n", ret));
+  dbprintf(_("SCSI_Move : end %d\n"), ret);
   return(ret);
 }
 
@@ -6090,7 +6079,7 @@ SCSI_LoadUnload(
   CDB_T CDB;
   int ret;
 
-  dbprintf(("##### START SCSI_LoadUnload\n"));
+  dbprintf(_("##### START SCSI_LoadUnload\n"));
 
   CDB[0] = SC_COM_UNLOAD;
   CDB[1] = byte1;
@@ -6107,12 +6096,12 @@ SCSI_LoadUnload(
 
   if (ret < 0)
     {
-      dbprintf(("SCSI_Unload : failed %d\n", ret));
+      dbprintf(_("SCSI_Unload : failed %d\n"), ret);
       return(-1);
       /*NOTREACHED*/
     }
 
-  dbprintf(("##### STOP SCSI_LoadUnload\n"));
+  dbprintf(_("##### STOP SCSI_LoadUnload\n"));
   return(ret);
 }
 
@@ -6124,7 +6113,7 @@ SCSI_TestUnitReady(
   CDB_T CDB;
   int ret;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_TestUnitReady\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_TestUnitReady\n"));
 
   CDB[0] = SC_COM_TEST_UNIT_READY;
   CDB[1] = 0;
@@ -6143,7 +6132,7 @@ SCSI_TestUnitReady(
    */
   if (ret > 0)
     {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (1)\n");
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n"));
       return(ret);
       /*NOTREACHED*/
     }
@@ -6154,7 +6143,7 @@ SCSI_TestUnitReady(
    */
   if (pRequestSense->ErrorCode == 0 && pRequestSense->SenseKey == 0)
     {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (1)\n");
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n"));
       return(0);
       /*NOTREACHED*/
     }
@@ -6163,12 +6152,12 @@ SCSI_TestUnitReady(
    * Some sense is set
    */
   if (pRequestSense->ErrorCode != 0){
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady ErrorCode set\n");
+    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady ErrorCode set\n"));
   }
   if (pRequestSense->SenseKey != 0) {
-    DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady Sense Key set\n");
+    DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady Sense Key set\n"));
   }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (0)\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (0)\n"));
   return(SCSI_SENSE);
 }
 
@@ -6188,9 +6177,9 @@ SCSI_ModeSelect(
   int retry;
   u_char *sendbuf;
 
-  dbprintf(("##### START SCSI_ModeSelect\n"));
+  dbprintf(_("##### START SCSI_ModeSelect\n"));
 
-  dbprintf(("SCSI_ModeSelect start length = %u:\n", (unsigned)length));
+  dbprintf(_("SCSI_ModeSelect start length = %u:\n"), (unsigned)length);
   pRequestSense = alloc(SIZEOF(RequestSense_T));
   sendbuf = alloc((size_t)length + 4);
   memset(sendbuf, 0 , (size_t)length + 4);
@@ -6215,7 +6204,7 @@ SCSI_ModeSelect(
                                 SIZEOF(RequestSense_T));
       if (ret < 0)
         {
-          dbprintf(("SCSI_ModeSelect : ret %d\n", ret));
+          dbprintf(_("SCSI_ModeSelect : ret %d\n"), ret);
          goto done;
           /*NOTREACHED*/
         }
@@ -6228,12 +6217,12 @@ SCSI_ModeSelect(
                              pRequestSense))
             {
             case SENSE_IGNORE:
-              dbprintf(("SCSI_ModeSelect : SENSE_IGNORE\n"));
+              dbprintf(_("SCSI_ModeSelect : SENSE_IGNORE\n"));
              goto done;
               /*NOTREACHED*/
 
             case SENSE_RETRY:
-              dbprintf(("SCSI_ModeSelect : SENSE_RETRY no %d\n", retry));
+              dbprintf(_("SCSI_ModeSelect : SENSE_RETRY no %d\n"), retry);
               break;
 
             default:
@@ -6243,7 +6232,7 @@ SCSI_ModeSelect(
         }
     }
 end:
-  dbprintf(("SCSI_ModeSelect end: %d\n", ret));
+  dbprintf(_("SCSI_ModeSelect end: %d\n"), ret);
 
 done:
   free(pRequestSense);
@@ -6266,9 +6255,9 @@ SCSI_ModeSense(
   int ret = 1;
   int retry = 1;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_ModeSense\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ModeSense\n"));
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense start length = %d:\n", size);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense start length = %d:\n"), size);
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
   while (ret && retry < MAX_RETRIES)
@@ -6298,14 +6287,14 @@ SCSI_ModeSense(
           switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
             {
             case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
               return(0);
               /*NOTREACHED*/
             case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
               break;
             default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
               return(pRequestSense->SenseKey);
               /*NOTREACHED*/
             }
@@ -6313,7 +6302,7 @@ SCSI_ModeSense(
       retry++;
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense end: %d\n", ret);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense end: %d\n"), ret);
   return(ret);
 }
 
@@ -6331,9 +6320,9 @@ SCSI_Inquiry(
 
   assert(size <= UCHAR_MAX);
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, "##### START SCSI_Inquiry\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START SCSI_Inquiry\n"));
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry start length = %d:\n", size);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry start length = %d:\n"), size);
 
   pRequestSense = alloc((size_t)size);
 
@@ -6354,12 +6343,12 @@ SCSI_Inquiry(
                                 SIZEOF(RequestSense_T));
       if (ret < 0)
         {
-          DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X",
+          DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"),
                     "chs", ((u_char *) pRequestSense)[0]);
           for (i = 1; i < (int)sizeof(RequestSense_T); i++)
             DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) pRequestSense)[i]);
           DebugPrint(DEBUG_ERROR, SECTION_SCSI, "\n");
-         DebugPrint(DEBUG_ERROR, SECTION_SCSI, "Inquiry end: %d\n", ret);
+         DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Inquiry end: %d\n"), ret);
          return(ret);
          /*NOTRACHED*/
         }
@@ -6368,14 +6357,14 @@ SCSI_Inquiry(
           switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
             {
             case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Inquiry : SENSE_IGNORE\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry : SENSE_IGNORE\n"));
               return(0);
               /*NOTREACHED*/
             case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry : SENSE_RETRY no %d\n", retry);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : SENSE_RETRY no %d\n"), retry);
               break;
             default:
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI, "SCSI_Inquiry : end %d\n", pRequestSense->SenseKey);
+              DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), pRequestSense->SenseKey);
               return(pRequestSense->SenseKey);
               /*NOTREACHED*/
             }
@@ -6384,13 +6373,13 @@ SCSI_Inquiry(
       if (ret == 0)
         {
           dump_hex((u_char *)buffer, size, DEBUG_INFO, SECTION_SCSI);
-          DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry : end %d\n", ret);
+          DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), ret);
           return(ret);
          /*NOTRACHED*/
         }
     }
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Inquiry end: %d\n", ret);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry end: %d\n"), ret);
   return(ret);
 }
 
@@ -6423,7 +6412,7 @@ SCSI_ReadElementStatus(
   int retry = 1;
   int ret = -1;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_ReadElementStatus\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ReadElementStatus\n"));
 
   pRequestSense = alloc(SIZEOF(RequestSense_T));
 
@@ -6432,7 +6421,7 @@ SCSI_ReadElementStatus(
    */
   if (NoOfElements == 0)
     {
-      ChgExit("SCSI_ReadElementStatus","No of Elements passed are le 0",FATAL);
+      ChgExit("SCSI_ReadElementStatus",_("No of Elements passed are le 0"),FATAL);
       /*NOTREACHED*/
     }
 
@@ -6465,11 +6454,11 @@ SCSI_ReadElementStatus(
                         *data, 8,
                         pRequestSense, SIZEOF(RequestSense_T));
 
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus : (1) SCSI_Run %d\n", ret);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (1) SCSI_Run %d\n"), ret);
          if (ret < 0)
            {
              DecodeSense(pRequestSense, "SCSI_ReadElementStatus :",debug_file);
-             DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret);
+             DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
              return(ret);
              /*NOTRACHED*/
            }
@@ -6478,15 +6467,15 @@ SCSI_ReadElementStatus(
              switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
                {
                case SENSE_IGNORE:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n");
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
                  retry = 0;
                  break;
                case SENSE_RETRY:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry);
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
                  sleep(2);
                  break;
                default:
-                 DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey);
+                 DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
                  return(pRequestSense->SenseKey);
                  /*NOTREACHED*/
                }
@@ -6499,7 +6488,7 @@ SCSI_ReadElementStatus(
        }
       if (retry > 0)
        {
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
          return(ret);
          /*NOTRACHED*/
        }
@@ -6507,7 +6496,7 @@ SCSI_ReadElementStatus(
       ElementStatusData = (ElementStatusData_T *)*data;
       DataBufferLength = V3(ElementStatusData->count);
 
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus: DataBufferLength %X, ret %d\n",DataBufferLength, ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus: DataBufferLength %X, ret %d\n"),DataBufferLength, ret);
 
       dump_hex(*data, 8, DEBUG_INFO, SECTION_ELEMENT);
     } else { /* DescriptorSize != 0 */
@@ -6537,11 +6526,11 @@ SCSI_ReadElementStatus(
                                 pRequestSense, SIZEOF(RequestSense_T));
 
 
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus : (2) SCSI_Run %d\n", ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (2) SCSI_Run %d\n"), ret);
       if (ret < 0)
         {
-          DecodeSense(pRequestSense, "SCSI_ReadElementStatus :",debug_file);
-         DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret);
+          DecodeSense(pRequestSense, _("SCSI_ReadElementStatus :"),debug_file);
+         DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
           return(ret);
          /*NOTRACHED*/
         }
@@ -6550,15 +6539,15 @@ SCSI_ReadElementStatus(
           switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense))
             {
             case SENSE_IGNORE:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n"));
               retry = 0;
               break;
             case SENSE_RETRY:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry);
               sleep(2);
               break;
             default:
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey);
               return(pRequestSense->SenseKey);
               /*NOTREACHED*/
             }
@@ -6572,13 +6561,13 @@ SCSI_ReadElementStatus(
 
   if (retry > 0)
     {
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
       return(ret);
       /*NOTRACHED*/
     }
 
   dump_hex(*data, DataBufferLength, DEBUG_INFO, SECTION_SCSI);
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret);
   return(ret);
 }
 
@@ -6593,8 +6582,8 @@ printf_arglist_function2(void DebugPrint, int, level, int, section, char *, fmt)
   if (changer->debuglevel)
     {
       if (sscanf(changer->debuglevel,"%d:%d", &dlevel, &dsection) != 2) {
-       dbprintf(("Parse error: line is '%s' expected [0-9]*:[0-9]*\n",
-                 changer->debuglevel));
+       dbprintf(_("Parse error: line is '%s' expected [0-9]*:[0-9]*\n"),
+                 changer->debuglevel);
         dlevel=1;
         dsection=1;
       }
@@ -6604,16 +6593,16 @@ printf_arglist_function2(void DebugPrint, int, level, int, section, char *, fmt)
     }
 
   arglist_start(argp, fmt);
-  vsnprintf(buf, SIZEOF(buf), fmt, argp);
+  g_vsnprintf(buf, SIZEOF(buf), fmt, argp);
   if (dlevel >= level)
     {
       if (section == dsection || dsection == 0)
        {
          if (index(buf, '\n') != NULL && strlen(buf) > 1)
           {
-            dbprintf(("%ld:%s", (long)ti, buf));
+            dbprintf(_("%ld:%s"), (long)ti, buf);
          } else {
-            dbprintf(("%s", buf));
+            dbprintf("%s", buf);
          }
        }
     }
index 87c6157e824efad237911615d295e877f710bb07..32c3dbb9d5d4d8160fd7c58c143aaf8f6a3568a7 100644 (file)
@@ -7,15 +7,12 @@
  *     Author: Eric Schnoebelen, eric@cirr.com
  *     based on work by: Larry Pyeatt,  pyeatt@cs.colostate.edu 
  *     Copyright: 1997, 1998 Eric Schnoebelen
- *             
+ *
+ *     Patch: Michael Enkelis, michaele@mxim.com)
  */
 
 #include "config.h"
 #include "amanda.h"
-#include "scsi-defs.h"
-
-#if (defined(HAVE_CHIO_H) || defined(HAVE_SYS_CHIO_H)) \
-    && !defined(HAVE_CAMLIB_H)
 
 #include <sys/types.h>
 #include <sys/ioctl.h>
  * and possibly change all the ioctl() calls in this program.  
  */
 
-#if defined(HAVE_CHIO_H)
-#  include <chio.h>
-#else /* HAVE_SYS_CHIO_H must be defined */
-#  include <sys/chio.h>
-#endif
+#if defined(HAVE_LINUX_CHIO_H)
+#  include <linux/chio.h>
+#else
+# if defined(HAVE_CHIO_H)
+#   include <chio.h>
+# else /* HAVE_SYS_CHIO_H must be defined */
+#   include <sys/chio.h>
+# endif        /* HAVE_CHIO_H */
+#endif  /* HAVE_LINUX_CHIO_H */
 
 char *modname = "@(#)" __FILE__ 
                ": SCSI support library for the chio(2) interface @(#)";
@@ -41,8 +42,22 @@ char *modname = "@(#)" __FILE__
  */
 static struct changer_params changer_info;
 static int changer_info_init = 0;
-
-static int get_changer_info(fd)
+int GetCurrentSlot(int fd, int drive);
+int GetDeviceStatus (char *tapedev);
+int OpenDevice (char *tapedev);
+int CloseDevice (char *device, int DeviceFD);
+int Tape_Ready1 ( char *tapedev , int wait);
+int isempty(int fd, int slot);
+int find_empty(int fd, int start, int count);
+int get_clean_state(char *tapedev);
+int get_slot_count(int fd);
+int get_drive_count(int fd);
+int eject_tape(char *tapedev);
+int drive_loaded(int fd, int drivenum);
+int unload(int fd, int drive, int slot);
+int load(int fd, int drive, int slot);
+
+static int get_changer_info(int fd)
 {
 int rc = 0;
 
@@ -64,6 +79,8 @@ int GetCurrentSlot(int fd, int drive)
     int slot;
     int i, rc;
 
+    (void)drive;
+
     get_changer_info(fd);
 
     ces.ces_type = CHET_ST;
@@ -71,35 +88,40 @@ int GetCurrentSlot(int fd, int drive)
 
     rc = ioctl(fd, CHIOGSTATUS, &ces);
     if (rc) {
-       dbprintf(("%s: changer status query failed: 0x%x %s\n",
-                       get_pname(), rc,strerror(errno)));
+       dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno));
        return -1;
     }
     for (slot = 0; slot < changer_info.cp_nslots; slot++)
     {
        i = ces.ces_data[slot] & CESTATUS_FULL;
-       dbprintf(("\tGetCurrentSlot slot %d = %d\n", slot, i));
+       dbprintf(_("\tGetCurrentSlot slot %d = %d\n"), slot, i);
        if (!i)
             return(slot);
     }
-
-
+    return -1;
 }
 
-int get_clean_state(int changerfd, char *changerdev, char *dev)
+int get_clean_state(char *tapedev)
 {
-    return 0;
-
+int rc;
+#if defined(BUILTIN)
+    rc = 0;
+#else
+#define GMT_CLN(x)     ((x) & 0x00008000)
+    rc = ( GMT_CLN(GetDeviceStatus(tapedev)) );
+#endif /* BUILTIN */
+    return rc;
 }
-void eject_tape(char *tape)
+
+int eject_tape(char *tapedev)
 /* This function ejects the tape from the drive */
 {
 int mtfd;
 struct mtop mt_com;
 
-    if ((mtfd = open(tape, O_RDWR)) < 0) {
-        dbprintf(("eject_tape : failed\n"));
-        perror(tape);
+    if ( (mtfd = OpenDevice(tapedev) ) < 0) {
+        dbprintf(_("eject_tape : failed\n"));
+        perror(tapedev);
         exit(2);
     }
     mt_com.mt_op = MTOFFL;
@@ -109,11 +131,11 @@ struct mtop mt_com;
     If the drive already ejected the tape due an error, or because it
     was a cleaning tape, threre can be an error, which we should ignore 
 
-       perror(tape);
+       perror(tapedev);
        exit(2);
 */
     }
-    close(mtfd);
+    return(CloseDevice(tapedev, mtfd));
 }
 
 
@@ -133,8 +155,7 @@ int type=CHET_ST;
 
     rc = ioctl(fd, CHIOGSTATUS, &ces);
     if (rc) {
-       dbprintf(("%s: changer status query failed: 0x%x %s\n",
-                       get_pname(), rc,strerror(errno)));
+       dbprintf(_("changer status query failed: 0x%x %s\n"), rc,strerror(errno));
        return -1;
     }
 
@@ -153,6 +174,9 @@ struct changer_element_status  ces;
 int                            i,rc;
 int type=CHET_ST;
 
+    (void)start;
+    (void)count;
+
     get_changer_info(fd);
 
     ces.ces_type = type;
@@ -160,8 +184,7 @@ int type=CHET_ST;
 
     rc = ioctl(fd,CHIOGSTATUS,&ces);
     if (rc) {
-       dbprintf(("%s: changer status query failed: 0x%x %s\n",
-                       get_pname(), rc, strerror(errno)));
+       dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno));
        return -1;
     }
 
@@ -188,8 +211,7 @@ int type=CHET_DT;
 
     rc = ioctl(fd, CHIOGSTATUS, &ces);
     if (rc) {
-       dbprintf(("%s: drive status query failed: 0x%x %s\n",
-                       get_pname(), rc, strerror(errno)));
+       dbprintf(_("drive status query failed: 0x%x %s\n"), rc, strerror(errno));
        return -1;
     }
 
@@ -208,7 +230,7 @@ int unload(int fd, int drive, int slot)
 struct changer_move  move;
 int rc;
 
-    dbprintf(("unload : fd = %d, drive = %d, slot =%d\n",fd, drive, slot));
+    dbprintf(_("unload : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot);
 
     move.cm_fromtype = CHET_DT;
     move.cm_fromunit = drive;
@@ -218,8 +240,7 @@ int rc;
 
     rc = ioctl(fd, CHIOMOVE, &move);
     if (rc){
-       dbprintf(("%s: drive unload failed (MOVE): 0x%x %s\n",
-               get_pname(), rc, strerror(errno)));
+       dbprintf(_("drive unload failed (MOVE): 0x%x %s\n"), rc, strerror(errno));
        return(-2);
     }
     return 0;
@@ -234,7 +255,7 @@ int load(int fd, int drive, int slot)
 struct changer_move  move;
 int rc;
 
-    dbprintf(("load : fd = %d, drive = %d, slot =%d\n",fd, drive, slot));
+    dbprintf(_("load : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot);
 
     move.cm_fromtype = CHET_ST;
     move.cm_fromunit = slot;
@@ -244,8 +265,7 @@ int rc;
 
     rc = ioctl(fd,CHIOMOVE,&move);
     if (rc){
-       dbprintf(("%s: drive load failed (MOVE): 0x%x %s\n",
-               get_pname(), rc, strerror(errno)));
+       dbprintf(_("drive load failed (MOVE): 0x%x %s\n"), rc, strerror(errno));
        return(-2);
     }
     return(0);
@@ -257,8 +277,7 @@ int rc;
 
     rc = get_changer_info(fd);
     if (rc) {
-        dbprintf(("%s: slot count query failed: 0x%x %s\n", 
-                       get_pname(), rc, strerror(errno)));
+        dbprintf(_("slot count query failed: 0x%x %s\n"), rc, strerror(errno));
         return -1;
     }
 
@@ -271,8 +290,7 @@ int rc;
 
     rc = get_changer_info(fd);
     if (rc) {
-        dbprintf(("%s: drive count query failed: 0x%x %s\n",
-                       get_pname(), rc, strerror(errno)));
+        dbprintf(_("drive count query failed: 0x%x %s\n"), rc, strerror(errno));
         return -1;
     }
 
@@ -280,7 +298,8 @@ int rc;
 }
 
 /* This function should ask the drive if it is ready */
-int Tape_Ready ( char *tapedev , int wait)
+int Tape_Ready1 ( char *tapedev , int wait)
+#if defined(BUILTIN)
 {
   FILE *out=NULL;
   int cnt=0;
@@ -294,25 +313,60 @@ int Tape_Ready ( char *tapedev , int wait)
   return 0;
 }
 
+#else
+{
+  int cnt=0;
+
+  dbprintf(_("Tape_Ready1 : wait for BOT : max %d seconds\n"),wait);
+  /* loop on status BOT */
+  while ((cnt < wait)) {
+    if ( GMT_BOT(GetDeviceStatus(tapedev)) ) {
+     break;
+    }
+    /* dbprintf(("Tape_Ready1 : cnt %d\n",cnt)); */
+    cnt++;
+    sleep(1);
+  }
+  if (cnt >= wait) {
+   dbprintf(_("Tape_Ready1 : BOT not found : %d seconds\n"),cnt);
+   return(-1);
+  } else {
+   dbprintf(_("Tape_Ready1 : BOT : %d seconds\n"),cnt);
+  return 0;
+  }
+}
+#endif /* BUILTIN */
+
+int GetDeviceStatus (char *tapedev)
+{
+  struct mtget status;
+  int mtfd, rc;
+
+  mtfd = OpenDevice(tapedev);
+  ioctl (mtfd, MTIOCGET, (char *)&status);
+  CloseDevice(tapedev, mtfd);
+  rc = status.mt_gstat;
+  return rc;
+}
+
 int OpenDevice (char *tapedev)
 {
   int DeviceFD;
 
   DeviceFD = open(tapedev, O_RDWR);
-  return(DeviceFD);
+  return DeviceFD;
 }
 
 int CloseDevice (char *device, int DeviceFD)
 {
-   int ret;
+   int rc;
 
-   dbprintf(("%s: CloseDevice(%s)\n", device, get_pname()));
-   ret = close(DeviceFD);
+   dbprintf(_("CloseDevice(%s)\n"), device);
+   rc = close(DeviceFD);
 
-   return ret;
+   return rc;
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index 56179b19b58ad69c57b2569c01105f3149c2058f..1d379a88b478465628f9d3350e2690e2155fce40 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "amanda.h"
 
-#if defined(HAVE_HPUX_SCSI_CHIO)
 # include <sys/scsi.h>
 # include <sys/mtio.h>  /* for eject_tape ioctls */
 
@@ -157,7 +156,7 @@ int rc;
 
     rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
     if (rc) {
-       fprintf(stderr, "%s: element status query failed: 0x%x %s\n",
+       g_fprintf(stderr, _("%s: element status query failed: 0x%x %s\n"),
                                get_pname(), rc, strerror(errno));
        return(-1);
     }
@@ -183,7 +182,7 @@ int i, rc;
                && !rc && es.full);
 
     if (rc) {
-       fprintf(stderr,"%s: element status query failed: 0x%x %s\n",
+       g_fprintf(stderr,_("%s: element status query failed: 0x%x %s\n"),
                                get_pname(), rc, strerror(errno));
        return -1;
     }
@@ -204,7 +203,7 @@ int                            i,rc;
 
     rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
     if (rc) {
-       fprintf(stderr,"%s: drive status quer failed: 0x%x %s\n",
+       g_fprintf(stderr,_("%s: drive status quer failed: 0x%x %s\n"),
                                get_pname(), rc, strerror(errno));
        return(-1);
     }
@@ -234,7 +233,7 @@ int rc;
 
     rc = ioctl(fd, SIOC_MOVE_MEDIUM, &move);
     if (rc){
-       fprintf(stderr,"%s: move medium command failed: 0x%x %s\n",
+       g_fprintf(stderr,_("%s: move medium command failed: 0x%x %s\n"),
                get_pname(), rc, strerror(errno));
        return(-2);
     }
@@ -264,7 +263,7 @@ int rc;
 
     rc = ioctl(fd, SIOC_MOVE_MEDIUM,&move);
     if (rc){
-       fprintf(stderr,"%s: drive load failed (MOVE): 0x%x %s\n",
+       g_fprintf(stderr,_("%s: drive load failed (MOVE): 0x%x %s\n"),
                get_pname(), rc, strerror(errno));
        return(-2);
     }
@@ -277,7 +276,7 @@ int rc;
 
     rc = get_changer_info(fd);
     if (rc) {
-        fprintf(stderr, "%s: storage size query failed: 0x%x %s\n", get_pname(),
+        g_fprintf(stderr, _("%s: storage size query failed: 0x%x %s\n"), get_pname(),
                                                rc, strerror(errno));
         return -1;
     }
@@ -292,7 +291,7 @@ int get_drive_count(int fd)
 
     rc = get_changer_info(fd);
     if (rc) {
-        fprintf(stderr, "%s: drive count query failed: 0x%x %s\n", get_pname(),
+        g_fprintf(stderr, _("%s: drive count query failed: 0x%x %s\n"), get_pname(),
                                                rc, strerror(errno));
         return -1;
     }
@@ -326,7 +325,7 @@ int OpenDevice(char * tapedev)
   int DeviceFD;
 
   DeviceFD = open(tapedev, O_RDWR);
-  dbprintf(("%s: OpenDevice(%s) returns %d\n", get_pname(), tapedev, DeviceFD));
+  dbprintf(_("OpenDevice(%s) returns %d\n"), tapedev, DeviceFD);
   return(DeviceFD);
 }
 
@@ -335,8 +334,6 @@ int CloseDevice(char *device, int DeviceFD)
   int ret;
 
   ret = close(DeviceFD);
-  dbprintf(("%s: CloseDevice(%s) returns %d\n", get_pname(), device, ret));
+  dbprintf(_("CloseDevice(%s) returns %d\n"), device, ret);
   return(ret);
 }
-
-#endif
index e96ed4725b9347831a98bede862b10792a9896dc..288bff28d30a171cf72f0b050feda76d31dd6b26 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_HPUX_LIKE_SCSI
-
-# ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
+#include "amanda.h"
 
 #include <sys/scsi.h>
 #include <sys/mtio.h>
@@ -190,9 +174,9 @@ int SCSI_ExecuteCommand(int DeviceFD,
       {
         if (SCSI_OpenDevice(DeviceFD) == 0)
           {
-            dbprintf(("SCSI_ExecuteCommand could not open %s: %s\n",
+            dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"),
                       pDev[DeviceFD].dev,
-                     strerror(errno)));
+                     strerror(errno));
             sleep(1); /* Give device a little time befor retry */
             continue;
           }
@@ -251,7 +235,7 @@ int Tape_Ioctl( int DeviceFD, int command)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
     {
-      dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno)));
+      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -274,12 +258,12 @@ int Tape_Status( int DeviceFD)
 
   if (ioctl(pDev[DeviceFD].fd, MTIOCGET, &mtget) != 0)
   {
-     dbprintf(("Tape_Status error ioctl %s\n", strerror(errno)));
+     dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
      SCSI_CloseDevice(DeviceFD);
      return(-1);
   }
 
-  dbprintf(("ioctl -> mtget.mt_gstat %X\n",mtget.mt_gstat));
+  dbprintf(_("ioctl -> mtget.mt_gstat %X\n"),mtget.mt_gstat);
   if (GMT_ONLINE(mtget.mt_gstat))
   {
     ret = TAPE_ONLINE;
@@ -311,7 +295,6 @@ int ScanBus(int print)
 */
   return(-1);
 }
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index f018cebca0f494cc3f4ee6649266b8be69959bf8..412a648ec2dccb72935858d429e118562933a6a3 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_IRIX_LIKE_SCSI
-
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#include "amanda.h"
 
 #include <sys/scsi.h>
 #include <sys/dsreq.h>
@@ -211,9 +192,9 @@ int SCSI_ExecuteCommand(int DeviceFD,
       {
         if (SCSI_OpenDevice(DeviceFD) == 0)
           {
-            dbprintf(("SCSI_ExecuteCommand could not open %s: %s\n",
+            dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"),
                       pDev[DeviceFD].dev,
-                     strerror(errno)));
+                     strerror(errno));
             sleep(1); /* Give device a little time befor retry */
             continue;
           }
@@ -228,7 +209,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
         return (SCSI_ERROR);
       }
     DecodeSCSI(CDB, "SCSI_ExecuteCommand : ");
-    dbprintf(("\t\t\tSTATUS(%02X) RET(%02X)\n", STATUS(&ds), RET(&ds)));
+    dbprintf(_("\t\t\tSTATUS(%02X) RET(%02X)\n"), STATUS(&ds), RET(&ds));
     switch (STATUS(&ds))
       {
       case ST_BUSY:                /*  BUSY */
@@ -303,7 +284,7 @@ int Tape_Status( int DeviceFD)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
     {
-      dbprintf(("Tape_Status error ioctl %s\n",strerror(errno)));
+      dbprintf(_("Tape_Status error ioctl %s\n"),strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -344,7 +325,7 @@ int ScanBus(int print)
 
   if ((dir = opendir("/dev/scsi")) == NULL)
     {
-      dbprintf(("Can not read /dev/scsi: %s", strerror(errno)));
+      dbprintf(_("Can not read /dev/scsi: %s"), strerror(errno));
       return 0;
     }
 
@@ -354,7 +335,7 @@ int ScanBus(int print)
       {
         pDev[count].dev = malloc(10);
         pDev[count].inqdone = 0;
-        sprintf(pDev[count].dev,"/dev/scsi/%s", dirent->d_name);
+        g_sprintf(pDev[count].dev,"/dev/scsi/%s", dirent->d_name);
         if (OpenDevice(count,pDev[count].dev, "Scan", NULL ))
           {
             SCSI_CloseDevice(count);
@@ -362,48 +343,48 @@ int ScanBus(int print)
             
             if (print)
               {
-                printf("name /dev/scsi/%s ", dirent->d_name);
+                g_printf(_("name /dev/scsi/%s "), dirent->d_name);
                 
                 switch (pDev[count].inquiry->type)
                   {
                   case TYPE_DISK:
-                    printf("Disk");
+                    g_printf(_("Disk"));
                     break;
                   case TYPE_TAPE:
-                    printf("Tape");
+                    g_printf(_("Tape"));
                     break;
                   case TYPE_PRINTER:
-                    printf("Printer");
+                    g_printf(_("Printer"));
                     break;
                   case TYPE_PROCESSOR:
-                    printf("Processor");
+                    g_printf(_("Processor"));
                     break;
                   case TYPE_WORM:
-                    printf("Worm");
+                    g_printf(_("Worm"));
                     break;
                   case TYPE_CDROM:
-                    printf("Cdrom");
+                    g_printf(_("Cdrom"));
                     break;
                   case TYPE_SCANNER:
-                    printf("Scanner");
+                    g_printf(_("Scanner"));
                     break;
                   case TYPE_OPTICAL:
-                    printf("Optical");
+                    g_printf(_("Optical"));
                     break;
                   case TYPE_CHANGER:
-                    printf("Changer");
+                    g_printf(_("Changer"));
                     break;
                   case TYPE_COMM:
-                    printf("Comm");
+                    g_printf(_("Comm"));
                     break;
                   default:
-                    printf("unknown %d",pDev[count].inquiry->type);
+                    g_printf(_("unknown %d"),pDev[count].inquiry->type);
                     break;
                   }
-                printf("\n");
+                g_printf("\n");
               }
             count++;
-           printf("Count %d\n",count);
+           g_printf(_("Count %d\n"),count);
           } else {
             free(pDev[count].dev);
             pDev[count].dev=NULL;
@@ -413,7 +394,6 @@ int ScanBus(int print)
   return 0;
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index d0dcaeb8b31f18f4c6092ae1312ebd3ae0a1b0ef..396e8979dacb04e631b12325a525cf43968c6129 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_DMALLOC_H
-#include <dmalloc.h>
-#endif
-
-#ifdef HAVE_LINUX_LIKE_SCSI
-
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#include <time.h>
-
-#ifdef HAVE_SCSI_SCSI_IOCTL_H
-#include <scsi/scsi_ioctl.h>
-#endif
+#include "amanda.h"
 
 #ifdef HAVE_SCSI_SG_H
 #include <scsi/sg.h>
@@ -121,21 +88,21 @@ int SCSI_OpenDevice(int ip)
   char *buffer = NULL ;           /* Will contain the device name after checking */
   int openmode = O_RDONLY;
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_OpenDevice\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_OpenDevice\n"));
   if (pDev[ip].inqdone == 0)
     {
       pDev[ip].inqdone = 1;
       if (strncmp("/dev/sg", pDev[ip].dev, 7) != 0) /* Check if no sg device for an link .... */
         {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : checking if %s is a sg device\n", pDev[ip].dev);
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : checking if %s is a sg device\n"), pDev[ip].dev);
           if (lstat(pDev[ip].dev, &pstat) != -1)
             {
               if (S_ISLNK(pstat.st_mode) == 1)
                 {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : is a link, checking destination\n");
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : is a link, checking destination\n"));
                   if ((buffer = (char *)malloc(513)) == NULL)
                     {
-                      DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_OpenDevice : malloc failed\n");
+                      DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_OpenDevice : malloc failed\n"));
                       return(0);
                     }
                   memset(buffer, 0, 513);
@@ -151,16 +118,16 @@ int SCSI_OpenDevice(int ip)
                     {
                       if (strncmp("/dev/sg", buffer, 7) == 0)
                         {
-                          DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : link points to %s\n", buffer) ;
+                          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : link points to %s\n"), buffer) ;
                           pDev[ip].flags = 1;
                         }
                     }
                 } else {/* S_ISLNK(pstat.st_mode) == 1 */
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"No link %s\n", pDev[ip].dev) ;
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("No link %s\n"), pDev[ip].dev) ;
                   buffer = stralloc(pDev[ip].dev);
                 }
             } else {/* lstat(DeviceName, &pstat) != -1 */ 
-              DebugPrint(DEBUG_ERROR, SECTION_SCSI,"can't stat device %s\n", pDev[ip].dev);
+              DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("can't stat device %s\n"), pDev[ip].dev);
               return(0);
             }
         } else {
@@ -173,19 +140,19 @@ int SCSI_OpenDevice(int ip)
           openmode = O_RDWR;
         }
       
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"Try to open %s\n", buffer);
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Try to open %s\n"), buffer);
       if ((DeviceFD = open(buffer, openmode)) >= 0)
         {
           pDev[ip].avail = 1;
           pDev[ip].devopen = 1;
           pDev[ip].fd = DeviceFD;
         } else {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
          amfree(buffer);
           return(0);
         }
       
-      DebugPrint(DEBUG_INFO, SECTION_SCSI,"done\n");
+      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("done\n"));
       if ( pDev[ip].flags == 1)
         {
           pDev[ip].SCSI = 1;
@@ -194,14 +161,14 @@ int SCSI_OpenDevice(int ip)
       pDev[ip].dev = buffer;
       if (pDev[ip].SCSI == 1)
         {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : use SG interface\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : use SG interface\n"));
           if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) 
             {
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : current timeout %d\n", timeout);
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout);
               timeout = 60000;
               if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0)
                 {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : timeout set to %d\n", timeout);
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout);
                 }
             }
           pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
@@ -228,12 +195,12 @@ int SCSI_OpenDevice(int ip)
                  }
 
                   PrintInquiry(pDev[ip].inquiry);
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n");
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
                   return(1);
                 } else {
                   close(DeviceFD);
                   amfree(pDev[ip].inquiry);
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (0)\n");
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (0)\n"));
                   return(0);
                 }
             } else {
@@ -242,15 +209,15 @@ int SCSI_OpenDevice(int ip)
               close(DeviceFD);
               amfree(pDev[ip].inquiry);
               pDev[ip].inquiry = NULL;
-              DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n");
+              DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
               return(1);
             }
         } else /* if (pDev[ip].SCSI == 1) */ {  
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"Device not capable for SCSI commands\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Device not capable for SCSI commands\n"));
           pDev[ip].SCSI = 0;
           pDev[ip].devopen = 0;
           close(DeviceFD);
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
           return(1);
         }
     } else { /* if (pDev[ip].inqdone == 0) */
@@ -268,22 +235,22 @@ int SCSI_OpenDevice(int ip)
             {
               if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) 
                 {
-                  DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : current timeout %d\n", timeout);
+                  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout);
                   timeout = 60000;
                   if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0)
                     {
-                      DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : timeout set to %d\n", timeout);
+                      DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout);
                     }
                 }
             }
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n"));
           return(1);
         } else {
-          DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n");
+          DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n"));
           return(0);
         }
     }
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice should not happen !!\n");
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice should not happen !!\n"));
   return(0);
 }
 
@@ -327,7 +294,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
   buffer = (char *)malloc(SCSI_OFF + CDB_Length + DataBufferLength);
   if (buffer == NULL)
     {
-      dbprintf(("SCSI_ExecuteCommand memory allocation failure.\n"));
+      dbprintf(_("SCSI_ExecuteCommand memory allocation failure.\n"));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -361,7 +328,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
        (status != (ssize_t)(SCSI_OFF + CDB_Length + osize)) ||
        (psg_header->result != 0)) 
     {
-      dbprintf(("SCSI_ExecuteCommand error send \n"));
+      dbprintf(_("SCSI_ExecuteCommand error send \n"));
       SCSI_CloseDevice(DeviceFD);
       amfree(buffer);
       return(SCSI_ERROR);
@@ -376,8 +343,8 @@ int SCSI_ExecuteCommand(int DeviceFD,
        (status != (ssize_t)(SCSI_OFF + DataBufferLength)) || 
        (psg_header->result != 0)) 
     { 
-      dbprintf(("SCSI_ExecuteCommand error read \n"));
-      dbprintf(("Status " SSIZE_T_FMT " (" SSIZE_T_FMT ") %2X\n", status, SCSI_OFF + DataBufferLength,psg_header->result ));
+      dbprintf(_("SCSI_ExecuteCommand error read \n"));
+      dbprintf(_("Status %zd (%zd) %2X\n"), status, SCSI_OFF + DataBufferLength,psg_header->result );
       SCSI_CloseDevice(DeviceFD);
       amfree(buffer);
       return(SCSI_ERROR);
@@ -420,7 +387,7 @@ int SCSI_OpenDevice(int ip)
           pDev[ip].fd = DeviceFD;
           pDev[ip].SCSI = 0;
           pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE);
-          dbprintf(("SCSI_OpenDevice : use ioctl interface\n"));
+          dbprintf(_("SCSI_OpenDevice : use ioctl interface\n"));
           if (SCSI_Inquiry(ip, pDev[ip].inquiry, (u_char)INQUIRY_SIZE) == 0)
             {
               if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER)
@@ -549,7 +516,7 @@ int Tape_Ioctl( int DeviceFD, int command)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
     {
-      dbprintf(("Tape_Ioctl error ioctl %s\n",strerror(errno)));
+      dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -572,13 +539,13 @@ int Tape_Status( int DeviceFD)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
   {
-     DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Tape_Status error ioctl %s\n",
+     DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Tape_Status error ioctl %s\n"),
                strerror(errno));
      SCSI_CloseDevice(DeviceFD);
      return(-1);
   }
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE,"ioctl -> mtget.mt_gstat %lX\n",mtget.mt_gstat);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE,_("ioctl -> mtget.mt_gstat %lX\n"),mtget.mt_gstat);
   if (GMT_ONLINE(mtget.mt_gstat))
     {
       ret = TAPE_ONLINE;
@@ -621,7 +588,7 @@ int ScanBus(int print)
 
   if ((dir = opendir("/dev/")) == NULL)
     {
-      dbprintf(("/dev/ error: %s", strerror(errno)));
+      dbprintf(_("/dev/ error: %s"), strerror(errno));
       return 0;
     }
 
@@ -631,7 +598,7 @@ int ScanBus(int print)
       {
         pDev[count].dev = malloc(10);
         pDev[count].inqdone = 0;
-        snprintf(pDev[count].dev, SIZEOF(pDev[count].dev),
+        g_snprintf(pDev[count].dev, SIZEOF(pDev[count].dev),
            "/dev/%s", dirent->d_name);
         if (OpenDevice(count,pDev[count].dev, "Scan", NULL ))
           {
@@ -640,48 +607,48 @@ int ScanBus(int print)
             
             if (print)
               {
-                printf("name /dev/%s ", dirent->d_name);
+                g_printf(_("name /dev/%s "), dirent->d_name);
                 
                 switch (pDev[count].inquiry->type)
                   {
                   case TYPE_DISK:
-                    printf("Disk");
+                    g_printf(_("Disk"));
                     break;
                   case TYPE_TAPE:
-                    printf("Tape");
+                    g_printf(_("Tape"));
                     break;
                   case TYPE_PRINTER:
-                    printf("Printer");
+                    g_printf(_("Printer"));
                     break;
                   case TYPE_PROCESSOR:
-                    printf("Processor");
+                    g_printf(_("Processor"));
                     break;
                   case TYPE_WORM:
-                    printf("Worm");
+                    g_printf(_("Worm"));
                     break;
                   case TYPE_CDROM:
-                    printf("Cdrom");
+                    g_printf(_("Cdrom"));
                     break;
                   case TYPE_SCANNER:
-                    printf("Scanner");
+                    g_printf(_("Scanner"));
                     break;
                   case TYPE_OPTICAL:
-                    printf("Optical");
+                    g_printf(_("Optical"));
                     break;
                   case TYPE_CHANGER:
-                    printf("Changer");
+                    g_printf(_("Changer"));
                     break;
                   case TYPE_COMM:
-                    printf("Comm");
+                    g_printf(_("Comm"));
                     break;
                   default:
-                    printf("unknown %d",pDev[count].inquiry->type);
+                    g_printf(_("unknown %d"),pDev[count].inquiry->type);
                     break;
                   }
-                printf("\n");
+                g_printf("\n");
               }
             count++;
-           printf("Count %d\n",count);
+           g_printf(_("Count %d\n"),count);
           } else {
             amfree(pDev[count].dev);
             pDev[count].dev=NULL;
@@ -690,7 +657,6 @@ int ScanBus(int print)
     }
   return 0;
 }
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index 8f6fd7737820957211a16ab31d91390022006271..4c53d17619173ad1d380853743a28977f26f4ed0 100644 (file)
@@ -15,8 +15,6 @@
 #include "amanda.h"
 #include "libscsi.h"
 
-#if defined(PROTO_H) 
-
 char *modname = "@(#)" __FILE__
                ": SCSI support library for the proto scsi interface @(#)";
 
@@ -124,5 +122,3 @@ int get_drive_count(int fd)
      */
     return number_of_data-transfer_devices;
 }
-
-#endif
index 891420abeebe92a70fce8e7103bb7d9833bdceeb..33cf87546af01d8e81919fd36615d052c43f2662 100644 (file)
  */
 
 
-#include <amanda.h>
-
-#ifdef HAVE_SOLARIS_LIKE_SCSI
-/*
-#ifdef HAVE_STDIO_H
-*/
-#include <stdio.h>
-/*
-#endif
-*/
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
+#include "amanda.h"
 
 #include <sys/scsi/impl/uscsi.h>
 
@@ -116,7 +98,7 @@ int SCSI_OpenDevice(int ip)
             pDev[ip].inquiry = NULL;
             return(1);
         } else {
-          dbprintf(("SCSI_OpenDevice %s failed\n", pDev[ip].dev));
+          dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev);
           return(0);
         }
     } else {
@@ -155,7 +137,6 @@ int SCSI_ExecuteCommand(int DeviceFD,
   extern FILE * debug_file;
   int ret = 0;
   int retries = 1;
-  extern int errno;
   struct uscsi_cmd Command;
   static int depth = 0;
 
@@ -230,8 +211,8 @@ int SCSI_ExecuteCommand(int DeviceFD,
       ret = Command.uscsi_status;
       break;
     }
-    dbprintf(("ioctl on %d failed, errno %s, ret %d\n",
-             pDev[DeviceFD].fd, strerror(errno), ret));
+    dbprintf(_("ioctl on %d failed, errno %s, ret %d\n"),
+             pDev[DeviceFD].fd, strerror(errno), ret);
 #if 0
     RequestSense(DeviceFD, &pExtendedRequestSense, 0);
 #endif
@@ -241,7 +222,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
   --depth;
   SCSI_CloseDevice(DeviceFD);
 
-  DebugPrint(DEBUG_INFO, SECTION_SCSI,"ioctl ret (%d)\n",ret);
+  DebugPrint(DEBUG_INFO, SECTION_SCSI,_("ioctl ret (%d)\n"),ret);
   return(SCSI_OK);
 }
 
@@ -271,7 +252,7 @@ int Tape_Ioctl( int DeviceFD, int command)
 
   if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0)
     {
-      dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno)));
+      dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -293,7 +274,7 @@ int Tape_Status( int DeviceFD)
   
   if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
     {
-      dbprintf(("Tape_Status error ioctl %s\n", strerror(errno)));
+      dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno));
       SCSI_CloseDevice(DeviceFD);
       return(-1);
     }
@@ -304,8 +285,8 @@ int Tape_Status( int DeviceFD)
    * 0x2 is no tape online
    */
 
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, "ioctl result for mt_dsreg (%d)\n", mtget.mt_dsreg);
-  DebugPrint(DEBUG_INFO, SECTION_TAPE, "ioctl result for mt_erreg (%d)\n", mtget.mt_erreg);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_dsreg (%d)\n"), mtget.mt_dsreg);
+  DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_erreg (%d)\n"), mtget.mt_erreg);
 
   if (mtget.mt_erreg == 0)
     {
@@ -328,7 +309,6 @@ int ScanBus(int print)
        return(-1);
 }
 
-#endif
 /*
  * Local variables:
  * indent-tabs-mode: nil
index e1e99661739ffba78ddec3e227d47cdbc1c84fa6..cca39040f1950f283bf7acff734c5be4c2ed46e3 100644 (file)
@@ -1,12 +1,4 @@
-#include <amanda.h>
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
+#include "amanda.h"
 
 #include "scsi-defs.h"
 /*
 /*
  * Generic one, this is used if not information is found based on the ident of the device
  */
-       { "generic", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "generic", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "generic", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "generic", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "generic", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "generic", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "generic", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "generic", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "The drive is not ready, but it is in the process of becoming ready"},
-       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "generic", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")},
+       { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "generic", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "generic", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "generic", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "generic", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "generic", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "generic", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "generic", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "generic", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "generic", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "generic", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "generic", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "generic", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "generic", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "generic", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "generic", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
+       { "generic", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "generic", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "generic", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "generic", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
-       { "generic", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "generic", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "generic", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "generic", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "generic", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "generic", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "generic", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "generic", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "generic", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "generic", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "generic", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "generic", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "generic", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "generic", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "generic", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "generic", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "generic", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "generic", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "generic", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "generic", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
+       { "generic", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "generic", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "generic", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "generic", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "generic", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "generic", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  *
  * ADIC DAT Autochanger
  *
  */
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x01, SENSE_IES, "Door opend"},
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x01, SENSE_IES, T_("Door opend")},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "DAT AutoChanger", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "DAT AutoChanger", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "DAT AutoChanger", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
 /*
  *
  *     L500 (for the L500 ATL library)
  * */
 
-       { "L500", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "L500", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "L500", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "L500", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0a, 0x0, SENSE_IGNORE, "Error Log overflow"},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, "EEPROM Copy 1 bad"},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, "EEPROM Copy 2 bad"},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, "SCSI parity error"},
-       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x48, 0x0, SENSE_IGNORE, "SCSI IDE message received"},
-       { "L500", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0a, 0x0, SENSE_IGNORE, T_("Error Log overflow")},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM Copy 1 bad")},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM Copy 2 bad")},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("SCSI parity error")},
+       { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x48, 0x0, SENSE_IGNORE, T_("SCSI IDE message received")},
+       { "L500", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_ABORT, "Scsi port not initialized"},
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, "Becoming ready, scanning magazines, etc"},
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x03, SENSE_ABORT, "Unit not ready: manual intervention required: Door Open"},
+       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_ABORT, T_("Scsi port not initialized")},
+       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("Becoming ready, scanning magazines, etc")},
+       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x03, SENSE_ABORT, T_("Unit not ready: manual intervention required: Door Open")},
 /* needed? */
-       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "L500", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "L500", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
 /*     Not used by L500
-       { "L500", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "L500", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "L500", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "L500", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 */
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0,  0x0,  SENSE_ABORT, "Hardware Error"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x3a, 0x80, SENSE_ABORT, "Media not present"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x40, 0x84, SENSE_ABORT, "POST soft failure"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x80, SENSE_ABORT, "Loader Communications timeout"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x81, SENSE_ABORT, "Loader communications UART error or buffer overflow"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x86, SENSE_ABORT, "bad status returned from loader"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xc3, SENSE_ABORT, "EEPROM both copies bad"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xff, SENSE_ABORT, "Unexpected status from test"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x70, SENSE_ABORT, "Cartridge has no home"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x71, SENSE_ABORT, "Loader mechanism problem"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x72, SENSE_ABORT, "Tape drive handle problem"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x73, SENSE_IGNORE, "No cartridge in drive during unload"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x74, SENSE_ABORT, "Loader mechanism problem, after retries"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x75, SENSE_ABORT, "Timeout moving cartridge from drive"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x76, SENSE_ABORT, "Timeout unloading cartridge into slot"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x77, SENSE_ABORT, "Couldn't unlock door after retries"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x78, SENSE_ABORT, "Error during SCAN MAGAZINE"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x79, SENSE_ABORT, "Couldn't lock door after retries"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x80, SENSE_ABORT, "Unexpected door open"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x81, SENSE_ABORT, "Didn't find all expected slots during elevator movement"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x82, SENSE_ABORT, "Cartridge alreay in drive during LOAD CARTRIDGE"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x83, SENSE_ABORT, "Slot empty during LOAD CARTRIDGE"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x84, SENSE_ABORT, "Cleaning Tape expired"},
-       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x85, SENSE_ABORT, "Cleaning Failed"},
-       { "L500", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR,   UCHAR_MAX,   UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
-
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0,   SENSE_ABORT, "Illegal Request"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x1a, 0x0,  SENSE_ABORT, "Parameter length error"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x20, 0x0,  SENSE_ABORT, "SCSI invalid opcode"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid element address"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, "Invalid CDB"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x81, SENSE_ABORT, "Invalid mode on WRITE BUFFER"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x82, SENSE_ABORT, "Invalid drive specified"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x83, SENSE_ABORT, "SEND DIAG Invalid test number"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x86, SENSE_ABORT, "Invalid offset on WRITE BUFFER"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x87, SENSE_ABORT, "Invalid size on WRITE BUFFER"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x89, SENSE_ABORT, "Image data too large on WRITE BUFFER"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8b, SENSE_ABORT, "Invalid image for CUP"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8c, SENSE_ABORT, "Non-immediate command during CUP"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8e, SENSE_ABORT, "Invalid personality for CUP"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8f, SENSE_ABORT, "Bad controller image EDC"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x25, 0x0,  SENSE_ABORT, "Invalid LUN"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x0,  SENSE_ABORT, "Parameter list error: invalid field"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x01, SENSE_ABORT, "Parameter list error: parameter not supported"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x39, 0x0,  SENSE_ABORT, "Saving parameters not supported"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x81, SENSE_ABORT, "Cleaning Slot empty"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x82, SENSE_ABORT, "Cleaning slot doesn't have a cleaning slot"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, "Destination element full"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, "Source slot or drive empty"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3d, 0x0,  SENSE_ABORT, "SCSI invalid ID message"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x0,  SENSE_ABORT, "Media Load/Eject failure"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x01, SENSE_ABORT, "Cartridge failed to unload"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x0,  SENSE_ABORT, "Command unspecified"},
-       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x02, SENSE_ABORT, "Unrecognized loader command"},
-       { "L500", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX,    SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0,  0x0,  SENSE_RETRY, "Unit Attention"},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x0,  SENSE_RETRY, "Not ready to Ready transition"},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x29, 0x0,  SENSE_RETRY, "Reset occured"},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x2a, 0x01, SENSE_ABORT, "Mode parameters changed"},
-       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x3f, 0x01, SENSE_ABORT, "Microcode has changed"},
-       { "L500", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX,     SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0,  0x0,  SENSE_ABORT, T_("Hardware Error")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x3a, 0x80, SENSE_ABORT, T_("Media not present")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x40, 0x84, SENSE_ABORT, T_("POST soft failure")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x80, SENSE_ABORT, T_("Loader Communications timeout")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x81, SENSE_ABORT, T_("Loader communications UART error or buffer overflow")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x86, SENSE_ABORT, T_("bad status returned from loader")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xc3, SENSE_ABORT, T_("EEPROM both copies bad")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xff, SENSE_ABORT, T_("Unexpected status from test")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x70, SENSE_ABORT, T_("Cartridge has no home")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x71, SENSE_ABORT, T_("Loader mechanism problem")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x72, SENSE_ABORT, T_("Tape drive handle problem")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x73, SENSE_IGNORE, T_("No cartridge in drive during unload")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x74, SENSE_ABORT, T_("Loader mechanism problem, after retries")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x75, SENSE_ABORT, T_("Timeout moving cartridge from drive")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x76, SENSE_ABORT, T_("Timeout unloading cartridge into slot")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x77, SENSE_ABORT, T_("Couldn't unlock door after retries")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x78, SENSE_ABORT, T_("Error during SCAN MAGAZINE")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x79, SENSE_ABORT, T_("Couldn't lock door after retries")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x80, SENSE_ABORT, T_("Unexpected door open")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x81, SENSE_ABORT, T_("Didn't find all expected slots during elevator movement")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x82, SENSE_ABORT, T_("Cartridge alreay in drive during LOAD CARTRIDGE")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x83, SENSE_ABORT, T_("Slot empty during LOAD CARTRIDGE")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x84, SENSE_ABORT, T_("Cleaning Tape expired")},
+       { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x85, SENSE_ABORT, T_("Cleaning Failed")},
+       { "L500", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR,   UCHAR_MAX,   UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
+
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0,   SENSE_ABORT, T_("Illegal Request")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x1a, 0x0,  SENSE_ABORT, T_("Parameter length error")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x20, 0x0,  SENSE_ABORT, T_("SCSI invalid opcode")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid CDB")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x81, SENSE_ABORT, T_("Invalid mode on WRITE BUFFER")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x82, SENSE_ABORT, T_("Invalid drive specified")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x83, SENSE_ABORT, T_("SEND DIAG Invalid test number")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x86, SENSE_ABORT, T_("Invalid offset on WRITE BUFFER")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x87, SENSE_ABORT, T_("Invalid size on WRITE BUFFER")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x89, SENSE_ABORT, T_("Image data too large on WRITE BUFFER")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8b, SENSE_ABORT, T_("Invalid image for CUP")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8c, SENSE_ABORT, T_("Non-immediate command during CUP")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8e, SENSE_ABORT, T_("Invalid personality for CUP")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8f, SENSE_ABORT, T_("Bad controller image EDC")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x25, 0x0,  SENSE_ABORT, T_("Invalid LUN")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x0,  SENSE_ABORT, T_("Parameter list error: invalid field")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x01, SENSE_ABORT, T_("Parameter list error: parameter not supported")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x39, 0x0,  SENSE_ABORT, T_("Saving parameters not supported")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x81, SENSE_ABORT, T_("Cleaning Slot empty")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x82, SENSE_ABORT, T_("Cleaning slot doesn't have a cleaning slot")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element full")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source slot or drive empty")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3d, 0x0,  SENSE_ABORT, T_("SCSI invalid ID message")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x0,  SENSE_ABORT, T_("Media Load/Eject failure")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x01, SENSE_ABORT, T_("Cartridge failed to unload")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x0,  SENSE_ABORT, T_("Command unspecified")},
+       { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x02, SENSE_ABORT, T_("Unrecognized loader command")},
+       { "L500", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX,    SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0,  0x0,  SENSE_RETRY, T_("Unit Attention")},
+       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x0,  SENSE_RETRY, T_("Not ready to Ready transition")},
+       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x29, 0x0,  SENSE_RETRY, T_("Reset occured")},
+       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x2a, 0x01, SENSE_ABORT, T_("Mode parameters changed")},
+       { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x3f, 0x01, SENSE_ABORT, T_("Microcode has changed")},
+       { "L500", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX,     SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
 
 /*     Not used by L500
-       { "L500", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "L500", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 */
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x43, 0x0, SENSE_ABORT, "SCSI message error"},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x47, 0x0, SENSE_ABORT, "SCSI parity error"},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x48, 0x0, SENSE_ABORT, "SCSI IDE message received"},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x49, 0x0, SENSE_ABORT, "SCSI invalid message"},
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x4e, 0x0, SENSE_ABORT, "SCSI overlapped commands"},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x43, 0x0, SENSE_ABORT, T_("SCSI message error")},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x47, 0x0, SENSE_ABORT, T_("SCSI parity error")},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x48, 0x0, SENSE_ABORT, T_("SCSI IDE message received")},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x49, 0x0, SENSE_ABORT, T_("SCSI invalid message")},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, 0x4e, 0x0, SENSE_ABORT, T_("SCSI overlapped commands")},
 
-       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ABORTED_COMMAND"},
-       { "L500", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "L500", "", TYPE_CHANGER,  SENSE_ABORTED_COMMAND, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ABORTED_COMMAND")},
+       { "L500", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
 /*
  * HP C1553A Tape
  */
-       { "C1553A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "C1553A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "C1553A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "C1553A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "C1553A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "C1553A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "C1553A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "C1553A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "C1553A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "C1553A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "C1553A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "C1553A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "C1553A", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "C1553A", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "C1553A", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "C1553A", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "C1553A", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "C1553A", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "C1553A", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * HP C1537A Tape
  */
-       { "C1537A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "C1537A", "", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "C1537A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x0, SENSE_RETRY, "tape is being ejected"},
-       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, "tape is being loaded"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x0, SENSE_RETRY, T_("tape is being ejected")},
+       { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("tape is being loaded")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "C1537A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "C1537A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "C1537A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, "Not Ready to Ready Transition"},
-       { "C1537A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
+       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not Ready to Ready Transition")},
+       { "C1537A", "", TYPE_TAPE,  SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "C1537A", "", TYPE_TAPE,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "C1537A", "", TYPE_TAPE,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "C1537A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "C1537A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * Tandberg TapeLibrary 1420
  */
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x0, SENSE_IES, "IES"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x1, SENSE_IES, "IES"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x4, SENSE_IGNORE, "IES"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x0, SENSE_IES, T_("IES")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x1, SENSE_IES, T_("IES")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x4, SENSE_IGNORE, T_("IES")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
+       { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
        { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
 
-       { "TDS 1420", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "TDS 1420", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
 /*
  * Tandberg SLR100 Tape Drive
 /*
  * DLT 8000 Tape
  */
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0,   SENSE_NO, "No Sense"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x01,  SENSE_NO, "Unexpected FM encountered"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x02,  SENSE_NO, "EOM encountered"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x04,  SENSE_NO, "BOM encountered"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x5d, 0x00, SENSE_NO, "Failure prediction threshold exceeded"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x27, 0x82, SENSE_NO, "Data safety write protect"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX,    SENSE_RETRY, "Default for SENSE_NULL"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x17, SENSE_IGNORE, "Cleaning requested"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x00, SENSE_IGNORE, "Error log overflow"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x80, SENSE_IGNORE, "Error log generated"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x37, 0x0,  SENSE_IGNORE, "Rounded parameter"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x38, 0x08, SENSE_IGNORE, "repositioning error"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, "EEPROM copy1 area bad"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, "EEPROM copy2 area bad"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x00, SENSE_IGNORE, "SCSI parity error"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x48, 0x00, SENSE_IGNORE, "IDE Message received"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x51, 0x00, SENSE_IGNORE, "Erase Failure"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x53, 0x01, SENSE_IGNORE, "Unload Tape failure"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x01, SENSE_IGNORE, "Threshold met"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x02, SENSE_IGNORE, "Log counter at maximum"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x02, SENSE_IGNORE, "Cleaning requested"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x03, SENSE_IGNORE, "Softe error exceeds threshold"},
-/*     { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, "Scsi Parity Error"}, */
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready (this shouldn't happen should it?)"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "The drive is not ready, but it is in the process of becoming ready"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x02, SENSE_ABORT, "Incompatible tape format"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x03, SENSE_ABORT, "Cleaning Cartridge in drive"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x5a,0x01, SENSE_ABORT, "Asynchronous eject occurred"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, "Not ready to ready transition"},
-       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "DLT8000", "QUANTUM", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x0,   SENSE_NO, T_("No Sense")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x01,  SENSE_NO, T_("Unexpected FM encountered")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x02,  SENSE_NO, T_("EOM encountered")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x0, 0x04,  SENSE_NO, T_("BOM encountered")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x5d, 0x00, SENSE_NO, T_("Failure prediction threshold exceeded")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL, 0x27, 0x82, SENSE_NO, T_("Data safety write protect")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NULL , UCHAR_MAX, UCHAR_MAX,    SENSE_RETRY, T_("Default for SENSE_NULL")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x17, SENSE_IGNORE, T_("Cleaning requested")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x00, SENSE_IGNORE, T_("Error log overflow")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x80, SENSE_IGNORE, T_("Error log generated")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x37, 0x0,  SENSE_IGNORE, T_("Rounded parameter")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x38, 0x08, SENSE_IGNORE, T_("repositioning error")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM copy1 area bad")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM copy2 area bad")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x00, SENSE_IGNORE, T_("SCSI parity error")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x48, 0x00, SENSE_IGNORE, T_("IDE Message received")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x51, 0x00, SENSE_IGNORE, T_("Erase Failure")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x53, 0x01, SENSE_IGNORE, T_("Unload Tape failure")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x01, SENSE_IGNORE, T_("Threshold met")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x02, SENSE_IGNORE, T_("Log counter at maximum")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x02, SENSE_IGNORE, T_("Cleaning requested")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x03, SENSE_IGNORE, T_("Soft error exceeds threshold")},
+/*     { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("Scsi Parity Error")}, */
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready (this shouldn't happen should it?)")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x02, SENSE_ABORT, T_("Incompatible tape format")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x03, SENSE_ABORT, T_("Cleaning Cartridge in drive")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x5a,0x01, SENSE_ABORT, T_("Asynchronous eject occurred")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not ready to ready transition")},
+       { "DLT8000", "QUANTUM", TYPE_TAPE,  SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       { "DLT8000", "QUANTUM", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 
 /*
  * DLT 7000 Tape
  */
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
+       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "DLT7000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "DLT7000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * DLT 4000 Tape
  */
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"},
-       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "DLT4000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
+       { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "DLT4000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "DLT4000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "DLT4000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * AIT VLS DLT Library
  */
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "VLS_DLT", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "VLS_DLT", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "VLS_DLT", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "VLS_DLT", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * AIT VLS SDX Library
  */
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
 
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
 
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
 
-       { "VLS_SDX", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
+       { "VLS_SDX", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
 
-       { "VLS_SDX", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "VLS_SDX", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * Exabyte 85058 Tape
  */
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
-       { "EXB-85058HE-0000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE,  SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
+       { "EXB-85058HE-0000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")},
 /*
  * Exabyte 10e Library (Robot)
  */
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"},
-       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "EXB-10e", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
-
-       { "EXB-10e", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
+
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
+       { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       { "EXB-10e", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
+
+       { "EXB-10e", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
 
 /*
  * Exabyte 210 Library (Robot)
  */
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid element address"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, "Invalid Invert Field"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, "Destination element occupied"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, "Source Element empty"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x87, SENSE_ABORT, "Cartridge stuck in tape"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x90, SENSE_ABORT, "Source cart is loaded inside the tape drive and not accessible"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x03, SENSE_ABORT, "Source magazine not installed"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x04, SENSE_ABORT, "Destination magazine no installed"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x05, SENSE_ABORT, "Source tape drive not installed"},
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x06, SENSE_ABORT, "Destination tape drive not installed"},
-
-       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x0, SENSE_IES, "Label questionable"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x1, SENSE_IGNORE, "Cannot read bar code label"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x2, SENSE_ABORT, "Cartzridge magazine not present"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x3, SENSE_IES, "Label and full status questionable"},
-               { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x4, SENSE_ABORT, "Tape drive not installed"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x7, SENSE_IES, "Full status questionable"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x8, SENSE_IGNORE, "Bar code label upside down"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x9, SENSE_IGNORE, "No bar code label"},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0xa, SENSE_IGNORE, ""},
-       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
-
-       { "EXB-210", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
+
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid Invert Field")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element occupied")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source Element empty")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x87, SENSE_ABORT, T_("Cartridge stuck in tape")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x90, SENSE_ABORT, T_("Source cart is loaded inside the tape drive and not accessible")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x03, SENSE_ABORT, T_("Source magazine not installed")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x04, SENSE_ABORT, T_("Destination magazine no installed")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x05, SENSE_ABORT, T_("Source tape drive not installed")},
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x06, SENSE_ABORT, T_("Destination tape drive not installed")},
+
+       { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x0, SENSE_IES, T_("Label questionable")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x1, SENSE_IGNORE, T_("Cannot read bar code label")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x2, SENSE_ABORT, T_("Cartzridge magazine not present")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x3, SENSE_IES, T_("Label and full status questionable")},
+               { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x4, SENSE_ABORT, T_("Tape drive not installed")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x7, SENSE_IES, T_("Full status questionable")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x8, SENSE_IGNORE, T_("Bar code label upside down")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0x9, SENSE_IGNORE, T_("No bar code label")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, 0x83, 0xa, SENSE_IGNORE, T_("Ignore")},
+       { "EXB-210", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
+
+       { "EXB-210", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
 
 /*
  * Exabyte 230D Library (Robot)
  */
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"},
-
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"},
-       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       { "EXB-230D", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
-
-       { "EXB-230D", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")},
+
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")},
+       { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       { "EXB-230D", "", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
+
+       { "EXB-230D", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")},
 /*
  * Spectra TreeFrog  library
  */
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense, Unit Ready"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, UCHAR_MAX, UCHAR_MAX, SENSE_NO, "No Sense, Unit Ready"},
-
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Unit Not Ready"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Unit is Becoming Ready"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x83, SENSE_ABORT, "Door is open, Robot is Disabled"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"},
-
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x4C, 0x0, SENSE_ABORT, "Unit Failed Initialization"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, "DRAM Memory Failure"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, "Two ore More SCSI ID's in the library are tehe same"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x81, 0x4, SENSE_ABORT, "Tape may be broken;of tape is a cleaning tape;or Drive B is broken"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x0, SENSE_ABORT, "Bad FPROM or invalid device in socket"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x1, SENSE_ABORT, "FPROM Erase Operation Failed"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x2, SENSE_ABORT, "FFPROM Write Operation Failed"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x1, SENSE_ABORT, "Robot not Initialized"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x99, SENSE_ABORT, "Generic Robotics  Error"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x2, SENSE_ABORT, "Long Axis Robotics Error"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x3, SENSE_ABORT, "Short Axis Robotics Error"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x4, SENSE_ABORT, "Ambient Light Detected"},
-       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x1A, 0x0, SENSE_ABORT, "Parameter List Length Error"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, "Invalid Command Code"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid Element Address"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x0, SENSE_ABORT, "Invalid Field in CDB"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, "LUN Not Supported"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, "Invalid Parameter Field"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xd, SENSE_ABORT, "Medium Destination is full"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xe, SENSE_ABORT, "Medium Source Element is Full"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3d, 0x80, SENSE_ABORT, "Disconnects Must be Allowed"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x18, SENSE_ABORT, "Conflict, Element is Reserved"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x2, SENSE_ABORT, "Library is Full of Tapes"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x3, SENSE_ABORT, "Grip Arm not Empty"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, UCHAR_MAX , UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_IES, "Inventory possible Altered"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, "A Reset Has Occured"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x24, 0x1, SENSE_IGNORE, "Mode Parameter Have CHanged"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_UNIT_ATTENTION"},
-
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x00, SENSE_ABORT, "Barcode Label is Unread"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x01, SENSE_ABORT, "Problem Reading Barcode"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x11, SENSE_ABORT, "Tape in Drive & Unmounted"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x00, SENSE_ABORT, "Unsupported SCSI Command"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x01, SENSE_ABORT, "No Response from SCSI Target"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x02, SENSE_ABORT, "Check Condition form Target"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x03, SENSE_ABORT, "SCSI ID Same as Library's ID"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x08,  SENSE_ABORT, "Busy Condition from Target"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x18, SENSE_ABORT, "SCSI Reservation Conflict"},
-       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC,  UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_VENDOR_SPECIFIC"},
-
-       { "215", "SPECTRA", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"},
-
-       { "215", "SPECTRA", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing found for Spectra/215"},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense, Unit Ready")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, UCHAR_MAX, UCHAR_MAX, SENSE_NO, T_("No Sense, Unit Ready")},
+
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Unit Not Ready")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Unit is Becoming Ready")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x83, SENSE_ABORT, T_("Door is open, Robot is Disabled")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")},
+
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x4C, 0x0, SENSE_ABORT, T_("Unit Failed Initialization")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("DRAM Memory Failure")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("Two ore More SCSI ID's in the library are tehe same")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x81, 0x4, SENSE_ABORT, T_("Tape may be broken;of tape is a cleaning tape;or Drive B is broken")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x0, SENSE_ABORT, T_("Bad FPROM or invalid device in socket")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x1, SENSE_ABORT, T_("FPROM Erase Operation Failed")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x2, SENSE_ABORT, T_("FFPROM Write Operation Failed")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x1, SENSE_ABORT, T_("Robot not Initialized")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x99, SENSE_ABORT, T_("Generic Robotics  Error")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x2, SENSE_ABORT, T_("Long Axis Robotics Error")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x3, SENSE_ABORT, T_("Short Axis Robotics Error")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x4, SENSE_ABORT, T_("Ambient Light Detected")},
+       { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")},
+
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x1A, 0x0, SENSE_ABORT, T_("Parameter List Length Error")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, T_("Invalid Command Code")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid Element Address")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x0, SENSE_ABORT, T_("Invalid Field in CDB")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, T_("LUN Not Supported")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, T_("Invalid Parameter Field")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xd, SENSE_ABORT, T_("Medium Destination is full")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xe, SENSE_ABORT, T_("Medium Source Element is Full")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3d, 0x80, SENSE_ABORT, T_("Disconnects Must be Allowed")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x18, SENSE_ABORT, T_("Conflict, Element is Reserved")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x2, SENSE_ABORT, T_("Library is Full of Tapes")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x3, SENSE_ABORT, T_("Grip Arm not Empty")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, UCHAR_MAX , UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")},
+
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_IES, T_("Inventory possible Altered")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, T_("A Reset Has Occured")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x24, 0x1, SENSE_IGNORE, T_("Mode Parameter Have CHanged")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_UNIT_ATTENTION")},
+
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x00, SENSE_ABORT, T_("Barcode Label is Unread")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x01, SENSE_ABORT, T_("Problem Reading Barcode")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x11, SENSE_ABORT, T_("Tape in Drive & Unmounted")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x00, SENSE_ABORT, T_("Unsupported SCSI Command")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x01, SENSE_ABORT, T_("No Response from SCSI Target")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x02, SENSE_ABORT, T_("Check Condition form Target")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x03, SENSE_ABORT, T_("SCSI ID Same as Library's ID")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x08,  SENSE_ABORT, T_("Busy Condition from Target")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x18, SENSE_ABORT, T_("SCSI Reservation Conflict")},
+       {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC,  UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_VENDOR_SPECIFIC")},
+
+       { "215", "SPECTRA", TYPE_CHANGER,  SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")},
+
+       { "215", "SPECTRA", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing found for Spectra/215")},
 
        { NULL, "", 0x0, UCHAR_MAX, 0x0, 0x0, 0x0, ""},
 
@@ -736,14 +728,14 @@ DumpSense(void)
        {
                if (pwork->sense == UCHAR_MAX)
                {
-                       printf("\n");
+                       g_printf("\n");
                } else {
-                       printf("%s %s %02X %02X %02X %d %s\n",pwork->ident, pwork->vendor,
+                       g_printf(_("%s %s %02X %02X %02X %d %s\n"),pwork->ident, pwork->vendor,
                                pwork->sense,
                                pwork->asc,
                                pwork->ascq,
                                pwork->ret,
-                               pwork->text);
+                               _(pwork->text));
                }
                pwork++;
        }
@@ -783,12 +775,12 @@ Sense2Action(
        SenseType_T *generic = NULL;
         int in = 0;
 
-       dbprintf(("Sense2Action START : type(%d), ignsense(%d), sense(%02X), asc(%02X), ascq(%02X)\n",
+       dbprintf(_("Sense2Action START : type(%d), ignsense(%d), sense(%02X), asc(%02X), ascq(%02X)\n"),
                type,
                ignsense,
                sense,
                asc,
-               ascq));
+               ascq);
 
        while (pwork->ident != NULL)
        {
@@ -803,7 +795,7 @@ Sense2Action(
                 } else {
                        if (in == 1)
                        {
-                               dbprintf(("Sense2Action       : no match\n"));
+                               dbprintf(_("Sense2Action       : no match\n"));
                                break;
                        }
                        pwork++;
@@ -816,9 +808,9 @@ Sense2Action(
                        if (pwork->sense == UCHAR_MAX)
                        {
                                *text = stralloc(pwork->text);
-                               dbprintf(("Sense2Action   END : no match for %s %s\n",
+                               dbprintf(_("Sense2Action   END : no match for %s %s\n"),
                                        pwork->ident,
-                                       pwork->vendor));
+                                       pwork->vendor);
                                return(pwork->ret);
                        }
 
@@ -827,11 +819,11 @@ Sense2Action(
                                if (pwork->asc ==  asc && pwork->ascq == ascq)
                                {
                                        *text = stralloc(pwork->text);
-                                       dbprintf(("Sense2Action END(IGN) : match for %s %s  return -> %d/%s\n",
+                                       dbprintf(_("Sense2Action END(IGN) : match for %s %s  return -> %d/%s\n"),
                                                pwork->ident,
                                                pwork->vendor,
                                                pwork->ret,
-                                               *text));
+                                               _(*text));
                                        return(pwork->ret);
                                }
                                pwork++;
@@ -844,11 +836,11 @@ Sense2Action(
                                if (pwork->asc ==  asc && pwork->ascq == ascq)
                                {
                                        *text = (char *)stralloc(pwork->text);
-                                       dbprintf(("Sense2Action   END : match for %s %s  return -> %d/%s\n",
+                                       dbprintf(_("Sense2Action   END : match for %s %s  return -> %d/%s\n"),
                                                pwork->ident,
                                                pwork->vendor,
                                                pwork->ret,
-                                               *text));
+                                               _(*text));
                                        return(pwork->ret);
                                }
 
@@ -858,11 +850,11 @@ Sense2Action(
                                if (    pwork->asc == UCHAR_MAX && pwork->ascq == UCHAR_MAX)
                                {
                                        *text = (char *)stralloc(pwork->text);
-                                       dbprintf(("Sense2Action   END : no match for %s %s  return -> %d/%s\n",
+                                       dbprintf(_("Sense2Action   END : no match for %s %s  return -> %d/%s\n"),
                                                pwork->ident,
                                                pwork->vendor,
                                                pwork->ret,
-                                               *text));
+                                               _(*text));
                                        return(pwork->ret);
                                }
                        }
@@ -873,7 +865,7 @@ Sense2Action(
        /*
         * Ok no match found, so lets return the values from the generic table
         */
-       dbprintf(("Sense2Action generic start :\n"));
+       dbprintf(_("Sense2Action generic start :\n"));
        while (generic != NULL) {
                if (generic->ident == NULL)
                   break;
@@ -881,11 +873,11 @@ Sense2Action(
                if (generic->sense == UCHAR_MAX)
                {
                        *text = (char *)stralloc(generic->text);
-                       dbprintf(("Sense2Action generic END : match for %s %s  return -> %d/%s\n",
+                       dbprintf(_("Sense2Action generic END : match for %s %s  return -> %d/%s\n"),
                                generic->ident,
                                generic->vendor,
                                generic->ret,
-                               *text));
+                               _(*text));
                        return(generic->ret);
                }
 
@@ -894,11 +886,11 @@ Sense2Action(
                        if (generic->asc ==  asc && generic->ascq == ascq)
                        {
                                *text = (char *)stralloc(generic->text);
-                               dbprintf(("Sense2Action generic END(IGN) : match for %s %s  return -> %d/%s\n",
+                               dbprintf(_("Sense2Action generic END(IGN) : match for %s %s  return -> %d/%s\n"),
                                        generic->ident,
                                        generic->vendor,
                                        generic->ret,
-                                       *text));
+                                       _(*text));
                                return(generic->ret);
                        }
                        generic++;
@@ -911,11 +903,11 @@ Sense2Action(
                        if (generic->asc ==  asc && generic->ascq == ascq)
                        {
                                *text = (char *)stralloc(generic->text);
-                               dbprintf(("Sense2Action generic END : match for %s %s  return -> %d/%s\n",
+                               dbprintf(_("Sense2Action generic END : match for %s %s  return -> %d/%s\n"),
                                        generic->ident,
                                        generic->vendor,
                                        generic->ret,
-                                       *text));
+                                       _(*text));
                                return(generic->ret);
                        }
 
@@ -925,11 +917,11 @@ Sense2Action(
                        if (    generic->asc == UCHAR_MAX && generic->ascq == UCHAR_MAX)
                        {
                                *text = (char *)stralloc(generic->text);
-                               dbprintf(("Sense2Action generic END : no match for %s %s  return -> %d/%s\n",
+                               dbprintf(_("Sense2Action generic END : no match for %s %s  return -> %d/%s\n"),
                                        generic->ident,
                                        generic->vendor,
                                        generic->ret,
-                                       *text));
+                                       _(*text));
                                return(generic->ret);
                        }
                        generic++;
@@ -938,7 +930,7 @@ Sense2Action(
                generic++;
        }
 
-       dbprintf(("Sense2Action END:\n"));
+       dbprintf(_("Sense2Action END:\n"));
        *text = (char *)stralloc("No match found");
        return(SENSE_ABORT);
 }
index 2aa6d4749580773762655e9df2be1c0e9acafe59..fa768ce5dded07f8b5f12c5ad661449b2950b99c 100644 (file)
@@ -1,35 +1,42 @@
 # Makefile for Amanda client programs.
 
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/amandad-src  \
                -I$(top_srcdir)/gnulib
 
-LINT=@AMLINT@
-LINTFLAGS=@AMLINTFLAGS@
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 
-lib_LTLIBRARIES =      libamclient.la
-LIB_EXTENSION = la
+LINT=$(AMLINT)
+LINTFLAGS=$(AMLINTFLAGS)
 
-libexec_PROGRAMS =     noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize versionsuffix
+amlib_LTLIBRARIES =    libamclient.la
 
-sbin_SCRIPTS =         @CLIENT_SCRIPTS_OPT@
+amlibexec_PROGRAMS =   noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize versionsuffix
 
-libexec_SCRIPTS =      patch-system
+sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@
+EXTRA_SCRIPTS =        amhpfixdevs amsinixfixdevs
 
-if WANT_SAMBA
-samba_sources = findpass.c
-endif
+amlibexec_SCRIPTS = patch-system
 
-if WANT_RUNTIME_PSEUDO_RELOC
-AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
-endif
+CHECK_PERL = $(sbin_SCRIPTS)
+SCRIPTS_PERL = $(CHECK_PERL)
+SCRIPTS_SHELL = $(amlibexec_SCRIPTS)
 
 libamclient_la_SOURCES=        amandates.c             getfsent.c      \
-                       unctime.c               client_util.c   \
-                       $(samba_sources)
+                       unctime.c               client_util.c
+if WANT_SAMBA
+libamclient_la_SOURCES += findpass.c
+endif
 
 libamclient_la_LDFLAGS = -release $(VERSION)
+libamclient_la_LIBADD  = ../common-src/libamanda.la
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -38,35 +45,19 @@ libamclient_la_LDFLAGS = -release $(VERSION)
 # routines, and second to pick up any references in the other libraries.
 ###
 
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
-
-SUFFIXES =             .sh .pl
-
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
-
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+LDADD = ../common-src/libamanda.la \
+       libamclient.la \
+       ../amandad-src/libamandad.la \
+       ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 
 # these are used for testing only:
 TEST_PROGS = getfsent
 
 EXTRA_PROGRAMS =       $(TEST_PROGS)
 
-CLEANFILES = *.test.c patch-system
+CLEANFILES += *.test.c
 
-EXTRA_SCRIPTS =                amhpfixdevs             amsinixfixdevs
-
-DISTCLEANFILES =       $(EXTRA_SCRIPTS)
-
-EXTRA_DIST =           amhpfixdevs.sh          amsinixfixdevs.sh
 
 sendbackup_SOURCES =   sendbackup.c            sendbackup.h      \
                        sendbackup-dump.c       sendbackup-gnutar.c
@@ -74,45 +65,25 @@ sendbackup_SOURCES =        sendbackup.c            sendbackup.h      \
 noinst_HEADERS =       amandates.h     getfsent.h      \
                        findpass.h      client_util.h
                        
+INSTALLPERMS_exec = chown=amanda \
+       dest=$(amlibexecdir) $(amlibexec_PROGRAMS)
+
+INSTALLPERMS_data = chown=amanda \
+       dest=$(sbindir) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) $(amlibexec_SCRIPTS)
 
-install-exec-hook:
-       @list="$(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
 if WANT_SETUID_CLIENT
-       @list="calcsize killpgrp rundump runtar"; \
-       for p in $$list; do \
-               if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-                       pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-                       echo chown root $$pa; \
-                       chown root $$pa; \
-                       echo chmod u+s,o-rwx $$pa; \
-                       chmod u+s,o-rwx $$pa; \
-               else true; \
-               fi; \
-       done
+INSTALLPERMS_exec += dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \
+               calcsize killpgrp rundump runtar
 endif
 
 lint:
-       @ for p in $(libexec_PROGRAMS); do                                      \
+       @ for p in $(amlibexec_PROGRAMS); do                                    \
                f="$$p.c $(libamclient_la_SOURCES)";                            \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index b797c1b0fed9b7d0796619af41356adeb56747ff..4864f2bf13c00b913a1e35798728bccf60214748 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda client programs.
 
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -42,171 +161,231 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-libexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+amlibexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \
        rundump$(EXEEXT) runtar$(EXEEXT) selfcheck$(EXEEXT) \
        sendbackup$(EXEEXT) sendsize$(EXEEXT) versionsuffix$(EXEEXT)
+@WANT_SAMBA_TRUE@am__append_1 = findpass.c
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
+@WANT_SETUID_CLIENT_TRUE@am__append_2 = dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \
+@WANT_SETUID_CLIENT_TRUE@              calcsize killpgrp rundump runtar
+
 subdir = client-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/patch-system.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = patch-system.sh
+CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \
-       "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libamclient_la_LIBADD =
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
+       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamclient_la_DEPENDENCIES = ../common-src/libamanda.la
 am__libamclient_la_SOURCES_DIST = amandates.c getfsent.c unctime.c \
        client_util.c findpass.c
 @WANT_SAMBA_TRUE@am__objects_1 = findpass.lo
 am_libamclient_la_OBJECTS = amandates.lo getfsent.lo unctime.lo \
        client_util.lo $(am__objects_1)
 libamclient_la_OBJECTS = $(am_libamclient_la_OBJECTS)
+libamclient_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamclient_la_LDFLAGS) $(LDFLAGS) -o $@
 am__EXEEXT_1 = getfsent$(EXEEXT)
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS)
+amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(amlibexec_PROGRAMS)
 calcsize_SOURCES = calcsize.c
 calcsize_OBJECTS = calcsize.$(OBJEXT)
 calcsize_LDADD = $(LDADD)
-calcsize_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+calcsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 am_getfsent_OBJECTS = getfsent.test.$(OBJEXT)
 getfsent_OBJECTS = $(am_getfsent_OBJECTS)
 getfsent_LDADD = $(LDADD)
-getfsent_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+getfsent_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 killpgrp_SOURCES = killpgrp.c
 killpgrp_OBJECTS = killpgrp.$(OBJEXT)
 killpgrp_LDADD = $(LDADD)
-killpgrp_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+killpgrp_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 noop_SOURCES = noop.c
 noop_OBJECTS = noop.$(OBJEXT)
 noop_LDADD = $(LDADD)
-noop_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+noop_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 rundump_SOURCES = rundump.c
 rundump_OBJECTS = rundump.$(OBJEXT)
 rundump_LDADD = $(LDADD)
-rundump_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+rundump_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 runtar_SOURCES = runtar.c
 runtar_OBJECTS = runtar.$(OBJEXT)
 runtar_LDADD = $(LDADD)
-runtar_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+runtar_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 selfcheck_SOURCES = selfcheck.c
 selfcheck_OBJECTS = selfcheck.$(OBJEXT)
 selfcheck_LDADD = $(LDADD)
-selfcheck_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+selfcheck_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 am_sendbackup_OBJECTS = sendbackup.$(OBJEXT) sendbackup-dump.$(OBJEXT) \
        sendbackup-gnutar.$(OBJEXT)
 sendbackup_OBJECTS = $(am_sendbackup_OBJECTS)
 sendbackup_LDADD = $(LDADD)
-sendbackup_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+sendbackup_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 sendsize_SOURCES = sendsize.c
 sendsize_OBJECTS = sendsize.$(OBJEXT)
 sendsize_LDADD = $(LDADD)
-sendsize_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+sendsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 versionsuffix_SOURCES = versionsuffix.c
 versionsuffix_OBJECTS = versionsuffix.$(OBJEXT)
 versionsuffix_LDADD = $(LDADD)
-versionsuffix_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
-libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+versionsuffix_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
+       ../amandad-src/libamandad.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
+amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(libexec_SCRIPTS) $(sbin_SCRIPTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libamclient_la_SOURCES) calcsize.c $(getfsent_SOURCES) \
        killpgrp.c noop.c rundump.c runtar.c selfcheck.c \
        $(sendbackup_SOURCES) sendsize.c versionsuffix.c
@@ -217,15 +396,14 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -233,14 +411,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -251,20 +434,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -278,60 +460,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -341,10 +632,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -355,24 +660,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -384,59 +723,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -445,43 +771,70 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = 
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log *.test.c
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/amandad-src  \
                -I$(top_srcdir)/gnulib
 
-LINT = @AMLINT@
-LINTFLAGS = @AMLINTFLAGS@
-lib_LTLIBRARIES = libamclient.la
-LIB_EXTENSION = la
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+LINT = $(AMLINT)
+LINTFLAGS = $(AMLINTFLAGS)
+amlib_LTLIBRARIES = libamclient.la
 sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@
-libexec_SCRIPTS = patch-system
-@WANT_SAMBA_TRUE@samba_sources = findpass.c
-@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
-libamclient_la_SOURCES = amandates.c           getfsent.c      \
-                       unctime.c               client_util.c   \
-                       $(samba_sources)
-
+EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs
+amlibexec_SCRIPTS = patch-system
+CHECK_PERL = $(sbin_SCRIPTS)
+SCRIPTS_PERL = $(CHECK_PERL)
+SCRIPTS_SHELL = $(amlibexec_SCRIPTS)
+libamclient_la_SOURCES = amandates.c getfsent.c unctime.c \
+       client_util.c $(am__append_1)
 libamclient_la_LDFLAGS = -release $(VERSION)
+libamclient_la_LIBADD = ../common-src/libamanda.la
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -489,32 +842,34 @@ libamclient_la_LDFLAGS = -release $(VERSION)
 # need to list libamanda twice here, first to override the system library
 # routines, and second to pick up any references in the other libraries.
 ###
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamclient.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+LDADD = ../common-src/libamanda.la \
+       libamclient.la \
+       ../amandad-src/libamandad.la \
+       ../common-src/libamanda.la \
+       ../gnulib/libgnu.la
 
-SUFFIXES = .sh .pl
 
 # these are used for testing only:
 TEST_PROGS = getfsent
-CLEANFILES = *.test.c patch-system
-EXTRA_SCRIPTS = amhpfixdevs            amsinixfixdevs
-DISTCLEANFILES = $(EXTRA_SCRIPTS)
-EXTRA_DIST = amhpfixdevs.sh            amsinixfixdevs.sh
 sendbackup_SOURCES = sendbackup.c              sendbackup.h      \
                        sendbackup-dump.c       sendbackup-gnutar.c
 
 noinst_HEADERS = amandates.h   getfsent.h      \
                        findpass.h      client_util.h
 
+INSTALLPERMS_exec = chown=amanda dest=$(amlibexecdir) \
+       $(amlibexec_PROGRAMS) $(am__append_2)
+INSTALLPERMS_data = chown=amanda \
+       dest=$(sbindir) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) $(amlibexec_SCRIPTS)
+
 getfsent_SOURCES = getfsent.test.c
-all: all-am
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sh .pl .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -543,117 +898,115 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-patch-system.sh: $(top_builddir)/config.status $(srcdir)/patch-system.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 libamclient.la: $(libamclient_la_OBJECTS) $(libamclient_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(libamclient_la_LDFLAGS) $(libamclient_la_OBJECTS) $(libamclient_la_LIBADD) $(LIBS)
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
+       $(libamclient_la_LINK) -rpath $(amlibdir) $(libamclient_la_OBJECTS) $(libamclient_la_LIBADD) $(LIBS)
+install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
             || test -f $$p1 \
          ; then \
            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \
          else :; fi; \
        done
 
-uninstall-libexecPROGRAMS:
+uninstall-amlibexecPROGRAMS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
-clean-libexecPROGRAMS:
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+clean-amlibexecPROGRAMS:
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          echo " rm -f $$p $$f"; \
          rm -f $$p $$f ; \
        done
 calcsize$(EXEEXT): $(calcsize_OBJECTS) $(calcsize_DEPENDENCIES) 
        @rm -f calcsize$(EXEEXT)
-       $(LINK) $(calcsize_LDFLAGS) $(calcsize_OBJECTS) $(calcsize_LDADD) $(LIBS)
+       $(LINK) $(calcsize_OBJECTS) $(calcsize_LDADD) $(LIBS)
 getfsent$(EXEEXT): $(getfsent_OBJECTS) $(getfsent_DEPENDENCIES) 
        @rm -f getfsent$(EXEEXT)
-       $(LINK) $(getfsent_LDFLAGS) $(getfsent_OBJECTS) $(getfsent_LDADD) $(LIBS)
+       $(LINK) $(getfsent_OBJECTS) $(getfsent_LDADD) $(LIBS)
 killpgrp$(EXEEXT): $(killpgrp_OBJECTS) $(killpgrp_DEPENDENCIES) 
        @rm -f killpgrp$(EXEEXT)
-       $(LINK) $(killpgrp_LDFLAGS) $(killpgrp_OBJECTS) $(killpgrp_LDADD) $(LIBS)
+       $(LINK) $(killpgrp_OBJECTS) $(killpgrp_LDADD) $(LIBS)
 noop$(EXEEXT): $(noop_OBJECTS) $(noop_DEPENDENCIES) 
        @rm -f noop$(EXEEXT)
-       $(LINK) $(noop_LDFLAGS) $(noop_OBJECTS) $(noop_LDADD) $(LIBS)
+       $(LINK) $(noop_OBJECTS) $(noop_LDADD) $(LIBS)
 rundump$(EXEEXT): $(rundump_OBJECTS) $(rundump_DEPENDENCIES) 
        @rm -f rundump$(EXEEXT)
-       $(LINK) $(rundump_LDFLAGS) $(rundump_OBJECTS) $(rundump_LDADD) $(LIBS)
+       $(LINK) $(rundump_OBJECTS) $(rundump_LDADD) $(LIBS)
 runtar$(EXEEXT): $(runtar_OBJECTS) $(runtar_DEPENDENCIES) 
        @rm -f runtar$(EXEEXT)
-       $(LINK) $(runtar_LDFLAGS) $(runtar_OBJECTS) $(runtar_LDADD) $(LIBS)
+       $(LINK) $(runtar_OBJECTS) $(runtar_LDADD) $(LIBS)
 selfcheck$(EXEEXT): $(selfcheck_OBJECTS) $(selfcheck_DEPENDENCIES) 
        @rm -f selfcheck$(EXEEXT)
-       $(LINK) $(selfcheck_LDFLAGS) $(selfcheck_OBJECTS) $(selfcheck_LDADD) $(LIBS)
+       $(LINK) $(selfcheck_OBJECTS) $(selfcheck_LDADD) $(LIBS)
 sendbackup$(EXEEXT): $(sendbackup_OBJECTS) $(sendbackup_DEPENDENCIES) 
        @rm -f sendbackup$(EXEEXT)
-       $(LINK) $(sendbackup_LDFLAGS) $(sendbackup_OBJECTS) $(sendbackup_LDADD) $(LIBS)
+       $(LINK) $(sendbackup_OBJECTS) $(sendbackup_LDADD) $(LIBS)
 sendsize$(EXEEXT): $(sendsize_OBJECTS) $(sendsize_DEPENDENCIES) 
        @rm -f sendsize$(EXEEXT)
-       $(LINK) $(sendsize_LDFLAGS) $(sendsize_OBJECTS) $(sendsize_LDADD) $(LIBS)
+       $(LINK) $(sendsize_OBJECTS) $(sendsize_LDADD) $(LIBS)
 versionsuffix$(EXEEXT): $(versionsuffix_OBJECTS) $(versionsuffix_DEPENDENCIES) 
        @rm -f versionsuffix$(EXEEXT)
-       $(LINK) $(versionsuffix_LDFLAGS) $(versionsuffix_OBJECTS) $(versionsuffix_LDADD) $(LIBS)
-install-libexecSCRIPTS: $(libexec_SCRIPTS)
+       $(LINK) $(versionsuffix_OBJECTS) $(versionsuffix_LDADD) $(LIBS)
+install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_SCRIPTS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
            f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-           echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-           $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \
+           echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+           $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libexecSCRIPTS:
+uninstall-amlibexecSCRIPTS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_SCRIPTS)'; for p in $$list; do \
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
@@ -696,22 +1049,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versionsuffix.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -722,10 +1075,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -775,22 +1124,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -801,14 +1149,20 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -823,6 +1177,7 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -834,16 +1189,20 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
+clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
        clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -855,17 +1214,27 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
-install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS \
-       install-libexecSCRIPTS install-sbinSCRIPTS
+install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \
+       install-sbinSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -886,72 +1255,167 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \
-       uninstall-sbinSCRIPTS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool ctags \
-       distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-exec install-exec-am install-exec-hook \
-       install-info install-info-am install-libLTLIBRARIES \
-       install-libexecPROGRAMS install-libexecSCRIPTS install-man \
-       install-sbinSCRIPTS install-strip installcheck installcheck-am \
-       installdirs maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-       uninstall-am uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \
-       uninstall-sbinSCRIPTS
-
-
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
-
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
-
-install-exec-hook:
-       @list="$(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-@WANT_SETUID_CLIENT_TRUE@      @list="calcsize killpgrp rundump runtar"; \
-@WANT_SETUID_CLIENT_TRUE@      for p in $$list; do \
-@WANT_SETUID_CLIENT_TRUE@              if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-@WANT_SETUID_CLIENT_TRUE@                      pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
-@WANT_SETUID_CLIENT_TRUE@                      echo chown root $$pa; \
-@WANT_SETUID_CLIENT_TRUE@                      chown root $$pa; \
-@WANT_SETUID_CLIENT_TRUE@                      echo chmod u+s,o-rwx $$pa; \
-@WANT_SETUID_CLIENT_TRUE@                      chmod u+s,o-rwx $$pa; \
-@WANT_SETUID_CLIENT_TRUE@              else true; \
-@WANT_SETUID_CLIENT_TRUE@              fi; \
-@WANT_SETUID_CLIENT_TRUE@      done
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
+       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+       clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
+       clean-libtool ctags dist-hook distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-amlibLTLIBRARIES install-amlibexecPROGRAMS \
+       install-amlibexecSCRIPTS install-data install-data-am \
+       install-data-hook install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
+       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 lint:
-       @ for p in $(libexec_PROGRAMS); do                                      \
+       @ for p in $(amlibexec_PROGRAMS); do                                    \
                f="$$p.c $(libamclient_la_SOURCES)";                            \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index b800520b873766b9b6747a1aaa7f4fa7300e9797..abbef3626c19d5a40deb41586cc20733b0b0f63d 100644 (file)
@@ -102,7 +102,7 @@ start_amandates(
        rc = amroflock(fileno(amdf), amandates_file);
 
     if(rc == -1) {
-       error("could not lock %s: %s", amandates_file, strerror(errno));
+       error(_("could not lock %s: %s"), amandates_file, strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -137,7 +137,7 @@ start_amandates(
     }
 
     if(ferror(amdf)) {
-       error("reading %s: %s", amandates_file, strerror(errno));
+       error(_("reading %s: %s"), amandates_file, strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -157,7 +157,7 @@ finish_amandates(void)
 
     if(updated) {
        if(readonly) {
-           error("updated amandates after opening readonly");
+           error(_("updated amandates after opening readonly"));
            /*NOTREACHED*/
        }
 
@@ -166,7 +166,7 @@ finish_amandates(void)
            for(level = 0; level < DUMP_LEVELS; level++) {
                if(amdp->dates[level] == EPOCH) continue;
                qname = quote_string(amdp->name);
-               fprintf(amdf, "%s %d %ld\n",
+               g_fprintf(amdf, "%s %d %ld\n",
                        qname, level, (long) amdp->dates[level]);
                amfree(qname);
            }
@@ -174,11 +174,11 @@ finish_amandates(void)
     }
 
     if(amfunlock(fileno(amdf), g_amandates_file) == -1) {
-       error("could not unlock %s: %s", g_amandates_file, strerror(errno));
+       error(_("could not unlock %s: %s"), g_amandates_file, strerror(errno));
        /*NOTREACHED*/
     }
     if (fclose(amdf) == EOF) {
-       error("error [closing %s: %s]", g_amandates_file, strerror(errno));
+       error(_("error [closing %s: %s]"), g_amandates_file, strerror(errno));
        /*NOTREACHED*/
     }
     amdf = NULL;
@@ -258,8 +258,8 @@ enter_record(
     if(level < 0 || level >= DUMP_LEVELS || dumpdate < amdp->dates[level]) {
        qname = quote_string(name);
        /* this is not allowed, but we can ignore it */
-        dbprintf(("amandates botch: %s lev %d: new dumpdate %ld old %ld\n",
-                 qname, level, (long) dumpdate, (long) amdp->dates[level]));
+        dbprintf(_("amandates botch: %s lev %d: new dumpdate %ld old %ld\n"),
+                 qname, level, (long) dumpdate, (long) amdp->dates[level]);
        amfree(qname);
        return;
     }
@@ -284,8 +284,8 @@ amandates_updateone(
     if(level < 0 || level >= DUMP_LEVELS || dumpdate < amdp->dates[level]) {
        /* this is not allowed, but we can ignore it */
        qname = quote_string(name);
-       dbprintf(("amandates updateone: %s lev %d: new dumpdate %ld old %ld",
-                 name, level, (long) dumpdate, (long) amdp->dates[level]));
+       dbprintf(_("amandates updateone: %s lev %d: new dumpdate %ld old %ld"),
+                 name, level, (long) dumpdate, (long) amdp->dates[level]);
        amfree(qname);
        return;
     }
diff --git a/client-src/amhpfixdevs.sh b/client-src/amhpfixdevs.sh
deleted file mode 100644 (file)
index 172c503..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-
-eval '(exit $?0)' && eval 'exec perl -x -S $0 ${1+"$@"}'
-       & eval 'exec perl -x -S $0 $argv:q'
-               if 0;
-
-#!perl
-
-# Check whether we're on a HP-UX system.
-$uname=`uname`;
-chomp $uname;
-if ( $uname ne "HP-UX" ) {
-       print "Sorry, this script only works for HP-UX systems!\n";
-       exit 1;
-}
-
-# Check whether the user is root.
-$id=`id -un`;
-chomp $id;
-if ( $id ne "root" ) {
-       print "Sorry, this script needs to be run by the superuser!\n";
-       exit 1;
-}
-
-# Determine all volume groups and the logical volumes in these volume groups.
-print "\n\nScanning volume groups...\n";
-open(LV, "vgdisplay -v 2>/dev/null |") or
-  die "$0: unable to open vgdisplay pipe: $!\n";
-while ( <LV> ) {
-       if ( m!^(VG Name\s+/dev/)(.*)! ) {
-               print "\n" if $v;
-               $v = $2;
-               print "The volume group $v contains the following logical volumes:\n";
-       }
-       elsif ( m!(\s+LV Name\s+/dev/$v/)(.*)! ) {
-               print "\t$2\n";
-               $vg{$v} .= "$2 ";
-       }
-}
-close LV or
-  warn "$0: error in closing vgdisplay pipe: $!\n";
-
-# Now fix the device entries for all logical volumes.
-print "\n\nFixing device entries...\n";
-foreach $v ( keys(%vg) ) {
-       foreach $w ( split(/[\s]+/, $vg{$v} ) ) {
-               # First the link for the block device.
-               if ( ! -e "/dev/dsk/${v}_$w" ) {
-                       print "Creating link for /dev/dsk/${v}_$w...";
-                       if ( ! symlink("/dev/$v/$w", "/dev/dsk/${v}_$w") ) {
-                               print "FAILED\n";
-                               next;
-                       }
-                       print "done\n";
-               }
-
-               # Now the link for the raw devive.
-               if ( ! -e "/dev/rdsk/${v}_$w" ) {
-                       print "Creating link for /dev/rdsk/${v}_$w...";
-                       if ( ! symlink("/dev/$v/r$w", "/dev/rdsk/${v}_$w") ) {
-                               print "FAILED\n";
-                               next;
-                       }
-                       print "done\n";
-               }
-       }
-}
diff --git a/client-src/amsinixfixdevs.sh b/client-src/amsinixfixdevs.sh
deleted file mode 100644 (file)
index b4c5a47..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-
-eval '(exit $?0)' && eval 'exec perl -x -S $0 ${1+"$@"}'
-       & eval 'exec perl -x -S $0 $argv:q'
-               if 0;
-
-#!perl
-
-# Check whether we're on a SINIX system.
-$uname=`uname`;
-chomp $uname;
-if ( $uname !~ /SINIX/ ) {
-  die("Sorry, this script only works for SINIX systems!\n");
-}
-
-# Check whether the user is root.
-$id=`id -un`;
-chomp $id;
-if ( $id ne "root" ) {
-  die("Sorry, this script needs to be run by the superuser!\n");
-}
-
-# Determine all filesystems currently mounted.
-print "\nDetermining all filesystems currently mounted...\n";
-open(VD, "/usr/bin/mount -p 2>/dev/null |") or
-  die("$0: unable to open mount pipe: $!\n");
-while ( <VD> ) {
-  if ( m!^(/dev/\S*)\s+-\s+(\S+)\s+(vxfs|ufs)\s+! ) {
-    $v = $1;
-    print "Found filesystem $v\n";
-    $vd{$v}++;
-  }
-}
-close VD or
-  warn "$0: error in closing mount pipe: $!\n";
-
-# Determine all virtual disks.
-undef($v);
-print "\nDetermining all virtual disks...\n";
-open(VD, "/sbin/dkconfig -lA 2>/dev/null |") or
-  die("$0: unable to open dkconfig pipe: $!\n");
-while ( <VD> ) {
-  if ( m!^(/dev/\S*):\s+\d+\s+blocks! ) {
-    $v = $1;
-    print "Found virtual disk $v\n";
-    $vd{$v}++;
-  }
-}
-close VD or
-  warn "$0: error in closing dkconfig pipe: $!\n";
-
-# Check whether our target directories are present.
-foreach $d ( "/dev/dsk", "/dev/rdsk" ) {
-  if ( ! -x $d ) {
-    if ( ! mkdir($d, 0755) ) {
-      die("Failed to create directory $d!\n");
-    }
-  }
-}
-
-# Now fix the device entries for all virtual disks.
-print "\nFixing device entries...\n";
-foreach $v ( keys(%vd) ) {
-  # determine the basename of the device
-  ( $name ) = $v =~ m!^/dev/(.+)$!;
-  if ( $name =~ m!/! ) {
-    ( $p, $dev_orig ) = $name =~ m!(.*/)(.*)!;
-  }
-  else {
-    $p = "";
-    $dev_orig = $name;
-  }
-
-  # replace all slashes with _'s
-  $dev_new = $name;
-  $dev_new =~ s!/!_!g;
-
-  # First the link for the block device.
-  if ( ! -e "/dev/dsk/$dev_new" ) {
-    print "Creating link for /dev/dsk/$dev_new...";
-    if ( ! symlink($v, "/dev/dsk/$dev_new") ) {
-      print "FAILED\n";
-      next;
-    }
-    print "done\n";
-  }
-
-  # Now the link for the raw devive.
-  if ( ! -e "/dev/rdsk/$dev_new" ) {
-    print "Creating link for /dev/rdsk/$dev_new...";
-    if ( ! symlink("/dev/${p}r$dev_orig", "/dev/rdsk/$dev_new") ) {
-      print "FAILED\n";
-      next;
-    }
-    print "done\n";
-  }
-}
index 7d8ad04f0fa276b1ebf9ffd16c57a714f99453b5..1336d8d1e553c0296d04c3ec04444d9da719c3ab 100644 (file)
@@ -32,7 +32,7 @@
  * argv[1] is the config name or NOCONFIG
  */
 #include "amanda.h"
-#include "statfs.h"
+#include "fsusage.h"
 #include "version.h"
 #include "sl.h"
 #include "util.h"
@@ -128,6 +128,15 @@ main(
     char *d;
     int l, w;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
 
     set_pname("calcsize");
@@ -138,29 +147,34 @@ main(
     signal(SIGPIPE, SIG_IGN);
 
     if (argc < 2) {
-       fprintf(stderr,"Usage: %s file[s]\n",argv[0]);
+       g_fprintf(stderr,_("Usage: %s file[s]\n"),argv[0]);
        return 1;
     }
     for(i=1; i<argc; i++) {
        if(lstat(argv[i], &finfo) == -1) {
-           fprintf(stderr, "%s: %s\n", argv[i], strerror(errno));
+           g_fprintf(stderr, "%s: %s\n", argv[i], strerror(errno));
            continue;
        }
-       printf("%s: st_size=%lu", argv[i],(unsigned long)finfo.st_size);
-       printf(": blocks=%llu\n", ST_BLOCKS(finfo));
+       g_printf("%s: st_size=%lu", argv[i],(unsigned long)finfo.st_size);
+       g_printf(": blocks=%llu\n", ST_BLOCKS(finfo));
        dump_total += (ST_BLOCKS(finfo) + (off_t)1) / (off_t)2 + (off_t)1;
        gtar_total += ROUND(4,(ST_BLOCKS(finfo) + (off_t)1));
     }
-    printf("           gtar           dump\n");
-    printf("total      %-9lu         %-9lu\n",gtar_total,dump_total);
+    g_printf("           gtar           dump\n");
+    g_printf("total      %-9lu         %-9lu\n",gtar_total,dump_total);
     return 0;
 #else
     int i;
     char *dirname=NULL;
     char *amname=NULL, *qamname=NULL;
     char *filename=NULL, *qfilename = NULL;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
+
+    /* drop root privileges; we'll regain them for the required operations */
+#ifdef WANT_SETUID_CLIENT
+    if (!set_root_privs(0)) {
+       error(_("calcsize must be run setuid root"));
+    }
+#endif
 
     safe_fd(-1, 0);
     safe_cd();
@@ -168,9 +182,7 @@ main(
     set_pname("calcsize");
 
     dbopen(DBG_SUBDIR_CLIENT);
-    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
-
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+    dbprintf(_("version %s\n"), version());
 
 #if 0
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
@@ -181,18 +193,20 @@ main(
     /* need at least program, amname, and directory name */
 
     if(argc < 4) {
-       error("Usage: %s config [DUMP|GNUTAR] name dir [-X exclude-file] [-I include-file] [level date]*",
+       error(_("Usage: %s config [DUMP|STAR|GNUTAR] name dir [-X exclude-file] [-I include-file] [level date]*"),
              get_pname());
         /*NOTREACHED*/
     }
 
-    dbprintf(("config: %s\n", *argv));
+    dbprintf(_("config: %s\n"), *argv);
     if (strcmp(*argv, "NOCONFIG") != 0) {
        dbrename(*argv, DBG_SUBDIR_CLIENT);
     }
     argc--;
     argv++;
 
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
+
     /* parse backup program name */
 
     if(strcmp(*argv, "DUMP") == 0) {
@@ -254,12 +268,12 @@ main(
        filename = stralloc(*argv);
        qfilename = quote_string(filename);
        if (access(filename, R_OK) != 0) {
-           fprintf(stderr,"Cannot open exclude file %s\n", qfilename);
+           g_fprintf(stderr,"Cannot open exclude file %s\n", qfilename);
            use_gtar_excl = use_star_excl = 0;
        } else {
            exclude_sl = calc_load_file(filename);
            if (!exclude_sl) {
-               fprintf(stderr,"Cannot open exclude file %s: %s\n", qfilename,
+               g_fprintf(stderr,"Cannot open exclude file %s: %s\n", qfilename,
                        strerror(errno));
                use_gtar_excl = use_star_excl = 0;
            }
@@ -278,12 +292,12 @@ main(
        filename = stralloc(*argv);
        qfilename = quote_string(filename);
        if (access(filename, R_OK) != 0) {
-           fprintf(stderr,"Cannot open include file %s\n", qfilename);
+           g_fprintf(stderr,"Cannot open include file %s\n", qfilename);
            use_gtar_excl = use_star_excl = 0;
        } else {
            include_sl = calc_load_file(filename);
            if (!include_sl) {
-               fprintf(stderr,"Cannot open include file %s: %s\n", qfilename,
+               g_fprintf(stderr,"Cannot open include file %s: %s\n", qfilename,
                        strerror(errno));
                use_gtar_excl = use_star_excl = 0;
            }
@@ -330,22 +344,17 @@ main(
 
        amflock(1, "size");
 
-       dbprintf(("calcsize: %s %d SIZE " OFF_T_FMT "\n",
+       dbprintf("calcsize: %s %d SIZE %lld\n",
               qamname, dumplevel[i],
-              (OFF_T_FMT_TYPE)final_size(i, dirname)));
-       fprintf(stderr, "%s %d SIZE " OFF_T_FMT "\n",
+              (long long)final_size(i, dirname));
+       g_fprintf(stderr, "%s %d SIZE %lld\n",
               qamname, dumplevel[i],
-              (OFF_T_FMT_TYPE)final_size(i, dirname));
+              (long long)final_size(i, dirname));
        fflush(stderr);
 
        amfunlock(1, "size");
     }
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
+    amfree(qamname);
 
     return 0;
 #endif
@@ -395,6 +404,8 @@ traverse_dirs(
     has_exclude = !is_empty_sl(exclude_sl) && (use_gtar_excl || use_star_excl);
     aparent = vstralloc(parent_dir, "/", include, NULL);
 
+    /* We (may) need root privs for the *stat() calls here. */
+    set_root_privs(1);
     if(stat(parent_dir, &finfo) != -1)
        parent_dev = finfo.st_dev;
 
@@ -428,7 +439,7 @@ traverse_dirs(
 
            newname = newstralloc2(newname, newbase, f->d_name);
            if(lstat(newname, &finfo) == -1) {
-               fprintf(stderr, "%s/%s: %s\n",
+               g_fprintf(stderr, "%s/%s: %s\n",
                        dirname, f->d_name, strerror(errno));
                continue;
            }
@@ -479,6 +490,10 @@ traverse_dirs(
            perror(dirname);
 #endif
     }
+
+    /* drop root privs -- we're done with the permission-sensitive calls */
+    set_root_privs(0);
+
     amfree(newbase);
     amfree(newname);
     amfree(aparent);
@@ -555,20 +570,20 @@ final_size_dump(
     int                level,
     char *     topdir)
 {
-    generic_fs_stats_t stats;
+    struct fs_usage fsusage;
     off_t mapsize;
     char *s;
 
     /* calculate the map sizes */
 
     s = stralloc2(topdir, "/.");
-    if(get_fs_stats(s, &stats) == -1) {
+    if(get_fs_usage(s, NULL, &fsusage) == -1) {
        error("statfs %s: %s", s, strerror(errno));
        /*NOTREACHED*/
     }
     amfree(s);
 
-    mapsize = (stats.files + (off_t)7) / (off_t)8;    /* in bytes */
+    mapsize = (fsusage.fsu_files + (off_t)7) / (off_t)8;    /* in bytes */
     mapsize = (mapsize + (off_t)1023) / (off_t)1024;  /* in kbytes */
 
     /* the dump contains three maps plus the files */
index bba8b184b5b5103cae0958dd9f6656b7eeef565b..7765532e1e0dd525729736246d271d767a574df9 100644 (file)
@@ -33,6 +33,7 @@
 #include "client_util.h"
 #include "getfsent.h"
 #include "util.h"
+#include "timestamp.h"
 #include "pipespawn.h"
 
 #define MAXMAXDUMPS 16
@@ -72,11 +73,11 @@ get_name(
     char *filename;
     char *ts;
 
-    ts = construct_timestamp(&t);
+    ts = get_timestamp_from_time(t);
     if(n == 0)
        number[0] = '\0';
     else
-       snprintf(number, SIZEOF(number), "%03d", n - 1);
+       g_snprintf(number, SIZEOF(number), "%03d", n - 1);
        
     filename = vstralloc(get_pname(), ".", diskname, ".", ts, number, ".",
                         exin, NULL);
@@ -110,7 +111,7 @@ build_name(
 
     dbgdir = stralloc2(AMANDA_TMPDIR, "/");
     if((d = opendir(AMANDA_TMPDIR)) == NULL) {
-       error("open debug directory \"%s\": %s",
+       error(_("open debug directory \"%s\": %s"),
                AMANDA_TMPDIR, strerror(errno));
        /*NOTREACHED*/
     }
@@ -154,10 +155,9 @@ build_name(
        filename = get_name(diskname, exin, curtime, 0);
        afilename = newvstralloc(afilename, dbgdir, filename, NULL);
        quoted = quote_string(afilename);
-       dbprintf(("%s: Cannot create %s (%s)\n",
-                       debug_prefix_time(NULL), quoted, strerror(errno)));
+       dbprintf(_("Cannot create %s (%s)\n"), quoted, strerror(errno));
        if(verbose) {
-           printf("ERROR [cannot create %s (%s)]\n",
+           g_printf(_("ERROR [cannot create %s (%s)]\n"),
                        quoted, strerror(errno));
        }
        amfree(quoted);
@@ -193,7 +193,7 @@ add_exclude(
        file[strlen(file) - 1] = '\0';
        file++;
     }
-    fprintf(file_exclude, "%s\n", file);
+    g_fprintf(file_exclude, "%s\n", file);
     amfree(quoted);
     return 1;
 }
@@ -219,10 +219,9 @@ add_include(
     }
     if (strncmp(ainc, "./", 2) != 0) {
         quoted = quote_string(ainc);
-        dbprintf(("%s: include must start with './' (%s)\n",
-                 debug_prefix_time(NULL), quoted));
+        dbprintf(_("include must start with './' (%s)\n"), quoted);
        if(verbose) {
-           printf("ERROR [include must start with './' (%s)]\n", quoted);
+           g_printf(_("ERROR [include must start with './' (%s)]\n"), quoted);
        }
        amfree(quoted);
     }
@@ -235,7 +234,7 @@ add_include(
                file[strlen(file) - 1] = '\0';
                file++;
            }
-           fprintf(file_include, "%s\n", file);
+           g_fprintf(file_include, "%s\n", file);
            amfree(quoted);
            nb_exp++;
        }
@@ -247,10 +246,9 @@ add_include(
            regex = glob_to_regex(incname);
            if((d = opendir(device)) == NULL) {
                quoted = quote_string(device);
-               dbprintf(("%s: Can't open disk %s\n",
-                     debug_prefix_time(NULL), quoted));
+               dbprintf(_("Can't open disk %s\n"), quoted);
                if(verbose) {
-                   printf("ERROR [Can't open disk %s]\n", quoted);
+                   g_printf(_("ERROR [Can't open disk %s]\n"), quoted);
                }
                amfree(quoted);
            }
@@ -266,7 +264,7 @@ add_include(
                            file[strlen(file) - 1] = '\0';
                            file++;
                        }
-                       fprintf(file_include, "%s\n", file);
+                       g_fprintf(file_include, "%s\n", file);
                        amfree(quoted);
                        amfree(incname);
                        nb_exp++;
@@ -329,12 +327,11 @@ build_exclude(
                    }
                    else {
                        quoted = quote_string(exclname);
-                       dbprintf(("%s: Can't open exclude file %s (%s)\n",
-                                 debug_prefix_time(NULL),
-                                 quoted, strerror(errno)));
+                       dbprintf(_("Can't open exclude file %s (%s)\n"),
+                                 quoted, strerror(errno));
                        if(verbose && (options->exclude_optional == 0 ||
                                       errno != ENOENT)) {
-                           printf("ERROR [Can't open exclude file %s (%s)]\n",
+                           g_printf(_("ERROR [Can't open exclude file %s (%s)]\n"),
                                   quoted, strerror(errno));
                        }
                        amfree(quoted);
@@ -346,11 +343,10 @@ build_exclude(
        }
        else {
            quoted = quote_string(filename);
-           dbprintf(("%s: Can't create exclude file %s (%s)\n",
-                     debug_prefix_time(NULL),
-                     quoted, strerror(errno)));
+           dbprintf(_("Can't create exclude file %s (%s)\n"),
+                     quoted, strerror(errno));
            if(verbose) {
-               printf("ERROR [Can't create exclude file %s (%s)]\n",
+               g_printf(_("ERROR [Can't create exclude file %s (%s)]\n"),
                        quoted, strerror(errno));
            }
            amfree(quoted);
@@ -412,11 +408,11 @@ build_include(
                    }
                    else {
                        quoted = quote_string(inclname);
-                       dbprintf(("%s: Can't open include file %s (%s)\n",
-                                 debug_prefix_time(NULL), quoted, strerror(errno)));
+                       dbprintf(_("Can't open include file %s (%s)\n"),
+                                 quoted, strerror(errno));
                        if(verbose && (options->include_optional == 0 ||
                                       errno != ENOENT)) {
-                           printf("ERROR [Can't open include file %s (%s)]\n",
+                           g_printf(_("ERROR [Can't open include file %s (%s)]\n"),
                                   quoted, strerror(errno));
                        }
                        amfree(quoted);
@@ -428,10 +424,10 @@ build_include(
        }
        else {
            quoted = quote_string(filename);
-           dbprintf(("%s: Can't create include file %s (%s)\n",
-                     debug_prefix_time(NULL), quoted, strerror(errno)));
+           dbprintf(_("Can't create include file %s (%s)\n"),
+                     quoted, strerror(errno));
            if(verbose) {
-               printf("ERROR [Can't create include file %s (%s)]\n",
+               g_printf(_("ERROR [Can't create include file %s (%s)]\n"),
                        quoted, strerror(errno));
            }
            amfree(quoted);
@@ -440,9 +436,9 @@ build_include(
        
     if(nb_exp == 0) {
        quoted = quote_string(disk);
-       dbprintf(("%s: No include for %s\n", debug_prefix_time(NULL), quoted));
+       dbprintf(_("No include for %s\n"), quoted);
        if(verbose && options->include_optional == 0) {
-           printf("ERROR [No include for %s]\n", quoted);
+           g_printf(_("ERROR [No include for %s]\n"), quoted);
        }
        amfree(quoted);
     }
@@ -460,6 +456,7 @@ init_options(
     options->srvcompprog = NULL;
     options->clntcompprog = NULL;
     options->encrypt = ENCRYPT_NONE;
+    options->kencrypt = 0;
     options->srv_encrypt = NULL;
     options->clnt_encrypt = NULL;
     options->srv_decrypt_opt = NULL;
@@ -505,10 +502,9 @@ parse_options(
           && BSTRNCMP(tok,"auth=") == 0) {
            if(options->auth != NULL) {
                quoted = quote_string(tok + 5);
-               dbprintf(("%s: multiple auth option %s\n",
-                         debug_prefix_time(NULL), quoted));
+               dbprintf(_("multiple auth option %s\n"), quoted);
                if(verbose) {
-                   printf("ERROR [multiple auth option %s]\n", quoted);
+                   g_printf(_("ERROR [multiple auth option %s]\n"), quoted);
                }
                amfree(quoted);
            }
@@ -517,10 +513,9 @@ parse_options(
        else if(am_has_feature(fs, fe_options_bsd_auth)
           && BSTRNCMP(tok, "bsd-auth") == 0) {
            if(options->auth != NULL) {
-               dbprintf(("%s: multiple auth option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple auth option\n"));
                if(verbose) {
-                   printf("ERROR [multiple auth option]\n");
+                   g_printf(_("ERROR [multiple auth option]\n"));
                }
            }
            options->auth = stralloc("bsd");
@@ -528,60 +523,54 @@ parse_options(
        else if(am_has_feature(fs, fe_options_krb4_auth)
           && BSTRNCMP(tok, "krb4-auth") == 0) {
            if(options->auth != NULL) {
-               dbprintf(("%s: multiple auth option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple auth option\n"));
                if(verbose) {
-                   printf("ERROR [multiple auth option]\n");
+                   g_printf(_("ERROR [multiple auth option]\n"));
                }
            }
            options->auth = stralloc("krb4");
        }
        else if(BSTRNCMP(tok, "compress-fast") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->compress = COMP_FAST;
        }
        else if(BSTRNCMP(tok, "compress-best") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->compress = COMP_BEST;
        }
        else if(BSTRNCMP(tok, "srvcomp-fast") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->compress = COMP_SERVER_FAST;
        }
        else if(BSTRNCMP(tok, "srvcomp-best") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->compress = COMP_SERVER_BEST;
        }
        else if(BSTRNCMP(tok, "srvcomp-cust=") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->srvcompprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1);
@@ -589,10 +578,9 @@ parse_options(
        }
        else if(BSTRNCMP(tok, "comp-cust=") == 0) {
            if(options->compress != COMP_NONE) {
-               dbprintf(("%s: multiple compress option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple compress option\n"));
                if(verbose) {
-                   printf("ERROR [multiple compress option]\n");
+                   g_printf(_("ERROR [multiple compress option]\n"));
                }
            }
            options->clntcompprog = stralloc(tok + SIZEOF("comp-cust=") -1);
@@ -601,10 +589,9 @@ parse_options(
        } 
        else if(BSTRNCMP(tok, "encrypt-serv-cust=") == 0) {
            if(options->encrypt != ENCRYPT_NONE) {
-               dbprintf(("%s: multiple encrypt option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple encrypt option\n"));
                if(verbose) {
-                   printf("ERROR [multiple encrypt option]\n");
+                   g_printf(_("ERROR [multiple encrypt option]\n"));
                }
            }
            options->srv_encrypt = stralloc(tok + SIZEOF("encrypt-serv-cust=") -1);
@@ -612,10 +599,9 @@ parse_options(
        } 
        else if(BSTRNCMP(tok, "encrypt-cust=") == 0) {
            if(options->encrypt != ENCRYPT_NONE) {
-               dbprintf(("%s: multiple encrypt option\n", 
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple encrypt option\n"));
                if(verbose) {
-                   printf("ERROR [multiple encrypt option]\n");
+                   g_printf(_("ERROR [multiple encrypt option]\n"));
                }
            }
            options->clnt_encrypt= stralloc(tok + SIZEOF("encrypt-cust=") -1);
@@ -629,40 +615,36 @@ parse_options(
        }
        else if(BSTRNCMP(tok, "no-record") == 0) {
            if(options->no_record != 0) {
-               dbprintf(("%s: multiple no-record option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple no-record option\n"));
                if(verbose) {
-                   printf("ERROR [multiple no-record option]\n");
+                   g_printf(_("ERROR [multiple no-record option]\n"));
                }
            }
            options->no_record = 1;
        }
        else if(BSTRNCMP(tok, "index") == 0) {
            if(options->createindex != 0) {
-               dbprintf(("%s: multiple index option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple index option\n"));
                if(verbose) {
-                   printf("ERROR [multiple index option]\n");
+                   g_printf(_("ERROR [multiple index option]\n"));
                }
            }
            options->createindex = 1;
        }
        else if(BSTRNCMP(tok, "exclude-optional") == 0) {
            if(options->exclude_optional != 0) {
-               dbprintf(("%s: multiple exclude-optional option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple exclude-optional option\n"));
                if(verbose) {
-                   printf("ERROR [multiple exclude-optional option]\n");
+                   g_printf(_("ERROR [multiple exclude-optional option]\n"));
                }
            }
            options->exclude_optional = 1;
        }
        else if(strcmp(tok, "include-optional") == 0) {
            if(options->include_optional != 0) {
-               dbprintf(("%s: multiple include-optional option\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("multiple include-optional option\n"));
                if(verbose) {
-                   printf("ERROR [multiple include-optional option]\n");
+                   g_printf(_("ERROR [multiple include-optional option]\n"));
                }
            }
            options->include_optional = 1;
@@ -687,12 +669,14 @@ parse_options(
            options->include_list = append_sl(options->include_list, inc);
            amfree(inc);
        }
+       else if(BSTRNCMP(tok,"kencrypt") == 0) {
+           options->kencrypt = 1;
+       }
        else if(strcmp(tok,"|") != 0) {
            quoted = quote_string(tok);
-           dbprintf(("%s: unknown option %s\n",
-                       debug_prefix_time(NULL), quoted));
+           dbprintf(_("unknown option %s\n"), quoted);
            if(verbose) {
-               printf("ERROR [unknown option: %s]\n", quoted);
+               g_printf(_("ERROR [unknown option: %s]\n"), quoted);
            }
            amfree(quoted);
        }
@@ -713,7 +697,7 @@ output_tool_property(
     if (!is_empty_sl(options->exclude_file)) {
        for(sle = options->exclude_file->first ; sle != NULL; sle=sle->next) {
            q = quote_string(sle->name);
-           fprintf(tool, "EXCLUDE-FILE %s\n", q);
+           g_fprintf(tool, "EXCLUDE-FILE %s\n", q);
            amfree(q);
        }
     }
@@ -721,7 +705,7 @@ output_tool_property(
     if (!is_empty_sl(options->exclude_list)) {
        for(sle = options->exclude_list->first ; sle != NULL; sle=sle->next) {
            q = quote_string(sle->name);
-           fprintf(tool, "EXCLUDE-LIST %s\n", q);
+           g_fprintf(tool, "EXCLUDE-LIST %s\n", q);
            amfree(q);
        }
     }
@@ -729,7 +713,7 @@ output_tool_property(
     if (!is_empty_sl(options->include_file)) {
        for(sle = options->include_file->first ; sle != NULL; sle=sle->next) {
            q = quote_string(sle->name);
-           fprintf(tool, "INCLUDE-FILE %s\n", q);
+           g_fprintf(tool, "INCLUDE-FILE %s\n", q);
            amfree(q);
        }
     }
@@ -737,7 +721,7 @@ output_tool_property(
     if (!is_empty_sl(options->include_list)) {
        for(sle = options->include_list->first ; sle != NULL; sle=sle->next) {
            q = quote_string(sle->name);
-           fprintf(tool, "INCLUDE-LIST %s\n", q);
+           g_fprintf(tool, "INCLUDE-LIST %s\n", q);
            amfree(q);
        }
     }
@@ -745,17 +729,17 @@ output_tool_property(
     if (!is_empty_sl(options->exclude_file) ||
        !is_empty_sl(options->exclude_list)) {
        if (options->exclude_optional)
-           fprintf(tool, "EXCLUDE-OPTIONAL YES\n");
+           g_fprintf(tool, "EXCLUDE-OPTIONAL YES\n");
        else
-           fprintf(tool, "EXCLUDE-OPTIONAL NO\n");
+           g_fprintf(tool, "EXCLUDE-OPTIONAL NO\n");
     }
 
     if (!is_empty_sl(options->include_file) ||
        !is_empty_sl(options->include_list)) {
        if (options->include_optional)
-           fprintf(tool, "INCLUDE-OPTIONAL YES\n");
+           g_fprintf(tool, "INCLUDE-OPTIONAL YES\n");
        else
-           fprintf(tool, "INCLUDE-OPTIONAL NO\n");
+           g_fprintf(tool, "INCLUDE-OPTIONAL NO\n");
     }
 }
 
@@ -808,7 +792,7 @@ backup_support_option(
     memset(bsu, '\0', SIZEOF(*bsu));
     streamout = fdopen(supportout, "r");
     while((line = agets(streamout)) != NULL) {
-       dbprintf(("support line: %s\n", line));
+       dbprintf(_("support line: %s\n"), line);
        if (strncmp(line,"CONFIG ", 7) == 0) {
            if (strcmp(line+7, "YES") == 0)
                bsu->config = 1;
@@ -851,7 +835,7 @@ backup_support_option(
        } else if (strncmp(line,"MAX-LEVEL ", 10) == 0) {
            bsu->max_level  = atoi(line+10);
        } else {
-           dbprintf(("Invalid support line: %s\n", line));
+           dbprintf(_("Invalid support line: %s\n"), line);
        }
        amfree(line);
     }
index e3f4d7a55e40bf7026e6d3c6e07be973aa7a5e8c..b5ed362696bebe8ac1a5ce1cbd804e6b21a20f87 100644 (file)
@@ -57,6 +57,7 @@ typedef struct option_s {
     sl_t *include_list;
     int exclude_optional;
     int include_optional;
+    int kencrypt;
 } option_t;
 
 typedef struct backup_support_option_s {
index 03e68d8c3e23678e27681f3a1e48540b6383ba24..6f0f2752e46e3ace5e7a8a43fe0a909d2b5d8a1b 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "amanda.h"
+#include "util.h"
 
 #ifdef TEST
 #  include <stdio.h>
@@ -85,7 +86,7 @@ get_fstab_nextentry(
     fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_opts);
 #else
 #if defined(_AIX)
-    fsent->fstype  = xfstype  = newstralloc(xfstype,  "unknown");
+    fsent->fstype  = xfstype  = newstralloc(xfstype,  _("unknown"));
     fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_type);
 #else
     fsent->fstype  = xfstype  = newstralloc(xfstype,  sys_fsent->fs_vfstype);
@@ -433,7 +434,7 @@ dev2rdev(
   char *s;
   int ch;
 
-  if(stat(name, &st) == 0 && S_ISCHR(st.st_mode)) {
+  if(stat(name, &st) == 0 && !S_ISBLK(st.st_mode)) {
     /*
      * If the input is already a character device, just return it.
      */
@@ -538,9 +539,8 @@ search_fstab(
 
     amfree(rdev);
 
-    if(fsent->mntdir != NULL &&
-       (smnt = stat(fsent->mntdir, &mntstat)) == -1)
-      continue;
+    if(fsent->mntdir != NULL)
+       smnt = stat(fsent->mntdir, &mntstat);
 
     if(fsent->fsname != NULL) {
       sfs = stat(fsent->fsname, &fsstat);
@@ -634,7 +634,7 @@ print_entry(
     generic_fsent_t *  fsent)
 {
 #define nchk(s)        ((s)? (s) : "<NULL>")
-    printf("%-20.20s %-14.14s %-7.7s %4d %5d %s\n",
+    g_printf("%-20.20s %-14.14s %-7.7s %4d %5d %s\n",
           nchk(fsent->fsname), nchk(fsent->mntdir), nchk(fsent->fstype),
           fsent->freq, fsent->passno, nchk(fsent->mntopts));
 }
@@ -647,8 +647,15 @@ main(
     generic_fsent_t fsent;
     char *s;
     char *name = NULL;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -659,101 +666,93 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     if(!open_fstab()) {
-       fprintf(stderr, "getfsent_test: could not open fstab\n");
+       g_fprintf(stderr, _("getfsent_test: could not open fstab\n"));
        return 1;
     }
 
-    printf("getfsent (%s)\n",GETFSENT_TYPE);
-    printf("l/r fsname               mntdir         fstype  freq pass# mntopts\n");
+    g_printf("getfsent (%s)\n",GETFSENT_TYPE);
+    g_printf("l/r fsname               mntdir         fstype  freq pass# mntopts\n");
     while(get_fstab_nextentry(&fsent)) {
-       printf("%c  ",is_local_fstype(&fsent)? 'l' : 'r');
+       g_printf("%c  ",is_local_fstype(&fsent)? 'l' : 'r');
        print_entry(&fsent);
     }
-    printf("--------\n");
+    g_printf("--------\n");
 
     close_fstab();
 
     name = newstralloc(name, "/usr");
     if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) {
-       printf("Found %s mount for %s:\n",
-              is_local_fstype(&fsent)? "local" : "remote", name);
+       g_printf(_("Found %s mount for %s:\n"),
+              is_local_fstype(&fsent)? _("local") : _("remote"), name);
        print_entry(&fsent);
     }
     else 
-       printf("Mount for %s not found\n", name);
+       g_printf(_("Mount for %s not found\n"), name);
 
     name = newstralloc(name, "/");
     if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) {
-       printf("Found %s mount for %s:\n",
-              is_local_fstype(&fsent)? "local" : "remote", name);
+       g_printf(_("Found %s mount for %s:\n"),
+              is_local_fstype(&fsent)? _("local") : _("remote"), name);
        print_entry(&fsent);
     }
     else 
-       printf("Mount for %s not found\n", name);
+       g_printf(_("Mount for %s not found\n"), name);
 
     name = newstralloc(name, "/");
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
     name = newstralloc(name, "/dev/root");
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
     name = newstralloc(name, "/usr");
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
     name = newstralloc(name, "c0t3d0s0");
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
 
     name = newstralloc(name, "/tmp/foo");
     s = amname_to_devname(name);
-    printf("device of `%s': %s\n", name, s);
+    g_printf(_("device of `%s': %s\n"), name, s);
     amfree(s);
     s = amname_to_dirname(name);
-    printf("dirname of `%s': %s\n", name, s);
+    g_printf(_("dirname of `%s': %s\n"), name, s);
     amfree(s);
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
 
     name = newstralloc(name, "./foo");
     s = amname_to_devname(name);
-    printf("device of `%s': %s\n", name, s);
+    g_printf(_("device of `%s': %s\n"), name, s);
     amfree(s);
     s = amname_to_dirname(name);
-    printf("dirname of `%s': %s\n", name, s);
+    g_printf(_("dirname of `%s': %s\n"), name, s);
     amfree(s);
     s = amname_to_fstype(name);
-    printf("fstype of `%s': %s\n", name, s);
+    g_printf(_("fstype of `%s': %s\n"), name, s);
     amfree(s);
 
     while (--argc > 0) {
        name = newstralloc(name, *++argv);
        s = amname_to_devname(name);
-       printf("device of `%s': %s\n", name, s);
+       g_printf(_("device of `%s': %s\n"), name, s);
        amfree(s);
        s = amname_to_dirname(name);
-       printf("dirname of `%s': %s\n", name, s);
+       g_printf(_("dirname of `%s': %s\n"), name, s);
        amfree(s);
        s = amname_to_fstype(name);
-       printf("fstype of `%s': %s\n", name, s);
+       g_printf(_("fstype of `%s': %s\n"), name, s);
        amfree(s);
     }
 
     amfree(name);
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     return 0;
 }
 
index e2b983d7b89cb2bcfa784fb4af315ba854fc080d..d7472943dcc961b8437a7ce1faa7bebc0fb3c9b7 100644 (file)
@@ -35,6 +35,7 @@
  */
 #include "amanda.h"
 #include "version.h"
+#include "util.h"
 
 #ifdef HAVE_GETPGRP
 #ifdef GETPGRP_VOID
@@ -51,13 +52,24 @@ int main(int argc, char **argv);
 static void term_kill_soft(int sig);
 static void term_kill_hard(int sig);
 
-int main(
-    int argc,
-    char **argv)
+int
+main(
+    int                argc,
+    char **    argv)
 {
     int ch;
+    char *exitstr;
     amwait_t status;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
     safe_cd();
 
@@ -65,42 +77,32 @@ int main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 2) {
-       error("%s: Need at least 2 arguments\n", debug_prefix_time(NULL));
+       error("Need at least 2 arguments\n");
        /*NOTREACHED*/
     }
-    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
-    dbprintf(("config: %s\n", argv[1]));
+    dbprintf(_("version %s\n"), version());
+    dbprintf(_("config: %s\n"), argv[1]);
     if (strcmp(argv[1], "NOCONFIG") != 0)
        dbrename(argv[1], DBG_SUBDIR_CLIENT);
 
-    if(client_uid == (uid_t) -1) {
-       error("error [cannot find user %s in passwd file]", CLIENT_LOGIN);
-       /*NOTREACHED*/
-    }
-
-#ifdef FORCE_USERID
-    if (getuid() != client_uid) {
-       error("error [must be invoked by %s]", CLIENT_LOGIN);
-       /*NOTREACHED*/
-    }
-    if (geteuid() != 0) {
-       error("error [must be setuid root]");
+#ifdef WANT_SETUID_CLIENT
+    check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY);
+    if (!become_root()) {
+       error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname());
        /*NOTREACHED*/
     }
-#endif /* FORCE_USERID */
-
-#if !defined (DONT_SUID_ROOT)
-    setuid(0);
+#else
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 #endif
 
     if (AM_GETPGRP() != getpid()) {
-       error("error [must be the process group leader]");
+       error(_("error [must be the process group leader]"));
        /*NOTREACHED*/
     }
 
-    /* Consume any extranious input */
     signal(SIGTERM, term_kill_soft);
 
+    /* Consume any extranious input */
     do {
        ch = getchar();
        /* wait until EOF */
@@ -112,15 +114,16 @@ int main(
        if (wait(&status) != -1)
            break;
        if (errno != EINTR) {
-           error("error [wait() failed: %s]", strerror(errno));
+           error(_("error [wait() failed: %s]"), strerror(errno));
            /*NOTREACHED*/
        }
     }
+    exitstr = str_exit_status("child", status);
+    dbprintf("%s\n", exitstr);
+    amfree(exitstr);
 
     /*@ignore@*/
-    dbprintf(("child process exited with status %d\n", WEXITSTATUS(status)));
-
-    return WEXITSTATUS(status);
+    return WIFEXITED(status)?WEXITSTATUS(status):1;
     /*@end@*/
 }
 
@@ -139,10 +142,10 @@ static void term_kill_soft(
      * First, try to kill the dump process nicely.  If it ignores us
      * for three seconds, hit it harder.
      */
-    dbprintf(("sending SIGTERM to process group %ld\n", (long) dumppid));
+    dbprintf(_("sending SIGTERM to process group %ld\n"), (long) dumppid);
     killerr = kill(-dumppid, SIGTERM);
     if (killerr == -1) {
-       dbprintf(("kill failed: %s\n", strerror(errno)));
+       dbprintf(_("kill failed: %s\n"), strerror(errno));
     }
 }
 
@@ -154,12 +157,12 @@ static void term_kill_hard(
 
     (void)sig; /* Quiet unused parameter warning */
 
-    dbprintf(("it won\'t die with SIGTERM, but SIGKILL should do\n"));
-    dbprintf(("do\'t expect any further output, this will be suicide\n"));
+    dbprintf(_("It won\'t die with SIGTERM, but SIGKILL should do.\n"));
+    dbprintf(_("Don't expect any further output, this will be suicide.\n"));
     killerr = kill(-dumppid, SIGKILL);
     /* should never reach this point, but so what? */
     if (killerr == -1) {
-       dbprintf(("kill failed: %s\n", strerror(errno)));
-       dbprintf(("waiting until child terminates\n"));
+       dbprintf(_("kill failed: %s\n"), strerror(errno));
+       dbprintf(_("waiting until child terminates\n"));
     }
 }
index a0c4105abcf3e41c958f029a075e50078dc36123..fb3acbdd33d7e4f13b39ab3dddf8a4509e605521 100644 (file)
@@ -52,10 +52,22 @@ main(
     (void)argc;        /* Quiet unused parameter warning */
     (void)argv;        /* Quiet unused parameter warning */
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
     safe_fd(-1, 0);
+
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
+
     do {
        /* soak up any stdin */
        n = read(0, &ch, 1);
@@ -70,7 +82,7 @@ main(
     am_release_feature_set(our_features);
     our_features = NULL;
     if (fullwrite(1, options, strlen(options)) < 0) {
-       error("error sending noop response: %s", strerror(errno));
+       error(_("error sending noop response: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     amfree(options);
diff --git a/client-src/patch-system.sh b/client-src/patch-system.sh
new file mode 100644 (file)
index 0000000..fe7f634
--- /dev/null
@@ -0,0 +1,152 @@
+#! @SHELL@
+#
+# patch inetd.conf and services
+# originally by Axel Zinser (fifi@hiss.han.de)
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+SERVICE_SUFFIX="@SERVICE_SUFFIX@"
+
+USER="@CLIENT_LOGIN@"
+
+INETDCONF=/etc/inetd.conf
+[ ! -f $INETDCONF ] && INETDCONF=/usr/etc/inetd.conf
+
+SERVICES=/etc/services
+[ ! -f $SERVICES ] && SERVICES=/usr/etc/services
+
+ENABLE_AMANDAD=true
+
+case `uname -n` in
+"@DEFAULT_SERVER@" | "@DEFAULT_SERVER@".*)
+    ENABLE_INDEX=true
+    ENABLE_TAPE=true
+    ;;
+*)
+    ENABLE_INDEX=false
+    ENABLE_TAPE=false
+    ;;
+esac
+
+CLIENT_PORT=10080
+KCLIENT_PORT=10081
+INDEX_PORT=10082
+TAPE_PORT=10083
+
+while [ $# != 0 ]; do
+    case "$1" in
+    --service-suffix=*)
+       SERVICE_SUFFIX=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --version-suffix=*)
+       SUF=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --inetd=*)
+        INETDCONF=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;;
+    --services=*)
+       SERVICES=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;;
+    --libexecdir=?*)
+       libexecdir=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --user=?*)
+       USER=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --enable-client)
+       ENABLE_AMANDAD=true;;
+    --disable-client)
+       ENABLE_AMANDAD=false;;
+    --enable-index)
+       ENABLE_INDEX=true;;
+    --disable-index)
+       ENABLE_INDEX=false;;
+    --enable-tape)
+       ENABLE_TAPE=true;;
+    --disable-tape)
+       ENABLE_TAPE=false;;
+    --client-port=?*)
+       CLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --kclient-port=?*)
+       KCLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --index-port=?*)
+       INDEX_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --tape-port=?*)
+       TAPE_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
+    --usage | --help | -h)
+       echo `_ 'call this script with zero or more of the following arguments:'`
+       echo `_ '--version-suffix=<suffix>: append to program names [%s]' "$SUF"`
+       echo `_ '--service-suffix=<suffix>: append to service names [%s]' "$SERVICE_SUFFIX"`
+       echo `_ '--libexecdir=<dirname>: where daemons should be looked for [%s]' "$libexecdir"`
+       echo `_ '--inetd=<pathname>: full pathname of inetd.conf [%s]' "$INETDCONF"`
+       echo `_ '--services=<pathname>: full pathname of services [%s]' "$SERVICES"`
+       echo `_ '\tan empty pathname or /dev/null causes that file to be skipped'`
+       echo `_ '--user=<username>: run deamons as this user [%s]' "$USER"`
+       echo `_ '--enable/disable-client: enable/disable amandad [%s]' \`$ENABLE_AMANDAD && echo enabled || echo disabled\``
+       echo `_ '--enable/disable-index: enable/disable index server [%s]' \`$ENABLE_INDEX && echo enabled || echo disabled\``
+       echo `_ '--enable/disable-tape: enable/disable tape server [%s]' \`$ENABLE_TAPE && echo enabled || echo disabled\``
+       echo `_ '--client-port=<num>: amandad port number [%s]' "$CLIENT_PORT"`
+       echo `_ '--kclient-port=<num>: kamandad port number [%s]' "$KCLIENT_PORT"`
+       echo `_ '--index-port=<num>: index server port number [%s]' "$INDEX_PORT"`
+       echo `_ '--tape-port=<num>: tape server port number [%s]' "$TAPE_PORT"`
+       exec true;;
+    *)
+       echo `_ '%s: invalid argument %s.  run with -h for usage\n' "$0" "$1"` >&2
+       exec false;;
+    esac
+    shift
+done
+
+if [ "$SERVICES" = /dev/null ]; then :
+elif [ -f "$SERVICES" ]; then
+       TEMP="$SERVICES.new"
+       {
+           egrep < "$SERVICES" -v "^(amanda|kamanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[     ]"
+           echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/udp"
+           echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/tcp"
+           echo "kamanda${SERVICE_SUFFIX} ${KCLIENT_PORT}/udp"
+           echo "amandaidx${SERVICE_SUFFIX} ${INDEX_PORT}/tcp"
+           echo "amidxtape${SERVICE_SUFFIX} ${TAPE_PORT}/tcp"
+       } > "$TEMP"
+       if diff "$SERVICES" "$TEMP" >/dev/null 2>/dev/null; then
+               echo `_ '%s is up to date' "$SERVICES"`
+       else
+               cp "$TEMP" "$SERVICES" || echo `_ 'cannot patch %s' "$SERVICES"`
+       fi
+       rm -f "$TEMP"
+else
+       echo `_ '%s not found!' "$SERVICES"`
+fi
+if [ "$INETDCONF" = /dev/null ]; then :
+elif [ -f "$INETDCONF" ]; then
+       err=`_ 'warning: %s/amandad%s does not exist' "$libexecdir" "$SUF"`
+       $ENABLE_AMANDAD && test ! -f $libexecdir/amandad$SUF && echo "$err" >&2
+       err=`_ 'warning: %s/amindexd%s does not exist' "$libexecdir" "$SUF"`
+       $ENABLE_INDEX && test ! -f $libexecdir/amindexd$SUF && echo "$err" >&2
+       err=`_ 'warning: %s/amidxtaped%s does not exist' "$libexecdir" "$SUF"`
+       $ENABLE_TAPE && test ! -f $libexecdir/amidxtaped$SUF && echo "$err" >&2
+       TEMP="$INETDCONF.new"
+       {
+           egrep < "$INETDCONF" -v "^(amanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[    ]"
+           $ENABLE_AMANDAD && echo "amanda${SERVICE_SUFFIX}    dgram  udp wait   $USER $libexecdir/amandad$SUF    amandad$SUF"
+           $ENABLE_INDEX && echo "amandaidx${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amindexd$SUF   amindexd$SUF"
+           $ENABLE_TAPE && echo "amidxtape${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amidxtaped$SUF amidxtaped$SUF"
+       } > "$TEMP"
+       if diff "$INETDCONF" "$TEMP" >/dev/null 2>/dev/null; then
+               fmt="%s is up to date\n"
+               printf $fmt $INETDCONF
+       else
+               fmt="cannot patch %s\n"
+               cp "$TEMP" "$INETDCONF" || printf $fmt $INETDCONF
+       fi
+       rm -f "$TEMP"
+else
+       fmt="%s not found!\n"
+       printf $fmt $INETDCONF
+fi
diff --git a/client-src/patch-system.sh.in b/client-src/patch-system.sh.in
deleted file mode 100644 (file)
index f96f72e..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#! @SHELL@
-#
-# patch inetd.conf and services
-# originally by Axel Zinser (fifi@hiss.han.de)
-#
-
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-libexecdir="@libexecdir@"
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-SERVICE_SUFFIX="@SERVICE_SUFFIX@"
-
-USER="@CLIENT_LOGIN@"
-
-INETDCONF=/etc/inetd.conf
-[ ! -f $INETDCONF ] && INETDCONF=/usr/etc/inetd.conf
-
-SERVICES=/etc/services
-[ ! -f $SERVICES ] && SERVICES=/usr/etc/services
-
-ENABLE_AMANDAD=true
-
-case `uname -n` in
-"@DEFAULT_SERVER@" | "@DEFAULT_SERVER@".*)
-    ENABLE_INDEX=true
-    ENABLE_TAPE=true
-    ;;
-*)
-    ENABLE_INDEX=false
-    ENABLE_TAPE=false
-    ;;
-esac
-
-CLIENT_PORT=10080
-KCLIENT_PORT=10081
-INDEX_PORT=10082
-TAPE_PORT=10083
-
-while [ $# != 0 ]; do
-    case "$1" in
-    --service-suffix=*)
-       SERVICE_SUFFIX=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --version-suffix=*)
-       SUF=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --inetd=*)
-        INETDCONF=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;;
-    --services=*)
-       SERVICES=`echo $1 | sed -e 's/[^=]*=//' -e 's%^$%/dev/null%'`;;
-    --libexecdir=?*)
-       libexecdir=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --user=?*)
-       USER=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --enable-client)
-       ENABLE_AMANDAD=true;;
-    --disable-client)
-       ENABLE_AMANDAD=false;;
-    --enable-index)
-       ENABLE_INDEX=true;;
-    --disable-index)
-       ENABLE_INDEX=false;;
-    --enable-tape)
-       ENABLE_TAPE=true;;
-    --disable-tape)
-       ENABLE_TAPE=false;;
-    --client-port=?*)
-       CLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --kclient-port=?*)
-       KCLIENT_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --index-port=?*)
-       INDEX_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --tape-port=?*)
-       TAPE_PORT=`echo $1 | sed -e 's/[^=]*=//'`;;
-    --usage | --help | -h)
-       echo "call this script with zero or more of the following arguments:"
-       echo "--version-suffix=<suffix>: append to program names [$SUF]"
-       echo "--service-suffix=<suffix>: append to service names [$SERVICE_SUFFIX]"
-       echo "--libexecdir=<dirname>: where daemons should be looked for [$libexecdir]"
-       echo "--inetd=<pathname>: full pathname of inetd.conf [$INETDCONF]"
-       echo "--services=<pathname>: full pathname of services [$SERVICES]"
-       echo "    an empty pathname or /dev/null causes that file to be skipped"
-       echo "--user=<username>: run deamons as this user [$USER]"
-       echo "--enable/disable-client: enable/disable amandad [`$ENABLE_AMANDAD && echo enabled || echo disabled`]"
-       echo "--enable/disable-index: enable/disable index server [`$ENABLE_INDEX && echo enabled || echo disabled`]"
-       echo "--enable/disable-tape: enable/disable tape server [`$ENABLE_TAPE && echo enabled || echo disabled`]"
-       echo "--client-port=<num>: amandad port number [$CLIENT_PORT]"
-       echo "--kclient-port=<num>: kamandad port number [$KCLIENT_PORT]"
-       echo "--index-port=<num>: index server port number [$INDEX_PORT]"
-       echo "--tape-port=<num>: tape server port number [$TAPE_PORT]"
-       exec true;;
-    *)
-       echo "$0: invalid argument $1.  run with -h for usage" >&2
-       exec false;;
-    esac
-    shift
-done
-
-if [ "$SERVICES" = /dev/null ]; then :
-elif [ -f "$SERVICES" ]; then
-       TEMP="$SERVICES.new"
-       {
-           egrep < "$SERVICES" -v "^(amanda|kamanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[     ]"
-           echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/udp"
-           echo "amanda${SERVICE_SUFFIX} ${CLIENT_PORT}/tcp"
-           echo "kamanda${SERVICE_SUFFIX} ${KCLIENT_PORT}/udp"
-           echo "amandaidx${SERVICE_SUFFIX} ${INDEX_PORT}/tcp"
-           echo "amidxtape${SERVICE_SUFFIX} ${TAPE_PORT}/tcp"
-       } > "$TEMP"
-       if diff "$SERVICES" "$TEMP" >/dev/null 2>/dev/null; then
-               echo "$SERVICES is up to date"
-       else
-               cp "$TEMP" "$SERVICES" || echo "cannot patch $SERVICES"
-       fi
-       rm -f "$TEMP"
-else
-       echo "$SERVICES not found!"
-fi
-if [ "$INETDCONF" = /dev/null ]; then :
-elif [ -f "$INETDCONF" ]; then
-       $ENABLE_AMANDAD && test ! -f $libexecdir/amandad$SUF && echo "warning: $libexecdir/amandad$SUF does not exist" >&2
-       $ENABLE_INDEX && test ! -f $libexecdir/amindexd$SUF && echo "warning: $libexecdir/amindexd$SUF does not exist" >&2
-       $ENABLE_TAPE && test ! -f $libexecdir/amidxtaped$SUF && echo "warning: $libexecdir/amidxtaped$SUF does not exist" >&2
-       TEMP="$INETDCONF.new"
-       {
-           egrep < "$INETDCONF" -v "^(amanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[    ]"
-           $ENABLE_AMANDAD && echo "amanda${SERVICE_SUFFIX}    dgram  udp wait   $USER $libexecdir/amandad$SUF    amandad$SUF"
-           $ENABLE_INDEX && echo "amandaidx${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amindexd$SUF   amindexd$SUF"
-           $ENABLE_TAPE && echo "amidxtape${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amidxtaped$SUF amidxtaped$SUF"
-       } > "$TEMP"
-       if diff "$INETDCONF" "$TEMP" >/dev/null 2>/dev/null; then
-               echo "$INETDCONF is up to date"
-       else
-               cp "$TEMP" "$INETDCONF" || echo "cannot patch $INETDCONF"
-       fi
-       rm -f "$TEMP"
-else
-       echo "$INETDCONF not found!"
-fi
index 5a9e50f53a798044bf46b322d5d97fcb8b723480..d6772fa57d03925cf615d8cd943d18c1545a4fb9 100644 (file)
@@ -33,6 +33,7 @@
  * argv[2] will be argv[0] of the DUMP program
  * ...
  */
+#include "util.h"
 #include "amanda.h"
 #include "version.h"
 
@@ -44,10 +45,10 @@ int main(int argc, char **argv);
 #endif
 
 #if !defined(USE_RUNDUMP)
-#  define ERRMSG "rundump not enabled on this system.\n"
+#  define ERRMSG _("rundump not enabled on this system.\n")
 #else
 #  if !defined(DUMP) && !defined(VXDUMP) && !defined(VDUMP) && !defined(XFSDUMP)
-#    define ERRMSG "DUMP not available on this system.\n"
+#    define ERRMSG _("DUMP not available on this system.\n")
 #  else
 #    undef ERRMSG
 #  endif
@@ -62,8 +63,18 @@ main(
     char *dump_program;
     int i;
     char *e;
+    char *cmdline;
 #endif /* ERRMSG */
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
     safe_cd();
 
@@ -74,47 +85,36 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 3) {
-       error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL));
+       error(_("Need at least 3 arguments\n"));
        /*NOTREACHED*/
     }
 
-    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
+    dbprintf(_("version %s\n"), version());
 
 #ifdef ERRMSG                                                  /* { */
 
-    fprintf(stderr, ERRMSG);
-    dbprintf(("%s: %s", argv[0], ERRMSG));
+    g_fprintf(stderr, ERRMSG);
+    dbprintf("%s: %s", argv[0], ERRMSG);
     dbclose();
     return 1;
 
 #else                                                          /* } { */
 
-    if(client_uid == (uid_t) -1) {
-       error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-       /*NOTREACHED*/
-    }
-
-#ifdef FORCE_USERID
-    if (getuid() != client_uid) {
-       error("error [must be invoked by %s]\n", CLIENT_LOGIN);
+#ifdef WANT_SETUID_CLIENT
+    check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY);
+    if (!become_root()) {
+       error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname());
        /*NOTREACHED*/
     }
-
-    if (geteuid() != 0) {
-       error("error [must be setuid root]\n");
-       /*NOTREACHED*/
-    }
-#endif /* FORCE_USERID */
-
-#if !defined (DONT_SUID_ROOT)
-    setuid(0);
+#else
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 #endif
 
     /* skip argv[0] */
     argc--;
     argv++;
 
-    dbprintf(("config: %s\n", argv[0]));
+    dbprintf(_("config: %s\n"), argv[0]);
     if (strcmp(argv[0], "NOCONFIG") != 0)
        dbrename(argv[0], DBG_SUBDIR_CLIENT);
     argc--;
@@ -158,18 +158,24 @@ main(
 # endif
 #endif
 
-    dbprintf(("running: %s: ",dump_program));
-    for (i=0; argv[i]; i++)
-       dbprintf(("%s ", argv[i]));
-    dbprintf(("\n"));
+    cmdline = stralloc(dump_program);
+    for (i = 1; argv[i]; i++) {
+       char *quoted;
+
+       quoted = quote_string(argv[i]);
+       cmdline = vstrextend(&cmdline, " ", quoted, NULL);
+       amfree(quoted);
+    }
+    dbprintf(_("running: %s\n"), cmdline);
+    amfree(cmdline);
 
     execve(dump_program, argv, safe_env());
 
     e = strerror(errno);
-    dbprintf(("failed (%s)\n", e));
+    dbprintf(_("failed (%s)\n"), e);
     dbclose();
 
-    fprintf(stderr, "rundump: could not exec %s: %s\n", dump_program, e);
+    g_fprintf(stderr, _("rundump: could not exec %s: %s\n"), dump_program, e);
     return 1;
 #endif                                                         /* } */
 }
index f088ea13bf871f280308324e35b6c587d499c240..144d6bfc777052b87a39298b20c4c7331b818b69 100644 (file)
@@ -48,8 +48,18 @@ main(
     int i;
     char *e;
     char *dbf;
+    char *cmdline;
 #endif
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
     safe_cd();
 
@@ -60,22 +70,21 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 3) {
-       error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL));
+       error(_("Need at least 3 arguments\n"));
        /*NOTREACHED*/
     }
 
-    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
+    dbprintf(_("version %s\n"), version());
 
     if (strcmp(argv[3], "--create") != 0) {
-       error("%s: Can only be used to create tar archives\n",
-             debug_prefix_time(NULL));
+       error(_("Can only be used to create tar archives\n"));
        /*NOTREACHED*/
     }
 
 #ifndef GNUTAR
 
-    fprintf(stderr,"gnutar not available on this system.\n");
-    dbprintf(("%s: gnutar not available on this system.\n", argv[0]));
+    g_fprintf(stderr,_("gnutar not available on this system.\n"));
+    dbprintf(_("%s: gnutar not available on this system.\n"), argv[0]);
     dbclose();
     return 1;
 
@@ -90,60 +99,55 @@ main(
 
        if ((version_file = popen(GNUTAR " --version 2>&1", "r")) != NULL) {
            if (fgets(version_buf, (int)sizeof(version_buf), version_file) != NULL) {
-               dbprintf((GNUTAR " version: %s\n", version_buf));
+               dbprintf(_(GNUTAR " version: %s\n"), version_buf);
            } else {
                if (ferror(version_file)) {
-                   dbprintf((GNUTAR " version: Read failure: %s\n", strerror(errno)));
+                   dbprintf(_(GNUTAR " version: Read failure: %s\n"), strerror(errno));
                } else {
-                   dbprintf((GNUTAR " version: Read failure; EOF\n"));
+                   dbprintf(_(GNUTAR " version: Read failure; EOF\n"));
                }
            }
        } else {
-           dbprintf((GNUTAR " version: unavailable: %s\n", strerror(errno)));
+           dbprintf(_(GNUTAR " version: unavailable: %s\n"), strerror(errno));
        }
     } while(0);
 
-    if(client_uid == (uid_t) -1) {
-       error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-       /*NOTREACHED*/
-    }
-
-#ifdef FORCE_USERID
-    if (getuid() != client_uid) {
-       error("error [must be invoked by %s]\n", CLIENT_LOGIN);
+    if(get_client_uid() == (uid_t) -1) {
+       error(_("error [cannot find user %s in passwd file]\n"), CLIENT_LOGIN);
        /*NOTREACHED*/
     }
 
-    if (geteuid() != 0) {
-       error("error [must be setuid root]\n");
+#ifdef WANT_SETUID_CLIENT
+    check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY);
+    if (!become_root()) {
+       error(_("error [%s could not become root (is the setuid bit set?)]\n"), get_pname());
        /*NOTREACHED*/
     }
-#endif
-
-#if !defined (DONT_SUID_ROOT)
-    setuid(0);
+#else
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 #endif
 
     /* skip argv[0] */
     argc--;
     argv++;
 
-    dbprintf(("config: %s\n", argv[0]));
+    dbprintf(_("config: %s\n"), argv[0]);
     if (strcmp(argv[0], "NOCONFIG") != 0)
        dbrename(argv[0], DBG_SUBDIR_CLIENT);
     argc--;
     argv++;
 
-
-    dbprintf(("running: %s: ",GNUTAR));
-    for (i=0; argv[i]; i++) {
+    cmdline = stralloc(GNUTAR);
+    for (i = 1; argv[i]; i++) {
        char *quoted;
 
        quoted = quote_string(argv[i]);
-       dbprintf(("'%s' ", quoted));
+       cmdline = vstrextend(&cmdline, " ", quoted, NULL);
        amfree(quoted);
     }
-    dbprintf(("\n"));
+    dbprintf(_("running: %s\n"), cmdline);
+    amfree(cmdline);
+
     dbf = dbfn();
     if (dbf) {
        dbf = stralloc(dbf);
@@ -155,10 +159,10 @@ main(
     e = strerror(errno);
     dbreopen(dbf, "more");
     amfree(dbf);
-    dbprintf(("execve of %s failed (%s)\n", GNUTAR, e));
+    dbprintf(_("execve of %s failed (%s)\n"), GNUTAR, e);
     dbclose();
 
-    fprintf(stderr, "runtar: could not exec %s: %s\n", GNUTAR, e);
+    g_fprintf(stderr, _("runtar: could not exec %s: %s\n"), GNUTAR, e);
     return 1;
 #endif
 }
index fe6179c4ddf2ba6dfb96d43bc502cc473f4e6992..8787a8245f40c0a055d6e7f8197662d10e4e8ad5 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 #include "amanda.h"
-#include "statfs.h"
+#include "fsusage.h"
 #include "version.h"
 #include "getfsent.h"
 #include "amandates.h"
 #include "findpass.h"
 #endif
 
-#define selfcheck_debug(i,x) do {      \
-       if ((i) <= debug_selfcheck) {   \
-           dbprintf(x);                \
-       }                               \
-} while (0)
-
 int need_samba=0;
 int need_rundump=0;
 int need_dump=0;
@@ -103,16 +97,20 @@ main(
     char *optstr = NULL;
     char *err_extra = NULL;
     char *s, *fp;
-    char *conffile;
     option_t *options;
     int ch;
-#if defined(USE_DBMALLOC)
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-#endif
 
     /* initialize */
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
     safe_cd();
 
@@ -121,26 +119,18 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-#if defined(USE_DBMALLOC)
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-#endif
-
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
     dbopen(DBG_SUBDIR_CLIENT);
     startclock();
-    dbprintf(("%s: version %s\n", get_pname(), version()));
+    dbprintf(_("version %s\n"), version());
 
     if(argc > 2 && strcmp(argv[1], "amandad") == 0) {
        amandad_auth = stralloc(argv[2]);
     }
 
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       printf("ERROR [reading conffile: %s]\n", conffile);
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    config_init(CONFIG_INIT_CLIENT, NULL);
+
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
@@ -161,27 +151,22 @@ main(
                g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0';
            }
 
-           printf("OPTIONS ");
+           g_printf("OPTIONS ");
            if(am_has_feature(g_options->features, fe_rep_options_features)) {
-               printf("features=%s;", our_feature_string);
+               g_printf("features=%s;", our_feature_string);
            }
            if(am_has_feature(g_options->features, fe_rep_options_hostname)) {
-               printf("hostname=%s;", g_options->hostname);
+               g_printf("hostname=%s;", g_options->hostname);
            }
-           printf("\n");
+           g_printf("\n");
            fflush(stdout);
 
            if (g_options->config) {
-               conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/",
-                                    "amanda-client.conf", NULL);
-               if (read_clientconf(conffile) > 0) {
-                   printf("ERROR [reading conffile: %s]\n", conffile);
-                   error("error reading conffile: %s", conffile);
-                   /*NOTREACHED*/
-               }
-               amfree(conffile);
+               /* overlay this configuration on the existing (nameless) configuration */
+               config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY,
+                           g_options->config);
 
-               dbrename(g_options->config, DBG_SUBDIR_CLIENT);
+               dbrename(config_name, DBG_SUBDIR_CLIENT);
            }
 
            continue;
@@ -298,8 +283,14 @@ main(
            goto err;                           /* bad syntax */
        }
        amfree(disk);
+       amfree(qamdevice);
        amfree(amdevice);
     }
+    if (g_options == NULL) {
+       printf(_("ERROR [Missing OPTIONS line in selfcheck input]\n"));
+       error(_("Missing OPTIONS line in selfcheck input\n"));
+       /*NOTREACHED*/
+    }
 
     check_overall();
 
@@ -307,31 +298,16 @@ main(
     amfree(our_feature_string);
     am_release_feature_set(our_features);
     our_features = NULL;
-    am_release_feature_set(g_options->features);
-    g_options->features = NULL;
-    amfree(g_options->str);
-    amfree(g_options->hostname);
-    amfree(g_options);
-
-#if defined(USE_DBMALLOC)
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       extern int dbfd;
-
-       malloc_list(dbfd(), malloc_hist_1, malloc_hist_2);
-    }
-#endif
+    free_g_options(g_options);
 
     dbclose();
     return 0;
 
  err:
-    printf("ERROR [BOGUS REQUEST PACKET]\n");
-    dbprintf(("%s: REQ packet is bogus%s%s\n",
-             debug_prefix_time(NULL),
+    g_printf(_("ERROR [BOGUS REQUEST PACKET]\n"));
+    dbprintf(_("REQ packet is bogus%s%s\n"),
              err_extra ? ": " : "",
-             err_extra ? err_extra : ""));
+             err_extra ? err_extra : "");
     dbclose();
     return 1;
 }
@@ -366,7 +342,7 @@ check_options(
 
        need_calcsize=1;
        if (calcprog == NULL) {
-           printf("ERROR [no program name for calcsize]\n");
+           g_printf(_("ERROR [no program name for calcsize]\n"));
        } else {
            myprogram = calcprog;
        }
@@ -376,18 +352,18 @@ check_options(
        need_gnutar=1;
         if(amdevice[0] == '/' && amdevice[1] == '/') {
            if(options->exclude_file && options->exclude_file->nb_element > 1) {
-               printf("ERROR [samba support only one exclude file]\n");
+               g_printf(_("ERROR [samba support only one exclude file]\n"));
            }
            if(options->exclude_list && options->exclude_list->nb_element > 0 &&
               options->exclude_optional==0) {
-               printf("ERROR [samba does not support exclude list]\n");
+               g_printf(_("ERROR [samba does not support exclude list]\n"));
            }
            if(options->include_file && options->include_file->nb_element > 0) {
-               printf("ERROR [samba does not support include file]\n");
+               g_printf(_("ERROR [samba does not support include file]\n"));
            }
            if(options->include_list && options->include_list->nb_element > 0 &&
               options->include_optional==0) {
-               printf("ERROR [samba does not support include list]\n");
+               g_printf(_("ERROR [samba does not support include list]\n"));
            }
            need_samba=1;
        }
@@ -414,16 +390,16 @@ check_options(
 
     if(strcmp(myprogram,"DUMP") == 0) {
        if(options->exclude_file && options->exclude_file->nb_element > 0) {
-           printf("ERROR [DUMP does not support exclude file]\n");
+           g_printf(_("ERROR [DUMP does not support exclude file]\n"));
        }
        if(options->exclude_list && options->exclude_list->nb_element > 0) {
-           printf("ERROR [DUMP does not support exclude list]\n");
+           g_printf(_("ERROR [DUMP does not support exclude list]\n"));
        }
        if(options->include_file && options->include_file->nb_element > 0) {
-           printf("ERROR [DUMP does not support include file]\n");
+           g_printf(_("ERROR [DUMP does not support include file]\n"));
        }
        if(options->include_list && options->include_list->nb_element > 0) {
-           printf("ERROR [DUMP does not support include list]\n");
+           g_printf(_("ERROR [DUMP does not support include list]\n"));
        }
 #ifdef USE_RUNDUMP
        need_rundump=1;
@@ -488,8 +464,17 @@ check_options(
     }
     if(options->auth && amandad_auth) {
        if(strcasecmp(options->auth, amandad_auth) != 0) {
-           fprintf(stdout,"ERROR [client configured for auth=%s while server requested '%s']\n",
+           g_fprintf(stdout,_("ERROR [client configured for auth=%s while server requested '%s']\n"),
                    amandad_auth, options->auth);
+           if(strcmp(options->auth, "ssh") == 0)  {    
+               g_fprintf(stderr, _("ERROR [The auth in ~/.ssh/authorized_keys "
+                                 "should be \"--auth=ssh\", or use another auth "
+                                 " for the DLE]\n"));
+           }
+           else {
+               g_fprintf(stderr, _("ERROR [The auth in the inetd/xinetd configuration "
+                                 " must be the same as the DLE]\n"));
+           }           
        }
     }
 }
@@ -518,18 +503,19 @@ check_disk(
     char *qamdevice = quote_string(amdevice);
     char *qdevice = NULL;
     FILE *toolin;
-    char number[NUM_STR_SIZE];
 
     (void)level;       /* Quiet unused parameter warning */
 
-    dbprintf(("%s: checking disk %s\n", debug_prefix_time(NULL), qdisk));
+    dbprintf(_("checking disk %s\n"), qdisk);
 
     if(strcmp(myprogram,"CALCSIZE") == 0) {
        if(amdevice[0] == '/' && amdevice[1] == '/') {
-           err = vstralloc("Can't use CALCSIZE for samba estimate,",
-                           " use CLIENT: ",
-                           amdevice,
-                           NULL);
+           err = vstrallocf(_("Can't use CALCSIZE for samba estimate, use CLIENT: %s"),
+                           amdevice);
+           goto common_exit;
+       }
+       if (calcprog == NULL) {
+           err = _("no program for calcsize");
            goto common_exit;
        }
        myprogram = calcprog;
@@ -544,9 +530,8 @@ check_disk(
            size_t pwtext_len;
            pid_t checkpid;
            amwait_t retstat;
-           char number[NUM_STR_SIZE];
            pid_t wpid;
-           int ret, sig, rc;
+           int rc;
            char *line;
            char *sep;
            FILE *ferr;
@@ -555,35 +540,33 @@ check_disk(
 
            parsesharename(amdevice, &share, &subdir);
            if (!share) {
-               err = stralloc2("cannot parse for share/subdir disk entry ", amdevice);
+               err = vstrallocf(_("cannot parse for share/subdir disk entry %s"), amdevice);
                goto common_exit;
            }
            if ((subdir) && (SAMBA_VERSION < 2)) {
-               err = vstralloc("subdirectory specified for share '",
-                               amdevice,
-                               "' but samba not v2 or better",
-                               NULL);
+               err = vstrallocf(_("subdirectory specified for share '%s' but, samba is not v2 or better"),
+                               amdevice);
                goto common_exit;
            }
            if ((user_and_password = findpass(share, &domain)) == NULL) {
-               err = stralloc2("cannot find password for ", amdevice);
+               err = vstrallocf(_("cannot find password for %s"), amdevice);
                goto common_exit;
            }
            lpass = strlen(user_and_password);
            if ((pwtext = strchr(user_and_password, '%')) == NULL) {
-               err = stralloc2("password field not \'user%pass\' for ", amdevice);
+               err = vstrallocf(_("password field not \'user%%pass\' for %s"), amdevice);
                goto common_exit;
            }
            *pwtext++ = '\0';
            pwtext_len = (size_t)strlen(pwtext);
            amfree(device);
            if ((device = makesharename(share, 0)) == NULL) {
-               err = stralloc2("cannot make share name of ", share);
+               err = vstrallocf(_("cannot make share name of %s"), share);
                goto common_exit;
            }
 
            if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-               err = stralloc2("Cannot access /dev/null : ", strerror(errno));
+               err = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno));
                goto common_exit;
            }
 
@@ -613,11 +596,8 @@ check_disk(
            /*@ignore@*/
            if ((pwtext_len > 0)
              && fullwrite(passwdfd, pwtext, (size_t)pwtext_len) < 0) {
-               err = vstralloc("password write failed: ",
-                               amdevice,
-                               ": ",
-                               strerror(errno),
-                               NULL);
+               err = vstrallocf(_("password write failed: %s: %s"),
+                               amdevice, strerror(errno));
                aclose(passwdfd);
                goto common_exit;
            }
@@ -627,8 +607,8 @@ check_disk(
            aclose(passwdfd);
            ferr = fdopen(checkerr, "r");
            if (!ferr) {
-               printf("ERROR [Can't fdopen: %s]\n", strerror(errno));
-               error("Can't fdopen: %s", strerror(errno));
+               g_printf(_("ERROR [Can't fdopen: %s]\n"), strerror(errno));
+               error(_("Can't fdopen: %s"), strerror(errno));
                /*NOTREACHED*/
            }
            sep = "";
@@ -646,38 +626,31 @@ check_disk(
            afclose(ferr);
            checkerr = -1;
            rc = 0;
+           sep = "";
            while ((wpid = wait(&retstat)) != -1) {
-               if (WIFSIGNALED(retstat)) {
-                   ret = 0;
-                   rc = sig = WTERMSIG(retstat);
-               } else {
-                   sig = 0;
-                   rc = ret = WEXITSTATUS(retstat);
-               }
-               if (rc != 0) {
-                   strappend(err, sep);
-                   if (ret == 0) {
-                       strappend(err, "got signal ");
-                       ret = sig;
-                   } else {
-                       strappend(err, "returned ");
-                   }
-                   snprintf(number, (size_t)sizeof(number), "%d", ret);
-                   strappend(err, number);
+               if (!WIFEXITED(retstat) || WEXITSTATUS(retstat) != 0) {
+                   char *exitstr = str_exit_status("smbclient", retstat);
+                   err = newvstralloc(err, err, sep, exitstr);
+                   sep = "\n";
+                   amfree(exitstr);
+
+                   rc = 1;
                }
            }
            if (errdos != 0 || rc != 0) {
-               err = newvstralloc(err,
-                                  "samba access error: ",
-                                  amdevice,
-                                  ": ",
-                                  extra_info ? extra_info : "",
-                                  err,
-                                  NULL);
-               amfree(extra_info);
+               if (extra_info) {
+                   err = newvstrallocf(err,
+                                  _("samba access error: %s: %s %s"),
+                                  amdevice, extra_info, err);
+                   amfree(extra_info);
+               } else {
+                   err = newvstrallocf(err, _("samba access error: %s: %s"),
+                                  amdevice, err);
+               }
            }
 #else
-           err = stralloc2("This client is not configured for samba: ", qdisk);
+           err = vstrallocf(_("This client is not configured for samba: %s"),
+                       qdisk);
 #endif
            goto common_exit;
        }
@@ -686,10 +659,9 @@ check_disk(
        device = amname_to_dirname(amdevice);
     } else if (strcmp(myprogram, "DUMP") == 0) {
        if(amdevice[0] == '/' && amdevice[1] == '/') {
-           err = vstralloc("The DUMP program cannot handle samba shares,",
-                           " use GNUTAR: ",
-                           qdisk,
-                           NULL);
+           err = vstrallocf(
+                 _("The DUMP program cannot handle samba shares, use GNUTAR: %s"),
+                 qdisk);
            goto common_exit;
        }
 #ifdef VDUMP                                                           /* { */
@@ -722,14 +694,14 @@ check_disk(
        bsu = backup_support_option(program, g_options, disk, amdevice);
 
        if (pipe(property_pipe) < 0) {
-           err = vstralloc("pipe failed: ", strerror(errno), NULL);
+           err = vstrallocf(_("pipe failed: %s"), strerror(errno));
            goto common_exit;
        }
        fflush(stdout);fflush(stderr);
        
        switch (backup_api_pid = fork()) {
        case -1:
-           err = vstralloc("fork failed: ", strerror(errno), NULL);
+           err = vstrallocf(_("fork failed: %s"), strerror(errno));
            goto common_exit;
 
        case 0: /* child */
@@ -767,8 +739,9 @@ check_disk(
                argvchild[j++] = NULL;
                dup2(property_pipe[0], 0);
                aclose(property_pipe[1]);
+               safe_fd(-1, 0);
                execve(cmd,argvchild,safe_env());
-               printf("ERROR [Can't execute %s: %s]\n", cmd, strerror(errno));
+               g_printf(_("ERROR [Can't execute %s: %s]\n"), cmd, strerror(errno));
                exit(127);
            }
        default: /* parent */
@@ -777,7 +750,7 @@ check_disk(
                aclose(property_pipe[0]);
                toolin = fdopen(property_pipe[1],"w");
                if (!toolin) {
-                   err = vstralloc("Can't fdopen: ", strerror(errno), NULL);
+                   err = vstrallocf(_("Can't fdopen: %s"), strerror(errno));
                    goto common_exit;
                }
                output_tool_property(toolin, options);
@@ -785,17 +758,13 @@ check_disk(
                fclose(toolin);
                if (waitpid(backup_api_pid, &status, 0) < 0) {
                    if (!WIFEXITED(status)) {
-                       snprintf(number, SIZEOF(number), "%d",
-                                (int)WTERMSIG(status));
-                       err = vstralloc("Tool exited with signal ", number,
-                                       NULL);
+                       err = vstrallocf(_("Tool exited with signal %d"),
+                                        WTERMSIG(status));
                    } else if (WEXITSTATUS(status) != 0) {
-                       snprintf(number, SIZEOF(number), "%d",
-                                (int)WEXITSTATUS(status));
-                       err = vstralloc("Tool exited with status ", number,
-                                       NULL);
+                       err = vstrallocf(_("Tool exited with status %d"),
+                                        WEXITSTATUS(status));
                    } else {
-                       err = stralloc("waitpid returned negative value");
+                       err = vstrallocf(_("waitpid returned negative value"));
                    }
                    goto common_exit;
                }
@@ -810,7 +779,7 @@ check_disk(
     }
 
     qdevice = quote_string(device);
-    dbprintf(("%s: device %s\n", debug_prefix_time(NULL), qdevice));
+    dbprintf(_("device %s\n"), qdevice);
 
     /* skip accessability test if this is an AFS entry */
     if(strncmp_const(device, "afs:") != 0) {
@@ -822,8 +791,8 @@ check_disk(
        access_type = "access";
 #endif
        if(access_result == -1) {
-           err = vstralloc("could not ", access_type, " ", qdevice,
-                       " (", qdisk, "): ", strerror(errno), NULL);
+           err = vstrallocf(_("Could not access %s (%s): %s"),
+                       qdevice, qdisk, strerror(errno));
        }
 #ifdef CHECK_FOR_ACCESS_WITH_OPEN
        aclose(access_result);
@@ -841,20 +810,19 @@ common_exit:
     amfree(domain);
 
     if(err) {
-       printf("ERROR [%s]\n", err);
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), err));
+       g_printf(_("ERROR [%s]\n"), err);
+       dbprintf(_("%s\n"), err);
        amfree(err);
     } else {
-       printf("OK %s\n", qdisk);
-       dbprintf(("%s: disk %s OK\n", debug_prefix_time(NULL), qdisk));
-       printf("OK %s\n", qamdevice);
-       dbprintf(("%s: amdevice %s OK\n",
-                 debug_prefix_time(NULL), qamdevice));
-       printf("OK %s\n", qdevice);
-       dbprintf(("%s: device %s OK\n", debug_prefix_time(NULL), qdevice));
+       g_printf("OK %s\n", qdisk);
+       dbprintf(_("disk %s OK\n"), qdisk);
+       g_printf("OK %s\n", qamdevice);
+       dbprintf(_("amdevice %s OK\n"), qamdevice);
+       g_printf("OK %s\n", qdevice);
+       dbprintf(_("device %s OK\n"), qdevice);
     }
     if(extra_info) {
-       dbprintf(("%s: extra info: %s\n", debug_prefix_time(NULL), extra_info));
+       dbprintf(_("extra info: %s\n"), extra_info);
        amfree(extra_info);
     }
     amfree(qdisk);
@@ -876,7 +844,7 @@ check_overall(void)
 
     if( need_runtar )
     {
-       cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL);
+       cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL);
        check_file(cmd,X_OK);
        check_suid(cmd);
        amfree(cmd);
@@ -884,7 +852,7 @@ check_overall(void)
 
     if( need_rundump )
     {
-       cmd = vstralloc(libexecdir, "/", "rundump", versionsuffix(), NULL);
+       cmd = vstralloc(amlibexecdir, "/", "rundump", versionsuffix(), NULL);
        check_file(cmd,X_OK);
        check_suid(cmd);
        amfree(cmd);
@@ -894,7 +862,7 @@ check_overall(void)
 #ifdef DUMP
        check_file(DUMP, X_OK);
 #else
-       printf("ERROR [DUMP program not available]\n");
+       g_printf(_("ERROR [DUMP program not available]\n"));
 #endif
     }
 
@@ -902,7 +870,7 @@ check_overall(void)
 #ifdef RESTORE
        check_file(RESTORE, X_OK);
 #else
-       printf("ERROR [RESTORE program not available]\n");
+       g_printf(_("ERROR [RESTORE program not available]\n"));
 #endif
     }
 
@@ -910,7 +878,7 @@ check_overall(void)
 #ifdef VDUMP
        check_file(VDUMP, X_OK);
 #else
-       printf("ERROR [VDUMP program not available]\n");
+       g_printf(_("ERROR [VDUMP program not available]\n"));
 #endif
     }
 
@@ -918,7 +886,7 @@ check_overall(void)
 #ifdef VRESTORE
        check_file(VRESTORE, X_OK);
 #else
-       printf("ERROR [VRESTORE program not available]\n");
+       g_printf(_("ERROR [VRESTORE program not available]\n"));
 #endif
     }
 
@@ -926,7 +894,7 @@ check_overall(void)
 #ifdef XFSDUMP
        check_file(XFSDUMP, F_OK);
 #else
-       printf("ERROR [XFSDUMP program not available]\n");
+       g_printf(_("ERROR [XFSDUMP program not available]\n"));
 #endif
     }
 
@@ -934,7 +902,7 @@ check_overall(void)
 #ifdef XFSRESTORE
        check_file(XFSRESTORE, X_OK);
 #else
-       printf("ERROR [XFSRESTORE program not available]\n");
+       g_printf(_("ERROR [XFSRESTORE program not available]\n"));
 #endif
     }
 
@@ -942,7 +910,7 @@ check_overall(void)
 #ifdef VXDUMP
        check_file(VXDUMP, X_OK);
 #else
-       printf("ERROR [VXDUMP program not available]\n");
+       g_printf(_("ERROR [VXDUMP program not available]\n"));
 #endif
     }
 
@@ -950,7 +918,7 @@ check_overall(void)
 #ifdef VXRESTORE
        check_file(VXRESTORE, X_OK);
 #else
-       printf("ERROR [VXRESTORE program not available]\n");
+       g_printf(_("ERROR [VXRESTORE program not available]\n"));
 #endif
     }
 
@@ -958,7 +926,7 @@ check_overall(void)
 #ifdef GNUTAR
        check_file(GNUTAR, X_OK);
 #else
-       printf("ERROR [GNUTAR program not available]\n");
+       g_printf(_("ERROR [GNUTAR program not available]\n"));
 #endif
        need_amandates = 1;
        gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR);
@@ -976,7 +944,7 @@ check_overall(void)
     if( need_calcsize ) {
        char *cmd;
 
-       cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL);
+       cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL);
 
        check_file(cmd, X_OK);
 
@@ -987,23 +955,23 @@ check_overall(void)
 #ifdef SAMBA_CLIENT
        check_file(SAMBA_CLIENT, X_OK);
 #else
-       printf("ERROR [SMBCLIENT program not available]\n");
+       g_printf(_("ERROR [SMBCLIENT program not available]\n"));
 #endif
        testfd = open("/etc/amandapass", R_OK);
        if (testfd >= 0) {
            if(fstat(testfd, &buf) == 0) {
                if ((buf.st_mode & 0x7) != 0) {
-                   printf("ERROR [/etc/amandapass is world readable!]\n");
+                   g_printf(_("ERROR [/etc/amandapass is world readable!]\n"));
                } else {
-                   printf("OK [/etc/amandapass is readable, but not by all]\n");
+                   g_printf(_("OK [/etc/amandapass is readable, but not by all]\n"));
                }
            } else {
-               printf("OK [unable to stat /etc/amandapass: %s]\n",
+               g_printf(_("OK [unable to stat /etc/amandapass: %s]\n"),
                       strerror(errno));
            }
            aclose(testfd);
        } else {
-           printf("ERROR [unable to open /etc/amandapass: %s]\n",
+           g_printf(_("ERROR [unable to open /etc/amandapass: %s]\n"),
                   strerror(errno));
        }
     }
@@ -1023,7 +991,7 @@ check_overall(void)
        } else {
 #ifndef USE_RUNDUMP
            if (access("/etc", R_OK|W_OK) == -1) {
-               printf("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n", strerror(errno));
+               g_printf(_("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n"), strerror(errno));
            }
 #endif
        }
@@ -1050,19 +1018,29 @@ check_space(
     char *     dir,
     off_t      kbytes)
 {
-    generic_fs_stats_t statp;
+    struct fs_usage fsusage;
     char *quoted = quote_string(dir);
+    intmax_t kb_avail;
+
+    if(get_fs_usage(dir, NULL, &fsusage) == -1) {
+       g_printf(_("ERROR [cannot get filesystem usage for %s: %s]\n"), quoted, strerror(errno));
+       amfree(quoted);
+       return;
+    }
+
+    /* do the division first to avoid potential integer overflow */
+    kb_avail = fsusage.fsu_bavail / 1024 * fsusage.fsu_blocksize;
 
-    if(get_fs_stats(dir, &statp) == -1) {
-       printf("ERROR [cannot statfs %s: %s]\n", quoted, strerror(errno));
-    } else if(statp.avail < kbytes) {
-       printf("ERROR [dir %s needs " OFF_T_FMT "KB, only has "
-               OFF_T_FMT "KB available.]\n", quoted,
-               (OFF_T_FMT_TYPE)kbytes,
-               (OFF_T_FMT_TYPE)statp.avail);
+    if (fsusage.fsu_bavail_top_bit_set || fsusage.fsu_bavail == 0) {
+       g_printf(_("ERROR [dir %s needs %lldKB, has nothing available.]\n"), quoted,
+               (long long)kbytes);
+    } else if (kb_avail < kbytes) {
+       g_printf(_("ERROR [dir %s needs %lldKB, only has %lldKB available.]\n"), quoted,
+               (long long)kbytes,
+               (long long)kb_avail);
     } else {
-       printf("OK %s has more than " OFF_T_FMT " KB available.\n",
-               quoted, (OFF_T_FMT_TYPE)kbytes);
+       g_printf(_("OK %s has more than %lldKB available.\n"),
+               quoted, (long long)kbytes);
     }
     amfree(quoted);
 }
@@ -1085,9 +1063,9 @@ check_access(
        noun = "access", adjective = "accessible";
 
     if(access(filename, mode) == -1)
-       printf("ERROR [can not %s %s: %s]\n", noun, quoted, strerror(errno));
+       g_printf(_("ERROR [can not %s %s: %s]\n"), noun, quoted, strerror(errno));
     else
-       printf("OK %s %s\n", quoted, adjective);
+       g_printf(_("OK %s %s\n"), quoted, adjective);
     amfree(quoted);
 }
 
@@ -1116,7 +1094,7 @@ check_file(
     if(!stat(filename, &stat_buf)) {
        if(!S_ISREG(stat_buf.st_mode)) {
            quoted = quote_string(filename);
-           printf("ERROR [%s is not a file]\n", quoted);
+           g_printf(_("ERROR [%s is not a file]\n"), quoted);
            amfree(quoted);
        }
     }
@@ -1135,7 +1113,7 @@ check_dir(
     if(!stat(dirname, &stat_buf)) {
        if(!S_ISDIR(stat_buf.st_mode)) {
            quoted = quote_string(dirname);
-           printf("ERROR [%s is not a directory]\n", quoted);
+           g_printf(_("ERROR [%s is not a directory]\n"), quoted);
            amfree(quoted);
        }
     }
@@ -1148,21 +1126,20 @@ static void
 check_suid(
     char *     filename)
 {
-/* The following is only valid for real Unixs */
-#ifndef IGNORE_UID_CHECK
+#ifndef SINGLE_USERID
     struct stat stat_buf;
     char *quoted = quote_string(filename);
 
     if(!stat(filename, &stat_buf)) {
        if(stat_buf.st_uid != 0 ) {
-           printf("ERROR [%s is not owned by root]\n", quoted);
+           g_printf(_("ERROR [%s is not owned by root]\n"), quoted);
        }
        if((stat_buf.st_mode & S_ISUID) != S_ISUID) {
-           printf("ERROR [%s is not SUID root]\n", quoted);
+           g_printf(_("ERROR [%s is not SUID root]\n"), quoted);
        }
     }
     else {
-       printf("ERROR [can not stat %s]\n", quoted);
+       g_printf(_("ERROR [can not stat %s]\n"), quoted);
     }
     amfree(quoted);
 #else
index cb87624565257f5556764a132546e1a4c7e69a9c..1ec5a7fb2321a0f8977b6739b726639299870eaf 100644 (file)
@@ -150,13 +150,12 @@ start_backup(
 
     (void)dumpdate;    /* Quiet unused parameter warning */
 
-    snprintf(level_str, SIZEOF(level_str), "%d", level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", level);
 
     qdisk = quote_string(disk);
-    dbprintf(("%s: start: %s:%s lev %d\n",
-             get_pname(), host, qdisk, level));
+    dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level);
 
-    fprintf(stderr, "%s: start [%s:%s level %d]\n",
+    g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"),
            get_pname(), host, qdisk, level);
     amfree(qdisk);
 
@@ -165,8 +164,7 @@ start_backup(
         encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE,
                        &compout, &dataf, &mesgf,
                        options->clnt_encrypt, encryptopt, NULL);
-        dbprintf(("%s: pid %ld: %s\n",
-                 debug_prefix_time("-gnutar"), (long)encpid, options->clnt_encrypt));
+        dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt);
     } else {
         compout = dataf;
         encpid = -1;
@@ -187,23 +185,22 @@ start_backup(
        comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
                            COMPRESS_PATH, compopt, NULL);
-       dbprintf(("%s: pid %ld: %s",
-                 debug_prefix_time("-dump"), (long)comppid, COMPRESS_PATH));
+       dbprintf(_("dump: pid %ld: %s"), (long)comppid, COMPRESS_PATH);
        if(compopt != skip_argument) {
-           dbprintf((" %s", compopt));
+           dbprintf(" %s", compopt);
        }
-       dbprintf(("\n"));
+       dbprintf("\n");
      } else if (options->compress == COMP_CUST) {
         compopt = skip_argument;
        comppid = pipespawn(options->clntcompprog, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
                            options->clntcompprog, compopt, NULL);
-       dbprintf(("%s: pid %ld: %s",
-                 debug_prefix_time("-gnutar-cust"), (long)comppid, options->clntcompprog));
+       dbprintf(_("gnutar-cust: pid %ld: %s"),
+               (long)comppid, options->clntcompprog);
        if(compopt != skip_argument) {
-           dbprintf((" %s", compopt));
+           dbprintf(" %s", compopt);
        }
-       dbprintf(("\n"));
+       dbprintf("\n");
     } else {
        dumpout = compout;
        comppid = -1;
@@ -213,11 +210,10 @@ start_backup(
     device = amname_to_devname(amdevice);
     fstype = amname_to_fstype(amdevice);
 
-    dbprintf(("%s: dumping device '%s' with '%s'\n",
-             debug_prefix_time(NULL), device, fstype));
+    dbprintf(_("dumping device '%s' with '%s'\n"), device, fstype);
 
 #if defined(USE_RUNDUMP) || !defined(DUMP)
-    cmd = vstralloc(libexecdir, "/", "rundump", versionsuffix(), NULL);
+    cmd = vstralloc(amlibexecdir, "/", "rundump", versionsuffix(), NULL);
     cmdX = cmd;
     if (g_options->config)
        config = g_options->config;
@@ -238,7 +234,7 @@ start_backup(
     if (1)
 #endif                                                 /* } */
     {
-        char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
+        char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
        cmdX = cmd;
        if (g_options->config)
@@ -283,7 +279,7 @@ start_backup(
 #endif
     {
 #ifdef USE_RUNDUMP
-        char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
+        char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
        cmdX = cmd;
        if (g_options->config)
@@ -334,7 +330,7 @@ start_backup(
     if (1)
 #endif
     {
-        char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump",
+        char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump",
                                            versionsuffix(), NULL);
        cmdX = cmd;
        if (g_options->config)
index 0aef9c707fc1f9ea98746dae0fddb211697dfc6d..c11b55c5a65947ea1984fba7b4ab7274c3f7aa54 100644 (file)
@@ -141,6 +141,7 @@ start_backup(
     int                mesgf,
     int                indexf)
 {
+    char tmppath[PATH_MAX];
     int dumpin, dumpout, compout;
     char *cmd = NULL;
     char *indexcmd = NULL;
@@ -153,7 +154,8 @@ start_backup(
     char *error_pn = NULL;
     char *compopt  = NULL;
     char *encryptopt = skip_argument;
-    char *quoted;
+    char *tquoted;
+    char *fquoted;
     char *qdisk;
     int infd, outfd;
     ssize_t nb;
@@ -164,10 +166,9 @@ start_backup(
     error_pn = stralloc2(get_pname(), "-smbclient");
 
     qdisk = quote_string(disk);
-    dbprintf(("%s: start: %s:%s lev %d\n",
-             get_pname(), host, qdisk, level));
+    dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level);
 
-    fprintf(stderr, "%s: start [%s:%s level %d]\n",
+    g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"),
            get_pname(), host, qdisk, level);
 
      /*  apply client-side encryption here */
@@ -175,8 +176,7 @@ start_backup(
          encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE,
                        &compout, &dataf, &mesgf, 
                        options->clnt_encrypt, encryptopt, NULL);
-         dbprintf(("%s: pid %ld: %s\n",
-                 debug_prefix_time("-gnutar"), (long)encpid, options->clnt_encrypt));
+         dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt);
     } else {
        compout = dataf;
        encpid = -1;
@@ -194,23 +194,24 @@ start_backup(
        comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
                            COMPRESS_PATH, compopt, NULL);
-       dbprintf(("%s: pid %ld: %s",
-                 debug_prefix_time("-gnutar"), (long)comppid, COMPRESS_PATH));
+       dbprintf(_("gnutar: pid %ld: %s"), (long)comppid, COMPRESS_PATH);
        if(compopt != skip_argument) {
-           dbprintf((" %s", compopt));
+           dbprintf(_("pid %ld: %s %s\n"),
+                       (long)comppid, COMPRESS_PATH, compopt);
+       } else {
+           dbprintf(_("pid %ld: %s\n"), (long)comppid, COMPRESS_PATH);
        }
-       dbprintf(("\n"));
      } else if (options->compress == COMP_CUST) {
         compopt = skip_argument;
        comppid = pipespawn(options->clntcompprog, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
                            options->clntcompprog, compopt, NULL);
-       dbprintf(("%s: pid %ld: %s",
-                 debug_prefix_time("-gnutar-cust"), (long)comppid, options->clntcompprog));
        if(compopt != skip_argument) {
-           dbprintf((" %s", compopt));
+           dbprintf(_("pid %ld: %s %s\n"),
+                    (long)comppid, options->clntcompprog, compopt);
+       } else {
+           dbprintf(_("pid %ld: %s\n"), (long)comppid, options->clntcompprog);
        }
-       dbprintf(("\n"));
     } else {
        dumpout = compout;
        comppid = -1;
@@ -228,27 +229,18 @@ start_backup(
     if (gnutar_list_dir) {
        char *basename = NULL;
        char number[NUM_STR_SIZE];
-       char *s;
-       int ch;
        char *inputname = NULL;
        int baselevel;
+       char *sdisk = sanitise_filename(disk);
 
        basename = vstralloc(gnutar_list_dir,
                             "/",
                             host,
-                            disk,
+                            sdisk,
                             NULL);
-       /*
-        * The loop starts at the first character of the host name,
-        * not the '/'.
-        */
-       s = basename + strlen(gnutar_list_dir) + 1;
-       while((ch = *s++) != '\0') {
-           if(ch == '/')
-               s[-1] = '_';
-       }
+       amfree(sdisk);
 
-       snprintf(number, SIZEOF(number), "%d", level);
+       g_snprintf(number, SIZEOF(number), "%d", level);
        incrname = vstralloc(basename, "_", number, ".new", NULL);
        unlink(incrname);
 
@@ -261,7 +253,7 @@ start_backup(
        infd = -1;
        while (infd == -1) {
            if (--baselevel >= 0) {
-               snprintf(number, SIZEOF(number), "%d", baselevel);
+               g_snprintf(number, SIZEOF(number), "%d", baselevel);
                inputname = newvstralloc(inputname,
                                         basename, "_", number, NULL);
            } else {
@@ -271,12 +263,11 @@ start_backup(
                int save_errno = errno;
                char *qname = quote_string(inputname);
 
-               dbprintf(("%s: error opening '%s': %s\n",
-                         debug_prefix_time("-gnutar"),
+               dbprintf(_("gnutar: error opening '%s': %s\n"),
                          qname,
-                         strerror(save_errno)));
+                         strerror(save_errno));
                if (baselevel < 0) {
-                   error("error [opening '%s': %s]", qname, strerror(save_errno));
+                   error(_("error [opening '%s': %s]"), qname, strerror(save_errno));
                    /*NOTREACHED*/
                }
                amfree(qname);
@@ -287,42 +278,43 @@ start_backup(
         * Copy the previous listed incremental file to the new one.
         */
        if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) {
-           error("error [opening '%s': %s]", incrname, strerror(errno));
+           error(_("error [opening '%s': %s]"), incrname, strerror(errno));
            /*NOTREACHED*/
        }
 
        while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) {
            if (fullwrite(outfd, &buf, (size_t)nb) < nb) {
-               error("error [writing to '%s': %s]", incrname,
+               error(_("error [writing to '%s': %s]"), incrname,
                       strerror(errno));
                /*NOTREACHED*/
            }
        }
 
        if (nb < 0) {
-           error("error [reading from '%s': %s]", inputname, strerror(errno));
+           error(_("error [reading from '%s': %s]"), inputname, strerror(errno));
            /*NOTREACHED*/
        }
 
        if (close(infd) != 0) {
-           error("error [closing '%s': %s]", inputname, strerror(errno));
+           error(_("error [closing '%s': %s]"), inputname, strerror(errno));
            /*NOTREACHED*/
        }
        if (close(outfd) != 0) {
-           error("error [closing '%s': %s]", incrname, strerror(errno));
+           error(_("error [closing '%s': %s]"), incrname, strerror(errno));
            /*NOTREACHED*/
        }
 
-       dbprintf(("%s: doing level %d dump as listed-incremental",
-                 debug_prefix_time("-gnutar"), level));
+       tquoted = quote_string(incrname);
        if(baselevel >= 0) {
-           quoted = quote_string(inputname);
-           dbprintf((" from '%s'", quoted));
-           amfree(quoted);
+           fquoted = quote_string(inputname);
+           dbprintf(_("doing level %d dump as listed-incremental from '%s' to '%s'\n"),
+                    level, fquoted, tquoted);
+           amfree(fquoted);
+       } else {
+           dbprintf(_("doing level %d dump as listed-incremental to '%s'\n"),
+                    level, tquoted);
        }
-       quoted = quote_string(incrname);
-       dbprintf((" to '%s'\n", quoted));
-       amfree(quoted);
+       amfree(tquoted);
        amfree(inputname);
        amfree(basename);
     }
@@ -331,7 +323,7 @@ start_backup(
 
     amandates_file = getconf_str(CNF_AMANDATES);
     if(!start_amandates(amandates_file, 0)) {
-       error("error [opening %s: %s]", amandates_file, strerror(errno));
+       error(_("error [opening %s: %s]"), amandates_file, strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -347,13 +339,13 @@ start_backup(
     free_amandates();
 
     gmtm = gmtime(&prev_dumptime);
-    snprintf(dumptimestr, SIZEOF(dumptimestr),
+    g_snprintf(dumptimestr, SIZEOF(dumptimestr),
                "%04d-%02d-%02d %2d:%02d:%02d GMT",
                gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday,
                gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec);
 
-    dbprintf(("%s: doing level %d dump from date: %s\n",
-             debug_prefix_time("-gnutar"), level, dumptimestr));
+    dbprintf(_("gnutar: doing level %d dump from date: %s\n"),
+             level, dumptimestr);
 
     dirname = amname_to_dirname(amdevice);
 
@@ -391,7 +383,7 @@ start_backup(
            amfree(subdir);
            set_pname(error_pn);
            amfree(error_pn);
-           error("cannot parse disk entry %s for share/subdir", qdisk);
+           error(_("cannot parse disk entry %s for share/subdir"), qdisk);
            /*NOTREACHED*/
        }
        if ((subdir) && (SAMBA_VERSION < 2)) {
@@ -399,7 +391,7 @@ start_backup(
            amfree(subdir);
            set_pname(error_pn);
            amfree(error_pn);
-           error("subdirectory specified for share %s but samba not v2 or better", qdisk);
+           error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk);
            /*NOTREACHED*/
        }
        if ((user_and_password = findpass(share, &domain)) == NULL) {
@@ -409,7 +401,7 @@ start_backup(
            }
            set_pname(error_pn);
            amfree(error_pn);
-           error("error [invalid samba host or password not found?]");
+           error(_("error [invalid samba host or password not found?]"));
            /*NOTREACHED*/
        }
        lpass = strlen(user_and_password);
@@ -422,7 +414,7 @@ start_backup(
            }
            set_pname(error_pn);
            amfree(error_pn);
-           error("password field not \'user%%pass\' for %s", qdisk);
+           error(_("password field not \'user%%pass\' for %s"), qdisk);
            /*NOTREACHED*/
        }
        *pwtext++ = '\0';
@@ -436,7 +428,7 @@ start_backup(
            }
            set_pname(error_pn);
            amfree(error_pn);
-           error("error [can't make share name of %s]", share);
+           error(_("error [can't make share name of %s]"), share);
            /*NOTREACHED*/
        }
 
@@ -454,11 +446,11 @@ start_backup(
            strappend(taropt, "a");
        }
 
-       dbprintf(("%s: backup of %s", debug_prefix_time("-gnutar"), sharename));
        if (subdir) {
-           dbprintf(("/%s",subdir));
+           dbprintf(_("gnutar: backup of %s/%s\n"), sharename, subdir);
+       } else {
+           dbprintf(_("gnutar: backup of %s\n"), sharename);
        }
-       dbprintf(("\n"));
 
        program->backup_name = program->restore_name = SAMBA_CLIENT;
        cmd = stralloc(program->backup_name);
@@ -502,7 +494,7 @@ start_backup(
            amfree(user_and_password);
            set_pname(error_pn);
            amfree(error_pn);
-           error("error [password write failed: %s]", strerror(save_errno));
+           error(_("error [password write failed: %s]"), strerror(save_errno));
            /*NOTREACHED*/
        }
        memset(user_and_password, '\0', lpass);
@@ -534,7 +526,7 @@ start_backup(
 
        my_argv = alloc(SIZEOF(char *) * (22 + (nb_exclude*2)+(nb_include*2)));
 
-       cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL);
+       cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL);
        info_tapeheader();
 
        start_index(options->createindex, dumpout, mesgf, indexf, indexcmd);
@@ -544,12 +536,17 @@ start_backup(
            my_argv[i++] = g_options->config;
        else
            my_argv[i++] = "NOCONFIG";
-       my_argv[i++] = "gtar";
+#ifdef GNUTAR
+       my_argv[i++] = GNUTAR;
+#else
+       my_argv[i++] = "tar";
+#endif
        my_argv[i++] = "--create";
        my_argv[i++] = "--file";
        my_argv[i++] = "-";
        my_argv[i++] = "--directory";
-       my_argv[i++] = dirname;
+       canonicalize_pathname(dirname, tmppath);
+       my_argv[i++] = tmppath;
        my_argv[i++] = "--one-file-system";
        if (gnutar_list_dir && incrname) {
            my_argv[i++] = "--listed-incremental";
@@ -591,10 +588,7 @@ start_backup(
        amfree(file_include);
        amfree(my_argv);
     }
-    dbprintf(("%s: %s: pid %ld\n",
-             debug_prefix_time("-gnutar"),
-             cmd,
-             (long)dumppid));
+    dbprintf(_("gnutar: %s: pid %ld\n"), cmd, (long)dumppid);
 
     amfree(qdisk);
     amfree(dirname);
@@ -624,7 +618,7 @@ end_backup(
            nodotnew = stralloc(incrname);
            nodotnew[strlen(nodotnew)-4] = '\0';
            if (rename(incrname, nodotnew)) {
-               fprintf(stderr, "%s: warning [renaming %s to %s: %s]\n"
+               g_fprintf(stderr, _("%s: warning [renaming %s to %s: %s]\n")
                        get_pname(), incrname, nodotnew, strerror(errno));
            }
            amfree(nodotnew);
@@ -632,7 +626,7 @@ end_backup(
        }
 
         if(!start_amandates(amandates_file, 1)) {
-           fprintf(stderr, "%s: warning [opening %s: %s]", get_pname(),
+           g_fprintf(stderr, _("%s: warning [opening %s: %s]"), get_pname(),
                    amandates_file, strerror(errno));
        }
        else {
index 9cfa39732d122407a17560461fb5338ea52fe63f..9f26dafe2e2d3ccf02db171a2da62cc57d227b12 100644 (file)
@@ -40,9 +40,9 @@
 #include "version.h"
 #include "conffile.h"
 
-#define sendbackup_debug(i,x) do {     \
+#define sendbackup_debug(i, ...) do {  \
        if ((i) <= debug_sendbackup) {  \
-           dbprintf(x);                \
+           dbprintf(__VA_LIST__);      \
        }                               \
 } while (0)
 
@@ -193,16 +193,22 @@ main(
     char *line = NULL;
     char *err_extra = NULL;
     char *s;
-    char *conffile;
     int i;
     int ch;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
     FILE *toolin;
     int status;
 
     /* initialize */
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2);
 
     safe_cd();
@@ -215,8 +221,6 @@ main(
     /* Don't die when interrupt received */
     signal(SIGINT, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     if(argc > 1 && strcmp(argv[1],"-t") == 0) {
        interactive = 1;
        argc--;
@@ -228,7 +232,7 @@ main(
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
     dbopen(DBG_SUBDIR_CLIENT);
     startclock();
-    dbprintf(("%s: version %s\n", get_pname(), version()));
+    dbprintf(_("Version %s\n"), version());
 
     if(argc > 2 && strcmp(argv[1], "amandad") == 0) {
        amandad_auth = stralloc(argv[2]);
@@ -237,12 +241,9 @@ main(
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
 
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    config_init(CONFIG_INIT_CLIENT, NULL);
+
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 
     if(interactive) {
        /*
@@ -251,7 +252,7 @@ main(
         * programs on the tape host are set up.  The index service is
         * run and goes to stdout.
         */
-       fprintf(stderr, "%s: running in interactive test mode\n", get_pname());
+       g_fprintf(stderr, _("%s: running in interactive test mode\n"), get_pname());
        fflush(stderr);
     }
 
@@ -267,7 +268,7 @@ main(
        if (line[0] == '\0')
            continue;
        if(interactive) {
-           fprintf(stderr, "%s> ", get_pname());
+           g_fprintf(stderr, "%s> ", get_pname());
            fflush(stderr);
        }
        if(strncmp_const(line, "OPTIONS ") == 0) {
@@ -279,31 +280,27 @@ main(
            }
 
            if (g_options->config) {
-               conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/",
-                                    "amanda-client.conf", NULL);
-               if (read_clientconf(conffile) > 0) {
-                   error("error reading conffile: %s", conffile);
-                   /*NOTREACHED*/
-               }
-               amfree(conffile);
+               /* overlay this configuration on the existing (nameless) configuration */
+               config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY,
+                           g_options->config);
 
-               dbrename(g_options->config, DBG_SUBDIR_CLIENT);
+               dbrename(config_name, DBG_SUBDIR_CLIENT);
            }
            continue;
        }
 
        if (prog != NULL) {
-           err_extra = "multiple requests";
+           err_extra = _("multiple requests");
            goto err;
        }
 
-       dbprintf(("  sendbackup req: <%s>\n", line));
+       dbprintf(_("  sendbackup req: <%s>\n"), line);
        s = line;
        ch = *s++;
 
        skip_whitespace(s, ch);                 /* find the program name */
        if(ch == '\0') {
-           err_extra = "no program name";
+           err_extra = _("no program name");
            goto err;                           /* no program name */
        }
        prog = s - 1;
@@ -324,7 +321,7 @@ main(
 
        skip_whitespace(s, ch);                 /* find the disk name */
        if(ch == '\0') {
-           err_extra = "no disk name";
+           err_extra = _("no disk name");
            goto err;                           /* no disk name */
        }
 
@@ -339,7 +336,7 @@ main(
 
        skip_whitespace(s, ch);                 /* find the device or level */
        if (ch == '\0') {
-           err_extra = "bad level";
+           err_extra = _("bad level");
            goto err;
        }
 
@@ -360,14 +357,14 @@ main(
        }
                                                /* find the level number */
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           err_extra = "bad level";
+           err_extra = _("bad level");
            goto err;                           /* bad level */
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the dump date */
        if(ch == '\0') {
-           err_extra = "no dumpdate";
+           err_extra = _("no dumpdate");
            goto err;                           /* no dumpdate */
        }
        amfree(dumpdate);
@@ -378,38 +375,43 @@ main(
 
        skip_whitespace(s, ch);                 /* find the options keyword */
        if(ch == '\0') {
-           err_extra = "no options";
+           err_extra = _("no options");
            goto err;                           /* no options */
        }
        if(strncmp_const_skip(s - 1, "OPTIONS ", s, ch) != 0) {
-           err_extra = "no OPTIONS keyword";
+           err_extra = _("no OPTIONS keyword");
            goto err;                           /* no options */
        }
        skip_whitespace(s, ch);                 /* find the options string */
        if(ch == '\0') {
-           err_extra = "bad options string";
+           err_extra = _("bad options string");
            goto err;                           /* no options */
        }
        amfree(stroptions);
        stroptions = stralloc(s - 1);
     }
     amfree(line);
+    if (g_options == NULL) {
+       printf(_("ERROR [Missing OPTIONS line in sendbackup input]\n"));
+       error(_("Missing OPTIONS line in sendbackup input\n"));
+       /*NOTREACHED*/
+    }
 
     if (prog       == NULL ||
        disk       == NULL ||
        amdevice   == NULL ||
        dumpdate   == NULL ||
        stroptions == NULL) {
-       err_extra = "no valid sendbackup request";
+       err_extra = _("no valid sendbackup request");
        goto err;
     }
        
-    dbprintf(("  parsed request as: program `%s'\n", prog));
-    dbprintf(("                     disk `%s'\n", qdisk));
-    dbprintf(("                     device `%s'\n", qamdevice));
-    dbprintf(("                     level %d\n", level));
-    dbprintf(("                     since %s\n", dumpdate));
-    dbprintf(("                     options `%s'\n", stroptions));
+    dbprintf(_("  Parsed request as: program `%s'\n"), prog);
+    dbprintf(_("                     disk `%s'\n"), qdisk);
+    dbprintf(_("                     device `%s'\n"), qamdevice);
+    dbprintf(_("                     level %d\n"), level);
+    dbprintf(_("                     since %s\n"), dumpdate);
+    dbprintf(_("                     options `%s'\n"), stroptions);
 
     if(program_is_backup_api==1) {
        /* check that the backup_api exist */
@@ -421,8 +423,8 @@ main(
            }
        }
        if (programs[i] == NULL) {
-           dbprintf(("ERROR [%s: unknown program %s]\n", get_pname(), prog));
-           error("ERROR [%s: unknown program %s]", get_pname(), prog);
+           dbprintf(_("ERROR [%s: unknown program %s]\n"), get_pname(), prog);
+           error(_("ERROR [%s: unknown program %s]"), get_pname(), prog);
            /*NOTREACHED*/
        }
        program = programs[i];
@@ -440,38 +442,41 @@ main(
 
     if(options->auth && amandad_auth) {
        if(strcasecmp(options->auth, amandad_auth) != 0) {
-           printf("ERROR [client configured for auth=%s while server requested '%s']\n",
+           g_printf(_("ERROR [client configured for auth=%s while server requested '%s']\n"),
                   amandad_auth, options->auth);
            exit(-1);
        }
     }
 
-    printf("CONNECT DATA %d MESG %d INDEX %d\n",
+    if (options->kencrypt) {
+       g_printf("KENCRYPT\n");
+    }
+
+    g_printf(_("CONNECT DATA %d MESG %d INDEX %d\n"),
           DATA_FD_OFFSET, DATA_FD_OFFSET+1,
           indexfd == -1 ? -1 : DATA_FD_OFFSET+2);
-    printf("OPTIONS ");
+    g_printf(_("OPTIONS "));
     if(am_has_feature(g_options->features, fe_rep_options_features)) {
-       printf("features=%s;", our_feature_string);
+       g_printf("features=%s;", our_feature_string);
     }
     if(am_has_feature(g_options->features, fe_rep_options_hostname)) {
-       printf("hostname=%s;", g_options->hostname);
+       g_printf("hostname=%s;", g_options->hostname);
     }
     if(am_has_feature(g_options->features, fe_rep_options_sendbackup_options)) {
-       printf("%s", optionstr(options));
+       g_printf("%s", optionstr(options));
     }
-    printf("\n");
+    g_printf("\n");
     fflush(stdout);
     if (freopen("/dev/null", "w", stdout) == NULL) {
-       dbprintf(("%s: error redirecting stdout to /dev/null: %s\n",
-           debug_prefix_time(NULL), strerror(errno)));
+       dbprintf(_("Error redirecting stdout to /dev/null: %s\n"),
+                strerror(errno));
         exit(1);
     }
 
     if(interactive) {
       if((datafd = open("/dev/null", O_RDWR)) < 0) {
-       s = strerror(errno);
-       error("ERROR [%s: open of /dev/null for debug data stream: %s]\n",
-                 get_pname(), s);
+       error(_("ERROR [open of /dev/null for debug data stream: %s]\n"),
+               strerror(errno));
        /*NOTREACHED*/
       }
       mesgfd = 2;
@@ -495,7 +500,7 @@ main(
        backup_support_option_t *bsu;
 
        if (pipe(property_pipe) < 0) {
-           error("Can't create pipe: %s",strerror(errno));
+           error(_("Can't create pipe: %s"),strerror(errno));
            /*NOTREACHED*/
        }
        bsu = backup_support_option(prog, g_options, disk, amdevice);
@@ -504,24 +509,27 @@ main(
        case 0:
            aclose(property_pipe[1]);
            if(dup2(property_pipe[0], 0) == -1) {
-               error("Can't dup2: %s",strerror(errno));
+               error(_("Can't dup2: %s"),strerror(errno));
                /*NOTREACHED*/
            }
            if(dup2(datafd, 1) == -1) {
-               error("Can't dup2: %s",strerror(errno));
+               error(_("Can't dup2: %s"),strerror(errno));
                /*NOTREACHED*/
            }
            if(dup2(mesgfd, 2) == -1) {
-               error("Can't dup2: %s",strerror(errno));
+               error(_("Can't dup2: %s"),strerror(errno));
                /*NOTREACHED*/
            }
            if(indexfd != 0) {
                if(dup2(indexfd, 3) == -1) {
-                   error("Can't dup2: %s",strerror(errno));
+                   error(_("Can't dup2: %s"),strerror(errno));
                    /*NOTREACHED*/
                }
                fcntl(indexfd, F_SETFD, 0);
                fcntl(3, F_SETFD, 0);
+               safe_fd(3, 1);
+           } else {
+               safe_fd(-1, 0);
            }
            cmd = vstralloc(DUMPER_DIR, "/", prog, NULL);
            i=0;
@@ -547,7 +555,7 @@ main(
            argvchild[i++] = amdevice;
            if (level <= bsu->max_level) {
                argvchild[i++] = "--level";
-               snprintf(levelstr,19,"%d",level);
+               g_snprintf(levelstr,19,"%d",level);
                argvchild[i++] = levelstr;
            }
            if (indexfd != 0 && bsu->index_line == 1) {
@@ -558,9 +566,9 @@ main(
                argvchild[i++] = "--record";
            }
            argvchild[i] = NULL;
-           dbprintf(("%s: running \"%s", get_pname(), cmd));
-           for(j=1;j<i;j++) dbprintf((" %s",argvchild[j]));
-           dbprintf(("\"\n"));
+           dbprintf(_("%s: running \"%s"), get_pname(), cmd);
+           for(j=1;j<i;j++) dbprintf(" %s",argvchild[j]);
+           dbprintf(_("\"\n"));
            backup_api_info_tapeheader(mesgfd, prog, options);
            execve(cmd, argvchild, safe_env());
            exit(1);
@@ -570,7 +578,7 @@ main(
            aclose(property_pipe[0]);
            toolin = fdopen(property_pipe[1],"w");
            if (!toolin) {
-               error("Can't fdopen: %s", strerror(errno));
+               error(_("Can't fdopen: %s"), strerror(errno));
                /*NOTREACHED*/
            }
            output_tool_property(toolin, options);
@@ -578,16 +586,16 @@ main(
            fclose(toolin);
            break;
        case -1:
-           error("%s: fork returned: %s", get_pname(), strerror(errno));
+           error(_("%s: fork returned: %s"), get_pname(), strerror(errno));
        }
        amfree(bsu);
        if (waitpid(backup_api_pid, &status, 0) < 0) {
            if (!WIFEXITED(status)) {
-               dbprintf(("Tool exited with signal %d", WTERMSIG(status)));
+               dbprintf(_("Tool exited with signal %d"), WTERMSIG(status));
            } else if (WEXITSTATUS(status) != 0) {
-               dbprintf(("Tool exited with status %d", WEXITSTATUS(status)));
+               dbprintf(_("Tool exited with status %d"), WEXITSTATUS(status));
            } else {
-               dbprintf(("waitpid returned negative value"));
+               dbprintf(_("waitpid returned negative value"));
            }
        }
      }
@@ -595,8 +603,8 @@ main(
        if(!interactive) {
            /* redirect stderr */
            if(dup2(mesgfd, 2) == -1) {
-               dbprintf(("%s: error redirecting stderr to fd %d: %s\n",
-                         debug_prefix_time(NULL), mesgfd, strerror(errno)));
+               dbprintf(_("Error redirecting stderr to fd %d: %s\n"),
+                        mesgfd, strerror(errno));
                dbclose();
                exit(1);
            }
@@ -604,15 +612,15 @@ main(
  
        if(pipe(mesgpipe) == -1) {
            s = strerror(errno);
-           dbprintf(("error [opening mesg pipe: %s]\n", s));
-           error("error [opening mesg pipe: %s]", s);
+           dbprintf(_("error [opening mesg pipe: %s]\n"), s);
+           error(_("error [opening mesg pipe: %s]"), s);
        }
 
        program->start_backup(g_options->hostname, disk, amdevice, level,
                              dumpdate, datafd, mesgpipe[1], indexfd);
-       dbprintf(("%s: started backup\n", debug_prefix_time(NULL)));
+       dbprintf(_("Started backup\n"));
        parse_backup_messages(mesgpipe[0]);
-       dbprintf(("%s: parsed backup messages\n", debug_prefix_time(NULL)));
+       dbprintf(_("Parsed backup messages\n"));
     }
 
     amfree(prog);
@@ -625,28 +633,17 @@ main(
     amfree(our_feature_string);
     am_release_feature_set(our_features);
     our_features = NULL;
-    am_release_feature_set(g_options->features);
-    g_options->features = NULL;
-    amfree(g_options->hostname);
-    amfree(g_options->str);
-    amfree(g_options);
+    free_g_options(g_options);
 
     dbclose();
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     return 0;
 
  err:
-    printf("FORMAT ERROR IN REQUEST PACKET\n");
-    dbprintf(("%s: REQ packet is bogus%s%s\n",
-             debug_prefix_time(NULL),
+    g_printf(_("FORMAT ERROR IN REQUEST PACKET\n"));
+    dbprintf(_("REQ packet is bogus%s%s\n"),
              err_extra ? ": " : "",
-             err_extra ? err_extra : ""));
+             err_extra ? err_extra : "");
     dbclose();
     return 1;
 }
@@ -683,8 +680,6 @@ check_status(
     char *thiserr = NULL;
     char *str, *strX;
     int ret, sig, rc;
-    char number[NUM_STR_SIZE];
-    char numberpid[NUM_STR_SIZE];
 
     str = childstr(pid);
 
@@ -703,7 +698,7 @@ check_status(
         * but the failure is noted.
         */
        if(ret != 0) {
-           fprintf(stderr, "? index %s returned %d\n", str, ret);
+           g_fprintf(stderr, _("? index %s returned %d\n"), str, ret);
            rc = 0;
        }
        indexpid = -1;
@@ -752,18 +747,15 @@ check_status(
        return 0;                               /* normal exit */
     }
 
-    snprintf(numberpid, SIZEOF(number), "%d", (int)pid);
     if(ret == 0) {
-       snprintf(number, SIZEOF(number), "%d", sig);
-       thiserr = vstralloc(strX, "(", numberpid, ") ", str, " got signal ", number, NULL);
+       thiserr = vstrallocf(_("%s (%d) %s got signal %d"), strX, (int)pid, str,
+                            sig);
     } else {
-       snprintf(number, SIZEOF(number), "%d", ret);
-       thiserr = vstralloc(strX, "(", numberpid, ") ", str, " returned ", number, NULL);
+       thiserr = vstrallocf(_("%s (%d) %s returned %d"), strX, (int)pid, str, ret);
     }
 
     if(errorstr) {
-       strappend(errorstr, ", ");
-       strappend(errorstr, thiserr);
+       errorstr =  newvstrallocf(errorstr, "%s, %s", errorstr, thiserr);
        amfree(thiserr);
     } else {
        errorstr = thiserr;
@@ -779,11 +771,11 @@ check_status(
 void
 info_tapeheader(void)
 {
-    fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name);
+    g_fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name);
 
-    fprintf(stderr, "%s: info RECOVER_CMD=", get_pname());
+    g_fprintf(stderr, "%s: info RECOVER_CMD=", get_pname());
     if (options->compress == COMP_FAST || options->compress == COMP_BEST)
-       fprintf(stderr, "%s %s |", UNCOMPRESS_PATH,
+       g_fprintf(stderr, "%s %s |", UNCOMPRESS_PATH,
 #ifdef UNCOMPRESS_OPT
                UNCOMPRESS_OPT
 #else
@@ -791,13 +783,13 @@ info_tapeheader(void)
 #endif
                );
 
-    fprintf(stderr, "%s -xpGf - ...\n", program->restore_name);
+    g_fprintf(stderr, "%s -xpGf - ...\n", program->restore_name);
 
     if (options->compress == COMP_FAST || options->compress == COMP_BEST)
-       fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n",
+       g_fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n",
                        get_pname(), COMPRESS_SUFFIX);
 
-    fprintf(stderr, "%s: info end\n", get_pname());
+    g_fprintf(stderr, "%s: info end\n", get_pname());
 }
 
 void
@@ -808,26 +800,26 @@ backup_api_info_tapeheader(
 {
     char line[1024];
 
-    snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname());
+    g_snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname());
     if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
        return;
     }
 
-    snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog);
+    g_snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog);
     if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
        return;
     }
 
-    snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname());
+    g_snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname());
     if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
        return;
     }
 
     if (options->compress) {
-       snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH,
+       g_snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH,
 #ifdef UNCOMPRESS_OPT
                 UNCOMPRESS_OPT
 #else
@@ -835,28 +827,28 @@ backup_api_info_tapeheader(
 #endif
                 );
        if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-           dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+           dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
            return;
        }
     }
-    snprintf(line, 1024, "%s -f... -\n", prog);
+    g_snprintf(line, 1024, "%s -f... -\n", prog);
     if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
        return;
     }
 
     if (options->compress) {
-       snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n",
+       g_snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n",
                 get_pname(), COMPRESS_SUFFIX);
        if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-           dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+           dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
            return;
        }
     }
 
-    snprintf(line, 1024, "%s: info end\n", get_pname());
+    g_snprintf(line, 1024, "%s: info end\n", get_pname());
     if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
-       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno));
        return;
     }
 }
@@ -872,17 +864,16 @@ pipefork(
     int inpipe[2];
     pid_t pid;
 
-    dbprintf(("%s: forking function %s in pipeline\n",
-       debug_prefix_time(NULL), fname));
+    dbprintf(_("Forking function %s in pipeline\n"), fname);
 
     if(pipe(inpipe) == -1) {
-       error("error [open pipe to %s: %s]", fname, strerror(errno));
+       error(_("error [open pipe to %s: %s]"), fname, strerror(errno));
        /*NOTREACHED*/
     }
 
     switch(pid = fork()) {
     case -1:
-       error("error [fork %s: %s]", fname, strerror(errno));
+       error(_("error [fork %s: %s]"), fname, strerror(errno));
        /*NOTREACHED*/
     default:   /* parent process */
        aclose(inpipe[0]);      /* close input side of pipe */
@@ -892,17 +883,17 @@ pipefork(
        aclose(inpipe[1]);      /* close output side of pipe */
 
        if(dup2(inpipe[0], 0) == -1) {
-           error("error [fork %s: dup2(%d, in): %s]",
+           error(_("error [fork %s: dup2(%d, in): %s]"),
                  fname, inpipe[0], strerror(errno));
            /*NOTRACHED*/
        }
        if(dup2(stdoutfd, 1) == -1) {
-           error("error [fork %s: dup2(%d, out): %s]",
+           error(_("error [fork %s: dup2(%d, out): %s]"),
                  fname, stdoutfd, strerror(errno));
            /*NOTRACHED*/
        }
        if(dup2(stderrfd, 2) == -1) {
-           error("error [fork %s: dup2(%d, err): %s]",
+           error(_("error [fork %s: dup2(%d, err): %s]"),
                  fname, stderrfd, strerror(errno));
            /*NOTRACHED*/
        }
@@ -931,7 +922,7 @@ parse_backup_messages(
     }
 
     if(errno) {
-       error("error [read mesg pipe: %s]", strerror(errno));
+       error(_("error [read mesg pipe: %s]"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -946,13 +937,13 @@ parse_backup_messages(
        }
     }
     if (dumppid != -1) {
-       dbprintf(("%s: Sending SIGHUP to dump process %d\n",
-                 debug_prefix_time(NULL), (int)dumppid));
+       dbprintf(_("Sending SIGHUP to dump process %d\n"),
+                 (int)dumppid);
        if(dumppid != -1) {
            if(kill(dumppid, SIGHUP) == -1) {
-               dbprintf(("%s: Can't send SIGHUP to %d: %s\n",
-                         debug_prefix_time(NULL), (int)dumppid,
-                         strerror(errno)));
+               dbprintf(_("Can't send SIGHUP to %d: %s\n"),
+                         (int)dumppid,
+                         strerror(errno));
            }
        }
        sleep(5);
@@ -961,13 +952,13 @@ parse_backup_messages(
        }
     }
     if (dumppid != -1) {
-       dbprintf(("%s: Sending SIGKILL to dump process %d\n",
-                 debug_prefix_time(NULL), (int)dumppid));
+       dbprintf(_("Sending SIGKILL to dump process %d\n"),
+                 (int)dumppid);
        if(dumppid != -1) {
            if(kill(dumppid, SIGKILL) == -1) {
-               dbprintf(("%s: Can't send SIGKILL to %d: %s\n",
-                         debug_prefix_time(NULL), (int)dumppid,
-                         strerror(errno)));
+               dbprintf(_("Can't send SIGKILL to %d: %s\n"),
+                         (int)dumppid,
+                         strerror(errno));
            }
        }
        sleep(5);
@@ -977,17 +968,17 @@ parse_backup_messages(
     }
 
     if(errorstr) {
-       error("error [%s]", errorstr);
+       error(_("error [%s]"), errorstr);
        /*NOTREACHED*/
     } else if(dump_size == -1) {
-       error("error [no backup size line]");
+       error(_("error [no backup size line]"));
        /*NOTREACHED*/
     }
 
     program->end_backup(goterror);
 
-    fprintf(stderr, "%s: size %ld\n", get_pname(), dump_size);
-    fprintf(stderr, "%s: end\n", get_pname());
+    g_fprintf(stderr, _("%s: size %ld\n"), get_pname(), dump_size);
+    g_fprintf(stderr, _("%s: end\n"), get_pname());
 }
 
 
@@ -1061,13 +1052,12 @@ process_dumpline(
        startchr = '!';
        break;
     }
-    dbprintf(("%s: %3d: %7s(%c): %s\n",
-             debug_prefix_time(NULL),
+    dbprintf("%3d: %7s(%c): %s\n",
              rp->srcline,
              type,
              startchr,
-             str));
-    fprintf(stderr, "%c %s\n", startchr, str);
+             str);
+    g_fprintf(stderr, "%c %s\n", startchr, str);
 }
 
 
@@ -1101,13 +1091,11 @@ save_fd(
   while (*fd >= 0 && *fd < min) {
     int newfd = dup(*fd);
     if (newfd == -1)
-      dbprintf(("%s: unable to save file descriptor [%s]\n",
-       debug_prefix_time(NULL), strerror(errno)));
+      dbprintf(_("Unable to save file descriptor [%s]\n"), strerror(errno));
     *fd = newfd;
   }
   if (origfd != *fd)
-    dbprintf(("%s: dupped file descriptor %i to %i\n",
-      debug_prefix_time(NULL), origfd, *fd));
+    dbprintf(_("Dupped file descriptor %i to %i\n"), origfd, *fd);
 }
 
 void
@@ -1126,19 +1114,19 @@ start_index(
     return;
 
   if (pipe(pipefd) != 0) {
-    error("creating index pipe: %s", strerror(errno));
+    error(_("creating index pipe: %s"), strerror(errno));
     /*NOTREACHED*/
   }
 
   switch(indexpid = fork()) {
   case -1:
-    error("forking index tee process: %s", strerror(errno));
+    error(_("forking index tee process: %s"), strerror(errno));
     /*NOTREACHED*/
 
   default:
     aclose(pipefd[0]);
     if (dup2(pipefd[1], input) == -1) {
-      error("dup'ping index tee output: %s", strerror(errno));
+      error(_("dup'ping index tee output: %s"), strerror(errno));
       /*NOTREACHED*/
     }
     aclose(pipefd[1]);
@@ -1157,19 +1145,18 @@ start_index(
   dup2(index, 1);
   dup2(mesg, 2);
   dup2(input, 3);
-  for(index = 4; index < FD_SETSIZE; index++) {
+  for(index = 4; index < (int)FD_SETSIZE; index++) {
     if (index != dbfd()) {
       close(index);
     }
   }
 
   if ((pipe_fp = popen(cmd, "w")) == NULL) {
-    error("couldn't start index creator [%s]", strerror(errno));
+    error(_("couldn't start index creator [%s]"), strerror(errno));
     /*NOTREACHED*/
   }
 
-  dbprintf(("%s: started index creator: \"%s\"\n",
-    debug_prefix_time(NULL), cmd));
+  dbprintf(_("Started index creator: \"%s\"\n"), cmd);
   while(1) {
     char buffer[BUFSIZ], *ptr;
     ssize_t bytes_read;
@@ -1181,7 +1168,7 @@ start_index(
     } while ((bytes_read < 0) && ((errno == EINTR) || (errno == EAGAIN)));
 
     if (bytes_read < 0) {
-      error("index tee cannot read [%s]", strerror(errno));
+      error(_("index tee cannot read [%s]"), strerror(errno));
       /*NOTREACHED*/
     }
 
@@ -1197,8 +1184,8 @@ start_index(
         * just as we waited for write() to complete.
         */
        if (errno != EPIPE) {
-           dbprintf(("%s: index tee cannot write to index creator [%s]\n",
-                           debug_prefix_time(NULL), strerror(errno)));
+           dbprintf(_("Index tee cannot write to index creator [%s]\n"),
+                           strerror(errno));
        }
     } else {
        bytes_written += just_written;
@@ -1211,7 +1198,7 @@ start_index(
     bytes_written = 0;
     just_written = fullwrite(3, ptr, (size_t)bytes_read);
     if (just_written < 0) {
-       error("index tee cannot write [%s]", strerror(errno));
+       error(_("index tee cannot write [%s]"), strerror(errno));
        /*NOTREACHED*/
     } else {
        bytes_written += just_written;
@@ -1224,10 +1211,11 @@ start_index(
   /* finished */
   /* check the exit code of the pipe and moan if not 0 */
   if ((exitcode = pclose(pipe_fp)) != 0) {
-    dbprintf(("%s: index pipe returned %d\n",
-      debug_prefix_time(NULL), exitcode));
+    char *exitstr = str_exit_status("Index pipe", exitcode);
+    dbprintf("%s\n", exitstr);
+    amfree(exitstr);
   } else {
-    dbprintf(("%s: index created successfully\n", debug_prefix_time(NULL)));
+    dbprintf(_("Index created successfully\n"));
   }
   pipe_fp = NULL;
 
index aec977e13d65b5649614f7d4d71174bfd33a0eb6..97b28571ad5bcd7120effd66359b4ab13957a89b 100644 (file)
 #include "findpass.h"
 #endif
 
-#define sendsize_debug(i,x) do {       \
+#define sendsize_debug(i, ...) do {    \
        if ((i) <= debug_sebdsize) {    \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
 #ifdef HAVE_SETPGID
 #  define SETPGRP      setpgid(getpid(), getpid())
 #  define SETPGRP_FAILED() do {                                                \
-    dbprintf(("setpgid(%ld,%ld) failed: %s\n",                         \
-             (long)getpid(), (long)getpid(), strerror(errno)));        \
+    dbprintf(_("setpgid(%ld,%ld) failed: %s\n"),                               \
+             (long)getpid(), (long)getpid(), strerror(errno)); \
 } while(0)
 
 #else /* () line 0 */
 #if defined(SETPGRP_VOID)
 #  define SETPGRP      setpgrp()
 #  define SETPGRP_FAILED() do {                                                \
-    dbprintf(("setpgrp() failed: %s\n", strerror(errno)));             \
+    dbprintf(_("setpgrp() failed: %s\n"), strerror(errno));            \
 } while(0)
 
 #else
 #  define SETPGRP      setpgrp(0, getpid())
 #  define SETPGRP_FAILED() do {                                                \
-    dbprintf(("setpgrp(0,%ld) failed: %s\n",                           \
-             (long)getpid(), strerror(errno)));                        \
+    dbprintf(_("setpgrp(0,%ld) failed: %s\n"),                         \
+             (long)getpid(), strerror(errno));                 \
 } while(0)
 
 #endif
@@ -144,19 +144,23 @@ main(
     char *qlist = NULL;
     char *amdevice = NULL;
     char *qamdevice = NULL;
-    char *conffile;
     char *amandates_file;
     int   amandates_read = 0;
-#if defined(USE_DBMALLOC)
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-#endif
 
     (void)argc;        /* Quiet unused parameter warning */
     (void)argv;        /* Quiet unused parameter warning */
 
     /* initialize */
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     safe_fd(-1, 0);
     safe_cd();
 
@@ -165,26 +169,17 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-#if defined(USE_DBMALLOC)
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-#endif
-
     erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG);
     dbopen(DBG_SUBDIR_CLIENT);
     startclock();
-    dbprintf(("%s: version %s\n", get_pname(), version()));
+    dbprintf(_("version %s\n"), version());
 
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
 
-    set_debug_prefix_pid(getpid());
+    config_init(CONFIG_INIT_CLIENT, NULL);
 
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_CLIENT_LOGIN);
 
     /* handle all service requests */
 
@@ -199,29 +194,25 @@ main(
                g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0';
            }
 
-           printf("OPTIONS ");
+           g_printf("OPTIONS ");
            if(am_has_feature(g_options->features, fe_rep_options_features)) {
-               printf("features=%s;", our_feature_string);
+               g_printf("features=%s;", our_feature_string);
            }
            if(am_has_feature(g_options->features, fe_rep_options_maxdumps)) {
-               printf("maxdumps=%d;", g_options->maxdumps);
+               g_printf("maxdumps=%d;", g_options->maxdumps);
            }
            if(am_has_feature(g_options->features, fe_rep_options_hostname)) {
-               printf("hostname=%s;", g_options->hostname);
+               g_printf("hostname=%s;", g_options->hostname);
            }
-           printf("\n");
+           g_printf("\n");
            fflush(stdout);
 
            if (g_options->config) {
-               conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/",
-                                    "amanda-client.conf", NULL);
-               if (read_clientconf(conffile) > 0) {
-                   error("error reading conffile: %s", conffile);
-                   /*NOTREACHED*/
-               }
-               amfree(conffile);
+               /* overlay this configuration on the existing (nameless) configuration */
+               config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY,
+                           g_options->config);
 
-               dbrename(g_options->config, DBG_SUBDIR_CLIENT);
+               dbrename(config_name, DBG_SUBDIR_CLIENT);
            }
 
            continue;
@@ -240,7 +231,7 @@ main(
 
        skip_whitespace(s, ch);                 /* find the program name */
        if(ch == '\0') {
-           err_extra = stralloc("no program name");
+           err_extra = stralloc(_("no program name"));
            goto err;                           /* no program name */
        }
        prog = s - 1;
@@ -251,7 +242,7 @@ main(
        if(strncmp_const(prog, "CALCSIZE") == 0) {
            skip_whitespace(s, ch);             /* find the program name */
            if(ch == '\0') {
-               err_extra = stralloc("no program name");
+               err_extra = stralloc(_("no program name"));
                goto err;
            }
            calcprog = s - 1;
@@ -284,7 +275,7 @@ main(
 
        skip_whitespace(s, ch);                 /* find the disk name */
        if(ch == '\0') {
-           err_extra = stralloc("no disk name");
+           err_extra = stralloc(_("no disk name"));
            goto err;                           /* no disk name */
        }
 
@@ -301,7 +292,7 @@ main(
 
        skip_whitespace(s, ch);                 /* find the device or level */
        if (ch == '\0') {
-           err_extra = stralloc("bad level");
+           err_extra = stralloc(_("bad level"));
            goto err;
        }
        if(!isdigit((int)s[-1])) {
@@ -319,18 +310,18 @@ main(
 
                                                /* find the level number */
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           err_extra = stralloc("bad level");
+           err_extra = stralloc(_("bad level"));
            goto err;                           /* bad level */
        }
        if (level < 0 || level >= DUMP_LEVELS) {
-           err_extra = stralloc("bad level");
+           err_extra = stralloc(_("bad level"));
            goto err;
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the dump date */
        if(ch == '\0') {
-           err_extra = stralloc("no dumpdate");
+           err_extra = stralloc(_("no dumpdate"));
            goto err;                           /* no dumpdate */
        }
        dumpdate = s - 1;
@@ -343,7 +334,7 @@ main(
        skip_whitespace(s, ch);                 /* find the spindle */
        if(ch != '\0') {
            if(sscanf(s - 1, "%d", &spindle) != 1) {
-               err_extra = stralloc("bad spindle");
+               err_extra = stralloc(_("bad spindle"));
                goto err;                       /* bad spindle */
            }
            skip_integer(s, ch);
@@ -382,8 +373,7 @@ main(
                                append_sl(options->include_list, qlist);
                            amfree(qlist);
                        } else {
-                           err_extra = vstralloc("Invalid parameter (",
-                               s-1, ")", NULL);
+                           err_extra = vstrallocf(_("Invalid parameter (%s)"), s-1);
                            goto err;           /* should have gotten to end */
                        }
                        skip_quoted_string(s, ch);
@@ -411,7 +401,8 @@ main(
        amfree(qamdevice);
     }
     if (g_options == NULL) {
-       error("Missing OPTIONS line in sendsize input\n");
+       printf(_("ERROR [Missing OPTIONS line in sendsize input]\n"));
+       error(_("Missing OPTIONS line in sendsize input\n"));
        /*NOTREACHED*/
     }
     amfree(line);
@@ -431,31 +422,24 @@ main(
        if(need_wait) {
            pid_t child_pid;
            amwait_t child_status;
-           int exit_code;
 
            need_wait = 0;
-           dbprintf(("%s: waiting for any estimate child: %d running\n",
-                     debug_prefix_time(NULL), dumpsrunning));
+           dbprintf(_("waiting for any estimate child: %d running\n"),
+                     dumpsrunning);
            child_pid = wait(&child_status);
            if(child_pid == -1) {
-               error("wait failed: %s", strerror(errno));
+               error(_("wait failed: %s"), strerror(errno));
                /*NOTREACHED*/
            }
-           if(WIFSIGNALED(child_status)) {
-               dbprintf(("%s: child %ld terminated with signal %d\n",
-                         debug_prefix_time(NULL),
-                         (long) child_pid, WTERMSIG(child_status)));
-           } else {
-               exit_code = WEXITSTATUS(child_status);
-               if(exit_code == 0) {
-                   dbprintf(("%s: child %ld terminated normally\n",
-                             debug_prefix_time(NULL), (long) child_pid));
-               } else {
-                   dbprintf(("%s: child %ld terminated with code %d\n",
-                             debug_prefix_time(NULL),
-                             (long) child_pid, exit_code));
-               }
+
+           if (!WIFEXITED(child_status) || WEXITSTATUS(child_status) != 0) {
+               char *child_name = vstrallocf(_("child %ld"), (long)child_pid);
+               char *child_status_str = str_exit_status(child_name, child_status);
+               dbprintf("%s\n", child_status_str);
+               amfree(child_status_str);
+               amfree(child_name);
            }
+
            /*
             * Find the child and mark it done.
             */
@@ -465,8 +449,7 @@ main(
                }
            }
            if(est == NULL) {
-               dbprintf(("%s: unexpected child %ld\n",
-                         debug_prefix_time(NULL), (long)child_pid));
+               dbprintf(_("unexpected child %ld\n"), (long)child_pid);
            } else {
                est->done = 1;
                est->child = 0;
@@ -521,11 +504,10 @@ main(
        } else {
            done = 0;
            if((est->child = fork()) == 0) {
-               set_debug_prefix_pid(getpid());
                calc_estimates(est);            /* child does the estimate */
                exit(0);
            } else if(est->child == -1) {
-               error("calc_estimates fork failed: %s", strerror(errno));
+               error(_("calc_estimates fork failed: %s"), strerror(errno));
                /*NOTREACHED*/
            }
            dumpsrunning++;                     /* parent */
@@ -542,29 +524,18 @@ main(
     amfree(our_feature_string);
     am_release_feature_set(our_features);
     our_features = NULL;
-    am_release_feature_set(g_options->features);
-    g_options->features = NULL;
-    amfree(g_options->hostname);
-    amfree(g_options->str);
-    amfree(g_options);
-
-#if defined(USE_DBMALLOC)
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(dbfd(), malloc_hist_1, malloc_hist_2);
-    }
-#endif
+    free_g_options(g_options);
 
     dbclose();
     return 0;
  err:
-    printf("FORMAT ERROR IN REQUEST PACKET\n");
-    dbprintf(("%s: REQ packet is bogus%s%s\n",
-             debug_prefix_time(NULL),
-             err_extra ? ": " : "",
-             err_extra ? err_extra : ""));
-    amfree(err_extra);
+    g_printf(_("FORMAT ERROR IN REQUEST PACKET\n"));
+    if (err_extra) {
+       dbprintf(_("REQ packet is bogus: %s\n"), err_extra);
+       amfree(err_extra);
+    } else {
+       dbprintf(_("REQ packet is bogus\n"));
+    }
     dbclose();
     return 1;
 }
@@ -674,9 +645,8 @@ void
 calc_estimates(
     disk_estimates_t * est)
 {
-    dbprintf(("%s: calculating for amname %s, dirname %s, spindle %d\n",
-             debug_prefix_time(NULL),
-             est->qamname, est->qdirname, est->spindle));
+    dbprintf(_("calculating for amname %s, dirname %s, spindle %d\n"),
+             est->qamname, est->qdirname, est->spindle);
        
     if(est->program_is_backup_api ==  1)
        backup_api_calc_estimate(est);
@@ -699,16 +669,14 @@ calc_estimates(
 #endif
 #ifdef SAMBA_CLIENT
          if (est->amdevice[0] == '/' && est->amdevice[1] == '/')
-           dbprintf(("%s: Can't use CALCSIZE for samba estimate: %s %s\n",
-                     debug_prefix_time(NULL),
-                     est->qamname, est->qdirname));
+           dbprintf(_("Can't use CALCSIZE for samba estimate: %s %s\n"),
+                     est->qamname, est->qdirname);
          else
 #endif
            generic_calc_estimates(est);
 
-    dbprintf(("%s: done with amname %s dirname %s spindle %d\n",
-             debug_prefix_time(NULL),
-             est->qamname, est->qdirname, est->spindle));
+    dbprintf(_("done with amname %s dirname %s spindle %d\n"),
+             est->qamname, est->qdirname, est->spindle);
 }
 
 /*
@@ -738,23 +706,22 @@ backup_api_calc_estimate(
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if (est->est[level].needestimate) {
-           dbprintf(("%s: getting size via backup-api for %s %s level %d\n",
-                     debug_prefix_time(NULL), est->qamname, est->qamdevice,
-                     level));
+           dbprintf(_("getting size via application API for %s %s level %d\n"),
+                     est->qamname, est->qamdevice, level);
            size = getsize_backup_api(est->program, est->amname, est->amdevice,
                                      level, est->options,
                                      est->est[level].dumpsince, &errmsg);
 
            amflock(1, "size");
 
-           printf("%s %d SIZE " OFF_T_FMT "\n", est->qamname, level,
-                  (OFF_T_FMT_TYPE)size);
+           g_printf(_("%s %d SIZE %lld\n"), est->qamname, level,
+                  (long long)size);
            if (errmsg && errmsg[0] != '\0') {
                if(am_has_feature(g_options->features,
                                  fe_rep_sendsize_quoted_error)) {
                    qerrmsg = quote_string(errmsg);
-                   dbprintf(("errmsg is %s\n", errmsg));
-                   printf("%s %d ERROR %s\n",
+                   dbprintf(_("errmsg is %s\n"), errmsg);
+                   g_printf(_("%s %d ERROR %s\n"),
                           est->qamname, level, qerrmsg);
                    amfree(qerrmsg);
                }
@@ -774,6 +741,7 @@ generic_calc_estimates(
 {
     int pipefd = -1, nullfd = -1;
     char *cmd;
+    char *cmdline;
     char *my_argv[DUMP_LEVELS*2+22];
     char number[NUM_STR_SIZE];
     int i, level, my_argc;
@@ -789,8 +757,9 @@ generic_calc_estimates(
     char *match_expr;
     amwait_t wait_status;
     char *errmsg = NULL, *qerrmsg;
+    char tmppath[PATH_MAX];
 
-    cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL);
+    cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL);
 
     my_argc = 0;
 
@@ -803,7 +772,8 @@ generic_calc_estimates(
     my_argv[my_argc++] = stralloc(est->calcprog);
 
     my_argv[my_argc++] = stralloc(est->amname);
-    my_argv[my_argc++] = stralloc(est->dirname);
+    canonicalize_pathname(est->dirname, tmppath);
+    my_argv[my_argc++] = stralloc(tmppath);
 
 
     if(est->options->exclude_file)
@@ -833,30 +803,32 @@ generic_calc_estimates(
     }
     start_time = curclock();
 
-    dbprintf(("%s: running cmd: %s", debug_prefix_time(NULL), my_argv[0]));
-    for(i=0; i<my_argc; ++i)
-       dbprintf((" %s", my_argv[i]));
+    cmdline = stralloc(my_argv[0]);
+    for(i = 1; i < my_argc; i++)
+       cmdline = vstrextend(&cmdline, " ", my_argv[i], NULL);
+    dbprintf(_("running: \"%s\"\n"), cmdline);
+    amfree(cmdline);
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if(est->est[level].needestimate) {
-           snprintf(number, SIZEOF(number), "%d", level);
+           g_snprintf(number, SIZEOF(number), "%d", level);
            my_argv[my_argc++] = stralloc(number); 
-           dbprintf((" %s", number));
-           snprintf(number, SIZEOF(number),
+           dbprintf(" %s", number);
+           g_snprintf(number, SIZEOF(number),
                        "%ld", (long)est->est[level].dumpsince);
            my_argv[my_argc++] = stralloc(number); 
-           dbprintf((" %s", number));
+           dbprintf(" %s", number);
        }
     }
     my_argv[my_argc] = NULL;
-    dbprintf(("\n"));
+    dbprintf("\n");
 
     fflush(stderr); fflush(stdout);
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       errmsg = vstrallocf("Cannot access /dev/null : %s",
+       errmsg = vstrallocf(_("Cannot access /dev/null : %s"),
                            strerror(errno));
-       dbprintf(("%s\n", errmsg));
+       dbprintf("%s\n", errmsg);
        goto common_exit;
     }
 
@@ -865,61 +837,59 @@ generic_calc_estimates(
 
     dumpout = fdopen(pipefd,"r");
     if (!dumpout) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
-    match_expr = vstralloc(est->qamname," %d SIZE " OFF_T_FMT, NULL);
+    match_expr = vstralloc(est->qamname," %d SIZE %lld", NULL);
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
-       OFF_T_FMT_TYPE size_ = (OFF_T_FMT_TYPE)0;
+       long long size_ = (long long)0;
        if (line[0] == '\0')
            continue;
        if(sscanf(line, match_expr, &level, &size_) == 2) {
-           printf("%s\n", line); /* write to amandad */
-           dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-                     debug_prefix_time(NULL),
+           g_printf("%s\n", line); /* write to amandad */
+           dbprintf(_("estimate size for %s level %d: %lld KB\n"),
                      est->qamname,
                      level,
-                     size_));
+                     size_);
        }
        size = (off_t)size_;
     }
     amfree(match_expr);
 
-    dbprintf(("%s: waiting for %s %s child (pid=%d)\n",
-             debug_prefix_time(NULL), my_argv[0], est->qamdevice, calcpid));
+    dbprintf(_("waiting for %s %s child (pid=%d)\n"),
+             my_argv[0], est->qamdevice, (int)calcpid);
     waitpid(calcpid, &wait_status, 0);
     if (WIFSIGNALED(wait_status)) {
-       errmsg = vstrallocf("%s terminated with signal %d: see %s",
+       errmsg = vstrallocf(_("%s terminated with signal %d: see %s"),
                            "calcsize", WTERMSIG(wait_status),
-                           debug_fn());
+                           dbfn());
     } else if (WIFEXITED(wait_status)) {
        if (WEXITSTATUS(wait_status) != 0) {
-           errmsg = vstrallocf("%s exited with status %d: see %s",
+           errmsg = vstrallocf(_("%s exited with status %d: see %s"),
                                "calcsize", WEXITSTATUS(wait_status),
-                               debug_fn());
+                               dbfn());
        } else {
            /* Normal exit */
        }
     } else {
-       errmsg = vstrallocf("%s got bad exit: see %s",
-                            "calcsize", debug_fn());
+       errmsg = vstrallocf(_("%s got bad exit: see %s"),
+                            "calcsize", dbfn());
     }
-    dbprintf(("%s: after %s %s wait: child pid=%d status=%d\n",
-             debug_prefix_time(NULL), my_argv[0], est->qamdevice,
-             calcpid, WEXITSTATUS(wait_status)));
+    dbprintf(_("after %s %s wait: child pid=%d status=%d\n"),
+             my_argv[0], est->qamdevice,
+             (int)calcpid, WEXITSTATUS(wait_status));
 
-    dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-    dbprintf(("%s: estimate time for %s: %s\n",
-             debug_prefix_time(NULL),
+    dbprintf(_(".....\n"));
+    dbprintf(_("estimate time for %s: %s\n"),
              est->qamname,
-             walltime_str(timessub(curclock(), start_time))));
+             walltime_str(timessub(curclock(), start_time)));
 
 common_exit:
     if (errmsg && errmsg[0] != '\0') {
        if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) {
            qerrmsg = quote_string(errmsg);
-           dbprintf(("errmsg is %s\n", errmsg));
-           printf("%s %d ERROR %s\n",
+           dbprintf(_("errmsg is %s\n"), errmsg);
+           g_printf("%s %d ERROR %s\n",
                    est->qamname, 0, qerrmsg);
            amfree(qerrmsg);
        }
@@ -942,21 +912,21 @@ dump_calc_estimates(
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if(est->est[level].needestimate) {
-           dbprintf(("%s: getting size via dump for %s level %d\n",
-                     debug_prefix_time(NULL), est->qamname, level));
+           dbprintf(_("getting size via dump for %s level %d\n"),
+                     est->qamname, level);
            size = getsize_dump(est->amname, est->amdevice,
                                level, est->options, &errmsg);
 
            amflock(1, "size");
 
-           printf("%s %d SIZE " OFF_T_FMT "\n",
-                  est->qamname, level, (OFF_T_FMT_TYPE)size);
+           g_printf(_("%s %d SIZE %lld\n"),
+                  est->qamname, level, (long long)size);
            if (errmsg && errmsg[0] != '\0') {
                if(am_has_feature(g_options->features,
                                  fe_rep_sendsize_quoted_error)) {
                    qerrmsg = quote_string(errmsg);
-                   dbprintf(("errmsg is %s\n", errmsg));
-                   printf("%s %d ERROR %s\n",
+                   dbprintf(_("errmsg is %s\n"), errmsg);
+                   g_printf("%s %d ERROR %s\n",
                           est->qamname, level, qerrmsg);
                    amfree(qerrmsg);
                }
@@ -980,21 +950,21 @@ smbtar_calc_estimates(
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if(est->est[level].needestimate) {
-           dbprintf(("%s: getting size via smbclient for %s level %d\n",
-                     debug_prefix_time(NULL), est->qamname, level));
+           dbprintf(_("getting size via smbclient for %s level %d\n"),
+                     est->qamname, level);
            size = getsize_smbtar(est->amname, est->amdevice, level,
                                  est->options, &errmsg);
 
            amflock(1, "size");
 
-           printf("%s %d SIZE " OFF_T_FMT "\n",
-                  est->qamname, level, (OFF_T_FMT_TYPE)size);
+           g_printf(_("%s %d SIZE %lld\n"),
+                  est->qamname, level, (long long)size);
            if (errmsg && errmsg[0] != '\0') {
                if(am_has_feature(g_options->features,
                                  fe_rep_sendsize_quoted_error)) {
                    qerrmsg = quote_string(errmsg);
-                   dbprintf(("errmsg is %s\n", errmsg));
-                   printf("%s %d ERROR %s\n",
+                   dbprintf(_("errmsg is %s\n"), errmsg);
+                   g_printf("%s %d ERROR %s\n",
                           est->qamname, level, qerrmsg);
                    amfree(qerrmsg);
                }
@@ -1019,22 +989,22 @@ gnutar_calc_estimates(
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if (est->est[level].needestimate) {
-           dbprintf(("%s: getting size via gnutar for %s level %d\n",
-                     debug_prefix_time(NULL), est->qamname, level));
+           dbprintf(_("getting size via gnutar for %s level %d\n"),
+                     est->qamname, level);
            size = getsize_gnutar(est->amname, est->amdevice, level,
                                  est->options, est->est[level].dumpsince,
                                  &errmsg);
 
            amflock(1, "size");
 
-           printf("%s %d SIZE " OFF_T_FMT "\n",
-                  est->qamname, level, (OFF_T_FMT_TYPE)size);
+           g_printf(_("%s %d SIZE %lld\n"),
+                  est->qamname, level, (long long)size);
            if (errmsg && errmsg[0] != '\0') {
                if(am_has_feature(g_options->features,
                                  fe_rep_sendsize_quoted_error)) {
                    qerrmsg = quote_string(errmsg);
-                   dbprintf(("errmsg is %s\n", errmsg));
-                   printf("%s %d ERROR %s\n",
+                   dbprintf(_("errmsg is %s\n"), errmsg);
+                   g_printf(_("%s %d ERROR %s\n"),
                           est->qamname, level, qerrmsg);
                    amfree(qerrmsg);
                }
@@ -1051,10 +1021,10 @@ gnutar_calc_estimates(
 typedef struct regex_s {
     char *regex;
     int scale;
-} regex_t;
+} regex_scale_t;
 
 /*@ignore@*/
-regex_t re_size[] = {
+regex_scale_t re_size[] = {
 #ifdef DUMP
     {"  DUMP: estimated -*[0-9][0-9]* tape blocks", 1024},
     {"  DUMP: [Ee]stimated [0-9][0-9]* blocks", 512},
@@ -1146,25 +1116,25 @@ getsize_dump(
 
     (void)getsize_smbtar;      /* Quiet unused parameter warning */
 
-    snprintf(level_str, SIZEOF(level_str), "%d", level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", level);
 
     device = amname_to_devname(amdevice);
     qdevice = quote_string(device);
     fstype = amname_to_fstype(amdevice);
 
-    dbprintf(("%s: calculating for device %s with %s\n",
-             debug_prefix_time(NULL), qdevice, fstype));
+    dbprintf(_("calculating for device %s with %s\n"),
+             qdevice, fstype);
 
-    cmd = vstralloc(libexecdir, "/rundump", versionsuffix(), NULL);
+    cmd = vstralloc(amlibexecdir, "/rundump", versionsuffix(), NULL);
     rundump_cmd = stralloc(cmd);
     if (g_options->config)
         config = g_options->config;
     else
         config = "NOCONFIG";
     if ((stdoutfd = nullfd = open("/dev/null", O_RDWR)) == -1) {
-       *errmsg = vstrallocf("getsize_dump could not open /dev/null: %s",
+       *errmsg = vstrallocf(_("getsize_dump could not open /dev/null: %s"),
                             strerror(errno));
-       dbprintf(("%s\n", *errmsg));
+       dbprintf("%s\n", *errmsg);
        amfree(cmd);
        amfree(rundump_cmd);
        amfree(fstype);
@@ -1175,9 +1145,9 @@ getsize_dump(
     }
     pipefd[0] = pipefd[1] = killctl[0] = killctl[1] = -1;
     if (pipe(pipefd) < 0) {
-       *errmsg = vstrallocf("getsize_dump could create data pipes: %s",
+       *errmsg = vstrallocf(_("getsize_dump could create data pipes: %s"),
                             strerror(errno));
-       dbprintf(("%s\n", *errmsg));
+       dbprintf("%s\n", *errmsg);
        amfree(cmd);
        amfree(rundump_cmd);
        amfree(fstype);
@@ -1195,8 +1165,8 @@ getsize_dump(
 #endif                                                 /* } */
     {
        name = stralloc(" (xfsdump)");
-       dbprintf(("%s: running \"%s%s -F -J -l %s - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, level_str, qdevice));
+       dbprintf(_("running \"%s%s -F -J -l %s - %s\"\n"),
+                 cmd, name, level_str, qdevice);
     }
     else
 #endif                                                 /* } */
@@ -1216,8 +1186,8 @@ getsize_dump(
        is_rundump = 0;
 #endif
        dumpkeys = vstralloc(level_str, "s", "f", NULL);
-       dbprintf(("%s: running \"%s%s %s 1048576 - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice));
+       dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"),
+                 cmd, name, dumpkeys, qdevice);
     }
     else
 #endif                                                 /* } */
@@ -1234,8 +1204,8 @@ getsize_dump(
        device = amname_to_dirname(amdevice);
        qdevice = quote_string(device);
        dumpkeys = vstralloc(level_str, "b", "f", NULL);
-       dbprintf(("%s: running \"%s%s %s 60 - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice));
+       dbprintf(_("running \"%s%s %s 60 - %s\"\n"),
+                 cmd, name, dumpkeys, qdevice);
     }
     else
 #endif                                                 /* } */
@@ -1256,8 +1226,8 @@ getsize_dump(
 
 # ifdef AIX_BACKUP                                     /* { */
        dumpkeys = vstralloc("-", level_str, "f", NULL);
-       dbprintf(("%s: running \"%s%s %s - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice));
+       dbprintf(_("running \"%s%s %s - %s\"\n"),
+                 cmd, name, dumpkeys, qdevice);
 # else                                                 /* } { */
 #  ifdef HAVE_DUMP_ESTIMATE
 #    define PARAM_DUMP_ESTIMATE HAVE_DUMP_ESTIMATE
@@ -1279,24 +1249,23 @@ getsize_dump(
 #  endif
 
 #  ifdef HAVE_HONOR_NODUMP                             /* { */
-       dbprintf(("%s: running \"%s%s %s 0 1048576 - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice));
+       dbprintf(_("running \"%s%s %s 0 1048576 - %s\"\n"),
+                 cmd, name, dumpkeys, qdevice);
 #  else                                                        /* } { */
-       dbprintf(("%s: running \"%s%s %s 1048576 - %s\"\n",
-                 debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice));
+       dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"),
+                 cmd, name, dumpkeys, qdevice);
 #  endif                                               /* } */
 # endif                                                        /* } */
     }
     else
 #endif                                                 /* } */
     {
-       error("no dump program available");
+       error(_("no dump program available"));
        /*NOTREACHED*/
     }
 
     if (pipe(killctl) < 0) {
-       dbprintf(("%s: Could not create pipe: %s\n",
-               debug_prefix_time(NULL), strerror(errno)));
+       dbprintf(_("Could not create pipe: %s\n"), strerror(errno));
        /* Message will be printed later... */
        killctl[0] = killctl[1] = -1;
     }
@@ -1304,9 +1273,9 @@ getsize_dump(
     start_time = curclock();
     switch(dumppid = fork()) {
     case -1:
-       *errmsg = vstrallocf("cannot fork for killpgrp: %s",
+       *errmsg = vstrallocf(_("cannot fork for killpgrp: %s"),
                             strerror(errno));
-       dbprintf(("%s\n", *errmsg));
+       dbprintf("%s\n", *errmsg);
        amfree(dumpkeys);
        amfree(cmd);
        amfree(rundump_cmd);
@@ -1322,21 +1291,19 @@ getsize_dump(
        if(SETPGRP == -1)
            SETPGRP_FAILED();
        else if (killctl[0] == -1 || killctl[1] == -1)
-           dbprintf(("%s: Trying without killpgrp\n", debug_prefix_time(NULL)));
+           dbprintf(_("Trying without killpgrp\n"));
        else {
            switch(fork()) {
            case -1:
-               dbprintf(("%s: fork failed, trying without killpgrp\n",
-                         debug_prefix_time(NULL)));
+               dbprintf(_("fork failed, trying without killpgrp\n"));
                break;
 
            default:
            {
                char *config;
-               char *killpgrp_cmd = vstralloc(libexecdir, "/killpgrp",
+               char *killpgrp_cmd = vstralloc(amlibexecdir, "/killpgrp",
                                               versionsuffix(), NULL);
-               dbprintf(("%s: running %s\n",
-                         debug_prefix_time(NULL), killpgrp_cmd));
+               dbprintf(_("running %s\n"), killpgrp_cmd);
                dup2(killctl[0], 0);
                dup2(nullfd, 1);
                dup2(nullfd, 2);
@@ -1348,10 +1315,11 @@ getsize_dump(
                    config = g_options->config;
                else
                    config = "NOCONFIG";
+               safe_fd(-1, 0);
                execle(killpgrp_cmd, killpgrp_cmd, config, (char *)0,
                       safe_env());
-               dbprintf(("%s: cannot execute %s: %s\n",
-                         debug_prefix_time(NULL), killpgrp_cmd, strerror(errno)));
+               dbprintf(_("cannot execute %s: %s\n"),
+                         killpgrp_cmd, strerror(errno));
                exit(-1);
            }
 
@@ -1368,6 +1336,7 @@ getsize_dump(
            aclose(killctl[0]);
        if (killctl[1] != -1)
            aclose(killctl[1]);
+       safe_fd(-1, 0);
 
 #ifdef XFSDUMP
 #ifdef DUMP
@@ -1436,7 +1405,7 @@ getsize_dump(
 # endif
 #endif
        {
-           error("exec %s failed or no dump program available: %s",
+           error(_("exec %s failed or no dump program available: %s"),
                  cmd, strerror(errno));
            /*NOTREACHED*/
        }
@@ -1450,14 +1419,14 @@ getsize_dump(
        aclose(killctl[0]);
     dumpout = fdopen(pipefd[0],"r");
     if (!dumpout) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
        if (line[0] == '\0')
            continue;
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+       dbprintf("%s\n", line);
        size = handle_dumpline(line);
        if(size > (off_t)-1) {
            amfree(line);
@@ -1467,43 +1436,40 @@ getsize_dump(
                amfree(line);
            }
            if (line != NULL) {
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+               dbprintf("%s\n", line);
            }
            break;
        }
     }
     amfree(line);
 
-    dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-    dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix_time(NULL),
+    dbprintf(".....\n");
+    dbprintf(_("estimate time for %s level %d: %s\n"),
              qdisk,
              level,
-             walltime_str(timessub(curclock(), start_time))));
+             walltime_str(timessub(curclock(), start_time)));
     if(size == (off_t)-1) {
-       *errmsg = vstrallocf("no size line match in %s%s output",
+       *errmsg = vstrallocf(_("no size line match in %s%s output"),
                             cmd, name);
-       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
-                 *errmsg, qdisk));
+       dbprintf(_("%s for %s\n"),
+                 *errmsg, qdisk);
 
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-       dbprintf(("%s: Run %s%s manually to check for errors\n",
-                   debug_prefix_time(NULL), cmd, name));
+       dbprintf(".....\n");
+       dbprintf(_("Run %s%s manually to check for errors\n"),
+                   cmd, name);
     } else if(size == (off_t)0 && level == 0) {
-       dbprintf(("%s: possible %s%s problem -- is \"%s\" really empty?\n",
-                 debug_prefix_time(NULL), cmd, name, disk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       dbprintf(_("possible %s%s problem -- is \"%s\" really empty?\n"),
+                 cmd, name, disk);
+       dbprintf(".....\n");
     } else {
-           dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-             debug_prefix_time(NULL),
+           dbprintf(_("estimate size for %s level %d: %lld KB\n"),
              qdisk,
              level,
-             (OFF_T_FMT_TYPE)size));
+             (long long)size);
     }
 
     if (killctl[1] != -1) {
-       dbprintf(("%s: asking killpgrp to terminate\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("asking killpgrp to terminate\n"));
        aclose(killctl[1]);
        for(s = 5; s > 0; --s) {
            sleep(1);
@@ -1516,11 +1482,9 @@ getsize_dump(
      * First, try to kill the dump process nicely.  If it ignores us
      * for several seconds, hit it harder.
      */
-    dbprintf(("%s: sending SIGTERM to process group %ld\n",
-             debug_prefix_time(NULL), (long)dumppid));
+    dbprintf(_("sending SIGTERM to process group %ld\n"), (long)dumppid);
     if (kill(-dumppid, SIGTERM) == -1) {
-       dbprintf(("%s: kill failed: %s\n",
-                 debug_prefix_time(NULL), strerror(errno)));
+       dbprintf(_("kill failed: %s\n"), strerror(errno));
     }
     /* Now check whether it dies */
     for(s = 5; s > 0; --s) {
@@ -1529,11 +1493,9 @@ getsize_dump(
            goto terminated;
     }
 
-    dbprintf(("%s: sending SIGKILL to process group %ld\n",
-             debug_prefix_time(NULL), (long)dumppid));
+    dbprintf(_("sending SIGKILL to process group %ld\n"), (long)dumppid);
     if (kill(-dumppid, SIGKILL) == -1) {
-       dbprintf(("%s: kill failed: %s\n",
-                 debug_prefix_time(NULL), strerror(errno)));
+       dbprintf(_("kill failed: %s\n"), strerror(errno));
     }
     for(s = 5; s > 0; --s) {
        sleep(1);
@@ -1541,25 +1503,23 @@ getsize_dump(
            goto terminated;
     }
 
-    dbprintf(("%s: waiting for %s%s \"%s\" child\n",
-             debug_prefix_time(NULL), cmd, name, qdisk));
+    dbprintf(_("waiting for %s%s \"%s\" child\n"), cmd, name, qdisk);
     waitpid(dumppid, &wait_status, 0);
     if (WIFSIGNALED(wait_status)) {
-       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
-                            cmd, WTERMSIG(wait_status), debug_fn());
+       *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"),
+                            cmd, WTERMSIG(wait_status), dbfn());
     } else if (WIFEXITED(wait_status)) {
        if (WEXITSTATUS(wait_status) != 0) {
-           *errmsg = vstrallocf("%s exited with status %d: see %s",
-                                cmd, WEXITSTATUS(wait_status), debug_fn());
+           *errmsg = vstrallocf(_("%s exited with status %d: see %s"),
+                                cmd, WEXITSTATUS(wait_status), dbfn());
        } else {
            /* Normal exit */
        }
     } else {
-       *errmsg = vstrallocf("%s got bad exit: see %s",
-                            cmd, debug_fn());
+       *errmsg = vstrallocf(_("%s got bad exit: see %s"),
+                            cmd, dbfn());
     }
-    dbprintf(("%s: after %s%s %s wait\n",
-             debug_prefix_time(NULL), cmd, name, qdisk));
+    dbprintf(_("after %s%s %s wait\n"), cmd, name, qdisk);
 
  terminated:
 
@@ -1612,7 +1572,7 @@ getsize_smbtar(
        amfree(subdir);
        set_pname(error_pn);
        amfree(error_pn);
-       error("cannot parse disk entry %s for share/subdir", qdisk);
+       error(_("cannot parse disk entry %s for share/subdir"), qdisk);
        /*NOTREACHED*/
     }
     if ((subdir) && (SAMBA_VERSION < 2)) {
@@ -1620,7 +1580,7 @@ getsize_smbtar(
        amfree(subdir);
        set_pname(error_pn);
        amfree(error_pn);
-       error("subdirectory specified for share %s but samba not v2 or better", qdisk);
+       error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk);
        /*NOTREACHED*/
     }
     if ((user_and_password = findpass(share, &domain)) == NULL) {
@@ -1631,7 +1591,7 @@ getsize_smbtar(
        }
        set_pname(error_pn);
        amfree(error_pn);
-       error("cannot find password for %s", disk);
+       error(_("cannot find password for %s"), disk);
        /*NOTREACHED*/
     }
     lpass = strlen(user_and_password);
@@ -1644,7 +1604,7 @@ getsize_smbtar(
        }
        set_pname(error_pn);
        amfree(error_pn);
-       error("password field not \'user%%pass\' for %s", disk);
+       error(_("password field not \'user%%pass\' for %s"), disk);
        /*NOTREACHED*/
     }
     *pwtext++ = '\0';
@@ -1658,7 +1618,7 @@ getsize_smbtar(
        }
        set_pname(error_pn);
        amfree(error_pn);
-       error("cannot make share name of %s", share);
+       error(_("cannot make share name of %s"), share);
        /*NOTREACHED*/
     }
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
@@ -1671,7 +1631,7 @@ getsize_smbtar(
        set_pname(error_pn);
        amfree(error_pn);
        amfree(sharename);
-       error("could not open /dev/null: %s\n",
+       error(_("could not open /dev/null: %s\n"),
              strerror(errno));
        /*NOTREACHED*/
     }
@@ -1725,7 +1685,7 @@ getsize_smbtar(
        aclose(passwdfd);
        set_pname(error_pn);
        amfree(error_pn);
-       error("password write failed: %s", strerror(save_errno));
+       error(_("password write failed: %s"), strerror(save_errno));
        /*NOTREACHED*/
     }
     memset(user_and_password, '\0', (size_t)lpass);
@@ -1737,14 +1697,14 @@ getsize_smbtar(
     amfree(error_pn);
     dumpout = fdopen(pipefd,"r");
     if (!dumpout) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
        if (line[0] == '\0')
            continue;
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+       dbprintf("%s\n", line);
        size = handle_dumpline(line);
        if(size > -1) {
            amfree(line);
@@ -1754,58 +1714,54 @@ getsize_smbtar(
                amfree(line);
            }
            if(line != NULL) {
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+               dbprintf("%s\n", line);
            }
            break;
        }
     }
     amfree(line);
 
-    dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-    dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix_time(NULL),
+    dbprintf(".....\n");
+    dbprintf(_("estimate time for %s level %d: %s\n"),
              qdisk,
              level,
-             walltime_str(timessub(curclock(), start_time))));
+             walltime_str(timessub(curclock(), start_time)));
     if(size == (off_t)-1) {
-       *errmsg = vstrallocf("no size line match in %s output",
+       *errmsg = vstrallocf(_("no size line match in %s output"),
                             SAMBA_CLIENT);
-       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
-                 *errmsg, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       dbprintf(_("%s for %s\n"),
+                 *errmsg, qdisk);
+       dbprintf(".....\n");
     } else if(size == (off_t)0 && level == 0) {
-       dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix_time(NULL), SAMBA_CLIENT, disk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"),
+                 SAMBA_CLIENT, disk);
+       dbprintf(".....\n");
     }
-    dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-             debug_prefix_time(NULL),
+    dbprintf(_("estimate size for %s level %d: %lld KB\n"),
              qdisk,
              level,
-             (OFF_T_FMT_TYPE)size));
+             (long long)size);
 
     kill(-dumppid, SIGTERM);
 
-    dbprintf(("%s: waiting for %s \"%s\" child\n",
-             debug_prefix_time(NULL), SAMBA_CLIENT, qdisk));
+    dbprintf(_("waiting for %s \"%s\" child\n"), SAMBA_CLIENT, qdisk);
     waitpid(dumppid, &wait_status, 0);
     if (WIFSIGNALED(wait_status)) {
-       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
-                            "smbclient", WTERMSIG(wait_status), debug_fn());
+       *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"),
+                            SAMBA_CLIENT, WTERMSIG(wait_status), dbfn());
     } else if (WIFEXITED(wait_status)) {
        if (WEXITSTATUS(wait_status) != 0) {
-           *errmsg = vstrallocf("%s exited with status %d: see %s",
-                                "smbclient", WEXITSTATUS(wait_status),
-                                debug_fn());
+           *errmsg = vstrallocf(_("%s exited with status %d: see %s"),
+                                SAMBA_CLIENT, WEXITSTATUS(wait_status),
+                                dbfn());
        } else {
            /* Normal exit */
        }
     } else {
-       *errmsg = vstrallocf("%s got bad exit: see %s",
-                            "smbclient", debug_fn());
+       *errmsg = vstrallocf(_("%s got bad exit: see %s"),
+                            SAMBA_CLIENT, dbfn());
     }
-    dbprintf(("%s: after %s %s wait\n",
-             debug_prefix_time(NULL), SAMBA_CLIENT, qdisk));
+    dbprintf(_("after %s %s wait\n"), SAMBA_CLIENT, qdisk);
 
     afclose(dumpout);
     pipefd = -1;
@@ -1854,6 +1810,7 @@ getsize_gnutar(
     char *qdisk = quote_string(disk);
     char *gnutar_list_dir;
     amwait_t wait_status;
+    char tmppath[PATH_MAX];
 
     if(options->exclude_file) nb_exclude += options->exclude_file->nb_element;
     if(options->exclude_list) nb_exclude += options->exclude_list->nb_element;
@@ -1871,25 +1828,17 @@ getsize_gnutar(
        gnutar_list_dir = NULL;
     if (gnutar_list_dir) {
        char number[NUM_STR_SIZE];
-       char *s;
-       int ch;
        int baselevel;
+       char *sdisk = sanitise_filename(disk);
 
        basename = vstralloc(gnutar_list_dir,
                             "/",
                             g_options->hostname,
-                            disk,
+                            sdisk,
                             NULL);
-       /*
-        * The loop starts at the first character of the host name,
-        * not the '/'.
-        */
-       s = basename + strlen(gnutar_list_dir) + 1;
-       while((ch = *s++) != '\0') {
-           if(ch == '/' || isspace(ch)) s[-1] = '_';
-       }
+       amfree(sdisk);
 
-       snprintf(number, SIZEOF(number), "%d", level);
+       g_snprintf(number, SIZEOF(number), "%d", level);
        incrname = vstralloc(basename, "_", number, ".new", NULL);
        unlink(incrname);
 
@@ -1902,7 +1851,7 @@ getsize_gnutar(
        infd = -1;
        while (infd == -1) {
            if (--baselevel >= 0) {
-               snprintf(number, SIZEOF(number), "%d", baselevel);
+               g_snprintf(number, SIZEOF(number), "%d", baselevel);
                inputname = newvstralloc(inputname,
                                         basename, "_", number, NULL);
            } else {
@@ -1910,9 +1859,9 @@ getsize_gnutar(
            }
            if ((infd = open(inputname, O_RDONLY)) == -1) {
 
-               *errmsg = vstrallocf("gnutar: error opening %s: %s",
+               *errmsg = vstrallocf(_("gnutar: error opening %s: %s"),
                                     inputname, strerror(errno));
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+               dbprintf("%s\n", *errmsg);
                if (baselevel < 0) {
                    goto common_exit;
                }
@@ -1924,38 +1873,38 @@ getsize_gnutar(
         * Copy the previous listed incremental file to the new one.
         */
        if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) {
-           *errmsg = vstrallocf("opening %s: %s",
+           *errmsg = vstrallocf(_("opening %s: %s"),
                                 incrname, strerror(errno));
-           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+           dbprintf("%s\n", *errmsg);
            goto common_exit;
        }
 
        while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) {
            if (fullwrite(outfd, &buf, (size_t)nb) < nb) {
-               *errmsg = vstrallocf("writing to %s: %s",
+               *errmsg = vstrallocf(_("writing to %s: %s"),
                                     incrname, strerror(errno));
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+               dbprintf("%s\n", *errmsg);
                goto common_exit;
            }
        }
 
        if (nb < 0) {
-           *errmsg = vstrallocf("reading from %s: %s",
+           *errmsg = vstrallocf(_("reading from %s: %s"),
                                 inputname, strerror(errno));
-           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+           dbprintf("%s\n", *errmsg);
            goto common_exit;
        }
 
        if (close(infd) != 0) {
-           *errmsg = vstrallocf("closing %s: %s",
+           *errmsg = vstrallocf(_("closing %s: %s"),
                                 inputname, strerror(errno));
-           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+           dbprintf("%s\n", *errmsg);
            goto common_exit;
        }
        if (close(outfd) != 0) {
-           *errmsg = vstrallocf("closing %s: %s",
+           *errmsg = vstrallocf(_("closing %s: %s"),
                                 incrname, strerror(errno));
-           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+           dbprintf("%s\n", *errmsg);
            goto common_exit;
        }
 
@@ -1964,14 +1913,14 @@ getsize_gnutar(
     }
 
     gmtm = gmtime(&dumpsince);
-    snprintf(dumptimestr, SIZEOF(dumptimestr),
+    g_snprintf(dumptimestr, SIZEOF(dumptimestr),
                "%04d-%02d-%02d %2d:%02d:%02d GMT",
                gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday,
                gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec);
 
     dirname = amname_to_dirname(amdevice);
 
-    cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL);
+    cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL);
     my_argv[i++] = "runtar";
     if (g_options->config)
        my_argv[i++] = g_options->config;
@@ -1987,7 +1936,8 @@ getsize_gnutar(
     my_argv[i++] = "--file";
     my_argv[i++] = "/dev/null";
     my_argv[i++] = "--directory";
-    my_argv[i++] = dirname;
+    canonicalize_pathname(dirname, tmppath);
+    my_argv[i++] = tmppath;
     my_argv[i++] = "--one-file-system";
     if (gnutar_list_dir) {
            my_argv[i++] = "--listed-incremental";
@@ -2026,9 +1976,9 @@ getsize_gnutar(
     start_time = curclock();
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       *errmsg = vstrallocf("Cannot access /dev/null : %s",
+       *errmsg = vstrallocf(_("Cannot access /dev/null : %s"),
                             strerror(errno));
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+       dbprintf("%s\n", *errmsg);
        goto common_exit;
     }
 
@@ -2036,14 +1986,14 @@ getsize_gnutar(
 
     dumpout = fdopen(pipefd,"r");
     if (!dumpout) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
        if (line[0] == '\0')
            continue;
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+       dbprintf("%s\n", line);
        size = handle_dumpline(line);
        if(size > (off_t)-1) {
            amfree(line);
@@ -2054,7 +2004,7 @@ getsize_gnutar(
                amfree(line);
            }
            if (line != NULL) {
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+               dbprintf("%s\n", line);
                break;
            }
            break;
@@ -2062,49 +2012,44 @@ getsize_gnutar(
     }
     amfree(line);
 
-    dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-    dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix_time(NULL),
+    dbprintf(".....\n");
+    dbprintf(_("estimate time for %s level %d: %s\n"),
              qdisk,
              level,
-             walltime_str(timessub(curclock(), start_time))));
+             walltime_str(timessub(curclock(), start_time)));
     if(size == (off_t)-1) {
-       *errmsg = vstrallocf("no size line match in %s output", my_argv[0]);
-       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
-                 *errmsg, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       *errmsg = vstrallocf(_("no size line match in %s output"), my_argv[0]);
+       dbprintf(_("%s for %s\n"), *errmsg, qdisk);
+       dbprintf(".....\n");
     } else if(size == (off_t)0 && level == 0) {
-       dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix_time(NULL), my_argv[0], disk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"),
+                 my_argv[0], disk);
+       dbprintf(".....\n");
     }
-    dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-             debug_prefix_time(NULL),
+    dbprintf(_("estimate size for %s level %d: %lld KB\n"),
              qdisk,
              level,
-             (OFF_T_FMT_TYPE)size));
+             (long long)size);
 
     kill(-dumppid, SIGTERM);
 
-    dbprintf(("%s: waiting for %s \"%s\" child\n",
-             debug_prefix_time(NULL), my_argv[0], qdisk));
+    dbprintf(_("waiting for %s \"%s\" child\n"), my_argv[0], qdisk);
     waitpid(dumppid, &wait_status, 0);
     if (WIFSIGNALED(wait_status)) {
-       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
-                            cmd, WTERMSIG(wait_status), debug_fn());
+       *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"),
+                            cmd, WTERMSIG(wait_status), dbfn());
     } else if (WIFEXITED(wait_status)) {
        if (WEXITSTATUS(wait_status) != 0) {
-           *errmsg = vstrallocf("%s exited with status %d: see %s",
-                                cmd, WEXITSTATUS(wait_status), debug_fn());
+           *errmsg = vstrallocf(_("%s exited with status %d: see %s"),
+                                cmd, WEXITSTATUS(wait_status), dbfn());
        } else {
            /* Normal exit */
        }
     } else {
-       *errmsg = vstrallocf("%s got bad exit: see %s",
-                            cmd, debug_fn());
+       *errmsg = vstrallocf(_("%s got bad exit: see %s"),
+                            cmd, dbfn());
     }
-    dbprintf(("%s: after %s %s wait\n",
-             debug_prefix_time(NULL), my_argv[0], qdisk));
+    dbprintf(_("after %s %s wait\n"), my_argv[0], qdisk);
 
 common_exit:
 
@@ -2146,6 +2091,7 @@ getsize_backup_api(
     FILE *dumpout, *toolin;
     char *line = NULL;
     char *cmd = NULL;
+    char *cmdline;
     char dumptimestr[80];
     struct tm *gmtm;
     int  i, j;
@@ -2161,7 +2107,7 @@ getsize_backup_api(
 
     (void)options;
     gmtm = gmtime(&dumpsince);
-    snprintf(dumptimestr, SIZEOF(dumptimestr),
+    g_snprintf(dumptimestr, SIZEOF(dumptimestr),
                "%04d-%02d-%02d %2d:%02d:%02d GMT",
                gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday,
                gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec);
@@ -2193,36 +2139,36 @@ getsize_backup_api(
     }
     if (level <= bsu->max_level) {
        argvchild[i++] = "--level";
-       snprintf(levelstr,SIZEOF(levelstr),"%d",level);
+       g_snprintf(levelstr,SIZEOF(levelstr),"%d",level);
        argvchild[i++] = levelstr;
     }
 
     argvchild[i] = NULL;
 
-    dbprintf(("%s: running %s", debug_prefix_time(NULL), cmd));
-    for(j = 1; j < i; j++) {
-       dbprintf((" %s", argvchild[j]));
-    }
-    dbprintf(("\n"));
+    cmdline = stralloc(cmd);
+    for(j = 1; j < i; j++)
+       cmdline = vstrextend(&cmdline, " ", argvchild[i], NULL);
+    dbprintf("running: \"%s\"\n", cmdline);
+    amfree(cmdline);
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       *errmsg = vstrallocf("Cannot access /dev/null : %s",
+       *errmsg = vstrallocf(_("Cannot access /dev/null : %s"),
                             strerror(errno));
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+       dbprintf("%s\n", *errmsg);
        goto common_exit;
     }
 
     if (pipe(pipeinfd) < 0) {
-       *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s",
+       *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"),
                             strerror(errno));
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+       dbprintf("%s\n", *errmsg);
        goto common_exit;
     }
 
     if (pipe(pipeoutfd) < 0) {
-       *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s",
+       *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"),
                             strerror(errno));
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+       dbprintf("%s\n", *errmsg);
        goto common_exit;
     }
 
@@ -2240,9 +2186,10 @@ getsize_backup_api(
       dup2(nullfd, 2);
       aclose(pipeinfd[1]);
       aclose(pipeoutfd[0]);
+      safe_fd(-1, 0);
 
       execve(cmd, argvchild, safe_env());
-      error("exec %s failed: %s", cmd, strerror(errno));
+      error(_("exec %s failed: %s"), cmd, strerror(errno));
       /*NOTREACHED*/
     }
     amfree(newoptstr);
@@ -2262,17 +2209,17 @@ getsize_backup_api(
 
     dumpout = fdopen(pipeoutfd[0],"r");
     if (!dumpout) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
-       OFF_T_FMT_TYPE size1_ = (OFF_T_FMT_TYPE)0;
-       OFF_T_FMT_TYPE size2_ = (OFF_T_FMT_TYPE)0;
+       long long size1_ = (long long)0;
+       long long size2_ = (long long)0;
        if (line[0] == '\0')
            continue;
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
-       i = sscanf(line, OFF_T_FMT " " OFF_T_FMT, &size1_, &size2_);
+       dbprintf("%s\n", line);
+       i = sscanf(line, "%lld %lld", &size1_, &size2_);
        size1 = (off_t)size1_;
        size2 = (off_t)size2_;
        if(i == 2) {
@@ -2286,55 +2233,49 @@ getsize_backup_api(
                amfree(line);
            }
            if(line != NULL) {
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
+               dbprintf(_("%s\n"), line);
            }
            break;
        }
     }
     amfree(line);
 
-    dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
-    dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix_time(NULL),
-             qamdevice,
-             level,
-             walltime_str(timessub(curclock(), start_time))));
+    dbprintf(".....\n");
+    dbprintf(_("estimate time for %s level %d: %s\n"), qamdevice, level,
+             walltime_str(timessub(curclock(), start_time)));
     if(size == (off_t)-1) {
-       *errmsg = vstrallocf("no size line match in %s output", cmd);
-       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), cmd, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       *errmsg = vstrallocf(_("no size line match in %s output"), cmd);
+       dbprintf(_("%s for %s\n"), cmd, qdisk);
+       dbprintf(".....\n");
     } else if(size == (off_t)0 && level == 0) {
-       dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix_time(NULL), cmd, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
+       dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"),
+                 cmd, qdisk);
+       dbprintf(".....\n");
     }
-    dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-             debug_prefix_time(NULL),
+    dbprintf(_("estimate size for %s level %d: %lld KB\n"),
              qamdevice,
              level,
-             (OFF_T_FMT_TYPE)size));
+             (long long)size);
 
     kill(-dumppid, SIGTERM);
 
-    dbprintf(("%s: waiting for %s \"%s\" child\n",
-             debug_prefix_time(NULL), cmd, qdisk));
+    dbprintf(_("waiting for %s \"%s\" child\n"), cmd, qdisk);
     waitpid(dumppid, &wait_status, 0);
     if (WIFSIGNALED(wait_status)) {
-       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
-                            cmd, WTERMSIG(wait_status), debug_fn());
+       *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"),
+                            cmd, WTERMSIG(wait_status), dbfn());
     } else if (WIFEXITED(wait_status)) {
        if (WEXITSTATUS(wait_status) != 0) {
-           *errmsg = vstrallocf("%s exited with status %d: see %s", cmd,
-                                WEXITSTATUS(wait_status), debug_fn());
+           *errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd,
+                                WEXITSTATUS(wait_status), dbfn());
        } else {
            /* Normal exit */
        }
     } else {
-       *errmsg = vstrallocf("%s got bad exit: see %s",
-                            cmd, debug_fn());
+       *errmsg = vstrallocf(_("%s got bad exit: see %s"),
+                            cmd, dbfn());
     }
-    dbprintf(("%s: after %s %s wait\n",
-             debug_prefix_time(NULL), cmd, qdisk));
+    dbprintf(_("after %s %s wait\n"), cmd, qdisk);
 
     aclose(nullfd);
     afclose(dumpout);
@@ -2380,7 +2321,7 @@ off_t
 handle_dumpline(
     char *     str)
 {
-    regex_t *rp;
+    regex_scale_t *rp;
     double size;
 
     /* check for size match */
index 3e99a981b43b669705bf88fb99fc62beb416d0e0..1c16eaa193592f64411f6b22f1805264b0970cba 100644 (file)
@@ -77,14 +77,12 @@ unctime(
        return mktime(&then);
 }
 
-static char months[] =
-       "JanFebMarAprMayJunJulAugSepOctNovDec";
-
 static int
 lookup(
     char *     str)
 {
        register char *cp, *cp2;
+       char *months = _("JanFebMarAprMayJunJulAugSepOctNovDec");
 
        for (cp = months, cp2 = str; *cp != '\0'; cp += 3)
                if (strncmp(cp, cp2, 3) == 0)
index 91d070000c3d443e56157c87137d0b0355267dd9..d9e2ecbe7715f5519f0a785b4d7d1758098b6bb0 100644 (file)
  */
 #include "amanda.h"
 #include "version.h"
+#include "util.h"
 
 int main(int argc, char **argv);
 
-int main(int argc, char **argv)
+int
+main(
+    int                argc,
+    char **    argv)
 {
-       safe_fd(-1, 0);
-
        (void)argc;     /* Quiet unused parameter warning */
        (void)argv;     /* Quiet unused parameter warning */
 
+       /*
+        * Configure program for internationalization:
+        *   1) Only set the message locale for now.
+        *   2) Set textdomain for all amanda related programs to "amanda"
+        *      We don't want to be forced to support dozens of message catalogs.
+        */  
+       setlocale(LC_MESSAGES, "C");
+       textdomain("amanda"); 
+
+       safe_fd(-1, 0);
+
        set_pname("versionsuffix");
 
-       printf("%s\n", versionsuffix());
+       g_printf("%s\n", versionsuffix());
        return 0;
 }
index 672eb190448ff175287acedd06e4ff46bd87cb89..91a42a1159cf478454660984dc59f8fba5ae13a2 100644 (file)
@@ -1,47 +1,93 @@
 # Makefile for Amanda library.
 
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =      -I$(top_srcdir)/gnulib   
 
-lib_LTLIBRARIES =      libamanda.la
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
+amlib_LTLIBRARIES =    libamanda.la
 
-LINT=@AMLINT@
-LINTFLAGS=@AMLINTFLAGS@
+LINT=$(AMLINT)
+LINTFLAGS=$(AMLINTFLAGS)
 
 libamanda_la_SOURCES =         \
        alloc.c                 \
        amfeatures.c            \
        amflock.c               \
-       bsd-security.c          \
-       bsdtcp-security.c       \
-       bsdudp-security.c       \
        clock.c                 \
+       columnar.c              \
        conffile.c              \
        debug.c                 \
        dgram.c                 \
-       error.c                 \
        event.c                 \
        file.c                  \
        fileheader.c            \
-       krb4-security.c         \
-       krb5-security.c         \
+       glib-util.c             \
        match.c                 \
        packet.c                \
        pipespawn.c             \
        protocol.c              \
-       rsh-security.c          \
        security.c              \
        security-util.c         \
        sl.c                    \
-       ssh-security.c          \
-       statfs.c                \
+       sockaddr-util.c         \
        stream.c                \
        tapelist.c              \
+       timestamp.c             \
        token.c                 \
        util.c                  \
-       version.c               \
        versuff.c
-
-#libamanda_la_LIBADD = @LTLIBOBJS@
+# version.c is generated; see below
+nodist_libamanda_la_SOURCES = version.c
+
+libamanda_la_LIBADD =          \
+       ../gnulib/libgnu.la
+
+if WANT_AMFLOCK_POSIX
+libamanda_la_SOURCES += amflock-posix.c
+endif
+
+if WANT_AMFLOCK_FLOCK
+libamanda_la_SOURCES += amflock-flock.c
+endif
+
+if WANT_AMFLOCK_LOCKF
+libamanda_la_SOURCES += amflock-lockf.c
+endif
+
+if WANT_AMFLOCK_LNLOCK
+libamanda_la_SOURCES += amflock-lnlock.c
+endif
+
+
+if WANT_RSH_SECURITY
+libamanda_la_SOURCES += rsh-security.c
+endif
+if WANT_SSH_SECURITY
+libamanda_la_SOURCES += ssh-security.c
+endif
+if WANT_BSD_SECURITY
+libamanda_la_SOURCES += bsd-security.c
+endif
+if WANT_BSDTCP_SECURITY
+libamanda_la_SOURCES += bsdtcp-security.c
+endif
+if WANT_BSDUDP_SECURITY
+libamanda_la_SOURCES += bsdudp-security.c
+endif
+if WANT_KRB4_SECURITY
+libamanda_la_SOURCES += krb4-security.c        
+endif
+if WANT_KRB5_SECURITY
+libamanda_la_SOURCES += krb5-security.c
+endif
+
+libamanda_la_SOURCES += local-security.c
 
 libamanda_la_LDFLAGS =  -release $(VERSION)
 
@@ -50,10 +96,15 @@ noinst_HEADERS =            \
        amfeatures.h            \
        arglist.h               \
        clock.h                 \
+       columnar.h              \
+       amflock.h               \
        conffile.h              \
+       debug.h                 \
        dgram.h                 \
        event.h                 \
+       file.h                  \
        fileheader.h            \
+       glib-util.h             \
        packet.h                \
        pipespawn.h             \
        protocol.h              \
@@ -61,58 +112,62 @@ noinst_HEADERS =           \
        security.h              \
        security-util.h         \
        sl.h                    \
-       statfs.h                \
+       sockaddr-util.h         \
        stream.h                \
        tapelist.h              \
+       timestamp.h             \
        token.h                 \
        util.h                  \
        version.h
 
-.sh:
-       cat $< > $@
-       chmod a+x $@
-
 EXTRA_PROGRAMS = genversion $(TEST_PROGS)
 
-genversion_SOURCES = genversion.c
-genversion_LDADD = $(libamanda_la_LIBADD) versuff.lo
+# Version-building steps:
+#
+# 1. configure builds svn-info.h, if svn info is available; this
+#    file is included in distribution tarballs
+# 2. Makefile creates genversion.h with build-time information
+# 3. Makefile builds genversion
+# 4. Makefile runs genversion to create version.c
+# 5. version.c is compiled into libamanda normally
+
+genversion_SOURCES = genversion.c genversion.h svn-info.h
+genversion_LDADD = $(libamanda_la_LIBADD)      \
+       versuff.lo                              \
+       ../gnulib/libgnu.la
 
-genversion.@OBJEXT@: genversion.h
 genversion.h: $(top_builddir)/config.status
        -rm -f $@ $@.new
        echo '#define CC "$(CC)"' > $@.new
        echo '#define BUILT_DATE "'`date`'"' >> $@.new
-       echo '#define BUILT_MACH "'`uname -a || echo UNKNOWN HOST`'"' >> $@.new
+       echo '#define BUILT_MACH "$(target)"' >> $@.new
        mv $@.new $@
 
-version.c:     genversion$(EXEEXT)
+version.c: genversion$(EXEEXT)
        -rm -f version.c
-       ./genversion > version.c
+       ./genversion$(EXEEXT) > version.c
 
-# these are used for testing only:
-TEST_PROGS = statfs token file bsdsecurity amfeatures
+BUILT_SOURCES += genversion.h version.c
 
-CLEANFILES = *.test.c
+# these are used for testing only:
+TEST_PROGS = token file bsdsecurity amfeatures
 
-DISTCLEANFILES = version.c genversion.h genversion amanda-int.h
+CLEANFILES += *.test.c
+DISTCLEANFILES += version.c genversion genversion.h
 
 # used for testing only
 
 STANDARD_COMMON_STUFF_NOT_FILE = \
-       alloc.$(OBJEXT) \
-       clock.$(OBJEXT) \
-       debug.$(OBJEXT) \
-       error.$(OBJEXT) \
-       util.$(OBJEXT) \
-       match.$(OBJEXT) \
-       sl.$(OBJEXT)
+       alloc.lo \
+       clock.lo \
+       debug.lo \
+       util.lo \
+       match.lo \
+       sl.lo
 
 STANDARD_COMMON_STUFF = \
        $(STANDARD_COMMON_STUFF_NOT_FILE) \
-       file.$(OBJEXT)
-
-statfs_SOURCES = statfs.test.c
-statfs_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
+       file.lo
 
 token_SOURCES = token.test.c
 token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
@@ -122,26 +177,65 @@ file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE)
 
 bsdsecurity_SOURCES = bsd-security.test.c
 bsdsecurity_LDADD = $(libamanda_a_LIBADD) \
-                   alloc.$(OBJEXT) \
-                   clock.$(OBJEXT) \
-                   debug.$(OBJEXT) \
-                   dgram.$(OBJEXT) \
-                   error.$(OBJEXT) \
-                   event.$(OBJEXT) \
-                   file.$(OBJEXT) \
-                   packet.$(OBJEXT) \
-                   security.$(OBJEXT) \
-                   ssh-security.$(OBJEXT) \
-                   versuff.$(OBJEXT)
+                   alloc.lo \
+                   clock.lo \
+                   debug.lo \
+                   dgram.lo \
+                   event.lo \
+                   file.lo \
+                   packet.lo \
+                   security.lo \
+                   ssh-security.lo \
+                   versuff.lo
 
 amfeatures_SOURCES = amfeatures.test.c
 amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
 
+# automake-style tests
+
+TESTS = amflock-test
+noinst_PROGRAMS = $(TESTS)
+
+amflock_test_SOURCES = amflock-test.c
+amflock_test_LDADD = libamanda.la
+
+# scripts
+
+# divide scripts up both by language and by destination directory.
+sbin_SCRIPTS_PERL = \
+           amgpgcrypt \
+           amcryptsimple
+
+sbin_SCRIPTS_SHELL = \
+           amcrypt \
+           amaespipe \
+           amcrypt-ossl \
+           amcrypt-ossl-asym
+
+amlibexec_SCRIPTS_PERL = 
+
+SCRIPTS_INCLUDE = \
+           amanda-sh-lib.sh
+
+EXTRA_DIST += amanda-sh-lib.sh.in
+
+CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
+SCRIPTS_PERL = $(CHECK_PERL)
+SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
+amlibexec_DATA = $(SCRIPTS_INCLUDE)
+amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
+sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
+
+# installation
+
+INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \
+                   dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA)
+
 lint:
        @echo $(LINT) $(libamanda_la_SOURCES)
-       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(libamanda_la_SOURCES)
+       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES)
        @echo $(LINT) $(genversion_SOURCES)
-       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(genversion_SOURCES)
+       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES)
 
 listlibsrc:
        @ for p in $(libamanda_la_SOURCES) $(REGEXCSRC); do     \
index e22c64b02b3a31186fab0ea3e5acc71c6ceba3c3..4e5b8a9191b591f49acd2b1591dd5a9c24880e09 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda library.
 
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
+
+
+
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,48 +162,133 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/versuff.c.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+@WANT_AMFLOCK_POSIX_TRUE@am__append_1 = amflock-posix.c
+@WANT_AMFLOCK_FLOCK_TRUE@am__append_2 = amflock-flock.c
+@WANT_AMFLOCK_LOCKF_TRUE@am__append_3 = amflock-lockf.c
+@WANT_AMFLOCK_LNLOCK_TRUE@am__append_4 = amflock-lnlock.c
+@WANT_RSH_SECURITY_TRUE@am__append_5 = rsh-security.c
+@WANT_SSH_SECURITY_TRUE@am__append_6 = ssh-security.c
+@WANT_BSD_SECURITY_TRUE@am__append_7 = bsd-security.c
+@WANT_BSDTCP_SECURITY_TRUE@am__append_8 = bsdtcp-security.c
+@WANT_BSDUDP_SECURITY_TRUE@am__append_9 = bsdudp-security.c
+@WANT_KRB4_SECURITY_TRUE@am__append_10 = krb4-security.c       
+@WANT_KRB5_SECURITY_TRUE@am__append_11 = krb5-security.c
 EXTRA_PROGRAMS = genversion$(EXEEXT) $(am__EXEEXT_1)
+TESTS = amflock-test$(EXEEXT)
+noinst_PROGRAMS = $(am__EXEEXT_2)
 subdir = common-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/versuff.c.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -93,75 +300,110 @@ am__vpath_adj = case $$p in \
     *) f=$$p;; \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libamanda_la_LIBADD =
-am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo \
-       bsd-security.lo bsdtcp-security.lo bsdudp-security.lo clock.lo \
-       conffile.lo debug.lo dgram.lo error.lo event.lo file.lo \
-       fileheader.lo krb4-security.lo krb5-security.lo match.lo \
-       packet.lo pipespawn.lo protocol.lo rsh-security.lo security.lo \
-       security-util.lo sl.lo ssh-security.lo statfs.lo stream.lo \
-       tapelist.lo token.lo util.lo version.lo versuff.lo
-libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS)
-am__EXEEXT_1 = statfs$(EXEEXT) token$(EXEEXT) file$(EXEEXT) \
-       bsdsecurity$(EXEEXT) amfeatures$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
+       "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamanda_la_DEPENDENCIES = ../gnulib/libgnu.la
+am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c clock.c \
+       columnar.c conffile.c debug.c dgram.c event.c file.c \
+       fileheader.c glib-util.c match.c packet.c pipespawn.c \
+       protocol.c security.c security-util.c sl.c sockaddr-util.c \
+       stream.c tapelist.c timestamp.c token.c util.c versuff.c \
+       amflock-posix.c amflock-flock.c amflock-lockf.c \
+       amflock-lnlock.c rsh-security.c ssh-security.c bsd-security.c \
+       bsdtcp-security.c bsdudp-security.c krb4-security.c \
+       krb5-security.c local-security.c
+@WANT_AMFLOCK_POSIX_TRUE@am__objects_1 = amflock-posix.lo
+@WANT_AMFLOCK_FLOCK_TRUE@am__objects_2 = amflock-flock.lo
+@WANT_AMFLOCK_LOCKF_TRUE@am__objects_3 = amflock-lockf.lo
+@WANT_AMFLOCK_LNLOCK_TRUE@am__objects_4 = amflock-lnlock.lo
+@WANT_RSH_SECURITY_TRUE@am__objects_5 = rsh-security.lo
+@WANT_SSH_SECURITY_TRUE@am__objects_6 = ssh-security.lo
+@WANT_BSD_SECURITY_TRUE@am__objects_7 = bsd-security.lo
+@WANT_BSDTCP_SECURITY_TRUE@am__objects_8 = bsdtcp-security.lo
+@WANT_BSDUDP_SECURITY_TRUE@am__objects_9 = bsdudp-security.lo
+@WANT_KRB4_SECURITY_TRUE@am__objects_10 = krb4-security.lo
+@WANT_KRB5_SECURITY_TRUE@am__objects_11 = krb5-security.lo
+am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo clock.lo \
+       columnar.lo conffile.lo debug.lo dgram.lo event.lo file.lo \
+       fileheader.lo glib-util.lo match.lo packet.lo pipespawn.lo \
+       protocol.lo security.lo security-util.lo sl.lo \
+       sockaddr-util.lo stream.lo tapelist.lo timestamp.lo token.lo \
+       util.lo versuff.lo $(am__objects_1) $(am__objects_2) \
+       $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+       $(am__objects_6) $(am__objects_7) $(am__objects_8) \
+       $(am__objects_9) $(am__objects_10) $(am__objects_11) \
+       local-security.lo
+nodist_libamanda_la_OBJECTS = version.lo
+libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS) \
+       $(nodist_libamanda_la_OBJECTS)
+libamanda_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamanda_la_LDFLAGS) $(LDFLAGS) -o $@
+am__EXEEXT_1 = token$(EXEEXT) file$(EXEEXT) bsdsecurity$(EXEEXT) \
+       amfeatures$(EXEEXT)
+am__EXEEXT_2 = amflock-test$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
 am_amfeatures_OBJECTS = amfeatures.test.$(OBJEXT)
 amfeatures_OBJECTS = $(am_amfeatures_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = alloc.$(OBJEXT) clock.$(OBJEXT) debug.$(OBJEXT) \
-       error.$(OBJEXT) util.$(OBJEXT) match.$(OBJEXT) sl.$(OBJEXT)
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) file.$(OBJEXT)
-amfeatures_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3)
+amfeatures_DEPENDENCIES = $(libamanda_la_LIBADD) \
+       $(STANDARD_COMMON_STUFF)
+am_amflock_test_OBJECTS = amflock-test.$(OBJEXT)
+amflock_test_OBJECTS = $(am_amflock_test_OBJECTS)
+amflock_test_DEPENDENCIES = libamanda.la
 am_bsdsecurity_OBJECTS = bsd-security.test.$(OBJEXT)
 bsdsecurity_OBJECTS = $(am_bsdsecurity_OBJECTS)
-bsdsecurity_DEPENDENCIES = alloc.$(OBJEXT) clock.$(OBJEXT) \
-       debug.$(OBJEXT) dgram.$(OBJEXT) error.$(OBJEXT) \
-       event.$(OBJEXT) file.$(OBJEXT) packet.$(OBJEXT) \
-       security.$(OBJEXT) ssh-security.$(OBJEXT) versuff.$(OBJEXT)
+bsdsecurity_DEPENDENCIES = alloc.lo clock.lo debug.lo dgram.lo \
+       event.lo file.lo packet.lo security.lo ssh-security.lo \
+       versuff.lo
 am_file_OBJECTS = file.test.$(OBJEXT)
 file_OBJECTS = $(am_file_OBJECTS)
-file_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+file_DEPENDENCIES = $(libamanda_la_LIBADD) \
+       $(STANDARD_COMMON_STUFF_NOT_FILE)
 am_genversion_OBJECTS = genversion.$(OBJEXT)
 genversion_OBJECTS = $(am_genversion_OBJECTS)
-genversion_DEPENDENCIES = $(am__DEPENDENCIES_1) versuff.lo
-am_statfs_OBJECTS = statfs.test.$(OBJEXT)
-statfs_OBJECTS = $(am_statfs_OBJECTS)
-statfs_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3)
+genversion_DEPENDENCIES = $(libamanda_la_LIBADD) versuff.lo \
+       ../gnulib/libgnu.la
 am_token_OBJECTS = token.test.$(OBJEXT)
 token_OBJECTS = $(am_token_OBJECTS)
-token_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+token_DEPENDENCIES = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
+amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libamanda_la_SOURCES) $(amfeatures_SOURCES) \
-       $(bsdsecurity_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \
-       $(statfs_SOURCES) $(token_SOURCES)
-DIST_SOURCES = $(libamanda_la_SOURCES) $(amfeatures_SOURCES) \
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libamanda_la_SOURCES) $(nodist_libamanda_la_SOURCES) \
+       $(amfeatures_SOURCES) $(amflock_test_SOURCES) \
        $(bsdsecurity_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \
-       $(statfs_SOURCES) $(token_SOURCES)
+       $(token_SOURCES)
+DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) $(amfeatures_SOURCES) \
+       $(amflock_test_SOURCES) $(bsdsecurity_SOURCES) $(file_SOURCES) \
+       $(genversion_SOURCES) $(token_SOURCES)
+amlibexecDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(amlibexec_DATA)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -169,14 +411,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -187,20 +434,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -214,60 +460,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -277,10 +632,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -291,24 +660,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -320,59 +723,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -381,75 +771,86 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = amanda-sh-lib.sh.in
+BUILT_SOURCES = genversion.h version.c
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log *.test.c
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \
+       version.c genversion genversion.h
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_srcdir)/gnulib   
-lib_LTLIBRARIES = libamanda.la
-LINT = @AMLINT@
-LINTFLAGS = @AMLINTFLAGS@
-libamanda_la_SOURCES = \
-       alloc.c                 \
-       amfeatures.c            \
-       amflock.c               \
-       bsd-security.c          \
-       bsdtcp-security.c       \
-       bsdudp-security.c       \
-       clock.c                 \
-       conffile.c              \
-       debug.c                 \
-       dgram.c                 \
-       error.c                 \
-       event.c                 \
-       file.c                  \
-       fileheader.c            \
-       krb4-security.c         \
-       krb5-security.c         \
-       match.c                 \
-       packet.c                \
-       pipespawn.c             \
-       protocol.c              \
-       rsh-security.c          \
-       security.c              \
-       security-util.c         \
-       sl.c                    \
-       ssh-security.c          \
-       statfs.c                \
-       stream.c                \
-       tapelist.c              \
-       token.c                 \
-       util.c                  \
-       version.c               \
-       versuff.c
-
-
-#libamanda_la_LIBADD = @LTLIBOBJS@
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+amlib_LTLIBRARIES = libamanda.la
+LINT = $(AMLINT)
+LINTFLAGS = $(AMLINTFLAGS)
+libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c clock.c \
+       columnar.c conffile.c debug.c dgram.c event.c file.c \
+       fileheader.c glib-util.c match.c packet.c pipespawn.c \
+       protocol.c security.c security-util.c sl.c sockaddr-util.c \
+       stream.c tapelist.c timestamp.c token.c util.c versuff.c \
+       $(am__append_1) $(am__append_2) $(am__append_3) \
+       $(am__append_4) $(am__append_5) $(am__append_6) \
+       $(am__append_7) $(am__append_8) $(am__append_9) \
+       $(am__append_10) $(am__append_11) local-security.c
+# version.c is generated; see below
+nodist_libamanda_la_SOURCES = version.c
+libamanda_la_LIBADD = \
+       ../gnulib/libgnu.la
+
 libamanda_la_LDFLAGS = -release $(VERSION)
 noinst_HEADERS = \
        amanda.h                \
        amfeatures.h            \
        arglist.h               \
        clock.h                 \
+       columnar.h              \
+       amflock.h               \
        conffile.h              \
+       debug.h                 \
        dgram.h                 \
        event.h                 \
+       file.h                  \
        fileheader.h            \
+       glib-util.h             \
        packet.h                \
        pipespawn.h             \
        protocol.h              \
@@ -457,62 +858,101 @@ noinst_HEADERS = \
        security.h              \
        security-util.h         \
        sl.h                    \
-       statfs.h                \
+       sockaddr-util.h         \
        stream.h                \
        tapelist.h              \
+       timestamp.h             \
        token.h                 \
        util.h                  \
        version.h
 
-genversion_SOURCES = genversion.c
-genversion_LDADD = $(libamanda_la_LIBADD) versuff.lo
+
+# Version-building steps:
+#
+# 1. configure builds svn-info.h, if svn info is available; this
+#    file is included in distribution tarballs
+# 2. Makefile creates genversion.h with build-time information
+# 3. Makefile builds genversion
+# 4. Makefile runs genversion to create version.c
+# 5. version.c is compiled into libamanda normally
+genversion_SOURCES = genversion.c genversion.h svn-info.h
+genversion_LDADD = $(libamanda_la_LIBADD)      \
+       versuff.lo                              \
+       ../gnulib/libgnu.la
+
 
 # these are used for testing only:
-TEST_PROGS = statfs token file bsdsecurity amfeatures
-CLEANFILES = *.test.c
-DISTCLEANFILES = version.c genversion.h genversion amanda-int.h
+TEST_PROGS = token file bsdsecurity amfeatures
 
 # used for testing only
 STANDARD_COMMON_STUFF_NOT_FILE = \
-       alloc.$(OBJEXT) \
-       clock.$(OBJEXT) \
-       debug.$(OBJEXT) \
-       error.$(OBJEXT) \
-       util.$(OBJEXT) \
-       match.$(OBJEXT) \
-       sl.$(OBJEXT)
+       alloc.lo \
+       clock.lo \
+       debug.lo \
+       util.lo \
+       match.lo \
+       sl.lo
 
 STANDARD_COMMON_STUFF = \
        $(STANDARD_COMMON_STUFF_NOT_FILE) \
-       file.$(OBJEXT)
+       file.lo
 
-statfs_SOURCES = statfs.test.c
-statfs_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
 token_SOURCES = token.test.c
 token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
 file_SOURCES = file.test.c
 file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE)
 bsdsecurity_SOURCES = bsd-security.test.c
 bsdsecurity_LDADD = $(libamanda_a_LIBADD) \
-                   alloc.$(OBJEXT) \
-                   clock.$(OBJEXT) \
-                   debug.$(OBJEXT) \
-                   dgram.$(OBJEXT) \
-                   error.$(OBJEXT) \
-                   event.$(OBJEXT) \
-                   file.$(OBJEXT) \
-                   packet.$(OBJEXT) \
-                   security.$(OBJEXT) \
-                   ssh-security.$(OBJEXT) \
-                   versuff.$(OBJEXT)
+                   alloc.lo \
+                   clock.lo \
+                   debug.lo \
+                   dgram.lo \
+                   event.lo \
+                   file.lo \
+                   packet.lo \
+                   security.lo \
+                   ssh-security.lo \
+                   versuff.lo
 
 amfeatures_SOURCES = amfeatures.test.c
 amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF)
-all: all-am
+amflock_test_SOURCES = amflock-test.c
+amflock_test_LDADD = libamanda.la
+
+# scripts
+
+# divide scripts up both by language and by destination directory.
+sbin_SCRIPTS_PERL = \
+           amgpgcrypt \
+           amcryptsimple
+
+sbin_SCRIPTS_SHELL = \
+           amcrypt \
+           amaespipe \
+           amcrypt-ossl \
+           amcrypt-ossl-asym
+
+amlibexec_SCRIPTS_PERL = 
+SCRIPTS_INCLUDE = \
+           amanda-sh-lib.sh
+
+CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
+SCRIPTS_PERL = $(CHECK_PERL)
+SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
+amlibexec_DATA = $(SCRIPTS_INCLUDE)
+amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
+sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
+
+# installation
+INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \
+                   dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA)
+
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -543,53 +983,98 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 versuff.c: $(top_builddir)/config.status $(srcdir)/versuff.c.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 libamanda.la: $(libamanda_la_OBJECTS) $(libamanda_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(libamanda_la_LDFLAGS) $(libamanda_la_OBJECTS) $(libamanda_la_LIBADD) $(LIBS)
+       $(libamanda_la_LINK) -rpath $(amlibdir) $(libamanda_la_OBJECTS) $(libamanda_la_LIBADD) $(LIBS)
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
 amfeatures$(EXEEXT): $(amfeatures_OBJECTS) $(amfeatures_DEPENDENCIES) 
        @rm -f amfeatures$(EXEEXT)
-       $(LINK) $(amfeatures_LDFLAGS) $(amfeatures_OBJECTS) $(amfeatures_LDADD) $(LIBS)
+       $(LINK) $(amfeatures_OBJECTS) $(amfeatures_LDADD) $(LIBS)
+amflock-test$(EXEEXT): $(amflock_test_OBJECTS) $(amflock_test_DEPENDENCIES) 
+       @rm -f amflock-test$(EXEEXT)
+       $(LINK) $(amflock_test_OBJECTS) $(amflock_test_LDADD) $(LIBS)
 bsdsecurity$(EXEEXT): $(bsdsecurity_OBJECTS) $(bsdsecurity_DEPENDENCIES) 
        @rm -f bsdsecurity$(EXEEXT)
-       $(LINK) $(bsdsecurity_LDFLAGS) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS)
+       $(LINK) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS)
 file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) 
        @rm -f file$(EXEEXT)
-       $(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS)
+       $(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS)
 genversion$(EXEEXT): $(genversion_OBJECTS) $(genversion_DEPENDENCIES) 
        @rm -f genversion$(EXEEXT)
-       $(LINK) $(genversion_LDFLAGS) $(genversion_OBJECTS) $(genversion_LDADD) $(LIBS)
-statfs$(EXEEXT): $(statfs_OBJECTS) $(statfs_DEPENDENCIES) 
-       @rm -f statfs$(EXEEXT)
-       $(LINK) $(statfs_LDFLAGS) $(statfs_OBJECTS) $(statfs_LDADD) $(LIBS)
+       $(LINK) $(genversion_OBJECTS) $(genversion_LDADD) $(LIBS)
 token$(EXEEXT): $(token_OBJECTS) $(token_DEPENDENCIES) 
        @rm -f token$(EXEEXT)
-       $(LINK) $(token_LDFLAGS) $(token_OBJECTS) $(token_LDADD) $(LIBS)
+       $(LINK) $(token_OBJECTS) $(token_LDADD) $(LIBS)
+install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f $$d$$p; then \
+           f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+           echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+           $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-amlibexecSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
+       done
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+       @list='$(sbin_SCRIPTS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f $$d$$p; then \
+           f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+           echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+           $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-sbinSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_SCRIPTS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+         echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+       done
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -600,23 +1085,30 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-flock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-lnlock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-lockf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-posix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdtcp-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdudp-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/columnar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgram.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileheader.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genversion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glib-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb4-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5-security.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipespawn.Plo@am__quote@
@@ -625,11 +1117,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh-security.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs.test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapelist.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timestamp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.test.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
@@ -637,22 +1129,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versuff.Plo@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -662,10 +1154,23 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
+install-amlibexecDATA: $(amlibexec_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(amlibexecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         $(amlibexecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \
+       done
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+uninstall-amlibexecDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlibexec_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
+       done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -715,23 +1220,95 @@ GTAGS:
 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
-         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       srcdir=$(srcdir); export srcdir; \
+       list=' $(TESTS) '; \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               echo "XPASS: $$tst"; \
+             ;; \
+             *) \
+               echo "PASS: $$tst"; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xfail=`expr $$xfail + 1`; \
+               echo "XFAIL: $$tst"; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               echo "FAIL: $$tst"; \
+             ;; \
+             esac; \
+           else \
+             skip=`expr $$skip + 1`; \
+             echo "SKIP: $$tst"; \
+           fi; \
+         done; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="All $$all tests passed"; \
+           else \
+             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+           fi; \
          else \
-           dir=''; \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all tests failed"; \
+           else \
+             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+           fi; \
+         fi; \
+         dashes="$$banner"; \
+         skipped=""; \
+         if test "$$skip" -ne 0; then \
+           skipped="($$skip tests were not run)"; \
+           test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$skipped"; \
          fi; \
+         report=""; \
+         if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+           report="Please report to $(PACKAGE_BUGREPORT)"; \
+           test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$report"; \
+         fi; \
+         dashes=`echo "$$dashes" | sed s/./=/g`; \
+         echo "$$dashes"; \
+         echo "$$banner"; \
+         test -z "$$skipped" || echo "$$skipped"; \
+         test -z "$$report" || echo "$$report"; \
+         echo "$$dashes"; \
+         test "$$failed" -eq 0; \
+       else :; fi
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -742,14 +1319,21 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
+               $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -764,6 +1348,7 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -775,16 +1360,20 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-       mostlyclean-am
+clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \
+       clean-noinstPROGRAMS mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -796,14 +1385,27 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
-install-exec-am: install-libLTLIBRARIES
+install-dvi: install-dvi-am
+
+install-exec-am: install-amlibexecDATA install-amlibexecSCRIPTS \
+       install-sbinSCRIPTS
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+install-html: install-html-am
 
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -824,43 +1426,177 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \
+       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libtool ctags distclean \
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-local \
+       clean clean-amlibLTLIBRARIES clean-generic clean-libtool \
+       clean-noinstPROGRAMS ctags dist-hook 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-exec \
-       install-exec-am install-info install-info-am \
-       install-libLTLIBRARIES install-man install-strip installcheck \
-       installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-info-am \
-       uninstall-libLTLIBRARIES
-
-
-.sh:
-       cat $< > $@
+       install install-am install-amlibLTLIBRARIES \
+       install-amlibexecDATA install-amlibexecSCRIPTS install-data \
+       install-data-am install-data-hook install-dvi install-dvi-am \
+       install-exec install-exec-am install-exec-hook install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-sbinSCRIPTS install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-amlibLTLIBRARIES \
+       uninstall-amlibexecDATA uninstall-amlibexecSCRIPTS \
+       uninstall-sbinSCRIPTS
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
        chmod a+x $@
 
-genversion.@OBJEXT@: genversion.h
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
+
 genversion.h: $(top_builddir)/config.status
        -rm -f $@ $@.new
        echo '#define CC "$(CC)"' > $@.new
        echo '#define BUILT_DATE "'`date`'"' >> $@.new
-       echo '#define BUILT_MACH "'`uname -a || echo UNKNOWN HOST`'"' >> $@.new
+       echo '#define BUILT_MACH "$(target)"' >> $@.new
        mv $@.new $@
 
-version.c:     genversion$(EXEEXT)
+version.c: genversion$(EXEEXT)
        -rm -f version.c
-       ./genversion > version.c
+       ./genversion$(EXEEXT) > version.c
 
 lint:
        @echo $(LINT) $(libamanda_la_SOURCES)
-       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(libamanda_la_SOURCES)
+       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES)
        @echo $(LINT) $(genversion_SOURCES)
-       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(genversion_SOURCES)
+       @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES)
 
 listlibsrc:
        @ for p in $(libamanda_la_SOURCES) $(REGEXCSRC); do     \
index 50cfc084772911587884597618930ffab6302a57..4089c00367444764cde7e8d2700d5f7bfff4ed49 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: alloc.c,v 1.37 2006/07/05 10:41:32 martinea Exp $
+ * $Id: alloc.c 5280 2007-02-13 15:58:56Z martineau $
  *
  * Memory allocators with error handling.  If the allocation fails,
  * errordump() is called, relieving the caller from checking the return
 #include "arglist.h"
 #include "queue.h"
 
-#define MIN_ALLOC 64
-static char *internal_vstralloc(const char *, va_list);
+#define        MIN_ALLOC       64
 
-/*
- *=====================================================================
- * debug_caller_loc -- keep track of all allocation callers
- *
- * const char *debug_caller_loc(const char *file, int line)
- *
- * entry:      file = source file
- *             line = source line
- * exit:       a string like "genversion.c@999"
- *
- * The debug malloc library has a concept of a call stack that can be used
- * to fine tune what was running when a particular allocation was done.
- * We use it to tell who called our various allocation wrappers since
- * it wouldn't do much good to tell us a problem happened because of
- * the malloc call in alloc (they are all from there at some point).
- *
- * But the library expects the string passed to malloc_enter/malloc_leave
- * to be static, so we build a linked list of each one we get (there are
- * not really that many during a given execution).  When we get a repeat
- * we return the previously allocated string.  For a bit of performance,
- * we keep the list in least recently used order, which helps because
- * the calls to us come in pairs (one for malloc_enter and one right
- * after for malloc_leave).
- *=====================================================================
- */
-
-const char *
-debug_caller_loc(
-    const char *file,
-    int line)
-{
-    /*@keep@*/
-    struct loc_str {
-       char *str;
-       LIST_ENTRY(loc_str) le;
-    } *ls;
-    static LIST_HEAD(, loc_str) root = LIST_HEAD_INITIALIZER(root);
-    static char loc[256];      /* big enough for filename@lineno */
-    const char *p;
-
-    if ((p = strrchr(file, '/')) != NULL)
-       file = p + 1;                           /* just the last path element */
-
-    snprintf(loc, SIZEOF(loc), "%s@%d", file, line);
-
-    for (ls = LIST_FIRST(&root); ls != NULL; ls = LIST_NEXT(ls, le)) {
-       if (strcmp(loc, ls->str) == 0) {
-           if (ls != LIST_FIRST(&root)) {
-               /*
-                * This is a repeat and was not at the head of the list.
-                * Unlink it and move it to the front.
-                */
-               LIST_REMOVE(ls, le);
-               LIST_INSERT_HEAD(&root, ls, le);
-           }
-           return (ls->str);
-       }
-    }
-
-    /*
-     * This is a new entry.  Put it at the head of the list.
-     */
-    ls = malloc(SIZEOF(*ls));
-    if (ls == NULL)
-       return ("??");                  /* not much better than abort */
-    ls->str = malloc(strlen(loc) + 1);
-    if (ls->str == NULL) {
-       free(ls);
-       return ("??");                  /* not much better than abort */
-    }
-    strcpy(ls->str, loc);
-    malloc_mark(ls);
-    malloc_mark(ls->str);
-    LIST_INSERT_HEAD(&root, ls, le);
-    return (ls->str);
-}
-
-/*
- *=====================================================================
- * Save the current source line for vstralloc/newvstralloc.
- *
- * int debug_alloc_push (char *s, int l)
- *
- * entry:      s = source file
- *             l = source line
- * exit:       always zero
- * 
- * See the comments in amanda.h about what this is used for.
- *=====================================================================
- */
-
-#define        DEBUG_ALLOC_SAVE_MAX    10
-
-static struct {
-       char            *file;
-       int             line;
-} debug_alloc_loc_info[DEBUG_ALLOC_SAVE_MAX];
-static int debug_alloc_ptr = 0;
-
-static char            *saved_file;
-static int             saved_line;
-
-int
-debug_alloc_push(
-    char *s,
-    int l)
-{
-    debug_alloc_loc_info[debug_alloc_ptr].file = s;
-    debug_alloc_loc_info[debug_alloc_ptr].line = l;
-    debug_alloc_ptr = (debug_alloc_ptr + 1) % DEBUG_ALLOC_SAVE_MAX;
-    return 0;
-}
-
-/*
- *=====================================================================
- * Pop the current source line information for vstralloc/newvstralloc.
- *
- * int debug_alloc_pop (void)
- *
- * entry:      none
- * exit:       none
- * 
- * See the comments in amanda.h about what this is used for.
- *=====================================================================
- */
-
-void
-debug_alloc_pop(void)
-{
-    debug_alloc_ptr =
-      (debug_alloc_ptr + DEBUG_ALLOC_SAVE_MAX - 1) % DEBUG_ALLOC_SAVE_MAX;
-    saved_file = debug_alloc_loc_info[debug_alloc_ptr].file;
-    saved_line = debug_alloc_loc_info[debug_alloc_ptr].line;
-}
+static char *internal_vstralloc(const char *, int, const char *, va_list);
 
 /*
  * alloc - a wrapper for malloc.
  */
 void *
 debug_alloc(
-    const char *s,
-    int l,
-    size_t size)
+    const char *file,
+    int                line,
+    size_t     size)
 {
     void *addr;
 
-    malloc_enter(debug_caller_loc(s, l));
     addr = (void *)malloc(max(size, 1));
     if (addr == NULL) {
-       errordump("%s@%d: memory allocation failed (" SIZE_T_FMT " bytes requested)",
-                 s ? s : "(unknown)",
-                 s ? l : -1,
-                 (SIZE_T_FMT_TYPE)size);
+       errordump(_("%s@%d: memory allocation failed (%zu bytes requested)"),
+                 file ? file : _("(unknown)"),
+                 file ? line : -1,
+                 size);
        /*NOTREACHED*/
     }
-    malloc_leave(debug_caller_loc(s, l));
     return addr;
 }
 
@@ -202,17 +66,15 @@ debug_alloc(
  */
 void *
 debug_newalloc(
-    const char *s,
-    int l,
-    void *old,
-    size_t size)
+    const char *file,
+    int                line,
+    void *     old,
+    size_t     size)
 {
     char *addr;
 
-    malloc_enter(debug_caller_loc(s, l));
-    addr = debug_alloc(s, l, size);
+    addr = debug_alloc(file, line, size);
     amfree(old);
-    malloc_leave(debug_caller_loc(s, l));
     return addr;
 }
 
@@ -223,41 +85,17 @@ debug_newalloc(
  */
 char *
 debug_stralloc(
-    const char *s,
-    int l,
+    const char *file,
+    int                line,
     const char *str)
 {
     char *addr;
 
-    malloc_enter(debug_caller_loc(s, l));
-    addr = debug_alloc(s, l, strlen(str) + 1);
+    addr = debug_alloc(file, line, strlen(str) + 1);
     strcpy(addr, str);
-    malloc_leave(debug_caller_loc(s, l));
     return (addr);
 }
 
-/* vstrextend -- Extends the existing string by appending the other 
- * arguments. */
-/*@ignore@*/
-arglist_function(
-    char *vstrextend,
-    char **, oldstr)
-{
-       char *keep = *oldstr;
-       va_list ap;
-
-       arglist_start(ap, oldstr);
-
-       if (*oldstr == NULL)
-               *oldstr = "";
-       *oldstr = internal_vstralloc(*oldstr, ap);
-        amfree(keep);
-
-       arglist_end(ap);
-        return *oldstr;
-}
-/*@end@*/
-
 /*
  * internal_vstralloc - copies up to MAX_STR_ARGS strings into newly
  * allocated memory.
@@ -270,6 +108,8 @@ arglist_function(
 
 static char *
 internal_vstralloc(
+    const char *file,
+    int                line,
     const char *str,
     va_list argp)
 {
@@ -282,7 +122,7 @@ internal_vstralloc(
     size_t l;
 
     if (str == NULL) {
-       errordump("internal_vstralloc: str is NULL");
+       errordump(_("internal_vstralloc: str is NULL"));
        /*NOTREACHED*/
     }
 
@@ -297,9 +137,9 @@ internal_vstralloc(
            continue;                           /* minor optimisation */
        }
        if (a >= MAX_VSTRALLOC_ARGS) {
-           errordump("%s@%d: more than %d args to vstralloc",
-                     saved_file ? saved_file : "(unknown)",
-                     saved_file ? saved_line : -1,
+           errordump(_("%s@%d: more than %d args to vstralloc"),
+                     file ? file : _("(unknown)"),
+                     file ? line : -1,
                      MAX_VSTRALLOC_ARGS);
            /*NOTREACHED*/
        }
@@ -309,7 +149,7 @@ internal_vstralloc(
        a++;
     }
 
-    result = debug_alloc(saved_file, saved_line, total_len+1);
+    result = debug_alloc(file, line, total_len+1);
 
     next = result;
     for (b = 0; b < a; b++) {
@@ -325,19 +165,19 @@ internal_vstralloc(
 /*
  * vstralloc - copies multiple strings into newly allocated memory.
  */
-arglist_function(
-    char *debug_vstralloc,
-    const char *, str)
+char *
+debug_vstralloc(
+    const char *file,
+    int                line,
+    const char *str,
+    ...)
 {
     va_list argp;
     char *result;
 
-    debug_alloc_pop();
-    malloc_enter(debug_caller_loc(saved_file, saved_line));
     arglist_start(argp, str);
-    result = internal_vstralloc(str, argp);
+    result = internal_vstralloc(file, line, str, argp);
     arglist_end(argp);
-    malloc_leave(debug_caller_loc(saved_file, saved_line));
     return result;
 }
 
@@ -347,17 +187,15 @@ arglist_function(
  */
 char *
 debug_newstralloc(
-    const char *s,
-    int l,
-    char *oldstr,
+    const char *file,
+    int                line,
+    char *     oldstr,
     const char *newstr)
 {
     char *addr;
 
-    malloc_enter(debug_caller_loc(s, l));
-    addr = debug_stralloc(s, l, newstr);
+    addr = debug_stralloc(file, line, newstr);
     amfree(oldstr);
-    malloc_leave(debug_caller_loc(s, l));
     return (addr);
 }
 
@@ -365,21 +203,21 @@ debug_newstralloc(
 /*
  * newvstralloc - free existing string and then vstralloc a new one.
  */
-arglist_function1(
-    char *debug_newvstralloc,
-    char *, oldstr,
-    const char *, newstr)
+char *
+debug_newvstralloc(
+    const char *file,
+    int                line,
+    char *     oldstr,
+    const char *newstr,
+    ...)
 {
     va_list argp;
     char *result;
 
-    debug_alloc_pop();
-    malloc_enter(debug_caller_loc(saved_file, saved_line));
     arglist_start(argp, newstr);
-    result = internal_vstralloc(newstr, argp);
+    result = internal_vstralloc(file, line, newstr, argp);
     arglist_end(argp);
     amfree(oldstr);
-    malloc_leave(debug_caller_loc(saved_file, saved_line));
     return result;
 }
 
@@ -389,37 +227,96 @@ arglist_function1(
  */
 char *
 debug_vstrallocf(
+    const char *file,
+    int                line,
     const char *fmt,
     ...)
 {
-    char *      result;
-    size_t      size;
-    va_list     argp;
+    char *     result;
+    size_t     size;
+    va_list    argp;
 
-    debug_alloc_pop();
-    malloc_enter(debug_caller_loc(saved_file, saved_line));
 
-    result = debug_alloc(saved_file, saved_line, MIN_ALLOC);
+    result = debug_alloc(file, line, MIN_ALLOC);
     if (result != NULL) {
 
        arglist_start(argp, fmt);
-       size = vsnprintf(result, MIN_ALLOC, fmt, argp);
+       size = g_vsnprintf(result, MIN_ALLOC, fmt, argp);
        arglist_end(argp);
 
        if (size >= (size_t)MIN_ALLOC) {
            amfree(result);
-           result = debug_alloc(saved_file, saved_line, size + 1);
+           result = debug_alloc(file, line, size + 1);
 
            arglist_start(argp, fmt);
-           (void)vsnprintf(result, size + 1, fmt, argp);
+           (void)g_vsnprintf(result, size + 1, fmt, argp);
            arglist_end(argp);
        }
     }
 
-    malloc_leave(debug_caller_loc(saved_file, saved_line));
     return result;
 }
 
+
+/*
+ * newvstrallocf - free existing string and then vstrallocf a new one.
+ */
+char *
+debug_newvstrallocf(
+    const char *file,
+    int                line,
+    char *     oldstr,
+    const char *fmt,
+    ...)
+{
+    size_t     size;
+    char *     result;
+    va_list    argp;
+
+    result = debug_alloc(file, line, MIN_ALLOC);
+    if (result != NULL) {
+
+       arglist_start(argp, fmt);
+       size = g_vsnprintf(result, MIN_ALLOC, fmt, argp);
+       arglist_end(argp);
+
+       if (size >= MIN_ALLOC) {
+           amfree(result);
+           result = debug_alloc(file, line, size + 1);
+
+           arglist_start(argp, fmt);
+           (void)g_vsnprintf(result, size + 1, fmt, argp);
+           arglist_end(argp);
+       }
+    }
+    amfree(oldstr);
+    return result;
+}
+
+/* vstrextend -- Extends the existing string by appending the other 
+ * arguments. */
+char *
+debug_vstrextend(
+    const char *file,
+    int                line,
+    char **    oldstr,
+    ...)
+{
+       char *keep = *oldstr;
+       va_list ap;
+
+       arglist_start(ap, oldstr);
+
+       if (*oldstr == NULL)
+               *oldstr = "";
+       *oldstr = internal_vstralloc(file, line, *oldstr, ap);
+        amfree(keep);
+
+       arglist_end(ap);
+        return *oldstr;
+}
+
+
 extern char **environ;
 /*
  * safe_env - build a "safe" environment list.
@@ -512,13 +409,13 @@ safe_env(void)
 
 int
 debug_amtable_alloc(
-    const char *s,
-    int l,
-    void **table,
-    size_t *current,
-    size_t elsize,
-    size_t count,
-    int bump,
+    const char *file,
+    int                line,
+    void **    table,
+    size_t *   current,
+    size_t     elsize,
+    size_t     count,
+    int                bump,
     void (*init_func)(void *))
 {
     void *table_new;
@@ -527,7 +424,7 @@ debug_amtable_alloc(
 
     if (count >= *current) {
        table_count_new = ((count + bump) / bump) * bump;
-       table_new = debug_alloc(s, l, table_count_new * elsize);
+       table_new = debug_alloc(file, line, table_count_new * elsize);
        if (0 != *table) {
            memcpy(table_new, *table, *current * elsize);
            free(*table);
@@ -557,8 +454,8 @@ debug_amtable_alloc(
 
 void
 amtable_free(
-    void **table,
-    size_t *current)
+    void **    table,
+    size_t *   current)
 {
     amfree(*table);
     *current = 0;
diff --git a/common-src/amaespipe.sh b/common-src/amaespipe.sh
new file mode 100755 (executable)
index 0000000..8d3aa1c
--- /dev/null
@@ -0,0 +1,90 @@
+#! @SHELL@
+#
+# Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
+# 
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+# 
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# 
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+# wrapper script to use aespipe
+# based on bz2aespipe distributed by aespipe from 
+# http://loop-aes.sourceforge.net/
+# FILE FORMAT
+# 10 bytes: constant string 'bz2aespipe'
+# 10 bytes: itercountk digits
+# 1 byte: '0' = AES128, '1' = AES192, '2' = AES256
+# 1 byte: '0' = SHA256, '1' = SHA384, '2' = SHA512, '3' = RMD160
+# 24 bytes: random seed string
+# remaining bytes are aespipe encrypted
+
+# These definitions are only used when encrypting.
+# Decryption will autodetect these definitions from archive.
+ENCRYPTION=AES256
+HASHFUNC=SHA256
+ITERCOUNTK=100
+WAITSECONDS=1
+AMANDA_HOME=~@CLIENT_LOGIN@
+GPGKEY="$AMANDA_HOME/.gnupg/am_key.gpg"
+FDNUMBER=3
+
+if test x$1 = x-d ; then
+    # decrypt
+    n=`head -c 10 - | tr -d -c 0-9a-zA-Z`
+    if test x${n} != xbz2aespipe ; then
+        echo `_ 'bz2aespipe: wrong magic - aborted'` >/dev/tty
+        exit 1
+    fi
+    itercountk=`head -c 10 - | tr -d -c 0-9`
+    if test x${itercountk} = x ; then itercountk=0; fi
+    n=`head -c 1 - | tr -d -c 0-9`
+    encryption=AES128
+    if test x${n} = x1 ; then encryption=AES192; fi
+    if test x${n} = x2 ; then encryption=AES256; fi
+    n=`head -c 1 - | tr -d -c 0-9`
+    hashfunc=SHA256
+    if test x${n} = x1 ; then hashfunc=SHA384; fi
+    if test x${n} = x2 ; then hashfunc=SHA512; fi
+    if test x${n} = x3 ; then hashfunc=RMD160; fi
+    seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/`
+    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -S ${seedstr} -C ${itercountk} -d
+else
+    # encrypt
+    echo -n bz2aespipe
+    echo ${ITERCOUNTK} | awk '{printf "%10u", $1;}'
+    n=`echo ${ENCRYPTION} | tr -d -c 0-9`
+    aesstr=0
+    if test x${n} = x192 ; then aesstr=1; fi
+    if test x${n} = x256 ; then aesstr=2; fi
+    n=`echo ${HASHFUNC} | tr -d -c 0-9`
+    hashstr=0
+    if test x${n} = x384 ; then hashstr=1; fi
+    if test x${n} = x512 ; then hashstr=2; fi
+    if test x${n} = x160 ; then hashstr=3; fi
+    seedstr=`head -c 18 /dev/urandom | uuencode -m - | head -n 2 | tail -n 1`
+    echo -n ${aesstr}${hashstr}${seedstr}
+    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
+fi
+exit 0
diff --git a/common-src/amanda-sh-lib.sh.in b/common-src/amanda-sh-lib.sh.in
new file mode 100644 (file)
index 0000000..0c82190
--- /dev/null
@@ -0,0 +1,49 @@
+# Shell library containing functions and definitions common to amanda's
+# shell scripts and wrappers.
+
+# Include this file as follows:
+#   prefix="@prefix@"
+#   exec_prefix="@exec_prefix@"
+#   amlibexecdir="@amlibexecdir@"
+#   . "${amlibexecdir}/amanda-sh-lib.sh"
+
+####
+# Configure variables
+
+GREP="@GREP@"
+EGREP="@EGREP@"
+GETTEXT="@GETTEXT@"
+GNUPLOT="@GNUPLOT@"
+GNUTAR="@GNUTAR@"
+STAR="@STAR@"
+SAMBA_CLIENT="@SAMBA_CLIENT@"
+GZIP="@GZIP@"
+SORT="@SORT@"
+MAILER="@MAILER@"
+PERL="@PERL@"
+AWK="@AWK@"
+
+####
+# Set up PATH for finding amanda executables
+
+PATH="@sbindir@:@amlibexecdir@:$PATH"
+
+####
+# Gettext
+
+# use as follows:
+#   echo `_ "%s: '%s' is not executable" "$myname" "$binpath"`
+# NOTE: use a text editor with shell syntax hilighting to avoid
+# quoting errors!
+
+if test -n "$GETTEXT"; then
+    _() {
+           fmt=`$GETTEXT -d amanda "$1"`
+           shift
+           printf "$fmt" $*
+    }
+else
+    _() {
+       printf "$@"
+    }
+fi
index 2858516b7e7df17c1619b07bad7b2d1337139c3b..886e1156ab9766b14946d288470b51c80a1a75fb 100644 (file)
 #ifndef AMANDA_H
 #define AMANDA_H
 
+#include <glib.h>
+#include <glib/gprintf.h>
+
+#include "amflock.h"
+
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+/* use a relative path here to avoid conflicting with Perl's config.h. */
+#include "../config/config.h"
 #endif
 
 /*
@@ -54,6 +60,9 @@
 #  include <sys/types.h>
 #endif
 
+/* gnulib creates this header locally if the system doesn't provide it */
+#include <stdint.h>
+
 /*
  * I would prefer that each Amanda module include only those system headers
  * that are locally needed, but on most Unixes the system header files are not
 #  endif
 #endif
 
+#ifdef ENABLE_NLS
+#  include <libintl.h>
+#  include <locale.h>
+#  define  plural(String1, String2, Count)                             \
+               (((Count) == 1) ? (String1) : (String2))
+#else
+#  define plural(String1, String2, Count)                              \
+               (((Count) == 1) ? (String1) : (String2))
+#  define setlocale(Which, Locale)
+#  define textdomain(Domain)
+#  define bindtextdomain(Package, Directory)
+#  define gettext(String)                      String
+#  define dgettext(Domain, String)             String
+#  define dcgettext(Domain, String, Catagory)  String
+#  define ngettext(String1, String2, Count)                            \
+               plural((String1), (String2), (Count))
+#  define dngettext(Domain, String1, String2, Count)                   \
+               plural((String1), (String2), (Count))
+#  define dcngettext(Domain, String1, String2, Count, Catagory)                \
+               plural((String1), (String2), (Count))
+#endif
+#define T_(String)                     String
+#ifndef SWIG /* TODO: make this go away */
+#define _(String)                      dgettext("amanda", (String))
+#endif
+
 #ifdef HAVE_FCNTL_H
 #  include <fcntl.h>
 #endif
@@ -250,9 +285,12 @@ struct iovec {
 #  include <unistd.h>
 #endif
 
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>
+#endif
+
 #include <ctype.h>
 #include <errno.h>
-#include <netinet/in.h>
 #include <pwd.h>
 #include <signal.h>
 #include <setjmp.h>
@@ -260,136 +298,22 @@ struct iovec {
 #include <sys/resource.h>
 #include <sys/socket.h>
 
-#if !defined(CONFIGURE_TEST)
-#  include "amanda-int.h"
-#endif
-
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
 
+/* Support for missing IPv6 components */
 #ifndef HAVE_SOCKADDR_STORAGE
 #  define sockaddr_storage sockaddr_in
 #  define ss_family sin_family
 #endif
 
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
-#endif
-
-/* Calculate the length of the data in a struct sockaddr_storage.
- * THIS IS A HACK.
- *
- * To be truly portable, the length of an address should be passed
- * in a companion variable.  When such lengths are available
- * everywhere they are needed, this macro should be removed.
- */
-#ifdef WORKING_IPV6
-# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in))
-#else
-# define SS_LEN(ss) (sizeof(struct sockaddr_in))
-#endif
-
-
-/* AF_NATIVE is the "best" address family we support, backward compatible
- * through to AF_INET.
- */
-#ifdef WORKING_IPV6
-#define AF_NATIVE AF_INET6
-#else
-#define AF_NATIVE AF_INET
-#endif
-
-/* SS_INIT(ss, family) initializes ss to all zeroes (as directed by RFC),
- * and sets its ss_family as specified
- */
-#define SS_INIT(ss, family) do { \
-    memset((ss), 0, sizeof(*(ss))); \
-    (ss)->ss_family = (family); \
-} while (0);
-
-/* SS_SET_INADDR_ANY(ss) sets ss to the family-appropriate equivalent of
- * INADDR_ANY, a wildcard address and port.
- */
-#ifdef WORKING_IPV6
-#define SS_SET_INADDR_ANY(ss) do { \
-    switch ((ss)->ss_family) { \
-        case AF_INET6: \
-            ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \
-            ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \
-            break; \
-        case AF_INET: \
-            ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
-            break; \
-    } \
-} while (0);
-#else
-#define SS_SET_INADDR_ANY(ss) do { \
-    ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
-} while (0);
-#endif
-
-/* Set/get the port in a sockaddr_storage that already has an family */
-#ifdef WORKING_IPV6
-#define SS_SET_PORT(ss, port) \
-switch ((ss)->ss_family) { \
-    case AF_INET: \
-        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \
-        break; \
-    case AF_INET6: \
-        ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \
-        break; \
-    default: assert(0); \
-}
-#else
-#define SS_SET_PORT(ss, port) \
-        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port));
-#endif
-
 #ifdef WORKING_IPV6
-#define SS_GET_PORT(ss) (ntohs( \
-       (ss)->ss_family == AF_INET6? \
-        ((struct sockaddr_in6 *)(ss))->sin6_port \
-       :((struct sockaddr_in *)(ss))->sin_port))
-#else
-#define SS_GET_PORT(ss) (ntohs( \
-        ((struct sockaddr_in *)(ss))->sin_port))
+#define INET6
 #endif
 
-/*
- * The dbmalloc package comes from:
- *
- *  http://www.clark.net/pub/dickey/dbmalloc/dbmalloc.tar.gz
- *
- * or
- *
- *  ftp://gatekeeper.dec.com/pub/usenet/comp.sources.misc/volume32/dbmalloc/
- *
- * The following functions are sprinkled through the code, but are
- * disabled unless USE_DBMALLOC is defined:
- *
- *  malloc_enter(char *) -- stack trace for malloc reports
- *  malloc_leave(char *) -- stack trace for malloc reports
- *  malloc_mark(void *) -- mark an area as never to be free-d
- *  malloc_chain_check(void) -- check the malloc area now
- *  malloc_dump(int fd) -- report the malloc contents to a file descriptor
- *  malloc_list(int fd, ulong a, ulong b) -- report memory activated since
- *     history stamp a that is still active as of stamp b (leak check)
- *  malloc_inuse(ulong *h) -- create history stamp h and return the amount
- *     of memory currently in use.
- */
-
-#ifdef USE_DBMALLOC
-#include "dbmalloc.h"
-#else
-#define        malloc_enter(func)              ((void)0)
-#define        malloc_leave(func)              ((void)0)
-#define        malloc_mark(ptr)                ((void)0)
-#define        malloc_chain_check()            ((void)0)
-#define        malloc_dump(fd)                 ((void)0)
-#define        malloc_list(a,b,c)              ((void)0)
-#define        malloc_inuse(hist)              (*(hist) = 0, 0)
-#define        dbmalloc_caller_loc(x,y)        (x)
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
 #endif
 
 #if !defined(HAVE_SIGACTION) && defined(HAVE_SIGVEC)
@@ -457,76 +381,6 @@ extern int errno;
 #define stringize(x) #x
 #define stringconcat(x, y) x ## y
 
-/*
- * So that we can use GNUC attributes (such as to get -Wall warnings
- * for printf-like functions).  Only do this in gcc 2.7 or later ...
- * it may work on earlier stuff, but why chance it.
- */
-#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(S_SPLINT_S) || defined(LINT) || defined(__lint)
-#undef __attribute__
-#define __attribute__(__x)
-#endif
-
-/*
- * assertions, but call error() instead of abort 
- */
-#ifndef ASSERTIONS
-
-#define assert(exp) ((void)0)
-
-#else  /* ASSERTIONS */
-
-#define assert(exp)    do {                                            \
-    if (!(exp)) {                                                      \
-       onerror(abort);                                                 \
-       error("assert: %s false, file %s, line %d",                     \
-          stringize(exp), __FILE__, __LINE__);                         \
-        /*NOTREACHED*/                                                 \
-    }                                                                  \
-} while (0)
-
-#endif /* ASSERTIONS */
-
-/*
- * print debug output, else compile to nothing.
- */
-
-#ifdef DEBUG_CODE                                                      /* { */
-#   define dbopen(a)   debug_open(a)
-#   define dbreopen(a,b) debug_reopen(a,b)
-#   define dbrename(a,b) debug_rename(a,b)
-#   define dbclose()   debug_close()
-#   define dbprintf(p) (debug_printf p)
-#   define dbfd()      debug_fd()
-#   define dbfp()      debug_fp()
-#   define dbfn()      debug_fn()
-
-extern void debug_open(char *subdir);
-extern void debug_reopen(char *file, char *notation);
-extern void debug_rename(char *config, char *subdir);
-extern void debug_close(void);
-extern void debug_printf(const char *format, ...)
-    __attribute__ ((format (printf, 1, 2)));
-extern int  debug_fd(void);
-extern FILE *  debug_fp(void);
-extern char *  debug_fn(void);
-extern void set_debug_prefix_pid(pid_t);
-extern char *debug_prefix(char *);
-extern char *debug_prefix_time(char *);
-#else                                                                  /* }{ */
-#   define dbopen(a)
-#   define dbreopen(a,b)
-#   define dbrename(a,b)
-#   define dbclose()
-#   define dbprintf(p)
-#   define dbfd()      (-1)
-#   define dbfp()      NULL
-#   define dbfn()      NULL
-#   define set_debug_prefix_pid(x)
-#   define debug_prefix(x) get_pname()
-#   define debug_prefix_time(x) get_pname()
-#endif                                                                 /* } */
-
 /* amanda #days calculation, with roundoff */
 
 #define SECS_PER_DAY   (24*60*60)
@@ -566,83 +420,43 @@ extern char *debug_prefix_time(char *);
 #define MAX_TAPE_LABEL_BUF (MAX_TAPE_LABEL_LEN+1)
 #define MAX_TAPE_LABEL_FMT "%10240s"
 
-/* Define miscellaneous amanda functions.  */
-#define ERR_INTERACTIVE        1
-#define ERR_SYSLOG     2
-#define ERR_AMANDALOG  4
-
-extern void   set_logerror(void (*f)(char *));
-extern void   set_pname(char *pname);
-extern char  *get_pname(void);
-extern int    erroutput_type;
-extern void   error(const char *format, ...)
-    __attribute__ ((format (printf, 1, 2), noreturn));
-extern void   errordump(const char *format, ...)
-    __attribute__ ((format (printf, 1, 2), noreturn));
-extern int    onerror(void (*errf)(void));
-
-extern void *debug_alloc      (const char *c, int l, size_t size);
-extern void *debug_newalloc   (const char *c, int l, void *old, size_t size);
-extern char *debug_stralloc   (const char *c, int l, const char *str);
-extern char *debug_newstralloc(const char *c, int l, char *oldstr,
-                              const char *newstr);
-extern const char *debug_caller_loc (const char *file, int line);
-extern int debug_alloc_push (char *file, int line);
-extern void debug_alloc_pop (void);
+#include "debug.h"
+#include "file.h"
+
+void *debug_alloc(const char *file, int line, size_t size);
+void *debug_newalloc(const char *file, int line, void *old, size_t size);
+char *debug_stralloc(const char *file, int line, const char *str);
+char *debug_newstralloc(const char *file, int line,
+               char *oldstr, const char *newstr);
+char *debug_vstralloc(const char *file, int line, const char *str, ...);
+char *debug_newvstralloc(const char *file, int line,
+               char *oldstr, const char *str, ...);
+char *debug_vstrallocf(const char *file, int line, const char *fmt,
+               ...) G_GNUC_PRINTF(3, 4);
+char *debug_newvstrallocf(const char *file, int line, char *oldstr,
+               const char *fmt, ...) G_GNUC_PRINTF(4, 5);
+
+/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing 
+ * string, or allocates a brand new one. */
+char *debug_vstrextend(const char *file, int line, char **oldstr, ...);
 
 #define        alloc(s)                debug_alloc(__FILE__, __LINE__, (s))
 #define        newalloc(p,s)           debug_newalloc(__FILE__, __LINE__, (p), (s))
 #define        stralloc(s)             debug_stralloc(__FILE__, __LINE__, (s))
 #define        newstralloc(p,s)        debug_newstralloc(__FILE__, __LINE__, (p), (s))
+#define vstralloc(...)         debug_vstralloc(__FILE__,__LINE__,__VA_ARGS__)
+#define newvstralloc(...)      debug_newvstralloc(__FILE__,__LINE__,__VA_ARGS__)
+#define vstrallocf(...)                debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
+#define newvstrallocf(...)     debug_newvstrallocf(__FILE__,__LINE__,__VA_ARGS__)
+#define vstrextend(...)                debug_vstrextend(__FILE__,__LINE__,__VA_ARGS__)
 
-/*
- * Voodoo time.  We want to be able to mark these calls with the source
- * line, but CPP does not handle variable argument lists so we cannot
- * do what we did above (e.g. for alloc()).
- *
- * What we do is call a function to save the file and line number
- * and have it return "false".  That triggers the "?" operator to
- * the right side of the ":" which is a call to the debug version of
- * vstralloc/newvstralloc but without parameters.  The compiler gets
- * those from the next input tokens:
- *
- *  xx = vstralloc(a,b,NULL);
- *
- * becomes:
- *
- *  xx = debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc(a,b,NULL);
- *
- * This works as long as vstralloc/newvstralloc are not part of anything
- * very complicated.  Assignment is fine, as is an argument to another
- * function (but you should not do that because it creates a memory leak).
- * This will not work in arithmetic or comparison, but it is unlikely
- * they are used like that.
- *
- *  xx = vstralloc(a,b,NULL);                  OK
- *  return vstralloc(j,k,NULL);                        OK
- *  sub(a, vstralloc(g,h,NULL), z);            OK, but a leak
- *  if(vstralloc(s,t,NULL) == NULL) { ...      NO, but unneeded
- *  xx = vstralloc(x,y,NULL) + 13;             NO, but why do it?
- */
-
-#define vstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc
-#define newvstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_newvstralloc
-#define vstrallocf debug_alloc_push(__FILE__,__LINE__)?0:debug_vstrallocf
-
-extern char  *debug_vstralloc(const char *str, ...);
-extern char  *debug_newvstralloc(char *oldstr, const char *newstr, ...);
-extern char  *debug_vstrallocf(const char *fmt, ...)
-                              __attribute__ ((format (printf, 1, 2)));
-
-#define        stralloc2(s1,s2)      vstralloc((s1),(s2),NULL)
-#define        newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL)
+#define        stralloc2(s1,s2)        vstralloc((s1),(s2),NULL)
+#define        newstralloc2(p,s1,s2)   newvstralloc((p),(s1),(s2),NULL)
 
-/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing 
- * string, or allocates a brand new one. */
-extern char *vstrextend(char **oldstr, ...);
+#define vstrallocf(...)         debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__)
 
-extern /*@only@*/ /*@null@*/ char *debug_agets(const char *c, int l, FILE *file);
-extern /*@only@*/ /*@null@*/ char *debug_areads(const char *c, int l, int fd);
+/*@only@*/ /*@null@*/ char *debug_agets(const char *file, int line, FILE *f);
+/*@only@*/ /*@null@*/ char *debug_areads(const char *file, int line, int fd);
 #define agets(f)             debug_agets(__FILE__,__LINE__,(f))
 #define areads(f)            debug_areads(__FILE__,__LINE__,(f))
 
@@ -664,14 +478,8 @@ extern int debug_amtable_alloc(const char *file,
                                                     (b),             \
                                                     (f))
 
-extern void amtable_free(void **table, size_t *current);
+extern void amtable_free(void **, size_t *);
 
-extern uid_t  client_uid;
-extern gid_t  client_gid;
-
-void   safe_fd(int fd_start, int fd_count);
-void   safe_cd(void);
-void   save_core(void);
 char **        safe_env(void);
 char * validate_regexp(const char *regex);
 char * validate_glob(const char *glob);
@@ -686,8 +494,6 @@ int match_disk(const char *glob, const char *disk);
 int    match_datestamp(const char *dateexp, const char *datestamp);
 int    match_level(const char *levelexp, const char *level);
 time_t unctime(char *timestr);
-ssize_t        areads_dataready(int fd);
-void   areads_relbuf(int fd);
 
 /*
  * amfree(ptr) -- if allocated, release space and set ptr to NULL.
@@ -712,52 +518,6 @@ void       areads_relbuf(int fd);
     (s1) = t_t_t;                                                      \
 } while(0)
 
-/*
- * "Safe" close macros.  Close the object then set it to a value that
- * will cause an error if referenced.
- *
- * aclose(fd) -- close a file descriptor and set it to -1.
- * afclose(f) -- close a stdio file and set it to NULL.
- * apclose(p) -- close a stdio pipe file and set it to NULL.
- *
- * Note: be careful not to do the following:
- *
- *  for(fd = low; fd < high; fd++) {
- *      aclose(fd);
- *  }
- *
- * Since aclose() sets the argument to -1, this will loop forever.
- * Just copy fd to a temp variable and use that with aclose().
- *
- * Aclose() interacts with areads() to inform it to release any buffer
- * it has outstanding on the file descriptor.
- */
-
-#define aclose(fd) do {                                                        \
-    if((fd) >= 0) {                                                    \
-       close(fd);                                                      \
-       areads_relbuf(fd);                                              \
-    }                                                                  \
-    (fd) = -1;                                                         \
-    (void)(fd);  /* Fix value never used warning at end of routines */ \
-} while(0)
-
-#define afclose(f) do {                                                        \
-    if((f) != NULL) {                                                  \
-       fclose(f);                                                      \
-       (f) = NULL;                                                     \
-       (void)(f);  /* Fix value never used warning at end of routines */ \
-    }                                                                  \
-} while(0)
-
-#define apclose(p) do {                                                        \
-    if((p) != NULL) {                                                  \
-       pclose(p);                                                      \
-       (p) = NULL;                                                     \
-       (void)(p);  /* Fix value never used warning at end of routines */ \
-    }                                                                  \
-} while(0)
-
 /*
  * Return the number of elements in an array.
  */
@@ -856,15 +616,15 @@ void      areads_relbuf(int fd);
 #define        NUM_STR_SIZE    128             /* a generic number buffer size */
 
 #define        skip_whitespace(ptr,c) do {                                     \
-    while((c) != '\n' && isspace(c)) (c) = *(ptr)++;                   \
+    while((c) != '\n' && isspace((int)c)) (c) = *(ptr)++;              \
 } while(0)
 
 #define        skip_non_whitespace(ptr,c) do {                                 \
-    while((c) != '\0' && !isspace(c)) (c) = *(ptr)++;                  \
+    while((c) != '\0' && !isspace((int)c)) (c) = *(ptr)++;             \
 } while(0)
 
 #define        skip_non_whitespace_cs(ptr,c) do {                              \
-    while((c) != '\0' && (c) != '#' && !isspace(c)) (c) = *(ptr)++;    \
+    while((c) != '\0' && (c) != '#' && !isspace((int)c)) (c) = *(ptr)++;\
 } while(0)
 
 #define        skip_non_integer(ptr,c) do {                                    \
@@ -878,7 +638,7 @@ void        areads_relbuf(int fd);
 
 #define skip_quoted_string(ptr, c) do {                                        \
     int        iq = 0;                                                         \
-    while (((c) != '\0') && !((iq == 0) && isspace(c))) {              \
+    while (((c) != '\0') && !((iq == 0) && isspace((int)c))) {         \
        if ((c) == '"') {                                               \
            iq = !iq;                                                   \
        } else if (((c) == '\\') && (*(ptr) == '"')) {                  \
@@ -908,7 +668,7 @@ void        areads_relbuf(int fd);
 
 #define        copy_string(ptr,c,f,l,fp) do {                                  \
     (fp) = (f);                                                                \
-    while((c) != '\0' && !isspace(c)) {                                        \
+    while((c) != '\0' && !isspace((int)c)) {                           \
        if((fp) >= (f) + (l) - 1) {                                     \
            *(fp) = '\0';                                               \
            (fp) = NULL;                                                \
@@ -924,7 +684,7 @@ void        areads_relbuf(int fd);
 
 #define        copy_string_cs(ptr,c,f,l,fp) do {                               \
     (fp) = (f);                                                                \
-    while((c) != '\0' && (c) != '#' && !isspace(c)) {                  \
+    while((c) != '\0' && (c) != '#' && !isspace((int)c)) {             \
        if((fp) >= (f) + (l) - 1) {                                     \
            *(fp) = '\0';                                               \
            (fp) = NULL;                                                \
@@ -950,17 +710,6 @@ void       areads_relbuf(int fd);
                 ((ptr)+=sizeof((cnst))-1, (var)=(ptr)[-1], 0)          \
                :1)
 
-/* from amflock.c */
-extern int    amflock(int fd, char *resource);
-extern int    amroflock(int fd, char *resource);
-extern int    amfunlock(int fd, char *resource);
-
-/* from file.c */
-extern int    mkpdir(char *file, mode_t mode, uid_t uid, gid_t gid);
-extern int    rmpdir(char *file, char *topdir);
-extern char  *sanitise_filename(char *inp);
-extern char  *old_sanitise_filename(char *inp);
-
 /* from old bsd-security.c */
 extern int debug;
 extern int check_security(struct sockaddr_storage *, char *, unsigned long, char **);
@@ -1007,33 +756,6 @@ extern void closelog(void);
 extern int connect(int s, struct sockaddr *name, socklen_t namelen);
 #endif
 
-#if !defined(TEXTDB) && !defined(HAVE_DBM_OPEN_DECL)
-#undef   DBM_INSERT
-#define  DBM_INSERT  0
-
-#undef   DBM_REPLACE
-#define  DBM_REPLACE 1
-
-    typedef struct {
-       int dummy[10];
-    } DBM;
-
-#ifndef HAVE_STRUCT_DATUM
-    typedef struct {
-       char    *dptr;
-       int     dsize;
-    } datum;
-#endif
-
-    extern DBM   *dbm_open(char *file, int flags, int mode);
-    extern void   dbm_close(DBM *db);
-    extern datum  dbm_fetch(DBM *db, datum key);
-    extern datum  dbm_firstkey(DBM *db);
-    extern datum  dbm_nextkey(DBM *db);
-    extern int    dbm_delete(DBM *db, datum key);
-    extern int    dbm_store(DBM *db, datum key, datum content, int flg);
-#endif
-
 #ifndef HAVE_FCLOSE_DECL
 extern int fclose(FILE *stream);
 #endif
@@ -1091,14 +813,6 @@ extern int getsockopt(int s, int level, int optname, char *optval,
                         socklen_t *optlen);
 #endif
 
-#ifndef HAVE_GETTIMEOFDAY_DECL
-# ifdef HAVE_TWO_ARG_GETTIMEOFDAY
-extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
-# else
-extern int gettimeofday(struct timeval *tp);
-# endif
-#endif
-
 #ifndef HAVE_INITGROUPS
 # define initgroups(name,basegid) 0
 #else
@@ -1279,7 +993,7 @@ extern int shmget(key_t key, size_t size, int shmflg);
 #ifndef HAVE_SNPRINTF_DECL
 #include "arglist.h"
 int snprintf(char *buf, size_t len, const char *format,...)
-                   __attribute__((format(printf,3,4)));
+     G_GNUC_PRINTF(3,4);
 #endif
 #ifndef HAVE_VSNPRINTF_DECL
 #include "arglist.h"
@@ -1317,7 +1031,7 @@ extern int strncasecmp(const char *s1, const char *s2, int n);
 
 #ifndef HAVE_SYSLOG_DECL
 extern void syslog(int priority, const char *logstring, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 #endif
 
 #ifndef HAVE_SYSTEM_DECL
@@ -1350,11 +1064,9 @@ extern int vfprintf(FILE *stream, const char *format, va_list ap);
 extern int vprintf(const char *format, va_list ap);
 #endif
 
-/* GNULIB include */
-#ifndef CONFIGURE_TEST
+/* gnulib-only includes (hence "" instead of <>) */
 #include "getaddrinfo.h"
 #include "inet_ntop.h"
-#endif
 
 #if !defined(S_ISCHR) && defined(_S_IFCHR) && defined(_S_IFMT)
 #define S_ISCHR(mode) (((mode) & _S_IFMT) == _S_IFCHR)
@@ -1398,15 +1110,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #endif
 
 #if SIZEOF_SIZE_T == SIZEOF_INT
-#  define        SIZE_T_FMT    "%u"
-#  define        SIZE_T_FMT_TYPE unsigned
 #  define        SIZE_T_ATOI   (size_t)atoi
 #  ifndef SIZE_MAX
-#    define      SIZE_MAX      UINT_MAX
+#    define      SIZE_MAX      G_MAXUINT
 #  endif
 #else
-#  define        SIZE_T_FMT    "%lu"
-#  define        SIZE_T_FMT_TYPE unsigned long
 #  define        SIZE_T_ATOI   (size_t)atol
 #  ifndef SIZE_MAX
 #    define      SIZE_MAX      ULONG_MAX
@@ -1414,8 +1122,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #endif
 
 #if SIZEOF_SSIZE_T == SIZEOF_INT
-#  define        SSIZE_T_FMT   "%d"
-#  define        SSIZE_T_FMT_TYPE int
 #  define        SSIZE_T_ATOI  (ssize_t)atoi
 #  ifndef SSIZE_MAX
 #    define      SSIZE_MAX     INT_MAX
@@ -1424,8 +1130,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #    define      SSIZE_MIN     INT_MIN
 #  endif
 #else
-#  define        SSIZE_T_FMT   "%ld"
-#  define        SSIZE_T_FMT_TYPE long
 #  define        SSIZE_T_ATOI  (ssize_t)atol
 #  ifndef SSIZE_MAX
 #    define      SSIZE_MAX     LONG_MAX
@@ -1436,15 +1140,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #endif
 
 #if SIZEOF_TIME_T == SIZEOF_INT
-#  define        TIME_T_FMT    "%u"
-#  define        TIME_T_FMT_TYPE unsigned
 #  define        TIME_T_ATOI   (time_t)atoi
 #  ifndef TIME_MAX
-#    define      TIME_MAX      UINT_MAX
+#    define      TIME_MAX      G_MAXUINT
 #  endif
 #else
-#  define        TIME_T_FMT    "%lu"
-#  define        TIME_T_FMT_TYPE unsigned long
 #  define        TIME_T_ATOI   (time_t)atol
 #  ifndef TIME_MAX
 #    define      TIME_MAX      ULONG_MAX
@@ -1452,30 +1152,21 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #endif
 
 #if SIZEOF_OFF_T > SIZEOF_LONG
-#  define        OFF_T_FMT       LL_FMT
-#  define        OFF_T_RFMT      LL_RFMT
-#  define        OFF_T_FMT_TYPE  long long
 #  ifdef HAVE_ATOLL
-#    define      OFF_T_ATOI     (off_t)atoll
+#    define        OFF_T_ATOI   (off_t)atoll
 #  else
-#    define      OFF_T_ATOI      (off_t)atol
+#    define        OFF_T_ATOI   (off_t)atol
 #  endif
 #  ifdef HAVE_STRTOLL
-#    define      OFF_T_STRTOL   (off_t)strtoll
+#    define        OFF_T_STRTOL         (off_t)strtoll
 #  else
-#    define      OFF_T_STRTOL      (off_t)strtol
+#    define        OFF_T_STRTOL         (off_t)strtol
 #  endif
 #else
 #  if SIZEOF_OFF_T == SIZEOF_LONG
-#    define        OFF_T_FMT       "%ld"
-#    define        OFF_T_RFMT      "ld"
-#    define        OFF_T_FMT_TYPE  long
 #    define        OFF_T_ATOI   (off_t)atol
 #    define        OFF_T_STRTOL         (off_t)strtol
 #  else
-#    define        OFF_T_FMT       "%d"
-#    define        OFF_T_RFMT      "d"
-#    define        OFF_T_FMT_TYPE  int
 #    define        OFF_T_ATOI   (off_t)atoi
 #    define        OFF_T_STRTOL         (off_t)strtol
 #  endif
@@ -1492,7 +1183,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #  else
 #    define AM64_MIN (off_t)(-9223372036854775807LL -1LL)
 #  endif
-#  define AM64_FMT OFF_T_FMT
 #else
 #if SIZEOF_LONG == 8
 #  ifdef LONG_MAX
@@ -1505,7 +1195,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #  else
 #    define AM64_MIN (off_t)(-9223372036854775807L -1L)
 #  endif
-#  define AM64_FMT "%ld"
 #else
 #if SIZEOF_LONG_LONG == 8
 #  ifdef LONG_LONG_MAX
@@ -1518,7 +1207,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #  else
 #    define AM64_MIN (off_t)(-9223372036854775807LL -1LL)
 #  endif
-#  define AM64_FMT LL_FMT
 #else
 #if SIZEOF_INTMAX_T == 8
 #  ifdef INTMAX_MAX
@@ -1531,7 +1219,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #  else
 #    define AM64_MIN (off_t)(-9223372036854775807LL -1LL)
 #  endif
-#  define AM64_FMT LL_FMT
 #else  /* no 64 bits type found, use long. */
 #  ifdef LONG_MAX
 #    define AM64_MAX (off_t)(LONG_MAX)
@@ -1543,55 +1230,24 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
 #  else
 #    define AM64_MIN (off_t)(-2147483647 -1)
 #  endif
-#  define AM64_FMT "%ld"
 #endif
 #endif
 #endif
 #endif
 
-#ifdef HAVE_LIBREADLINE
-#  ifdef HAVE_READLINE_READLINE_H
-#    include <readline/readline.h>
-#    ifdef HAVE_READLINE_HISTORY_H
-#      include <readline/history.h>
-#    endif
-#  else
-#    ifdef HAVE_READLINE_H
-#      include <readline.h>
-#      ifdef HAVE_HISTORY_H
-#        include <history.h>
-#      endif
-#    else
-#      undef HAVE_LIBREADLINE
-#    endif
-#  endif
-#else
-
-char * readline(const char *prompt);
-void   add_history(const char *line);
-
-#endif
-
 #define BIND_CYCLE_RETRIES     120             /* Total of 30 minutes */
 
-#define DBG_SUBDIR_SERVER  "server"
-#define DBG_SUBDIR_CLIENT  "client"
-#define DBG_SUBDIR_AMANDAD "amandad"
-
 #define MAX_DUMPERS 63
 
 #ifndef NI_MAXHOST
 #define NI_MAXHOST 1025
 #endif
 
-#define _(x) x
-
-#ifndef AI_V4MAPPED
-#define AI_V4MAPPED 0
-#endif
-
-#ifndef AI_ALL
-#define AI_ALL 0
-#endif
+typedef enum {
+    KENCRYPT_NONE,     /* krb5 encryption not enabled */
+    KENCRYPT_WILL_DO,  /* krb5 encryption will be enabled once amanda
+                          protocol stream is closed */
+    KENCRYPT_YES       /* krb5 encryption enabled on all stream */
+} kencrypt_type;
 
 #endif /* !AMANDA_H */
diff --git a/common-src/amcrypt-ossl-asym.sh b/common-src/amcrypt-ossl-asym.sh
new file mode 100644 (file)
index 0000000..bec5269
--- /dev/null
@@ -0,0 +1,188 @@
+#!@SHELL@
+#
+# amcrypt-ossl-asym.sh - asymmetric crypto helper using OpenSSL
+# Usage: amcrypt-ossl-asym.sh [-d]
+#
+# Copyright © 2006  Ben Slusky <sluskyb@paranoiacs.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+# 
+# Keys can be generated with the standard OpenSSL commands, e.g.:
+#
+# $ openssl genrsa -aes128 -out backup-privkey.pem 1024
+# Generating RSA private key, 1024 bit long modulus
+# [...]
+# Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
+# Verifying - Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
+#
+# $ openssl rsa -in backup-privkey.pem -pubout -out backup-pubkey.pem
+# Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
+# Writing RSA key
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# change these as needed
+OPENSSL=                       # whatever's in $PATH
+CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
+AMANDA_HOME=~@CLIENT_LOGIN@
+RANDFILE=$AMANDA_HOME/.rnd
+export RANDFILE
+PASSPHRASE=$AMANDA_HOME/.am_passphrase # optional
+PRIVKEY=$AMANDA_HOME/backup-privkey.pem
+PUBKEY=$AMANDA_HOME/backup-pubkey.pem
+
+# where might openssl be?
+PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin:/opt/csw/bin
+export PATH
+MAGIC='AmAnDa+OpEnSsL'
+ME=`basename "$0"`
+WORKDIR="/tmp/.${ME}.$$"
+
+
+# first things first
+if [ -z "${OPENSSL:=`which openssl`}" ]; then
+       echo `_ '%s: %s not found' "${ME}" "openssl"` >&2
+       exit 1
+elif [ ! -x "${OPENSSL}" ]; then
+       echo `_ "%s: can't execute %s (%s)" "${ME}" "openssl" "${OPENSSL}"` >&2
+       exit 1
+fi
+
+if [ -n "${PASSPHRASE}" ]; then
+       # check the openssl version. if it's too old, we have to handle
+       # the pass phrase differently.
+       OSSL_VERSION=`eval \"${OPENSSL}\" version |cut -d\  -f2`
+       case "${OSSL_VERSION}" in
+        ''|0.[0-8].*|0.9.[0-6]*|0.9.7|0.9.7[a-c]*)
+               echo `_ '%s: %s is version %s' "${ME}" "${OPENSSL}" "${OSSL_VERSION}"` >&2
+               echo `_ '%s: Using pass phrase kluge for OpenSSL version >=0.9.7d' "${ME}"` >&2
+               PASS_FROM_STDIN=yes
+               ;;
+       esac
+fi
+
+mkdir -m 700 "${WORKDIR}"
+if [ $? -ne 0 ]; then
+       echo `_ '%s: failed to create temp directory' "${ME}"` >&2
+       exit 1
+fi
+# ignore SIGINT
+trap "" 2
+trap "rm -rf \"${WORKDIR}\"" 0 1 3 15
+
+# we'll need to pad the datastream to a multiple of the cipher block size
+# prior to encryption and decryption. 96 bytes (= 768 bits) should be good
+# for any cipher.
+pad() {
+       perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }'
+}
+
+encrypt() {
+       # generate a random printable cipher key (on one line)
+       echo `"${OPENSSL}" rand -base64 80` >"${WORKDIR}/pass"
+
+       # encrypt the cipher key using the RSA public key
+       "${OPENSSL}" rsautl -encrypt -in "${WORKDIR}/pass" -out "${WORKDIR}/pass.ciphertext" -pubin -inkey "${PUBKEY}" -pkcs
+       [ $? -eq 0 ] || return 1
+
+       # print magic
+       printf "%s" "${MAGIC}"
+
+       # print the encrypted cipher key, preceded by size
+       ls -l "${WORKDIR}/pass.ciphertext" | awk '{ printf("%-10d", $5) }'
+       cat "${WORKDIR}/pass.ciphertext"
+
+       # encrypt data using the cipher key and print
+       pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -e -pass "file:${WORKDIR}/pass" -nosalt
+       [ $? -eq 0 ] || return 1
+}
+
+decrypt() {
+       # read magic
+       magicsize=`printf "%s" "${MAGIC}" | wc -c | sed 's/^ *//'`
+       magic=`dd bs=$magicsize count=1 2>/dev/null`
+       if [ "$magic" != "${MAGIC}" ]; then
+               echo `_ '%s: bad magic' "${ME}"` >&2
+               return 1
+       fi
+
+       # read size of encrypted cipher key
+       n=`dd bs=10 count=1 2>/dev/null`
+       [ $n -gt 0 ] 2>/dev/null
+       if [ $? -ne 0 ]; then
+               echo `_ '%s: bad header' "${ME}"` >&2
+               return 1
+       fi
+
+       # read the encrypted cipher key
+       dd "of=${WORKDIR}/pass.ciphertext" bs=$n count=1 2>/dev/null
+
+       # decrypt the cipher key using the RSA private key
+       if [ "${PASS_FROM_STDIN}" = yes ]; then
+               "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" -pkcs < "${PASSPHRASE}"
+       else
+               "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" ${PASSARG} -pkcs 3< "${PASSPHRASE}"
+       fi
+       [ $? -eq 0 ] || return 1
+
+       # use the cipher key to decrypt data
+       pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -d -pass "file:${WORKDIR}/pass" -nosalt
+
+       # N.B.: in the likely event that we're piping to gzip, the above command
+       # may return a spurious error if gzip closes the output stream early.
+       return 0
+}
+
+if [ "$1" = -d ]; then
+       if [ -z "${PRIVKEY}" ]; then
+               echo `_ '%s: must specify private key for decryption' "${ME}"` >&2
+               exit 1
+       elif [ ! -r "${PRIVKEY}" ]; then
+               echo `_ "%s: can't read private key from %s" "${ME}" "${PRIVKEY}"` >&2
+               exit 1
+       fi
+
+       if [ -n "${PASSPHRASE}" -a -e "${PASSPHRASE}" -a -r "${PASSPHRASE}" ]; then
+               PASSARG='-passin fd:3'
+       else
+               PASSPHRASE=/dev/null
+       fi
+
+       decrypt
+       if [ $? -ne 0 ]; then
+               echo `_ '%s: decryption failed' "${ME}"` >&2
+               exit 1
+       fi
+else
+       if [ -z "${PUBKEY}" ]; then
+               echo `_ '%s: must specify public key for encryption' "${ME}"` >&2
+               exit 1
+       elif [ ! -r "${PUBKEY}" ]; then
+               echo `_ "%s: can't read public key from %s" "${ME}" "${PUBKEY}"` >&2
+               exit 1
+       fi
+
+       encrypt
+       if [ $? -ne 0 ]; then
+               echo `_ '%s: encryption failed' "${ME}"` >&2
+               exit 1
+       fi
+fi
diff --git a/common-src/amcrypt-ossl.sh b/common-src/amcrypt-ossl.sh
new file mode 100644 (file)
index 0000000..edab131
--- /dev/null
@@ -0,0 +1,47 @@
+#!@SHELL@
+#
+# amcrypt-ossl.sh - crypto helper using OpenSSL
+# Usage: amcrypt-ossl.sh [-d]
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# change these as needed
+OPENSSL=                       # whatever's in $PATH
+CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
+AMANDA_HOME=~@CLIENT_LOGIN@
+RANDFILE=$AMANDA_HOME/.rnd
+export RANDFILE
+PASSPHRASE=$AMANDA_HOME/.am_passphrase # required
+
+# where might openssl be?
+PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin:/opt/csw/bin
+export PATH
+ME=`basename "$0"`
+
+if [ -z "${OPENSSL:=`which openssl`}" ]; then
+       echo `_ '%s: openssl not found' "${ME}"` >&2
+       exit 1
+elif [ ! -x "${OPENSSL}" ]; then
+       echo `_ "%s: can't execute %s (%s)" "${ME}" "openssl" "${OPENSSL}"` >&2
+       exit 1
+fi
+
+# we'll need to pad the datastream to a multiple of the cipher block size prior
+# to encryption. 96 bytes (= 768 bits) should be good for any cipher.
+pad() {
+       perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }'
+}
+
+if [ "$1" = -d ]; then
+       # decrypt
+       "${OPENSSL}" enc -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
+else
+       # encrypt
+       pad | "${OPENSSL}" enc -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
+fi
+
diff --git a/common-src/amcrypt.sh b/common-src/amcrypt.sh
new file mode 100755 (executable)
index 0000000..82e1ea6
--- /dev/null
@@ -0,0 +1,47 @@
+#!@SHELL@
+#
+# Original wrapper by Paul Bijnens
+#
+# worked by Stefan G. Weichinger
+# to enable gpg-encrypted dumps via aespipe
+# also worked by Matthieu Lochegnies for server-side encryption
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs, as well as csw (blastwave)
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb:/opt/csw/bin"
+export PATH
+
+AMANDA_HOME=~@CLIENT_LOGIN@
+AM_AESPIPE=@sbindir@/amaespipe
+AM_PASSPHRASE=$AMANDA_HOME/.am_passphrase
+
+AESPIPE=`which aespipe`
+
+if [ $? -ne 0 ] ; then
+       echo `_ '%s: %s was not found in %s' "$0" "aespipe" "$PATH"` >&2
+        exit 2
+fi
+
+if [ ! -x $AESPIPE ] ; then
+       echo `_ '%s: %s is not executable' "$0" "aespipe"` >&2
+        exit 2
+fi
+
+if [ ! -x $AM_AESPIPE ] ; then
+        echo `_ '%s: %s was not found' "$0" "$AM_AESPIPE"` >&2
+        exit 2
+fi
+if [ ! -x $AM_AESPIPE ] ; then
+        echo `_ '%s: %s is not executable' "$0" "$AM_AESPIPE"` >&2
+        exit 2
+fi
+
+$AM_AESPIPE "$@" 3< $AM_PASSPHRASE
+
+rc=$?
+exit $rc
diff --git a/common-src/amcryptsimple.pl b/common-src/amcryptsimple.pl
new file mode 100755 (executable)
index 0000000..05e50e5
--- /dev/null
@@ -0,0 +1,141 @@
+#!@PERL@ -w
+#
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+
+
+# Run perl.
+eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+         & eval 'exec /usr/bin/perl -S $0 $argv:q'
+                if 0;
+
+use Time::Local;
+
+my $AMANDA='@CLIENT_LOGIN@';
+
+my $ddebug = 1;   # set to 1 to print signal debug to stderr
+
+my $sigint_seen   = 0;
+my $sigpipe_seen  = 0;
+my $sighup_seen   = 0;
+my $sigill_seen   = 0;
+my $sigterm_seen  = 0;
+my $sigsegv_seen  = 0;
+my $sigquit_seen  = 0;
+my $sigfpe_seen   = 0;
+
+$AMANDA_HOME = (getpwnam($AMANDA) )[7] || die "Cannot find $AMANDA home directory\n" ;
+$AM_PASS = "$AMANDA_HOME/.am_passphrase";
+
+unless ( -e $AM_PASS ) {
+  die "secret key $AM_PASS not found\n";
+}
+
+
+$ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin';
+
+$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg";
+
+
+sub encrypt() {
+    system "gpg --batch --no-secmem-warning --disable-mdc --symmetric --cipher-algo AES256 --passphrase-fd 3  3<$AM_PASS";
+}
+
+sub decrypt() {
+     system "gpg --batch --quiet --no-mdc-warning --decrypt --passphrase-fd 3  3<$AM_PASS";
+}
+
+sub int_catcher {
+    $sigint_seen = 1;
+}
+
+sub pipe_catcher {
+    $sigpipe_seen = 1;
+}
+
+sub hup_catcher {
+    $sighup_seen = 1;
+}
+
+sub ill_catcher {
+    $sigill_seen = 1;
+}
+
+sub term_catcher {
+    $sigterm_seen = 1;
+}
+
+sub segv_catcher {
+    $sigsegv_seen = 1;
+}
+
+sub quit_catcher {
+    $sigquit_seen = 1;
+}
+
+sub fpe_catcher {
+    $sigfpe_seen = 1;
+}
+
+#main
+
+$SIG{'INT'}   = 'int_catcher';
+$SIG{'PIPE'}  = 'pipe_catcher';
+$SIG{'HUP'}   = 'hup_catcher';
+$SIG{'ILL'}   = 'ill_catcher';
+$SIG{'TERM'}  = 'term_catcher';
+$SIG{'SEGV'}  = 'segv_catcher';
+$SIG{'QUIT'}  = 'quit_catcher';
+$SIG{'FPE'}   = 'FPE_catcher';
+
+
+if ( $#ARGV > 0 ) {
+     die "Usage: $0 [-d]\n";
+}
+
+if ( $#ARGV==0 && $ARGV[0] eq "-d" ) {
+    decrypt();
+}
+else {
+    encrypt();
+}
+
+if ( $ddebug  ) {
+    if ( $sigint_seen )  { print STDERR "strange sigint seen = $sigint_seen\n"; }
+    if ( $sigpipe_seen ) { print STDERR "strange sigpipe seen = $sigpipe_seen\n"; }
+    if ( $sighup_seen )  { print STDERR "strange sighup seen = $sighup_seen\n"; }
+    if ( $sigill_seen )  { print STDERR "strange sigill seen = $sigill_seen\n"; }
+    
+    if ( $sigterm_seen ) { print STDERR "strange sigterm seen = $sigterm_seen\n"; }
+    if ( $sigsegv_seen ) { print STDERR "strange sigsegv seen = $sigsegv_seen\n"; }
+    if ( $sigquit_seen ) { print STDERR "strange sigquit seen = $sigquit_seen\n"; }
+    if ( $sigfpe_seen )  { print STDERR "strange sigfpe seen = $sigfpe_seen\n"; }
+    
+}
+
+$SIG{'INT'}  = 'DEFAULT';
+$SIG{'PIPE'} = 'DEFAULT';
+$SIG{'HUP'}  = 'DEFAULT';
+$SIG{'ILL'}  = 'DEFAULT';
+$SIG{'TERM'} = 'DEFAULT';
+$SIG{'SEGV'} = 'DEFAULT';
+$SIG{'QUIT'} = 'DEFAULT';
+$SIG{'FPE'}  = 'DEFAULT';
+
index 8775912237e27b584b53bd70e1a4e23e7a729acc..675a647eba48691b24f243c874f9271ff8fb9f02 100644 (file)
@@ -363,11 +363,11 @@ am_feature_to_string(
     size_t                     i;
 
     if (f == NULL) {
-       result = stralloc("UNKNOWNFEATURE");
+       result = stralloc(_("UNKNOWNFEATURE"));
     } else {
        result = alloc((f->size * 2) + 1);
        for (i = 0; i < f->size; i++) {
-           snprintf(result + (i * 2), 2 + 1, "%02x", f->bytes[i]);
+           g_snprintf(result + (i * 2), 2 + 1, "%02x", f->bytes[i]);
        }
        result[i * 2] = '\0';
     }
@@ -439,7 +439,7 @@ am_string_to_feature(
 int
 main(
     int                argc,
-    char       **argv)
+    char **    argv)
 {
     am_feature_t               *f;
     am_feature_t               *f1;
@@ -448,20 +448,29 @@ main(
     int                                i;
     int                                n;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     f = am_init_feature_set();
     if (f == NULL) {
-       fprintf(stderr, "cannot initialize feature set\n");
+       g_fprintf(stderr, _("cannot initialize feature set\n"));
        return 1;
     }
 
     s = am_feature_to_string(f);
-    printf("base features=%s\n", s);
+    g_printf(_("base features=%s\n"), s);
 
     f1 = am_string_to_feature(s);
     s1 = am_feature_to_string(f1);
     if (strcmp(s, s1) != 0) {
-       fprintf(stderr, "base feature -> string -> feature set mismatch\n");
-       fprintf(stderr, "conv features=%s\n", s);
+       g_fprintf(stderr, _("base feature -> string -> feature set mismatch\n"));
+       g_fprintf(stderr, _("conv features=%s\n"), s);
     }
 
     amfree(s1);
@@ -471,29 +480,29 @@ main(
        if (argv[i][0] == '+') {
            n = atoi(&argv[i][1]);
            if (am_add_feature(f, (am_feature_e)n)) {
-               printf("added feature number %d\n", n);
+               g_printf(_("added feature number %d\n"), n);
            } else {
-               printf("could not add feature number %d\n", n);
+               g_printf(_("could not add feature number %d\n"), n);
            }
        } else if (argv[i][0] == '-') {
            n = atoi(&argv[i][1]);
            if (am_remove_feature(f, (am_feature_e)n)) {
-               printf("removed feature number %d\n", n);
+               g_printf(_("removed feature number %d\n"), n);
            } else {
-               printf("could not remove feature number %d\n", n);
+               g_printf(_("could not remove feature number %d\n"), n);
            }
        } else {
            n = atoi(argv[i]);
            if (am_has_feature(f, (am_feature_e)n)) {
-               printf("feature %d is set\n", n);
+               g_printf(_("feature %d is set\n"), n);
            } else {
-               printf("feature %d is not set\n", n);
+               g_printf(_("feature %d is not set\n"), n);
            }
        }
     }
 
     s = am_feature_to_string(f);
-    printf(" new features=%s\n", s);
+    g_printf(_(" new features=%s\n"), s);
     amfree(s);
 
     return 0;
diff --git a/common-src/amflock-flock.c b/common-src/amflock-flock.c
new file mode 100644 (file)
index 0000000..82001c3
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/* moved from amflock.c by Dustin J. Mitchell <dustin@zmanda.com> */
+
+#include "amanda.h"
+
+static int
+flock_lock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    return flock(fd, LOCK_EX);
+}
+
+static int
+flock_unlock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    return flock(fd, LOCK_UN);
+}
+
+amflock_impl_t amflock_flock_impl = {
+    flock_lock,
+    flock_lock, /* no read-only support */
+    flock_unlock,
+    "flock"
+};
diff --git a/common-src/amflock-lnlock.c b/common-src/amflock-lnlock.c
new file mode 100644 (file)
index 0000000..142aea3
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/* moved from amflock.c by Dustin J. Mitchell <dustin@zmanda.com> */
+
+#include "amanda.h"
+
+static int ln_lock(char *res, int op);
+char *_lnlock_dir = AMANDA_TMPDIR; /* amflock-test changes this; it's a constant otherwise */
+
+/* XXX - error checking in this section needs to be tightened up */
+
+/* Delete a lock file.
+*/
+static int
+delete_lock(
+    char *fn)
+{
+       int rc;
+
+       rc = unlink(fn);
+       if (rc != 0 && errno == ENOENT) rc = 0;
+
+       return rc;
+}
+
+/* Create a lock file.
+*/
+static int
+create_lock(
+    char *fn,
+    long pid)
+{
+       int fd;
+       FILE *f;
+       int mask;
+
+       (void)delete_lock(fn);                  /* that's MY file! */
+
+       mask = umask(0027);
+       fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0640);
+       umask(mask);
+       if (fd == -1) return -1;
+
+       if((f = fdopen(fd, "w")) == NULL) {
+           aclose(fd);
+           return -1;
+       }
+       g_fprintf(f, "%ld\n", pid);
+       if (fclose(f) == EOF)
+           return -1;
+       return 0;
+}
+
+/* Read the pid out of a lock file.
+**   -1=error, otherwise pid.
+*/
+static long
+read_lock(
+    char *     fn) /* name of lock file */
+{
+       int save_errno;
+       FILE *f;
+       long pid;
+
+       if ((f = fopen(fn, "r")) == NULL) {
+               return -1;
+       }
+       if (fscanf(f, "%ld", &pid) != 1) {
+               save_errno = errno;
+               afclose(f);
+               errno = save_errno;
+               return -1;
+       }
+       if (fclose(f) != 0) {
+               return -1;
+       }
+       return pid;
+}
+
+/* Link a lock if we can.
+**   0=done, 1=already locked, -1=error.
+*/
+static int
+link_lock(
+    char *     lk,     /* real lock file */
+    char *     tlk)    /* temp lock file */
+{
+       int rc;
+       int serrno;     /* saved errno */
+       struct stat lkstat, tlkstat;
+
+       /* an atomic check and set operation */
+       rc = link(tlk, lk);
+       if (rc == 0) return 0; /* XXX do we trust it? */
+
+       /* link() says it failed - don't beleive it */
+       serrno = errno;
+
+       if (stat(lk, &lkstat) == 0 &&
+           stat(tlk, &tlkstat) == 0 &&
+           lkstat.st_ino == tlkstat.st_ino)
+               return 0;       /* it did work! */
+
+       errno = serrno;
+
+       if (errno == EEXIST) rc = 1;
+
+       return rc;
+}
+
+/* Steal a lock if we can.
+**   0=done; 1=still in use; -1 = error.
+*/
+static int
+steal_lock(
+    char *     fn,     /* name of lock file to steal */
+    long       mypid,  /* my process id */
+    char *     sres)   /* name of steal-resource to lock */
+{
+       long pid;
+       int rc;
+
+       /* prevent a race with another stealer */
+       rc = ln_lock(sres, 1);
+       if (rc != 0) goto error;
+
+       pid = read_lock(fn);
+       if (pid == -1) {
+               if (errno == ENOENT) goto done;
+               goto error;
+       }
+
+       if (pid == mypid) goto steal; /* i'm the locker! */
+
+       /* are they still there ? */
+       rc = kill((pid_t)pid, 0);
+       if (rc != 0) {
+               if (errno == ESRCH) goto steal; /* locker has gone */
+               goto error;
+       }
+
+       rc = ln_lock(sres, 0);
+       if (rc != 0) goto error;
+
+       return 1;
+
+steal:
+       rc = delete_lock(fn);
+       if (rc != 0) goto error;
+
+done:
+       rc = ln_lock(sres, 0);
+       if (rc != 0) goto error;
+
+       return 0;
+
+error:
+       rc = ln_lock(sres, 0);
+
+       return -1;
+}
+
+static int
+ln_lock(
+    char *     res, /* name of resource to lock */
+    int                op)  /* true to lock; false to unlock */
+{
+       long mypid;
+       char *lockfile = NULL;
+       char *tlockfile = NULL;
+       char *mres = NULL;
+       int rc;
+       char pid_str[NUM_STR_SIZE];
+
+       mypid = (long)getpid();
+
+       lockfile = vstralloc(_lnlock_dir, "/am", res, ".lock", NULL);
+
+       if (!op) {
+               /* unlock the resource */
+               assert(read_lock(lockfile) == mypid);
+
+               (void)delete_lock(lockfile);
+               amfree(lockfile);
+               return 0;
+       }
+
+       /* lock the resource */
+
+       g_snprintf(pid_str, SIZEOF(pid_str), "%ld", mypid);
+       tlockfile = vstralloc(_lnlock_dir, "/am", res, ".", pid_str, NULL);
+
+       (void)create_lock(tlockfile, mypid);
+
+       mres = stralloc2(res, ".");
+
+       while(1) {
+               rc = link_lock(lockfile, tlockfile);
+               if (rc == -1) break;
+               if (rc == 0) break;
+
+               rc = steal_lock(lockfile, mypid, mres);
+               if (rc == -1) break;
+               if (rc == 0) continue;
+               sleep(1);
+       }
+
+       (void) delete_lock(tlockfile);
+
+       amfree(mres);
+       amfree(tlockfile);
+       amfree(lockfile);
+
+       return rc;
+}
+
+static int
+lnlock_lock(
+    G_GNUC_UNUSED int fd,
+    char *resource)
+{
+    return ln_lock(resource, 1);
+}
+
+static int
+lnlock_unlock(
+    G_GNUC_UNUSED int fd,
+    char *resource)
+{
+    return ln_lock(resource, 0);
+}
+
+amflock_impl_t amflock_lnlock_impl = {
+    lnlock_lock,
+    lnlock_lock, /* no read-only support */
+    lnlock_unlock,
+    "lnlock"
+};
diff --git a/common-src/amflock-lockf.c b/common-src/amflock-lockf.c
new file mode 100644 (file)
index 0000000..90af1ff
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/* moved from amflock.c by Dustin J. Mitchell <dustin@zmanda.com> */
+
+#include "amanda.h"
+
+/* XPG4-UNIX (eg, SGI IRIX, DEC DU) has F_ULOCK instead of F_UNLOCK */
+#if defined(F_ULOCK) && !defined(F_UNLOCK)
+#  define F_UNLOCK F_ULOCK
+#endif
+
+static int
+lockf_lock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    return lockf(fd, F_LOCK, (off_t)0);
+}
+
+static int
+lockf_unlock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    off_t pos;
+
+    /* unlock from here on */
+    if (lockf(fd, F_UNLOCK, (off_t)0) == -1) return -1;
+
+    /* unlock from bof to here */
+    pos = lseek(fd, (off_t)0, SEEK_CUR);
+    if (pos == (off_t)-1) {
+       if (errno == ESPIPE) 
+           pos = (off_t)0;
+       else
+           return -1;
+    }
+
+    if (pos > (off_t)0) {
+       if (lockf(fd, F_UNLOCK, -pos) == -1)
+           return -1;
+    }
+
+    return 0;
+}
+
+amflock_impl_t amflock_lockf_impl = {
+    lockf_lock,
+    lockf_lock, /* no read-only support */
+    lockf_unlock,
+    "lockf"
+};
diff --git a/common-src/amflock-posix.c b/common-src/amflock-posix.c
new file mode 100644 (file)
index 0000000..4e2af7b
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/* moved from amflock.c by Dustin J. Mitchell <dustin@zmanda.com> */
+
+#include "amanda.h"
+
+static int
+posix_lock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    struct flock lock;
+
+    lock.l_type = F_WRLCK;
+    lock.l_start = 0;
+    lock.l_whence = SEEK_SET;
+    lock.l_len = 0; /* to EOF */
+    return fcntl(fd, F_SETLKW, &lock);
+}
+
+static int
+posix_rolock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    struct flock lock;
+
+    lock.l_type = F_RDLCK;
+    lock.l_start = 0;
+    lock.l_whence = SEEK_SET;
+    lock.l_len = 0; /* to EOF */
+    return fcntl(fd, F_SETLKW, &lock);
+}
+
+static int
+posix_unlock(
+    int        fd,
+    G_GNUC_UNUSED char *resource)
+{
+    struct flock lock;
+
+    lock.l_type = F_UNLCK;
+    lock.l_start = 0;
+    lock.l_whence = SEEK_SET;
+    lock.l_len = 0; /* to EOF */
+    return fcntl(fd, F_SETLK, &lock);
+}
+
+amflock_impl_t amflock_posix_impl = {
+    posix_lock,
+    posix_rolock,
+    posix_unlock,
+    "posix"
+};
diff --git a/common-src/amflock-test.c b/common-src/amflock-test.c
new file mode 100644 (file)
index 0000000..4becf5c
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+#include "amanda.h"
+
+/* from amflock.c */
+extern amflock_impl_t *amflock_impls[];
+
+int
+main(void)
+{
+    amflock_impl_t **imp = amflock_impls;
+    char *filename = "./amflocktest.file";
+    char *resource = "rez";
+    int fd;
+    int lock_ro;
+
+    /* set lnlock's lock directory to the current directory */
+    extern char *_lnlock_dir;
+    _lnlock_dir = ".";
+
+    while (*imp) {
+       g_fprintf(stderr, _("Testing amflock-%s\n"), (*imp)->impl_name);
+       alarm(5); /* time out after 5 seconds */
+
+       for (lock_ro = 0; lock_ro < 2; lock_ro++) { /* false (0) or true (1) */
+           if (unlink(filename) == -1 && errno != ENOENT) {
+               perror("unlink");
+               return 1;
+           }
+
+           if ((fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
+               perror("open");
+               return 1;
+           }
+
+           if (lock_ro) {
+               if ((*imp)->amroflock_impl(fd, resource) != 0) {
+                   perror("amroflock");
+                   return 1;
+               }
+           } else {
+               if ((*imp)->amflock_impl(fd, resource) != 0) {
+                   perror("amflock");
+                   return 1;
+               }
+           }
+
+           if ((*imp)->amfunlock_impl(fd, resource) != 0) {
+               perror("amfunlock");
+               return 1;
+           }
+
+           close(fd); /* ignore error */
+           unlink(filename); /* ignore error */
+       }
+
+       imp++;
+    }
+
+    return 0;
+}
index cc1cd4e46550ed2e32077a04975f45edf49ff42b..c10599683681a8068ff14bfab5a4f1bcd5fa4c3e 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amflock.c,v 1.28 2006/05/25 01:47:11 johnfranks Exp $
+ * $Id: amflock.c 7161 2007-07-03 16:27:26Z dustin $
  *
  * file locking routines, put here to hide the system dependant stuff
  * from the rest of the code
 **                       blocking file locks as used by Amanda.
 **     USE_LNLOCK      - Home brew exclusive, blocking file lock.
 **     <none>          - No locking available.  User beware!
-** - "configure" compiles this with -DCONFIGURE_TEST to try and determine
-**   whether a particular type of locking works.
 */
 
+/* FIXME: This code has several limitations to be fixed:
+ * - It should be possible to select a locking mode (or detect the
+ *   best mode for a particular filesystem) at runtime.
+ * - There should be a locking mode that works with NFS filesystems.
+ * - Semantics should be clear when different parts of a single 
+ *   process (possibly in the same/different threads) both try to lock 
+ *   the same file (but with different file descriptors).
+ * - It should be possible to promote a read-only lock to an 
+ *   exclusive lock.
+ * - Arbitrary strings should be useable as resource names. */
+
 #include "amanda.h"
+/* Interface to the implementations in common-src/amflock-*.c */
 
-#if defined(USE_POSIX_FCNTL)
-     static struct flock lock; /* zero-initialized */
+#ifdef WANT_AMFLOCK_POSIX
+extern amflock_impl_t amflock_posix_impl;
 #endif
-
-#if !defined(USE_POSIX_FCNTL) && defined(USE_FLOCK)
-#  ifdef HAVE_SYS_FILE_H
-#    include <sys/file.h>
-#  endif
-
-#  if !defined(HAVE_FLOCK_DECL) && !defined(CONFIGURE_TEST)
-     extern int flock(int fd, int operation);
-#  endif
+#ifdef WANT_AMFLOCK_FLOCK
+extern amflock_impl_t amflock_flock_impl;
 #endif
-
-
-#if !defined(USE_POSIX_FCNTL) && !defined(USE_FLOCK) && defined(USE_LOCKF)
-
-/* XPG4-UNIX (eg, SGI IRIX, DEC DU) has F_ULOCK instead of F_UNLOCK */
-#if defined(F_ULOCK) && !defined(F_UNLOCK)
-#  define F_UNLOCK F_ULOCK
+#ifdef WANT_AMFLOCK_LOCKF
+extern amflock_impl_t amflock_lockf_impl;
 #endif
-
-/* Lock a file using lockf().
-** Notes:
-** - returns errors for some non-files like pipes.
-** - probably only works for files open for writing.
-*/
-int
-use_lockf(
-    int fd,    /* fd of file to operate on */
-    int op)    /* true to lock; false to unlock */
-{
-       off_t pos;
-
-       if (op) {
-               /* lock from here on */
-               if (lockf(fd, F_LOCK, (off_t)0) == -1) return -1;
-       }
-       else {
-               /* unlock from here on */
-               if (lockf(fd, F_UNLOCK, (off_t)0) == -1) return -1;
-
-               /* unlock from bof to here */
-               pos = lseek(fd, (off_t)0, SEEK_CUR);
-               if (pos == (off_t)-1) {
-                       if (errno == ESPIPE) pos = (off_t)0;
-                       else return -1;
-               }
-
-               if (pos > (off_t)0 &&
-                   lockf(fd, F_UNLOCK, -pos) == -1) return -1;
-       }
-
-       return 0;
-}
-
+#ifdef WANT_AMFLOCK_LNLOCK
+extern amflock_impl_t amflock_lnlock_impl;
 #endif
 
-#if !defined(USE_POSIX_FCNTL) && !defined(USE_FLOCK) && !defined(USE_LOCKF) && defined(USE_LNLOCK)
-/* XXX - error checking in this section needs to be tightened up */
-
-/* Delete a lock file.
-*/
-int
-delete_lock(
-    char *fn)
-{
-       int rc;
-
-       rc = unlink(fn);
-       if (rc != 0 && errno == ENOENT) rc = 0;
-
-       return rc;
-}
-
-/* Create a lock file.
-*/
-int
-create_lock(
-    char *fn,
-    pid_t pid)
-{
-       int fd;
-       FILE *f;
-       int mask;
-
-       (void)delete_lock(fn);                  /* that's MY file! */
-
-       mask = umask(0027);
-       fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0640);
-       umask(mask);
-       if (fd == -1) return -1;
-
-       if((f = fdopen(fd, "w")) == NULL) {
-           aclose(fd);
-           return -1;
-       }
-       fprintf(f, "%ld\n", pid);
-       if (fclose(f) == EOF)
-           return -1;
-       return 0;
-}
-
-/* Read the pid out of a lock file.
-**   -1=error, otherwise pid.
-*/
-long
-read_lock(
-    char *     fn) /* name of lock file */
-{
-       int save_errno;
-       FILE *f;
-       long pid;
-
-       if ((f = fopen(fn, "r")) == NULL) {
-               return -1;
-       }
-       if (fscanf(f, "%ld", &pid) != 1) {
-               save_errno = errno;
-               afclose(f);
-               errno = save_errno;
-               return -1;
-       }
-       if (fclose(f) != 0) {
-               return -1;
-       }
-       return pid;
-}
-
-/* Link a lock if we can.
-**   0=done, 1=already locked, -1=error.
-*/
-int
-link_lock(
-    char *     lk,     /* real lock file */
-    char *     tlk)    /* temp lock file */
-{
-       int rc;
-       int serrno;     /* saved errno */
-       struct stat lkstat, tlkstat;
-
-       /* an atomic check and set operation */
-       rc = link(tlk, lk);
-       if (rc == 0) return 0; /* XXX do we trust it? */
-
-       /* link() says it failed - don't beleive it */
-       serrno = errno;
-
-       if (stat(lk, &lkstat) == 0 &&
-           stat(tlk, &tlkstat) == 0 &&
-           lkstat.st_ino == tlkstat.st_ino)
-               return 0;       /* it did work! */
-
-       errno = serrno;
-
-       if (errno == EEXIST) rc = 1;
-
-       return rc;
-}
-
-/* Steal a lock if we can.
-**   0=done; 1=still in use; -1 = error.
-*/
-int
-steal_lock(
-    char *     fn,     /* name of lock file to steal */
-    pid_t      mypid,  /* my process id */
-    char *     sres)   /* name of steal-resource to lock */
-{
-       int fd;
-       char buff[64];
-       long pid;
-       int rc;
-
-       /* prevent a race with another stealer */
-       rc = ln_lock(sres, 1);
-       if (rc != 0) goto error;
-
-       pid = read_lock(fn);
-       if (pid == -1) {
-               if (errno == ENOENT) goto done;
-               goto error;
-       }
-
-       if (pid == mypid) goto steal; /* i'm the locker! */
-
-       /* are they still there ? */
-       rc = kill((pid_t)pid, 0);
-       if (rc != 0) {
-               if (errno == ESRCH) goto steal; /* locker has gone */
-               goto error;
-       }
-
-inuse:
-       rc = ln_lock(sres, 0);
-       if (rc != 0) goto error;
-
-       return 1;
-
-steal:
-       rc = delete_lock(fn);
-       if (rc != 0) goto error;
-
-done:
-       rc = ln_lock(sres, 0);
-       if (rc != 0) goto error;
-
-       return 0;
-
-error:
-       rc = ln_lock(sres, 0);
+amflock_impl_t *amflock_impls[] = {
+#ifdef WANT_AMFLOCK_POSIX
+    &amflock_posix_impl,
+#endif
+#ifdef WANT_AMFLOCK_FLOCK
+    &amflock_flock_impl,
+#endif
+#ifdef WANT_AMFLOCK_LOCKF
+    &amflock_lockf_impl,
+#endif
+#ifdef WANT_AMFLOCK_LNLOCK
+    &amflock_lnlock_impl,
+#endif
+    NULL
+};
 
-       return -1;
-}
+/* Interface functions */
+/* FIXME: for now, these just use the first non-NULL implementation
+ */
 
-/* Locking using existance of a file.
+/* Get a file lock (for read/write files).
 */
 int
-ln_lock(
-    char *     res, /* name of resource to lock */
-    int                op)  /* true to lock; false to unlock */
+amflock(
+    int                fd,
+    char *     resource)
 {
-       long mypid;
-       char *lockfile = NULL;
-       char *tlockfile = NULL;
-       char *mres = NULL;
-       int rc;
-       char pid_str[NUM_STR_SIZE];
-
-       mypid = (long)getpid();
-
-       lockfile = vstralloc(AMANDA_TMPDIR, "/am", res, ".lock", NULL);
-
-       if (!op) {
-               /* unlock the resource */
-               assert(read_lock(lockfile) == mypid);
-
-               (void)delete_lock(lockfile);
-               amfree(lockfile);
-               return 0;
-       }
-
-       /* lock the resource */
-
-       snprintf(pid_str, SIZEOF(pid_str), "%ld", mypid);
-       tlockfile = vstralloc(AMANDA_TMPDIR, "am", res, ".", pid_str, NULL);
-
-       (void)create_lock(tlockfile, mypid);
-
-       mres = stralloc2(res, ".");
-
-       while(1) {
-               rc = link_lock(lockfile, tlockfile);
-               if (rc == -1) break;
-               if (rc == 0) break;
-
-               rc = steal_lock(lockfile, mypid, mres);
-               if (rc == -1) break;
-               if (rc == 0) continue;
-               sleep(1);
-       }
-
-       (void) delete_lock(tlockfile);
-
-       amfree(mres);
-       amfree(tlockfile);
-       amfree(lockfile);
-
-       return rc;
+    if (!amflock_impls[0]) return 0; /* no locking */
+    return amflock_impls[0]->amflock_impl(fd, resource);
 }
-#endif
-
 
 /*
  * Get a file lock (for read-only files).
@@ -328,161 +109,18 @@ amroflock(
     int                fd,
     char *     resource)
 {
-       int r;
-
-#ifdef USE_POSIX_FCNTL
-       (void)resource; /* Quiet unused paramater warning */
-       lock.l_type = F_RDLCK;
-       lock.l_whence = SEEK_SET;
-       r = fcntl(fd, F_SETLKW, &lock);
-#else
-       (void)fd; /* Quiet unused paramater warning */
-       r = amflock(fd, resource);
-#endif
-
-       return r;
+    if (!amflock_impls[0]) return 0; /* no locking */
+    return amflock_impls[0]->amroflock_impl(fd, resource);
 }
 
-
-/* Get a file lock (for read/write files).
-*/
-int
-amflock(
-    int                fd,
-    char *     resource)
-{
-       int r;
-
-#ifdef USE_POSIX_FCNTL
-       (void)resource; /* Quiet unused paramater warning */
-       lock.l_type = F_WRLCK;
-       lock.l_whence = SEEK_SET;
-       r = fcntl(fd, F_SETLKW, &lock);
-#else
-#ifdef USE_FLOCK
-       (void)resource; /* Quiet unused paramater warning */
-       r = flock(fd, LOCK_EX);
-#else
-#ifdef USE_LOCKF
-       (void)resource; /* Quiet unused paramater warning */
-       r = use_lockf(fd, 1);
-#else
-#ifdef USE_LNLOCK
-       (void)fd; /* Quiet unused paramater warning */
-       r = ln_lock(resource, 1);
-#else
-       (void)fd; /* Quiet unused paramater warning */
-       (void)resource; /* Quiet unused paramater warning */
-       r = 0;
-#endif
-#endif
-#endif
-#endif
-
-       return r;
-}
-
-
-/* Release a file lock.
-*/
+/*
+ * Release a file lock.
+ */
 int
 amfunlock(
     int                fd,
     char *     resource)
 {
-       int r;
-
-#ifdef USE_POSIX_FCNTL
-       (void)resource; /* Quiet unused paramater warning */
-       lock.l_type = F_UNLCK;
-       lock.l_whence = SEEK_SET;
-       r = fcntl(fd, F_SETLK, &lock);
-#else
-#ifdef USE_FLOCK
-       (void)resource; /* Quiet unused paramater warning */
-       r = flock(fd, LOCK_UN);
-#else
-#ifdef USE_LOCKF
-       (void)fd; /* Quiet unused paramater warning */
-       r = use_lockf(fd, 0);
-#else
-#ifdef USE_LNLOCK
-       (void)fd; /* Quiet unused paramater warning */
-       r = ln_lock(resource, 0);
-#else
-       (void)fd; /* Quiet unused paramater warning */
-       (void)resource; /* Quiet unused paramater warning */
-       r = 0;
-#endif
-#endif
-#endif
-#endif
-
-       return r;
-}
-
-
-/* Test routine for use by configure.
-** (I'm not sure why we use both return and exit!)
-** XXX the testing here should be a lot more comprehensive.
-**     - lock the file and then try and lock it from another process
-**     - lock the file from another process and check that process
-**       termination unlocks it.
-**     The hard part is to find a system independent way to not block
-**     for ever.
-*/
-#ifdef CONFIGURE_TEST
-int
-main(
-    int argc,
-    char **argv)
-{
-    int lockfd;
-    char *filen = "/tmp/conftest.lock";
-    char *resn = "test";
-
-    (void)argc;                /* Quiet compiler warning */
-    (void)argv;                /* Quiet compiler warning */
-
-    unlink(filen);
-    if ((lockfd = open(filen, O_RDONLY | O_CREAT | O_EXCL, 0600)) == -1) {
-       perror (filen);
-       exit(10);
-    }
-
-    if (amroflock(lockfd, resn) != 0) {
-       perror ("amroflock");
-       exit(1);
-    }
-    if (amfunlock(lockfd, resn) != 0) {
-       perror ("amfunlock/2");
-       exit(2);
-    }
-
-    /*
-     * Do not use aclose() here.  During configure we do not have
-     * areads_relbuf() available and it makes configure think all
-     * the tests have failed.
-     */
-    close(lockfd);
-
-    unlink(filen);
-    if ((lockfd = open(filen, O_WRONLY | O_CREAT | O_EXCL, 0600)) == -1) {
-       perror (filen);
-       exit(20);
-    }
-
-    if (amflock(lockfd, resn) != 0) {
-       perror ("amflock");
-       exit(3);
-    }
-    if (amfunlock(lockfd, resn) != 0) {
-       perror ("amfunlock/4");
-       exit(4);
-    }
-
-    close(lockfd);
-
-    exit(0);
+    if (!amflock_impls[0]) return 0; /* no locking */
+    return amflock_impls[0]->amfunlock_impl(fd, resource);
 }
-#endif
diff --git a/common-src/amflock.h b/common-src/amflock.h
new file mode 100644 (file)
index 0000000..f9d33e1
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1999 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/* Moved from amanda.h and amflock.c by Dustin J. Mitchell <dustin@zmanda.com> */
+
+/* Public interface */
+
+/*
+ * Get a file lock (for read/write files).
+ */
+int amflock(int fd, char *resource);
+
+/*
+ * Get a file lock (for read-only files).
+ */
+int amroflock(int fd, char *resource);
+
+/*
+ * Release a file lock.
+ */
+int amfunlock(int fd, char *resource);
+
+/* Implementation interface */
+typedef int (*amflock_fn)(int, char *);
+typedef struct amflock_impl_s {
+    amflock_fn amflock_impl;
+    amflock_fn amroflock_impl;
+    amflock_fn amfunlock_impl;
+    char *impl_name;
+} amflock_impl_t;
diff --git a/common-src/amgpgcrypt.pl b/common-src/amgpgcrypt.pl
new file mode 100755 (executable)
index 0000000..2852670
--- /dev/null
@@ -0,0 +1,80 @@
+#!@PERL@ -w
+#
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+# Amanda has problem with gpg mdc(modification detection code) in the binary mode.
+# This program encrypt with mdc disabled.
+# If mdc is required, use --armor option. 
+
+
+
+# Run perl.
+eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+         & eval 'exec /usr/bin/perl -S $0 $argv:q'
+                if 0;
+
+use Time::Local;
+
+my $AMANDA='@CLIENT_LOGIN@';
+my $saw_sigint = 0;
+
+$AMANDA_HOME = (getpwnam($AMANDA) )[7] || die "Cannot find $AMANDA home directory\n" ;
+
+#The following two ($AM_PASS, $AM_PRIV) are needed only for restore/recover
+#They should be protected and stored away during other time.
+$AM_PASS = "$AMANDA_HOME/.am_passphrase";
+$AM_PRIV = "$AMANDA_HOME/.gnupg/secring.gpg";
+
+$ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin';
+
+$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg";
+
+sub encrypt() {
+#   system "gpg --armor --encrypt --recipient $AMANDA";
+    system "gpg  --batch --disable-mdc --encrypt --cipher-algo AES256 --recipient $AMANDA";
+}
+
+sub decrypt() {
+     system "gpg --batch --quiet --no-mdc-warning --secret-keyring $AM_PRIV --decrypt --passphrase-fd 3  3<$AM_PASS";
+}
+
+sub my_sig_catcher {
+       $saw_sigint = 1;
+}
+
+#main
+
+
+
+$SIG{'INT'} = 'my_sig_catcher';
+
+
+if ( $#ARGV > 0 ) {
+     die "Usage: $0 [-d]\n";
+}
+
+if ( $#ARGV==0 && $ARGV[0] eq "-d" ) {
+    decrypt();
+}
+else {
+    encrypt();
+}
+
+$SIG{'INT'} = 'DEFAULT';
index e18b4a79e5fb485096d33f0b6db03f5d98e53fee..a3d572d6934c86533585ffdb0bb2375e7b1d683c 100644 (file)
 
 #define printf_arglist_function(fdecl, \
                                hook_type, hook_name) \
-       __attribute__ ((format (printf, 1, 0))) \
+        G_GNUC_PRINTF(1,0) \
         fdecl(hook_type hook_name, ...)
 
 #define printf_arglist_function1(fdecl, \
                                 arg1_type, arg1_name, \
                                 hook_type, hook_name) \
-       __attribute__ ((format (printf, 2, 0))) \
+        G_GNUC_PRINTF(2,0) \
        fdecl(arg1_type arg1_name, \
              hook_type hook_name, ...)
 
@@ -52,7 +52,7 @@
                                 arg1_type, arg1_name, \
                                 arg2_type, arg2_name, \
                                 hook_type, hook_name) \
-       __attribute__ ((format (printf, 3, 0))) \
+        G_GNUC_PRINTF(3,0) \
        fdecl(arg1_type arg1_name, \
              arg2_type arg2_name, \
              hook_type hook_name, ...)
@@ -62,8 +62,8 @@
                                 arg2_type, arg2_name, \
                                 arg3_type, arg3_name, \
                                 hook_type, hook_name) \
-       __attribute__ ((format (printf, 4, 0))) \
-       fdecl(arg1_type arg1_name, \
+        G_GNUC_PRINTF(4,0) \
+        fdecl(arg1_type arg1_name, \
              arg2_type arg2_name, \
              arg3_type arg3_name, \
              hook_type hook_name, ...)
index 18102ba63b47d3dc163d966595a28f95e1205440..8953f1f9308e72bf3a951bda549a45258cef2f46 100644 (file)
 #undef DUMPER_SOCKET_BUFFERING
 #endif
 
-#ifdef BSD_SECURITY                                            /* { */
-
-/*
- * Change the following from #undef to #define to cause detailed logging
- * of the security steps, e.g. into /tmp/amanda/amandad*debug.
- */
-#undef SHOW_SECURITY_DETAIL
-
 /*
  * Interface functions
  */
 static void    bsd_connect(const char *, char *(*)(char *, void *), 
                        void (*)(void *, security_handle_t *, security_status_t),
                        void *, void *);
-static void    bsd_accept(const struct security_driver *, int, int,
-                       void (*)(security_handle_t *, pkt_t *));
+static void    bsd_accept(const struct security_driver *,
+                       char *(*)(char *, void *),
+                       int, int,
+                       void (*)(security_handle_t *, pkt_t *),
+                       void *);
 static void    bsd_close(void *);
 static void *  bsd_stream_server(void *);
 static int     bsd_stream_accept(void *);
@@ -131,12 +126,12 @@ bsd_connect(
     struct servent *se;
     in_port_t port = 0;
     struct timeval sequence_time;
-    amanda_timezone dontcare;
     int sequence;
     char *handle;
     int result;
-    struct addrinfo hints;
-    struct addrinfo *res = NULL;
+    struct addrinfo *res, *res_addr;
+    char *canonname;
+    int result_bind;
 
     assert(hostname != NULL);
 
@@ -147,117 +142,142 @@ bsd_connect(
     bh->proto_handle=NULL;
     security_handleinit(&bh->sech, &bsd_security_driver);
 
-    /*
-     * Only init the socket once
-     */
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = AF_INET6;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = AF_INET;
-#endif
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
-#ifdef WORKING_IPV6
-    if (result != 0) {
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       result = getaddrinfo(hostname, NULL, &hints, &res);
-    }
-#endif
+    result = resolve_hostname(hostname, SOCK_DGRAM, &res, &canonname);
     if(result != 0) {
-       dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
-       security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname,
+       dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result));
+       security_seterror(&bh->sech, _("resolve_hostname(%s): %s\n"), hostname,
                          gai_strerror(result));
        (*fn)(arg, &bh->sech, S_ERROR);
        return;
     }
-    if (res->ai_canonname == NULL) {
-       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+    if (canonname == NULL) {
+       dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        security_seterror(&bh->sech,
-               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+               _("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        (*fn)(arg, &bh->sech, S_ERROR);
        return;
     }
+    if (res == NULL) {
+       dbprintf(_("resolve_hostname(%s): no results\n"), hostname);
+       security_seterror(&bh->sech,
+               _("resolve_hostname(%s): no results\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       amfree(canonname);
+       return;
+    }
 
+    for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
 #ifdef WORKING_IPV6
-    if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
-       uid_t euid;
-       dgram_zero(&netfd6.dgram);
-
-       euid = geteuid();
-       seteuid((uid_t)0);
-       dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port);
-       seteuid(euid);
-       netfd6.handle = NULL;
-       netfd6.pkt.body = NULL;
-       netfd6.recv_security_ok = &bsd_recv_security_ok;
-       netfd6.prefix_packet = &bsd_prefix_packet;
+       /* IPv6 socket already bound */
+       if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 0) {
+           break;
+       }
        /*
-        * We must have a reserved port.  Bomb if we didn't get one.
+        * Only init the IPv6 socket once
         */
-       if (port >= IPPORT_RESERVED) {
-           security_seterror(&bh->sech,
-               "unable to bind to a reserved port (got port %u)",
-               (unsigned int)port);
-           (*fn)(arg, &bh->sech, S_ERROR);
-           return;
+       if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
+           uid_t euid;
+           dgram_zero(&netfd6.dgram);
+
+           euid = geteuid();
+           set_root_privs(1);
+           result_bind = dgram_bind(&netfd6.dgram,
+                                    res_addr->ai_addr->sa_family, &port);
+           set_root_privs(0);
+           if (result_bind != 0) {
+               continue;
+           }
+           netfd6.handle = NULL;
+           netfd6.pkt.body = NULL;
+           netfd6.recv_security_ok = &bsd_recv_security_ok;
+           netfd6.prefix_packet = &bsd_prefix_packet;
+           /*
+            * We must have a reserved port.  Bomb if we didn't get one.
+            */
+           if (port >= IPPORT_RESERVED) {
+               security_seterror(&bh->sech,
+                   _("unable to bind to a reserved port (got port %u)"),
+                   (unsigned int)port);
+               (*fn)(arg, &bh->sech, S_ERROR);
+               freeaddrinfo(res);
+               amfree(canonname);
+               return;
+           }
+           not_init6 = 0;
+           bh->udp = &netfd6;
+           break;
        }
-       not_init6 = 0;
-       bh->udp = &netfd6;
-    }
 #endif
 
-    if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) {
-       uid_t euid;
-       dgram_zero(&netfd4.dgram);
-
-       euid = geteuid();
-       seteuid((uid_t)0);
-       dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port);
-       seteuid(euid);
-       netfd4.handle = NULL;
-       netfd4.pkt.body = NULL;
-       netfd4.recv_security_ok = &bsd_recv_security_ok;
-       netfd4.prefix_packet = &bsd_prefix_packet;
+       /* IPv4 socket already bound */
+       if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 0) {
+           break;
+       }
+
        /*
-        * We must have a reserved port.  Bomb if we didn't get one.
+        * Only init the IPv4 socket once
         */
-       if (port >= IPPORT_RESERVED) {
-           security_seterror(&bh->sech,
-               "unable to bind to a reserved port (got port %u)",
-               (unsigned int)port);
-           (*fn)(arg, &bh->sech, S_ERROR);
-           return;
+       if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 1) {
+           uid_t euid;
+           dgram_zero(&netfd4.dgram);
+
+           euid = geteuid();
+           set_root_privs(1);
+           result_bind = dgram_bind(&netfd4.dgram,
+                                    res_addr->ai_addr->sa_family, &port);
+           set_root_privs(0);
+           if (result_bind != 0) {
+               continue;
+           }
+           netfd4.handle = NULL;
+           netfd4.pkt.body = NULL;
+           netfd4.recv_security_ok = &bsd_recv_security_ok;
+           netfd4.prefix_packet = &bsd_prefix_packet;
+           /*
+            * We must have a reserved port.  Bomb if we didn't get one.
+            */
+           if (port >= IPPORT_RESERVED) {
+               security_seterror(&bh->sech,
+                   "unable to bind to a reserved port (got port %u)",
+                   (unsigned int)port);
+               (*fn)(arg, &bh->sech, S_ERROR);
+               freeaddrinfo(res);
+               amfree(canonname);
+               return;
+           }
+           not_init4 = 0;
+           bh->udp = &netfd4;
+           break;
        }
-       not_init4 = 0;
-       bh->udp = &netfd4;
+    }
+
+    if (res_addr == NULL) {
+       dbprintf(_("Can't bind a socket to connect to %s\n"), hostname);
+       security_seterror(&bh->sech,
+               _("Can't bind a socket to connect to %s\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       amfree(canonname);
+       return;
     }
 
 #ifdef WORKING_IPV6
-    if (res->ai_addr->sa_family == AF_INET6)
+    if (res_addr->ai_addr->sa_family == AF_INET6)
        bh->udp = &netfd6;
     else
 #endif
        bh->udp = &netfd4;
 
-    auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname));
+    auth_debug(1, _("Resolved hostname=%s\n"), canonname);
     if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL)
        port = AMANDA_SERVICE_DEFAULT;
     else
        port = (in_port_t)ntohs(se->s_port);
-    amanda_gettimeofday(&sequence_time, &dontcare);
+    amanda_gettimeofday(&sequence_time);
     sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec;
     handle=alloc(15);
-    snprintf(handle, 14, "000-%08x",  (unsigned)newhandle++);
-    if (udp_inithandle(bh->udp, bh, res->ai_canonname,
-       (struct sockaddr_storage *)res->ai_addr, port, handle, sequence) < 0) {
+    g_snprintf(handle, 14, "000-%08x",  (unsigned)newhandle++);
+    if (udp_inithandle(bh->udp, bh, canonname,
+       (struct sockaddr_storage *)res_addr->ai_addr, port, handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
        amfree(bh);
@@ -266,6 +286,7 @@ bsd_connect(
        (*fn)(arg, &bh->sech, S_OK);
     }
     amfree(handle);
+    amfree(canonname);
 
     freeaddrinfo(res);
 }
@@ -276,9 +297,11 @@ bsd_connect(
 static void
 bsd_accept(
     const struct security_driver *     driver,
+    char       *(*conf_fn)(char *, void *),
     int                in,
     int                out,
-    void       (*fn)(security_handle_t *, pkt_t *))
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
 {
 
     assert(in >= 0 && out >= 0);
@@ -286,6 +309,8 @@ bsd_accept(
 
     (void)out; /* Quiet unused parameter warning */
     (void)driver; /* Quiet unused parameter warning */
+    (void)conf_fn;
+    (void)datap;
 
     /*
      * We assume in and out point to the same socket, and just use
@@ -320,8 +345,7 @@ bsd_close(
        return;
     }
 
-    auth_debug(1, ("%s: bsd: close handle '%s'\n",
-                  debug_prefix_time(NULL), bh->proto_handle));
+    auth_debug(1, _("bsd: close handle '%s'\n"), bh->proto_handle);
 
     udp_recvpkt_cancel(bh);
     if(bh->next) {
@@ -363,11 +387,12 @@ bsd_stream_server(
 
     bs = alloc(SIZEOF(*bs));
     security_streaminit(&bs->secstr, &bsd_security_driver);
-    bs->socket = stream_server(&bs->port, (size_t)STREAM_BUFSIZE, 
-                       (size_t)STREAM_BUFSIZE, 0);
+    bs->socket = stream_server(bh->udp->peer.ss_family, &bs->port,
+                              (size_t)STREAM_BUFSIZE, (size_t)STREAM_BUFSIZE,
+                              0);
     if (bs->socket < 0) {
        security_seterror(&bh->sech,
-           "can't create server stream: %s", strerror(errno));
+           _("can't create server stream: %s"), strerror(errno));
        amfree(bs);
        return (NULL);
     }
@@ -393,7 +418,7 @@ bsd_stream_accept(
     bs->fd = stream_accept(bs->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE);
     if (bs->fd < 0) {
        security_stream_seterror(&bs->secstr,
-           "can't accept new stream connection: %s", strerror(errno));
+           _("can't accept new stream connection: %s"), strerror(errno));
        return (-1);
     }
     return (0);
@@ -421,7 +446,7 @@ bsd_stream_client(
        STREAM_BUFSIZE, STREAM_BUFSIZE, &bs->port, 0);
     if (bs->fd < 0) {
        security_seterror(&bh->sech,
-           "can't connect stream to %s port %d: %s", bh->hostname,
+           _("can't connect stream to %s port %d: %s"), bh->hostname,
            id, strerror(errno));
        amfree(bs);
        return (NULL);
@@ -540,8 +565,7 @@ stream_read_sync_callback(
 
     assert(bs != NULL);
 
-    auth_debug(1, ("%s: bsd: stream_read_callback_sync: fd %d\n",
-                  debug_prefix_time(NULL), bs->fd));
+    auth_debug(1, _("bsd: stream_read_callback_sync: fd %d\n"), bs->fd);
 
     /*
      * Remove the event first, in case they reschedule it in the callback.
@@ -597,5 +621,3 @@ stream_read_callback(
 
     (*bs->fn)(bs->arg, bs->databuf, n);
 }
-
-#endif /* BSD_SECURITY */                                      /* } */
index 485186ffb8d24d61279302acf4c5f1eb89b0d8ca..3c2e84b04fdcc42c2f42c20f5bebba2da01c80f8 100644 (file)
 #include "queue.h"
 #include "security.h"
 #include "security-util.h"
+#include "sockaddr-util.h"
 #include "stream.h"
 #include "version.h"
 
-#ifdef BSDTCP_SECURITY
-
 /*
  * Number of seconds bsdtcp has to start up
  */
 /*
  * Interface functions
  */
-static void bsdtcp_accept(const struct security_driver *, int, int,
-    void (*)(security_handle_t *, pkt_t *));
+static void bsdtcp_accept(const struct security_driver *,
+    char *(*)(char *, void *),
+    int, int,
+    void (*)(security_handle_t *, pkt_t *),
+    void *);
 static void bsdtcp_connect(const char *,
     char *(*)(char *, void *), 
     void (*)(void *, security_handle_t *, security_status_t), void *, void *);
@@ -107,16 +109,14 @@ bsdtcp_connect(
 {
     struct sec_handle *rh;
     int result;
-    struct addrinfo hints;
-    struct addrinfo *res = NULL;
+    char *canonname;
 
     assert(fn != NULL);
     assert(hostname != NULL);
     (void)conf_fn;     /* Quiet unused parameter warning */
     (void)datap;       /* Quiet unused parameter warning */
 
-    auth_debug(1, ("%s: bsdtcp: bsdtcp_connect: %s\n", debug_prefix_time(NULL),
-                  hostname));
+    auth_debug(1, _("bsdtcp: bsdtcp_connect: %s\n"), hostname);
 
     rh = alloc(sizeof(*rh));
     security_handleinit(&rh->sech, &bsdtcp_security_driver);
@@ -125,43 +125,24 @@ bsdtcp_connect(
     rh->ev_timeout = NULL;
     rh->rc = NULL;
 
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = AF_UNSPEC;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = AF_INET;
-#endif
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
-#ifdef WORKING_IPV6
-    if (result != 0) {
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       result = getaddrinfo(hostname, NULL, &hints, &res);
-    }
-#endif
+    result = resolve_hostname(hostname, 0, NULL, &canonname);
     if(result != 0) {
-        dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
-       security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname,
+       dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result));
+       security_seterror(&rh->sech, _("resolve_hostname(%s): %s\n"), hostname,
                          gai_strerror(result));
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
-    if (res->ai_canonname == NULL) {
-       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+    if (canonname == NULL) {
+       dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        security_seterror(&rh->sech,
-               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+               _("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
 
-    rh->hostname = stralloc(res->ai_canonname);        /* will be replaced */
+    rh->hostname = canonname;  /* will be replaced */
+    canonname = NULL; /* steal reference */
     rh->rs = tcpma_stream_client(rh, newhandle++);
     rh->rc->recv_security_ok = &bsd_recv_security_ok;
     rh->rc->prefix_packet = &bsd_prefix_packet;
@@ -198,12 +179,10 @@ bsdtcp_connect(
     rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME,
        sec_connect_timeout, rh);
 
-    freeaddrinfo(res);
     return;
 
 error:
     (*fn)(arg, &rh->sech, S_ERROR);
-    freeaddrinfo(res);
 }
 
 /*
@@ -212,9 +191,11 @@ error:
 static void
 bsdtcp_accept(
     const struct security_driver *driver,
+    char *     (*conf_fn)(char *, void *),
     int                in,
     int                out,
-    void       (*fn)(security_handle_t *, pkt_t *))
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
 {
     struct sockaddr_storage sin;
     socklen_t len;
@@ -225,14 +206,13 @@ bsdtcp_accept(
 
     len = sizeof(sin);
     if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) {
-       dbprintf(("%s: getpeername returned: %s\n", debug_prefix_time(NULL),
-                 strerror(errno)));
+       dbprintf(_("getpeername returned: %s\n"), strerror(errno));
        return;
     }
     if ((result = getnameinfo((struct sockaddr *)&sin, len,
                              hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
-       dbprintf(("%s: getnameinfo failed: %s\n",
-                 debug_prefix_time(NULL), gai_strerror(result)));
+       dbprintf(_("getnameinfo failed: %s\n"),
+                 gai_strerror(result));
        return;
     }
     if (check_name_give_sockaddr(hostname,
@@ -244,11 +224,13 @@ bsdtcp_accept(
     rc = sec_tcp_conn_get(hostname, 0);
     rc->recv_security_ok = &bsd_recv_security_ok;
     rc->prefix_packet = &bsd_prefix_packet;
-    memcpy(&rc->peer, &sin, sizeof(rc->peer));
+    copy_sockaddr(&rc->peer, &sin);
     rc->read = in;
     rc->write = out;
     rc->accept_fn = fn;
     rc->driver = driver;
+    rc->conf_fn = conf_fn;
+    rc->datap = datap;
     sec_tcp_conn_read(rc);
 }
 
@@ -263,15 +245,13 @@ runbsdtcp(
     struct servent *   sp;
     int                        server_socket;
     in_port_t          my_port;
-    uid_t              euid;
     struct tcp_conn *  rc = rh->rc;
 
     if ((sp = getservbyname(AMANDA_SERVICE_NAME, "tcp")) == NULL) {
-       error("%s/tcp unknown protocol", "amanda");
+       error(_("%s/tcp unknown protocol"), "amanda");
     }
 
-    euid = geteuid();
-    seteuid(0);
+    set_root_privs(1);
 
     server_socket = stream_client_privileged(rc->hostname,
                                     (in_port_t)(ntohs((in_port_t)sp->s_port)),
@@ -279,6 +259,7 @@ runbsdtcp(
                                     STREAM_BUFSIZE,
                                     &my_port,
                                     0);
+    set_root_privs(0);
 
     if(server_socket < 0) {
        security_seterror(&rh->sech,
@@ -286,15 +267,12 @@ runbsdtcp(
        
        return -1;
     }
-    seteuid(euid);
 
     if(my_port >= IPPORT_RESERVED) {
        security_seterror(&rh->sech,
-                         "did not get a reserved port: %d", my_port);
+                         _("did not get a reserved port: %d"), my_port);
     }
 
     rc->read = rc->write = server_socket;
     return 0;
 }
-
-#endif /* BSDTCP_SECURITY */
index 9a3949d5ad8bb5a0ff5d71d8946a00b3945053d6..2ae9e4edb1cb26ed063c82f9a7e1182601640bec 100644 (file)
 #include "stream.h"
 #include "version.h"
 
-#ifdef BSDUDP_SECURITY
-
 #ifndef SO_RCVBUF
 #undef DUMPER_SOCKET_BUFFERING
 #endif
 
-/*
- * Change the following from #undef to #define to cause detailed logging
- * of the security steps, e.g. into /tmp/amanda/amandad*debug.
- */
-#undef SHOW_SECURITY_DETAIL
-
 /*
  * Interface functions
  */
 static void bsdudp_connect(const char *,
     char *(*)(char *, void *), 
     void (*)(void *, security_handle_t *, security_status_t), void *, void *);
-static void bsdudp_accept(const struct security_driver *, int, int, void (*)(security_handle_t *, pkt_t *));
+static void bsdudp_accept(const struct security_driver *,
+    char *(*)(char *, void *),
+    int, int,
+    void (*)(security_handle_t *, pkt_t *),
+    void *);
 static void bsdudp_close(void *);
 
 /*
@@ -114,12 +110,12 @@ bsdudp_connect(
     struct servent *se;
     in_port_t port;
     struct timeval sequence_time;
-    amanda_timezone dontcare;
     int sequence;
     char *handle;
     int result;
-    struct addrinfo hints;
-    struct addrinfo *res = NULL;
+    char *canonname;
+    struct addrinfo *res = NULL, *res_addr;
+    int result_bind;
 
     (void)conf_fn;     /* Quiet unused parameter warning */
     (void)datap;       /* Quiet unused parameter warning */
@@ -130,117 +126,142 @@ bsdudp_connect(
     bh->rc = NULL;
     security_handleinit(&bh->sech, &bsdudp_security_driver);
 
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = AF_INET6;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = AF_INET;
-#endif
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
-#ifdef WORKING_IPV6
-    if (result != 0) {
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       result = getaddrinfo(hostname, NULL, &hints, &res);
-    }
-#endif
+    result = resolve_hostname(hostname, SOCK_DGRAM, &res, &canonname);
     if(result != 0) {
-        dbprintf(("getaddrinfo: %s\n", gai_strerror(result)));
-       security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname,
+       dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result));
+       security_seterror(&bh->sech, _("resolve_hostname(%s): %s\n"), hostname,
                          gai_strerror(result));
        (*fn)(arg, &bh->sech, S_ERROR);
-        return;
+       return;
     }
-    if (res->ai_canonname == NULL) {
-       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+    if (canonname == NULL) {
+       dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        security_seterror(&bh->sech,
-               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+               _("resolve_hostname(%s) did not return a canonical name\n"), hostname);
        (*fn)(arg, &bh->sech, S_ERROR);
        return;
     }
+    if (res == NULL) {
+       dbprintf(_("resolve_hostname(%s): no results\n"), hostname);
+       security_seterror(&bh->sech,
+               _("resolve_hostname(%s): no results\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       amfree(canonname);
+       return;
+    }
 
-    /*
-     * Only init the socket once
-     */
+    for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
 #ifdef WORKING_IPV6
-    if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
-       uid_t euid;
-       dgram_zero(&netfd6.dgram);
-       
-       euid = geteuid();
-       seteuid(0);
-       dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port);
-       seteuid(euid);
-       netfd6.handle = NULL;
-       netfd6.pkt.body = NULL;
-       netfd6.recv_security_ok = &bsd_recv_security_ok;
-       netfd6.prefix_packet = &bsd_prefix_packet;
+       /* IPv6 socket already bound */
+       if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 0) {
+           break;
+       }
        /*
-        * We must have a reserved port.  Bomb if we didn't get one.
+        * Only init the IPv6 socket once
         */
-       if (port >= IPPORT_RESERVED) {
-           security_seterror(&bh->sech,
-               "unable to bind to a reserved port (got port %u)",
-               (unsigned int)port);
-           (*fn)(arg, &bh->sech, S_ERROR);
-           return;
+       if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
+           uid_t euid;
+           dgram_zero(&netfd6.dgram);
+
+           euid = geteuid();
+           set_root_privs(1);
+           result_bind = dgram_bind(&netfd6.dgram,
+                                    res_addr->ai_addr->sa_family, &port);
+           set_root_privs(0);
+           if (result_bind != 0) {
+               continue;
+           }
+           netfd6.handle = NULL;
+           netfd6.pkt.body = NULL;
+           netfd6.recv_security_ok = &bsd_recv_security_ok;
+           netfd6.prefix_packet = &bsd_prefix_packet;
+           /*
+            * We must have a reserved port.  Bomb if we didn't get one.
+            */
+           if (port >= IPPORT_RESERVED) {
+               security_seterror(&bh->sech,
+                   _("unable to bind to a reserved port (got port %u)"),
+                   (unsigned int)port);
+               (*fn)(arg, &bh->sech, S_ERROR);
+               freeaddrinfo(res);
+               amfree(canonname);
+               return;
+           }
+           not_init6 = 0;
+           bh->udp = &netfd6;
+           break;
        }
-       not_init6 = 0;
-       bh->udp = &netfd6;
-    }
 #endif
 
-    if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) {
-       uid_t euid;
-       dgram_zero(&netfd4.dgram);
+       /* IPv4 socket already bound */
+       if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 0) {
+           break;
+       }
 
-       euid = geteuid();
-       seteuid((uid_t)0);
-       dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port);
-       seteuid(euid);
-       netfd4.handle = NULL;
-       netfd4.pkt.body = NULL;
-       netfd4.recv_security_ok = &bsd_recv_security_ok;
-       netfd4.prefix_packet = &bsd_prefix_packet;
        /*
-        * We must have a reserved port.  Bomb if we didn't get one.
+        * Only init the IPv4 socket once
         */
-       if (port >= IPPORT_RESERVED) {
-           security_seterror(&bh->sech,
-               "unable to bind to a reserved port (got port %u)",
-               (unsigned int)port);
-           (*fn)(arg, &bh->sech, S_ERROR);
-           return;
+       if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 1) {
+           uid_t euid;
+           dgram_zero(&netfd4.dgram);
+
+           euid = geteuid();
+           set_root_privs(1);
+           result_bind = dgram_bind(&netfd4.dgram,
+                                    res_addr->ai_addr->sa_family, &port);
+           set_root_privs(0);
+           if (result_bind != 0) {
+               continue;
+           }
+           netfd4.handle = NULL;
+           netfd4.pkt.body = NULL;
+           netfd4.recv_security_ok = &bsd_recv_security_ok;
+           netfd4.prefix_packet = &bsd_prefix_packet;
+           /*
+            * We must have a reserved port.  Bomb if we didn't get one.
+            */
+           if (port >= IPPORT_RESERVED) {
+               security_seterror(&bh->sech,
+                   "unable to bind to a reserved port (got port %u)",
+                   (unsigned int)port);
+               (*fn)(arg, &bh->sech, S_ERROR);
+               freeaddrinfo(res);
+               amfree(canonname);
+               return;
+           }
+           not_init4 = 0;
+           bh->udp = &netfd4;
+           break;
        }
-       not_init4 = 0;
-       bh->udp = &netfd4;
+    }
+
+    if (res_addr == NULL) {
+       dbprintf(_("Can't bind a socket to connect to %s\n"), hostname);
+       security_seterror(&bh->sech,
+               _("Can't bind a socket to connect to %s\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       amfree(canonname);
+       return;
     }
 
 #ifdef WORKING_IPV6
-    if (res->ai_addr->sa_family == AF_INET6)
+    if (res_addr->ai_addr->sa_family == AF_INET6)
        bh->udp = &netfd6;
     else
 #endif
        bh->udp = &netfd4;
 
-    auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname));
+    auth_debug(1, _("Resolved hostname=%s\n"), canonname);
     if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL)
        port = AMANDA_SERVICE_DEFAULT;
     else
        port = (in_port_t)ntohs(se->s_port);
-    amanda_gettimeofday(&sequence_time, &dontcare);
+    amanda_gettimeofday(&sequence_time);
     sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec;
     handle=alloc(15);
-    snprintf(handle,14,"000-%08x", newhandle++);
-    if (udp_inithandle(bh->udp, bh, res->ai_canonname,
-                      (struct sockaddr_storage *)res->ai_addr, port,
+    g_snprintf(handle,14,"000-%08x", newhandle++);
+    if (udp_inithandle(bh->udp, bh, canonname,
+                      (struct sockaddr_storage *)res_addr->ai_addr, port,
                       handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
@@ -249,8 +270,9 @@ bsdudp_connect(
        (*fn)(arg, &bh->sech, S_OK);
     }
     amfree(handle);
+    amfree(canonname);
 
-    freeaddrinfo(res);
+    if (res) freeaddrinfo(res);
 }
 
 /*
@@ -259,12 +281,16 @@ bsdudp_connect(
 static void
 bsdudp_accept(
     const struct security_driver *driver,
+    char *      (*conf_fn)(char *, void *),
     int                in,
     int                out,
-    void       (*fn)(security_handle_t *, pkt_t *))
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
 {
     (void)driver;      /* Quiet unused parameter warning */
     (void)out;         /* Quiet unused parameter warning */
+    (void)conf_fn;
+    (void)datap;
 
     assert(in >= 0 && out >= 0);
     assert(fn != NULL);
@@ -303,8 +329,7 @@ bsdudp_close(
        return;
     }
 
-    auth_debug(1, ("%s: bsdudp: close handle '%s'\n",
-                  debug_prefix_time(NULL), bh->proto_handle));
+    auth_debug(1, _("bsdudp: close handle '%s'\n"), bh->proto_handle);
 
     udp_recvpkt_cancel(bh);
     if(bh->next) {
@@ -331,5 +356,3 @@ bsdudp_close(
     amfree(bh);
 }
 
-#endif /* BSDUDP_SECURITY */                                   /* } */
-
index ff41fa641edba607feaec4360b8dd1e5df27747c..5362ac8562440a101186fef04104d95b65b5f51f 100644 (file)
@@ -34,9 +34,6 @@
 #include "clock.h"
 
 /* local functions */
-static struct timeval timesub(struct timeval end, struct timeval start);
-static struct timeval timeadd(struct timeval a, struct timeval b);
-
 times_t times_zero;
 times_t start_time;
 static int clock_running = 0;
@@ -50,25 +47,18 @@ clock_is_running(void)
 void
 startclock(void)
 {
-    amanda_timezone dontcare;
-
     clock_running = 1;
-    amanda_gettimeofday(&start_time.r, &dontcare);
+    
+    g_get_current_time(&start_time);
 }
 
 times_t
 stopclock(void)
 {
-    times_t diff;
-    struct timeval end_time;
-    amanda_timezone dontcare;
+    GTimeVal diff;
+
+    diff = curclock();
 
-    if(!clock_running) {
-       fprintf(stderr,"stopclock botch\n");
-       exit(1);
-    }
-    amanda_gettimeofday(&end_time, &dontcare);
-    diff.r = timesub(end_time,start_time.r);
     clock_running = 0;
     return diff;
 }
@@ -76,56 +66,15 @@ stopclock(void)
 times_t
 curclock(void)
 {
-    times_t diff;
-    struct timeval end_time;
-    amanda_timezone dontcare;
+    GTimeVal end_time;
 
     if(!clock_running) {
-       fprintf(stderr,"curclock botch\n");
+       g_fprintf(stderr,_("curclock botch\n"));
        exit(1);
     }
-    amanda_gettimeofday(&end_time, &dontcare);
-    diff.r = timesub(end_time,start_time.r);
-    return diff;
-}
 
-times_t
-timesadd(
-    times_t    a,
-    times_t    b)
-{
-    times_t sum;
-
-    sum.r = timeadd(a.r,b.r);
-    return sum;
-}
-
-times_t
-timessub(
-    times_t    a,
-    times_t    b)
-{
-    times_t dif;
-
-    dif.r = timesub(a.r,b.r);
-    return dif;
-}
-
-char *
-times_str(
-    times_t    t)
-{
-    static char str[10][NUM_STR_SIZE+10];
-    static size_t n = 0;
-    char *s;
-
-    /* tv_sec/tv_usec are longs on some systems */
-    snprintf(str[n], SIZEOF(str[n]), "rtime %lu.%03lu",
-            (unsigned long)t.r.tv_sec,
-            (unsigned long)t.r.tv_usec / 1000);
-    s = str[n++];
-    n %= am_countof(str);
-    return s;
+    g_get_current_time(&end_time);
+    return timesub(end_time,start_time);
 }
 
 char *
@@ -137,20 +86,16 @@ walltime_str(
     char *s;
 
     /* tv_sec/tv_usec are longs on some systems */
-    snprintf(str[n], SIZEOF(str[n]), "%lu.%03lu",
-            (unsigned long)t.r.tv_sec,
-            (unsigned long)t.r.tv_usec/1000);
+    g_snprintf(str[n], SIZEOF(str[n]), "%lu.%03lu",
+            (unsigned long)t.tv_sec,
+            (unsigned long)t.tv_usec/1000);
     s = str[n++];
     n %= am_countof(str);
     return s;
 }
 
-static struct timeval
-timesub(
-    struct timeval     end,
-    struct timeval     start)
-{
-    struct timeval diff;
+GTimeVal timesub(GTimeVal end, GTimeVal start) {
+    GTimeVal diff;
 
     if(end.tv_usec < start.tv_usec) { /* borrow 1 sec */
        if (end.tv_sec > 0)
@@ -167,12 +112,8 @@ timesub(
     return diff;
 }
 
-static struct timeval
-timeadd(
-    struct timeval     a,
-    struct timeval     b)
-{
-    struct timeval sum;
+GTimeVal timeadd(GTimeVal a, GTimeVal b) {
+    GTimeVal sum;
 
     sum.tv_sec = a.tv_sec + b.tv_sec;
     sum.tv_usec = a.tv_usec + b.tv_usec;
@@ -183,3 +124,15 @@ timeadd(
     }
     return sum;
 }
+
+double g_timeval_to_double(GTimeVal v) {
+    return v.tv_sec + ((double)v.tv_usec) / G_USEC_PER_SEC;
+}
+
+void amanda_gettimeofday(struct timeval * timeval_time) {
+    GTimeVal gtimeval_time;
+
+    g_get_current_time(&gtimeval_time);
+    timeval_time->tv_sec = gtimeval_time.tv_sec;
+    timeval_time->tv_usec = gtimeval_time.tv_usec;
+}
index 391b3835a4494e2e7276bd948fd408df3878cfe7..0f7ce1eb1a7c43242edb9a43527d3ac994a1b9b5 100644 (file)
 
 #include "amanda.h"
 
-typedef struct times_s {
-    struct timeval r;
-
-#ifdef INSTRUMENTATION
-    struct timeval u,s;
-#endif
-} times_t;
+typedef GTimeVal times_t;
 
 extern times_t times_zero, start_time;
 
-#ifdef HAVE_TWO_ARG_GETTIMEOFDAY
-#  define amanda_timezone struct timezone
-#  define amanda_gettimeofday(x, y) gettimeofday((x), (y))
-#else
-#  define amanda_timezone int
-#  define amanda_gettimeofday(x, y) gettimeofday((x))
-#endif
-
+/* NOT THREAD SAFE */
 void startclock(void);
 times_t stopclock(void);
 times_t curclock(void);
-times_t timesadd(times_t a, times_t b);
-times_t timessub(times_t a, times_t b);
-char * times_str(times_t t);
 char * walltime_str(times_t t);
 int clock_is_running(void);
 
+/* Thread safe */
+times_t timeadd(times_t a, times_t b);
+#define timesadd(x, y) timeadd(x, y)
+
+times_t timesub(times_t a, times_t b);
+#define timessub(x, y) timesub(x, y)
+
+double g_timeval_to_double(GTimeVal v);
+
+void amanda_gettimeofday(struct timeval * timeval_time);
+
+
 #endif /* CLOCK_H */
diff --git a/common-src/columnar.c b/common-src/columnar.c
new file mode 100644 (file)
index 0000000..6a11dd7
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-2000 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: James da Silva, Systems Design and Analysis Group
+ *                        Computer Science Department
+ *                        University of Maryland at College Park
+ */
+/*
+ * Originally living in conffile.c, this stuff supports columnar output in amreport.
+ */
+
+
+#include "amanda.h"
+#include "columnar.h"
+
+ColumnInfo ColumnData[] = {
+    { "HostName",   0, 12, 12, 0, "%-*.*s", "HOSTNAME" },
+    { "Disk",       1, 11, 11, 0, "%-*.*s", "DISK" },
+    { "Level",      1, 1,  1,  0, "%*.*d",  "L" },
+    { "OrigKB",     1, 7,  0,  0, "%*.*lf", "ORIG-KB" },
+    { "OutKB",      1, 7,  0,  0, "%*.*lf", "OUT-KB" },
+    { "Compress",   1, 6,  1,  0, "%*.*lf", "COMP%" },
+    { "DumpTime",   1, 7,  7,  0, "%*.*s",  "MMM:SS" },
+    { "DumpRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
+    { "TapeTime",   1, 6,  6,  0, "%*.*s",  "MMM:SS" },
+    { "TapeRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
+    { NULL,         0, 0,  0,  0, NULL,     NULL }
+};
+
+
+int
+ColumnDataCount(void )
+{
+    return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0]));
+}
+
+/* conversion from string to table index
+ */
+int
+StringToColumn(
+    char *s)
+{
+    int cn;
+
+    for (cn=0; ColumnData[cn].Name != NULL; cn++) {
+       if (strcasecmp(s, ColumnData[cn].Name) == 0) {
+           break;
+       }
+    }
+    return cn;
+}
+
+char
+LastChar(
+    char *s)
+{
+    return s[strlen(s)-1];
+}
+
+int
+SetColumnDataFromString(
+    ColumnInfo* ci,
+    char *s,
+    char **errstr)
+{
+    ci = ci;
+
+    /* Convert from a Columnspec string to our internal format
+     * of columspec. The purpose is to provide this string
+     * as configuration paramter in the amanda.conf file or
+     * (maybe) as environment variable.
+     * 
+     * This text should go as comment into the sample amanda.conf
+     *
+     * The format for such a ColumnSpec string s is a ',' seperated
+     * list of triples. Each triple consists of
+     *   -the name of the column (as in ColumnData.Name)
+     *   -prefix before the column
+     *   -the width of the column
+     *       if set to -1 it will be recalculated
+     *  to the maximum length of a line to print.
+     * Example:
+     *         "Disk=1:17,HostName=1:10,OutKB=1:7"
+     * or
+     *         "Disk=1:-1,HostName=1:10,OutKB=1:7"
+     * 
+     * You need only specify those colums that should be changed from
+     * the default. If nothing is specified in the configfile, the
+     * above compiled in values will be in effect, resulting in an
+     * output as it was all the time.
+     *                                                 ElB, 1999-02-24.
+     */
+
+    while (s && *s) {
+       int Space, Width;
+       int cn;
+       char *eon= strchr(s, '=');
+
+       if (eon == NULL) {
+           *errstr = stralloc2(_("invalid columnspec: "), s);
+           return -1;
+       }
+       *eon= '\0';
+       cn=StringToColumn(s);
+       if (ColumnData[cn].Name == NULL) {
+           *errstr = stralloc2(_("invalid column name: "), s);
+           return -1;
+       }
+       if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) {
+           *errstr = stralloc2(_("invalid format: "), eon + 1);
+           return -1;
+       }
+       ColumnData[cn].Width= Width;
+       ColumnData[cn].PrefixSpace = Space;
+       if (LastChar(ColumnData[cn].Format) == 's') {
+           if (Width < 0)
+               ColumnData[cn].MaxWidth= 1;
+           else
+               if (Width > ColumnData[cn].Precision)
+                   ColumnData[cn].Precision= Width;
+       }
+       else {
+           if (Width < 0) {
+               ColumnData[cn].MaxWidth= 1;
+           }
+           else if (Width < ColumnData[cn].Precision)
+               ColumnData[cn].Precision = Width;
+       }
+       s= strchr(eon+1, ',');
+       if (s != NULL)
+           s++;
+    }
+    return 0;
+}
+
diff --git a/common-src/columnar.h b/common-src/columnar.h
new file mode 100644 (file)
index 0000000..a9f54b8
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-2000 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: James da Silva, Systems Design and Analysis Group
+ *                        Computer Science Department
+ *                        University of Maryland at College Park
+ */
+/*
+ * Originally living in conffile.h, this stuff supports columnar output in amreport.
+ */
+
+#ifndef COLUMNAR_H
+#define COLUMNAR_H
+
+/* for each column we define some values on how to
+ * format this column element
+ */
+typedef struct {
+    char *Name;                /* column name */
+    int PrefixSpace;   /* the blank space to print before this
+                        * column. It is used to get the space
+                        * between the colums
+                        */
+    int Width;         /* the width of the column itself */
+    int Precision;     /* the precision if its a float */
+    int MaxWidth;      /* if set, Width will be recalculated
+                        * to the space needed */
+    char *Format;      /* the printf format string for this
+                        * column element
+                        */
+    char *Title;       /* the title to use for this column */
+} ColumnInfo;
+
+extern ColumnInfo ColumnData[];
+
+int ColumnDataCount(void);
+int StringToColumn(char *s);
+char LastChar(char *s);
+int SetColumnDataFromString(ColumnInfo* ci, char *s, char **errstr); /* (sic) */
+
+#endif /* COLUMNAR_H */
index 986d9b46bbdbdf43b7a4b50d1abb64b80bfe0ace..2cc9cba4af08b9f56fd59bea8f0c5def55f48b60 100644 (file)
 #include "conffile.h"
 #include "clock.h"
 
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef AMANDATES_FILE
-#define AMANDATES_FILE "/etc/amandates"
-#endif
+/*
+ * Lexical analysis
+ */
 
-#ifndef INT_MAX
-#define INT_MAX 2147483647
-#endif
+/* This module implements its own quixotic lexer and parser, present for historical
+ * reasons.  If this were written from scratch, it would use flex/bison. */
 
-/* this corresponds to the normal output of amanda, but may
- * be adapted to any spacing as you like.
+/* An enumeration of the various tokens that might appear in a configuration file.
+ *
+ * - CONF_UNKNOWN has special meaning as an unrecognized token.
+ * - CONF_ANY can be used to request any token, rather than requiring a specific
+ *   token.
  */
-ColumnInfo ColumnData[] = {
-    { "HostName",   0, 12, 12, 0, "%-*.*s", "HOSTNAME" },
-    { "Disk",       1, 11, 11, 0, "%-*.*s", "DISK" },
-    { "Level",      1, 1,  1,  0, "%*.*d",  "L" },
-    { "OrigKB",     1, 7,  0,  0, "%*.*lf", "ORIG-KB" },
-    { "OutKB",      1, 7,  0,  0, "%*.*lf", "OUT-KB" },
-    { "Compress",   1, 6,  1,  0, "%*.*lf", "COMP%" },
-    { "DumpTime",   1, 7,  7,  0, "%*.*s",  "MMM:SS" },
-    { "DumpRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
-    { "TapeTime",   1, 6,  6,  0, "%*.*s",  "MMM:SS" },
-    { "TapeRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
-    { NULL,         0, 0,  0,  0, NULL,     NULL }
-};
+typedef enum {
+    CONF_UNKNOWN,              CONF_ANY,               CONF_COMMA,
+    CONF_LBRACE,               CONF_RBRACE,            CONF_NL,
+    CONF_END,                  CONF_IDENT,             CONF_INT,
+    CONF_AM64,                 CONF_BOOL,              CONF_REAL,
+    CONF_STRING,               CONF_TIME,              CONF_SIZE,
+
+    /* config parameters */
+    CONF_INCLUDEFILE,          CONF_ORG,               CONF_MAILTO,
+    CONF_DUMPUSER,             CONF_TAPECYCLE,         CONF_TAPEDEV,
+    CONF_CHANGERDEV,           CONF_CHANGERFILE,       CONF_LABELSTR,
+    CONF_BUMPPERCENT,          CONF_BUMPSIZE,          CONF_BUMPDAYS,
+    CONF_BUMPMULT,             CONF_ETIMEOUT,          CONF_DTIMEOUT,
+    CONF_CTIMEOUT,             CONF_TAPEBUFS,          CONF_TAPELIST,
+    CONF_DEVICE_OUTPUT_BUFFER_SIZE,
+    CONF_DISKFILE,             CONF_INFOFILE,          CONF_LOGDIR,
+    CONF_LOGFILE,              CONF_DISKDIR,           CONF_DISKSIZE,
+    CONF_INDEXDIR,             CONF_NETUSAGE,          CONF_INPARALLEL,
+    CONF_DUMPORDER,            CONF_TIMEOUT,           CONF_TPCHANGER,
+    CONF_RUNTAPES,             CONF_DEFINE,            CONF_DUMPTYPE,
+    CONF_TAPETYPE,             CONF_INTERFACE,         CONF_PRINTER,
+    CONF_AUTOFLUSH,            CONF_RESERVE,           CONF_MAXDUMPSIZE,
+    CONF_COLUMNSPEC,           CONF_AMRECOVER_DO_FSF,  CONF_AMRECOVER_CHECK_LABEL,
+    CONF_AMRECOVER_CHANGER,    CONF_LABEL_NEW_TAPES,   CONF_USETIMESTAMPS,
+
+    CONF_TAPERALGO,            CONF_FIRST,             CONF_FIRSTFIT,
+    CONF_LARGEST,              CONF_LARGESTFIT,        CONF_SMALLEST,
+    CONF_LAST,                 CONF_DISPLAYUNIT,       CONF_RESERVED_UDP_PORT,
+    CONF_RESERVED_TCP_PORT,    CONF_UNRESERVED_TCP_PORT,
+    CONF_TAPERFLUSH,
+    CONF_FLUSH_THRESHOLD_DUMPED,
+    CONF_FLUSH_THRESHOLD_SCHEDULED,
+    CONF_DEVICE_PROPERTY,
+
+    /* kerberos 5 */
+    CONF_KRB5KEYTAB,           CONF_KRB5PRINCIPAL,
+
+    /* holding disk */
+    CONF_COMMENT,              CONF_DIRECTORY,         CONF_USE,
+    CONF_CHUNKSIZE,
+
+    /* dump type */
+    /*COMMENT,*/               CONF_PROGRAM,           CONF_DUMPCYCLE,
+    CONF_RUNSPERCYCLE,         CONF_MAXCYCLE,          CONF_MAXDUMPS,
+    CONF_OPTIONS,              CONF_PRIORITY,          CONF_FREQUENCY,
+    CONF_INDEX,                        CONF_MAXPROMOTEDAY,     CONF_STARTTIME,
+    CONF_COMPRESS,             CONF_ENCRYPT,           CONF_AUTH,
+    CONF_STRATEGY,             CONF_ESTIMATE,          CONF_SKIP_INCR,
+    CONF_SKIP_FULL,            CONF_RECORD,            CONF_HOLDING,
+    CONF_EXCLUDE,              CONF_INCLUDE,           CONF_KENCRYPT,
+    CONF_IGNORE,               CONF_COMPRATE,          CONF_TAPE_SPLITSIZE,
+    CONF_SPLIT_DISKBUFFER,     CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG,
+    CONF_CLNTCOMPPROG,         CONF_SRV_ENCRYPT,       CONF_CLNT_ENCRYPT,
+    CONF_SRV_DECRYPT_OPT,      CONF_CLNT_DECRYPT_OPT,  CONF_AMANDAD_PATH,
+    CONF_CLIENT_USERNAME,
+
+    /* tape type */
+    /*COMMENT,*/               CONF_BLOCKSIZE,         CONF_FILE_PAD,
+    CONF_LBL_TEMPL,            CONF_FILEMARK,          CONF_LENGTH,
+    CONF_SPEED,                        CONF_READBLOCKSIZE,
+
+    /* client conf */
+    CONF_CONF,                 CONF_INDEX_SERVER,      CONF_TAPE_SERVER,
+    CONF_SSH_KEYS,             CONF_GNUTAR_LIST_DIR,   CONF_AMANDATES,
+
+    /* protocol config */
+    CONF_REP_TRIES,            CONF_CONNECT_TRIES,     CONF_REQ_TRIES,
+
+    /* debug config */
+    CONF_DEBUG_AMANDAD,                CONF_DEBUG_AMIDXTAPED,  CONF_DEBUG_AMINDEXD,
+    CONF_DEBUG_AMRECOVER,      CONF_DEBUG_AUTH,        CONF_DEBUG_EVENT,
+    CONF_DEBUG_HOLDING,                CONF_DEBUG_PROTOCOL,    CONF_DEBUG_PLANNER,
+    CONF_DEBUG_DRIVER,         CONF_DEBUG_DUMPER,      CONF_DEBUG_CHUNKER,
+    CONF_DEBUG_TAPER,          CONF_DEBUG_SELFCHECK,   CONF_DEBUG_SENDSIZE,
+    CONF_DEBUG_SENDBACKUP,
+
+    /* network interface */
+    /* COMMENT, */             /* USE, */
+
+    /* dump options (obsolete) */
+    CONF_EXCLUDE_FILE,         CONF_EXCLUDE_LIST,
+
+    /* compress, estimate, encryption */
+    CONF_NONE,                 CONF_FAST,              CONF_BEST,
+    CONF_SERVER,               CONF_CLIENT,            CONF_CALCSIZE,
+    CONF_CUSTOM,
+
+    /* holdingdisk */
+    CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
+
+    /* priority */
+    CONF_LOW,                  CONF_MEDIUM,            CONF_HIGH,
+
+    /* dump strategy */
+    CONF_SKIP,                 CONF_STANDARD,          CONF_NOFULL,
+    CONF_NOINC,                        CONF_HANOI,             CONF_INCRONLY,
+
+    /* exclude list */
+    CONF_LIST,                 CONF_EFILE,             CONF_APPEND,
+    CONF_OPTIONAL,
+
+    /* numbers */
+    CONF_AMINFINITY,           CONF_MULT1,             CONF_MULT7,
+    CONF_MULT1K,               CONF_MULT1M,            CONF_MULT1G,
+
+    /* boolean */
+    CONF_ATRUE,                        CONF_AFALSE
+} tok_t;
+
+/* A keyword table entry, mapping the given keyword to the given token.
+ * Note that punctuation, integers, and quoted strings are handled 
+ * internally to the lexer, so they do not appear here. */
+typedef struct {
+    char *keyword;
+    tok_t token;
+} keytab_t;
+
+/* The current keyword table, used by all token-related functions */
+static keytab_t *keytable = NULL;
 
-char *config_name = NULL;
-char *config_dir = NULL;
+/* Has a token been "ungotten", and if so, what was it? */
+static int token_pushed;
+static tok_t pushed_tok;
 
-int debug_amandad    = 0;
-int debug_amidxtaped = 0;
-int debug_amindexd   = 0;
-int debug_amrecover  = 0;
-int debug_auth       = 0;
-int debug_event      = 0;
-int debug_holding    = 0;
-int debug_protocol   = 0;
-int debug_planner    = 0;
-int debug_driver     = 0;
-int debug_dumper     = 0;
-int debug_chunker    = 0;
-int debug_taper      = 0;
-int debug_selfcheck  = 0;
-int debug_sendsize   = 0;
-int debug_sendbackup = 0;
+/* The current token and its value.  Note that, unlike most other val_t*,
+ * tokenval's v.s points to statically allocated memory which cannot be
+ * free()'d. */
+static tok_t tok;
+static val_t tokenval;
 
-/* visible holding disk variables */
+/* The current input information: file, filename, line, and character 
+ * (which points somewhere within current_line) */
+static FILE *current_file = NULL;
+static char *current_filename = NULL;
+static char *current_line = NULL;
+static char *current_char = NULL;
+static int current_line_num = 0; /* (technically, managed by the parser) */
 
-holdingdisk_t *holdingdisks;
-int num_holdingdisks;
+/* A static buffer for storing tokens while they are being scanned. */
+static char tkbuf[4096];
 
-long int unit_divisor = 1;
+/* Look up the name of the given token in the current keytable */
+static char *get_token_name(tok_t);
 
-/* configuration parameters */
+/* Look up a token in keytable, given a string, returning CONF_UNKNOWN 
+ * for unrecognized strings.  Search is case-insensitive. */
+static tok_t lookup_keyword(char *str);
 
-val_t conf_data[CNF_CNF];
-int conffile_init = 0;
+/* Get the next token.  If exp is anything but CONF_ANY, and the next token
+ * does not match, then a parse error is flagged.  This function reads from the
+ * current_* static variables, recognizes keywords against the keytable static
+ * variable, and places its result in tok and tokenval. */
+static void get_conftoken(tok_t exp);
 
-command_option_t *program_options      = NULL;
-int               program_options_size = 0;
+/* "Unget" the current token; this supports a 1-token lookahead. */
+static void unget_conftoken(void);
 
-/* other internal variables */
-static holdingdisk_t hdcur;
+/* Tokenizer character-by-character access. */
+static int  conftoken_getc(void);
+static int  conftoken_ungetc(int c);
 
-static tapetype_t tpcur;
+/*
+ * Parser
+ */
 
-static dumptype_t dpcur;
+/* A parser table entry.  Read as "<token> introduces parameter <parm>,
+ * the data for which will be read by <read_function> and validated by
+ * <validate_function> (if not NULL).  <type> is only used in formatting 
+ * config overwrites. */
+typedef struct conf_var_s {
+    tok_t      token;
+    conftype_t type;
+    void       (*read_function) (struct conf_var_s *, val_t*);
+    int                parm;
+    void       (*validate_function) (struct conf_var_s *, val_t *);
+} conf_var_t;
+
+/* If allow_overwrites is true, the a parameter which has already been
+ * seen will simply overwrite the old value, rather than triggering an 
+ * error.  Note that this does not apply to all parameters, e.g., 
+ * device_property */
+static int allow_overwrites;
 
-static interface_t ifcur;
+/* subsection structs
+ *
+ * The 'seen' fields in these structs are useless outside this module;
+ * they are only used to generate error messages for multiply defined
+ * subsections.
+ */
+struct tapetype_s {
+    struct tapetype_s *next;
+    int seen;
+    char *name;
 
-static dumptype_t *dumplist = NULL;
-static tapetype_t *tapelist = NULL;
-static interface_t *interface_list = NULL;
+    val_t value[TAPETYPE_TAPETYPE];
+};
 
-static int allow_overwrites;
-static int token_pushed;
-static tok_t tok, pushed_tok;
-static val_t tokenval;
+struct dumptype_s {
+    struct dumptype_s *next;
+    int seen;
+    char *name;
 
-static int conf_line_num;
-static int got_parserror;
-static FILE *conf_conf = (FILE *)NULL;
-static char *conf_confname = NULL;
-static char *conf_line = NULL;
-static char *conf_char = NULL;
-static keytab_t *keytable = NULL;
+    val_t value[DUMPTYPE_DUMPTYPE];
+};
 
-/* predeclare local functions */
+struct interface_s {
+    struct interface_s *next;
+    int seen;
+    char *name;
 
-char *get_token_name(tok_t);
+    val_t value[INTER_INTER];
+};
 
+struct holdingdisk_s {
+    struct holdingdisk_s *next;
+    int seen;
+    char *name;
 
-static void validate_positive0            (t_conf_var *, val_t *);
-static void validate_positive1            (t_conf_var *, val_t *);
-static void validate_runspercycle         (t_conf_var *, val_t *);
-static void validate_bumppercent          (t_conf_var *, val_t *);
-static void validate_bumpmult             (t_conf_var *, val_t *);
-static void validate_inparallel           (t_conf_var *, val_t *);
-static void validate_displayunit          (t_conf_var *, val_t *);
-static void validate_reserve              (t_conf_var *, val_t *);
-static void validate_use                  (t_conf_var *, val_t *);
-static void validate_chunksize            (t_conf_var *, val_t *);
-static void validate_blocksize            (t_conf_var *, val_t *);
-static void validate_debug                (t_conf_var *, val_t *);
-static void validate_reserved_port_range  (t_conf_var *, val_t *);
-static void validate_unreserved_port_range(t_conf_var *, val_t *);
+    val_t value[HOLDING_HOLDING];
+};
 
-/*static t_conf_var  *get_np(t_conf_var *get_var, int parm);*/
-static int     get_int(void);
-/*static long    get_long(void);*/
-static time_t  get_time(void);
-static ssize_t get_size(void);
-static off_t   get_am64_t(void);
-static int     get_bool(void);
-static void    ckseen(int *seen);
-static void    conf_parserror(const char *format, ...)
-                __attribute__ ((format (printf, 1, 2)));
-static tok_t   lookup_keyword(char *str);
-
-static void read_string(t_conf_var *, val_t *);
-static void read_ident(t_conf_var *, val_t *);
-static void read_int(t_conf_var *, val_t *);
-/*static void read_long(t_conf_var *, val_t *);*/
-static void read_size(t_conf_var *, val_t *);
-static void read_am64(t_conf_var *, val_t *);
-static void read_bool(t_conf_var *, val_t *);
-static void read_real(t_conf_var *, val_t *);
-static void read_time(t_conf_var *, val_t *);
-static void read_intrange(t_conf_var *, val_t *);
-static void conf_init_string(val_t *, char *);
-static void conf_init_ident(val_t *, char *);
-static void conf_init_int(val_t *, int);
-static void conf_init_bool(val_t *, int);
-static void conf_init_strategy(val_t *, int);
-static void conf_init_estimate(val_t *, int);
-static void conf_init_taperalgo(val_t *, int);
-static void conf_init_priority(val_t *, int);
-static void conf_init_strategy(val_t *, int);
-static void conf_init_compress(val_t *, comp_t);
-static void conf_init_encrypt(val_t *, encrypt_t);
-static void conf_init_holding(val_t *, dump_holdingdisk_t);
-/*static void conf_init_long(val_t *, long);*/
-static void conf_init_size(val_t *, ssize_t);
-static void conf_init_am64(val_t *, off_t);
-static void conf_init_real(val_t *, double);
-static void conf_init_rate(val_t *, double, double);
-static void conf_init_intrange(val_t *, int, int);
-static void conf_init_time(val_t *, time_t);
-/*static void conf_init_sl(val_t *, sl_t *);*/
-static void conf_init_exinclude(val_t *);
-static void conf_set_string(val_t *, char *);
-/*static void conf_set_int(val_t *, int);*/
-static void conf_set_bool(val_t *, int);
-static void conf_set_compress(val_t *, comp_t);
-/*static void conf_set_encrypt(val_t *, encrypt_t);*/
-static void conf_set_holding(val_t *, dump_holdingdisk_t);
-static void conf_set_strategy(val_t *, int);
+/* The current parser table */
+static conf_var_t *parsetable = NULL;
 
-static void init_defaults(void);
-static void read_conffile_recursively(char *filename);
-static void read_client_conffile_recursively(char *filename);
+/* Read and parse a configuration file, recursively reading any included
+ * files.  This function sets the keytable and parsetable appropriately
+ * according to is_client.
+ *
+ * @param filename: configuration file to read
+ * @param is_client: true if this is a client
+ * @returns: false if an error occurred
+ */
+static gboolean read_conffile(char *filename,
+                             gboolean is_client);
+
+/* Read and process a line of input from the current file, using the 
+ * current keytable and parsetable.  For blocks, this recursively
+ * reads the entire block.
+ *
+ * @param is_client: true if this is a client
+ * @returns: true on success, false on EOF or error
+ */
+static gboolean read_confline(gboolean is_client);
 
-static int read_confline(void);
-static int read_client_confline(void);
+/* Handle an invalid token, by issuing a warning or an error, depending
+ * on how long the token has been deprecated.
+ *
+ * @param token: the identifier
+ */
+static void handle_invalid_keyword(const char * token);
 
-static void read_block(command_option_t *command_options, t_conf_var *read_var,
-                       keytab_t *keytab, val_t *valarray, char *prefix,
+/* Read a brace-delimited block using the given parse table.  This
+ * function is used to read brace-delimited subsections in the config
+ * files and also (via read_dumptype) to read dumptypes from
+ * the disklist.
+ *
+ * This function implements "inheritance" as follows: if a bare
+ * identifier occurs within the braces, it calls copy_function (if
+ * not NULL), which looks up an existing subsection using the
+ * identifier from tokenval and copies any values not already seen
+ * into valarray.
+ *
+ * @param read_var: the parse table to use
+ * @param valarray: the (pre-initialized) val_t array to fill in
+ * @param errormsg: error message to display for unrecognized keywords
+ * @param read_brace: if true, read the opening brace
+ * @param copy_function: function to copy configuration from
+ *     another subsection into this one.
+ */
+static void read_block(conf_var_t *read_var, val_t *valarray, 
                       char *errormsg, int read_brace,
                       void (*copy_function)(void));
 
-static void copy_val_t(val_t *, val_t *);
-static void free_val_t(val_t *);
-static char *conf_print(val_t *, int, char *);
-static void conf_print_exinclude(val_t *, int, int, char *prefix, char **buf, int *free_space);
-
+/* For each subsection type, we have a global and  four functions:
+ *  - foocur is a temporary struct used to assemble new subsections
+ *  - get_foo is called after reading "DEFINE FOO", and
+ *    is responsible for reading the entire block, using
+ *    read_block()
+ *  - init_foo_defaults initializes a new subsection struct
+ *    to its default values
+ *  - save_foo copies foocur to a newly allocated struct and
+ *    inserts that into the relevant list.
+ *  - copy_foo implements inheritance as described in read_block()
+ */
+static holdingdisk_t hdcur;
 static void get_holdingdisk(void);
 static void init_holdingdisk_defaults(void);
 static void save_holdingdisk(void);
+/* (holdingdisks don't support inheritance) */
+
+static dumptype_t dpcur;
 static void get_dumptype(void);
 static void init_dumptype_defaults(void);
 static void save_dumptype(void);
 static void copy_dumptype(void);
+
+static tapetype_t tpcur;
 static void get_tapetype(void);
 static void init_tapetype_defaults(void);
 static void save_tapetype(void);
 static void copy_tapetype(void);
+
+static interface_t ifcur;
 static void get_interface(void);
 static void init_interface_defaults(void);
 static void save_interface(void);
 static void copy_interface(void);
-static void get_comprate(t_conf_var *, val_t *);
-static void get_compress(t_conf_var *, val_t *);
-static void get_encrypt (t_conf_var *, val_t *);
-static void get_holding (t_conf_var *, val_t *);
-static void get_priority(t_conf_var *, val_t *);
-static void get_strategy(t_conf_var *, val_t *);
-static void get_estimate(t_conf_var *, val_t *);
-static void get_exclude (t_conf_var *, val_t *);
-/*static void get_include(t_conf_var *, val_t *);*/
-static void get_taperalgo(t_conf_var *, val_t *);
 
-static int  conftoken_getc(void);
-static int  conftoken_ungetc(int c);
-static void unget_conftoken(void);
-static void get_conftoken(tok_t exp);
+/* read_functions -- these fit into the read_function slot in a parser
+ * table entry, and are responsible for calling getconf_token as necessary
+ * to consume their arguments, and setting their second argument with the
+ * result.  The first argument is a copy of the parser table entry, if
+ * needed. */
+static void read_int(conf_var_t *, val_t *);
+static void read_am64(conf_var_t *, val_t *);
+static void read_real(conf_var_t *, val_t *);
+static void read_str(conf_var_t *, val_t *);
+static void read_ident(conf_var_t *, val_t *);
+static void read_time(conf_var_t *, val_t *);
+static void read_size(conf_var_t *, val_t *);
+static void read_bool(conf_var_t *, val_t *);
+static void read_compress(conf_var_t *, val_t *);
+static void read_encrypt(conf_var_t *, val_t *);
+static void read_holding(conf_var_t *, val_t *);
+static void read_estimate(conf_var_t *, val_t *);
+static void read_strategy(conf_var_t *, val_t *);
+static void read_taperalgo(conf_var_t *, val_t *);
+static void read_priority(conf_var_t *, val_t *);
+static void read_rate(conf_var_t *, val_t *);
+static void read_exinclude(conf_var_t *, val_t *);
+static void read_intrange(conf_var_t *, val_t *);
+static void read_property(conf_var_t *, val_t *);
+
+/* Functions to get various types of values.  These are called by
+ * read_functions to take care of any variations in the way that these
+ * values can be written: integers can have units, boolean values can be
+ * specified with a number of names, etc.  They form utility functions
+ * for the read_functions, below. */
+static time_t  get_time(void);
+static int     get_int(void);
+static ssize_t get_size(void);
+static off_t   get_am64_t(void);
+static int     get_bool(void);
+
+/* Check the given 'seen', flagging an error if this value has already
+ * been seen and allow_overwrites is false.  Also marks the value as
+ * seen on the current line.
+ *
+ * @param seen: (in/out) seen value to adjust
+ */
+static void ckseen(int *seen);
+
+/* validate_functions -- these fit into the validate_function solt in
+ * a parser table entry.  They call conf_parserror if the value in their
+ * second argument is invalid.  */
+static void validate_nonnegative(conf_var_t *, val_t *);
+static void validate_positive(conf_var_t *, val_t *);
+static void validate_runspercycle(conf_var_t *, val_t *);
+static void validate_bumppercent(conf_var_t *, val_t *);
+static void validate_bumpmult(conf_var_t *, val_t *);
+static void validate_inparallel(conf_var_t *, val_t *);
+static void validate_displayunit(conf_var_t *, val_t *);
+static void validate_reserve(conf_var_t *, val_t *);
+static void validate_use(conf_var_t *, val_t *);
+static void validate_chunksize(conf_var_t *, val_t *);
+static void validate_blocksize(conf_var_t *, val_t *);
+static void validate_debug(conf_var_t *, val_t *);
+static void validate_port_range(val_t *, int, int);
+static void validate_reserved_port_range(conf_var_t *, val_t *);
+static void validate_unreserved_port_range(conf_var_t *, val_t *);
+
+/*
+ * Initialization
+ */
+
+/* Name of the current configuration (part of API) */
+char *config_name = NULL;
+
+/* Current configuration directory (part of API) */
+char *config_dir = NULL;
+
+/* Current toplevel configuration file (part of API) */
+char *config_filename = NULL;
+
+/* Has the config been initialized? */
+static gboolean config_initialized = FALSE;
+
+/* Are we running a client? (true if last init was
+ * with CONFIG_INIT_CLIENT) */
+static gboolean config_client = FALSE;
+
+/* What config overwrites are applied? */
+static config_overwrites_t *applied_config_overwrites = NULL;
+
+/* All global parameters */
+static val_t conf_data[CNF_CNF];
+
+/* Linked list of holding disks */
+static holdingdisk_t *holdinglist = NULL;
+static dumptype_t *dumplist = NULL;
+static tapetype_t *tapelist = NULL;
+static interface_t *interface_list = NULL;
+
+/* storage for derived values */
+static long int unit_divisor = 1;
+
+int debug_amandad    = 0;
+int debug_amidxtaped = 0;
+int debug_amindexd   = 0;
+int debug_amrecover  = 0;
+int debug_auth       = 0;
+int debug_event      = 0;
+int debug_holding    = 0;
+int debug_protocol   = 0;
+int debug_planner    = 0;
+int debug_driver     = 0;
+int debug_dumper     = 0;
+int debug_chunker    = 0;
+int debug_taper      = 0;
+int debug_selfcheck  = 0;
+int debug_sendsize   = 0;
+int debug_sendbackup = 0;
 
-keytab_t   *my_keytab = NULL;
-t_conf_var *my_var = NULL;
+/* Reset all configuration values to their defaults (which, in many
+ * cases, come from --with-foo options at build time) */
+static void init_defaults(void);
+
+/* Update all dervied values based on the current configuration.  This
+ * function can be called multiple times, once after each adjustment
+ * to the current configuration.
+ *
+ * @param is_client: are we running a client?
+ */
+static void update_derived_values(gboolean is_client);
+
+/* per-type conf_init functions, used as utilities for init_defaults
+ * and for each subsection's init_foo_defaults.
+ *
+ * These set the value's type and seen flags, as well as copying
+ * the relevant value into the 'v' field.
+ */
+static void conf_init_int(val_t *val, int i);
+static void conf_init_am64(val_t *val, off_t l);
+static void conf_init_real(val_t *val, float r);
+static void conf_init_str(val_t *val, char *s);
+static void conf_init_ident(val_t *val, char *s);
+static void conf_init_time(val_t *val, time_t t);
+static void conf_init_size(val_t *val, ssize_t sz);
+static void conf_init_bool(val_t *val, int i);
+static void conf_init_compress(val_t *val, comp_t i);
+static void conf_init_encrypt(val_t *val, encrypt_t i);
+static void conf_init_holding(val_t *val, dump_holdingdisk_t i);
+static void conf_init_estimate(val_t *val, estimate_t i);
+static void conf_init_strategy(val_t *val, strategy_t);
+static void conf_init_taperalgo(val_t *val, taperalgo_t i);
+static void conf_init_priority(val_t *val, int i);
+static void conf_init_rate(val_t *val, float r1, float r2);
+static void conf_init_exinclude(val_t *val); /* to empty list */
+static void conf_init_intrange(val_t *val, int i1, int i2);
+static void conf_init_proplist(val_t *val); /* to empty list */
+
+/*
+ * Command-line Handling
+ */
+
+typedef struct config_overwrite_s {
+    char *key;
+    char *value;
+} config_overwrite_t;
+
+struct config_overwrites_s {
+    int n_allocated;
+    int n_used;
+    config_overwrite_t *ovr;
+};
+
+/*
+ * val_t Management
+ */
+
+static void copy_val_t(val_t *, val_t *);
+static void free_val_t(val_t *);
+
+/*
+ * Utilities
+ */
+
+
+/* Utility functions/structs for val_t_display_strs */
+static char *exinclude_display_str(val_t *val, int file);
+static void proplist_display_str_foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p);
+static void val_t_print_token(FILE *output, char *prefix, char *format, keytab_t *kt, val_t *val);
+
+/* Given a key name as used in config overwrites, return a pointer to the corresponding
+ * conf_var_t in the current parsetable, and the val_t representing that value.  This
+ * function will access subsections if key has the form  TYPE:SUBSEC:KEYWORD.  Returns
+ * false if the value does not exist.
+ *
+ * Assumes keytable and parsetable are set correctly, which is generally OK after 
+ * config_init has been called.
+ *
+ * @param key: the key to look up
+ * @param parm: (result) the parse table entry
+ * @param val: (result) the parameter value
+ * @returns: true on success
+ */
+static int parm_key_info(char *key, conf_var_t **parm, val_t **val);
+
+/*
+ * Error handling
+ */
+
+/* Have we seen a parse error yet?  Parsing continues after an error, so this
+ * flag is checked after the parse is complete.
+ */
+static gboolean got_parserror;
+
+static void    conf_parserror(const char *format, ...)
+                __attribute__ ((format (printf, 1, 2)));
+
+static void    conf_parswarn(const char *format, ...)
+                __attribute__ ((format (printf, 1, 2)));
+
+/*
+ * Tables
+ */
 
+/* First, the keyword tables for client and server */
 keytab_t client_keytab[] = {
     { "CONF", CONF_CONF },
     { "INDEX_SERVER", CONF_INDEX_SERVER },
     { "TAPE_SERVER", CONF_TAPE_SERVER },
     { "TAPEDEV", CONF_TAPEDEV },
+    { "DEVICE-PROPERTY", CONF_DEVICE_PROPERTY },
     { "AUTH", CONF_AUTH },
     { "SSH_KEYS", CONF_SSH_KEYS },
     { "AMANDAD_PATH", CONF_AMANDAD_PATH },
@@ -281,46 +611,12 @@ keytab_t client_keytab[] = {
     { "DEBUG_SELFCHECK", CONF_DEBUG_SELFCHECK },
     { "DEBUG_SENDSIZE", CONF_DEBUG_SENDSIZE },
     { "DEBUG_SENDBACKUP", CONF_DEBUG_SENDBACKUP },
+    { "RESERVED-UDP-PORT", CONF_RESERVED_UDP_PORT },
+    { "RESERVED-TCP-PORT", CONF_RESERVED_TCP_PORT },
     { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT },
     { NULL, CONF_UNKNOWN },
 };
 
-t_conf_var client_var [] = {
-   { CONF_CONF               , CONFTYPE_STRING  , read_string  , CNF_CONF               , NULL },
-   { CONF_INDEX_SERVER       , CONFTYPE_STRING  , read_string  , CNF_INDEX_SERVER       , NULL },
-   { CONF_TAPE_SERVER        , CONFTYPE_STRING  , read_string  , CNF_TAPE_SERVER        , NULL },
-   { CONF_TAPEDEV            , CONFTYPE_STRING  , read_string  , CNF_TAPEDEV            , NULL },
-   { CONF_AUTH               , CONFTYPE_STRING  , read_string  , CNF_AUTH               , NULL },
-   { CONF_SSH_KEYS           , CONFTYPE_STRING  , read_string  , CNF_SSH_KEYS           , NULL },
-   { CONF_AMANDAD_PATH       , CONFTYPE_STRING  , read_string  , CNF_AMANDAD_PATH       , NULL },
-   { CONF_CLIENT_USERNAME    , CONFTYPE_STRING  , read_string  , CNF_CLIENT_USERNAME    , NULL },
-   { CONF_GNUTAR_LIST_DIR    , CONFTYPE_STRING  , read_string  , CNF_GNUTAR_LIST_DIR    , NULL },
-   { CONF_AMANDATES          , CONFTYPE_STRING  , read_string  , CNF_AMANDATES          , NULL },
-   { CONF_KRB5KEYTAB         , CONFTYPE_STRING  , read_string  , CNF_KRB5KEYTAB         , NULL },
-   { CONF_KRB5PRINCIPAL      , CONFTYPE_STRING  , read_string  , CNF_KRB5PRINCIPAL      , NULL },
-   { CONF_CONNECT_TRIES      , CONFTYPE_INT     , read_int     , CNF_CONNECT_TRIES      , validate_positive1 },
-   { CONF_REP_TRIES          , CONFTYPE_INT     , read_int     , CNF_REP_TRIES          , validate_positive1 },
-   { CONF_REQ_TRIES          , CONFTYPE_INT     , read_int     , CNF_REQ_TRIES          , validate_positive1 },
-   { CONF_DEBUG_AMANDAD      , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMANDAD      , validate_debug },
-   { CONF_DEBUG_AMIDXTAPED   , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMIDXTAPED   , validate_debug },
-   { CONF_DEBUG_AMINDEXD     , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMINDEXD     , validate_debug },
-   { CONF_DEBUG_AMRECOVER    , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMRECOVER    , validate_debug },
-   { CONF_DEBUG_AUTH         , CONFTYPE_INT     , read_int     , CNF_DEBUG_AUTH         , validate_debug },
-   { CONF_DEBUG_EVENT        , CONFTYPE_INT     , read_int     , CNF_DEBUG_EVENT        , validate_debug },
-   { CONF_DEBUG_HOLDING      , CONFTYPE_INT     , read_int     , CNF_DEBUG_HOLDING      , validate_debug },
-   { CONF_DEBUG_PROTOCOL     , CONFTYPE_INT     , read_int     , CNF_DEBUG_PROTOCOL     , validate_debug },
-   { CONF_DEBUG_PLANNER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_PLANNER      , validate_debug },
-   { CONF_DEBUG_DRIVER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DRIVER       , validate_debug },
-   { CONF_DEBUG_DUMPER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DUMPER       , validate_debug },
-   { CONF_DEBUG_CHUNKER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_CHUNKER      , validate_debug },
-   { CONF_DEBUG_TAPER        , CONFTYPE_INT     , read_int     , CNF_DEBUG_TAPER        , validate_debug },
-   { CONF_DEBUG_SELFCHECK    , CONFTYPE_INT     , read_int     , CNF_DEBUG_SELFCHECK    , validate_debug },
-   { CONF_DEBUG_SENDSIZE     , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDSIZE     , validate_debug },
-   { CONF_DEBUG_SENDBACKUP   , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDBACKUP   , validate_debug },
-   { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range },
-   { CONF_UNKNOWN            , CONFTYPE_INT     , NULL         , CNF_CNF                , NULL }
-};
-
 keytab_t server_keytab[] = {
     { "AMANDAD_PATH", CONF_AMANDAD_PATH },
     { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER },
@@ -337,8 +633,8 @@ keytab_t server_keytab[] = {
     { "BUMPPERCENT", CONF_BUMPPERCENT },
     { "BUMPSIZE", CONF_BUMPSIZE },
     { "CALCSIZE", CONF_CALCSIZE },
-    { "CHANGERDEV", CONF_CHNGRDEV },
-    { "CHANGERFILE", CONF_CHNGRFILE },
+    { "CHANGERDEV", CONF_CHANGERDEV },
+    { "CHANGERFILE", CONF_CHANGERFILE },
     { "CHUNKSIZE", CONF_CHUNKSIZE },
     { "CLIENT", CONF_CLIENT },
     { "CLIENT_CUSTOM_COMPRESS", CONF_CLNTCOMPPROG },
@@ -369,6 +665,7 @@ keytab_t server_keytab[] = {
     { "DEBUG_SENDSIZE"   , CONF_DEBUG_SENDSIZE },
     { "DEBUG_SENDBACKUP" , CONF_DEBUG_SENDBACKUP },
     { "DEFINE", CONF_DEFINE },
+    { "DEVICE_PROPERTY", CONF_DEVICE_PROPERTY },
     { "DIRECTORY", CONF_DIRECTORY },
     { "DISKFILE", CONF_DISKFILE },
     { "DISPLAYUNIT", CONF_DISPLAYUNIT },
@@ -421,7 +718,7 @@ keytab_t server_keytab[] = {
     { "MAXDUMPSIZE", CONF_MAXDUMPSIZE },
     { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
     { "MEDIUM", CONF_MEDIUM },
-    { "NETUSAGE", CONF_NETUSAGE },     /* XXX - historical */
+    { "NETUSAGE", CONF_NETUSAGE },
     { "NEVER", CONF_NEVER },
     { "NOFULL", CONF_NOFULL },
     { "NOINC", CONF_NOINC },
@@ -431,7 +728,6 @@ keytab_t server_keytab[] = {
     { "PRINTER", CONF_PRINTER },
     { "PRIORITY", CONF_PRIORITY },
     { "PROGRAM", CONF_PROGRAM },
-    { "RAWTAPEDEV", CONF_RAWTAPEDEV },
     { "RECORD", CONF_RECORD },
     { "REP_TRIES", CONF_REP_TRIES },
     { "REQ_TRIES", CONF_REQ_TRIES },
@@ -456,10 +752,14 @@ keytab_t server_keytab[] = {
     { "STARTTIME", CONF_STARTTIME },
     { "STRATEGY", CONF_STRATEGY },
     { "TAPEBUFS", CONF_TAPEBUFS },
+    { "DEVICE_OUTPUT_BUFFER_SIZE", CONF_DEVICE_OUTPUT_BUFFER_SIZE },
     { "TAPECYCLE", CONF_TAPECYCLE },
     { "TAPEDEV", CONF_TAPEDEV },
     { "TAPELIST", CONF_TAPELIST },
     { "TAPERALGO", CONF_TAPERALGO },
+    { "FLUSH-THRESHOLD-DUMPED", CONF_FLUSH_THRESHOLD_DUMPED },
+    { "FLUSH-THRESHOLD-SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED },
+    { "TAPERFLUSH", CONF_TAPERFLUSH },
     { "TAPETYPE", CONF_TAPETYPE },
     { "TAPE_SPLITSIZE", CONF_TAPE_SPLITSIZE },
     { "TPCHANGER", CONF_TPCHANGER },
@@ -470,1097 +770,683 @@ keytab_t server_keytab[] = {
     { NULL, CONF_UNKNOWN }
 };
 
-t_conf_var server_var [] = {
-   { CONF_ORG                  , CONFTYPE_STRING   , read_string  , CNF_ORG                  , NULL },
-   { CONF_MAILTO               , CONFTYPE_STRING   , read_string  , CNF_MAILTO               , NULL },
-   { CONF_DUMPUSER             , CONFTYPE_STRING   , read_string  , CNF_DUMPUSER             , NULL },
-   { CONF_PRINTER              , CONFTYPE_STRING   , read_string  , CNF_PRINTER              , NULL },
-   { CONF_TAPEDEV              , CONFTYPE_STRING   , read_string  , CNF_TAPEDEV              , NULL },
-   { CONF_TPCHANGER            , CONFTYPE_STRING   , read_string  , CNF_TPCHANGER            , NULL },
-   { CONF_CHNGRDEV             , CONFTYPE_STRING   , read_string  , CNF_CHNGRDEV             , NULL },
-   { CONF_CHNGRFILE            , CONFTYPE_STRING   , read_string  , CNF_CHNGRFILE            , NULL },
-   { CONF_LABELSTR             , CONFTYPE_STRING   , read_string  , CNF_LABELSTR             , NULL },
-   { CONF_TAPELIST             , CONFTYPE_STRING   , read_string  , CNF_TAPELIST             , NULL },
-   { CONF_DISKFILE             , CONFTYPE_STRING   , read_string  , CNF_DISKFILE             , NULL },
-   { CONF_INFOFILE             , CONFTYPE_STRING   , read_string  , CNF_INFOFILE             , NULL },
-   { CONF_LOGDIR               , CONFTYPE_STRING   , read_string  , CNF_LOGDIR               , NULL },
-   { CONF_INDEXDIR             , CONFTYPE_STRING   , read_string  , CNF_INDEXDIR             , NULL },
-   { CONF_TAPETYPE             , CONFTYPE_IDENT    , read_ident   , CNF_TAPETYPE             , NULL },
-   { CONF_DUMPCYCLE            , CONFTYPE_INT      , read_int     , CNF_DUMPCYCLE            , validate_positive0 },
-   { CONF_RUNSPERCYCLE         , CONFTYPE_INT      , read_int     , CNF_RUNSPERCYCLE         , validate_runspercycle },
-   { CONF_RUNTAPES             , CONFTYPE_INT      , read_int     , CNF_RUNTAPES             , validate_positive0 },
-   { CONF_TAPECYCLE            , CONFTYPE_INT      , read_int     , CNF_TAPECYCLE            , validate_positive1 },
-   { CONF_BUMPDAYS             , CONFTYPE_INT      , read_int     , CNF_BUMPDAYS             , validate_positive1 },
-   { CONF_BUMPSIZE             , CONFTYPE_AM64     , read_am64    , CNF_BUMPSIZE             , validate_positive1 },
-   { CONF_BUMPPERCENT          , CONFTYPE_INT      , read_int     , CNF_BUMPPERCENT          , validate_bumppercent },
-   { CONF_BUMPMULT             , CONFTYPE_REAL     , read_real    , CNF_BUMPMULT             , validate_bumpmult },
-   { CONF_NETUSAGE             , CONFTYPE_INT      , read_int     , CNF_NETUSAGE             , validate_positive1 },
-   { CONF_INPARALLEL           , CONFTYPE_INT      , read_int     , CNF_INPARALLEL           , validate_inparallel },
-   { CONF_DUMPORDER            , CONFTYPE_STRING   , read_string  , CNF_DUMPORDER            , NULL },
-   { CONF_MAXDUMPS             , CONFTYPE_INT      , read_int     , CNF_MAXDUMPS             , validate_positive1 },
-   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int     , CNF_ETIMEOUT             , NULL },
-   { CONF_DTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_DTIMEOUT             , validate_positive1 },
-   { CONF_CTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_CTIMEOUT             , validate_positive1 },
-   { CONF_TAPEBUFS             , CONFTYPE_INT      , read_int     , CNF_TAPEBUFS             , validate_positive1 },
-   { CONF_RAWTAPEDEV           , CONFTYPE_STRING   , read_string  , CNF_RAWTAPEDEV           , NULL },
-   { CONF_COLUMNSPEC           , CONFTYPE_STRING   , read_string  , CNF_COLUMNSPEC           , NULL },
-   { CONF_TAPERALGO            , CONFTYPE_TAPERALGO, get_taperalgo, CNF_TAPERALGO            , NULL },
-   { CONF_DISPLAYUNIT          , CONFTYPE_STRING   , read_string  , CNF_DISPLAYUNIT          , validate_displayunit },
-   { CONF_AUTOFLUSH            , CONFTYPE_BOOL     , read_bool    , CNF_AUTOFLUSH            , NULL },
-   { CONF_RESERVE              , CONFTYPE_INT      , read_int     , CNF_RESERVE              , validate_reserve },
-   { CONF_MAXDUMPSIZE          , CONFTYPE_AM64     , read_am64    , CNF_MAXDUMPSIZE          , NULL },
-   { CONF_KRB5KEYTAB           , CONFTYPE_STRING   , read_string  , CNF_KRB5KEYTAB           , NULL },
-   { CONF_KRB5PRINCIPAL        , CONFTYPE_STRING   , read_string  , CNF_KRB5PRINCIPAL        , NULL },
-   { CONF_LABEL_NEW_TAPES      , CONFTYPE_STRING   , read_string  , CNF_LABEL_NEW_TAPES      , NULL },
-   { CONF_USETIMESTAMPS        , CONFTYPE_BOOL     , read_bool    , CNF_USETIMESTAMPS        , NULL },
-   { CONF_AMRECOVER_DO_FSF     , CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_DO_FSF     , NULL },
-   { CONF_AMRECOVER_CHANGER    , CONFTYPE_STRING   , read_string  , CNF_AMRECOVER_CHANGER    , NULL },
-   { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_CHECK_LABEL, NULL },
-   { CONF_CONNECT_TRIES        , CONFTYPE_INT      , read_int     , CNF_CONNECT_TRIES        , validate_positive1 },
-   { CONF_REP_TRIES            , CONFTYPE_INT      , read_int     , CNF_REP_TRIES            , validate_positive1 },
-   { CONF_REQ_TRIES            , CONFTYPE_INT      , read_int     , CNF_REQ_TRIES            , validate_positive1 },
-   { CONF_DEBUG_AMANDAD        , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMANDAD        , validate_debug },
-   { CONF_DEBUG_AMIDXTAPED     , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMIDXTAPED     , validate_debug },
-   { CONF_DEBUG_AMINDEXD       , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMINDEXD       , validate_debug },
-   { CONF_DEBUG_AMRECOVER      , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMRECOVER      , validate_debug },
-   { CONF_DEBUG_AUTH           , CONFTYPE_INT      , read_int     , CNF_DEBUG_AUTH           , validate_debug },
-   { CONF_DEBUG_EVENT          , CONFTYPE_INT      , read_int     , CNF_DEBUG_EVENT          , validate_debug },
-   { CONF_DEBUG_HOLDING        , CONFTYPE_INT      , read_int     , CNF_DEBUG_HOLDING        , validate_debug },
-   { CONF_DEBUG_PROTOCOL       , CONFTYPE_INT      , read_int     , CNF_DEBUG_PROTOCOL       , validate_debug },
-   { CONF_DEBUG_PLANNER        , CONFTYPE_INT      , read_int     , CNF_DEBUG_PLANNER        , validate_debug },
-   { CONF_DEBUG_DRIVER         , CONFTYPE_INT      , read_int     , CNF_DEBUG_DRIVER         , validate_debug },
-   { CONF_DEBUG_DUMPER         , CONFTYPE_INT      , read_int     , CNF_DEBUG_DUMPER         , validate_debug },
-   { CONF_DEBUG_CHUNKER        , CONFTYPE_INT      , read_int     , CNF_DEBUG_CHUNKER        , validate_debug },
-   { CONF_DEBUG_TAPER          , CONFTYPE_INT      , read_int     , CNF_DEBUG_TAPER          , validate_debug },
-   { CONF_DEBUG_SELFCHECK      , CONFTYPE_INT      , read_int     , CNF_DEBUG_SELFCHECK      , validate_debug },
-   { CONF_DEBUG_SENDSIZE       , CONFTYPE_INT      , read_int     , CNF_DEBUG_SENDSIZE       , validate_debug },
-   { CONF_DEBUG_SENDBACKUP     , CONFTYPE_INT      , read_int     , CNF_DEBUG_SENDBACKUP     , validate_debug },
-   { CONF_RESERVED_UDP_PORT    , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_UDP_PORT    , validate_reserved_port_range },
-   { CONF_RESERVED_TCP_PORT    , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_TCP_PORT    , validate_reserved_port_range },
-   { CONF_UNRESERVED_TCP_PORT  , CONFTYPE_INTRANGE , read_intrange, CNF_UNRESERVED_TCP_PORT  , validate_unreserved_port_range },
-   { CONF_UNKNOWN              , CONFTYPE_INT      , NULL         , CNF_CNF                  , NULL }
-};
-
-t_conf_var tapetype_var [] = {
-   { CONF_COMMENT     , CONFTYPE_STRING, read_string, TAPETYPE_COMMENT      , NULL },
-   { CONF_LBL_TEMPL   , CONFTYPE_STRING, read_string, TAPETYPE_LBL_TEMPL    , NULL },
-   { CONF_BLOCKSIZE   , CONFTYPE_SIZE  , read_size  , TAPETYPE_BLOCKSIZE    , validate_blocksize },
-   { CONF_READBLOCKSIZE, CONFTYPE_SIZE  , read_size , TAPETYPE_READBLOCKSIZE, validate_blocksize },
-   { CONF_LENGTH      , CONFTYPE_AM64  , read_am64  , TAPETYPE_LENGTH       , validate_positive0 },
-   { CONF_FILEMARK    , CONFTYPE_AM64  , read_am64  , TAPETYPE_FILEMARK     , NULL },
-   { CONF_SPEED       , CONFTYPE_INT   , read_int   , TAPETYPE_SPEED        , validate_positive0 },
-   { CONF_FILE_PAD    , CONFTYPE_BOOL  , read_bool  , TAPETYPE_FILE_PAD     , NULL },
-   { CONF_UNKNOWN     , CONFTYPE_INT   , NULL       , TAPETYPE_TAPETYPE     , NULL }
-};
-
-t_conf_var dumptype_var [] = {
-   { CONF_COMMENT           , CONFTYPE_STRING   , read_string , DUMPTYPE_COMMENT           , NULL },
-   { CONF_AUTH              , CONFTYPE_STRING   , read_string , DUMPTYPE_SECURITY_DRIVER   , NULL },
-   { CONF_BUMPDAYS          , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPDAYS          , NULL },
-   { CONF_BUMPMULT          , CONFTYPE_REAL     , read_real   , DUMPTYPE_BUMPMULT          , NULL },
-   { CONF_BUMPSIZE          , CONFTYPE_AM64     , read_am64   , DUMPTYPE_BUMPSIZE          , NULL },
-   { CONF_BUMPPERCENT       , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPPERCENT       , NULL },
-   { CONF_COMPRATE          , CONFTYPE_REAL     , get_comprate, DUMPTYPE_COMPRATE          , NULL },
-   { CONF_COMPRESS          , CONFTYPE_INT      , get_compress, DUMPTYPE_COMPRESS          , NULL },
-   { CONF_ENCRYPT           , CONFTYPE_INT      , get_encrypt , DUMPTYPE_ENCRYPT           , NULL },
-   { CONF_DUMPCYCLE         , CONFTYPE_INT      , read_int    , DUMPTYPE_DUMPCYCLE         , validate_positive0 },
-   { CONF_EXCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_EXCLUDE           , NULL },
-   { CONF_INCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_INCLUDE           , NULL },
-   { CONF_IGNORE            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_IGNORE            , NULL },
-   { CONF_HOLDING           , CONFTYPE_HOLDING  , get_holding , DUMPTYPE_HOLDINGDISK       , NULL },
-   { CONF_INDEX             , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_INDEX             , NULL },
-   { CONF_KENCRYPT          , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_KENCRYPT          , NULL },
-   { CONF_MAXDUMPS          , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXDUMPS          , validate_positive1 },
-   { CONF_MAXPROMOTEDAY     , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXPROMOTEDAY     , validate_positive0 },
-   { CONF_PRIORITY          , CONFTYPE_PRIORITY , get_priority, DUMPTYPE_PRIORITY          , NULL },
-   { CONF_PROGRAM           , CONFTYPE_STRING   , read_string , DUMPTYPE_PROGRAM           , NULL },
-   { CONF_RECORD            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_RECORD            , NULL },
-   { CONF_SKIP_FULL         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_FULL         , NULL },
-   { CONF_SKIP_INCR         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_INCR         , NULL },
-   { CONF_STARTTIME         , CONFTYPE_TIME     , read_time   , DUMPTYPE_STARTTIME         , NULL },
-   { CONF_STRATEGY          , CONFTYPE_INT      , get_strategy, DUMPTYPE_STRATEGY          , NULL },
-   { CONF_TAPE_SPLITSIZE    , CONFTYPE_AM64     , read_am64   , DUMPTYPE_TAPE_SPLITSIZE    , validate_positive0 },
-   { CONF_SPLIT_DISKBUFFER  , CONFTYPE_STRING   , read_string , DUMPTYPE_SPLIT_DISKBUFFER  , NULL },
-   { CONF_ESTIMATE          , CONFTYPE_INT      , get_estimate, DUMPTYPE_ESTIMATE          , NULL },
-   { CONF_SRV_ENCRYPT       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_ENCRYPT       , NULL },
-   { CONF_CLNT_ENCRYPT      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_ENCRYPT      , NULL },
-   { CONF_AMANDAD_PATH      , CONFTYPE_STRING   , read_string , DUMPTYPE_AMANDAD_PATH      , NULL },
-   { CONF_CLIENT_USERNAME   , CONFTYPE_STRING   , read_string , DUMPTYPE_CLIENT_USERNAME   , NULL },
-   { CONF_SSH_KEYS          , CONFTYPE_STRING   , read_string , DUMPTYPE_SSH_KEYS          , NULL },
-   { CONF_SRVCOMPPROG       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRVCOMPPROG       , NULL },
-   { CONF_CLNTCOMPPROG      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNTCOMPPROG      , NULL },
-   { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64     , read_am64   , DUMPTYPE_FALLBACK_SPLITSIZE, NULL },
-   { CONF_SRV_DECRYPT_OPT   , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_DECRYPT_OPT   , NULL },
-   { CONF_CLNT_DECRYPT_OPT  , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_DECRYPT_OPT  , NULL },
-   { CONF_UNKNOWN           , CONFTYPE_INT      , NULL        , DUMPTYPE_DUMPTYPE          , NULL }
+/* A keyword table for recognizing unit suffixes.  No distinction is made for kinds
+ * of suffixes: 1024 weeks = 7 k. */
+keytab_t numb_keytable[] = {
+    { "B", CONF_MULT1 },
+    { "BPS", CONF_MULT1 },
+    { "BYTE", CONF_MULT1 },
+    { "BYTES", CONF_MULT1 },
+    { "DAY", CONF_MULT1 },
+    { "DAYS", CONF_MULT1 },
+    { "INF", CONF_AMINFINITY },
+    { "K", CONF_MULT1K },
+    { "KB", CONF_MULT1K },
+    { "KBPS", CONF_MULT1K },
+    { "KBYTE", CONF_MULT1K },
+    { "KBYTES", CONF_MULT1K },
+    { "KILOBYTE", CONF_MULT1K },
+    { "KILOBYTES", CONF_MULT1K },
+    { "KPS", CONF_MULT1K },
+    { "M", CONF_MULT1M },
+    { "MB", CONF_MULT1M },
+    { "MBPS", CONF_MULT1M },
+    { "MBYTE", CONF_MULT1M },
+    { "MBYTES", CONF_MULT1M },
+    { "MEG", CONF_MULT1M },
+    { "MEGABYTE", CONF_MULT1M },
+    { "MEGABYTES", CONF_MULT1M },
+    { "G", CONF_MULT1G },
+    { "GB", CONF_MULT1G },
+    { "GBPS", CONF_MULT1G },
+    { "GBYTE", CONF_MULT1G },
+    { "GBYTES", CONF_MULT1G },
+    { "GIG", CONF_MULT1G },
+    { "GIGABYTE", CONF_MULT1G },
+    { "GIGABYTES", CONF_MULT1G },
+    { "MPS", CONF_MULT1M },
+    { "TAPE", CONF_MULT1 },
+    { "TAPES", CONF_MULT1 },
+    { "WEEK", CONF_MULT7 },
+    { "WEEKS", CONF_MULT7 },
+    { NULL, CONF_IDENT }
 };
 
-t_conf_var holding_var [] = {
-   { CONF_DIRECTORY, CONFTYPE_STRING, read_string, HOLDING_DISKDIR  , NULL },
-   { CONF_COMMENT  , CONFTYPE_STRING, read_string, HOLDING_COMMENT  , NULL },
-   { CONF_USE      , CONFTYPE_AM64  , read_am64  , HOLDING_DISKSIZE , validate_use },
-   { CONF_CHUNKSIZE, CONFTYPE_AM64  , read_am64  , HOLDING_CHUNKSIZE, validate_chunksize },
-   { CONF_UNKNOWN  , CONFTYPE_INT   , NULL       , HOLDING_HOLDING  , NULL }
+/* Boolean keywords -- all the ways to say "true" and "false" in amanda.conf */
+keytab_t bool_keytable[] = {
+    { "Y", CONF_ATRUE },
+    { "YES", CONF_ATRUE },
+    { "T", CONF_ATRUE },
+    { "TRUE", CONF_ATRUE },
+    { "ON", CONF_ATRUE },
+    { "N", CONF_AFALSE },
+    { "NO", CONF_AFALSE },
+    { "F", CONF_AFALSE },
+    { "FALSE", CONF_AFALSE },
+    { "OFF", CONF_AFALSE },
+    { NULL, CONF_IDENT }
 };
 
-/*
-** ------------------------
-**  External entry points
-** ------------------------
-*/
-
-int
-read_conffile(
-    char *filename)
-{
-    interface_t *ip;
-
-    my_keytab = server_keytab;
-    my_var = server_var;
-    init_defaults();
+/* Now, the parser tables for client and server global parameters, and for
+ * each of the server subsections */
+conf_var_t client_var [] = {
+   { CONF_CONF               , CONFTYPE_STR     , read_str     , CNF_CONF               , NULL },
+   { CONF_INDEX_SERVER       , CONFTYPE_STR     , read_str     , CNF_INDEX_SERVER       , NULL },
+   { CONF_TAPE_SERVER        , CONFTYPE_STR     , read_str     , CNF_TAPE_SERVER        , NULL },
+   { CONF_TAPEDEV            , CONFTYPE_STR     , read_str     , CNF_TAPEDEV            , NULL },
+   { CONF_AUTH               , CONFTYPE_STR     , read_str     , CNF_AUTH               , NULL },
+   { CONF_SSH_KEYS           , CONFTYPE_STR     , read_str     , CNF_SSH_KEYS           , NULL },
+   { CONF_AMANDAD_PATH       , CONFTYPE_STR     , read_str     , CNF_AMANDAD_PATH       , NULL },
+   { CONF_CLIENT_USERNAME    , CONFTYPE_STR     , read_str     , CNF_CLIENT_USERNAME    , NULL },
+   { CONF_GNUTAR_LIST_DIR    , CONFTYPE_STR     , read_str     , CNF_GNUTAR_LIST_DIR    , NULL },
+   { CONF_AMANDATES          , CONFTYPE_STR     , read_str     , CNF_AMANDATES          , NULL },
+   { CONF_KRB5KEYTAB         , CONFTYPE_STR     , read_str     , CNF_KRB5KEYTAB         , NULL },
+   { CONF_KRB5PRINCIPAL      , CONFTYPE_STR     , read_str     , CNF_KRB5PRINCIPAL      , NULL },
+   { CONF_CONNECT_TRIES      , CONFTYPE_INT     , read_int     , CNF_CONNECT_TRIES      , validate_positive },
+   { CONF_REP_TRIES          , CONFTYPE_INT     , read_int     , CNF_REP_TRIES          , validate_positive },
+   { CONF_REQ_TRIES          , CONFTYPE_INT     , read_int     , CNF_REQ_TRIES          , validate_positive },
+   { CONF_DEBUG_AMANDAD      , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMANDAD      , validate_debug },
+   { CONF_DEBUG_AMIDXTAPED   , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMIDXTAPED   , validate_debug },
+   { CONF_DEBUG_AMINDEXD     , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMINDEXD     , validate_debug },
+   { CONF_DEBUG_AMRECOVER    , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMRECOVER    , validate_debug },
+   { CONF_DEBUG_AUTH         , CONFTYPE_INT     , read_int     , CNF_DEBUG_AUTH         , validate_debug },
+   { CONF_DEBUG_EVENT        , CONFTYPE_INT     , read_int     , CNF_DEBUG_EVENT        , validate_debug },
+   { CONF_DEBUG_HOLDING      , CONFTYPE_INT     , read_int     , CNF_DEBUG_HOLDING      , validate_debug },
+   { CONF_DEBUG_PROTOCOL     , CONFTYPE_INT     , read_int     , CNF_DEBUG_PROTOCOL     , validate_debug },
+   { CONF_DEBUG_PLANNER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_PLANNER      , validate_debug },
+   { CONF_DEBUG_DRIVER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DRIVER       , validate_debug },
+   { CONF_DEBUG_DUMPER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DUMPER       , validate_debug },
+   { CONF_DEBUG_CHUNKER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_CHUNKER      , validate_debug },
+   { CONF_DEBUG_TAPER        , CONFTYPE_INT     , read_int     , CNF_DEBUG_TAPER        , validate_debug },
+   { CONF_DEBUG_SELFCHECK    , CONFTYPE_INT     , read_int     , CNF_DEBUG_SELFCHECK    , validate_debug },
+   { CONF_DEBUG_SENDSIZE     , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDSIZE     , validate_debug },
+   { CONF_DEBUG_SENDBACKUP   , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDBACKUP   , validate_debug },
+   { CONF_RESERVED_UDP_PORT  , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_UDP_PORT  , validate_reserved_port_range },
+   { CONF_RESERVED_TCP_PORT  , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_TCP_PORT  , validate_reserved_port_range },
+   { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range },
+   { CONF_UNKNOWN            , CONFTYPE_INT     , NULL         , CNF_CNF                , NULL }
+};
 
-    /* We assume that conf_confname & conf are initialized to NULL above */
-    read_conffile_recursively(filename);
+conf_var_t server_var [] = {
+   { CONF_ORG                  , CONFTYPE_STR      , read_str         , CNF_ORG                  , NULL },
+   { CONF_MAILTO               , CONFTYPE_STR      , read_str         , CNF_MAILTO               , NULL },
+   { CONF_DUMPUSER             , CONFTYPE_STR      , read_str         , CNF_DUMPUSER             , NULL },
+   { CONF_PRINTER              , CONFTYPE_STR      , read_str         , CNF_PRINTER              , NULL },
+   { CONF_TAPEDEV              , CONFTYPE_STR      , read_str         , CNF_TAPEDEV              , NULL },
+   { CONF_DEVICE_PROPERTY      , CONFTYPE_PROPLIST , read_property    , CNF_DEVICE_PROPERTY      , NULL },
+   { CONF_TPCHANGER            , CONFTYPE_STR      , read_str         , CNF_TPCHANGER            , NULL },
+   { CONF_CHANGERDEV           , CONFTYPE_STR      , read_str         , CNF_CHANGERDEV           , NULL },
+   { CONF_CHANGERFILE          , CONFTYPE_STR      , read_str         , CNF_CHANGERFILE          , NULL },
+   { CONF_LABELSTR             , CONFTYPE_STR      , read_str         , CNF_LABELSTR             , NULL },
+   { CONF_TAPELIST             , CONFTYPE_STR      , read_str         , CNF_TAPELIST             , NULL },
+   { CONF_DISKFILE             , CONFTYPE_STR      , read_str         , CNF_DISKFILE             , NULL },
+   { CONF_INFOFILE             , CONFTYPE_STR      , read_str         , CNF_INFOFILE             , NULL },
+   { CONF_LOGDIR               , CONFTYPE_STR      , read_str         , CNF_LOGDIR               , NULL },
+   { CONF_INDEXDIR             , CONFTYPE_STR      , read_str         , CNF_INDEXDIR             , NULL },
+   { CONF_TAPETYPE             , CONFTYPE_IDENT    , read_ident       , CNF_TAPETYPE             , NULL },
+   { CONF_DUMPCYCLE            , CONFTYPE_INT      , read_int         , CNF_DUMPCYCLE            , validate_nonnegative },
+   { CONF_RUNSPERCYCLE         , CONFTYPE_INT      , read_int         , CNF_RUNSPERCYCLE         , validate_runspercycle },
+   { CONF_RUNTAPES             , CONFTYPE_INT      , read_int         , CNF_RUNTAPES             , validate_nonnegative },
+   { CONF_TAPECYCLE            , CONFTYPE_INT      , read_int         , CNF_TAPECYCLE            , validate_positive },
+   { CONF_BUMPDAYS             , CONFTYPE_INT      , read_int         , CNF_BUMPDAYS             , validate_positive },
+   { CONF_BUMPSIZE             , CONFTYPE_AM64     , read_am64        , CNF_BUMPSIZE             , validate_positive },
+   { CONF_BUMPPERCENT          , CONFTYPE_INT      , read_int         , CNF_BUMPPERCENT          , validate_bumppercent },
+   { CONF_BUMPMULT             , CONFTYPE_REAL     , read_real        , CNF_BUMPMULT             , validate_bumpmult },
+   { CONF_NETUSAGE             , CONFTYPE_INT      , read_int         , CNF_NETUSAGE             , validate_positive },
+   { CONF_INPARALLEL           , CONFTYPE_INT      , read_int         , CNF_INPARALLEL           , validate_inparallel },
+   { CONF_DUMPORDER            , CONFTYPE_STR      , read_str         , CNF_DUMPORDER            , NULL },
+   { CONF_MAXDUMPS             , CONFTYPE_INT      , read_int         , CNF_MAXDUMPS             , validate_positive },
+   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int         , CNF_ETIMEOUT             , NULL },
+   { CONF_DTIMEOUT             , CONFTYPE_INT      , read_int         , CNF_DTIMEOUT             , validate_positive },
+   { CONF_CTIMEOUT             , CONFTYPE_INT      , read_int         , CNF_CTIMEOUT             , validate_positive },
+   { CONF_TAPEBUFS             , CONFTYPE_INT      , read_int         , CNF_TAPEBUFS             , validate_positive },
+   { CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size        , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive },
+   { CONF_COLUMNSPEC           , CONFTYPE_STR      , read_str         , CNF_COLUMNSPEC           , NULL },
+   { CONF_TAPERALGO            , CONFTYPE_TAPERALGO, read_taperalgo   , CNF_TAPERALGO            , NULL },
+   { CONF_FLUSH_THRESHOLD_DUMPED, CONFTYPE_INT     , read_int         , CNF_FLUSH_THRESHOLD_DUMPED, validate_nonnegative },
+   { CONF_FLUSH_THRESHOLD_SCHEDULED, CONFTYPE_INT  , read_int         , CNF_FLUSH_THRESHOLD_SCHEDULED, validate_nonnegative },
+   { CONF_TAPERFLUSH           , CONFTYPE_INT      , read_int         , CNF_TAPERFLUSH           , validate_nonnegative },
+   { CONF_DISPLAYUNIT          , CONFTYPE_STR      , read_str         , CNF_DISPLAYUNIT          , validate_displayunit },
+   { CONF_AUTOFLUSH            , CONFTYPE_BOOLEAN  , read_bool        , CNF_AUTOFLUSH            , NULL },
+   { CONF_RESERVE              , CONFTYPE_INT      , read_int         , CNF_RESERVE              , validate_reserve },
+   { CONF_MAXDUMPSIZE          , CONFTYPE_AM64     , read_am64        , CNF_MAXDUMPSIZE          , NULL },
+   { CONF_KRB5KEYTAB           , CONFTYPE_STR      , read_str         , CNF_KRB5KEYTAB           , NULL },
+   { CONF_KRB5PRINCIPAL        , CONFTYPE_STR      , read_str         , CNF_KRB5PRINCIPAL        , NULL },
+   { CONF_LABEL_NEW_TAPES      , CONFTYPE_STR      , read_str         , CNF_LABEL_NEW_TAPES      , NULL },
+   { CONF_USETIMESTAMPS        , CONFTYPE_BOOLEAN  , read_bool        , CNF_USETIMESTAMPS        , NULL },
+   { CONF_AMRECOVER_DO_FSF     , CONFTYPE_BOOLEAN  , read_bool        , CNF_AMRECOVER_DO_FSF     , NULL },
+   { CONF_AMRECOVER_CHANGER    , CONFTYPE_STR      , read_str         , CNF_AMRECOVER_CHANGER    , NULL },
+   { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOLEAN  , read_bool        , CNF_AMRECOVER_CHECK_LABEL, NULL },
+   { CONF_CONNECT_TRIES        , CONFTYPE_INT      , read_int         , CNF_CONNECT_TRIES        , validate_positive },
+   { CONF_REP_TRIES            , CONFTYPE_INT      , read_int         , CNF_REP_TRIES            , validate_positive },
+   { CONF_REQ_TRIES            , CONFTYPE_INT      , read_int         , CNF_REQ_TRIES            , validate_positive },
+   { CONF_DEBUG_AMANDAD        , CONFTYPE_INT      , read_int         , CNF_DEBUG_AMANDAD        , validate_debug },
+   { CONF_DEBUG_AMIDXTAPED     , CONFTYPE_INT      , read_int         , CNF_DEBUG_AMIDXTAPED     , validate_debug },
+   { CONF_DEBUG_AMINDEXD       , CONFTYPE_INT      , read_int         , CNF_DEBUG_AMINDEXD       , validate_debug },
+   { CONF_DEBUG_AMRECOVER      , CONFTYPE_INT      , read_int         , CNF_DEBUG_AMRECOVER      , validate_debug },
+   { CONF_DEBUG_AUTH           , CONFTYPE_INT      , read_int         , CNF_DEBUG_AUTH           , validate_debug },
+   { CONF_DEBUG_EVENT          , CONFTYPE_INT      , read_int         , CNF_DEBUG_EVENT          , validate_debug },
+   { CONF_DEBUG_HOLDING        , CONFTYPE_INT      , read_int         , CNF_DEBUG_HOLDING        , validate_debug },
+   { CONF_DEBUG_PROTOCOL       , CONFTYPE_INT      , read_int         , CNF_DEBUG_PROTOCOL       , validate_debug },
+   { CONF_DEBUG_PLANNER        , CONFTYPE_INT      , read_int         , CNF_DEBUG_PLANNER        , validate_debug },
+   { CONF_DEBUG_DRIVER         , CONFTYPE_INT      , read_int         , CNF_DEBUG_DRIVER         , validate_debug },
+   { CONF_DEBUG_DUMPER         , CONFTYPE_INT      , read_int         , CNF_DEBUG_DUMPER         , validate_debug },
+   { CONF_DEBUG_CHUNKER        , CONFTYPE_INT      , read_int         , CNF_DEBUG_CHUNKER        , validate_debug },
+   { CONF_DEBUG_TAPER          , CONFTYPE_INT      , read_int         , CNF_DEBUG_TAPER          , validate_debug },
+   { CONF_DEBUG_SELFCHECK      , CONFTYPE_INT      , read_int         , CNF_DEBUG_SELFCHECK      , validate_debug },
+   { CONF_DEBUG_SENDSIZE       , CONFTYPE_INT      , read_int         , CNF_DEBUG_SENDSIZE       , validate_debug },
+   { CONF_DEBUG_SENDBACKUP     , CONFTYPE_INT      , read_int         , CNF_DEBUG_SENDBACKUP     , validate_debug },
+   { CONF_RESERVED_UDP_PORT    , CONFTYPE_INTRANGE , read_intrange    , CNF_RESERVED_UDP_PORT    , validate_reserved_port_range },
+   { CONF_RESERVED_TCP_PORT    , CONFTYPE_INTRANGE , read_intrange    , CNF_RESERVED_TCP_PORT    , validate_reserved_port_range },
+   { CONF_UNRESERVED_TCP_PORT  , CONFTYPE_INTRANGE , read_intrange    , CNF_UNRESERVED_TCP_PORT  , validate_unreserved_port_range },
+   { CONF_UNKNOWN              , CONFTYPE_INT      , NULL             , CNF_CNF                  , NULL }
+};
 
-    /* overwrite with command line option */
-    command_overwrite(program_options, my_var, my_keytab, conf_data,
-                     "");
+conf_var_t tapetype_var [] = {
+   { CONF_COMMENT       , CONFTYPE_STR     , read_str   , TAPETYPE_COMMENT      , NULL },
+   { CONF_LBL_TEMPL     , CONFTYPE_STR     , read_str   , TAPETYPE_LBL_TEMPL    , NULL },
+   { CONF_BLOCKSIZE     , CONFTYPE_SIZE    , read_size  , TAPETYPE_BLOCKSIZE    , validate_blocksize },
+   { CONF_READBLOCKSIZE , CONFTYPE_SIZE    , read_size  , TAPETYPE_READBLOCKSIZE, validate_blocksize },
+   { CONF_LENGTH        , CONFTYPE_AM64    , read_am64  , TAPETYPE_LENGTH       , validate_nonnegative },
+   { CONF_FILEMARK      , CONFTYPE_AM64    , read_am64  , TAPETYPE_FILEMARK     , NULL },
+   { CONF_SPEED         , CONFTYPE_INT     , read_int   , TAPETYPE_SPEED        , validate_nonnegative },
+   { CONF_FILE_PAD      , CONFTYPE_BOOLEAN , read_bool  , TAPETYPE_FILE_PAD     , NULL },
+   { CONF_UNKNOWN       , CONFTYPE_INT     , NULL       , TAPETYPE_TAPETYPE     , NULL }
+};
 
-    if(got_parserror != -1 ) {
-       if(lookup_tapetype(conf_data[CNF_TAPETYPE].v.s) == NULL) {
-           char *save_confname = conf_confname;
+conf_var_t dumptype_var [] = {
+   { CONF_COMMENT           , CONFTYPE_STR      , read_str      , DUMPTYPE_COMMENT           , NULL },
+   { CONF_AUTH              , CONFTYPE_STR      , read_str      , DUMPTYPE_SECURITY_DRIVER   , NULL },
+   { CONF_BUMPDAYS          , CONFTYPE_INT      , read_int      , DUMPTYPE_BUMPDAYS          , NULL },
+   { CONF_BUMPMULT          , CONFTYPE_REAL     , read_real     , DUMPTYPE_BUMPMULT          , NULL },
+   { CONF_BUMPSIZE          , CONFTYPE_AM64     , read_am64     , DUMPTYPE_BUMPSIZE          , NULL },
+   { CONF_BUMPPERCENT       , CONFTYPE_INT      , read_int      , DUMPTYPE_BUMPPERCENT       , NULL },
+   { CONF_COMPRATE          , CONFTYPE_REAL     , read_rate     , DUMPTYPE_COMPRATE          , NULL },
+   { CONF_COMPRESS          , CONFTYPE_INT      , read_compress , DUMPTYPE_COMPRESS          , NULL },
+   { CONF_ENCRYPT           , CONFTYPE_INT      , read_encrypt  , DUMPTYPE_ENCRYPT           , NULL },
+   { CONF_DUMPCYCLE         , CONFTYPE_INT      , read_int      , DUMPTYPE_DUMPCYCLE         , validate_nonnegative },
+   { CONF_EXCLUDE           , CONFTYPE_EXINCLUDE, read_exinclude, DUMPTYPE_EXCLUDE           , NULL },
+   { CONF_INCLUDE           , CONFTYPE_EXINCLUDE, read_exinclude, DUMPTYPE_INCLUDE           , NULL },
+   { CONF_IGNORE            , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_IGNORE            , NULL },
+   { CONF_HOLDING           , CONFTYPE_HOLDING  , read_holding  , DUMPTYPE_HOLDINGDISK       , NULL },
+   { CONF_INDEX             , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_INDEX             , NULL },
+   { CONF_KENCRYPT          , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_KENCRYPT          , NULL },
+   { CONF_MAXDUMPS          , CONFTYPE_INT      , read_int      , DUMPTYPE_MAXDUMPS          , validate_positive },
+   { CONF_MAXPROMOTEDAY     , CONFTYPE_INT      , read_int      , DUMPTYPE_MAXPROMOTEDAY     , validate_nonnegative },
+   { CONF_PRIORITY          , CONFTYPE_PRIORITY , read_priority , DUMPTYPE_PRIORITY          , NULL },
+   { CONF_PROGRAM           , CONFTYPE_STR      , read_str      , DUMPTYPE_PROGRAM           , NULL },
+   { CONF_RECORD            , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_RECORD            , NULL },
+   { CONF_SKIP_FULL         , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_SKIP_FULL         , NULL },
+   { CONF_SKIP_INCR         , CONFTYPE_BOOLEAN  , read_bool     , DUMPTYPE_SKIP_INCR         , NULL },
+   { CONF_STARTTIME         , CONFTYPE_TIME     , read_time     , DUMPTYPE_STARTTIME         , NULL },
+   { CONF_STRATEGY          , CONFTYPE_INT      , read_strategy , DUMPTYPE_STRATEGY          , NULL },
+   { CONF_TAPE_SPLITSIZE    , CONFTYPE_AM64     , read_am64     , DUMPTYPE_TAPE_SPLITSIZE    , validate_nonnegative },
+   { CONF_SPLIT_DISKBUFFER  , CONFTYPE_STR      , read_str      , DUMPTYPE_SPLIT_DISKBUFFER  , NULL },
+   { CONF_ESTIMATE          , CONFTYPE_INT      , read_estimate , DUMPTYPE_ESTIMATE          , NULL },
+   { CONF_SRV_ENCRYPT       , CONFTYPE_STR      , read_str      , DUMPTYPE_SRV_ENCRYPT       , NULL },
+   { CONF_CLNT_ENCRYPT      , CONFTYPE_STR      , read_str      , DUMPTYPE_CLNT_ENCRYPT      , NULL },
+   { CONF_AMANDAD_PATH      , CONFTYPE_STR      , read_str      , DUMPTYPE_AMANDAD_PATH      , NULL },
+   { CONF_CLIENT_USERNAME   , CONFTYPE_STR      , read_str      , DUMPTYPE_CLIENT_USERNAME   , NULL },
+   { CONF_SSH_KEYS          , CONFTYPE_STR      , read_str      , DUMPTYPE_SSH_KEYS          , NULL },
+   { CONF_SRVCOMPPROG       , CONFTYPE_STR      , read_str      , DUMPTYPE_SRVCOMPPROG       , NULL },
+   { CONF_CLNTCOMPPROG      , CONFTYPE_STR      , read_str      , DUMPTYPE_CLNTCOMPPROG      , NULL },
+   { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64     , read_am64     , DUMPTYPE_FALLBACK_SPLITSIZE, NULL },
+   { CONF_SRV_DECRYPT_OPT   , CONFTYPE_STR      , read_str      , DUMPTYPE_SRV_DECRYPT_OPT   , NULL },
+   { CONF_CLNT_DECRYPT_OPT  , CONFTYPE_STR      , read_str      , DUMPTYPE_CLNT_DECRYPT_OPT  , NULL },
+   { CONF_UNKNOWN           , CONFTYPE_INT      , NULL          , DUMPTYPE_DUMPTYPE          , NULL }
+};
 
-           conf_confname = filename;
-           if(!conf_data[CNF_TAPETYPE].seen)
-               conf_parserror("default tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s);
-           else {
-               conf_line_num = conf_data[CNF_TAPETYPE].seen;
-               conf_parserror("tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s);
-           }
-           conf_confname = save_confname;
-       }
-    }
+conf_var_t holding_var [] = {
+   { CONF_DIRECTORY, CONFTYPE_STR   , read_str   , HOLDING_DISKDIR  , NULL },
+   { CONF_COMMENT  , CONFTYPE_STR   , read_str   , HOLDING_COMMENT  , NULL },
+   { CONF_USE      , CONFTYPE_AM64  , read_am64  , HOLDING_DISKSIZE , validate_use },
+   { CONF_CHUNKSIZE, CONFTYPE_AM64  , read_am64  , HOLDING_CHUNKSIZE, validate_chunksize },
+   { CONF_UNKNOWN  , CONFTYPE_INT   , NULL       , HOLDING_HOLDING  , NULL }
+};
 
-    ip = alloc(SIZEOF(interface_t));
-    ip->name = stralloc("default");
-    ip->seen = conf_data[CNF_NETUSAGE].seen;
-    conf_init_string(&ip->value[INTER_COMMENT], "implicit from NETUSAGE");
-    conf_init_int(&ip->value[INTER_MAXUSAGE], conf_data[CNF_NETUSAGE].v.i);
-    ip->curusage = 0;
-    ip->next = interface_list;
-    interface_list = ip;
+conf_var_t interface_var [] = {
+   { CONF_COMMENT, CONFTYPE_STR   , read_str   , INTER_COMMENT , NULL },
+   { CONF_USE    , CONFTYPE_INT   , read_int   , INTER_MAXUSAGE, validate_positive },
+   { CONF_UNKNOWN, CONFTYPE_INT   , NULL       , INTER_INTER   , NULL }
+};
 
-    debug_amandad    = getconf_int(CNF_DEBUG_AMANDAD);
-    debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED);
-    debug_amindexd   = getconf_int(CNF_DEBUG_AMINDEXD);
-    debug_amrecover  = getconf_int(CNF_DEBUG_AMRECOVER);
-    debug_auth       = getconf_int(CNF_DEBUG_AUTH);
-    debug_event      = getconf_int(CNF_DEBUG_EVENT);
-    debug_holding    = getconf_int(CNF_DEBUG_HOLDING);
-    debug_protocol   = getconf_int(CNF_DEBUG_PROTOCOL);
-    debug_planner    = getconf_int(CNF_DEBUG_PLANNER);
-    debug_driver     = getconf_int(CNF_DEBUG_DRIVER);
-    debug_dumper     = getconf_int(CNF_DEBUG_DUMPER);
-    debug_chunker    = getconf_int(CNF_DEBUG_CHUNKER);
-    debug_taper      = getconf_int(CNF_DEBUG_TAPER);
-    debug_selfcheck  = getconf_int(CNF_DEBUG_SELFCHECK);
-    debug_sendsize   = getconf_int(CNF_DEBUG_SENDSIZE);
-    debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP);
 
-    return got_parserror;
-}
+/*
+ * Lexical Analysis Implementation
+ */
 
-static void
-validate_positive0(
-    struct s_conf_var *np,
-    val_t        *val)
+static char *
+get_token_name(
+    tok_t token)
 {
-    switch(val->type) {
-    case CONFTYPE_INT:
-       if(val->v.i < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_LONG:
-       if(val->v.l < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_AM64:
-       if(val->v.am64 < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    default:
-       conf_parserror("validate_positive0 invalid type %d\n", val->type);
-    }
-}
+    keytab_t *kt;
 
-static void
-validate_positive1(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    switch(val->type) {
-    case CONFTYPE_INT:
-       if(val->v.i < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_LONG:
-       if(val->v.l < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_AM64:
-       if(val->v.am64 < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_TIME:
-       if(val->v.t < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    default:
-       conf_parserror("validate_positive1 invalid type %d\n", val->type);
+    if (keytable == NULL) {
+       error(_("keytable == NULL"));
+       /*NOTREACHED*/
     }
-}
 
-static void
-validate_runspercycle(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < -1)
-       conf_parserror("runspercycle must be >= -1");
-}
-
-static void
-validate_bumppercent(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 0 || val->v.i > 100)
-       conf_parserror("bumppercent must be between 0 and 100");
-}
+    for(kt = keytable; kt->token != CONF_UNKNOWN; kt++)
+       if(kt->token == token) break;
 
-static void
-validate_inparallel(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 1 || val->v.i >MAX_DUMPERS)
-       conf_parserror("inparallel must be between 1 and MAX_DUMPERS (%d)",
-                      MAX_DUMPERS);
+    if(kt->token == CONF_UNKNOWN)
+       return("");
+    return(kt->keyword);
 }
 
-static void
-validate_bumpmult(
-    struct s_conf_var *np,
-    val_t        *val)
+static tok_t
+lookup_keyword(
+    char *     str)
 {
-    np = np;
-    if(val->v.r < 0.999) {
-       conf_parserror("bumpmult must be positive");
-    }
-}
+    keytab_t *kwp;
 
-static void
-validate_displayunit(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(strcmp(val->v.s, "k") == 0 ||
-       strcmp(val->v.s, "K") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1;
-    }
-    else if(strcmp(val->v.s, "m") == 0 ||
-       strcmp(val->v.s, "M") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024;
-    }
-    else if(strcmp(val->v.s, "g") == 0 ||
-       strcmp(val->v.s, "G") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024*1024;
-    }
-    else if(strcmp(val->v.s, "t") == 0 ||
-       strcmp(val->v.s, "T") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024*1024*1024;
-    }
-    else {
-       conf_parserror("displayunit must be k,m,g or t.");
+    for(kwp = keytable; kwp->keyword != NULL; kwp++) {
+       if (strcasecmp(kwp->keyword, str) == 0) break;
     }
+    return kwp->token;
 }
 
 static void
-validate_reserve(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 0 || val->v.i > 100)
-       conf_parserror("reserve must be between 0 and 100");
-}
-
-static void
-validate_use(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    val->v.am64 = am_floor(val->v.am64, DISK_BLOCK_KB);
-}
-
-static void
-validate_chunksize(
-    struct s_conf_var *np,
-    val_t        *val)
+get_conftoken(
+    tok_t      exp)
 {
-    np = np;
-    if(val->v.am64 == 0) {
-       val->v.am64 = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB));
-    }
-    else if(val->v.am64 < 0) {
-       conf_parserror("Negative chunksize (" OFF_T_FMT
-                       ") is no longer supported", val->v.am64);
-    }
-    val->v.am64 = am_floor(val->v.am64, (off_t)DISK_BLOCK_KB);
-    if (val->v.am64 < 2*DISK_BLOCK_KB) {
-       conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB);
-    }
-}
+    int ch, d;
+    off_t am64;
+    char *buf;
+    char *tmps;
+    int token_overflow;
+    int inquote = 0;
+    int escape = 0;
+    int sign;
 
-static void
-validate_blocksize(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.l < DISK_BLOCK_KB) {
-       conf_parserror("Tape blocksize must be at least %d KBytes",
-                 DISK_BLOCK_KB);
-    } else if(val->v.l > MAX_TAPE_BLOCK_KB) {
-       conf_parserror("Tape blocksize must not be larger than %d KBytes",
-                 MAX_TAPE_BLOCK_KB);
-    }
-}
+    if (token_pushed) {
+       token_pushed = 0;
+       tok = pushed_tok;
 
-static void
-validate_debug(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 0 || val->v.i > 9) {
-       conf_parserror("Debug must be between 0 and 9");
-    }
-}
+       /*
+       ** If it looked like a keyword before then look it
+       ** up again in the current keyword table.
+       */
+       switch(tok) {
+       case CONF_AM64:    case CONF_SIZE:
+       case CONF_INT:     case CONF_REAL:    case CONF_STRING:
+       case CONF_LBRACE:  case CONF_RBRACE:  case CONF_COMMA:
+       case CONF_NL:      case CONF_END:     case CONF_UNKNOWN:
+       case CONF_TIME:
+           break; /* not a keyword */
 
-static void
-validate_reserved_port_range(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.intrange[0] < 1 || val->v.intrange[0] > IPPORT_RESERVED-1) {
-       conf_parserror("portrange must be between 1 and %d", IPPORT_RESERVED-1);
-    } else if(val->v.intrange[1] < 1 || val->v.intrange[1] > IPPORT_RESERVED-1) {
-       conf_parserror("portrange must be between 1 and IPPORT_RESERVED-1");
+       default:
+           if (exp == CONF_IDENT)
+               tok = CONF_IDENT;
+           else
+               tok = lookup_keyword(tokenval.v.s);
+           break;
+       }
     }
-}
+    else {
+       ch = conftoken_getc();
 
-static void
-validate_unreserved_port_range(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.intrange[0] < IPPORT_RESERVED+1 || val->v.intrange[0] > 65536) {
-       conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1);
-    } else if(val->v.intrange[1] < IPPORT_RESERVED+1 || val->v.intrange[1] > 65536) {
-       conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1);
-    }
-}
+       while(ch != EOF && ch != '\n' && isspace(ch))
+           ch = conftoken_getc();
+       if (ch == '#') {        /* comment - eat everything but eol/eof */
+           while((ch = conftoken_getc()) != EOF && ch != '\n') {
+               (void)ch; /* Quiet empty loop complaints */     
+           }
+       }
 
-char *
-getconf_byname(
-    char *str)
-{
-    static char *tmpstr;
-    t_conf_var *np;
-    keytab_t *kt;
-    char *s;
-    char ch;
-    char *first_delim;
-    char *second_delim;
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
+       if (isalpha(ch)) {              /* identifier */
+           buf = tkbuf;
+           token_overflow = 0;
+           do {
+               if (buf < tkbuf+sizeof(tkbuf)-1) {
+                   *buf++ = (char)ch;
+               } else {
+                   *buf = '\0';
+                   if (!token_overflow) {
+                       conf_parserror(_("token too long: %.20s..."), tkbuf);
+                   }
+                   token_overflow = 1;
+               }
+               ch = conftoken_getc();
+           } while(isalnum(ch) || ch == '_' || ch == '-');
 
-    tmpstr = stralloc(str);
-    s = tmpstr;
-    while((ch = *s++) != '\0') {
-       if(islower((int)ch))
-           s[-1] = (char)toupper(ch);
-    }
+           if (ch != EOF && conftoken_ungetc(ch) == EOF) {
+               if (ferror(current_file)) {
+                   conf_parserror(_("Pushback of '%c' failed: %s"),
+                                  ch, strerror(ferror(current_file)));
+               } else {
+                   conf_parserror(_("Pushback of '%c' failed: EOF"), ch);
+               }
+           }
+           *buf = '\0';
 
-    first_delim = strchr(tmpstr, ':');
-    if (first_delim) {
-       *first_delim = '\0';
-       first_delim++;
-       second_delim = strchr(first_delim,':');
-       if(!second_delim) {
-           amfree(tmpstr);
-           return(NULL);
-       }
-       *second_delim = '\0';
-       second_delim++;
+           tokenval.v.s = tkbuf;
 
-       for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) {
-           if(kt->keyword && strcmp(kt->keyword, second_delim) == 0)
-               break;
+           if (token_overflow) tok = CONF_UNKNOWN;
+           else if (exp == CONF_IDENT) tok = CONF_IDENT;
+           else tok = lookup_keyword(tokenval.v.s);
        }
+       else if (isdigit(ch)) { /* integer */
+           sign = 1;
 
-       if(kt->token == CONF_UNKNOWN)
-           return NULL;
+negative_number: /* look for goto negative_number below sign is set there */
+           am64 = 0;
+           do {
+               am64 = am64 * 10 + (ch - '0');
+               ch = conftoken_getc();
+           } while (isdigit(ch));
 
-       if (strcmp(tmpstr, "TAPETYPE") == 0) {
-           tp = lookup_tapetype(first_delim);
-           if (!tp) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
-           }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&tp->value[np->parm], 0, ""));
-       } else if (strcmp(tmpstr, "DUMPTYPE") == 0) {
-           dp = lookup_dumptype(first_delim);
-           if (!dp) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
+           if (ch != '.') {
+               if (exp == CONF_INT) {
+                   tok = CONF_INT;
+                   tokenval.v.i = sign * (int)am64;
+               } else if (exp != CONF_REAL) {
+                   tok = CONF_AM64;
+                   tokenval.v.am64 = (off_t)sign * am64;
+               } else {
+                   /* automatically convert to real when expected */
+                   tokenval.v.r = (double)sign * (double)am64;
+                   tok = CONF_REAL;
+               }
+           } else {
+               /* got a real number, not an int */
+               tokenval.v.r = sign * (double) am64;
+               am64 = 0;
+               d = 1;
+               ch = conftoken_getc();
+               while (isdigit(ch)) {
+                   am64 = am64 * 10 + (ch - '0');
+                   d = d * 10;
+                   ch = conftoken_getc();
+               }
+               tokenval.v.r += sign * ((double)am64) / d;
+               tok = CONF_REAL;
            }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&dp->value[np->parm], 0, ""));
-       } else if (strcmp(tmpstr, "HOLDINGDISK") == 0) {
-           hp = lookup_holdingdisk(first_delim);
-           if (!hp) {
-               amfree(tmpstr);
-               return(NULL);
+
+           if (ch != EOF &&  conftoken_ungetc(ch) == EOF) {
+               if (ferror(current_file)) {
+                   conf_parserror(_("Pushback of '%c' failed: %s"),
+                                  ch, strerror(ferror(current_file)));
+               } else {
+                   conf_parserror(_("Pushback of '%c' failed: EOF"), ch);
+               }
            }
-           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
+       } else switch(ch) {
+       case '"':                       /* string */
+           buf = tkbuf;
+           token_overflow = 0;
+           inquote = 1;
+           *buf++ = (char)ch;
+           while (inquote && ((ch = conftoken_getc()) != EOF)) {
+               if (ch == '\n') {
+                   if (!escape)
+                       break;
+                   escape = 0;
+                   buf--; /* Consume escape in buffer */
+               } else if (ch == '\\') {
+                   escape = 1;
+               } else {
+                   if (ch == '"') {
+                       if (!escape)
+                           inquote = 0;
+                   }
+                   escape = 0;
+               }
+
+               if(buf >= &tkbuf[sizeof(tkbuf) - 1]) {
+                   if (!token_overflow) {
+                       conf_parserror(_("string too long: %.20s..."), tkbuf);
+                   }
+                   token_overflow = 1;
+                   break;
+               }
+               *buf++ = (char)ch;
            }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&hp->value[np->parm], 0, ""));
-       } else if (strcmp(tmpstr, "INTERFACE") == 0) {
-           ip = lookup_interface(first_delim);
-           if (!ip) {
-               amfree(tmpstr);
-               return(NULL);
+           *buf = '\0';
+
+           /*
+            * A little manuver to leave a fully unquoted, unallocated  string
+            * in tokenval.v.s
+            */
+           tmps = unquote_string(tkbuf);
+           strncpy(tkbuf, tmps, sizeof(tkbuf));
+           amfree(tmps);
+           tokenval.v.s = tkbuf;
+
+           tok = (token_overflow) ? CONF_UNKNOWN :
+                       (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING;
+           break;
+
+       case '-':
+           ch = conftoken_getc();
+           if (isdigit(ch)) {
+               sign = -1;
+               goto negative_number;
            }
-           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
+           else {
+               if (ch != EOF && conftoken_ungetc(ch) == EOF) {
+                   if (ferror(current_file)) {
+                       conf_parserror(_("Pushback of '%c' failed: %s"),
+                                      ch, strerror(ferror(current_file)));
+                   } else {
+                       conf_parserror(_("Pushback of '%c' failed: EOF"), ch);
+                   }
+               }
+               tok = CONF_UNKNOWN;
            }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&ip->value[np->parm], 0, ""));
-       } else {
-           amfree(tmpstr);
-           return(NULL);
-       }
-    } else {
-       for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) {
-           if(kt->keyword && strcmp(kt->keyword, tmpstr) == 0)
-               break;
-       }
+           break;
 
-       if(kt->token == CONF_UNKNOWN)
-           return NULL;
+       case ',':
+           tok = CONF_COMMA;
+           break;
 
-       for(np = my_var; np->token != CONF_UNKNOWN; np++) {
-           if(np->token == kt->token)
-               break;
-       }
+       case '{':
+           tok = CONF_LBRACE;
+           break;
+
+       case '}':
+           tok = CONF_RBRACE;
+           break;
+
+       case '\n':
+           tok = CONF_NL;
+           break;
 
-       if(np->token == CONF_UNKNOWN) return NULL;
+       case EOF:
+           tok = CONF_END;
+           break;
 
-       tmpstr = stralloc(conf_print(&conf_data[np->parm], 0, ""));
+       default:
+           tok = CONF_UNKNOWN;
+           break;
+       }
     }
 
-    return tmpstr;
-}
+    if (exp != CONF_ANY && tok != exp) {
+       char *str;
+       keytab_t *kwp;
 
+       switch(exp) {
+       case CONF_LBRACE:
+           str = "\"{\"";
+           break;
 
-char *
-getconf_list(
-    char *listname)
-{
-    char *result = NULL;
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
+       case CONF_RBRACE:
+           str = "\"}\"";
+           break;
 
-    if (strcasecmp(listname,"tapetype") == 0) {
-       result = stralloc("");
-       for(tp = tapelist; tp != NULL; tp=tp->next) {
-           result = vstrextend(&result, tp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"dumptype") == 0) {
-       result = stralloc("");
-       for(dp = dumplist; dp != NULL; dp=dp->next) {
-           result = vstrextend(&result, dp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"holdingdisk") == 0) {
-       result = stralloc("");
-       for(hp = holdingdisks; hp != NULL; hp=hp->next) {
-           result = vstrextend(&result, hp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"interface") == 0) {
-       result = stralloc("");
-       for(ip = interface_list; ip != NULL; ip=ip->next) {
-           result = vstrextend(&result, ip->name, "\n", NULL);
-       }
-    }
-    return result;
-}
+       case CONF_COMMA:
+           str = "\",\"";
+           break;
 
+       case CONF_NL:
+           str = _("end of line");
+           break;
 
-int
-getconf_seen(
-    confparm_t parm)
-{
-    return(conf_data[parm].seen);
-}
+       case CONF_END:
+           str = _("end of file");
+           break;
 
-int
-getconf_boolean(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_BOOL) {
-       error("getconf_boolean: parm is not a CONFTYPE_BOOL");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.i != 0);
-}
+       case CONF_INT:
+           str = _("an integer");
+           break;
 
-int
-getconf_int(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_INT) {
-       error("getconf_int: parm is not a CONFTYPE_INT");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.i);
-}
+       case CONF_REAL:
+           str = _("a real number");
+           break;
 
-long
-getconf_long(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_LONG) {
-       error("getconf_long: parm is not a CONFTYPE_LONG");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.l);
-}
+       case CONF_STRING:
+           str = _("a quoted string");
+           break;
 
-time_t
-getconf_time(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_TIME) {
-       error("getconf_time: parm is not a CONFTYPE_TIME");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.t);
-}
+       case CONF_IDENT:
+           str = _("an identifier");
+           break;
 
-ssize_t
-getconf_size(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_SIZE) {
-       error("getconf_size: parm is not a CONFTYPE_SIZE");
-       /*NOTREACHED*/
+       default:
+           for(kwp = keytable; kwp->keyword != NULL; kwp++) {
+               if (exp == kwp->token)
+                   break;
+           }
+           if (kwp->keyword == NULL)
+               str = _("token not");
+           else
+               str = kwp->keyword;
+           break;
+       }
+       conf_parserror(_("%s is expected"), str);
+       tok = exp;
+       if (tok == CONF_INT)
+           tokenval.v.i = 0;
+       else
+           tokenval.v.s = "";
     }
-    return(conf_data[parm].v.size);
 }
 
-off_t
-getconf_am64(
-    confparm_t parm)
+static void
+unget_conftoken(void)
 {
-    if (conf_data[parm].type != CONFTYPE_AM64) {
-       error("getconf_am64: parm is not a CONFTYPE_AM64");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.am64);
+    assert(!token_pushed);
+    token_pushed = 1;
+    pushed_tok = tok;
+    tok = CONF_UNKNOWN;
 }
 
-double
-getconf_real(
-    confparm_t parm)
+static int
+conftoken_getc(void)
 {
-    if (conf_data[parm].type != CONFTYPE_REAL) {
-       error("getconf_real: parm is not a CONFTYPE_REAL");
-       /*NOTREACHED*/
-    }
-    return(conf_data[parm].v.r);
+    if(current_line == NULL)
+       return getc(current_file);
+    if(*current_char == '\0')
+       return -1;
+    return(*current_char++);
 }
 
-char *
-getconf_str(
-    confparm_t parm)
+static int
+conftoken_ungetc(
+    int c)
 {
-    if (conf_data[parm].type != CONFTYPE_STRING &&
-        conf_data[parm].type != CONFTYPE_IDENT) {
-       error("getconf_str: parm is not a CONFTYPE_STRING|CONFTYPE_IDENT: %d", parm);
-       /*NOTREACHED*/
+    if(current_line == NULL)
+       return ungetc(c, current_file);
+    else if(current_char > current_line) {
+       if(c == -1)
+           return c;
+       current_char--;
+       if(*current_char != c) {
+           error(_("*current_char != c   : %c %c"), *current_char, c);
+           /* NOTREACHED */
+       }
+    } else {
+       error(_("current_char == current_line"));
+       /* NOTREACHED */
     }
-    return(conf_data[parm].v.s);
+    return c;
 }
 
-int
-getconf_taperalgo(
-    confparm_t parm)
+/*
+ * Parser Implementation
+ */
+
+static gboolean
+read_conffile(
+    char *filename,
+    gboolean is_client)
 {
-    if (conf_data[parm].type != CONFTYPE_TAPERALGO) {
-       error("getconf_taperalgo: parm is not a CONFTYPE_TAPERALGO");
-       /*NOTREACHED*/
+    /* Save global locations. */
+    FILE *save_file     = current_file;
+    char *save_filename = current_filename;
+    int  save_line_num  = current_line_num;
+    int        rc;
+
+    if (is_client) {
+       keytable = client_keytab;
+       parsetable = client_var;
+    } else {
+       keytable = server_keytab;
+       parsetable = server_var;
     }
-    return(conf_data[parm].v.i);
-}
+    current_filename = config_dir_relative(filename);
 
-int*
-getconf_intrange(
-    confparm_t parm)
-{
-    if (conf_data[parm].type != CONFTYPE_INTRANGE) {
-       error("getconf_intrange: parm is not a CONFTYPE_INTRANGE");
-       /*NOTREACHED*/
+    if ((current_file = fopen(current_filename, "r")) == NULL) {
+       g_fprintf(stderr, _("could not open conf file \"%s\": %s\n"), current_filename,
+               strerror(errno));
+       got_parserror = TRUE;
+       goto finish;
     }
-    return(conf_data[parm].v.intrange);
-}
 
-holdingdisk_t *
-getconf_holdingdisks(
-    void)
-{
-    return holdingdisks;
-}
-
-dumptype_t *
-lookup_dumptype(
-    char *str)
-{
-    dumptype_t *p;
-
-    for(p = dumplist; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-tapetype_t *
-lookup_tapetype(
-    char *str)
-{
-    tapetype_t *p;
-
-    for(p = tapelist; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-holdingdisk_t *
-lookup_holdingdisk(
-    char *str)
-{
-    holdingdisk_t *p;
-
-    for(p = holdingdisks; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-interface_t *
-lookup_interface(
-    char *str)
-{
-#ifndef __lint
-    interface_t *p;
-#endif
-
-    if (str == NULL)
-       return interface_list;
-
-#ifndef __lint
-    for (p = interface_list; p != NULL; p = p->next) {
-       if (strcasecmp(p->name, str) == 0)
-           return p;
-    }
-#endif
-    return NULL;
-}
-
-
-/*
-** ------------------------
-**  Internal routines
-** ------------------------
-*/
-
-
-static void
-init_defaults(
-    void)
-{
-    char *s;
-
-    /* defaults for exported variables */
-
-#ifdef DEFAULT_CONFIG
-    s = DEFAULT_CONFIG;
-#else
-    s = "YOUR ORG";
-#endif
-#ifdef DEFAULT_CONFIG
-    s = DEFAULT_CONFIG;
-#else
-    s = "";
-#endif
-    conf_init_string(&conf_data[CNF_CONF], s);
-#ifdef DEFAULT_SERVER
-    s = DEFAULT_SERVER;
-#else
-    s = "";
-#endif
-    conf_init_string(&conf_data[CNF_INDEX_SERVER], s);
-
-
-#ifdef DEFAULT_TAPE_SERVER
-    s = DEFAULT_TAPE_SERVER;
-#else
-#ifdef DEFAULT_SERVER
-    s = DEFAULT_SERVER;
-#else
-    s = "";
-#endif
-#endif
-    conf_init_string(&conf_data[CNF_TAPE_SERVER], s);
-    conf_init_string(&conf_data[CNF_AUTH], "bsd");
-    conf_init_string(&conf_data[CNF_SSH_KEYS], "");
-    conf_init_string(&conf_data[CNF_AMANDAD_PATH], "");
-    conf_init_string(&conf_data[CNF_CLIENT_USERNAME], "");
-#ifdef GNUTAR_LISTED_INCREMENTAL_DIR
-    conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR],
-                     GNUTAR_LISTED_INCREMENTAL_DIR);
-#else
-    conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR], NULL);
-#endif
-    conf_init_string(&conf_data[CNF_AMANDATES], AMANDATES_FILE);
-    conf_init_string(&conf_data[CNF_KRB5KEYTAB], "/.amanda-v5-keytab");
-    conf_init_string(&conf_data[CNF_KRB5PRINCIPAL], "service/amanda");
-
-    conf_init_string(&conf_data[CNF_ORG], s);
-    conf_init_string(&conf_data[CNF_MAILTO], "operators");
-    conf_init_string(&conf_data[CNF_DUMPUSER], CLIENT_LOGIN);
-#ifdef DEFAULT_TAPE_DEVICE
-    s = DEFAULT_TAPE_DEVICE;
-#else
-    s = NULL;
-#endif
-    conf_init_string(&conf_data[CNF_TAPEDEV], s);
-#ifdef DEFAULT_CHANGER_DEVICE
-    s = DEFAULT_CHANGER_DEVICE;
-#else
-    s = "/dev/null";
-#endif
-    conf_init_string(&conf_data[CNF_CHNGRDEV], s);
-    conf_init_string(&conf_data[CNF_CHNGRFILE], "/usr/adm/amanda/changer-status");
-#ifdef DEFAULT_RAW_TAPE_DEVICE
-    s = DEFAULT_RAW_TAPE_DEVICE;
-#else
-    s = "/dev/rawft0";
-#endif
-    conf_init_string   (&conf_data[CNF_LABELSTR]             , ".*");
-    conf_init_string   (&conf_data[CNF_TAPELIST]             , "tapelist");
-    conf_init_string   (&conf_data[CNF_DISKFILE]             , "disklist");
-    conf_init_string   (&conf_data[CNF_INFOFILE]             , "/usr/adm/amanda/curinfo");
-    conf_init_string   (&conf_data[CNF_LOGDIR]               , "/usr/adm/amanda");
-    conf_init_string   (&conf_data[CNF_INDEXDIR]             , "/usr/adm/amanda/index");
-    conf_init_ident    (&conf_data[CNF_TAPETYPE]             , "EXABYTE");
-    conf_init_int      (&conf_data[CNF_DUMPCYCLE]            , 10);
-    conf_init_int      (&conf_data[CNF_RUNSPERCYCLE]         , 0);
-    conf_init_int      (&conf_data[CNF_TAPECYCLE]            , 15);
-    conf_init_int      (&conf_data[CNF_NETUSAGE]             , 300);
-    conf_init_int      (&conf_data[CNF_INPARALLEL]           , 10);
-    conf_init_string   (&conf_data[CNF_DUMPORDER]            , "ttt");
-    conf_init_int      (&conf_data[CNF_BUMPPERCENT]          , 0);
-    conf_init_am64     (&conf_data[CNF_BUMPSIZE]             , (off_t)10*1024);
-    conf_init_real     (&conf_data[CNF_BUMPMULT]             , 1.5);
-    conf_init_int      (&conf_data[CNF_BUMPDAYS]             , 2);
-    conf_init_string   (&conf_data[CNF_TPCHANGER]            , "");
-    conf_init_int      (&conf_data[CNF_RUNTAPES]             , 1);
-    conf_init_int      (&conf_data[CNF_MAXDUMPS]             , 1);
-    conf_init_int      (&conf_data[CNF_ETIMEOUT]             , 300);
-    conf_init_int      (&conf_data[CNF_DTIMEOUT]             , 1800);
-    conf_init_int      (&conf_data[CNF_CTIMEOUT]             , 30);
-    conf_init_int      (&conf_data[CNF_TAPEBUFS]             , 20);
-    conf_init_string   (&conf_data[CNF_RAWTAPEDEV]           , s);
-    conf_init_string   (&conf_data[CNF_PRINTER]              , "");
-    conf_init_bool     (&conf_data[CNF_AUTOFLUSH]            , 0);
-    conf_init_int      (&conf_data[CNF_RESERVE]              , 100);
-    conf_init_am64     (&conf_data[CNF_MAXDUMPSIZE]          , (off_t)-1);
-    conf_init_string   (&conf_data[CNF_COLUMNSPEC]           , "");
-    conf_init_bool     (&conf_data[CNF_AMRECOVER_DO_FSF]     , 1);
-    conf_init_string   (&conf_data[CNF_AMRECOVER_CHANGER]    , "");
-    conf_init_bool     (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1);
-    conf_init_taperalgo(&conf_data[CNF_TAPERALGO]            , 0);
-    conf_init_string   (&conf_data[CNF_DISPLAYUNIT]          , "k");
-    conf_init_string   (&conf_data[CNF_KRB5KEYTAB]           , "/.amanda-v5-keytab");
-    conf_init_string   (&conf_data[CNF_KRB5PRINCIPAL]        , "service/amanda");
-    conf_init_string   (&conf_data[CNF_LABEL_NEW_TAPES]      , "");
-    conf_init_bool     (&conf_data[CNF_USETIMESTAMPS]        , 0);
-    conf_init_int      (&conf_data[CNF_CONNECT_TRIES]        , 3);
-    conf_init_int      (&conf_data[CNF_REP_TRIES]            , 5);
-    conf_init_int      (&conf_data[CNF_REQ_TRIES]            , 3);
-    conf_init_int      (&conf_data[CNF_DEBUG_AMANDAD]        , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_AMIDXTAPED]     , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_AMINDEXD]       , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_AMRECOVER]      , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_AUTH]           , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_EVENT]          , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_HOLDING]        , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_PROTOCOL]       , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_PLANNER]        , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_DRIVER]         , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_DUMPER]         , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_CHUNKER]        , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_TAPER]          , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_SELFCHECK]      , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_SENDSIZE]       , 0);
-    conf_init_int      (&conf_data[CNF_DEBUG_SENDBACKUP]     , 0);
-#ifdef UDPPORTRANGE
-    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , UDPPORTRANGE);
-#else
-    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , 512, 1023);
-#endif
-#ifdef LOW_TCPPORTRANGE
-    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , LOW_TCPPORTRANGE);
-#else
-    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , 512, 1023);
-#endif
-#ifdef TCPPORTRANGE
-    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , TCPPORTRANGE);
-#else
-    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , 0, 0);
-#endif
-
-    /* defaults for internal variables */
-
-    conf_line_num = got_parserror = 0;
-    allow_overwrites = 0;
-    token_pushed = 0;
-
-    while(holdingdisks != NULL) {
-       holdingdisk_t *hp;
-
-       hp = holdingdisks;
-       holdingdisks = holdingdisks->next;
-       amfree(hp);
-    }
-    num_holdingdisks = 0;
-
-    /* free any previously declared dump, tape and interface types */
-
-    while(dumplist != NULL) {
-       dumptype_t *dp;
-
-       dp = dumplist;
-       dumplist = dumplist->next;
-       amfree(dp);
-    }
-    while(tapelist != NULL) {
-       tapetype_t *tp;
-
-       tp = tapelist;
-       tapelist = tapelist->next;
-       amfree(tp);
-    }
-    while(interface_list != NULL) {
-       interface_t *ip;
-
-       ip = interface_list;
-       interface_list = interface_list->next;
-       amfree(ip);
-    }
-
-    /* create some predefined dumptypes for backwards compatability */
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-COMPRESS");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_NONE);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-FAST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_FAST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-BEST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_BEST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-CUST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_CUST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("SRVCOMPRESS");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_SERVER_FAST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("BSD-AUTH");
-    dpcur.seen = -1;
-    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "BSD");
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("KRB4-AUTH");
-    dpcur.seen = -1;
-    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "KRB4");
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-RECORD");
-    dpcur.seen = -1;
-    conf_set_bool(&dpcur.value[DUMPTYPE_RECORD], 0);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-HOLD");
-    dpcur.seen = -1;
-    conf_set_holding(&dpcur.value[DUMPTYPE_HOLDINGDISK], HOLD_NEVER);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-FULL");
-    dpcur.seen = -1;
-    conf_set_strategy(&dpcur.value[DUMPTYPE_STRATEGY], DS_NOFULL);
-    save_dumptype();
-    conffile_init = 1;
-}
-
-static void
-read_conffile_recursively(
-    char *filename)
-{
-    /* Save globals used in read_confline(), elsewhere. */
-    int  save_line_num  = conf_line_num;
-    FILE *save_conf     = conf_conf;
-    char *save_confname = conf_confname;
-    int        rc;
-
-    if (*filename == '/' || config_dir == NULL) {
-       conf_confname = stralloc(filename);
-    } else {
-       conf_confname = stralloc2(config_dir, filename);
-    }
-
-    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
-       fprintf(stderr, "could not open conf file \"%s\": %s\n", conf_confname,
-               strerror(errno));
-       amfree(conf_confname);
-       got_parserror = -1;
-       return;
-    }
+    current_line_num = 0;
 
-    conf_line_num = 0;
-
-    /* read_confline() can invoke us recursively via "includefile" */
     do {
-       rc = read_confline();
+       /* read_confline() can invoke us recursively via "includefile" */
+       rc = read_confline(is_client);
     } while (rc != 0);
-    afclose(conf_conf);
-
-    amfree(conf_confname);
 
-    /* Restore servers */
-    conf_line_num = save_line_num;
-    conf_conf     = save_conf;
-    conf_confname = save_confname;
-}
+    afclose(current_file);
 
+finish:
+    amfree(current_filename);
 
-/* ------------------------ */
+    /* Restore servers */
+    current_line_num = save_line_num;
+    current_file     = save_file;
+    current_filename = save_filename;
 
+    return !got_parserror;
+}
 
-static int
+static gboolean
 read_confline(
-    void)
+    gboolean is_client)
 {
-    t_conf_var *np;
+    conf_var_t *np;
 
-    keytable = server_keytab;
-
-    conf_line_num += 1;
+    current_line_num += 1;
     get_conftoken(CONF_ANY);
     switch(tok) {
     case CONF_INCLUDEFILE:
-       {
-           char *fn;
-           char *cname;
-
-           get_conftoken(CONF_STRING);
-           fn = tokenval.v.s;
-           if (*fn == '/' || config_dir == NULL) {
-               cname = stralloc(fn);
-           } else {
-               cname = stralloc2(config_dir, fn);
-           }
-           if ( cname != NULL &&  (access(cname, R_OK) == 0)) {
-               read_conffile_recursively(cname);
-               amfree(cname);
-           } else {
-               conf_parserror("cannot open %s: %s\n", fn, strerror(errno));
-           }
-           amfree(cname);
-           
-       }
+       get_conftoken(CONF_STRING);
+       if (!read_conffile(tokenval.v.s, is_client))
+           return 0;
        break;
 
     case CONF_HOLDING:
-       get_holdingdisk();
+       if (is_client) {
+           handle_invalid_keyword(tokenval.v.s);
+       } else {
+           get_holdingdisk();
+       }
        break;
 
     case CONF_DEFINE:
-       get_conftoken(CONF_ANY);
-       if(tok == CONF_DUMPTYPE) get_dumptype();
-       else if(tok == CONF_TAPETYPE) get_tapetype();
-       else if(tok == CONF_INTERFACE) get_interface();
-       else conf_parserror("DUMPTYPE, INTERFACE or TAPETYPE expected");
+       if (is_client) {
+           handle_invalid_keyword(tokenval.v.s);
+       } else {
+           get_conftoken(CONF_ANY);
+           if(tok == CONF_DUMPTYPE) get_dumptype();
+           else if(tok == CONF_TAPETYPE) get_tapetype();
+           else if(tok == CONF_INTERFACE) get_interface();
+           else conf_parserror(_("DUMPTYPE, INTERFACE or TAPETYPE expected"));
+       }
        break;
 
     case CONF_NL:      /* empty line */
@@ -1569,17 +1455,19 @@ read_confline(
     case CONF_END:     /* end of file */
        return 0;
 
+    /* if it's not a known punctuation mark, then check the parse table and use the
+     * read_function we find there. */
     default:
        {
-           for(np = server_var; np->token != CONF_UNKNOWN; np++) 
+           for(np = parsetable; np->token != CONF_UNKNOWN; np++) 
                if(np->token == tok) break;
 
            if(np->token == CONF_UNKNOWN) {
-               conf_parserror("configuration keyword expected");
+                handle_invalid_keyword(tokenval.v.s);
            } else {
                np->read_function(np, &conf_data[np->parm]);
-               if(np->validate)
-                   np->validate(np, &conf_data[np->parm]);
+               if(np->validate_function)
+                   np->validate_function(np, &conf_data[np->parm]);
            }
        }
     }
@@ -1589,28 +1477,133 @@ read_confline(
 }
 
 static void
-get_holdingdisk(
-    void)
-{
-    char *prefix;
-    int save_overwrites;
+handle_invalid_keyword(
+    const char * token)
+{
+    /* Procedure for deprecated keywords:
+     * 1) At time of deprecation, add to warning_deprecated below.
+     *    Note the date of deprecation.
+     * 2) After two years, move the keyword to error_deprecated below.
+     *    Note the date of the move.
+     * 3) After two more years, drop the token entirely. */
+
+    static const char * warning_deprecated[] = {
+        "rawtapedev",  /* 2007-01-23 */
+        "tapebufs",    /* 2007-10-15 */
+       "netusage",    /* historical since 1997-08-11, deprecated 2007-10-23 */
+        NULL
+    };
+    static const char * error_deprecated[] = {
+        NULL
+    };
+    const char ** s;
+
+    for (s = warning_deprecated; *s != NULL; s ++) {
+        if (strcmp(*s, token) == 0) {
+            conf_parswarn(_("warning: Keyword %s is deprecated."),
+                           token);
+            break;
+        }
+    }
+    if (*s == NULL) {
+        for (s = error_deprecated; *s != NULL; s ++) {
+            if (strcmp(*s, token) == 0) {
+                conf_parserror(_("error: Keyword %s is deprecated."),
+                               token);
+                return;
+            }
+        }
+    }
+    if (*s == NULL) {
+        conf_parserror(_("configuration keyword expected"));
+    }
 
-    save_overwrites = allow_overwrites;
-    allow_overwrites = 1;
+    for (;;) {
+        char c = conftoken_getc();
+        if (c == '\n' || c == -1) {
+            conftoken_ungetc(c);
+            return;
+        }
+    }
 
-    init_holdingdisk_defaults();
+    g_assert_not_reached();
+}
+
+static void
+read_block(
+    conf_var_t    *read_var,
+    val_t    *valarray,
+    char     *errormsg,
+    int       read_brace,
+    void      (*copy_function)(void))
+{
+    conf_var_t *np;
+    int    done;
+
+    if(read_brace) {
+       get_conftoken(CONF_LBRACE);
+       get_conftoken(CONF_NL);
+    }
+
+    done = 0;
+    do {
+       current_line_num += 1;
+       get_conftoken(CONF_ANY);
+       switch(tok) {
+       case CONF_RBRACE:
+           done = 1;
+           break;
+       case CONF_NL:   /* empty line */
+           break;
+       case CONF_END:  /* end of file */
+           done = 1;
+           break;
+
+       /* inherit from a "parent" */
+        case CONF_IDENT:
+        case CONF_STRING:
+           if(copy_function) 
+               copy_function();
+           else
+               conf_parserror(_("ident not expected"));
+           break;
+       default:
+           {
+               for(np = read_var; np->token != CONF_UNKNOWN; np++)
+                   if(np->token == tok) break;
+
+               if(np->token == CONF_UNKNOWN)
+                   conf_parserror(errormsg);
+               else {
+                   np->read_function(np, &valarray[np->parm]);
+                   if(np->validate_function)
+                       np->validate_function(np, &valarray[np->parm]);
+               }
+           }
+       }
+       if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE)
+           get_conftoken(CONF_NL);
+    } while(!done);
+}
+
+static void
+get_holdingdisk(
+    void)
+{
+    int save_overwrites;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_holdingdisk_defaults();
 
     get_conftoken(CONF_IDENT);
     hdcur.name = stralloc(tokenval.v.s);
-    hdcur.seen = conf_line_num;
+    hdcur.seen = current_line_num;
 
-    prefix = vstralloc( "HOLDINGDISK:", hdcur.name, ":", NULL);
-    read_block(program_options, holding_var, server_keytab, hdcur.value, prefix,
-              "holding disk parameter expected", 1, NULL);
-    amfree(prefix);
+    read_block(holding_var, hdcur.value,
+              _("holding disk parameter expected"), 1, NULL);
     get_conftoken(CONF_NL);
-
-    hdcur.disksize = holdingdisk_get_disksize(&hdcur);
     save_holdingdisk();
 
     allow_overwrites = save_overwrites;
@@ -1620,14 +1613,11 @@ static void
 init_holdingdisk_defaults(
     void)
 {
-    conf_init_string(&hdcur.value[HOLDING_COMMENT]  , "");
-    conf_init_string(&hdcur.value[HOLDING_DISKDIR]  , "");
+    conf_init_str(&hdcur.value[HOLDING_COMMENT]  , "");
+    conf_init_str(&hdcur.value[HOLDING_DISKDIR]  , "");
     conf_init_am64(&hdcur.value[HOLDING_DISKSIZE] , (off_t)0);
                     /* 1 Gb = 1M counted in 1Kb blocks */
     conf_init_am64(&hdcur.value[HOLDING_CHUNKSIZE], (off_t)1024*1024);
-
-    hdcur.up = (void *)0;
-    hdcur.disksize = 0LL;
 }
 
 static void
@@ -1638,13 +1628,14 @@ save_holdingdisk(
 
     hp = alloc(sizeof(holdingdisk_t));
     *hp = hdcur;
-    hp->next = holdingdisks;
-    holdingdisks = hp;
-
-    num_holdingdisks++;
+    hp->next = holdinglist;
+    holdinglist = hp;
 }
 
 
+/* WARNING:
+ * This function is called both from this module and from diskfile.c. Modify
+ * with caution. */
 dumptype_t *
 read_dumptype(
     char *name,
@@ -1655,20 +1646,19 @@ read_dumptype(
     int save_overwrites;
     FILE *saved_conf = NULL;
     char *saved_fname = NULL;
-    char *prefix;
 
     if (from) {
-       saved_conf = conf_conf;
-       conf_conf = from;
+       saved_conf = current_file;
+       current_file = from;
     }
 
     if (fname) {
-       saved_fname = conf_confname;
-       conf_confname = fname;
+       saved_fname = current_filename;
+       current_filename = fname;
     }
 
     if (linenum)
-       conf_line_num = *linenum;
+       current_line_num = *linenum;
 
     save_overwrites = allow_overwrites;
     allow_overwrites = 1;
@@ -1680,14 +1670,13 @@ read_dumptype(
        get_conftoken(CONF_IDENT);
        dpcur.name = stralloc(tokenval.v.s);
     }
-    dpcur.seen = conf_line_num;
-
-    prefix = vstralloc( "DUMPTYPE:", dpcur.name, ":", NULL);
-    read_block(program_options, dumptype_var, server_keytab, dpcur.value,
-              prefix, "dumptype parameter expected",
-              (name == NULL), *copy_dumptype);
-    amfree(prefix);
-    if(!name)
+    dpcur.seen = current_line_num;
+
+    read_block(dumptype_var, dpcur.value,
+              _("dumptype parameter expected"),
+              (name == NULL), copy_dumptype);
+
+    if(!name) /* !name => reading disklist, not conffile */
        get_conftoken(CONF_NL);
 
     /* XXX - there was a stupidity check in here for skip-incr and
@@ -1698,13 +1687,13 @@ read_dumptype(
     allow_overwrites = save_overwrites;
 
     if (linenum)
-       *linenum = conf_line_num;
+       *linenum = current_line_num;
 
     if (fname)
-       conf_confname = saved_fname;
+       current_filename = saved_fname;
 
     if (from)
-       conf_conf = saved_conf;
+       current_file = saved_conf;
 
     return lookup_dumptype(dpcur.name);
 }
@@ -1719,16 +1708,16 @@ static void
 init_dumptype_defaults(void)
 {
     dpcur.name = NULL;
-    conf_init_string   (&dpcur.value[DUMPTYPE_COMMENT]           , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_PROGRAM]           , "DUMP");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRVCOMPPROG]       , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNTCOMPPROG]      , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_ENCRYPT]       , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT]      , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_AMANDAD_PATH]      , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLIENT_USERNAME]   , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SSH_KEYS]          , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SECURITY_DRIVER]   , "BSD");
+    conf_init_str   (&dpcur.value[DUMPTYPE_COMMENT]           , "");
+    conf_init_str   (&dpcur.value[DUMPTYPE_PROGRAM]           , "DUMP");
+    conf_init_str   (&dpcur.value[DUMPTYPE_SRVCOMPPROG]       , "");
+    conf_init_str   (&dpcur.value[DUMPTYPE_CLNTCOMPPROG]      , "");
+    conf_init_str   (&dpcur.value[DUMPTYPE_SRV_ENCRYPT]       , "");
+    conf_init_str   (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT]      , "");
+    conf_init_str   (&dpcur.value[DUMPTYPE_AMANDAD_PATH]      , "X");
+    conf_init_str   (&dpcur.value[DUMPTYPE_CLIENT_USERNAME]   , "X");
+    conf_init_str   (&dpcur.value[DUMPTYPE_SSH_KEYS]          , "X");
+    conf_init_str   (&dpcur.value[DUMPTYPE_SECURITY_DRIVER]   , "BSD");
     conf_init_exinclude(&dpcur.value[DUMPTYPE_EXCLUDE]);
     conf_init_exinclude(&dpcur.value[DUMPTYPE_INCLUDE]);
     conf_init_priority (&dpcur.value[DUMPTYPE_PRIORITY]          , 1);
@@ -1744,12 +1733,12 @@ init_dumptype_defaults(void)
     conf_init_estimate (&dpcur.value[DUMPTYPE_ESTIMATE]          , ES_CLIENT);
     conf_init_compress (&dpcur.value[DUMPTYPE_COMPRESS]          , COMP_FAST);
     conf_init_encrypt  (&dpcur.value[DUMPTYPE_ENCRYPT]           , ENCRYPT_NONE);
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT]   , "-d");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT]  , "-d");
+    conf_init_str   (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT]   , "-d");
+    conf_init_str   (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT]  , "-d");
     conf_init_rate     (&dpcur.value[DUMPTYPE_COMPRATE]          , 0.50, 0.50);
     conf_init_am64     (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE]    , (off_t)0);
     conf_init_am64     (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (off_t)10 * 1024);
-    conf_init_string   (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER]  , NULL);
+    conf_init_str   (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER]  , NULL);
     conf_init_bool     (&dpcur.value[DUMPTYPE_RECORD]            , 1);
     conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_INCR]         , 0);
     conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_FULL]         , 0);
@@ -1767,7 +1756,7 @@ save_dumptype(void)
     dp = lookup_dumptype(dpcur.name);
 
     if(dp != (dumptype_t *)0) {
-       conf_parserror("dumptype %s already defined on line %d", dp->name, dp->seen);
+       conf_parserror(_("dumptype %s already defined on line %d"), dp->name, dp->seen);
        return;
     }
 
@@ -1795,7 +1784,7 @@ copy_dumptype(void)
     dt = lookup_dumptype(tokenval.v.s);
 
     if(dt == NULL) {
-       conf_parserror("dumptype parameter expected");
+       conf_parserror(_("dumptype parameter expected"));
        return;
     }
 
@@ -1811,7 +1800,6 @@ static void
 get_tapetype(void)
 {
     int save_overwrites;
-    char *prefix;
 
     save_overwrites = allow_overwrites;
     allow_overwrites = 1;
@@ -1820,12 +1808,10 @@ get_tapetype(void)
 
     get_conftoken(CONF_IDENT);
     tpcur.name = stralloc(tokenval.v.s);
-    tpcur.seen = conf_line_num;
+    tpcur.seen = current_line_num;
 
-    prefix = vstralloc( "TAPETYPE:", tpcur.name, ":", NULL);
-    read_block(program_options, tapetype_var, server_keytab, tpcur.value,
-              prefix, "tapetype parameter expected", 1, &copy_tapetype);
-    amfree(prefix);
+    read_block(tapetype_var, tpcur.value,
+              _("tapetype parameter expected"), 1, copy_tapetype);
     get_conftoken(CONF_NL);
 
     save_tapetype();
@@ -1836,12 +1822,12 @@ get_tapetype(void)
 static void
 init_tapetype_defaults(void)
 {
-    conf_init_string(&tpcur.value[TAPETYPE_COMMENT]      , "");
-    conf_init_string(&tpcur.value[TAPETYPE_LBL_TEMPL]    , "");
+    conf_init_str(&tpcur.value[TAPETYPE_COMMENT]      , "");
+    conf_init_str(&tpcur.value[TAPETYPE_LBL_TEMPL]    , "");
     conf_init_size  (&tpcur.value[TAPETYPE_BLOCKSIZE]    , DISK_BLOCK_KB);
     conf_init_size  (&tpcur.value[TAPETYPE_READBLOCKSIZE], MAX_TAPE_BLOCK_KB);
-    conf_init_am64  (&tpcur.value[TAPETYPE_LENGTH]       , (off_t)2000);
-    conf_init_am64  (&tpcur.value[TAPETYPE_FILEMARK]     , (off_t)1);
+    conf_init_am64  (&tpcur.value[TAPETYPE_LENGTH]       , ((off_t)2000 * 1024));
+    conf_init_am64  (&tpcur.value[TAPETYPE_FILEMARK]     , (off_t)1000);
     conf_init_int   (&tpcur.value[TAPETYPE_SPEED]        , 200);
     conf_init_bool  (&tpcur.value[TAPETYPE_FILE_PAD]     , 1);
 }
@@ -1855,7 +1841,7 @@ save_tapetype(void)
 
     if(tp != (tapetype_t *)0) {
        amfree(tpcur.name);
-       conf_parserror("tapetype %s already defined on line %d", tp->name, tp->seen);
+       conf_parserror(_("tapetype %s already defined on line %d"), tp->name, tp->seen);
        return;
     }
 
@@ -1882,7 +1868,7 @@ copy_tapetype(void)
     tp = lookup_tapetype(tokenval.v.s);
 
     if(tp == NULL) {
-       conf_parserror("tape type parameter expected");
+       conf_parserror(_("tape type parameter expected"));
        return;
     }
 
@@ -1894,17 +1880,10 @@ copy_tapetype(void)
     }
 }
 
-t_conf_var interface_var [] = {
-   { CONF_COMMENT, CONFTYPE_STRING, read_string, INTER_COMMENT , NULL },
-   { CONF_USE    , CONFTYPE_INT   , read_int   , INTER_MAXUSAGE, validate_positive1 },
-   { CONF_UNKNOWN, CONFTYPE_INT   , NULL       , INTER_INTER   , NULL }
-};
-
 static void
 get_interface(void)
 {
     int save_overwrites;
-    char *prefix;
 
     save_overwrites = allow_overwrites;
     allow_overwrites = 1;
@@ -1913,12 +1892,10 @@ get_interface(void)
 
     get_conftoken(CONF_IDENT);
     ifcur.name = stralloc(tokenval.v.s);
-    ifcur.seen = conf_line_num;
+    ifcur.seen = current_line_num;
 
-    prefix = vstralloc( "INTERFACE:", ifcur.name, ":", NULL);
-    read_block(program_options, interface_var, server_keytab, ifcur.value,
-              prefix, "interface parameter expected", 1, &copy_interface);
-    amfree(prefix);
+    read_block(interface_var, ifcur.value,
+              _("interface parameter expected"), 1, copy_interface);
     get_conftoken(CONF_NL);
 
     save_interface();
@@ -1931,10 +1908,8 @@ get_interface(void)
 static void
 init_interface_defaults(void)
 {
-    conf_init_string(&ifcur.value[INTER_COMMENT] , "");
-    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 300);
-
-    ifcur.curusage = 0;
+    conf_init_str(&ifcur.value[INTER_COMMENT] , "");
+    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 8000);
 }
 
 static void
@@ -1945,7 +1920,7 @@ save_interface(void)
     ip = lookup_interface(ifcur.name);
 
     if(ip != (interface_t *)0) {
-       conf_parserror("interface %s already defined on line %d", ip->name,
+       conf_parserror(_("interface %s already defined on line %d"), ip->name,
                       ip->seen);
        return;
     }
@@ -1967,20 +1942,13 @@ save_interface(void)
 static void
 copy_interface(void)
 {
-/*
-    int i;
-    t_xxx *np;
-    keytab_t *kt;
-    
-    val_t val;
-*/
     interface_t *ip;
     int i;
 
     ip = lookup_interface(tokenval.v.s);
 
     if(ip == NULL) {
-       conf_parserror("interface parameter expected");
+       conf_parserror(_("interface parameter expected"));
        return;
     }
 
@@ -1992,82 +1960,92 @@ copy_interface(void)
     }
 }
 
+/* Read functions */
+
 static void
-get_comprate(
-    t_conf_var *np,
+read_int(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
-    np = np;
-    get_conftoken(CONF_REAL);
-    val->v.rate[0] = tokenval.v.r;
-    val->v.rate[1] = tokenval.v.r;
-    val->seen = tokenval.seen;
-    if(tokenval.v.r < 0) {
-       conf_parserror("full compression rate must be >= 0");
-    }
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_NL:
-       return;
-
-    case CONF_END:
-       return;
-
-    case CONF_COMMA:
-       break;
+    ckseen(&val->seen);
+    val_t__int(val) = get_int();
+}
 
-    default:
-       unget_conftoken();
-    }
+static void
+read_am64(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__am64(val) = get_am64_t();
+}
 
+static void
+read_real(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
     get_conftoken(CONF_REAL);
-    val->v.rate[1] = tokenval.v.r;
-    if(tokenval.v.r < 0) {
-       conf_parserror("incremental compression rate must be >= 0");
-    }
+    val_t__real(val) = tokenval.v.r;
 }
 
 static void
-read_intrange(
-    t_conf_var *np,
+read_str(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
-    np = np;
-    get_conftoken(CONF_INT);
-    val->v.intrange[0] = tokenval.v.i;
-    val->v.intrange[1] = tokenval.v.i;
-    val->seen = tokenval.seen;
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_NL:
-       return;
+    ckseen(&val->seen);
+    get_conftoken(CONF_STRING);
+    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+}
 
-    case CONF_END:
-       return;
+static void
+read_ident(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    get_conftoken(CONF_IDENT);
+    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+}
 
-    case CONF_COMMA:
-       break;
+static void
+read_time(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__time(val) = get_time();
+}
 
-    default:
-       unget_conftoken();
-    }
+static void
+read_size(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__size(val) = get_size();
+}
 
-    get_conftoken(CONF_INT);
-    val->v.intrange[1] = tokenval.v.i;
+static void
+read_bool(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__boolean(val) = get_bool();
 }
 
 static void
-get_compress(
-    t_conf_var *np,
+read_compress(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
     int serv, clie, none, fast, best, custom;
     int done;
     comp_t comp;
 
-    np = np;
     ckseen(&val->seen);
 
     serv = clie = none = fast = best = custom  = 0;
@@ -2110,21 +2088,20 @@ get_compress(
     }
 
     if((int)comp == -1) {
-       conf_parserror("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected");
+       conf_parserror(_("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected"));
        comp = COMP_NONE;
     }
 
-    val->v.i = (int)comp;
+    val_t__compress(val) = (int)comp;
 }
 
 static void
-get_encrypt(
-    t_conf_var *np,
+read_encrypt(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
    encrypt_t encrypt;
 
-   np = np;
    ckseen(&val->seen);
 
    get_conftoken(CONF_ANY);
@@ -2142,22 +2119,21 @@ get_encrypt(
      break;
 
    default:
-     conf_parserror("NONE, CLIENT or SERVER expected");
+     conf_parserror(_("NONE, CLIENT or SERVER expected"));
      encrypt = ENCRYPT_NONE;
      break;
    }
 
-   val->v.i = (int)encrypt;
+   val_t__encrypt(val) = (int)encrypt;
 }
 
 static void
-get_holding(
-    t_conf_var *np,
+read_holding(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
    dump_holdingdisk_t holding;
 
-   np = np;
    ckseen(&val->seen);
 
    get_conftoken(CONF_ANY);
@@ -2182,65 +2158,47 @@ get_holding(
      else if (holding == 1 || holding == 2)
        holding = HOLD_AUTO;
      else
-       conf_parserror("NEVER, AUTO or REQUIRED expected");
+       conf_parserror(_("NEVER, AUTO or REQUIRED expected"));
      break;
    }
 
-   val->v.i = (int)holding;
-}
-
-static void
-get_taperalgo(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_FIRST:      val->v.i = ALGO_FIRST;      break;
-    case CONF_FIRSTFIT:   val->v.i = ALGO_FIRSTFIT;   break;
-    case CONF_LARGEST:    val->v.i = ALGO_LARGEST;    break;
-    case CONF_LARGESTFIT: val->v.i = ALGO_LARGESTFIT; break;
-    case CONF_SMALLEST:   val->v.i = ALGO_SMALLEST;   break;
-    case CONF_LAST:       val->v.i = ALGO_LAST;       break;
-    default:
-       conf_parserror("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected");
-    }
+   val_t__holding(val) = (int)holding;
 }
 
 static void
-get_priority(
-    t_conf_var *np,
+read_estimate(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
-    int pri;
+    int estime;
 
-    np = np;
     ckseen(&val->seen);
 
     get_conftoken(CONF_ANY);
     switch(tok) {
-    case CONF_LOW: pri = 0; break;
-    case CONF_MEDIUM: pri = 1; break;
-    case CONF_HIGH: pri = 2; break;
-    case CONF_INT: pri = tokenval.v.i; break;
+    case CONF_CLIENT:
+       estime = ES_CLIENT;
+       break;
+    case CONF_SERVER:
+       estime = ES_SERVER;
+       break;
+    case CONF_CALCSIZE:
+       estime = ES_CALCSIZE;
+       break;
     default:
-       conf_parserror("LOW, MEDIUM, HIGH or integer expected");
-       pri = 0;
+       conf_parserror(_("CLIENT, SERVER or CALCSIZE expected"));
+       estime = ES_CLIENT;
     }
-    val->v.i = pri;
+    val_t__estimate(val) = estime;
 }
 
 static void
-get_strategy(
-    t_conf_var *np,
+read_strategy(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
     int strat;
 
-    np = np;
     ckseen(&val->seen);
 
     get_conftoken(CONF_ANY);
@@ -2264,60 +2222,108 @@ get_strategy(
        strat = DS_INCRONLY;
        break;
     default:
-       conf_parserror("STANDARD or NOFULL expected");
+       conf_parserror(_("dump strategy expected"));
        strat = DS_STANDARD;
     }
-    val->v.i = strat;
+    val_t__strategy(val) = strat;
 }
 
 static void
-get_estimate(
-    t_conf_var *np,
+read_taperalgo(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
-    int estime;
+    ckseen(&val->seen);
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_FIRST:      val_t__taperalgo(val) = ALGO_FIRST;      break;
+    case CONF_FIRSTFIT:   val_t__taperalgo(val) = ALGO_FIRSTFIT;   break;
+    case CONF_LARGEST:    val_t__taperalgo(val) = ALGO_LARGEST;    break;
+    case CONF_LARGESTFIT: val_t__taperalgo(val) = ALGO_LARGESTFIT; break;
+    case CONF_SMALLEST:   val_t__taperalgo(val) = ALGO_SMALLEST;   break;
+    case CONF_LAST:       val_t__taperalgo(val) = ALGO_LAST;       break;
+    default:
+       conf_parserror(_("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected"));
+    }
+}
+
+static void
+read_priority(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    int pri;
 
-    np = np;
     ckseen(&val->seen);
 
     get_conftoken(CONF_ANY);
     switch(tok) {
-    case CONF_CLIENT:
-       estime = ES_CLIENT;
-       break;
-    case CONF_SERVER:
-       estime = ES_SERVER;
-       break;
-    case CONF_CALCSIZE:
-       estime = ES_CALCSIZE;
+    case CONF_LOW: pri = 0; break;
+    case CONF_MEDIUM: pri = 1; break;
+    case CONF_HIGH: pri = 2; break;
+    case CONF_INT: pri = tokenval.v.i; break;
+    default:
+       conf_parserror(_("LOW, MEDIUM, HIGH or integer expected"));
+       pri = 0;
+    }
+    val_t__priority(val) = pri;
+}
+
+static void
+read_rate(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    get_conftoken(CONF_REAL);
+    val_t__rate(val)[0] = tokenval.v.r;
+    val_t__rate(val)[1] = tokenval.v.r;
+    val->seen = tokenval.seen;
+    if(tokenval.v.r < 0) {
+       conf_parserror(_("full compression rate must be >= 0"));
+    }
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_NL:
+       return;
+
+    case CONF_END:
+       return;
+
+    case CONF_COMMA:
        break;
+
     default:
-       conf_parserror("CLIENT, SERVER or CALCSIZE expected");
-       estime = ES_CLIENT;
+       unget_conftoken();
+    }
+
+    get_conftoken(CONF_REAL);
+    val_t__rate(val)[1] = tokenval.v.r;
+    if(tokenval.v.r < 0) {
+       conf_parserror(_("incremental compression rate must be >= 0"));
     }
-    val->v.i = estime;
 }
 
 static void
-get_exclude(
-    t_conf_var *np,
+read_exinclude(
+    conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
     int file, got_one = 0;
     sl_t *exclude;
     int optional = 0;
 
-    np = np;
     get_conftoken(CONF_ANY);
     if(tok == CONF_LIST) {
        file = 0;
        get_conftoken(CONF_ANY);
-       exclude = val->v.exinclude.sl_list;
+       exclude = val_t__exinclude(val).sl_list;
     }
     else {
        file = 1;
        if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
-       exclude = val->v.exinclude.sl_file;
+       exclude = val_t__exinclude(val).sl_file;
     }
     ckseen(&val->seen);
 
@@ -2344,1765 +2350,1852 @@ get_exclude(
     if(got_one == 0) { free_sl(exclude); exclude = NULL; }
 
     if (file == 0)
-       val->v.exinclude.sl_list = exclude;
+       val_t__exinclude(val).sl_list = exclude;
     else
-       val->v.exinclude.sl_file = exclude;
-    val->v.exinclude.optional = optional;
+       val_t__exinclude(val).sl_file = exclude;
+    val_t__exinclude(val).optional = optional;
 }
 
-/*
-static void get_include(np, val)
-    t_conf_var *np;
-    val_t *val;
+static void
+read_intrange(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
 {
-    int list, got_one = 0;
-    sl_t *include;
-    int optional = 0;
-    int append = 0;
+    get_conftoken(CONF_INT);
+    val_t__intrange(val)[0] = tokenval.v.i;
+    val_t__intrange(val)[1] = tokenval.v.i;
+    val->seen = tokenval.seen;
 
     get_conftoken(CONF_ANY);
-    if(tok == CONF_LIST) {
-       list = 1;
-       include = dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl;
-       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_LIST].seen);
-       get_conftoken(CONF_ANY);
-    }
-    else {
-       list = 0;
-       include = dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl;
-       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_FILE].seen);
-       if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
-    }
+    switch(tok) {
+    case CONF_NL:
+       return;
 
-    if(tok == CONF_OPTIONAL) {
-       get_conftoken(CONF_ANY);
-       optional = 1;
-    }
-
-    if(tok == CONF_APPEND) {
-       get_conftoken(CONF_ANY);
-       append = 1;
-    }
-    else {
-       free_sl(include);
-       include = NULL;
-       append = 0;
-    }
-
-    while(tok == CONF_STRING) {
-       include = append_sl(include, tokenval.v.s);
-       got_one = 1;
-       get_conftoken(CONF_ANY);
-    }
-    unget_conftoken();
+    case CONF_END:
+       return;
 
-    if(got_one == 0) { free_sl(include); include = NULL; }
+    case CONF_COMMA:
+       break;
 
-    if(list == 0)
-       dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl = include;
-    else {
-       dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl = include;
-       if(!append || optional)
-           dpcur.value[DUMPTYPE_INCLUDE_OPTIONAL].v.i = optional;
+    default:
+       unget_conftoken();
     }
-}
-*/
-
-/* ------------------------ */
 
-int
-ColumnDataCount(void )
-{
-    return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0]));
+    get_conftoken(CONF_INT);
+    val_t__intrange(val)[1] = tokenval.v.i;
 }
 
-/* conversion from string to table index
- */
-int
-StringToColumn(
-    char *s)
+static void
+read_property(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
 {
-    int cn;
+    char *key, *value;
+    get_conftoken(CONF_STRING);
+    key = strdup(tokenval.v.s);
+    get_conftoken(CONF_STRING);
+    value = strdup(tokenval.v.s);
 
-    for (cn=0; ColumnData[cn].Name != NULL; cn++) {
-       if (strcasecmp(s, ColumnData[cn].Name) == 0) {
-           break;
-       }
-    }
-    return cn;
+    g_hash_table_insert(val_t__proplist(val), key, value);
 }
 
-char
-LastChar(
-    char *s)
-{
-    return s[strlen(s)-1];
-}
+/* get_* functions */
 
-int
-SetColumDataFromString(
-    ColumnInfo* ci,
-    char *s,
-    char **errstr)
+static time_t
+get_time(void)
 {
-#ifdef TEST
-    char *myname= "SetColumDataFromString";
-#endif
-    ci = ci;
-
-    /* Convert from a Columspec string to our internal format
-     * of columspec. The purpose is to provide this string
-     * as configuration paramter in the amanda.conf file or
-     * (maybe) as environment variable.
-     * 
-     * This text should go as comment into the sample amanda.conf
-     *
-     * The format for such a ColumnSpec string s is a ',' seperated
-     * list of triples. Each triple consists of
-     *   -the name of the column (as in ColumnData.Name)
-     *   -prefix before the column
-     *   -the width of the column
-     *       if set to -1 it will be recalculated
-     *  to the maximum length of a line to print.
-     * Example:
-     *         "Disk=1:17,HostName=1:10,OutKB=1:7"
-     * or
-     *         "Disk=1:-1,HostName=1:10,OutKB=1:7"
-     * 
-     * You need only specify those colums that should be changed from
-     * the default. If nothing is specified in the configfile, the
-     * above compiled in values will be in effect, resulting in an
-     * output as it was all the time.
-     *                                                 ElB, 1999-02-24.
-     */
-
-    while (s && *s) {
-       int Space, Width;
-       int cn;
-       char *eon= strchr(s, '=');
+    time_t hhmm;
 
-       if (eon == NULL) {
-           *errstr = stralloc2("invalid columnspec: ", s);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INT:
+#if SIZEOF_TIME_T < SIZEOF_INT
+       if ((off_t)tokenval.v.i >= (off_t)TIME_MAX)
+           conf_parserror(_("value too large"));
 #endif
-           return -1;
-       }
-       *eon= '\0';
-       cn=StringToColumn(s);
-       if (ColumnData[cn].Name == NULL) {
-           *errstr = stralloc2("invalid column name: ", s);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
+       hhmm = (time_t)tokenval.v.i;
+       break;
+
+    case CONF_SIZE:
+#if SIZEOF_TIME_T < SIZEOF_SSIZE_T
+       if ((off_t)tokenval.v.size >= (off_t)TIME_MAX)
+           conf_parserror(_("value too large"));
 #endif
-           return -1;
-       }
-       if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) {
-           *errstr = stralloc2("invalid format: ", eon + 1);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
+       hhmm = (time_t)tokenval.v.size;
+       break;
+
+    case CONF_AM64:
+#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
+       if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX)
+           conf_parserror(_("value too large"));
 #endif
-           return -1;
-       }
-       ColumnData[cn].Width= Width;
-       ColumnData[cn].PrefixSpace = Space;
-       if (LastChar(ColumnData[cn].Format) == 's') {
-           if (Width < 0)
-               ColumnData[cn].MaxWidth= 1;
-           else
-               if (Width > ColumnData[cn].Precision)
-                   ColumnData[cn].Precision= Width;
-       }
-       else if (Width < ColumnData[cn].Precision)
-           ColumnData[cn].Precision = Width;
-       s= strchr(eon+1, ',');
-       if (s != NULL)
-           s++;
-    }
-    return 0;
-}
+       hhmm = (time_t)tokenval.v.am64;
+       break;
 
+    case CONF_AMINFINITY:
+       hhmm = TIME_MAX;
+       break;
 
-long int
-getconf_unit_divisor(void)
-{
-    return unit_divisor;
+    default:
+       conf_parserror(_("a time is expected"));
+       hhmm = 0;
+       break;
+    }
+    return hhmm;
 }
 
-/* ------------------------ */
-
-
-void
-dump_configuration(
-    char *filename)
+static int
+get_int(void)
 {
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
-    int i;
-    t_conf_var *np;
-    keytab_t *kt;
-    char *prefix;
-    char kt_prefix[100];
-
-    printf("AMANDA CONFIGURATION FROM FILE \"%s\":\n\n", filename);
-
-    for(np=server_var; np->token != CONF_UNKNOWN; np++) {
-       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) 
-           if (np->token == kt->token) break;
-
-       if(kt->token == CONF_UNKNOWN)
-           error("server bad token");
-
-       if (kt->token != CONF_IDENT)
-           snprintf(kt_prefix, 100, "%-21s ", kt->keyword);
-           printf("%s\n",
-                  conf_print(&conf_data[np->parm], 1, kt_prefix));
-    }
+    int val;
+    keytab_t *save_kt;
 
-    for(hp = holdingdisks; hp != NULL; hp = hp->next) {
-       printf("\nHOLDINGDISK %s {\n", hp->name);
-       for(i=0; i < HOLDING_HOLDING; i++) {
-           for(np=holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->parm == i)
-                       break;
-           }
-           if(np->token == CONF_UNKNOWN)
-               error("holding bad value");
+    save_kt = keytable;
+    keytable = numb_keytable;
 
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
-               if(kt->token == np->token)
-                   break;
-           }
-           if(kt->token == CONF_UNKNOWN)
-               error("holding bad token");
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INT:
+       val = tokenval.v.i;
+       break;
 
-           snprintf(kt_prefix, 100, "      %-9s ", kt->keyword);
-           printf("%s\n", conf_print(&hp->value[i], 1, kt_prefix));
-       }
-       printf("}\n");
-    }
+    case CONF_SIZE:
+#if SIZEOF_INT < SIZEOF_SSIZE_T
+       if ((off_t)tokenval.v.size > (off_t)INT_MAX)
+           conf_parserror(_("value too large"));
+       if ((off_t)tokenval.v.size < (off_t)INT_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (int)tokenval.v.size;
+       break;
 
-    for(tp = tapelist; tp != NULL; tp = tp->next) {
-       printf("\nDEFINE TAPETYPE %s {\n", tp->name);
-       for(i=0; i < TAPETYPE_TAPETYPE; i++) {
-           for(np=tapetype_var; np->token != CONF_UNKNOWN; np++)
-               if(np->parm == i) break;
-           if(np->token == CONF_UNKNOWN)
-               error("tapetype bad value");
+    case CONF_AM64:
+#if SIZEOF_INT < SIZEOF_LONG_LONG
+       if (tokenval.v.am64 > (off_t)INT_MAX)
+           conf_parserror(_("value too large"));
+       if (tokenval.v.am64 < (off_t)INT_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (int)tokenval.v.am64;
+       break;
 
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-               if(kt->token == np->token) break;
-           if(kt->token == CONF_UNKNOWN)
-               error("tapetype bad token");
+    case CONF_AMINFINITY:
+       val = INT_MAX;
+       break;
 
-           snprintf(kt_prefix, 100, "      %-9s ", kt->keyword);
-           printf("%s\n", conf_print(&tp->value[i], 1, kt_prefix));
-       }
-       printf("}\n");
+    default:
+       conf_parserror(_("an integer is expected"));
+       val = 0;
+       break;
     }
 
-    for(dp = dumplist; dp != NULL; dp = dp->next) {
-       if (strncmp(dp->name, "custom(", 7) != 0) {
-           if(dp->seen == -1)
-               prefix = "#";
-           else
-               prefix = "";
-           printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name);
-           for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
-               for(np=dumptype_var; np->token != CONF_UNKNOWN; np++)
-                   if(np->parm == i) break;
-               if(np->token == CONF_UNKNOWN)
-                   error("dumptype bad value");
-
-               for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-                   if(kt->token == np->token) break;
-               if(kt->token == CONF_UNKNOWN)
-                   error("dumptype bad token");
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_END:
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
 
-               snprintf(kt_prefix, 100, "%s      %-19s ", prefix,kt->keyword);
-               printf("%s\n", conf_print(&dp->value[i], 1, kt_prefix));
-           }
-           printf("%s}\n", prefix);
-       }
-    }
+    case CONF_MULT7:
+       if (val > (INT_MAX / 7))
+           conf_parserror(_("value too large"));
+       if (val < (INT_MIN / 7))
+           conf_parserror(_("value too small"));
+       val *= 7;
+       break;
 
-    for(ip = interface_list; ip != NULL; ip = ip->next) {
-       if(strcmp(ip->name,"default") == 0)
-           prefix = "#";
-       else
-           prefix = "";
-       printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name);
-       for(i=0; i < INTER_INTER; i++) {
-           for(np=interface_var; np->token != CONF_UNKNOWN; np++)
-               if(np->parm == i) break;
-           if(np->token == CONF_UNKNOWN)
-               error("interface bad value");
+    case CONF_MULT1M:
+       if (val > (INT_MAX / 1024))
+           conf_parserror(_("value too large"));
+       if (val < (INT_MIN / 1024))
+           conf_parserror(_("value too small"));
+       val *= 1024;
+       break;
 
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-               if(kt->token == np->token) break;
-           if(kt->token == CONF_UNKNOWN)
-               error("interface bad token");
+    case CONF_MULT1G:
+       if (val > (INT_MAX / (1024 * 1024)))
+           conf_parserror(_("value too large"));
+       if (val < (INT_MIN / (1024 * 1024)))
+           conf_parserror(_("value too small"));
+       val *= 1024 * 1024;
+       break;
 
-           snprintf(kt_prefix, 100, "%s      %-19s ", prefix, kt->keyword);
-           printf("%s\n", conf_print(&ip->value[i], 1, kt_prefix));
-       }
-       printf("%s}\n",prefix);
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
     }
 
+    keytable = save_kt;
+    return val;
 }
 
-char *
-generic_get_security_conf(
-       char *string,
-       void *arg)
+static ssize_t
+get_size(void)
 {
-       arg = arg;
-       if(!string || !*string)
-               return(NULL);
+    ssize_t val;
+    keytab_t *save_kt;
 
-       if(strcmp(string, "krb5principal")==0) {
-               return(getconf_str(CNF_KRB5PRINCIPAL));
-       } else if(strcmp(string, "krb5keytab")==0) {
-               return(getconf_str(CNF_KRB5KEYTAB));
-       }
-       return(NULL);
-}
+    save_kt = keytable;
+    keytable = numb_keytable;
 
-char *
-get_token_name(
-    tok_t token)
-{
-    keytab_t *kt;
+    get_conftoken(CONF_ANY);
 
-    if (my_keytab == NULL) {
-       error("my_keytab == NULL");
-       /*NOTREACHED*/
-    }
+    switch(tok) {
+    case CONF_SIZE:
+       val = tokenval.v.size;
+       break;
 
-    for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++)
-       if(kt->token == token) break;
+    case CONF_INT:
+#if SIZEOF_SIZE_T < SIZEOF_INT
+       if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX)
+           conf_parserror(_("value too large"));
+       if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (ssize_t)tokenval.v.i;
+       break;
 
-    if(kt->token == CONF_UNKNOWN)
-       return("");
-    return(kt->keyword);
-}
-
-void
-parse_conf(
-    int parse_argc,
-    char **parse_argv,
-    int *new_argc,
-    char ***new_argv)
-{
-    int i;
-    char **my_argv;
-    char *myarg, *value;
-    command_option_t *program_option;
-
-    program_options = alloc((size_t)(parse_argc+1) * SIZEOF(*program_options));
-    program_options_size = parse_argc+1;
-    program_option = program_options;
-    program_option->name = NULL;
-
-    my_argv = alloc((size_t)parse_argc * SIZEOF(char *));
-    *new_argv = my_argv;
-    *new_argc = 0;
-    i=0;
-    while(i<parse_argc) {
-       if(strncmp(parse_argv[i],"-o",2) == 0) {
-           if(strlen(parse_argv[i]) > 2)
-               myarg = &parse_argv[i][2];
-           else {
-               i++;
-               if(i >= parse_argc)
-                   error("expect something after -o");
-               myarg = parse_argv[i];
-           }
-           value = index(myarg,'=');
-           if (value == NULL) {
-               conf_parserror("Must specify a value for %s.\n", myarg);
-           } else {
-               *value = '\0';
-               value++;
-               program_option->used = 0;
-               program_option->name = stralloc(myarg);
-               program_option->value = stralloc(value);
-               program_option++;
-               program_option->name = NULL;
-           }
-       }
-       else {
-           my_argv[*new_argc] = stralloc(parse_argv[i]);
-           *new_argc += 1;
-       }
-       i++;
-    }
-}
-
-char **
-get_config_options(
-    int first)
-{
-    char             **config_options;
-    char            **config_option;
-    command_option_t  *command_options;
-
-    config_options = alloc((first+program_options_size+1)*SIZEOF(char *));
-    for(command_options = program_options,
-        config_option = config_options + first;
-       command_options->name != NULL; command_options++) {
-       *config_option = vstralloc("-o", command_options->name, "=",
-                                  command_options->value, NULL);
-       config_option++;
-    }
-    *config_option = NULL;
-    return(config_options);
-}
+    case CONF_AM64:
+#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG
+       if (tokenval.v.am64 > (off_t)SSIZE_MAX)
+           conf_parserror(_("value too large"));
+       if (tokenval.v.am64 < (off_t)SSIZE_MIN)
+           conf_parserror(_("value too small"));
+#endif
+       val = (ssize_t)tokenval.v.am64;
+       break;
 
-void
-report_bad_conf_arg(void)
-{
-    command_option_t *command_option;
+    case CONF_AMINFINITY:
+       val = (ssize_t)SSIZE_MAX;
+       break;
 
-    for(command_option = program_options; command_option->name != NULL;
-                                                       command_option++) {
-       if(command_option->used == 0) {
-           fprintf(stderr,"argument -o%s=%s not used\n",
-                   command_option->name, command_option->value);
-       }
+    default:
+       conf_parserror(_("an integer is expected"));
+       val = 0;
+       break;
     }
-}
 
-void
-free_server_config(void)
-{
-    holdingdisk_t    *hp, *hpnext;
-    dumptype_t       *dp, *dpnext;
-    tapetype_t       *tp, *tpnext;
-    interface_t      *ip, *ipnext;
-    command_option_t *server_option;
-    int               i;
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
 
-    for(hp=holdingdisks; hp != NULL; hp = hpnext) {
-       amfree(hp->name);
-       for(i=0; i<HOLDING_HOLDING-1; i++) {
-          free_val_t(&hp->value[i]);
-       }
-       hpnext = hp->next;
-       amfree(hp);
-    }
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
 
-    for(dp=dumplist; dp != NULL; dp = dpnext) {
-       amfree(dp->name);
-       for(i=0; i<DUMPTYPE_DUMPTYPE-1; i++) {
-          free_val_t(&dp->value[i]);
-       }
-       dpnext = dp->next;
-       amfree(dp);
-    }
+    case CONF_MULT7:
+       if (val > (ssize_t)(SSIZE_MAX / 7))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / 7))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)7;
+       break;
 
-    for(tp=tapelist; tp != NULL; tp = tpnext) {
-       amfree(tp->name);
-       for(i=0; i<TAPETYPE_TAPETYPE-1; i++) {
-          free_val_t(&tp->value[i]);
-       }
-       tpnext = tp->next;
-       amfree(tp);
-    }
+    case CONF_MULT1M:
+       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)1024;
+       break;
 
-    for(ip=interface_list; ip != NULL; ip = ipnext) {
-       amfree(ip->name);
-       for(i=0; i<INTER_INTER-1; i++) {
-          free_val_t(&ip->value[i]);
-       }
-       ipnext = ip->next;
-       amfree(ip);
-    }
+    case CONF_MULT1G:
+       if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024)))
+           conf_parserror(_("value too large"));
+       if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024)))
+           conf_parserror(_("value too small"));
+       val *= (ssize_t)(1024 * 1024);
+       break;
 
-    if(program_options) {
-       for(server_option = program_options; server_option->name != NULL;
-                                               server_option++) {
-           amfree(server_option->name);
-           amfree(server_option->value);
-        }
-       amfree(program_options);
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
     }
 
-    for(i=0; i<CNF_CNF-1; i++)
-       free_val_t(&conf_data[i]);
+    keytable = save_kt;
+    return val;
 }
 
+static off_t
+get_am64_t(void)
+{
+    off_t val;
+    keytab_t *save_kt;
 
+    save_kt = keytable;
+    keytable = numb_keytable;
 
-/* configuration parameters */
-static char *cln_config_dir = NULL;
-
-/* predeclare local functions */
-
-static void read_client_conffile_recursively(char *filename);
-static int read_client_confline(void);
+    get_conftoken(CONF_ANY);
 
-static int first_file = 1;
+    switch(tok) {
+    case CONF_INT:
+       val = (off_t)tokenval.v.i;
+       break;
 
-/*
-** ------------------------
-**  External entry points
-** ------------------------
-*/
+    case CONF_SIZE:
+       val = (off_t)tokenval.v.size;
+       break;
 
-/* return  0 on success        */
-/* return  1 on error          */
-/* return -1 if file not found */
+    case CONF_AM64:
+       val = tokenval.v.am64;
+       break;
 
-int read_clientconf(
-    char *filename)
-{
-    my_keytab = server_keytab;
-    my_var = client_var;
+    case CONF_AMINFINITY:
+       val = AM64_MAX;
+       break;
 
-    if(first_file == 1) {
-       init_defaults();
-       first_file = 0;
-    } else {
-       allow_overwrites = 1;
+    default:
+       conf_parserror(_("an integer is expected"));
+       val = 0;
+       break;
     }
 
-    /* We assume that conf_confname & conf are initialized to NULL above */
-    read_client_conffile_recursively(filename);
-
-    command_overwrite(program_options, client_var, client_keytab, conf_data,
-                     "");
-
-    debug_amandad    = getconf_int(CNF_DEBUG_AMANDAD);
-    debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED);
-    debug_amindexd   = getconf_int(CNF_DEBUG_AMINDEXD);
-    debug_amrecover  = getconf_int(CNF_DEBUG_AMRECOVER);
-    debug_auth       = getconf_int(CNF_DEBUG_AUTH);
-    debug_event      = getconf_int(CNF_DEBUG_EVENT);
-    debug_holding    = getconf_int(CNF_DEBUG_HOLDING);
-    debug_protocol   = getconf_int(CNF_DEBUG_PROTOCOL);
-    debug_planner    = getconf_int(CNF_DEBUG_PLANNER);
-    debug_driver     = getconf_int(CNF_DEBUG_DRIVER);
-    debug_dumper     = getconf_int(CNF_DEBUG_DUMPER);
-    debug_chunker    = getconf_int(CNF_DEBUG_CHUNKER);
-    debug_taper      = getconf_int(CNF_DEBUG_TAPER);
-    debug_selfcheck  = getconf_int(CNF_DEBUG_SELFCHECK);
-    debug_sendsize   = getconf_int(CNF_DEBUG_SENDSIZE);
-    debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP);
-
-    return got_parserror;
-}
-
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
 
-/*
-** ------------------------
-**  Internal routines
-** ------------------------
-*/
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
 
+    case CONF_MULT7:
+       if (val > AM64_MAX/7 || val < AM64_MIN/7)
+           conf_parserror(_("value too large"));
+       val *= 7;
+       break;
 
-static void
-read_client_conffile_recursively(
-    char *     filename)
-{
-    /* Save globals used in read_client_confline(), elsewhere. */
-    int  save_line_num  = conf_line_num;
-    FILE *save_conf     = conf_conf;
-    char *save_confname = conf_confname;
-    int        rc;
+    case CONF_MULT1M:
+       if (val > AM64_MAX/1024 || val < AM64_MIN/1024)
+           conf_parserror(_("value too large"));
+       val *= 1024;
+       break;
 
-    if (*filename == '/' || cln_config_dir == NULL) {
-       conf_confname = stralloc(filename);
-    } else {
-       conf_confname = stralloc2(cln_config_dir, filename);
-    }
+    case CONF_MULT1G:
+       if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024))
+           conf_parserror(_("value too large"));
+       val *= 1024*1024;
+       break;
 
-    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
-       dbprintf(("Could not open conf file \"%s\": %s\n", conf_confname,
-                 strerror(errno)));
-       amfree(conf_confname);
-       got_parserror = -1;
-       return;
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
     }
-    dbprintf(("Reading conf file \"%s\".\n", conf_confname));
-
-    conf_line_num = 0;
 
-    /* read_client_confline() can invoke us recursively via "includefile" */
-    do {
-       rc = read_client_confline();
-    } while (rc != 0);
-    afclose(conf_conf);
-
-    amfree(conf_confname);
+    keytable = save_kt;
 
-    /* Restore globals */
-    conf_line_num = save_line_num;
-    conf_conf     = save_conf;
-    conf_confname = save_confname;
+    return val;
 }
 
-
-/* ------------------------ */
-
-
 static int
-read_client_confline(void)
+get_bool(void)
 {
-    t_conf_var *np;
+    int val;
+    keytab_t *save_kt;
 
-    keytable = client_keytab;
+    save_kt = keytable;
+    keytable = bool_keytable;
 
-    conf_line_num += 1;
     get_conftoken(CONF_ANY);
+
     switch(tok) {
-    case CONF_INCLUDEFILE:
-       {
-           char *fn;
+    case CONF_INT:
+       if (tokenval.v.i != 0)
+           val = 1;
+       else
+           val = 0;
+       break;
 
-           get_conftoken(CONF_STRING);
-           fn = tokenval.v.s;
-           read_client_conffile_recursively(fn);
-       }
+    case CONF_SIZE:
+       if (tokenval.v.size != (size_t)0)
+           val = 1;
+       else
+           val = 0;
        break;
 
-    case CONF_NL:      /* empty line */
+    case CONF_AM64:
+       if (tokenval.v.am64 != (off_t)0)
+           val = 1;
+       else
+           val = 0;
        break;
 
-    case CONF_END:     /* end of file */
-       return 0;
+    case CONF_ATRUE:
+       val = 1;
+       break;
 
-    default:
-       {
-           for(np = client_var; np->token != CONF_UNKNOWN; np++)
-               if(np->token == tok) break;
+    case CONF_AFALSE:
+       val = 0;
+       break;
 
-           if(np->token == CONF_UNKNOWN) {
-               conf_parserror("configuration keyword expected");
-           } else {
-               np->read_function(np, &conf_data[np->parm]);
-               if(np->validate)
-                   np->validate(np, &conf_data[np->parm]);
-           }
-       }
+    case CONF_NL:
+       unget_conftoken();
+       val = 2; /* no argument - most likely TRUE */
+       break;
+    default:
+       unget_conftoken();
+       val = 3; /* a bad argument - most likely TRUE */
+       conf_parserror(_("YES, NO, TRUE, FALSE, ON, OFF expected"));
+       break;
     }
-    if(tok != CONF_NL)
-       get_conftoken(CONF_NL);
-    return 1;
+
+    keytable = save_kt;
+    return val;
 }
 
-
-char *
-generic_client_get_security_conf(
-    char *     string,
-    void *     arg)
+void
+ckseen(
+    int *seen)
 {
-       (void)arg;      /* Quiet unused parameter warning */
-
-       if(!string || !*string)
-               return(NULL);
-
-       if(strcmp(string, "conf")==0) {
-               return(getconf_str(CNF_CONF));
-       } else if(strcmp(string, "index_server")==0) {
-               return(getconf_str(CNF_INDEX_SERVER));
-       } else if(strcmp(string, "tape_server")==0) {
-               return(getconf_str(CNF_TAPE_SERVER));
-       } else if(strcmp(string, "tapedev")==0) {
-               return(getconf_str(CNF_TAPEDEV));
-       } else if(strcmp(string, "auth")==0) {
-               return(getconf_str(CNF_AUTH));
-       } else if(strcmp(string, "ssh_keys")==0) {
-               return(getconf_str(CNF_SSH_KEYS));
-       } else if(strcmp(string, "amandad_path")==0) {
-               return(getconf_str(CNF_AMANDAD_PATH));
-       } else if(strcmp(string, "client_username")==0) {
-               return(getconf_str(CNF_CLIENT_USERNAME));
-       } else if(strcmp(string, "gnutar_list_dir")==0) {
-               return(getconf_str(CNF_GNUTAR_LIST_DIR));
-       } else if(strcmp(string, "amandates")==0) {
-               return(getconf_str(CNF_AMANDATES));
-       } else if(strcmp(string, "krb5principal")==0) {
-               return(getconf_str(CNF_KRB5PRINCIPAL));
-       } else if(strcmp(string, "krb5keytab")==0) {
-               return(getconf_str(CNF_KRB5KEYTAB));
-       }
-       return(NULL);
+    if (*seen && !allow_overwrites && current_line_num != -2) {
+       conf_parserror(_("duplicate parameter, prev def on line %d"), *seen);
+    }
+    *seen = current_line_num;
 }
 
+/* Validation functions */
 
-/* return  0 on success             */
-/* return -1 if it is already there */
-/* return -2 if other failure       */
-int
-add_client_conf(
-    confparm_t parm,
-    char *value)
+static void
+validate_nonnegative(
+    struct conf_var_s *np,
+    val_t        *val)
 {
-    t_conf_var *np;
-    keytab_t *kt;
-    command_option_t *command_option;
-    int nb_option;
+    switch(val->type) {
+    case CONFTYPE_INT:
+       if(val_t__int(val) < 0)
+           conf_parserror(_("%s must be nonnegative"), get_token_name(np->token));
+       break;
+    case CONFTYPE_AM64:
+       if(val_t__am64(val) < 0)
+           conf_parserror(_("%s must be nonnegative"), get_token_name(np->token));
+       break;
+    case CONFTYPE_SIZE:
+       if(val_t__size(val) < 0)
+           conf_parserror(_("%s must be positive"), get_token_name(np->token));
+       break;
+    default:
+       conf_parserror(_("validate_nonnegative invalid type %d\n"), val->type);
+    }
+}
 
-    for(np = client_var; np->token != CONF_UNKNOWN; np++)
-       if(np->parm == (int)parm) break;
+static void
+validate_positive(
+    struct conf_var_s *np,
+    val_t        *val)
+{
+    switch(val->type) {
+    case CONFTYPE_INT:
+       if(val_t__int(val) < 1)
+           conf_parserror(_("%s must be positive"), get_token_name(np->token));
+       break;
+    case CONFTYPE_AM64:
+       if(val_t__am64(val) < 1)
+           conf_parserror(_("%s must be positive"), get_token_name(np->token));
+       break;
+    case CONFTYPE_TIME:
+       if(val_t__time(val) < 1)
+           conf_parserror(_("%s must be positive"), get_token_name(np->token));
+       break;
+    case CONFTYPE_SIZE:
+       if(val_t__size(val) < 1)
+           conf_parserror(_("%s must be positive"), get_token_name(np->token));
+       break;
+    default:
+       conf_parserror(_("validate_positive invalid type %d\n"), val->type);
+    }
+}
 
-    if(np->token == CONF_UNKNOWN) return -2;
+static void
+validate_runspercycle(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__int(val) < -1)
+       conf_parserror(_("runspercycle must be >= -1"));
+}
 
-    for(kt = client_keytab; kt->token != CONF_UNKNOWN; kt++)
-       if(kt->token == np->token) break;
+static void
+validate_bumppercent(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__int(val) < 0 || val_t__int(val) > 100)
+       conf_parserror(_("bumppercent must be between 0 and 100"));
+}
 
-    if(kt->token == CONF_UNKNOWN) return -2;
+static void
+validate_inparallel(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__int(val) < 1 || val_t__int(val) >MAX_DUMPERS)
+       conf_parserror(_("inparallel must be between 1 and MAX_DUMPERS (%d)"),
+                      MAX_DUMPERS);
+}
 
-    /* Try to find it */
-    nb_option = 0;
-    for(command_option = program_options; command_option->name != NULL;
-                                                       command_option++) {
-       nb_option++;
+static void
+validate_bumpmult(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__real(val) < 0.999) {
+       conf_parserror(_("bumpmult must one or more"));
     }
+}
 
-    /* Increase size of program_options if needed */
-    if(nb_option >= program_options_size-1) {
-       program_options_size *= 2;
-       program_options = realloc(program_options,
-                               program_options_size * SIZEOF(*program_options));
-       if (program_options == NULL) {
-           error("Can't realloc program_options: %s\n", strerror(errno));
-           /*NOTREACHED*/
-       }
-       for(command_option = program_options; command_option->name != NULL;
-                                                       command_option++) {
+static void
+validate_displayunit(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val G_GNUC_UNUSED)
+{
+    char *s = val_t__str(val);
+    if (strlen(s) == 1) {
+       switch (s[0]) {
+           case 'K':
+           case 'M':
+           case 'G':
+           case 'T':
+               return; /* all good */
+
+           /* lower-case values should get folded to upper case */
+           case 'k':
+           case 'm':
+           case 'g':
+           case 't':
+               s[0] = toupper(s[0]);
+               return;
+
+           default:    /* bad */
+               break;
        }
     }
+    conf_parserror(_("displayunit must be k,m,g or t."));
+}
 
-    /* add it */
-    command_option->used = 0;
-    command_option->name = stralloc(kt->keyword);
-    command_option->value = stralloc(value);
-    command_option++;
-    command_option->name = NULL;
-    return 0;
+static void
+validate_reserve(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__int(val) < 0 || val_t__int(val) > 100)
+       conf_parserror(_("reserve must be between 0 and 100"));
 }
 
-/*
-static t_conf_var *
-get_np(
-    t_conf_var *get_var,
-    int        parm)
+static void
+validate_use(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
 {
-    t_conf_var *np;
+    val_t__am64(val) = am_floor(val_t__am64(val), DISK_BLOCK_KB);
+}
 
-    for(np = get_var; np->token != CONF_UNKNOWN; np++) {
-       if(np->parm == parm)
-           break;
+static void
+validate_chunksize(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    /* NOTE: this function modifies the target value (rounding) */
+    if(val_t__am64(val) == 0) {
+       val_t__am64(val) = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB));
     }
-
-    if(np->token == CONF_UNKNOWN) {
-       error("error [unknown get_np parm: %d]", parm);
-       NOTREACHED
+    else if(val_t__am64(val) < 0) {
+       conf_parserror(_("Negative chunksize (%lld) is no longer supported"), (long long)val_t__am64(val));
+    }
+    val_t__am64(val) = am_floor(val_t__am64(val), (off_t)DISK_BLOCK_KB);
+    if (val_t__am64(val) < 2*DISK_BLOCK_KB) {
+       conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB);
     }
-    return np;
 }
-*/
 
-static time_t
-get_time(void)
+static void
+validate_blocksize(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
 {
-    time_t hhmm;
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INT:
-#if SIZEOF_TIME_T < SIZEOF_INT
-       if ((off_t)tokenval.v.i >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.i;
-       break;
+    if(val_t__size(val) < DISK_BLOCK_KB) {
+       conf_parserror(_("Tape blocksize must be at least %d KBytes"),
+                 DISK_BLOCK_KB);
+    } else if(val_t__size(val) > MAX_TAPE_BLOCK_KB) {
+       conf_parserror(_("Tape blocksize must not be larger than %d KBytes"),
+                 MAX_TAPE_BLOCK_KB);
+    }
+}
 
-    case CONF_LONG:
-#if SIZEOF_TIME_T < SIZEOF_LONG
-       if ((off_t)tokenval.v.l >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.l;
-       break;
+static void
+validate_debug(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if(val_t__int(val) < 0 || val_t__int(val) > 9) {
+       conf_parserror(_("Debug must be between 0 and 9"));
+    }
+}
 
-    case CONF_SIZE:
-#if SIZEOF_TIME_T < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.size;
-       break;
+static void
+validate_port_range(
+    val_t        *val,
+    int                 smallest,
+    int                 largest)
+{
+    int i;
+    /* check both values are in range */
+    for (i = 0; i < 2; i++) {
+        if(val_t__intrange(val)[0] < smallest || val_t__intrange(val)[0] > largest) {
+           conf_parserror(_("portrange must be in the range %d to %d, inclusive"), smallest, largest);
+       }
+     }
 
-    case CONF_AM64:
-#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
-       if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.am64;
-       break;
+    /* and check they're in the right order and not equal */
+    if (val_t__intrange(val)[0] > val_t__intrange(val)[1]) {
+       conf_parserror(_("portranges must be in order from low to high"));
+    }
+}
 
-    case CONF_AMINFINITY:
-       hhmm = TIME_MAX;
-       break;
+static void
+validate_reserved_port_range(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    validate_port_range(val, 1, IPPORT_RESERVED-1);
+}
 
-    default:
-       conf_parserror("a time is expected");
-       hhmm = 0;
-       break;
-    }
-    return hhmm;
+static void
+validate_unreserved_port_range(
+    struct conf_var_s *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    validate_port_range(val, IPPORT_RESERVED, 65535);
 }
 
-keytab_t numb_keytable[] = {
-    { "B", CONF_MULT1 },
-    { "BPS", CONF_MULT1 },
-    { "BYTE", CONF_MULT1 },
-    { "BYTES", CONF_MULT1 },
-    { "DAY", CONF_MULT1 },
-    { "DAYS", CONF_MULT1 },
-    { "INF", CONF_AMINFINITY },
-    { "K", CONF_MULT1K },
-    { "KB", CONF_MULT1K },
-    { "KBPS", CONF_MULT1K },
-    { "KBYTE", CONF_MULT1K },
-    { "KBYTES", CONF_MULT1K },
-    { "KILOBYTE", CONF_MULT1K },
-    { "KILOBYTES", CONF_MULT1K },
-    { "KPS", CONF_MULT1K },
-    { "M", CONF_MULT1M },
-    { "MB", CONF_MULT1M },
-    { "MBPS", CONF_MULT1M },
-    { "MBYTE", CONF_MULT1M },
-    { "MBYTES", CONF_MULT1M },
-    { "MEG", CONF_MULT1M },
-    { "MEGABYTE", CONF_MULT1M },
-    { "MEGABYTES", CONF_MULT1M },
-    { "G", CONF_MULT1G },
-    { "GB", CONF_MULT1G },
-    { "GBPS", CONF_MULT1G },
-    { "GBYTE", CONF_MULT1G },
-    { "GBYTES", CONF_MULT1G },
-    { "GIG", CONF_MULT1G },
-    { "GIGABYTE", CONF_MULT1G },
-    { "GIGABYTES", CONF_MULT1G },
-    { "MPS", CONF_MULT1M },
-    { "TAPE", CONF_MULT1 },
-    { "TAPES", CONF_MULT1 },
-    { "WEEK", CONF_MULT7 },
-    { "WEEKS", CONF_MULT7 },
-    { NULL, CONF_IDENT }
-};
+/*
+ * Initialization Implementation
+ */
 
-static int
-get_int(void)
+gboolean
+config_init(
+    config_init_flags flags,
+    char *arg_config_name)
 {
-    int val;
-    keytab_t *save_kt;
+    if (!(flags & CONFIG_INIT_OVERLAY)) {
+       /* Clear out anything that's already in there */
+       config_uninit();
 
-    save_kt = keytable;
-    keytable = numb_keytable;
+       /* and set everything to default values */
+       init_defaults();
 
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INT:
-       val = tokenval.v.i;
-       break;
+       allow_overwrites = FALSE;
+    } else {
+       if (!config_initialized) {
+           error(_("Attempt to overlay configuration with no existing configuration"));
+           /* NOTREACHED */
+       }
 
-    case CONF_LONG:
-#if SIZEOF_INT < SIZEOF_LONG
-       if ((off_t)tokenval.v.l > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.l < (off_t)INT_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (int)tokenval.v.l;
-       break;
+       allow_overwrites = TRUE;
+    }
 
-    case CONF_SIZE:
-#if SIZEOF_INT < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.size < (off_t)INT_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (int)tokenval.v.size;
-       break;
+    /* store away our client-ness for later reference */
+    config_client = flags & CONFIG_INIT_CLIENT;
 
-    case CONF_AM64:
-#if SIZEOF_INT < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)INT_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (int)tokenval.v.am64;
-       break;
+    if ((flags & CONFIG_INIT_EXPLICIT_NAME) && arg_config_name) {
+       config_name = newstralloc(config_name, arg_config_name);
+       config_dir = newvstralloc(config_dir, CONFIG_DIR, "/", arg_config_name, NULL);
+    } else if (flags & CONFIG_INIT_USE_CWD) {
+        char * cwd;
+        
+        cwd = get_original_cwd();
+       if (!cwd) {
+           /* (this isn't a config error, so it's always fatal) */
+           error(_("Cannot determine current working directory"));
+           /* NOTREACHED */
+       }
 
-    case CONF_AMINFINITY:
-       val = INT_MAX;
-       break;
+       config_dir = stralloc2(cwd, "/");
+       if ((config_name = strrchr(cwd, '/')) != NULL) {
+           config_name = stralloc(config_name + 1);
+       }
 
-    default:
-       conf_parserror("an integer is expected");
-       val = 0;
-       break;
+        amfree(cwd);
+    } else if (flags & CONFIG_INIT_CLIENT) {
+       amfree(config_name);
+       config_dir = newstralloc(config_dir, CONFIG_DIR);
+    } else {
+       /* ok, then, we won't read anything (for e.g., amrestore) */
+       amfree(config_name);
+       amfree(config_dir);
     }
 
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_END:
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
+    /* If we have a config_dir, we can try reading something */
+    if (config_dir) {
+       if (flags & CONFIG_INIT_CLIENT) {
+           config_filename = newvstralloc(config_filename, config_dir, "/amanda-client.conf", NULL);
+       } else {
+           config_filename = newvstralloc(config_filename, config_dir, "/amanda.conf", NULL);
+       }
 
-    case CONF_MULT7:
-       if (val > (INT_MAX / 7))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / 7))
-           conf_parserror("value too small");
-       val *= 7;
-       break;
+       /* try to read the file, and handle parse errors */
+       if (!read_conffile(config_filename, flags & CONFIG_INIT_CLIENT)) {
+           if (flags & CONFIG_INIT_FATAL) {
+               error(_("errors processing config file \"%s\""), config_filename);
+               /* NOTREACHED */
+           } else {
+               g_warning(_("errors processing config file \"%s\" (non-fatal)"), config_filename);
+               return FALSE;
+           }
+       }
+    } else {
+       amfree(config_filename);
+    }
 
-    case CONF_MULT1M:
-       if (val > (INT_MAX / 1024))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / 1024))
-           conf_parserror("value too small");
-       val *= 1024;
-       break;
+    update_derived_values(flags & CONFIG_INIT_CLIENT);
 
-    case CONF_MULT1G:
-       if (val > (INT_MAX / (1024 * 1024)))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / (1024 * 1024)))
-           conf_parserror("value too small");
-       val *= 1024 * 1024;
-       break;
+    return TRUE;
+}
 
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
+void
+config_uninit(void)
+{
+    holdingdisk_t    *hp, *hpnext;
+    dumptype_t       *dp, *dpnext;
+    tapetype_t       *tp, *tpnext;
+    interface_t      *ip, *ipnext;
+    int               i;
+
+    if (!config_initialized) return;
+
+    for(hp=holdinglist; hp != NULL; hp = hpnext) {
+       amfree(hp->name);
+       for(i=0; i<HOLDING_HOLDING-1; i++) {
+          free_val_t(&hp->value[i]);
+       }
+       hpnext = hp->next;
+       amfree(hp);
     }
+    holdinglist = NULL;
 
-    keytable = save_kt;
-    return val;
-}
+    for(dp=dumplist; dp != NULL; dp = dpnext) {
+       amfree(dp->name);
+       for(i=0; i<DUMPTYPE_DUMPTYPE-1; i++) {
+          free_val_t(&dp->value[i]);
+       }
+       dpnext = dp->next;
+       amfree(dp);
+    }
+    dumplist = NULL;
 
-/*
-static long
-get_long(void)
-{
-    long val;
-    keytab_t *save_kt;
+    for(tp=tapelist; tp != NULL; tp = tpnext) {
+       amfree(tp->name);
+       for(i=0; i<TAPETYPE_TAPETYPE-1; i++) {
+          free_val_t(&tp->value[i]);
+       }
+       tpnext = tp->next;
+       amfree(tp);
+    }
+    tapelist = NULL;
 
-    save_kt = keytable;
-    keytable = numb_keytable;
+    for(ip=interface_list; ip != NULL; ip = ipnext) {
+       amfree(ip->name);
+       for(i=0; i<INTER_INTER-1; i++) {
+          free_val_t(&ip->value[i]);
+       }
+       ipnext = ip->next;
+       amfree(ip);
+    }
+    interface_list = NULL;
 
-    get_conftoken(CONF_ANY);
+    for(i=0; i<CNF_CNF-1; i++)
+       free_val_t(&conf_data[i]);
 
-    switch(tok) {
-    case CONF_LONG:
-       val = tokenval.v.l;
-       break;
+    if (applied_config_overwrites) {
+       free_config_overwrites(applied_config_overwrites);
+       applied_config_overwrites = NULL;
+    }
 
-    case CONF_INT:
-#if SIZEOF_LONG < SIZEOF_INT
-       if ((off_t)tokenval.v.i > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.i < (off_t)LONG_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (long)tokenval.v.i;
-       break;
+    amfree(config_name);
+    amfree(config_dir);
 
-    case CONF_SIZE:
-#if SIZEOF_LONG < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.size < (off_t)LONG_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (long)tokenval.v.size;
-       break;
+    config_client = FALSE;
 
-    case CONF_AM64:
-#if SIZEOF_LONG < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)LONG_MIN)
-           conf_parserror("value too small");
+    config_initialized = FALSE;
+}
+
+static void
+init_defaults(
+    void)
+{
+    assert(!config_initialized);
+
+    /* defaults for exported variables */
+    conf_init_str(&conf_data[CNF_ORG], DEFAULT_CONFIG);
+    conf_init_str(&conf_data[CNF_CONF], DEFAULT_CONFIG);
+    conf_init_str(&conf_data[CNF_INDEX_SERVER], DEFAULT_SERVER);
+    conf_init_str(&conf_data[CNF_TAPE_SERVER], DEFAULT_TAPE_SERVER);
+    conf_init_str(&conf_data[CNF_AUTH], "bsd");
+    conf_init_str(&conf_data[CNF_SSH_KEYS], "");
+    conf_init_str(&conf_data[CNF_AMANDAD_PATH], "");
+    conf_init_str(&conf_data[CNF_CLIENT_USERNAME], "");
+    conf_init_str(&conf_data[CNF_GNUTAR_LIST_DIR], GNUTAR_LISTED_INCREMENTAL_DIR);
+    conf_init_str(&conf_data[CNF_AMANDATES], DEFAULT_AMANDATES_FILE);
+    conf_init_str(&conf_data[CNF_MAILTO], "operators");
+    conf_init_str(&conf_data[CNF_DUMPUSER], CLIENT_LOGIN);
+    conf_init_str(&conf_data[CNF_TAPEDEV], DEFAULT_TAPE_DEVICE);
+    conf_init_proplist(&conf_data[CNF_DEVICE_PROPERTY]);
+    conf_init_str(&conf_data[CNF_CHANGERDEV], DEFAULT_CHANGER_DEVICE);
+    conf_init_str(&conf_data[CNF_CHANGERFILE], "/usr/adm/amanda/changer-status");
+    conf_init_str   (&conf_data[CNF_LABELSTR]             , ".*");
+    conf_init_str   (&conf_data[CNF_TAPELIST]             , "tapelist");
+    conf_init_str   (&conf_data[CNF_DISKFILE]             , "disklist");
+    conf_init_str   (&conf_data[CNF_INFOFILE]             , "/usr/adm/amanda/curinfo");
+    conf_init_str   (&conf_data[CNF_LOGDIR]               , "/usr/adm/amanda");
+    conf_init_str   (&conf_data[CNF_INDEXDIR]             , "/usr/adm/amanda/index");
+    conf_init_ident    (&conf_data[CNF_TAPETYPE]             , "EXABYTE");
+    conf_init_int      (&conf_data[CNF_DUMPCYCLE]            , 10);
+    conf_init_int      (&conf_data[CNF_RUNSPERCYCLE]         , 0);
+    conf_init_int      (&conf_data[CNF_TAPECYCLE]            , 15);
+    conf_init_int      (&conf_data[CNF_NETUSAGE]             , 8000);
+    conf_init_int      (&conf_data[CNF_INPARALLEL]           , 10);
+    conf_init_str   (&conf_data[CNF_DUMPORDER]            , "ttt");
+    conf_init_int      (&conf_data[CNF_BUMPPERCENT]          , 0);
+    conf_init_am64     (&conf_data[CNF_BUMPSIZE]             , (off_t)10*1024);
+    conf_init_real     (&conf_data[CNF_BUMPMULT]             , 1.5);
+    conf_init_int      (&conf_data[CNF_BUMPDAYS]             , 2);
+    conf_init_str   (&conf_data[CNF_TPCHANGER]            , "");
+    conf_init_int      (&conf_data[CNF_RUNTAPES]             , 1);
+    conf_init_int      (&conf_data[CNF_MAXDUMPS]             , 1);
+    conf_init_int      (&conf_data[CNF_ETIMEOUT]             , 300);
+    conf_init_int      (&conf_data[CNF_DTIMEOUT]             , 1800);
+    conf_init_int      (&conf_data[CNF_CTIMEOUT]             , 30);
+    conf_init_int      (&conf_data[CNF_TAPEBUFS]             , 20);
+    conf_init_size     (&conf_data[CNF_DEVICE_OUTPUT_BUFFER_SIZE], 40*32768);
+    conf_init_str   (&conf_data[CNF_PRINTER]              , "");
+    conf_init_bool     (&conf_data[CNF_AUTOFLUSH]            , 0);
+    conf_init_int      (&conf_data[CNF_RESERVE]              , 100);
+    conf_init_am64     (&conf_data[CNF_MAXDUMPSIZE]          , (off_t)-1);
+    conf_init_str   (&conf_data[CNF_COLUMNSPEC]           , "");
+    conf_init_bool     (&conf_data[CNF_AMRECOVER_DO_FSF]     , 1);
+    conf_init_str   (&conf_data[CNF_AMRECOVER_CHANGER]    , "");
+    conf_init_bool     (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1);
+    conf_init_taperalgo(&conf_data[CNF_TAPERALGO]            , 0);
+    conf_init_int      (&conf_data[CNF_FLUSH_THRESHOLD_DUMPED]   , 0);
+    conf_init_int      (&conf_data[CNF_FLUSH_THRESHOLD_SCHEDULED], 0);
+    conf_init_int      (&conf_data[CNF_TAPERFLUSH]               , 0);
+    conf_init_str   (&conf_data[CNF_DISPLAYUNIT]          , "k");
+    conf_init_str   (&conf_data[CNF_KRB5KEYTAB]           , "/.amanda-v5-keytab");
+    conf_init_str   (&conf_data[CNF_KRB5PRINCIPAL]        , "service/amanda");
+    conf_init_str   (&conf_data[CNF_LABEL_NEW_TAPES]      , "");
+    conf_init_bool     (&conf_data[CNF_USETIMESTAMPS]        , 1);
+    conf_init_int      (&conf_data[CNF_CONNECT_TRIES]        , 3);
+    conf_init_int      (&conf_data[CNF_REP_TRIES]            , 5);
+    conf_init_int      (&conf_data[CNF_REQ_TRIES]            , 3);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMANDAD]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMIDXTAPED]     , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMINDEXD]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMRECOVER]      , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AUTH]           , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_EVENT]          , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_HOLDING]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_PROTOCOL]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_PLANNER]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_DRIVER]         , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_DUMPER]         , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_CHUNKER]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_TAPER]          , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SELFCHECK]      , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SENDSIZE]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SENDBACKUP]     , 0);
+#ifdef UDPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , UDPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , 512, IPPORT_RESERVED-1);
+#endif
+#ifdef LOW_TCPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , LOW_TCPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , 512, IPPORT_RESERVED-1);
+#endif
+#ifdef TCPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , TCPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , IPPORT_RESERVED, 65535);
 #endif
-       val = (long)tokenval.v.am64;
-       break;
 
-    case CONF_AMINFINITY:
-       val = (long)LONG_MAX;
-       break;
+    /* reset internal variables */
+    got_parserror = FALSE;
+    allow_overwrites = 0;
+    token_pushed = 0;
 
-    default:
-       conf_parserror("an integer is expected");
-       val = 0;
-       break;
-    }
+    /* create some predefined dumptypes for backwards compatability */
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-COMPRESS");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]);
+    val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_NONE;
+    val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1;
+    save_dumptype();
 
-    get_conftoken(CONF_ANY);
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-FAST");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]);
+    val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_FAST;
+    val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1;
+    save_dumptype();
 
-    switch(tok) {
-    case CONF_NL:
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-BEST");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]);
+    val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_BEST;
+    val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1;
+    save_dumptype();
 
-    case CONF_MULT7:
-       if (val > (LONG_MAX / 7L))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / 7L))
-           conf_parserror("value too small");
-       val *= 7L;
-       break;
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-CUST");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]);
+    val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_CUST;
+    val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1;
+    save_dumptype();
 
-    case CONF_MULT1M:
-       if (val > (LONG_MAX / 1024L))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / 1024L))
-           conf_parserror("value too small");
-       val *= 1024L;
-       break;
+    init_dumptype_defaults();
+    dpcur.name = stralloc("SRVCOMPRESS");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]);
+    val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_SERVER_FAST;
+    val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1;
+    save_dumptype();
 
-    case CONF_MULT1G:
-       if (val > (LONG_MAX / (1024L * 1024L)))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / (1024L * 1024L)))
-           conf_parserror("value too small");
-       val *= 1024L * 1024L;
-       break;
+    init_dumptype_defaults();
+    dpcur.name = stralloc("BSD-AUTH");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]);
+    val_t__str(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = stralloc("BSD");
+    val_t__seen(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = -1;
+    save_dumptype();
 
-    default:
-       unget_conftoken();
-       break;
-    }
+    init_dumptype_defaults();
+    dpcur.name = stralloc("KRB4-AUTH");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]);
+    val_t__str(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = stralloc("KRB4");
+    val_t__seen(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = -1;
+    save_dumptype();
 
-    keytable = save_kt;
-    return val;
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-RECORD");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_RECORD]);
+    val_t__int(&dpcur.value[DUMPTYPE_RECORD]) = 0;
+    val_t__seen(&dpcur.value[DUMPTYPE_RECORD]) = -1;
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-HOLD");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_HOLDINGDISK]);
+    val_t__holding(&dpcur.value[DUMPTYPE_HOLDINGDISK]) = HOLD_NEVER;
+    val_t__seen(&dpcur.value[DUMPTYPE_HOLDINGDISK]) = -1;
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-FULL");
+    dpcur.seen = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_STRATEGY]);
+    val_t__strategy(&dpcur.value[DUMPTYPE_STRATEGY]) = DS_NOFULL;
+    val_t__seen(&dpcur.value[DUMPTYPE_STRATEGY]) = -1;
+    save_dumptype();
+
+    /* And we're initialized! */
+    config_initialized = 1;
 }
-*/
 
-static ssize_t
-get_size(void)
+char **
+get_config_options(
+    int first)
 {
-    ssize_t val;
-    keytab_t *save_kt;
+    char             **config_options;
+    char            **config_option;
+    int                     n_applied_config_overwrites = 0;
+    int                     i;
 
-    save_kt = keytable;
-    keytable = numb_keytable;
+    if (applied_config_overwrites)
+       n_applied_config_overwrites = applied_config_overwrites->n_used;
 
-    get_conftoken(CONF_ANY);
+    config_options = alloc((first+n_applied_config_overwrites+1)*SIZEOF(char *));
+    config_option = config_options + first;
 
-    switch(tok) {
-    case CONF_SIZE:
-       val = tokenval.v.size;
-       break;
+    for (i = 0; i < n_applied_config_overwrites; i++) {
+       char *key = applied_config_overwrites->ovr[i].key;
+       char *value = applied_config_overwrites->ovr[i].value;
+       *config_option = vstralloc("-o", key, "=", value, NULL);
+       config_option++;
+    }
 
-    case CONF_INT:
-#if SIZEOF_SIZE_T < SIZEOF_INT
-       if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (ssize_t)tokenval.v.i;
-       break;
+    *config_option = NULL; /* add terminating sentinel */
 
-    case CONF_LONG:
-#if SIZEOF_SIZE_T < SIZEOF_LONG
-       if ((off_t)tokenval.v.l > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.l < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (ssize_t)tokenval.v.l;
-       break;
+    return config_options;
+}
 
-    case CONF_AM64:
-#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (ssize_t)tokenval.v.am64;
-       break;
+static void
+update_derived_values(
+    gboolean is_client)
+{
+    interface_t *ip;
 
-    case CONF_AMINFINITY:
-       val = (ssize_t)SSIZE_MAX;
-       break;
+    if (!is_client) {
+       /* Add a 'default' interface if one doesn't already exist */
+       if (!(ip = lookup_interface("default"))) {
+           init_interface_defaults();
+           ifcur.name = stralloc("default");
+           ifcur.seen = getconf_seen(CNF_NETUSAGE);
+           save_interface();
 
-    default:
-       conf_parserror("an integer is expected");
-       val = 0;
-       break;
+           ip = lookup_interface("default");
+       }
+
+       /* .. and set its maxusage from 'netusage' */
+       if (!interface_seen(ip, INTER_MAXUSAGE)) {
+           val_t *v;
+
+           v = interface_getconf(ip, INTER_COMMENT);
+           free_val_t(v);
+           val_t__str(v) = stralloc(_("implicit from NETUSAGE"));
+           val_t__seen(v) = getconf_seen(CNF_NETUSAGE);
+
+           v = interface_getconf(ip, INTER_MAXUSAGE);
+           free_val_t(v);
+           val_t__int(v) = getconf_int(CNF_NETUSAGE);
+           val_t__seen(v) = getconf_seen(CNF_NETUSAGE);
+       }
     }
 
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
+    /* fill in the debug_* values */
+    debug_amandad    = getconf_int(CNF_DEBUG_AMANDAD);
+    debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED);
+    debug_amindexd   = getconf_int(CNF_DEBUG_AMINDEXD);
+    debug_amrecover  = getconf_int(CNF_DEBUG_AMRECOVER);
+    debug_auth       = getconf_int(CNF_DEBUG_AUTH);
+    debug_event      = getconf_int(CNF_DEBUG_EVENT);
+    debug_holding    = getconf_int(CNF_DEBUG_HOLDING);
+    debug_protocol   = getconf_int(CNF_DEBUG_PROTOCOL);
+    debug_planner    = getconf_int(CNF_DEBUG_PLANNER);
+    debug_driver     = getconf_int(CNF_DEBUG_DRIVER);
+    debug_dumper     = getconf_int(CNF_DEBUG_DUMPER);
+    debug_chunker    = getconf_int(CNF_DEBUG_CHUNKER);
+    debug_taper      = getconf_int(CNF_DEBUG_TAPER);
+    debug_selfcheck  = getconf_int(CNF_DEBUG_SELFCHECK);
+    debug_sendsize   = getconf_int(CNF_DEBUG_SENDSIZE);
+    debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP);
 
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
+    /* And finally, display unit */
+    switch (getconf_str(CNF_DISPLAYUNIT)[0]) {
+       case 'k':
+       case 'K':
+           unit_divisor = 1;
+           break;
 
-    case CONF_MULT7:
-       if (val > (ssize_t)(SSIZE_MAX / 7))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / 7))
-           conf_parserror("value too small");
-       val *= (ssize_t)7;
-       break;
+       case 'm':
+       case 'M':
+           unit_divisor = 1024;
+           break;
 
-    case CONF_MULT1M:
-       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024))
-           conf_parserror("value too small");
-       val *= (ssize_t)1024;
-       break;
+       case 'g':
+       case 'G':
+           unit_divisor = 1024*1024;
+           break;
 
-    case CONF_MULT1G:
-       if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024)))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024)))
-           conf_parserror("value too small");
-       val *= (ssize_t)(1024 * 1024);
-       break;
+       case 't':
+       case 'T':
+           unit_divisor = 1024*1024*1024;
+           break;
 
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
+       default:
+           error(_("Invalid displayunit missed by validate_displayunit"));
+           /* NOTREACHED */
     }
-
-    keytable = save_kt;
-    return val;
 }
 
-static off_t
-get_am64_t(void)
+static void
+conf_init_int(
+    val_t *val,
+    int    i)
 {
-    off_t val;
-    keytab_t *save_kt;
+    val->seen = 0;
+    val->type = CONFTYPE_INT;
+    val_t__int(val) = i;
+}
 
-    save_kt = keytable;
-    keytable = numb_keytable;
+static void
+conf_init_am64(
+    val_t *val,
+    off_t   l)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_AM64;
+    val_t__am64(val) = l;
+}
 
-    get_conftoken(CONF_ANY);
+static void
+conf_init_real(
+    val_t  *val,
+    float r)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_REAL;
+    val_t__real(val) = r;
+}
 
-    switch(tok) {
-    case CONF_INT:
-       val = (off_t)tokenval.v.i;
-       break;
+static void
+conf_init_str(
+    val_t *val,
+    char  *s)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_STR;
+    if(s)
+       val->v.s = stralloc(s);
+    else
+       val->v.s = NULL;
+}
 
-    case CONF_LONG:
-       val = (off_t)tokenval.v.l;
-       break;
+static void
+conf_init_ident(
+    val_t *val,
+    char  *s)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_IDENT;
+    if(s)
+       val->v.s = stralloc(s);
+    else
+       val->v.s = NULL;
+}
 
-    case CONF_SIZE:
-       val = (off_t)tokenval.v.size;
-       break;
+static void
+conf_init_time(
+    val_t *val,
+    time_t   t)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_TIME;
+    val_t__time(val) = t;
+}
 
-    case CONF_AM64:
-       val = tokenval.v.am64;
-       break;
+static void
+conf_init_size(
+    val_t *val,
+    ssize_t   sz)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_SIZE;
+    val_t__size(val) = sz;
+}
 
-    case CONF_AMINFINITY:
-       val = AM64_MAX;
-       break;
+static void
+conf_init_bool(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_BOOLEAN;
+    val_t__boolean(val) = i;
+}
 
-    default:
-       conf_parserror("an integer is expected");
-       val = 0;
-       break;
-    }
+static void
+conf_init_compress(
+    val_t *val,
+    comp_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_COMPRESS;
+    val_t__compress(val) = (int)i;
+}
 
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
+static void
+conf_init_encrypt(
+    val_t *val,
+    encrypt_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_ENCRYPT;
+    val_t__encrypt(val) = (int)i;
+}
 
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
+static void
+conf_init_holding(
+    val_t              *val,
+    dump_holdingdisk_t  i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_HOLDING;
+    val_t__holding(val) = (int)i;
+}
 
-    case CONF_MULT7:
-       if (val > AM64_MAX/7 || val < AM64_MIN/7)
-           conf_parserror("value too large");
-       val *= 7;
-       break;
+static void
+conf_init_estimate(
+    val_t *val,
+    estimate_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_ESTIMATE;
+    val_t__estimate(val) = i;
+}
 
-    case CONF_MULT1M:
-       if (val > AM64_MAX/1024 || val < AM64_MIN/1024)
-           conf_parserror("value too large");
-       val *= 1024;
-       break;
+static void
+conf_init_strategy(
+    val_t *val,
+    strategy_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_STRATEGY;
+    val_t__strategy(val) = i;
+}
 
-    case CONF_MULT1G:
-       if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024))
-           conf_parserror("value too large");
-       val *= 1024*1024;
-       break;
+static void
+conf_init_taperalgo(
+    val_t *val,
+    taperalgo_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_TAPERALGO;
+    val_t__taperalgo(val) = i;
+}
 
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
-    }
+static void
+conf_init_priority(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_PRIORITY;
+    val_t__priority(val) = i;
+}
 
-    keytable = save_kt;
+static void
+conf_init_rate(
+    val_t  *val,
+    float r1,
+    float r2)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_RATE;
+    val_t__rate(val)[0] = r1;
+    val_t__rate(val)[1] = r2;
+}
 
-    return val;
+static void
+conf_init_exinclude(
+    val_t *val)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_EXINCLUDE;
+    val_t__exinclude(val).optional = 0;
+    val_t__exinclude(val).sl_list = NULL;
+    val_t__exinclude(val).sl_file = NULL;
 }
 
-keytab_t bool_keytable[] = {
-    { "Y", CONF_ATRUE },
-    { "YES", CONF_ATRUE },
-    { "T", CONF_ATRUE },
-    { "TRUE", CONF_ATRUE },
-    { "ON", CONF_ATRUE },
-    { "N", CONF_AFALSE },
-    { "NO", CONF_AFALSE },
-    { "F", CONF_AFALSE },
-    { "FALSE", CONF_AFALSE },
-    { "OFF", CONF_AFALSE },
-    { NULL, CONF_IDENT }
-};
+static void
+conf_init_intrange(
+    val_t *val,
+    int    i1,
+    int    i2)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_INTRANGE;
+    val_t__intrange(val)[0] = i1;
+    val_t__intrange(val)[1] = i2;
+}
 
-static int
-get_bool(void)
+static void
+conf_init_proplist(
+    val_t *val)
 {
-    int val;
-    keytab_t *save_kt;
+    val->seen = 0;
+    val->type = CONFTYPE_PROPLIST;
+    val_t__proplist(val) =
+        g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+}
 
-    save_kt = keytable;
-    keytable = bool_keytable;
+/*
+ * Config access implementation
+ */
 
-    get_conftoken(CONF_ANY);
+val_t *
+getconf(confparm_key key)
+{
+    assert(key < CNF_CNF);
+    return &conf_data[key];
+}
 
-    switch(tok) {
-    case CONF_INT:
-       if (tokenval.v.i != 0)
-           val = 1;
-       else
-           val = 0;
-       break;
+GSList *
+getconf_list(
+    char *listname)
+{
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+    GSList *rv = NULL;
 
-    case CONF_LONG:
-       if (tokenval.v.l != 0L)
-           val = 1;
-       else
-           val = 0;
-       break;
+    if (strcasecmp(listname,"tapetype") == 0) {
+       for(tp = tapelist; tp != NULL; tp=tp->next) {
+           rv = g_slist_append(rv, tp->name);
+       }
+    } else if (strcasecmp(listname,"dumptype") == 0) {
+       for(dp = dumplist; dp != NULL; dp=dp->next) {
+           rv = g_slist_append(rv, dp->name);
+       }
+    } else if (strcasecmp(listname,"holdingdisk") == 0) {
+       for(hp = holdinglist; hp != NULL; hp=hp->next) {
+           rv = g_slist_append(rv, hp->name);
+       }
+    } else if (strcasecmp(listname,"interface") == 0) {
+       for(ip = interface_list; ip != NULL; ip=ip->next) {
+           rv = g_slist_append(rv, ip->name);
+       }
+    }
+    return rv;
+}
 
-    case CONF_SIZE:
-       if (tokenval.v.size != (size_t)0)
-           val = 1;
-       else
-           val = 0;
-       break;
+val_t *
+getconf_byname(
+    char *key)
+{
+    val_t *rv = NULL;
 
-    case CONF_AM64:
-       if (tokenval.v.am64 != (off_t)0)
-           val = 1;
-       else
-           val = 0;
-       break;
+    if (!parm_key_info(key, NULL, &rv))
+       return NULL;
 
-    case CONF_ATRUE:
-       val = 1;
-       break;
+    return rv;
+}
 
-    case CONF_AFALSE:
-       val = 0;
-       break;
+tapetype_t *
+lookup_tapetype(
+    char *str)
+{
+    tapetype_t *p;
 
-    case CONF_NL:
-       unget_conftoken();
-       val = 2; /* no argument - most likely TRUE */
-       break;
-    default:
-       unget_conftoken();
-       val = 3; /* a bad argument - most likely TRUE */
-       conf_parserror("YES, NO, TRUE, FALSE, ON, OFF expected");
-       break;
+    for(p = tapelist; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
     }
+    return NULL;
+}
 
-    keytable = save_kt;
-    return val;
+val_t *
+tapetype_getconf(
+    tapetype_t *ttyp,
+    tapetype_key key)
+{
+    assert(ttyp != NULL);
+    assert(key < TAPETYPE_TAPETYPE);
+    return &ttyp->value[key];
 }
 
-void
-ckseen(
-    int *seen)
+char *
+tapetype_name(
+    tapetype_t *ttyp)
+{
+    assert(ttyp != NULL);
+    return ttyp->name;
+}
+
+dumptype_t *
+lookup_dumptype(
+    char *str)
 {
-    if (*seen && !allow_overwrites && conf_line_num != -2) {
-       conf_parserror("duplicate parameter, prev def on line %d", *seen);
+    dumptype_t *p;
+
+    for(p = dumplist; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
     }
-    *seen = conf_line_num;
+    return NULL;
 }
 
-printf_arglist_function(void conf_parserror, const char *, format)
+val_t *
+dumptype_getconf(
+    dumptype_t *dtyp,
+    dumptype_key key)
 {
-    va_list argp;
+    assert(dtyp != NULL);
+    assert(key < DUMPTYPE_DUMPTYPE);
+    return &dtyp->value[key];
+}
 
-    /* print error message */
+char *
+dumptype_name(
+    dumptype_t *dtyp)
+{
+    assert(dtyp != NULL);
+    return dtyp->name;
+}
 
-    if(conf_line)
-       fprintf(stderr, "argument \"%s\": ", conf_line);
-    else
-       fprintf(stderr, "\"%s\", line %d: ", conf_confname, conf_line_num);
-    arglist_start(argp, format);
-    vfprintf(stderr, format, argp);
-    arglist_end(argp);
-    fputc('\n', stderr);
+interface_t *
+lookup_interface(
+    char *str)
+{
+    interface_t *p;
 
-    got_parserror = 1;
+    for(p = interface_list; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
 }
 
-tok_t
-lookup_keyword(
-    char *     str)
+val_t *
+interface_getconf(
+    interface_t *iface,
+    interface_key key)
 {
-    keytab_t *kwp;
+    assert(iface != NULL);
+    assert(key < INTER_INTER);
+    return &iface->value[key];
+}
+
+char *
+interface_name(
+    interface_t *iface)
+{
+    assert(iface != NULL);
+    return iface->name;
+}
 
-    /* switch to binary search if performance warrants */
+holdingdisk_t *
+lookup_holdingdisk(
+    char *str)
+{
+    holdingdisk_t *p;
 
-    for(kwp = keytable; kwp->keyword != NULL; kwp++) {
-       if (strcasecmp(kwp->keyword, str) == 0) break;
+    for(p = holdinglist; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
     }
-    return kwp->token;
+    return NULL;
+}
+
+holdingdisk_t *
+getconf_holdingdisks(
+    void)
+{
+    return holdinglist;
 }
 
-char tkbuf[4096];
+holdingdisk_t *
+holdingdisk_next(
+    holdingdisk_t *hdisk)
+{
+    if (hdisk) return hdisk->next;
+    return NULL;
+}
 
-/* push the last token back (can only unget ANY tokens) */
-static void
-unget_conftoken(void)
+val_t *
+holdingdisk_getconf(
+    holdingdisk_t *hdisk,
+    holdingdisk_key key)
 {
-    token_pushed = 1;
-    pushed_tok = tok;
-    tok = CONF_UNKNOWN;
-    return;
+    assert(hdisk != NULL);
+    assert(key < HOLDING_HOLDING);
+    return &hdisk->value[key];
 }
 
-static int
-conftoken_getc(void)
+char *
+holdingdisk_name(
+    holdingdisk_t *hdisk)
 {
-    if(conf_line == NULL)
-       return getc(conf_conf);
-    if(*conf_char == '\0')
-       return -1;
-    return(*conf_char++);
+    assert(hdisk != NULL);
+    return hdisk->name;
 }
 
-static int
-conftoken_ungetc(
-    int c)
+long int
+getconf_unit_divisor(void)
 {
-    if(conf_line == NULL)
-       return ungetc(c, conf_conf);
-    else if(conf_char > conf_line) {
-       if(c == -1)
-           return c;
-       conf_char--;
-       if(*conf_char != c) {
-           error("*conf_char != c   : %c %c", *conf_char, c);
+    return unit_divisor;
+}
+
+/*
+ * Command-line Handling Implementation
+ */
+
+config_overwrites_t *
+new_config_overwrites(
+    int size_estimate)
+{
+    config_overwrites_t *co;
+
+    co = alloc(sizeof(*co));
+    co->ovr = alloc(sizeof(*co->ovr) * size_estimate);
+    co->n_allocated = size_estimate;
+    co->n_used = 0;
+
+    return co;
+}
+
+void
+free_config_overwrites(
+    config_overwrites_t *co)
+{
+    int i;
+
+    if (!co) return;
+    for (i = 0; i < co->n_used; i++) {
+       amfree(co->ovr[i].key);
+       amfree(co->ovr[i].value);
+    }
+    amfree(co->ovr);
+    amfree(co);
+}
+
+void add_config_overwrite(
+    config_overwrites_t *co,
+    char *key,
+    char *value)
+{
+    /* reallocate if necessary */
+    if (co->n_used == co->n_allocated) {
+       co->n_allocated *= 2;
+       co->ovr = realloc(co->ovr, co->n_allocated * sizeof(*co->ovr));
+       if (!co->ovr) {
+           error(_("Cannot realloc; out of memory"));
            /* NOTREACHED */
        }
-    } else {
-       error("conf_char == conf_line");
-       /* NOTREACHED */
     }
-    return c;
+
+    co->ovr[co->n_used].key = stralloc(key);
+    co->ovr[co->n_used].value = stralloc(value);
+    co->n_used++;
 }
 
-static void
-get_conftoken(
-    tok_t      exp)
+void
+add_config_overwrite_opt(
+    config_overwrites_t *co,
+    char *optarg)
 {
-    int ch, d;
-    off_t am64;
-    char *buf;
-    char *tmps;
-    int token_overflow;
-    int inquote = 0;
-    int escape = 0;
-    int sign;
+    char *value;
+    assert(optarg != NULL);
 
-    if (token_pushed) {
-       token_pushed = 0;
-       tok = pushed_tok;
+    value = index(optarg, '=');
+    if (value == NULL) {
+       error(_("Must specify a value for %s."), optarg);
+       /* NOTREACHED */
+    }
 
-       /*
-       ** If it looked like a key word before then look it
-       ** up again in the current keyword table.
-       */
-       switch(tok) {
-       case CONF_LONG:    case CONF_AM64:    case CONF_SIZE:
-       case CONF_INT:     case CONF_REAL:    case CONF_STRING:
-       case CONF_LBRACE:  case CONF_RBRACE:  case CONF_COMMA:
-       case CONF_NL:      case CONF_END:     case CONF_UNKNOWN:
-       case CONF_TIME:
-           break;
+    *value = '\0';
+    add_config_overwrite(co, optarg, value+1);
+    *value = '=';
+}
 
-       default:
-           if (exp == CONF_IDENT)
-               tok = CONF_IDENT;
-           else
-               tok = lookup_keyword(tokenval.v.s);
-           break;
-       }
-    }
-    else {
-       ch = conftoken_getc();
+config_overwrites_t *
+extract_commandline_config_overwrites(
+    int *argc,
+    char ***argv)
+{
+    int i, j, moveup;
+    config_overwrites_t *co = new_config_overwrites(*argc/2);
 
-       while(ch != EOF && ch != '\n' && isspace(ch))
-           ch = conftoken_getc();
-       if (ch == '#') {        /* comment - eat everything but eol/eof */
-           while((ch = conftoken_getc()) != EOF && ch != '\n') {
-               (void)ch; /* Quiet empty loop complaints */     
+    i = 0;
+    while (i<*argc) {
+       if(strncmp((*argv)[i],"-o",2) == 0) {
+           if(strlen((*argv)[i]) > 2) {
+               add_config_overwrite_opt(co, (*argv)[i]+2);
+               moveup = 1;
+           }
+           else {
+               if (i+1 >= *argc) error(_("expect something after -o"));
+               add_config_overwrite_opt(co, (*argv)[i+1]);
+               moveup = 2;
            }
+
+           /* move up remaining argment array */
+           for (j = i; j+moveup<*argc; j++) {
+               (*argv)[j] = (*argv)[j+moveup];
+           }
+           *argc -= moveup;
+       } else {
+           i++;
        }
+    }
 
-       if (isalpha(ch)) {              /* identifier */
-           buf = tkbuf;
-           token_overflow = 0;
-           do {
-               if (buf < tkbuf+sizeof(tkbuf)-1) {
-                   *buf++ = (char)ch;
-               } else {
-                   *buf = '\0';
-                   if (!token_overflow) {
-                       conf_parserror("token too long: %.20s...", tkbuf);
-                   }
-                   token_overflow = 1;
-               }
-               ch = conftoken_getc();
-           } while(isalnum(ch) || ch == '_' || ch == '-');
-
-           if (ch != EOF && conftoken_ungetc(ch) == EOF) {
-               if (ferror(conf_conf)) {
-                   conf_parserror("Pushback of '%c' failed: %s",
-                                  ch, strerror(ferror(conf_conf)));
-               } else {
-                   conf_parserror("Pushback of '%c' failed: EOF", ch);
-               }
-           }
-           *buf = '\0';
-
-           tokenval.v.s = tkbuf;
-
-           if (token_overflow) tok = CONF_UNKNOWN;
-           else if (exp == CONF_IDENT) tok = CONF_IDENT;
-           else tok = lookup_keyword(tokenval.v.s);
-       }
-       else if (isdigit(ch)) { /* integer */
-           sign = 1;
-
-negative_number: /* look for goto negative_number below sign is set there */
-           am64 = 0;
-           do {
-               am64 = am64 * 10 + (ch - '0');
-               ch = conftoken_getc();
-           } while (isdigit(ch));
-
-           if (ch != '.') {
-               if (exp == CONF_INT) {
-                   tok = CONF_INT;
-                   tokenval.v.i = sign * (int)am64;
-               } else if (exp == CONF_LONG) {
-                   tok = CONF_LONG;
-                   tokenval.v.l = (long)sign * (long)am64;
-               } else if (exp != CONF_REAL) {
-                   tok = CONF_AM64;
-                   tokenval.v.am64 = (off_t)sign * am64;
-               } else {
-                   /* automatically convert to real when expected */
-                   tokenval.v.r = (double)sign * (double)am64;
-                   tok = CONF_REAL;
-               }
-           } else {
-               /* got a real number, not an int */
-               tokenval.v.r = sign * (double) am64;
-               am64 = 0;
-               d = 1;
-               ch = conftoken_getc();
-               while (isdigit(ch)) {
-                   am64 = am64 * 10 + (ch - '0');
-                   d = d * 10;
-                   ch = conftoken_getc();
-               }
-               tokenval.v.r += sign * ((double)am64) / d;
-               tok = CONF_REAL;
-           }
-
-           if (ch != EOF &&  conftoken_ungetc(ch) == EOF) {
-               if (ferror(conf_conf)) {
-                   conf_parserror("Pushback of '%c' failed: %s",
-                                  ch, strerror(ferror(conf_conf)));
-               } else {
-                   conf_parserror("Pushback of '%c' failed: EOF", ch);
-               }
-           }
-       } else switch(ch) {
-       case '"':                       /* string */
-           buf = tkbuf;
-           token_overflow = 0;
-           inquote = 1;
-           *buf++ = (char)ch;
-           while (inquote && ((ch = conftoken_getc()) != EOF)) {
-               if (ch == '\n') {
-                   if (!escape)
-                       break;
-                   escape = 0;
-                   buf--; /* Consume escape in buffer */
-               } else if (ch == '\\') {
-                   escape = 1;
-               } else {
-                   if (ch == '"') {
-                       if (!escape)
-                           inquote = 0;
-                   }
-                   escape = 0;
-               }
+    return co;
+}
 
-               if(buf >= &tkbuf[sizeof(tkbuf) - 1]) {
-                   if (!token_overflow) {
-                       conf_parserror("string too long: %.20s...", tkbuf);
-                   }
-                   token_overflow = 1;
-                   break;
-               }
-               *buf++ = (char)ch;
-           }
-           *buf = '\0';
+void
+apply_config_overwrites(
+    config_overwrites_t *co)
+{
+    int i;
 
-           /*
-            * A little manuver to leave a fully unquoted, unallocated  string
-            * in tokenval.v.s
-            */
-           tmps = unquote_string(tkbuf);
-           strncpy(tkbuf, tmps, sizeof(tkbuf));
-           amfree(tmps);
-           tokenval.v.s = tkbuf;
+    if(!co) return;
+    assert(keytable != NULL);
+    assert(parsetable != NULL);
 
-           tok = (token_overflow) ? CONF_UNKNOWN :
-                       (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING;
-           break;
+    for (i = 0; i < co->n_used; i++) {
+       char *key = co->ovr[i].key;
+       char *value = co->ovr[i].value;
+       val_t *key_val;
+       conf_var_t *key_parm;
 
-       case '-':
-           ch = conftoken_getc();
-           if (isdigit(ch)) {
-               sign = -1;
-               goto negative_number;
-           }
-           else {
-               if (ch != EOF && conftoken_ungetc(ch) == EOF) {
-                   if (ferror(conf_conf)) {
-                       conf_parserror("Pushback of '%c' failed: %s",
-                                      ch, strerror(ferror(conf_conf)));
-                   } else {
-                       conf_parserror("Pushback of '%c' failed: EOF", ch);
-                   }
-               }
-               tok = CONF_UNKNOWN;
-           }
-           break;
+       if (!parm_key_info(key, &key_parm, &key_val)) {
+           error(_("unknown parameter '%s'"), key);
+       }
 
-       case ',':
-           tok = CONF_COMMA;
-           break;
+       /* now set up a fake line and use the relevant read_function to
+        * parse it.  This is sneaky! */
 
-       case '{':
-           tok = CONF_LBRACE;
-           break;
+       if (key_parm->type == CONFTYPE_STR) {
+           current_line = vstralloc("\"", value, "\"", NULL);
+       } else {
+           current_line = stralloc("");
+       }
 
-       case '}':
-           tok = CONF_RBRACE;
-           break;
+       current_char = current_line;
+       token_pushed = 0;
+       current_line_num = -2;
+       allow_overwrites = 1;
+       got_parserror = 0;
 
-       case '\n':
-           tok = CONF_NL;
-           break;
+       key_parm->read_function(key_parm, key_val);
+       if ((key_parm)->validate_function)
+           key_parm->validate_function(key_parm, key_val);
 
-       case EOF:
-           tok = CONF_END;
-           break;
+       amfree(current_line);
+       current_char = NULL;
 
-       default:
-           tok = CONF_UNKNOWN;
-           break;
+       if (got_parserror) {
+           error(_("parse error in configuration overwrites"));
+           /* NOTREACHED */
        }
     }
 
-    if (exp != CONF_ANY && tok != exp) {
-       char *str;
-       keytab_t *kwp;
-
-       switch(exp) {
-       case CONF_LBRACE:
-           str = "\"{\"";
-           break;
-
-       case CONF_RBRACE:
-           str = "\"}\"";
-           break;
-
-       case CONF_COMMA:
-           str = "\",\"";
-           break;
-
-       case CONF_NL:
-           str = "end of line";
-           break;
-
-       case CONF_END:
-           str = "end of file";
-           break;
-
-       case CONF_INT:
-           str = "an integer";
-           break;
+    /* merge these overwrites with previous overwrites, if necessary */
+    if (applied_config_overwrites) {
+       for (i = 0; i < co->n_used; i++) {
+           char *key = co->ovr[i].key;
+           char *value = co->ovr[i].value;
 
-       case CONF_REAL:
-           str = "a real number";
-           break;
-
-       case CONF_STRING:
-           str = "a quoted string";
-           break;
-
-       case CONF_IDENT:
-           str = "an identifier";
-           break;
-
-       default:
-           for(kwp = keytable; kwp->keyword != NULL; kwp++) {
-               if (exp == kwp->token)
-                   break;
-           }
-           if (kwp->keyword == NULL)
-               str = "token not";
-           else
-               str = kwp->keyword;
-           break;
+           add_config_overwrite(applied_config_overwrites, key, value);
        }
-       conf_parserror("%s is expected", str);
-       tok = exp;
-       if (tok == CONF_INT)
-           tokenval.v.i = 0;
-       else
-           tokenval.v.s = "";
+       free_config_overwrites(co);
+    } else {
+       applied_config_overwrites = co;
     }
+
+    update_derived_values(config_client);
 }
 
+/*
+ * val_t Management Implementation
+ */
 
-static void
-read_string(
-    t_conf_var *np,
+int
+val_t_to_int(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_STRING);
-    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+    if (val->type != CONFTYPE_INT) {
+       error(_("val_t_to_int: val.type is not CONFTYPE_INT"));
+       /*NOTREACHED*/
+    }
+    return val_t__int(val);
 }
 
-static void
-read_ident(
-    t_conf_var *np,
+off_t
+val_t_to_am64(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_IDENT);
-    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+    if (val->type != CONFTYPE_AM64) {
+       error(_("val_t_to_am64: val.type is not CONFTYPE_AM64"));
+       /*NOTREACHED*/
+    }
+    return val_t__am64(val);
 }
 
-static void
-read_int(
-    t_conf_var *np,
+float
+val_t_to_real(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.i = get_int();
+    if (val->type != CONFTYPE_REAL) {
+       error(_("val_t_to_real: val.type is not CONFTYPE_REAL"));
+       /*NOTREACHED*/
+    }
+    return val_t__real(val);
 }
 
-/*
-static void
-read_long(
-    t_conf_var *np,
+char *
+val_t_to_str(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.l = get_long();
+    /* support CONFTYPE_IDENT, too */
+    if (val->type != CONFTYPE_STR && val->type != CONFTYPE_IDENT) {
+       error(_("val_t_to_str: val.type is not CONFTYPE_STR nor CONFTYPE_IDENT"));
+       /*NOTREACHED*/
+    }
+    return val_t__str(val);
 }
-*/
 
-static void
-read_size(
-    t_conf_var *np,
+char *
+val_t_to_ident(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.size = get_size();
+    /* support CONFTYPE_STR, too */
+    if (val->type != CONFTYPE_STR && val->type != CONFTYPE_IDENT) {
+       error(_("val_t_to_ident: val.type is not CONFTYPE_IDENT nor CONFTYPE_STR"));
+       /*NOTREACHED*/
+    }
+    return val_t__str(val);
 }
 
-static void
-read_am64(
-    t_conf_var *np,
+time_t
+val_t_to_time(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.am64 = get_am64_t();
+    if (val->type != CONFTYPE_TIME) {
+       error(_("val_t_to_time: val.type is not CONFTYPE_TIME"));
+       /*NOTREACHED*/
+    }
+    return val_t__time(val);
 }
 
-static void
-read_bool(
-    t_conf_var *np,
+ssize_t
+val_t_to_size(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.i = get_bool();
+    if (val->type != CONFTYPE_SIZE) {
+       error(_("val_t_to_size: val.type is not CONFTYPE_SIZE"));
+       /*NOTREACHED*/
+    }
+    return val_t__size(val);
 }
 
-static void
-read_real(
-    t_conf_var *np,
+int
+val_t_to_boolean(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_REAL);
-    val->v.r = tokenval.v.r;
+    if (val->type != CONFTYPE_BOOLEAN) {
+       error(_("val_t_to_bool: val.type is not CONFTYPE_BOOLEAN"));
+       /*NOTREACHED*/
+    }
+    return val_t__boolean(val);
 }
 
-static void
-read_time(
-    t_conf_var *np,
+comp_t
+val_t_to_compress(
     val_t *val)
 {
-    np = np;
-    ckseen(&val->seen);
-    val->v.t = get_time();
+    if (val->type != CONFTYPE_COMPRESS) {
+       error(_("val_t_to_compress: val.type is not CONFTYPE_COMPRESS"));
+       /*NOTREACHED*/
+    }
+    return val_t__compress(val);
+}
+
+encrypt_t
+val_t_to_encrypt(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_ENCRYPT) {
+       error(_("val_t_to_encrypt: val.type is not CONFTYPE_ENCRYPT"));
+       /*NOTREACHED*/
+    }
+    return val_t__encrypt(val);
+}
+
+dump_holdingdisk_t
+val_t_to_holding(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_HOLDING) {
+       error(_("val_t_to_hold: val.type is not CONFTYPE_HOLDING"));
+       /*NOTREACHED*/
+    }
+    return val_t__holding(val);
+}
+
+estimate_t
+val_t_to_estimate(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_ESTIMATE) {
+       error(_("val_t_to_extimate: val.type is not CONFTYPE_ESTIMATE"));
+       /*NOTREACHED*/
+    }
+    return val_t__estimate(val);
+}
+
+strategy_t
+val_t_to_strategy(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_STRATEGY) {
+       error(_("val_t_to_strategy: val.type is not CONFTYPE_STRATEGY"));
+       /*NOTREACHED*/
+    }
+    return val_t__strategy(val);
+}
+
+taperalgo_t
+val_t_to_taperalgo(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_TAPERALGO) {
+       error(_("val_t_to_taperalgo: val.type is not CONFTYPE_TAPERALGO"));
+       /*NOTREACHED*/
+    }
+    return val_t__taperalgo(val);
+}
+
+int
+val_t_to_priority(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_PRIORITY) {
+       error(_("val_t_to_priority: val.type is not CONFTYPE_PRIORITY"));
+       /*NOTREACHED*/
+    }
+    return val_t__priority(val);
+}
+
+float *
+val_t_to_rate(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_RATE) {
+       error(_("val_t_to_rate: val.type is not CONFTYPE_RATE"));
+       /*NOTREACHED*/
+    }
+    return val_t__rate(val);
+}
+
+exinclude_t
+val_t_to_exinclude(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_EXINCLUDE) {
+       error(_("val_t_to_exinclude: val.type is not CONFTYPE_EXINCLUDE"));
+       /*NOTREACHED*/
+    }
+    return val_t__exinclude(val);
+}
+
+
+int *
+val_t_to_intrange(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_INTRANGE) {
+       error(_("val_t_to_intrange: val.type is not CONFTYPE_INTRANGE"));
+       /*NOTREACHED*/
+    }
+    return val_t__intrange(val);
+}
+
+proplist_t
+val_t_to_proplist(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_PROPLIST) {
+       error(_("val_t_to_proplist: val.type is not CONFTYPE_PROPLIST"));
+       /*NOTREACHED*/
+    }
+    return val_t__proplist(val);
 }
 
 static void
@@ -4115,7 +4208,7 @@ copy_val_t(
        valdst->seen = valsrc->seen;
        switch(valsrc->type) {
        case CONFTYPE_INT:
-       case CONFTYPE_BOOL:
+       case CONFTYPE_BOOLEAN:
        case CONFTYPE_COMPRESS:
        case CONFTYPE_ENCRYPT:
        case CONFTYPE_HOLDING:
@@ -4126,10 +4219,6 @@ copy_val_t(
            valdst->v.i = valsrc->v.i;
            break;
 
-       case CONFTYPE_LONG:
-           valdst->v.l = valsrc->v.l;
-           break;
-
        case CONFTYPE_SIZE:
            valdst->v.size = valsrc->v.size;
            break;
@@ -4148,7 +4237,7 @@ copy_val_t(
            break;
 
        case CONFTYPE_IDENT:
-       case CONFTYPE_STRING:
+       case CONFTYPE_STR:
            valdst->v.s = stralloc(valsrc->v.s);
            break;
 
@@ -4156,10 +4245,6 @@ copy_val_t(
            valdst->v.t = valsrc->v.t;
            break;
 
-       case CONFTYPE_SL:
-           valdst->v.sl = duplicate_sl(valsrc->v.sl);
-           break;
-
        case CONFTYPE_EXINCLUDE:
            valdst->v.exinclude.optional = valsrc->v.exinclude.optional;
            valdst->v.exinclude.sl_list = duplicate_sl(valsrc->v.exinclude.sl_list);
@@ -4171,6 +4256,9 @@ copy_val_t(
            valdst->v.intrange[1] = valsrc->v.intrange[1];
            break;
 
+        case CONFTYPE_PROPLIST:
+            g_assert_not_reached();
+            break;
        }
     }
 }
@@ -4181,7 +4269,7 @@ free_val_t(
 {
     switch(val->type) {
        case CONFTYPE_INT:
-       case CONFTYPE_BOOL:
+       case CONFTYPE_BOOLEAN:
        case CONFTYPE_COMPRESS:
        case CONFTYPE_ENCRYPT:
        case CONFTYPE_HOLDING:
@@ -4190,7 +4278,6 @@ free_val_t(
        case CONFTYPE_SIZE:
        case CONFTYPE_TAPERALGO:
        case CONFTYPE_PRIORITY:
-       case CONFTYPE_LONG:
        case CONFTYPE_AM64:
        case CONFTYPE_REAL:
        case CONFTYPE_RATE:
@@ -4198,971 +4285,743 @@ free_val_t(
            break;
 
        case CONFTYPE_IDENT:
-       case CONFTYPE_STRING:
+       case CONFTYPE_STR:
            amfree(val->v.s);
            break;
 
        case CONFTYPE_TIME:
            break;
 
-       case CONFTYPE_SL:
-           free_sl(val->v.sl);
-           break;
-
        case CONFTYPE_EXINCLUDE:
-           free_sl(val->v.exinclude.sl_list);
-           free_sl(val->v.exinclude.sl_file);
+           free_sl(val_t__exinclude(val).sl_list);
+           free_sl(val_t__exinclude(val).sl_file);
            break;
+
+        case CONFTYPE_PROPLIST:
+            g_hash_table_destroy(val_t__proplist(val));
+            break;
     }
     val->seen = 0;
 }
 
+/*
+ * Utilities Implementation
+ */
+
 char *
-taperalgo2str(
-    int taperalgo)
+generic_get_security_conf(
+       char *string,
+       void *arg)
 {
-    if(taperalgo == ALGO_FIRST) return "FIRST";
-    if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT";
-    if(taperalgo == ALGO_LARGEST) return "LARGEST";
-    if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT";
-    if(taperalgo == ALGO_SMALLEST) return "SMALLEST";
-    if(taperalgo == ALGO_LAST) return "LAST";
-    return "UNKNOWN";
+       arg = arg;
+       if(!string || !*string)
+               return(NULL);
+
+       if(strcmp(string, "krb5principal")==0) {
+               return(getconf_str(CNF_KRB5PRINCIPAL));
+       } else if(strcmp(string, "krb5keytab")==0) {
+               return(getconf_str(CNF_KRB5KEYTAB));
+       }
+       return(NULL);
 }
 
-static char buffer_conf_print[2049];
+char *
+generic_client_get_security_conf(
+    char *     string,
+    void *     arg)
+{
+       (void)arg;      /* Quiet unused parameter warning */
+
+       if(!string || !*string)
+               return(NULL);
 
-static char *
-conf_print(
+       if(strcmp(string, "conf")==0) {
+               return(getconf_str(CNF_CONF));
+       } else if(strcmp(string, "index_server")==0) {
+               return(getconf_str(CNF_INDEX_SERVER));
+       } else if(strcmp(string, "tape_server")==0) {
+               return(getconf_str(CNF_TAPE_SERVER));
+       } else if(strcmp(string, "tapedev")==0) {
+               return(getconf_str(CNF_TAPEDEV));
+        } else if(strcmp(string, "auth")==0) {
+               return(getconf_str(CNF_AUTH));
+       } else if(strcmp(string, "ssh_keys")==0) {
+               return(getconf_str(CNF_SSH_KEYS));
+       } else if(strcmp(string, "amandad_path")==0) {
+               return(getconf_str(CNF_AMANDAD_PATH));
+       } else if(strcmp(string, "client_username")==0) {
+               return(getconf_str(CNF_CLIENT_USERNAME));
+       } else if(strcmp(string, "gnutar_list_dir")==0) {
+               return(getconf_str(CNF_GNUTAR_LIST_DIR));
+       } else if(strcmp(string, "amandates")==0) {
+               return(getconf_str(CNF_AMANDATES));
+       } else if(strcmp(string, "krb5principal")==0) {
+               return(getconf_str(CNF_KRB5PRINCIPAL));
+       } else if(strcmp(string, "krb5keytab")==0) {
+               return(getconf_str(CNF_KRB5KEYTAB));
+       }
+       return(NULL);
+}
+
+void
+dump_configuration(void)
+{
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+    int i;
+    conf_var_t *np;
+    keytab_t *kt;
+    char *prefix;
+
+    if (config_client) {
+       error(_("Don't know how to dump client configurations."));
+       /* NOTREACHED */
+    }
+
+    g_printf(_("# AMANDA CONFIGURATION FROM FILE \"%s\":\n\n"), config_filename);
+
+    for(np=server_var; np->token != CONF_UNKNOWN; np++) {
+       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) 
+           if (np->token == kt->token) break;
+
+       if(kt->token == CONF_UNKNOWN)
+           error(_("server bad token"));
+
+        val_t_print_token(stdout, NULL, "%-21s ", kt, &conf_data[np->parm]);
+    }
+
+    for(hp = holdinglist; hp != NULL; hp = hp->next) {
+       g_printf("\nHOLDINGDISK %s {\n", hp->name);
+       for(i=0; i < HOLDING_HOLDING; i++) {
+           for(np=holding_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->parm == i)
+                       break;
+           }
+           if(np->token == CONF_UNKNOWN)
+               error(_("holding bad value"));
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
+               if(kt->token == np->token)
+                   break;
+           }
+           if(kt->token == CONF_UNKNOWN)
+               error(_("holding bad token"));
+
+            val_t_print_token(stdout, NULL, "      %-9s ", kt, &hp->value[i]);
+       }
+       g_printf("}\n");
+    }
+
+    for(tp = tapelist; tp != NULL; tp = tp->next) {
+       g_printf("\nDEFINE TAPETYPE %s {\n", tp->name);
+       for(i=0; i < TAPETYPE_TAPETYPE; i++) {
+           for(np=tapetype_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error(_("tapetype bad value"));
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error(_("tapetype bad token"));
+
+            val_t_print_token(stdout, NULL, "      %-9s ", kt, &tp->value[i]);
+       }
+       g_printf("}\n");
+    }
+
+    for(dp = dumplist; dp != NULL; dp = dp->next) {
+       if (strncmp_const(dp->name, "custom(") != 0) { /* don't dump disklist-derived dumptypes */
+           if(dp->seen == -1)
+               prefix = "#";
+           else
+               prefix = "";
+           g_printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name);
+           for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
+               for(np=dumptype_var; np->token != CONF_UNKNOWN; np++)
+                   if(np->parm == i) break;
+               if(np->token == CONF_UNKNOWN)
+                   error(_("dumptype bad value"));
+
+               for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+                   if(kt->token == np->token) break;
+               if(kt->token == CONF_UNKNOWN)
+                   error(_("dumptype bad token"));
+
+               val_t_print_token(stdout, prefix, "      %-19s ", kt, &dp->value[i]);
+           }
+           g_printf("%s}\n", prefix);
+       }
+    }
+
+    for(ip = interface_list; ip != NULL; ip = ip->next) {
+       if(strcmp(ip->name,"default") == 0)
+           prefix = "#";
+       else
+           prefix = "";
+       g_printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name);
+       for(i=0; i < INTER_INTER; i++) {
+           for(np=interface_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error(_("interface bad value"));
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error(_("interface bad token"));
+
+           val_t_print_token(stdout, prefix, "      %-19s ", kt, &ip->value[i]);
+       }
+       g_printf("%s}\n",prefix);
+    }
+
+}
+
+static void
+val_t_print_token(
+    FILE     *output,
+    char     *prefix,
+    char     *format,
+    keytab_t *kt,
+    val_t    *val)
+{
+    char       **dispstrs, **dispstr;
+    dispstrs = val_t_display_strs(val, 1);
+
+    /* For most configuration types, this outputs
+     *   PREFIX KEYWORD DISPSTR
+     * for each of the display strings.  For identifiers, however, it
+     * simply prints the first line of the display string.
+     */
+
+    /* Print the keyword for anything that is not itself an identifier */
+    if (kt->token != CONF_IDENT) {
+        for(dispstr=dispstrs; *dispstr!=NULL; dispstr++) {
+           if (prefix)
+               g_fprintf(output, "%s", prefix);
+           g_fprintf(output, format, kt->keyword);
+           g_fprintf(output, "%s\n", *dispstr);
+       }
+    } else {
+       /* for identifiers, assume there's at most one display string */
+       assert(g_strv_length(dispstrs) <= 1);
+       if (*dispstrs) {
+           g_fprintf(output, "%s\n", *dispstrs);
+       }
+    }
+
+    g_strfreev(dispstrs);
+}
+
+char **
+val_t_display_strs(
     val_t *val,
-    int    str_need_quote,
-    char  *prefix)
+    int    str_need_quote)
 {
-    char *buf;
-    int   free_space;
+    char **buf;
+    buf = malloc(3*SIZEOF(char *));
+    buf[0] = NULL;
+    buf[1] = NULL;
+    buf[2] = NULL;
 
-    buffer_conf_print[0] = '\0';
-    snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), prefix);
-    free_space = SIZEOF(buffer_conf_print) - strlen(buffer_conf_print);
-    buf = buffer_conf_print + strlen(buffer_conf_print);
     switch(val->type) {
     case CONFTYPE_INT:
-       snprintf(buf, free_space, "%d", val->v.i);
-       break;
-
-    case CONFTYPE_LONG:
-       snprintf(buf, free_space, "%ld", val->v.l);
+       buf[0] = vstrallocf("%d", val_t__int(val));
        break;
 
     case CONFTYPE_SIZE:
-       snprintf(buf, free_space, SSIZE_T_FMT, (SSIZE_T_FMT_TYPE)val->v.size);
+       buf[0] = vstrallocf("%zd", (ssize_t)val_t__size(val));
        break;
 
     case CONFTYPE_AM64:
-       snprintf(buf, free_space, OFF_T_FMT, (OFF_T_FMT_TYPE)val->v.am64);
+       buf[0] = vstrallocf("%lld", (long long)val_t__am64(val));
        break;
 
     case CONFTYPE_REAL:
-       snprintf(buf, free_space, "%0.5f" , val->v.r);
+       buf[0] = vstrallocf("%0.5f", val_t__real(val));
        break;
 
     case CONFTYPE_RATE:
-       snprintf(buf, free_space, "%0.5f %0.5f",
-                val->v.rate[0], val->v.rate[1]);
+       buf[0] = vstrallocf("%0.5f %0.5f", val_t__rate(val)[0], val_t__rate(val)[1]);
        break;
 
     case CONFTYPE_INTRANGE:
-       snprintf(buf, free_space, "%d,%d",
-                val->v.intrange[0], val->v.intrange[1]);
+       buf[0] = vstrallocf("%d,%d", val_t__intrange(val)[0], val_t__intrange(val)[1]);
        break;
 
     case CONFTYPE_IDENT:
        if(val->v.s) {
-           strncpy(buf, val->v.s, free_space);
+           buf[0] = stralloc(val->v.s);
+        } else {
+           buf[0] = stralloc("");
        }
        break;
 
-    case CONFTYPE_STRING:
+    case CONFTYPE_STR:
        if(str_need_quote) {
-           *buf++ = '"';
-           free_space++;
             if(val->v.s) {
-               strncpy(buf, val->v.s, free_space);
-               buffer_conf_print[SIZEOF(buffer_conf_print) - 2] = '\0';
-               buffer_conf_print[strlen(buffer_conf_print)] = '"';
-               buffer_conf_print[strlen(buffer_conf_print) + 1] = '\0';
+               buf[0] = vstrallocf("\"%s\"", val->v.s);
             } else {
-               *buf++ = '"';
-               *buf++ = '\0';
-               free_space -= 2;
+               buf[0] = stralloc("\"\"");
             }
        } else {
            if(val->v.s) {
-               strncpy(buf, val->v.s, free_space);
-           }
+               buf[0] = stralloc(val->v.s);
+            } else {
+               buf[0] = stralloc("");
+            }
        }
        break;
 
     case CONFTYPE_TIME:
-       snprintf(buf, free_space, "%2d%02d",
-                (int)val->v.t/100, (int)val->v.t % 100);
+       buf[0] = vstrallocf("%2d%02d",
+                        (int)val_t__time(val)/100, (int)val_t__time(val) % 100);
        break;
 
-    case CONFTYPE_SL:
+    case CONFTYPE_EXINCLUDE: {
+        buf[0] = exinclude_display_str(val, 0);
+        buf[1] = exinclude_display_str(val, 1);
        break;
+    }
 
-    case CONFTYPE_EXINCLUDE:
-       buf = buffer_conf_print;
-       free_space = SIZEOF(buffer_conf_print);
-
-       conf_print_exinclude(val, 1, 0, prefix, &buf ,&free_space);
-       *buf++ = '\n';
-       free_space -= 1;
-
-       conf_print_exinclude(val, 1, 1, prefix, &buf, &free_space);
-       break;
-
-    case CONFTYPE_BOOL:
-       if(val->v.i)
-           strncpy(buf, "yes", free_space);
+    case CONFTYPE_BOOLEAN:
+       if(val_t__boolean(val))
+           buf[0] = stralloc("yes");
        else
-           strncpy(buf, "no", free_space);
+           buf[0] = stralloc("no");
        break;
 
     case CONFTYPE_STRATEGY:
-       switch(val->v.i) {
+       switch(val_t__strategy(val)) {
        case DS_SKIP:
-           strncpy(buf, "SKIP", free_space);
+           buf[0] = vstrallocf("SKIP");
            break;
 
        case DS_STANDARD:
-           strncpy(buf, "STANDARD", free_space);
+           buf[0] = vstrallocf("STANDARD");
            break;
 
        case DS_NOFULL:
-           strncpy(buf, "NOFULL", free_space);
+           buf[0] = vstrallocf("NOFULL");
            break;
 
        case DS_NOINC:
-           strncpy(buf, "NOINC", free_space);
+           buf[0] = vstrallocf("NOINC");
            break;
 
        case DS_HANOI:
-           strncpy(buf, "HANOI", free_space);
+           buf[0] = vstrallocf("HANOI");
            break;
 
        case DS_INCRONLY:
-           strncpy(buf, "INCRONLY", free_space);
+           buf[0] = vstrallocf("INCRONLY");
            break;
        }
        break;
 
     case CONFTYPE_COMPRESS:
-       switch(val->v.i) {
+       switch(val_t__compress(val)) {
        case COMP_NONE:
-           strncpy(buf, "NONE", free_space);
+           buf[0] = vstrallocf("NONE");
            break;
 
        case COMP_FAST:
-           strncpy(buf, "CLIENT FAST", free_space);
+           buf[0] = vstrallocf("CLIENT FAST");
            break;
 
        case COMP_BEST:
-           strncpy(buf, "CLIENT BEST", free_space);
+           buf[0] = vstrallocf("CLIENT BEST");
            break;
 
        case COMP_CUST:
-           strncpy(buf, "CLIENT CUSTOM", free_space);
+           buf[0] = vstrallocf("CLIENT CUSTOM");
            break;
 
        case COMP_SERVER_FAST:
-           strncpy(buf, "SERVER FAST", free_space);
+           buf[0] = vstrallocf("SERVER FAST");
            break;
 
        case COMP_SERVER_BEST:
-           strncpy(buf, "SERVER FAST", free_space);
+           buf[0] = vstrallocf("SERVER BEST");
            break;
 
        case COMP_SERVER_CUST:
-           strncpy(buf, "SERVER CUSTOM", free_space);
+           buf[0] = vstrallocf("SERVER CUSTOM");
            break;
        }
        break;
 
     case CONFTYPE_ESTIMATE:
-       switch(val->v.i) {
+       switch(val_t__estimate(val)) {
        case ES_CLIENT:
-           strncpy(buf, "CLIENT", free_space);
+           buf[0] = vstrallocf("CLIENT");
            break;
 
        case ES_SERVER:
-           strncpy(buf, "SERVER", free_space);
+           buf[0] = vstrallocf("SERVER");
            break;
 
        case ES_CALCSIZE:
-           strncpy(buf, "CALCSIZE", free_space);
+           buf[0] = vstrallocf("CALCSIZE");
            break;
        }
        break;
 
      case CONFTYPE_ENCRYPT:
-       switch(val->v.i) {
+       switch(val_t__encrypt(val)) {
        case ENCRYPT_NONE:
-           strncpy(buf, "NONE", free_space);
+           buf[0] = vstrallocf("NONE");
            break;
 
        case ENCRYPT_CUST:
-           strncpy(buf, "CLIENT", free_space);
+           buf[0] = vstrallocf("CLIENT");
            break;
 
        case ENCRYPT_SERV_CUST:
-           strncpy(buf, "SERVER", free_space);
+           buf[0] = vstrallocf("SERVER");
            break;
        }
        break;
 
      case CONFTYPE_HOLDING:
-       switch(val->v.i) {
+       switch(val_t__holding(val)) {
        case HOLD_NEVER:
-           strncpy(buf, "NEVER", free_space);
+           buf[0] = vstrallocf("NEVER");
            break;
 
        case HOLD_AUTO:
-           strncpy(buf, "AUTO", free_space);
+           buf[0] = vstrallocf("AUTO");
            break;
 
        case HOLD_REQUIRED:
-           strncpy(buf, "REQUIRED", free_space);
+           buf[0] = vstrallocf("REQUIRED");
            break;
        }
        break;
 
      case CONFTYPE_TAPERALGO:
-       strncpy(buf, taperalgo2str(val->v.i), free_space);
-       break;
-
-     case CONFTYPE_PRIORITY:
-       switch(val->v.i) {
-       case 0:
-           strncpy(buf, "LOW", free_space);
-           break;
-
-       case 1:
-           strncpy(buf, "MEDIUM", free_space);
-           break;
-
-       case 2:
-           strncpy(buf, "HIGH", free_space);
-           break;
-       }
+       buf[0] = vstrallocf("%s", taperalgo2str(val_t__taperalgo(val)));
        break;
-    }
-    buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
-    return buffer_conf_print;
-}
-
-void  conf_print_exinclude(
-    val_t *val,
-    int    str_need_quote,
-    int    file,
-    char  *prefix,
-    char **buf,
-    int   *free_space)
-{
-    sl_t  *sl;
-    sle_t *excl;
-
-    (void)str_need_quote;
-
-    snprintf(*buf, *free_space, prefix);
-    *free_space -= strlen(prefix);
-    *buf += strlen(prefix);
-
-    if (val->type != CONFTYPE_EXINCLUDE) {
-       strcpy(*buf,
-         "ERROR: conf_print_exinclude called for type != CONFTYPE_EXINCLUDE");
-       return;
-    }
-
-    if (file == 0) {
-       sl = val->v.exinclude.sl_list;
-       strncpy(*buf, "LIST ", *free_space);
-       *buf += 5;
-       *free_space -= 5;
-    } else {
-       sl = val->v.exinclude.sl_file;
-       strncpy(*buf, "FILE ", *free_space);
-       *buf += 5;
-       *free_space -= 5;
-    }
-
-    if (val->v.exinclude.optional == 1) {
-       strncpy(*buf, "OPTIONAL ", *free_space);
-       *buf += 9;
-       *free_space -= 9;
-    }
-
-    if (sl != NULL) {
-       for(excl = sl->first; excl != NULL; excl = excl->next) {
-           if (3 + (int)strlen(excl->name) < *free_space) {
-               *(*buf)++ = ' ';
-               *(*buf)++ = '"';
-               strcpy(*buf, excl->name);
-               *buf += strlen(excl->name);
-               *(*buf)++ = '"';
-               *free_space -= 3 + strlen(excl->name);
-           }
-       }
-    }
-
-    return;
-}
-
-static void
-conf_init_string(
-    val_t *val,
-    char  *s)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_STRING;
-    if(s)
-       val->v.s = stralloc(s);
-    else
-       val->v.s = NULL;
-}
-
-static void
-conf_init_ident(
-    val_t *val,
-    char  *s)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_IDENT;
-    if(s)
-       val->v.s = stralloc(s);
-    else
-       val->v.s = NULL;
-}
-
-static void
-conf_init_int(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_INT;
-    val->v.i = i;
-}
-
-static void
-conf_init_bool(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_BOOL;
-    val->v.i = i;
-}
-
-static void
-conf_init_strategy(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_STRATEGY;
-    val->v.i = i;
-}
-
-static void
-conf_init_estimate(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_ESTIMATE;
-    val->v.i = i;
-}
-
-static void
-conf_init_taperalgo(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_TAPERALGO;
-    val->v.i = i;
-}
-
-static void
-conf_init_priority(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_PRIORITY;
-    val->v.i = i;
-}
-
-static void
-conf_init_compress(
-    val_t *val,
-    comp_t    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-
-static void
-conf_init_encrypt(
-    val_t *val,
-    encrypt_t    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_ENCRYPT;
-    val->v.i = (int)i;
-}
-
-static void
-conf_init_holding(
-    val_t              *val,
-    dump_holdingdisk_t  i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_HOLDING;
-    val->v.i = (int)i;
-}
-
-/*
-static void
-conf_init_long(
-    val_t *val,
-    long   l)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_LONG;
-    val->v.l = l;
-}
-*/
-
-static void
-conf_init_size(
-    val_t *val,
-    ssize_t   sz)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_SIZE;
-    val->v.size = sz;
-}
-
-static void
-conf_init_am64(
-    val_t *val,
-    off_t   l)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_AM64;
-    val->v.am64 = l;
-}
-
-static void
-conf_init_real(
-    val_t  *val,
-    double r)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_REAL;
-    val->v.r = r;
-}
-
-static void
-conf_init_rate(
-    val_t  *val,
-    double r1,
-    double r2)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_RATE;
-    val->v.rate[0] = r1;
-    val->v.rate[1] = r2;
-}
-
-static void
-conf_init_intrange(
-    val_t *val,
-    int    i1,
-    int    i2)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_INTRANGE;
-    val->v.intrange[0] = i1;
-    val->v.intrange[1] = i2;
-}
-
-static void
-conf_init_time(
-    val_t *val,
-    time_t   t)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_TIME;
-    val->v.t = t;
-}
-
-/*
-static void
-conf_init_sl(
-    val_t *val,
-    sl_t  *sl)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_AM64;
-    val->v.sl = sl;
-}
-*/
-
-static void
-conf_init_exinclude(
-    val_t *val)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_EXINCLUDE;
-    val->v.exinclude.optional = 0;
-    val->v.exinclude.sl_list = NULL;
-    val->v.exinclude.sl_file = NULL;
-}
-
-static void
-conf_set_string(
-    val_t *val,
-    char *s)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_STRING;
-    amfree(val->v.s);
-    val->v.s = stralloc(s);
-}
-
-/*
-static void
-conf_set_int(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_INT;
-    val->v.i = i;
-}
-*/
-
-static void
-conf_set_bool(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_BOOL;
-    val->v.i = i;
-}
-
-static void
-conf_set_compress(
-    val_t *val,
-    comp_t    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-
-/*
-static void
-conf_set_encrypt(
-    val_t *val,
-    encrypt_t    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-*/
-
-static void
-conf_set_holding(
-    val_t              *val,
-    dump_holdingdisk_t  i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_HOLDING;
-    val->v.i = (int)i;
-}
-
-static void
-conf_set_strategy(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_STRATEGY;
-    val->v.i = i;
-}
-
 
-int
-get_conftype_int(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_INT) {
-       error("get_conftype_int: val.type is not CONFTYPE_INT");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
+     case CONFTYPE_PRIORITY:
+       switch(val_t__priority(val)) {
+       case 0:
+           buf[0] = vstrallocf("LOW");
+           break;
 
-long
-get_conftype_long(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_LONG) {
-       error("get_conftype_long: val.type is not CONFTYPE_LONG");
-       /*NOTREACHED*/
-    }
-    return val->v.l;
-}
+       case 1:
+           buf[0] = vstrallocf("MEDIUM");
+           break;
 
-off_t
-get_conftype_am64(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_AM64) {
-       error("get_conftype_am64: val.type is not CONFTYPE_AM64");
-       /*NOTREACHED*/
-    }
-    return val->v.am64;
-}
+       case 2:
+           buf[0] = vstrallocf("HIGH");
+           break;
+       }
+       break;
 
-double
-get_conftype_real(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_REAL) {
-       error("get_conftype_real: val.type is not CONFTYPE_REAL");
-       /*NOTREACHED*/
-    }
-    return val->v.r;
-}
+    case CONFTYPE_PROPLIST: {
+       int    nb_property;
+       char **mybuf;
 
-char *
-get_conftype_string(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_STRING) {
-       error("get_conftype_string: val.type is not CONFTYPE_STRING");
-       /*NOTREACHED*/
+       nb_property = g_hash_table_size(val_t__proplist(val));
+       amfree(buf);
+       buf = malloc((nb_property+1)*SIZEOF(char*));
+       buf[nb_property] = NULL;
+       mybuf = buf;
+       g_hash_table_foreach(val_t__proplist(val), proplist_display_str_foreach_fn, &mybuf);
+        break;
     }
-    return val->v.s;
-}
-
-char *
-get_conftype_ident(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_IDENT) {
-       error("get_conftype_ident: val.type is not CONFTYPE_IDENT");
-       /*NOTREACHED*/
     }
-    return val->v.s;
+    return buf;
 }
 
-time_t
-get_conftype_time(
-    val_t *val)
+static void
+proplist_display_str_foreach_fn(
+    gpointer key_p,
+    gpointer value_p,
+    gpointer user_data_p)
 {
-    if (val->type != CONFTYPE_TIME) {
-       error("get_conftype_time: val.type is not CONFTYPE_TIME");
-       /*NOTREACHED*/
-    }
-    return val->v.t;
-}
+    char *property_s = key_p;
+    char *value_s    = value_p;
+    char ***msg             = (char ***)user_data_p;
 
-ssize_t
-get_conftype_size(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_SIZE) {
-       error("get_conftype_size: val.type is not CONFTYPE_SIZE");
-       /*NOTREACHED*/
-    }
-    return val->v.size;
+    **msg = vstralloc("\"", property_s, "\" \"", value_s, "\"", NULL);
+    (*msg)++;
 }
 
-sl_t *
-get_conftype_sl(
-    val_t *val)
+static char *
+exinclude_display_str(
+    val_t *val,
+    int    file)
 {
-    if (val->type != CONFTYPE_SL) {
-       error("get_conftype_size: val.type is not CONFTYPE_SL");
-       /*NOTREACHED*/
-    }
-    return val->v.sl;
-}
+    sl_t  *sl;
+    sle_t *excl;
+    char *rval;
 
-int
-get_conftype_bool(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_BOOL) {
-       error("get_conftype_bool: val.type is not CONFTYPE_BOOL");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
+    assert(val->type == CONFTYPE_EXINCLUDE);
 
-int
-get_conftype_hold(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_HOLDING) {
-       error("get_conftype_hold: val.type is not CONFTYPE_HOLDING");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
+    rval = stralloc("");
 
-int
-get_conftype_compress(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_COMPRESS) {
-       error("get_conftype_compress: val.type is not CONFTYPE_COMPRESS");
-       /*NOTREACHED*/
+    if (file == 0) {
+       sl = val_t__exinclude(val).sl_list;
+        strappend(rval, "LIST");
+    } else {
+       sl = val_t__exinclude(val).sl_file;
+        strappend(rval, "FILE");
     }
-    return val->v.i;
-}
 
-int
-get_conftype_encrypt(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_ENCRYPT) {
-       error("get_conftype_encrypt: val.type is not CONFTYPE_ENCRYPT");
-       /*NOTREACHED*/
+    if (val_t__exinclude(val).optional == 1) {
+        strappend(rval, " OPTIONAL");
     }
-    return val->v.i;
-}
 
-int
-get_conftype_estimate(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_ESTIMATE) {
-       error("get_conftype_extimate: val.type is not CONFTYPE_ESTIMATE");
-       /*NOTREACHED*/
+    if (sl != NULL) {
+       for(excl = sl->first; excl != NULL; excl = excl->next) {
+            vstrextend(&rval, " \"", excl->name, "\"", NULL);
+       }
     }
-    return val->v.i;
-}
 
-int
-get_conftype_strategy(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_STRATEGY) {
-       error("get_conftype_strategy: val.type is not CONFTYPE_STRATEGY");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
+    return rval;
 }
 
-int
-get_conftype_taperalgo(
-    val_t *val)
+char *
+taperalgo2str(
+    taperalgo_t taperalgo)
 {
-    if (val->type != CONFTYPE_TAPERALGO) {
-       error("get_conftype_taperalgo: val.type is not CONFTYPE_TAPERALGO");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
+    if(taperalgo == ALGO_FIRST) return "FIRST";
+    if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT";
+    if(taperalgo == ALGO_LARGEST) return "LARGEST";
+    if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT";
+    if(taperalgo == ALGO_SMALLEST) return "SMALLEST";
+    if(taperalgo == ALGO_LAST) return "LAST";
+    return "UNKNOWN";
 }
 
-int
-get_conftype_priority(
-    val_t *val)
+char *
+config_dir_relative(
+    char *filename)
 {
-    if (val->type != CONFTYPE_PRIORITY) {
-       error("get_conftype_priority: val.type is not CONFTYPE_PRIORITY");
-       /*NOTREACHED*/
+    if (*filename == '/' || config_dir == NULL) {
+       return stralloc(filename);
+    } else {
+       if (config_dir[strlen(config_dir)-1] == '/') {
+           return vstralloc(config_dir, filename, NULL);
+       } else {
+           return vstralloc(config_dir, "/", filename, NULL);
+       }
     }
-    return val->v.i;
 }
 
-exinclude_t
-get_conftype_exinclude(
-    val_t *val)
+static int
+parm_key_info(
+    char *key,
+    conf_var_t **parm,
+    val_t **val)
 {
-    if (val->type != CONFTYPE_EXINCLUDE) {
-       error("get_conftype_exinclude: val.type is not CONFTYPE_EXINCLUDE");
-       /*NOTREACHED*/
-    }
-    return val->v.exinclude;
-}
+    conf_var_t *np;
+    keytab_t *kt;
+    char *s;
+    char ch;
+    char *subsec_type;
+    char *subsec_name;
+    char *subsec_key;
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+    int success = FALSE;
 
+    /* WARNING: assumes globals keytable and parsetable are set correctly. */
+    assert(keytable != NULL);
+    assert(parsetable != NULL);
 
-static void
-read_block(
-    command_option_t *command_options,
-    t_conf_var    *read_var,
-    keytab_t *keytab,
-    val_t    *valarray,
-    char     *prefix,
-    char     *errormsg,
-    int       read_brace,
-    void      (*copy_function)(void))
-{
-    t_conf_var *np;
-    int    saved_conf_line_num;
-    int    done;
+    /* make a copy we can stomp on */
+    key = stralloc(key);
 
-    if(read_brace) {
-       get_conftoken(CONF_LBRACE);
-       get_conftoken(CONF_NL);
+    /* uppercase the key */
+    s = key;
+    for (s = key; (ch = *s) != 0; s++) {
+       if(islower((int)ch))
+           *s = (char)toupper(ch);
     }
 
-    done = 0;
-    do {
-       conf_line_num += 1;
-       get_conftoken(CONF_ANY);
-       switch(tok) {
-       case CONF_RBRACE:
-           done = 1;
-           break;
-       case CONF_NL:   /* empty line */
-           break;
-       case CONF_END:  /* end of file */
-           done = 1;
-           break;
-        case CONF_IDENT:
-        case CONF_STRING:
-           if(copy_function) 
-               copy_function();
-           else
-               conf_parserror("ident not expected");
-           break;
-       default:
-           {
-               for(np = read_var; np->token != CONF_UNKNOWN; np++)
-                   if(np->token == tok) break;
+    subsec_name = strchr(key, ':');
+    if (subsec_name) {
+       subsec_type = key;
 
-               if(np->token == CONF_UNKNOWN)
-                   conf_parserror(errormsg);
-               else {
-                   np->read_function(np, &valarray[np->parm]);
-                   if(np->validate)
-                       np->validate(np, &valarray[np->parm]);
-               }
-           }
-       }
-       if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE)
-           get_conftoken(CONF_NL);
-    } while(!done);
+       *subsec_name = '\0';
+       subsec_name++;
 
-    /* overwrite with command line option */
-    saved_conf_line_num = conf_line_num;
-    command_overwrite(command_options, read_var, keytab, valarray, prefix);
-    conf_line_num = saved_conf_line_num;
-}
+       subsec_key = strchr(subsec_name,':');
+       if(!subsec_key) goto out; /* failure */
 
-void
-command_overwrite(
-    command_option_t *command_options,
-    t_conf_var    *overwrite_var,
-    keytab_t *keytab,
-    val_t    *valarray,
-    char     *prefix)
-{
-    t_conf_var      *np;
-    keytab_t        *kt;
-    char            *myprefix;
-    command_option_t *command_option;
-    int                      duplicate;
+       *subsec_key = '\0';
+       subsec_key++;
+
+       /* If the keyword doesn't exist, there's no need to look up the
+        * subsection -- we know it's invalid */
+       for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) {
+           if(kt->keyword && strcmp(kt->keyword, subsec_key) == 0)
+               break;
+       }
+       if(kt->token == CONF_UNKNOWN) goto out;
 
-    if(!command_options) return;
+       /* Otherwise, figure out which kind of subsection we're dealing with,
+        * and parse against that. */
+       if (strcmp(subsec_type, "TAPETYPE") == 0) {
+           tp = lookup_tapetype(subsec_name);
+           if (!tp) goto out;
+           for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) goto out;
+
+           if (val) *val = &tp->value[np->parm];
+           if (parm) *parm = np;
+           success = TRUE;
+       } else if (strcmp(subsec_type, "DUMPTYPE") == 0) {
+           dp = lookup_dumptype(subsec_name);
+           if (!dp) goto out;
+           for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) goto out;
+
+           if (val) *val = &dp->value[np->parm];
+           if (parm) *parm = np;
+           success = TRUE;
+       } else if (strcmp(subsec_type, "HOLDINGDISK") == 0) {
+           hp = lookup_holdingdisk(subsec_name);
+           if (!hp) goto out;
+           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) goto out;
+
+           if (val) *val = &hp->value[np->parm];
+           if (parm) *parm = np;
+           success = TRUE;
+       } else if (strcmp(subsec_type, "INTERFACE") == 0) {
+           ip = lookup_interface(subsec_name);
+           if (!ip) goto out;
+           for(np = interface_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) goto out;
 
-    for(np = overwrite_var; np->token != CONF_UNKNOWN; np++) {
-       for(kt = keytab; kt->token != CONF_UNKNOWN; kt++)
-           if(kt->token == np->token) break;
+           if (val) *val = &ip->value[np->parm];
+           if (parm) *parm = np;
+           success = TRUE;
+       } 
 
-       if(kt->token == CONF_UNKNOWN) {
-           error("command_overwrite: invalid token");
-           /* NOTREACHED */
+    /* No delimiters -- we're referencing a global config parameter */
+    } else {
+       /* look up the keyword */
+       for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) {
+           if(kt->keyword && strcmp(kt->keyword, key) == 0)
+               break;
        }
+       if(kt->token == CONF_UNKNOWN) goto out;
 
-       for(command_option = command_options; command_option->name != NULL;
-                                                           command_option++) {
-           myprefix = stralloc2(prefix, kt->keyword);
-           if(strcasecmp(myprefix, command_option->name) == 0) {
-               duplicate = 0;
-               if (command_option->used == 0 &&
-                   valarray[np->parm].seen == -2) {
-                   duplicate = 1;
-               }
-               command_option->used = 1;
-               valarray[np->parm].seen = -2;
-               if(np->type == CONFTYPE_STRING &&
-                  command_option->value[0] != '"') {
-                   conf_line = vstralloc("\"", command_option->value, "\"",
-                                         NULL);
-               }
-               else {
-                   conf_line = stralloc(command_option->value);
-               }
-               conf_char = conf_line;
-               token_pushed = 0;
-               conf_line_num = -2;
-               np->read_function(np, &valarray[np->parm]);
-               amfree(conf_line);
-               conf_line = conf_char = NULL;
-
-               if (np->validate)
-                   np->validate(np, &valarray[np->parm]);
-               if (duplicate == 1) {
-                   fprintf(stderr,"Duplicate %s option, using %s\n",
-                           command_option->name, command_option->value);
-               }
-           }
-           amfree(myprefix);
+       /* and then look that up in the parse table */
+       for(np = parsetable; np->token != CONF_UNKNOWN; np++) {
+           if(np->token == kt->token)
+               break;
        }
+       if(np->token == CONF_UNKNOWN) goto out;
+
+       if (val) *val = &conf_data[np->parm];
+       if (parm) *parm = np;
+       success = TRUE;
     }
+
+out:
+    amfree(key);
+    return success;
 }
 
-void
-free_new_argv(
-    int new_argc,
-    char **new_argv)
+gint64 
+find_multiplier(
+    char * casestr)
 {
-    int i;
-    for(i=0; i<new_argc; i++)
-       amfree(new_argv[i]);
-    amfree(new_argv);
+    keytab_t * table_entry;
+    char * str = g_utf8_strup(casestr, -1);
+    g_strstrip(str);
+
+    if (*str == '\0') {
+        g_free(str);
+        return 1;
+    }
+    
+    for (table_entry = numb_keytable; table_entry->keyword != NULL;
+         table_entry ++) {
+        if (strcmp(casestr, table_entry->keyword) == 0) {
+            g_free(str);
+            switch (table_entry->token) {
+            case CONF_MULT1K:
+                return 1024;
+            case CONF_MULT1M:
+                return 1024*1024;
+            case CONF_MULT1G:
+                return 1024*1024*1024;
+            case CONF_MULT7:
+                return 7;
+            case CONF_AMINFINITY:
+                return G_MAXINT64;
+            case CONF_MULT1:
+            case CONF_IDENT:
+                return 1;
+            default:
+                /* Should not happen. */
+                return 0;
+            }
+        }
+    }
+
+    /* None found; this is an error. */
+    g_free(str);
+    return 0;
 }
 
-ssize_t
-getconf_readblocksize(void)
-{
-    tapetype_t *tape;
-    char       *conf_tapetype;
+/*
+ * Error Handling Implementaiton
+ */
+
+static void print_parse_problem(const char * format, va_list argp) {
+    const char *xlated_fmt = gettext(format);
 
-    if (conffile_init == 1) {
-       conf_tapetype = getconf_str(CNF_TAPETYPE);
+    if(current_line)
+       g_fprintf(stderr, _("argument \"%s\": "), current_line);
+    else if (current_filename && current_line_num > 0)
+       g_fprintf(stderr, "\"%s\", line %d: ", current_filename, current_line_num);
+    else
+       g_fprintf(stderr, _("parse error: "));
+    
+    g_vfprintf(stderr, xlated_fmt, argp);
+    fputc('\n', stderr);
+}
 
-       if (!conf_tapetype || strlen(conf_tapetype) == 0)
-           return MAX_TAPE_BLOCK_KB;
+printf_arglist_function(void conf_parserror, const char *, format)
+{
+    va_list argp;
+    
+    arglist_start(argp, format);
+    print_parse_problem(format, argp);
+    arglist_end(argp);
 
-       tape = lookup_tapetype(conf_tapetype);
-       if (!tape)
-           return MAX_TAPE_BLOCK_KB;
-       return tapetype_get_readblocksize(tape);
-    }
+    got_parserror = TRUE;
+}
 
-    return MAX_TAPE_BLOCK_KB;
+printf_arglist_function(void conf_parswarn, const char *, format) {
+    va_list argp;
+    
+    arglist_start(argp, format);
+    print_parse_problem(format, argp);
+    arglist_end(argp);
 }
index 787f51495caf98aa88276a91a7cea45a4a04f79a..8873cec75292b3d659bae70148c72d098d6319c0 100644 (file)
@@ -21,8 +21,8 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
  * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
+ *                         Computer Science Department
+ *                         University of Maryland at College Park
  */
 /*
  * $Id: conffile.h,v 1.72 2006/07/26 15:17:37 martinea Exp $
 #define CONFFILE_H
 
 #include "amanda.h"
-#include "conffile.h"
 #include "util.h"
 
-#define CONFFILE_NAME "amanda.conf"
+/* Getting Configuration Values
+ * ============================
+ *
+ * Amanda configurations consist of a number of "global" parameters, as well as named
+ * subsections of four types: dumptypes, interfaces, holdingdisks, and tapetypes.  The
+ * global parameters are fetched with the getconf_CONFTYPE functions, keyed by a
+ * confparam_t constant (with prefix CNF_).  The subsection parameters are fetched with
+ * SUBSEC_get_PARAM() macros, e.g., tapetype_get_blocksize(ttyp), where the argument
+ * comes from lookup_SUBSEC(), in this case lookup_tapetype(name).
+ *
+ * Types
+ * =====
+ *
+ * This module juggles two kinds of types: C types and conftypes.  Conftypes include
+ * everything from integers through property lists, and are specific to the needs of
+ * the configuration system.  Each conftype has a corresponding C type, which is of course
+ * necessary to actually use the data.
+ *
+ * The val_t__CONFTYPE macros represent the canonical correspondance of conftypes to C
+ * types, but in general the relationship is obvious: ints, strings, reals, and so forth
+ * are represented directly.  Enumerated conftypes are represented by the corresponding
+ * C enum type.  The 'rate' conftype is represented as a 2-element array of doubles, and
+ * the 'intrange' conftype is represented as a 2-element array of ints.  exincludes are
+ * a exinclude_t *, and a proplist is represented as a GHashTable *.
+ *
+ * Memory
+ * ======
+ * Note that, unless specified, all memory in this module is managed by the module
+ * itself; return strings should not be freed by the caller.
+ */
+
+/*
+ * Generic values
+ *
+ * This module uses a generic val_t type to hold values of various types -- it's basically
+ * a union with type information and a 'seen' flag.  In a way, it's a very simple equivalent
+ * to Glib's GValue.  It's worth considering rewriting this with GValue, but for the moment,
+ * this works and it's here.
+ */
+
+/* holdingdisk types */
+typedef enum {
+    HOLD_NEVER,                 /* Always direct to tape  */
+    HOLD_AUTO,                  /* If possible            */
+    HOLD_REQUIRED               /* Always to holding disk */
+} dump_holdingdisk_t;
+
+/* Compression types */
+typedef enum {
+    COMP_NONE,          /* No compression */
+    COMP_FAST,          /* Fast compression on client */
+    COMP_BEST,          /* Best compression on client */
+    COMP_CUST,          /* Custom compression on client */
+    COMP_SERVER_FAST,   /* Fast compression on server */
+    COMP_SERVER_BEST,   /* Best compression on server */
+    COMP_SERVER_CUST    /* Custom compression on server */
+} comp_t;
+
+/* Encryption types */
+typedef enum {
+    ENCRYPT_NONE,               /* No encryption */
+    ENCRYPT_CUST,               /* Custom encryption on client */
+    ENCRYPT_SERV_CUST           /* Custom encryption on server */
+} encrypt_t;
+
+/* Estimate strategies */
+typedef enum {
+    ES_CLIENT,          /* client estimate */
+    ES_SERVER,          /* server estimate */
+    ES_CALCSIZE,        /* calcsize estimate */
+    ES_ES /* sentinel */
+} estimate_t;
+
+/* Dump strategies */
+typedef enum {
+    DS_SKIP,        /* Don't do any dumps at all */
+    DS_STANDARD,    /* Standard (0 1 1 1 1 2 2 2 ...) */
+    DS_NOFULL,      /* No full's (1 1 1 ...) */
+    DS_NOINC,       /* No inc's (0 0 0 ...) */
+    DS_4,           /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
+    DS_5,           /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
+    DS_HANOI,       /* Tower of Hanoi (? ? ? ? ? ...) */
+    DS_INCRONLY,    /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
+    DS_DS /* sentinel */
+} strategy_t;
+
+typedef enum {
+    ALGO_FIRST,
+    ALGO_FIRSTFIT,
+    ALGO_LARGEST,
+    ALGO_LARGESTFIT,
+    ALGO_SMALLEST,
+    ALGO_LAST,
+    ALGO_ALGO /* sentinel */
+} taperalgo_t;
+
+typedef struct exinclude_s {
+    sl_t *sl_list;
+    sl_t *sl_file;
+    int  optional;
+} exinclude_t;
 
+typedef GHashTable* proplist_t;
+
+/* Names for the type of value in a val_t.  Mostly for internal use, but useful
+ * for wrapping val_t's, too. */
+typedef enum {
+    CONFTYPE_INT,
+    CONFTYPE_AM64,
+    CONFTYPE_REAL,
+    CONFTYPE_STR,
+    CONFTYPE_IDENT,
+    CONFTYPE_TIME,
+    CONFTYPE_SIZE,
+    CONFTYPE_BOOLEAN,
+    CONFTYPE_COMPRESS,
+    CONFTYPE_ENCRYPT,
+    CONFTYPE_HOLDING,
+    CONFTYPE_ESTIMATE,
+    CONFTYPE_STRATEGY,
+    CONFTYPE_TAPERALGO,
+    CONFTYPE_PRIORITY,
+    CONFTYPE_RATE,
+    CONFTYPE_INTRANGE,
+    CONFTYPE_EXINCLUDE,
+    CONFTYPE_PROPLIST
+} conftype_t;
+
+/* This should be considered an opaque type for any other modules.  The complete
+ * struct is included here to allow quick access via macros. Access it *only* through
+ * those macros. */
+typedef struct val_s {
+    union {
+        int            i;
+        off_t          am64;
+        double         r;
+        char           *s;
+        ssize_t                size;
+        time_t         t;
+        float          rate[2];
+        exinclude_t    exinclude;
+        int            intrange[2];
+        proplist_t      proplist;
+    } v;
+    int seen;
+    conftype_t type;
+} val_t;
+
+/* Functions to typecheck and extract a particular type of
+ * value from a val_t.  All call error() if the type is incorrect,
+ * as this is a programming error.  */
+int                 val_t_to_int      (val_t *);
+off_t               val_t_to_am64     (val_t *);
+float               val_t_to_real     (val_t *);
+char               *val_t_to_str      (val_t *); /* (also converts CONFTYPE_IDENT) */
+char               *val_t_to_ident    (val_t *); /* (also converts CONFTYPE_STR) */
+time_t              val_t_to_time     (val_t *);
+ssize_t             val_t_to_size     (val_t *);
+int                 val_t_to_boolean  (val_t *);
+comp_t              val_t_to_compress (val_t *);
+encrypt_t           val_t_to_encrypt  (val_t *);
+dump_holdingdisk_t  val_t_to_holding  (val_t *);
+estimate_t          val_t_to_estimate (val_t *);
+strategy_t          val_t_to_strategy (val_t *);
+taperalgo_t         val_t_to_taperalgo(val_t *);
+int                 val_t_to_priority (val_t *);
+float              *val_t_to_rate     (val_t *); /* array of two floats */
+exinclude_t         val_t_to_exinclude(val_t *);
+int                *val_t_to_intrange (val_t *); /* array of two ints */
+proplist_t          val_t_to_proplist (val_t *);
+
+/* Has the given val_t been seen in a configuration file or config overwrite?
+ *
+ * @param val: val_t* to examine
+ * @returns: boolean
+ */
+#define val_t_seen(val) ((val)->seen)
+
+/* What is the underlying type of this val_t?
+ *
+ * @param val: val_t* to examine
+ * @returns: conftype_t
+ */
+#define val_t_type(val) ((val)->type)
+
+/* Macros to convert val_t's to a particular type without the benefit of
+ * a typecheck.  Use these only if you really know what you're doing!
+ *
+ * Implementation note: these macros encode the relationship of conftypes
+ * (in the macro name) to the corresponding union field.  The macros work
+ * as lvalues, too.
+ */
+#define val_t__seen(val)        ((val)->seen)
+#define val_t__int(val)         ((val)->v.i)
+#define val_t__am64(val)        ((val)->v.am64)
+#define val_t__real(val)        ((val)->v.r)
+#define val_t__str(val)         ((val)->v.s)
+#define val_t__ident(val)       ((val)->v.s)
+#define val_t__time(val)        ((val)->v.t)
+#define val_t__size(val)        ((val)->v.size)
+#define val_t__boolean(val)     ((val)->v.i)
+#define val_t__compress(val)    ((val)->v.i)
+#define val_t__encrypt(val)     ((val)->v.i)
+#define val_t__holding(val)     ((val)->v.i)
+#define val_t__estimate(val)    ((val)->v.i)
+#define val_t__strategy(val)    ((val)->v.i)
+#define val_t__taperalgo(val)   ((val)->v.i)
+#define val_t__priority(val)    ((val)->v.i)
+#define val_t__rate(val)        ((val)->v.rate)
+#define val_t__exinclude(val)   ((val)->v.exinclude)
+#define val_t__intrange(val)    ((val)->v.intrange)
+#define val_t__proplist(val)    ((val)->v.proplist)
+/*
+ * Parameters
+ *
+ * Programs get val_t's by giving the index of the parameters they're interested in.
+ * For global parameters, these start with CNF; for subsections, they start with the
+ * name of the subsection.
+ */
+
+/*
+ * Global parameter access
+ */
 typedef enum {
     CNF_ORG,
     CNF_CONF,
@@ -52,8 +272,9 @@ typedef enum {
     CNF_MAILTO,
     CNF_DUMPUSER,
     CNF_TAPEDEV,
-    CNF_CHNGRDEV,
-    CNF_CHNGRFILE,
+    CNF_DEVICE_PROPERTY,
+    CNF_CHANGERDEV,
+    CNF_CHANGERFILE,
     CNF_LABELSTR,
     CNF_TAPELIST,
     CNF_DISKFILE,
@@ -78,7 +299,7 @@ typedef enum {
     CNF_DTIMEOUT,
     CNF_CTIMEOUT,
     CNF_TAPEBUFS,
-    CNF_RAWTAPEDEV,
+    CNF_DEVICE_OUTPUT_BUFFER_SIZE,
     CNF_PRINTER,
     CNF_AUTOFLUSH,
     CNF_RESERVE,
@@ -88,6 +309,9 @@ typedef enum {
     CNF_AMRECOVER_CHECK_LABEL,
     CNF_AMRECOVER_CHANGER,
     CNF_TAPERALGO,
+    CNF_FLUSH_THRESHOLD_DUMPED,
+    CNF_FLUSH_THRESHOLD_SCHEDULED,
+    CNF_TAPERFLUSH,
     CNF_DISPLAYUNIT,
     CNF_KRB5KEYTAB,
     CNF_KRB5PRINCIPAL,
@@ -115,211 +339,106 @@ typedef enum {
     CNF_RESERVED_UDP_PORT,
     CNF_RESERVED_TCP_PORT,
     CNF_UNRESERVED_TCP_PORT,
-    CNF_CNF
-} confparm_t;
+    CNF_CNF /* sentinel */
+} confparm_key;
 
-typedef enum {
-    CONF_UNKNOWN,              CONF_ANY,               CONF_COMMA,
-    CONF_LBRACE,               CONF_RBRACE,            CONF_NL,
-    CONF_END,                  CONF_IDENT,             CONF_INT,
-    CONF_LONG,                 CONF_AM64,              CONF_BOOL,
-    CONF_REAL,                 CONF_STRING,            CONF_TIME,
-    CONF_SIZE,
-
-    /* config parameters */
-    CONF_INCLUDEFILE,          CONF_ORG,               CONF_MAILTO,
-    CONF_DUMPUSER,             CONF_TAPECYCLE,         CONF_TAPEDEV,
-    CONF_CHNGRDEV,             CONF_CHNGRFILE,         CONF_LABELSTR,
-    CONF_BUMPPERCENT,          CONF_BUMPSIZE,          CONF_BUMPDAYS,
-    CONF_BUMPMULT,             CONF_ETIMEOUT,          CONF_DTIMEOUT,
-    CONF_CTIMEOUT,             CONF_TAPEBUFS,          CONF_TAPELIST,
-    CONF_DISKFILE,             CONF_INFOFILE,          CONF_LOGDIR,
-    CONF_LOGFILE,              CONF_DISKDIR,           CONF_DISKSIZE,
-    CONF_INDEXDIR,             CONF_NETUSAGE,          CONF_INPARALLEL,
-    CONF_DUMPORDER,            CONF_TIMEOUT,           CONF_TPCHANGER,
-    CONF_RUNTAPES,             CONF_DEFINE,            CONF_DUMPTYPE,
-    CONF_TAPETYPE,             CONF_INTERFACE,         CONF_PRINTER,
-    CONF_AUTOFLUSH,            CONF_RESERVE,           CONF_MAXDUMPSIZE,
-    CONF_COLUMNSPEC,           CONF_AMRECOVER_DO_FSF,  CONF_AMRECOVER_CHECK_LABEL,
-    CONF_AMRECOVER_CHANGER,    CONF_LABEL_NEW_TAPES,   CONF_USETIMESTAMPS,
-
-    CONF_TAPERALGO,            CONF_FIRST,             CONF_FIRSTFIT,
-    CONF_LARGEST,              CONF_LARGESTFIT,        CONF_SMALLEST,
-    CONF_LAST,                 CONF_DISPLAYUNIT,       CONF_RESERVED_UDP_PORT,
-    CONF_RESERVED_TCP_PORT,    CONF_UNRESERVED_TCP_PORT,
-
-    /* kerberos 5 */
-    CONF_KRB5KEYTAB,           CONF_KRB5PRINCIPAL,
-
-    /* holding disk */
-    CONF_COMMENT,              CONF_DIRECTORY,         CONF_USE,
-    CONF_CHUNKSIZE,
-
-    /* dump type */
-    /*COMMENT,*/               CONF_PROGRAM,           CONF_DUMPCYCLE,
-    CONF_RUNSPERCYCLE,         CONF_MAXCYCLE,          CONF_MAXDUMPS,
-    CONF_OPTIONS,              CONF_PRIORITY,          CONF_FREQUENCY,
-    CONF_INDEX,                        CONF_MAXPROMOTEDAY,     CONF_STARTTIME,
-    CONF_COMPRESS,             CONF_ENCRYPT,           CONF_AUTH,
-    CONF_STRATEGY,             CONF_ESTIMATE,          CONF_SKIP_INCR,
-    CONF_SKIP_FULL,            CONF_RECORD,            CONF_HOLDING,
-    CONF_EXCLUDE,              CONF_INCLUDE,           CONF_KENCRYPT,
-    CONF_IGNORE,               CONF_COMPRATE,          CONF_TAPE_SPLITSIZE,
-    CONF_SPLIT_DISKBUFFER,     CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG,
-    CONF_CLNTCOMPPROG,         CONF_SRV_ENCRYPT,       CONF_CLNT_ENCRYPT,
-    CONF_SRV_DECRYPT_OPT,      CONF_CLNT_DECRYPT_OPT,  CONF_AMANDAD_PATH,
-    CONF_CLIENT_USERNAME,
-
-    /* tape type */
-    /*COMMENT,*/               CONF_BLOCKSIZE,         CONF_FILE_PAD,
-    CONF_LBL_TEMPL,            CONF_FILEMARK,          CONF_LENGTH,
-    CONF_SPEED,                        CONF_READBLOCKSIZE,
-
-    /* client conf */
-    CONF_CONF,                 CONF_INDEX_SERVER,      CONF_TAPE_SERVER,
-    CONF_SSH_KEYS,             CONF_GNUTAR_LIST_DIR,   CONF_AMANDATES,
-
-    /* protocol config */
-    CONF_REP_TRIES,            CONF_CONNECT_TRIES,     CONF_REQ_TRIES,
-
-    /* debug config */
-    CONF_DEBUG_AMANDAD,                CONF_DEBUG_AMIDXTAPED,  CONF_DEBUG_AMINDEXD,
-    CONF_DEBUG_AMRECOVER,      CONF_DEBUG_AUTH,        CONF_DEBUG_EVENT,
-    CONF_DEBUG_HOLDING,                CONF_DEBUG_PROTOCOL,    CONF_DEBUG_PLANNER,
-    CONF_DEBUG_DRIVER,         CONF_DEBUG_DUMPER,      CONF_DEBUG_CHUNKER,
-    CONF_DEBUG_TAPER,          CONF_DEBUG_SELFCHECK,   CONF_DEBUG_SENDSIZE,
-    CONF_DEBUG_SENDBACKUP,
-
-    /* network interface */
-    /* COMMENT, */             /* USE, */
-
-    /* dump options (obsolete) */
-    CONF_EXCLUDE_FILE,         CONF_EXCLUDE_LIST,
-
-    /* compress, estimate, encryption */
-    CONF_NONE,                 CONF_FAST,              CONF_BEST,
-    CONF_SERVER,               CONF_CLIENT,            CONF_CALCSIZE,
-    CONF_CUSTOM,
-
-    /* holdingdisk */
-    CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
-
-    /* priority */
-    CONF_LOW,                  CONF_MEDIUM,            CONF_HIGH,
-
-    /* dump strategy */
-    CONF_SKIP,                 CONF_STANDARD,          CONF_NOFULL,
-    CONF_NOINC,                        CONF_HANOI,             CONF_INCRONLY,
-
-    /* exclude list */
-    CONF_LIST,                 CONF_EFILE,             CONF_APPEND,
-    CONF_OPTIONAL,
-
-    /* numbers */
-    CONF_AMINFINITY,           CONF_MULT1,             CONF_MULT7,
-    CONF_MULT1K,               CONF_MULT1M,            CONF_MULT1G,
-
-    /* boolean */
-    CONF_ATRUE,                        CONF_AFALSE,
-
-    CONF_RAWTAPEDEV
-} tok_t;
-
-/* internal types and variables */
-
-/* */
-typedef enum {
-    CONFTYPE_INT,
-    CONFTYPE_LONG,
-    CONFTYPE_AM64,
-    CONFTYPE_REAL,
-    CONFTYPE_STRING,
-    CONFTYPE_IDENT,
-    CONFTYPE_TIME,             /* hhmm */
-    CONFTYPE_SIZE,
-    CONFTYPE_SL,
-    CONFTYPE_BOOL,
-    CONFTYPE_COMPRESS,
-    CONFTYPE_ENCRYPT,
-    CONFTYPE_HOLDING,
-    CONFTYPE_ESTIMATE,
-    CONFTYPE_STRATEGY,
-    CONFTYPE_TAPERALGO,
-    CONFTYPE_PRIORITY,
-    CONFTYPE_RATE,
-    CONFTYPE_INTRANGE,
-    CONFTYPE_EXINCLUDE
-} conftype_t;
+/* Given a confparm_key, return a pointer to the corresponding val_t.
+ *
+ * @param key: confparm_key
+ * @returns: pointer to value
+ */
+val_t *getconf(confparm_key key);
 
-/* Compression types */
-typedef enum {
-    COMP_NONE,          /* No compression */
-    COMP_FAST,          /* Fast compression on client */
-    COMP_BEST,          /* Best compression on client */
-    COMP_CUST,          /* Custom compression on client */
-    COMP_SERVER_FAST,   /* Fast compression on server */
-    COMP_SERVER_BEST,   /* Best compression on server */
-    COMP_SERVER_CUST    /* Custom compression on server */
-} comp_t;
+/* (convenience macro) has this global parameter been seen?
+ *
+ * @param key: confparm_key
+ * @returns: boolean
+ */
+#define getconf_seen(key)       (val_t_seen(getconf((key))))
 
-/* Encryption types */
-typedef enum {
-    ENCRYPT_NONE,               /* No encryption */
-    ENCRYPT_CUST,               /* Custom encryption on client */
-    ENCRYPT_SERV_CUST           /* Custom encryption on server */
-} encrypt_t;
+/* (convenience macros)
+ * Fetch a gloabl parameter of a specific type.  Note that these
+ * convenience macros have a different form from those for the
+ * subsections: here you specify a type and a key, while for the
+ * subsections you specify only a key.  The difference is historical.
+ *
+ * @param key: confparm_key
+ * @returns: various
+ */
+#define getconf_int(key)          (val_t_to_int(getconf((key))))
+#define getconf_am64(key)         (val_t_to_am64(getconf((key))))
+#define getconf_real(key)         (val_t_to_real(getconf((key))))
+#define getconf_str(key)         (val_t_to_str(getconf((key))))
+#define getconf_ident(key)        (val_t_to_ident(getconf((key))))
+#define getconf_time(key)         (val_t_to_time(getconf((key))))
+#define getconf_size(key)         (val_t_to_size(getconf((key))))
+#define getconf_boolean(key)      (val_t_to_boolean(getconf((key))))
+#define getconf_compress(key)     (val_t_to_compress(getconf((key))))
+#define getconf_encrypt(key)      (val_t_to_encrypt(getconf((key))))
+#define getconf_holding(key)      (val_t_to_holding(getconf((key))))
+#define getconf_estimate(key)     (val_t_to_estimate(getconf((key))))
+#define getconf_strategy(key)     (val_t_to_strategy(getconf((key))))
+#define getconf_taperalgo(key)    (val_t_to_taperalgo(getconf((key))))
+#define getconf_priority(key)     (val_t_to_priority(getconf((key))))
+#define getconf_rate(key)         (val_t_to_rate(getconf((key))))
+#define getconf_exinclude(key)    (val_t_to_exinclude(getconf((key))))
+#define getconf_intrange(key)     (val_t_to_intrange(getconf((key))))
+#define getconf_proplist(key)     (val_t_to_proplist(getconf((key))))
+
+/* Get a list of names for subsections of the given type
+ *
+ * @param listname: the desired type of subsection
+ * @returns: list of subsection names; caller is responsible for freeing
+ * this list, but not the strings it points to, using g_slist_free().
+ */
+GSList *getconf_list(char *listname);
 
-/* holdingdisk types */
-typedef enum {
-    HOLD_NEVER,                        /* Always direct to tape  */
-    HOLD_AUTO,                 /* If possible            */
-    HOLD_REQUIRED              /* Always to holding disk */
-} dump_holdingdisk_t;
+/* Get a configuration value by name, supporting the TYPE:SUBSEC:KEYWORD.
+ * Returns NULL if the configuration value doesnt exist.
+ */
+val_t *getconf_byname(char *key);
 
-typedef struct {        /* token table entry */
-    char *keyword;
-    tok_t token;
-} keytab_t;
+/*
+ * Derived values
+ *
+ * Values which aren't directly specified by the configuration, but which
+ * are derived from it.
+ */
 
-typedef struct {
-    char *name;
-    char *value;
-    int   used;
-} command_option_t;
+/* Return a divisor which will convert a value in units of kilo-whatevers
+ * to the user's selected display unit.
+ *
+ * @returns: long integer divisor
+ */
+long int getconf_unit_divisor(void);
 
-typedef struct exinclude_s {
-    sl_t *sl_list;
-    sl_t *sl_file;
-    int  optional;
-} exinclude_t;
+/* If any of these globals are true, the corresponding component will
+ * send verbose debugging output to the debug file.  The options are
+ * set during config_init, but can be modified at will after that if 
+ * desired.  */
 
-typedef struct val_s {
-    union {
-       int             i;
-       long            l;
-       off_t           am64;
-       double          r;
-       char            *s;
-       sl_t            *sl;
-       ssize_t         size;
-       time_t          t;
-       float           rate[2];
-       exinclude_t     exinclude;
-       int             intrange[2];
-    } v;
-    int seen;
-    conftype_t type;
-} val_t;
+extern int debug_amandad;
+extern int debug_amidxtaped;
+extern int debug_amindexd;
+extern int debug_amrecover;
+extern int debug_auth;
+extern int debug_event;
+extern int debug_holding;
+extern int debug_protocol;
+extern int debug_planner;
+extern int debug_driver;
+extern int debug_dumper;
+extern int debug_chunker;
+extern int debug_taper;
+extern int debug_selfcheck;
+extern int debug_sendsize;
+extern int debug_sendbackup;
 
-typedef struct s_conf_var {
-    tok_t      token;
-    conftype_t type;
-    void       (*read_function) (struct s_conf_var *, val_t*);
-    int                parm;
-    void       (*validate) (struct s_conf_var *, val_t *);
-} t_conf_var;
+/*
+ * Tapetype parameter access
+ */
 
-typedef enum tapetype_e  {
+typedef enum {
     TAPETYPE_COMMENT,
     TAPETYPE_LBL_TEMPL,
     TAPETYPE_BLOCKSIZE,
@@ -328,52 +447,63 @@ typedef enum tapetype_e  {
     TAPETYPE_FILEMARK,
     TAPETYPE_SPEED,
     TAPETYPE_FILE_PAD,
-    TAPETYPE_TAPETYPE
-} tapetype_ee;
+    TAPETYPE_TAPETYPE /* sentinel */
+} tapetype_key;
 
-typedef struct tapetype_s {
-    struct tapetype_s *next;
-    int seen;
-    char *name;
-
-    val_t value[TAPETYPE_TAPETYPE];
-} tapetype_t;
-
-#define tapetype_get(tapetype, field) (tapetype->field)
-#define tapetype_get_name(tapetype) tapetype->name
-#define tapetype_get_seen(tapetype) tapetype->seen
-#define tapetype_get_comment(tapetype)       get_conftype_string(&tapetype->value[TAPETYPE_COMMENT])
-#define tapetype_get_lbl_templ(tapetype)     get_conftype_string(&tapetype->value[TAPETYPE_LBL_TEMPL])
-#define tapetype_get_blocksize(tapetype)     get_conftype_size  (&tapetype->value[TAPETYPE_BLOCKSIZE])
-#define tapetype_get_readblocksize(tapetype) get_conftype_size  (&tapetype->value[TAPETYPE_READBLOCKSIZE])
-#define tapetype_get_length(tapetype)        get_conftype_am64  (&tapetype->value[TAPETYPE_LENGTH])
-#define tapetype_get_filemark(tapetype)      get_conftype_am64  (&tapetype->value[TAPETYPE_FILEMARK])
-#define tapetype_get_speed(tapetype)         get_conftype_int   (&tapetype->value[TAPETYPE_SPEED])
-#define tapetype_get_file_pad(tapetype)      get_conftype_bool  (&tapetype->value[TAPETYPE_FILE_PAD])
+/* opaque object */
+typedef struct tapetype_s tapetype_t;
 
-/* Dump strategies */
-#define DS_SKIP                0       /* Don't do any dumps at all */
-#define DS_STANDARD    1       /* Standard (0 1 1 1 1 2 2 2 ...) */
-#define DS_NOFULL      2       /* No full's (1 1 1 ...) */
-#define DS_NOINC       3       /* No inc's (0 0 0 ...) */
-#define DS_4           4       /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
-#define DS_5           5       /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
-#define DS_HANOI       6       /* Tower of Hanoi (? ? ? ? ? ...) */
-#define DS_INCRONLY    7       /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
+/* Given the name of the tapetype, return a tapetype object.  Returns NULL
+ * if no matching tapetype exists.  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired tapetype
+ * @returns: object or NULL
+ */
+tapetype_t *lookup_tapetype(char *identifier);
 
-/* Estimate strategies */
-#define ES_CLIENT      0       /* client estimate */
-#define ES_SERVER      1       /* server estimate */
-#define ES_CALCSIZE    2       /* calcsize estimate */
-
-#define ALGO_FIRST     0
-#define ALGO_FIRSTFIT  1
-#define ALGO_LARGEST   2
-#define ALGO_LARGESTFIT        3
-#define ALGO_SMALLEST  4
-#define ALGO_LAST      5
-
-typedef enum dumptype_e  {
+/* Given a tapetype and a key, return a pointer to the corresponding val_t.
+ *
+ * @param ttyp: the tapetype to examine
+ * @param key: tapetype_key (one of the TAPETYPE_* constants)
+ * @returns: pointer to value
+ */
+val_t *tapetype_getconf(tapetype_t *ttyp, tapetype_key key);
+
+/* Get the name of this tapetype.
+ *
+ * @param ttyp: the tapetype to examine
+ * @returns: name of the tapetype
+ */
+char *tapetype_name(tapetype_t *ttyp);
+
+/* (convenience macro) has this parameter been seen in this tapetype?  This
+ * applies to the specific parameter *within* the tapetype.
+ *
+ * @param key: tapetype_key
+ * @returns: boolean
+ */
+#define tapetype_seen(ttyp, key)       (val_t_seen(tapetype_getconf((ttyp), (key))))
+
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param ttyp: the tapetype to examine
+ * @returns: various
+ */
+#define tapetype_get_comment(ttyp)         (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_COMMENT)))
+#define tapetype_get_lbl_templ(ttyp)       (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL)))
+#define tapetype_get_blocksize(ttyp)       (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE)))
+#define tapetype_get_readblocksize(ttyp)   (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE)))
+#define tapetype_get_length(ttyp)          (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_LENGTH)))
+#define tapetype_get_filemark(ttyp)        (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK)))
+#define tapetype_get_speed(ttyp)           (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED)))
+#define tapetype_get_file_pad(ttyp)        (val_t_to_boolean(tapetype_getconf((ttyp), TAPETYPE_FILE_PAD)))
+
+/*
+ * Dumptype parameter access
+ */
+
+typedef enum {
     DUMPTYPE_COMMENT,
     DUMPTYPE_PROGRAM,
     DUMPTYPE_SRVCOMPPROG,
@@ -412,226 +542,445 @@ typedef enum dumptype_e  {
     DUMPTYPE_KENCRYPT,
     DUMPTYPE_IGNORE,
     DUMPTYPE_INDEX,
-    DUMPTYPE_DUMPTYPE
-} dumptype_ee;
+    DUMPTYPE_DUMPTYPE /* sentinel */
+} dumptype_key;
 
-typedef struct dumptype_s {
-    struct dumptype_s *next;
-    int seen;
-    char *name;
-
-    val_t value[DUMPTYPE_DUMPTYPE];
-} dumptype_t;
-
-#define dumptype_get_name(dumptype) dumptype->name
-#define dumptype_get_seen(dumptype) dumptype->seen
-#define dumptype_get_comment(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_COMMENT])
-#define dumptype_get_program(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_PROGRAM])
-#define dumptype_get_srvcompprog(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRVCOMPPROG])
-#define dumptype_get_clntcompprog(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNTCOMPPROG])
-#define dumptype_get_srv_encrypt(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_ENCRYPT])
-#define dumptype_get_clnt_encrypt(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_ENCRYPT])
-#define dumptype_get_amandad_path(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_AMANDAD_PATH])
-#define dumptype_get_client_username(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_CLIENT_USERNAME])
-#define dumptype_get_ssh_keys(dumptype)           get_conftype_string   (&dumptype->value[DUMPTYPE_SSH_KEYS])
-#define dumptype_get_security_driver(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SECURITY_DRIVER])
-#define dumptype_get_exclude(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_EXCLUDE])
-#define dumptype_get_include(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_INCLUDE])
-#define dumptype_get_priority(dumptype)           get_conftype_priority (&dumptype->value[DUMPTYPE_PRIORITY])
-#define dumptype_get_dumpcycle(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_DUMPCYCLE])
-#define dumptype_get_maxcycle(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXCYCLE])
-#define dumptype_get_frequency(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_FREQUENCY])
-#define dumptype_get_maxdumps(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXDUMPS])
-#define dumptype_get_maxpromoteday(dumptype)      get_conftype_int      (&dumptype->value[DUMPTYPE_MAXPROMOTEDAY])
-#define dumptype_get_bumppercent(dumptype)        get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPPERCENT])
-#define dumptype_get_bumpsize(dumptype)           get_conftype_am64     (&dumptype->value[DUMPTYPE_BUMPSIZE])
-#define dumptype_get_bumpdays(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPDAYS])
-#define dumptype_get_bumpmult(dumptype)           get_conftype_real     (&dumptype->value[DUMPTYPE_BUMPMULT])
-#define dumptype_get_starttime(dumptype)          get_conftype_time     (&dumptype->value[DUMPTYPE_STARTTIME])
-#define dumptype_get_strategy(dumptype)           get_conftype_strategy (&dumptype->value[DUMPTYPE_STRATEGY])
-#define dumptype_get_estimate(dumptype)           get_conftype_estimate (&dumptype->value[DUMPTYPE_ESTIMATE])
-#define dumptype_get_compress(dumptype)           get_conftype_compress (&dumptype->value[DUMPTYPE_COMPRESS])
-#define dumptype_get_encrypt(dumptype)            get_conftype_encrypt  (&dumptype->value[DUMPTYPE_ENCRYPT])
-#define dumptype_get_srv_decrypt_opt(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_DECRYPT_OPT])
-#define dumptype_get_clnt_decrypt_opt(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_DECRYPT_OPT])
-#define dumptype_get_comprate(dumptype)                                   dumptype->value[DUMPTYPE_COMPRATE].v.rate
-#define dumptype_get_tape_splitsize(dumptype)     get_conftype_am64     (&dumptype->value[DUMPTYPE_TAPE_SPLITSIZE])
-#define dumptype_get_fallback_splitsize(dumptype) get_conftype_am64     (&dumptype->value[DUMPTYPE_FALLBACK_SPLITSIZE])
-#define dumptype_get_split_diskbuffer(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_SPLIT_DISKBUFFER])
-#define dumptype_get_record(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_RECORD])
-#define dumptype_get_skip_incr(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_INCR])
-#define dumptype_get_skip_full(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_FULL])
-#define dumptype_get_to_holdingdisk(dumptype)     get_conftype_hold     (&dumptype->value[DUMPTYPE_HOLDINGDISK])
-#define dumptype_get_kencrypt(dumptype)           get_conftype_bool     (&dumptype->value[DUMPTYPE_KENCRYPT])
-#define dumptype_get_ignore(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_IGNORE])
-#define dumptype_get_index(dumptype)              get_conftype_bool     (&dumptype->value[DUMPTYPE_INDEX])
-
-/* A network interface */
-typedef enum interface_e  {
+/* opaque object */
+typedef struct dumptype_s dumptype_t;
+
+/* Given the name of the dumptype, return a dumptype object.  Returns NULL
+ * if no matching dumptype exists.  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired dumptype
+ * @returns: object or NULL
+ */
+dumptype_t *lookup_dumptype(char *identifier);
+
+/* Given a dumptype and a key, return a pointer to the corresponding val_t.
+ *
+ * @param dtyp: the dumptype to examine
+ * @param key: dumptype_key (one of the TAPETYPE_* constants)
+ * @returns: pointer to value
+ */
+val_t *dumptype_getconf(dumptype_t *dtyp, dumptype_key key);
+
+/* Get the name of this dumptype.
+ *
+ * @param dtyp: the dumptype to examine
+ * @returns: name of the dumptype
+ */
+char *dumptype_name(dumptype_t *dtyp);
+
+/* (convenience macro) has this parameter been seen in this dumptype?  This
+ * applies to the specific parameter *within* the dumptype.
+ *
+ * @param key: dumptype_key
+ * @returns: boolean
+ */
+#define dumptype_seen(dtyp, key)       (val_t_seen(dumptype_getconf((dtyp), (key))))
+
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param dtyp: the dumptype to examine
+ * @returns: various
+ */
+#define dumptype_get_comment(dtyp)             (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_COMMENT)))
+#define dumptype_get_program(dtyp)             (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_PROGRAM)))
+#define dumptype_get_srvcompprog(dtyp)         (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRVCOMPPROG)))
+#define dumptype_get_clntcompprog(dtyp)        (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNTCOMPPROG)))
+#define dumptype_get_srv_encrypt(dtyp)         (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_ENCRYPT)))
+#define dumptype_get_clnt_encrypt(dtyp)        (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_ENCRYPT)))
+#define dumptype_get_amandad_path(dtyp)        (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_AMANDAD_PATH)))
+#define dumptype_get_client_username(dtyp)     (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_USERNAME)))
+#define dumptype_get_ssh_keys(dtyp)            (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSH_KEYS)))
+#define dumptype_get_security_driver(dtyp)     (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SECURITY_DRIVER)))
+#define dumptype_get_exclude(dtyp)             (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_EXCLUDE)))
+#define dumptype_get_include(dtyp)             (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_INCLUDE)))
+#define dumptype_get_priority(dtyp)            (val_t_to_priority(dumptype_getconf((dtyp), DUMPTYPE_PRIORITY)))
+#define dumptype_get_dumpcycle(dtyp)           (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_DUMPCYCLE)))
+#define dumptype_get_maxcycle(dtyp)            (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXCYCLE)))
+#define dumptype_get_frequency(dtyp)           (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_FREQUENCY)))
+#define dumptype_get_maxdumps(dtyp)            (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXDUMPS)))
+#define dumptype_get_maxpromoteday(dtyp)       (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXPROMOTEDAY)))
+#define dumptype_get_bumppercent(dtyp)         (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPPERCENT)))
+#define dumptype_get_bumpsize(dtyp)            (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_BUMPSIZE)))
+#define dumptype_get_bumpdays(dtyp)            (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPDAYS)))
+#define dumptype_get_bumpmult(dtyp)            (val_t_to_real(dumptype_getconf((dtyp), DUMPTYPE_BUMPMULT)))
+#define dumptype_get_starttime(dtyp)           (val_t_to_time(dumptype_getconf((dtyp), DUMPTYPE_STARTTIME)))
+#define dumptype_get_strategy(dtyp)            (val_t_to_strategy(dumptype_getconf((dtyp), DUMPTYPE_STRATEGY)))
+#define dumptype_get_estimate(dtyp)            (val_t_to_estimate(dumptype_getconf((dtyp), DUMPTYPE_ESTIMATE)))
+#define dumptype_get_compress(dtyp)            (val_t_to_compress(dumptype_getconf((dtyp), DUMPTYPE_COMPRESS)))
+#define dumptype_get_encrypt(dtyp)             (val_t_to_encrypt(dumptype_getconf((dtyp), DUMPTYPE_ENCRYPT)))
+#define dumptype_get_srv_decrypt_opt(dtyp)     (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_DECRYPT_OPT)))
+#define dumptype_get_clnt_decrypt_opt(dtyp)    (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_DECRYPT_OPT)))
+#define dumptype_get_comprate(dtyp)            (val_t_to_rate(dumptype_getconf((dtyp), DUMPTYPE_COMPRATE)))
+#define dumptype_get_tape_splitsize(dtyp)      (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_TAPE_SPLITSIZE)))
+#define dumptype_get_fallback_splitsize(dtyp)  (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_FALLBACK_SPLITSIZE)))
+#define dumptype_get_split_diskbuffer(dtyp)    (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SPLIT_DISKBUFFER)))
+#define dumptype_get_record(dtyp)              (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_RECORD)))
+#define dumptype_get_skip_incr(dtyp)           (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_INCR)))
+#define dumptype_get_skip_full(dtyp)           (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_FULL)))
+#define dumptype_get_to_holdingdisk(dtyp)      (val_t_to_holding(dumptype_getconf((dtyp), DUMPTYPE_HOLDINGDISK)))
+#define dumptype_get_kencrypt(dtyp)            (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_KENCRYPT)))
+#define dumptype_get_ignore(dtyp)              (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_IGNORE)))
+#define dumptype_get_index(dtyp)               (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_INDEX)))
+
+/*
+ * Interface parameter access
+ */
+
+typedef enum {
     INTER_COMMENT,
     INTER_MAXUSAGE,
-    INTER_INTER
-} interface_ee;
+    INTER_INTER /* sentinel */
+} interface_key;
 
+/* opaque object */
+typedef struct interface_s interface_t;
 
-typedef struct interface_s {
-    struct interface_s *next;
-    int seen;
-    char *name;
+/* Given the name of the interface, return a interface object.  Returns NULL
+ * if no matching interface exists.  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired interface
+ * @returns: object or NULL
+ */
+interface_t *lookup_interface(char *identifier);
 
-    val_t value[INTER_INTER];
+/* Given a interface and a key, return a pointer to the corresponding val_t.
+ *
+ * @param iface: the interface to examine
+ * @param key: interface_key (one of the TAPETYPE_* constants)
+ * @returns: pointer to value
+ */
+val_t *interface_getconf(interface_t *iface, interface_key key);
 
-    unsigned long curusage;            /* current usage */
-} interface_t;
+/* Get the name of this interface.
+ *
+ * @param iface: the interface to examine
+ * @returns: name of the interface
+ */
+char *interface_name(interface_t *iface);
 
-#define interface_get_name(interface) interface->name
-#define interface_get_seen(interface) interface->seen
-#define interface_get_comment(interface)  get_conftype_string(&interface->value[INTER_COMMENT])
-#define interface_get_maxusage(interface) get_conftype_int   (&interface->value[INTER_MAXUSAGE])
+/* (convenience macro) has this parameter been seen in this interface?  This
+ * applies to the specific parameter *within* the interface.
+ *
+ * @param key: interface_key
+ * @returns: boolean
+ */
+#define interface_seen(iface, key)       (val_t_seen(interface_getconf((iface), (key))))
 
-/* A holding disk */
-typedef enum holdingdisk_e  {
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param iface: the interface to examine
+ * @returns: various
+ */
+#define interface_get_comment(iface)    (val_t_to_str(interface_getconf((iface), INTER_COMMENT)))
+#define interface_get_maxusage(iface)   (val_t_to_int(interface_getconf((iface), INTER_MAXUSAGE)))
+
+/*
+ * Holdingdisk parameter access
+ */
+
+typedef enum {
     HOLDING_COMMENT,
     HOLDING_DISKDIR,
     HOLDING_DISKSIZE,
     HOLDING_CHUNKSIZE,
-    HOLDING_HOLDING
-} holdingdisk_ee;
+    HOLDING_HOLDING /* sentinel */
+} holdingdisk_key;
 
-typedef struct holdingdisk_s {
-    struct holdingdisk_s *next;
-    int seen;
-    char *name;
-
-    val_t value[HOLDING_HOLDING];
-
-    void *up;                  /* generic user pointer */
-    off_t disksize;
-} holdingdisk_t;
-
-#define holdingdisk_get_name(holdingdisk) (holdingdisk)->name
-#define holdingdisk_get_seen(holdingdisk) (holdingdisk)->seen
-#define holdingdisk_get_comment(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_COMMENT])
-#define holdingdisk_get_diskdir(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_DISKDIR])
-#define holdingdisk_get_disksize(holdingdisk)  get_conftype_am64  (&(holdingdisk)->value[HOLDING_DISKSIZE])
-#define holdingdisk_get_chunksize(holdingdisk) get_conftype_am64  (&(holdingdisk)->value[HOLDING_CHUNKSIZE])
-
-/* for each column we define some values on how to
- * format this column element
- */
-typedef struct {
-    char *Name;                /* column name */
-    int PrefixSpace;   /* the blank space to print before this
-                        * column. It is used to get the space
-                        * between the colums
-                        */
-    int Width;         /* the width of the column itself */
-    int Precision;     /* the precision if its a float */
-    int MaxWidth;      /* if set, Width will be recalculated
-                        * to the space needed */
-    char *Format;      /* the printf format string for this
-                        * column element
-                        */
-    char *Title;       /* the title to use for this column */
-} ColumnInfo;
-
-
-/* predeclare local functions */
-
-int          get_conftype_int      (val_t *);
-long         get_conftype_long     (val_t *);
-off_t        get_conftype_am64     (val_t *);
-double       get_conftype_real     (val_t *);
-char        *get_conftype_string   (val_t *);
-char        *get_conftype_ident    (val_t *);
-time_t       get_conftype_time     (val_t *);
-ssize_t      get_conftype_size     (val_t *);
-sl_t        *get_conftype_sl       (val_t *);
-int          get_conftype_bool     (val_t *);
-int          get_conftype_hold     (val_t *);
-int          get_conftype_compress (val_t *);
-int          get_conftype_encrypt  (val_t *);
-int          get_conftype_estimate (val_t *);
-int          get_conftype_strategy (val_t *);
-int          get_conftype_taperalgo(val_t *);
-int          get_conftype_priority (val_t *);
-float       *get_conftype_rate     (val_t *);
-exinclude_t  get_conftype_exinclude(val_t *);
-int         *get_conftype_intrange (val_t *);
-
-void command_overwrite(command_option_t *command_options, t_conf_var *overwrite_var,
-                      keytab_t *keytab, val_t *valarray, char *prefix);
-
-void free_new_argv(int new_argc, char **new_argv);
-/* this corresponds to the normal output of amanda, but may
- * be adapted to any spacing as you like.
- */
-extern ColumnInfo ColumnData[];
+/* opaque object */
+typedef struct holdingdisk_s holdingdisk_t;
 
-extern char *config_name;
-extern char *config_dir;
+/* Given the name of the holdingdisk, return a holdingdisk object.  Returns NULL
+ * if no matching holdingdisk exists.  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired holdingdisk
+ * @returns: object or NULL
+ */
+holdingdisk_t *lookup_holdingdisk(char *identifier);
 
-extern int debug_amandad;
-extern int debug_amidxtaped;
-extern int debug_amindexd;
-extern int debug_amrecover;
-extern int debug_auth;
-extern int debug_event;
-extern int debug_holding;
-extern int debug_protocol;
-extern int debug_planner;
-extern int debug_driver;
-extern int debug_dumper;
-extern int debug_chunker;
-extern int debug_taper;
-extern int debug_selfcheck;
-extern int debug_sendsize;
-extern int debug_sendbackup;
+/* Return the whole linked list of holdingdisks.  Use holdingdisk_next
+ * to traverse the list.
+ *
+ * @returns: first holding disk
+ */
+holdingdisk_t *getconf_holdingdisks(void);
+
+/* Return the next holdingdisk in the list.
+ *
+ * @param hdisk: holding disk
+ * @returns: NULL if hdisk is the last disk, otherwise the next holding
+ * disk
+ */
+holdingdisk_t *holdingdisk_next(holdingdisk_t *hdisk);
+
+/* Given a holdingdisk and a key, return a pointer to the corresponding val_t.
+ *
+ * @param hdisk: the holdingdisk to examine
+ * @param key: holdingdisk_key (one of the TAPETYPE_* constants)
+ * @returns: pointer to value
+ */
+val_t *holdingdisk_getconf(holdingdisk_t *hdisk, holdingdisk_key key);
+
+/* Get the name of this holdingdisk.
+ *
+ * @param hdisk: the holdingdisk to examine
+ * @returns: name of the holdingdisk
+ */
+char *holdingdisk_name(holdingdisk_t *hdisk);
+
+/* (convenience macro) has this parameter been seen in this holdingdisk?  This
+ * applies to the specific parameter *within* the holdingdisk.
+ *
+ * @param key: holdingdisk_key
+ * @returns: boolean
+ */
+#define holdingdisk_seen(hdisk, key)       (val_t_seen(holdingdisk_getconf((hdisk), (key))))
+
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param hdisk: the holdingdisk to examine
+ * @returns: various
+ */
+#define holdingdisk_get_comment(hdisk)   (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_COMMENT)))
+#define holdingdisk_get_diskdir(hdisk)   (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_DISKDIR)))
+#define holdingdisk_get_disksize(hdisk)  (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_DISKSIZE)))
+#define holdingdisk_get_chunksize(hdisk) (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_CHUNKSIZE)))
 
-extern holdingdisk_t *holdingdisks;
-extern int num_holdingdisks;
+/*
+ * Command-line handling
+ */
 
-void parse_conf(int parse_argc, char **parse_argv, int *new_argc,
-                      char ***new_argv);
-char **get_config_options(int);
-void report_bad_conf_arg(void);
-void free_server_config(void);
+/* opaque type */
+typedef struct config_overwrites_s config_overwrites_t;
 
-int read_conffile(char *filename);
+/* Create a new, empty config_overwrites object.
+ *
+ * @param size_estimate: a guess at the number of overwrites; argc/2 is a 
+ *  good estimate.
+ * @returns: new object
+ */
+config_overwrites_t *new_config_overwrites(int size_estimate);
 
-#define CLIENTCONFFILE_NAME "client.conf"
+/* Free a config_overwrites object.  This usually won't be needed, as
+ * apply_config_overwrites takes ownership of the overwrites for you.
+ *
+ * @param co: config_overwrites object
+ */
+void free_config_overwrites(config_overwrites_t *co);
 
-int  add_client_conf(confparm_t parm, char *value);
-int read_clientconf(char *filename);
+/* Add an overwrite to a config_overwrites object.
+ *
+ * @param co: the config_overwrites object
+ * @param key: the configuration parameter's key, possibly with the format
+ * SUBTYPE:NAME:KEYWORD
+ * @param value: the value for the parameter, as would be seen in amanda.conf
+ */
+void add_config_overwrite(config_overwrites_t *co,
+                        char *key,
+                        char *value);
+
+/* Add an overwrite option from the command line to a config_overwrites
+ * object.  Calls error() with any errors
+ *
+ * @param co: the config_overwrites object
+ * @param optarg: the value of the command-line option
+ */
+void add_config_overwrite_opt(config_overwrites_t *co,
+                             char *optarg);
+
+/* Given a command line, represented as argc/argv, extract any -o options
+ * as config overwrites.  This function modifies argc and argv in place.
+ *
+ * This is the deprecated way to extract config overwrites, for applications
+ * which do not use getopt.  The preferred method is to use getopt and
+ * call add_config_overwrite_opt for any -o options.
+ *
+ * @param argc: (in/out) command-line length
+ * @param argv: (in/out) command-line strings
+ * @returns: newly allocated config_overwrites object
+ */
+config_overwrites_t *
+extract_commandline_config_overwrites(int *argc,
+                                     char ***argv);
+
+/* Apply configuration overwrites to the current configuration and take
+ * ownership of the config_overwrites object.
+ *
+ * If any parameters are not matched in the current symbol table, or
+ * correspond to named subsections which do not exist, this function calls
+ * error() and does not return.
+ *
+ * @param co: the config_overwrites object
+ */
+void apply_config_overwrites(config_overwrites_t *co);
+
+/*
+ * Initialization
+ */
+
+/* Constants for config_init */
+typedef enum {
+    /* Use arg_config_name, if not NULL */
+    CONFIG_INIT_EXPLICIT_NAME = 1 << 0,
+
+    /* Use the current working directory if an explicit name is not available */
+    CONFIG_INIT_USE_CWD = 1 << 1,
+
+    /* This is a client application (server is default) */
+    CONFIG_INIT_CLIENT = 1 << 2,
+
+    /* New configuration should "overlay" existing configuration; this
+     * is used by clients to load multiple amanda-client.conf files. */
+    CONFIG_INIT_OVERLAY = 1 << 3,
+
+    /* If the file doesn't exist, halt with an error. */
+    CONFIG_INIT_FATAL = 1 << 4,
+} config_init_flags;
+
+/* Initialize this application's configuration, with the specific actions
+ * based on 'flags':
+ *  - if CONFIG_INIT_OVERLAY is not set, configuration values are reset
+ *    to their defaults
+ *  - if CONFIG_INIT_EXPLICIT_NAME and arg_config_name is not NULL,
+ *    use CONFIG_DIR/arg_config_name as config_dir arg_config_name as 
+ *    config_name.
+ *  - otherwise, if CONFIG_USE_CWD is set, use the directory in which 
+ *    the application was started as config_dir, and its filename as 
+ *    config_name.
+ *  - otherwise, for the client only, se config_dir to CONFIG_DIR and
+ *    config_name to NULL.
+ *  - depending on CONFIG_INIT_CLIENT, read amanda.conf or amanda-client.conf
+ *  - in the event of an error, call error() if CONFIG_INIT_FATAL, otherwise
+ *    record a message in the debug log and return false.
+ *
+ * @param flags: flags indicating desired behavior, as above
+ * @param arg_config_name: config name to use (from e.g., argv[1])
+ * @returns: true on success, false on failure, unless CONFIG_INIT_FATAL
+ */
+gboolean config_init(config_init_flags flags,
+                    char *arg_config_name);
+
+/* Free all memory allocated for the configuration.  This effectively
+ * reverses the effects of config_init().
+ */
+void config_uninit(void);
+
+/* Encode any applied config_overwrites into a strv format suitale for
+ * executing another Amanda tool.
+ *
+ * The * result is dynamically allocated and NULL terminated.  There is no
+ * provision to free the result, as this function is always called just
+ * before execve(..).
+ *
+ * First gives the number of array elements to leave for the caller to
+ * fill in.  The usual calling pattern is this:
+ *   command_line = get_config_options(3);
+ *   command_line[0] = "appname";
+ *   command_line[1] = config_name;
+ *   command_line[2] = "--foo";
+ *   execve(command_line[0], command_line, safe_env());
+ *
+ * @param first: number of unused elements to leave at the beginning of
+ * the array.
+ * @returns: NULL-terminated string array suitable for execve
+ */
+char **get_config_options(int first);
+
+/* The name of the configuration under which this application is running.
+ * This variable is initialized by config_init, and should be treated as
+ * read-only.
+ */
+extern char *config_name;
+
+/* The directory containing the configuration for this application.  This
+ * variable is initialized by config_init, and should be treated as read-only.
+ */
+extern char *config_dir;
+
+/* The most recently read top-level configuration file.  This variable is
+ * initialized by config_init, and should be treated as read-only.
+ */
+extern char *config_filename;
+
+/*
+ * Utilities
+ */
+
+/* Security plugins get their configuration information through a callback
+ * with the signature:
+ *   char *callback(char *key, void *userpointer);
+ * where key is the name of the desired parameter, which may not match the
+ * name used in this module.  See the implementations of these functions
+ * to learn which keys they support, or to add new keys.
+ */
 char *generic_client_get_security_conf(char *, void *);
+char *generic_get_security_conf(char *, void *);
 
-int getconf_seen(confparm_t parameter);
-int getconf_boolean(confparm_t parameter);
-int getconf_int(confparm_t parameter);
-long getconf_long(confparm_t parameter);
-ssize_t getconf_size(confparm_t parameter);
-time_t getconf_time(confparm_t parameter);
-off_t getconf_am64(confparm_t parameter);
-double getconf_real(confparm_t parameter);
-char *getconf_str(confparm_t parameter);
-int getconf_taperalgo(confparm_t parameter);
-int *getconf_intrange(confparm_t parameter);
-char *getconf_byname(char *confname);
-char *getconf_list(char *listname);
-dumptype_t *lookup_dumptype(char *identifier);
+/* Dump the current configuration information to stdout, in a format 
+ * that can be re-read by this module.  The results will include any
+ * command-line overwrites.
+ *
+ * This function only dumps the server configuration, and will fail on
+ * clients.
+ */
+void dump_configuration(void);
+
+/* Return a sequence of strings giving the printable representation
+ * of the given val_t.  If str_needs_quotes is true and each string is
+ * prefixed by the relevant configuration keyword, these strings will
+ * be parseable by this module, and will reproduce exactly the same
+ * configuration value.  See the implementation of dump_configuration
+ * for details.
+ *
+ * If str_needs_quotes is provided, a CONFTYPE_STR value will be returned with 
+ * quotes.
+ *
+ * The result is a NULL-terminated strv, which can be freed with g_strfreev or
+ * joined with g_strjoinv.  Caller is responsible for freeing the memory.
+ *
+ * @param val: the value to analyze
+ * @param str_needs_quotes: add quotes to CONFTYPE_STR values?
+ * @returns: NULL-terminated string vector
+ */
+char **val_t_display_strs(val_t *val, int str_needs_quotes);
+
+/* Read a dumptype; this is used by this module as well as by diskfile.c to
+ * read the disklist.  The two are carefully balanced in their parsing process.
+ *
+ * Nobody else should use this function.  Seriously.
+ */
 dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum);
-tapetype_t *lookup_tapetype(char *identifier);
-holdingdisk_t *lookup_holdingdisk(char *identifier);
-interface_t *lookup_interface(char *identifier);
-holdingdisk_t *getconf_holdingdisks(void);
-long int getconf_unit_divisor(void);
-void dump_configuration(char *filename);
-int ColumnDataCount(void);
-int StringToColumn(char *s);
-char LastChar(char *s);
-int SetColumDataFromString(ColumnInfo* ci, char *s, char **errstr);
-ssize_t getconf_readblocksize(void);
-
-/* this is in securityconf.h */
-char *generic_get_security_conf(char *, void *);
+
+/* Extend a relative filename with the current config_dir; if filename is already
+ * absolute, this is equivalent to stralloc.
+ *
+ * @param filename: filename to extend
+ * @returns: newly allocated filename
+ */
+char *config_dir_relative(char *filename);
+
+/* Convert from a symbol back to a name for logging and for dumping
+ * config values
+ *
+ * @param taperalgo: the constant value
+ * @returns: statically allocated string
+ */
+char *taperalgo2str(taperalgo_t taperalgo);
+
+/* Looks for a unit value like b, byte, bytes, bps, etc. Technically
+ * the return value should never be < 1, but we return a signed value
+ * to help mitigate bad C promotion semantics. Returns 0 on error.
+ *
+ * This is here in this module because it uses the numb_keytable.
+ *
+ * @param casestr: the unit string
+ * @returns: the corresponding multiplier (e.g., 'M' => 1024*1024)
+ */
+gint64 find_multiplier(char * casestr);
+
 #endif /* ! CONFFILE_H */
index 86c3be141131c8e2e90635920d78bc2ebfe2a12a..7adbc00b241b2346c73914e6fb70d2193f4afca0 100644 (file)
 /*
  * $Id: debug.c,v 1.40 2006/07/26 11:49:32 martinea Exp $
  *
- * debug log subroutines
+ * Logging support
  */
 
 #include "amanda.h"
 #include "util.h"
 #include "arglist.h"
 #include "clock.h"
+#include "timestamp.h"
+#include "conffile.h"
 
-#ifndef AMANDA_DBGDIR
-#  define AMANDA_DBGDIR                AMANDA_TMPDIR
-#endif
+/* Minimum file descriptor on which to keep the debug file.  This is intended
+ * to keep the descriptor "out of the way" of other processing.  It's not clear
+ * that this is required any longer, but it doesn't hurt anything.
+ */
+#define        MIN_DB_FD                       10
 
-#ifdef DEBUG_CODE
+/* information on the current debug file */
+static int db_fd = 2;                  /* file descriptor (default stderr) */
+static FILE *db_file = NULL;           /* stdio stream */
+static char *db_name  = NULL;          /* unqualified filename */
+static char *db_filename = NULL;       /* fully qualified pathname */
 
-int debug = 1;
+/* directory containing debug file, including trailing slash */
+static char *dbgdir = NULL;
 
-#define        MIN_DB_FD                       10
+/* time debug log was opened (timestamp of the file) */
+static time_t open_time;
 
-static int db_fd = 2;                  /* default is stderr */
-static FILE *db_file = NULL;           /* stderr may not be a constant */
-static char *db_name  = NULL;          /* filename */
-static char *db_filename = NULL;       /* /path/to/filename */
+/* pointer to logfile.c's 'logerror()', if we're linked
+ * with it */
+static void (*logerror_fn)(char *) = NULL;
 
-static pid_t debug_prefix_pid = 0;
+/* storage for global variables */
+erroutput_type_t erroutput_type = ERR_INTERACTIVE;
+int error_exit_status = 1;
+
+/* static function prototypes */
 static char *get_debug_name(time_t t, int n);
 static void debug_setup_1(char *config, char *subdir);
-static void debug_setup_2(char *s, int fd, char *notation);
-static times_t debug_start_time;
-static int debug_clock_is_running = 0;
-
-/*
- * Format and write a debug message to the process debug file.
- */
-printf_arglist_function(void debug_printf, const char *, format)
-{
-    va_list argp;
-
-    /*
-     * It is common in the code to call dbprintf to write out
-     * syserrno(errno) and then turn around and try to do something else
-     * with errno (e.g. printf() or log()), so we make sure errno goes
-     * back out with the same value it came in with.
-     */
-    if (debug != 0) {
-        int save_errno;
+static void debug_setup_2(char *s, int fd, char *annotation);
+static char *msg_timestamp(void);
 
-       save_errno = errno;
-       if(db_file == NULL && db_fd == 2) {
-           db_file = stderr;
-       }
-       if(db_file != NULL) {
-           arglist_start(argp, format);
-           vfprintf(db_file, format, argp);
-           fflush(db_file);
-           arglist_end(argp);
-       }
-       errno = save_errno;
-    }
-}
+static void debug_logging_handler(const gchar *log_domain,
+       GLogLevelFlags log_level,
+       const gchar *message,
+       gpointer user_data);
+static void debug_setup_logging(void);
 
 /*
  * Generate a debug file name.  The name is based on the program name,
  * followed by a timestamp, an optional sequence number, and ".debug".
+ *
+ * @param t: timestamp
+ * @param n: sequence number between 1 and 1000; if zero, no sequence number
+ * is included.
  */
 static char *
 get_debug_name(
@@ -103,24 +95,106 @@ get_debug_name(
     if(n < 0 || n > 1000) {
        return NULL;
     }
-    ts = construct_timestamp(&t);
+    ts = get_timestamp_from_time(t);
     if(n == 0) {
        number[0] = '\0';
     } else {
-       snprintf(number, SIZEOF(number), "%03d", n - 1);
+       g_snprintf(number, SIZEOF(number), "%03d", n - 1);
     }
     result = vstralloc(get_pname(), ".", ts, number, ".debug", NULL);
     amfree(ts);
     return result;
 }
 
-static char *dbgdir = NULL;
-static time_t curtime;
+/* A GLogFunc to handle g_log calls.  This function assumes that user_data
+ * is either NULL or a pointer to one of the debug_* configuration variables
+ * in conffile.c, indicating whether logging for this log domain is enabled.
+ *
+ * @param log_domain: the log domain, or NULL for general logging
+ * @param log_level: level, fatality, and recursion flags
+ * @param message: the message to log
+ * @param user_pointer: unused
+ */
+static void
+debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED,
+           GLogLevelFlags log_level,
+           const gchar *message,
+           gpointer user_data G_GNUC_UNUSED)
+{
+    char *maxlevel = NULL;
+
+    /* convert the highest level to a string and dbprintf it */
+    if (log_level & G_LOG_LEVEL_ERROR)
+       maxlevel = _("error (fatal): ");
+    else if (log_level & G_LOG_LEVEL_CRITICAL)
+       maxlevel = _("critical (fatal): ");
+    else if (log_level & G_LOG_LEVEL_WARNING)
+       maxlevel = _("warning: ");
+    else if (log_level & G_LOG_LEVEL_MESSAGE)
+       maxlevel = _("message: ");
+    else if (log_level & G_LOG_LEVEL_INFO)
+       maxlevel = _("info: ");
+    else
+       maxlevel = ""; /* no level displayed for debugging */
+
+    debug_printf("%s%s\n", maxlevel, message);
+
+    /* error and critical levels have special handling */
+    if (log_level & (G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL)) {
+       if (erroutput_type & ERR_AMANDALOG && logerror_fn != NULL)
+           (*logerror_fn)((char *)message); /* discard 'const' */
 
+       if (erroutput_type & ERR_SYSLOG) {
+#ifdef LOG_AUTH
+           openlog(get_pname(), LOG_PID, LOG_AUTH);
+#else
+           openlog(get_pname(), LOG_PID, 0);
+#endif
+           syslog(LOG_NOTICE, "%s", message);
+           closelog();
+       }
+
+       if (erroutput_type & ERR_INTERACTIVE) {
+           g_fprintf(stderr, "%s: %s: %s\n", get_pname(), msg_timestamp(), message);
+           fflush(stderr);
+       }
+
+       /* we're done */
+       if (log_level & G_LOG_LEVEL_CRITICAL)
+           exit(error_exit_status);
+       else
+           abort();
+       g_assert_not_reached();
+    }
+}
+
+/* Install our handler into the glib log handling system.
+ */
+static void
+debug_setup_logging(void)
+{
+    /* g_error and g_critical should be fatal, although the log handler
+     * takes care of this anyway */
+    g_log_set_always_fatal(G_LOG_LEVEL_ERROR |  G_LOG_LEVEL_CRITICAL);
+
+    /* set up handler (g_log_set_default_handler is new in glib-2.6, and
+     * hence not useable here) */
+    g_log_set_handler(NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
+                     debug_logging_handler, NULL);
+}
+
+/* Set the global dbgdir according to 'config' and 'subdir', and clean
+ * old debug files out of that directory
+ *
+ * The global open_time is set to the current time, and used to delete
+ * old files.
+ *
+ * @param config: configuration or NULL
+ * @param subdir: subdirectory (server, client, etc.) or NULL
+ */
 static void
 debug_setup_1(char *config, char *subdir)
 {
-    struct passwd *pwent;
     char *pname;
     size_t pname_len;
     char *e = NULL;
@@ -137,11 +211,6 @@ debug_setup_1(char *config, char *subdir)
     int i;
 
     memset(&sbuf, 0, SIZEOF(sbuf));
-    if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
-       client_uid = pwent->pw_uid;
-       client_gid = pwent->pw_gid;
-       endpwent();
-    }
 
     pname = get_pname();
     pname_len = strlen(pname);
@@ -161,10 +230,10 @@ debug_setup_1(char *config, char *subdir)
        dbgdir = vstralloc(AMANDA_DBGDIR, "/", subdir, "/", NULL);
     else
        dbgdir = stralloc2(AMANDA_DBGDIR, "/");
-    if(mkpdir(dbgdir, 02700, client_uid, client_gid) == -1) {
-        error("create debug directory \"%s\": %s",
+    if(mkpdir(dbgdir, 02700, get_client_uid(), get_client_gid()) == -1) {
+       error(_("create debug directory \"%s\": %s"),
              dbgdir, strerror(errno));
-        /*NOTREACHED*/
+       /*NOTREACHED*/
     }
     amfree(sane_config);
 
@@ -175,12 +244,12 @@ debug_setup_1(char *config, char *subdir)
      * not be a conflict between an old and new name.
      */
     if((d = opendir(dbgdir)) == NULL) {
-        error("open debug directory \"%s\": %s",
+       error(_("open debug directory \"%s\": %s"),
              dbgdir, strerror(errno));
-        /*NOTREACHED*/
+       /*NOTREACHED*/
     }
-    time(&curtime);
-    test_name = get_debug_name(curtime - (AMANDA_DEBUG_DAYS * 24 * 60 * 60), 0);
+    time(&open_time);
+    test_name = get_debug_name(open_time - (AMANDA_DEBUG_DAYS * 24 * 60 * 60), 0);
     test_name_len = strlen(test_name);
     while((entry = readdir(d)) != NULL) {
        if(is_dot_or_dotdot(entry->d_name)) {
@@ -224,7 +293,7 @@ debug_setup_1(char *config, char *subdir)
                dbfilename = get_debug_name((time_t)sbuf.st_mtime, ++i);
            }
            if(dbfilename == NULL) {
-               error("cannot rename old debug file \"%s\"", entry->d_name);
+               error(_("cannot rename old debug file \"%s\""), entry->d_name);
                /*NOTREACHED*/
            }
        }
@@ -236,23 +305,44 @@ debug_setup_1(char *config, char *subdir)
     closedir(d);
 }
 
+/* Given an already-opened debug file, set the file's ownership
+ * appropriately, move its file descriptor above MIN_DB_FD, and
+ * add an initial log entry to the file.
+ *
+ * This function records the file's identity in the globals
+ * db_filename, db_fd, and db_file.  It does *not* set db_name.
+ * db_file is not set if fd is -1
+ *
+ * This function uses the global 'open_time', which is set by
+ * debug_setup_1.
+ *
+ * @param s: the filename of the debug file; string should be malloc'd,
+ * and should *not* be freed by the caller.
+ * @param fd: the descriptor connected to the debug file, or -1 if
+ * no decriptor moving should take place.
+ * @param annotation: an extra string to include in the initial
+ * log entry.
+ */
 static void
 debug_setup_2(
     char *     s,
     int                fd,
-    char *     notation)
+    char *     annotation)
 {
-    int saved_debug;
-    int i, rc;
+    int i;
     int fd_close[MIN_DB_FD+1];
 
     amfree(db_filename);
     db_filename = s;
     s = NULL;
-    if ((rc = chown(db_filename, client_uid, client_gid)) < 0) {
-       dbprintf(("chown(%s, %d, %d) failed. <%s>",
-                 db_filename, client_uid, client_gid, strerror(errno)));
-       (void)rc;
+
+    /* If we're root, change the ownership of the debug files.  If we're not root,
+     * this would either be redundant or an error. */
+    if (geteuid() == 0) {
+       if (chown(db_filename, get_client_uid(), get_client_gid()) < 0) {
+           dbprintf(_("chown(%s, %d, %d) failed: %s"),
+                    db_filename, (int)get_client_uid(), (int)get_client_gid(), strerror(errno));
+       }
     }
     amfree(dbgdir);
     /*
@@ -271,20 +361,47 @@ debug_setup_2(
        db_file = fdopen(db_fd, "a");
     }
 
-    if (notation) {
+    if (annotation) {
        /*
         * Make the first debug log file entry.
         */
-       saved_debug = debug; debug = 1;
-       debug_printf("%s: debug %d pid %ld ruid %ld euid %ld: %s at %s",
-                    get_pname(), saved_debug, (long)getpid(),
+       debug_printf(_("pid %ld ruid %ld euid %ld: %s at %s"),
+                    (long)getpid(),
                     (long)getuid(), (long)geteuid(),
-                    notation,
-                    ctime(&curtime));
-       debug = saved_debug;
+                    annotation,
+                    ctime(&open_time));
     }
 }
 
+/* Get current GMT time and return a message timestamp.
+ * Used for g_printf calls to logs and such.  The return value
+ * is to a static buffer, so it should be used immediately.
+ *
+ * @returns: timestamp
+ */
+static char *
+msg_timestamp(void)
+{
+    static char timestamp[128];
+    struct timeval tv;
+
+    gettimeofday(&tv, NULL);
+    g_snprintf(timestamp, SIZEOF(timestamp), "%lld.%06ld",
+               (long long)tv.tv_sec, (long)tv.tv_usec);
+
+    return timestamp;
+}
+
+/*
+ * ---- public functions
+ */
+
+void
+set_logerror(void (*f)(char *))
+{
+    logerror_fn = f;
+}
+
 void
 debug_open(char *subdir)
 {
@@ -292,40 +409,40 @@ debug_open(char *subdir)
     int i;
     char *s = NULL;
     mode_t mask;
-    amanda_timezone dontcare;
 
-    amanda_gettimeofday(&debug_start_time.r, &dontcare);
-    debug_clock_is_running = 1;
+    /* set up logging while we're here */
+    debug_setup_logging();
 
-    /*
-     * Do initial setup.
-     */
+    /* set 'dbgdir' and clean out old debug files */
     debug_setup_1(NULL, subdir);
 
     /*
      * Create the new file with a unique sequence number.
      */
     mask = (mode_t)umask((mode_t)0037); /* Allow the group read bit through */
+
+    /* iteratate through sequence numbers until we find one that
+     * is not already in use */
     for(i = 0; fd < 0; i++) {
        amfree(db_name);
-       if ((db_name = get_debug_name(curtime, i)) == NULL) {
-           error("Cannot create %s debug file", get_pname());
+       if ((db_name = get_debug_name(open_time, i)) == NULL) {
+           error(_("Cannot create debug file name in %d tries."), i);
            /*NOTREACHED*/
-        }
+       }
 
        if ((s = newvstralloc(s, dbgdir, db_name, NULL)) == NULL) {
-           error("Cannot allocate %s debug file name memory", get_pname());
+           error(_("Cannot allocate debug file name memory"));
            /*NOTREACHED*/
        }
 
-        if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) {
-            if (errno != EEXIST) {
-                error("Cannot create %s debug file: %s",
-                       get_pname(), strerror(errno));
-                /*NOTREACHED*/
-            }
-            amfree(s);
-        }
+       if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) {
+           if (errno != EEXIST) {
+               error(_("Cannot create debug file \"%s\": %s"),
+                       s, strerror(errno));
+               /*NOTREACHED*/
+           }
+           amfree(s);
+       }
     }
     (void)umask(mask); /* Restore mask */
 
@@ -340,7 +457,7 @@ debug_open(char *subdir)
 void
 debug_reopen(
     char *     dbfilename,
-    char *     notation)
+    char *     annotation)
 {
     char *s = NULL;
     int fd;
@@ -349,9 +466,7 @@ debug_reopen(
        return;
     }
 
-    /*
-     * Do initial setup.
-     */
+    /* set 'dbgdir' and clean out old debug files */
     debug_setup_1(NULL, NULL);
 
     /*
@@ -363,7 +478,7 @@ debug_reopen(
        s = newvstralloc(s, dbgdir, dbfilename, NULL);
     }
     if ((fd = open(s, O_RDWR|O_APPEND)) < 0) {
-       error("cannot reopen %s debug file %s", get_pname(), dbfilename);
+       error(_("cannot reopen debug file %s"), dbfilename);
        /*NOTREACHED*/
     }
 
@@ -372,7 +487,7 @@ debug_reopen(
      *
      * Note: we release control of the string 's' points to.
      */
-    debug_setup_2(s, fd, notation);
+    debug_setup_2(s, fd, annotation);
 }
 
 void
@@ -388,9 +503,7 @@ debug_rename(
     if (!db_filename)
        return;
 
-    /*
-     * Do initial setup.
-     */
+    /* set 'dbgdir' and clean out old debug files */
     debug_setup_1(config, subdir);
 
     s = newvstralloc(s, dbgdir, db_name, NULL);
@@ -401,20 +514,72 @@ debug_rename(
     }
 
     mask = (mode_t)umask((mode_t)0037);
-    /* check if a file with the same name already exist */
+
+#if defined(__CYGWIN__)
+    /*
+     * On cygwin, rename will not overwrite an existing file nor
+     * will it rename a file that is open for writing...
+     *
+     * Rename file directly.  Expect failure if file already exists
+     * or is open by another user.
+     */
+
+    i = 0;
+    while (rename(db_filename, s) < 0) {
+       if (errno != EEXIST) {
+           /*
+            * If the failure was not due to the target file name already
+            * existing then we have bigger issues at hand so we keep 
+            * the existing file.
+            */
+           dbprintf(_("Cannot rename \"%s\" to \"%s\": %s\n"),
+                    db_filename, s, strerror(errno));
+           s = newvstralloc(s, db_filename, NULL);
+           i = -1;
+           break;
+       }
+
+       /*
+        * Files already exists:
+        * Continue searching for a unique file name that will work.
+        */
+       amfree(db_name);
+       if ((db_name = get_debug_name(open_time, i++)) == NULL) {
+           dbprintf(_("Cannot create unique debug file name"));
+           break;
+       }
+       s = newvstralloc(s, dbgdir, db_name, NULL);
+    }
+    if (i >= 0) {
+       /*
+        * We need to close and reopen the original file handle to
+        * release control of the original debug file name.
+        */
+       if ((fd = open(s, O_WRONLY|O_APPEND, 0640)) >= 0) {
+           /*
+            * We can safely close the the original log file
+            * since we now have a new working handle.
+            */
+           db_fd = 2;
+           fclose(db_file);
+           db_file = NULL;
+       }
+    }
+#else
+    /* check if a file with the same name already exists. */
     if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) {
        for(i = 0; fd < 0; i++) {
            amfree(db_name);
-           if ((db_name = get_debug_name(curtime, i)) == NULL) {
-               dbprintf(("Cannot create %s debug file", get_pname()));
+           if ((db_name = get_debug_name(open_time, i)) == NULL) {
+               dbprintf(_("Cannot create debug file"));
                break;
            }
 
            s = newvstralloc(s, dbgdir, db_name, NULL);
            if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) {
                if (errno != EEXIST) {
-                   dbprintf(("Cannot create %s debug file: %s", get_pname(),
-                             strerror(errno)));
+                   dbprintf(_("Cannot create debug file: %s"),
+                             strerror(errno));
                    break;
                }
            }
@@ -422,47 +587,74 @@ debug_rename(
     }
 
     if (fd >= 0) {
-       rename(db_filename, s);
+       close(fd);
+       if (rename(db_filename, s) == -1) {
+           dbprintf(_("Cannot rename \"%s\" to \"%s\": %s\n"),
+                    db_filename, s, strerror(errno));
+       }
+       fd = -1;
     }
+#endif
+
     (void)umask(mask); /* Restore mask */
-    close(fd);
     /*
      * Finish setup.
      *
      * Note: we release control of the string 's' points to.
      */
-    debug_setup_2(s, -1, "rename");
+    debug_setup_2(s, fd, "rename");
 }
 
 void
 debug_close(void)
 {
     time_t curtime;
-    int save_debug;
-    pid_t save_pid;
 
     time(&curtime);
-    save_debug = debug;
-    debug = 1;
-    save_pid = debug_prefix_pid;
-    debug_prefix_pid = 0;
-    debug_printf("%s: pid %ld finish time %s",
-                debug_prefix_time(NULL),
-                (long)getpid(),
-                ctime(&curtime));
-    debug_prefix_pid = save_pid;
-    debug = save_debug;
+    debug_printf(_("pid %ld finish time %s"), (long)getpid(), ctime(&curtime));
 
     if(db_file && fclose(db_file) == EOF) {
        int save_errno = errno;
 
        db_file = NULL;                         /* prevent recursion */
-       fprintf(stderr, "close debug file: %s", strerror(save_errno));
+       g_fprintf(stderr, _("close debug file: %s"), strerror(save_errno));
        /*NOTREACHED*/
     }
-    db_fd = -1;
+    db_fd = 2;
     db_file = NULL;
     amfree(db_filename);
+    amfree(db_name);
+}
+
+/*
+ * Format and write a debug message to the process debug file.
+ */
+printf_arglist_function(void debug_printf, const char *, format)
+{
+    va_list argp;
+    int save_errno;
+
+    /*
+     * It is common in the code to call dbprintf to write out
+     * syserrno(errno) and then turn around and try to do something else
+     * with errno (e.g. g_printf() or log()), so we make sure errno goes
+     * back out with the same value it came in with.
+     */
+
+    save_errno = errno;
+
+    /* handle the default (stderr) if debug_open hasn't been called yet */
+    if(db_file == NULL && db_fd == 2) {
+       db_file = stderr;
+    }
+    if(db_file != NULL) {
+       g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname());
+       arglist_start(argp, format);
+       g_vfprintf(db_file, format, argp);
+       arglist_end(argp);
+       fflush(db_file);
+    }
+    errno = save_errno;
 }
 
 int
@@ -483,65 +675,16 @@ debug_fn(void)
     return db_filename;
 }
 
-/*
- * Routines for returning a common debug file line prefix.  Always starts
- * with the current program name, possibly with an optional suffix.
- * May then be followed by a PID.  May then be followed by an elapsed
- * time indicator.
- */ 
-
 void
-set_debug_prefix_pid(
-    pid_t      p)
+debug_dup_stderr_to_debug(void)
 {
-    debug_prefix_pid = p;
-}
-
-char *
-debug_prefix(
-    char *     suffix)
-{
-    int save_errno;
-    static char *s = NULL;
-    char debug_pid[NUM_STR_SIZE];
-
-    save_errno = errno;
-    s = newvstralloc(s, get_pname(), suffix, NULL);
-    if (debug_prefix_pid != (pid_t) 0) {
-       snprintf(debug_pid, SIZEOF(debug_pid),
-                "%ld",
-                (long) debug_prefix_pid);
-       s = newvstralloc(s, s, "[", debug_pid, "]", NULL);
+    if(db_fd != -1 && db_fd != STDERR_FILENO)
+    {
+       if(dup2(db_fd, STDERR_FILENO) != STDERR_FILENO)
+       {
+          error(_("can't redirect stderr to the debug file"));
+          g_assert_not_reached();
+       }
     }
-    errno = save_errno;
-    return s;
 }
 
-char *
-debug_prefix_time(
-    char *     suffix)
-{
-    int save_errno;
-    static char *s = NULL;
-    char *t1;
-    char *t2;
-    times_t diff;
-    times_t debug_end_time;
-    amanda_timezone dontcare;
-
-    save_errno = errno;
-    if (debug_clock_is_running == 1) {
-       amanda_gettimeofday(&debug_end_time.r, &dontcare);
-       diff = timessub(debug_end_time,debug_start_time);
-       t1 = ": time ";
-       t2 = walltime_str(diff);
-    } else {
-       t1 = t2 = NULL;
-    }
-
-    s = newvstralloc(s, debug_prefix(suffix), t1, t2, NULL);
-
-    errno = save_errno;
-    return s;
-}
-#endif
diff --git a/common-src/debug.h b/common-src/debug.h
new file mode 100644 (file)
index 0000000..b3d539e
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1999 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+/*
+ * $Id: debug.h 6789 2007-06-18 20:18:52Z dustin $
+ *
+ * Logging support
+ */
+
+/* this file is included from amanda.h; there is no need to include
+ * it explicitly in source files. */
+
+#ifndef AMANDA_DEBUG_H
+#define AMANDA_DEBUG_H
+
+/*
+ * GENERAL LOGGING
+ */
+
+/* Amanda uses glib's logging facilities.  See
+ *  http://developer.gnome.org/doc/API/2.2/glib/glib-Message-Logging.html
+ *
+ * Note that log output will go to stderr until debug_open is called.
+ *
+ * The error levels are assigned as follows:
+ *  g_error -- errors that should dump core (will not return)
+ *  g_critical -- fatal errors, exiting with exit status in 
+ *    error_exit_status() (will not return)
+ *  g_warning -- non-fatal problems
+ *  g_message -- normal status information
+ *  g_info -- helpful extra details, but not verbose
+ *  g_debug -- debug messages
+ *
+ * g_error and g_critical will respect erroutput_type, potentially
+ * sending the error to the Amanda logfile for this run (see logfile.c).
+ */
+
+/* g_debug was introduced in glib 2.6, so define it here for systems where
+ * it is lacking.  g_info doesn't exist even in glib 2.13, but maybe it will
+ * be invented soon..
+ */
+
+#ifndef g_debug
+#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
+#endif
+
+#ifndef g_info
+#define g_info(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__)
+#endif
+
+/*
+ * FATAL ERROR HANDLING
+ */
+
+/* for compatibility; these should eventually be substituted throughout
+ * the codebase.  Extra calls to exit() and abort() should be optimized
+ * away, and are there only for stupid compilers. */
+#define errordump(...) do { g_error(__VA_ARGS__); abort(); } while (0)
+#define error(...) do { g_critical(__VA_ARGS__); exit(error_exit_status); } while (0)
+
+/* Additional handling for error and critical messages. */
+typedef enum {
+    /* send message to stderr (for interactive programs) */
+    ERR_INTERACTIVE    = 1 << 0, /* (default) */
+
+    /* log to syslog */
+    ERR_SYSLOG         = 1 << 1,
+
+    /* add an L_FATAL entry in the Amanda logfile for the 
+     * current run */
+    ERR_AMANDALOG      = 1 << 2
+} erroutput_type_t;
+extern erroutput_type_t erroutput_type;
+
+/* The process exit status that will be given when error()
+ * or errordump() is called.
+ */
+extern int error_exit_status;
+
+/* Supply a pointer to the logfile module's logerror(), if
+ * ERR_AMANDALOG is set.
+ *
+ * This function is required because libamanda, which contains
+ * debug.c, is not always linked with the logerror module 
+ * (which only appears in server applications).
+ *
+ * @param logerror_fn: function pointer
+ */
+void set_logerror(void (*logerror_fn)(char *));
+
+/*
+ * DEBUG LOGGING
+ */
+
+/* short names */
+#define dbopen(a)      debug_open(a)
+#define dbreopen(a,b)  debug_reopen(a,b)
+#define dbrename(a,b)  debug_rename(a,b)
+#define dbclose()      debug_close()
+#define dbprintf       debug_printf
+#define dbfd()         debug_fd()
+#define dbfp()         debug_fp()
+#define dbfn()         debug_fn()
+
+/* constants for db(re)open */
+#define DBG_SUBDIR_SERVER  "server"
+#define DBG_SUBDIR_CLIENT  "client"
+#define DBG_SUBDIR_AMANDAD "amandad"
+
+/* Open the debugging log in the given subdirectory.  Once 
+ * this function is called, debug logging is available.
+ *
+ * The debugging file is created in the given subdirectory of the
+ * amanda debugging directory, with a filename based on the current
+ * process name (from get_pname).
+ *
+ * @param subdir: subdirectory in which to create the debug file.
+ * This is usually one of the DBG_SUBDIR_* constants.  
+ */
+void   debug_open(char *subdir);
+
+/* Re-open a previously debug_close()d debug file, given by 
+ * filename, optionally adding a notation as to why it was
+ * reopened.
+ *
+ * @param file: the filename of the debug file to reopen
+ * @param notation: reason for re-opening the file
+ */
+void   debug_reopen(char *file, char *notation);
+
+/* Rename the debugging logfile into a configuration-specific subdirectory
+ * of SUBDIR.  Any existing content of the file will be preserved.
+ *
+ * @param config: configuration name
+ * @param subdir: subdirectory in which to create the debug file.
+ */
+void   debug_rename(char *config, char *subdir);
+
+/* Flush and close the debugging logfile.  Call this function at application
+ * shutdown.
+ */
+void   debug_close(void);
+
+/* Add a message to the debugging logfile.  A newline is not automatically 
+ * added.
+ *
+ * This function is deprecated in favor of glib's g_debug().
+ */
+void   debug_printf(const char *format, ...) G_GNUC_PRINTF(1,2);
+
+/* Get the file descriptor for the debug file
+ *
+ * @returns: the file descriptor
+ */
+int    debug_fd(void);
+
+/* Get the stdio file handle for the debug file.
+ *
+ * @returns: the file handle
+ */
+FILE * debug_fp(void);
+
+/* Get the pathname of the debug file.
+ *
+ * The result should not be freed by the caller.
+ *
+ * @returns: the pathname
+ */
+char * debug_fn(void);
+
+/* Use 'dup2' to send stderr output to the debug file.  This is useful
+ * when launching other applications, where the stderr of those applications
+ * may be necessary for debugging.  It should be called in the child, after
+ * the fork().
+ */
+void debug_dup_stderr_to_debug(void);
+
+/*
+ * PROCESS NAME
+ */
+
+/*
+ * ASSERTIONS
+ */
+
+#ifndef SWIG
+#ifdef ASSERTIONS
+
+/* Like the standard assert(), but call g_error() to log the result properly */
+#define assert(exp)    do {                                            \
+    if (!(exp)) {                                                      \
+       g_error(_("assert: %s is false: file %s, line %d"),             \
+          stringize(exp), __FILE__, __LINE__);                         \
+        g_assert_not_reached();                                                \
+    }                                                                  \
+} while (0)
+
+#else  /* ASSERTIONS */
+
+#define assert(exp) ((void)0)
+
+#endif /* ASSERTIONS */
+#endif /* SWIG */
+
+#endif /* AMANDA_DEBUG_H */
index e6d267bb99f45bb646aa4503c3c2fd908dea2dc2..338baa8eab8f6cd269bb05de72a506fe9d735fae 100644 (file)
 #include "dgram.h"
 #include "util.h"
 #include "conffile.h"
+#include "sockaddr-util.h"
 
 void
 dgram_socket(
     dgram_t *  dgram,
     int                socket)
 {
-    if(socket < 0 || socket >= FD_SETSIZE) {
-       error("dgram_socket: socket %d out of range (0 .. %d)\n",
-             socket, FD_SETSIZE-1);
+    if(socket < 0 || socket >= (int)FD_SETSIZE) {
+       error(_("dgram_socket: socket %d out of range (0 .. %d)\n"),
+             socket, (int)FD_SETSIZE-1);
         /*NOTREACHED*/
     }
     dgram->socket = socket;
@@ -65,16 +66,14 @@ dgram_bind(
     *portp = (in_port_t)0;
     if((s = socket(family, SOCK_DGRAM, 0)) == -1) {
        save_errno = errno;
-       dbprintf(("%s: dgram_bind: socket() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("dgram_bind: socket() failed: %s\n"),
+                 strerror(save_errno));
        errno = save_errno;
        return -1;
     }
     if(s < 0 || s >= (int)FD_SETSIZE) {
-       dbprintf(("%s: dgram_bind: socket out of range: %d\n",
-                 debug_prefix_time(NULL),
-                 s));
+       dbprintf(_("dgram_bind: socket out of range: %d\n"),
+                 s);
        aclose(s);
        errno = EMFILE;                         /* out of range */
        return -1;
@@ -97,23 +96,20 @@ dgram_bind(
     for (retries = 0; ; retries++) {
        if (bind_portrange(s, &name, portrange[0], portrange[1], "udp") == 0)
            goto out;
-       dbprintf(("%s: dgram_bind: Could not bind to port in range: %d - %d.\n",
-                 debug_prefix_time(NULL), portrange[0], portrange[1]));
+       dbprintf(_("dgram_bind: Could not bind to port in range: %d - %d.\n"),
+                 portrange[0], portrange[1]);
        if (retries >= BIND_CYCLE_RETRIES) {
-           dbprintf(("%s: dgram_bind: Giving up...\n",
-                     debug_prefix_time(NULL)));
+           dbprintf(_("dgram_bind: Giving up...\n"));
            break;
        }
 
-       dbprintf(("%s: dgram_bind: Retrying entire range after 10 second delay.\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("dgram_bind: Retrying entire range after 10 second delay.\n"));
        sleep(15);
     }
 
     save_errno = errno;
-    dbprintf(("%s: dgram_bind: bind(in6addr_any) failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+    dbprintf(_("dgram_bind: bind(in6addr_any) failed: %s\n"),
+                 strerror(save_errno));
     aclose(s);
     errno = save_errno;
     return -1;
@@ -124,9 +120,7 @@ out:
     len = (socklen_t)sizeof(name);
     if(getsockname(s, (struct sockaddr *)&name, &len) == -1) {
        save_errno = errno;
-       dbprintf(("%s: dgram_bind: getsockname() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("dgram_bind: getsockname() failed: %s\n"), strerror(save_errno));
        errno = save_errno;
        aclose(s);
        return -1;
@@ -134,8 +128,8 @@ out:
     *portp = SS_GET_PORT(&name);
     dgram->socket = s;
 
-    dbprintf(("%s: dgram_bind: socket %d bound to %s\n",
-             debug_prefix_time(NULL), dgram->socket, str_sockaddr(&name)));
+    dbprintf(_("dgram_bind: socket %d bound to %s\n"),
+             dgram->socket, str_sockaddr(&name));
     return 0;
 }
 
@@ -155,20 +149,19 @@ dgram_send_addr(
     int r;
 #endif
 
-    dbprintf(("%s: dgram_send_addr(addr=%p, dgram=%p)\n",
-             debug_prefix_time(NULL), addr, dgram));
+    dbprintf(_("dgram_send_addr(addr=%p, dgram=%p)\n"),
+             addr, dgram);
     dump_sockaddr(addr);
-    dbprintf(("%s: dgram_send_addr: %p->socket = %d\n",
-             debug_prefix_time(NULL), dgram, dgram->socket));
+    dbprintf(_("dgram_send_addr: %p->socket = %d\n"),
+             dgram, dgram->socket);
     if(dgram->socket != -1) {
        s = dgram->socket;
        socket_opened = 0;
     } else {
        if((s = socket(addr->ss_family, SOCK_DGRAM, 0)) == -1) {
            save_errno = errno;
-           dbprintf(("%s: dgram_send_addr: socket() failed: %s\n",
-                     debug_prefix_time(NULL),
-                     strerror(save_errno)));
+           dbprintf(_("dgram_send_addr: socket() failed: %s\n"),
+                     strerror(save_errno));
            errno = save_errno;
            return -1;
        }
@@ -177,17 +170,14 @@ dgram_send_addr(
        r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
                (void *)&on, (socklen_t)sizeof(on));
        if (r < 0) {
-           dbprintf(("%s: dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n",
-                     debug_prefix_time(NULL),
-                     strerror(errno)));
+           dbprintf(_("dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n"),
+                     strerror(errno));
        }
 #endif
     }
 
-    if(s < 0 || s >= FD_SETSIZE) {
-       dbprintf(("%s: dgram_send_addr: socket out of range: %d\n",
-                 debug_prefix_time(NULL),
-                 s));
+    if(s < 0 || s >= (int)FD_SETSIZE) {
+       dbprintf(_("dgram_send_addr: socket out of range: %d\n"), s);
        errno = EMFILE;                         /* out of range */
        rc = -1;
     } else {
@@ -203,28 +193,25 @@ dgram_send_addr(
 #ifdef ECONNREFUSED
            if(errno == ECONNREFUSED && wait_count++ < max_wait) {
                sleep(5);
-               dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after ECONNREFUSED\n",
-                     debug_prefix_time(NULL),
+               dbprintf(_("dgram_send_addr: sendto(%s): retry %d after ECONNREFUSED\n"),
                      str_sockaddr(addr),
-                     wait_count));
+                     wait_count);
                continue;
            }
 #endif
 #ifdef EAGAIN
            if(errno == EAGAIN && wait_count++ < max_wait) {
                sleep(5);
-               dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after EAGAIN\n",
-                     debug_prefix_time(NULL),
+               dbprintf(_("dgram_send_addr: sendto(%s): retry %d after EAGAIN\n"),
                      str_sockaddr(addr),
-                     wait_count));
+                     wait_count);
                continue;
            }
 #endif
            save_errno = errno;
-           dbprintf(("%s: dgram_send_addr: sendto(%s) failed: %s \n",
-                 debug_prefix_time(NULL),
+           dbprintf(_("dgram_send_addr: sendto(%s) failed: %s \n"),
                  str_sockaddr(addr),
-                 strerror(save_errno)));
+                 strerror(save_errno));
            errno = save_errno;
            rc = -1;
            break;
@@ -234,10 +221,9 @@ dgram_send_addr(
     if(socket_opened) {
        save_errno = errno;
        if(close(s) == -1) {
-           dbprintf(("%s: dgram_send_addr: close(%s): failed: %s\n",
-                     debug_prefix_time(NULL),
+           dbprintf(_("dgram_send_addr: close(%s): failed: %s\n"),
                      str_sockaddr(addr),
-                     strerror(errno)));
+                     strerror(errno));
            /*
             * Calling function should not care that the close failed.
             * It does care about the send results though.
@@ -250,6 +236,7 @@ dgram_send_addr(
 }
 
 
+
 ssize_t
 dgram_recv(
     dgram_t *          dgram,
@@ -271,31 +258,26 @@ dgram_recv(
     to.tv_sec = timeout;
     to.tv_usec = 0;
 
-    dbprintf(("%s: dgram_recv(dgram=%p, timeout=%u, fromaddr=%p)\n",
-               debug_prefix_time(NULL), dgram, timeout, fromaddr));
+    dbprintf(_("dgram_recv(dgram=%p, timeout=%u, fromaddr=%p)\n"),
+               dgram, timeout, fromaddr);
     
     nfound = (ssize_t)select(sock+1, &ready, NULL, NULL, &to);
     if(nfound <= 0 || !FD_ISSET(sock, &ready)) {
        save_errno = errno;
        if(nfound < 0) {
-           dbprintf(("%s: dgram_recv: select() failed: %s\n",
-                     debug_prefix_time(NULL),
-                     strerror(save_errno)));
+           dbprintf(_("dgram_recv: select() failed: %s\n"), strerror(save_errno));
        } else if(nfound == 0) {
-           dbprintf(("%s: dgram_recv: timeout after %d second%s\n",
-                     debug_prefix_time(NULL),
-                     timeout,
-                     (timeout == 1) ? "" : "s"));
+           dbprintf(plural(_("dgram_recv: timeout after %d second\n"),
+                           _("dgram_recv: timeout after %d seconds\n"),
+                           timeout),
+                    timeout);
            nfound = 0;
        } else if (!FD_ISSET(sock, &ready)) {
            int i;
 
            for(i = 0; i < sock + 1; i++) {
                if(FD_ISSET(i, &ready)) {
-                   dbprintf(("%s: dgram_recv: got fd %d instead of %d\n",
-                             debug_prefix_time(NULL),
-                             i,
-                             sock));
+                   dbprintf(_("dgram_recv: got fd %d instead of %d\n"), i, sock);
                }
            }
            save_errno = EBADF;
@@ -310,9 +292,7 @@ dgram_recv(
                    (struct sockaddr *)fromaddr, &addrlen);
     if(size == -1) {
        save_errno = errno;
-       dbprintf(("%s: dgram_recv: recvfrom() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("dgram_recv: recvfrom() failed: %s\n"), strerror(save_errno));
        errno = save_errno;
        return -1;
     }
@@ -350,7 +330,7 @@ printf_arglist_function1(int dgram_cat, dgram_t *, dgram, const char *, fmt)
        return -1;
 
     arglist_start(argp, fmt);
-    len = vsnprintf(dgram->cur, (size_t)bufsize, fmt, argp);
+    len = g_vsnprintf(dgram->cur, (size_t)bufsize, fmt, argp);
     arglist_end(argp);
     if(len < 0) {
        return -1;
index eb5fbfd33b673d0c7035fd3a938d5cdddf548ba4..442fee845e4acb85a2e808ce65c5416c94838a05 100644 (file)
@@ -55,7 +55,7 @@ ssize_t       dgram_recv(dgram_t *dgram, int timeout,
                   struct sockaddr_storage *fromaddr);
 void   dgram_zero(dgram_t *dgram);
 int    dgram_cat(dgram_t *dgram, const char *fmt, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 void dgram_eatline(dgram_t *dgram);
 
 #endif /* ! DGRAM_H */
diff --git a/common-src/error.c b/common-src/error.c
deleted file mode 100644 (file)
index ade2e40..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: error.c,v 1.19 2006/05/25 01:47:11 johnfranks Exp $
- *
- * error handling common to Amanda programs
- */
-#include "amanda.h"
-#include "arglist.h"
-
-#define MAXFUNCS 8
-
-typedef void (*voidfunc)(void);
-static voidfunc onerr[MAXFUNCS] = 
-    { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
-
-int erroutput_type = ERR_INTERACTIVE;
-
-static char *pname = "unknown";
-
-static void output_error_message(char *msg);
-
-static void (*logerror)(char *) = NULL;
-
-void
-set_pname(
-    char *     p)
-{
-    pname = p;
-}
-
-char *
-get_pname(void)
-{
-    return pname;
-}
-
-void
-set_logerror(
-    void (*f)(char *))
-{
-    logerror = f;
-}
-
-
-static void
-output_error_message(
-    char *     msg)
-{
-    /* print and/or log message */
-
-    if((erroutput_type & ERR_AMANDALOG) != 0 && logerror != NULL) {
-       (*logerror)(msg);
-    }
-
-    if(erroutput_type & ERR_SYSLOG) {
-#ifdef LOG_AUTH
-       openlog(get_pname(), LOG_PID, LOG_AUTH);
-#else
-       openlog(get_pname(), LOG_PID, 0);
-#endif
-       syslog(LOG_NOTICE, "%s", msg);
-       closelog();
-    }
-
-    if(erroutput_type & ERR_INTERACTIVE) {
-       fprintf(stderr, "%s: %s\n", get_pname(), msg);
-       fflush(stderr);
-    }
-
-    if(dbfp() != NULL) {
-       dbprintf(("%s: %s\n", debug_prefix_time(NULL), msg));
-       dbclose();
-    }
-}
-
-
-/*
- * Prints an error message, calls the functions installed via onerror(),
- * then exits.
- */
-printf_arglist_function(void error, const char *, format)
-{
-    va_list argp;
-    int i;
-    char linebuf[STR_SIZE];
-
-
-    /* format and output the error message */
-
-    arglist_start(argp, format);
-    vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
-    arglist_end(argp);
-    output_error_message(linebuf);
-
-    /* traverse function list, calling in reverse order */
-
-    for(i=MAXFUNCS-1; i >= 0; i--) {
-       if(onerr[i] != NULL) (*onerr[i])();
-    }
-
-    /* terminate */
-    exit(1);
-}
-
-
-/*
- * Prints an error message, calls the functions installed via onerror(),
- * then calls abort() to drop core.
- */
-printf_arglist_function(void errordump, const char *, format)
-{
-    va_list argp;
-    int i;
-    char linebuf[STR_SIZE];
-
-    /* format error message */
-
-    arglist_start(argp, format);
-    vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
-    arglist_end(argp);
-    output_error_message(linebuf);
-
-    /* traverse function list, calling in reverse order */
-
-    for(i=MAXFUNCS-1; i >= 0; i--) {
-       if(onerr[i] != NULL) (*onerr[i])();
-    }
-
-    /* terminate and drop core */
-    abort();
-}
-
-
-/*
- * Register function to be called when error is called.  Up to MAXFUNCS
- * functions can be registered.  If there isn't room in the table, onerror
- * returns -1, otherwise it returns 0.
- *
- * The resemblance to atexit() is on purpose.  I wouldn't need onerror()
- * if everyone had atexit().  Bummer.
- */
-
-int
-onerror(
-    void       (*errf)(void))
-{
-    int i;
-
-    for(i=0; i < MAXFUNCS; i++)                /* find empty slot */
-       if(onerr[i] == NULL) {
-           onerr[i] = errf;
-           return 0;
-       }
-
-    return -1;                         /* full table */
-}
index 0959c721ebb47c58d9b8ce4ffc9e91dbeac99871..11bad8bf576575ef3d58c2b9e514328d4e71fd3a 100644 (file)
 #include "queue.h"
 #include "conffile.h"
 
-#define event_debug(i,x) do {                          \
-       if ((i) <= debug_event) {       \
-           dbprintf(x);                                \
-       }                                               \
+#define event_debug(i, ...) do {       \
+       if ((i) <= debug_event) {       \
+           dbprintf(__VA_ARGS__);      \
+       }                               \
 } while (0)
 
 /*
@@ -110,23 +110,23 @@ event_register(
 
     if ((type == EV_READFD) || (type == EV_WRITEFD)) {
        /* make sure we aren't given a high fd that will overflow a fd_set */
-       if (data >= FD_SETSIZE) {
-           error("event_register: Invalid file descriptor %lu", data);
+       if (data >= (int)FD_SETSIZE) {
+           error(_("event_register: Invalid file descriptor %lu"), data);
            /*NOTREACHED*/
        }
 #if !defined(__lint) /* Global checking knows that these are never called */
     } else if (type == EV_SIG) {
        /* make sure signals are within range */
        if (data >= NSIG) {
-           error("event_register: Invalid signal %lu", data);
+           error(_("event_register: Invalid signal %lu"), data);
            /*NOTREACHED*/
        }
        if (sigtable[data].handle != NULL) { 
-           error("event_register: signal %lu already registered", data);
+           error(_("event_register: signal %lu already registered"), data);
            /*NOTREACHED*/
        }
     } else if (type >= EV_DEAD) {
-       error("event_register: Invalid event type %d", type);
+       error(_("event_register: Invalid event type %d"), type);
        /*NOTREACHED*/
 #endif
     }
@@ -140,9 +140,8 @@ event_register(
     eventq_add(eventq, handle);
     eventq.qlength++;
 
-    event_debug(1, ("%s: event: register: %p->data=%lu, type=%s\n",
-                   debug_prefix_time(NULL), handle, handle->data,
-                   event_type2str(handle->type)));
+    event_debug(1, _("event: register: %p->data=%lu, type=%s\n"),
+                   handle, handle->data, event_type2str(handle->type));
     return (handle);
 }
 
@@ -158,9 +157,9 @@ event_release(
 
     assert(handle != NULL);
 
-    event_debug(1, ("%s: event: release (mark): %p data=%lu, type=%s\n",
-                   debug_prefix_time(NULL), handle, handle->data,
-                   event_type2str(handle->type)));
+    event_debug(1, _("event: release (mark): %p data=%lu, type=%s\n"),
+                   handle, handle->data,
+                   event_type2str(handle->type));
     assert(handle->type != EV_DEAD);
 
     /*
@@ -198,14 +197,12 @@ event_wakeup(
     event_handle_t *eh;
     int nwaken = 0;
 
-    event_debug(1, ("%s: event: wakeup: enter (%lu)\n",
-                   debug_prefix_time(NULL), id));
+    event_debug(1, _("event: wakeup: enter (%lu)\n"), id);
 
     for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) {
 
        if (eh->type == EV_WAIT && eh->data == id) {
-           event_debug(1, ("%s: event: wakeup: %p id=%lu\n",
-                           debug_prefix_time(NULL), eh, id));
+           event_debug(1, _("event: wakeup: %p id=%lu\n"), eh, id);
            fire(eh);
            nwaken++;
        }
@@ -258,9 +255,8 @@ event_loop_wait(
     int event_wait_fired = 0;
     int see_event;
 
-    event_debug(1, ("%s: event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n",
-                   debug_prefix_time(NULL),
-                   dontblock, eventq.qlength, wait_eh));
+    event_debug(1, _("event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n"),
+                   dontblock, eventq.qlength, wait_eh);
 
     /*
      * If we have no events, we have nothing to do
@@ -283,14 +279,12 @@ event_loop_wait(
 
     do {
        if (debug_event >= 1) {
-           event_debug(1, ("%s: event: loop: dontblock=%d, qlength=%d eh=%p\n",
-                           debug_prefix_time(NULL), dontblock, eventq.qlength,
-                           wait_eh));
+           event_debug(1, _("event: loop: dontblock=%d, qlength=%d eh=%p\n"),
+                           dontblock, eventq.qlength, wait_eh);
            for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) {
-               event_debug(1, ("%s: %p): %s data=%lu fn=%p arg=%p\n",
-                               debug_prefix_time(NULL), eh,
-                               event_type2str(eh->type), eh->data, eh->fn,
-                               eh->arg));
+               event_debug(1, _("%p): %s data=%lu fn=%p arg=%p\n"),
+                               eh, event_type2str(eh->type), eh->data, eh->fn,
+                               eh->arg);
            }
        }
        /*
@@ -427,12 +421,11 @@ event_loop_wait(
         * Let 'er rip
         */
        event_debug(1,
-                   ("%s: event: select: dontblock=%d, maxfd=%d, timeout=%ld\n",
-                    debug_prefix_time(NULL), dontblock, maxfd,
-                    tvptr != NULL ? timeout.tv_sec : -1));
+                   _("event: select: dontblock=%d, maxfd=%d, timeout=%ld\n"),
+                    dontblock, maxfd,
+                    tvptr != NULL ? timeout.tv_sec : -1);
        rc = select(maxfd + 1, &readfds, &writefds, &errfds, tvptr);
-       event_debug(1, ("%s: event: select returns %d\n",
-                       debug_prefix_time(NULL), rc));
+       event_debug(1, _("event: select returns %d\n"), rc);
 
        /*
         * Select errors can mean many things.  Interrupted events should
@@ -442,7 +435,7 @@ event_loop_wait(
        if (rc < 0) {
            if (errno != EINTR) {
                if (++ntries > 5) {
-                   error("select failed: %s", strerror(errno));
+                   error(_("select failed: %s"), strerror(errno));
                    /*NOTREACHED*/
                }
                continue;
@@ -623,5 +616,5 @@ event_type2str(
     for (i = 0; i < (size_t)(sizeof(event_types) / sizeof(event_types[0])); i++)
        if (type == event_types[i].type)
            return (event_types[i].name);
-    return ("BOGUS EVENT TYPE");
+    return (_("BOGUS EVENT TYPE"));
 }
index be64f8931e26733d712691ea881f641987ce9e44..402d899c8e1f0a418bc50d839b16f794e1423d94 100644 (file)
@@ -47,6 +47,7 @@ typedef struct event_handle event_handle_t;
  * of event we are registering.  This is hopefully wide enough that
  * callers can cast pointers to it and keep the value untruncated and
  * unique.
+ * FIXME: THIS IS NOT 64-BIT CLEAN!
  */
 typedef        unsigned long event_id_t;
 
index cadcf0a31499b47c240a68451a75d59f71422ce5..5446391ee804c9a7ef9d34cc2085957dc7cf375a 100644 (file)
 
 #include "amanda.h"
 #include "util.h"
+#include "timestamp.h"
+#include "arglist.h"
+#include "file.h"
 
 static int mk1dir(const char *, mode_t, uid_t, gid_t);
 static void areads_getbuf(const char *s, int l, int fd);
-
-uid_t client_uid = (uid_t) -1;
-gid_t client_gid = (gid_t) -1;
+static char *original_cwd = NULL;
 
 /* Make a directory (internal function).
-** If the directory already exists then we pretend we created it.
-** XXX - I'm not sure about the use of the chown() stuff.  On most systems
-**       it will do nothing - only root is permitted to change the owner
-**       of a file.
-*/
+ * If the directory already exists then we pretend we created it.
+ *
+ * The uid and gid are used only if we are running as root.
+ */
 static int
 mk1dir(
     const char *dir, /* directory to create */
     mode_t     mode,   /* mode for new directory */
-    uid_t      uid,    /* uid for new directory */
-    gid_t      gid)    /* gid for new directory */
+    uid_t      G_GNUC_UNUSED uid,      /* uid for new directory */
+    gid_t      G_GNUC_UNUSED gid)      /* gid for new directory */
 {
     int rc;    /* return code */
 
-    if((rc = mkdir(dir, mode)) == 0) {
-       if ((rc = chown(dir, uid, gid)) == 0) { /* mkdir() affected by the umask */
-           rc = chmod(dir, mode);
-       }
-    } else {                   /* maybe someone beat us to it */
+    rc = mkdir(dir, mode);
+    if(rc != 0) {      /* maybe someone beat us to it */
        int serrno;
 
        serrno = errno;
@@ -65,6 +62,15 @@ mk1dir(
        errno = serrno; /* pass back the real error */
     }
 
+    /* mkdir is affected by umask, so set the mode bits manually */
+    if (rc == 0) {
+       rc = chmod(dir, mode);
+    }
+
+    if (rc == 0 && geteuid() == 0) {
+       rc = chown(dir, uid, gid);
+    }
+
     return rc;
 }
 
@@ -161,9 +167,6 @@ rmpdir(
  *
  * void safe_cd (void)
  *
- * entry:      client_uid and client_gid set to CLIENT_LOGIN information
- * exit:       none
- *
  * Set a default umask of 0077.
  *
  * Create the Amada debug directory (if defined) and the Amanda temp
@@ -186,17 +189,17 @@ safe_cd(void)
 {
     int                        cd_ok = 0;
     struct stat                sbuf;
-    struct passwd      *pwent;
     char               *d;
-
-    if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
-       client_uid = pwent->pw_uid;
-       client_gid = pwent->pw_gid;
-       endpwent();
-    }
+    uid_t              client_uid = get_client_uid();
+    gid_t              client_gid = get_client_gid();
 
     (void) umask(0077);
 
+    /* stash away the current directory for later reference */
+    if (original_cwd == NULL) {
+       original_cwd = g_get_current_dir();
+    }
+
     if (client_uid != (uid_t) -1) {
 #if defined(AMANDA_DBGDIR)
        d = stralloc2(AMANDA_DBGDIR, "/.");
@@ -256,7 +259,7 @@ safe_fd(
 {
     int                        fd;
 
-    for(fd = 0; fd < FD_SETSIZE; fd++) {
+    for(fd = 0; fd < (int)FD_SETSIZE; fd++) {
        if (fd < 3) {
            /*
             * Open three file descriptors.  If one of the standard
@@ -269,7 +272,7 @@ safe_fd(
             */
            if (fcntl(fd, F_GETFD) == -1) {
                if (open("/dev/null", O_RDWR) == -1) {
-                  fprintf(stderr, "/dev/null is inaccessable: %s\n",
+                  g_fprintf(stderr, _("/dev/null is inaccessable: %s\n"),
                           strerror(errno));
                   exit(1);
                }
@@ -319,7 +322,7 @@ save_core(void)
         char suffix[2];
         char *old, *new;
 
-       ts = construct_datestamp((time_t *)&sbuf.st_mtime);
+       ts = get_datestamp_from_time(sbuf.st_mtime);
         suffix[0] = 'z';
         suffix[1] = '\0';
         old = vstralloc("core", ts, suffix, NULL);
@@ -346,11 +349,13 @@ save_core(void)
 /*
 ** Sanitise a file name.
 ** 
-** Convert all '/' characters to '_' so that we can use,
+** Convert all '/', ':', and '\' characters to '_' so that we can use,
 ** for example, disk names as part of file names.
 ** Notes: 
 **  - there is a many-to-one mapping between input and output
-**  - Only / and '\0' are disallowed in filenames by POSIX...
+**  - Only / and '\0' are disallowed in filenames by POSIX, but Windows
+**    disallows ':' and '\' as well.  Furthermore, we use ':' as a 
+**    delimiter at other points in Amanda.
 */
 char *
 sanitise_filename(
@@ -366,7 +371,7 @@ sanitise_filename(
     d = buf;
     s = inp;
     while((ch = *s++) != '\0') {
-       if(ch == '/') {
+       if((ch == '/') || (ch == ':') || (ch == '\\')) {
            ch = '_';   /* convert "bad" to "_" */
        }
        *d++ = (char)ch;
@@ -406,6 +411,17 @@ old_sanitise_filename(
     return buf;
 }
 
+void
+canonicalize_pathname(char *pathname, char *result_buf)
+{
+#ifdef __CYGWIN__
+    cygwin_conv_to_full_posix_path(pathname, result_buf);
+#else
+    strncpy(result_buf, pathname, PATH_MAX-1);
+    result_buf[PATH_MAX-1] = '\0';
+#endif
+}
+
 /*
  *=====================================================================
  * Get the next line of input from a stdio file.
@@ -623,8 +639,6 @@ debug_areads (
     size_t size;
     ssize_t r;
 
-    malloc_enter(dbmalloc_caller_loc(s, l));
-
     if(fd < 0) {
        errno = EBADF;
        return NULL;
@@ -657,7 +671,6 @@ debug_areads (
            if(r == 0) {
                errno = 0;              /* flag EOF instead of error */
            }
-           malloc_leave(dbmalloc_caller_loc(s, l));
            return NULL;
        }
        endptr[r] = '\0';               /* we always leave room for this */
@@ -670,10 +683,135 @@ debug_areads (
     memmove(buffer, nl, size);
     areads_buffer[fd].endptr = buffer + size;
     areads_buffer[fd].endptr[0] = '\0';
-    malloc_leave(dbmalloc_caller_loc(s, l));
     return line;
 }
 
+int robust_open(const char * pathname, int flags, mode_t mode) {
+    int result = -1;
+    int e_busy_count = 0;
+
+    for (;;) {
+        if (flags & O_CREAT) {
+            result = open(pathname, flags, mode);
+        } else {
+            result = open(pathname, flags);
+        }
+
+        if (result < 0) {
+#ifdef EBUSY
+            /* EBUSY is a tricky one; sometimes it is synonymous with
+               EINTR, but sometimes it means the device is open
+               elsewhere (e.g., with a tape drive on Linux). We take
+               the middle path and retry, but with limited
+               patience. */
+            if (errno == EBUSY && e_busy_count < 10) {
+                e_busy_count ++;
+                continue;
+            } else
+#endif
+            if (0
+                /* Always retry on EINTR; if the caller did
+                   not specify non-blocking mode, then also retry on
+                   EAGAIN or EWOULDBLOCK. */
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                || ( 1
+#ifdef O_NONBLOCK
+                  && !(flags & O_NONBLOCK)
+#endif
+                  && ( 0
+#ifdef EAGAIN
+                       || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                       || errno == EWOULDBLOCK
+#endif
+                       ) ) ) {
+                /* Try again */
+                continue;
+            } else {
+                /* Failure. */
+                return result;
+            }
+        } else {
+            break;
+        }
+    }
+
+#ifdef F_SETFD
+    if (result >= 0) {
+        fcntl(result, F_SETFD, 1); /* Throw away result. */
+    }
+#endif
+
+    return result;
+}
+
+int robust_close(int fd) {
+    for (;;) {
+        int result;
+
+        result = close(fd);
+        if (result != 0 && (0
+#ifdef EINTR
+                            || errno == EINTR
+#endif
+#ifdef EBUSY
+                            || errno == EBUSY
+#endif
+#ifdef EAGAIN
+                            || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                            || errno == EWOULDBLOCK
+#endif
+                            )) {
+            continue;
+        } else {
+            return result;
+        }
+    }
+}
+
+uid_t
+get_client_uid(void)
+{
+    static uid_t client_uid = (uid_t) -1;
+    struct passwd      *pwent;
+
+    if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
+       client_uid = pwent->pw_uid;
+       endpwent();
+    }
+
+    return client_uid;
+}
+
+gid_t
+get_client_gid(void)
+{
+    static gid_t client_gid = (gid_t) -1;
+    struct passwd      *pwent;
+
+    if(client_gid == (gid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
+       client_gid = pwent->pw_gid;
+       endpwent();
+    }
+
+    return client_gid;
+}
+
+char *
+get_original_cwd(void)
+{
+    if (original_cwd == NULL) {
+       original_cwd = g_get_current_dir();
+    }
+
+    return original_cwd;
+}
+
 #ifdef TEST
 
 int
@@ -688,6 +826,15 @@ main(
        char *file;
        char *line;
 
+       /*
+        * Configure program for internationalization:
+        *   1) Only set the message locale for now.
+        *   2) Set textdomain for all amanda related programs to "amanda"
+        *      We don't want to be forced to support dozens of message catalogs
+        */  
+       setlocale(LC_MESSAGES, "C");
+       textdomain("amanda"); 
+
        safe_fd(-1, 0);
 
        set_pname("file test");
@@ -710,25 +857,25 @@ main(
                name = argv[3];
        }
 
-       fprintf(stderr, "Create parent directories of %s ...", name);
+       g_fprintf(stderr, _("Create parent directories of %s ..."), name);
        rc = mkpdir(name, (mode_t)02777, (uid_t)-1, (gid_t)-1);
        if (rc == 0)
-               fprintf(stderr, " done\n");
+               g_fprintf(stderr, " done\n");
        else {
-               perror("failed");
+               perror(_("failed"));
                return rc;
        }
 
-       fprintf(stderr, "Delete %s back to %s ...", name, top);
+       g_fprintf(stderr, _("Delete %s back to %s ..."), name, top);
        rc = rmpdir(name, top);
        if (rc == 0)
-               fprintf(stderr, " done\n");
+               g_fprintf(stderr, _(" done\n"));
        else {
-               perror("failed");
+               perror(_("failed"));
                return rc;
        }
 
-       fprintf(stderr, "areads dump of %s ...", file);
+       g_fprintf(stderr, _("areads dump of %s ..."), file);
        if ((fd = open (file, 0)) < 0) {
                perror(file);
                return 1;
@@ -739,10 +886,11 @@ main(
                amfree(line);
        }
        aclose(fd);
-       fprintf(stderr, " done.\n");
+       g_fprintf(stderr, _(" done.\n"));
 
-       fprintf(stderr, "Finished.\n");
+       g_fprintf(stderr, _("Finished.\n"));
        return 0;
 }
 
 #endif
+
diff --git a/common-src/file.h b/common-src/file.h
new file mode 100644 (file)
index 0000000..98e6f2b
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1997-1998 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: AMANDA core development group.
+ */
+
+extern int    mkpdir(char *file, mode_t mode, uid_t uid, gid_t gid);
+extern int    rmpdir(char *file, char *topdir);
+
+/* Given a pathname, convert it to "canonical form" for this system.  Currently,
+ * this means nothing on POSIX, but means substituting /cygdrive, etc. on Cygwin.
+ *
+ * @param pathname: the pathname to canonicalize
+ * @param result_buf (output): the canonicalize pathname; this should be a buffer of
+ * at least PATH_MAX bytes.
+ */
+void canonicalize_pathname(char *pathname, char *result_buf);
+
+extern char  *sanitise_filename(char *inp);
+char  *old_sanitise_filename(char *inp);
+void    safe_fd(int fd_start, int fd_count);
+void   safe_cd(void);
+void   save_core(void);
+
+/* Get the uid of CLIENT_LOGIN, or -1 if it doesn't exist.  Note that, if
+ * only running a server, CLIENT_LOGIN may legitimately not exist.
+ *
+ * @returns: userid, or -1 if invalid
+ */
+uid_t get_client_uid(void);
+
+/* Get the gid of CLIENT_LOGIN, or -1 if it doesn't exist.  Note that, if
+ * only running a server, CLIENT_LOGIN may legitimately not exist.
+ *
+ * @returns: groupid, or -1 if invalid
+ */
+gid_t get_client_gid(void);
+
+extern /*@only@*/ /*@null@*/ char *debug_agets(const char *c, int l, FILE *file);
+extern /*@only@*/ /*@null@*/ char *debug_areads(const char *c, int l, int fd);
+#define agets(f)             debug_agets(__FILE__,__LINE__,(f))
+#define areads(f)            debug_areads(__FILE__,__LINE__,(f))
+
+ssize_t        areads_dataready(int fd);
+void   areads_relbuf(int fd);
+
+/*
+ * "Safe" close macros.  Close the object then set it to a value that
+ * will cause an error if referenced.
+ *
+ * aclose(fd) -- close a file descriptor and set it to -1.
+ * afclose(f) -- close a stdio file and set it to NULL.
+ * apclose(p) -- close a stdio pipe file and set it to NULL.
+ *
+ * Note: be careful not to do the following:
+ *
+ *  for(fd = low; fd < high; fd++) {
+ *      aclose(fd);
+ *  }
+ *
+ * Since aclose() sets the argument to -1, this will loop forever.
+ * Just copy fd to a temp variable and use that with aclose().
+ *
+ * Aclose() interacts with areads() to inform it to release any buffer
+ * it has outstanding on the file descriptor.
+ */
+
+#define aclose(fd) do {                                                        \
+    if((fd) >= 0) {                                                    \
+       close(fd);                                                      \
+       areads_relbuf(fd);                                              \
+    }                                                                  \
+    (fd) = -1;                                                         \
+} while(0)
+
+#define afclose(f) do {                                                        \
+    if((f) != NULL) {                                                  \
+       fclose(f);                                                      \
+    }                                                                  \
+    (f) = NULL;                                                                \
+} while(0)
+
+#define apclose(p) do {                                                        \
+    if((p) != NULL) {                                                  \
+       pclose(p);                                                      \
+    }                                                                  \
+    (p) = NULL;                                                                \
+} while(0)
+
+
+/* Calls system open(), but takes care of interrupted system calls and
+ * clears the close-on-exec bit. In the failure case, errno is
+ * retained from the final call to open(). */
+extern int robust_open(const char * pathname, int flags, mode_t mode);
+
+/* Same idea but for close. */
+extern int robust_close(int fd);
+
+/* Get the original working directory, at application startup
+ *
+ * @returns: pointer to statically allocated string
+ */
+char *get_original_cwd(void);
index 9d18d8cf1d30fc246f1880e1ea836c0f16a629db..ead4619c403222b1ce0b969e30356d1cd1dee38e 100644 (file)
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: fileheader.c,v 1.40 2006/07/01 00:10:38 paddy_s Exp $
+ * $Id: fileheader.c 6512 2007-05-24 17:00:24Z ian $
  */
 
 #include "amanda.h"
 #include "fileheader.h"
+#include <glib.h>
+#include "util.h"
 
 static const char *    filetype2str(filetype_t);
 static filetype_t      str2filetype(const char *);
 static void            strange_header(dumpfile_t *, const char *,
                                size_t, const char *, const char *);
+static char *          strquotedstr(void);
+static ssize_t                 hexdump(const char *buffer, size_t len);
 
 void
 fh_init(
@@ -56,10 +60,10 @@ strange_header(
     if (expected == NULL)
        expected = "<null>";
 
-    fprintf(stderr, "%s: strange amanda header: \"%.*s\"\n", get_pname(),
+    g_fprintf(stderr, _("%s: strange amanda header: \"%.*s\"\n"), get_pname(),
                (int)buflen, buffer);
 
-    fprintf(stderr, "%s: Expected: \"%s\"  Actual: \"%s\"\n", get_pname(),
+    g_fprintf(stderr, _("%s: Expected: \"%s\"  Actual: \"%s\"\n"), get_pname(),
                expected, actual);
 
     file->type = F_WEIRD;
@@ -104,12 +108,11 @@ parse_file_header(
 
     tok = strtok(line1, " ");
     if (tok == NULL) {
-        fprintf(stderr, "%s: Empty amanda header: buflen=" SIZE_T_FMT
-           " lsize=" SIZE_T_FMT "\n", get_pname(),
-           (SIZE_T_FMT_TYPE)buflen, 
-           (SIZE_T_FMT_TYPE)lsize);
+        g_fprintf(stderr, _("%s: Empty amanda header: buflen=%zu lsize=%zu\n"), get_pname(),
+           buflen, 
+           lsize);
        hexdump(buffer, lsize);
-       strange_header(file, buffer, buflen, "<Non-empty line>", tok);
+       strange_header(file, buffer, buflen, _("<Non-empty line>"), tok);
        goto out;
     }
 
@@ -122,7 +125,7 @@ parse_file_header(
 
     tok = strtok(NULL, " ");
     if (tok == NULL) {
-       strange_header(file, buffer, buflen, "<file type>", tok);
+       strange_header(file, buffer, buflen, _("<file type>"), tok);
        goto out;
     }
     file->type = str2filetype(tok);
@@ -137,7 +140,7 @@ parse_file_header(
 
        tok = strtok(NULL, " ");
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<date stamp>", tok);
+           strange_header(file, buffer, buflen, _("<date stamp>"), tok);
            goto out;
        }
        strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1);
@@ -150,7 +153,7 @@ parse_file_header(
 
        tok = strtok(NULL, " ");
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<file type>", tok);
+           strange_header(file, buffer, buflen, _("<file type>"), tok);
            goto out;
        }
        strncpy(file->name, tok, SIZEOF(file->name) - 1);
@@ -161,21 +164,21 @@ parse_file_header(
     case F_SPLIT_DUMPFILE:
        tok = strtok(NULL, " ");
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<date stamp>", tok);
+           strange_header(file, buffer, buflen, _("<date stamp>"), tok);
            goto out;
        }
        strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1);
 
        tok = strtok(NULL, " ");
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<file name>", tok);
+           strange_header(file, buffer, buflen, _("<file name>"), tok);
            goto out;
        }
        strncpy(file->name, tok, SIZEOF(file->name) - 1);
 
        tok = strquotedstr();
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<disk name>", tok);
+           strange_header(file, buffer, buflen, _("<disk name>"), tok);
            goto out;
        }
        uqname = unquote_string(tok);
@@ -191,7 +194,7 @@ parse_file_header(
 
            tok = strtok(NULL, "/");
            if ((tok == NULL) || (sscanf(tok, "%d", &file->partnum) != 1)) {
-               strange_header(file, buffer, buflen, "<part num param>", tok);
+               strange_header(file, buffer, buflen, _("<part num param>"), tok);
                goto out;
            }
 
@@ -200,7 +203,7 @@ parse_file_header(
                many parts there are. */
            tok = strtok(NULL, " ");
             if((tok == NULL) || (sscanf(tok, "%d", &file->totalparts) != 1)) {
-               strange_header(file, buffer, buflen, "<total parts param>", tok);
+               strange_header(file, buffer, buflen, _("<total parts param>"), tok);
                goto out;
            }
        }
@@ -213,7 +216,7 @@ parse_file_header(
 
        tok = strtok(NULL, " ");
        if ((tok == NULL) || (sscanf(tok, "%d", &file->dumplevel) != 1)) {
-           strange_header(file, buffer, buflen, "<dump level param>", tok);
+           strange_header(file, buffer, buflen, _("<dump level param>"), tok);
            goto out;
        }
 
@@ -225,7 +228,7 @@ parse_file_header(
 
        tok = strtok(NULL, " ");
        if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<comp param>", tok);
+           strange_header(file, buffer, buflen, _("<comp param>"), tok);
            goto out;
        }
        strncpy(file->comp_suffix, tok, SIZEOF(file->comp_suffix) - 1);
@@ -245,7 +248,7 @@ parse_file_header(
 
         tok = strtok(NULL, " ");
         if (tok == NULL) {
-           strange_header(file, buffer, buflen, "<program name>", tok);
+           strange_header(file, buffer, buflen, _("<program name>"), tok);
            goto out;
        }
         strncpy(file->program, tok, SIZEOF(file->program) - 1);
@@ -259,7 +262,7 @@ parse_file_header(
        if (BSTRNCMP(tok, "crypt") == 0) {
            tok = strtok(NULL, " ");
            if (tok == NULL) {
-               strange_header(file, buffer, buflen, "<crypt param>", tok);
+               strange_header(file, buffer, buflen, _("<crypt param>"), tok);
                goto out;
            }
            strncpy(file->encrypt_suffix, tok,
@@ -274,7 +277,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<server custom compress param>", tok);
+                               _("<server custom compress param>"), tok);
                goto out;
            }
            strncpy(file->srvcompprog, tok, SIZEOF(file->srvcompprog) - 1);
@@ -287,7 +290,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<client custom compress param>", tok);
+                               _("<client custom compress param>"), tok);
                goto out;
            }
            strncpy(file->clntcompprog, tok, SIZEOF(file->clntcompprog) - 1);
@@ -300,7 +303,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<server encrypt param>", tok);
+                               _("<server encrypt param>"), tok);
                goto out;
            }
            strncpy(file->srv_encrypt, tok, SIZEOF(file->srv_encrypt) - 1);
@@ -313,7 +316,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<client encrypt param>", tok);
+                               _("<client encrypt param>"), tok);
                goto out;
            }
            strncpy(file->clnt_encrypt, tok, SIZEOF(file->clnt_encrypt) - 1);
@@ -326,7 +329,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<server decrypt param>", tok);
+                               _("<server decrypt param>"), tok);
                goto out;
            }
            strncpy(file->srv_decrypt_opt, tok,
@@ -340,7 +343,7 @@ parse_file_header(
            tok = strtok(NULL, " ");
            if (tok == NULL) {
                strange_header(file, buffer, buflen,
-                               "<client decrypt param>", tok);
+                               _("<client decrypt param>"), tok);
                goto out;
            }
            strncpy(file->clnt_decrypt_opt, tok,
@@ -362,7 +365,7 @@ parse_file_header(
                else
                    strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1);
            } else {
-               strange_header(file, buffer, buflen, "<DATE>", tok);
+               strange_header(file, buffer, buflen, _("<DATE>"), tok);
           }
        } else {
            file->datestamp[0] = '\0';
@@ -371,7 +374,7 @@ parse_file_header(
 
     default:
        strange_header(file, buffer, buflen,
-               "TAPESTART|DUMPFILE|CONT_DUMPFILE|SPLIT_DUMPFILE|TAPEEND", tok);
+               _("TAPESTART|DUMPFILE|CONT_DUMPFILE|SPLIT_DUMPFILE|TAPEEND"), tok);
        goto out;
     }
 
@@ -403,7 +406,7 @@ parse_file_header(
        }
 #undef SC
 
-#define SC "To restore, position tape at start of file and run:"
+#define SC _("To restore, position tape at start of file and run:")
        if (strncmp(line, SC, SIZEOF(SC) - 1) == 0)
            continue;
 #undef SC
@@ -442,15 +445,15 @@ parse_file_header(
                strncpy(file->recover_cmd, cmd1,
                        SIZEOF(file->recover_cmd) - 1);
              } else {
-               snprintf(file->uncompress_cmd,
+               g_snprintf(file->uncompress_cmd,
                         SIZEOF(file->uncompress_cmd), "%s|", cmd1);
                strncpy(file->recover_cmd, cmd2,
                        SIZEOF(file->recover_cmd) - 1);
              }
            } else {    /* cmd3 presents:  decrypt | uncompress | recover */
-             snprintf(file->decrypt_cmd,
+             g_snprintf(file->decrypt_cmd,
                       SIZEOF(file->decrypt_cmd), "%s|", cmd1);
-             snprintf(file->uncompress_cmd,
+             g_snprintf(file->uncompress_cmd,
                       SIZEOF(file->uncompress_cmd), "%s|", cmd2);
              strncpy(file->recover_cmd, cmd3,
                      SIZEOF(file->recover_cmd) - 1);
@@ -470,51 +473,34 @@ void
 dump_dumpfile_t(
     const dumpfile_t *file)
 {
-       const char *pname = get_pname();
-
-       dbprintf(("%s: Contents of *(dumpfile_t *)%p:\n", pname, file));
-       dbprintf(("%s:     type             = %d (%s)\n", pname,
-                       file->type, filetype2str(file->type)));
-       dbprintf(("%s:     datestamp        = '%s'\n", pname,
-                       file->datestamp));
-       dbprintf(("%s:     dumplevel        = %d\n", pname, file->dumplevel));
-       dbprintf(("%s:     compressed       = %d\n", pname, file->compressed));
-       dbprintf(("%s:     encrypted        = %d\n", pname, file->encrypted));
-       dbprintf(("%s:     comp_suffix      = '%s'\n", pname,
-                       file->comp_suffix));
-       dbprintf(("%s:     encrypt_suffix   = '%s'\n", pname,
-                       file->encrypt_suffix));
-       dbprintf(("%s:     name             = '%s'\n", pname, file->name));
-       dbprintf(("%s:     disk             = '%s'\n", pname, file->disk));
-       dbprintf(("%s:     program          = '%s'\n", pname, file->program));
-       dbprintf(("%s:     dumper           = '%s'\n", pname, file->dumper));
-       dbprintf(("%s:     srvcompprog      = '%s'\n", pname,
-                       file->srvcompprog));
-       dbprintf(("%s:     clntcompprog     = '%s'\n", pname,
-                       file->clntcompprog));
-       dbprintf(("%s:     srv_encrypt      = '%s'\n", pname,
-                       file->srv_encrypt));
-       dbprintf(("%s:     clnt_encrypt     = '%s'\n", pname,
-                       file->clnt_encrypt));
-       dbprintf(("%s:     recover_cmd      = '%s'\n", pname,
-                       file->recover_cmd));
-       dbprintf(("%s:     uncompress_cmd   = '%s'\n", pname,
-                       file->uncompress_cmd));
-       dbprintf(("%s:     encrypt_cmd      = '%s'\n", pname,
-                       file->encrypt_cmd));
-       dbprintf(("%s:     decrypt_cmd      = '%s'\n", pname,
-                       file->decrypt_cmd));
-       dbprintf(("%s:     srv_decrypt_opt  = '%s'\n", pname,
-                       file->srv_decrypt_opt));
-       dbprintf(("%s:     clnt_decrypt_opt = '%s'\n", pname,
-                       file->clnt_decrypt_opt));
-       dbprintf(("%s:     cont_filename    = '%s'\n", pname,
-                       file->cont_filename));
-       dbprintf(("%s:     is_partial       = %d\n", pname, file->is_partial));
-       dbprintf(("%s:     partnum          = %d\n", pname, file->partnum));
-       dbprintf(("%s:     totalparts       = %d\n", pname, file->totalparts));
-       dbprintf(("%s:     blocksize        = " SIZE_T_FMT "\n", pname,
-                       (SIZE_T_FMT_TYPE)file->blocksize));
+       dbprintf(_("Contents of *(dumpfile_t *)%p:\n"), file);
+       dbprintf(_("    type             = %d (%s)\n"),
+                       file->type, filetype2str(file->type));
+       dbprintf(_("    datestamp        = '%s'\n"), file->datestamp);
+       dbprintf(_("    dumplevel        = %d\n"), file->dumplevel);
+       dbprintf(_("    compressed       = %d\n"), file->compressed);
+       dbprintf(_("    encrypted        = %d\n"), file->encrypted);
+       dbprintf(_("    comp_suffix      = '%s'\n"), file->comp_suffix);
+       dbprintf(_("    encrypt_suffix   = '%s'\n"), file->encrypt_suffix);
+       dbprintf(_("    name             = '%s'\n"), file->name);
+       dbprintf(_("    disk             = '%s'\n"), file->disk);
+       dbprintf(_("    program          = '%s'\n"), file->program);
+       dbprintf(_("    dumper           = '%s'\n"), file->dumper);
+       dbprintf(_("    srvcompprog      = '%s'\n"), file->srvcompprog);
+       dbprintf(_("    clntcompprog     = '%s'\n"), file->clntcompprog);
+       dbprintf(_("    srv_encrypt      = '%s'\n"), file->srv_encrypt);
+       dbprintf(_("    clnt_encrypt     = '%s'\n"), file->clnt_encrypt);
+       dbprintf(_("    recover_cmd      = '%s'\n"), file->recover_cmd);
+       dbprintf(_("    uncompress_cmd   = '%s'\n"), file->uncompress_cmd);
+       dbprintf(_("    encrypt_cmd      = '%s'\n"), file->encrypt_cmd);
+       dbprintf(_("    decrypt_cmd      = '%s'\n"), file->decrypt_cmd);
+       dbprintf(_("    srv_decrypt_opt  = '%s'\n"), file->srv_decrypt_opt);
+       dbprintf(_("    clnt_decrypt_opt = '%s'\n"), file->clnt_decrypt_opt);
+       dbprintf(_("    cont_filename    = '%s'\n"), file->cont_filename);
+       dbprintf(_("    is_partial       = %d\n"), file->is_partial);
+       dbprintf(_("    partnum          = %d\n"), file->partnum);
+       dbprintf(_("    totalparts       = %d\n"), file->totalparts);
+       dbprintf(_("    blocksize        = %zu\n"), file->blocksize);
 }
 
 static void
@@ -522,7 +508,7 @@ validate_name(
     const char *name)
 {
        if (strlen(name) == 0) {
-           error("Invalid name '%s'\n", name);
+           error(_("Invalid name '%s'\n"), name);
            /*NOTREACHED*/
        }
 }
@@ -541,7 +527,7 @@ validate_datestamp(
        if ((strlen(datestamp) == 14) && match("^[0-9]{14}$", datestamp)) {
            return;
        }
-       error("Invalid datestamp '%s'\n", datestamp);
+       error(_("Invalid datestamp '%s'\n"), datestamp);
        /*NOTREACHED*/
 }
 
@@ -551,159 +537,144 @@ validate_parts(
     const int totalparts)
 {
        if (partnum < 1) {
-           error("Invalid partnum (%d)\n", partnum);
+           error(_("Invalid partnum (%d)\n"), partnum);
            /*NOTREACHED*/
        }
 
        if (partnum > totalparts && totalparts >= 0) {
-           error("Invalid partnum (%d) > totalparts (%d)\n",
+           error(_("Invalid partnum (%d) > totalparts (%d)\n"),
                        partnum, totalparts);
            /*NOTREACHED*/
        }
 }
 
-void
-build_header(
-    char *             buffer,
-    const dumpfile_t * file,
-    size_t             buflen)
+char *
+build_header(const dumpfile_t * file, size_t size)
 {
-    int n;
+    GString *rval, *split_data;
     char *qname;
-    char split_data[128] = "";
+    char *program;
 
-    dbprintf(("%s: Building type %d (%s) header of size " SIZE_T_FMT " using:\n",
-               get_pname(), file->type, filetype2str(file->type),
-               (SIZE_T_FMT_TYPE)buflen));
+    dbprintf(_("Building type %d (%s) header of size %zu using:\n"),
+               file->type, filetype2str(file->type), size);
     dump_dumpfile_t(file);
 
-    memset(buffer,'\0',buflen);
-
+    rval = g_string_sized_new(size);
+    split_data = g_string_sized_new(10);
+    
     switch (file->type) {
     case F_TAPESTART:
        validate_name(file->name);
        validate_datestamp(file->datestamp);
-       snprintf(buffer, buflen,
-           "AMANDA: TAPESTART DATE %s TAPE %s\n014\n",
-           file->datestamp, file->name);
+        g_string_printf(rval, 
+                        "AMANDA: TAPESTART DATE %s TAPE %s\n014\n",
+                        file->datestamp, file->name);
        break;
-
+        
     case F_SPLIT_DUMPFILE:
        validate_parts(file->partnum, file->totalparts);
-       snprintf(split_data, SIZEOF(split_data),
-                " part %d/%d ", file->partnum, file->totalparts);
-       /*FALLTHROUGH*/
+        g_string_printf(split_data,
+                        " part %d/%d ", file->partnum, file->totalparts);
+        /* FALLTHROUGH */
        
+
     case F_CONT_DUMPFILE:
     case F_DUMPFILE :
        validate_name(file->name);
        validate_datestamp(file->datestamp);
        qname = quote_string(file->disk);
-        n = snprintf(buffer, buflen,
-                     "AMANDA: %s %s %s %s %s lev %d comp %s program %s",
-                        filetype2str(file->type),
-                        file->datestamp, file->name, qname,
-                        split_data,
-                        file->dumplevel, file->comp_suffix, file->program); 
+       program = stralloc(file->program);
+       if (match("^.*[.][Ee][Xx][Ee]$", program)) {
+               /* Trim ".exe" from program name */
+               program[strlen(program) - strlen(".exe")] = '\0';
+       }
+        g_string_printf(rval, 
+                        "AMANDA: %s %s %s %s %s lev %d comp %s program %s",
+                        filetype2str(file->type),
+                        file->datestamp, file->name, qname,
+                        split_data->str,
+                        file->dumplevel, file->comp_suffix, program); 
+       amfree(program);
        amfree(qname);
-       if ( n ) {
-         buffer += n;
-         buflen -= n;
-         n = 0;
-       }
 
-       if (strcmp(file->encrypt_suffix, "enc") == 0) {  /* only output crypt if it's enabled */
-         n = snprintf(buffer, buflen, " crypt %s", file->encrypt_suffix);
-       }
-       if ( n ) {
-         buffer += n;
-         buflen -= n;
-         n = 0;
+        /* only output crypt if it's enabled */
+       if (strcmp(file->encrypt_suffix, "enc") == 0) {
+            g_string_append_printf(rval, " crypt %s", file->encrypt_suffix);
        }
 
        if (*file->srvcompprog) {
-           n = snprintf(buffer, buflen, " server_custom_compress %s", file->srvcompprog);
+            g_string_append_printf(rval, " server_custom_compress %s", 
+                                   file->srvcompprog);
        } else if (*file->clntcompprog) {
-           n = snprintf(buffer, buflen, " client_custom_compress %s", file->clntcompprog);
+            g_string_append_printf(rval, " client_custom_compress %s",
+                                   file->clntcompprog);
        } 
-
-       if ( n ) {
-         buffer += n;
-         buflen -= n;
-         n = 0;
-       }
-
+        
        if (*file->srv_encrypt) {
-           n = snprintf(buffer, buflen, " server_encrypt %s", file->srv_encrypt);
+            g_string_append_printf(rval, " server_encrypt %s",
+                                   file->srv_encrypt);
        } else if (*file->clnt_encrypt) {
-           n = snprintf(buffer, buflen, " client_encrypt %s", file->clnt_encrypt);
+            g_string_append_printf(rval, " client_encrypt %s",
+                                   file->clnt_encrypt);
        } 
-
-       if ( n ) {
-         buffer += n;
-         buflen -= n;
-         n = 0;
-       }
-       
+        
        if (*file->srv_decrypt_opt) {
-           n = snprintf(buffer, buflen, " server_decrypt_option %s", file->srv_decrypt_opt);
-       } else if (*file->clnt_decrypt_opt) {
-           n = snprintf(buffer, buflen, " client_decrypt_option %s", file->clnt_decrypt_opt);
+            g_string_append_printf(rval, " server_decrypt_option %s",
+                                   file->srv_decrypt_opt);
+        } else if (*file->clnt_decrypt_opt) {
+            g_string_append_printf(rval, " client_decrypt_option %s",
+                                   file->clnt_decrypt_opt);
        } 
-
-       if ( n ) {
-         buffer += n;
-         buflen -= n;
-         n = 0;
-       }
-
-       n = snprintf(buffer, buflen, "\n");
-       buffer += n;
-       buflen -= n;
-
+        
+        g_string_append_printf(rval, "\n");
+        
        if (file->cont_filename[0] != '\0') {
-           n = snprintf(buffer, buflen, "CONT_FILENAME=%s\n",
-               file->cont_filename);
-           buffer += n;
-           buflen -= n;
+            g_string_append_printf(rval, "CONT_FILENAME=%s\n",
+                                   file->cont_filename);
        }
        if (file->dumper[0] != '\0') {
-           n = snprintf(buffer, buflen, "DUMPER=%s\n", file->dumper);
-           buffer += n;
-           buflen -= n;
+            g_string_append_printf(rval, "DUMPER=%s\n", file->dumper);
        }
        if (file->is_partial != 0) {
-           n = snprintf(buffer, buflen, "PARTIAL=YES\n");
-           buffer += n;
-           buflen -= n;
+            g_string_append_printf(rval, "PARTIAL=YES\n");
        }
-
-       n = snprintf(buffer, buflen, 
-           "To restore, position tape at start of file and run:\n");
-       buffer += n;
-       buflen -= n;
+        
+        g_string_append_printf(rval,
+           _("To restore, position tape at start of file and run:\n"));
 
        /* \014 == ^L == form feed */
-       n = snprintf(buffer, buflen,
-           "\tdd if=<tape> bs=" SIZE_T_FMT "k skip=1 | %s %s %s\n\014\n",
-           (SIZE_T_FMT_TYPE)file->blocksize / 1024, file->decrypt_cmd,
-           file->uncompress_cmd, file->recover_cmd);
+        g_string_append_printf(rval,
+                               "\tdd if=<tape> bs=%zuk skip=1 |%s %s %s\n\014\n",
+                               file->blocksize / 1024,
+                               file->decrypt_cmd, file->uncompress_cmd,
+                               file->recover_cmd);
        break;
 
     case F_TAPEEND:
        validate_datestamp(file->datestamp);
-       snprintf(buffer, buflen, "AMANDA: TAPEEND DATE %s\n\014\n",
-           file->datestamp);
+        g_string_printf(rval, "AMANDA: TAPEEND DATE %s\n\014\n",
+                        file->datestamp);
        break;
 
     case F_UNKNOWN:
     case F_EMPTY:
     case F_WEIRD:
     default:
-       error("Invalid header type: %d (%s)",
+       error(_("Invalid header type: %d (%s)"),
                file->type, filetype2str(file->type));
        /*NOTREACHED*/
     }
+    
+    g_string_free(split_data, TRUE);
+
+    /* Since we don't return the length, it is an error for the header to be
+     * more than 'size' bytes */
+    assert(rval->len <= size);
+    /* Clear extra bytes. */
+    if (rval->len < size) {
+        bzero(rval->str + rval->len, rval->allocated_len - rval->len);
+    }
+    return g_string_free(rval, FALSE);
 }
 
 /*
@@ -719,79 +690,79 @@ print_header(
 
     switch(file->type) {
     case F_EMPTY:
-       fprintf(outf, "EMPTY file\n");
+       g_fprintf(outf, _("EMPTY file\n"));
        break;
 
     case F_UNKNOWN:
-       fprintf(outf, "UNKNOWN file\n");
+       g_fprintf(outf, _("UNKNOWN file\n"));
        break;
 
     case F_WEIRD:
-       fprintf(outf, "WEIRD file\n");
+       g_fprintf(outf, _("WEIRD file\n"));
        break;
 
     case F_TAPESTART:
-       fprintf(outf, "start of tape: date %s label %s\n",
+       g_fprintf(outf, _("start of tape: date %s label %s\n"),
               file->datestamp, file->name);
        break;
 
     case F_DUMPFILE:
     case F_CONT_DUMPFILE:
        qdisk = quote_string(file->disk);
-       fprintf(outf, "%s: date %s host %s disk %s lev %d comp %s",
+       g_fprintf(outf, "%s: date %s host %s disk %s lev %d comp %s",
            filetype2str(file->type), file->datestamp, file->name,
            qdisk, file->dumplevel, file->comp_suffix);
        if (*file->program)
-           fprintf(outf, " program %s",file->program);
+           g_fprintf(outf, " program %s", file->program);
        if (strcmp(file->encrypt_suffix, "enc") == 0)
-           fprintf(outf, " crypt %s", file->encrypt_suffix);
+           g_fprintf(outf, " crypt %s", file->encrypt_suffix);
        if (*file->srvcompprog)
-           fprintf(outf, " server_custom_compress %s", file->srvcompprog);
+           g_fprintf(outf, " server_custom_compress %s", file->srvcompprog);
        if (*file->clntcompprog)
-           fprintf(outf, " client_custom_compress %s", file->clntcompprog);
+           g_fprintf(outf, " client_custom_compress %s", file->clntcompprog);
        if (*file->srv_encrypt)
-           fprintf(outf, " server_encrypt %s", file->srv_encrypt);
+           g_fprintf(outf, " server_encrypt %s", file->srv_encrypt);
        if (*file->clnt_encrypt)
-           fprintf(outf, " client_encrypt %s", file->clnt_encrypt);
+           g_fprintf(outf, " client_encrypt %s", file->clnt_encrypt);
        if (*file->srv_decrypt_opt)
-           fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt);
+           g_fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt);
        if (*file->clnt_decrypt_opt)
-           fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt);
-       fprintf(outf, "\n");
+           g_fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt);
+       g_fprintf(outf, "\n");
        amfree(qdisk);
        break;
 
     case F_SPLIT_DUMPFILE:
         if(file->totalparts > 0){
-            snprintf(number, SIZEOF(number), "%d", file->totalparts);
+            g_snprintf(number, SIZEOF(number), "%d", file->totalparts);
         }   
-        else snprintf(number, SIZEOF(number), "UNKNOWN");
+        else g_snprintf(number, SIZEOF(number), "UNKNOWN");
        qdisk = quote_string(file->disk);
-        fprintf(outf, "split dumpfile: date %s host %s disk %s part %d/%s lev %d comp %s",
+        g_fprintf(outf, "split dumpfile: date %s host %s disk %s part %d/%s lev %d comp %s",
                       file->datestamp, file->name, qdisk, file->partnum,
                       number, file->dumplevel, file->comp_suffix);
         if (*file->program)
-            fprintf(outf, " program %s",file->program);
+            g_fprintf(outf, " program %s",file->program);
        if (strcmp(file->encrypt_suffix, "enc") == 0)
-           fprintf(outf, " crypt %s", file->encrypt_suffix);
+           g_fprintf(outf, " crypt %s", file->encrypt_suffix);
        if (*file->srvcompprog)
-           fprintf(outf, " server_custom_compress %s", file->srvcompprog);
+           g_fprintf(outf, " server_custom_compress %s", file->srvcompprog);
        if (*file->clntcompprog)
-           fprintf(outf, " client_custom_compress %s", file->clntcompprog);
+           g_fprintf(outf, " client_custom_compress %s", file->clntcompprog);
        if (*file->srv_encrypt)
-           fprintf(outf, " server_encrypt %s", file->srv_encrypt);
+           g_fprintf(outf, " server_encrypt %s", file->srv_encrypt);
        if (*file->clnt_encrypt)
-           fprintf(outf, " client_encrypt %s", file->clnt_encrypt);
+           g_fprintf(outf, " client_encrypt %s", file->clnt_encrypt);
        if (*file->srv_decrypt_opt)
-           fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt);
+           g_fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt);
        if (*file->clnt_decrypt_opt)
-           fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt);
-        fprintf(outf, "\n");
+           g_fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt);
+        g_fprintf(outf, "\n");
        amfree(qdisk);
         break;
 
     case F_TAPEEND:
-       fprintf(outf, "end of tape: date %s\n", file->datestamp);
+       g_fprintf(outf, "end of tape: date %s\n", file->datestamp);
        break;
     }
 }
@@ -848,3 +819,63 @@ str2filetype(
            return (filetypetab[i].type);
     return (F_UNKNOWN);
 }
+
+gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b) {
+    if (a == NULL && b == NULL)
+        return TRUE;
+
+    if (a == NULL || b == NULL)
+        return FALSE;
+
+    return 0 == memcmp(a, b, sizeof(*a));
+}
+
+dumpfile_t * dumpfile_copy(dumpfile_t* source) {
+    gpointer rval = malloc(sizeof(dumpfile_t));
+    memcpy(rval, source, sizeof(dumpfile_t));
+    return rval;
+}
+
+/*
+ * This function modify strtok context.
+ */
+static char *
+strquotedstr(void)
+{
+    char *  tok = strtok(NULL, " ");
+    size_t     len;
+
+    len = strlen(tok);
+    if ((tok != NULL) && (tok[0] == '"') &&
+       (len > 1 && (tok[len - 1] != '"') && (tok[len - 2] != '\\'))) {
+       char *  t;
+
+       do {
+           t = strtok(NULL, " ");
+           tok[len] = ' ';
+           len = strlen(tok);
+       } while ((t != NULL) &&
+                (tok[len - 1] != '"') && (tok[len - 2] != '\\'));
+    }
+    return tok;
+}
+
+static ssize_t
+hexdump(
+    const char *buffer,
+    size_t     len)
+{
+    ssize_t rc = -1;
+
+    FILE *stream = popen("od -c -x -", "w");
+       
+    if (stream != NULL) {
+       fflush(stdout);
+       rc = (ssize_t)fwrite(buffer, len, 1, stream);
+       if (ferror(stream))
+           rc = -1;
+       pclose(stream);
+    }
+    return rc;
+}
+
index ea7bda5eeca33de70c3de12f08b06695922e7cce..f54fae5451e8bb5f5623771d0fb131bc6a8ac9e9 100644 (file)
 #ifndef FILEHEADER_H
 #define FILEHEADER_H
 
-#include "amanda.h"
-#include "util.h"              /* for bstrncmp() */
+#include <glib.h>
+#include <stdio.h>
 
 #define STRMAX         256
 
 typedef char string_t[STRMAX];
 typedef enum {
-    F_UNKNOWN, F_WEIRD, F_TAPESTART, F_TAPEEND
-    F_DUMPFILE, F_CONT_DUMPFILE, F_SPLIT_DUMPFILE, F_EMPTY
+    F_UNKNOWN = 0, F_WEIRD = -1, F_TAPESTART = 1, F_TAPEEND = 2
+    F_DUMPFILE = 3, F_CONT_DUMPFILE = 4, F_SPLIT_DUMPFILE = 5, F_EMPTY = -2
 } filetype_t;
 
 typedef struct file_s {
@@ -73,11 +73,23 @@ typedef struct file_s {
 
 /* local functions */
 
+/* Makes a serialized header from the dumpfile_t representation. The
+ * return value is allocated using malloc(), so you must free it.
+ *
+ * Build_header guarantees that the buffer returned is exactly
+ * 'size' bytes, with any extra bytes zeroed out. */
+char *  build_header        (const dumpfile_t *file, size_t size);
+
 void   fh_init(dumpfile_t *file);
 void   parse_file_header(const char *buffer, dumpfile_t *file, size_t buflen);
-void   build_header(char *buffer, const dumpfile_t *file, size_t buflen);
 void   print_header(FILE *outf, const dumpfile_t *file);
 int    known_compress_type(const dumpfile_t *file);
 void   dump_dumpfile_t(const dumpfile_t *file);
 
+/* Returns TRUE if the two headers are equal, FALSE otherwise. */
+gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b);
+
+/* Returns an allocated duplicate header. */
+dumpfile_t * dumpfile_copy(dumpfile_t* from);
+
 #endif /* !FILEHEADER_H */
index 21243b96fcb9c6d14f71aaff728f6fc98a888a5a..1b4f7f5b58aff57f5a983f817847826b0807c483 100644 (file)
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: genversion.c,v 1.36 2006/07/13 03:22:20 paddy_s Exp $
+ * $Id: genversion.c 698 2008-01-11 00:42:49Z martinea $
  *
  * dump the current Amanda version info
  */
 #include "amanda.h"
 #include "version.h"
+
+/* distribution-time information */
+#include "svn-info.h"
+
+/* build-time information */
 #include "genversion.h"
 
 #define        LMARGIN         6
@@ -37,8 +42,8 @@
 
 static size_t linelen;
 
-#define        startline(title)        printf("  \"%-*s", LMARGIN, title); linelen = 0
-#define        endline()               printf("\\n\",\n")
+#define        startline(title)  g_printf("  \"%-*s", LMARGIN, title); linelen = 0
+#define        endline()         g_printf("\\n\",\n")
 
 static void prstr(const char *);
 static void prvar(const char *, const char *);
@@ -62,7 +67,7 @@ prstr(
        endline();
        startline("");
     }
-    printf(" %s", string);
+    g_printf(" %s", string);
     linelen += len;
 }
 
@@ -87,12 +92,12 @@ prvar(
        buf_len = new_len;
        buf = malloc(new_len);
        if (!buf) {
-           fprintf(stderr, "genversion: Not enough memory");
+           g_fprintf(stderr, _("genversion: Not enough memory"));
            abort();
            /*NOTREACHED*/
        }
     }
-    snprintf(buf, buf_len, "%s=\\\"%s\\\"", var, val); /* safe */
+    g_snprintf(buf, buf_len, "%s=\\\"%s\\\"", var, val);       /* safe */
     prstr(buf);
 }
 
@@ -111,12 +116,12 @@ prundefvar(
        buf_len = new_len;
        buf = malloc(new_len);          /* let it die if malloc() fails */
        if (!buf) {
-           fprintf(stderr, "genversion: Not enough memory");
+           g_fprintf(stderr, _("genversion: Not enough memory"));
            abort();
            /*NOTREACHED*/
        }
     }
-    snprintf(buf, buf_len, "%s=UNDEF", var);   /* safe */
+    g_snprintf(buf, buf_len, "%s=UNDEF", var); /* safe */
     prstr(buf);
 }
 
@@ -129,7 +134,7 @@ prnum(
     static char number[NUM_STR_SIZE];
     size_t new_len;
 
-    snprintf(number, SIZEOF(number), "%ld", val);
+    g_snprintf(number, SIZEOF(number), "%ld", val);
     new_len = strlen(var)
              + SIZEOF("=")
              + strlen(number)
@@ -139,12 +144,12 @@ prnum(
        buf_len = new_len;
        buf = malloc(new_len);          /* let it die if malloc() fails */
        if (!buf) {
-           fprintf(stderr, "genversion: Not enough memory");
+           g_fprintf(stderr, _("genversion: Not enough memory"));
            abort();
            /*NOTREACHED*/
        }
     }
-    snprintf(buf, buf_len, "%s=%s", var, number);              /* safe */
+    g_snprintf(buf, buf_len, "%s=%s", var, number);            /* safe */
     prstr(buf);
 }
 
@@ -160,19 +165,28 @@ main(
     (void)argc;        /* Quiet unused parameter warning */
     (void)argv;        /* Quiet unused parameter warning */
 
-    printf("/* version.c - generated by genversion.c - DO NOT EDIT! */\n");
-    printf("const char * const version_info[] = {\n");
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
+    g_printf(_("/* version.c - generated by genversion.c - DO NOT EDIT! */\n"));
+    g_printf("const char * const version_info[] = {\n");
 
     startline("build:");
     v = version();
     v_len = SIZEOF("Amanda-") + strlen(v) + 1;
     verstr = malloc(v_len);
     if (!verstr) {
-       fprintf(stderr, "genversion: Not enough memory");
+       g_fprintf(stderr, _("genversion: Not enough memory"));
        abort();
        /*NOTREACHED*/
     }
-    snprintf(verstr, v_len, "Amanda-%s", v);           /* safe */
+    g_snprintf(verstr, v_len, "Amanda-%s", v);         /* safe */
     prvar("VERSION", verstr);
     free(verstr);
 
@@ -188,16 +202,22 @@ main(
     prundefvar("BUILT_MACH");
 #endif
 
-#ifdef CC
-    prvar("CC", CC);
+#ifdef BUILT_REV
+    prvar("BUILT_REV", BUILT_REV);
 #else
-    prundefvar("CC");
+    prundefvar("BUILT_REV");
+#endif
+
+#ifdef BUILT_BRANCH
+    prvar("BUILT_BRANCH", BUILT_BRANCH);
+#else
+    prundefvar("BUILT_BRANCH");
 #endif
 
 #ifdef CC
-    prvar("CONFIGURE_COMMAND", CONFIGURE_COMMAND);
+    prvar("CC", CC);
 #else
-    prundefvar("CONFIGURE_COMMAND");
+    prundefvar("CC");
 #endif
 
     endline();
@@ -207,6 +227,7 @@ main(
     prvar("bindir", bindir);
     prvar("sbindir", sbindir);
     prvar("libexecdir", libexecdir);
+    prvar("amlibexecdir", amlibexecdir);
     prvar("mandir", mandir);
     prvar("AMANDA_TMPDIR", AMANDA_TMPDIR);
 #ifdef AMANDA_DBGDIR
@@ -290,7 +311,11 @@ main(
     prundefvar(" LPRCMD");
 #endif
 
+#ifdef MAILER
     prvar("MAILER", MAILER);
+#else
+    prundefvar(" MAILER");
+#endif
 
 #ifdef GNUTAR_LISTED_INCREMENTAL_DIR
     prvar("listed_incr_dir", GNUTAR_LISTED_INCREMENTAL_DIR);
@@ -313,10 +338,6 @@ main(
     prstr("AIX_BACKUP");
 #endif
 
-#ifdef AIX_TAPEIO
-    prstr("AIX_TAPEIO");
-#endif
-
 #ifdef BROKEN_VOID
     prstr("BROKEN_VOID");
 #endif
@@ -377,10 +398,6 @@ main(
     prstr("ASSERTIONS");
 #endif
 
-#ifdef DEBUG_CODE
-    prstr("DEBUG_CODE");
-#endif
-
 #ifdef AMANDA_DEBUG_DAYS
     prnum("AMANDA_DEBUG_DAYS", AMANDA_DEBUG_DAYS);
 #endif
@@ -411,8 +428,8 @@ main(
 
     prvar("CLIENT_LOGIN", CLIENT_LOGIN);
 
-#ifdef FORCE_USERID
-    prstr("FORCE_USERID");
+#ifdef CHECK_USERID
+    prstr("CHECK_USERID");
 #endif
 
 #ifdef USE_VERSION_SUFFIXES
@@ -441,7 +458,7 @@ main(
 
     endline();
 
-    printf("  0\n};\n");
+    g_printf("  0\n};\n");
 
     return (0); /* exit */
 }
diff --git a/common-src/genversion.h b/common-src/genversion.h
new file mode 100644 (file)
index 0000000..7904057
--- /dev/null
@@ -0,0 +1,3 @@
+#define CC "gcc"
+#define BUILT_DATE "Mon Mar 31 20:02:23 EDT 2008"
+#define BUILT_MACH "x86_64-unknown-linux-gnu"
diff --git a/common-src/glib-util.c b/common-src/glib-util.c
new file mode 100644 (file)
index 0000000..ec9728a
--- /dev/null
@@ -0,0 +1,437 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/*
+ * Utilities that aren't quite included in glib
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>, Ian Turner <ian@zmanda.com>
+ */
+
+#include "amanda.h"
+#include "glib-util.h"
+#include "conffile.h" /* For find_multiplier. */
+
+typedef enum {
+    FLAG_STRING_NAME,
+    FLAG_STRING_SHORT_NAME,
+    FLAG_STRING_NICK
+} FlagString;
+
+static char ** g_flags_to_strv(int value, GType type, FlagString source);
+
+void
+_glib_util_foreach_glue(gpointer data, gpointer func)
+{
+    void (*one_arg_fn)(gpointer) = (void (*)(gpointer))func;
+    one_arg_fn(data);
+}
+
+GValue* g_value_unset_init(GValue* value, GType type) {
+    g_return_val_if_fail(value != NULL, NULL);
+
+    if (G_IS_VALUE(value)) {
+        g_value_unset(value);
+    }
+    g_value_init(value, type);
+    return value;
+}
+
+GValue* g_value_unset_copy(const GValue * from, GValue * to) {
+    g_return_val_if_fail(from != NULL, NULL);
+    g_return_val_if_fail(to != NULL, NULL);
+
+    g_value_unset_init(to, G_VALUE_TYPE(from));
+    g_value_copy(from, to);
+    return to;
+}
+
+void g_list_free_full(GList * list) {
+    GList * cur = list;
+
+    while (cur != NULL) {
+        gpointer data = cur->data;
+        amfree(data);
+        cur = g_list_next(cur);
+    }
+
+    g_list_free(list);
+}
+
+void g_slist_free_full(GSList * list) {
+    GSList * cur = list;
+
+    while (cur != NULL) {
+        gpointer data = cur->data;
+        amfree(data);
+        cur = g_slist_next(cur);
+    }
+
+    g_slist_free(list);
+}
+
+void g_queue_free_full(GQueue * queue) {
+    while (!g_queue_is_empty(queue)) {
+        gpointer data;
+        data = g_queue_pop_head(queue);
+        amfree(data);
+    }
+    g_queue_free(queue);
+}
+
+void g_ptr_array_free_full(GPtrArray * array) {
+    size_t i;
+
+    for (i = 0; i < array->len; i ++) {
+        amfree(g_ptr_array_index(array, i));
+    }
+    g_ptr_array_free(array, TRUE);
+}
+
+gboolean g_value_compare(GValue * a, GValue * b) {
+    if (a == NULL && b == NULL)
+        return TRUE;
+    if (a == NULL || b == NULL)
+        return FALSE;
+    if (G_VALUE_TYPE(a) != G_VALUE_TYPE(b))
+        return FALSE;
+    if (g_value_fits_pointer(a) && g_value_fits_pointer(b)) {
+        return g_value_peek_pointer(a) == g_value_peek_pointer(b);
+    } else {
+        /* Since there is no builtin comparison function, we resort to
+           comparing serialized strings. Yuck. */
+        char * a_str;
+        char * b_str;
+        gboolean rval;
+        a_str = g_strdup_value_contents(a);
+        b_str = g_strdup_value_contents(b);
+        rval = (0 == strcmp(a_str, b_str));
+        amfree(a_str);
+        amfree(b_str);
+        return rval;
+    }
+    
+    g_assert_not_reached();
+}
+
+static gboolean g_value_set_boolean_from_string(GValue * val, char * string) {
+    if (strcasecmp(string, "true") == 0 ||
+        strcasecmp(string, "yes") == 0 ||
+        strcmp(string, "1") == 0) {
+        g_value_set_boolean(val, TRUE);
+    } else if (strcasecmp(string, "false") == 0 ||
+               strcasecmp(string, "no") == 0 ||
+               strcmp(string, "0") == 0) {
+        g_value_set_boolean(val, FALSE);
+    } else {
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+static gboolean g_value_set_int_from_string(GValue * val, char * string) {
+    long int strto_result;
+    char * strto_end;
+    gint64 multiplier;
+    strto_result = strtol(string, &strto_end, 0);
+    multiplier = find_multiplier(strto_end);
+    if (multiplier == G_MAXINT64) {
+        if (strto_result >= 0) {
+            g_value_set_int(val, G_MAXINT);
+        } else {
+            g_value_set_int(val, G_MININT);
+        }
+        return TRUE;
+    } else if (*string == '\0' || multiplier == 0
+               || strto_result < G_MININT / multiplier
+               || strto_result > G_MAXINT / multiplier) {
+        return FALSE;
+    } else { 
+        g_value_set_int(val, (int)(strto_result * multiplier));
+        return TRUE;
+    }
+}
+
+static gboolean g_value_set_uint_from_string(GValue * val, char * string) {
+    unsigned long int strto_result;
+    char * strto_end;
+    guint64 multiplier;
+    strto_result = strtoul(string, &strto_end, 0);
+    multiplier = find_multiplier(strto_end); /* casts */
+    if (multiplier == G_MAXINT64) {
+        g_value_set_uint(val, G_MAXUINT);
+        return TRUE;
+    } else if (multiplier == 0 || *string == '\0' ||
+               strto_result > G_MAXUINT / multiplier) {
+        return FALSE;
+    } else {
+        g_value_set_uint(val, (guint)(strto_result * multiplier));
+        return TRUE;
+    }
+}
+
+static gboolean g_value_set_uint64_from_string(GValue * val, char * string) {
+    unsigned long long int strto_result;
+    char * strto_end;
+    guint64 multiplier;
+    strto_result = strtoull(string, &strto_end, 0);
+    multiplier = find_multiplier(strto_end); /* casts */
+    if (multiplier == G_MAXINT64) {
+        g_value_set_uint64(val, G_MAXUINT64);
+        return TRUE;
+    } else if (multiplier == 0 || *string == '\0' ||
+        strto_result > G_MAXUINT64 / multiplier) {
+        return FALSE;
+    } else {
+        g_value_set_uint64(val, (guint64)(strto_result * multiplier));
+        return TRUE;
+    }
+}
+
+/* Flags can contain multiple values. We assume here that values are like
+ * C identifiers (that is, they match /[A-Za-z_][A-Za-z0-9_]+/), although
+ * that doesn't seem to be a requirement of GLib. With that assumption in
+ * mind, we look for the format "FLAG_1 | FLAG_2 | ... | FLAG_N". */
+static gboolean g_value_set_flags_from_string(GValue * val, char * string) {
+    guint value = 0;
+    char * strtok_saveptr;
+    char * string_copy;
+    char * strtok_first_arg;
+    const char delim[] = " \t,|";
+    GFlagsClass * flags_class;
+    
+    flags_class = (GFlagsClass*) g_type_class_ref(G_VALUE_TYPE(val));
+    g_return_val_if_fail(flags_class != NULL, FALSE);
+    g_return_val_if_fail(G_IS_FLAGS_CLASS(flags_class), FALSE);
+
+    /* Don't let strtok stop on original. */
+    strtok_first_arg = string_copy = strdup(string);
+    
+    for (;;) {
+        GFlagsValue * flag_value;
+        char * token = strtok_r(strtok_first_arg, delim, &strtok_saveptr);
+        strtok_first_arg = NULL;
+
+        if (token == NULL) {
+            break;
+        }
+        
+        flag_value = g_flags_get_value_by_name(flags_class, token);
+        if (flag_value == NULL) {
+            flag_value = g_flags_get_value_by_nick(flags_class, token);
+        }
+        if (flag_value == NULL) {
+            g_fprintf(stderr, _("Invalid flag %s for type %s\n"), token,
+                    g_type_name(G_VALUE_TYPE(val)));
+            continue;
+        }
+
+        value |= flag_value->value;
+    }
+    
+    amfree(string_copy);
+    
+    if (value == 0) {
+        g_fprintf(stderr, _("No valid flags for type %s in string %s\n"),
+                g_type_name(G_VALUE_TYPE(val)), string);
+        return FALSE;
+    }
+    
+    g_value_set_flags(val, value);
+    return TRUE;
+
+}
+
+/* This function really ought not to be part of Amanda. In my (Ian's) opinion,
+   serialization and deserialization should be a part of the GValue
+   interface. But it's not, and here we are. */
+gboolean g_value_set_from_string(GValue * val, char * string) {
+    g_return_val_if_fail(val != NULL, FALSE);
+    g_return_val_if_fail(G_IS_VALUE(val), FALSE);
+
+    if (G_VALUE_HOLDS_BOOLEAN(val)) {
+        return g_value_set_boolean_from_string(val, string);
+    } else if (G_VALUE_HOLDS_INT(val)) {
+        return g_value_set_int_from_string(val, string);
+    } else if (G_VALUE_HOLDS_UINT(val)) {
+        return g_value_set_uint_from_string(val, string);
+    } else if (G_VALUE_HOLDS_UINT64(val)) {
+        return g_value_set_uint64_from_string(val, string);
+    } else if (G_VALUE_HOLDS_STRING(val)) {
+        g_value_set_string(val, string);
+        return TRUE;
+    } else if (G_VALUE_HOLDS_FLAGS(val)) {
+        return g_value_set_flags_from_string(val, string);
+    }
+
+    return TRUE;
+}
+
+gint
+g_compare_strings(
+    gconstpointer a,
+    gconstpointer b)
+{
+    return strcmp((char *)a, (char *)b);
+}
+
+char * g_strjoinv_and_free(char ** strv, const char * seperator) {
+    char * rval = g_strjoinv(seperator, strv);
+    g_strfreev(strv);
+    return rval;
+}
+
+char ** g_flags_name_to_strv(int value, GType type) {
+    return g_flags_to_strv(value, type, FLAG_STRING_NAME);
+}
+
+char ** g_flags_short_name_to_strv(int value, GType type) {
+    return g_flags_to_strv(value, type, FLAG_STRING_SHORT_NAME);
+}
+
+char ** g_flags_nick_to_strv(int value, GType type) {
+    return g_flags_to_strv(value, type, FLAG_STRING_NICK);
+}
+
+static char * get_name_from_value(GFlagsValue * value, FlagString source) {
+    switch (source) {
+    case FLAG_STRING_NAME:
+    case FLAG_STRING_SHORT_NAME:
+        return strdup(value->value_name);
+    case FLAG_STRING_NICK:
+        return strdup(value->value_nick);
+    default:
+        return NULL;
+    }
+}
+
+/* If freed and notfreed have a common prefix that is different from freed,
+   then return that and free freed. Otherwise, return freed. */
+static char * find_common_prefix(char * freed, const char * notfreed) {
+    char * freed_ptr = freed;
+    const char * notfreed_ptr = notfreed;
+
+    if (freed == NULL) {
+        if (notfreed == NULL) {
+            return NULL;
+        } else {
+            return strdup(notfreed);
+        }
+    } else if (notfreed == NULL) {
+        amfree(freed);
+        return strdup("");
+    }
+
+    while (*freed_ptr == *notfreed_ptr) {
+        freed_ptr ++;
+        notfreed_ptr ++;
+    }
+
+    *freed_ptr = '\0';
+    return freed;
+}
+
+static char ** g_flags_to_strv(int value, GType type,
+                               FlagString source) {
+    GPtrArray * rval;
+    GFlagsValue * flagsvalue;
+    char * common_prefix = NULL;
+    int common_prefix_len;
+    GFlagsClass * class;
+
+    g_return_val_if_fail(G_TYPE_IS_FLAGS(type), NULL);
+    g_return_val_if_fail((class = g_type_class_ref(type)) != NULL, NULL);
+    g_return_val_if_fail(G_IS_FLAGS_CLASS(class), NULL);
+        
+    rval = g_ptr_array_new();
+    for (flagsvalue = class->values;
+         flagsvalue->value_name != NULL;
+         flagsvalue ++) {
+        if (source == FLAG_STRING_SHORT_NAME) {
+            common_prefix = find_common_prefix(common_prefix,
+                                               flagsvalue->value_name);
+        }
+                                               
+        if ((flagsvalue->value == 0 && value == 0) ||
+            (flagsvalue->value != 0 && (value & flagsvalue->value))) {
+            g_ptr_array_add(rval, get_name_from_value(flagsvalue, source));
+        }
+    }
+
+    if (source == FLAG_STRING_SHORT_NAME && common_prefix != NULL &&
+        ((common_prefix_len = strlen(common_prefix))) > 0) {
+        char * old;
+        char * new;
+        guint i;
+        for (i = 0; i < rval->len; i ++) {
+            old = g_ptr_array_index(rval, i);
+            new = strdup(old + common_prefix_len);
+            g_ptr_array_index(rval, i) = new;
+            g_free(old);
+        }
+    }
+    
+    g_ptr_array_add(rval, NULL);
+
+    amfree(common_prefix);
+    return (char**)g_ptr_array_free(rval, FALSE);
+}
+
+char * g_english_strjoinv(char ** strv, const char * conjunction) {
+    int length;
+    char * last;
+    char * joined;
+    char * rval;
+    strv = g_strdupv(strv);
+
+    length = g_strv_length(strv);
+    last = strv[length - 1];
+    strv[length - 1] = NULL;
+    
+    joined = g_strjoinv(", ", strv);
+    rval = g_strdup_printf("%s, %s %s", joined, conjunction, last);
+
+    g_free(joined);
+    g_free(last);
+    g_strfreev(strv);
+    return rval;
+}
+
+char * g_english_strjoinv_and_free(char ** strv, const char * conjunction) {
+    char * rval = g_english_strjoinv(strv, conjunction);
+    g_strfreev(strv);
+    return rval;   
+}
+
+#if !(GLIB_CHECK_VERSION(2,6,0))
+guint g_strv_length(gchar ** strv) {
+    int rval = 0;
+
+    if (G_UNLIKELY(strv == NULL))
+        return 0;
+
+    while (*strv != NULL) {
+        rval ++;
+        strv ++;
+    }
+    return rval;
+}
+
+#endif /* GLIB_CHECK_VERSION(2.6.0) */
diff --git a/common-src/glib-util.h b/common-src/glib-util.h
new file mode 100644 (file)
index 0000000..3151d2b
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+/*
+ * Utilities that aren't quite included in glib
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>, Ian Turner <ian@zmanda.com>
+ */
+
+#ifndef GLIB_UTIL_H
+#define GLIB_UTIL_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+/* like g_[s]list_foreach, but with a function taking only
+ * one argument.
+ */
+#define g_list_foreach_nodata(list, func)                              \
+    g_list_foreach((list), _glib_util_foreach_glue, (gpointer)(func));
+#define g_slist_foreach_nodata(list, func)                             \
+    g_slist_foreach((list), _glib_util_foreach_glue, (gpointer)(func));
+void _glib_util_foreach_glue(gpointer data, gpointer func);
+
+/* This function takes a GValue, which may be zero-filled or
+ * initialized. In either case, this function causes the GValue to be
+ * initialized with the given type. Note that this function lacks the
+ * safety of the standard g_value_ functions; it assumes that the
+ * passed value is zeroed or valid.
+ *
+ * Returns its first argument.*/
+GValue* g_value_unset_init(GValue* val, GType type);
+
+/* This does the same thing but also copies the contents of one value
+ * into another. Note that this function lacks the safety of the
+ * standard g_value_ functions; it assumes that the passed value is
+ * zeroed or valid.
+ *
+ * Returns its second (reset) argument.*/
+GValue* g_value_unset_copy(const GValue* from, GValue * to);
+
+/* These functions all take a GLib container, and call free() on all the
+ * pointers in the container before free()ing the container itself. */
+void g_list_free_full(GList * list);
+void g_slist_free_full(GSList * list);
+void g_queue_free_full(GQueue * queue);
+void g_ptr_array_free_full(GPtrArray * array);
+
+/* g_value_compare() does what you expect. It returns TRUE if and
+   only if the two values have the same type and the same value. Note
+   that it will return FALSE if the same value is stored with two
+   different types: For example, a GValue with a UCHAR of 1 and a
+   GValue with a CHAR of 1 will be considered inequal. Also, this is a
+   'shallow' comparison; pointers to distinct but equivalent objects
+   are considered inequal. */
+gboolean g_value_compare(GValue * a, GValue * b);
+
+/* Given a string and a GValue, parse the string and store it in the
+   GValue. The GValue should be pre-initalized to whatever type you want
+   parsed. */
+gboolean g_value_set_from_string(GValue * val, char * string);
+
+/* A GCompareFunc that will sort strings alphabetically (using strcmp) */
+gint g_compare_strings(gconstpointer a, gconstpointer b);
+
+/* These functions all take a Flags class and stringify it. They
+ * return a NULL-terminated array of strings that can be
+ * passed to g_strjoinv(), g_strfreev(), g_strdupv(), and
+ * g_strv_length(). Example output looks like:
+ * - g_flags_name_to_strv() -> "MEDIA_ACCESS_MODE_READ_ONLY"
+ * - g_flags_short_name_to_strv() -> "READ_ONLY"
+ * - g_flags_nick_to_strv() -> "read-only"
+ */
+
+char ** g_flags_name_to_strv(int value, GType type);
+char ** g_flags_short_name_to_strv(int value, GType type);
+char ** g_flags_nick_to_strv(int value, GType type);
+
+/* Just like g_strjoinv, but frees the array as well. */
+char * g_strjoinv_and_free(char ** strv, const char * seperator);
+
+/* Just like g_strjoinv, but joins like an English list. The string would
+ * usually be "and" or "or". */
+char * g_english_strjoinv(char ** strv, const char * conjunction);
+
+/* Just like g_english_strjoinv, but also frees the array. */
+char * g_english_strjoinv_and_free(char ** strv, const char * conjunction);
+
+/* Replacement for built-in functions. */
+#if !(GLIB_CHECK_VERSION(2,6,0))
+guint g_strv_length(gchar ** strv);
+#endif
+
+#endif
+
index b4ca980c2a7de080b758c9a70356a25081723516..77fa3bd903a205bfff4c2615f5456485d957734a 100644 (file)
@@ -31,7 +31,6 @@
  */
 
 #include "config.h"
-#ifdef KRB4_SECURITY
 
 #include <des.h>
 #include <krb.h>
@@ -96,7 +95,7 @@ struct krb4_stream {
     security_stream_t secstr;          /* MUST be first */
     struct krb4_handle *krb4_handle;   /* pointer into above */
     int fd;                            /* io file descriptor */
-    int port;                          /* local port this is bound to */
+    in_port_t port;                    /* local port this is bound to */
     int socket;                                /* fd for server-side accepts */
     event_handle_t *ev_read;           /* read event handle */
     char databuf[MAX_TAPE_BLOCK_BYTES];        /* read buffer */
@@ -108,7 +107,9 @@ struct krb4_stream {
 /*
  * This is the tcp stream buffer size
  */
+#ifndef STREAM_BUFSIZE
 #define        STREAM_BUFSIZE  (MAX_TAPE_BLOCK_BYTES * 2)
+#endif
 
 /*
  * Interface functions
@@ -224,7 +225,7 @@ static void (*accept_fn)(security_handle_t *, pkt_t *);
  */
 union mutual {
     char pad[8];
-    long cksum;
+    unsigned long cksum;
 };
 
 /*
@@ -243,8 +244,8 @@ static void recvpkt_timeout(void *);
 static int recv_security_ok(struct krb4_handle *, pkt_t *);
 static void stream_read_callback(void *);
 static void stream_read_sync_callback(void *);
-static int net_write(int, const void *, size_t);
-static int net_read(int, void *, size_t, int);
+static int knet_write(int, const void *, size_t);
+static int knet_read(int, void *, size_t, int);
 
 static int add_ticket(struct krb4_handle *, const pkt_t *, dgram_t *);
 static void add_mutual_auth(struct krb4_handle *, dgram_t *);
@@ -252,8 +253,8 @@ static int check_ticket(struct krb4_handle *, const pkt_t *,
     const char *, unsigned long);
 static int check_mutual_auth(struct krb4_handle *, const char *);
 
-static const char *pkthdr2str(const struct krb4_handle *, const pkt_t *);
-static int str2pkthdr(const char *, pkt_t *, char *, size_t, int *);
+static const char *kpkthdr2str(const struct krb4_handle *, const pkt_t *);
+static int str2kpkthdr(const char *, pkt_t *, char *, size_t, int *);
 
 static const char *bin2astr(const unsigned char *, int);
 static void astr2bin(const unsigned char *, unsigned char *, int *);
@@ -280,7 +281,7 @@ static void
 init(void)
 {
     char tktfile[256];
-    int port;
+    in_port_t port;
     static int beenhere = 0;
 
     if (beenhere)
@@ -291,7 +292,7 @@ init(void)
     hostname[SIZEOF(hostname) - 1] = '\0';
 
     if (atexit(killtickets) < 0)
-       error("could not setup krb4 exit handler: %s", strerror(errno));
+       error(_("could not setup krb4 exit handler: %s"), strerror(errno));
 
     /*
      * [XXX] It could be argued that if KRBTKFILE is set outside of amanda,
@@ -299,7 +300,7 @@ init(void)
      * This file also needs to be removed so that no extra tickets are
      * hanging around.
      */
-    snprintf(tktfile, SIZEOF(tktfile), "/tmp/tkt%ld-%ld.amanda",
+    g_snprintf(tktfile, SIZEOF(tktfile), "/tmp/tkt%ld-%ld.amanda",
        (long)getuid(), (long)getpid());
     ticketfilename = stralloc(tktfile);
     unlink(ticketfilename);
@@ -329,12 +330,12 @@ get_tgt(void)
     strncpy(realm, krb_realmofhost(hostname), SIZEOF(realm) - 1);
     realm[SIZEOF(realm) - 1] = '\0';
 
-    rc = krb_get_svc_in_tkt(SERVER_HOST_PRINCIPLE, SERVER_HOST_INSTANCE,
+    rc = krb_get_svc_in_tkt(SERVER_HOST_PRINCIPAL, SERVER_HOST_INSTANCE,
        realm, "krbtgt", realm, TICKET_LIFETIME, SERVER_HOST_KEY_FILE);
 
     if (rc != 0) {
-       error("could not get krbtgt for %s.%s@%s from %s: %s",
-           SERVER_HOST_PRINCIPLE, SERVER_HOST_INSTANCE, realm,
+       error(_("could not get krbtgt for %s.%s@%s from %s: %s"),
+           SERVER_HOST_PRINCIPAL, SERVER_HOST_INSTANCE, realm,
            SERVER_HOST_KEY_FILE, krb_err_txt[rc]);
     }
 
@@ -358,7 +359,10 @@ krb4_connect(
     char handle[32];
     struct servent *se;
     struct hostent *he;
-    int port;
+    in_port_t port;
+
+    (void)conf_fn;     /* Quiet unused parameter warning */
+    (void)datap;       /* Quiet unused parameter warning */
 
     assert(hostname != NULL);
 
@@ -372,7 +376,7 @@ krb4_connect(
 
     if ((he = gethostbyname(hostname)) == NULL) {
        security_seterror(&kh->sech,
-           "%s: could not resolve hostname", hostname);
+           _("%s: could not resolve hostname"), hostname);
        (*fn)(arg, &kh->sech, S_ERROR);
        return;
     }
@@ -380,7 +384,7 @@ krb4_connect(
        port = (int)KAMANDA_SERVICE_DEFAULT;
     else
        port = ntohs(se->s_port);
-    snprintf(handle, SIZEOF(handle), "%ld", (long)time(NULL));
+    g_snprintf(handle, SIZEOF(handle), "%ld", (long)time(NULL));
     inithandle(kh, he, (int)port, handle);
     (*fn)(arg, &kh->sech, S_OK);
 }
@@ -395,6 +399,8 @@ krb4_accept(
     int                out,
     void       (*fn)(security_handle_t *, pkt_t *))
 {
+    (void)driver;      /* Quiet unused parameter warning */
+    (void)out;         /* Quiet unused parameter warning */
 
     /*
      * Make sure we're initted
@@ -497,7 +503,7 @@ krb4_sendpkt(
     /*
      * Add the header to the packet
      */
-    dgram_cat(&netfd, pkthdr2str(kh, pkt));
+    dgram_cat(&netfd, kpkthdr2str(kh, pkt));
 
     /*
      * Add the security info.  This depends on which kind of packet we're
@@ -536,7 +542,7 @@ krb4_sendpkt(
     dgram_cat(&netfd, pkt->body);
     if (dgram_send_addr(&kh->peer, &netfd) != 0) {
        security_seterror(&kh->sech,
-           "send %s to %s failed: %s", pkt_type2str(pkt->type),
+           _("send %s to %s failed: %s"), pkt_type2str(pkt->type),
            kh->hostname, strerror(errno));
        return (-1);
     }
@@ -635,7 +641,7 @@ krb4_stream_server(
     ks->socket = stream_server(&ks->port, STREAM_BUFSIZE, STREAM_BUFSIZE, 1);
     if (ks->socket < 0) {
        security_seterror(&kh->sech,
-           "can't create server stream: %s", strerror(errno));
+           _("can't create server stream: %s"), strerror(errno));
        amfree(ks);
        return (NULL);
     }
@@ -664,7 +670,7 @@ krb4_stream_accept(
     ks->fd = stream_accept(ks->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE);
     if (ks->fd < 0) {
        security_stream_seterror(&ks->secstr,
-           "can't accept new stream connection: %s", strerror(errno));
+           _("can't accept new stream connection: %s"), strerror(errno));
        return (-1);
     }
     return (0);
@@ -689,7 +695,7 @@ krb4_stream_client(
        &ks->port, 0);
     if (ks->fd < 0) {
        security_seterror(&kh->sech,
-           "can't connect stream to %s port %d: %s", kh->hostname, id,
+           _("can't connect stream to %s port %d: %s"), kh->hostname, id,
            strerror(errno));
        amfree(ks);
        return (NULL);
@@ -754,12 +760,12 @@ krb4_stream_auth(
      * and present it to the other side.
      */
     gettimeofday(&local, &tz);
-    enc.tv_sec = (long)htonl((uint32_t)local.tv_sec);
-    enc.tv_usec = (long)htonl((uint32_t)local.tv_usec);
+    enc.tv_sec = (long)htonl((guint32)local.tv_sec);
+    enc.tv_usec = (long)htonl((guint32)local.tv_usec);
     encrypt_data(&enc, SIZEOF(enc), &kh->session_key);
-    if (net_write(fd, &enc, SIZEOF(enc)) < 0) {
+    if (knet_write(fd, &enc, SIZEOF(enc)) < 0) {
        security_stream_seterror(&ks->secstr,
-           "krb4 stream handshake write error: %s", strerror(errno));
+           _("krb4 stream handshake write error: %s"), strerror(errno));
        return (-1);
     }
 
@@ -768,20 +774,20 @@ krb4_stream_auth(
      * and useconds by one.  Reencrypt, and present to the other side.
      * Timeout in 10 seconds.
      */
-    if (net_read(fd, &enc, SIZEOF(enc), 60) < 0) {
+    if (knet_read(fd, &enc, SIZEOF(enc), 60) < 0) {
        security_stream_seterror(&ks->secstr,
-           "krb4 stream handshake read error: %s", strerror(errno));
+           _("krb4 stream handshake read error: %s"), strerror(errno));
        return (-1);
     }
     decrypt_data(&enc, SIZEOF(enc), &kh->session_key);
     /* XXX do timestamp checking here */
-    enc.tv_sec = (long)htonl(ntohl((uint32_t)enc.tv_sec) + 1);
-    enc.tv_usec =(long)htonl(ntohl((uint32_t)enc.tv_usec) + 1);
+    enc.tv_sec = (long)htonl(ntohl((guint32)enc.tv_sec) + 1);
+    enc.tv_usec =(long)htonl(ntohl((guint32)enc.tv_usec) + 1);
     encrypt_data(&enc, SIZEOF(enc), &kh->session_key);
 
-    if (net_write(fd, &enc, SIZEOF(enc)) < 0) {
+    if (knet_write(fd, &enc, SIZEOF(enc)) < 0) {
        security_stream_seterror(&ks->secstr,
-           "krb4 stream handshake write error: %s", strerror(errno));
+           _("krb4 stream handshake write error: %s"), strerror(errno));
        return (-1);
     }
 
@@ -790,21 +796,21 @@ krb4_stream_auth(
      * If they incremented it properly, then succeed.
      * Timeout in 10 seconds.
      */
-    if (net_read(fd, &enc, SIZEOF(enc), 60) < 0) {
+    if (knet_read(fd, &enc, SIZEOF(enc), 60) < 0) {
        security_stream_seterror(&ks->secstr,
-           "krb4 stream handshake read error: %s", strerror(errno));
+           _("krb4 stream handshake read error: %s"), strerror(errno));
        return (-1);
     }
     decrypt_data(&enc, SIZEOF(enc), &kh->session_key);
-    if ((ntohl((uint32_t)enc.tv_sec)  == (uint32_t)(local.tv_sec + 1)) &&
-       (ntohl((uint32_t)enc.tv_usec) == (uint32_t)(local.tv_usec + 1)))
+    if ((ntohl((guint32)enc.tv_sec)  == (uint32_t)(local.tv_sec + 1)) &&
+       (ntohl((guint32)enc.tv_usec) == (uint32_t)(local.tv_usec + 1)))
            return (0);
 
     security_stream_seterror(&ks->secstr,
-       "krb4 handshake failed: sent %ld,%ld - recv %ld,%ld",
+       _("krb4 handshake failed: sent %ld,%ld - recv %ld,%ld"),
            (long)(local.tv_sec + 1), (long)(local.tv_usec + 1),
-           (long)ntohl((uint32_t)enc.tv_sec),
-           (long)ntohl((uint32_t)enc.tv_usec));
+           (long)ntohl((guint32)enc.tv_sec),
+           (long)ntohl((guint32)enc.tv_usec));
     return (-1);
 }
 
@@ -833,14 +839,12 @@ krb4_stream_write(
     size_t     size)
 {
     struct krb4_stream *ks = s;
-    struct krb4_handle *kh = ks->krb4_handle;
 
     assert(ks != NULL);
-    assert(kh != NULL);
 
-    if (net_write(ks->fd, buf, size) < 0) {
+    if (knet_write(ks->fd, buf, size) < 0) {
        security_stream_seterror(&ks->secstr,
-           "write error on stream %d: %s", ks->fd, strerror(errno));
+           _("write error on stream %d: %s"), ks->fd, strerror(errno));
        return (-1);
     }
     return (0);
@@ -982,6 +986,7 @@ recvpkt_callback(
     void (*fn)(void *, pkt_t *, security_status_t);
     void *arg;
 
+    (void)cookie;              /* Quiet unused parameter warning */
     assert(cookie == NULL);
 
     /*
@@ -992,7 +997,7 @@ recvpkt_callback(
     dgram_zero(&netfd);
     if (dgram_recv(&netfd, 0, &peer) < 0)
        return;
-    if (str2pkthdr(netfd.cur, &pkt, handle, SIZEOF(handle), &sequence) < 0)
+    if (str2kpkthdr(netfd.cur, &pkt, handle, SIZEOF(handle), &sequence) < 0)
        return;
 
     for (kh = handleq_first(); kh != NULL; kh = handleq_next(kh)) {
@@ -1091,17 +1096,17 @@ add_ticket(
      * Get a ticket with the user-defined service and instance,
      * and using the checksum of the body of the request packet.
      */
-    rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPLE, inst, kh->realm,
+    rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPAL, inst, kh->realm,
        kh->cksum);
     if (rc == NO_TKT_FIL) {
        /* It's been kdestroyed.  Get a new one and try again */
        get_tgt();
-       rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPLE, inst, kh->realm,
+       rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPAL, inst, kh->realm,
            kh->cksum);
     }
     if (rc != 0) {
        security_seterror(&kh->sech,
-           "krb_mk_req failed: %s (%d)", error_message(rc), rc);
+           _("krb_mk_req failed: %s (%d)"), error_message(rc), rc);
        return (-1);
     }
     /*
@@ -1134,7 +1139,7 @@ add_mutual_auth(
     assert(kh->session_key[0] != '\0');
 
     memset(&mutual, 0, SIZEOF(mutual));
-    mutual.cksum = (unsigned long)htonl((uint32_t)kh->cksum + 1);
+    mutual.cksum = (unsigned long)htonl((guint32)kh->cksum + 1);
     encrypt_data(&mutual, SIZEOF(mutual), &kh->session_key);
 
     security = vstralloc("SECURITY MUTUAL-AUTH ",
@@ -1164,7 +1169,7 @@ recv_security_ok(
      * Set this preemptively before we mangle the body.
      */
     security_seterror(&kh->sech,
-       "bad %s SECURITY line from %s: '%s'", pkt_type2str(pkt->type),
+       _("bad %s SECURITY line from %s: '%s'"), pkt_type2str(pkt->type),
        kh->hostname, pkt->body);
 
 
@@ -1223,7 +1228,7 @@ recv_security_ok(
            return (-1);
        if (strcmp(tok, "TICKET") != 0) {
            security_seterror(&kh->sech,
-               "REQ SECURITY line parse error, expecting TICKET, got %s", tok);
+               _("REQ SECURITY line parse error, expecting TICKET, got %s"), tok);
            return (-1);
        }
 
@@ -1297,6 +1302,8 @@ check_ticket(
     char *user;
     int rc;
 
+    (void)pkt;         /* Quiet unused parameter warning */
+
     assert(kh != NULL);
     assert(pkt != NULL);
     assert(ticket_str != NULL);
@@ -1314,11 +1321,11 @@ check_ticket(
     inst[SIZEOF(inst) - 1] = '\0';
 
     /* get the checksum out of the ticket */
-    rc = krb_rd_req(&ticket, CLIENT_HOST_PRINCIPLE, inst,
+    rc = krb_rd_req(&ticket, CLIENT_HOST_PRINCIPAL, inst,
        kh->peer.sin6_addr.s_addr, &auth, CLIENT_HOST_KEY_FILE);
     if (rc != 0) {
        security_seterror(&kh->sech,
-           "krb_rd_req failed for %s: %s (%d)", kh->hostname,
+           _("krb_rd_req failed for %s: %s (%d)"), kh->hostname,
            error_message(rc), rc);
        return (-1);
     }
@@ -1326,7 +1333,7 @@ check_ticket(
     /* verify and save the checksum and session key */
     if (auth.checksum != cksum) {
        security_seterror(&kh->sech,
-           "krb4 checksum mismatch for %s (remote=%lu, local=%lu)",
+           _("krb4 checksum mismatch for %s (remote=%lu, local=%lu)"),
            kh->hostname, (long)auth.checksum, cksum);
        return (-1);
     }
@@ -1334,16 +1341,16 @@ check_ticket(
     memcpy(kh->session_key, auth.session, SIZEOF(kh->session_key));
 
     /*
-     * If FORCE_USERID is set, then we need to specifically
+     * If CHECK_USERID is set, then we need to specifically
      * check the userid we're forcing ourself to.  Otherwise,
      * just check the login we're currently setuid to.
      */
-#ifdef FORCE_USERID
+#ifdef CHECK_USERID
     if ((pwd = getpwnam(CLIENT_LOGIN)) == NULL)
-       error("error [getpwnam(%s) fails]", CLIENT_LOGIN);
+       error(_("error [getpwnam(%s) fails]"), CLIENT_LOGIN);
 #else
     if ((pwd = getpwuid(getuid())) == NULL)
-       error("error  [getpwuid(%d) fails]", getuid());
+       error(_("error  [getpwuid(%d) fails]"), getuid());
 #endif
 
     /* save the username in case it's overwritten */
@@ -1352,7 +1359,7 @@ check_ticket(
     /* check the klogin file */
     if (kuserok(&auth, user)) {
        security_seterror(&kh->sech,
-           "access as %s not allowed from %s.%s@%s", user, auth.pname,
+           _("access as %s not allowed from %s.%s@%s"), user, auth.pname,
            auth.pinst, auth.prealm);
        amfree(user);
        return (-1);
@@ -1388,12 +1395,12 @@ check_mutual_auth(
     /* unencrypt the string using the key in the ticket file */
     host2key(kh->hostname, kh->inst, &kh->session_key);
     decrypt_data(&mutual, (size_t)len, &kh->session_key);
-    mutual.cksum = (unsigned long)ntohl((uint32_t)mutual.cksum);
+    mutual.cksum = (unsigned long)ntohl((guint32)mutual.cksum);
 
     /* the data must be the same as our request cksum + 1 */
     if (mutual.cksum != (kh->cksum + 1)) {
        security_seterror(&kh->sech,
-           "krb4 checksum mismatch from %s (remote=%lu, local=%lu)",
+           _("krb4 checksum mismatch from %s (remote=%lu, local=%lu)"),
            kh->hostname, mutual.cksum, kh->cksum + 1);
        return (-1);
     }
@@ -1405,7 +1412,7 @@ check_mutual_auth(
  * Convert a pkt_t into a header string for our packet
  */
 static const char *
-pkthdr2str(
+kpkthdr2str(
     const struct krb4_handle * kh,
     const pkt_t *              pkt)
 {
@@ -1414,7 +1421,7 @@ pkthdr2str(
     assert(kh != NULL);
     assert(pkt != NULL);
 
-    snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n",
+    g_snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n",
        VERSION_MAJOR, VERSION_MINOR, pkt_type2str(pkt->type),
        kh->proto_handle, kh->sequence);
 
@@ -1429,7 +1436,7 @@ pkthdr2str(
  * Returns negative on parse error.
  */
 static int
-str2pkthdr(
+str2kpkthdr(
     const char *origstr,
     pkt_t *    pkt,
     char *     handle,
@@ -1490,7 +1497,7 @@ str2pkthdr(
 parse_error:
 #if 0 /* XXX we have no way of passing this back up */
     security_seterror(&kh->sech,
-       "parse error in packet header : '%s'", origstr);
+       _("parse error in packet header : '%s'"), origstr);
 #endif
     amfree(str);
     return (-1);
@@ -1510,7 +1517,7 @@ host2key(
 #if CLIENT_HOST_INSTANCE != HOSTNAME_INSTANCE
     inst = CLIENT_HOST_INSTANCE
 #endif
-    krb_get_cred(CLIENT_HOST_PRINCIPLE, (char *)inst, realm, &cred);
+    krb_get_cred(CLIENT_HOST_PRINCIPAL, (char *)inst, realm, &cred);
     memcpy(key, cred.session, SIZEOF(des_cblock));
 }
 
@@ -1664,7 +1671,7 @@ decrypt_data(
  * like write(), but always writes out the entire buffer.
  */
 static int
-net_write(
+knet_write(
     int                fd,
     const void *vbuf,
     size_t     size)
@@ -1686,7 +1693,7 @@ net_write(
  * Like read(), but waits until the entire buffer has been filled.
  */
 static int
-net_read(
+knet_read(
     int                fd,
     void *     vbuf,
     size_t     size,
@@ -1742,12 +1749,13 @@ print_hex(
 {
     int i;
 
-    dbprintf(("%s:", str));
+    dbprintf("%s:", str);
     for(i=0;i<len;i++) {
-       if(i%25 == 0) dbprintf(("\n"));
-       dbprintf((" %02X", buf[i]));
+       if(i%25 == 0)
+               dbprintf("\n");
+       dbprintf(" %02X", buf[i]);
     }
-    dbprintf(("\n"));
+    dbprintf("\n");
 }
 
 static void
@@ -1755,8 +1763,8 @@ print_ticket(
     const char *str,
     KTEXT      tktp)
 {
-    dbprintf(("%s: length %d chk %lX\n", str, tktp->length, tktp->mbz));
-    print_hex("ticket data", tktp->dat, tktp->length);
+    dbprintf(_("%s: length %d chk %lX\n"), str, tktp->length, tktp->mbz);
+    print_hex(_("ticket data"), tktp->dat, tktp->length);
     fflush(stdout);
 }
 
@@ -1764,10 +1772,10 @@ static void
 print_auth(
     AUTH_DAT *authp)
 {
-    printf("\nAuth Data:\n");
-    printf("  Principal \"%s\" Instance \"%s\" Realm \"%s\"\n",
+    g_printf("\nAuth Data:\n");
+    g_printf("  Principal \"%s\" Instance \"%s\" Realm \"%s\"\n",
           authp->pname, authp->pinst, authp->prealm);
-    printf("  cksum %d life %d keylen %ld\n", authp->checksum,
+    g_printf("  cksum %d life %d keylen %ld\n", authp->checksum,
           authp->life, SIZEOF(authp->session));
     print_hex("session key", authp->session, SIZEOF(authp->session));
     fflush(stdout);
@@ -1777,8 +1785,8 @@ static void
 print_credentials(
     CREDENTIALS *credp)
 {
-    printf("\nCredentials:\n");
-    printf("  service \"%s\" instance \"%s\" realm \"%s\" life %d kvno %d\n",
+    g_printf("\nCredentials:\n");
+    g_printf("  service \"%s\" instance \"%s\" realm \"%s\" life %d kvno %d\n",
           credp->service, credp->instance, credp->realm, credp->lifetime,
           credp->kvno);
     print_hex("session key", credp->session, SIZEOF(credp->session));
@@ -1786,14 +1794,3 @@ print_credentials(
     fflush(stdout);
 }
 #endif
-
-#else
-
-void krb4_security_dummy(void);
-
-void
-krb4_security_dummy(void)
-{
-}
-
-#endif /* KRB4_SECURITY */
index 5b3d76a416afe55584d4e0c245fbc3caaf0c9350..dc70b318dcb49a00204c547a4b4bc4f91a435716 100644 (file)
 #include "security-util.h"
 #include "stream.h"
 #include "version.h"
+#include "sockaddr-util.h"
 
 #ifdef KRB5_HEIMDAL_INCLUDES
 #include "com_err.h"
 #endif
 
-#ifdef KRB5_SECURITY
-
 #define BROKEN_MEMORY_CCACHE
 
 #ifdef BROKEN_MEMORY_CCACHE
 #define KRB5_ENV_CCNAME "KRB5CCNAME"
 #endif
 
-#define k5printf(x)     auth_debug(1,x)
-
-
 /*
  * consider undefining when kdestroy() is fixed.  The current version does
  * not work under krb5-1.2.4 in rh7.3, perhaps others.
  */
 #define KDESTROY_VIA_UNLINK     1
 
-/*
- * Define this if you want all network traffic encrypted.  This will
- * extract a serious performance hit.
- *
- * It would be nice if we could do this on a filesystem-by-filesystem basis.
- */
-/*#define       AMANDA_KRB5_ENCRYPT*/
-
 /*
  * Where the keytab lives, if defined.  Otherwise it expects something in the
  * config file.
@@ -161,8 +149,11 @@ static char myhostname[MAX_HOSTNAME_LENGTH+1];
 /*
  * Interface functions
  */
-static void krb5_accept(const struct security_driver *, int, int,
-    void (*)(security_handle_t *, pkt_t *));
+static void krb5_accept(const struct security_driver *,
+    char *(*)(char *, void *),
+    int, int,
+    void (*)(security_handle_t *, pkt_t *),
+    void *);
 static void krb5_connect(const char *,
     char *(*)(char *, void *), 
     void (*)(void *, security_handle_t *, security_status_t), void *, void *);
@@ -177,12 +168,10 @@ static int           gss_client(struct sec_handle *);
 static const char *gss_error(OM_uint32, OM_uint32);
 static char       *krb5_checkuser(char *host, char *name, char *realm);
 
-#ifdef AMANDA_KRB5_ENCRYPT
 static int k5_encrypt(void *cookie, void *buf, ssize_t buflen,
                      void **encbuf, ssize_t *encbuflen);
 static int k5_decrypt(void *cookie, void *buf, ssize_t buflen,
                      void **encbuf, ssize_t *encbuflen);
-#endif
 
 /*
  * This is our interface to the outside world.
@@ -206,13 +195,8 @@ const security_driver_t krb5_security_driver = {
     tcpm_stream_read_sync,
     tcpm_stream_read_cancel,
     tcpm_close_connection,
-#ifdef AMANDA_KRB5_ENCRYPT
     k5_encrypt,
     k5_decrypt,
-#else
-    NULL,
-    NULL,
-#endif
 };
 
 static int newhandle = 1;
@@ -239,16 +223,12 @@ krb5_connect(
 {
     struct sec_handle *rh;
     int result;
-    struct addrinfo hints;
-    struct addrinfo *res = NULL;
+    char *canonname;
 
     assert(fn != NULL);
     assert(hostname != NULL);
-    (void)conf_fn;     /* Quiet unused parameter warning */
-    (void)datap;       /* Quiet unused parameter warning */
 
-    k5printf(("%s: krb5: krb5_connect: %s\n", debug_prefix_time(NULL),
-              hostname));
+    auth_debug(1, "krb5: krb5_connect: %s\n", hostname);
 
     krb5_init();
 
@@ -259,37 +239,27 @@ krb5_connect(
     rh->ev_timeout = NULL;
     rh->rc = NULL;
 
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = AF_UNSPEC;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = AF_INET;
-#endif
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
-#ifdef WORKING_IPV6
-    if (result != 0) {
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       result = getaddrinfo(hostname, NULL, &hints, &res);
-    }
-#endif
+    result = resolve_hostname(hostname, 0, NULL, &canonname);
     if(result != 0) {
-       dbprintf(("krb5_connect: getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
-       security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname,
+       dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result));
+       security_seterror(&rh->sech, _("resolve_hostname(%s): %s\n"), hostname,
                          gai_strerror(result));
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
+    if (canonname == NULL) {
+       dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname);
+       security_seterror(&rh->sech,
+               _("resolve_hostname(%s) did not return a canonical name\n"), hostname);
+       (*fn)(arg, &rh->sech, S_ERROR);
+       return;
+    }
 
-    rh->hostname = stralloc(res->ai_canonname);        /* will be replaced */
+    rh->hostname = canonname;        /* will be replaced */
+    canonname = NULL; /* steal reference */
     rh->rs = tcpma_stream_client(rh, newhandle++);
+    rh->rc->conf_fn = conf_fn;
+    rh->rc->datap = datap;
     rh->rc->recv_security_ok = NULL;
     rh->rc->prefix_packet = NULL;
 
@@ -340,21 +310,26 @@ krb5_connect(
     rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME,
        sec_connect_timeout, rh);
 
+    amfree(canonname);
     return;
 
 error:
+    amfree(canonname);
     (*fn)(arg, &rh->sech, S_ERROR);
 }
 
 /*
+
  * Setup to handle new incoming connections
  */
 static void
 krb5_accept(
     const struct security_driver *driver,
+    char       *(*conf_fn)(char *, void *),
     int                in,
     int                out,
-    void       (*fn)(security_handle_t *, pkt_t *))
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
 {
     struct sockaddr_storage sin;
     socklen_t len;
@@ -367,26 +342,32 @@ krb5_accept(
 
     len = sizeof(sin);
     if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) {
-       dbprintf(("%s: getpeername returned: %s\n", debug_prefix_time(NULL),
-                 strerror(errno)));
+       dbprintf(_("getpeername returned: %s\n"),
+                 strerror(errno));
        return;
+
     }
     if ((result = getnameinfo((struct sockaddr *)&sin, len,
                              hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
-       dbprintf(("%s: getnameinfo failed: %s\n",
-                 debug_prefix_time(NULL), gai_strerror(result)));
+       dbprintf(_("getnameinfo failed: %s\n"),
+                 gai_strerror(result));
        return;
     }
     if (check_name_give_sockaddr(hostname,
                                 (struct sockaddr *)&sin, &errmsg) < 0) {
+       dbprintf(_("check_name_give_sockaddr(%s): %s\n"),
+                 hostname, errmsg);
        amfree(errmsg);
        return;
     }
 
+
     rc = sec_tcp_conn_get(hostname, 0);
+    rc->conf_fn = conf_fn;
+    rc->datap = datap;
     rc->recv_security_ok = NULL;
     rc->prefix_packet = NULL;
-    memcpy(&rc->peer, &sin, sizeof(rc->peer));
+    copy_sockaddr(&rc->peer, &sin);
     rc->read = in;
     rc->write = out;
     rc->driver = driver;
@@ -407,7 +388,6 @@ runkrb5(
     struct servent *   sp;
     int                        server_socket;
     in_port_t          my_port, port;
-    uid_t              euid;
     struct tcp_conn *  rc = rh->rc;
     const char *err;
 
@@ -416,20 +396,20 @@ runkrb5(
     else
        port = sp->s_port;
 
-    euid = geteuid();
-
     if ((err = get_tgt(keytab_name, principal_name)) != NULL) {
         security_seterror(&rh->sech, "%s: could not get TGT: %s",
             rc->hostname, err);
         return -1;
     }
 
+    set_root_privs(1);
     server_socket = stream_client(rc->hostname,
                                     (in_port_t)(ntohs(port)),
                                     STREAM_BUFSIZE,
                                     STREAM_BUFSIZE,
                                     &my_port,
                                     0);
+    set_root_privs(0);
 
     if(server_socket < 0) {
        security_seterror(&rh->sech,
@@ -437,7 +417,6 @@ runkrb5(
        
        return -1;
     }
-    seteuid(euid);
 
     rc->read = rc->write = server_socket;
 
@@ -445,11 +424,14 @@ runkrb5(
        return -1;
     }
 
+
     return 0;
 }
 
 
+
 /*
+
  * Negotiate a krb5 gss context from the client end.
  */
 static int
@@ -467,14 +449,14 @@ gss_client(
     gss_name_t gss_name;
     char *errmsg = NULL;
 
-    k5printf(("gss_client\n"));
+    auth_debug(1, "gss_client\n");
 
     send_tok.value = vstralloc("host/", rs->rc->hostname, NULL);
     send_tok.length = strlen(send_tok.value) + 1;
     maj_stat = gss_import_name(&min_stat, &send_tok, GSS_C_NULL_OID,
        &gss_name);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       security_seterror(&rh->sech, "can't import name %s: %s",
+       security_seterror(&rh->sech, _("can't import name %s: %s"),
            (char *)send_tok.value, gss_error(maj_stat, min_stat));
        amfree(send_tok.value);
        return (-1);
@@ -482,7 +464,7 @@ gss_client(
     amfree(send_tok.value);
     rc->gss_context = GSS_C_NO_CONTEXT;
     maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid);
-    dbprintf(("gss_name %s\n", (char *)AA.value));
+    dbprintf(_("gss_name %s\n"), (char *)AA.value);
 
     /*
      * Perform the context-establishement loop.
@@ -520,7 +502,7 @@ gss_client(
        }
        if (maj_stat != (OM_uint32)GSS_S_COMPLETE && maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED) {
            security_seterror(&rh->sech,
-               "error getting gss context: %s %s",
+               _("error getting gss context: %s %s"),
                gss_error(maj_stat, min_stat), (char *)send_tok.value);
            goto done;
        }
@@ -547,9 +529,9 @@ gss_client(
        if (rvalue <= 0) {
            if (rvalue < 0)
                security_seterror(&rh->sech,
-                   "recv error in gss loop: %s", rc->errmsg);
+                   _("recv error in gss loop: %s"), rc->errmsg);
            else
-               security_seterror(&rh->sech, "EOF in gss loop");
+               security_seterror(&rh->sech, _("EOF in gss loop"));
            goto done;
        }
     }
@@ -580,7 +562,7 @@ gss_server(
     char errbuf[256];
     char *errmsg = NULL;
 
-    k5printf(("gss_server\n"));
+    auth_debug(1, "gss_server\n");
 
     assert(rc != NULL);
 
@@ -591,14 +573,14 @@ gss_server(
      */
     euid = geteuid();
     if (getuid() != 0) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "real uid is %ld, needs to be 0 to read krb5 host key",
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("real uid is %ld, needs to be 0 to read krb5 host key"),
            (long)getuid());
        goto out;
     }
-    if (seteuid(0) < 0) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "can't seteuid to uid 0: %s", strerror(errno));
+    if (!set_root_privs(0)) {
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("can't seteuid to uid 0: %s"), strerror(errno));
        goto out;
     }
 
@@ -612,9 +594,9 @@ gss_server(
     maj_stat = gss_import_name(&min_stat, &send_tok, GSS_C_NULL_OID,
        &gss_name);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       seteuid(euid);
-       snprintf(errbuf, SIZEOF(errbuf),
-           "can't import name %s: %s", (char *)send_tok.value,
+       set_root_privs(0);
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("can't import name %s: %s"), (char *)send_tok.value,
            gss_error(maj_stat, min_stat));
        amfree(send_tok.value);
        goto out;
@@ -622,15 +604,15 @@ gss_server(
     amfree(send_tok.value);
 
     maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid);
-    dbprintf(("gss_name %s\n", (char *)AA.value));
+    dbprintf(_("gss_name %s\n"), (char *)AA.value);
     maj_stat = gss_acquire_cred(&min_stat, gss_name, 0,
        GSS_C_NULL_OID_SET, GSS_C_ACCEPT, &gss_creds, NULL, NULL);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "can't acquire creds for host key host/%s: %s", myhostname,
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("can't acquire creds for host key host/%s: %s"), myhostname,
            gss_error(maj_stat, min_stat));
        gss_release_name(&min_stat, &gss_name);
-       seteuid(euid);
+       set_root_privs(0);
        goto out;
     }
     gss_release_name(&min_stat, &gss_name);
@@ -638,15 +620,16 @@ gss_server(
     for (recv_tok.length = 0;;) {
        recv_tok.value = NULL;
         rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg,
-                                (char **)&recv_tok.value,
+                                /* (void *) is to avoid type-punning warning */
+                                (char **)(void *)&recv_tok.value,
                                 (ssize_t *)&recv_tok.length, 60);
        if (rvalue <= 0) {
            if (rvalue < 0) {
-               snprintf(errbuf, SIZEOF(errbuf),
-                   "recv error in gss loop: %s", rc->errmsg);
+               g_snprintf(errbuf, SIZEOF(errbuf),
+                   _("recv error in gss loop: %s"), rc->errmsg);
                amfree(rc->errmsg);
            } else
-               snprintf(errbuf, SIZEOF(errbuf), "EOF in gss loop");
+               g_snprintf(errbuf, SIZEOF(errbuf), _("EOF in gss loop"));
            goto out;
        }
 
@@ -656,8 +639,8 @@ gss_server(
 
        if (maj_stat != (OM_uint32)GSS_S_COMPLETE &&
            maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED) {
-           snprintf(errbuf, SIZEOF(errbuf),
-               "error accepting context: %s", gss_error(maj_stat, min_stat));
+           g_snprintf(errbuf, SIZEOF(errbuf),
+               _("error accepting context: %s"), gss_error(maj_stat, min_stat));
            amfree(recv_tok.value);
            goto out;
        }
@@ -683,8 +666,8 @@ gss_server(
 
     maj_stat = gss_display_name(&min_stat, gss_name, &send_tok, &doid);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "can't display gss name: %s", gss_error(maj_stat, min_stat));
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("can't display gss name: %s"), gss_error(maj_stat, min_stat));
        gss_release_name(&min_stat, &gss_name);
        goto out;
     }
@@ -692,8 +675,8 @@ gss_server(
 
     /* get rid of the realm */
     if ((p = strchr(send_tok.value, '@')) == NULL) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "malformed gss name: %s", (char *)send_tok.value);
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("malformed gss name: %s"), (char *)send_tok.value);
        amfree(send_tok.value);
        goto out;
     }
@@ -704,8 +687,8 @@ gss_server(
      * If the principal doesn't match, complain
      */
     if ((msg = krb5_checkuser(rc->hostname, send_tok.value, realm)) != NULL) {
-       snprintf(errbuf, SIZEOF(errbuf),
-           "access not allowed from %s: %s", (char *)send_tok.value, msg);
+       g_snprintf(errbuf, SIZEOF(errbuf),
+           _("access not allowed from %s: %s"), (char *)send_tok.value, msg);
        amfree(send_tok.value);
        goto out;
     }
@@ -713,13 +696,13 @@ gss_server(
 
     rval = 0;
 out:
-    seteuid(euid);
+    set_root_privs(0);
     if (rval != 0) {
        rc->errmsg = stralloc(errbuf);
     } else {
        rc->auth = 1;
     }
-    k5printf(("gss_server returning %d\n", rval));
+    auth_debug(1, _("gss_server returning %d\n"), rval);
     return (rval);
 }
 
@@ -752,7 +735,7 @@ krb5_init(void)
     {
        char *ccache;
        ccache = malloc(128);
-       snprintf(ccache, SIZEOF(ccache),
+       g_snprintf(ccache, SIZEOF(ccache),
                 "KRB5_ENV_CCNAME=FILE:/tmp/amanda_ccache.%ld.%ld",
                 (long)geteuid(), (long)getpid());
        putenv(ccache);
@@ -766,7 +749,7 @@ krb5_init(void)
      * In case it isn't fully qualified, do a DNS lookup.  Ignore
      * any errors (this is best-effort).
      */
-    if (try_resolving_hostname(myhostname, &myfqhostname) == 0
+    if (resolve_hostname(myhostname, SOCK_STREAM, NULL, &myfqhostname) == 0
        && myfqhostname != NULL) {
        strncpy(myhostname, myfqhostname, SIZEOF(myhostname)-1);
        myhostname[SIZEOF(myhostname)-1] = '\0';
@@ -789,7 +772,7 @@ cleanup(void)
 {
 #ifdef KDESTROY_VIA_UNLINK
     char ccache[64];
-    snprintf(ccache, SIZEOF(ccache), "/tmp/amanda_ccache.%ld.%ld",
+    g_snprintf(ccache, SIZEOF(ccache), "/tmp/amanda_ccache.%ld.%ld",
         (long)geteuid(), (long)getpid());
     unlink(ccache);
 #else
@@ -825,20 +808,20 @@ get_tgt(
        error = NULL;
     }
     if ((ret = krb5_init_context(&context)) != 0) {
-       error = vstralloc("error initializing krb5 context: ",
-           error_message(ret), NULL);
+       error = vstrallocf(_("error initializing krb5 context: %s"),
+           error_message(ret));
        return (error);
     }
 
     /*krb5_init_ets(context);*/
 
     if(!keytab_name) {
-        error = vstralloc("error  -- no krb5 keytab defined", NULL);
+        error = vstrallocf(_("error  -- no krb5 keytab defined"));
         return(error);
     }
 
     if(!principal_name) {
-        error = vstralloc("error  -- no krb5 principal defined", NULL);
+        error = vstrallocf(_("error  -- no krb5 principal defined"));
         return(error);
     }
 
@@ -846,8 +829,8 @@ get_tgt(
      * Resolve keytab file into a keytab object
      */
     if ((ret = krb5_kt_resolve(context, keytab_name, &keytab)) != 0) {
-       error = vstralloc("error resolving keytab ", keytab_name, ": ",
-           error_message(ret), NULL);
+       error = vstrallocf(_("error resolving keytab %s: %s"), keytab_name, 
+           error_message(ret));
        return (error);
     }
 
@@ -857,8 +840,8 @@ get_tgt(
      */
     ret = krb5_parse_name(context, principal_name, &client);
     if (ret != 0) {
-       error = vstralloc("error parsing ", principal_name, ": ",
-           error_message(ret), NULL);
+       error = vstrallocf(_("error parsing %s: %s"), principal_name,
+           error_message(ret));
        return (error);
     }
 
@@ -880,15 +863,14 @@ get_tgt(
        0);
 #endif
     if (ret != 0) {
-       error = vstralloc("error while building server name: ",
-           error_message(ret), NULL);
+       error = vstrallocf(_("error while building server name: %s"),
+           error_message(ret));
        return (error);
     }
 
     ret = krb5_timeofday(context, &now);
     if (ret != 0) {
-       error = vstralloc("error getting time of day: ", error_message(ret),
-           NULL);
+       error = vstrallocf(_("error getting time of day: %s"), error_message(ret));
        return (error);
     }
 
@@ -906,24 +888,22 @@ get_tgt(
        keytab, 0, &creds, 0);
 
     if (ret != 0) {
-       error = vstralloc("error getting ticket for ", principal_name,
-           ": ", error_message(ret), NULL);
+       error = vstrallocf(_("error getting ticket for %s: %s"),
+           principal_name, error_message(ret));
        goto cleanup2;
     }
 
     if ((ret = krb5_cc_default(context, &ccache)) != 0) {
-       error = vstralloc("error initializing ccache: ", error_message(ret),
-           NULL);
+       error = vstrallocf(_("error initializing ccache: %s"), error_message(ret));
        goto cleanup;
     }
     if ((ret = krb5_cc_initialize(context, ccache, client)) != 0) {
-       error = vstralloc("error initializing ccache: ", error_message(ret),
-           NULL);
+       error = vstrallocf(_("error initializing ccache: %s"), error_message(ret));
        goto cleanup;
     }
     if ((ret = krb5_cc_store_cred(context, ccache, &creds)) != 0) {
-       error = vstralloc("error storing creds in ccache: ",
-           error_message(ret), NULL);
+       error = vstrallocf(_("error storing creds in ccache: %s"), 
+           error_message(ret));
        /* FALLTHROUGH */
     }
     krb5_cc_close(context, ccache);
@@ -988,7 +968,6 @@ gss_error(
     return ((const char *)msg.value);
 }
 
-#ifdef AMANDA_KRB5_ENCRYPT
 static int
 k5_encrypt(
     void *cookie,
@@ -1003,31 +982,36 @@ k5_encrypt(
     OM_uint32 maj_stat, min_stat;
     int conf_state;
 
-    k5printf(("krb5: k5_encrypt: enter %p\n", rc));
-
-    dectok.length = buflen;
-    dectok.value  = buf;    
-
-    if (rc->auth == 1) {
-       assert(rc->gss_context != GSS_C_NO_CONTEXT);
-       maj_stat = gss_seal(&min_stat, rc->gss_context, 1,
-                           GSS_C_QOP_DEFAULT, &dectok, &conf_state, &enctok);
-       if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) {
-           k5printf(("krb5 encrypt error to %s: %s\n",
-                     rc->hostname, gss_error(maj_stat, min_stat)));
-           return (-1);
+    if (rc->conf_fn && rc->conf_fn("kencrypt", rc->datap)) {
+       auth_debug(1, _("krb5: k5_encrypt: enter %p\n"), rc);
+
+       dectok.length = buflen;
+       dectok.value  = buf;    
+
+       if (rc->auth == 1) {
+           assert(rc->gss_context != GSS_C_NO_CONTEXT);
+           maj_stat = gss_seal(&min_stat, rc->gss_context, 1,
+                               GSS_C_QOP_DEFAULT, &dectok, &conf_state,
+                               &enctok);
+           if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) {
+               auth_debug(1, _("krb5 encrypt error to %s: %s\n"),
+                          rc->hostname, gss_error(maj_stat, min_stat));
+               return (-1);
+           }
+           auth_debug(1, _("krb5: k5_encrypt: give %zu bytes\n"),
+                      enctok.length);
+           *encbuf = enctok.value;
+           *encbuflen = enctok.length;
+       } else {
+           *encbuf = buf;
+           *encbuflen = buflen;
        }
-       k5printf(("krb5: k5_encrypt: give %zu bytes\n", enctok.length));
-       *encbuf = enctok.value;
-       *encbuflen = enctok.length;
-    } else {
-       *encbuf = buf;
-       *encbuflen = buflen;
+       auth_debug(1, _("krb5: k5_encrypt: exit\n"));
     }
-       k5printf(("krb5: k5_encrypt: exit\n"));
     return (0);
 }
 
+
 static int
 k5_decrypt(
     void *cookie,
@@ -1042,33 +1026,37 @@ k5_decrypt(
     OM_uint32 maj_stat, min_stat;
     int conf_state, qop_state;
 
-    k5printf(("krb5: k5_decrypt: enter\n"));
-
-    if (rc->auth == 1) {
-       enctok.length = buflen;
-       enctok.value  = buf;    
+    if (rc->conf_fn && rc->conf_fn("kencrypt", rc->datap)) {
+       auth_debug(1, _("krb5: k5_decrypt: enter\n"));
+       if (rc->auth == 1) {
+           enctok.length = buflen;
+           enctok.value  = buf;    
 
-       k5printf(("krb5: k5_decrypt: decrypting %zu bytes\n", enctok.length));
+           auth_debug(1, _("krb5: k5_decrypt: decrypting %zu bytes\n"), enctok.length);
 
-       assert(rc->gss_context != GSS_C_NO_CONTEXT);
-       maj_stat = gss_unseal(&min_stat, rc->gss_context, &enctok, &dectok,
+           assert(rc->gss_context != GSS_C_NO_CONTEXT);
+           maj_stat = gss_unseal(&min_stat, rc->gss_context, &enctok, &dectok,
                              &conf_state, &qop_state);
-       if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-           k5printf(("krb5 decrypt error from %s: %s\n",
-                     rc->hostname, gss_error(maj_stat, min_stat)));
-           return (-1);
+           if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
+               auth_debug(1, _("krb5 decrypt error from %s: %s\n"),
+                          rc->hostname, gss_error(maj_stat, min_stat));
+               return (-1);
+           }
+           auth_debug(1, _("krb5: k5_decrypt: give %zu bytes\n"),
+                      dectok.length);
+           *decbuf = dectok.value;
+           *decbuflen = dectok.length;
+       } else {
+           *decbuf = buf;
+           *decbuflen = buflen;
        }
-       k5printf(("krb5: k5_decrypt: give %zu bytes\n", dectok.length));
-       *decbuf = dectok.value;
-       *decbuflen = dectok.length;
+       auth_debug(1, _("krb5: k5_decrypt: exit\n"));
     } else {
        *decbuf = buf;
        *decbuflen = buflen;
     }
-    k5printf(("krb5: k5_decrypt: exit\n"));
     return (0);
 }
-#endif
 
 /*
  * check ~/.k5amandahosts to see if this principal is allowed in.  If it's
@@ -1083,25 +1071,23 @@ krb5_checkuser( char *  host,
     if(strcmp(name, AMANDA_PRINCIPAL) == 0) {
        return(NULL);
     } else {
-       return(vstralloc("does not match compiled in default"));
+       return(vstrallocf(_("does not match compiled in default")));
     }
 #else
     struct passwd *pwd;
     char *ptmp;
-    char *result = "generic error";    /* default is to not permit */
+    char *result = _("generic error"); /* default is to not permit */
     FILE *fp = NULL;
     struct stat sbuf;
     uid_t localuid;
     char *line = NULL;
     char *filehost = NULL, *fileuser = NULL, *filerealm = NULL;
-    char n1[NUM_STR_SIZE];
-    char n2[NUM_STR_SIZE];
 
     assert( host != NULL);
     assert( name != NULL);
 
     if((pwd = getpwnam(CLIENT_LOGIN)) == NULL) {
-       result = vstralloc("can not find user ", CLIENT_LOGIN, NULL);
+       result = vstrallocf(_("can not find user %s"), CLIENT_LOGIN);
     }
     localuid = pwd->pw_uid;
 
@@ -1112,7 +1098,7 @@ krb5_checkuser( char *    host,
 #endif
 
     if(!ptmp) {
-       result = vstralloc("could not find home directory for ", CLIENT_LOGIN, NULL);
+       result = vstrallocf(_("could not find home directory for %s"), CLIENT_LOGIN);
        goto common_exit;
    }
 
@@ -1125,40 +1111,36 @@ krb5_checkuser( char *  host,
         * the destination user mimicing the .k5login functionality.
         */
         if(strcmp(name, CLIENT_LOGIN) != 0) {
-               result = vstralloc(name, " does not match ",
-                       CLIENT_LOGIN, NULL);
+               result = vstrallocf(_("%s does not match %s"),
+                       name, CLIENT_LOGIN);
                return result;
        }
        result = NULL;
        goto common_exit;
     }
 
-    k5printf(("opening ptmp: %s\n", (ptmp)?ptmp: "NULL!"));
+    auth_debug(1, _("opening ptmp: %s\n"), (ptmp)?ptmp: "NULL!");
     if((fp = fopen(ptmp, "r")) == NULL) {
-       result = vstralloc("can not open ", ptmp, NULL);
+       result = vstrallocf(_("can not open %s"), ptmp);
        return result;
     }
-    k5printf(("opened ptmp\n"));
+    auth_debug(1, _("opened ptmp\n"));
 
     if (fstat(fileno(fp), &sbuf) != 0) {
-       result = vstralloc("cannot fstat ", ptmp, ": ", strerror(errno), NULL);
+       result = vstrallocf(_("cannot fstat %s: %s"), ptmp, strerror(errno));
        goto common_exit;
     }
 
     if (sbuf.st_uid != localuid) {
-       snprintf(n1, SIZEOF(n1), "%ld", (long) sbuf.st_uid);
-       snprintf(n2, SIZEOF(n2), "%ld", (long) localuid);
-       result = vstralloc(ptmp, ": ",
-           "owned by id ", n1,
-           ", should be ", n2,
-           NULL);
+       result = vstrallocf(_("%s is owned by %ld, should be %ld"),
+               ptmp, (long)sbuf.st_uid, (long)localuid);
        goto common_exit;
     }
     if ((sbuf.st_mode & 077) != 0) {
-       result = stralloc2(ptmp,
-           ": incorrect permissions; file must be accessible only by its owner");
+       result = vstrallocf(
+           _("%s: incorrect permissions; file must be accessible only by its owner"), ptmp);
        goto common_exit;
-    }       
+    }
 
     while ((line = agets(fp)) != NULL) {
        if (line[0] == '\0') {
@@ -1166,9 +1148,6 @@ krb5_checkuser( char *    host,
            continue;
        }
 
-#if defined(SHOW_SECURITY_DETAIL)                               /* { */
-       k5printf(("%s: processing line: <%s>\n", debug_prefix(NULL), line));
-#endif                                                          /* } */
        /* if there's more than one column, then it's the host */
        if( (filehost = strtok(line, " \t")) == NULL) {
            amfree(line);
@@ -1188,7 +1167,7 @@ krb5_checkuser( char *    host,
            amfree(line);
            continue;
        } else {
-               k5printf(("found a host match\n"));
+               auth_debug(1, _("found a host match\n"));
        }
 
        if( (filerealm = strchr(fileuser, '@')) != NULL) {
@@ -1203,9 +1182,9 @@ krb5_checkuser( char *    host,
         * You likely only get this far if you've turned on cross-realm auth
         * anyway...
         */
-       k5printf(("comparing %s %s\n", fileuser, name));
+       auth_debug(1, _("comparing %s %s\n"), fileuser, name);
        if(strcmp(fileuser, name) == 0) {
-               k5printf(("found a match!\n"));
+               auth_debug(1, _("found a match!\n"));
                if(realm && filerealm && (strcmp(realm, filerealm)!=0)) {
                        amfree(line);
                        continue;
@@ -1216,21 +1195,10 @@ krb5_checkuser( char *  host,
        }
        amfree(line);
     }
-    result = vstralloc("no match in ", ptmp, NULL);
+    result = vstrallocf(_("no match in %s"), ptmp);
 
 common_exit:
     afclose(fp);
     return(result);
 #endif /* AMANDA_PRINCIPAL */
 }
-
-#else
-
-void krb5_security_dummy(void);
-
-void
-krb5_security_dummy(void)
-{
-}
-
-#endif /* KRB5_SECURITY */
diff --git a/common-src/local-security.c b/common-src/local-security.c
new file mode 100644 (file)
index 0000000..29a946d
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1999 University of Maryland
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+/*
+ * $Id: local-security.c 6512 2007-05-24 17:00:24Z ian $
+ *
+ * local-security.c - security and transport over local or a local-like command.
+ *
+ * XXX still need to check for initial keyword on connect so we can skip
+ * over shell garbage and other stuff that local might want to spew out.
+ */
+
+#include "amanda.h"
+#include "util.h"
+#include "event.h"
+#include "packet.h"
+#include "queue.h"
+#include "security.h"
+#include "security-util.h"
+#include "stream.h"
+#include "version.h"
+
+/*
+ * Number of seconds amandad has to start up
+ */
+#define CONNECT_TIMEOUT 20
+
+/*
+ * Interface functions
+ */
+static void local_connect(const char *, char *(*)(char *, void *),
+                       void (*)(void *, security_handle_t *, security_status_t),
+                       void *, void *);
+
+/*
+ * This is our interface to the outside world.
+ */
+const security_driver_t local_security_driver = {
+    "LOCAL",
+    local_connect,
+    sec_accept,
+    sec_close,
+    stream_sendpkt,
+    stream_recvpkt,
+    stream_recvpkt_cancel,
+    tcpma_stream_server,
+    tcpma_stream_accept,
+    tcpma_stream_client,
+    tcpma_stream_close,
+    sec_stream_auth,
+    sec_stream_id,
+    tcpm_stream_write,
+    tcpm_stream_read,
+    tcpm_stream_read_sync,
+    tcpm_stream_read_cancel,
+    tcpm_close_connection,
+    NULL,
+    NULL
+};
+
+static int newhandle = 1;
+
+/*
+ * Local functions
+ */
+static int runlocal(struct tcp_conn *, const char *, const char *);
+
+
+/*
+ * local version of a security handle allocator.  Logically sets
+ * up a network "connection".
+ */
+static void
+local_connect(
+    const char *       hostname,
+    char *             (*conf_fn)(char *, void *),
+    void               (*fn)(void *, security_handle_t *, security_status_t),
+    void *             arg,
+    void *             datap)
+{
+    struct sec_handle *rh;
+    char *amandad_path=NULL;
+    char *client_username=NULL;
+    char myhostname[MAX_HOSTNAME_LENGTH+1];
+
+    assert(fn != NULL);
+    assert(hostname != NULL);
+
+    auth_debug(1, _("local: local_connect: %s\n"), hostname);
+
+    rh = alloc(SIZEOF(*rh));
+    security_handleinit(&rh->sech, &local_security_driver);
+    rh->hostname = NULL;
+    rh->rs = NULL;
+    rh->ev_timeout = NULL;
+    rh->rc = NULL;
+
+    if (gethostname(myhostname, MAX_HOSTNAME_LENGTH) == -1) {
+       security_seterror(&rh->sech, _("gethostname failed"));
+       (*fn)(arg, &rh->sech, S_ERROR);
+       return;
+    }
+    myhostname[SIZEOF(myhostname)-1] = '\0';
+
+    if (strcmp(hostname, myhostname) != 0 &&
+       match("^localhost(\\.localdomain)?$", hostname) == 0) {
+       security_seterror(&rh->sech,
+           _("%s: is not local"), hostname);
+       (*fn)(arg, &rh->sech, S_ERROR);
+       return;
+    }
+    rh->hostname = stralloc(hostname);
+    rh->rs = tcpma_stream_client(rh, newhandle++);
+
+    if (rh->rs == NULL)
+       goto error;
+
+    amfree(rh->hostname);
+    rh->hostname = stralloc(rh->rs->rc->hostname);
+
+    /*
+     * We need to open a new connection.
+     *
+     * XXX need to eventually limit number of outgoing connections here.
+     */
+    if(conf_fn) {
+       amandad_path    = conf_fn("amandad_path", datap);
+       client_username = conf_fn("client_username", datap);
+    }
+    if(rh->rc->read == -1) {
+       if (runlocal(rh->rs->rc, amandad_path, client_username) < 0) {
+           security_seterror(&rh->sech, _("can't connect to %s: %s"),
+                             hostname, rh->rs->rc->errmsg);
+           goto error;
+       }
+       rh->rc->refcnt++;
+    }
+
+    /*
+     * The socket will be opened async so hosts that are down won't
+     * block everything.  We need to register a write event
+     * so we will know when the socket comes alive.
+     *
+     * Overload rh->rs->ev_read to provide a write event handle.
+     * We also register a timeout.
+     */
+    rh->fn.connect = fn;
+    rh->arg = arg;
+    rh->rs->ev_read = event_register((event_id_t)rh->rs->rc->write, EV_WRITEFD,
+       sec_connect_callback, rh);
+    rh->ev_timeout = event_register((event_id_t)CONNECT_TIMEOUT, EV_TIME,
+       sec_connect_timeout, rh);
+
+    return;
+
+error:
+    (*fn)(arg, &rh->sech, S_ERROR);
+}
+
+/*
+ * Forks a local to the host listed in rc->hostname
+ * Returns negative on error, with an errmsg in rc->errmsg.
+ */
+static int
+runlocal(
+    struct tcp_conn *  rc,
+    const char *       amandad_path,
+    const char *       client_username)
+{
+    int rpipe[2], wpipe[2];
+    char *xamandad_path = (char *)amandad_path;
+
+#ifndef SINGLE_USERID
+    struct passwd *pwd = NULL;
+    uid_t uid = 0;
+    gid_t gid = 0;
+
+    if (getuid() == 0) {
+       if (client_username && strlen(client_username) > 1) {
+           pwd = getpwnam(client_username);
+            if (!pwd) {
+               dbprintf("User '%s' doesn't exist\n", client_username);
+           } else {
+               uid = pwd->pw_uid;
+               gid = pwd->pw_gid;
+           }
+       }
+       if (!pwd) {
+           uid = get_client_uid();
+           gid = get_client_gid();
+       }
+    }
+#endif
+
+    memset(rpipe, -1, SIZEOF(rpipe));
+    memset(wpipe, -1, SIZEOF(wpipe));
+    if (pipe(rpipe) < 0 || pipe(wpipe) < 0) {
+       rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno));
+       return (-1);
+    }
+
+    switch (rc->pid = fork()) {
+    case -1:
+       rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno));
+       aclose(rpipe[0]);
+       aclose(rpipe[1]);
+       aclose(wpipe[0]);
+       aclose(wpipe[1]);
+       return (-1);
+    case 0:
+       dup2(wpipe[0], 0);
+       dup2(rpipe[1], 1);
+       break;
+    default:
+       rc->read = rpipe[0];
+       aclose(rpipe[1]);
+       rc->write = wpipe[1];
+       aclose(wpipe[0]);
+       return (0);
+    }
+
+    safe_fd(-1, 0);
+
+    if(!xamandad_path || strlen(xamandad_path) <= 1) 
+       xamandad_path = vstralloc(amlibexecdir, "/", "amandad",
+                                versionsuffix(), NULL);
+
+#ifndef SINGLE_USERID
+    if (uid != 0)
+       setreuid(uid, uid);
+    if (gid != 0)
+       setregid(gid, gid);
+#endif
+
+    execlp(xamandad_path, xamandad_path,
+          "-auth=local", "amdump", "amindexd", "amidxtaped", (char *)NULL);
+    error(_("error: couldn't exec %s: %s"), xamandad_path, strerror(errno));
+
+    /* should never go here, shut up compiler warning */
+    return(-1);
+}
index dba15c802c28add576135af2f4a85476a2ccfd57..f9ce31ded98bf71d8e8f78bc72b60636fe62957c 100644 (file)
@@ -83,14 +83,14 @@ match(
     if((result = regcomp(&regc, regex,
                         REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("regex \"%s\": %s", regex, errmsg);
+       error(_("regex \"%s\": %s"), regex, errmsg);
        /*NOTREACHED*/
     }
 
     if((result = regexec(&regc, str, 0, 0, 0)) != 0
        && result != REG_NOMATCH) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("regex \"%s\": %s", regex, errmsg);
+       error(_("regex \"%s\": %s"), regex, errmsg);
        /*NOTREACHED*/
     }
 
@@ -136,14 +136,14 @@ match_glob(
     if((result = regcomp(&regc, regex,
                         REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg);
+       error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
        /*NOTREACHED*/
     }
 
     if((result = regexec(&regc, str, 0, 0, 0)) != 0
        && result != REG_NOMATCH) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg);
+       error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
        /*NOTREACHED*/
     }
 
@@ -244,14 +244,14 @@ match_tar(
     if((result = regcomp(&regc, regex,
                         REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg);
+       error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
        /*NOTREACHED*/
     }
 
     if((result = regexec(&regc, str, 0, 0, 0)) != 0
        && result != REG_NOMATCH) {
         regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg);
+       error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
        /*NOTREACHED*/
     }
 
@@ -543,7 +543,7 @@ match_datestamp(
     int match_exact;
 
     if(strlen(dateexp) >= 100 || strlen(dateexp) < 1) {
-       error("Illegal datestamp expression %s",dateexp);
+       error(_("Illegal datestamp expression %s"),dateexp);
        /*NOTREACHED*/
     }
    
@@ -565,7 +565,7 @@ match_datestamp(
 
     if((dash = strchr(mydateexp,'-'))) {
        if(match_exact == 1) {
-           error("Illegal datestamp expression %s",dateexp);
+           error(_("Illegal datestamp expression %s"),dateexp);
            /*NOTREACHED*/
        }
        len = (size_t)(dash - mydateexp);
@@ -605,7 +605,7 @@ match_level(
     int match_exact;
 
     if(strlen(levelexp) >= 100 || strlen(levelexp) < 1) {
-       error("Illegal level expression %s",levelexp);
+       error(_("Illegal level expression %s"),levelexp);
        /*NOTREACHED*/
     }
    
@@ -627,7 +627,7 @@ match_level(
 
     if((dash = strchr(mylevelexp,'-'))) {
        if(match_exact == 1) {
-           error("Illegal level expression %s",levelexp);
+           error(_("Illegal level expression %s"),levelexp);
            /*NOTREACHED*/
        }
        len = (size_t)(dash - mylevelexp);
index 87b5f5043448ec956dd55cb0cc4340c7420cf975..c161f95c9f3a7c1019d555e6a6590138815f3684 100644 (file)
@@ -72,14 +72,15 @@ printf_arglist_function2(void pkt_init, pkt_t *, pkt, pktype_t, type,
 
     assert(pkt != NULL);
     assert(strcmp(pkt_type2str(type), "BOGUS") != 0);
-    assert(fmt != NULL);
+    if(fmt == NULL)
+       fmt = "";
 
     pkt->type = type;
     pkt->packet_size = 1000;
     pkt->body = alloc(pkt->packet_size);
     while(1) {
        arglist_start(argp, fmt);
-       len = vsnprintf(pkt->body, pkt->packet_size, fmt, argp);
+       len = g_vsnprintf(pkt->body, pkt->packet_size, fmt, argp);
        arglist_end(argp);
        if (len > -1 && len < (int)(pkt->packet_size - 1))
            break;
@@ -107,7 +108,7 @@ printf_arglist_function1(void pkt_cat, pkt_t *, pkt, const char *, fmt)
 
     while(1) {
        arglist_start(argp, fmt);
-        lenX = vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp);
+        lenX = g_vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp);
        arglist_end(argp);
        if (lenX > -1 && lenX < (int)(pkt->packet_size - len - 1))
            break;
index cd40615698df3b84c1146ca084f0dbb0b6a09b2c..cc117f66eae2e4e93c1f0612bbae04319d76ae8a 100644 (file)
@@ -44,13 +44,13 @@ typedef struct {
  */
 void pkt_init_empty(pkt_t *pkt, pktype_t type);
 void pkt_init(pkt_t *, pktype_t, const char *, ...)
-    __attribute__ ((format (printf, 3, 4)));
+     G_GNUC_PRINTF(3,4);
 
 /*
  * Append data to a packet
  */
 void pkt_cat(pkt_t *, const char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 
 /*
  * Convert the packet type to and from a string
index 09553b6ce3db42d0112619ff341c2f67209b53e0..16fd67cdda4dfc916cd0e3dc71ec8bd8001049dc 100644 (file)
@@ -83,6 +83,8 @@ pipespawnv_passwd(
     char **arg;
     char *e;
     char **env;
+    char *cmdline;
+    char *quoted;
     char **newenv;
     char *passwdvar = NULL;
     int  *passwdfd = NULL;
@@ -90,8 +92,6 @@ pipespawnv_passwd(
     /*
      * Log the command line and count the args.
      */
-    dbprintf(("%s: spawning %s in pipeline\n", debug_prefix_time(NULL), prog));
-    dbprintf(("%s: argument list:", debug_prefix_time(NULL)));
     if ((pipedef & PASSWD_PIPE) != 0) {
        passwdvar = *my_argv++;
        passwdfd  = (int *)*my_argv++;
@@ -101,42 +101,42 @@ pipespawnv_passwd(
     memset(errpipe, -1, SIZEOF(errpipe));
     memset(passwdpipe, -1, SIZEOF(passwdpipe));
     argc = 0;
-    for(arg = my_argv; *arg != NULL; arg++) {
-       char *quoted;
 
+    cmdline = stralloc(prog);
+    for(arg = my_argv; *arg != NULL; arg++) {
        if (*arg != skip_argument) {
            argc++;
            quoted = quote_string(*arg);
-           dbprintf((" %s", quoted));
+           cmdline = vstrextend(&cmdline, " ", quoted, NULL);
            amfree(quoted);
        }
     }
-    dbprintf(("\n"));
+    dbprintf(_("Spawning \"%s\" in pipeline\n"), cmdline);
 
     /*
      * Create the pipes
      */
     if ((pipedef & STDIN_PIPE) != 0) {
        if(pipe(inpipe) == -1) {
-           error("error [open pipe to %s: %s]", prog, strerror(errno));
+           error(_("error [open pipe to %s: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
     }
     if ((pipedef & STDOUT_PIPE) != 0) {
        if(pipe(outpipe) == -1) {
-           error("error [open pipe to %s: %s]", prog, strerror(errno));
+           error(_("error [open pipe to %s: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
     }
     if ((pipedef & STDERR_PIPE) != 0) {
        if(pipe(errpipe) == -1) {
-           error("error [open pipe to %s: %s]", prog, strerror(errno));
+           error(_("error [open pipe to %s: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
     }
     if ((pipedef & PASSWD_PIPE) != 0) {
        if(pipe(passwdpipe) == -1) {
-           error("error [open pipe to %s: %s]", prog, strerror(errno));
+           error(_("error [open pipe to %s: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
     }
@@ -147,7 +147,7 @@ pipespawnv_passwd(
     switch(pid = fork()) {
     case -1:
        e = strerror(errno);
-       error("error [fork %s: %s]", prog, e);
+       error(_("error [fork %s: %s]"), prog, e);
        /*NOTREACHED*/
 
     default:   /* parent process */
@@ -192,15 +192,15 @@ pipespawnv_passwd(
         * Shift the pipes to the standard file descriptors as requested.
         */
        if(dup2(inpipe[0], 0) == -1) {
-           error("error [spawn %s: dup2 in: %s]", prog, strerror(errno));
+           error(_("error [spawn %s: dup2 in: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
        if(dup2(outpipe[1], 1) == -1) {
-           error("error [spawn %s: dup2 out: %s]", prog, strerror(errno));
+           error(_("error [spawn %s: dup2 out: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
        if(dup2(errpipe[1], 2) == -1) {
-           error("error [spawn %s: dup2 err: %s]", prog, strerror(errno));
+           error(_("error [spawn %s: dup2 err: %s]"), prog, strerror(errno));
            /*NOTREACHED*/
        }
 
@@ -213,19 +213,23 @@ pipespawnv_passwd(
            for (i = 0; env[i] != NULL; i++)
                (void)i; /* make lint happy and do nothing */   
            newenv = (char **)alloc((i + 1 + 1) * SIZEOF(*newenv));
-           snprintf(number, SIZEOF(number), "%d", passwdpipe[0]);
+           g_snprintf(number, SIZEOF(number), "%d", passwdpipe[0]);
            newenv[0] = vstralloc(passwdvar, "=", number, NULL);
            for(i = 0; env[i] != NULL; i++)
                newenv[i + 1] = env[i];
            newenv[i + 1] = NULL;
            amfree(env);
            env = newenv;
+           safe_fd(passwdpipe[0], 1);
+       } else {
+           safe_fd(-1, 0);
        }
 
        execve(prog, my_argv, env);
        e = strerror(errno);
-       error("error [exec %s: %s]", prog, e);
+       error(_("error [exec %s: %s]"), prog, e);
        /*NOTREACHED*/
     }
+    amfree(cmdline);
     return pid;
 }
index 4b3f54ffd02db456644cd82e37b25b141483f294..da587042749e6679fc4150c9c150783612291259 100644 (file)
 #include "security.h"
 #include "protocol.h"
 
-#define proto_debug(i,x) do {                          \
-       if ((i) <= debug_protocol) {    \
-           dbprintf(x);                                \
-       }                                               \
+#define proto_debug(i, ...) do {       \
+       if ((i) <= debug_protocol) {    \
+           dbprintf(__VA_ARGS__);      \
+       }                               \
 } while (0)
 
 /*
@@ -170,8 +170,8 @@ protocol_sendreq(
     p->continuation = continuation;
     p->datap = datap;
 
-    proto_debug(1, ("%s: security_connect: host %s -> p %p\n"
-                   debug_prefix_time(": protocol"), hostname, p));
+    proto_debug(1, _("protocol: security_connect: host %s -> p %p\n")
+                   hostname, p);
 
     security_connect(p->security_driver, p->hostname, conf_fn, connect_callback,
                         p, p->datap);
@@ -196,8 +196,7 @@ connect_callback(
     assert(p != NULL);
     p->security_handle = security_handle;
 
-    proto_debug(1, ("%s: connect_callback: p %p\n",
-                   debug_prefix_time(": protocol"), p));
+    proto_debug(1, _("protocol: connect_callback: p %p\n"), p);
 
     switch (status) {
     case S_OK:
@@ -205,7 +204,7 @@ connect_callback(
        break;
 
     case S_TIMEOUT:
-       security_seterror(p->security_handle, "timeout during connect");
+       security_seterror(p->security_handle, _("timeout during connect"));
        /* FALLTHROUGH */
 
     case S_ERROR:
@@ -217,8 +216,8 @@ connect_callback(
        if (--p->connecttries == 0) {
            state_machine(p, PA_ABORT, NULL);
        } else {
-           proto_debug(1, ("%s: connect_callback: p %p: retrying %s\n",
-                           debug_prefix_time(": protocol"), p, p->hostname));
+           proto_debug(1, _("protocol: connect_callback: p %p: retrying %s\n"),
+                           p, p->hostname);
            security_close(p->security_handle);
            /* XXX overload p->security handle to hold the event handle */
            p->security_handle =
@@ -301,24 +300,22 @@ state_machine(
     pstate_t curstate;
     p_action_t retaction;
 
-    proto_debug(1, ("protocol: state_machine: initial: p %p action %s pkt %p\n",
-                   p, action2str(action), (void *)NULL));
+    proto_debug(1, _("protocol: state_machine: initial: p %p action %s pkt %p\n"),
+                   p, action2str(action), (void *)NULL);
 
     assert(p != NULL);
     assert(action == PA_RCVDATA || pkt == NULL);
     assert(p->state != NULL);
 
     for (;;) {
-       proto_debug(1, ("%s: state_machine: p %p state %s action %s\n",
-                       debug_prefix_time(": protocol"),
-                       p, pstate2str(p->state), action2str(action)));
+       proto_debug(1, _("protocol: state_machine: p %p state %s action %s\n"),
+                       p, pstate2str(p->state), action2str(action));
        if (pkt != NULL) {
-           proto_debug(1, ("%s: pkt: %s (t %d) orig REQ (t %d cur %d)\n",
-                           debug_prefix_time(": protocol"),
+           proto_debug(1, _("protocol: pkt: %s (t %d) orig REQ (t %d cur %d)\n"),
                            pkt_type2str(pkt->type), (int)CURTIME,
-                           (int)p->origtime, (int)p->curtime));
-           proto_debug(1, ("%s: pkt contents:\n-----\n%s-----\n",
-                           debug_prefix_time(": protocol"), pkt->body));
+                           (int)p->origtime, (int)p->curtime);
+           proto_debug(1, _("protocol: pkt contents:\n-----\n%s-----\n"),
+                           pkt->body);
        }
 
        /*
@@ -344,9 +341,8 @@ state_machine(
             */
            retaction = (*curstate)(p, action, pkt);
 
-       proto_debug(1, ("%s: state_machine: p %p state %s returned %s\n",
-                       debug_prefix_time(": protocol"),
-                       p, pstate2str(p->state), action2str(retaction)));
+       proto_debug(1, _("protocol: state_machine: p %p state %s returned %s\n"),
+                       p, pstate2str(p->state), action2str(retaction));
 
        /*
         * The state function is expected to return one of the following
@@ -364,9 +360,8 @@ state_machine(
            /* FALLTHROUGH */
 
        case PA_PENDING:
-           proto_debug(1, ("%s: state_machine: p %p state %s: timeout %d\n",
-                           debug_prefix_time(": protocol"),
-                           p, pstate2str(p->state), (int)p->timeout));
+           proto_debug(1, _("protocol: state_machine: p %p state %s: timeout %d\n"),
+                           p, pstate2str(p->state), (int)p->timeout);
            /*
             * Get the security layer to register a receive event for this
             * security handle on our behalf.  Have it timeout in p->timeout
@@ -382,10 +377,9 @@ state_machine(
         */
        case PA_CONTINUE:
            assert(p->state != curstate);
-           proto_debug(1, ("%s: state_machine: p %p: moved from %s to %s\n",
-                           debug_prefix_time(": protocol"),
+           proto_debug(1, _("protocol: state_machine: p %p: moved from %s to %s\n"),
                            p, pstate2str(curstate),
-                           pstate2str(p->state)));
+                           pstate2str(p->state));
            continue;
 
        /*
@@ -442,7 +436,7 @@ s_sendreq(
 
     if (security_sendpkt(p->security_handle, &p->req) < 0) {
        /* XXX should retry */
-       security_seterror(p->security_handle, "error sending REQ: %s",
+       security_seterror(p->security_handle, _("error sending REQ: %s"),
            security_geterror(p->security_handle));
        return (PA_ABORT);
     }
@@ -491,7 +485,7 @@ s_ackwait(
        assert(pkt == NULL);
 
        if (--p->reqtries == 0) {
-           security_seterror(p->security_handle, "timeout waiting for ACK");
+           security_seterror(p->security_handle, _("timeout waiting for ACK"));
            return (PA_ABORT);
        }
 
@@ -567,7 +561,7 @@ s_repwait(
         * return.
         */
        if (p->resettries == 0 || DROP_DEAD_TIME(p->origtime)) {
-           security_seterror(p->security_handle, "timeout waiting for REP");
+           security_seterror(p->security_handle, _("timeout waiting for REP"));
            return (PA_ABORT);
        }
 
@@ -582,6 +576,10 @@ s_repwait(
 
     assert(action == PA_RCVDATA);
 
+    /* Finish if we get a NAK */
+    if (pkt->type == P_NAK)
+       return (PA_FINISH);
+
     /*
      * We've received some data.  If we didn't get a reply,
      * requeue the packet and retry.  Otherwise, acknowledge
@@ -595,7 +593,7 @@ s_repwait(
        if (security_sendpkt(p->security_handle, &ack) < 0) {
            /* XXX should retry */
            amfree(ack.body);
-           security_seterror(p->security_handle, "error sending ACK: %s",
+           security_seterror(p->security_handle, _("error sending ACK: %s"),
                security_geterror(p->security_handle));
            return (PA_ABORT);
        }
@@ -667,7 +665,7 @@ pstate2str(
     for (i = 0; i < ASIZE(pstates); i++)
        if (pstate == pstates[i].type)
            return (pstates[i].name);
-    return ("BOGUS PSTATE");
+    return (_("BOGUS PSTATE"));
 }
 
 /*
@@ -698,5 +696,5 @@ action2str(
     for (i = 0; i < ASIZE(actions); i++)
        if (action == actions[i].type)
            return (actions[i].name);
-    return ("BOGUS ACTION");
+    return (_("BOGUS ACTION"));
 }
index c98aed744d5cadd2bcdfde852afc9f87f405f77f..26914c6845f1433b0a2445df54fe2a03155a969f 100644 (file)
@@ -43,8 +43,6 @@
 #include "stream.h"
 #include "version.h"
 
-#ifdef RSH_SECURITY
-
 /*
  * Path to the rsh binary.  This should be configurable.
  */
@@ -125,8 +123,7 @@ rsh_connect(
     assert(fn != NULL);
     assert(hostname != NULL);
 
-    auth_debug(1, ("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL),
-                  hostname));
+    auth_debug(1, _("rsh: rsh_connect: %s\n"), hostname);
 
     rh = alloc(SIZEOF(*rh));
     security_handleinit(&rh->sech, &rsh_security_driver);
@@ -136,9 +133,9 @@ rsh_connect(
     rh->rc = NULL;
 
     rh->hostname = NULL;
-    if (try_resolving_hostname(hostname, &rh->hostname)) {
+    if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) {
        security_seterror(&rh->sech,
-           "%s: could not resolve hostname", hostname);
+           _("%s: could not resolve hostname"), hostname);
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
@@ -161,7 +158,7 @@ rsh_connect(
     }
     if(rh->rc->read == -1) {
        if (runrsh(rh->rs->rc, amandad_path, client_username) < 0) {
-           security_seterror(&rh->sech, "can't connect to %s: %s",
+           security_seterror(&rh->sech, _("can't connect to %s: %s"),
                              hostname, rh->rs->rc->errmsg);
            goto error;
        }
@@ -206,13 +203,13 @@ runrsh(
     memset(rpipe, -1, SIZEOF(rpipe));
     memset(wpipe, -1, SIZEOF(wpipe));
     if (pipe(rpipe) < 0 || pipe(wpipe) < 0) {
-       rc->errmsg = newvstralloc(rc->errmsg, "pipe: ", strerror(errno), NULL);
+       rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno));
        return (-1);
     }
 
     switch (rc->pid = fork()) {
     case -1:
-       rc->errmsg = newvstralloc(rc->errmsg, "fork: ", strerror(errno), NULL);
+       rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno));
        aclose(rpipe[0]);
        aclose(rpipe[1]);
        aclose(wpipe[0]);
@@ -233,7 +230,7 @@ runrsh(
     safe_fd(-1, 0);
 
     if(!xamandad_path || strlen(xamandad_path) <= 1) 
-       xamandad_path = vstralloc(libexecdir, "/", "amandad",
+       xamandad_path = vstralloc(amlibexecdir, "/", "amandad",
                                 versionsuffix(), NULL);
     if(!xclient_username || strlen(xclient_username) <= 1)
        xclient_username = CLIENT_LOGIN;
@@ -241,10 +238,8 @@ runrsh(
     execlp(RSH_PATH, RSH_PATH, "-l", xclient_username,
           rc->hostname, xamandad_path, "-auth=rsh", "amdump", "amindexd",
           "amidxtaped", (char *)NULL);
-    error("error: couldn't exec %s: %s", RSH_PATH, strerror(errno));
+    error(_("error: couldn't exec %s: %s"), RSH_PATH, strerror(errno));
 
     /* should never go here, shut up compiler warning */
     return(-1);
 }
-
-#endif /* RSH_SECURITY */
index 4035cbad58d2876bd0be817aec96572b13001d4f..e326258d6dc208ac9633c0ef791917e9bec1f4c9 100644 (file)
@@ -42,6 +42,7 @@
 #include "security-util.h"
 #include "stream.h"
 #include "version.h"
+#include "sockaddr-util.h"
 
 /*
  * Magic values for sec_conn->handle
@@ -103,9 +104,11 @@ sec_stream_id(
 void
 sec_accept(
     const security_driver_t *driver,
+    char       *(*conf_fn)(char *, void *),
     int                in,
     int                out,
-    void       (*fn)(security_handle_t *, pkt_t *))
+    void       (*fn)(security_handle_t *, pkt_t *),
+    void       *datap)
 {
     struct tcp_conn *rc;
 
@@ -114,6 +117,8 @@ sec_accept(
     rc->write = out;
     rc->accept_fn = fn;
     rc->driver = driver;
+    rc->conf_fn = conf_fn;
+    rc->datap = datap;
     sec_tcp_conn_read(rc);
 }
 
@@ -128,8 +133,7 @@ sec_close(
 
     assert(rh != NULL);
 
-    auth_debug(1, ("%s: sec: closing handle to %s\n", debug_prefix_time(NULL),
-                  rh->hostname));
+    auth_debug(1, _("sec: closing handle to %s\n"), rh->hostname);
 
     if (rh->rs != NULL) {
        /* This may be null if we get here on an error */
@@ -206,8 +210,7 @@ stream_sendpkt(
     assert(rh != NULL);
     assert(pkt != NULL);
 
-    auth_debug(1, ("%s: sec: stream_sendpkt: enter\n",
-                  debug_prefix_time(NULL)));
+    auth_debug(1, _("sec: stream_sendpkt: enter\n"));
 
     if (rh->rc->prefix_packet)
        s = rh->rc->prefix_packet(rh, pkt);
@@ -222,9 +225,8 @@ stream_sendpkt(
        amfree(s);
 
     auth_debug(1,
-     ("%s: sec: stream_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n",
-      debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
-      strlen(pkt->body), pkt->body));
+     _("sec: stream_sendpkt: %s (%d) pkt_t (len %zu) contains:\n\n\"%s\"\n\n"),
+      pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body);
 
     if (security_stream_write(&rh->rs->secstr, buf, len) < 0) {
        security_seterror(&rh->sech, security_stream_geterror(&rh->rs->secstr));
@@ -249,8 +251,7 @@ stream_recvpkt(
 
     assert(rh != NULL);
 
-    auth_debug(1, ("%s: sec: recvpkt registered for %s\n",
-                  debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, _("sec: recvpkt registered for %s\n"), rh->hostname);
 
     /*
      * Reset any pending timeout on this handle
@@ -283,8 +284,7 @@ stream_recvpkt_timeout(
 
     assert(rh != NULL);
 
-    auth_debug(1, ("%s: sec: recvpkt timeout for %s\n",
-                  debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, _("sec: recvpkt timeout for %s\n"), rh->hostname);
 
     stream_recvpkt_cancel(rh);
     (*rh->fn.recvpkt)(rh->arg, NULL, S_TIMEOUT);
@@ -299,8 +299,7 @@ stream_recvpkt_cancel(
 {
     struct sec_handle *rh = cookie;
 
-    auth_debug(1, ("%s: sec: cancelling recvpkt for %s\n",
-                  debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, _("sec: cancelling recvpkt for %s\n"), rh->hostname);
 
     assert(rh != NULL);
 
@@ -325,9 +324,9 @@ tcpm_stream_write(
     assert(rs != NULL);
     assert(rs->rc != NULL);
 
-    auth_debug(1, ("%s: sec: stream_write: writing " SIZE_T_FMT " bytes to %s:%d %d\n",
-                  debug_prefix_time(NULL), size, rs->rc->hostname, rs->handle,
-                  rs->rc->write));
+    auth_debug(1, _("sec: stream_write: writing %zu bytes to %s:%d %d\n"),
+                  size, rs->rc->hostname, rs->handle,
+                  rs->rc->write);
 
     if (tcpm_send_token(rs->rc, rs->rc->write, rs->handle, &rs->rc->errmsg,
                             buf, size)) {
@@ -421,8 +420,8 @@ tcpm_send_token(
     const void *buf,
     size_t     len)
 {
-    uint32_t           nethandle;
-    uint32_t           netlength;
+    guint32            nethandle;
+    guint32            netlength;
     struct iovec       iov[3];
     int                        nb_iov = 3;
     int                        rval;
@@ -431,8 +430,8 @@ tcpm_send_token(
 
     assert(SIZEOF(netlength) == 4);
 
-    auth_debug(1, ("%s: tcpm_send_token: write %zd bytes to handle %d\n",
-         debug_prefix_time(NULL), len, handle));
+    auth_debug(1, "tcpm_send_token: write %zd bytes to handle %d\n",
+         len, handle);
     /*
      * Format is:
      *   32 bit length (network byte order)
@@ -443,7 +442,7 @@ tcpm_send_token(
     iov[0].iov_base = (void *)&netlength;
     iov[0].iov_len = SIZEOF(netlength);
 
-    nethandle = htonl((uint32_t)handle);
+    nethandle = htonl((guint32)handle);
     iov[1].iov_base = (void *)&nethandle;
     iov[1].iov_len = SIZEOF(nethandle);
 
@@ -474,8 +473,8 @@ tcpm_send_token(
 
     if (rval < 0) {
        if (errmsg)
-            *errmsg = newvstralloc(*errmsg, "write error to ",
-                                  ": ", strerror(errno), NULL);
+            *errmsg = newvstrallocf(*errmsg, _("write error to: %s"),
+                                  strerror(errno));
         return (-1);
     }
     return (0);
@@ -505,17 +504,14 @@ tcpm_recv_token(
     switch (net_read(fd, &netint, SIZEOF(netint), timeout)) {
     case -1:
        if (errmsg)
-           *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno),
-                                  NULL);
-       auth_debug(1, ("%s: tcpm_recv_token: A return(-1)\n",
-                      debug_prefix_time(NULL)));
+           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
+       auth_debug(1, _("tcpm_recv_token: A return(-1)\n"));
        return (-1);
     case 0:
        *size = 0;
        *handle = H_EOF;
-       *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL);
-       auth_debug(1, ("%s: tcpm_recv_token: A return(0)\n",
-                      debug_prefix_time(NULL)));
+       *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
+       auth_debug(1, _("tcpm_recv_token: A return(0)\n"));
        return (0);
     default:
        break;
@@ -544,23 +540,21 @@ tcpm_recv_token(
            s[6] = (*handle >> 8 ) & 0xFF;
            s[7] = (*handle      ) & 0xFF;
            i = 8; s[i] = ' ';
-           while(i<100 && isprint(s[i]) && s[i] != '\n') {
+           while(i<100 && isprint((int)s[i]) && s[i] != '\n') {
                switch(net_read(fd, &s[i], 1, 0)) {
                case -1: s[i] = '\0'; break;
                case  0: s[i] = '\0'; break;
-               default: dbprintf(("read: %c\n", s[i])); i++; s[i]=' ';break;
+               default:
+                        dbprintf(_("read: %c\n"), s[i]); i++; s[i]=' ';
+                        break;
                }
            }
            s[i] = '\0';
-           *errmsg = newvstralloc(*errmsg, "tcpm_recv_token: invalid size: ",
-                                  s, NULL);
-           dbprintf(("%s: tcpm_recv_token: invalid size: %s\n",
-                     debug_prefix_time(NULL), s));
+           *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size: %s"), s);
+           dbprintf(_("tcpm_recv_token: invalid size %s\n"), s);
        } else {
-           *errmsg = newvstralloc(*errmsg, "tcpm_recv_token: invalid size",
-                                  NULL);
-           dbprintf(("%s: tcpm_recv_token: invalid size " SSIZE_T_FMT "\n",
-                     debug_prefix_time(NULL), *size));
+           *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size"));
+           dbprintf(_("tcpm_recv_token: invalid size %zd\n"), *size);
        }
        *size = -1;
        return -1;
@@ -569,41 +563,34 @@ tcpm_recv_token(
     *buf = alloc((size_t)*size);
 
     if(*size == 0) {
-       auth_debug(1, ("%s: tcpm_recv_token: read EOF from %d\n",
-                      debug_prefix_time(NULL), *handle));
-       *errmsg = newvstralloc(*errmsg, "EOF",
-                                  NULL);
+       auth_debug(1, _("tcpm_recv_token: read EOF from %d\n"), *handle);
+       *errmsg = newvstrallocf(*errmsg, _("EOF"));
        return 0;
     }
     switch (net_read(fd, *buf, (size_t)*size, timeout)) {
     case -1:
        if (errmsg)
-           *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno),
-                                  NULL);
-       auth_debug(1, ("%s: tcpm_recv_token: B return(-1)\n",
-                      debug_prefix_time(NULL)));
+           *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno));
+       auth_debug(1, _("tcpm_recv_token: B return(-1)\n"));
        return (-1);
     case 0:
        *size = 0;
-       *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL);
-       auth_debug(1, ("%s: tcpm_recv_token: B return(0)\n",
-                      debug_prefix_time(NULL)));
+       *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF"));
+       auth_debug(1, _("tcpm_recv_token: B return(0)\n"));
        return (0);
     default:
        break;
     }
 
-    auth_debug(1, ("%s: tcpm_recv_token: read " SSIZE_T_FMT " bytes from %d\n",
-                  debug_prefix_time(NULL), *size, *handle));
+    auth_debug(1, _("tcpm_recv_token: read %zd bytes from %d\n"), *size, *handle);
 
     if (*size > 0 && rc->driver->data_decrypt != NULL) {
-       char *decbuf;
+       void *decbuf;
        ssize_t decsize;
-       /* (the extra (void *) cast is to quiet type-punning warnings) */
-       rc->driver->data_decrypt(rc, *buf, *size, (void **)(void *)&decbuf, &decsize);
-       if (*buf != decbuf) {
+       rc->driver->data_decrypt(rc, *buf, *size, &decbuf, &decsize);
+       if (*buf != (char *)decbuf) {
            amfree(*buf);
-           *buf = decbuf;
+           *buf = (char *)decbuf;
        }
        *size = decsize;
     }
@@ -657,7 +644,7 @@ tcpma_stream_client(
 
     if (id <= 0) {
        security_seterror(&rh->sech,
-           "%d: invalid security stream id", id);
+           _("%d: invalid security stream id"), id);
        return (NULL);
     }
 
@@ -677,8 +664,7 @@ tcpma_stream_client(
        rh->rc = rs->rc;
     }
 
-    auth_debug(1, ("%s: sec: stream_client: connected to stream %d\n",
-                  debug_prefix_time(NULL), id));
+    auth_debug(1, _("sec: stream_client: connected to stream %d\n"), id);
 
     return (rs);
 }
@@ -715,7 +701,7 @@ tcpma_stream_server(
     if (rs->rc->read < 0) {
        sec_tcp_conn_put(rs->rc);
        amfree(rs);
-       security_seterror(&rh->sech, "lost connection to %s", rh->hostname);
+       security_seterror(&rh->sech, _("lost connection to %s"), rh->hostname);
        return (NULL);
     }
     assert(strcmp(rh->hostname, rs->rc->hostname) == 0);
@@ -725,8 +711,7 @@ tcpma_stream_server(
      */
     rs->handle = 500000 - newhandle++;
     rs->ev_read = NULL;
-    auth_debug(1, ("%s: sec: stream_server: created stream %d\n",
-                  debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, _("sec: stream_server: created stream %d\n"), rs->handle);
     return (rs);
 }
 
@@ -742,8 +727,7 @@ tcpma_stream_close(
 
     assert(rs != NULL);
 
-    auth_debug(1, ("%s: sec: tcpma_stream_close: closing stream %d\n",
-                  debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, _("sec: tcpma_stream_close: closing stream %d\n"), rs->handle);
 
     if(rs->closed_by_network == 0 && rs->rc->write != -1)
        tcpm_stream_write(rs, &buf, 0);
@@ -780,11 +764,11 @@ tcp1_stream_server(
        rh->rc = sec_tcp_conn_get(rh->hostname, 1);
        rh->rc->driver = rh->sech.driver;
        rs->rc = rh->rc;
-       rs->socket = stream_server(&rs->port, STREAM_BUFSIZE, 
-               STREAM_BUFSIZE, 0);
+       rs->socket = stream_server(rh->udp->peer.ss_family, &rs->port,
+                                  STREAM_BUFSIZE, STREAM_BUFSIZE, 0);
        if (rs->socket < 0) {
            security_seterror(&rh->sech,
-                           "can't create server stream: %s", strerror(errno));
+                           _("can't create server stream: %s"), strerror(errno));
            amfree(rs);
            return (NULL);
        }
@@ -815,7 +799,7 @@ tcp1_stream_accept(
        bs->fd = stream_accept(bs->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE);
        if (bs->fd < 0) {
            security_stream_seterror(&bs->secstr,
-                                    "can't accept new stream connection: %s",
+                                    _("can't accept new stream connection: %s"),
                                     strerror(errno));
            return (-1);
        }
@@ -856,7 +840,7 @@ tcp1_stream_client(
                        STREAM_BUFSIZE, STREAM_BUFSIZE, &rs->port, 0);
        if (rh->rc->read < 0) {
            security_seterror(&rh->sech,
-                             "can't connect stream to %s port %d: %s",
+                             _("can't connect stream to %s port %d: %s"),
                               rh->hostname, id, strerror(errno));
            amfree(rs);
            return (NULL);
@@ -880,7 +864,7 @@ tcp_stream_write(
 
     if (fullwrite(rs->fd, buf, size) < 0) {
         security_stream_seterror(&rs->secstr,
-            "write error on stream %d: %s", rs->port, strerror(errno));
+            _("write error on stream %d: %s"), rs->port, strerror(errno));
         return (-1);
     }
     return (0);
@@ -900,7 +884,7 @@ bsd_prefix_packet(
 
     if ((pwd = getpwuid(getuid())) == NULL) {
        security_seterror(&rh->sech,
-                         "can't get login name for my uid %ld",
+                         _("can't get login name for my uid %ld"),
                          (long)getuid());
        return(NULL);
     }
@@ -982,7 +966,7 @@ bsd_recv_security_ok(
     port = SS_GET_PORT(&rh->peer);
        if (port >= IPPORT_RESERVED) {
            security_seterror(&rh->sech,
-               "host %s: port %u not secure", rh->hostname,
+               _("host %s: port %u not secure"), rh->hostname,
                (unsigned int)port);
            amfree(service);
            amfree(security_line);
@@ -991,7 +975,7 @@ bsd_recv_security_ok(
 
        if (!service) {
            security_seterror(&rh->sech,
-                             "packet as no SERVICE line");
+                             _("packet as no SERVICE line"));
            amfree(security_line);
            return (-1);
        }
@@ -1007,7 +991,7 @@ bsd_recv_security_ok(
        /* there must be some security info */
        if (security == NULL) {
            security_seterror(&rh->sech,
-               "no bsd SECURITY for P_REQ");
+               _("no bsd SECURITY for P_REQ"));
            amfree(service);
            return (-1);
        }
@@ -1015,14 +999,14 @@ bsd_recv_security_ok(
        /* second word must be USER */
        if ((tok = strtok(security, " ")) == NULL) {
            security_seterror(&rh->sech,
-               "SECURITY line: %s", security_line);
+               _("SECURITY line: %s"), security_line);
            amfree(service);
            amfree(security_line);
            return (-1);        /* default errmsg */
        }
        if (strcmp(tok, "USER") != 0) {
            security_seterror(&rh->sech,
-               "REQ SECURITY line parse error, expecting USER, got %s", tok);
+               _("REQ SECURITY line parse error, expecting USER, got %s"), tok);
            amfree(service);
            amfree(security_line);
            return (-1);
@@ -1031,7 +1015,7 @@ bsd_recv_security_ok(
        /* the third word is the username */
        if ((tok = strtok(NULL, "")) == NULL) {
            security_seterror(&rh->sech,
-               "SECURITY line: %s", security_line);
+               _("SECURITY line: %s"), security_line);
            amfree(security_line);
            return (-1);        /* default errmsg */
        }
@@ -1074,7 +1058,7 @@ udpbsd_sendpkt(
     assert(rh != NULL);
     assert(pkt != NULL);
 
-    auth_debug(1, ("%s: udpbsd_sendpkt: enter\n", get_pname()));
+    auth_debug(1, _("udpbsd_sendpkt: enter\n"));
     /*
      * Initialize this datagram, and add the header
      */
@@ -1092,10 +1076,10 @@ udpbsd_sendpkt(
         */
        if ((pwd = getpwuid(geteuid())) == NULL) {
            security_seterror(&rh->sech,
-               "can't get login name for my uid %ld", (long)getuid());
+               _("can't get login name for my uid %ld"), (long)getuid());
            return (-1);
        }
-       dgram_cat(&rh->udp->dgram, "SECURITY USER %s\n", pwd->pw_name);
+       dgram_cat(&rh->udp->dgram, _("SECURITY USER %s\n"), pwd->pw_name);
        break;
 
     default:
@@ -1108,13 +1092,12 @@ udpbsd_sendpkt(
     dgram_cat(&rh->udp->dgram, pkt->body);
 
     auth_debug(1,
-     ("%s: sec: udpbsd_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n",
-      debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
-      strlen(pkt->body), pkt->body));
+     _("sec: udpbsd_sendpkt: %s (%d) pkt_t (len %zu) contains:\n\n\"%s\"\n\n"),
+      pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body);
 
     if (dgram_send_addr(&rh->peer, &rh->udp->dgram) != 0) {
        security_seterror(&rh->sech,
-           "send %s to %s failed: %s", pkt_type2str(pkt->type),
+           _("send %s to %s failed: %s"), pkt_type2str(pkt->type),
            rh->hostname, strerror(errno));
        return (-1);
     }
@@ -1131,8 +1114,7 @@ udp_close(
        return;
     }
 
-    auth_debug(1, ("%s: udp: close handle '%s'\n",
-                  debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, _("udp: close handle '%s'\n"), rh->proto_handle);
 
     udp_recvpkt_cancel(rh);
     if (rh->next) {
@@ -1166,8 +1148,8 @@ udp_recvpkt(
 {
     struct sec_handle *rh = cookie;
 
-    auth_debug(1, ("%s: udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n",
-                  debug_prefix_time(NULL), cookie, fn, arg, timeout));
+    auth_debug(1, _("udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n"),
+                  cookie, fn, arg, timeout);
     assert(rh != NULL);
     assert(fn != NULL);
 
@@ -1228,8 +1210,8 @@ udp_recvpkt_callback(
     void (*fn)(void *, pkt_t *, security_status_t);
     void *arg;
 
-    auth_debug(1, ("%s: udp: receive handle '%s' netfd '%s'\n",
-                  debug_prefix_time(NULL), rh->proto_handle, rh->udp->handle));
+    auth_debug(1, _("udp: receive handle '%s' netfd '%s'\n"),
+                  rh->proto_handle, rh->udp->handle);
     assert(rh != NULL);
 
     /* if it doesn't correspond to this handle, something is wrong */
@@ -1238,7 +1220,7 @@ udp_recvpkt_callback(
     /* if it didn't come from the same host/port, forget it */
     if (cmp_sockaddr(&rh->peer, &rh->udp->peer, 0) != 0) {
        amfree(rh->udp->handle);
-       dbprintf(("not form same host\n"));
+       dbprintf(_("not from same host\n"));
        dump_sockaddr(&rh->peer);
        dump_sockaddr(&rh->udp->peer);
        return;
@@ -1300,15 +1282,15 @@ udp_inithandle(
     /*
      * Save the hostname and port info
      */
-    auth_debug(1, ("%s: udp_inithandle port %u handle %s sequence %d\n",
-                  debug_prefix_time(NULL), (unsigned int)ntohs(port),
-                  handle, sequence));
+    auth_debug(1, _("udp_inithandle port %u handle %s sequence %d\n"),
+                  (unsigned int)ntohs(port), handle, sequence);
     assert(addr != NULL);
 
     rh->hostname = stralloc(hostname);
-    memcpy(&rh->peer, addr, SIZEOF(rh->peer));
+    copy_sockaddr(&rh->peer, addr);
     SS_SET_PORT(&rh->peer, port);
 
+
     rh->prev = udp->bh_last;
     if (udp->bh_last) {
        rh->prev->next = rh;
@@ -1328,8 +1310,7 @@ udp_inithandle(
     rh->ev_read = NULL;
     rh->ev_timeout = NULL;
 
-    auth_debug(1, ("%s: udp: adding handle '%s'\n",
-                  debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, _("udp: adding handle '%s'\n"), rh->proto_handle);
 
     return(0);
 }
@@ -1352,8 +1333,7 @@ udp_netfd_read_callback(
     char *errmsg = NULL;
     int result;
 
-    auth_debug(1, ("%s: udp_netfd_read_callback(cookie=%p)\n",
-                  debug_prefix_time(NULL), cookie));
+    auth_debug(1, _("udp_netfd_read_callback(cookie=%p)\n"), cookie);
     assert(udp != NULL);
     
 #ifndef TEST                                                   /* { */
@@ -1388,7 +1368,7 @@ udp_netfd_read_callback(
      * If no accept handler was setup, then just return.
      */
     if (udp->accept_fn == NULL) {
-       dbprintf(("%s: Receive packet from unknown source", debug_prefix_time(NULL)));
+       dbprintf(_("Receive packet from unknown source"));
        return;
     }
 
@@ -1401,8 +1381,8 @@ udp_netfd_read_callback(
     result = getnameinfo((struct sockaddr *)&udp->peer, SS_LEN(&udp->peer),
                         hostname, sizeof(hostname), NULL, 0, 0);
     if (result != 0) {
-       dbprintf(("%s: getnameinfo failed: %s\n",
-                 debug_prefix_time(NULL), gai_strerror(result)));
+       dbprintf("getnameinfo failed: %s\n",
+                 gai_strerror(result));
        security_seterror(&rh->sech, "getnameinfo failed: %s",
                          gai_strerror(result));
        return;
@@ -1423,8 +1403,7 @@ udp_netfd_read_callback(
                   udp->handle,
                   udp->sequence);
     if (a < 0) {
-       auth_debug(1, ("%s: bsd: closeX handle '%s'\n",
-                      debug_prefix_time(NULL), rh->proto_handle));
+       auth_debug(1, _("bsd: closeX handle '%s'\n"), rh->proto_handle);
 
        amfree(rh);
        return;
@@ -1451,8 +1430,7 @@ sec_tcp_conn_get(
 {
     struct tcp_conn *rc;
 
-    auth_debug(1, ("%s: sec_tcp_conn_get: %s\n",
-                  debug_prefix_time(NULL), hostname));
+    auth_debug(1, _("sec_tcp_conn_get: %s\n"), hostname);
 
     if (want_new == 0) {
        for (rc = connq_first(); rc != NULL; rc = connq_next(rc)) {
@@ -1463,15 +1441,13 @@ sec_tcp_conn_get(
        if (rc != NULL) {
            rc->refcnt++;
            auth_debug(1,
-                     ("%s: sec_tcp_conn_get: exists, refcnt to %s is now %d\n",
-                      debug_prefix_time(NULL),
-                      rc->hostname, rc->refcnt));
+                     _("sec_tcp_conn_get: exists, refcnt to %s is now %d\n"),
+                      rc->hostname, rc->refcnt);
            return (rc);
        }
     }
 
-    auth_debug(1, ("%s: sec_tcp_conn_get: creating new handle\n",
-                  debug_prefix_time(NULL)));
+    auth_debug(1, _("sec_tcp_conn_get: creating new handle\n"));
     /*
      * We can't be creating a new handle if we are the client
      */
@@ -1492,6 +1468,8 @@ sec_tcp_conn_get(
     rc->recv_security_ok = NULL;
     rc->prefix_packet = NULL;
     rc->auth = 0;
+    rc->conf_fn = NULL;
+    rc->datap = NULL;
     connq_append(rc);
     return (rc);
 }
@@ -1508,14 +1486,12 @@ sec_tcp_conn_put(
 
     assert(rc->refcnt > 0);
     --rc->refcnt;
-    auth_debug(1, ("%s: sec_tcp_conn_put: decrementing refcnt for %s to %d\n",
-                  debug_prefix_time(NULL),
-       rc->hostname, rc->refcnt));
+    auth_debug(1, _("sec_tcp_conn_put: decrementing refcnt for %s to %d\n"),
+                  rc->hostname, rc->refcnt);
     if (rc->refcnt > 0) {
        return;
     }
-    auth_debug(1, ("%s: sec_tcp_conn_put: closing connection to %s\n",
-                  debug_prefix_time(NULL), rc->hostname));
+    auth_debug(1, _("sec_tcp_conn_put: closing connection to %s\n"), rc->hostname);
     if (rc->read != -1)
        aclose(rc->read);
     if (rc->write != -1)
@@ -1548,12 +1524,12 @@ sec_tcp_conn_read(
     if (rc->ev_read != NULL) {
        rc->ev_read_refcnt++;
        auth_debug(1,
-             ("%s: sec: conn_read: incremented ev_read_refcnt to %d for %s\n",
-              debug_prefix_time(NULL), rc->ev_read_refcnt, rc->hostname));
+             _("sec: conn_read: incremented ev_read_refcnt to %d for %s\n"),
+              rc->ev_read_refcnt, rc->hostname);
        return;
     }
-    auth_debug(1, ("%s: sec: conn_read registering event handler for %s\n",
-                  debug_prefix_time(NULL), rc->hostname));
+    auth_debug(1, _("sec: conn_read registering event handler for %s\n"),
+                  rc->hostname);
     rc->ev_read = event_register((event_id_t)rc->read, EV_READFD,
                sec_tcp_conn_read_callback, rc);
     rc->ev_read_refcnt = 1;
@@ -1566,15 +1542,14 @@ sec_tcp_conn_read_cancel(
 
     --rc->ev_read_refcnt;
     auth_debug(1,
-       ("%s: sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n",
-       debug_prefix_time(NULL),
-       rc->ev_read_refcnt, rc->hostname));
+       _("sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n"),
+       rc->ev_read_refcnt, rc->hostname);
     if (rc->ev_read_refcnt > 0) {
        return;
     }
     auth_debug(1,
-                ("%s: sec: conn_read_cancel: releasing event handler for %s\n",
-                debug_prefix_time(NULL), rc->hostname));
+                _("sec: conn_read_cancel: releasing event handler for %s\n"),
+                rc->hostname);
     event_release(rc->ev_read);
     rc->ev_read = NULL;
 }
@@ -1594,8 +1569,7 @@ recvpkt_callback(
 
     assert(rh != NULL);
 
-    auth_debug(1, ("%s: sec: recvpkt_callback: " SSIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), bufsize));
+    auth_debug(1, _("sec: recvpkt_callback: %zd\n"), bufsize);
     /*
      * We need to cancel the recvpkt request before calling
      * the callback because the callback may reschedule us.
@@ -1605,7 +1579,7 @@ recvpkt_callback(
     switch (bufsize) {
     case 0:
        security_seterror(&rh->sech,
-           "EOF on read from %s", rh->hostname);
+           _("EOF on read from %s"), rh->hostname);
        (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR);
        return;
     case -1:
@@ -1618,9 +1592,9 @@ recvpkt_callback(
 
     parse_pkt(&pkt, buf, (size_t)bufsize);
     auth_debug(1,
-         ("%s: sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n",
-          debug_prefix_time(NULL), pkt_type2str(pkt.type), pkt.type,
-          rh->hostname, pkt.body));
+         _("sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n"),
+          pkt_type2str(pkt.type), pkt.type,
+          rh->hostname, pkt.body);
     if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0)
        (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR);
     else
@@ -1638,8 +1612,7 @@ stream_read_sync_callback(
     struct sec_stream *rs = s;
     assert(rs != NULL);
 
-    auth_debug(1, ("%s: sec: stream_read_callback_sync: handle %d\n",
-                  debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, _("sec: stream_read_callback_sync: handle %d\n"), rs->handle);
 
     /*
      * Make sure this was for us.  If it was, then blow away the handle
@@ -1648,12 +1621,10 @@ stream_read_sync_callback(
      * If the handle is EOF, pass that up to our callback.
      */
     if (rs->rc->handle == rs->handle) {
-        auth_debug(1, ("%s: sec: stream_read_callback_sync: it was for us\n",
-                      debug_prefix_time(NULL)));
+        auth_debug(1, _("sec: stream_read_callback_sync: it was for us\n"));
         rs->rc->handle = H_TAKEN;
     } else if (rs->rc->handle != H_EOF) {
-        auth_debug(1, ("%s: sec: stream_read_callback_sync: not for us\n",
-                      debug_prefix_time(NULL)));
+        auth_debug(1, _("sec: stream_read_callback_sync: not for us\n"));
         return;
     }
 
@@ -1665,8 +1636,7 @@ stream_read_sync_callback(
     tcpm_stream_read_cancel(rs);
 
     if (rs->rc->pktlen <= 0) {
-       auth_debug(1, ("%s: sec: stream_read_sync_callback: %s\n",
-                      debug_prefix_time(NULL), rs->rc->errmsg));
+       auth_debug(1, _("sec: stream_read_sync_callback: %s\n"), rs->rc->errmsg);
        security_stream_seterror(&rs->secstr, rs->rc->errmsg);
        if(rs->closed_by_me == 0 && rs->closed_by_network == 0)
            sec_tcp_conn_put(rs->rc);
@@ -1674,9 +1644,8 @@ stream_read_sync_callback(
        return;
     }
     auth_debug(1,
-           ("%s: sec: stream_read_callback_sync: read " SSIZE_T_FMT " bytes from %s:%d\n",
-            debug_prefix_time(NULL),
-        rs->rc->pktlen, rs->rc->hostname, rs->handle));
+           _("sec: stream_read_callback_sync: read %zd bytes from %s:%d\n"),
+           rs->rc->pktlen, rs->rc->hostname, rs->handle);
 }
 
 /*
@@ -1689,8 +1658,7 @@ stream_read_callback(
     struct sec_stream *rs = arg;
     assert(rs != NULL);
 
-    auth_debug(1, ("%s: sec: stream_read_callback: handle %d\n",
-                  debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, _("sec: stream_read_callback: handle %d\n"), rs->handle);
 
     /*
      * Make sure this was for us.  If it was, then blow away the handle
@@ -1699,12 +1667,10 @@ stream_read_callback(
      * If the handle is EOF, pass that up to our callback.
      */
     if (rs->rc->handle == rs->handle) {
-       auth_debug(1, ("%s: sec: stream_read_callback: it was for us\n",
-                      debug_prefix_time(NULL)));
+       auth_debug(1, _("sec: stream_read_callback: it was for us\n"));
        rs->rc->handle = H_TAKEN;
     } else if (rs->rc->handle != H_EOF) {
-       auth_debug(1, ("%s: sec: stream_read_callback: not for us\n",
-                      debug_prefix_time(NULL)));
+       auth_debug(1, _("sec: stream_read_callback: not for us\n"));
        return;
     }
 
@@ -1716,8 +1682,7 @@ stream_read_callback(
     tcpm_stream_read_cancel(rs);
 
     if (rs->rc->pktlen <= 0) {
-       auth_debug(1, ("%s: sec: stream_read_callback: %s\n",
-                      debug_prefix_time(NULL), rs->rc->errmsg));
+       auth_debug(1, _("sec: stream_read_callback: %s\n"), rs->rc->errmsg);
        security_stream_seterror(&rs->secstr, rs->rc->errmsg);
        if(rs->closed_by_me == 0 && rs->closed_by_network == 0)
            sec_tcp_conn_put(rs->rc);
@@ -1725,12 +1690,10 @@ stream_read_callback(
        (*rs->fn)(rs->arg, NULL, rs->rc->pktlen);
        return;
     }
-    auth_debug(1, ("%s: sec: stream_read_callback: read " SSIZE_T_FMT " bytes from %s:%d\n",
-                  debug_prefix_time(NULL),
-       rs->rc->pktlen, rs->rc->hostname, rs->handle));
+    auth_debug(1, _("sec: stream_read_callback: read %zd bytes from %s:%d\n"),
+                  rs->rc->pktlen, rs->rc->hostname, rs->handle);
     (*rs->fn)(rs->arg, rs->rc->pkt, rs->rc->pktlen);
-    auth_debug(1, ("%s: sec: after callback stream_read_callback\n",
-                  debug_prefix_time(NULL)));
+    auth_debug(1, _("sec: after callback stream_read_callback\n"));
 }
 
 /*
@@ -1750,24 +1713,24 @@ sec_tcp_conn_read_callback(
 
     assert(cookie != NULL);
 
-    auth_debug(1, ("%s: sec: conn_read_callback\n", debug_prefix_time(NULL)));
+    auth_debug(1, _("sec: conn_read_callback\n"));
 
     /* Read the data off the wire.  If we get errors, shut down. */
     rval = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg, &rc->pkt,
                                &rc->pktlen, 60);
-    auth_debug(1, ("%s: sec: conn_read_callback: tcpm_recv_token returned " SSIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), rval));
+    auth_debug(1, _("sec: conn_read_callback: tcpm_recv_token returned %zd\n"),
+                  rval);
     if (rval < 0 || rc->handle == H_EOF) {
        rc->pktlen = rval;
        rc->handle = H_EOF;
        revent = event_wakeup((event_id_t)rc);
-       auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return %d\n",
-                      debug_prefix_time(NULL), revent));
+       auth_debug(1, _("sec: conn_read_callback: event_wakeup return %d\n"),
+                      revent);
        /* delete our 'accept' reference */
        if (rc->accept_fn != NULL) {
            if(rc->refcnt != 1) {
-               dbprintf(("STRANGE, rc->refcnt should be 1, it is %d\n",
-                         rc->refcnt));
+               dbprintf(_("STRANGE, rc->refcnt should be 1, it is %d\n"),
+                         rc->refcnt);
                rc->refcnt=1;
            }
            rc->accept_fn = NULL;
@@ -1780,16 +1743,14 @@ sec_tcp_conn_read_callback(
        rc->pktlen = 0;
        revent = event_wakeup((event_id_t)rc);
        auth_debug(1,
-                  ("%s: 0 sec: conn_read_callback: event_wakeup return %d\n",
-                   debug_prefix_time(NULL), revent));
+                  _("sec: conn_read_callback: event_wakeup return %d\n"), revent);
        return;
     }
 
     /* If there are events waiting on this handle, we're done */
     rc->donotclose = 1;
     revent = event_wakeup((event_id_t)rc);
-    auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return " SSIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), rval));
+    auth_debug(1, _("sec: conn_read_callback: event_wakeup return %zd\n"), rval);
     rc->donotclose = 0;
     if (rc->handle == H_TAKEN || rc->pktlen == 0) {
        if(rc->refcnt == 0) amfree(rc);
@@ -1810,10 +1771,10 @@ sec_tcp_conn_read_callback(
     rh->peer = rc->peer;
     rh->rs = tcpma_stream_client(rh, rc->handle);
 
-    auth_debug(1, ("%s: sec: new connection\n", debug_prefix_time(NULL)));
+    auth_debug(1, _("sec: new connection\n"));
     pkt.body = NULL;
     parse_pkt(&pkt, rc->pkt, (size_t)rc->pktlen);
-    auth_debug(1, ("%s: sec: calling accept_fn\n", debug_prefix_time(NULL)));
+    auth_debug(1, _("sec: calling accept_fn\n"));
     if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0)
        (*rc->accept_fn)(&rh->sech, NULL);
     else
@@ -1829,8 +1790,7 @@ parse_pkt(
 {
     const unsigned char *bufp = buf;
 
-    auth_debug(1, ("%s: sec: parse_pkt: parsing buffer of " SSIZE_T_FMT " bytes\n",
-                  debug_prefix_time(NULL), bufsize));
+    auth_debug(1, _("sec: parse_pkt: parsing buffer of %zu bytes\n"), bufsize);
 
     pkt->type = (pktype_t)*bufp++;
     bufsize--;
@@ -1845,9 +1805,8 @@ parse_pkt(
     }
     pkt->size = strlen(pkt->body);
 
-    auth_debug(1, ("%s: sec: parse_pkt: %s (%d): \"%s\"\n",
-                  debug_prefix_time(NULL), pkt_type2str(pkt->type),
-                  pkt->type, pkt->body));
+    auth_debug(1, _("sec: parse_pkt: %s (%d): \"%s\"\n"), pkt_type2str(pkt->type),
+                  pkt->type, pkt->body);
 }
 
 /*
@@ -1863,12 +1822,11 @@ pkthdr2str(
     assert(rh != NULL);
     assert(pkt != NULL);
 
-    snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n",
+    g_snprintf(retbuf, SIZEOF(retbuf), _("Amanda %d.%d %s HANDLE %s SEQ %d\n"),
        VERSION_MAJOR, VERSION_MINOR, pkt_type2str(pkt->type),
        rh->proto_handle, rh->sequence);
 
-    auth_debug(1, ("%s: bsd: pkthdr2str handle '%s'\n",
-                  debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, _("bsd: pkthdr2str handle '%s'\n"), rh->proto_handle);
 
     /* check for truncation.  If only we had asprintf()... */
     assert(retbuf[strlen(retbuf) - 1] == '\n');
@@ -1959,7 +1917,7 @@ check_user(
 
     /* lookup our local user name */
     if ((pwd = getpwnam(CLIENT_LOGIN)) == NULL) {
-       return vstralloc("getpwnam(", CLIENT_LOGIN, ") fails", NULL);
+       return vstrallocf(_("getpwnam(%s) failed."), CLIENT_LOGIN);
     }
 
     /*
@@ -1974,9 +1932,9 @@ check_user(
     r = check_user_amandahosts(rh->hostname, &rh->peer, pwd, remoteuser, service);
 #endif
     if (r != NULL) {
-       result = vstralloc("user ", remoteuser, " from ", rh->hostname,
-                          " is not allowed to execute the service ",
-                          service, ": ", r, NULL);
+       result = vstrallocf(
+               _("user %s from %s is not allowed to execute the service %s: %s"),
+               remoteuser, rh->hostname, service, r);
        amfree(r);
     }
     amfree(localuser);
@@ -1987,7 +1945,7 @@ check_user(
  * See if a remote user is allowed in.  This version uses ruserok()
  * and friends.
  *
- * Returns 0 on success, or negative on error.
+ * Returns NULL on success, or error message on error.
  */
 char *
 check_user_ruserok(
@@ -2004,7 +1962,6 @@ check_user_ruserok(
     char *es;
     char *result;
     int ok;
-    char number[NUM_STR_SIZE];
     uid_t myuid = getuid();
 
     /*
@@ -2019,22 +1976,22 @@ check_user_ruserok(
      * problem and is expected.  Thanks a lot.  Not.
      */
     if (pipe(fd) != 0) {
-       return stralloc2("pipe() fails: ", strerror(errno));
+       return stralloc2(_("pipe() fails: "), strerror(errno));
     }
     if ((ruserok_pid = fork()) < 0) {
-       return stralloc2("fork() fails: ", strerror(errno));
+       return stralloc2(_("fork() fails: "), strerror(errno));
     } else if (ruserok_pid == 0) {
        int ec;
 
        close(fd[0]);
        fError = fdopen(fd[1], "w");
        if (!fError) {
-           error("Can't fdopen: %s", strerror(errno));
+           error(_("Can't fdopen: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        /* pamper braindead ruserok's */
        if (chdir(pwd->pw_dir) != 0) {
-           fprintf(fError, "chdir(%s) failed: %s",
+           g_fprintf(fError, _("chdir(%s) failed: %s"),
                    pwd->pw_dir, strerror(errno));
            fclose(fError);
            exit(1);
@@ -2043,13 +2000,11 @@ check_user_ruserok(
        if (debug_auth >= 9) {
            char *dir = stralloc(pwd->pw_dir);
 
-           auth_debug(9, ("%s: bsd: calling ruserok(%s, %d, %s, %s)\n",
-                          debug_prefix_time(NULL), host,
-                          ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name));
+           auth_debug(9, _("bsd: calling ruserok(%s, %d, %s, %s)\n"), host,
+                          ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name);
            if (myuid == 0) {
-               auth_debug(9, ("%s: bsd: because you are running as root, ",
-                              debug_prefix_time(NULL)));
-               auth_debug(9, ("/etc/hosts.equiv will not be used\n"));
+               auth_debug(9, _("bsd: because you are running as root, "));
+               auth_debug(9, _("/etc/hosts.equiv will not be used\n"));
            } else {
                show_stat_info("/etc/hosts.equiv", NULL);
            }
@@ -2060,8 +2015,7 @@ check_user_ruserok(
        saved_stderr = dup(2);
        close(2);
        if (open("/dev/null", O_RDWR) == -1) {
-            auth_debug(1, ("%s: Could not open /dev/null: %s\n",
-                          debug_prefix_time(NULL), strerror(errno)));
+            auth_debug(1, _("Could not open /dev/null: %s\n"), strerror(errno));
            ec = 1;
        } else {
            ok = ruserok(host, myuid == 0, remoteuser, CLIENT_LOGIN);
@@ -2078,7 +2032,7 @@ check_user_ruserok(
     close(fd[1]);
     fError = fdopen(fd[0], "r");
     if (!fError) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -2102,19 +2056,15 @@ check_user_ruserok(
     while (pid != ruserok_pid) {
        if ((pid == (pid_t) -1) && (errno != EINTR)) {
            amfree(result);
-           return stralloc2("ruserok wait failed: %s", strerror(errno));
+           return vstrallocf(_("ruserok wait failed: %s"), strerror(errno));
        }
        pid = wait(&exitcode);
     }
-    if (WIFSIGNALED(exitcode)) {
+    if (!WIFEXITED(exitcode) || WEXITSTATUS(exitcode) != 0) {
        amfree(result);
-       snprintf(number, SIZEOF(number), "%d", WTERMSIG(exitcode));
-       return stralloc2("ruserok child got signal ", number);
-    }
-    if (WEXITSTATUS(exitcode) == 0) {
+       result = str_exit_status("ruserok child", exitcode);
+    } else {
        amfree(result);
-    } else if (result == NULL) {
-       result = stralloc("ruserok failed");
     }
 
     return result;
@@ -2122,7 +2072,7 @@ check_user_ruserok(
 
 /*
  * Check to see if a user is allowed in.  This version uses .amandahosts
- * Returns -1 on failure, or 0 on success.
+ * Returns an error message on failure, or NULL on success.
  */
 char *
 check_user_amandahosts(
@@ -2140,8 +2090,6 @@ check_user_amandahosts(
     FILE *fp = NULL;
     int found;
     struct stat sbuf;
-    char n1[NUM_STR_SIZE];
-    char n2[NUM_STR_SIZE];
     int hostmatch;
     int usermatch;
     char *aservice = NULL;
@@ -2151,16 +2099,16 @@ check_user_amandahosts(
     char ipstr[INET_ADDRSTRLEN];
 #endif
 
-    auth_debug(1, ("check_user_amandahosts(host=%s, pwd=%p, "
-                  "remoteuser=%s, service=%s)\n",
-                  host, pwd, remoteuser, service));
+    auth_debug(1, _("check_user_amandahosts(host=%s, pwd=%p, "
+                  "remoteuser=%s, service=%s)\n"),
+                  host, pwd, remoteuser, service);
 
     ptmp = stralloc2(pwd->pw_dir, "/.amandahosts");
     if (debug_auth >= 9) {
        show_stat_info(ptmp, "");;
     }
     if ((fp = fopen(ptmp, "r")) == NULL) {
-       result = vstralloc("cannot open ", ptmp, ": ", strerror(errno), NULL);
+       result = vstrallocf(_("cannot open %s: %s"), ptmp, strerror(errno));
        amfree(ptmp);
        return result;
     }
@@ -2170,21 +2118,16 @@ check_user_amandahosts(
      * have any group/other access allowed.
      */
     if (fstat(fileno(fp), &sbuf) != 0) {
-       result = vstralloc("cannot fstat ", ptmp, ": ", strerror(errno), NULL);
+       result = vstrallocf(_("cannot fstat %s: %s"), ptmp, strerror(errno));
        goto common_exit;
     }
     if (sbuf.st_uid != pwd->pw_uid) {
-       snprintf(n1, SIZEOF(n1), "%ld", (long)sbuf.st_uid);
-       snprintf(n2, SIZEOF(n2), "%ld", (long)pwd->pw_uid);
-       result = vstralloc(ptmp, ": ",
-                          "owned by id ", n1,
-                          ", should be ", n2,
-                          NULL);
+       result = vstrallocf(_("%s: owned by id %ld, should be %ld"),
+                       ptmp, (long)sbuf.st_uid, (long)pwd->pw_uid);
        goto common_exit;
     }
     if ((sbuf.st_mode & 077) != 0) {
-       result = stralloc2(ptmp,
-         ": incorrect permissions; file must be accessible only by its owner");
+       result = vstrallocf(_("%s: incorrect permissions; file must be accessible only by its owner"), ptmp);
        goto common_exit;
     }
 
@@ -2198,8 +2141,7 @@ check_user_amandahosts(
            continue;
        }
 
-       auth_debug(9, ("%s: bsd: processing line: <%s>\n",
-                      debug_prefix_time(NULL), line));
+       auth_debug(9, _("bsd: processing line: <%s>\n"), line);
        /* get the host out of the file */
        if ((filehost = strtok(line, " \t")) == NULL) {
            amfree(line);
@@ -2230,14 +2172,12 @@ check_user_amandahosts(
                hostmatch = 1;
        }
        usermatch = (strcasecmp(fileuser, remoteuser) == 0);
-       auth_debug(9, ("%s: bsd: comparing \"%s\" with\n",
-                      debug_prefix_time(NULL), filehost));
-       auth_debug(9, ("%s: bsd:           \"%s\" (%s)\n", host,
-                 debug_prefix_time(NULL), hostmatch ? "match" : "no match"));
-       auth_debug(9, ("%s: bsd:       and \"%s\" with\n",
-                      fileuser, debug_prefix_time(NULL)));
-       auth_debug(9, ("%s: bsd:           \"%s\" (%s)\n", remoteuser,
-                      debug_prefix_time(NULL), usermatch ? "match" : "no match"));
+       auth_debug(9, _("bsd: comparing \"%s\" with\n"), filehost);
+       auth_debug(9, _("bsd:           \"%s\" (%s)\n"), host,
+                      hostmatch ? _("match") : _("no match"));
+       auth_debug(9, _("bsd:       and \"%s\" with\n"), fileuser);
+       auth_debug(9, _("bsd:           \"%s\" (%s)\n"), remoteuser,
+                      usermatch ? _("match") : _("no match"));
        /* compare */
        if (!hostmatch || !usermatch) {
            amfree(line);
@@ -2297,18 +2237,15 @@ check_user_amandahosts(
     if (! found) {
        if (strcmp(service, "amindexd") == 0 ||
            strcmp(service, "amidxtaped") == 0) {
-           result = vstralloc("Please add \"amindexd amidxtaped\" to "
-                              "the line in ", ptmp, " on the client", NULL);
+           result = vstrallocf(_("Please add the line \"%s %s amindexd amidxtaped\" to %s on the client"), host, remoteuser, ptmp);
        } else if (strcmp(service, "amdump") == 0 ||
                   strcmp(service, "noop") == 0 ||
                   strcmp(service, "selfcheck") == 0 ||
                   strcmp(service, "sendsize") == 0 ||
                   strcmp(service, "sendbackup") == 0) {
-           result = vstralloc("Please add \"amdump\" to the line in ",
-                              ptmp, " on the client", NULL);
+           result = vstrallocf(_("Please add the line \"%s %s amdump\" to %s on the client"), host, remoteuser, ptmp);
        } else {
-           result = vstralloc(ptmp, ": ",
-                              "invalid service ", service, NULL);
+           result = vstrallocf(_("%s: invalid service %s"), ptmp, service);
        }
     }
 
@@ -2342,17 +2279,17 @@ check_security(
     (void)cksum;       /* Quiet unused parameter warning */
 
     auth_debug(1,
-              ("%s: check_security(addr=%p, str='%s', cksum=%lu, errstr=%p\n",
-               debug_prefix_time(NULL), addr, str, cksum, errstr));
+              _("check_security(addr=%p, str='%s', cksum=%lu, errstr=%p\n"),
+               addr, str, cksum, errstr);
     dump_sockaddr(addr);
 
     *errstr = NULL;
 
     /* what host is making the request? */
     if ((result = getnameinfo((struct sockaddr *)addr, SS_LEN(addr),
-                              hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
-       dbprintf(("%s: getnameinfo failed: %s\n",
-                 debug_prefix_time(NULL), gai_strerror(result)));
+                             hostname, NI_MAXHOST, NULL, 0, 0)) != 0) {
+       dbprintf(_("getnameinfo failed: %s\n"),
+                 gai_strerror(result));
        *errstr = vstralloc("[", "addr ", str_sockaddr(addr), ": ",
                            "getnameinfo failed: ", gai_strerror(result),
                            "]", NULL);
@@ -2365,16 +2302,12 @@ check_security(
        return 0;
     }
 
+
     /* next, make sure the remote port is a "reserved" one */
     port = SS_GET_PORT(addr);
     if (port >= IPPORT_RESERVED) {
-       char number[NUM_STR_SIZE];
-
-       snprintf(number, SIZEOF(number), "%u", (unsigned int)port);
-       *errstr = vstralloc("[",
-                           "host ", remotehost, ": ",
-                           "port ", number, " not secure",
-                           "]", NULL);
+       *errstr = vstrallocf(_("[host %s: port %u not secure]"),
+                       remotehost, (unsigned int)port);
        amfree(remotehost);
        return 0;
     }
@@ -2384,10 +2317,7 @@ check_security(
     s = str;
     ch = *s++;
 
-    bad_bsd = vstralloc("[",
-                       "host ", remotehost, ": ",
-                       "bad bsd security line",
-                       "]", NULL);
+    bad_bsd = vstrallocf(_("[host %s: bad bsd security line]"), remotehost);
 
     if (strncmp_const_skip(s - 1, "USER ", s, ch) != 0) {
        *errstr = bad_bsd;
@@ -2414,10 +2344,10 @@ check_security(
 
     myuid = getuid();
     if ((pwptr = getpwuid(myuid)) == NULL)
-        error("error [getpwuid(%d) fails]", myuid);
+        error(_("error [getpwuid(%d) fails]"), (int)myuid);
 
-    auth_debug(1, ("%s: bsd security: remote host %s user %s local user %s\n",
-                  debug_prefix_time(NULL), remotehost, remoteuser, pwptr->pw_name));
+    auth_debug(1, _("bsd security: remote host %s user %s local user %s\n"),
+                  remotehost, remoteuser, pwptr->pw_name);
 
 #ifndef USE_AMANDAHOSTS
     s = check_user_ruserok(remotehost, pwptr, remoteuser);
@@ -2426,10 +2356,8 @@ check_security(
 #endif
 
     if (s != NULL) {
-       *errstr = vstralloc("[",
-                           "access as ", pwptr->pw_name, " not allowed",
-                           " from ", remoteuser, "@", remotehost,
-                           ": ", s, "]", NULL);
+       *errstr = vstrallocf(_("[access as %s not allowed from %s@%s: %s]"),
+                           pwptr->pw_name, remoteuser, remotehost, s);
     }
     amfree(s);
     amfree(remotehost);
@@ -2459,8 +2387,7 @@ net_writev(
        if (n < 0) {
            if (errno != EINTR)
                return (-1);
-           auth_debug(1, ("%s: net_writev got EINTR\n",
-                          debug_prefix_time(NULL)));
+           auth_debug(1, _("net_writev got EINTR\n"));
        }
        else if (n == 0) {
            errno = EIO;
@@ -2473,7 +2400,7 @@ net_writev(
             */
            for (; n > 0; iovcnt--, iov++) {
                /* 'delta' is the bytes written from this iovec */
-               delta = ((size_t)n < iov->iov_len) ? n : (ssize_t)iov->iov_len;
+               delta = ((size_t)n < (size_t)iov->iov_len) ? n : (ssize_t)iov->iov_len;
                /* subtract from the total num bytes written */
                n -= delta;
                assert(n >= 0);
@@ -2503,28 +2430,23 @@ net_read(
     ssize_t nread;
     size_t size = origsize;
 
-    auth_debug(1, ("%s: net_read: begin " SIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), origsize));
+    auth_debug(1, _("net_read: begin %zu\n"), origsize);
 
     while (size > 0) {
-       auth_debug(1, ("%s: net_read: while " SIZE_T_FMT "\n",
-                      debug_prefix_time(NULL), size));
+       auth_debug(1, _("net_read: while %zu\n"), size);
        nread = net_read_fillbuf(fd, timeout, buf, size);
        if (nread < 0) {
-           auth_debug(1, ("%s: db: net_read: end return(-1)\n",
-                          debug_prefix_time(NULL)));
+           auth_debug(1, _("db: net_read: end return(-1)\n"));
            return (-1);
        }
        if (nread == 0) {
-           auth_debug(1, ("%s: net_read: end return(0)\n",
-                          debug_prefix_time(NULL)));
+           auth_debug(1, _("net_read: end return(0)\n"));
            return (0);
        }
        buf += nread;
        size -= nread;
     }
-    auth_debug(1, ("%s: net_read: end " SIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), origsize));
+    auth_debug(1, _("net_read: end %zu\n"), origsize);
     return ((ssize_t)origsize);
 }
 
@@ -2542,7 +2464,7 @@ net_read_fillbuf(
     struct timeval tv;
     ssize_t nread;
 
-    auth_debug(1, ("%s: net_read_fillbuf: begin\n", debug_prefix_time(NULL)));
+    auth_debug(1, _("net_read_fillbuf: begin\n"));
     FD_ZERO(&readfds);
     FD_SET(fd, &readfds);
     tv.tv_sec = timeout;
@@ -2552,25 +2474,21 @@ net_read_fillbuf(
        errno = ETIMEDOUT;
        /* FALLTHROUGH */
     case -1:
-       auth_debug(1, ("%s: net_read_fillbuf: case -1\n",
-                      debug_prefix_time(NULL)));
+       auth_debug(1, _("net_read_fillbuf: case -1\n"));
        return (-1);
     case 1:
-       auth_debug(1, ("%s: net_read_fillbuf: case 1\n",
-                      debug_prefix_time(NULL)));
+       auth_debug(1, _("net_read_fillbuf: case 1\n"));
        assert(FD_ISSET(fd, &readfds));
        break;
     default:
-       auth_debug(1, ("%s: net_read_fillbuf: case default\n",
-                      debug_prefix_time(NULL)));
+       auth_debug(1, _("net_read_fillbuf: case default\n"));
        assert(0);
        break;
     }
     nread = read(fd, buf, size);
     if (nread < 0)
        return (-1);
-    auth_debug(1, ("%s: net_read_fillbuf: end " SSIZE_T_FMT "\n",
-                  debug_prefix_time(NULL), nread));
+    auth_debug(1, _("net_read_fillbuf: end %zd\n"), nread);
     return (nread);
 }
 
@@ -2587,35 +2505,51 @@ show_stat_info(
     char *name = vstralloc(a, b, NULL);
     struct stat sbuf;
     struct passwd *pwptr;
+    struct passwd pw;
     char *owner;
     struct group *grptr;
+    struct group gr;
     char *group;
+    int buflen;
+    char *buf;
 
     if (stat(name, &sbuf) != 0) {
-       auth_debug(1, ("%s: bsd: cannot stat %s: %s\n",
-                      debug_prefix_time(NULL), name, strerror(errno)));
+       auth_debug(1, _("bsd: cannot stat %s: %s\n"), name, strerror(errno));
        amfree(name);
        return;
     }
-    if ((pwptr = getpwuid(sbuf.st_uid)) == NULL) {
+
+#ifdef _SC_GETPW_R_SIZE_MAX
+    buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+    if (buflen == -1)
+       buflen = 1024;
+#else
+    buflen = 1024;
+#endif
+    buf = malloc(buflen);
+
+    if (getpwuid_r(sbuf.st_uid, &pw, buf, buflen, &pwptr) != 0 ||
+       pwptr == NULL) {
        owner = alloc(NUM_STR_SIZE + 1);
-       snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_uid);
+       g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_uid);
     } else {
        owner = stralloc(pwptr->pw_name);
     }
-    if ((grptr = getgrgid(sbuf.st_gid)) == NULL) {
+    if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) != 0 ||
+       grptr == NULL) {
        group = alloc(NUM_STR_SIZE + 1);
-       snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid);
+       g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid);
     } else {
        group = stralloc(grptr->gr_name);
     }
-    auth_debug(1, ("%s: bsd: processing file: %s\n", debug_prefix_time(NULL), name));
-    auth_debug(1, ("%s: bsd:                  owner=%s group=%s mode=%03o\n",
-                  debug_prefix_time(NULL), owner, group,
-                  (int) (sbuf.st_mode & 0777)));
+    auth_debug(1, _("bsd: processing file: %s\n"), name);
+    auth_debug(1, _("bsd:                  owner=%s group=%s mode=%03o\n"),
+                  owner, group,
+                  (int) (sbuf.st_mode & 0777));
     amfree(name);
     amfree(owner);
     amfree(group);
+    amfree(buf);
 }
 
 int
@@ -2624,118 +2558,50 @@ check_name_give_sockaddr(
     struct sockaddr *addr,
     char **errstr)
 {
-    struct addrinfo *res = NULL, *res1;
-    struct addrinfo hints;
     int result;
+    struct addrinfo *res = NULL, *res1;
+    char *canonname;
 
-#ifdef WORKING_IPV6
-    if ((addr)->sa_family == AF_INET6)
-       hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    else
-#endif
-       hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = addr->sa_family;
-    hints.ai_socktype = 0;
-    hints.ai_protocol = 0;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
+    result = resolve_hostname(hostname, 0, &res, &canonname);
     if (result != 0) {
-       dbprintf(("check_name_give_sockaddr: getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
-       *errstr = newvstralloc(*errstr,
-                              " getaddrinfo(", hostname, "): ",
-                              gai_strerror(result), NULL);
-       return -1;
+       dbprintf(_("check_name_give_sockaddr: resolve_hostname('%s'): %s\n"), hostname, gai_strerror(result));
+       *errstr = newvstrallocf(*errstr,
+                              _("check_name_give_sockaddr: resolve_hostname('%s'): %s"),
+                              hostname, gai_strerror(result));
+       goto error;
     }
-    if (res->ai_canonname == NULL) {
-       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
-       *errstr = newvstralloc(*errstr, 
-               " getaddrinfo(", hostname, ") did not return a canonical name", NULL);
-       return -1;
+    if (canonname == NULL) {
+       dbprintf(_("resolve_hostname('%s') did not return a canonical name\n"), hostname);
+       *errstr = newvstrallocf(*errstr,
+               _("check_name_give_sockaddr: resolve_hostname('%s') did not return a canonical name"),
+               hostname);
+       goto error;
     }
 
-    if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) {
-       auth_debug(1, ("%s: %s doesn't resolve to itself, it resolves to %s\n",
-                      debug_prefix_time(NULL),
-                      hostname, res->ai_canonname));
-       *errstr = newvstralloc(*errstr, hostname,
-                              _(" doesn't resolve to itself, it resolves to "),
-                              res->ai_canonname, NULL);
-       return -1;
+    if (strncasecmp(hostname, canonname, strlen(hostname)) != 0) {
+       dbprintf(_("%s doesn't resolve to itself, it resolves to %s\n"),
+                      hostname, canonname);
+       *errstr = newvstrallocf(*errstr,
+                              _("%s doesn't resolve to itself, it resolves to %s"),
+                              hostname, canonname);
+       goto error;
     }
 
     for(res1=res; res1 != NULL; res1 = res1->ai_next) {
-       if (res1->ai_addr->sa_family == addr->sa_family) {
-           if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) {
-               freeaddrinfo(res);
-               return 0;
-           }
+       if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) {
+           freeaddrinfo(res);
+           amfree(canonname);
+           return 0;
        }
     }
 
-    *errstr = newvstralloc(*errstr,
-                          str_sockaddr((struct sockaddr_storage *)addr),
-                          " doesn't resolve to ",
-                          hostname, NULL);
-    freeaddrinfo(res);
+    dbprintf(_("%s doesn't resolve to %s"),
+           hostname, str_sockaddr((struct sockaddr_storage *)addr));
+    *errstr = newvstrallocf(*errstr,
+                          "%s doesn't resolve to %s",
+                          hostname, str_sockaddr((struct sockaddr_storage *)addr));
+error:
+    if (res) freeaddrinfo(res);
+    amfree(canonname);
     return -1;
 }
-
-
-int
-check_addrinfo_give_name(
-    struct addrinfo *res,
-    const char *hostname,
-    char **errstr)
-{
-    if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) {
-       dbprintf(("%s: %s doesn't resolve to itself, it resolv to %s\n",
-                 debug_prefix_time(NULL),
-                 hostname, res->ai_canonname));
-       *errstr = newvstralloc(*errstr, hostname,
-                              " doesn't resolve to itself, it resolv to ",
-                              res->ai_canonname, NULL);
-       return -1;
-    }
-
-    return 0;
-}
-
-/* Try resolving the hostname, just to catch any potential
- * problems down the road.  This is used from most security_connect
- * methods, many of which also want the canonical name.  Returns 
- * 0 on success.
- */
-int
-try_resolving_hostname(
-       const char *hostname,
-       char **canonname)
-{
-    struct addrinfo hints;
-    struct addrinfo *gaires;
-    int res;
-
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = AF_UNSPEC;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = AF_INET;
-#endif
-    hints.ai_socktype = 0;
-    hints.ai_protocol = 0;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    if ((res = getaddrinfo(hostname, NULL, &hints, &gaires)) != 0) {
-       return -1;
-    }
-    if (canonname && gaires && gaires->ai_canonname)
-       *canonname = stralloc(gaires->ai_canonname);
-    if (gaires) freeaddrinfo(gaires);
-
-    return 0;
-}
index 9b2dcc47ce855249dacd6d3d37ed79da385cbf2b..dd1e3ccb9e5542b1d278eacb7a44b616d88d9231 100644 (file)
@@ -39,9 +39,9 @@
 #include "security.h"
 #include "event.h"
 
-#define auth_debug(i,x) do {           \
+#define auth_debug(i, ...) do {                \
        if ((i) <= debug_auth) {        \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
@@ -83,6 +83,8 @@ struct tcp_conn {
     int                        toclose;
     int                        donotclose;
     int                        auth;
+    char *              (*conf_fn)(char *, void *);
+    void *              datap;
 #ifdef KRB5_SECURITY
     gss_ctx_id_t       gss_context;
 #endif
@@ -206,8 +208,11 @@ typedef struct udp_handle {
 
 int    sec_stream_auth(void *);
 int    sec_stream_id(void *);
-void   sec_accept(const security_driver_t *, int, int,
-                   void (*)(security_handle_t *, pkt_t *));
+void   sec_accept(const security_driver_t *,
+                  char *(*)(char *, void *),
+                  int, int,
+                  void (*)(security_handle_t *, pkt_t *),
+                  void *);
 void   sec_close(void *);
 void   sec_connect_callback(void *);
 void   sec_connect_timeout(void *);
@@ -276,9 +281,5 @@ ssize_t net_read_fillbuf(int, int, void *, size_t);
 void   show_stat_info(char *a, char *b);
 int     check_name_give_sockaddr(const char *hostname, struct sockaddr *addr,
                                 char **errstr);
-int     check_addrinfo_give_name(struct addrinfo *res, const char *hostname,
-                                char **errstr);
-int    try_resolving_hostname(const char *hostname,
-                              char **cannonname);
 
 #endif /* _SECURITY_INFO_H */
index 4ee8eb7c25eb84937b0d317429324ed8f659d45d..54c6b99b1b2f9b96c09f46ceadb4b9486305429f 100644 (file)
@@ -55,6 +55,7 @@ extern const security_driver_t bsdtcp_security_driver;
 #ifdef BSDUDP_SECURITY
 extern const security_driver_t bsdudp_security_driver;
 #endif
+extern const security_driver_t local_security_driver;
 
 static const security_driver_t *drivers[] = {
 #ifdef BSD_SECURITY
@@ -78,6 +79,7 @@ static const security_driver_t *drivers[] = {
 #ifdef BSDUDP_SECURITY
     &bsdudp_security_driver,
 #endif
+    &local_security_driver,
 };
 #define        NDRIVERS        (size_t)(sizeof(drivers) / sizeof(drivers[0]))
 
@@ -94,13 +96,12 @@ security_getdriver(
 
     for (i = 0; i < NDRIVERS; i++) {
        if (strcasecmp(name, drivers[i]->name) == 0) {
-           dbprintf(("%s: security_getdriver(name=%s) returns %p\n",
-                     debug_prefix_time(NULL), name, drivers[i]));
+           dbprintf(_("security_getdriver(name=%s) returns %p\n"),
+                     name, drivers[i]);
            return (drivers[i]);
        }
     }
-    dbprintf(("%s: security_getdriver(name=%s) returns NULL\n",
-             debug_prefix_time(NULL), name));
+    dbprintf(_("security_getdriver(name=%s) returns NULL\n"), name);
     return (NULL);
 }
 
@@ -112,35 +113,35 @@ security_handleinit(
     security_handle_t *                handle,
     const security_driver_t *  driver)
 {
-    dbprintf(("%s: security_handleinit(handle=%p, driver=%p (%s))\n",
-             debug_prefix_time(NULL), handle, driver, driver->name));
+    dbprintf(_("security_handleinit(handle=%p, driver=%p (%s))\n"),
+             handle, driver, driver->name);
     handle->driver = driver;
-    handle->error = stralloc("unknown protocol error");
+    handle->error = stralloc(_("unknown protocol error"));
 }
 
 printf_arglist_function1(void security_seterror, security_handle_t *, handle,
     const char *, fmt)
 {
-    static char buf[256];
+    static char buf[1024];
     va_list argp;
 
     assert(handle->error != NULL);
     arglist_start(argp, fmt);
-    vsnprintf(buf, SIZEOF(buf), fmt, argp);
+    g_vsnprintf(buf, SIZEOF(buf), fmt, argp);
     arglist_end(argp);
     handle->error = newstralloc(handle->error, buf);
-    dbprintf(("%s: security_seterror(handle=%p, driver=%p (%s) error=%s)\n",
-             debug_prefix_time(NULL), handle, handle->driver,
-             handle->driver->name, handle->error));
+    dbprintf(_("security_seterror(handle=%p, driver=%p (%s) error=%s)\n"),
+             handle, handle->driver,
+             handle->driver->name, handle->error);
 }
 
 void
 security_close(
     security_handle_t *        handle)
 {
-    dbprintf(("%s: security_close(handle=%p, driver=%p (%s))\n",
-             debug_prefix_time(NULL), handle, handle->driver,
-             handle->driver->name));
+    dbprintf(_("security_close(handle=%p, driver=%p (%s))\n"),
+             handle, handle->driver,
+             handle->driver->name);
     amfree(handle->error);
     (*handle->driver->close)(handle);
 }
@@ -153,33 +154,31 @@ security_streaminit(
     security_stream_t *                stream,
     const security_driver_t *  driver)
 {
-    dbprintf(("%s: security_streaminit(stream=%p, driver=%p (%s))\n",
-             debug_prefix_time(NULL), stream, driver, driver->name));
+    dbprintf(_("security_streaminit(stream=%p, driver=%p (%s))\n"),
+             stream, driver, driver->name);
     stream->driver = driver;
-    stream->error = stralloc("unknown stream error");
+    stream->error = stralloc(_("unknown stream error"));
 }
 
 printf_arglist_function1(void security_stream_seterror,
     security_stream_t *, stream,
     const char *, fmt)
 {
-    static char buf[256];
+    static char buf[1024];
     va_list argp;
 
     arglist_start(argp, fmt);
-    vsnprintf(buf, SIZEOF(buf), fmt, argp);
+    g_vsnprintf(buf, SIZEOF(buf), fmt, argp);
     arglist_end(argp);
     stream->error = newstralloc(stream->error, buf);
-    dbprintf(("%s: security_stream_seterr(%p, %s)\n",
-             debug_prefix_time(NULL), stream, stream->error));
+    dbprintf(_("security_stream_seterr(%p, %s)\n"), stream, stream->error);
 }
 
 void
 security_stream_close(
     security_stream_t *        stream)
 {
-    dbprintf(("%s: security_stream_close(%p)\n",
-             debug_prefix_time(NULL), stream));
+    dbprintf(_("security_stream_close(%p)\n"), stream);
     amfree(stream->error);
     (*stream->driver->stream_close)(stream);
 }
index 59b2bbf674f9f36fb12bb911773b77d8ae2c88b6..1e327f90435160632d5925325684aaaa0b703679 100644 (file)
@@ -66,8 +66,11 @@ typedef struct security_driver {
      * This form sets up a callback that returns new handles as
      * they are received.  It takes an input and output file descriptor.
      */
-    void (*accept)(const struct security_driver *, int, int,
-                       void (*)(struct security_handle *, pkt_t *));
+    void (*accept)(const struct security_driver *,
+                       char *(*)(char *, void *),
+                       int, int,
+                       void (*)(struct security_handle *, pkt_t *),
+                       void *);
 
     /*
      * Frees up handles allocated by the previous
@@ -188,20 +191,25 @@ void security_streaminit(security_stream_t *, const security_driver_t *);
 /* const char *security_geterror(security_handle_t *); */
 #define        security_geterror(handle)       ((handle)->error)
 void security_seterror(security_handle_t *, const char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 
 
-/* void security_connect(const security_driver_t *, const char *,
-    void (*)(void *, security_handle_t *, security_status_t), void *, void *); */
+/* void security_connect(const security_driver_t *, const char *, 
+    char *(*)(char *, void *),
+    void (*)(void *, security_handle_t *, security_status_t), 
+    void *, 
+    void *); */
 #define        security_connect(driver, hostname, conf_fn, fn, arg, datap)     \
     (*(driver)->connect)(hostname, conf_fn, fn, arg, datap)
-/* void security_accept(const security_driver_t *, int, int,
-    void (*)(security_handle_t *, pkt_t *)); */
-#define        security_accept(driver, in, out, fn)    \
-    (*(driver)->accept)(driver, in, out, fn)
+
+/* void security_accept(const security_driver_t *,
+    char *(*)(char *, void *), int, int,
+    void (*)(security_handle_t *, pkt_t *), void *); */
+#define        security_accept(driver, conf_fn, in, out, fn, datap)    \
+    (*(driver)->accept)(driver, conf_fn, in, out, fn, datap)
 void security_close(security_handle_t *);
 
-/* int security_sendpkt(security_handle_t *, const pkt_t *); */
+/* ssize_t security_sendpkt(security_handle_t *, const pkt_t *); */
 #define        security_sendpkt(handle, pkt)           \
     (*(handle)->driver->sendpkt)(handle, pkt)
 
@@ -217,7 +225,7 @@ void security_close(security_handle_t *);
 /* const char *security_stream_geterror(security_stream_t *); */
 #define        security_stream_geterror(stream)        ((stream)->error)
 void security_stream_seterror(security_stream_t *, const char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 
 /* security_stream_t *security_stream_server(security_handle_t *); */
 #define        security_stream_server(handle)  \
diff --git a/common-src/sockaddr-util.c b/common-src/sockaddr-util.c
new file mode 100644 (file)
index 0000000..77fd54a
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>
+ */
+/*
+ * Utility routines for handling sockaddrs
+ */
+
+#include "sockaddr-util.h"
+
+void
+dump_sockaddr(
+    struct sockaddr_storage *sa)
+{
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
+#endif
+    int port;
+
+    port = SS_GET_PORT(sa);
+#ifdef WORKING_IPV6
+    if (sa->ss_family == (sa_family_t)AF_INET6) {
+       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
+                 ipstr, sizeof(ipstr));
+       dbprintf("(sockaddr_in6 *)%p = { %d, %d, %s }\n",
+                sa,
+                ((struct sockaddr_in6 *)sa)->sin6_family,
+                port,
+                ipstr);
+    } else
+#endif
+    {
+       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
+                 sizeof(ipstr));
+       dbprintf("(sockaddr_in *)%p = { %d, %d, %s }\n",
+                sa,
+                ((struct sockaddr_in *)sa)->sin_family,
+                port,
+                ipstr);
+    }
+}
+
+
+#ifdef WORKING_IPV6
+static char mystr_sockaddr[INET6_ADDRSTRLEN + 20];
+#else
+static char mystr_sockaddr[INET_ADDRSTRLEN + 20];
+#endif
+
+char *
+str_sockaddr(
+    struct sockaddr_storage *sa)
+{
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
+#endif
+    int port;
+
+    port = SS_GET_PORT(sa);
+#ifdef WORKING_IPV6
+    if ( sa->ss_family == (sa_family_t)AF_INET6) {
+       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
+                 ipstr, sizeof(ipstr));
+    } else
+#endif
+    {
+       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
+                 sizeof(ipstr));
+    }
+    g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port);
+    return mystr_sockaddr;
+}
+
+int
+cmp_sockaddr(
+    struct sockaddr_storage *ss1,
+    struct sockaddr_storage *ss2,
+    int addr_only)
+{
+    /* if addresses are v4mapped, "unmap" them */
+#ifdef WORKING_IPV6
+#ifdef IN6_IS_ADDR_V4MAPPED
+    struct sockaddr_in ss1_v4;
+    struct sockaddr_in ss2_v4;
+
+    if (ss1->ss_family == AF_INET6 &&
+        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) {
+       memset(&ss1_v4, 0, sizeof(struct sockaddr_in));
+       memcpy(&ss1_v4.sin_addr.s_addr,
+              &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]),
+              sizeof(struct in_addr));
+       ss1_v4.sin_family = AF_INET;
+       SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1));
+       ss1 = (struct sockaddr_storage *)&ss1_v4;
+    }
+
+    if (ss2->ss_family == AF_INET6 &&
+        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) {
+       memset(&ss2_v4, 0, sizeof(struct sockaddr_in));
+       memcpy(&ss2_v4.sin_addr.s_addr,
+              &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]),
+              sizeof(struct in_addr));
+       ss2_v4.sin_family = AF_INET;
+       SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2));
+       ss2 = (struct sockaddr_storage *)&ss2_v4;
+    }
+#endif
+#endif
+
+    if (ss1->ss_family == ss2->ss_family) {
+        if (addr_only) {
+#ifdef WORKING_IPV6
+            if(ss1->ss_family == (sa_family_t)AF_INET6)
+                return memcmp(
+                    &((struct sockaddr_in6 *)ss1)->sin6_addr,
+                    &((struct sockaddr_in6 *)ss2)->sin6_addr,
+                    sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr));
+            else
+#endif
+                return memcmp(
+                    &((struct sockaddr_in *)ss1)->sin_addr,
+                    &((struct sockaddr_in *)ss2)->sin_addr,
+                    sizeof(((struct sockaddr_in *)ss1)->sin_addr));
+        } else {
+            return memcmp(ss1, ss2, SS_LEN(ss1));
+        }
+    } else {
+        /* compare families to give a total order */
+        if (ss1->ss_family < ss2->ss_family)
+            return -1;
+        else
+            return 1;
+    }
+}
+
diff --git a/common-src/sockaddr-util.h b/common-src/sockaddr-util.h
new file mode 100644 (file)
index 0000000..849dd2a
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>
+ */
+/*
+ * Utility routines for handling sockaddrs
+ */
+
+#ifndef SOCKADDR_H
+#define        SOCKADDR_H
+
+#include "amanda.h"
+
+/* Dump a sockaddr_storage using dbprintf
+ *
+ * @param sa: the sockaddr to dump
+ */
+void   dump_sockaddr(struct sockaddr_storage * sa);
+
+/* Convert a sockaddr_storage to a string.
+ *
+ * NOTE: this function is not threadsafe!
+ *
+ * @param sa: the sockaddr_storage to dump
+ * @returns: pointer to statically allocated string
+ */
+char *  str_sockaddr(struct sockaddr_storage *sa);
+
+/* Compare two sockaddr_storage objects, optionally comparing
+ * only the address (and thus ignoring port, flow info, etc.).
+ *
+ * @param ss1: one sockaddr_storage to compare
+ * @param ss2: the other sockaddr_storage to compare
+ * @param addr_only: if true, ignore port, flow info, etc.
+ * @returns: -1, 0, or 1 for <, ==, >, respectively
+ */
+int     cmp_sockaddr(struct sockaddr_storage *ss1,
+                    struct sockaddr_storage *ss2,
+                    int addr_only);
+
+/* Copy a sockaddr object.
+ *
+ * @param dest: destination
+ * @param src: source
+ */
+#define copy_sockaddr(dest, src) memcpy((dest), (src), SS_LEN((src)))
+
+/* Calculate the length of the data in a struct sockaddr_storage.
+ *
+ * @param ss: the sockaddr_storage to examine
+ * @returns: length of the data in the object
+ */
+/* SS_LEN(ss) */
+#ifdef WORKING_IPV6
+# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in))
+#else
+# define SS_LEN(ss) (sizeof(struct sockaddr_in))
+#endif
+
+/* The "best" address family we support.
+ */
+/* AF_NATIVE */
+#ifdef WORKING_IPV6
+#define AF_NATIVE AF_INET6
+#else
+#define AF_NATIVE AF_INET
+#endif
+
+/* Initialize a sockaddr_storage to all zeroes (as directed by RFC),
+ * and set its ss_family as specified
+ *
+ * @param ss: sockaddr_storage object to initialize
+ * @param family: an AF_* constant
+ */
+/* SS_INIT(ss, family) */
+#define SS_INIT(ss, family) do { \
+    memset((ss), 0, sizeof(*(ss))); \
+    (ss)->ss_family = (family); \
+} while (0);
+
+/* set a sockaddr_storage to the family-appropriate equivalent of
+ * INADDR_ANY -- a wildcard address and port.  Call SS_INIT(ss)
+ * first to initialize the object and set the family.
+ *
+ * @param ss: the sockaddr_storage to set
+ */
+/* SS_SET_INADDR_ANY(ss) */
+#ifdef WORKING_IPV6
+#define SS_SET_INADDR_ANY(ss) do { \
+    switch ((ss)->ss_family) { \
+        case AF_INET6: \
+            ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \
+            ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \
+            break; \
+        case AF_INET: \
+            ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+            break; \
+    } \
+} while (0);
+#else
+#define SS_SET_INADDR_ANY(ss) do { \
+    ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+} while (0);
+#endif
+
+/* Set the port in a sockaddr_storage that already has an family
+ *
+ * @param ss: the sockaddr_storage to manipulate
+ * @param port: the port to insert
+ */
+/* SS_SET_PORT(ss, port) */
+#ifdef WORKING_IPV6
+#define SS_SET_PORT(ss, port) \
+switch ((ss)->ss_family) { \
+    case AF_INET: \
+        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \
+        break; \
+    case AF_INET6: \
+        ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \
+        break; \
+    default: assert(0); \
+}
+#else
+#define SS_SET_PORT(ss, port) \
+        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port));
+#endif
+
+/* Get the port in a sockaddr_storage object
+ *
+ * @param ss: the sockaddr_storage to manipulate
+ */
+/* SS_GET_PORT(ss) */
+#ifdef WORKING_IPV6
+#define SS_GET_PORT(ss) (ntohs( \
+       (ss)->ss_family == AF_INET6? \
+        ((struct sockaddr_in6 *)(ss))->sin6_port \
+       :((struct sockaddr_in *)(ss))->sin_port))
+#else
+#define SS_GET_PORT(ss) (ntohs( \
+        ((struct sockaddr_in *)(ss))->sin_port))
+#endif
+
+#endif /* SOCKADDR_H */
+
index 3736927ca2da74f534367c8e890afb3f65a0207d..45a55e40d7d2684d299714d8354a33cabf1510da 100644 (file)
@@ -43,8 +43,6 @@
 #include "stream.h"
 #include "version.h"
 
-#ifdef SSH_SECURITY
-
 /*
  * Number of seconds ssh has to start up
  */
@@ -114,10 +112,7 @@ ssh_connect(
     assert(fn != NULL);
     assert(hostname != NULL);
 
-    (void)conf_fn;     /* Quiet unused parameter warning */
-
-    auth_debug(1, ("%s: ssh: ssh_connect: %s\n", debug_prefix_time(NULL),
-                  hostname));
+    auth_debug(1, "ssh_connect: %s\n", hostname);
 
     rh = alloc(SIZEOF(*rh));
     security_handleinit(&rh->sech, &ssh_security_driver);
@@ -127,13 +122,15 @@ ssh_connect(
     rh->rc = NULL;
 
     rh->hostname = NULL;
-    if (try_resolving_hostname(hostname, &rh->hostname)) {
+    if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) {
        security_seterror(&rh->sech,
-           "%s: ssh could not resolve hostname", hostname);
+           _("%s: ssh could not resolve hostname"), hostname);
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
     rh->rs = tcpma_stream_client(rh, newhandle++);
+    rh->rc->conf_fn = conf_fn;
+    rh->rc->datap = datap;
 
     if (rh->rs == NULL)
        goto error;
@@ -153,7 +150,7 @@ ssh_connect(
     }
     if(rh->rc->read == -1) {
        if (runssh(rh->rs->rc, amandad_path, client_username, ssh_keys) < 0) {
-           security_seterror(&rh->sech, "can't connect to %s: %s",
+           security_seterror(&rh->sech, _("can't connect to %s: %s"),
                              hostname, rh->rs->rc->errmsg);
            goto error;
        }
@@ -200,13 +197,13 @@ runssh(
     memset(rpipe, -1, SIZEOF(rpipe));
     memset(wpipe, -1, SIZEOF(wpipe));
     if (pipe(rpipe) < 0 || pipe(wpipe) < 0) {
-       rc->errmsg = newvstralloc(rc->errmsg, "pipe: ", strerror(errno), NULL);
+       rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno));
        return (-1);
     }
 
     switch (rc->pid = fork()) {
     case -1:
-       rc->errmsg = newvstralloc(rc->errmsg, "fork: ", strerror(errno), NULL);
+       rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno));
        aclose(rpipe[0]);
        aclose(rpipe[1]);
        aclose(wpipe[0]);
@@ -227,7 +224,7 @@ runssh(
     safe_fd(-1, 0);
 
     if(!xamandad_path || strlen(xamandad_path) <= 1) 
-       xamandad_path = vstralloc(libexecdir, "/", "amandad",
+       xamandad_path = vstralloc(amlibexecdir, "/", "amandad",
                                 versionsuffix(), NULL);
     if(!xclient_username || strlen(xclient_username) <= 1)
        xclient_username = CLIENT_LOGIN;
@@ -246,5 +243,3 @@ runssh(
     /* should never go here, shut up compiler warning */
     return(-1);
 }
-
-#endif /* SSH_SECURITY */
diff --git a/common-src/statfs.c b/common-src/statfs.c
deleted file mode 100644 (file)
index 6f3e26a..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: statfs.c,v 1.16 2006/08/24 17:05:35 martinea Exp $
- *
- * a generic statfs-like routine
- */
-#include "amanda.h"
-#include "statfs.h"
-
-/*
- * You are in a maze of twisty passages, all alike.
- * Begin retching now.
- */
-
-#ifdef STATFS_ULTRIX
-# include <sys/param.h>
-# include <sys/mount.h>
-# define STATFS_STRUCT struct fs_data
-# define STATFS_TOTAL(buf)     (buf).fd_btot
-# define STATFS_AVAIL(buf)     (buf).fd_bfreen
-# define STATFS_FREE(buf)      (buf).fd_bfree
-# define STATFS_FILES(buf)     (buf).fd_gtot
-# define STATFS_FAVAIL(buf)    (buf).fd_gfree
-# define STATFS_FFREE(buf)     (buf).fd_gfree
-# define STATFS_SCALE(buf)     1024
-# define STATFS(path, buffer)  statfs(path, &buffer)
-#else
-# if defined(HAVE_SYS_STATVFS_H) && !defined(STATFS_SCO_OS5)
-/*
-** System V.4 (STATFS_SVR4)
-*/
-#  include <sys/statvfs.h>
-#  define STATFS_TYP           "SVR4 (Irix-5+, Solaris-2, Linux glibc 2.1)"
-#  define STATFS_STRUCT        struct statvfs
-#  define STATFS_TOTAL(buf)    (buf).f_blocks
-#  define STATFS_AVAIL(buf)    (buf).f_bavail
-#  define STATFS_FREE(buf)     (buf).f_bfree
-#  define STATFS_FILES(buf)    (buf).f_files
-#  define STATFS_FAVAIL(buf)   (buf).f_favail
-#  define STATFS_FFREE(buf)    (buf).f_ffree
-#  define STATFS_SCALE(buf)    ((buf).f_frsize?(buf).f_frsize:(buf).f_bsize)
-#  define STATFS(path, buffer) statvfs(path, &buffer)
-# else
-#  if HAVE_SYS_VFS_H
-/*
-** (STATFS_AIX, STATFS_VFS, STATFS_NEXT)
-*/
-#   ifdef HAVE_SYS_STATFS_H /* AIX */
-#    include <sys/statfs.h>
-#   endif
-#   include <sys/vfs.h>
-#   define STATFS_TYP          "Posix (NeXTstep, AIX, Linux, HP-UX)"
-#   define STATFS_STRUCT       struct statfs
-#   define STATFS_TOTAL(buf)   (buf).f_blocks
-#   define STATFS_AVAIL(buf)   (buf).f_bavail
-#   define STATFS_FREE(buf)    (buf).f_bfree
-#   define STATFS_FILES(buf)   (buf).f_files
-#   define STATFS_FAVAIL(buf)  (buf).f_ffree
-#   define STATFS_FFREE(buf)   (buf).f_ffree
-#   define STATFS_SCALE(buf)   (buf).f_bsize
-#   define STATFS(path, buffer)        statfs(path, &buffer)
-#  else
-#   if HAVE_SYS_STATFS_H
-/*
-** System V.3 (STATFS_SVR3)
-*/
-#    include <sys/statfs.h>
-#    define STATFS_TYP         "SVR3 (Irix-3, Irix-4)"
-#    define STATFS_STRUCT      struct statfs
-#    define STATFS_TOTAL(buf)  (buf).f_blocks
-#    define STATFS_AVAIL(buf)  (buf).f_bfree
-#    define STATFS_FREE(buf)   (buf).f_bfree
-#    define STATFS_FILES(buf)  (buf).f_files
-#    define STATFS_FAVAIL(buf) (buf).f_ffree
-#    define STATFS_FFREE(buf)  (buf).f_ffree
-#    define STATFS_SCALE(buf)  (buf).f_bsize
-#    define STATFS(path, buffer)       statfs(path, &buffer, SIZEOF(STATFS_STRUCT), 0)
-#   else
-#    if HAVE_SYS_MOUNT_H
-/*
-** BSD (STATFS_BSD43, STATFS_BSD44)
-*/
-#     ifdef HAVE_SYS_PARAM_H /* BSD-4.4 */
-#      include <sys/param.h>
-#     endif
-#     include <sys/mount.h>
-#     define STATFS_TYP                "BSD43/44"
-#     define STATFS_STRUCT     struct statfs
-#     define STATFS_TOTAL(buf) (buf).f_blocks
-#     define STATFS_AVAIL(buf) (buf).f_bavail
-#     define STATFS_FREE(buf)  (buf).f_bfree
-#     define STATFS_FILES(buf) (buf).f_files
-#     define STATFS_FAVAIL(buf)        (buf).f_ffree
-#     define STATFS_FFREE(buf) (buf).f_ffree
-#     define STATFS_SCALE(buf) (buf).f_bsize
-#     define STATFS(path, buffer)      statfs(path, &buffer)
-#     ifdef STATFS_OSF1
-#      define STATFS(path, buffer)     statfs(path, &buffer, SIZEOF(STATFS_STRUCT))
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-
-off_t scale(off_t r, off_t s);
-
-off_t
-scale(
-    off_t r,
-    off_t s)
-{
-    if (r == (off_t)-1)
-       return (off_t)-1;
-    if (s % 1024 == 0)
-       return r*(s/(off_t)1024);
-    return (off_t)(r*((double)s/1024.0));
-}
-
-int
-get_fs_stats(
-    char *             dir,
-    generic_fs_stats_t *sp)
-{
-    STATFS_STRUCT statbuf;
-
-    if(STATFS(dir, statbuf) == -1)
-       return -1;
-
-    /* total, avail, free: converted to kbytes, rounded down */
-
-    sp->total = scale((off_t)STATFS_TOTAL(statbuf),
-                     (off_t)STATFS_SCALE(statbuf));
-    sp->avail = scale((off_t)STATFS_AVAIL(statbuf),
-                     (off_t)STATFS_SCALE(statbuf));
-    sp->free  = scale((off_t)STATFS_FREE(statbuf),
-                     (off_t)STATFS_SCALE(statbuf));
-
-    /* inode stats */
-
-    sp->files  = (off_t)STATFS_FILES(statbuf);
-    sp->favail = (off_t)STATFS_FAVAIL(statbuf);
-    sp->ffree  = (off_t)STATFS_FFREE(statbuf);
-
-    return 0;
-}
-
-#ifdef TEST
-/* ----- test scaffolding ----- */
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-    generic_fs_stats_t statbuf;
-
-    safe_fd(-1, 0);
-
-    set_pname(argv[0]);
-
-    dbopen(NULL);
-
-    if(argc < 2) {
-       fprintf(stderr, "Usage: %s files ...\n", get_pname());
-       return 1;
-    }
-
-    printf("statfs (%s)\n",STATFS_TYP);
-    printf(
-"name                            total     free    avail   files   ffree  favail\n"
-          );
-    printf(
-"---------------------------- -------- -------- -------- ------- ------- -------\n"
-          );
-
-    do {
-       argc--,argv++;
-       if(get_fs_stats(*argv, &statbuf) == -1) {
-           perror(*argv);
-           continue;
-       }
-       printf("%-28.28s %8ld %8ld %8ld %7ld %7ld %7ld\n", *argv,
-              statbuf.total, statbuf.free, statbuf.avail,
-              statbuf.files, statbuf.ffree, statbuf.favail);
-    } while(argc > 1);
-    return 0;
-}
-#endif
diff --git a/common-src/statfs.h b/common-src/statfs.h
deleted file mode 100644 (file)
index 7252e8f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: statfs.h,v 1.4 2006/05/25 01:47:12 johnfranks Exp $
- *
- * interface to statfs module
- */
-#ifndef STATFS_H
-#define STATFS_H
-
-#include "amanda.h"
-
-typedef struct generic_fs_stats {
-    off_t total;               /* total KB in filesystem */
-    off_t avail;               /* KB available to non-superuser */
-    off_t free;                /* KB free for superuser */
-
-    off_t files;               /* total # of files in filesystem */
-    off_t favail;              /* # files avail for non-superuser */
-    off_t ffree;               /* # files free for superuser */
-} generic_fs_stats_t;
-
-int get_fs_stats(char *dir, generic_fs_stats_t *sp);
-
-#endif /* !STATFS_H */
index b7925e9a8b697504eb6f91d694fc3f6e3ca62a82..789de4a4c16098b4127765160713eee5f4801422 100644 (file)
@@ -35,6 +35,7 @@
 #include "util.h"
 #include "conffile.h"
 #include "security-util.h"
+#include "sockaddr-util.h"
 
 /* local functions */
 static void try_socksize(int sock, int which, size_t size);
@@ -44,6 +45,7 @@ static int stream_client_internal(const char *hostname, in_port_t port,
 
 int
 stream_server(
+    int family,
     in_port_t *portp,
     size_t sendsize,
     size_t recvsize,
@@ -62,8 +64,13 @@ stream_server(
     int socket_family;
 
     *portp = USHRT_MAX;                                /* in case we error exit */
-    socket_family = AF_NATIVE;
-    server_socket = socket(AF_NATIVE, SOCK_STREAM, 0);
+    if (family == -1) {
+       socket_family = AF_NATIVE;
+    } else {
+       socket_family = family;
+    }
+    server_socket = socket(socket_family, SOCK_STREAM, 0);
+    
 #ifdef WORKING_IPV6
     /* if that address family actually isn't supported, just try AF_INET */
     if (server_socket == -1 && errno == EAFNOSUPPORT) {
@@ -73,9 +80,8 @@ stream_server(
 #endif
     if (server_socket == -1) {
        save_errno = errno;
-       dbprintf(("%s: stream_server: socket() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("stream_server: socket() failed: %s\n"),
+                 strerror(save_errno));
        errno = save_errno;
        return -1;
     }
@@ -83,9 +89,8 @@ stream_server(
        aclose(server_socket);
        errno = EMFILE;                         /* out of range */
        save_errno = errno;
-       dbprintf(("%s: stream_server: socket out of range: %d\n",
-                 debug_prefix_time(NULL),
-                 server_socket));
+       dbprintf(_("stream_server: socket out of range: %d\n"),
+                 server_socket);
        errno = save_errno;
        return -1;
     }
@@ -97,9 +102,8 @@ stream_server(
     r = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR,
        (void *)&on, (socklen_t)sizeof(on));
     if (r < 0) {
-       dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(errno)));
+       dbprintf(_("stream_server: setsockopt(SO_REUSEADDR) failed: %s\n"),
+                 strerror(errno));
     }
 #endif
 
@@ -128,29 +132,27 @@ stream_server(
            if (bind_portrange(server_socket, &server, (in_port_t)portrange[0],
                               (in_port_t)portrange[1], "tcp") == 0)
                goto out;
-           dbprintf(("%s: stream_server: Could not bind to port in range: %d - %d.\n",
-                     debug_prefix_time(NULL), portrange[0], portrange[1]));
+           dbprintf(_("stream_server: Could not bind to port in range: %d - %d.\n"),
+                     portrange[0], portrange[1]);
        } else {
            socklen = SS_LEN(&server);
            if (bind(server_socket, (struct sockaddr *)&server, socklen) == 0)
                goto out;
-           dbprintf(("%s: stream_server: Could not bind to any port: %s\n",
-                     debug_prefix_time(NULL), strerror(errno)));
+           dbprintf(_("stream_server: Could not bind to any port: %s\n"),
+                     strerror(errno));
        }
 
        if (retries >= BIND_CYCLE_RETRIES)
            break;
 
-       dbprintf(("%s: stream_server: Retrying entire range after 10 second delay.\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("stream_server: Retrying entire range after 10 second delay.\n"));
 
        sleep(15);
     }
 
     save_errno = errno;
-    dbprintf(("%s: stream_server: bind(in6addr_any) failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+    dbprintf(_("stream_server: bind(in6addr_any) failed: %s\n"),
+                 strerror(save_errno));
     aclose(server_socket);
     errno = save_errno;
     return -1;
@@ -163,9 +165,8 @@ out:
     len = SIZEOF(server);
     if(getsockname(server_socket, (struct sockaddr *)&server, &len) == -1) {
        save_errno = errno;
-       dbprintf(("%s: stream_server: getsockname() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("stream_server: getsockname() failed: %s\n"),
+                 strerror(save_errno));
        aclose(server_socket);
        errno = save_errno;
        return -1;
@@ -176,9 +177,8 @@ out:
        (void *)&on, (socklen_t)sizeof(on));
     if(r == -1) {
        save_errno = errno;
-       dbprintf(("%s: stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n"),
+                 strerror(save_errno));
         aclose(server_socket);
        errno = save_errno;
         return -1;
@@ -186,9 +186,8 @@ out:
 #endif
 
     *portp = SS_GET_PORT(&server);
-    dbprintf(("%s: stream_server: waiting for connection: %s\n",
-             debug_prefix_time(NULL),
-             str_sockaddr(&server)));
+    dbprintf(_("stream_server: waiting for connection: %s\n"),
+             str_sockaddr(&server));
     return server_socket;
 }
 
@@ -208,69 +207,60 @@ stream_client_internal(
     int client_socket;
     int *portrange;
     int result;
-    struct addrinfo hints;
-    struct addrinfo *res = NULL;
+    struct addrinfo *res, *res_addr;
 
     f = priv ? "stream_client_privileged" : "stream_client";
 
-#ifdef WORKING_IPV6
-    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-    hints.ai_family = (sa_family_t)AF_UNSPEC;
-#else
-    hints.ai_flags = AI_CANONNAME;
-    hints.ai_family = (sa_family_t)AF_INET;
-#endif
-    hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_protocol = IPPROTO_UDP;
-    hints.ai_addrlen = 0;
-    hints.ai_addr = NULL;
-    hints.ai_canonname = NULL;
-    hints.ai_next = NULL;
-    result = getaddrinfo(hostname, NULL, &hints, &res);
-#ifdef WORKING_IPV6
+    result = resolve_hostname(hostname, SOCK_STREAM, &res, NULL);
     if(result != 0) {
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       result = getaddrinfo(hostname, NULL, &hints, &res);
+       dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result));
+       errno = EHOSTUNREACH;
+       return -1;
     }
-#endif
-    if(result != 0) {
-        dbprintf(("getaddrinfo: %s\n", gai_strerror(result)));
+    if(!res) {
+       dbprintf(_("resolve_hostname(%s): no results\n"), hostname);
+       errno = EHOSTUNREACH;
        return -1;
     }
 
-    memcpy(&svaddr, res->ai_addr, (size_t)res->ai_addrlen);
-    freeaddrinfo(res);
-    SS_SET_PORT(&svaddr, port);
+    for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
+       /* copy the first (preferred) address we found */
+       copy_sockaddr(&svaddr, res_addr->ai_addr);
+       SS_SET_PORT(&svaddr, port);
 
-    SS_INIT(&claddr, svaddr.ss_family);
-    SS_SET_INADDR_ANY(&claddr);
+       SS_INIT(&claddr, svaddr.ss_family);
+       SS_SET_INADDR_ANY(&claddr);
 
-    /*
-     * If a privileged port range was requested, we try to get a port in
-     * that range first and fail if it is not available.  Next, we try
-     * to get a port in the range built in when Amanda was configured.
-     * If that fails, we just go for any port.
-     *
-     * It is up to the caller to make sure we have the proper permissions
-     * to get the desired port, and to make sure we return a port that
-     * is within the range it requires.
-     */
-    if (priv) {
-       portrange = getconf_intrange(CNF_RESERVED_TCP_PORT);
-    } else {
-       portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT);
+       /*
+        * If a privileged port range was requested, we try to get a port in
+        * that range first and fail if it is not available.  Next, we try
+        * to get a port in the range built in when Amanda was configured.
+        * If that fails, we just go for any port.
+        *
+        * It is up to the caller to make sure we have the proper permissions
+        * to get the desired port, and to make sure we return a port that
+        * is within the range it requires.
+        */
+       if (priv) {
+           portrange = getconf_intrange(CNF_RESERVED_TCP_PORT);
+       } else {
+           portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT);
+       }
+       client_socket = connect_portrange(&claddr, (in_port_t)portrange[0],
+                                         (in_port_t)portrange[1],
+                                         "tcp", &svaddr, nonblock);
+       save_errno = errno;
+       if (client_socket > 0)
+           break;
     }
-    client_socket = connect_portrange(&claddr, (in_port_t)portrange[0],
-                                     (in_port_t)portrange[1],
-                                      "tcp", &svaddr, nonblock);
-    save_errno = errno;
+
+    freeaddrinfo(res);
                                          
     if (client_socket > 0)
        goto out;
 
-    dbprintf(("%s: stream_client: Could not bind to port in range %d-%d.\n",
-             debug_prefix_time(NULL), portrange[0], portrange[1]));
+    dbprintf(_("stream_client: Could not bind to port in range %d-%d.\n"),
+             portrange[0], portrange[1]);
 
     errno = save_errno;
     return -1;
@@ -350,14 +340,13 @@ stream_accept(
        if(nfound <= 0 || !FD_ISSET(server_socket, &readset)) {
            save_errno = errno;
            if(nfound < 0) {
-               dbprintf(("%s: stream_accept: select() failed: %s\n",
-                     debug_prefix_time(NULL),
-                     strerror(save_errno)));
+               dbprintf(_("stream_accept: select() failed: %s\n"),
+                     strerror(save_errno));
            } else if(nfound == 0) {
-               dbprintf(("%s: stream_accept: timeout after %d second%s\n",
-                     debug_prefix_time(NULL),
-                     timeout,
-                     (timeout == 1) ? "" : "s"));
+               dbprintf(plural(_("stream_accept: timeout after %d second\n"),
+                               _("stream_accept: timeout after %d seconds\n"),
+                              timeout),
+                        timeout);
                errno = ENOENT;                 /* ??? */
                return -1;
            } else if (!FD_ISSET(server_socket, &readset)) {
@@ -365,10 +354,9 @@ stream_accept(
 
                for(i = 0; i < server_socket + 1; i++) {
                    if(FD_ISSET(i, &readset)) {
-                       dbprintf(("%s: stream_accept: got fd %d instead of %d\n",
-                             debug_prefix_time(NULL),
+                       dbprintf(_("stream_accept: got fd %d instead of %d\n"),
                              i,
-                             server_socket));
+                             server_socket);
                    }
                }
                save_errno = EBADF;
@@ -388,9 +376,8 @@ stream_accept(
        if(connected_socket < 0) {
            break;
        }
-       dbprintf(("%s: stream_accept: connection from %s\n",
-                 debug_prefix_time(NULL),
-                 str_sockaddr(&addr)));
+       dbprintf(_("stream_accept: connection from %s\n"),
+                 str_sockaddr(&addr));
        /*
         * Make certain we got an inet connection and that it is not
         * from port 20 (a favorite unauthorized entry tool).
@@ -406,31 +393,28 @@ stream_accept(
                try_socksize(connected_socket, SO_RCVBUF, recvsize);
                return connected_socket;
            } else {
-               dbprintf(("%s: remote port is %u: ignored\n",
-                         debug_prefix_time(NULL), (unsigned int)port));
+               dbprintf(_("remote port is %u: ignored\n"),
+                         (unsigned int)port);
            }
        } else {
 #ifdef WORKING_IPV6
-           dbprintf(("%s: family is %d instead of %d(AF_INET)"
-                     " or %d(AF_INET6): ignored\n",
-                     debug_prefix_time(NULL),
+           dbprintf(_("family is %d instead of %d(AF_INET)"
+                     " or %d(AF_INET6): ignored\n"),
                      addr.ss_family,
-                     AF_INET, AF_INET6));
+                     AF_INET, AF_INET6);
 #else
-           dbprintf(("%s: family is %d instead of %d(AF_INET)"
-                     ": ignored\n",
-                     debug_prefix_time(NULL),
+           dbprintf(_("family is %d instead of %d(AF_INET)"
+                     ": ignored\n"),
                      addr.ss_family,
-                     AF_INET));
+                     AF_INET);
 #endif
        }
        aclose(connected_socket);
     }
 
     save_errno = errno;
-    dbprintf(("%s: stream_accept: accept() failed: %s\n",
-             debug_prefix_time(NULL),
-             strerror(save_errno)));
+    dbprintf(_("stream_accept: accept() failed: %s\n"),
+             strerror(save_errno));
     errno = save_errno;
     return -1;
 }
@@ -456,14 +440,12 @@ try_socksize(
        isize -= 1024;
     }
     if(isize > 1024) {
-       dbprintf(("%s: try_socksize: %s buffer size is %d\n",
-                 debug_prefix_time(NULL),
-                 (which == SO_SNDBUF) ? "send" : "receive",
-                 isize));
+       dbprintf(_("try_socksize: %s buffer size is %d\n"),
+                 (which == SO_SNDBUF) ? _("send") : _("receive"),
+                 isize);
     } else {
-       dbprintf(("%s: try_socksize: could not allocate %s buffer of " SIZE_T_FMT "\n",
-                 debug_prefix_time(NULL),
-                 (which == SO_SNDBUF) ? "send" : "receive",
-                 origsize));
+       dbprintf(_("try_socksize: could not allocate %s buffer of %zu\n"),
+                 (which == SO_SNDBUF) ? _("send") : _("receive"),
+                 origsize);
     }
 }
index eb73dd4715ed02d47cc64ae41f1155ca61aef5f8..0eaa4b805d554306b42b6bd5dcde0c712a613f80 100644 (file)
@@ -37,7 +37,8 @@
 #define NETWORK_BLOCK_BYTES    DISK_BLOCK_BYTES
 #define STREAM_BUFSIZE         (NETWORK_BLOCK_BYTES * 2)
 
-int stream_server(in_port_t *port, size_t sendsize, size_t recvsize, int priv);
+int stream_server(int family, in_port_t *port, size_t sendsize,
+                 size_t recvsize, int priv);
 int stream_accept(int sock, int timeout, size_t sendsize, size_t recvsize);
 int stream_client_privileged(const char *hostname,
                                in_port_t port,
diff --git a/common-src/svn-info.h b/common-src/svn-info.h
new file mode 100644 (file)
index 0000000..19f0d7f
--- /dev/null
@@ -0,0 +1,2 @@
+#define BUILT_REV "933"
+#define BUILT_BRANCH "amanda-260"
index 8a47596e30c207903a26e7152892e3625f97325f..803ea6803fa61adc7ee82180521d68439dc243a7 100644 (file)
@@ -45,7 +45,7 @@ num_entries(
     for(cur_tape = tapelist ; cur_tape ; cur_tape = cur_tape->next)
        count++;
 
-    dbprintf(("num_entries(tapelist=%p)=%d\n", tapelist, count));
+    dbprintf("num_entries(tapelist=%p)=%d\n", tapelist, count);
     return(count);
 }
 
@@ -57,19 +57,20 @@ dump_tapelist(
     int count = 0;
     int file;
 
-    dbprintf(("dump_tapelist(%p):\n", tapelist));
+    dbprintf("dump_tapelist(%p):\n", tapelist);
     for(cur_tape = tapelist ; cur_tape != NULL ; cur_tape = cur_tape->next) {
-       dbprintf(("  %p->next     = %p\n", cur_tape, cur_tape->next));
-       dbprintf(("  %p->label    = %s\n", cur_tape, cur_tape->label));
-       dbprintf(("  %p->isafile  = %d\n", cur_tape, cur_tape->isafile));
-       dbprintf(("  %p->numfiles = %d\n", cur_tape, cur_tape->numfiles));
+       dbprintf("  %p->next     = %p\n", cur_tape, cur_tape->next);
+       dbprintf("  %p->label    = %s\n", cur_tape, cur_tape->label);
+       dbprintf("  %p->isafile  = %d\n", cur_tape, cur_tape->isafile);
+       dbprintf("  %p->numfiles = %d\n", cur_tape, cur_tape->numfiles);
        for (file=0; file < cur_tape->numfiles; file++) {
-           dbprintf(("  %p->files[%d] = " OFF_T_FMT "\n",
-                    cur_tape, file, (OFF_T_FMT_TYPE)cur_tape->files[file]));
+           dbprintf("  %p->files[%d] = %lld, %p->partnum[%d] = %lld\n",
+                    cur_tape, file, (long long)cur_tape->files[file],
+                    cur_tape, file, (long long)cur_tape->partnum[file]);
        }
        count++;
     }
-    dbprintf(("  %p count     = %d\n", tapelist, count));
+    dbprintf("  %p count     = %d\n", tapelist, count);
 }
 
 /*
@@ -81,37 +82,46 @@ append_to_tapelist(
     tapelist_t *tapelist,
     char *     label,
     off_t      file,
+    int        partnum,
     int                isafile)
 {
     tapelist_t *new_tape, *cur_tape;
     int c;
 
-    dbprintf(("append_to_tapelist(tapelist=%p, label='%s', , file="
-               OFF_T_FMT ", isafile=%d)\n",
-               tapelist, label, (OFF_T_FMT_TYPE)file, isafile));
+    dbprintf("append_to_tapelist(tapelist=%p, label='%s', file=%lld, partnum=%d,  isafile=%d)\n",
+               tapelist, label, (long long)file, partnum, isafile);
 
     /* see if we have this tape already, and if so just add to its file list */
     for(cur_tape = tapelist; cur_tape; cur_tape = cur_tape->next) {
        if(strcmp(label, cur_tape->label) == 0) {
            int d_idx = 0;
            off_t *newfiles;
+           int   *newpartnum;
 
            if(file >= (off_t)0) {
                newfiles = alloc(SIZEOF(*newfiles) *
                                 (cur_tape->numfiles + 1));
+               newpartnum = alloc(SIZEOF(*newpartnum) *
+                                (cur_tape->numfiles + 1));
                for(c = 0; c < cur_tape->numfiles ; c++) {
                    if(cur_tape->files[c] > file && c == d_idx) {
                        newfiles[d_idx] = file;
+                       newpartnum[d_idx] = partnum;
                        d_idx++;
                    }
                    newfiles[d_idx] = cur_tape->files[c];
+                   newpartnum[d_idx] = cur_tape->partnum[c];
                    d_idx++;
                }
-               if(c == d_idx)
+               if(c == d_idx) {
                    newfiles[d_idx] = file;
+                   newpartnum[d_idx] = partnum;
+               }
                cur_tape->numfiles++;
                amfree(cur_tape->files);
+               amfree(cur_tape->partnum);
                cur_tape->files = newfiles;
+               cur_tape->partnum = newpartnum;
            }
            return(tapelist);
        }
@@ -123,6 +133,8 @@ append_to_tapelist(
     if(file >= (off_t)0){
        new_tape->files = alloc(SIZEOF(*(new_tape->files)));
        new_tape->files[0] = file;
+       new_tape->partnum = alloc(SIZEOF(*(new_tape->partnum)));
+       new_tape->partnum[0] = partnum;
        new_tape->numfiles = 1;
        new_tape->isafile = isafile;
     }
@@ -227,8 +239,8 @@ marshal_tapelist(
 
        for(c = 0; c < cur_tape->numfiles ; c++){
            char num_str[NUM_STR_SIZE];
-           snprintf(num_str, SIZEOF(num_str), OFF_T_FMT,
-                       (OFF_T_FMT_TYPE)cur_tape->files[c]);
+           g_snprintf(num_str, SIZEOF(num_str), "%lld",
+                       (long long)cur_tape->files[c]);
            if (!files_str)
                files_str = stralloc(num_str);
            else
@@ -282,7 +294,7 @@ unmarshal_tapelist_str(
        }
        if(*tapelist_str != '\0')
            tapelist_str++;
-       tapelist = append_to_tapelist(tapelist, temp_label, (off_t)-1, 0);
+       tapelist = append_to_tapelist(tapelist, temp_label, (off_t)-1, -1, 0);
 
        /* now read the list of file numbers */
        while(*tapelist_str != ';' && *tapelist_str != '\0'){
@@ -298,7 +310,7 @@ unmarshal_tapelist_str(
            }
            filenum = OFF_T_ATOI(temp_filenum);
 
-           tapelist = append_to_tapelist(tapelist, temp_label, filenum, 0);
+           tapelist = append_to_tapelist(tapelist, temp_label, filenum, -1, 0);
            if(*tapelist_str != '\0' && *tapelist_str != ';')
                tapelist_str++;
        }
@@ -326,6 +338,7 @@ free_tapelist(
     for(cur_tape = tapelist ; cur_tape ; cur_tape = cur_tape->next){
        amfree(cur_tape->label);
        amfree(cur_tape->files);
+       amfree(cur_tape->partnum);
        amfree(prev);
        prev = cur_tape;
     }
index e6b58e20dff93c90385520a7b9b427d414837a94..c025046eb8fda6bc0eb4762b0fd267c5c45d6eff 100644 (file)
@@ -45,12 +45,13 @@ typedef struct tapelist_s {
     char *label;
     int isafile; /* set to 1 and make *label the path to the file */
     off_t *files;
+    int   *partnum;
     int numfiles;
 } tapelist_t;
 
 int num_entries(tapelist_t *tapelist);
 tapelist_t *append_to_tapelist(tapelist_t *tapelist, char *label,
-                                       off_t file, int isafile);
+                                       off_t file, int partnum, int isafile);
 char *marshal_tapelist(tapelist_t *tapelist, int escape);
 tapelist_t *unmarshal_tapelist_str(char *tapelist_str);
 char *escape_label(char *label);
diff --git a/common-src/timestamp.c b/common-src/timestamp.c
new file mode 100644 (file)
index 0000000..dfeec75
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1999 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+
+#include "timestamp.h"
+#include "conffile.h"
+#include <glib.h>
+
+/*
+ * Construct a datestamp (YYYYMMDD) from a time_t.
+ */
+char * get_datestamp_from_time(time_t when) {
+    struct tm *tm;
+    
+    if(when == (time_t)0) {
+       when = time((time_t *)NULL);
+    }
+    
+    tm = localtime(&when);
+    return g_strdup_printf("%04d%02d%02d",
+                           tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
+}
+
+/*
+ * Construct a timestamp (YYYYMMDDHHMMSS) from a time_t.
+ */
+char * get_timestamp_from_time(time_t when) {
+    struct tm *tm;
+
+    if(when == (time_t)0) {
+       when = time((time_t *)NULL);
+    } 
+
+    tm = localtime(&when);
+    return g_strdup_printf("%04d%02d%02d%02d%02d%02d",
+                           tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+                           tm->tm_hour, tm->tm_min, tm->tm_sec);
+}
+
+char * get_proper_stamp_from_time(time_t when) {
+    if (getconf_boolean(CNF_USETIMESTAMPS)) {
+        return get_timestamp_from_time(when);
+    } else {
+        return get_datestamp_from_time(when);
+    }
+}
+
+time_state_t get_timestamp_state(char * timestamp) {
+    if (timestamp == NULL || *timestamp == '\0') {
+        return TIME_STATE_REPLACE;
+    } else if (strcmp(timestamp, "X") == 0) {
+        return TIME_STATE_UNDEF;
+    } else {
+        return TIME_STATE_SET;
+    }
+}
+
+char * get_undef_timestamp(void) {
+    return strdup("X");
+}
diff --git a/common-src/timestamp.h b/common-src/timestamp.h
new file mode 100644 (file)
index 0000000..81a3b9e
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-1999 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+/*
+ * $Id$
+ *
+ * Date and time utility functions
+ */
+
+#ifndef TIMESTAMP_H
+#define TIMESTAMP_H
+
+#include "amanda.h"
+
+/* These functions do the opposite; they formats a time_t for
+   network or media storage. The return value is allocated with
+   malloc(). If time == 0, then these functions will use the current
+   time. */
+char * get_timestamp_from_time(time_t time);
+char * get_datestamp_from_time(time_t time);
+char * get_proper_stamp_from_time(time_t time);
+
+typedef enum {
+    TIME_STATE_REPLACE,
+    TIME_STATE_UNDEF,
+    TIME_STATE_SET
+} time_state_t;
+
+/* Returns the state of a timestamp. */
+time_state_t get_timestamp_state(char * timestamp);
+
+/* Returns a "X" timestamp. */
+char * get_undef_timestamp(void);
+
+#endif /* TIMESTAMP_H */
+
index 5dd8569a9a6206ed378de578317a72fd7c2b9680..6489da3581e7d375601912a35d901c7bcc2ebb1b 100644 (file)
@@ -135,7 +135,7 @@ printf_arglist_function(char *squotef, char *, format)
        /* Format the token */
 
        arglist_start(argp, format);
-       vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
+       g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
        arglist_end(argp);
 
        return quote(" ", linebuf);
@@ -149,7 +149,7 @@ printf_arglist_function1(char *quotef, char *, sep, char *, format)
        /* Format the token */
 
        arglist_start(argp, format);
-       vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
+       g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp);
        arglist_end(argp);
 
        return quote(sep, linebuf);
@@ -415,8 +415,19 @@ main(
        char *sr;
        int i;
 
+       /*
+        * Configure program for internationalization:
+        *   1) Only set the message locale for now.
+        *   2) Set textdomain for all amanda related programs to "amanda"
+        *      We don't want to be forced to support dozens of message catalogs
+        */  
+       setlocale(LC_MESSAGES, "C");
+       textdomain("amanda"); 
+
        safe_fd(-1, 0);
 
+       setlocale(LC_ALL, "C");
+
        /* shut up compiler */
        argc = argc;
        argv = argv;
@@ -430,36 +441,38 @@ main(
 
        erroutput_type = ERR_INTERACTIVE;
 
-       printf("Testing split() with \" \" token separator\n");
+       g_printf(_("Testing split() with \" \" token separator\n"));
        while(1) {
-               printf("Input string: ");
+               g_printf(_("Input string: "));
                amfree(str);
                if ((str = agets(stdin)) == NULL) {
-                       printf("\n");
+                       g_printf("\n");
                        break;
                }
                r = split(str, t, 20, " ");
-               printf("%d token%s:\n", r, (r == 1) ? "" : "s");
-               for (i=0; i <= r; i++) printf("tok[%d] = \"%s\"\n", i, t[i]);
+               g_printf(plural(_("%d token:\n"), _("%d token:\n"), r), r);
+               for (i=0; i <= r; i++)
+                       g_printf("tok[%d] = \"%s\"\n", i, t[i]);
        }
        amfree(str);
-       printf("\n");
+       g_printf("\n");
 
-       printf("Testing quote()\n");
+       g_printf(_("Testing quote()\n"));
        while(1) {
-               printf("Input string: ");
+               g_printf(_("Input string: "));
                amfree(str);
                if ((str = agets(stdin)) == NULL) {
-                       printf("\n");
+                       g_printf("\n");
                        break;
                }
                sr = squote(str);
-               printf("Quoted   = \"%s\"\n", sr);
+               g_printf(_("Quoted   = \"%s\"\n"), sr);
                strncpy(str,sr,SIZEOF(str)-1);
                str[SIZEOF(str)-1] = '\0';
                r = split(str, t, 20, " ");
-               if (r != 1) printf("split()=%d!\n", r);
-               printf("Unquoted = \"%s\"\n", t[1]);
+               if (r != 1)
+                       g_printf("split()=%d!\n", r);
+               g_printf(_("Unquoted = \"%s\"\n"), t[1]);
                amfree(sr);
        }
        amfree(str);
index 1856cbf8a6d632882d89a73bc93a9cc4d9047639..4d806997cd4787412eeec3a574b5f1c6ff131650 100644 (file)
@@ -37,10 +37,10 @@ typedef struct {char *word; int value;} table_t;
 
 extern int split(char *str, char **token, int toklen, char *sep);
 extern char *squotef(char *format, ...)
-    __attribute__ ((format (printf, 1, 2)));
+     G_GNUC_PRINTF(1,2);
 extern char *squote(char *str);
 extern char *quotef(char *sep, char *format, ...)
-    __attribute__ ((format (printf, 2, 3)));
+     G_GNUC_PRINTF(2,3);
 extern char *quote(char *sep, char *str);
 extern char *rxquote(char *str);
 #ifndef HAVE_SHQUOTE
index bb27cfac0618d1af986bd06eae9a231d61111a0e..774719e5444cbfe1fdbec65b14c130aa755a8275 100644 (file)
 
 #include "amanda.h"
 #include "util.h"
+#include <regex.h>
 #include "arglist.h"
 #include "clock.h"
+#include "sockaddr-util.h"
+#include "conffile.h"
 
-/*#define NET_READ_DEBUG*/
-
-#ifdef NET_READ_DEBUG
-#define netprintf(x)    dbprintf(x)
-#else
-#define netprintf(x)
+#ifdef HAVE_LIBCURL
+#include <curl/curl.h>
 #endif
 
 static int make_socket(sa_family_t family);
@@ -120,9 +119,7 @@ make_socket(
     s = socket(family, SOCK_STREAM, 0);
     if (s == -1) {
         save_errno = errno;
-        dbprintf(("%s: make_socket: socket() failed: %s\n",
-                  debug_prefix_time(NULL),
-                  strerror(save_errno)));
+        dbprintf(_("make_socket: socket() failed: %s\n"), strerror(save_errno));
         errno = save_errno;
         return -1;
     }
@@ -136,9 +133,8 @@ make_socket(
     r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
     if (r < 0) {
        save_errno = errno;
-       dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(errno)));
+       dbprintf(_("make_socket: setsockopt(SO_REUSEADDR) failed: %s\n"),
+                 strerror(errno));
        errno = save_errno;
     }
 #endif
@@ -148,9 +144,8 @@ make_socket(
                   (void *)&on, SIZEOF(on));
     if (r == -1) {
        save_errno = errno;
-       dbprintf(("%s: make_socket: setsockopt() failed: %s\n",
-                  debug_prefix_time(NULL),
-                  strerror(save_errno)));
+       dbprintf(_("make_socket: setsockopt() failed: %s\n"),
+                  strerror(save_errno));
        aclose(s);
        errno = save_errno;
        return -1;
@@ -202,10 +197,9 @@ connect_portrange(
        }
     }
 
-    dbprintf(("%s: connect_portrange: all ports between %d and %d busy\n",
-             debug_prefix_time(NULL),
+    dbprintf(_("connect_portrange: All ports between %d and %d are busy.\n"),
              first_port,
-             last_port));
+             last_port);
     errno = EAGAIN;
     return -1;
 }
@@ -231,19 +225,11 @@ connect_port(
 
     servPort = getservbyport((int)htons(port), proto);
     if (servPort != NULL && !strstr(servPort->s_name, "amanda")) {
-       dbprintf(("%s: connect_port: Skip port %d: Owned by %s.\n",
-                 debug_prefix_time(NULL), port, servPort->s_name));
+       dbprintf(_("connect_port: Skip port %d: owned by %s.\n"),
+                 port, servPort->s_name);
        return -1;
     }
 
-    if(servPort == NULL)
-       dbprintf(("%s: connect_port: Try  port %d: Available   - \n",
-                 debug_prefix_time(NULL), port));
-    else {
-       dbprintf(("%s: connect_port: Try  port %d: Owned by %s - \n",
-                 debug_prefix_time(NULL), port, servPort->s_name));
-    }
-
     if ((s = make_socket(addrp->ss_family)) == -1) return -2;
 
     SS_SET_PORT(addrp, port);
@@ -251,24 +237,35 @@ connect_port(
     if (bind(s, (struct sockaddr *)addrp, socklen) != 0) {
        save_errno = errno;
        aclose(s);
+       if(servPort == NULL) {
+           dbprintf(_("connect_port: Try  port %d: available - %s\n"),
+                    port, strerror(errno));
+       } else {
+           dbprintf(_("connect_port: Try  port %d: owned by %s - %s\n"),
+                    port, servPort->s_name, strerror(errno));
+       }
        if (save_errno != EADDRINUSE) {
-           dbprintf(("errno %d strerror %s\n",
-                     errno, strerror(errno)));
            errno = save_errno;
            return -2;
        }
+
        errno = save_errno;
        return -1;
     }
+    if(servPort == NULL) {
+       dbprintf(_("connect_port: Try  port %d: available - Success\n"), port);
+    } else {
+       dbprintf(_("connect_port: Try  port %d: owned by %s - Success\n"),
+                 port, servPort->s_name);
+    }
 
     /* find out what port was actually used */
 
     len = sizeof(*addrp);
     if (getsockname(s, (struct sockaddr *)addrp, &len) == -1) {
        save_errno = errno;
-       dbprintf(("%s: connect_port: getsockname() failed: %s\n",
-                 debug_prefix_time(NULL),
-                 strerror(save_errno)));
+       dbprintf(_("connect_port: getsockname() failed: %s\n"),
+                 strerror(save_errno));
        aclose(s);
        errno = save_errno;
        return -1;
@@ -278,14 +275,12 @@ connect_port(
        fcntl(s, F_SETFL, fcntl(s, F_GETFL, 0)|O_NONBLOCK);
     if (connect(s, (struct sockaddr *)svaddr, SS_LEN(svaddr)) == -1 && !nonblock) {
        save_errno = errno;
-       dbprintf(("%s: connect_portrange: connect from %s failed: %s\n",
-                 debug_prefix_time(NULL),
+       dbprintf(_("connect_portrange: Connect from %s failed: %s\n"),
                  str_sockaddr(addrp),
-                 strerror(save_errno)));
-       dbprintf(("%s: connect_portrange: connect to %s failed: %s\n",
-                 debug_prefix_time(NULL),
+                 strerror(save_errno));
+       dbprintf(_("connect_portrange: connect to %s failed: %s\n"),
                  str_sockaddr(svaddr),
-                 strerror(save_errno)));
+                 strerror(save_errno));
        aclose(s);
        errno = save_errno;
        if (save_errno == ECONNREFUSED ||
@@ -297,12 +292,10 @@ connect_port(
        return -1;
     }
 
-    dbprintf(("%s: connected to %s\n",
-              debug_prefix_time(NULL),
-              str_sockaddr(svaddr)));
-    dbprintf(("%s: our side is %s\n",
-              debug_prefix_time(NULL),
-              str_sockaddr(addrp)));
+    dbprintf(_("connected to %s\n"),
+              str_sockaddr(svaddr));
+    dbprintf(_("our side is %s\n"),
+              str_sockaddr(addrp));
     return s;
 }
 
@@ -343,87 +336,37 @@ bind_portrange(
     for (cnt = 0; cnt < num_ports; cnt++) {
        servPort = getservbyport((int)htons(port), proto);
        if ((servPort == NULL) || strstr(servPort->s_name, "amanda")) {
-           if (servPort == NULL) {
-               dbprintf(("%s: bind_portrange2: Try  port %d: Available   - ",
-                     debug_prefix_time(NULL), port));
-           } else {
-               dbprintf(("%s: bind_portrange2: Try  port %d: Owned by %s - ",
-                     debug_prefix_time(NULL), port, servPort->s_name));
-           }
            SS_SET_PORT(addrp, port);
            socklen = SS_LEN(addrp);
            if (bind(s, (struct sockaddr *)addrp, socklen) >= 0) {
-               dbprintf(("Success\n"));
+               if (servPort == NULL) {
+                   dbprintf(_("bind_portrange2: Try  port %d: Available - Success\n"), port);
+               } else {
+                   dbprintf(_("bind_portrange2: Try  port %d: Owned by %s - Success.\n"), port, servPort->s_name);
+               }
                return 0;
            }
-           dbprintf(("%s\n", strerror(errno)));
+           if (servPort == NULL) {
+               dbprintf(_("bind_portrange2: Try  port %d: Available - %s\n"),
+                       port, strerror(errno));
+           } else {
+               dbprintf(_("bind_portrange2: Try  port %d: Owned by %s - %s\n"),
+                       port, servPort->s_name, strerror(errno));
+           }
        } else {
-               dbprintf(("%s: bind_portrange2: Skip port %d: Owned by %s.\n",
-                     debug_prefix_time(NULL), port, servPort->s_name));
+               dbprintf(_("bind_portrange2: Skip port %d: Owned by %s.\n"),
+                     port, servPort->s_name);
        }
        if (++port > last_port)
            port = first_port;
     }
-    dbprintf(("%s: bind_portrange: all ports between %d and %d busy\n",
-                 debug_prefix_time(NULL),
+    dbprintf(_("bind_portrange: all ports between %d and %d busy\n"),
                  first_port,
-                 last_port));
+                 last_port);
     errno = EAGAIN;
     return -1;
 }
 
-/*
- * Construct a datestamp (YYYYMMDD) from a time_t.
- */
-char *
-construct_datestamp(
-    time_t *t)
-{
-    struct tm *tm;
-    char datestamp[3 * NUM_STR_SIZE];
-    time_t when;
-
-    if (t == NULL) {
-       when = time((time_t *)NULL);
-    } else {
-       when = *t;
-    }
-    tm = localtime(&when);
-    if (!tm)
-       return stralloc("19000101");
-
-    snprintf(datestamp, SIZEOF(datestamp),
-             "%04d%02d%02d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
-    return stralloc(datestamp);
-}
-
-/*
- * Construct a timestamp (YYYYMMDDHHMMSS) from a time_t.
- */
-char *
-construct_timestamp(
-    time_t *t)
-{
-    struct tm *tm;
-    char timestamp[6 * NUM_STR_SIZE];
-    time_t when;
-
-    if (t == NULL) {
-       when = time((time_t *)NULL);
-    } else {
-       when = *t;
-    }
-    tm = localtime(&when);
-    if (!tm)
-       return stralloc("19000101000000");
-
-    snprintf(timestamp, SIZEOF(timestamp),
-            "%04d%02d%02d%02d%02d%02d",
-            tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
-            tm->tm_hour, tm->tm_min, tm->tm_sec);
-    return stralloc(timestamp);
-}
-
 
 int
 needs_quotes(
@@ -447,7 +390,7 @@ quote_string(
 
     if ((str == NULL) || (*str == '\0')) {
        ret = stralloc("\"\"");
-    } else if ((match("[\\\"[:space:][:cntrl:]]", str)) == 0) {
+    } else if ((match("[:\'\\\"[:space:][:cntrl:]]", str)) == 0) {
        /*
         * String does not need to be quoted since it contains
         * neither whitespace, control or quote characters.
@@ -556,52 +499,13 @@ sanitize_string(
     } else {
        ret = stralloc(str);
        for (s = ret; *s != '\0'; s++) {
-           if (iscntrl(*s))
+           if (iscntrl((int)*s))
                *s = '?';
        }
     }
     return (ret);
 }
 
-char *
-strquotedstr(void)
-{
-    char *  tok = strtok(NULL, " ");
-
-    if ((tok != NULL) && (tok[0] == '"')) {
-       char *  t;
-       size_t  len;
-
-        len = strlen(tok);
-       do {
-           t = strtok(NULL, " ");
-           tok[len] = ' ';
-           len = strlen(tok);
-       } while ((t != NULL) &&
-                (tok[len - 1] != '"') && (tok[len - 2] != '\\'));
-    }
-    return tok;
-}
-
-ssize_t
-hexdump(
-    const char *buffer,
-    size_t     len)
-{
-    ssize_t rc = -1;
-
-    FILE *stream = popen("od -c -x -", "w");
-       
-    if (stream != NULL) {
-       fflush(stdout);
-       rc = (ssize_t)fwrite(buffer, len, 1, stream);
-       if (ferror(stream))
-           rc = -1;
-       pclose(stream);
-    }
-    return rc;
-}
-
 /*
    Return 0 if the following characters are present
    * ( ) < > [ ] , ; : ! $ \ / "
@@ -615,138 +519,6 @@ validate_mailto(
     return !match("\\*|<|>|\\(|\\)|\\[|\\]|,|;|:|\\\\|/|\"|\\!|\\$|\\|", mailto);
 }
 
-
-void
-dump_sockaddr(
-    struct sockaddr_storage *sa)
-{
-#ifdef WORKING_IPV6
-    char ipstr[INET6_ADDRSTRLEN];
-#else
-    char ipstr[INET_ADDRSTRLEN];
-#endif
-    int port;
-
-    port = SS_GET_PORT(sa);
-#ifdef WORKING_IPV6
-    if ( sa->ss_family == (sa_family_t)AF_INET6) {
-       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
-                 ipstr, sizeof(ipstr));
-       dbprintf(("%s: (sockaddr_in6 *)%p = { %d, %d, %s }\n",
-                 debug_prefix_time(NULL), sa,
-                 ((struct sockaddr_in6 *)sa)->sin6_family,
-                 port,
-                 ipstr));
-    } else
-#endif
-    {
-       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
-                 sizeof(ipstr));
-       dbprintf(("%s: (sockaddr_in *)%p = { %d, %d, %s }\n",
-                 debug_prefix_time(NULL), sa,
-                 ((struct sockaddr_in *)sa)->sin_family,
-                 port,
-                 ipstr));
-    }
-}
-
-
-#ifdef WORKING_IPV6
-static char mystr_sockaddr[INET6_ADDRSTRLEN + 20];
-#else
-static char mystr_sockaddr[INET_ADDRSTRLEN + 20];
-#endif
-
-char *
-str_sockaddr(
-    struct sockaddr_storage *sa)
-{
-#ifdef WORKING_IPV6
-    char ipstr[INET6_ADDRSTRLEN];
-#else
-    char ipstr[INET_ADDRSTRLEN];
-#endif
-    int port;
-
-    port = SS_GET_PORT(sa);
-#ifdef WORKING_IPV6
-    if ( sa->ss_family == (sa_family_t)AF_INET6) {
-       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
-                 ipstr, sizeof(ipstr));
-    } else
-#endif
-    {
-       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
-                 sizeof(ipstr));
-    }
-    snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port);
-    return mystr_sockaddr;
-}
-
-
-int
-cmp_sockaddr(
-    struct sockaddr_storage *ss1,
-    struct sockaddr_storage *ss2,
-    int addr_only)
-{
-    /* if addresses are v4mapped, "unmap" them */
-#ifdef WORKING_IPV6
-#ifdef IN6_IS_ADDR_V4MAPPED
-    struct sockaddr_in ss1_v4;
-    struct sockaddr_in ss2_v4;
-
-    if (ss1->ss_family == AF_INET6 &&
-        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) {
-       memset(&ss1_v4, 0, sizeof(struct sockaddr_in));
-       memcpy(&ss1_v4.sin_addr.s_addr,
-              &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]),
-              sizeof(struct in_addr));
-       ss1_v4.sin_family = AF_INET;
-       SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1));
-       ss1 = (struct sockaddr_storage *)&ss1_v4;
-    }
-
-    if (ss2->ss_family == AF_INET6 &&
-        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) {
-       memset(&ss2_v4, 0, sizeof(struct sockaddr_in));
-       memcpy(&ss2_v4.sin_addr.s_addr,
-              &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]),
-              sizeof(struct in_addr));
-       ss2_v4.sin_family = AF_INET;
-       SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2));
-       ss2 = (struct sockaddr_storage *)&ss2_v4;
-    }
-#endif
-#endif
-
-    if (ss1->ss_family == ss2->ss_family) {
-        if (addr_only) {
-#ifdef WORKING_IPV6
-            if(ss1->ss_family == (sa_family_t)AF_INET6)
-                return memcmp(
-                    &((struct sockaddr_in6 *)ss1)->sin6_addr,
-                    &((struct sockaddr_in6 *)ss2)->sin6_addr,
-                    sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr));
-            else
-#endif
-                return memcmp(
-                    &((struct sockaddr_in *)ss1)->sin_addr,
-                    &((struct sockaddr_in *)ss2)->sin_addr,
-                    sizeof(((struct sockaddr_in *)ss1)->sin_addr));
-        } else {
-            return memcmp(ss1, ss2, SS_LEN(ss1));
-        }
-    } else {
-        /* compare families to give a total order */
-        if (ss1->ss_family < ss2->ss_family)
-            return -1;
-        else
-            return 1;
-    }
-}
-
-
 int copy_file(
     char  *dst,
     char  *src,
@@ -761,8 +533,8 @@ int copy_file(
     if ((infd = open(src, O_RDONLY)) == -1) {
        save_errno = errno;
        quoted = quote_string(src);
-       *errmsg = vstralloc("Can't open file ", quoted, " for reading: %s",
-                           strerror(save_errno), NULL);
+       *errmsg = vstrallocf(_("Can't open file '%s' for reading: %s"),
+                           quoted, strerror(save_errno));
        amfree(quoted);
        return -1;
     }
@@ -770,8 +542,8 @@ int copy_file(
     if ((outfd = open(dst, O_WRONLY|O_CREAT, 0600)) == -1) {
        save_errno = errno;
        quoted = quote_string(dst);
-       *errmsg = vstralloc("Can't open file ", quoted, " for writting: %s",
-                           strerror(save_errno), NULL);
+       *errmsg = vstrallocf(_("Can't open file '%s' for writting: %s"),
+                           quoted, strerror(save_errno));
        amfree(quoted);
        close(infd);
        return -1;
@@ -781,8 +553,8 @@ int copy_file(
        if(fullwrite(outfd,&buf,(size_t)nb) < nb) {
            save_errno = errno;
            quoted = quote_string(dst);
-           *errmsg = vstralloc("Error writing to \"", quoted, "\":",
-                               strerror(save_errno), NULL);
+           *errmsg = vstrallocf(_("Error writing to '%s': %s"),
+                               quoted, strerror(save_errno));
            amfree(quoted);
            close(infd);
            close(outfd);
@@ -793,8 +565,8 @@ int copy_file(
     if (nb < 0) {
        save_errno = errno;
        quoted = quote_string(src);
-       *errmsg = vstralloc("Error reading from \"", quoted, "\":",
-                           strerror(save_errno), NULL);
+       *errmsg = vstrallocf(_("Error reading from '%s': %s"),
+                           quoted, strerror(save_errno));
        amfree(quoted);
        close(infd);
        close(outfd);
@@ -805,16 +577,18 @@ int copy_file(
     close(outfd);
     return 0;
 }
-#ifndef HAVE_LIBREADLINE
+
+#ifndef HAVE_READLINE
 /*
- * simple readline() replacements
+ * simple readline() replacements, used when we don't have readline
+ * support from the system.
  */
 
 char *
 readline(
     const char *prompt)
 {
-    printf("%s", prompt);
+    g_printf("%s", prompt);
     fflush(stdout);
     fflush(stderr);
     return agets(stdin);
@@ -824,6 +598,344 @@ void
 add_history(
     const char *line)
 {
-    (void)line;        /* Quite unused parameter warning */
+    (void)line;        /* Quiet unused parameter warning */
 }
+
 #endif
+
+/* Order of preference: readdir64(), readdir(). */
+#if HAVE_DECL_READDIR64
+#  define USE_DIRENT64
+#  define USE_READDIR64
+#elif HAVE_DECL_READDIR
+#  define USE_READDIR
+#else
+# error No readdir() or readdir64() available!
+#endif
+
+char * portable_readdir(DIR* handle) {
+
+#ifdef USE_DIRENT64
+    struct dirent64 *entry_p;
+#else
+    struct dirent *entry_p;
+#endif
+
+    static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
+
+    g_static_mutex_lock(&mutex);
+
+#ifdef USE_READDIR
+    entry_p = readdir(handle);
+#endif
+#ifdef USE_READDIR64
+    entry_p = readdir64(handle);
+#endif
+
+    g_static_mutex_unlock(&mutex);
+    
+    if (entry_p == NULL)
+        return NULL;
+
+    /* FIXME: According to glibc documentation, d_name may not be
+       null-terminated in some cases on some very old platforms. Not
+       sure what to do about that case. */
+    return strdup(entry_p->d_name);
+}
+
+int search_directory(DIR * handle, const char * regex,
+                     SearchDirectoryFunctor functor, gpointer user_data) {
+    int rval = 0;
+    regex_t compiled_regex;
+    gboolean done = FALSE;
+
+    if (regcomp(&compiled_regex, regex, REG_EXTENDED | REG_NOSUB) != 0) {
+        regfree(&compiled_regex);
+        return -1;
+    }
+
+    rewinddir(handle);
+
+    while (!done) {
+        char * read_name;
+        int result;
+        read_name = portable_readdir(handle);
+        if (read_name == NULL) {
+            regfree(&compiled_regex);
+            return rval;
+       }
+        result = regexec(&compiled_regex, read_name, 0, NULL, 0);
+        if (result == 0) {
+            rval ++;
+            done = !functor(read_name, user_data);
+        }
+        amfree(read_name);
+    }
+    regfree(&compiled_regex);
+    return rval;
+}
+
+char* find_regex_substring(const char* base_string, const regmatch_t match) {
+    char * rval;
+    int size;
+
+    size = match.rm_eo - match.rm_so;
+    rval = malloc(size+1);
+    memcpy(rval, base_string + match.rm_so, size);
+    rval[size] = '\0';
+
+    return rval;
+}
+
+int compare_possibly_null_strings(const char * a, const char * b) {
+    if (a == b) {
+        /* NULL or otherwise, they're the same. */
+        return 0;
+    } else if (a == NULL) {
+        /* b != NULL */
+        return -1;
+    } else if (b == NULL) {
+        /* a != NULL */
+        return 1;
+    } else {
+        /* a != NULL != b */
+        return strcmp(a, b);
+    }
+}
+
+gboolean amanda_thread_init(void) {
+    gboolean success = FALSE;
+#ifdef HAVE_LIBCURL
+    static gboolean did_curl_init = FALSE;
+    if (!did_curl_init) {
+# ifdef G_THREADS_ENABLED
+        g_assert(!g_thread_supported());
+# endif
+        g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0);
+        did_curl_init = TRUE;
+    }
+#endif
+#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
+    if (g_thread_supported()) {
+        return TRUE;
+    }
+    g_thread_init(NULL);
+    success = TRUE;
+#endif
+    return success;
+}
+
+int
+resolve_hostname(const char *hostname,
+       int socktype,
+       struct addrinfo **res,
+       char **canonname)
+{
+    struct addrinfo hints;
+    struct addrinfo *myres;
+    int flags = 0;
+    int result;
+
+    if (res) *res = NULL;
+    if (canonname) {
+       *canonname = NULL;
+       flags = AI_CANONNAME;
+    }
+
+#ifdef AI_ADDRCONFIG
+    flags |= AI_ADDRCONFIG;
+#endif
+
+    memset(&hints, 0, sizeof(hints));
+    hints.ai_family = AF_UNSPEC;
+    hints.ai_flags = flags;
+    hints.ai_socktype = socktype;
+    result = getaddrinfo(hostname, NULL, &hints, &myres);
+    if (result != 0) {
+       return result;
+    }
+
+    if (canonname && myres && myres->ai_canonname) {
+       *canonname = stralloc(myres->ai_canonname);
+    }
+
+    if (res) {
+       *res = myres;
+    } else {
+       freeaddrinfo(myres);
+    }
+
+    return result;
+}
+
+char *
+_str_exit_status(
+    char *subject,
+    amwait_t status)
+{
+    if (WIFEXITED(status)) {
+       int exitstatus = WEXITSTATUS(status);
+       if (exitstatus == 0)
+           return vstrallocf(_("%s exited normally"), subject);
+       else
+           return vstrallocf(_("%s exited with status %d"), subject, exitstatus);
+    }
+
+    if (WIFSIGNALED(status)) {
+       int signal = WTERMSIG(status);
+#ifdef WCOREDUMP
+       if (WCOREDUMP(status))
+           return vstrallocf(_("%s exited after receiving signal %d (core dumped)"),
+               subject, signal);
+       else
+#endif
+           return vstrallocf(_("%s exited after receiving signal %d"),
+               subject, signal);
+    }
+
+    if (WIFSTOPPED(status)) {
+       int signal = WSTOPSIG(status);
+       return vstrallocf(_("%s stopped temporarily after receiving signal %d"),
+           subject, signal);
+    }
+
+#ifdef WIFCONTINUED
+    if (WIFCONTINUED(status)) {
+       return vstrallocf(_("%s was resumed"), subject);
+    }
+#endif
+
+    return vstrallocf(_("%s exited in unknown circumstances"), subject);
+}
+
+void
+check_running_as(running_as_flags who)
+{
+#ifdef CHECK_USERID
+    struct passwd *pw;
+    uid_t uid_me;
+    uid_t uid_target;
+    char *uname_me = NULL;
+    char *uname_target = NULL;
+    char *dumpuser;
+
+    uid_me = getuid();
+    if ((pw = getpwuid(uid_me)) == NULL) {
+        error(_("current userid %ld not found in password database"), (long)uid_me);
+       /* NOTREACHED */
+    }
+    uname_me = stralloc(pw->pw_name);
+
+#ifndef SINGLE_USERID
+    if (!(who & RUNNING_AS_UID_ONLY) && uid_me != geteuid()) {
+       error(_("euid (%lld) does not match uid (%lld); is this program setuid-root when it shouldn't be?"),
+               (long long int)geteuid(), (long long int)uid_me);
+       /* NOTREACHED */
+    }
+#endif
+
+    switch (who & RUNNING_AS_USER_MASK) {
+       case RUNNING_AS_ROOT:
+           uid_target = 0;
+           uname_target = "root";
+           break;
+
+       case RUNNING_AS_DUMPUSER_PREFERRED:
+           dumpuser = getconf_str(CNF_DUMPUSER);
+           if ((pw = getpwnam(dumpuser)) != NULL &&
+                    uid_me != pw->pw_uid) {
+               if ((pw = getpwnam(CLIENT_LOGIN)) != NULL &&
+                   uid_me == pw->pw_uid) {
+                   /* uid == CLIENT_LOGIN: not ideal, but OK */
+                   dbprintf(_("NOTE: running as '%s', which is the client"
+                              " user, not the dumpuser ('%s'); forging"
+                              " on anyway\n"),
+                            CLIENT_LOGIN, dumpuser);
+                   uid_target = uid_me; /* force success below */
+                  break;
+               }
+            }
+            /* FALLTHROUGH */
+
+       case RUNNING_AS_DUMPUSER:
+           uname_target = getconf_str(CNF_DUMPUSER);
+           if ((pw = getpwnam(uname_target)) == NULL) {
+               error(_("cannot look up dumpuser \"%s\""), uname_target);
+               /*NOTREACHED*/
+           }
+           uid_target = pw->pw_uid;
+           break;
+
+       case RUNNING_AS_CLIENT_LOGIN:
+           uname_target = CLIENT_LOGIN;
+           if ((pw = getpwnam(uname_target)) == NULL) {
+               error(_("cannot look up client user \"%s\""), uname_target);
+               /*NOTREACHED*/
+           }
+           uid_target = pw->pw_uid;
+           break;
+
+       default:
+           error(_("Unknown check_running_as() call"));
+           /* NOTREACHED */
+    }
+
+    if (uid_me != uid_target) {
+       error(_("running as user \"%s\" instead of \"%s\""), uname_me, uname_target);
+       /*NOTREACHED*/
+    }
+    amfree(uname_me);
+
+#else
+    /* Quiet unused variable warning */
+    (void)who;
+#endif
+}
+
+int
+set_root_privs(int need_root)
+{
+#ifndef SINGLE_USERID
+    if (need_root) {
+        if (seteuid(0) == -1) return 0;
+        /* (we don't switch the group back) */
+    } else {
+       if (geteuid() != 0) return 0;
+        if (seteuid(getuid()) == -1) return 0;
+        if (setegid(getgid()) == -1) return 0;
+    }
+#else
+    (void)need_root; /* Quiet unused variable warning */
+#endif
+    return 1;
+}
+
+int
+become_root(void)
+{
+#ifndef SINGLE_USERID
+    if (setuid(0) == -1) return 0;
+#endif
+    return 1;
+}
+
+/*
+ * Process parameters
+ */
+
+/* current process name */
+#define MAX_PNAME 128
+static char pname[MAX_PNAME] = "unknown";
+
+void
+set_pname(char *p)
+{
+    g_strlcpy(pname, p, sizeof(pname));
+}
+
+char *
+get_pname(void)
+{
+    return pname;
+}
+
index f09c87baccf2682b6c3f001e26fc44ca2fd954cf..cab9d8d21e1eb717b35bad29eec1a0e1c1892520 100644 (file)
 #include "amanda.h"
 #include "sl.h"
 
+#include <glib.h>
+#include <glib-object.h>
+#include <regex.h>
+
+#include "glib-util.h"
+
 #define BIGINT  INT_MAX
 
 #define BSTRNCMP(a,b)  strncmp(a, b, strlen(b))
@@ -55,17 +61,6 @@ char *       construct_timestamp(time_t *t);
 int    needs_quotes(const char * str);
 
 char * sanitize_string(const char *str);
-char * strquotedstr(void);
-ssize_t        hexdump(const char *buffer, size_t bytes);
-void   dump_sockaddr(struct sockaddr_storage * sa);
-char *  str_sockaddr(struct sockaddr_storage *sa);
-/* Compare two sockaddr_storage objects, optionally comparing
- * only the address (and thus ignoring port, flow info, etc.).
- * @returns: -1, 0, or 1 for <, ==, >, respectively
- */
-int     cmp_sockaddr(struct sockaddr_storage *ss1,
-                    struct sockaddr_storage *ss2,
-             int addr_only);
 int     copy_file(char *dst, char *src, char **errmsg);
 
 /*
@@ -75,6 +70,176 @@ int     copy_file(char *dst, char *src, char **errmsg);
  */
 int validate_mailto(const char *mailto);
 
-char *taperalgo2str(int taperalgo);
+/* This function is a portable reimplementation of readdir(). It
+ * returns a newly-allocated string, that should be freed with
+ * free(). Returns NULL on error or end of directory.
+ * It is reentrant, with the following exceptions:
+ * - This function cannot be run at the same time as readdir() or
+ *   readdir64().
+ * - This function cannot be run simultaneously on the same directory
+ *   handle. */
+char * portable_readdir(DIR*);
+
+typedef gboolean (*SearchDirectoryFunctor)(const char * filename,
+                                           gpointer user_data);
+/* This function will search the given directory handle for files
+   matching the given POSIX extended regular expression.
+   For each matching file, the functor will be called with the given
+   user data. Stops when the functor returns FALSE, or all files have
+   been searched. Returns the number of matching files. */
+int search_directory(DIR * handle, const char * regex,
+                     SearchDirectoryFunctor functor, gpointer user_data);
+
+/* This function extracts a substring match from a regular expression
+   match result, and copies it into a newly allocated string. Example
+   usage to get the first matched substring:
+   substring = find_regmatch(whole_string, pmatch[1])
+   Note that pmatch[0] yields the entire matching portion of the string. */
+char* find_regex_substring(const char* base_string, const regmatch_t match);
+
+void free_new_argv(int new_argc, char **new_argv);
+
+/* Like strcmp(a, b), except that NULL strings are sorted before non-NULL
+ * strings, instead of segfaulting. */
+int compare_possibly_null_strings(const char * a, const char * b);
+
+/* Does g_thread_init(), along with anything else that should be done
+ * before/after thread setup. It's OK to call this function more than once.
+ * Returns TRUE if threads are supported. */
+gboolean amanda_thread_init(void);
+
+/* Given a hostname, call getaddrinfo to resolve it.  Optionally get the
+ * entire set of results (if res is not NULL) and the canonical name of
+ * the host (if canonname is not NULL).  The canonical name might
+ * expand e.g., www.domain.com to server3.webfarm.hosting.com.
+ *
+ * If not NULL, the caller is responsible for freeing res with freeaddrinfo().
+ * Similarly, the caller is responsible for freeing canonname if it is
+ * not NULL.
+ *
+ * @param hostname: the hostname to start with
+ * @param res: (result) if not NULL, the results from getaddrinfo()
+ * @param canonname: (result) if not NULL, the canonical name of the host
+ * @returns: newly allocated canonical hostname, or NULL if no
+ * canonical hostname was available.
+ */
+int resolve_hostname(const char *hostname, int socktype,
+                    struct addrinfo **res, char **canonname);
+
+/* Interpret a status (as returned from wait() and friends)
+ * into a human-readable sentence.
+ *
+ * Caller is responsible for freeing the resulting string.
+ * The resulting string has already been translated.
+ *
+ * The macro definition allows this to work even when amwait_t
+ * is 'union wait' (4.3BSD).  The cast is safe because the two
+ * argument types are interchangeable.
+ *
+ * @param subject: subject of the sentence (program name, etc.)
+ * @param status: the exit status
+ * @returns: newly allocated string describing status
+ */
+#define str_exit_status(subject, status) \
+    _str_exit_status((subject), *(amwait_t *)&(status))
+char *_str_exit_status(char *subject, amwait_t status);
+
+/*
+ * Userid manipulation
+ */
+
+/* Check that the current uid and euid are set to a specific user, 
+ * calling error() if not. Does nothing if CHECK_USERID is not 
+ * defined.  
+ *
+ * @param who: one of the RUNNING_AS_* constants, below.
+ */
+typedef enum {
+        /* userid is 0 */
+    RUNNING_AS_ROOT,
+
+        /* userid belongs to dumpuser (from config) */
+    RUNNING_AS_DUMPUSER,
+
+        /* prefer that userid belongs to dumpuser, but accept when userid belongs to
+         * CLIENT_LOGIN with a debug-log message (needed because amandad always runs
+         * as CLIENT_LOGIN, even on server) */
+    RUNNING_AS_DUMPUSER_PREFERRED,
+
+        /* userid belongs to CLIENT_LOGIN (from --with-user) */
+    RUNNING_AS_CLIENT_LOGIN,
+
+    RUNNING_AS_USER_MASK = (1 << 8) - 1,
+       /* '&' this on to only check the uid, not the euid; use this for programs
+        * that will call become_root() */
+    RUNNING_AS_UID_ONLY = 1 << 8
+} running_as_flags;
+
+void check_running_as(running_as_flags who);
+
+/* Drop and regain root priviledges; used from setuid-root binaries which only
+ * need to be root for certain operations. Does nothing if SINGLE_USERID is 
+ * defined.
+ *
+ * @param need_root: if true, try to assume root priviledges; otherwise, drop
+ * priviledges.
+ * @returns: true if the priviledge change succeeded
+ */
+int set_root_privs(int need_root);
+
+/* Become root completely, by setting the uid to 0.  This is used by setuid-root
+ * apps which will exec subprocesses which will also need root priviledges.  Does
+ * nothing if SINGLE_USERID is defined.
+ *
+ * @returns: true if the priviledge change succeeded
+ */
+int become_root(void);
+
+/*
+ * Process parameters
+ */
+
+/* Set the name of the process.  The parameter is copied, and remains
+ * the responsibility of the caller on return. This value is used in log
+ * messages and other output throughout Amanda.
+ *
+ * @param pname: the new process name
+ */
+void set_pname(char *pname);
+
+/* Get the current process name; the result is in a static buffer, and
+ * should *not* be free()d by the caller.
+ *
+ * @returns: process name
+ */
+char *get_pname(void);
+
+/*
+ * Readline support
+ *
+ * This either includes the system readline header we found in configure,
+ * or prototypes some simple stub functions that are used instead.
+ */
+
+#ifdef HAVE_READLINE
+#  ifdef HAVE_READLINE_READLINE_H
+#    include <readline/readline.h>
+#    ifdef HAVE_READLINE_HISTORY_H
+#      include <readline/history.h>
+#    endif
+#  else
+#    ifdef HAVE_READLINE_H
+#      include <readline.h>
+#      ifdef HAVE_HISTORY_H
+#        include <history.h>
+#      endif
+#    endif
+#  endif
+#else
+
+char * readline(const char *prompt);
+void   add_history(const char *line);
+
+#endif
 
 #endif /* UTIL_H */
diff --git a/common-src/version.c b/common-src/version.c
deleted file mode 100644 (file)
index 4d6b862..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* version.c - generated by genversion.c - DO NOT EDIT! */
-const char * const version_info[] = {
-  "build: VERSION=\"Amanda-2.5.2p1\"\n",
-  "       BUILT_DATE=\"Wed Jun 6 19:23:48 EDT 2007\"\n",
-  "       BUILT_MACH=\"Linux kdc.localdomain 2.6.20-1.2952.fc6 #1 SMP Wed May 16 18:18:22 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux\"\n",
-  "       CC=\"gcc\"\n",
-  "       CONFIGURE_COMMAND=\"'./configure' '--prefix=/home/martinea/linux' '--with-configdir=/home/martinea/etc/amanda' '--with-gnutar-listdir=/var/gnutar-lists' '--with-bsd-security' '--with-bsdudp-security' '--with-bsdtcp-security' '--with-ssh-security' '--with-rsh-security' '--without-krb4-security' '--with-krb5-security' '--with-user=martinea' '--with-group=martinea' '--enable-manpage-build' '--mandir=/home/martinea/man'\"\n",
-  "paths: bindir=\"/home/martinea/linux/bin\"\n",
-  "       sbindir=\"/home/martinea/linux/sbin\"\n",
-  "       libexecdir=\"/home/martinea/linux/libexec\"\n",
-  "       mandir=\"/home/martinea/man\" AMANDA_TMPDIR=\"/tmp/amanda\"\n",
-  "       AMANDA_DBGDIR=\"/tmp/amanda\"\n",
-  "       CONFIG_DIR=\"/home/martinea/etc/amanda\" DEV_PREFIX=\"/dev/\"\n",
-  "       RDEV_PREFIX=\"/dev/\" DUMP=\"/sbin/dump\"\n",
-  "       RESTORE=\"/sbin/restore\" VDUMP=UNDEF VRESTORE=UNDEF\n",
-  "       XFSDUMP=UNDEF XFSRESTORE=UNDEF VXDUMP=UNDEF VXRESTORE=UNDEF\n",
-  "       SAMBA_CLIENT=\"/usr/bin/smbclient\" GNUTAR=\"/bin/gtar\"\n",
-  "       COMPRESS_PATH=\"/usr/bin/gzip\"\n",
-  "       UNCOMPRESS_PATH=\"/usr/bin/gzip\" LPRCMD=\"/usr/bin/lpr\"\n",
-  "       MAILER=\"/usr/bin/Mail\" listed_incr_dir=\"/var/gnutar-lists\"\n",
-  "defs:  DEFAULT_SERVER=\"kdc.localdomain\"\n",
-  "       DEFAULT_CONFIG=\"DailySet1\"\n",
-  "       DEFAULT_TAPE_SERVER=\"kdc.localdomain\" HAVE_MMAP NEED_STRSTR\n",
-  "       HAVE_SYSVSHM LOCKING=POSIX_FCNTL SETPGRP_VOID DEBUG_CODE\n",
-  "       AMANDA_DEBUG_DAYS=4 BSD_SECURITY KRB5_SECURITY RSH_SECURITY\n",
-  "       USE_AMANDAHOSTS CLIENT_LOGIN=\"martinea\" FORCE_USERID\n",
-  "       HAVE_GZIP COMPRESS_SUFFIX=\".gz\" COMPRESS_FAST_OPT=\"--fast\"\n",
-  "       COMPRESS_BEST_OPT=\"--best\" UNCOMPRESS_OPT=\"-dc\"\n",
-  0
-};
index 0e51292017803165327f8c01d915a11310b1e6f2..886d2473d1e41be0e8914cf954d7c92bcb344a64 100644 (file)
 #include "version.h"
 
 const int   VERSION_MAJOR   = 2;
-const int   VERSION_MINOR   = 5;
-const int   VERSION_PATCH   = 2;
-const char *const VERSION_COMMENT = "p1";
+const int   VERSION_MINOR   = 6;
+const int   VERSION_PATCH   = 0;
+const char *const VERSION_COMMENT = "";
 
 const char *
 versionsuffix(void)
 {
 #ifdef USE_VERSION_SUFFIXES
-    return "-2.5.2p1";
+    return "-2.6.0";
 #else
     return "";
 #endif
@@ -49,5 +49,5 @@ versionsuffix(void)
 const char *
 version(void)
 {
-    return "2.5.2p1";
+    return "2.6.0";
 }
index bf61cb087810b39db48b65475b56e2baea1714dd..489e52c5034ad08e2bdfe77b5fb8b62f9f1a35f6 100644 (file)
@@ -1,11 +1,15 @@
 ## Process this file with automake to produce Makefile.in
 
-EXTRA_DIST =   acinclude.m4i   \
-               config.guess    \
+EXTRA_DIST =   config.guess    \
                config.sub      \
-               gnulib.m4i      \
                install-sh      \
-               libtool.m4i     \
+               libtool.m4      \
                ltmain.sh       \
                missing         \
                mkinstalldirs
+# add files from subdirectories, using file lists generated by autogen
+include $(srcdir)/amanda/file-list
+include $(srcdir)/gettext-macros/file-list
+include $(srcdir)/gnulib/file-list
+include $(srcdir)/macro-archive/file-list
+include $(srcdir)/automake/file-list
index bf8205d4339e22ce42cca7be8cd2f965ca62337b..9a0b85562359d2a65563684be1cf477c7ba51e67 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -36,48 +32,119 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-subdir = config
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/config.h.in config.guess config.rpath config.sub \
-       depcomp install-sh ltmain.sh missing mkinstalldirs
+       $(srcdir)/amanda/file-list $(srcdir)/automake/file-list \
+       $(srcdir)/config.h.in $(srcdir)/gettext-macros/file-list \
+       $(srcdir)/gnulib/file-list $(srcdir)/macro-archive/file-list \
+       compile config.guess config.rpath config.sub depcomp \
+       install-sh ltmain.sh missing mkinstalldirs ylwrap
+subdir = config
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -86,15 +153,14 @@ CONFIG_CLEAN_FILES =
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -102,14 +168,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -120,20 +191,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -147,60 +217,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -210,10 +389,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -224,24 +417,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -253,59 +480,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -314,40 +528,93 @@ 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@
 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@
-EXTRA_DIST = acinclude.m4i     \
-               config.guess    \
-               config.sub      \
-               gnulib.m4i      \
-               install-sh      \
-               libtool.m4i     \
-               ltmain.sh       \
-               missing         \
-               mkinstalldirs
-
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \
+       missing mkinstalldirs amanda/amplot.m4 amanda/bsd-security.m4 \
+       amanda/bsdtcp-security.m4 amanda/bsdudp-security.m4 \
+       amanda/changer.m4 amanda/components.m4 amanda/compress.m4 \
+       amanda/config.m4 amanda/debugging.m4 amanda/defaults.m4 \
+       amanda/devprefix.m4 amanda/dirs.m4 amanda/documentation.m4 \
+       amanda/dumpers.m4 amanda/flags.m4 amanda/flock.m4 \
+       amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \
+       amanda/ipv6.m4 amanda/krb4-security.m4 amanda/krb5-security.m4 \
+       amanda/lfs.m4 amanda/libs.m4 amanda/net.m4 amanda/progs.m4 \
+       amanda/readdir.m4 amanda/readline.m4 amanda/rsh-security.m4 \
+       amanda/s3-device.m4 amanda/shmem.m4 amanda/ssh-security.m4 \
+       amanda/summary.m4 amanda/swig.m4 amanda/syshacks.m4 \
+       amanda/tape.m4 amanda/types.m4 amanda/userid.m4 \
+       amanda/version.m4 gettext-macros/codeset.m4 \
+       gettext-macros/gettext.m4 gettext-macros/glibc21.m4 \
+       gettext-macros/glibc2.m4 gettext-macros/iconv.m4 \
+       gettext-macros/intdiv0.m4 gettext-macros/intmax.m4 \
+       gettext-macros/inttypes_h.m4 gettext-macros/inttypes.m4 \
+       gettext-macros/inttypes-pri.m4 gettext-macros/isc-posix.m4 \
+       gettext-macros/lcmessage.m4 gettext-macros/lib-ld.m4 \
+       gettext-macros/lib-link.m4 gettext-macros/lib-prefix.m4 \
+       gettext-macros/longdouble.m4 gettext-macros/longlong.m4 \
+       gettext-macros/nls.m4 gettext-macros/po.m4 \
+       gettext-macros/printf-posix.m4 gettext-macros/progtest.m4 \
+       gettext-macros/signed.m4 gettext-macros/size_max.m4 \
+       gettext-macros/stdint_h.m4 gettext-macros/uintmax_t.m4 \
+       gettext-macros/ulonglong.m4 gettext-macros/wchar_t.m4 \
+       gettext-macros/wint_t.m4 gettext-macros/xsize.m4 \
+       gnulib/absolute-header.m4 gnulib/alloca.m4 \
+       gnulib/arpa_inet_h.m4 gnulib/base64.m4 gnulib/eoverflow.m4 \
+       gnulib/extensions.m4 gnulib/float_h.m4 gnulib/fsusage.m4 \
+       gnulib/getaddrinfo.m4 gnulib/gettimeofday.m4 \
+       gnulib/gnulib-cache.m4 gnulib/gnulib-common.m4 \
+       gnulib/gnulib-comp.m4 gnulib/gnulib-tool.m4 \
+       gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/intmax_t.m4 \
+       gnulib/inttypes_h.m4 gnulib/lib-ld.m4 gnulib/lib-link.m4 \
+       gnulib/lib-prefix.m4 gnulib/lock.m4 gnulib/longlong.m4 \
+       gnulib/malloc.m4 gnulib/mkdtemp.m4 gnulib/netinet_in_h.m4 \
+       gnulib/onceonly_2_57.m4 gnulib/physmem.m4 gnulib/safe-read.m4 \
+       gnulib/safe-write.m4 gnulib/size_max.m4 gnulib/snprintf.m4 \
+       gnulib/socklen.m4 gnulib/sockpfaf.m4 gnulib/ssize_t.m4 \
+       gnulib/stdbool.m4 gnulib/stdint_h.m4 gnulib/stdint.m4 \
+       gnulib/stdio_h.m4 gnulib/stdlib_h.m4 gnulib/strdup.m4 \
+       gnulib/string_h.m4 gnulib/sys_socket_h.m4 gnulib/sys_stat_h.m4 \
+       gnulib/sys_time_h.m4 gnulib/tempname.m4 gnulib/ulonglong.m4 \
+       gnulib/unistd_h.m4 gnulib/vasnprintf.m4 gnulib/visibility.m4 \
+       gnulib/wchar.m4 gnulib/wchar_t.m4 gnulib/wint_t.m4 \
+       gnulib/xsize.m4 macro-archive/ac_define_dir.m4 \
+       macro-archive/ac_prog_perl_version.m4 \
+       macro-archive/ac_prog_swig.m4 \
+       macro-archive/ax_compare_version.m4 \
+       macro-archive/docbook-dtd.m4 macro-archive/docbook-xslt.m4 \
+       macro-archive/docbook-xslt-min.m4 macro-archive/xsltproc.m4 \
+       automake/installperms.am automake/precompile.am \
+       automake/scripts.am automake/vars.am
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/amanda/file-list $(srcdir)/gettext-macros/file-list $(srcdir)/gnulib/file-list $(srcdir)/macro-archive/file-list $(srcdir)/automake/file-list $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -380,7 +647,7 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 config.h: stamp-h1
        @if test ! -f $@; then \
          rm -f stamp-h1; \
-         $(MAKE) stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
        else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@@ -399,10 +666,6 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
-
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
 tags: TAGS
 TAGS:
 
@@ -411,22 +674,21 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -471,8 +733,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr \
-       distclean-libtool
+distclean-am: clean-am distclean-generic distclean-hdr
 
 dvi: dvi-am
 
@@ -486,12 +747,20 @@ info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-am
+
 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
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -510,18 +779,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
        distclean distclean-generic distclean-hdr distclean-libtool \
        distdir dvi dvi-am html html-am info info-am install \
-       install-am install-data install-data-am install-exec \
-       install-exec-am install-info install-info-am install-man \
+       install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
        install-strip installcheck installcheck-am installdirs \
        maintainer-clean maintainer-clean-generic mostlyclean \
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       uninstall uninstall-am uninstall-info-am
+       uninstall uninstall-am
 
+# add files from subdirectories, using file lists generated by autogen
 # 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/config/acinclude.m4i b/config/acinclude.m4i
deleted file mode 100644 (file)
index e8e9029..0000000
+++ /dev/null
@@ -1,1256 +0,0 @@
-dnl Check if the compiler can handle unsigned long constants, ie 2ul.
-AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS],
-    [
-       AC_CACHE_CHECK(
-           [for working unsigned long constants],
-           amanda_cv_c_unsigned_long_constants,
-           [
-               AC_TRY_COMPILE(
-                   [
-                   ],
-                   [
-                       long l = 1ul;
-                   ],
-                   amanda_cv_c_unsigned_long_constants=yes,
-                   amanda_cv_c_unsigned_long_constants=no
-               )
-           ]
-       )
-       if test "$amanda_cv_c_unsigned_long_constants" = yes; then
-           AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ])
-       fi
-    ]
-)
-
-dnl Check for the argument type for shmat() and shmdt()
-AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for shmdt() argument type],
-           amanda_cv_shmdt_arg_type,
-           [
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
-
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ])
-    ]
-)
-
-dnl Figure out the select() argument type.
-AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for select() argument type],
-           amanda_cv_select_arg_type,
-           [
-               rm -f conftest.c
-               cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#  include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int main()
-{
-#ifdef FD_SET_POINTER
-       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
-#else
-       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
-#endif
-       return 0;
-}
-EOF
-
-               dnl Figure out the select argument type by first trying to
-               dnl compile with the fd_set argument.  If the compile fails,
-               dnl then we know to use the int.  If it suceeds, then try to
-               dnl use the int.  If the int fails, then use fd_set.  If
-               dnl both suceeed, then do a line count on the number of
-               dnl lines that the compiler spit out, assuming that the
-               dnl compile outputing more lines had more errors.
-               amanda_cv_select_arg_type=no
-               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
-               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
-               if test $? -ne 0; then
-                   amanda_cv_select_arg_type=int
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
-                   if test $? -ne 0; then
-                       amanda_cv_select_arg_type=fd_set
-                   fi
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   wc_fdset=`wc -l <conftest.fd_set`
-                   wc_int=`wc -l <conftest.int`
-                   if test "$wc_fdset" -le "$wc_int"; then
-                       amanda_cv_select_arg_type=fd_set
-                   else
-                       amanda_cv_select_arg_type=int
-                   fi
-               fi
-               rm -f conftest*
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
-    ]
-)
-
-dnl Check if setsockopt can use the SO_SNDTIMEO option.
-dnl This defines HAVE_SO_SNDTIMEO if setsockopt works
-dnl with SO_SNDTIMEO.
-AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
-    [
-       AC_CACHE_CHECK(
-           [for setsockopt SO_SNDTIMEO option],
-           amanda_cv_setsockopt_SO_SNDTIMEO,
-           [
-               AC_TRY_RUN(
-                   [
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
-
-main() {
-#ifdef SO_SNDTIMEO
-    int sock = socket(AF_INET, SOCK_STREAM, 0);
-    struct timeval timeout;
-    timeout.tv_sec = 1;
-    timeout.tv_usec = 0;
-    return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
-             (void *)&timeout, sizeof(timeout)));
-#else
-    return -1;
-#endif
-}
-                   ],
-                   amanda_cv_setsockopt_SO_SNDTIMEO=yes,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no
-               )
-           ]
-       )
-       if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
-           AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
-       fi
-    ]
-)
-
-dnl Check for the one or two argument version of gettimeofday.
-AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
-    [
-       AC_REQUIRE([AC_HEADER_TIME])
-       AC_CACHE_CHECK(
-           [for gettimeofday number of arguments],
-           amanda_cv_gettimeofday_args,
-           [
-               AC_TRY_COMPILE(
-                   [
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
-                   ],
-                   [
-                       struct timeval val;
-                       struct timezone zone;
-                       gettimeofday(&val, &zone);
-                   ],
-                   amanda_cv_gettimeofday_args=2,
-                   amanda_cv_gettimeofday_args=1
-               )
-           ]
-       )
-       if test "$amanda_cv_gettimeofday_args" = 2; then
-           AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
-       fi
-    ]
-)
-
-
-
-dnl Check for if pid_t is a long, int, or short.
-AC_DEFUN([AMANDA_TYPE_PID_T],
-    [
-       AC_REQUIRE([AC_TYPE_PID_T])
-       AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
-           [
-               amanda_cv_pid_type=unknown
-               if test "$ac_cv_type_pid_t" = no; then
-                   amanda_cv_pid_type=int
-               fi
-               for TEST_amanda_cv_pid_type in long short int; do
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                           ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                               ZZZZ pid_t
-                       ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-               done
-               if test $amanda_cv_pid_type = unknown; then
-                   amanda_cv_pid_type=int
-               fi
-           ]
-       )
-       case $amanda_cv_pid_type in
-           int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
-           long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
-           short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
-       esac
-    ]
-)
-
-dnl
-dnl
-dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
-dnl If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
-dnl in one of the headers named in the whitespace-separated list 
-dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
-dnl
-AC_DEFUN([ICE_CHECK_DECL],
-[
-ice_have_$1=no
-AC_CHECK_FUNCS($1, ice_have_$1=yes)
-if test "${ice_have_$1}" = yes; then
-AC_MSG_CHECKING(for $1 declaration in $2)
-AC_CACHE_VAL(ice_cv_have_$1_decl,
-[
-ice_cv_have_$1_decl=no
-changequote(,)dnl
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-changequote([,])dnl
-for header in $2; do
-# Check for ordinary declaration
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*$ice_re_params\(\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-done
-])
-AC_MSG_RESULT($ice_cv_have_$1_decl)
-if test "$ice_cv_have_$1_decl" = yes; then
-AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
-fi
-fi
-])dnl
-dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
-dnl by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
-dnl
-dnl     FIXME: These tests should have been in autoconf 1.11!
-dnl
-dnl     Note that we cannot simply grep for 'union wait' in the wait.h file,
-dnl     because some Posix systems turn this on only when a BSD variable is
-dnl     defined. Since I'm trying to do without special defines, I'll live
-dnl     with the default behavior of the include-file.
-dnl
-dnl     I do _2_ compile checks, because we may have union-wait, but the
-dnl     prototype for 'wait()' may want an int.
-dnl
-dnl     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
-dnl     that if we've got union-wait, we'll automatically use it.
-dnl
-dnl Garrett Wollman adds:
-dnl    The tests described above don't quite do the right thing,
-dnl    since some systems have hacks which allow `union wait' to
-dnl    still work even though `int' is preferred (and generates
-dnl    fewer warnings).  Since all of these systems use prototypes,
-dnl    we can use the prototype of wait(2) to disambiguate them.
-dnl
-dnl Alexandre Oliva adds:
-dnl     A single compile check is enough.  If we don't have union wait,
-dnl     it's obvious that the test will fail, and that we must use int.
-dnl     If we do, the prototype (on STDC systems) and WIFEXITED will tell
-dnl     whether we're supposed to be using union wait instead of int.
-dnl
-AC_DEFUN([CF_WAIT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
-
-#ifdef __STDC__
-pid_t wait(union wait *);
-#endif
-], [
-  union wait x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
-if test $cf_cv_arg_union_wait = yes; then
-       AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ])
-fi
-])dnl
-AC_DEFUN([CF_WAIT_INT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
-
-#ifdef __STDC__
-pid_t wait(int *);
-#endif
-], [
-  int x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
-if test $cf_cv_arg_int = yes; then
-        AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ])
-fi
-])dnl
-
-dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
-dnl
-dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
-dnl existence of an include file <stdint.h> that defines a set of 
-dnl typedefs, especially uint8_t,int32_t,uintptr_t.
-dnl Many older installations will not provide this file, but some will
-dnl have the very same definitions in <inttypes.h>. In other enviroments
-dnl we can use the inet-types in <sys/types.h> which would define the
-dnl typedefs int8_t and u_int8_t respectivly.
-dnl
-dnl This macros will create a local "_stdint.h" or the headerfile given as 
-dnl an argument. In many cases that file will just "#include <stdint.h>" 
-dnl or "#include <inttypes.h>", while in other environments it will provide 
-dnl the set of basic 'stdint's definitions/typedefs: 
-dnl   int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
-dnl   int_least32_t.. int_fast32_t.. intmax_t
-dnl which may or may not rely on the definitions of other files,
-dnl or using the AC_CHECK_SIZEOF macro to determine the actual
-dnl sizeof each type.
-dnl
-dnl if your header files require the stdint-types you will want to create an
-dnl installable file mylib-int.h that all your other installable header
-dnl may include. So if you have a library package named "mylib", just use
-dnl      AX_CREATE_STDINT_H(mylib-int.h) 
-dnl in configure.ac and go to install that very header file in Makefile.am
-dnl along with the other headers (mylib.h) - and the mylib-specific headers
-dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
-dnl
-dnl Remember, if the system already had a valid <stdint.h>, the generated
-dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
-dnl
-dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
-dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp
-dnl @author  Guido Draheim <guidod@gmx.de> 
-
-AC_DEFUN([AX_CHECK_DATA_MODEL],[
-   AC_CHECK_SIZEOF(char)
-   AC_CHECK_SIZEOF(short)
-   AC_CHECK_SIZEOF(int)
-   AC_CHECK_SIZEOF(long)
-   AC_CHECK_SIZEOF(void*)
-   ac_cv_char_data_model=""
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model=""
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
-   AC_MSG_CHECKING([data model])
-   case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
-    122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
-    122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
-    122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
-    124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
-    124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
-    124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
-    124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
-    128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
-    128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;         
-    222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
-    333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
-    444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
-    666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
-    888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
-    222/*|333/*|444/*|666/*|888/*) :
-                 ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
-     *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
-   esac
-   AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
-])
-
-dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
-AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
-AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
- ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_uintptr_t 
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-  done
-  AC_MSG_CHECKING([for stdint uintptr_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
-AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
- ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint uint32_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
-AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
- ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint u_int32_t])
- ])
-])
-
-AC_DEFUN([AX_CREATE_STDINT_H],
-[# ------ AX CREATE STDINT H -------------------------------------
-AC_MSG_CHECKING([for stdint types])
-ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
-# try to shortcircuit - if the default include path of the compiler
-# can find a "stdint.h" header then we assume that all compilers can.
-AC_CACHE_VAL([ac_cv_header_stdint_t],[
-old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
-old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
-old_CFLAGS="$CFLAGS"     ; CFLAGS=""
-AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
-[ac_cv_stdint_result="(assuming C99 compatible system)"
- ac_cv_header_stdint_t="stdint.h"; ],
-[ac_cv_header_stdint_t=""])
-CXXFLAGS="$old_CXXFLAGS"
-CPPFLAGS="$old_CPPFLAGS"
-CFLAGS="$old_CFLAGS" ])
-
-v="... $ac_cv_header_stdint_h"
-if test "$ac_stdint_h" = "stdint.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
-elif test "_$ac_cv_header_stdint_t" = "_" ; then
- AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
-else
- ac_cv_header_stdint="$ac_cv_header_stdint_t"
- AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
-fi
-
-if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
-
-dnl .....intro message done, now do a few system checks.....
-dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, 
-dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW 
-dnl instead that is triggered with 3 or more arguments (see types.m4)
-
-inttype_headers=`echo $2 | sed -e 's/,/ /g'`
-
-ac_cv_stdint_result="(no helpful system typedefs seen)"
-AX_CHECK_HEADER_STDINT_X(dnl
-   stdint.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-AX_CHECK_HEADER_STDINT_O(dnl,
-   inttypes.h sys/inttypes.h stdint.h $inttype_headers,
-   ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
-fi
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-if test "_$ac_cv_header_stdint_o" = "_" ; then
-AX_CHECK_HEADER_STDINT_U(dnl,
-   sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
-fi fi
-
-dnl if there was no good C99 header file, do some typedef checks...
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-   AC_MSG_CHECKING([for stdint datatype model])
-   AC_MSG_RESULT([(..)])
-   AX_CHECK_DATA_MODEL
-fi
-
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "_$ac_cv_header_stdint_o" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "_$ac_cv_header_stdint_u" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
-   ac_cv_header_stdint="stddef.h"
-fi
-
-AC_MSG_CHECKING([for extra inttypes in chosen header])
-AC_MSG_RESULT([($ac_cv_header_stdint)])
-dnl see if int_least and int_fast types are present in _this_ header.
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
-AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
-AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
-
-fi # shortcircut to system "stdint.h"
-# ------------------ PREPARE VARIABLES ------------------------------
-if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` 
-else
-ac_cv_stdint_message="using $CC"
-fi
-
-AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
-$ac_cv_stdint_result])
-
-dnl -----------------------------------------------------------------
-# ----------------- DONE inttypes.h checks START header -------------
-AC_CONFIG_COMMANDS([$ac_stdint_h],[
-AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
-ac_stdint=$tmp/_stdint.h
-
-echo "#ifndef" $_ac_stdint_h >$ac_stdint
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
-echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_t" != "_" ; then 
-echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
-echo "#include <stdint.h>" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-else
-
-cat >>$ac_stdint <<STDINT_EOF
-
-/* ................... shortcircuit part ........................... */
-
-#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <stddef.h>
-
-/* .................... configured part ............................ */
-
-STDINT_EOF
-
-echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-  ac_header="$ac_cv_header_stdint_x"
-  echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
-fi
-
-echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_o" != "_" ; then
-  ac_header="$ac_cv_header_stdint_o"
-  echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
-fi
-
-echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_u" != "_" ; then
-  ac_header="$ac_cv_header_stdint_u"
-  echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
-fi
-
-echo "" >>$ac_stdint
-
-if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
-  echo "#include <$ac_header>" >>$ac_stdint
-  echo "" >>$ac_stdint
-fi fi
-
-echo "/* which 64bit typedef has been found */" >>$ac_stdint
-if test "$ac_cv_type_uint64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
-fi
-if test "$ac_cv_type_u_int64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* which type model has been detected */" >>$ac_stdint
-if test "_$ac_cv_char_data_model" != "_" ; then
-echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
-echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
-else
-echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
-echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* whether int_least types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_least32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
-fi
-echo "/* whether int_fast types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_fast32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
-fi
-echo "/* whether intmax_t type was detected */" >>$ac_stdint
-if test "$ac_cv_type_intmax_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-  cat >>$ac_stdint <<STDINT_EOF
-/* .................... detections part ............................ */
-
-/* whether we need to define bitspecific types from compiler base types */
-#ifndef _STDINT_HEADER_INTPTR
-#ifndef _STDINT_HEADER_UINT32
-#ifndef _STDINT_HEADER_U_INT32
-#define _STDINT_NEED_INT_MODEL_T
-#else
-#define _STDINT_HAVE_U_INT_TYPES
-#endif
-#endif
-#endif
-
-#ifdef _STDINT_HAVE_U_INT_TYPES
-#undef _STDINT_NEED_INT_MODEL_T
-#endif
-
-#ifdef  _STDINT_CHAR_MODEL
-#if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
-#ifndef _STDINT_BYTE_MODEL
-#define _STDINT_BYTE_MODEL 12
-#endif
-#endif
-#endif
-
-#ifndef _STDINT_HAVE_INT_LEAST32_T
-#define _STDINT_NEED_INT_LEAST_T
-#endif
-
-#ifndef _STDINT_HAVE_INT_FAST32_T
-#define _STDINT_NEED_INT_FAST_T
-#endif
-
-#ifndef _STDINT_HEADER_INTPTR
-#define _STDINT_NEED_INTPTR_T
-#ifndef _STDINT_HAVE_INTMAX_T
-#define _STDINT_NEED_INTMAX_T
-#endif
-#endif
-
-
-/* .................... definition part ............................ */
-
-/* some system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-#endif
-
-#ifndef _HAVE_UINT64_T
-/* .. here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-/* note: all ELF-systems seem to have loff-support which needs 64-bit */
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-  /* compiler/cpu type to define int64_t */
-#endif
-#endif
-#endif
-
-#if defined _STDINT_HAVE_U_INT_TYPES
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
-/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
-/* (btw, those nibble-addressable systems are way off, or so we assume) */
-
-dnl   /* have a look at "64bit and data size neutrality" at */
-dnl   /* http://unix.org/version2/whatsnew/login_64bit.html */
-dnl   /* (the shorthand "ILP" types always have a "P" part) */
-
-#if defined _STDINT_BYTE_MODEL
-#if _STDINT_LONG_MODEL+0 == 242
-/* 2:4:2 =  IP16 = a normal 16-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
-/* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
-/* 4:4:4 = ILP32 = a normal 32-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
-/* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
-/* 4:8:8 =  LP64 = a normal 64-bit system                 */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* this system has a "long" of 64bit */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef unsigned long   uint64_t;
-typedef          long    int64_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 448
-/*      LLP64   a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* assuming the system has a "long long" */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef unsigned long long uint64_t;
-typedef          long long  int64_t;
-#endif
-#else
-#define _STDINT_NO_INT32_T
-#endif
-#else
-#define _STDINT_NO_INT8_T
-#define _STDINT_NO_INT32_T
-#endif
-#endif
-
-/*
- * quote from SunOS-5.8 sys/inttypes.h:
- * Use at your own risk.  As of February 1996, the committee is squarely
- * behind the fixed sized types; the "least" and "fast" types are still being
- * discussed.  The probability that the "fast" types may be removed before
- * the standard is finalized is high enough that they are not currently
- * implemented.
- */
-
-#if defined _STDINT_NEED_INT_LEAST_T
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_least64_t;
-#endif
-
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-  /* least types */
-#endif
-
-#if defined _STDINT_NEED_INT_FAST_T
-typedef  int8_t    int_fast8_t; 
-typedef  int       int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_fast64_t;
-#endif
-
-typedef uint8_t   uint_fast8_t; 
-typedef unsigned  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-  /* fast types */
-#endif
-
-#ifdef _STDINT_NEED_INTMAX_T
-#ifdef _HAVE_UINT64_T
-typedef  int64_t       intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef          long  intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INTPTR_T
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-/* we encourage using "long" to store pointer values, never use "int" ! */
-#if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
-typedef  unsinged int   uintptr_t;
-typedef           int    intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
-typedef        uint64_t uintptr_t;
-typedef         int64_t  intptr_t;
-#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#endif
-#endif
-#endif
-
-/* The ISO C99 standard specifies that in C++ implementations these
-   should only be defined if explicitly requested.  */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-#ifndef UINT32_C
-
-/* Signed.  */
-# define INT8_C(c)      c
-# define INT16_C(c)     c
-# define INT32_C(c)     c
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INT64_C(c)    c ## L
-# else
-#  define INT64_C(c)    c ## LL
-# endif
-
-/* Unsigned.  */
-# define UINT8_C(c)     c ## U
-# define UINT16_C(c)    c ## U
-# define UINT32_C(c)    c ## U
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define UINT64_C(c)   c ## UL
-# else
-#  define UINT64_C(c)   c ## ULL
-# endif
-
-/* Maximal type.  */
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INTMAX_C(c)   c ## L
-#  define UINTMAX_C(c)  c ## UL
-# else
-#  define INTMAX_C(c)   c ## LL
-#  define UINTMAX_C(c)  c ## ULL
-# endif
-
-  /* literalnumbers */
-#endif
-#endif
-
-/* These limits are merily those of a two complement byte-oriented system */
-
-/* Minimum of signed integral types.  */
-# define INT8_MIN               (-128)
-# define INT16_MIN              (-32767-1)
-# define INT32_MIN              (-2147483647-1)
-# define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
-/* Maximum of signed integral types.  */
-# define INT8_MAX               (127)
-# define INT16_MAX              (32767)
-# define INT32_MAX              (2147483647)
-# define INT64_MAX              (__INT64_C(9223372036854775807))
-
-/* Maximum of unsigned integral types.  */
-# define UINT8_MAX              (255)
-# define UINT16_MAX             (65535)
-# define UINT32_MAX             (4294967295U)
-# define UINT64_MAX             (__UINT64_C(18446744073709551615))
-
-/* Minimum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MIN         INT8_MIN
-# define INT_LEAST16_MIN        INT16_MIN
-# define INT_LEAST32_MIN        INT32_MIN
-# define INT_LEAST64_MIN        INT64_MIN
-/* Maximum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MAX         INT8_MAX
-# define INT_LEAST16_MAX        INT16_MAX
-# define INT_LEAST32_MAX        INT32_MAX
-# define INT_LEAST64_MAX        INT64_MAX
-
-/* Maximum of unsigned integral types having a minimum size.  */
-# define UINT_LEAST8_MAX        UINT8_MAX
-# define UINT_LEAST16_MAX       UINT16_MAX
-# define UINT_LEAST32_MAX       UINT32_MAX
-# define UINT_LEAST64_MAX       UINT64_MAX
-
-  /* shortcircuit*/
-#endif
-  /* once */
-#endif
-#endif
-STDINT_EOF
-fi
-    if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
-      AC_MSG_NOTICE([$ac_stdint_h is unchanged])
-    else
-      ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
-      AS_MKDIR_P(["$ac_dir"])
-      rm -f $ac_stdint_h
-      mv $ac_stdint $ac_stdint_h
-    fi
-],[# variables for create stdint.h replacement
-PACKAGE="$PACKAGE"
-VERSION="$VERSION"
-ac_stdint_h="$ac_stdint_h"
-_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
-ac_cv_stdint_message="$ac_cv_stdint_message"
-ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
-ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
-ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
-ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
-ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
-ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
-ac_cv_char_data_model="$ac_cv_char_data_model"
-ac_cv_long_data_model="$ac_cv_long_data_model"
-ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
-ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
-ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
-])
-])
-
-# AC_PROG_XSLTPROC
-# -----------------------------------------------------------------
-# Find an xsltproc executable.
-#
-# Input:
-#  $1 is the default $XSLTPROC_FLAGS, which will be overridden if the
-#  user specifies --with-xsltproc-flags.
-# Output:
-#  $XSLTPROC contains the path to xsltproc, or is empty if none was
-#  found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
-#  contains the flags to use with xsltproc.
-
-AC_DEFUN([AC_PROG_XSLTPROC],
-[
-XSLTPROC_FLAGS="$1"
-AC_SUBST(XSLTPROC_FLAGS)
-
-# The (lack of) whitespace and overquoting here are all necessary for
-# proper formatting.
-AC_ARG_WITH(xsltproc,
-AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
-               [Use the xsltproc binary in in PATH.]),
-    [ ac_with_xsltproc=$withval; ],
-    [ ac_with_xsltproc=maybe; ])
-
-AC_ARG_WITH(xsltproc-flags,
-AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
-               [Flags to pass to xsltproc (default $1)]),
-    [ if test "x$withval" == "xno"; then
-       XSLTPROC_FLAGS=''
-    else
-       if test "x$withval" != "xyes"; then
-           XSLTPROC_FLAGS="$withval"
-       fi
-    fi
-       ])
-
-# search for xsltproc if it wasn't specified
-if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
-    AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
-else
-    if test "$ac_with_xsltproc" != "no"; then
-        if test -x "$ac_with_xsltproc"; then
-            XSLTPROC="$ac_with_xsltproc";
-        else
-            AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't])
-            AC_MSG_WARN([executable; searching for an alternative.])
-            AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
-        fi
-    fi
-fi
-])
-
-# AC_CHECK_DOCBOOK_XSLT
-# -----------------------------------------------------------------
-# Check for access to docbook stylesheets of a particular revision.
-# This macro can be used for multiple versions within the same script.
-#
-# Input:
-#  $1 is the version of docbook to search for; default 'current'
-# Output:
-#  $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending
-#  on the results of the test, where VERS is $1, with '_' substituted
-#  for '.'  $HAVE_DOCBOOK_XSLT will also be set to the same value.
-AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
-[
-    AC_REQUIRE([AC_PROG_XSLTPROC])
-
-    dnl define a temporary variable for the version, so this macro can be
-    dnl used with multiple versions
-    define([_VERS], $1)
-    ifelse(_VERS, [], [define([_VERS], [current])])
-    define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
-    define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
-
-    AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
-    [
-       ac_cv_docbook_xslt_VERS=no
-       if test -n "$XSLTPROC"; then
-           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
-           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&1
-
-           if test "$?" = 0; then
-               ac_cv_docbook_xslt_VERS=yes
-           fi
-       fi
-    ])
-
-    HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
-    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_VERS
-    undefine([_VERS])
-])
-
-# AC_CHECK_DOCBOOK_DTD
-# -----------------------------------------------------------------
-# Check for access to docbook DTD of a particular revision.
-# This macro can be used for multiple versions within the same script.
-#
-# Input:
-#  $1 is the version of docbook to search for; default 'current'
-# Output:
-#  $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending
-#  on the results of the test, where VERS is $1, with '_' substituted
-#  for '.'  $HAVE_DOCBOOK_DTD will also be set to the same value.
-AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
-[
-    AC_REQUIRE([AC_PROG_XSLTPROC])
-
-    dnl define a temporary variable for the version, so this macro can be
-    dnl used with multiple versions
-    define([_VERS], $1)
-    ifelse(_VERS, [], [define([_VERS], [current])])
-    define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
-    define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
-
-    AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
-    [
-       ac_cv_docbook_dtd_VERS=no
-       if test -n "$XSLTPROC"; then
-           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
-           cat <<EOF >conftest.xml
-<?xml version="1.0" encoding='ISO-8859-1'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
-<book id="empty">
-</book>
-EOF
-           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
-           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
-           if test "$?" = 0; then
-               # failing to load the DTD is just a warning, so check for it in the output.
-               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
-                   : # no good..
-               else
-                   ac_cv_docbook_dtd_VERS=yes
-               fi
-           fi
-           cat conftest.out >&AS_MESSAGE_LOG_FD
-
-           rm -f conftest.xml conftest.out
-       fi
-    ])
-
-    HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
-    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_VERS
-    undefine([_VERS])
-])
-dnl
-dnl Checks to see if there's a sockaddr_storage structure
-dnl
-dnl usage:
-dnl
-dnl    AC_SOCKADDR_STORAGE
-dnl
-dnl results:
-dnl
-dnl    HAVE_SOCKADDR_STORAGE (defined)
-dnl
-AC_DEFUN([AC_SOCKADDR_STORAGE],
-    [AC_MSG_CHECKING(if sockaddr_storage struct exists)
-    AC_CACHE_VAL(ac_cv_has_sockaddr_storage,
-       AC_TRY_COMPILE([
-#      include <sys/types.h>
-#      include <sys/socket.h>],
-       [u_int i = sizeof (struct sockaddr_storage)],
-       ac_cv_has_sockaddr_storage=yes,
-       ac_cv_has_sockaddr_storage=no))
-    AC_MSG_RESULT($ac_cv_has_sockaddr_storage)
-    if test $ac_cv_has_sockaddr_storage = yes ; then
-           AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists])
-    fi])
-
-
diff --git a/config/amanda/amplot.m4 b/config/amanda/amplot.m4
new file mode 100644 (file)
index 0000000..fba1884
--- /dev/null
@@ -0,0 +1,56 @@
+# OVERVIEW
+#
+#   'amplot' is largely pieced together by the instantiation phase of 
+#   configure; that is handled here.
+
+# SYNOPSIS
+#
+#   AMANDA_SETUP_AMPLOT
+#
+# DESCRIPTION
+#
+#   Check for the requirements for amplot, and set the Automake conditional
+#   WANT_AMPLOT appropriately.  If amplot is to be built, then also set up
+#   the required substitutions to build it correctly.
+#
+AC_DEFUN([AMANDA_SETUP_AMPLOT],
+[
+    AC_REQUIRE([AMANDA_PROG_GNUPLOT])
+    AC_REQUIRE([AMANDA_PROG_PCAT])
+    AC_REQUIRE([AMANDA_PROG_COMPRESS])
+    AC_REQUIRE([AMANDA_PROG_GZIP])
+    AC_REQUIRE([AC_PROG_AWK])
+
+    if test "x$GNUPLOT" != "x"; then
+       WANT_AMPLOT=true
+
+       # variable substitutions for amcat.awk
+       if test "$PCAT"; then
+           AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
+       else
+           AMPLOT_CAT_PACK=
+       fi
+       if test "$COMPRESS"; then
+           AMPLOT_COMPRESS=$COMPRESS
+           AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
+       else
+           AMPLOT_CAT_COMPRESS=
+       fi
+       if test "$GZIP"; then
+           AMPLOT_COMPRESS=$GZIP
+           AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
+       else
+           AMPLOT_CAT_GZIP=
+       fi
+
+       AC_SUBST(AMPLOT_COMPRESS)
+       AC_SUBST(AMPLOT_CAT_GZIP)
+       AC_SUBST(AMPLOT_CAT_COMPRESS)
+       AC_SUBST(AMPLOT_CAT_PACK)
+    else
+       WANT_AMPLOT=false
+       AMANDA_MSG_WARN([Not building 'amplot', because gnuplot was not found])
+    fi
+
+    AM_CONDITIONAL(WANT_AMPLOT, test x"$WANT_AMPLOT" = x"true")
+])
diff --git a/config/amanda/bsd-security.m4 b/config/amanda/bsd-security.m4
new file mode 100644 (file)
index 0000000..a376707
--- /dev/null
@@ -0,0 +1,58 @@
+# SYNOPSIS
+#
+#   AMANDA_BSD_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for BSD security, implementing the 
+#   --without-bsd-security option.  Also supplies the --without-amandahosts
+#   option to use .rhosts instead of .amandahosts
+#
+#   Note that the defaults for *both* of these options are "yes", unlike
+#   the remainder of the security implementations.
+#
+#   Defines BSD_SECURITY, and sets AM_CONDITIONAL WANT_BSD_SECURITY,
+#   if the user has selected this mechanism.  Also defines USE_AMANDAHOSTS
+#   unless the user has specified --without-amandahosts.
+#
+AC_DEFUN([AMANDA_BSD_SECURITY],
+[
+    BSD_SECURITY="yes"
+    AC_ARG_WITH(bsd-security,
+        AS_HELP_STRING([--without-bsd-security],
+                [do not include BSD authentication]),
+        [
+            case "$withval" in
+                n | no) BSD_SECURITY=no ;;
+                y |  ye | yes) ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.])
+                    ;;
+            esac
+        ],
+    )
+
+    USE_AMANDAHOSTS=yes
+    AC_ARG_WITH(amandahosts,
+        AS_HELP_STRING([ --without-amandahosts],
+            [use ".rhosts" instead of ".amandahosts"]),
+        [
+            case "$withval" in
+                n | no ) USE_AMANDAHOSTS="no" ;;
+                y |  ye | yes) : ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.])
+                  ;;
+            esac
+        ]
+    )
+
+    if test "x$BSD_SECURITY" = "xyes"; then
+        AC_DEFINE(BSD_SECURITY,1,
+            [Define to use BSD .rhosts/.amandahosts security. ])
+        if test "x$USE_AMANDAHOSTS" = "xyes"; then
+            AC_DEFINE(USE_AMANDAHOSTS,1,
+                [Define if you want to use the ".amandahosts" for BSD security. ])
+        fi
+    fi
+
+    AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes")
+])
diff --git a/config/amanda/bsdtcp-security.m4 b/config/amanda/bsdtcp-security.m4
new file mode 100644 (file)
index 0000000..044415b
--- /dev/null
@@ -0,0 +1,34 @@
+# SYNOPSIS
+#
+#   AMANDA_BSDTCP_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for BSDTCP security, implementing the 
+#   --with-bsdtcp-security option.
+#
+#   Defines BSDTCP_SECURITY, and sets AM_CONDITIONAL WANT_BSDTCP_SECURITY,
+#   if the user has selected this mechanism.
+#
+AC_DEFUN([AMANDA_BSDTCP_SECURITY],
+[
+    BSDTCP_SECURITY="no"
+    AC_ARG_WITH(bsdtcp-security,
+        AS_HELP_STRING([--with-bsdtcp-security],
+                [include BSDTCP authentication]),
+        [
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) BSDTCP_SECURITY=yes ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsdtcp-security.])
+              ;;
+            esac
+        ],
+    )
+
+    if test "x$BSDTCP_SECURITY" = "xyes"; then
+        AC_DEFINE(BSDTCP_SECURITY,1,
+            [Define if BSDTCP transport should be enabled.])
+    fi
+    AM_CONDITIONAL(WANT_BSDTCP_SECURITY, test x"$BSDTCP_SECURITY" = x"yes")
+])
diff --git a/config/amanda/bsdudp-security.m4 b/config/amanda/bsdudp-security.m4
new file mode 100644 (file)
index 0000000..1422bb7
--- /dev/null
@@ -0,0 +1,34 @@
+# SYNOPSIS
+#
+#   AMANDA_BSDUDP_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for BSDUDP security, implementing the 
+#   --with-bsdudp-security option.
+#
+#   Defines BSDUDP_SECURITY, and sets AM_CONDITIONAL WANT_BSDUDP_SECURITY,
+#   if the user has selected this mechanism.
+#
+AC_DEFUN([AMANDA_BSDUDP_SECURITY],
+[
+    BSDUDP_SECURITY="no"
+    AC_ARG_WITH(bsdudp-security,
+        AS_HELP_STRING([--with-bsdudp-security],
+                [include BSDUDP authentication]),
+        [
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) BSDUDP_SECURITY=yes ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsdudp-security.])
+              ;;
+            esac
+        ],
+    )
+
+    if test "x$BSDUDP_SECURITY" = "xyes"; then
+        AC_DEFINE(BSDUDP_SECURITY,1,
+            [Define if BSDUDP transport should be enabled.])
+    fi
+    AM_CONDITIONAL(WANT_BSDUDP_SECURITY, test x"$BSDUDP_SECURITY" = x"yes")
+])
diff --git a/config/amanda/changer.m4 b/config/amanda/changer.m4
new file mode 100644 (file)
index 0000000..23c3ae3
--- /dev/null
@@ -0,0 +1,274 @@
+# SYNOPSIS
+#
+#   AMANDA_SETUP_CHANGER
+#
+# OVERVIEW
+#
+#   Set up for changers.  This first checks the availability of several
+#   changer-related headers, then, based on those results, tries to 
+#   compile some test programs for each supported changer API.  It finishes
+#   by defining a series of AM_CONDITIONALS which are all used in
+#   changer-src/Makefile.am.
+#
+#   The macro also searches for chio, chs, mtx, and mcutil, which are used
+#   from various shell scripts in the changer-src/ directory.
+#
+AC_DEFUN([AMANDA_SETUP_CHANGER], [
+    AC_REQUIRE([AMANDA_PROG_CHIO])
+    AC_REQUIRE([AMANDA_PROG_CHS])
+    AC_REQUIRE([AMANDA_PROG_MTX])
+    AC_REQUIRE([AMANDA_PROG_MCUTIL])
+
+    AC_CHECK_HEADERS( \
+       camlib.h \
+       chio.h \
+       linux/chio.h \
+       scsi/sg.h \
+       scsi/scsi_ioctl.h \
+       sys/chio.h \
+       sys/dsreq.h \
+       sys/mtio.h \
+       sys/scarray.h \
+       sys/gscdds.h \
+       sys/scsi.h \
+       sys/scsiio.h \
+       sys/scsi/impl/uscsi.h \
+       sys/scsi/scsi/ioctl.h \
+       )
+
+    #
+    # chio support
+    #
+    if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
+       AC_CACHE_CHECK([for HP/UX-like scsi changer support],
+           amanda_cv_hpux_scsi_chio,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/scsi.h>
+    ]], [[
+           static struct element_addresses changer_info;
+           int i = SIOC_ELEMENT_ADDRESSES;
+           int j = SIOC_ELEMENT_STATUS;
+           int k = SIOC_MOVE_MEDIUM;
+    ]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])])
+       if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
+           WANT_SCSI_HPUX=yes
+           WANT_CHG_SCSI=yes
+       fi
+    fi
+
+    #
+    # Linux SCSI based on ioctl
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then 
+           AC_CACHE_CHECK([for Linux like scsi support (ioctl)],
+           amanda_cv_linux_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <scsi/scsi_ioctl.h>
+#include <sys/mtio.h>
+    ]], [[
+           int device;
+           char *Command;
+           ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
+    ]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])])
+    fi
+
+    #
+    # Linux SCSI based on sg
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_scsi_sg_h" = x"yes"; then 
+           AC_CACHE_CHECK([for Linux like scsi support (sg)],
+           amanda_cv_linux_sg_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <scsi/sg.h>
+#include <sys/mtio.h>
+    ]], [[
+           int device;
+           struct sg_header *psg_header;
+           char *buffer;
+           write(device, buffer, 1);
+    ]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])])
+    fi
+
+    if test x"$amanda_cv_linux_scsi" = x"yes" ||
+     test x"$amanda_cv_linux_sg_scsi" = x"yes";then
+           WANT_SCSI_LINUX=yes
+           WANT_CHG_SCSI=yes
+    fi
+
+    #
+    # HP-UX SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsi_h" = x"yes"; then 
+           AC_CACHE_CHECK([for HP-UX like scsi support],
+           amanda_cv_hpux_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <sys/scsi.h>
+#include <sys/mtio.h>
+    ]], [[
+           int device;
+           char *Command;
+           ioctl(device, SIOC_IO, Command);
+    ]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])])
+           if test x"$amanda_cv_hpux_scsi" = x"yes";then
+                   WANT_SCSI_HPUX_NEW=yes
+                   WANT_CHG_SCSI=yes
+                   WANT_CHG_SCSI_CHIO=yes
+           fi
+    fi
+
+    #
+    # IRIX SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then 
+           AC_CACHE_CHECK([for Irix like scsi support],
+           amanda_cv_irix_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/dsreq.h>
+#include <sys/mtio.h>
+    ]], [[
+           int device=1;
+           char Command;
+           ioctl(device, DS_ENTER, &Command);
+    ]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])])
+           if test x"$amanda_cv_irix_scsi" = x"yes";then
+                   WANT_SCSI_IRIX=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
+
+    #
+    # Solaris  SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then 
+           AC_CACHE_CHECK([for Solaris-like scsi support],
+           amanda_cv_solaris_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/scsi/impl/uscsi.h>
+#include <sys/mtio.h>
+    ]], [[
+           int device;
+           char *Command;
+           ioctl(device, USCSICMD, Command);
+    ]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])])
+           if test x"$amanda_cv_solaris_scsi" = x"yes";then
+                   WANT_SCSI_SOLARIS=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
+
+    #
+    # AIX SCSI
+    #
+    if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
+       test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then 
+           AC_CACHE_CHECK([for AIX like scsi support],
+           amanda_cv_aix_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/scarray.h>
+#include <sys/tape.h>
+    ]], [[
+           int device;
+           char *Command;
+           ioctl(device, STIOCMD, Command);
+    ]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])])
+           if test x"$amanda_cv_aix_scsi" = x"yes";then
+                   WANT_SCSI_AIX=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
+    #
+    # BSD CAM SCSI
+    #
+    if test x"$ac_cv_header_cam_cam_h" = x"yes";then
+           AC_CACHE_CHECK([for CAM like scsi support],
+           amanda_cv_cam_scsi,
+           [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+# include <fcntl.h>
+# include <cam/cam.h>
+# include <cam/cam_ccb.h>
+# include <cam/scsi/scsi_message.h>
+# include <cam/scsi/scsi_pass.h>
+# include <camlib.h>
+    ]], [[
+           struct cam_device *curdev;
+
+           curdev = cam_open_pass("", O_RDWR, NULL);
+    ]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])])
+           if test x"$amanda_cv_cam_scsi" = x"yes";then
+                   WANT_SCSI_CAM=yes
+                   WANT_CHG_SCSI=yes
+                   AC_CHECK_LIB(cam,main)
+           fi
+    fi
+
+
+    #
+    # BSD SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
+       AC_CACHE_CHECK([for BSD like scsi support],
+       amanda_cv_bsd_scsi,
+       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/scsiio.h>
+#include <sys/mtio.h>
+    ]], [[
+       int device=1;
+       char Command;
+       ioctl(device, SCIOCCOMMAND, &Command);
+    ]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])])
+       if test x"$amanda_cv_bsd_scsi" = x"yes";then
+          WANT_SCSI_BSD=yes
+          WANT_CHG_SCSI=yes
+       fi
+    fi
+
+    # Do not build chg-scsi-chio if we cannot find the needed support
+    # include files for the SCSI interfaces
+    # chio.h and sys/chio.h are chio based systems
+    if test x"$ac_cv_header_chio_h" = x"yes" ||
+       test x"$ac_cv_header_linux_chio_h" = x"yes" ||
+       test x"$ac_cv_header_sys_chio_h" = x"yes"; then
+       # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
+       # incompatible with the introduction of camlib.h
+       if test x"$ac_cv_header_camlib_h" != x"yes"; then
+        WANT_SCSI_CHIO=yes
+        # prefer to use chg-scsi, unless we already have a driver for that,
+        # in which case set it up as chg-scsi-chio.
+        if test x"$WANT_CHG_SCSI" = x"no"; then
+          WANT_CHG_SCSI=yes
+        else
+          WANT_CHG_SCSI_CHIO=yes
+        fi
+       fi
+    fi
+
+    # scsi-based implementations
+    AM_CONDITIONAL(WANT_CHG_SCSI, test x"$WANT_CHG_SCSI" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_LINUX, test x"$WANT_SCSI_LINUX" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_HPUX_NEW, test x"$WANT_SCSI_HPUX_NEW" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_IRIX, test x"$WANT_SCSI_IRIX" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_SOLARIS, test x"$WANT_SCSI_SOLARIS" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_AIX, test x"$WANT_SCSI_AIX" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_CAM, test x"$WANT_SCSI_CAM" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_BSD, test x"$WANT_SCSI_BSD" = x"yes")
+
+    # scsi-chio-based implementations
+    AM_CONDITIONAL(WANT_CHG_SCSI_CHIO, test x"$WANT_CHG_SCSI_CHIO" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_HPUX, test x"$WANT_SCSI_HPUX" = x"yes")
+    AM_CONDITIONAL(WANT_SCSI_CHIO, test x"$WANT_SCSI_CHIO" = x"yes")
+])
diff --git a/config/amanda/components.m4 b/config/amanda/components.m4
new file mode 100644 (file)
index 0000000..8c7b902
--- /dev/null
@@ -0,0 +1,177 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_COMPONENTS
+#
+# OVERVIEW
+#
+#   Defines --without-client, --without-server, --without-restore, and 
+#   --without-amrecover, and checks the results.
+#
+#   Sets the AM_CONDITIONALs WANT_CLIENT, WANT_SERVER, WANT_RESTORE, 
+#   and WANT_RECOVER.
+#   
+#   AM_CONDITIONAL WANT_TAPE is set if either server or restore support is
+#   being built.
+#
+AC_DEFUN([AMANDA_CHECK_COMPONENTS], [
+    AC_REQUIRE([AMANDA_WITHOUT_SERVER])
+    AC_REQUIRE([AMANDA_WITHOUT_CLIENT])
+    AC_REQUIRE([AMANDA_WITHOUT_RESTORE])
+    AC_REQUIRE([AMANDA_WITHOUT_AMRECOVER])
+    AC_REQUIRE([AMANDA_WITH_CLIENT_ONLY]) dnl deprecated
+    AC_REQUIRE([AMANDA_WITH_SERVER_ONLY]) dnl deprecated
+
+    # detect invalid combinations of components
+    if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then
+        AC_MSG_ERROR([--without-server requires --without-restore])
+    fi
+    if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then
+        AC_MSG_ERROR([--without-client requires --without-amrecover])
+    fi
+
+    AM_CONDITIONAL(WANT_CLIENT, $WANT_CLIENT)
+    AM_CONDITIONAL(WANT_RESTORE, $WANT_RESTORE)
+    AM_CONDITIONAL(WANT_SERVER, $WANT_SERVER)
+    AM_CONDITIONAL(WANT_RECOVER, $WANT_RECOVER)
+
+    AM_CONDITIONAL(WANT_TAPE, $WANT_SERVER || $WANT_RESTORE)
+])
+
+
+# SYNOPSIS
+#
+#   AMANDA_WITHOUT_SERVER
+#
+# OVERVIEW
+#
+#   Add option --without-server, and set WANT_SERVER to true or false, 
+#   accordingly.
+#
+AC_DEFUN([AMANDA_WITHOUT_SERVER], [
+    WANT_SERVER=true
+    AC_ARG_WITH(server,
+       AS_HELP_STRING([--without-server], [do not build server stuff (set --without-restore)]), [
+           case "$withval" in
+           y | ye | yes) WANT_SERVER=true;;
+           n | no) WANT_SERVER=false;;
+           *) AC_MSG_ERROR([You must not supply an argument to the --without-server option.]) ;;
+           esac
+    ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITHOUT_CLIENT
+#
+# OVERVIEW
+#
+#   Add option --without-client, and set WANT_CLIENT to true or false, 
+#   accordingly.
+#
+AC_DEFUN([AMANDA_WITHOUT_CLIENT], [
+    WANT_CLIENT=true
+    AC_ARG_WITH(client,
+       AS_HELP_STRING([--without-client], [do not build client stuff]), [
+           case "$withval" in
+           y | ye | yes) WANT_CLIENT=true;;
+           n | no) WANT_CLIENT=false;;
+           *) AC_MSG_ERROR([You must not supply an argument to the --without-client option.]) ;;
+           esac
+    ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITHOUT_RESTORE
+#
+# OVERVIEW
+#
+#   Add option --without-restore, and set WANT_RESTORE to true or false, 
+#   accordingly.
+#
+AC_DEFUN([AMANDA_WITHOUT_RESTORE], [
+    AC_REQUIRE([AMANDA_WITHOUT_SERVER])
+    WANT_RESTORE=${WANT_SERVER-true}
+    AC_ARG_WITH(restore,
+       AS_HELP_STRING([--without-restore], [do not build amrestore nor amidxtaped]), [
+           case "$withval" in
+           y | ye | yes) WANT_RESTORE=true;;
+           n | no) WANT_RESTORE=false;;
+           *) AC_MSG_ERROR([You must not supply an argument to --with-restore option.]) ;;
+           esac
+    ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITHOUT_AMRECOVER
+#
+# OVERVIEW
+#
+#   Add option --without-amrecover, and set WANT_RECOVER (not WANT_AMRECOVER) to
+#   true or false, accordingly.
+#
+AC_DEFUN([AMANDA_WITHOUT_AMRECOVER], [
+    AC_REQUIRE([AMANDA_WITHOUT_CLIENT])
+    WANT_RECOVER=${WANT_CLIENT-true}
+    AC_ARG_WITH(amrecover,
+       AS_HELP_STRING([--without-amrecover],
+                      [do not build amrecover]), [
+           case "$withval" in
+           y | ye | yes) WANT_RECOVER=false;;
+           n | no) WANT_RECOVER=false;;
+           *) AC_MSG_ERROR([You must not supply an argument to --with-amrecover option.]) ;;
+           esac
+       ])
+])
+
+## deprecated --with-* options
+
+AC_DEFUN([AMANDA_WITH_CLIENT_ONLY], [
+    AC_ARG_WITH(client-only,
+       AS_HELP_STRING([--with-client-only], [deprecated: use --without-server]),
+       [   AC_MSG_ERROR([--with-client-only is deprecated, use --without-server instead.])
+       ])
+],)
+
+AC_DEFUN([AMANDA_WITH_SERVER_ONLY], [
+    AC_ARG_WITH(server-only,
+       AS_HELP_STRING([--with-server-only], [deprecated: use --without-client]),
+       [   AC_MSG_ERROR([--with-server-only is deprecated, use --without-client instead.])
+       ],)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_COMPONENTS_SUMMARY
+#
+# OVERVIEW
+#
+#   Show a summary of the settings from this file.
+#
+AC_DEFUN([AMANDA_SHOW_COMPONENTS_SUMMARY],
+[
+    components=''
+    if $WANT_SERVER; then
+       components="$components server";
+    else 
+       components="$components (no server)";
+    fi
+    if $WANT_RESTORE; then
+       components="$components restore";
+    else 
+       components="$components (no restore)";
+    fi
+    if $WANT_CLIENT; then
+       components="$components client";
+    else 
+       components="$components (no client)";
+    fi
+    if $WANT_RECOVER; then
+       components="$components amrecover";
+    else 
+       components="$components (no amrecover)";
+    fi
+
+    echo "Amanda Components: $components"
+])
diff --git a/config/amanda/compress.m4 b/config/amanda/compress.m4
new file mode 100644 (file)
index 0000000..1fb47ec
--- /dev/null
@@ -0,0 +1,71 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_COMPRESSION
+#
+# OVERVIEW
+#
+#   Find a suitable compression program and define the following:
+#
+#    - COMPRESS_PATH
+#    - COMPRESS_SUFFIX
+#    - COMPRESS_FAST_OPT
+#    - COMPRESS_BEST_OPT
+#    - UNCOMPRESS_PATH
+#    - UNCOMPRESS_OPT
+#    - HAVE_GZIP
+#
+AC_DEFUN([AMANDA_CHECK_COMPRESSION],
+[
+    AC_REQUIRE([AMANDA_PROG_CAT])
+    AC_REQUIRE([AMANDA_PROG_COMPRESS])
+    AC_REQUIRE([AMANDA_PROG_GZIP])
+
+    if test "$GZIP"; then
+       AC_DEFINE(HAVE_GZIP,1,
+           [Define if Amanda is using the gzip program. ])
+       COMPRESS_PATH="$GZIP"
+       COMPRESS_SUFFIX=".gz"
+       COMPRESS_FAST_OPT="--fast"
+       COMPRESS_BEST_OPT="--best"
+       UNCOMPRESS_PATH="$GZIP"
+       UNCOMPRESS_OPT="-dc"
+    else
+       if test "$COMPRESS"; then
+           COMPRESS_PATH="$COMPRESS"
+           COMPRESS_SUFFIX=".Z"
+           COMPRESS_FAST_OPT="-f"
+           COMPRESS_BEST_OPT="-f"
+           UNCOMPRESS_PATH="$COMPRESS"
+           UNCOMPRESS_OPT="-dc"
+       else
+           # If we have to use cat, we don't define COMPRESS_FAST_OPT,
+           # COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
+           # look for a file by the name of "".
+           # XXX is the above true? --dustin
+
+           AMANDA_MSG_WARN([Cannot find either gzip or compress.  Using cat.])
+           COMPRESS_PATH="$CAT"
+           COMPRESS_SUFFIX=""
+           COMPRESS_FAST_OPT=""
+           COMPRESS_BEST_OPT=""
+           UNCOMPRESS_PATH="$CAT"
+           UNCOMPRESS_OPT=""
+       fi
+    fi
+
+    AC_DEFINE_UNQUOTED(COMPRESS_PATH,"$COMPRESS_PATH",
+       [Define to the exact path to the gzip or the compress program. ])
+    AC_DEFINE_UNQUOTED(COMPRESS_SUFFIX,"$COMPRESS_SUFFIX",
+       [Define to the suffix for the COMPRESS_PATH compression program. ])
+    AC_DEFINE_UNQUOTED(COMPRESS_FAST_OPT,"$COMPRESS_FAST_OPT",
+       [Define as the command line option for fast compression. ])
+    AC_DEFINE_UNQUOTED(COMPRESS_BEST_OPT,"$COMPRESS_BEST_OPT",
+       [Define as the command line option for best compression. ])
+    AC_DEFINE_UNQUOTED(UNCOMPRESS_PATH,"$UNCOMPRESS_PATH",
+       [Define as the exact path to the gzip or compress command. ])
+    AC_DEFINE_UNQUOTED(UNCOMPRESS_OPT,"$UNCOMPRESS_OPT",
+       [Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. ])
+
+    # Empty GZIP so that make dist works.
+    GZIP=
+])
diff --git a/config/amanda/config.m4 b/config/amanda/config.m4
new file mode 100644 (file)
index 0000000..fedf4bb
--- /dev/null
@@ -0,0 +1,58 @@
+# SYNOPSIS
+#
+#   AMANDA_CONFIG_LCOAL
+#
+# OVERVIEW
+#
+#   Invoke ./config.local, if it exists
+#
+AC_DEFUN([AMANDA_CONFIG_LOCAL],
+[
+    if test -f config.local; then
+       echo "running local script ./config.local"
+       . ./config.local
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_GET_SVN_INFO
+#
+# OVERVIEW
+#
+#   If the build is in a Subversion working copy, and if an svn client
+#   is available, then update common-src/svn-info.h to reflect the current
+#   revision and branch.
+#
+#   If these things are not available, then the file is not updated, and
+#   any previous contents are used.  If the file does not exist, it is
+#   created.
+#
+AC_DEFUN([AMANDA_GET_SVN_INFO],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_REQUIRE([AMANDA_PROG_GREP])
+
+    AC_PATH_PROG(SVN, svn,, $LOCSYSPATH)
+    AC_MSG_CHECKING([Subversion revision information])
+    if test -d $srcdir/.svn && test -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then
+       rev=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-`
+       url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
+       ( echo '#define BUILT_REV "'$rev'"'
+         echo '#define BUILT_BRANCH "'`basename "$url"`'"'
+       ) > common-src/svn-info.h
+
+       AC_MSG_RESULT([updated])
+    else
+       # Makefiles will be upset if the file doesn't exist, so double-check
+       if test -f common-src/svn-info.h; then
+           : # all good
+           AC_MSG_RESULT([not changed])
+       else
+           echo '/* no information available */' > common-src/svn-info.h
+           AC_MSG_RESULT([not available])
+       fi
+    fi
+
+    rm -f conftemp.svn
+])
diff --git a/config/amanda/debugging.m4 b/config/amanda/debugging.m4
new file mode 100644 (file)
index 0000000..6793c8f
--- /dev/null
@@ -0,0 +1,131 @@
+# SYNOPSIS
+#
+#   AMANDA_WITH_ASSERTIONS
+#
+# OVERVIEW
+#
+#   Handles the --with-assertions flag.  Defines ASSERTIONS if the flag is given.
+#
+AC_DEFUN([AMANDA_WITH_ASSERTIONS],
+[
+    AC_ARG_WITH(assertions,
+        AS_HELP_STRING([--with-assertions],
+            [compile assertions into code]),
+        [
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes)
+                    AC_DEFINE(ASSERTIONS,1,
+                        [Define if you want assertion checking. ])
+                  ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.])
+                  ;;
+            esac
+        ]
+    )
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_DEBUGGING
+#
+# OVERVIEW
+#
+#   Handles the --with[out]-debugging flag.  If debugging is not disabled, then define
+#   DEBUG_CODE, and define and substitute AMANDA_DBGDIR to either the location the
+#   user gave, or AMANDA_TMPDIR.
+#
+AC_DEFUN([AMANDA_WITH_DEBUGGING],
+[
+    AC_REQUIRE([AMANDA_WITH_TMPDIR])
+    AC_ARG_WITH(debugging,
+        AS_HELP_STRING([--with-debugging=DIR]
+            [put debug logs in DIR (default same as --with-tmpdir)]), 
+        [ debugging="$withval" ],
+       [ debugging="yes" ]
+    )
+
+    case "$debugging" in
+        n | no) AC_MSG_ERROR([Amanda no longer supports building with debugging disabled]);;
+        y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
+        *) AMANDA_DBGDIR="$debugging";;
+    esac
+
+    # evaluate any extra variables in the directory
+    AC_DEFINE_DIR([AMANDA_DBGDIR], [AMANDA_DBGDIR],
+       [Location of Amanda directories and files. ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_DEBUG_DAYS
+#
+# OVERVIEW
+#
+#   Handles the --with-debug-days flag.  Defines and substitutes AMANDA_DEBUG_DAYS.
+#
+AC_DEFUN([AMANDA_WITH_DEBUG_DAYS],
+[
+    AC_ARG_WITH(debug_days,
+        AS_HELP_STRING([--with-debug-days=NN],
+            [number of days to keep debugging files (default: 4)]),
+        [
+            debug_days="$withval"
+        ], [
+            debug_days="yes"
+        ]
+    )
+    case "$debug_days" in
+        n | no) 
+            AMANDA_DEBUG_DAYS=0 ;;
+        y |  ye | yes) 
+            AMANDA_DEBUG_DAYS=4 ;;
+        [[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]]) 
+            AMANDA_DEBUG_DAYS="$debug_days" ;;
+        *) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.])
+          ;;
+    esac
+    AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS,
+        [Number of days to keep debugging files. ])
+    AC_SUBST(AMANDA_DEBUG_DAYS)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_TESTING
+#
+# OVERVIEW
+#
+#   Handles the --with-testing flag.  Defines and substitutes SERVICE_SUFFIX, and
+#   defines AMANDA_SERVICE_NAME and KAMANDA_SERVICE_NAME.
+#
+AC_DEFUN([AMANDA_WITH_TESTING],
+[
+    AC_ARG_WITH(testing,
+        AS_HELP_STRING([--with-testing@<:@=SUFFIX@:>@],
+            [use alternate service names with suffix (default 'test')]),
+        [
+            TESTING="$withval"
+        ], [
+            TESTING="no"
+        ]
+    )
+    case "$TESTING" in
+        n | no) SERVICE_SUFFIX="";;
+        y |  ye | yes) SERVICE_SUFFIX="-test";;
+        *) SERVICE_SUFFIX="-$TESTING";;
+    esac
+
+    AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
+    KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
+
+    AC_SUBST(SERVICE_SUFFIX)
+    AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX",
+        [A suffix that will be appended to service names.
+     * Useful for testing in parallel with a working version. ])
+    AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME,  "$AMANDA_SERVICE_NAME", 
+        [The name for the Amanda service. ])
+    AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME", 
+        [The name for the Kerberized Amanda service. ])
+])
+
diff --git a/config/amanda/defaults.m4 b/config/amanda/defaults.m4
new file mode 100644 (file)
index 0000000..a28931b
--- /dev/null
@@ -0,0 +1,138 @@
+# SYNOPSIS
+#
+#   Get default settings for various configuration and command-line options:
+#      --with-index-server
+#          define and substitute DEFAULT_SERVER
+#      --with-config
+#          define and substitute DEFAULT_CONFIG
+#      --with-tape-server
+#          define and substitute DEFAULT_TAPE_SERVER
+#      --with-tape-device
+#          define and substitute DEFAULT_TAPE_DEVICE; substitue EXAMPLE_TAPEDEV
+#      --with-changer-device
+#          define and substitute DEFAULT_CHANGER_DEVICE
+#      --with-amandates
+#          define and substitute DEFAULT_AMANDATES_FILE
+#
+AC_DEFUN([AMANDA_SETUP_DEFAULTS],
+[
+    AC_ARG_WITH(index-server,
+       AS_HELP_STRING([--with-index-server=HOST],
+           [default amanda index server (default: `uname -n`)]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
+             ;;
+           *) DEFAULT_SERVER="$withval"
+             ;;
+           esac
+       ],
+       : ${DEFAULT_SERVER=`uname -n`}
+    )
+    AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
+       [This is the default Amanda index server.])
+    AC_SUBST(DEFAULT_SERVER)
+
+    AC_ARG_WITH(config,
+       AS_HELP_STRING([--with-config=CONFIG],
+           [default amanda configuration (default: DailySet1)]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
+             ;;
+           *) DEFAULT_CONFIG="$withval"
+             ;;
+           esac
+       ],
+       : ${DEFAULT_CONFIG=DailySet1}
+    )
+    AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
+       [This is the default Amanda configuration.])
+    AC_SUBST(DEFAULT_CONFIG)
+
+    AC_ARG_WITH(tape-server,
+       AS_HELP_STRING([--with-tape-server=HOST],
+           [default tape server for restore (default: same as index-server)]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
+             ;;
+           *) DEFAULT_TAPE_SERVER="$withval"
+             ;;
+           esac
+       ],
+       : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
+    )
+    AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",
+       [This is the default restoring Amanda tape server. ])
+    AC_SUBST(DEFAULT_TAPE_SERVER)
+
+    AC_ARG_WITH(tape-device,
+       AS_HELP_STRING([--with-tape-device=DEVICE],
+           [default device on restore tape server]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
+             ;;
+           *) DEFAULT_TAPE_DEVICE="$withval"
+             ;;
+           esac
+       ]
+    )
+
+    AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",
+       [This is the default no-rewinding tape device. ])
+    AC_SUBST(DEFAULT_TAPE_DEVICE)
+
+    if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then
+       EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE"
+    else
+       EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE"
+    fi
+    AC_SUBST(EXAMPLE_TAPEDEV)
+
+    AC_ARG_WITH(changer-device,
+       AS_HELP_STRING([--with-changer-device=DEV],
+           [default tape changer device (default: /dev/ch0)]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.])
+             ;;
+           *) DEFAULT_CHANGER_DEVICE="$withval"
+             ;;
+           esac
+       ]
+    )
+
+    if test -z "$DEFAULT_CHANGER_DEVICE"; then
+       DEFAULT_CHANGER_DEVICE=/dev/null
+       if test -f /dev/ch0; then
+           DEFAULT_CHANGER_DEVICE=/dev/ch0
+       fi
+    fi
+
+    AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",
+       [This is the default changer device. ])
+    AC_SUBST(DEFAULT_CHANGER_DEVICE)
+
+    AC_ARG_WITH(amandates,
+        AS_HELP_STRING([--with-amandates],
+            [default location for 'amandates' (default: $localstatedir/amanda/amandates)]),
+           [
+           case "$withval" in
+               n | no) AC_MSG_ERROR([*** --without-amandates is not allowed.]);;
+               y |  ye | yes) amandates='$localstatedir/amanda/amandates' ;;
+               *) amandates="$withval";;
+           esac
+           ],
+           [amandates='$localstatedir/amanda/amandates']
+    )
+
+    AC_DEFINE_DIR([DEFAULT_AMANDATES_FILE], [amandates],
+        [Default location for 'amandates'])
+])
diff --git a/config/amanda/devprefix.m4 b/config/amanda/devprefix.m4
new file mode 100644 (file)
index 0000000..7359d74
--- /dev/null
@@ -0,0 +1,119 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_DEVICE_PREFIXES
+#
+# DESCRIPTION
+#
+#   Check for the prefixes used for particular devices.  If the prefixes
+#   are broken on this system (Sinix and HPUX), suggest how to fix them.
+#
+#   Substitutes CLIENT_SCRIPTS_OPT with the name of the script used to fix
+#   broken systems.
+#
+#   Defines DEV_PREFIX and RDEV_PREFIX to the appropriate prefixes.
+#
+AC_DEFUN([AMANDA_CHECK_DEVICE_PREFIXES],
+[
+    # disk device prefixes
+    AC_MSG_CHECKING(disk device prefixes)
+
+    # Use df to find the mount point for the root filesystem.  Use
+    # the positional parameters to find the particular line from df
+    # that contains the root paritition.  We put it in a subshell so
+    # that the original positional parameters are not messed with.
+    dfline=`(
+       df / | while read line; do
+           set -- $line
+           dnl @S|@ means $ to m4
+           while test @S|@# -gt 0; do
+               if test "x@S|@1" = "x/"; then
+                   echo $line
+                   break 2
+               fi
+               shift
+           done
+       done
+    ) | sed 's/(//' | sed 's/)//' `
+
+    # Search for the mount point by using expr to find the parameter
+    # with dev in it.
+    mount=`(
+       set -- $dfline
+       dnl @S|@ means $ to m4
+       while test @S|@# -gt 0; do
+           if expr "@S|@1" : '.*dev' >/dev/null 2>&1; then
+               echo @S|@1
+               break
+           fi
+           shift
+       done
+    )`
+
+    # get any system-specific configuration information
+    case "$target" in
+       *-hp-*)
+           CLIENT_SCRIPTS_OPT=amhpfixdevs
+           case $mount in
+               /dev/vg*)
+                   AMANDA_MSG_WARN([Run amhpfixdevs on HP-UX systems using /dev/vg??.])
+                   ;;
+           esac
+           ;;
+       *-sni-sysv4)
+           DEV_PREFIX=/dev/dsk/
+           RDEV_PREFIX=/dev/rdsk/
+           CLIENT_SCRIPTS_OPT=amsinixfixdevs
+           if ! test -d /dev/dsk; then
+               AMANDA_MSG_WARN([Run amsinixfixdevs on Sinix systems using VxFS.])
+           fi
+           ;;
+       *-sco3.2v4*)
+           DEV_PREFIX=/dev/
+           RDEV_PREFIX=/dev/
+           ;;
+       *)
+           CLIENT_SCRIPTS_OPT=
+           ;;
+    esac
+
+    if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
+       AC_MSG_RESULT((predefined) $DEV_PREFIX - $RDEV_PREFIX)
+    else
+       if test -d /dev/dsk; then
+           DEV_PREFIX=/dev/dsk/
+           if test -d /dev/rdsk; then
+               RDEV_PREFIX=/dev/rdsk/
+           else
+               RDEV_PREFIX=/dev/dsk/
+           fi
+       elif test -d /dev; then
+           DEV_PREFIX=/dev/
+
+           # Some systems, notably Linux, do not have raw disk devices
+           # names.  Check this by trying to see if a raw disk device name
+           # exists using the normal raw device path prepended to the
+           # mount point of the root filesystem.
+           if test "$mount"; then
+               dev_name="/dev/r`basename $mount`"
+               if test -b $dev_name -o -c $dev_name; then
+                   RDEV_PREFIX=/dev/r
+               else
+                   RDEV_PREFIX=/dev/
+               fi
+           else
+               RDEV_PREFIX=/dev/r
+           fi
+       else
+           # just fake it..
+           DEV_PREFIX=/
+           RDEV_PREFIX=/
+       fi
+       AC_MSG_RESULT($DEV_PREFIX - $RDEV_PREFIX)
+    fi
+
+    AC_DEFINE_UNQUOTED(DEV_PREFIX,"${DEV_PREFIX}",
+       [Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ ])
+    AC_DEFINE_UNQUOTED(RDEV_PREFIX,"${RDEV_PREFIX}",
+       [Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ ])
+    AC_SUBST(CLIENT_SCRIPTS_OPT)
+])
diff --git a/config/amanda/dirs.m4 b/config/amanda/dirs.m4
new file mode 100644 (file)
index 0000000..ee9c58c
--- /dev/null
@@ -0,0 +1,266 @@
+# SYNOPSIS
+#
+#   AMANDA_WITH_DUMPERDIR
+#
+# OVERVIEW
+#
+#   Define and substitute DUMPER_DIR with the result.
+#
+AC_DEFUN([AMANDA_WITH_DUMPERDIR],
+[
+    AC_ARG_WITH(dumperdir,
+       AS_HELP_STRING([--with-dumperdir=DIR],
+           [where we install the dumpers (default: exec_prefix/dumper)]),
+       [
+            AMANDA_MSG_WARN([--with-dumperdir is no longer used.])
+       ]
+    )
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_CONFIGDIR
+#
+# OVERVIEW
+#
+#   Allow user to specify the dumperdir, defaulting to ${exec_prefix}/dumper.
+#   Define and substitute DUMPER_DIR with the result.
+#
+AC_DEFUN([AMANDA_WITH_CONFIGDIR],
+[
+    AC_ARG_WITH(configdir,
+       AS_HELP_STRING([--with-configdir=DIR],
+           [runtime config files in DIR @<:@sysconfdir/amanda@:>@]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-configdir option.])
+             ;;
+           *) CONFIG_DIR="$withval"
+             ;;
+           esac
+       ], [
+           : ${CONFIG_DIR='${sysconfdir}/amanda'} # (variable will be evaluated below)
+       ]
+    )
+    AC_DEFINE_DIR([CONFIG_DIR], [CONFIG_DIR],
+      [The directory in which configuration directories should be created. ])
+])
+
+## deprecated --with-*dir options
+
+AC_DEFUN([AMANDA_WITH_INDEXDIR],
+[
+    AC_ARG_WITH(indexdir,
+       AS_HELP_STRING([--with-indexdir], [deprecated: use indexdir in amanda.conf]),
+       [   AC_MSG_ERROR([*** --with-indexdir is deprecated; use indexdir in amanda.conf instead.])
+       ],)
+])
+
+AC_DEFUN([AMANDA_WITH_DBDIR],
+[
+    AC_ARG_WITH(dbdir,
+       AS_HELP_STRING([--with-dbdir], [deprecated: use infofile in amanda.conf]),
+       [   AC_MSG_ERROR([*** --with-dbdir is deprecated; use infofile in amanda.conf instead.])
+       ],)
+])
+
+AC_DEFUN([AMANDA_WITH_LOGDIR],
+[
+    AC_ARG_WITH(logdir,
+       AS_HELP_STRING([--with-logdir], [deprecated: use logfile in amanda.conf]),
+       [   AC_MSG_ERROR([*** --with-logdir is deprecated; use logfile in amanda.conf instead.])
+       ],)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_GNUTAR_LISTDIR
+#
+# OVERVIEW
+#
+#   Implements --with-gnutar-listdir.  Defines GNUTAR_LISTED_INCREMENTAL_DIR to the
+#   value given or $localstatedir/amanda/gnutar-lists by default.  Any $xxxdir variables
+#   are fully evaluated in the value.
+#
+AC_DEFUN([AMANDA_WITH_GNUTAR_LISTDIR], 
+[
+    AC_ARG_WITH(gnutar-listdir,
+       AS_HELP_STRING([--with-gnutar-listdir=DIR],
+        [put gnutar directory lists in DIR (default: localstatedir/amanda/gnutar-lists)]),
+       [
+            case "$withval" in
+                n | no) GNUTAR_LISTDIR= ;;
+                y | ye | yes) GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' ;;
+                *) GNUTAR_LISTDIR="$withval" ;;
+            esac
+        ], [
+            GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists'
+        ]
+    )
+
+    # substitute $prefix, etc. if necessary
+    AC_DEFINE_DIR([GNUTAR_LISTED_INCREMENTAL_DIR], [GNUTAR_LISTDIR],
+       [The directory in which GNU tar should store directory lists for incrementals. ])
+    
+    # handle deprecated option
+    AC_ARG_WITH(gnutar-listed-incremental,
+        AS_HELP_STRING([--with-gnutar-listed-incremental], 
+            [deprecated; use --with-gnutar-listdir]),
+        [
+            AC_MSG_ERROR([*** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead])
+        ]
+    )
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_TMPDIR
+#
+# OVERVIEW
+#
+#   Implement --with-tmpdir.  Defines and substitutes AMANDA_TMPDIR.
+#
+AC_DEFUN([AMANDA_WITH_TMPDIR],
+[
+    AC_ARG_WITH(tmpdir,
+        AS_HELP_STRING([--with-tmpdir],
+            [directory for temporary and debugging files (default: /tmp/amanda)]),
+        [
+            tmpdir="$withval"
+        ], [
+            tmpdir=yes
+        ]
+    )
+
+    case "$tmpdir" in
+        n | no) AC_MSG_ERROR([*** --without-tmpdir is not allowed.]);;
+        y |  ye | yes) AMANDA_TMPDIR="/tmp/amanda";;
+        *) AMANDA_TMPDIR="$tmpdir";;
+    esac
+
+    AC_DEFINE_DIR([AMANDA_TMPDIR], [AMANDA_TMPDIR],
+        [The directory in which Amanda should create temporary files. ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_EXPAND_DIRS
+#
+# OVERVIEW
+#
+#   Expand any variable references in the following variables, then define them:
+#   - bindir
+#   - sbindir
+#   - libexecdir
+#   - mandir
+#
+#   Also defines the following directories and expands any variable references:
+#   - amlibdir = --with-amlibdir or ${libdir}/amanda
+#   - amlibexecdir = --with-amlibexecdir or ${libexecdir}/amanda
+#   - amincludedir = ${includedir}/amanda
+#   - amperldir = --with-amperldir or `perl -V:installsitearch`
+#   - DUMPER_DIR = ${amlibexecdir}/application
+#
+AC_DEFUN([AMANDA_EXPAND_DIRS],
+[
+    AC_REQUIRE([AMANDA_PROG_PERL])
+
+    AC_DEFINE_DIR([bindir], [bindir],
+        [Directory in which user binaries should be installed. ])
+
+    AC_DEFINE_DIR([sbindir], [sbindir],
+        [Directory in which administrator binaries should be installed. ])
+
+    AC_DEFINE_DIR([libexecdir], [libexecdir], 
+        [Directory in which internal binaries should be installed. ])
+
+    AC_DEFINE_DIR([mandir], [mandir],
+        [Directory in which man-pages should be installed])
+
+
+    # amanda-specific directories
+    AMLIBDIR=$libdir/amanda
+    AC_ARG_WITH(amlibdir,
+       AS_HELP_STRING([--with-amlibdir[[[[[=PATH]]]]]],
+               [Where library are installed, default: $libdir/amanda])
+       AS_HELP_STRING([--without-amlibdir],
+               [Library are installed in $libdir]),
+       [
+           case "$withval" in
+               n | no) AMLIBDIR=$libdir ;;
+               y | ye | yes) AMLIBDIR=$libdir/amanda ;;
+               *) AMLIBDIR=$withval ;;
+           esac
+       ]
+    )
+    AC_DEFINE_DIR([amlibdir], [AMLIBDIR],
+       [Directory in which Amanda libraries should be installed])
+
+    AMLIBEXECDIR=$libexecdir/amanda
+    AC_ARG_WITH(amlibexecdir,
+       AS_HELP_STRING([--with-amlibexecdir[[[[[=PATH]]]]]],
+               [Where amanda own programs are installed, default: $libexecdir/amanda])
+       AS_HELP_STRING([--without-amlibexecdir],
+               [Amanda own programs are installed in $libexecdir]),
+       [
+           case "$withval" in
+               n | no) AMLIBEXECDIR=$libexecdir ;;
+               y | ye | yes) AMLIBEXECDIR=$libexecdir/amanda ;;
+               *) AMLIBEXECDIR=$withval ;;
+           esac
+       ]
+    )
+    AC_DEFINE_DIR([amlibexecdir], [AMLIBEXECDIR],
+       [Directory in which Amanda own programs should be installed])
+
+    amincludedir="${includedir}/amanda"
+    AC_DEFINE_DIR([amincludedir], [amincludedir],
+       [Directory in which Amanda header files should be installed])
+
+    AC_ARG_WITH(amperldir,
+       AS_HELP_STRING([--with-amperldir[[[[[=PATH]]]]]],
+               [Where amanda's perl modules are installed; default: installsitelib])
+       AS_HELP_STRING([--without-amperldir],
+               [Install amanda's perl modules in $amlibdir/perl]),
+       [
+           case "$withval" in
+               y | ye | yes) AMPERLLIB=DEFAULT ;;
+               n | no) AMPERLLIB=$amlibdir/perl ;;
+               *) AMPERLLIB=$withval ;;
+           esac
+       ], [
+           AMPERLLIB=DEFAULT
+       ]
+    )
+    # apply the default if no value was given.
+    if test x"$AMPERLLIB" = x"DEFAULT"; then
+       eval `$PERL -V:installsitelib`
+       AMPERLLIB=$installsitelib
+    fi
+    AC_DEFINE_DIR([amperldir], [AMPERLLIB],
+       [Directory in which perl modules should be installed])
+
+    DUMPER_DIR='${amlibexecdir}/application'
+    AC_DEFINE_DIR([DUMPER_DIR],[DUMPER_DIR],
+           [Directory in which dumper interfaces should be installed and searched. ])
+    # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR'
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_DIRS_SUMMARY
+#
+# OVERVIEW
+#
+#   Show a summary of the settings from this file.
+#
+AC_DEFUN([AMANDA_SHOW_DIRS_SUMMARY],
+[
+    echo "Directories:"
+    echo "  Perl modules (amperldir): $amperldir"
+    echo "  Dumper: $DUMPER_DIR"
+    echo "  Configuration: $CONFIG_DIR"
+    echo "  GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR"
+    echo "  Temporary: $AMANDA_TMPDIR"
+])
diff --git a/config/amanda/documentation.m4 b/config/amanda/documentation.m4
new file mode 100644 (file)
index 0000000..af8a023
--- /dev/null
@@ -0,0 +1,64 @@
+# OVERVIEW
+#
+#   Configuration for the docbook-based manpages.
+#
+#   We require XSLTPROC, as well as specific versions of Docbook and the
+#   Docbook DTD.
+
+AC_DEFUN([AMANDA_SETUP_DOCUMENTATION],
+[
+    AC_ARG_ENABLE(manpage-build,
+    AS_HELP_STRING([--enable-manpage-build],
+                  [Build the manpages from their XML source (shipped manpages are usually sufficient)]),
+       [ ENABLE_MANPAGE_BUILD=$enableval ],
+       [ ENABLE_MANPAGE_BUILD=no ])
+
+    # and ensure that everything docbook-related is OK if we'll be using it
+    if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+       DOC_BUILD_DATE=`date '+%d-%m-%Y'`
+
+       AC_PROG_XSLTPROC([--nonet])
+       AC_CHECK_DOCBOOK_XSLT([1.72.0])
+       AC_CHECK_DOCBOOK_XSLT_MIN([1.72.0])
+       AC_CHECK_DOCBOOK_DTD([4.1.2])
+       AC_CHECK_DOCBOOK_DTD([4.2])
+
+       if test -z "$XSLTPROC"; then
+           AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.])
+       fi
+
+       # if the 'current' Docbook revision is good enough, use that; otherwise,
+       # if 1.72.0 is available, use that.
+       XSLREL=current
+       if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
+           if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
+               AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 or higher required.])
+           else
+               XSLREL=1.72.0
+           fi
+       fi
+
+       # disable validation if the correct DTDs are not available
+       if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
+           AMANDA_MSG_WARN([Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation])
+           XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
+       fi
+    fi
+
+    AM_CONDITIONAL(ENABLE_MANPAGE_BUILD, test "x$ENABLE_MANPAGE_BUILD" = "xyes")
+    AC_SUBST(XSLREL)
+    AC_SUBST(DOC_BUILD_DATE)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_DOCUMENTATION_SUMMARY
+#
+# OVERVIEW
+#
+#   Show a summary of the settings from this file.
+#
+AC_DEFUN([AMANDA_SHOW_DOCUMENTATION_SUMMARY],
+[
+    echo "Build documentation:" $ENABLE_MANPAGE_BUILD
+])
diff --git a/config/amanda/dumpers.m4 b/config/amanda/dumpers.m4
new file mode 100644 (file)
index 0000000..5c3ce07
--- /dev/null
@@ -0,0 +1,394 @@
+# OVERVIEW
+#
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_GNUTAR
+#
+# OVERVIEW
+#
+#   Search for a GNU 'tar' binary, placing the result in the precious 
+#   variable GNUTAR.  The discovered binary is tested to ensure it's really
+#   GNU tar.
+#
+#   Also handle --with-gnutar
+#
+AC_DEFUN([AMANDA_PROG_GNUTAR],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    # call with
+    AC_ARG_WITH(gnutar,
+       AS_HELP_STRING([--with-gnutar=PROG],
+                      [use PROG as GNU 'tar']),
+       [
+           # check withval
+           case "$withval" in
+               /*) GNUTAR="$withval";;
+               y|ye|yes) :;;
+               n|no) GNUTAR=no ;;
+               *)  AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);;
+           esac
+           # done
+       ]
+    )
+
+    if test "x$GNUTAR" != "xno"; then
+       # call ac_path_progs
+       AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
+    else
+       GNUTAR=
+    fi
+
+    if test ! -z "$GNUTAR"; then
+      case "`\"$GNUTAR\" --version 2>&1`" in
+       *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
+                   ;;
+       *)
+                   # warning..
+                   AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
+                   GNUTAR=''
+                   ;;
+      esac
+    fi
+
+    if test "x$GNUTAR" != "x"; then
+       # define unquoted
+       AC_DEFINE_UNQUOTED(GNUTAR, "$GNUTAR", [Location of the GNU 'tar' binary])
+    fi
+    AC_ARG_VAR(GNUTAR, [Location of the GNU 'tar' binary])
+    AC_SUBST(GNUTAR)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_SAMBA_CLIENT
+#
+# OVERVIEW
+#
+#   Search for a samba client (smbclient) binary, placing the result in
+#   the variable SAMBA_CLIENT.  The discovered binary is tested to determine an
+#   internally significant version number, stored in SAMBA_VERSION.  The version
+#   serves only to differentiate versions of Samba which Amanada must treat 
+#   differently, and has no relation to the actual Samba version number.
+#
+#   Automake conditional 'WANT_SAMBA' is set if a samba client is discovered.
+#
+#   Also handles --with-smbclient and (deprecated) --with-samba-user
+#
+AC_DEFUN([AMANDA_PROG_SAMBA_CLIENT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_ARG_WITH(smbclient,
+       AS_HELP_STRING([--with-smbclient=PROG],
+                      [use PROG as 'smbclient']),
+       [
+           case "$withval" in
+               /*) SAMBA_CLIENT="$withval";;
+               y|ye|yes) :;;
+               n|no) SAMBA_CLIENT=no ;;
+               *)  AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);;
+           esac
+       ]
+    )
+
+    AC_ARG_WITH(samba-user,
+       AS_HELP_STRING([--with-samba-user],
+                      [deprecated; place username in 'amandapass']),
+       [ AC_MSG_ERROR([--with-samba-user is no longer supported; place username in 'amandapass']) ]
+    )
+
+    if test "x$SAMBA_CLIENT" != "xno"; then
+      AC_PATH_PROG(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
+      smbversion=0
+      if test ! -z "$SAMBA_CLIENT"; then
+        case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
+        *"Unknown host"*)
+                     smbversion=1
+                     ;;
+        *"Connection to not.a.host.name failed"*)
+                     smbversion=2
+                     ;;
+        *)
+                     AMANDA_MSG_WARN([$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.])
+                     SAMBA_CLIENT=
+                     ;;
+        esac
+        if test -n "$SAMBA_CLIENT"; then
+         AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT",
+                 [Define the location of smbclient for backing up Samba PC clients. ])
+         AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion,
+                 [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ])
+        fi
+      fi
+    fi
+
+    AM_CONDITIONAL(WANT_SAMBA, test -n "$SAMBA_CLIENT")
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_VDUMP_VRESTORE
+#
+# DESCRIPTION
+#
+#   Search for 'vdump' and 'vrestore', setting and AC_DEFINE-ing VDUMP and 
+#   VRESTORE if they are found.
+#
+AC_DEFUN([AMANDA_PROG_VDUMP_VRESTORE],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_PATH_PROG(VDUMP,vdump,,$SYSLOCPATH)
+    AC_PATH_PROG(VRESTORE,vrestore,,$SYSLOCPATH)
+    if test "$VDUMP" -a "$VRESTORE"; then
+       AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ])
+       AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_VXDUMP_VXRESTORE
+#
+# DESCRIPTION
+#
+#   Search for 'vxdump' and 'vxrestore', setting and AC_DEFINE-ing VXDUMP
+#   and VXRESTORE if they are found.
+#
+#   In addition to the standard paths, this macro will search in
+#   /usr/lib/fs/vxfs.
+#
+AC_DEFUN([AMANDA_PROG_VXDUMP_VXRESTORE],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_PATH_PROG(VXDUMP,vxdump,,$SYSLOCPATH:/usr/lib/fs/vxfs)
+    AC_PATH_PROG(VXRESTORE,vxrestore,,$SYSLOCPATH:/usr/lib/fs/vxfs)
+    if test "$VXDUMP" -a "$VXRESTORE"; then
+       AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP",
+[Define the location of the vxdump program on HPUX and SINIX hosts or on
+ * other hosts where the Veritas filesystem (vxfs) has been installed. ])
+       AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE",
+[Define the location of the vxrestore program on HPUX and SINIX hosts or on
+ * other hosts where the Veritas filesystem (vxfs) has been installed. ])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_XFSDUMP_XFSRESTORE
+#
+# DESCRIPTION
+#
+#   Search for 'xfsdump' and 'xfsrestore', setting and AC_DEFINE-ing XFSDUMP
+#   and XFSRESTORE if they are found.
+#
+AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH)
+    AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH)
+    if test "$XFSDUMP" -a "$XFSRESTORE"; then
+       AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP",
+               [Define the location of the xfsdump program on Irix hosts. ])
+       AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE",
+               [Define the location of the xfsrestore program on Irix hosts. ])
+       AMANDA_MSG_WARN([[xfsdump causes the setuid-root rundump program to be enabled.  To disable it, just #undef XFSDUMP in config/config.h]])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_DUMP_RESTORE
+#
+# DESCRIPTION
+#
+#   Search for compatible dump and restore binaries.  The exact name of
+#   the binaries we search for depends on the target system.  If working
+#   binaries are found, DUMP and RESTORE are defined to their full paths.
+#
+#   DUMP_RETURNS is defined if the system's 'dump' returns 1 on success.
+#
+#   HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates.
+#
+#   The --with-honor-nodump flag is processed, and the result of the test is
+#   positive, then HAVE_HONOR_NODUMP is defined.
+#
+AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_REQUIRE([AMANDA_PROG_GREP])
+
+    # Set the order of dump programs to look for.  Finding the proper file
+    # system dumping program is problematic.  Some systems, notably HP-UX
+    # and AIX, have both the backup and dump programs.  HP-UX can't use the
+    # the backup program while AIX systems can't use the dump program.  So
+    # a variable is set up here to specify the order of dump programs to
+    # search for on the system.
+    DUMP_PROGRAMS="ufsdump dump backup"
+    dump_returns_1=
+    case "$target" in
+       *-dg-*)
+           DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
+           dump_returns_1=yes
+           ;;
+      *-ibm-aix*)
+           DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
+           AC_DEFINE(AIX_BACKUP,1,
+               [Is DUMP the AIX program 'backup'?])
+           ;;
+      *-ultrix*)
+           dump_returns_1=yes
+           ;;
+    esac
+
+    if test -n "$dump_returns_1"; then
+      AC_DEFINE(DUMP_RETURNS_1,1,
+       [Define this if this system's dump exits with 1 as a success code. ])
+    fi
+
+    AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
+    AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
+    
+    # newer versions of GNU tar include a program named 'backup' which
+    # does *not* implement the expected 'dump' interface.  Detect that here
+    # and pretend we never saw it.
+    if test -n "$DUMP"; then
+      if test "`basename $DUMP`" = "backup"; then
+        backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
+        if test $? -eq 0; then
+          DUMP=
+        fi
+      fi
+    fi
+    
+    if test "$DUMP" -a "$RESTORE"; then
+       AC_DEFINE_UNQUOTED(DUMP,"$DUMP",
+           [Define the location of the ufsdump, backup, or dump program. ])
+       AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE",
+           [Define the location of the ufsrestore or restore program. ])
+
+       # check for an estimate flag
+       if test -x $DUMP; then
+           AC_CACHE_CHECK(
+               [whether $DUMP supports -E or -S for estimates],
+               amanda_cv_dump_estimate,
+               [
+                   case "$DUMP" in
+                   *dump)
+                       AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-E 2>&1)
+                       cat conftest.d-E >&AS_MESSAGE_LOG_FD()
+                       AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-S 2>&1)
+                       cat conftest.d-S >&AS_MESSAGE_LOG_FD()
+                       AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d 2>&1)
+                       cat conftest.d >&AS_MESSAGE_LOG_FD()
+                       if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then
+                           amanda_cv_dump_estimate=E
+                       elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then
+                           amanda_cv_dump_estimate=S
+                       else
+                           amanda_cv_dump_estimate=no
+                       fi
+                       rm -f conftest.d conftest.d-E conftest.d-S
+                     ;;
+                   *) amanda_cv_dump_estimate=no
+                     ;;
+                   esac
+               ])
+       else
+           AMANDA_MSG_WARN([$DUMP is not executable, cannot run -E/-S test])
+           amanda_cv_dump_estimate=no
+       fi
+       if test "x$amanda_cv_dump_estimate" != xno; then
+           AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate",
+               [Define to the string that enables dump estimates. ])
+       fi
+
+       AC_ARG_WITH(dump-honor-nodump,
+           AS_HELP_STRING([--with-dump-honor-nodump],
+               [if dump supports -h, use it for level0s too]),
+       [
+           if test -x $DUMP; then
+               AC_CACHE_CHECK(
+                 [whether $DUMP supports -h (honor nodump flag)],
+                 amanda_cv_honor_nodump,
+                 [
+                   case "$DUMP" in
+                   *dump)
+                       AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-h 2>&1)
+                       cat conftest.d-h >&AS_MESSAGE_LOG_FD()
+                       AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d 2>&1)
+                       cat conftest.d >&AS_MESSAGE_LOG_FD()
+                       if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then
+                           amanda_cv_honor_nodump=yes
+                       else
+                           amanda_cv_honor_nodump=no
+                       fi
+                       rm -f conftest.d conftest.d-h
+                     ;;
+                   *) amanda_cv_honor_nodump=no
+                     ;;
+                   esac
+                 ])
+           else
+               AMANDA_MSG_WARN([$DUMP is not executable, cannot run -h test])
+               amanda_cv_honor_nodump=no
+           fi
+           if test "x$amanda_cv_honor_nodump" = xyes; then
+               AC_DEFINE(HAVE_HONOR_NODUMP,1,
+                   [Define this if dump accepts -h for honoring nodump. ])
+           fi
+       ])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_USE_RUNDUMP
+#
+# DESCRIPTION
+#
+#   Decide if the 'rundump' setuid-root wrapper should be used to invoke
+#   dump.  If so, USE_RUNDUMP is #defined.
+#
+AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [
+    USE_RUNDUMP=no
+
+    # some systems require rundump unconditionally
+    case "$target" in
+        *-ultrix*) USE_RUNDUMP=yes ;;
+        *-dg-*) USE_RUNDUMP=yes ;;
+    esac
+
+    AC_ARG_WITH(rundump,
+        AS_HELP_STRING([--with-rundump], [use rundump, a setuid-root wrapper, to invoke dump]), [
+        case "$withval" in
+            n | no) USE_RUNDUMP=no ;;
+            y | ye | yes) USE_RUNDUMP=yes ;;
+            *) AC_MSG_ERROR([You must not supply an argument to --with-rundump option.]);;
+        esac
+        ])
+
+    if test x"$USE_RUNDUMP" = x"yes"; then
+        AC_DEFINE(USE_RUNDUMP,1,
+            [Define to invoke rundump (setuid-root) instead of DUMP program directly. ])
+    fi
+])
diff --git a/config/amanda/file-list b/config/amanda/file-list
new file mode 100644 (file)
index 0000000..a370d2a
--- /dev/null
@@ -0,0 +1,40 @@
+## this file is automatically generated by autogen
+EXTRA_DIST += amanda/amplot.m4
+EXTRA_DIST += amanda/bsd-security.m4
+EXTRA_DIST += amanda/bsdtcp-security.m4
+EXTRA_DIST += amanda/bsdudp-security.m4
+EXTRA_DIST += amanda/changer.m4
+EXTRA_DIST += amanda/components.m4
+EXTRA_DIST += amanda/compress.m4
+EXTRA_DIST += amanda/config.m4
+EXTRA_DIST += amanda/debugging.m4
+EXTRA_DIST += amanda/defaults.m4
+EXTRA_DIST += amanda/devprefix.m4
+EXTRA_DIST += amanda/dirs.m4
+EXTRA_DIST += amanda/documentation.m4
+EXTRA_DIST += amanda/dumpers.m4
+EXTRA_DIST += amanda/flags.m4
+EXTRA_DIST += amanda/flock.m4
+EXTRA_DIST += amanda/funcs.m4
+EXTRA_DIST += amanda/getfsent.m4
+EXTRA_DIST += amanda/i18n.m4
+EXTRA_DIST += amanda/ipv6.m4
+EXTRA_DIST += amanda/krb4-security.m4
+EXTRA_DIST += amanda/krb5-security.m4
+EXTRA_DIST += amanda/lfs.m4
+EXTRA_DIST += amanda/libs.m4
+EXTRA_DIST += amanda/net.m4
+EXTRA_DIST += amanda/progs.m4
+EXTRA_DIST += amanda/readdir.m4
+EXTRA_DIST += amanda/readline.m4
+EXTRA_DIST += amanda/rsh-security.m4
+EXTRA_DIST += amanda/s3-device.m4
+EXTRA_DIST += amanda/shmem.m4
+EXTRA_DIST += amanda/ssh-security.m4
+EXTRA_DIST += amanda/summary.m4
+EXTRA_DIST += amanda/swig.m4
+EXTRA_DIST += amanda/syshacks.m4
+EXTRA_DIST += amanda/tape.m4
+EXTRA_DIST += amanda/types.m4
+EXTRA_DIST += amanda/userid.m4
+EXTRA_DIST += amanda/version.m4
diff --git a/config/amanda/flags.m4 b/config/amanda/flags.m4
new file mode 100644 (file)
index 0000000..ba20da9
--- /dev/null
@@ -0,0 +1,301 @@
+# OVERVIEW/BACKGROUND
+#
+#   This file manages flags in CFLAGS, CPPFLAGS, LDFLAGS, and LIBS.
+#
+#   Flags can come from two several sources:
+#    - entry to ./configure or on the configure command line (they are
+#      `precious' variables)
+#    - added by autoconf tests during the execution of configure
+#
+#   Although Automake supports overriding variables when invoking 'make',
+#   we don't support it (mostly because autoconf doesn't).  Instead, users
+#   should specify such variables when invoking ./configure.
+#
+#   CFLAGS are a little bit more complicated: Amanda has two categories,
+#   mandatory CFLAGS, which should be used everywhere, and warning CFLAGS,
+#   which are only used on Amanda code (not gnulib or yacc-generated code).
+#   To accomplish this, mandatory CFLAGS go directl into CFLAGS, while
+#   warwnings go in AMANDA_WARNING_CFLAGS; these are then added to 
+#   AM_CFLAGS by the Makefiles.
+
+# SYNOPSIS
+#
+#   AMANDA_INIT_FLAGS()
+#
+# DESCRIPTION
+#
+#   Process variables given by the user on the command line,
+#   either as environment variables:
+#      CPPFLAGS=-Dfoo ./configure ...
+#   as assignments in the configure command line:
+#      ./configure LIBS=-lfoo ...
+#   or with the deprecated flags --with-cflags, --with-includes, and
+#   --with-libraries
+#
+AC_DEFUN([AMANDA_INIT_FLAGS],
+[
+    # support deprecated ./configure flags to set various compiler flags
+
+    AC_ARG_WITH(cflags,
+       AS_HELP_STRING([--with-cflags=FLAGS],
+                      [deprecated; use ./configure CFLAGS=... ]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-cflags option.])
+               ;;
+           esac
+
+           CFLAGS="$withval"
+       ])
+
+    AC_ARG_WITH(includes,
+       AS_HELP_STRING([--with-includes=INCLUDE-DIRS],
+                      [deprecated; use ./configure CPPFLAGS='-I.. -I..']),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.])
+             ;;
+           esac
+
+           for dir in $withval; do
+               if test -d "$dir"; then
+                   CPPFLAGS="$CPPFLAGS -I$dir"
+               else
+                   AMANDA_MSG_WARN([Include directory $dir does not exist.])
+               fi
+           done
+       ])
+
+    AC_ARG_WITH(libraries,
+       AS_HELP_STRING([--with-libraries=LIBRARY-DIRS],
+                      [deprecated; use ./configure LDFLAGS='-L.. -L..' (add -R on Solaris, NetBSD)]),
+       [
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.])
+             ;;
+           esac
+
+           for dir in $withval; do
+               if test -d "$dir"; then
+                   case "$target" in
+                     *-solaris2*,*-netbsd*)
+                           LDFLAGS="$LDFLAGS -R$dir"
+                           ;;
+                   esac
+                   LDFLAGS="$LDFLAGS -L$dir"
+               else
+                   AMANDA_MSG_WARN([Library directory $dir does not exist.])
+               fi
+           done
+       ])
+
+    # Warn for just about everything
+    AMANDA_TEST_GCC_WARNING_FLAG(-Wall, [
+       AMANDA_ADD_WARNING_CFLAG(-Wall)
+    ])
+    
+    # And add any extra warnings too
+    AMANDA_TEST_GCC_WARNING_FLAG(-Wextra, [
+       AMANDA_ADD_WARNING_CFLAG(-Wextra)
+    ], [
+       AMANDA_TEST_GCC_WARNING_FLAG(-W, [
+           AMANDA_ADD_WARNING_CFLAG(-W)
+       ])
+    ])
+    AC_SUBST([AMANDA_WARNING_CFLAGS])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_STATIC_FLAGS(new_flags)
+#
+# DESCRIPTION
+#
+#   Set AMANDA_STATIC_LDFLAGS to -static if --enable-static-binary
+#
+AC_DEFUN([AMANDA_STATIC_FLAGS],
+[
+    AC_ARG_ENABLE(static-binary,
+       AS_HELP_STRING([--enable-static-binary],
+                      [To build statically linked binaries]),
+       [
+           case "$withval" in
+           "" | y | ye | yes)
+               AMANDA_STATIC_LDFLAGS=-static
+               if test x"$enable_static" = x"no"; then
+                       AC_MSG_ERROR([*** --enable-static-binary is incompatible with --disable-static])
+               fi
+               ;;
+           *n | no)
+               AMANDA_STATIC_LDFLAGS=
+               ;;
+           esac
+       ])
+    AC_SUBST([AMANDA_STATIC_LDFLAGS])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_CFLAGS(new_flags)
+#
+# DESCRIPTION
+#
+#   Add 'new_flags' to CFLAGS.
+#
+#   'new_flags' will be enclosed in double quotes in the resulting
+#   shell assignment.
+#
+AC_DEFUN([AMANDA_ADD_CFLAGS],
+    [CFLAGS="$CFLAGS $1"]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_CPPFLAGS(new_flags)
+#
+# DESCRIPTION
+#
+#   Add 'new_flags' to CPPFLAGS.
+#
+#   'new_flags' will be enclosed in double quotes in the resulting
+#   shell assignment.
+#
+AC_DEFUN([AMANDA_ADD_CPPFLAGS],
+    [CPPFLAGS="$CPPFLAGS $1"]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_LDFLAGS(new_flags)
+#
+# DESCRIPTION
+#
+#   Add 'new_flags' to LDFLAGS.
+#
+#   'new_flags' will be enclosed in double quotes in the resulting
+#   shell assignment.
+#
+AC_DEFUN([AMANDA_ADD_LDFLAGS],
+    [LDFLAGS="$LDFLAGS $1"]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_LIBS(new_flags)
+#
+# DESCRIPTION
+#
+#   Add 'new_flags' to LIBS.
+#
+#   'new_flags' will be enclosed in double quotes in the resulting
+#   shell assignment.
+#
+AC_DEFUN([AMANDA_ADD_LIBS],
+    [LIBS="$1 $LIBS"]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_WARNING_CFLAG(flag)
+#
+# DESCRIPTION
+#
+#   Add 'flag' to AMANDA_WARNING_CFLAGS
+#
+AC_DEFUN([AMANDA_ADD_WARNING_CFLAG],
+    [AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS $1"]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_ENABLE_GCC_WARNING(warning)
+#
+# OVERVIEW
+#
+#   Enable warning 'warning' by adding flag -W'warning' to 
+#   AMANDA_WARNING_CFLAGS.
+#
+AC_DEFUN([AMANDA_ENABLE_GCC_WARNING],
+[
+    AMANDA_TEST_GCC_WARNING_FLAG(-W$1,
+    [
+       AMANDA_ADD_WARNING_CFLAG(-W$1)
+    ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_DISABLE_GCC_WARNING(warning)
+#
+# OVERVIEW
+#
+#   Disable warning 'warning' by adding flag -Wno-'warning' to 
+#   AMANDA_WARNING_CFLAGS.
+#
+AC_DEFUN([AMANDA_DISABLE_GCC_WARNING],
+[
+    # test for -W'warning', then add the 'no-' version.
+    AMANDA_TEST_GCC_WARNING_FLAG(-W$1,
+    [
+       AMANDA_ADD_WARNING_CFLAG(-Wno-$1)
+    ])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_TEST_GCC_WARNING_FLAG(flag, action-if-found, action-if-not-found)
+#
+# OVERVIEW
+#
+#   See if CC is gcc, and if gcc -v --help contains the given flag.  If so,
+#   run action-if-found; otherwise, run action-if-not-found.
+#
+#   Intended for internal use in this file.
+#
+AC_DEFUN([AMANDA_TEST_GCC_WARNING_FLAG],
+[
+    AC_REQUIRE([AC_PROG_CC])
+    AC_REQUIRE([AC_PROG_EGREP])
+    AC_MSG_CHECKING(for gcc flag $1)
+    if test "x$GCC" = "xyes"; then
+       changequote(,)dnl
+       $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]$1[^[:alnum:]-]' 2>&1 > /dev/null
+       changequote([,])dnl
+       if test $? -eq 0; then
+           found_warning=yes
+           AC_MSG_RESULT(yes)
+       else
+           found_warning=no
+           AC_MSG_RESULT(no)
+       fi
+    else
+       found_warning=no
+       AC_MSG_RESULT(no (not using gcc))
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       ifelse($2, [], [:], $2)
+    else
+       ifelse($3, [], [:], $3)
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_FLAGS_SUMMARY
+#
+# OVERVIEW
+#
+#   Show a summary of the flags with which Amanda was configured
+#
+AC_DEFUN([AMANDA_SHOW_FLAGS_SUMMARY],
+[
+    echo "Compiler Flags:"
+    echo "  CFLAGS: ${CFLAGS-(none)}"
+    echo "  CPPFLAGS: ${CPPFLAGS-(none)}"
+    echo "  LDFLAGS: ${LDFLAGS-(none)}"
+    echo "  LIBS: ${LIBS-(none)}"
+])
diff --git a/config/amanda/flock.m4 b/config/amanda/flock.m4
new file mode 100644 (file)
index 0000000..9850a5b
--- /dev/null
@@ -0,0 +1,145 @@
+# SYNOPSIS
+#
+#   AMANDA_SETUP_FILE_LOCKING
+#
+# OVERVIEW
+#
+#   Set up file locking support.  Four types of locking are available:
+#     USE_POSIX_FCNTL - use fcntl().  The full job.
+#     USE_FLOCK       - use flock().  Does just as well.
+#     USE_LOCKF       - use lockf().  Only handles advisory, exclusive,
+#                       blocking file locks as used by Amanda.
+#     USE_LNLOCK      - Home brew exclusive, blocking file lock.
+#     <none>          - No locking available.  User beware!
+#   One of given symbols are defined if the method is discovered to
+#   be available; the methods are searched in the above order.
+#
+AC_DEFUN([AMANDA_SETUP_FILE_LOCKING],
+[
+    AC_CHECK_HEADERS(
+        fcntl.h \
+        sys/fcntl.h \
+       sys/types.h \
+       sys/file.h \
+       unistd.h \
+    )
+
+    # find a working file-locking mechanism.
+    # Note: these all use AC_TRY_LINK to make sure that we can compile
+    # and link each variant.  They do not try to test the variants --
+    # that is left to runtime.
+    WORKING_FILE_LOCK="no"
+
+    # check POSIX locking
+    AC_CACHE_CHECK(
+       [whether POSIX locking (with fcntl(2)) is available],
+       amanda_cv_posix_filelocking,
+       [
+           AC_TRY_LINK([
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+           ], [
+           struct flock lock;
+
+           lock.l_type = F_RDLCK;
+           lock.l_start = 0;
+           lock.l_whence = SEEK_CUR;
+           lock.l_len = 0;
+           return fcntl(1, F_SETLK, &lock);
+           ], [
+       amanda_cv_posix_filelocking="yes"
+           ],[
+       amanda_cv_posix_filelocking="no"
+           ])
+       ])
+    if test "x$amanda_cv_posix_filelocking" = xyes; then
+       AC_DEFINE(WANT_AMFLOCK_POSIX,1,[Define to use POSIX (fcntl()) for file locking])
+       WANT_AMFLOCK_POSIX="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+    AM_CONDITIONAL(WANT_AMFLOCK_POSIX, test x"$WANT_AMFLOCK_POSIX" = x"yes")
+
+    # check flock-based (BSD) locking
+    AC_CACHE_CHECK(
+       [whether flock locking is available],
+       amanda_cv_flock_filelocking,
+       [
+           AC_TRY_LINK([
+#if HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+           ], [
+           return flock(1, LOCK_SH);
+           ], [
+       amanda_cv_flock_filelocking="yes"
+           ],[
+       amanda_cv_flock_filelocking="no"
+           ])
+       ])
+    if test "x$amanda_cv_flock_filelocking" = xyes; then
+       AC_DEFINE(WANT_AMFLOCK_FLOCK,1,[Define to use flock(2) for file locking])
+       WANT_AMFLOCK_FLOCK="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+    AM_CONDITIONAL(WANT_AMFLOCK_FLOCK, test x"$WANT_AMFLOCK_FLOCK" = x"yes")
+
+    # check lockf-based (SVR2, SVR3, SVR4) locking
+    AC_CACHE_CHECK(
+       [whether lockf(3) locking is available],
+       amanda_cv_lockf_filelocking,
+       [
+           AC_TRY_LINK([
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+           ], [
+           return lockf(1, F_LOCK, 0);
+           ], [
+       amanda_cv_lockf_filelocking="yes"
+           ],[
+       amanda_cv_lockf_filelocking="no"
+           ])
+       ])
+    if test "x$amanda_cv_lockf_filelocking" = xyes; then
+       AC_DEFINE(WANT_AMFLOCK_LOCKF,1,[Define to use lockf(3) for file locking.])
+       WANT_AMFLOCK_LOCKF="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+    AM_CONDITIONAL(WANT_AMFLOCK_LOCKF, test x"$WANT_AMFLOCK_LOCKF" = x"yes")
+
+    # check our homebrew hardlink-based locking (requires hardlinks)
+    AC_CACHE_CHECK(
+       [whether link(2) is available for locking],
+       amanda_cv_lnlock_filelocking,
+       [
+           AC_TRY_LINK([
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+           ], [
+           return link("/tmp/foo", "/tmp/bar");
+           ], [
+       amanda_cv_lnlock_filelocking="yes"
+           ],[
+       amanda_cv_lnlock_filelocking="no"
+           ])
+       ])
+    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
+       AC_DEFINE(WANT_AMFLOCK_LNLOCK,1,[Define to use link(2) to emulate file locking.])
+       WANT_AMFLOCK_LNLOCK="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+    AM_CONDITIONAL(WANT_AMFLOCK_LNLOCK, test x"$WANT_AMFLOCK_LNLOCK" = x"yes")
+
+    if test x"$WORKING_FILE_LOCK" = "no"; then
+       # this shouldn't happen, and is *bad* if it does
+       AC_MSG_ERROR([*** No working file locking capability found!])
+    fi
+])
diff --git a/config/amanda/funcs.m4 b/config/amanda/funcs.m4
new file mode 100644 (file)
index 0000000..862bac8
--- /dev/null
@@ -0,0 +1,266 @@
+# SYNOPSIS
+#
+#   AMANDA_FUNC_SELECT_ARG_TYPE
+# 
+# OVERVIEW
+#
+#   Figure out the select() argument type.  DEFINEs SELECT_ARG_TYPE.
+#
+AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
+    [
+       AC_REQUIRE([AC_HEADER_TIME])
+       AC_CHECK_HEADERS(
+           sys/time.h \
+           sys/types.h \
+           sys/select.h \
+           sys/socket.h \
+           unistd.h \
+       )
+
+       AC_CACHE_CHECK(
+           [for select() argument type],
+           amanda_cv_select_arg_type,
+           [
+               rm -f conftest.c
+               cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+int main()
+{
+#ifdef FD_SET_POINTER
+       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
+#else
+       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
+#endif
+       return 0;
+}
+EOF
+
+               # Figure out the select argument type by first trying to
+               # compile with the fd_set argument.  If the compile fails,
+               # then we know to use the int.  If it suceeds, then try to
+               # use the int.  If the int fails, then use fd_set.  If
+               # both suceeed, then do a line count on the number of
+               # lines that the compiler spit out, assuming that the
+               # compile outputing more lines had more errors.
+               amanda_cv_select_arg_type=no
+               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
+               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
+               if test $? -ne 0; then
+                   amanda_cv_select_arg_type=int
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
+                   if test $? -ne 0; then
+                       amanda_cv_select_arg_type=fd_set
+                   fi
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   wc_fdset=`wc -l <conftest.fd_set`
+                   wc_int=`wc -l <conftest.int`
+                   if test "$wc_fdset" -le "$wc_int"; then
+                       amanda_cv_select_arg_type=fd_set
+                   else
+                       amanda_cv_select_arg_type=int
+                   fi
+               fi
+               rm -f conftest*
+           ]
+       )
+       AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
+    ]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO
+#
+# OVERVIEW
+#
+#   Check if setsockopt can use the SO_SNDTIMEO option.
+#   This defines HAVE_SO_SNDTIMEO if setsockopt works with SO_SNDTIMEO.
+#
+AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
+    [
+       AC_REQUIRE([AC_HEADER_TIME])
+       AC_CHECK_HEADERS(
+           time.h
+           sys/time.h
+       )
+
+       AC_CACHE_CHECK(
+           [for setsockopt SO_SNDTIMEO option],
+           amanda_cv_setsockopt_SO_SNDTIMEO,
+           [
+               AC_TRY_RUN(
+                   [
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
+
+main() {
+#ifdef SO_SNDTIMEO
+    int sock = socket(AF_INET, SOCK_STREAM, 0);
+    struct timeval timeout;
+    timeout.tv_sec = 1;
+    timeout.tv_usec = 0;
+    return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
+             (void *)&timeout, sizeof(timeout)));
+#else
+    return -1;
+#endif
+}
+                   ],
+                   amanda_cv_setsockopt_SO_SNDTIMEO=yes,
+                   amanda_cv_setsockopt_SO_SNDTIMEO=no,
+                   amanda_cv_setsockopt_SO_SNDTIMEO=no
+               )
+           ]
+       )
+       if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
+           AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
+       fi
+    ]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_FUNC_GETTIMEOFDAY_ARGS
+#
+# OVERVIEW
+#
+#   Check for the one or two argument version of gettimeofday.  DEFINEs
+#   HAVE_TWO_ARG_GETTIMEOFDAY if the two argument version is present.
+#
+AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
+    [
+       AC_REQUIRE([AC_HEADER_TIME])
+       AC_CHECK_HEADERS(
+           time.h
+           sys/time.h
+       )
+
+       AC_CACHE_CHECK(
+           [for gettimeofday number of arguments],
+           amanda_cv_gettimeofday_args,
+           [
+               AC_TRY_COMPILE(
+                   [
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
+                   ],
+                   [
+                       struct timeval val;
+                       struct timezone zone;
+                       gettimeofday(&val, &zone);
+                   ],
+                   amanda_cv_gettimeofday_args=2,
+                   amanda_cv_gettimeofday_args=1
+               )
+           ]
+       )
+       if test "$amanda_cv_gettimeofday_args" = 2; then
+           AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
+       fi
+    ]
+)
+
+# SYNOPSIS
+#
+#   ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
+#
+# OVERVIEW
+#
+#   If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
+#   in one of the headers named in the whitespace-separated list 
+#   HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
+#
+AC_DEFUN([ICE_CHECK_DECL],
+[
+ice_have_$1=no
+AC_CHECK_FUNCS($1, ice_have_$1=yes)
+if test "${ice_have_$1}" = yes; then
+AC_MSG_CHECKING(for $1 declaration in $2)
+AC_CACHE_VAL(ice_cv_have_$1_decl,
+[
+ice_cv_have_$1_decl=no
+changequote(,)dnl
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+changequote([,])dnl
+for header in $2; do
+# Check for ordinary declaration
+AC_EGREP_HEADER([${ice_re_word}$1[     ]*\(], $header, 
+       ice_cv_have_$1_decl=yes)
+if test "$ice_cv_have_$1_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+AC_EGREP_HEADER([${ice_re_word}$1[     ]*$ice_re_params\(\(], $header, 
+       ice_cv_have_$1_decl=yes)
+if test "$ice_cv_have_$1_decl" = yes; then
+       break
+fi
+done
+])
+AC_MSG_RESULT($ice_cv_have_$1_decl)
+if test "$ice_cv_have_$1_decl" = yes; then
+AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
+fi
+fi
+])dnl
+
+# SYNOPSIS
+#
+#   AMANDA_FUNC_SETPGID
+#
+# OVERVIEW
+#
+#   Search for the function HAVE_SETPGID, and run an ICE_CHECK_DECL on it if so.
+#
+AC_DEFUN([AMANDA_FUNC_SETPGID],
+[
+    AC_CHECK_FUNC(setpgid, [
+       AC_DEFINE(HAVE_SETPGID,1,[Define if setpgid() is available. ])
+       ICE_CHECK_DECL(setpgid,sys/types.h unistd.h)
+    ])
+])
diff --git a/config/amanda/getfsent.m4 b/config/amanda/getfsent.m4
new file mode 100644 (file)
index 0000000..a45d75e
--- /dev/null
@@ -0,0 +1,19 @@
+# SYNOPSIS
+#
+#   AMANDA_SETUP_GETFSENT
+#
+# OVERVIEW
+#
+#   Checks for support for client-src/getfsent.c
+#
+AC_DEFUN([AMANDA_SETUP_GETFSENT], [
+    AC_CHECK_HEADERS(
+       fstab.h \
+       mntent.h \
+       mnttab.h \
+       sys/vfstab.h \
+    )
+
+    AC_CHECK_FUNCS(endmntent)
+    AC_CHECK_FUNCS(setmntent)
+])
diff --git a/config/amanda/i18n.m4 b/config/amanda/i18n.m4
new file mode 100644 (file)
index 0000000..fc55d70
--- /dev/null
@@ -0,0 +1,26 @@
+# SYNOPSIS
+#
+#   AMANDA_SETUP_I18N
+#
+# OVERVIEW
+#
+#   Set up Amanda's internationalization support.  Note that configure.in
+#   itself must contain (not indented):
+#
+#   AM_GNU_GETTEXT_VERSION([0.15])
+#   AM_GNU_GETTEXT([external])
+#
+AC_DEFUN([AMANDA_SETUP_I18N], [
+    # FreeBSD needs to link libxpg4
+    AC_CHECK_LIB(xpg4, setlocale)
+
+    # ------------------------------------------------------------------
+    # All list of languages for which a translation exist. Each
+    #  language is separated by a space.
+    # ------------------------------------------------------------------
+    ALL_LINGUAS=""
+
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(MSGFMT, msgfmt,,$LOCSYSPATH)
+    AC_PATH_PROG(GETTEXT,gettext,,$LOCSYSPATH)
+])
diff --git a/config/amanda/ipv6.m4 b/config/amanda/ipv6.m4
new file mode 100644 (file)
index 0000000..c3c1776
--- /dev/null
@@ -0,0 +1,151 @@
+#
+# Checks to see if there's a sockaddr_storage structure
+#
+# usage:
+#
+#      AMANDA_SOCKADDR_STORAGE
+#
+# results:
+#
+#      HAVE_SOCKADDR_STORAGE (defined)
+#
+AC_DEFUN([AMANDA_SOCKADDR_STORAGE],
+[
+    AC_CACHE_CHECK([if sockaddr_storage struct exists],
+       ac_cv_has_sockaddr_storage,
+    [
+       AC_TRY_COMPILE([
+#      include <sys/types.h>
+#      include <sys/socket.h>],
+       [u_int i = sizeof (struct sockaddr_storage)],
+       ac_cv_has_sockaddr_storage=yes,
+       ac_cv_has_sockaddr_storage=no)
+    ])
+
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+       AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,
+           [struct sockaddr_storage exists])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_IPV6
+#
+# DESCRIPTION
+#
+#   Determine if this system has basic IPv6 support.  This 
+#   addresse general availability (defining WORKING_IPV6 if
+#   there's some amount of compatibility there), as well as
+#   searching for specific functionality by requiring the other
+#   macros in this file.
+#   
+AC_DEFUN([AMANDA_CHECK_IPV6],
+[
+    AC_REQUIRE([AMANDA_SOCKADDR_STORAGE])
+
+    WORKING_IPV6=no
+    AC_ARG_WITH(ipv6,
+       AS_HELP_STRING([--with-ipv6],
+                      [enable IPv6 support (default if IPv6 is found)])
+       AS_HELP_STRING([--without-ipv6],
+                      [disable IPv6]),
+       [
+           case "$withval" in
+           y | ye | yes) amanda_with_ipv6=yes;;
+           n | no) amanda_with_ipv6=no;;
+           *)
+               AC_MSG_ERROR([*** You must not supply an argument to --with-ipv6 option.])
+             ;;
+           esac
+       ], [
+           amanda_with_ipv6=maybe
+       ]
+    )
+
+    if test x"$amanda_with_ipv6" = x"yes" ||
+       test x"$amanda_with_ipv6" = x"maybe" ; then
+       AC_CACHE_CHECK([for working IPv6],
+                      amanda_cv_working_ipv6,
+       [
+           case "$target" in
+               *-pc-cygwin) amanda_cv_working_ipv6=no;;
+               *)
+                   AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <sys/socket.h>
+#include <errno.h>
+
+main()
+{
+   int aa;
+   aa = socket(AF_INET6, SOCK_STREAM, 0);
+   if (aa > 0) return 0;
+   return aa;
+}]])],
+    [ amanda_cv_working_ipv6=yes ],
+    [ amanda_cv_working_ipv6=no ],
+    [ amanda_cv_working_ipv6=yes ]
+               )
+           esac
+       ])
+
+       if test "$amanda_cv_working_ipv6" = yes; then
+           WORKING_IPV6=yes
+           AC_DEFINE(WORKING_IPV6,1,
+               [Target system has functional IPv6 support])
+       else
+           # error out only if the user specifically requested support
+           if test x"$amanda_with_ipv6" = x"yes"; then
+               AC_MSG_ERROR([IPv6 support was requested, but it is not working.])
+           fi
+       fi
+    fi
+])
+
+#
+# Checks to see if there's a sockaddr_storage structure
+#
+# usage:
+#
+#      AC_SOCKADDR_STORAGE
+#
+# results:
+#
+#      HAVE_SOCKADDR_STORAGE (defined)
+#
+AC_DEFUN([AC_SOCKADDR_STORAGE],
+    [AC_MSG_CHECKING(if sockaddr_storage struct exists)
+    AC_CACHE_VAL(ac_cv_has_sockaddr_storage,
+       AC_TRY_COMPILE([
+#      include <sys/types.h>
+#      include <sys/socket.h>],
+       [u_int i = sizeof (struct sockaddr_storage)],
+       ac_cv_has_sockaddr_storage=yes,
+       ac_cv_has_sockaddr_storage=no))
+    AC_MSG_RESULT($ac_cv_has_sockaddr_storage)
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+           AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists])
+    fi])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_IPV6_SUMMARY
+#
+# OVERVIEW
+#
+#   Show a summary of the settings from this file.
+#
+AC_DEFUN([AMANDA_SHOW_IPV6_SUMMARY],
+[
+    echo "Working IPv6:" $WORKING_IPV6
+])
diff --git a/config/amanda/krb4-security.m4 b/config/amanda/krb4-security.m4
new file mode 100644 (file)
index 0000000..68f5416
--- /dev/null
@@ -0,0 +1,234 @@
+# SYNOPSIS
+#
+#   AMANDA_KRB4_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for KRB4 security, implementing the --with-krb4-security
+#   option.  If libraries are found, they are added to the relevant compiler flags.
+#
+#   Defines KRB4_SECURITY, and sets AM_CONDITIONAL WANT_KRB4_SECURITY,
+#   if the user has selected this mechanism.  Also, the following parameters
+#   are taken from options and defined:
+#
+#    - SERVER_HOST_PRINCIPAL
+#    - SERVER_HOST_INSTANCE
+#    - SERVER_HOST_KEY_FILE
+#    - CLIENT_HOST_PRINCIPAL
+#    - CLIENT_HOST_INSTANCE
+#    - CLIENT_HOST_KEY_FILE
+#    - TICKET_LIFETIME
+#
+AC_DEFUN([AMANDA_KRB4_SECURITY],
+[
+    # Specify --with-krb4-security if Kerberos software is in somewhere
+    # other than the listed KRB4_SPOTS.  We only compile kerberos support in
+    # if the right files are there.
+
+    : ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+    KRB4_SECURITY="no"
+    AC_ARG_WITH(krb4-security,
+        AS_HELP_STRING([--with-krb4-security=DIR],
+            [Location of Kerberos software @<:@/usr/kerberos /usr/cygnus /usr /opt/kerberos@:>@]),
+        [
+            case "$withval" in
+                n | no) ;;
+                y | ye | yes) KRB4_SECURITY="yes" ;;
+                *) KRB4_SPOTS="$KRB4_SECURITY"
+                   KRB4_SECURITY="yes"
+                   ;;
+            esac
+        ],
+    )
+
+    # check the remaining, subsidiary options
+
+    AC_MSG_CHECKING([host principal])
+    AC_ARG_WITH(server-principal,
+        AS_HELP_STRING([ --with-server-principal=ARG],
+            [server host principal ("amanda")]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-server-principal option.])
+                  ;;
+                *) SERVER_HOST_PRINCIPAL="$withval" ;;
+            esac
+        ],
+        [ : ${SERVER_HOST_PRINCIPAL="amanda"} ]
+    )
+    AC_MSG_RESULT($SERVER_HOST_PRINCIPAL)
+
+    AC_MSG_CHECKING([server host instance])
+    AC_ARG_WITH(server-instance,
+        AS_HELP_STRING([ --with-server-instance=ARG],
+            [server host instance ("amanda")]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-server-instance option.])
+                  ;;
+                *) SERVER_HOST_INSTANCE="$withval" ;;
+            esac
+        ],
+        [ : ${SERVER_HOST_INSTANCE="amanda"} ]
+    )
+    AC_MSG_RESULT($SERVER_HOST_INSTANCE)
+
+    AC_MSG_CHECKING([server host key file])
+    AC_ARG_WITH(server-keyfile,
+        AS_HELP_STRING([ --with-server-keyfile=ARG],
+            [server host key file ("/.amanda")]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-server-keyfile option.])
+                  ;;
+                *) SERVER_HOST_KEY_FILE="$withval" ;;
+            esac
+        ],
+        [ : ${SERVER_HOST_KEY_FILE="/.amanda"} ]
+    )
+    AC_MSG_RESULT($SERVER_HOST_KEY_FILE)
+
+    AC_MSG_CHECKING(client host principle)
+    AC_ARG_WITH(client-principal,
+        AS_HELP_STRING([ --with-client-principal=ARG],
+            [client host principle ("rcmd")]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-client-principal option.])
+                  ;;
+                *) CLIENT_HOST_PRINCIPAL="$withval" ;;
+            esac
+        ],
+        [ : ${CLIENT_HOST_PRINCIPAL="rcmd"} ]
+    )
+    AC_MSG_RESULT($CLIENT_HOST_PRINCIPAL)
+
+    AC_MSG_CHECKING([client host instance])
+    AC_ARG_WITH(client-instance,
+        AS_HELP_STRING([ --with-client-instance=ARG],
+            [client host instance (HOSTNAME_INSTANCE)]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-client-instance option.])
+                  ;;
+                *) CLIENT_HOST_INSTANCE="$withval" ;;
+            esac
+        ],
+        [ : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE} ]
+    )
+    AC_MSG_RESULT($CLIENT_HOST_INSTANCE)
+
+    AC_MSG_CHECKING([client host key file])
+    AC_ARG_WITH(client-keyfile,
+        AS_HELP_STRING([ --with-client-keyfile=ARG],
+            [client host key file (KEYFILE)]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-client-keyfile option.])
+                  ;;
+                *) CLIENT_HOST_KEY_FILE="$withval" ;;
+            esac
+        ],
+        [ : ${CLIENT_HOST_KEY_FILE=KEYFILE} ]
+    )
+    # Assume it's either KEYFILE (defined in krb.h), or a string filename...
+    if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
+      # add quotes
+      CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
+    fi
+    AC_MSG_RESULT($CLIENT_HOST_KEY_FILE)
+
+    AC_MSG_CHECKING([ticket lifetime])
+    AC_ARG_WITH(ticket-lifetime,
+        AS_HELP_STRING([ --ticket-lifetime],
+            [ticket lifetime (128)]),
+        [
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+                AC_MSG_ERROR([*** You must supply an argument to the --with-ticket-lifetime option.])
+              ;;
+            *) TICKET_LIFETIME="$withval" ;;
+            esac
+        ],
+        [ : ${TICKET_LIFETIME=128} ]
+    )
+    AC_MSG_RESULT($TICKET_LIFETIME)
+
+
+    if test "x${KRB4_SECURITY}" = "xyes"; then
+        AC_MSG_CHECKING(for Kerberos and Amanda kerberos4 bits)
+        found="no"
+        for dir in $KRB4_SPOTS; do
+            if test \( -f ${dir}/lib/libkrb.a -o -f ${dir}/lib/libkrb.so \) -a \( -f ${dir}/lib/libdes.a -o -f ${dir}/lib/libdes.so \) ; then
+                #
+                # This is the original Kerberos 4.
+                #
+                AC_MSG_RESULT(found in $dir)
+                found="yes"
+
+                #
+                # This handles BSD/OS.
+                #
+                if test -d $dir/include/kerberosIV ; then
+                    AMANDA_ADD_CPPFLAGS([-I$dir/include/kerberosIV])
+                else
+                    AMANDA_ADD_CPPFLAGS([-I$dir/include])
+                fi
+                AMANDA_ADD_LDFLAGS([-L$dir/lib])
+                AMANDA_ADD_LIBS([-lkrb -ldes])
+                if test -f ${dir}/lib/libcom_err.a; then
+                    AMANDA_ADD_LIBS([-lcom_err])
+                fi
+                break
+            elif test \( -f ${dir}/lib/libkrb4.a -o -f ${dir}/lib/libkrb4.so \) &&
+                 test \( -f ${dir}/lib/libcrypto.a -o -f ${dir}/lib/libcrypto.so \) &&
+                 test \( -f ${dir}/lib/libdes425.a -o -f ${dir}/lib/libdes425.so \) ; then
+                #
+                # This is Kerberos 5 with Kerberos 4 back-support.
+                #
+                AC_MSG_RESULT(found in $dir)
+                found="yes"
+                AMANDA_ADD_CPPFLAGS([-I$dir/include -I$dir/include/kerberosIV])
+                AMANDA_ADD_LDFLAGS([-L$dir/lib])
+                if test \( -f ${dir}/lib/libkrb5.a -o -f ${dir}/lib/libkrb5.so \) &&
+                   test \( -f ${dir}/lib/libcom_err.a -o -f ${dir}/lib/libcom_err.so \) ; then
+                    AMANDA_ADD_LIBS([-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err])
+                else
+                    AMANDA_ADD_LIBS([-lkrb4 -lcrypto -ldes425])
+                fi
+                break
+            fi
+        done
+
+        if test "x$found" = "xno" ; then
+            AC_MSG_RESULT(no libraries found)
+            AMANDA_MSG_WARN([No Kerberos IV libraries were found on your system; disabling krb4-security])
+            KRB4_SECURITY="no"
+        else
+            AC_DEFINE(KRB4_SECURITY, 1, 
+                [Enable Kerberos IV security.])
+            AC_DEFINE_UNQUOTED(SERVER_HOST_PRINCIPAL,"$SERVER_HOST_PRINCIPAL",
+                    [The Kerberos server principal. ])
+            AC_DEFINE_UNQUOTED(SERVER_HOST_INSTANCE,"$SERVER_HOST_INSTANCE",
+                    [The Kerberos server instance. ])
+            AC_DEFINE_UNQUOTED(SERVER_HOST_KEY_FILE,"$SERVER_HOST_KEY_FILE",
+                    [The Kerberos server key file. ])
+            AC_DEFINE_UNQUOTED(CLIENT_HOST_PRINCIPAL,"$CLIENT_HOST_PRINCIPAL",
+                    [The Kerberos client host principal. ])
+            AC_DEFINE_UNQUOTED(CLIENT_HOST_INSTANCE,$CLIENT_HOST_INSTANCE,
+                    [The Kerberos client host instance. ])
+            AC_DEFINE_UNQUOTED(CLIENT_HOST_KEY_FILE,$CLIENT_HOST_KEY_FILE,
+                    [The Kerberos client host key file. ])
+            AC_DEFINE_UNQUOTED(TICKET_LIFETIME,$TICKET_LIFETIME,
+                    [The Kerberos ticket lifetime. ])
+        fi
+    fi
+    AM_CONDITIONAL(WANT_KRB4_SECURITY, test x"$KRB4_SECURITY" = x"yes")
+])
diff --git a/config/amanda/krb5-security.m4 b/config/amanda/krb5-security.m4
new file mode 100644 (file)
index 0000000..1cf0d7a
--- /dev/null
@@ -0,0 +1,105 @@
+# SYNOPSIS
+#
+#   AMANDA_KRB5_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for KRB5 security, implementing the --with-krb5-security
+#   option.  If libraries are found, they are added to the relevant compiler flags.
+#
+#   Defines KRB5_SECURITY, and sets AM_CONDITIONAL WANT_KRB5_SECURITY,
+#   if the user has selected this mechanism.  Also, the following parameters
+#   are taken from options and defined:
+#
+#    - SERVER_HOST_PRINCIPAL
+#    - SERVER_HOST_INSTANCE
+#    - SERVER_HOST_KEY_FILE
+#    - CLIENT_HOST_PRINCIPAL
+#    - CLIENT_HOST_INSTANCE
+#    - CLIENT_HOST_KEY_FILE
+#    - TICKET_LIFETIME
+#
+AC_DEFUN([AMANDA_KRB5_SECURITY],
+[
+    # Specify --with-krb5-security if Kerberos software is in somewhere
+    # other than the listed KRB5_SPOTS.  We only compile kerberos support in
+    # if the right files are there.
+
+    KRB5_SECURITY="no"
+    : ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+    AC_ARG_WITH(krb5-security,
+        AS_HELP_STRING([--with-krb5-security=DIR],
+            [Location of Kerberos V software @<:@/usr/kerberos /usr/cygnus /usr /opt/kerberos@:>@]),
+        [
+            case "$withval" in
+                n | no) KRB5_SECURITY=no ;;
+                y | ye | yes) KRB5_SECURITY=yes ;;
+                *) KRB5_SPOTS="$KRB5_SECURITY"
+                   KRB5_SECURITY=yes
+                   ;;
+            esac
+        ]
+    )
+
+    if test "x$KRB5_SECURITY" = "xyes"; then
+        # if found, force the static versions of these libs (.a) by linking directly
+        # with the .a files.  I don't know how to get -R dependancies checked
+        # in autoconf at this time. -kashmir
+        AC_MSG_CHECKING(for Kerberos V libraries)
+        KRB5_DIR_FOUND=""
+        for dir in $KRB5_SPOTS; do
+          for lib in lib lib64; do
+            k5libdir=${dir}/${lib}
+            if test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libgssapi_krb5.so -o -f ${k5libdir}/libgssapi_krb5.a \) -a \( -f ${k5libdir}/libcom_err.a -o -f ${k5libdir}/libcom_err.so \); then
+                if test -f ${k5libdir}/libk5crypto.a -o -f ${k5libdir}/libk5crypto.so; then
+                    K5CRYPTO=-lk5crypto
+                elif test -f ${k5libdir}/libcrypto.a -o -f ${k5libdir}/libcrypto.so; then
+                    K5CRYPTO=-lcrypto
+                else
+                    K5CRYPTO=""
+                fi
+                if test -f ${k5libdir}/libkrb5support.a -o -f ${k5libdir}/libkrb5support.so; then
+                    K5SUPPORT=-lkrb5support
+                else
+                    K5SUPPORT=""
+                fi
+                KRB5_DIR_FOUND=$dir
+                KRB5_LIBDIR_FOUND=$k5libdir
+                AMANDA_ADD_LIBS([-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err])
+                break
+            elif test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libasn1.a -o -f ${k5libdir}/libasn1.so \) -a \( -f ${k5libdir}/libgssapi.a -o -f ${k5libdir}/libgssapi.so \); then
+                AMANDA_ADD_LIBS([-lgssapi -lkrb5 -lasn1])
+                AMANDA_ADD_CPPFLAGS([-DKRB5_HEIMDAL_INCLUDES])
+                break
+            fi
+          done
+        done
+
+        if test "$KRB5_DIR_FOUND"; then
+            AC_MSG_RESULT(found in $KRB5_DIR_FOUND)
+            #
+            # some OS's, such as NetBSD, stick krb5 includes out of the way...
+            # should probably just use autoconf to look for various include
+            # options and set them, but don't quite want to do that until I've
+            # dug into it a bit more.
+            #
+            if test -d "$KRB5_DIR_FOUND/krb5" ; then
+                AMANDA_ADD_CPPFLAGS([-I$KRB5_DIR_FOUND/include/krb5])
+            else
+                AMANDA_ADD_CPPFLAGS([-I$KRB5_DIR_FOUND/include])
+            fi
+                AC_CHECK_LIB(krb5support,main)
+            AMANDA_ADD_LDFLAGS([-L$KRB5_LIBDIR_FOUND])
+
+            AC_DEFINE(KRB5_SECURITY,1,
+                [Define if Kerberos 5 security is to be enabled. ])
+        else
+            AC_MSG_RESULT(no krb5 system libraries found)
+            AC_MSG_ERROR([No Kerberos V libraries were found on your system; krb5-security cannot be enabled])
+            KRB5_SECURITY="no"
+        fi
+    fi
+
+    AM_CONDITIONAL(WANT_KRB5_SECURITY, test x"$KRB5_SECURITY" = x"yes")
+])
diff --git a/config/amanda/lfs.m4 b/config/amanda/lfs.m4
new file mode 100644 (file)
index 0000000..0de6a66
--- /dev/null
@@ -0,0 +1,75 @@
+# SYNOPSIS
+#
+#   AMANDA_SETUP_LFS
+#
+# OVERVIEW
+#
+#   Set up for large file suport on this system.  Besides adding compiler flags,
+#   defines NEED_RESETOFS if the tape device's offset must be reset before it reaches
+#   2GB (a Linux kernel bug in systems without LFS support).
+#
+AC_DEFUN([AMANDA_SETUP_LFS],
+[
+    AC_REQUIRE([AMANDA_PROG_GETCONF])
+    AC_REQUIRE([AC_SYS_LARGEFILE])
+
+    # we use 'getconf', if it exists, to get the relevant
+    # compiler flags.
+    GETCONF_LFS="LFS"
+    case "$target" in
+        *-hp-*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
+        *-ibm-aix*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
+    esac
+
+    # Checks for compilers, typedefs, structures, and compiler characteristics.
+    # Check for large file compilation environment.
+    NEED_RESETOFS=yes
+    AC_CACHE_CHECK([for large file compilation CFLAGS],
+        amanda_cv_LFS_CFLAGS,
+        [
+        amanda_cv_LFS_CFLAGS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
+                amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
+        ]
+    )
+    AMANDA_ADD_CFLAGS([$amanda_cv_LFS_CFLAGS])
+
+    AC_CACHE_CHECK(
+        [for large file compilation LDFLAGS],
+        amanda_cv_LFS_LDFLAGS,
+        [
+        amanda_cv_LFS_LDFLAGS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
+                amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
+        ]
+    )
+    AMANDA_ADD_LDFLAGS([$amanda_cv_LFS_LDFLAGS])
+
+    AC_CACHE_CHECK(
+        [for large file compilation LIBS],
+        amanda_cv_LFS_LIBS,
+        [
+        amanda_cv_LFS_LIBS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
+                amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
+        ]
+    )
+    AMANDA_ADD_LIBS([$amanda_cv_LFS_LIBS])
+
+    if test x"$NEED_RESETOFS" = x"yes"; then
+        AC_DEFINE(NEED_RESETOFS,1,
+            [Define if we have to reset tape offsets when reaching 2GB. ])
+    fi
+])
diff --git a/config/amanda/libs.m4 b/config/amanda/libs.m4
new file mode 100644 (file)
index 0000000..4bf2bc2
--- /dev/null
@@ -0,0 +1,377 @@
+# OVERVIEW
+#
+#   This file contains macros that search for specific libraries that are
+#   required or utilized by Amanda.
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_LIBCURL
+#
+# OVERVIEW
+#
+#   Check for LIBCURL support.  Sets the shell variable HAVE_CURL to "yes" or
+#   "no" depending on the result of the test.  If CURL is found, the necessary
+#   compiler flags are added, and a few other type checks are performed.
+#
+#   Note that libcurl itself defines a number of useful symbols as well; see
+#   the libcurl distribution for details.
+#
+AC_DEFUN([AMANDA_CHECK_LIBCURL], [
+    case "$target" in
+        sparc-sun-solaris2.10) # Solaris 10
+        # curl is not in the LD_LIBRARY_PATH on Solaris 10, so we search
+        # for it in a few common paths; we then extract the -L flags and
+        # translate them to -R flags, as required by the runtime linker.
+        AC_PATH_PROG(CURL_CONFIG, curl-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
+        if test -n "$CURL_CONFIG"; then
+            curlflags=`$CURL_CONFIG --libs 2>/dev/null`
+            for flag in curlflags; do
+                case $flag in
+                    -L*) LDFLAGS="$LDFLAGS "`echo "x$flag" | sed -e 's/^x-L/-R/'`;;
+                esac
+            done
+        fi
+        ;;
+    esac
+
+    LIBCURL_CHECK_CONFIG(yes, 7.10.0, HAVE_CURL=yes, HAVE_CURL=no)
+    if test x"$HAVE_CURL" = x"yes"; then
+       AMANDA_ADD_LIBS($LIBCURL)
+       AMANDA_ADD_CPPFLAGS($LIBCURL_CPPFLAGS)
+
+       AMANDA_CHECK_TYPE([curl_off_t], [off_t], [curl/curl.h])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_HMAC
+#
+# OVERVIEW
+#
+#   Check for HMAC support in -lcrypto.  If found, the shell
+#   variable HAVE_HMAC will be set to 'yes'.  The appropriate one of
+#   HAVE_OPENSSL_HMAC_H, HAVE_CRYPTO_HMAC_H, and HAVE_HMAC_H are also
+#   defined via AC_CHECK_HEADERS.
+#
+AC_DEFUN([AMANDA_CHECK_HMAC], [
+    HAVE_HMAC=yes
+    AC_CHECK_LIB([crypto], [HMAC_CTX_init], [], [HAVE_HMAC=no])
+
+    found_hmac_h=no
+    AC_CHECK_HEADERS([openssl/hmac.h crypto/hmac.h hmac.h],
+                   [found_hmac_h=yes; break])
+    if test x"$found_hmac_h" != x"yes"; then
+       HAVE_HMAC=no
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_NET_LIBS
+#
+# OVERIVEW
+#
+#   Check for the libraries we'll need to use sockets, etc.
+#
+AC_DEFUN([AMANDA_CHECK_NET_LIBS], [
+    # Make sure we don't use -lnsl and -lsun on Irix systems.
+    case "$target" in
+       *sgi-irix*)
+                           AC_CHECK_LIB(socket,main)
+                           ;;
+       *)
+                           AC_CHECK_LIB(resolv,main)
+                           AC_CHECK_LIB(nsl,main)
+                           AC_CHECK_LIB(socket,main)
+                           AC_CHECK_LIB(sun,main)
+                           ;;
+    esac
+])
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_GLIB
+#
+# OVERVIEW
+#
+#   Search for glib.  This is basically a wrapper for AM_PATH_GLIB_2_0, with
+#   the addition of system-specific configuration to convince Amanda to compile
+#   "out of the box" on more boxes.
+#
+AC_DEFUN([AMANDA_CHECK_GLIB], [
+    # search for pkg-config, which the glib configuration uses, adding a few
+    # system-specific search paths.
+    AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
+
+    case "$target" in
+       sparc-sun-solaris2.8) # Solaris 8
+           # give the linker a runtime search path; pkg-config doesn't supply this.
+           # Users could also specify this with LD_LIBRARY_PATH to both ./configure
+           # and make.  Adding this support here makes straight './configure; make'
+           # "just work" on Solaris 8
+           if test -n "$PKG_CONFIG"; then
+               glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
+               LDFLAGS="$LDFLAGS $glib_R_flag"
+           fi
+           ;;
+    esac
+
+    AM_PATH_GLIB_2_0(2.2.0,,[
+       AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help)
+    ], gmodule gobject gthread)
+    AMANDA_ADD_CFLAGS($GLIB_CFLAGS)
+    AMANDA_ADD_CPPFLAGS($GLIB_CPPFLAGS)
+    AMANDA_ADD_LIBS($GLIB_LIBS)
+])
+
+# LIBCURL_CHECK_CONFIG is from the libcurl
+# distribution and licensed under the BSD license:
+# Copyright (c) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>.
+#
+# All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software for any purpose
+# with or without fee is hereby granted, provided that the above copyright
+# notice and this permission notice appear in all copies.
+#
+# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
+#                       [ACTION-IF-YES], [ACTION-IF-NO])
+# ----------------------------------------------------------
+#      David Shaw <dshaw@jabberwocky.com>   May-09-2006
+#
+# Checks for libcurl.  DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-libcurl or --without-libcurl.
+# If not supplied, DEFAULT-ACTION is yes.  MINIMUM-VERSION is the
+# minimum version of libcurl to accept.  Pass the version as a regular
+# version number like 7.10.1. If not supplied, any version is
+# accepted.  ACTION-IF-YES is a list of shell commands to run if
+# libcurl was successfully found and passed the various tests.
+# ACTION-IF-NO is a list of shell commands that are run otherwise.
+# Note that using --without-libcurl does run ACTION-IF-NO.
+#
+# This macro #defines HAVE_LIBCURL if a working libcurl setup is
+# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
+# values.  Other useful defines are LIBCURL_FEATURE_xxx where xxx are
+# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
+# where yyy are the various protocols supported by libcurl.  Both xxx
+# and yyy are capitalized.  See the list of AH_TEMPLATEs at the top of
+# the macro for the complete list of possible defines.  Shell
+# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also
+# defined to 'yes' for those features and protocols that were found.
+# Note that xxx and yyy keep the same capitalization as in the
+# curl-config list (e.g. it's "HTTP" and not "http").
+#
+# Users may override the detected values by doing something like:
+# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# For the sake of sanity, this macro assumes that any libcurl that is
+# found is after version 7.7.2, the first version that included the
+# curl-config script.  Note that it is very important for people
+# packaging binary versions of libcurl to include this script!
+# Without curl-config, we can only guess what protocols are available,
+# or use curl_version_info to figure it out at runtime.
+
+AC_DEFUN([LIBCURL_CHECK_CONFIG],
+[
+  AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
+  AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
+  AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
+  AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
+  AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
+  AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
+  AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
+  AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
+
+  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
+  AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
+
+  AC_ARG_WITH(libcurl,
+     AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
+     [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
+
+  if test "$_libcurl_with" != "no" ; then
+
+     AC_PROG_AWK
+
+     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
+
+     _libcurl_try_link=yes
+
+     if test -d "$_libcurl_with" ; then
+        LIBCURL_CPPFLAGS="-I$withval/include"
+        _libcurl_ldflags="-L$withval/lib"
+        AC_PATH_PROG([_libcurl_config],[curl-config],["$withval/bin"],["$withval/bin"])
+     else
+        AC_PATH_PROG([_libcurl_config],[curl-config])
+     fi
+
+     if test x$_libcurl_config != "x" ; then
+        AC_CACHE_CHECK([for the version of libcurl],
+           [libcurl_cv_lib_curl_version],
+           [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
+
+        _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+        _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
+
+        if test $_libcurl_wanted -gt 0 ; then
+           AC_CACHE_CHECK([for libcurl >= version $2],
+              [libcurl_cv_lib_version_ok],
+              [
+              if test $_libcurl_version -ge $_libcurl_wanted ; then
+                 libcurl_cv_lib_version_ok=yes
+              else
+                 libcurl_cv_lib_version_ok=no
+              fi
+              ])
+        fi
+
+        if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+           fi
+           if test x"$LIBCURL" = "x" ; then
+              LIBCURL=`$_libcurl_config --libs`
+
+              # This is so silly, but Apple actually has a bug in their
+              # curl-config script.  Fixed in Tiger, but there are still
+              # lots of Panther installs around.
+              case "${host}" in
+                 powerpc-apple-darwin7*)
+                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+                 ;;
+              esac
+           fi
+
+           # All curl-config scripts support --feature
+           _libcurl_features=`$_libcurl_config --feature`
+
+           # Is it modern enough to have --protocols? (7.12.4)
+           if test $_libcurl_version -ge 461828 ; then
+              _libcurl_protocols=`$_libcurl_config --protocols`
+           fi
+        else
+           _libcurl_try_link=no
+        fi
+
+        unset _libcurl_wanted
+     fi
+
+     if test $_libcurl_try_link = yes ; then
+
+        # we didn't find curl-config, so let's see if the user-supplied
+        # link line (or failing that, "-lcurl") is enough.
+        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+        AC_CACHE_CHECK([whether libcurl is usable],
+           [libcurl_cv_lib_curl_usable],
+           [
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBCURL $LIBS"
+
+           AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+           ])
+
+        if test $libcurl_cv_lib_curl_usable = yes ; then
+
+           # Does curl_free() exist in this version of libcurl?
+           # If not, fake it with free()
+
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBS $LIBCURL"
+
+           AC_CHECK_FUNC(curl_free,,
+              AC_DEFINE(curl_free,free,
+                [Define curl_free() as free() if our version of curl lacks curl_free.]))
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+
+           AC_DEFINE(HAVE_LIBCURL,1,
+             [Define to 1 if you have a functional curl library.])
+           AC_SUBST(LIBCURL_CPPFLAGS)
+           AC_SUBST(LIBCURL)
+
+           for _libcurl_feature in $_libcurl_features ; do
+              AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
+              eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
+           done
+
+           if test "x$_libcurl_protocols" = "x" ; then
+
+              # We don't have --protocols, so just assume that all
+              # protocols are available
+              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
+
+              if test x$libcurl_feature_SSL = xyes ; then
+                 _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+                 # FTPS wasn't standards-compliant until version
+                 # 7.11.0
+                 if test $_libcurl_version -ge 461568; then
+                    _libcurl_protocols="$_libcurl_protocols FTPS"
+                 fi
+              fi
+           fi
+
+           for _libcurl_protocol in $_libcurl_protocols ; do
+              AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
+              eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
+           done
+        else
+           unset LIBCURL
+           unset LIBCURL_CPPFLAGS
+        fi
+     fi
+
+     unset _libcurl_try_link
+     unset _libcurl_version_parse
+     unset _libcurl_config
+     unset _libcurl_feature
+     unset _libcurl_features
+     unset _libcurl_protocol
+     unset _libcurl_protocols
+     unset _libcurl_version
+     unset _libcurl_ldflags
+  fi
+
+  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+     # This is the IF-NO path
+     ifelse([$4],,:,[$4])
+  else
+     # This is the IF-YES path
+     ifelse([$3],,:,[$3])
+  fi
+
+  unset _libcurl_with
+])dnl
+
diff --git a/config/amanda/net.m4 b/config/amanda/net.m4
new file mode 100644 (file)
index 0000000..f2c1805
--- /dev/null
@@ -0,0 +1,167 @@
+# OVERVIEW
+#
+#   Networking-related macros
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_FQDN
+#
+# OVERVIEW
+#
+#   Check for --with-fqdn, and DEFINE USE_FQDN if given.
+#
+AC_DEFUN([AMANDA_WITH_FQDN], [
+    AC_ARG_WITH(fqdn,
+       AS_HELP_STRING([--with-fqdn],
+                      [use FQDN's to backup multiple networks]),
+       [ USE_FQDN=$withval ], [ USE_FQDN=no ])
+
+    case "$USE_FQDN" in
+    n | no) : ;;
+    y |  ye | yes) 
+       AC_DEFINE(USE_FQDN,1,
+           [Define for backups being done on a multiple networks and FQDNs are used. ])
+      ;;
+    *) AC_MSG_ERROR([You must not supply an argument to --with-fqdn option.])
+      ;;
+    esac
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_REUSEPORTS
+#
+# OVERVIEW
+#
+#   Check for --with-reuseports, and DEFINE USE_REUSEADDR if given.
+#
+AC_DEFUN([AMANDA_WITH_REUSEPORTS], [
+    AC_ARG_WITH(reuseports,
+       AS_HELP_STRING([--without-reuseaddr],
+                      [Don't reuse network connections until full timeout period]),
+       [ case "$withval" in
+           y | ye | yes) USE_REUSEADDR=no;;
+           n | no) USE_REUSEADDR=yes;;
+           *) AC_MSG_ERROR([You must not supply an argument to --without-reuseports]);;
+         esac
+       ],
+       [ USE_REUSEADDR=yes; ])
+    if test x"$USE_REUSEADDR" = x"yes"; then
+       AC_DEFINE(USE_REUSEADDR,1,
+               [Define to set SO_REUSEADDR on network connections.])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_PORTRANGES
+#
+# OVERVIEW
+#
+#   Implement --with-low-tcpportrange, --with-tcpportrange, and --with-udpportrange.
+#   Results are DEFINED in LOW_TCPPORTRANGE, TCPPORTRANGE, and UDPPORTRANGE, 
+#   respectively.
+#
+AC_DEFUN([AMANDA_WITH_PORTRANGES], [
+    AC_ARG_WITH(low-tcpportrange,
+       AS_HELP_STRING([--with-low-tcpportrange=low/high],
+           [bind reserved TCP server sockets to ports within this range (default: unlimited)]),
+       [ LOW_TCPPORTRANGE="$withval" ],
+       [ LOW_TCPPORTRANGE=unlimited ])
+     
+    if test x"$LOW_TCPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
+           AC_MSG_ERROR([--with-low-tcpportrange requires two comma-separated positive numbers])
+       fi
+       min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'`
+       max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'`
+       if test $min_low_tcp_port -gt $max_low_tcp_port; then
+           AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-low-tcpportrange])
+       fi
+       if test $min_low_tcp_port -lt 512; then
+           AMANDA_MSG_WARN([the low TCP port range should be 512 or greater in --with-low-tcpportrange])
+       fi
+       if test $max_low_tcp_port -ge 1024; then
+           AMANDA_MSG_WARN([the low TCP port range should be less than 1024 in --with-low-tcpportrange])
+       fi
+       AC_DEFINE_UNQUOTED(LOW_TCPPORTRANGE,$LOW_TCPPORTRANGE,
+   [A comma-separated list of two integers, determining the minimum and maximum
+ * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) ])
+    fi
+
+    AC_ARG_WITH(tcpportrange,
+       AS_HELP_STRING([--with-tcpportrange=low/high],
+           [bind unreserved TCP server sockets to ports within this range (default: unlimited)]),
+       [ TCPPORTRANGE="$withval" ],
+       [ TCPPORTRANGE="unlimited" ])
+
+    if test x"$TCPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
+           AC_MSG_ERROR([--with-tcpportrange requires two comma-separated positive numbers])
+       fi
+       min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
+       max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
+       if test $min_tcp_port -gt $max_tcp_port; then
+           AC_MSG_ERROR([the second TCP port number must be greater than the first in --with-tcpportrange])
+       fi
+       if test $min_tcp_port -lt 1024; then
+           AMANDA_MSG_WARN([the TCP port range should be 1024 or greater in --with-tcpportrange])
+       fi
+       if test $max_tcp_port -ge 65536; then
+           AMANDA_MSG_WARN([the TCP port range should be less than 65536 in --with-tcpportrange])
+       fi
+       AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE,
+  [A comma-separated list of two integers, determining the minimum and
+ * maximum unreserved TCP port numbers sockets should be bound to. ])
+    fi
+
+    AC_ARG_WITH(udpportrange,
+       AS_HELP_STRING([--with-udpportrange=low/high],
+           [bind reserved UDP server sockets to ports within this range (default: unlimited)]),
+       [ UDPPORTRANGE="$withval" ],
+       [ UDPPORTRANGE="unlimited" ])
+    if test x"$UDPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
+           AC_MSG_ERROR([--with-udpportrange requires two comma-separated positive numbers])
+       fi
+       min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
+       max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
+       if test $min_udp_port -gt $max_udp_port; then
+           AC_MSG_ERROR([the second UDP port number must be greater than the first in --with-udpportrange])
+       fi
+       if test $max_udp_port -ge 1024; then
+           AMANDA_MSG_WARN([the UDP port range should be less than 1025 in --with-udpportrange])
+       fi
+       if test $min_udp_port -le 0; then
+           AMANDA_MSG_WARN([the UDP port range should be greater than 0 in --with-udpportrange])
+       fi
+       AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE,
+  [A comma-separated list of two integers, determining the minimum and
+ * maximum reserved UDP port numbers sockets should be bound to. ])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_BUFFERED_DUMP
+#
+# OVERVIEW
+#
+#   Implement --with-buffered-dump, and DEFINEs DUMPER_SOCKET_BUFFERING if the option
+#   is given.
+#
+AC_DEFUN([AMANDA_WITH_BUFFERED_DUMP], [
+    AC_ARG_WITH(buffered-dump,
+       AS_HELP_STRING([--with-buffered-dump],
+           [buffer the dumping sockets on the server for speed]),
+       [ DUMPER_SOCKET_BUFFERING=$withval ],
+       [ DUMPER_SOCKET_BUFFERING=no ])
+    case "$DUMPER_SOCKET_BUFFERING" in
+    n | no) ;;
+    y | ye | yes)
+       AC_DEFINE(DUMPER_SOCKET_BUFFERING,1,
+           [Define if dumper should buffer the sockets for faster throughput. ])
+      ;;
+    *) AC_MSG_ERROR([You must not supply an argument to --with-buffered-dump.]) ;;
+    esac
+])
diff --git a/config/amanda/progs.m4 b/config/amanda/progs.m4
new file mode 100644 (file)
index 0000000..79babba
--- /dev/null
@@ -0,0 +1,392 @@
+# OVERVIEW
+#
+#   Code to handle searches for programs Amanda needs.
+#
+#   Because Amanda uses a customized search path, many macros which are standard
+#   in autoconf have been wrapped here.  Where this is the only change, the description
+#   of those macros has been omitted.
+#
+#   All of these macros indicate their requirements using AC_REQUIRE, so the order in
+#   which they are called in configure.in is inconsequential.
+
+# SYNOPSIS
+#
+#   AMANDA_INIT_PROGS
+#
+# OVERVIEW
+#
+#   Set up some amanda-specific path directories.  This should be AC_REQUIRE()d by
+#   any macros which need to search for a program.
+#
+#   SYSPATH is a list of likely system locations for a file, while
+#   LOCPATH is a list of likely local locations.  The two are combined
+#   in different orders in SYSLOCPATH and LOCSYSPATH.
+#
+AC_DEFUN([AMANDA_INIT_PROGS],
+[
+    SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/sfw/bin:/usr/bsd:/etc:/usr/etc"
+    # expand prefix or exec_prefix in LOCPATH
+    LOCPATH=`(
+       test "x$prefix" = xNONE && prefix=$ac_default_prefix
+       test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+       eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin"
+    )`
+    SYSLOCPATH="$SYSPATH:$LOCPATH"
+    LOCSYSPATH="$LOCPATH:$SYSPATH"
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_LINT
+#
+# OVERVIEW
+#
+#   Find a lint binary (either lint or splint) and record its name in AMLINT.
+#   Set up appropriate flags for the discovered binary in AMLINTFLAGS
+#
+AC_DEFUN([AMANDA_PROG_LINT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_REQUIRE([AMANDA_PROG_GREP])
+
+    AC_PATH_PROG(AMLINT,lint,,/opt/SUNWspro/bin:$SYSLOCPATH)
+    if test ! -z "$AMLINT"; then
+      $AMLINT -flags 2>&1 | $GREP -- '-errfmt=' > /dev/null
+      if test $? -eq 0; then
+       AMLINTFLAGS="-n -s -u -m -x"
+       AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
+       AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
+       AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
+       AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
+       AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
+       AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
+       AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
+       AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
+       AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
+       AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
+       AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
+       AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
+       AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
+       AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
+       AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
+       AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
+       AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
+      else
+       AMLINTFLAGS=""
+      fi
+    else
+      AC_PATH_PROG(AMLINT,splint,,$SYSLOCPATH)
+      if test ! -z "$AMLINT"; then
+       AMLINT="splint"
+      else
+       AMLINT='echo "Error: LINT is not installed" ; false'
+      fi
+      AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
+    fi
+    AC_SUBST(AMLINTFLAGS)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_GNUPLOT
+#
+# OVERVIEW
+#
+#   Search for a 'gnuplot' binary, placing the result in the precious 
+#   variable GNUPLOT.  Also accepts --with-gnuplot to indicate the location
+#   of the binary.
+#
+AC_DEFUN([AMANDA_PROG_GNUPLOT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_ARG_WITH(gnuplot,
+    AS_HELP_STRING([--with-gnuplot=PATH],
+                  [use gnuplot executable at PATH in amplot]),
+       [
+           case "$withval" in
+               y | ye | yes) : ;;
+               n | no) GNUPLOT= ;;
+               *) GNUPLOT="$withval" ;;
+           esac
+       ])
+    AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH)
+
+    AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary])
+    AC_SUBST(GNUPLOT)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_PRINT
+#
+# OVERVIEW
+#
+#   Search for a binary for printing, usually either 'lp' or 'lpr', and put its
+#   path in PRINT, as well as defining it in LPRCMD in config.h.
+#
+#   LPRFLAG is defined in config.h as the appropriate command-line flag to use 
+#   to select a printer; either -P or -d.
+#
+AC_DEFUN([AMANDA_PROG_PRINT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_PATH_PROGS(PRINT, lpr lp)
+    if test ! -z "$PRINT"; then
+       AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT",
+               [Command for starting printing jobs. ])
+
+       AC_CACHE_CHECK([which flag to use to select a printer],
+           amanda_cv_printer_flag, [
+           amanda_cv_printer_flag=$PRINTER_FLAG
+           case "$PRINT" in
+               lpr|*/lpr) amanda_cv_printer_flag="-P";;
+               lp|*/lp) amanda_cv_printer_flag="-d";;
+           esac
+       ])
+       if test ! -z "$amanda_cv_printer_flag"; then
+           AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag",
+                   [LPRCMD switch for specifying a printer name. ])
+       else
+           AMANDA_MSG_WARN([WARNING: amanda will always print to the default printer])
+       fi
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_GNUPLOT
+#
+# OVERVIEW
+#
+#   Search for a 'gnuplot' binary, placing the result in the precious 
+#   variable GNUPLOT.  Also accepts --with-gnuplot to indicate the location
+#   of the binary.
+#
+AC_DEFUN([AMANDA_PROG_GNUPLOT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    AC_ARG_WITH(gnuplot,
+    AS_HELP_STRING([--with-gnuplot=PATH],
+                  [use gnuplot executable at PATH in amplot]),
+       [
+           case "$withval" in
+               y | ye | yes) : ;;
+               n | no) GNUPLOT=no ;;
+               *) GNUPLOT="$withval" ;;
+           esac
+       ])
+    if test "x$GNUPLOT" = "xno"; then
+       GNUPLOT=
+    else
+       AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH)
+    fi
+
+    AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary])
+    AC_SUBST(GNUPLOT)
+])
+
+## simple macros needing no description; some add AC_DEFINE_UNQUOTED
+
+AC_DEFUN([AMANDA_PROG_GREP],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(GREP,grep,grep,$LOCSYSPATH)
+    AC_DEFINE_UNQUOTED(GREP,"$GREP",
+           [Define the location of the grep program. ])
+])
+
+AC_DEFUN([AMANDA_PROG_CAT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(CAT,cat,cat,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_COMPRESS],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(COMPRESS,compress,,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_DD],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(DD,dd,,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_GETCONF],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(GETCONF,getconf,,$SYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_GZIP],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(GZIP,gzip,,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_SORT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_REQUIRE([AMANDA_CHECK_COMPONENTS])
+
+    AC_PATH_PROG(SORT,sort,NONE,$LOCSYSPATH)
+
+    # sort is only needed in the server build
+    if test x"$SORT" = x"NONE" && $WANT_SERVER; then
+        AC_MSG_ERROR([Set SORT to the path of the sort program.])
+    fi
+
+    AC_DEFINE_UNQUOTED(SORT_PATH,"$SORT",
+           [Define to the exact path to the sort program. ])
+])
+
+AC_DEFUN([AMANDA_PROG_MAILER],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROGS(MAILER,Mail mailx mail,NONE)
+    if test x"$MAILER" = x"NONE"; then
+        AMANDA_MSG_WARN([WARNING: Amanda cannot send mail reports without a mailer.])
+    else
+        AC_DEFINE_UNQUOTED(MAILER,"$MAILER",
+                [A program that understands -s "subject" user < message_file])
+    fi
+])
+
+# SYNOPSIS
+#
+#   AMANDA_PROG_MT
+#
+# OVERVIEW
+#   
+#   Find and SUBST 'mt', and additionally calculate the proper flag to use
+#   to identify the tape device (usually -f) and DEFINE and SUBST that value
+#   as MT_FILE_FLAG.
+#
+AC_DEFUN([AMANDA_PROG_MT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(MT,mt,mt,$LOCSYSPATH)
+
+    case "$target" in
+       *-hp-*) MT_FILE_FLAG="-t" ;;
+       *) MT_FILE_FLAG="-f" ;;
+    esac
+
+    AC_SUBST(MT_FILE_FLAG)
+    AC_DEFINE_UNQUOTED(MT_FILE_FLAG, "$MT_FILE_FLAG",
+  [The switch to be used when invoking mt to specify the
+ * tape device. ])
+])
+
+
+AC_DEFUN([AMANDA_PROG_CHIO],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(CHIO,chio,chio,$LOCSYSPATH)
+])
+
+
+AC_DEFUN([AMANDA_PROG_CHS],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(CHS,chs,chs,$LOCSYSPATH)
+])
+
+
+AC_DEFUN([AMANDA_PROG_MTX],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(MTX,mtx,mtx,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_MCUTIL],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(MCUTIL,mcutil,mcutil,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_PCAT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(PCAT,pcat,,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_PERL],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROGS(PERL,perl5 perl,,$LOCSYSPATH)
+    AC_ARG_VAR([PERL], [Path to the 'perl' binary])
+    AC_PROG_PERL_VERSION([5.6.0], [], [
+       AC_MSG_ERROR([Amanda requires at least perl 5.6.0])
+    ])
+])
+
+AC_DEFUN([AMANDA_PROG_SWIG],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROGS(SWIG,swig,,$LOCSYSPATH)
+    AC_ARG_VAR([SWIG], [Path to the 'swig' binary (developers only)])
+    AC_PROG_SWIG([1.3.28])
+])
+
+AC_DEFUN([AMANDA_PROG_AR],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(AR,ar,,$LOCSYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_BASH],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(BASH,bash,,$SYSPATH)
+])
+
+AC_DEFUN([AMANDA_PROG_SSH],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH)
+    AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary])
+])
+
+AC_DEFUN([AMANDA_PROG_GETTEXT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(GETTEXT,gettext,,$LOCSYSPATH)
+])
diff --git a/config/amanda/readdir.m4 b/config/amanda/readdir.m4
new file mode 100644 (file)
index 0000000..4db19c7
--- /dev/null
@@ -0,0 +1,32 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_READDIR
+#
+# OVERVIEW
+#
+#   Check for one of the readdir variants, as well as the dirent headers.
+#   See common-src/util.c and amanda.h for the use of these symbols.
+#
+AC_DEFUN([AMANDA_CHECK_READDIR], [
+    AC_HEADER_DIRENT
+
+    # include the dirent headers as described in the autoconf documentation.
+    AC_CHECK_DECLS([readdir, readdir_r, readdir64, readdir64_r],,,[
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+    ])
+])
diff --git a/config/amanda/readline.m4 b/config/amanda/readline.m4
new file mode 100644 (file)
index 0000000..dbf8be5
--- /dev/null
@@ -0,0 +1,75 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_READLINE
+#
+# OVERVIEW
+#
+#   Check for readline support.  Defines HAVE_READLINE if readline
+#   is available, and also checks for a number of readline headers and
+#   adds readline libraries to READLINE_LIBS.
+#
+#   See common-src/util.{c,h}.
+#
+AC_DEFUN([AMANDA_CHECK_READLINE], [
+    AC_ARG_WITH(readline,
+    dnl no initial space here, so the results line up properly
+AS_HELP_STRING([--with-readline], [require readline support (for amrecover)])
+AS_HELP_STRING([--without-readline], [don't search for readline]),
+        [ 
+            case "$withval" in
+                y | ye | yes | n | no) : ;;
+                *) AC_MSG_ERROR([*** --with-readline does not take a value])
+            esac
+            want_readline="$withval"
+        ], [
+            want_readline="maybe" # meaning "only if we can find it"
+        ])
+
+    # unless the user said "no", look for readline.
+    if test x"$want_readline" != x"no"; then
+        # we need a tgetent() somewhere..
+        proceed="false"
+        AC_CHECK_LIB(termcap, tgetent, [
+            READLINE_LIBS="-ltermcap"
+            proceed="true"
+        ], [
+            AC_CHECK_LIB(curses, tgetent, [
+                READLINE_LIBS="-lcurses"
+                proceed="true"
+            ], [
+                AC_CHECK_LIB(ncurses, tgetent, [
+                    READLINE_LIBS="-lncurses"
+                    proceed="true"
+                ])
+            ])
+        ])
+
+        if $proceed; then
+            proceed="false"
+            AC_CHECK_HEADERS( history.h readline.h readline/history.h readline/readline.h, [
+                # found at least one of the headers, so we can proceed.
+                proceed="true"
+            ])
+        fi
+
+        if $proceed; then
+            proceed="false"
+            AC_CHECK_LIB(readline,readline, [
+                READLINE_LIBS="-lreadline $READLINE_LIBS"
+                proceed="true"
+            ],,$READLINE_LIBS)
+        fi
+
+        if $proceed; then
+            # we have readline!
+            AC_DEFINE(HAVE_READLINE, 1, [System has readline support (headers and libraries)])
+        else
+            # no readline.  if the user *really* wanted it, bail out.
+            if test x"$want_readline" = x"yes"; then
+                AC_MSG_ERROR([*** No readline implementation found.  Try using --with-libraries and --with-includes])
+            fi
+            READLINE_LIBS=""
+        fi
+    fi
+    AC_SUBST(READLINE_LIBS)
+])
diff --git a/config/amanda/rsh-security.m4 b/config/amanda/rsh-security.m4
new file mode 100644 (file)
index 0000000..891d50f
--- /dev/null
@@ -0,0 +1,32 @@
+# SYNOPSIS
+#
+#   AMANDA_RSH_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for RSH security, implementing the --with-rsh-security
+#   option and checking for the relevant programs and options.
+#
+AC_DEFUN([AMANDA_RSH_SECURITY],
+[
+    RSH_SECURITY=no
+    AC_ARG_WITH(rsh-security,
+        AS_HELP_STRING([--with-rsh-security], 
+                [include RSH authentication]),
+        [
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) RSH_SECURITY=yes ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --with-rsh-security.])
+              ;;
+            esac
+        ],
+    )
+
+    if test "x$RSH_SECURITY" = "xyes"; then
+        AC_DEFINE(RSH_SECURITY,1,
+                [Define if RSH transport should be enabled. ])
+    fi
+    AM_CONDITIONAL(WANT_RSH_SECURITY, test x"$RSH_SECURITY" = x"yes")
+])
+
diff --git a/config/amanda/s3-device.m4 b/config/amanda/s3-device.m4
new file mode 100644 (file)
index 0000000..9883d20
--- /dev/null
@@ -0,0 +1,80 @@
+# SYNOPSIS
+#
+#   AMANDA_S3_DEVICE
+#
+# OVERVIEW
+#
+#   Perform the necessary checks for the S3 Device.  If the S3 device should be built,
+#   WANT_S3_DEVICE is DEFINEd and set up as an AM_CONDITIONAL.
+#
+#   The subsidiary DevPay support, if enabled, defines and AM_CONDITIONALizes
+#   WANT_DEVPAY.
+#
+AC_DEFUN([AMANDA_S3_DEVICE], [
+    AC_REQUIRE([AMANDA_CHECK_LIBCURL])
+    AC_REQUIRE([AMANDA_CHECK_HMAC])
+
+    if test "$libcurl_feature_SSL" != "yes" ||
+       test "$libcurl_protocol_HTTPS" != "yes"; then
+        s3_ssl=no
+    else
+       s3_ssl=yes
+    fi
+
+    AC_ARG_ENABLE([s3-device],
+       AS_HELP_STRING([--disable-s3-device],
+                      [disable the S3 device]),
+       [ WANT_S3_DEVICE=$enableval ], [ WANT_S3_DEVICE=maybe ])
+
+    AC_MSG_CHECKING([whether to include the Amazon S3 device])
+    # if the user didn't specify 'no', then check for support
+    if test x"$WANT_S3_DEVICE" != x"no"; then
+       if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then
+           WANT_S3_DEVICE=yes
+       else
+           # no support -- if the user explicitly enabled the device,
+           # then this is an error
+           if test x"$WANT_S3_DEVICE" = x"yes"; then
+               AC_MSG_RESULT(no)
+               AC_MSG_ERROR([Cannot build the Amazon S3 device: one or more prerequisites are missing.])
+           else
+               WANT_S3_DEVICE=no
+           fi
+       fi
+    fi
+    AC_MSG_RESULT($WANT_S3_DEVICE)
+
+    AM_CONDITIONAL([WANT_S3_DEVICE], [test x"$WANT_S3_DEVICE" = x"yes"])
+
+    # Now handle any setup for S3, if we want it.
+    if test x"$WANT_S3_DEVICE" = x"yes"; then
+       AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver])
+       if test x"$s3_ssl" = x"no"; then
+         AMANDA_MSG_WARN([Encryption support is not available for S3; requests will be sent in plaintext.])
+       fi
+    fi
+                         
+
+    AC_ARG_ENABLE([devpay],
+                 AS_HELP_STRING([--enable-devpay],
+                                [Use devpay authentication for Amazon S3 driver]),
+                 [WANT_DEVPAY=$enableval], [WANT_DEVPAY=no])
+
+    AC_MSG_CHECKING([whether to include the Amazon S3 device's DevPay support])
+    if test x"$WANT_DEVPAY" = x"yes"; then
+       if test x"$WANT_S3_DEVICE" != x"yes"; then
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR([DevPay support requires the S3 device (--enable-s3-device)])
+       fi
+
+       if test "$s3_ssl" != "yes"; then
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR([Cannot use devpay without HTTPS/SSL support in libcurl.])
+       fi
+
+       AC_DEFINE([WANT_DEVPAY], [], [Compile Amazon DevPay support])
+    fi
+    AC_MSG_RESULT($WANT_DEVPAY)
+
+    AM_CONDITIONAL([WANT_DEVPAY], [test "$WANT_DEVPAY" = "yes"])
+])
diff --git a/config/amanda/shmem.m4 b/config/amanda/shmem.m4
new file mode 100644 (file)
index 0000000..d620e5d
--- /dev/null
@@ -0,0 +1,130 @@
+# SYNOPSIS
+#
+#   AMANDA_FUNC_SHM_ARG_TYPE
+#
+# OVERVIEW
+#
+#   Determine the type of the second argument to shmdt/shmat, defining
+#   that type (without the *) in SHM_ARG_TYPE.
+#
+AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], [
+       AC_CHECK_HEADERS(
+           sys/types.h \
+           sys/ipc.h \
+           sys/shm.h \
+       )
+
+       AC_CACHE_CHECK(
+           [for shmdt() argument type],
+           amanda_cv_shmdt_arg_type,
+           [
+               if test "$ac_cv_func_shmget" = yes; then
+                   cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+#endif
+#ifdef HAVE_SYS_SHM_H
+# include <sys/shm.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void *shmat(int, void *, int);
+#else
+void *shmat();
+#endif
+
+int main()
+{
+    int i;
+    return 0;
+}
+EOF
+                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
+                   if test $? = 0; then
+                       amanda_cv_shmdt_arg_type=void
+                   else
+                       amanda_cv_shmdt_arg_type=char
+                   fi
+                   rm -f conftest*
+               else
+                   amanda_cv_shmdt_arg_type=nothing
+               fi
+           ]
+       )
+       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,
+           [Define to type of shmget() function argument. ])
+    ]
+)
+
+# SYNOPSIS
+#
+#   AMANDA_CHECK_SHMEM
+#
+# OVERVIEW
+#
+#   Check for shared memory support; checks for the --with-mmap option,
+#   and then ensures that the proper compilation infrastructure is in place
+#   for either mmap or shared memory support.
+#
+#   Defines several HAVE_*_DECL symbols via ICE_CHECK_DECL, as well as 
+#   HAVE_SYSVSHM if shared memory support is discovered.
+#
+AC_DEFUN([AMANDA_CHECK_SHMEM],
+[
+    AC_REQUIRE([AC_HEADER_STDC])
+    AC_ARG_WITH(mmap,
+       AS_HELP_STRING([--with-mmap],
+           [force use of mmap instead of shared memory support]),
+       [
+           case "$FORCE_MMAP" in
+               y | ye | yes | n | no) : ;;
+               *) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.]) ;;
+           esac
+           FORCE_MMAP=$withval
+       ],
+       [ : ${FORCE_MMAP=no} ]
+    )
+
+
+    AC_CHECK_HEADERS(\
+           sys/shm.h \
+           sys/mman.h \
+    )
+
+    AC_FUNC_MMAP
+
+    AC_CHECK_FUNCS(shmget,
+       [
+           AMANDA_FUNC_SHM_ARG_TYPE
+           case "$FORCE_MMAP" in
+           n | no)
+               AC_DEFINE(HAVE_SYSVSHM,1,
+                   [Define if SysV shared-memory functions are available. ])
+             ;;
+           esac
+       ]
+    )
+    ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h)
+    ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h)
+    ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h)
+    ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h)
+
+    if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
+       case "$FORCE_MMAP" in
+       n | no)
+           if test "x$ac_cv_func_shmget" != xyes; then
+               AMANDA_MSG_WARN([Neither shmget() nor mmap() found. This system will not support the Amanda server.])
+               NO_SERVER_MODE=true
+           fi
+         ;;
+       y | ye | yes)
+           AMANDA_MSG_WARN([--with-mmap used on a system with no mmap() support.  This system will not support the Amanda server.])
+           NO_SERVER_MODE=true
+         ;;
+       esac
+    fi
+])
diff --git a/config/amanda/ssh-security.m4 b/config/amanda/ssh-security.m4
new file mode 100644 (file)
index 0000000..9fd8d97
--- /dev/null
@@ -0,0 +1,71 @@
+# SYNOPSIS
+#
+#   AMANDA_SSH_SECURITY
+#
+# OVERVIEW
+#
+#   Handle configuration for SSH security, implementing the --with-ssh-security
+#   option and checking for the relevant programs and options.
+#
+AC_DEFUN([AMANDA_SSH_SECURITY],
+[
+    SSH_SECURITY=no
+    AC_ARG_WITH(ssh-security,
+        AS_HELP_STRING([--with-ssh-security], 
+                [include SSH authentication]),
+        [
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) SSH_SECURITY=yes ;;
+                *) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.])
+              ;;
+            esac
+        ],
+    )
+
+    if test "x$SSH_SECURITY" = "xyes"; then
+        # find the SSH binary
+        AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH)
+
+        # see what options we should use
+        AC_ARG_WITH(ssh-options,
+            AS_HELP_STRING([ --with-ssh-options=@<:@OPTIONS@:>@],
+               [Use these ssh options for ssh security; the default should work]),
+            [ SSH_OPTIONS="$withval" ],
+            [ SSH_OPTIONS='' ]
+        )
+
+        case "$SSH_OPTIONS" in
+            y | ye | yes | n | no)
+                AC_MSG_ERROR([*** You must supply an argument to --with-ssh-options.]);;
+            *) : ;;
+        esac
+
+        AC_MSG_CHECKING([SSH options])
+        # if we didn't get SSH options from the user, figure them out for ourselves
+        if test -z "$SSH_OPTIONS"; then
+            case `$SSH -V 2>&1` in
+                OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
+                *) SSH_OPTIONS='-x -o BatchMode=yes' ;;
+            esac
+        fi
+
+        # now convert that to a comma-separated list of C strings
+        eval "set dummy ${SSH_OPTIONS}"; shift
+        SSH_OPTIONS=''
+       for i in "${@}"; do 
+           quoted="\"`echo "$i" | sed -e 's/\"/\\\"/'`\""
+           SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }$quoted"; 
+       done
+        AC_MSG_RESULT($SSH_OPTIONS)
+
+        # finally, make the various outputs for all of this
+        AC_DEFINE(SSH_SECURITY,1,
+                [Define if SSH transport should be enabled. ])
+        AC_DEFINE_UNQUOTED(SSH, "$SSH", 
+                [Path to the SSH binary])
+        AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS, 
+                [Arguments to ssh])
+    fi
+    AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY" = x"yes")
+])
diff --git a/config/amanda/summary.m4 b/config/amanda/summary.m4
new file mode 100644 (file)
index 0000000..105373c
--- /dev/null
@@ -0,0 +1,71 @@
+# OVERVIEW/BACKGROUND
+#
+#   This file creates an end-of-run summary of the Amanda configuration.
+#
+
+# SYNOPSIS
+#
+#   AMANDA_INIT_SUMMARY()
+#
+# DESCRIPTION
+#
+#   Set up for producing a summary.  This should be called early in the configure
+#   process
+#
+AC_DEFUN([AMANDA_INIT_SUMMARY],
+[
+    # initialize warnings file
+    rm -f config.warnings
+])
+
+# SYNOPSIS
+#
+#   AMANDA_MSG_WARN()
+#
+# DESCRIPTION
+#
+#   Like AC_MSG_WARN, but also adds the message to the summary
+#
+AC_DEFUN([AMANDA_MSG_WARN], [
+    AC_MSG_WARN([$1])
+    AMANDA_ADD_WARNING([$1])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_ADD_WARNING_QUOTED(warning-text) #if text already quoted
+#   AMANDA_ADD_WARNING(warning-text)        #if text not quoted
+#
+# DESCRIPTION
+#
+#   Add the given text to the warnings summary
+#
+AC_DEFUN([AMANDA_ADD_WARNING_QUOTED], [
+    cat <<AAW_EOF >>config.warnings
+$1
+AAW_EOF])
+
+AC_DEFUN([AMANDA_ADD_WARNING], [
+AMANDA_ADD_WARNING_QUOTED([_AS_QUOTE([$1])])
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SHOW_SUMMARY()
+#
+# DESCRIPTION
+#
+#   Output the configuration summary.
+#
+AC_DEFUN([AMANDA_SHOW_SUMMARY], [
+    AMANDA_SHOW_FLAGS_SUMMARY
+    AMANDA_SHOW_COMPONENTS_SUMMARY
+    AMANDA_SHOW_IPV6_SUMMARY
+    AMANDA_SHOW_DOCUMENTATION_SUMMARY
+    AMANDA_SHOW_DIRS_SUMMARY
+    if test -f config.warnings; then
+       echo "WARNINGS:"
+       cat config.warnings | sed -e 's/^/  /g'
+       rm config.warnings
+    fi
+])
diff --git a/config/amanda/swig.m4 b/config/amanda/swig.m4
new file mode 100644 (file)
index 0000000..dadfc89
--- /dev/null
@@ -0,0 +1,76 @@
+# OVERVIEW
+#
+#   Set up for building SWIG bindings.  Note that shipped tarballs contain pre-built
+#   SWIG bindings, so there should be no need for SWIG on non-developer machines.
+# SYNOPSIS
+#
+#   Find perl and SWIG, and substitute PERL_INC, the -I command that will lead the compiler
+#   to perl.h and friends.
+#
+#   Supports --with-perlextlibs, for adding extra LIBS declarations to perl extensions.
+#
+AC_DEFUN([AMANDA_SETUP_SWIG],
+[
+    AC_REQUIRE([AMANDA_PROG_SWIG])
+    AC_REQUIRE([AMANDA_PROG_PERL])
+
+    # If we want cygwin to copy ddl to modules directory.
+    WANT_CYGWIN_COPY_PERL_DLL="false"
+
+    # get the include path for building perl extensions
+    PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc`
+    AC_SUBST(PERL_INC)
+
+    if test x"$enable_shared" = x"no"; then
+       AC_MSG_ERROR([*** Amanda cannot be compiled without shared-library support (do not use --disable-shared)])
+    fi
+
+    case "$target" in
+       *freebsd@<:@123456@:>@*) # up to and including FreeBSD 6.*
+           # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
+           # libgthread to automatically pull in the desired threading library.
+           # Instead, they assume that any application linking against
+           # libgthread will pull in the threading library.  This is fine for
+           # Amanda C applications, but for Perl applications this assumption
+           # means that the perl binary would pull in the threading library.
+           # But perl is compiled without threading by default.  
+           #
+           # Specifically, this occurs on any FreeBSD using gcc-3.*: the linking
+           # decision is made in gcc's spec files, which were changed in
+           # gcc-4.0.  For a more in-depth discussion, see
+           #  http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_FreeBSD
+           #
+           # The easiest solution for the "default" case is to link all perl
+           # extension libraries against the threading library, so it is loaded
+           # when perl loads the extension library.  The default threading
+           # library in FreeBSD is libpthread.  The below default will work on
+           # such a FreeBSD system, but ports maintainers and those with
+           # different configurations may need to override this value with
+           # --with-perlextlibs.
+           #
+           # We can't use -pthread because gcc on FreeBSD ignores -pthread in
+           # combination with -shared.  See
+           #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
+
+           PERLEXTLIBS="-lpthread"
+           ;;
+       *-pc-cygwin)
+           # When need -lperl and the '-L' where it is located,
+           # we don't want the DynaLoader.a
+           PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
+           WANT_CYGWIN_COPY_PERL_DLL="true";
+           ;;
+    esac
+    AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL,$WANT_CYGWIN_COPY_PERL_DLL)
+
+    AC_ARG_WITH(perlextlibs,
+       AC_HELP_STRING([--with-perlextlibs=libs],[extra LIBS for Perl extensions]),
+       [
+           case "$withval" in
+               y|ye|yes) AC_MSG_ERROR([*** You must specify a value for --with-perlextlibs]);;
+               n|no) PERLEXTLIBS='';;
+               *) PERLEXTLIBS="$withval" ;;
+           esac
+       ])
+    AC_SUBST(PERLEXTLIBS)
+])
diff --git a/config/amanda/syshacks.m4 b/config/amanda/syshacks.m4
new file mode 100644 (file)
index 0000000..c3e9935
--- /dev/null
@@ -0,0 +1,108 @@
+# SYNOPSIS
+#
+#   AMANDA_SYSHACKS
+#
+# OVERVIEW
+#
+#   This macro encapsulates any system-specific hacks required to make Amanda
+#   compile that don't fit neatly into any other macro.  It is implemented as a 
+#   big 'case' statement based on the canonical target architecture.
+#
+#   It also serves as a list of the "supported" architectures, represented by 
+#   case statements with empty bodies.  If no architecture matches, the user
+#   is presented with a warning.
+#
+AC_DEFUN([AMANDA_SYSHACKS], [
+    AC_REQUIRE([AC_CANONICAL_TARGET])
+    case "$target" in
+       *-dec-osf*)
+                   ;;
+       *-dg-*)
+                   ;;
+       *-netbsd*)
+                   ;;
+       *-freebsd*)
+                   ;;
+       *-openbsd*)
+                   ;;
+       *-hp-*)
+                   case "$CC" in
+                       *gcc*)
+                           AMANDA_ADD_CPPFLAGS([-D__STDC_EXT__])
+                           ;;
+                       *cc*)
+                           AMANDA_ADD_CFLAGS([-Ae])
+                           ;;
+                   esac
+                   ;;
+       *-ibm-aix*)
+                   ;;
+       m88k-motorola-sysv4)
+                   ;;
+       *-nextstep3)
+                   ;;
+       *-pc-bsdi*)
+                   ;;
+       *-pc-linux-*)
+                   ;;
+       *-redhat-linux-*)
+                   ;;
+       *-suse-linux-*)
+                   ;;
+       x86_64-*-linux-*)
+                   ;;
+       alpha*-*-linux-*)
+                   ;;
+       sparc*-*-linux-*)
+                   ;;
+       powerpc-*-linux-*)
+                   ;;
+        *-sgi-irix3*)
+                   # The old cc won't work!
+                   if test "x$GCC" != "xyes"; then
+                       AC_MSG_ERROR([The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc])
+                   fi
+                   ;;
+        *-sgi-irix4*)
+                   ;;
+        *-sgi-irix5*)
+                   ;;
+        *-sgi-irix6*)
+                   ;;
+        *-solaris2*)
+                   ;;
+        *-sun-sunos4.1*)
+                   ;;
+        *-ultrix*)
+                   ;;
+        *-sysv4.2uw2*)
+                   ;;
+        *-sco3.2v5*)
+                   ;;
+        i386-pc-isc4*)
+                   ;;
+        *-sni-sysv4)
+                   ;;
+        *-pc-cygwin)
+                   AC_DEFINE(IGNORE_TAR_ERRORS,1,[Define on Cygwin. ])
+                   # Cygwin needs PATH to find cygwin1.dll
+                   AC_DEFINE(NEED_PATH_ENV,1,[Define on Cygwin. ])
+                   AC_DEFINE(IGNORE_FSTAB,1,[Define on Cygwin. ])
+                   AMANDA_ADD_LDFLAGS([-Wl,-enable-runtime-pseudo-reloc -no-undefined])
+                   ;;
+        *-apple-darwin7*) # MacOS X 10.3.* (Panther)
+                   ;;
+        *-apple-darwin8*) # MacOS X 10.4.* (Tiger)
+                   ;;
+      *)
+               AMANDA_ADD_WARNING(
+[*****
+This machine, target type $target, is not known to be fully supported
+by this configure script.  If the installation of Amanda on this system
+succeeds or needed any patches, please email amanda-hackers@amanda.org
+with the patches or an indication of the sucess or failure of the
+Amanda installation on your system.
+*****])
+                   ;;
+    esac
+])
diff --git a/config/amanda/tape.m4 b/config/amanda/tape.m4
new file mode 100644 (file)
index 0000000..d08f27a
--- /dev/null
@@ -0,0 +1,198 @@
+# SYNOPSIS
+#
+#   AMANDA_WITH_MAXTAPEBLOCKSIZE
+#
+# OVERVIEW
+#
+#   Implement the --with-maxtapeblocksize option, and DEFINE and SUBST the
+#   result in MAX_TAPE_BLOCk_KB and MAXTAPEBLOCKSIZE, respectively.
+#
+AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [
+    AC_ARG_WITH(maxtapeblocksize,
+       AS_HELP_STRING([--with-maxtapeblocksize=kb],
+           [Maximum size of a tape block (default: 32)]),
+       [ MAXTAPEBLOCKSIZE="$withval" ],
+       [ MAXTAPEBLOCKSIZE=32 ]
+    )
+
+    AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE),
+       [Maximum size of a tape block in KBytes.])
+    AC_SUBST(MAXTAPEBLOCKSIZE)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_TAPE_DEVICE
+#
+# OVERVIEW
+#
+#   Set up for the 'tape' device.  One of the conditionals WANT_TAPE_XENIX,
+#   WANT_TAPE_AIX, WANT_TAPE_UWARE, and WANT_TAPE_POSIX will be true; the
+#   corresponding symbols are also DEFINEd.  Finally, WANT_TAPE_DEVICE is
+#   defined nad AM_CONDITIONAL'd if the tape device should be supported (if
+#   at least one of the backends is available).
+#
+#   If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and 
+#   mt_erreg, the corresponding HAVE_MT_* is DEFINEd.
+#
+#   Not that most of the checks in this section correspond to the older
+#   tapeio (in tape-src/), rather than the new tape device.
+#
+AC_DEFUN([AMANDA_TAPE_DEVICE], [
+    AC_CHECK_HEADERS( \
+       linux/zftape.h \
+       sys/tape.h \
+       sys/mtio.h \
+       )
+
+    # check for MTIOCTOP, an indicator of POSIX tape support
+    AC_CACHE_CHECK([for MTIOCTOP], amanda_cv_HAVE_MTIOCTOP,[
+       AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TAPE_H
+# include <sys/tape.h>
+#endif
+#ifdef HAVE_SYS_MTIO_H
+# include <sys/mtio.h>
+#endif
+#ifndef MTIOCTOP
+#error MTIOCTOP not defined
+#endif
+           ],
+           [ int dummy = 0; ],
+           amanda_cv_HAVE_MTIOCTOP=yes,
+           amanda_cv_HAVE_MTIOCTOP=no,
+           amanda_cv_HAVE_MTIOCTOP=no)]
+
+       HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP
+    )
+
+    # decide which tape device to compile (arranged in such a way that
+    # only one actually gets compiled)
+    case "$target" in
+      *-ibm-aix*) aix_tapeio=yes ;;
+      *-sysv4.2uw2*) uware_tapeio=yes ;;
+      *-sco3.2v5*) xenix_tapeio=yes ;;
+      i386-pc-isc4*) xenix_tapeio=yes ;;
+    esac
+
+    # maybe we have no tape device at all (e.g., Mac OS X)?
+    if test -n "$xenix_tapeio" ||
+       test -n "$aix_tapeio" ||
+       test -n "$uware_tapeio" ||
+       test -n "$HAVE_MTIOCTOP"; then
+       want_tape_device=yes
+       AC_DEFINE(WANT_TAPE_DEVICE, 1, [Define if the tape-device will be built])
+    fi
+
+    AM_CONDITIONAL(WANT_TAPE_XENIX, test -n "$xenix_tapeio")
+    AM_CONDITIONAL(WANT_TAPE_AIX, test -n "$aix_tapeio")
+    AM_CONDITIONAL(WANT_TAPE_UWARE, test -n "$uware_tapeio")
+    AM_CONDITIONAL(WANT_TAPE_POSIX, test -n "$HAVE_MTIOCTOP")
+    AM_CONDITIONAL(WANT_TAPE_DEVICE, test -n "$want_tape_device")
+
+    if test -n "$xenix_tapeio"; then
+      AC_DEFINE(WANT_TAPE_XENIX,1,[Define on XENIX/ISC. ])
+    fi
+
+    if test -n "$aix_tapeio"; then
+      AC_DEFINE(WANT_TAPE_AIX,1,[Define on AIX. ])
+    fi
+
+    if test -n "$uware_tapeio"; then
+      AC_DEFINE(WANT_TAPE_UWARE,1,[Define on UnixWare. ])
+    fi
+
+    #
+    # Check for various "mt status" related structure elements.
+    #
+    AC_MSG_CHECKING([for mt_flags mtget structure element])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+       ]], [[
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_flags;
+       ]])],[
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_MT_FLAGS,1,
+               [Define if the mtget structure has an mt_flags field])
+       ],[
+           AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING([for mt_fileno mtget structure element])
+    mt_fileno_result="found"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+       ]], [[
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_fileno;
+       ]])],[
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_MT_FILENO,1,
+               [Define if the mtget structure has an mt_fileno field])
+       ],[
+           AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING(for mt_blkno mtget structure element)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+       ]], [[
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_blkno;
+       ]])],[
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_MT_BLKNO,1,
+               [Define if the mtget structure has an mt_blkno field])
+       ],[
+           AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING(for mt_dsreg mtget structure element)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+       ]], [[
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_dsreg;
+       ]])],[
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_MT_DSREG,1,
+               [Define if the mtget structure has an mt_dsreg field])
+       ],[
+           AC_MSG_RESULT(no)
+       ])
+
+    AC_MSG_CHECKING(for mt_erreg mtget structure element)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+       ]], [[
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_erreg;
+       ]])],[
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_MT_ERREG,1,
+               [Define if the mtget structure has an mt_erreg field])
+       ],[
+           AC_MSG_RESULT(no)
+       ])
+])
diff --git a/config/amanda/types.m4 b/config/amanda/types.m4
new file mode 100644 (file)
index 0000000..ff9e852
--- /dev/null
@@ -0,0 +1,188 @@
+# SYNOPSIS
+#
+#   AMANDA_CHECK_TYPE(type, replacement-type, header)
+#
+# OVERVIEW
+# 
+#   Like AC_CHECK_TYPE, where action-if-not-found DEFINEs $1 to $2.
+#
+#   'header' must be a single header name, or blank to use the default
+#   headers.
+#
+AC_DEFUN([AMANDA_CHECK_TYPE], [
+    AC_REQUIRE([AC_HEADER_STDC])
+    AC_CHECK_TYPE($1, [], [
+       AC_DEFINE($1, $2, [Type for $1, if it is not defined by the system])
+    ], ifelse($3, [], [], [
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <$3>
+       ])
+    )
+])
+#
+# SYNOPSIS
+#
+#   AMANDA_TYPE_PID_T
+#
+# OVERVIEW
+#
+#   Check whether pid_t is a long, int, or short.  DEFINE PRINTF_PID_T to the
+#   corresponding printf format.
+#
+AC_DEFUN([AMANDA_TYPE_PID_T], [
+       AC_REQUIRE([AC_HEADER_STDC])
+       AC_REQUIRE([AC_TYPE_PID_T])
+       AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
+           [
+               amanda_cv_pid_type=unknown
+               if test "$ac_cv_type_pid_t" = no; then
+                   amanda_cv_pid_type=int
+               fi
+               for TEST_amanda_cv_pid_type in long short int; do
+                   if test $amanda_cv_pid_type = unknown; then
+                       AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
+                           [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+                           ],
+                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
+                   fi
+                   if test $amanda_cv_pid_type = unknown; then
+                       AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
+                           [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+                               ZZZZ pid_t
+                       ],
+                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
+                   fi
+               done
+               if test $amanda_cv_pid_type = unknown; then
+                   amanda_cv_pid_type=int
+               fi
+           ]
+       )
+       case $amanda_cv_pid_type in
+           int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
+           long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
+           short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
+       esac
+    ]
+)
+
+# SYNOPSIS
+#
+#   CF_WAIT
+#
+# OVERVIEW
+#
+# Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
+# by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
+#
+#   DEFINEs WAIT_USES_UNION if 'union wait' is found.  Note that many systems
+#   support *both* 'union wait' and 'int' using a transparent union.
+#
+#   Original comments:
+#
+#     FIXME: These tests should have been in autoconf 1.11!
+#
+#     Note that we cannot simply grep for 'union wait' in the wait.h file,
+#     because some Posix systems turn this on only when a BSD variable is
+#     defined. Since I'm trying to do without special defines, I'll live
+#     with the default behavior of the include-file.
+#
+#     I do _2_ compile checks, because we may have union-wait, but the
+#     prototype for 'wait()' may want an int.
+#
+#     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
+#     that if we've got union-wait, we'll automatically use it.
+#
+# Garrett Wollman adds:
+#      The tests described above don't quite do the right thing,
+#      since some systems have hacks which allow `union wait' to
+#      still work even though `int' is preferred (and generates
+#      fewer warnings).  Since all of these systems use prototypes,
+#      we can use the prototype of wait(2) to disambiguate them.
+#
+# Alexandre Oliva adds:
+#     A single compile check is enough.  If we don't have union wait,
+#     it's obvious that the test will fail, and that we must use int.
+#     If we do, the prototype (on STDC systems) and WIFEXITED will tell
+#     whether we're supposed to be using union wait instead of int.
+#
+AC_DEFUN([CF_WAIT], [
+    AC_REQUIRE([AC_TYPE_PID_T])
+    AC_HAVE_HEADERS(sys/wait.h wait.h)
+    AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait], [
+        AC_TRY_COMPILE([
+#include <sys/types.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#else
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
+#endif
+
+#ifdef __STDC__
+pid_t wait(union wait *);
+#endif
+], [
+  union wait x; int i;
+  wait(&x); i = WIFEXITED(x)
+], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
+    if test $cf_cv_arg_union_wait = yes; then
+           AC_DEFINE(WAIT_USES_UNION,1,
+               [Defined if wait() puts the status in a union wait instead of int. ])
+    fi
+])
+
+# SYNOPSIS
+#
+#   CF_WAIT_INT
+#
+# OVERVIEW
+#
+# Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
+# by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
+#
+#   DEFINEs WAIT_USES_INT if an int result type is found.
+#
+AC_DEFUN([CF_WAIT_INT], [
+    AC_REQUIRE([AC_TYPE_PID_T])
+    AC_HAVE_HEADERS(sys/wait.h wait.h)
+    AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int], [
+        AC_TRY_COMPILE([
+#include <sys/types.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#else
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
+#endif
+
+#ifdef __STDC__
+pid_t wait(int *);
+#endif
+], [
+  int x; int i;
+  wait(&x); i = WIFEXITED(x)
+], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
+if test $cf_cv_arg_int = yes; then
+        AC_DEFINE(WAIT_USES_INT,1,
+           [Defined if wait() puts the status in a int instead of a union wait. ])
+fi
+])
+
diff --git a/config/amanda/userid.m4 b/config/amanda/userid.m4
new file mode 100644 (file)
index 0000000..8ef15c8
--- /dev/null
@@ -0,0 +1,187 @@
+# SYNOPSIS
+#
+#   AMANDA_DISABLE_INSTALLPERMS
+#
+# OVERVIEW
+#
+#   Handle the --disable-installperms option, which disables all post-install
+#   chown/chmod operations.  This is useful when packaging, as most packaging
+#   systems build as non-root, and apply permissions in the post-install step of
+#   the package itself.
+#
+AC_DEFUN([AMANDA_DISABLE_INSTALLPERMS],
+[
+    WANT_INSTALLPERMS=yes
+    AC_ARG_ENABLE(installperms,
+        AS_HELP_STRING([--disable-installperms],
+                [do not modify ownership and permissions on installed files]),
+        [ WANT_INSTALLPERMS="$enableval" ],
+        [ WANT_INSTALLPERMS="yes" ]
+    )
+    AM_CONDITIONAL(WANT_INSTALLPERMS, test x"$WANT_INSTALLPERMS" = x"yes")
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_FORCE_UID
+#
+# OVERVIEW
+#
+#   Handle the --without-force-id option, which disables userid checks for
+#   all Amanda applications.  Defines CHECK_USERID *unless* this option is
+#   given.
+#
+AC_DEFUN([AMANDA_WITH_FORCE_UID],
+[
+    AC_ARG_WITH(force-uid,
+        AS_HELP_STRING([--without-force-uid],
+                [do not check userids when running programs]),
+        CHECK_USERID="$withval",
+        : ${CHECK_USERID=yes}
+    )
+    case "$CHECK_USERID" in
+        y | ye | yes) 
+            AC_DEFINE(CHECK_USERID, 1,
+                [Define to force to another user on client machines. ])
+          ;;
+        n | no) :
+          ;;
+        *)
+            AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.])
+    esac
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_USER
+#
+# OVERVIEW
+#
+#   Handle the --with-user option, which sets the userid Amanda expects to run
+#   under.  Defines and substitutes CLIENT_LOGIN.
+#
+AC_DEFUN([AMANDA_WITH_USER],
+[
+    AC_ARG_WITH(user,
+        AS_HELP_STRING([--with-user=USER],
+                [force execution to USER on client systems (REQUIRED)]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-user option.])
+                  ;;
+                *) 
+                    CLIENT_LOGIN="$withval"
+                  ;;
+            esac
+        ], [
+            AMANDA_MSG_WARN([[no user specified (--with-user) -- using 'amanda']])
+           CLIENT_LOGIN=amanda
+        ]
+    )
+
+    AC_DEFINE_UNQUOTED(CLIENT_LOGIN,"$CLIENT_LOGIN",
+        [Define as a the user to force to on client machines. ])
+    AC_SUBST(CLIENT_LOGIN)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_GROUP
+#
+# OVERVIEW
+#
+#   Handle the --with-group option, which sets the groupid Amanda expects to run
+#   under.  Substitutes (but does not define) SETUID_GROUP.
+#
+AC_DEFUN([AMANDA_WITH_GROUP],
+[
+    AC_ARG_WITH(group,
+        AS_HELP_STRING([--with-group=GROUP],
+            [group allowed to execute setuid-root programs (REQUIRED)]),
+        [
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    AC_MSG_ERROR([*** You must supply an argument to the --with-group option.])
+                  ;;
+                *) SETUID_GROUP="$withval"
+                  ;;
+            esac
+        ], [
+            AMANDA_MSG_WARN([[no group specified (--with-group) -- using 'backup']])
+           CLIENT_LOGIN=backup
+        ]
+    )
+    AC_SUBST(SETUID_GROUP)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_OWNER
+#
+# OVERVIEW
+#
+#   Handle the --with-owner option, which sets the userid the 'make install' process
+#   will use.  Substitutes and defines BINARY_OWNER.
+#
+AC_DEFUN([AMANDA_WITH_OWNER],
+[
+    AC_REQUIRE([AMANDA_WITH_USER])
+    AC_ARG_WITH(owner,
+        AS_HELP_STRING([--with-owner=USER]
+            [force ownership of installed files to USER (default same as --with-user)]),
+        [
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+                AC_MSG_ERROR([*** You must supply an argument to the --with-owner option.])
+              ;;
+            *) BINARY_OWNER="$withval"
+              ;;
+            esac
+        ], [
+            BINARY_OWNER="$CLIENT_LOGIN"
+        ]
+    )
+    AC_DEFINE_UNQUOTED(BINARY_OWNER,"$BINARY_OWNER",
+        [Define as the user who owns installed binaries. ])
+    AC_SUBST(BINARY_OWNER)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_SINGLE_USERID
+#
+# OVERVIEW
+#
+#   Check if this system is one on which clients should be built setuid, 
+#   Sets up AM_CONDITIONAL/define WANT_SETUID_CLIENT and defines 
+#   SINGLE_USERID if either the system requires it or the user specified it.
+#
+AC_DEFUN([AMANDA_WITH_SINGLE_USERID],
+[
+    SINGLE_USERID=${SINGLE_USERID:-no}
+    WANT_SETUID_CLIENT=${WANT_SETUID_CLIENT:-true}
+
+    AC_ARG_WITH(single-userid,
+        AS_HELP_STRING([--with-single-userid]
+            [force amanda to run as a single userid (for testing)]),
+        [   SINGLE_USERID=$withval ])
+
+    case "$target" in
+        *-pc-cygwin)
+            WANT_SETUID_CLIENT=false
+           SINGLE_USERID=yes
+            ;;
+    esac
+
+    if test x"$WANT_SETUID_CLIENT" = x"true"; then
+        AC_DEFINE(WANT_SETUID_CLIENT,1,
+            [Define if clients should be built setuid-root])
+    fi
+    AM_CONDITIONAL(WANT_SETUID_CLIENT, test x"$WANT_SETUID_CLIENT" = x"true")
+
+    if test x"$SINGLE_USERID" = x"yes"; then
+        AC_DEFINE(SINGLE_USERID, 1,
+           [Define if all of Amanda will run as a single userid (e.g., on Cygwin or for installchecks)])
+    fi
+])
diff --git a/config/amanda/version.m4 b/config/amanda/version.m4
new file mode 100644 (file)
index 0000000..f1ecb8a
--- /dev/null
@@ -0,0 +1,115 @@
+# Amanda version handling macros
+
+# SYNOPSIS
+#
+#   AMANDA_SNAPSHOT_STAMP
+#
+# DESCRIPTION
+#
+#   If srcdir contains a file named SNAPSHOT, with a line matching
+#      Snapshot Date: [0-9]*
+#   then set add the date to VERSION and set 
+#   SNAPSHOT_STAMP=SNAPSHOT.
+#
+AC_DEFUN([AMANDA_SNAPSHOT_STAMP],
+[
+    if test -f "$srcdir/SNAPSHOT"; then
+      cat < "$srcdir/SNAPSHOT"
+    changequote(,)
+      snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT`
+    changequote([,])
+      test -z "$snapdate" || VERSION="$VERSION-$snapdate"
+      SNAPSHOT_STAMP=SNAPSHOT
+    else
+      SNAPSHOT_STAMP=
+    fi
+    AC_SUBST(SNAPSHOT_STAMP)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_SPLIT_VERSION
+#
+# DESCRIPTION
+#
+#   Set the version number of this release of Amanda from the VERSION
+#   string, which is set in AM_INIT_AUTOMAKE.  Sets VERSION_MAJOR,
+#   VERSION_MINOR, VERSION_PATCH, and VERSION_COMMENT to the 
+#   corresponding components of VERSION, and VERSION_SUFFIX to a
+#   version-specific filename suffix.
+#
+AC_DEFUN([AMANDA_SPLIT_VERSION],
+[
+    changequote(,)
+    VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'`
+    VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'`
+    VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+    VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\"
+    changequote([,])
+
+    VERSION_SUFFIX="$VERSION"
+    AC_SUBST(VERSION_MAJOR)
+    AC_SUBST(VERSION_MINOR)
+    AC_SUBST(VERSION_PATCH)
+    AC_SUBST(VERSION_COMMENT)
+    AC_SUBST(VERSION_SUFFIX)
+])
+
+# SYNOPSIS
+#
+#   AMANDA_WITH_SUFFIXES
+#
+# DESCRIPTION
+#
+#   Implement the --with-suffixes option.  If it is given, then set
+#   program_transform_name appropriately and AC_DEFINE USE_VERSION_SUFFIXES to 1.
+#   USE_VERSION_SUFFIXES is substituted with the value 'no' or 'yes'.
+#
+AC_DEFUN([AMANDA_WITH_SUFFIXES],
+[
+    AC_ARG_WITH(suffixes,
+       [  --with-suffixes        install binaries with version string appended to name],
+       USE_VERSION_SUFFIXES=$withval,
+       : ${USE_VERSION_SUFFIXES=no}
+    )
+
+    case "$USE_VERSION_SUFFIXES" in
+    y | ye | yes) USE_VERSION_SUFFIXES=yes
+       AC_DEFINE(USE_VERSION_SUFFIXES, 1,
+           [Define to have programs use version suffixes when calling other programs.])
+
+       program_suffix="-$VERSION_SUFFIX"
+       # This is from the output of configure.in.
+       if test "x$program_transform_name" = xs,x,x,; then
+           program_transform_name=
+       else
+           # Double any \ or $.  echo might interpret backslashes.
+           cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+           program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+           rm -f conftestsed
+       fi
+       test "x$program_prefix" != xNONE &&
+           program_transform_name="s,^,${program_prefix},; $program_transform_name"
+       # Use a double $ so make ignores it.
+       test "x$program_suffix" != xNONE &&
+           program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+       # sed with no file args requires a program.
+       test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
+       # Remove empty command
+       cat <<\EOF_SED > conftestsed
+s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
+EOF_SED
+       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+       rm -f conftestsed
+      ;;
+    n | no) USE_VERSION_SUFFIXES=no
+      ;;
+    *) AC_MSG_ERROR([*** You must not supply an argument to --with-suffixes option.])
+      ;;
+    esac
+
+    AC_SUBST(USE_VERSION_SUFFIXES)
+])
diff --git a/config/automake/file-list b/config/automake/file-list
new file mode 100644 (file)
index 0000000..7038942
--- /dev/null
@@ -0,0 +1,5 @@
+## this file is automatically generated by autogen
+EXTRA_DIST += automake/installperms.am
+EXTRA_DIST += automake/precompile.am
+EXTRA_DIST += automake/scripts.am
+EXTRA_DIST += automake/vars.am
diff --git a/config/automake/installperms.am b/config/automake/installperms.am
new file mode 100644 (file)
index 0000000..245345b
--- /dev/null
@@ -0,0 +1,91 @@
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs=s|^.*/||
+
+if WANT_INSTALLPERMS
+installperms-exec:
+       @installperms="$(INSTALLPERMS_exec)"; \
+       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+       dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda) \
+                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+                   if test -n "$$chown"; then \
+                       echo chown "$$chown" "$$pa"; \
+                       chown "$$chown" "$$pa" || exit 1; \
+                   fi; \
+                   if test -n "$$chmod"; then \
+                       echo chmod "$$chmod" "$$pa"; \
+                       chmod "$$chmod" "$$pa" || exit 1; \
+                   fi; \
+           esac; \
+       done
+
+installperms-data:
+       @installperms="$(INSTALLPERMS_data)"; \
+       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+       dest=; chown=; chmod=; \
+       for cmd in $$installperms; do \
+           case "$$cmd" in \
+               chown=amanda) \
+                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+               dest=*|chown=*|chmod=*) \
+                       echo "  ($$cmd)"; eval $$cmd;; \
+               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+                   if test -n "$$chown"; then \
+                       echo chown "$$chown" "$$pa"; \
+                       chown "$$chown" "$$pa" || exit 1; \
+                   fi; \
+                   if test -n "$$chmod"; then \
+                       echo chmod "$$chmod" "$$pa"; \
+                       chmod "$$chmod" "$$pa" || exit 1; \
+                   fi; \
+           esac; \
+       done
+
+install-exec-hook: installperms-exec
+install-data-hook: installperms-data
+endif
diff --git a/config/automake/precompile.am b/config/automake/precompile.am
new file mode 100644 (file)
index 0000000..36444d9
--- /dev/null
@@ -0,0 +1,11 @@
+# vim:ft=automake
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
diff --git a/config/automake/scripts.am b/config/automake/scripts.am
new file mode 100644 (file)
index 0000000..129df49
--- /dev/null
@@ -0,0 +1,141 @@
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# config.status leaves config.log files around
+CLEANFILES += config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
diff --git a/config/automake/vars.am b/config/automake/vars.am
new file mode 100644 (file)
index 0000000..88aa8a8
--- /dev/null
@@ -0,0 +1,32 @@
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+SUFFIXES =
+
+EXTRA_DIST =
+
+BUILT_SOURCES =
+
+MOSTLYCLEANFILES =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES = 
diff --git a/config/compile b/config/compile
new file mode 100644 (file)
index 0000000..80b645b
--- /dev/null
@@ -0,0 +1,140 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2004-09-10.20
+
+# Copyright (C) 1999, 2000, 2003, 2004 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No 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 0
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit 0
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+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 -e 's|^.*/||' -e '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
+  mv "$cofile" "$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-end: "$"
+# End:
index 892833f9484bffa443384460ef3dd5ee86266cce..6960a397af3d7fc2bdd085f7eb7e82542ce76773 100755 (executable)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2005-02-10'
+timestamp='2007-01-15'
 
 # 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
@@ -17,13 +18,15 @@ timestamp='2005-02-10'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Originally written by Per Bothner <per@bothner.com>.
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -66,11 +69,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -104,7 +107,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -136,6 +139,23 @@ 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
 
+if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
+       eval $set_cc_for_build
+       cat << EOF > $dummy.c
+       #include <features.h>
+       #ifdef __UCLIBC__
+       # ifdef __UCLIBC_CONFIG_VERSION__
+       LIBC=uclibc __UCLIBC_CONFIG_VERSION__
+       # else
+       LIBC=uclibc
+       # endif
+       #else
+       LIBC=gnu
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
+fi
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -158,6 +178,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
@@ -196,55 +217,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit 0 ;;
-    amd64:OpenBSD:*:*)
-       echo x86_64-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    cats:OpenBSD:*:*)
-       echo arm-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    luna88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    macppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mips64-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sun3:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
     macppc:MirBSD:*:*)
-       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
     *:MirBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -297,40 +286,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # 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'`
-       exit ;;
+       exit ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
        # of the specific Alpha model?
        echo alpha-pc-interix
-       exit ;;
+       exit ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit 0;;
+       exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
+       exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
+       exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit ;;
+       exit ;;
     *:z/VM:*:*)
        echo s390-ibm-zvmoe
-       exit ;;
+       exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-       exit ;;
+       exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
+       exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
+       exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -338,32 +330,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit ;;
+       exit ;;
     DRS?6000:unix:4.0:6*)
        echo sparc-icl-nx6
-       exit ;;
+       exit ;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
        case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7 && exit 0 ;;
+           sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     i86pc:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -372,10 +364,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -387,10 +379,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -401,40 +393,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -458,32 +450,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c \
-         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
        echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit ;;
+       exit ;;
     Motorola:*:4.3:PL8-*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -499,29 +492,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -529,7 +522,7 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
                eval $set_cc_for_build
@@ -544,14 +537,18 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-               echo rs6000-ibm-aix3.2.5
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
+       exit ;;
     *:AIX:*:[45])
        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
@@ -565,28 +562,28 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
+       exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
@@ -648,9 +645,19 @@ EOF
        esac
        if [ ${HP_ARCH} = "hppa2.0w" ]
        then
-           # avoid double evaluation of $set_cc_for_build
-           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+           eval $set_cc_for_build
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep __LP64__ >/dev/null
            then
                HP_ARCH="hppa2.0w"
            else
@@ -658,11 +665,11 @@ EOF
            fi
        fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     3050*:HI-UX:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -690,161 +697,179 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
+       exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit ;;
+       exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     *:UNICOS/mp:*:*)
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       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 ;;
+        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 ;;
+       exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit 0 ;;
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
-    i*:MINGW*:*)
+       exit ;;
+    *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit 0 ;;
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit 0 ;;
-    x86:Interix*:[34]*)
-       echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit 0 ;;
+       exit ;;
+    x86:Interix*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
        echo i586-pc-interix
-       exit ;;
+       exit ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit ;;
-    amd64:CYGWIN*:*:*)
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
        echo x86_64-unknown-cygwin
-       exit ;;
+       exit ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     *:GNU:*:*)
        # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
+       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/[-(].*//'`-gnu
-       exit ;;
+       exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
+       exit ;;
     arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
-       exit ;;
+       echo cris-axis-linux-${LIBC}
+       exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
-       exit ;;
+       echo crisv32-axis-linux-${LIBC}
+       exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
-       exit ;;
+       echo frv-unknown-linux-${LIBC}
+       exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     mips:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -861,8 +886,12 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
     mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -880,15 +909,22 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
        ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-${LIBC}
+       exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
-       exit ;;
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
-       exit ;;
+       echo powerpc64-unknown-linux-${LIBC}
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -900,35 +936,41 @@ EOF
          EV68*) UNAME_MACHINE=alphaev68 ;;
         esac
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
        esac
-       exit ;;
+       exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
-       exit ;;
+       echo hppa64-unknown-linux-${LIBC}
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
+       exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit 0 ;;
+       echo x86_64-unknown-linux-${LIBC}
+       exit ;;
+    xtensa:Linux:*:*)
+       echo xtensa-unknown-linux-${LIBC}
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -942,20 +984,22 @@ EOF
                                    p'`
         case "$ld_supported_targets" in
          elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+               TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
                ;;
          a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit ;;
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
+               exit ;;
          coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit ;;
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
+               exit ;;
          "")
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
                # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-               exit ;;
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
+               exit ;;
        esac
+       # This should get integrated into the C code below, but now we hack
+       if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
        # Determine whether the default compiler is a.out or elf
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -971,7 +1015,7 @@ EOF
        LIBC=gnulibc1
        # endif
        #else
-       #ifdef __INTEL_COMPILER
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
        LIBC=gnu
        #else
        LIBC=gnuaout
@@ -981,16 +1025,23 @@ EOF
        LIBC=dietlibc
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       test x"${LIBC}" != x && {
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+               exit
+       }
+       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
        ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
        # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -998,27 +1049,27 @@ EOF
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
        echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
+       exit ;;
     i*86:XTS-300:*:STOP)
        echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
+       exit ;;
     i*86:atheos:*:*)
        echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-       i*86:syllable:*:*)
+       exit ;;
+    i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
+       exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
+       exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1026,15 +1077,16 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit 0 ;;
-    i*86:*:5:[78]*)
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1052,73 +1104,73 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit ;;
+       exit ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
-        exit ;;
+        exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit ;;
+       exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
        echo m68k-convergent-sysv
-       exit ;;
+       exit ;;
     M680?0:D-NIX:5.3:*)
        echo m68k-diab-dnix
-       exit ;;
+       exit ;;
     M68*:*:R3V[5678]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit ;;
+       exit ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1126,69 +1178,81 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
+       exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit 0 ;;
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
-       exit ;;
+       exit ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
                echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit ;;
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-nec-superux${UNAME_RELEASE}
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
        case $UNAME_PROCESSOR in
-           *86) UNAME_PROCESSOR=i686 ;;
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
        if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1196,25 +1260,25 @@ EOF
                UNAME_MACHINE=pc
        fi
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit ;;
+       exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1225,41 +1289,47 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
+       exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit ;;
+       exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
+       exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
-           A*) echo alpha-dec-vms && exit 0 ;;
-           I*) echo ia64-dec-vms && exit 0 ;;
-           V*) echo vax-dec-vms && exit 0 ;;
+           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 0 ;;
+       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 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1291,7 +1361,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1380,11 +1450,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1393,22 +1464,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
        echo c1-convex-bsd
-       exit ;;
+       exit ;;
     c2*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-       exit ;;
+       exit ;;
     c34*)
        echo c34-convex-bsd
-       exit ;;
+       exit ;;
     c38*)
        echo c38-convex-bsd
-       exit ;;
+       exit ;;
     c4*)
        echo c4-convex-bsd
-       exit ;;
+       exit ;;
     esac
 fi
 
@@ -1419,7 +1490,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index 0f029207f687965f613b82bada86730f311f8f90..74e81696eb4a3fbe03d133554682ece9b663cd3f 100644 (file)
@@ -1,14 +1,8 @@
 /* config/config.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define this to an absolute name of <string.h>. */
-#undef ABSOLUTE_STRING_H
-
-/* Define on AIX. */
+/* Is DUMP the AIX program 'backup'? */
 #undef AIX_BACKUP
 
-/* Define on AIX. */
-#undef AIX_TAPEIO
-
 /* Location of Amanda directories and files. */
 #undef AMANDA_DBGDIR
 
 /* Define as the user who owns installed binaries. */
 #undef BINARY_OWNER
 
+/* Define to the number of bits in type 'ptrdiff_t'. */
+#undef BITSIZEOF_PTRDIFF_T
+
+/* Define to the number of bits in type 'sig_atomic_t'. */
+#undef BITSIZEOF_SIG_ATOMIC_T
+
+/* Define to the number of bits in type 'size_t'. */
+#undef BITSIZEOF_SIZE_T
+
+/* Define to the number of bits in type 'wchar_t'. */
+#undef BITSIZEOF_WCHAR_T
+
+/* Define to the number of bits in type 'wint_t'. */
+#undef BITSIZEOF_WINT_T
+
 /* Define if BSDTCP transport should be enabled. */
 #undef BSDTCP_SECURITY
 
 /* Define to use BSD .rhosts/.amandahosts security. */
 #undef BSD_SECURITY
 
+/* Define to force to another user on client machines. */
+#undef CHECK_USERID
+
 /* The Kerberos client host instance. */
 #undef CLIENT_HOST_INSTANCE
 
 /* The Kerberos client host key file. */
 #undef CLIENT_HOST_KEY_FILE
 
-/* The Kerberos client host principle. */
-#undef CLIENT_HOST_PRINCIPLE
+/* The Kerberos client host principal. */
+#undef CLIENT_HOST_PRINCIPAL
 
 /* Define as a the user to force to on client machines. */
 #undef CLIENT_LOGIN
@@ -63,9 +75,6 @@
 /* Define to the suffix for the COMPRESS_PATH compression program. */
 #undef COMPRESS_SUFFIX
 
-/* Saves the original ./configure command line arguments */
-#undef CONFIGURE_COMMAND
-
 /* The directory in which configuration directories should be created. */
 #undef CONFIG_DIR
 
@@ -77,8 +86,8 @@
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
 
-/* Define if you want debugging. */
-#undef DEBUG_CODE
+/* Default location for 'amandates' */
+#undef DEFAULT_AMANDATES_FILE
 
 /* This is the default changer device. */
 #undef DEFAULT_CHANGER_DEVICE
 /* This is the default Amanda configuration. */
 #undef DEFAULT_CONFIG
 
-/* For Linux systems with floppy tapes: * QIC volume table support via raw
-   tape device. */
-#undef DEFAULT_RAW_TAPE_DEVICE
-
 /* This is the default Amanda index server. */
 #undef DEFAULT_SERVER
 
 /* Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ */
 #undef DEV_PREFIX
 
-/* Define on Cygwin. */
-#undef DONT_SUID_ROOT
-
 /* Define the location of the ufsdump, backup, or dump program. */
 #undef DUMP
 
 /* Define this if this system's dump exits with 1 as a success code. */
 #undef DUMP_RETURNS_1
 
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
 /* Define as good substitute value for EOVERFLOW. */
 #undef EOVERFLOW
 
-/* Define to force to another user on client machines. */
-#undef FORCE_USERID
-
 /* Define to 1 if the `getpgrp' function requires zero arguments. */
 #undef GETPGRP_VOID
 
-/* Define to the location of Gnu tar. */
+/* Define if gettimeofday clobbers the localtime buffer. */
+#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
+
+/* Location of the GNU 'tar' binary */
 #undef GNUTAR
 
 /* The directory in which GNU tar should store directory lists for
 /* Define if accept is declared. */
 #undef HAVE_ACCEPT_DECL
 
-/* Define to enable AIX tape-changer support */
-#undef HAVE_AIX_LIKE_SCSI
-
 /* Define to 1 if you have `alloca', as a function or macro. */
 #undef HAVE_ALLOCA
 
 /* Define if atof is declared. */
 #undef HAVE_ATOF_DECL
 
-/* Define to 1 if you have the `atoi' function. */
-#undef HAVE_ATOI
-
-/* Define if atoi is declared. */
-#undef HAVE_ATOI_DECL
-
 /* Define to 1 if you have the `atol' function. */
 #undef HAVE_ATOL
 
 /* Define if bind is declared. */
 #undef HAVE_BIND_DECL
 
-/* Define this if issuing a fsf on a tape fails when you are not at a tape *
-   mark, for instance, if amrecover gives I/O errors when skipping. */
-#undef HAVE_BROKEN_FSF
-
-/* Define to enable BSD tape-changer support */
-#undef HAVE_BSD_LIKE_SCSI
-
 /* Define to 1 if you have the `bzero' function. */
 #undef HAVE_BZERO
 
 /* Define to 1 if you have the <camlib.h> header file. */
 #undef HAVE_CAMLIB_H
 
-/* Define to 1 if you have the <cam/cam.h> header file. */
-#undef HAVE_CAM_CAM_H
-
-/* Define to enable CAM tape-changer support */
-#undef HAVE_CAM_LIKE_SCSI
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+   CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
 
-/* Define to 1 if you have the <cam/scsi/scsi_message.h> header file. */
-#undef HAVE_CAM_SCSI_SCSI_MESSAGE_H
-
-/* Define if limits.h defines CHAR_BIT. */
-#undef HAVE_CHAR_BIT
-
-/* Define if limits.h defines CHAR_MAX. */
-#undef HAVE_CHAR_MAX
-
-/* Define if limits.h defines CHAR_MIN. */
-#undef HAVE_CHAR_MIN
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+   the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
 /* Define to 1 if you have the <chio.h> header file. */
 #undef HAVE_CHIO_H
 /* Define if connect is declared. */
 #undef HAVE_CONNECT_DECL
 
-/* Define to 1 if you have the <dbm.h> header file. */
-#undef HAVE_DBM_H
+/* Define to 1 if you have the <crypto/hmac.h> header file. */
+#undef HAVE_CRYPTO_HMAC_H
 
-/* Define to 1 if you have the `dbm_open' function. */
-#undef HAVE_DBM_OPEN
-
-/* Define if dbm_open is declared. */
-#undef HAVE_DBM_OPEN_DECL
-
-/* Define to 1 if you have the <db.h> header file. */
-#undef HAVE_DB_H
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+#undef HAVE_DCGETTEXT
 
 /* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you
    don't. */
    don't. */
 #undef HAVE_DECL_INET_NTOP
 
+/* Define to 1 if you have the declaration of `mkdir', and to 0 if you don't.
+   */
+#undef HAVE_DECL_MKDIR
+
+/* Define to 1 if you have the declaration of `readdir', and to 0 if you
+   don't. */
+#undef HAVE_DECL_READDIR
+
+/* Define to 1 if you have the declaration of `readdir64', and to 0 if you
+   don't. */
+#undef HAVE_DECL_READDIR64
+
+/* Define to 1 if you have the declaration of `readdir64_r', and to 0 if you
+   don't. */
+#undef HAVE_DECL_READDIR64_R
+
+/* Define to 1 if you have the declaration of `readdir_r', and to 0 if you
+   don't. */
+#undef HAVE_DECL_READDIR_R
+
 /* Define to 1 if you have the declaration of `snprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL_SNPRINTF
    */
 #undef HAVE_DECL_STRDUP
 
+/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL__SNPRINTF
+
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
 #undef HAVE_DIRENT_H
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
 /* Define to the string that enables dump estimates. */
 #undef HAVE_DUMP_ESTIMATE
 
+/* Define to 1 if you have the <dustat.h> header file. */
+#undef HAVE_DUSTAT_H
+
 /* Define to 1 if you have the `endmntent' function. */
 #undef HAVE_ENDMNTENT
 
 /* Define if fflush is declared. */
 #undef HAVE_FFLUSH_DECL
 
-/* Define to 1 if you have the `flock' function. */
-#undef HAVE_FLOCK
-
-/* Define if flock is declared. */
-#undef HAVE_FLOCK_DECL
-
-/* Define to 1 if you have the `fnmatch' function. */
-#undef HAVE_FNMATCH
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#undef HAVE_FNMATCH_H
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
 
 /* Define to 1 if you have the `fprintf' function. */
 #undef HAVE_FPRINTF
 /* Define if fwrite is declared. */
 #undef HAVE_FWRITE_DECL
 
-/* Define to 1 if you have the `gai_strerror' function. */
-#undef HAVE_GAI_STRERROR
-
 /* Define to 1 if you have the `getaddrinfo' function. */
 #undef HAVE_GETADDRINFO
 
-/* Define to 1 if you have the `getfsent' function. */
-#undef HAVE_GETFSENT
-
 /* Define to 1 if you have the `gethostbyname' function. */
 #undef HAVE_GETHOSTBYNAME
 
 /* Define if gethostname is declared. */
 #undef HAVE_GETHOSTNAME_DECL
 
-/* Define to 1 if you have the `getmntent' function. */
-#undef HAVE_GETMNTENT
-
 /* Define to 1 if you have the `getopt' function. */
 #undef HAVE_GETOPT
 
 /* Define if getpeername is declared. */
 #undef HAVE_GETPEERNAME_DECL
 
-/* Define to 1 if you have the `getpgrp' function. */
-#undef HAVE_GETPGRP
-
 /* Define to 1 if you have the `getsockname' function. */
 #undef HAVE_GETSOCKNAME
 
 /* Define if getsockopt is declared. */
 #undef HAVE_GETSOCKOPT_DECL
 
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
+/* Define to 1 if you have the `getsysinfo' function. */
+#undef HAVE_GETSYSINFO
 
-/* Define if gettimeofday is declared. */
-#undef HAVE_GETTIMEOFDAY_DECL
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
 
-/* Define to 1 if you have the `getvfsent' function. */
-#undef HAVE_GETVFSENT
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the <grp.h> header file. */
 #undef HAVE_GRP_H
 /* Define to 1 if you have the <history.h> header file. */
 #undef HAVE_HISTORY_H
 
+/* Define to 1 if you have the <hmac.h> header file. */
+#undef HAVE_HMAC_H
+
 /* Define this if dump accepts -h for honoring nodump. */
 #undef HAVE_HONOR_NODUMP
 
-/* Define to enable HPUX tape-changer support. */
-#undef HAVE_HPUX_LIKE_SCSI
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
 
-/* Define to enable HPUX chio based changer support. */
-#undef HAVE_HPUX_SCSI_CHIO
+/* Define if your compiler supports the #include_next directive. */
+#undef HAVE_INCLUDE_NEXT
 
 /* Define to 1 if you have the `inet_ntop' function. */
 #undef HAVE_INET_NTOP
 /* Define if ioctl is declared. */
 #undef HAVE_IOCTL_DECL
 
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
 /* Define to 1 if <sys/socket.h> defines AF_INET. */
 #undef HAVE_IPV4
 
 /* Define to 1 if <sys/socket.h> defines AF_INET6. */
 #undef HAVE_IPV6
 
-/* Define to enable IRIX tape-changer support */
-#undef HAVE_IRIX_LIKE_SCSI
-
-/* Define to 1 if you have the `isascii' function. */
-#undef HAVE_ISASCII
-
 /* Define to 1 if you have the `isnormal' function. */
 #undef HAVE_ISNORMAL
 
 /* Define if isnormal is declared. */
 #undef HAVE_ISNORMAL_DECL
 
-/* Define to 1 if you have the `c' library (-lc). */
-#undef HAVE_LIBC
-
 /* Define to 1 if you have the `cam' library (-lcam). */
 #undef HAVE_LIBCAM
 
-/* Define to 1 if you have the `curses' library (-lcurses). */
-#undef HAVE_LIBCURSES
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have a functional curl library. */
+#undef HAVE_LIBCURL
 
 /* Define to 1 if you have the `cur_colr' library (-lcur_colr). */
 #undef HAVE_LIBCUR_COLR
 /* Define to 1 if you have the <libc.h> header file. */
 #undef HAVE_LIBC_H
 
-/* Define to 1 if you have the `db' library (-ldb). */
-#undef HAVE_LIBDB
-
-/* Define to 1 if you have the `dbm' library (-ldbm). */
-#undef HAVE_LIBDBM
-
-/* Define to 1 if you have the `dbmalloc' library (-ldbmalloc). */
-#undef HAVE_LIBDBMALLOC
-
-/* Define to 1 if you have the `gdbm' library (-lgdbm). */
-#undef HAVE_LIBGDBM
-
 /* Define to 1 if you have the <libgen.h> header file. */
 #undef HAVE_LIBGEN_H
 
 /* Define to 1 if you have the `m' library (-lm). */
 #undef HAVE_LIBM
 
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
-#undef HAVE_LIBNCURSES
-
-/* Define to 1 if you have the `ndbm' library (-lndbm). */
-#undef HAVE_LIBNDBM
-
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
-/* Define to 1 if you have the `readline' library (-lreadline). */
-#undef HAVE_LIBREADLINE
-
 /* Define to 1 if you have the `resolv' library (-lresolv). */
 #undef HAVE_LIBRESOLV
 
 /* Define to 1 if you have the `sun' library (-lsun). */
 #undef HAVE_LIBSUN
 
-/* Define to 1 if you have the `termcap' library (-ltermcap). */
-#undef HAVE_LIBTERMCAP
-
-/* Define to 1 if you have the `vtblc' library (-lvtblc). */
-#undef HAVE_LIBVTBLC
+/* Define to 1 if you have the `xpg4' library (-lxpg4). */
+#undef HAVE_LIBXPG4
 
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
-/* Define to enable Linux tape-changer support. */
-#undef HAVE_LINUX_LIKE_SCSI
+/* Define to 1 if you have the <linux/chio.h> header file. */
+#undef HAVE_LINUX_CHIO_H
 
 /* Define to 1 if you have the <linux/zftape.h> header file. */
 #undef HAVE_LINUX_ZFTAPE_H
 /* Define if listen is declared. */
 #undef HAVE_LISTEN_DECL
 
-/* Define if you have the 'long double' type. */
-#undef HAVE_LONG_DOUBLE
-
 /* Define if you have the 'long long' type. */
 #undef HAVE_LONG_LONG
 
 /* Define if lstat is declared. */
 #undef HAVE_LSTAT_DECL
 
+/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
+#undef HAVE_MACHINE_HAL_SYSINFO_H
+
 /* Define to 1 if you have the `malloc' function. */
 #undef HAVE_MALLOC
 
 /* Define if malloc is declared. */
 #undef HAVE_MALLOC_DECL
 
+/* Define if the 'malloc' function is POSIX compliant. */
+#undef HAVE_MALLOC_POSIX
+
 /* Define to 1 if you have the <math.h> header file. */
 #undef HAVE_MATH_H
 
 /* Define if memset is declared. */
 #undef HAVE_MEMSET_DECL
 
-/* Define to 1 if you have the `mkdir' function. */
-#undef HAVE_MKDIR
+/* Define to 1 if you have the `mkdtemp' function. */
+#undef HAVE_MKDTEMP
 
 /* Define to 1 if you have the `mkstemp' function. */
 #undef HAVE_MKSTEMP
 /* Define if the mtget structure has an mt_flags field */
 #undef HAVE_MT_FLAGS
 
-/* Define to 1 if you have the <ndbm.h> header file. */
-#undef HAVE_NDBM_H
-
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #undef HAVE_NETINET_IN_H
 
-/* Define to 1 if you have the <netinet/in_systm.h> header file. */
-#undef HAVE_NETINET_IN_SYSTM_H
-
-/* Define to 1 if you have the <netinet/ip.h> header file. */
-#undef HAVE_NETINET_IP_H
-
 /* Define to 1 if you have the `on_exit' function. */
 #undef HAVE_ON_EXIT
 
 /* Define if openlog is declared. */
 #undef HAVE_OPENLOG_DECL
 
+/* Define to 1 if you have the <openssl/hmac.h> header file. */
+#undef HAVE_OPENSSL_HMAC_H
+
 /* Define to 1 if you have the `pclose' function. */
 #undef HAVE_PCLOSE
 
 /* Define if printf is declared. */
 #undef HAVE_PRINTF_DECL
 
+/* Define to 1 if you have the `pstat_getdynamic' function. */
+#undef HAVE_PSTAT_GETDYNAMIC
+
+/* Define to 1 if you have the `pstat_getstatic' function. */
+#undef HAVE_PSTAT_GETSTATIC
+
 /* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
 #undef HAVE_PTHREAD_MUTEX_RECURSIVE
 
 /* Define if puts is declared. */
 #undef HAVE_PUTS_DECL
 
+/* System has readline support (headers and libraries) */
+#undef HAVE_READLINE
+
 /* Define to 1 if you have the <readline.h> header file. */
 #undef HAVE_READLINE_H
 
 /* Define if rewind is declared. */
 #undef HAVE_REWIND_DECL
 
-/* Define to 1 if you have the `rmdir' function. */
-#undef HAVE_RMDIR
-
 /* Define to 1 if you have the `ruserok' function. */
 #undef HAVE_RUSEROK
 
 /* Define to 1 if you have the `sigemptyset' function. */
 #undef HAVE_SIGEMPTYSET
 
+/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
+#undef HAVE_SIGNED_SIG_ATOMIC_T
+
+/* Define to 1 if 'wchar_t' is a signed integer type. */
+#undef HAVE_SIGNED_WCHAR_T
+
+/* Define to 1 if 'wint_t' is a signed integer type. */
+#undef HAVE_SIGNED_WINT_T
+
 /* Define to 1 if you have the `sigvec' function. */
 #undef HAVE_SIGVEC
 
 /* Define if socket is declared. */
 #undef HAVE_SOCKET_DECL
 
-/* Define to enable Solaris tape-changer support */
-#undef HAVE_SOLARIS_LIKE_SCSI
-
 /* Define to 1 if you have the `sscanf' function. */
 #undef HAVE_SSCANF
 
 /* Define if sscanf is declared. */
 #undef HAVE_SSCANF_DECL
 
-/* Define to 1 if you have the `statfs' function. */
-#undef HAVE_STATFS
-
-/* Define to 1 if you have the `statvfs' function. */
-#undef HAVE_STATVFS
-
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
    uintmax_t. */
 #undef HAVE_STDINT_H_WITH_UINTMAX
 
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
 /* Define to 1 if the system has the type `struct addrinfo'. */
 #undef HAVE_STRUCT_ADDRINFO
 
-/* Define if the database header declares struct datum. */
-#undef HAVE_STRUCT_DATUM
+/* Define to 1 if you have the `sysctl' function. */
+#undef HAVE_SYSCTL
 
 /* Define to 1 if you have the `syslog' function. */
 #undef HAVE_SYSLOG
 /* Define to 1 if you have the <syslog.h> header file. */
 #undef HAVE_SYSLOG_H
 
+/* Define to 1 if you have the `sysmp' function. */
+#undef HAVE_SYSMP
+
 /* Define to 1 if you have the `system' function. */
 #undef HAVE_SYSTEM
 
 /* Define if SysV shared-memory functions are available. */
 #undef HAVE_SYSVSHM
 
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+#undef HAVE_SYS_BITYPES_H
+
 /* Define to 1 if you have the <sys/chio.h> header file. */
 #undef HAVE_SYS_CHIO_H
 
 /* Define to 1 if you have the <sys/file.h> header file. */
 #undef HAVE_SYS_FILE_H
 
+/* Define to 1 if you have the <sys/filsys.h> header file. */
+#undef HAVE_SYS_FILSYS_H
+
+/* Define to 1 if you have the <sys/fs/s5param.h> header file. */
+#undef HAVE_SYS_FS_S5PARAM_H
+
+/* Define to 1 if you have the <sys/fs_types.h> header file. */
+#undef HAVE_SYS_FS_TYPES_H
+
 /* Define to 1 if you have the <sys/gscdds.h> header file. */
 #undef HAVE_SYS_GSCDDS_H
 
+/* Define to 1 if you have the <sys/inttypes.h> header file. */
+#undef HAVE_SYS_INTTYPES_H
+
 /* Define to 1 if you have the <sys/ioctl.h> header file. */
 #undef HAVE_SYS_IOCTL_H
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+#undef HAVE_SYS_PSTAT_H
+
 /* Define to 1 if you have the <sys/scarray.h> header file. */
 #undef HAVE_SYS_SCARRAY_H
 
 /* Define to 1 if you have the <sys/statfs.h> header file. */
 #undef HAVE_SYS_STATFS_H
 
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-#undef HAVE_SYS_STATVFS_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/sysctl.h> header file. */
+#undef HAVE_SYS_SYSCTL_H
+
+/* Define to 1 if you have the <sys/sysinfo.h> header file. */
+#undef HAVE_SYS_SYSINFO_H
+
+/* Define to 1 if you have the <sys/sysmp.h> header file. */
+#undef HAVE_SYS_SYSMP_H
+
+/* Define to 1 if you have the <sys/systemcfg.h> header file. */
+#undef HAVE_SYS_SYSTEMCFG_H
+
+/* Define to 1 if you have the <sys/table.h> header file. */
+#undef HAVE_SYS_TABLE_H
+
 /* Define to 1 if you have the <sys/tape.h> header file. */
 #undef HAVE_SYS_TAPE_H
 
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
 /* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H
 
 /* Define to 1 if you have the <sys/wait.h> header file. */
 #undef HAVE_SYS_WAIT_H
 
+/* Define to 1 if you have the `table' function. */
+#undef HAVE_TABLE
+
 /* Define to 1 if you have the `time' function. */
 #undef HAVE_TIME
 
 /* Define if toupper is declared. */
 #undef HAVE_TOUPPER_DECL
 
-/* Define if gettimeofday takes two arguments. */
-#undef HAVE_TWO_ARG_GETTIMEOFDAY
-
 /* Define to 1 if you have the `ungetc' function. */
 #undef HAVE_UNGETC
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define if the compiler support unsigned long constants. */
-#undef HAVE_UNSIGNED_LONG_CONSTANTS
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define to 1 if you have the `vasnprintf' function. */
 #undef HAVE_VASNPRINTF
 /* Define if vsnprintf is declared. */
 #undef HAVE_VSNPRINTF_DECL
 
-/* Define to 1 if you have the `vsprintf' function. */
-#undef HAVE_VSPRINTF
-
-/* Define if vsprintf is declared. */
-#undef HAVE_VSPRINTF_DECL
-
-/* Define to 1 if you have the <vtblc.h> header file. */
-#undef HAVE_VTBLC_H
-
 /* Define to 1 if you have the <wait.h> header file. */
 #undef HAVE_WAIT_H
 
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
 /* Define if you have the 'wchar_t' type. */
 #undef HAVE_WCHAR_T
 
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
-/* Define if limits.h defines _POSIX2_RE_DUP_MAX. */
-#undef HAVE__POSIX2_RE_DUP_MAX
+/* Define to 1 if you have the `_ftime' function. */
+#undef HAVE__FTIME
+
+/* Define to 1 if you have the external variable, _system_configuration with a
+   member named physmem. */
+#undef HAVE__SYSTEM_CONFIGURATION
 
 /* Define on Cygwin. */
 #undef IGNORE_FSTAB
 /* Define on Cygwin. */
 #undef IGNORE_TAR_ERRORS
 
-/* Define on Cygwin. */
-#undef IGNORE_UID_CHECK
-
 /* The name for the Kerberized Amanda service. */
 #undef KAMANDA_SERVICE_NAME
 
-/* Enable Kerberos security. */
+/* Enable Kerberos IV security. */
 #undef KRB4_SECURITY
 
 /* Define if Kerberos 5 security is to be enabled. */
 #undef KRB5_SECURITY
 
-/* Format for a long long printf. */
-#undef LL_FMT
+/* Defined if libcurl supports AsynchDNS */
+#undef LIBCURL_FEATURE_ASYNCHDNS
+
+/* Defined if libcurl supports IDN */
+#undef LIBCURL_FEATURE_IDN
+
+/* Defined if libcurl supports IPv6 */
+#undef LIBCURL_FEATURE_IPV6
+
+/* Defined if libcurl supports KRB4 */
+#undef LIBCURL_FEATURE_KRB4
+
+/* Defined if libcurl supports libz */
+#undef LIBCURL_FEATURE_LIBZ
+
+/* Defined if libcurl supports NTLM */
+#undef LIBCURL_FEATURE_NTLM
+
+/* Defined if libcurl supports SSL */
+#undef LIBCURL_FEATURE_SSL
+
+/* Defined if libcurl supports SSPI */
+#undef LIBCURL_FEATURE_SSPI
+
+/* Defined if libcurl supports DICT */
+#undef LIBCURL_PROTOCOL_DICT
+
+/* Defined if libcurl supports FILE */
+#undef LIBCURL_PROTOCOL_FILE
+
+/* Defined if libcurl supports FTP */
+#undef LIBCURL_PROTOCOL_FTP
+
+/* Defined if libcurl supports FTPS */
+#undef LIBCURL_PROTOCOL_FTPS
+
+/* Defined if libcurl supports HTTP */
+#undef LIBCURL_PROTOCOL_HTTP
 
-/* Format for a long long printf. */
-#undef LL_RFMT
+/* Defined if libcurl supports HTTPS */
+#undef LIBCURL_PROTOCOL_HTTPS
+
+/* Defined if libcurl supports LDAP */
+#undef LIBCURL_PROTOCOL_LDAP
+
+/* Defined if libcurl supports TELNET */
+#undef LIBCURL_PROTOCOL_TELNET
+
+/* Defined if libcurl supports TFTP */
+#undef LIBCURL_PROTOCOL_TFTP
 
 /* A comma-separated list of two integers, determining the minimum and maximum
-   reserved TCP port numbers sockets should be bound to. (mainly for
+   reserved TCP port numbers sockets should be bound to. (mainly for
    amrecover) */
 #undef LOW_TCPPORTRANGE
 
 /* LPRCMD switch for specifying a printer name. */
 #undef LPRFLAG
 
-/* Define to a program that understands -s "subject" user < message_file */
+/* A program that understands -s "subject" user < message_file */
 #undef MAILER
 
 /* Maximum size of a tape block in KBytes. */
 #undef MAX_TAPE_BLOCK_KB
 
-/* Defined to the switch to be used when invoking mt to specify the * tape
-   device. */
+/* The switch to be used when invoking mt to specify the * tape device. */
 #undef MT_FILE_FLAG
 
 /* Define on Cygwin. */
 #undef NEED_PATH_ENV
 
-/* Define if we have to reset tape offsets when reacing 2GB. */
+/* Define if we have to reset tape offsets when reaching 2GB. */
 #undef NEED_RESETOFS
 
 /* Name of package */
 /* Define if the pthread_in_use() detection is hard. */
 #undef PTHREAD_IN_USE_DETECTION_HARD
 
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+   'ptrdiff_t'. */
+#undef PTRDIFF_T_SUFFIX
+
 /* Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ */
 #undef RDEV_PREFIX
 
+/* Define if vasnprintf exists but is overridden by gnulib. */
+#undef REPLACE_VASNPRINTF
+
 /* Define the location of the ufsrestore or restore program. */
 #undef RESTORE
 
 /* The Kerberos server key file. */
 #undef SERVER_HOST_KEY_FILE
 
-/* The Kerberos server principle. */
-#undef SERVER_HOST_PRINCIPLE
+/* The Kerberos server principal. */
+#undef SERVER_HOST_PRINCIPAL
 
 /* A suffix that will be appended to service names. * Useful for testing in
    parallel with a working version. */
 /* Define to type of shmget() function argument. */
 #undef SHM_ARG_TYPE
 
-/* The size of a `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+   'sig_atomic_t'. */
+#undef SIG_ATOMIC_T_SUFFIX
+
+/* Define if all of Amanda will run as a single userid (e.g., on Cygwin or for
+   installchecks) */
+#undef SINGLE_USERID
 
-/* The size of `int', as computed by sizeof. */
+/* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
-/* The size of `intmax_t', as computed by sizeof. */
+/* The size of `intmax_t', as computed by sizeof. */
 #undef SIZEOF_INTMAX_T
 
-/* The size of `long', as computed by sizeof. */
+/* The size of `long', as computed by sizeof. */
 #undef SIZEOF_LONG
 
-/* The size of `long long', as computed by sizeof. */
+/* The size of `long long', as computed by sizeof. */
 #undef SIZEOF_LONG_LONG
 
-/* The size of `off_t', as computed by sizeof. */
+/* The size of `off_t', as computed by sizeof. */
 #undef SIZEOF_OFF_T
 
-/* The size of a `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
-/* The size of a `size_t', as computed by sizeof. */
+/* The size of `size_t', as computed by sizeof. */
 #undef SIZEOF_SIZE_T
 
-/* The size of `ssize_t', as computed by sizeof. */
+/* The size of `ssize_t', as computed by sizeof. */
 #undef SIZEOF_SSIZE_T
 
-/* The size of `time_t', as computed by sizeof. */
+/* The size of `time_t', as computed by sizeof. */
 #undef SIZEOF_TIME_T
 
-/* The size of a `void*', as computed by sizeof. */
-#undef SIZEOF_VOIDP
-
 /* Define as the maximum value of type 'size_t', if the system doesn't define
    it. */
 #undef SIZE_MAX
 
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+   'size_t'. */
+#undef SIZE_T_SUFFIX
+
 /* Define to the exact path to the sort program. */
 #undef SORT_PATH
 
 
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
-   automatically deduced at run-time.
+   automatically deduced at runtime.
        STACK_DIRECTION > 0 => grows toward higher addresses
        STACK_DIRECTION < 0 => grows toward lower addresses
        STACK_DIRECTION = 0 => direction of growth unknown */
 #undef STACK_DIRECTION
 
-/* Define on OSF1. */
-#undef STATFS_OSF1
+/* Define if the block counts reported by statfs may be truncated to 2GB and
+   the correct values may be stored in the f_spare array. (SunOS 4.1.2, 4.1.3,
+   and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be
+   affected.) */
+#undef STATFS_TRUNCATES_BLOCK_COUNTS
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Define if there is no specific function for reading file systems usage
+   information and you have the <sys/filsys.h> header file. (SVR2) */
+#undef STAT_READ_FILSYS
+
+/* Define if statfs takes 2 args and struct statfs has a field named f_bsize.
+   (4.3BSD, SunOS 4, HP-UX, AIX PS/2) */
+#undef STAT_STATFS2_BSIZE
 
-/* Define on SCO OS5. */
-#undef STATFS_SCO_OS5
+/* Define if statfs takes 2 args and struct statfs has a field named f_fsize.
+   (4.4BSD, NetBSD) */
+#undef STAT_STATFS2_FSIZE
 
-/* Define on Ultrix. */
-#undef STATFS_ULTRIX
+/* Define if statfs takes 2 args and the second argument has type struct
+   fs_data. (Ultrix) */
+#undef STAT_STATFS2_FS_DATA
+
+/* Define if statfs takes 3 args. (DEC Alpha running OSF/1) */
+#undef STAT_STATFS3_OSF1
+
+/* Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin) */
+#undef STAT_STATFS4
+
+/* Define if there is a function named statvfs. (SVR4) */
+#undef STAT_STATVFS
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* A comma-separated list of two integers, determining the minimum and maximum
-   unreserved TCP port numbers sockets should be bound to. */
+/* A comma-separated list of two integers, determining the minimum and *
+   maximum unreserved TCP port numbers sockets should be bound to. */
 #undef TCPPORTRANGE
 
-/* Define to enable the text-based database format. */
-#undef TEXTDB
-
 /* The Kerberos ticket lifetime. */
 #undef TICKET_LIFETIME
 
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 
-/* A comma-separated list of two integers, determining the minimum and maximum
-   reserved UDP port numbers sockets should be bound to. */
+/* A comma-separated list of two integers, determining the minimum and *
+   maximum reserved UDP port numbers sockets should be bound to. */
 #undef UDPPORTRANGE
 
 /* Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. */
 /* Define as the exact path to the gzip or compress command. */
 #undef UNCOMPRESS_PATH
 
-/* Define if you want to use the .amandahosts for BSD security. */
+/* Define if you want to use the ".amandahosts" for BSD security. */
 #undef USE_AMANDAHOSTS
 
-/* Define to enable dbm databases. */
-#undef USE_DBM_H
-
-/* Define to enable db databases. */
-#undef USE_DB_H
-
-/* Define to use flock for file locking. */
-#undef USE_FLOCK
-
 /* Define for backups being done on a multiple networks and FQDNs are used. */
 #undef USE_FQDN
 
-/* Define to enable gdbm databases. */
-#undef USE_GDBM_H
-
-/* Define to use a hard-link based approach for file locking. */
-#undef USE_LNLOCK
-
-/* Define to use lockf for file locking. */
-#undef USE_LOCKF
-
-/* Define to enable ndbm databases. */
-#undef USE_NDBM_H
-
-/* Define to use Posix fcntl for file locking. */
-#undef USE_POSIX_FCNTL
-
 /* Define if the POSIX multithreading library can be used. */
 #undef USE_POSIX_THREADS
 
 /* Define if the Win32 multithreading API can be used. */
 #undef USE_WIN32_THREADS
 
-/* Define on UnixWare. */
-#undef UWARE_TAPEIO
-
 /* Define the location of the vdump program. */
 #undef VDUMP
 
 /* Defined if wait() puts the status in a union wait instead of int. */
 #undef WAIT_USES_UNION
 
+/* Define to use flock(2) for file locking */
+#undef WANT_AMFLOCK_FLOCK
+
+/* Define to use link(2) to emulate file locking. */
+#undef WANT_AMFLOCK_LNLOCK
+
+/* Define to use lockf(3) for file locking. */
+#undef WANT_AMFLOCK_LOCKF
+
+/* Define to use POSIX (fcntl()) for file locking */
+#undef WANT_AMFLOCK_POSIX
+
+/* Compile Amazon DevPay support */
+#undef WANT_DEVPAY
+
+/* Compile Amazon S3 driver */
+#undef WANT_S3_DEVICE
+
+/* Define if clients should be built setuid-root */
+#undef WANT_SETUID_CLIENT
+
+/* Define on AIX. */
+#undef WANT_TAPE_AIX
+
+/* Define if the tape-device will be built */
+#undef WANT_TAPE_DEVICE
+
+/* Define on UnixWare. */
+#undef WANT_TAPE_UWARE
+
+/* Define on XENIX/ISC. */
+#undef WANT_TAPE_XENIX
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+   'wchar_t'. */
+#undef WCHAR_T_SUFFIX
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+   'wint_t'. */
+#undef WINT_T_SUFFIX
+
 /* Define to 1 if your processor stores words with the most significant byte
    first (like Motorola and SPARC, unlike Intel and VAX). */
 #undef WORDS_BIGENDIAN
 
-/* Define if IPv6 is working. */
+/* Target system has functional IPv6 support */
 #undef WORKING_IPV6
 
-/* Define on XENIX/ISC. */
-#undef XENIX_TAPEIO
-
 /* Define the location of the xfsdump program on Irix hosts. */
 #undef XFSDUMP
 
    `char[]'. */
 #undef YYTEXT_POINTER
 
-/* Define to 1 if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
-/* Enable extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
 #endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+/* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Directory in which Amanda header files should be installed */
+#undef amincludedir
+
+/* Directory in which Amanda libraries should be installed */
+#undef amlibdir
+
+/* Directory in which Amanda own programs should be installed */
+#undef amlibexecdir
+
+/* Directory in which perl modules should be installed */
+#undef amperldir
 
 /* Directory in which user binaries should be installed. */
 #undef bindir
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
+/* Define curl_free() as free() if our version of curl lacks curl_free. */
+#undef curl_free
+
+/* Type for curl_off_t, if it is not defined by the system */
+#undef curl_off_t
+
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef gid_t
 
+/* Define to rpl_gmtime if the replacement function should be used. */
+#undef gmtime
+
+/* Type for in_port_t, if it is not defined by the system */
+#undef in_port_t
+
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
 /* Directory in which internal binaries should be installed. */
 #undef libexecdir
 
+/* Define to rpl_localtime if the replacement function should be used. */
+#undef localtime
+
 /* Directory in which man-pages should be installed */
 #undef mandir
 
-/* Define to `long' if <sys/types.h> does not define. */
+/* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
 /* Define to `int' if <sys/types.h> does not define. */
    supported. Do not define if restrict is supported directly. */
 #undef restrict
 
-/* Define if sa_family_t is not a standard system type */
+/* Type for sa_family_t, if it is not defined by the system */
 #undef sa_family_t
 
 /* Directory in which administrator binaries should be installed. */
 #undef sbindir
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
-/* Define if socklen_t is not a standard system type */
+/* Type for socklen_t, if it is not defined by the system */
 #undef socklen_t
 
+/* Define as a signed type of the same size as size_t. */
+#undef ssize_t
+
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
index e082db6bb57ae4628bab90a6fdfa65f510aa4ebe..c547c68825fa9b588b67046e9982e721d70aea8e 100644 (file)
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2006 Free Software Foundation, Inc.
+#   Copyright 1996-2007 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -64,7 +64,7 @@ else
           ;;
       esac
       ;;
-    mingw* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2*)
       ;;
     hpux9* | hpux10* | hpux11*)
       wl='-Wl,'
@@ -74,7 +74,7 @@ else
       ;;
     newsos6)
       ;;
-    linux*)
+    linux* | k*bsd*-gnu)
       case $cc_basename in
         icc* | ecc*)
           wl='-Wl,'
@@ -100,7 +100,7 @@ else
     osf3* | osf4* | osf5*)
       wl='-Wl,'
       ;;
-    sco3.2v5*)
+    rdos*)
       ;;
     solaris*)
       wl='-Wl,'
@@ -108,11 +108,14 @@ else
     sunos4*)
       wl='-Qoption ld '
       ;;
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       wl='-Wl,'
       ;;
     sysv4*MP*)
       ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      wl='-Wl,'
+      ;;
     unicos*)
       wl='-Wl,'
       ;;
@@ -189,11 +192,11 @@ if test "$with_gnu_ld" = yes; then
         ld_shlibs=no
       fi
       ;;
-    interix3*)
+    interix[3-9]*)
       hardcode_direct=no
       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
       ;;
-    linux*)
+    gnu* | linux* | k*bsd*-gnu)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         :
       else
@@ -280,7 +283,7 @@ else
             strings "$collect2name" | grep resolve_lib_name >/dev/null
           then
             # We have reworked collect2
-            hardcode_direct=yes
+            :
           else
             # We have old collect2
             hardcode_direct=unsupported
@@ -359,7 +362,7 @@ else
       hardcode_direct=yes
       hardcode_minus_L=yes
       ;;
-    freebsd* | kfreebsd*-gnu | dragonfly*)
+    freebsd* | dragonfly*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       ;;
@@ -412,18 +415,22 @@ else
       hardcode_libdir_separator=:
       ;;
     openbsd*)
-      hardcode_direct=yes
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      if test -f /usr/libexec/ld.so; then
+        hardcode_direct=yes
+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        else
+          case "$host_os" in
+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+              hardcode_libdir_flag_spec='-R$libdir'
+              ;;
+            *)
+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+              ;;
+          esac
+        fi
       else
-        case "$host_os" in
-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-            hardcode_libdir_flag_spec='-R$libdir'
-            ;;
-          *)
-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-            ;;
-        esac
+        ld_shlibs=no
       fi
       ;;
     os2*)
@@ -471,7 +478,7 @@ else
         ld_shlibs=yes
       fi
       ;;
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
       ;;
     sysv5* | sco3.2v5* | sco5v6*)
       hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
@@ -523,9 +530,6 @@ case "$host_os" in
     ;;
   freebsd1*)
     ;;
-  kfreebsd*-gnu)
-    library_names_spec='$libname$shrext'
-    ;;
   freebsd* | dragonfly*)
     case "$host_os" in
       freebsd[123]*)
@@ -551,7 +555,7 @@ case "$host_os" in
     esac
     library_names_spec='$libname$shrext'
     ;;
-  interix3*)
+  interix[3-9]*)
     library_names_spec='$libname$shrext'
     ;;
   irix5* | irix6* | nonstopux*)
@@ -572,7 +576,7 @@ case "$host_os" in
     ;;
   linux*oldld* | linux*aout* | linux*coff*)
     ;;
-  linux*)
+  linux* | k*bsd*-gnu)
     library_names_spec='$libname$shrext'
     ;;
   knetbsd*-gnu)
@@ -598,6 +602,8 @@ case "$host_os" in
   osf3* | osf4* | osf5*)
     library_names_spec='$libname$shrext'
     ;;
+  rdos*)
+    ;;
   solaris*)
     library_names_spec='$libname$shrext'
     ;;
index d8fd2f8fa2f58cb9a31d7494d75d7ed8b7135dfe..2a4932e7f58c367a246c5cfbbbb9d19e9c932203 100755 (executable)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2005-02-10'
+timestamp='2007-01-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +22,15 @@ timestamp='2005-02-10'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # 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.
 
+
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -83,11 +85,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -99,7 +101,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -118,8 +120,9 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -170,6 +173,10 @@ case $os in
        -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/'`
@@ -186,6 +193,10 @@ case $os in
                # Don't forget version if it is 3.2v4 or newer.
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -sco*)
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -230,14 +241,16 @@ case $basic_machine in
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
-       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | bfin \
        | c4x | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | fr30 | frv \
+       | d10v | d30v | dlx | dsp16xx | dvp \
+       | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -246,6 +259,7 @@ case $basic_machine in
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
        | mipsisa32 | mipsisa32el \
        | mipsisa32r2 | mipsisa32r2el \
        | mipsisa64 | mipsisa64el \
@@ -254,20 +268,24 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | mt \
        | msp430 \
+       | nios | nios2 \
        | ns16k | ns32k \
-       | openrisc | or32 \
+       | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
-       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
-       | strongarm \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
        | z8k)
                basic_machine=$basic_machine-unknown
                ;;
@@ -278,6 +296,9 @@ case $basic_machine in
                ;;
        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
 
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
@@ -297,18 +318,18 @@ case $basic_machine in
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* \
-       | bs2000-* \
+       | avr-* | avr32-* \
+       | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
-       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
-       | m32r-* | m32rle-* \
+       | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
        | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -319,6 +340,7 @@ case $basic_machine in
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
        | mipsisa32-* | mipsisa32el-* \
        | mipsisa32r2-* | mipsisa32r2el-* \
        | mipsisa64-* | mipsisa64el-* \
@@ -327,23 +349,26 @@ case $basic_machine in
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
+       | mt-* \
        | msp430-* \
+       | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa-* \
        | ymp-* \
        | z8k-*)
@@ -665,6 +690,24 @@ case $basic_machine in
                basic_machine=m68k-atari
                os=-mint
                ;;
+       mipsEE* | ee | ps2)
+               basic_machine=mips64r5900el-scei
+               case $os in
+                   -linux*)
+                       ;;
+                   *)
+                       os=-elf
+                       ;;
+               esac
+               ;;
+       iop)
+               basic_machine=mipsel-scei
+               os=-irx
+               ;;
+       dvp)
+               basic_machine=dvp-scei
+               os=-elf
+               ;;
        mips3*-*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
                ;;
@@ -683,6 +726,9 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-msdos
                ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
@@ -758,9 +804,8 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
-       or32 | or32-*)
+       openrisc | openrisc-*)
                basic_machine=or32-unknown
-               os=-coff
                ;;
        os400)
                basic_machine=powerpc-ibm
@@ -791,6 +836,12 @@ case $basic_machine in
        pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
@@ -847,6 +898,10 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
        rom68k)
                basic_machine=m68k-rom68k
                os=-coff
@@ -873,6 +928,10 @@ case $basic_machine in
        sb1el)
                basic_machine=mipsisa64sb1el-unknown
                ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
        sei)
                basic_machine=mips-sei
                os=-seiux
@@ -884,6 +943,9 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
        sh64)
                basic_machine=sh64-unknown
                ;;
@@ -1086,13 +1148,10 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b)
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
                basic_machine=sparc-sun
                ;;
        cydra)
@@ -1165,20 +1224,23 @@ case $os in
              | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* \
              | -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*)
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1196,7 +1258,7 @@ case $os in
                os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
@@ -1330,6 +1392,12 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
        *-acorn)
                os=-riscix1.2
                ;;
@@ -1339,9 +1407,9 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
        # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
@@ -1367,6 +1435,9 @@ case $basic_machine in
        m68*-cisco)
                os=-aout
                ;;
+        mep-*)
+               os=-elf
+               ;;
        mips*-cisco)
                os=-elf
                ;;
@@ -1385,6 +1456,9 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
+       *-haiku)
+               os=-haiku
+               ;;
        *-ibm)
                os=-aix
                ;;
@@ -1556,7 +1630,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index ffcd540c3366d4ac158cd738c98d712460d99696..ca5ea4e1ef9c125b1cb1fc7d51c93d8747637deb 100755 (executable)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2005-02-09.22
+scriptversion=2006-10-15.18
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,8 +18,8 @@ scriptversion=2005-02-09.22
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -91,7 +92,20 @@ 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.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## 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 -eq 0; then :
   else
@@ -276,6 +290,46 @@ icc)
   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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    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 -eq 0; then :
+  else
+     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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#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'.
@@ -288,13 +342,13 @@ tru64)
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mecanism is used in libtool 1.4 series to
+      # static library.  This mechanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # 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
@@ -467,7 +521,8 @@ cpp)
   done
 
   "$@" -E |
-    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    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"
diff --git a/config/gettext-macros/codeset.m4 b/config/gettext-macros/codeset.m4
new file mode 100644 (file)
index 0000000..a6e67ec
--- /dev/null
@@ -0,0 +1,21 @@
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+    [AC_TRY_LINK([#include <langinfo.h>],
+      [char* cs = nl_langinfo(CODESET);],
+      am_cv_langinfo_codeset=yes,
+      am_cv_langinfo_codeset=no)
+    ])
+  if test $am_cv_langinfo_codeset = yes; then
+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+  fi
+])
diff --git a/config/gettext-macros/file-list b/config/gettext-macros/file-list
new file mode 100644 (file)
index 0000000..60ef11b
--- /dev/null
@@ -0,0 +1,30 @@
+## this file is automatically generated by autogen
+EXTRA_DIST += gettext-macros/codeset.m4
+EXTRA_DIST += gettext-macros/gettext.m4
+EXTRA_DIST += gettext-macros/glibc21.m4
+EXTRA_DIST += gettext-macros/glibc2.m4
+EXTRA_DIST += gettext-macros/iconv.m4
+EXTRA_DIST += gettext-macros/intdiv0.m4
+EXTRA_DIST += gettext-macros/intmax.m4
+EXTRA_DIST += gettext-macros/inttypes_h.m4
+EXTRA_DIST += gettext-macros/inttypes.m4
+EXTRA_DIST += gettext-macros/inttypes-pri.m4
+EXTRA_DIST += gettext-macros/isc-posix.m4
+EXTRA_DIST += gettext-macros/lcmessage.m4
+EXTRA_DIST += gettext-macros/lib-ld.m4
+EXTRA_DIST += gettext-macros/lib-link.m4
+EXTRA_DIST += gettext-macros/lib-prefix.m4
+EXTRA_DIST += gettext-macros/longdouble.m4
+EXTRA_DIST += gettext-macros/longlong.m4
+EXTRA_DIST += gettext-macros/nls.m4
+EXTRA_DIST += gettext-macros/po.m4
+EXTRA_DIST += gettext-macros/printf-posix.m4
+EXTRA_DIST += gettext-macros/progtest.m4
+EXTRA_DIST += gettext-macros/signed.m4
+EXTRA_DIST += gettext-macros/size_max.m4
+EXTRA_DIST += gettext-macros/stdint_h.m4
+EXTRA_DIST += gettext-macros/uintmax_t.m4
+EXTRA_DIST += gettext-macros/ulonglong.m4
+EXTRA_DIST += gettext-macros/wchar_t.m4
+EXTRA_DIST += gettext-macros/wint_t.m4
+EXTRA_DIST += gettext-macros/xsize.m4
diff --git a/config/gettext-macros/gettext.m4 b/config/gettext-macros/gettext.m4
new file mode 100644 (file)
index 0000000..fdcaecc
--- /dev/null
@@ -0,0 +1,631 @@
+# gettext.m4 serial 53 (gettext-0.15)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2005.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl    default (if it is not specified or empty) is 'no-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl    depending on --{enable,disable}-{shared,static} and on the presence of
+dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl    implementations (in libc or libintl) without the ngettext() function
+dnl    will be ignored.  If NEEDSYMBOL is specified and is
+dnl    'need-formatstring-macros', then GNU gettext implementations that don't
+dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries.  If empty,
+dnl    the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl    and used.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl    Catalog format: none
+dnl    Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+  dnl Argument checking.
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+  define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
+  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+
+  AC_REQUIRE([AM_PO_SUBDIRS])dnl
+  ifelse(gt_included_intl, yes, [
+    AC_REQUIRE([AM_INTL_SUBDIR])dnl
+  ])
+
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Sometimes libintl requires libiconv, so first search for libiconv.
+  dnl Ideally we would do this search only after the
+  dnl      if test "$USE_NLS" = "yes"; then
+  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl the configure script would need to contain the same shell code
+  dnl again, outside any 'if'. There are two solutions:
+  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+  dnl documented, we avoid it.
+  ifelse(gt_included_intl, yes, , [
+    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+  ])
+
+  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+  gt_INTL_MACOSX
+
+  dnl Set USE_NLS.
+  AC_REQUIRE([AM_NLS])
+
+  ifelse(gt_included_intl, yes, [
+    BUILD_INCLUDED_LIBINTL=no
+    USE_INCLUDED_LIBINTL=no
+  ])
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
+
+  dnl If we use NLS figure out what method
+  if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
+    ifelse(gt_included_intl, yes, [
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH(included-gettext,
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+    ])
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If GNU gettext is available we use this.  Else we have
+        dnl to fall back to GNU NLS library.
+
+        dnl Add a version number to the cache macros.
+        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
+        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
+        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
+
+        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
+         [AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+]], [])[extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+            [bindtextdomain ("", "");
+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
+            gt_cv_func_gnugettext_libc=yes,
+            gt_cv_func_gnugettext_libc=no)])
+
+        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+          dnl Sometimes libintl requires libiconv, so first search for libiconv.
+          ifelse(gt_included_intl, yes, , [
+            AM_ICONV_LINK
+          ])
+          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+          dnl even if libiconv doesn't exist.
+          AC_LIB_LINKFLAGS_BODY([intl])
+          AC_CACHE_CHECK([for GNU gettext in libintl],
+            gt_cv_func_gnugettext_libintl,
+           [gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+            dnl Now see whether libintl exists and does not depend on libiconv.
+            AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+]], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+              [bindtextdomain ("", "");
+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+              gt_cv_func_gnugettext_libintl=yes,
+              gt_cv_func_gnugettext_libintl=no)
+            dnl Now see whether libintl exists and depends on libiconv.
+            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+]], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);],
+                [bindtextdomain ("", "");
+return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+               [LIBINTL="$LIBINTL $LIBICONV"
+                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                gt_cv_func_gnugettext_libintl=yes
+               ])
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"])
+        fi
+
+        dnl If an already present or preinstalled GNU gettext() is found,
+        dnl use it.  But if this macro is used in GNU gettext, and GNU
+        dnl gettext is already preinstalled in libintl, we update this
+        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
+        if test "$gt_cv_func_gnugettext_libc" = "yes" \
+           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+          dnl Reset the values set by searching for libintl.
+          LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
+
+    ifelse(gt_included_intl, yes, [
+        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+          dnl GNU gettext is not found in the C library.
+          dnl Fall back on included GNU gettext library.
+          nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        BUILD_INCLUDED_LIBINTL=yes
+        USE_INCLUDED_LIBINTL=yes
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+      fi
+
+      CATOBJEXT=
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions to use GNU gettext tools.
+        CATOBJEXT=.gmo
+      fi
+    ])
+
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Some extra flags are needed during linking.
+        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
+      AC_DEFINE(ENABLE_NLS, 1,
+        [Define to 1 if translation of program messages to the user's native language
+   is requested.])
+    else
+      USE_NLS=no
+    fi
+  fi
+
+  AC_MSG_CHECKING([whether to use NLS])
+  AC_MSG_RESULT([$USE_NLS])
+  if test "$USE_NLS" = "yes"; then
+    AC_MSG_CHECKING([where the gettext function comes from])
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
+    else
+      gt_source="included intl directory"
+    fi
+    AC_MSG_RESULT([$gt_source])
+  fi
+
+  if test "$USE_NLS" = "yes"; then
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        AC_MSG_CHECKING([how to link with libintl])
+        AC_MSG_RESULT([$LIBINTL])
+        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+      fi
+
+      dnl For backward compatibility. Some packages may be using this.
+      AC_DEFINE(HAVE_GETTEXT, 1,
+       [Define if the GNU gettext() function is already present or preinstalled.])
+      AC_DEFINE(HAVE_DCGETTEXT, 1,
+       [Define if the GNU dcgettext() function is already present or preinstalled.])
+    fi
+
+    dnl We need to process the po/ directory.
+    POSUB=po
+  fi
+
+  ifelse(gt_included_intl, yes, [
+    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+    dnl to 'yes' because some of the testsuite requires it.
+    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+      BUILD_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(BUILD_INCLUDED_LIBINTL)
+    AC_SUBST(USE_INCLUDED_LIBINTL)
+    AC_SUBST(CATOBJEXT)
+
+    dnl For backward compatibility. Some configure.ins may be using this.
+    nls_cv_header_intl=
+    nls_cv_header_libgt=
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    DATADIRNAME=share
+    AC_SUBST(DATADIRNAME)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INSTOBJEXT=.mo
+    AC_SUBST(INSTOBJEXT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    GENCAT=gencat
+    AC_SUBST(GENCAT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INTLOBJS=
+    if test "$USE_INCLUDED_LIBINTL" = yes; then
+      INTLOBJS="\$(GETTOBJS)"
+    fi
+    AC_SUBST(INTLOBJS)
+
+    dnl Enable libtool support if the surrounding package wishes it.
+    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+  ])
+
+  dnl For backward compatibility. Some Makefiles may be using this.
+  INTLLIBS="$LIBINTL"
+  AC_SUBST(INTLLIBS)
+
+  dnl Make all documented variables known to autoconf.
+  AC_SUBST(LIBINTL)
+  AC_SUBST(LTLIBINTL)
+  AC_SUBST(POSUB)
+])
+
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+  AC_REQUIRE([gt_GLIBC2])dnl
+  AC_REQUIRE([AC_PROG_RANLIB])dnl
+  AC_REQUIRE([gl_VISIBILITY])dnl
+  AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
+  AC_REQUIRE([bh_C_SIGNED])dnl
+  AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
+  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
+  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
+  AC_REQUIRE([gt_TYPE_WINT_T])dnl
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gt_TYPE_INTMAX_T])
+  AC_REQUIRE([gt_PRINTF_POSIX])
+  AC_REQUIRE([gl_GLIBC21])dnl
+  AC_REQUIRE([gl_XSIZE])dnl
+  AC_REQUIRE([gt_INTL_MACOSX])dnl
+
+  AC_CHECK_TYPE([ptrdiff_t], ,
+    [AC_DEFINE([ptrdiff_t], [long],
+       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+    ])
+  AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
+  AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
+
+  dnl Use the _snprintf function only if it is declared (because on NetBSD it
+  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
+  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
+
+  dnl Use the *_unlocked functions only if they are declared.
+  dnl (because some of them were defined without being declared in Solaris
+  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+  dnl on Solaris 2.5.1 to run on Solaris 2.6).
+  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
+
+  case $gt_cv_func_printf_posix in
+    *yes) HAVE_POSIX_PRINTF=1 ;;
+    *) HAVE_POSIX_PRINTF=0 ;;
+  esac
+  AC_SUBST([HAVE_POSIX_PRINTF])
+  if test "$ac_cv_func_asprintf" = yes; then
+    HAVE_ASPRINTF=1
+  else
+    HAVE_ASPRINTF=0
+  fi
+  AC_SUBST([HAVE_ASPRINTF])
+  if test "$ac_cv_func_snprintf" = yes; then
+    HAVE_SNPRINTF=1
+  else
+    HAVE_SNPRINTF=0
+  fi
+  AC_SUBST([HAVE_SNPRINTF])
+  if test "$ac_cv_func_wprintf" = yes; then
+    HAVE_WPRINTF=1
+  else
+    HAVE_WPRINTF=0
+  fi
+  AC_SUBST([HAVE_WPRINTF])
+
+  AM_LANGINFO_CODESET
+  gt_LC_MESSAGES
+
+  dnl Compilation on mingw and Cygwin needs special Makefile rules, because
+  dnl 1. when we install a shared library, we must arrange to export
+  dnl    auxiliary pointer variables for every exported variable,
+  dnl 2. when we install a shared library and a static library simultaneously,
+  dnl    the include file specifies __declspec(dllimport) and therefore we
+  dnl    must arrange to define the auxiliary pointer variables for the
+  dnl    exported variables _also_ in the static library.
+  if test "$enable_shared" = yes; then
+    case "$host_os" in
+      cygwin*) is_woe32dll=yes ;;
+      *) is_woe32dll=no ;;
+    esac
+  else
+    is_woe32dll=no
+  fi
+  WOE32DLL=$is_woe32dll
+  AC_SUBST([WOE32DLL])
+
+  dnl Rename some macros and functions used for locking.
+  AH_BOTTOM([
+#define __libc_lock_t                   gl_lock_t
+#define __libc_lock_define              gl_lock_define
+#define __libc_lock_define_initialized  gl_lock_define_initialized
+#define __libc_lock_init                gl_lock_init
+#define __libc_lock_lock                gl_lock_lock
+#define __libc_lock_unlock              gl_lock_unlock
+#define __libc_lock_recursive_t                   gl_recursive_lock_t
+#define __libc_lock_define_recursive              gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive                gl_recursive_lock_init
+#define __libc_lock_lock_recursive                gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
+#define glthread_in_use  libintl_thread_in_use
+#define glthread_lock_init     libintl_lock_init
+#define glthread_lock_lock     libintl_lock_lock
+#define glthread_lock_unlock   libintl_lock_unlock
+#define glthread_lock_destroy  libintl_lock_destroy
+#define glthread_rwlock_init     libintl_rwlock_init
+#define glthread_rwlock_rdlock   libintl_rwlock_rdlock
+#define glthread_rwlock_wrlock   libintl_rwlock_wrlock
+#define glthread_rwlock_unlock   libintl_rwlock_unlock
+#define glthread_rwlock_destroy  libintl_rwlock_destroy
+#define glthread_recursive_lock_init     libintl_recursive_lock_init
+#define glthread_recursive_lock_lock     libintl_recursive_lock_lock
+#define glthread_recursive_lock_unlock   libintl_recursive_lock_unlock
+#define glthread_recursive_lock_destroy  libintl_recursive_lock_destroy
+#define glthread_once                 libintl_once
+#define glthread_once_call            libintl_once_call
+#define glthread_once_singlethreaded  libintl_once_singlethreaded
+])
+])
+
+
+dnl Checks for the core files of the intl subdirectory:
+dnl   dcigettext.c
+dnl   eval-plural.h
+dnl   explodename.c
+dnl   finddomain.c
+dnl   gettextP.h
+dnl   gmo.h
+dnl   hash-string.h hash-string.c
+dnl   l10nflist.c
+dnl   libgnuintl.h.in (except the *printf stuff)
+dnl   loadinfo.h
+dnl   loadmsgcat.c
+dnl   localealias.c
+dnl   log.c
+dnl   plural-exp.h plural-exp.c
+dnl   plural.y
+dnl Used by libglocale.
+AC_DEFUN([gt_INTL_SUBDIR_CORE],
+[
+  AC_REQUIRE([AC_C_INLINE])dnl
+  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+  AC_REQUIRE([AC_FUNC_MMAP])dnl
+  AC_REQUIRE([gt_INTDIV0])dnl
+  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])dnl
+  AC_REQUIRE([gt_INTTYPES_PRI])dnl
+  AC_REQUIRE([gl_LOCK])dnl
+
+  AC_TRY_LINK(
+    [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
+    [],
+    [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+       [Define to 1 if the compiler understands __builtin_expect.])])
+
+  AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h])
+  AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
+    stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
+    argz_next __fsetlocking])
+
+  dnl Use the *_unlocked functions only if they are declared.
+  dnl (because some of them were defined without being declared in Solaris
+  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+  dnl on Solaris 2.5.1 to run on Solaris 2.6).
+  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+
+  AM_ICONV
+
+  dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
+  dnl and a _NL_LOCALE_NAME macro always.
+  AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
+    [AC_TRY_LINK([#include <langinfo.h>
+#include <locale.h>],
+      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
+      gt_cv_nl_locale_name=yes,
+      gt_cv_nl_locale_name=no)
+    ])
+  if test $gt_cv_nl_locale_name = yes; then
+    AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
+      [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
+  fi
+
+  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+  dnl because plural.y uses bison specific features. It requires at least
+  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+  dnl compile.
+  dnl bison is only needed for the maintainer (who touches plural.y). But in
+  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+  dnl the rule in general Makefile. Now, some people carelessly touch the
+  dnl files or have a broken "make" program, hence the plural.c rule will
+  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+  dnl present or too old.
+  AC_CHECK_PROGS([INTLBISON], [bison])
+  if test -z "$INTLBISON"; then
+    ac_verc_fail=yes
+  else
+    dnl Found it, now check the version.
+    AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+    case $ac_prog_version in
+      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+    esac
+    AC_MSG_RESULT([$ac_prog_version])
+  fi
+  if test $ac_verc_fail = yes; then
+    INTLBISON=:
+  fi
+])
+
+
+dnl Checks for special options needed on MacOS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+  dnl Check for API introduced in MacOS X 10.2.
+  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+    gt_cv_func_CFPreferencesCopyAppValue,
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
+       [CFPreferencesCopyAppValue(NULL, NULL)],
+       [gt_cv_func_CFPreferencesCopyAppValue=yes],
+       [gt_cv_func_CFPreferencesCopyAppValue=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
+      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+  fi
+  dnl Check for API introduced in MacOS X 10.3.
+  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
+       [gt_cv_func_CFLocaleCopyCurrent=yes],
+       [gt_cv_func_CFLocaleCopyCurrent=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
+      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
+  AC_SUBST([INTL_MACOSX_LIBS])
+])
+
+
+dnl gt_CHECK_DECL(FUNC, INCLUDES)
+dnl Check whether a function is declared.
+AC_DEFUN([gt_CHECK_DECL],
+[
+  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+    [AC_TRY_COMPILE([$2], [
+#ifndef $1
+  char *p = (char *) $1;
+#endif
+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+  if test $ac_cv_have_decl_$1 = yes; then
+    gt_value=1
+  else
+    gt_value=0
+  fi
+  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/config/gettext-macros/glibc2.m4 b/config/gettext-macros/glibc2.m4
new file mode 100644 (file)
index 0000000..e8f5bfe
--- /dev/null
@@ -0,0 +1,30 @@
+# glibc2.m4 serial 1
+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.0 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([gt_GLIBC2],
+  [
+    AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
+      ac_cv_gnu_library_2,
+      [AC_EGREP_CPP([Lucky GNU user],
+       [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2)
+  Lucky GNU user
+ #endif
+#endif
+       ],
+       ac_cv_gnu_library_2=yes,
+       ac_cv_gnu_library_2=no)
+      ]
+    )
+    AC_SUBST(GLIBC2)
+    GLIBC2="$ac_cv_gnu_library_2"
+  ]
+)
diff --git a/config/gettext-macros/glibc21.m4 b/config/gettext-macros/glibc21.m4
new file mode 100644 (file)
index 0000000..d95fd98
--- /dev/null
@@ -0,0 +1,30 @@
+# glibc21.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([gl_GLIBC21],
+  [
+    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+      ac_cv_gnu_library_2_1,
+      [AC_EGREP_CPP([Lucky GNU user],
+       [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+  Lucky GNU user
+ #endif
+#endif
+       ],
+       ac_cv_gnu_library_2_1=yes,
+       ac_cv_gnu_library_2_1=no)
+      ]
+    )
+    AC_SUBST(GLIBC21)
+    GLIBC21="$ac_cv_gnu_library_2_1"
+  ]
+)
diff --git a/config/gettext-macros/iconv.m4 b/config/gettext-macros/iconv.m4
new file mode 100644 (file)
index 0000000..654c415
--- /dev/null
@@ -0,0 +1,101 @@
+# iconv.m4 serial AM4 (gettext-0.11.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+  dnl those with the standalone portable GNU libiconv installed).
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libiconv and not disabled its use
+  dnl via --without-libiconv-prefix, he wants to use it. The first
+  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  am_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+      [iconv_t cd = iconv_open("","");
+       iconv(cd,NULL,NULL,NULL,NULL);
+       iconv_close(cd);],
+      am_cv_func_iconv=yes)
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+        [iconv_t cd = iconv_open("","");
+         iconv(cd,NULL,NULL,NULL,NULL);
+         iconv_close(cd);],
+        am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes)
+      LIBS="$am_save_LIBS"
+    fi
+  ])
+  if test "$am_cv_func_iconv" = yes; then
+    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    AC_MSG_CHECKING([how to link with libiconv])
+    AC_MSG_RESULT([$LIBICONV])
+  else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+  AC_SUBST(LIBICONV)
+  AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+  AM_ICONV_LINK
+  if test "$am_cv_func_iconv" = yes; then
+    AC_MSG_CHECKING([for iconv declaration])
+    AC_CACHE_VAL(am_cv_proto_iconv, [
+      AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+    AC_MSG_RESULT([$]{ac_t:-
+         }[$]am_cv_proto_iconv)
+    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+      [Define as const if the declaration of iconv() needs const.])
+  fi
+])
diff --git a/config/gettext-macros/intdiv0.m4 b/config/gettext-macros/intdiv0.m4
new file mode 100644 (file)
index 0000000..b8d7817
--- /dev/null
@@ -0,0 +1,70 @@
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+    gt_cv_int_divbyzero_sigfpe,
+    [
+      AC_TRY_RUN([
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+#ifdef __cplusplus
+sigfpe_handler (int sig)
+#else
+sigfpe_handler (sig) int sig;
+#endif
+{
+  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
+  exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+  signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+  signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL.  */
+#if defined (__sparc__) && defined (__linux__)
+  signal (SIGILL, sigfpe_handler);
+#endif
+
+  z = x / y;
+  nan = y / y;
+  exit (1);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+        [
+          # Guess based on the CPU.
+          case "$host_cpu" in
+            alpha* | i[34567]86 | m68k | s390*)
+              gt_cv_int_divbyzero_sigfpe="guessing yes";;
+            *)
+              gt_cv_int_divbyzero_sigfpe="guessing no";;
+          esac
+        ])
+    ])
+  case "$gt_cv_int_divbyzero_sigfpe" in
+    *yes) value=1;;
+    *) value=0;;
+  esac
+  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+    [Define if integer division by zero raises signal SIGFPE.])
+])
diff --git a/config/gettext-macros/intmax.m4 b/config/gettext-macros/intmax.m4
new file mode 100644 (file)
index 0000000..d99c999
--- /dev/null
@@ -0,0 +1,30 @@
+# intmax.m4 serial 2 (gettext-0.14.2)
+dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
+dnl find a replacement if it is lacking.
+
+AC_DEFUN([gt_TYPE_INTMAX_T],
+[
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
+    [AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+  if test $gt_cv_c_intmax_t = yes; then
+    AC_DEFINE(HAVE_INTMAX_T, 1,
+      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+  fi
+])
diff --git a/config/gettext-macros/inttypes-pri.m4 b/config/gettext-macros/inttypes-pri.m4
new file mode 100644 (file)
index 0000000..a3df331
--- /dev/null
@@ -0,0 +1,30 @@
+# inttypes-pri.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values.  This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  if test $gl_cv_header_inttypes_h = yes; then
+    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+      gt_cv_inttypes_pri_broken,
+      [
+        AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+      ])
+  fi
+  if test "$gt_cv_inttypes_pri_broken" = yes; then
+    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+  fi
+])
diff --git a/config/gettext-macros/inttypes.m4 b/config/gettext-macros/inttypes.m4
new file mode 100644 (file)
index 0000000..779bcea
--- /dev/null
@@ -0,0 +1,25 @@
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+  [
+    AC_TRY_COMPILE(
+      [#include <sys/types.h>
+#include <inttypes.h>],
+      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+  ])
+  if test $gt_cv_header_inttypes_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+  fi
+])
diff --git a/config/gettext-macros/inttypes_h.m4 b/config/gettext-macros/inttypes_h.m4
new file mode 100644 (file)
index 0000000..a5d075d
--- /dev/null
@@ -0,0 +1,26 @@
+# inttypes_h.m4 serial 6
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
+[
+  AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <inttypes.h>],
+    [uintmax_t i = (uintmax_t) -1;],
+    gl_cv_header_inttypes_h=yes,
+    gl_cv_header_inttypes_h=no)])
+  if test $gl_cv_header_inttypes_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/config/gettext-macros/isc-posix.m4 b/config/gettext-macros/isc-posix.m4
new file mode 100644 (file)
index 0000000..74dc8f2
--- /dev/null
@@ -0,0 +1,24 @@
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+  [
+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+  ]
+)
diff --git a/config/gettext-macros/lcmessage.m4 b/config/gettext-macros/lcmessage.m4
new file mode 100644 (file)
index 0000000..19aa77e
--- /dev/null
@@ -0,0 +1,30 @@
+# lcmessage.m4 serial 4 (gettext-0.14.2)
+dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([gt_LC_MESSAGES],
+[
+  AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
+    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
+  if test $gt_cv_val_LC_MESSAGES = yes; then
+    AC_DEFINE(HAVE_LC_MESSAGES, 1,
+      [Define if your <locale.h> file defines LC_MESSAGES.])
+  fi
+])
diff --git a/config/gettext-macros/lib-ld.m4 b/config/gettext-macros/lib-ld.m4
new file mode 100644 (file)
index 0000000..96c4e2c
--- /dev/null
@@ -0,0 +1,110 @@
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+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 GCC])
+  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.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/config/gettext-macros/lib-link.m4 b/config/gettext-macros/lib-link.m4
new file mode 100644 (file)
index 0000000..9292919
--- /dev/null
@@ -0,0 +1,630 @@
+# lib-link.m4 serial 8 (gettext-0.15)
+dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ(2.50)
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIB[]NAME"
+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
+  else
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
+  fi
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE(rpath,
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib$1-prefix],
+[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+  AC_REQUIRE([AC_LIB_RPATH])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  $1=
+  if test "$enable_rpath" != no; then
+    if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+      dnl Use an explicit option to hardcode directories into the resulting
+      dnl binary.
+      rpathdirs=
+      next=
+      for opt in $2; do
+        if test -n "$next"; then
+          dir="$next"
+          dnl No need to hardcode the standard /usr/lib.
+          if test "X$dir" != "X/usr/$acl_libdirstem"; then
+            rpathdirs="$rpathdirs $dir"
+          fi
+          next=
+        else
+          case $opt in
+            -L) next=yes ;;
+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                 dnl No need to hardcode the standard /usr/lib.
+                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
+                   rpathdirs="$rpathdirs $dir"
+                 fi
+                 next= ;;
+            *) next= ;;
+          esac
+        fi
+      done
+      if test "X$rpathdirs" != "X"; then
+        if test -n ""$3""; then
+          dnl libtool is used for linking. Use -R options.
+          for dir in $rpathdirs; do
+            $1="${$1}${$1:+ }-R$dir"
+          done
+        else
+          dnl The linker is used for linking directly.
+          if test -n "$hardcode_libdir_separator"; then
+            dnl Weird platform: only the last -rpath option counts, the user
+            dnl must pass all path elements in one option.
+            alldirs=
+            for dir in $rpathdirs; do
+              alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
+            done
+            acl_save_libdir="$libdir"
+            libdir="$alldirs"
+            eval flag=\"$hardcode_libdir_flag_spec\"
+            libdir="$acl_save_libdir"
+            $1="$flag"
+          else
+            dnl The -rpath options are cumulative.
+            for dir in $rpathdirs; do
+              acl_save_libdir="$libdir"
+              libdir="$dir"
+              eval flag=\"$hardcode_libdir_flag_spec\"
+              libdir="$acl_save_libdir"
+              $1="${$1}${$1:+ }$flag"
+            done
+          fi
+        fi
+      fi
+    fi
+  fi
+  AC_SUBST([$1])
+])
diff --git a/config/gettext-macros/lib-prefix.m4 b/config/gettext-macros/lib-prefix.m4
new file mode 100644 (file)
index 0000000..a8684e1
--- /dev/null
@@ -0,0 +1,185 @@
+# lib-prefix.m4 serial 5 (gettext-0.15)
+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+  dnl There is no formal standard regarding lib and lib64. The current
+  dnl practice is that on a system supporting 32-bit and 64-bit instruction
+  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+  dnl libraries go under $prefix/lib. We determine the compiler's default
+  dnl mode by looking at the compiler's library search path. If at least
+  dnl of its elements ends in /lib64 or points to a directory whose absolute
+  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+  dnl default, namely "lib".
+  acl_libdirstem=lib
+  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+  if test -n "$searchpath"; then
+    acl_save_IFS="${IFS=       }"; IFS=":"
+    for searchdir in $searchpath; do
+      if test -d "$searchdir"; then
+        case "$searchdir" in
+          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+          *) searchdir=`cd "$searchdir" && pwd`
+             case "$searchdir" in
+               */lib64 ) acl_libdirstem=lib64 ;;
+             esac ;;
+        esac
+      fi
+    done
+    IFS="$acl_save_IFS"
+  fi
+])
diff --git a/config/gettext-macros/longdouble.m4 b/config/gettext-macros/longdouble.m4
new file mode 100644 (file)
index 0000000..25590f4
--- /dev/null
@@ -0,0 +1,31 @@
+# longdouble.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the compiler supports the 'long double' type.
+dnl Prerequisite: AC_PROG_CC
+
+dnl This file is only needed in autoconf <= 2.59.  Newer versions of autoconf
+dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
+
+AC_DEFUN([gt_TYPE_LONGDOUBLE],
+[
+  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
+    [if test "$GCC" = yes; then
+       gt_cv_c_long_double=yes
+     else
+       AC_TRY_COMPILE([
+         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
+         long double foo = 0.0;
+         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
+         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+         ], ,
+         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
+     fi])
+  if test $gt_cv_c_long_double = yes; then
+    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
+  fi
+])
diff --git a/config/gettext-macros/longlong.m4 b/config/gettext-macros/longlong.m4
new file mode 100644 (file)
index 0000000..7b399e0
--- /dev/null
@@ -0,0 +1,23 @@
+# longlong.m4 serial 5
+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([gl_AC_TYPE_LONG_LONG],
+[
+  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
+    [long long llmax = (long long) -1;
+     return ll << i | ll >> i | llmax / ll | llmax % ll;],
+    ac_cv_type_long_long=yes,
+    ac_cv_type_long_long=no)])
+  if test $ac_cv_type_long_long = yes; then
+    AC_DEFINE(HAVE_LONG_LONG, 1,
+      [Define if you have the 'long long' type.])
+  fi
+])
diff --git a/config/gettext-macros/nls.m4 b/config/gettext-macros/nls.m4
new file mode 100644 (file)
index 0000000..7967cc2
--- /dev/null
@@ -0,0 +1,31 @@
+# nls.m4 serial 3 (gettext-0.15)
+dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+AC_DEFUN([AM_NLS],
+[
+  AC_MSG_CHECKING([whether NLS is requested])
+  dnl Default is enabled NLS
+  AC_ARG_ENABLE(nls,
+    [  --disable-nls           do not use Native Language Support],
+    USE_NLS=$enableval, USE_NLS=yes)
+  AC_MSG_RESULT($USE_NLS)
+  AC_SUBST(USE_NLS)
+])
diff --git a/config/gettext-macros/po.m4 b/config/gettext-macros/po.m4
new file mode 100644 (file)
index 0000000..00133ef
--- /dev/null
@@ -0,0 +1,428 @@
+# po.m4 serial 13 (gettext-0.15)
+dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ(2.50)
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+  AC_REQUIRE([AM_NLS])dnl
+
+  dnl Perform the following tests also if --disable-nls has been given,
+  dnl because they are needed for "make dist" to work.
+
+  dnl Search for GNU msgfmt in the PATH.
+  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+  dnl The second test excludes FreeBSD msgfmt.
+  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+  dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+    *) MSGFMT_015=$MSGFMT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([GMSGFMT_015])
+
+  dnl Search for GNU xgettext 0.12 or newer in the PATH.
+  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+  dnl The second test excludes FreeBSD xgettext.
+  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  dnl Remove leftover from FreeBSD xgettext call.
+  rm -f messages.po
+
+  dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([XGETTEXT_015])
+
+  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+  dnl Installation directories.
+  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+  dnl have to define it here, so that it can be used in po/Makefile.
+  test -n "$localedir" || localedir='${datadir}/locale'
+  AC_SUBST([localedir])
+
+  AC_CONFIG_COMMANDS([po-directories], [[
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done]],
+   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+    # from automake < 1.5.
+    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="${LINGUAS-%UNSET%}"
+   ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+  # When this code is run, in config.status, two variables have already been
+  # set:
+  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+  # - LINGUAS is the value of the environment variable LINGUAS at configure
+  #   time.
+
+changequote(,)dnl
+  # Adjust a relative srcdir.
+  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+  # In autoconf-2.13 it is called $ac_given_srcdir.
+  # In autoconf-2.50 it is called $srcdir.
+  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+  case "$ac_given_srcdir" in
+    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+    /*) top_srcdir="$ac_given_srcdir" ;;
+    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  # Find a way to echo strings without interpreting backslash.
+  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+    gt_echo='echo'
+  else
+    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+      gt_echo='printf %s\n'
+    else
+      echo_func () {
+        cat <<EOT
+$*
+EOT
+      }
+      gt_echo='echo_func'
+    fi
+  fi
+
+  # A sed script that extracts the value of VARIABLE from a Makefile.
+  sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[     ]*VARIABLE[     ]*=/{
+  # Seen the first line of the variable definition.
+  s/^[  ]*VARIABLE[     ]*=//
+  ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+  # Set POTFILES to the value of the Makefile variable POTFILES.
+  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+  # Compute POTFILES_DEPS as
+  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+  POTFILES_DEPS=
+  for file in $POTFILES; do
+    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+  done
+  POMAKEFILEDEPS=""
+
+  if test -n "$OBSOLETE_ALL_LINGUAS"; then
+    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+  fi
+  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+    # The LINGUAS file contains the set of available languages.
+    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+  else
+    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+  fi
+  # Hide the ALL_LINGUAS assigment from automake < 1.5.
+  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+  # Compute POFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+  # Compute UPDATEPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+  # Compute DUMMYPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+  # Compute GMOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+  # Compute PROPERTIESFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+  # Compute CLASSFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+  # Compute QMFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+  # Compute MSGFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+  # Compute RESOURCESDLLFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+  case "$ac_given_srcdir" in
+    .) srcdirpre= ;;
+    *) srcdirpre='$(srcdir)/' ;;
+  esac
+  POFILES=
+  UPDATEPOFILES=
+  DUMMYPOFILES=
+  GMOFILES=
+  PROPERTIESFILES=
+  CLASSFILES=
+  QMFILES=
+  MSGFILES=
+  RESOURCESDLLFILES=
+  for lang in $ALL_LINGUAS; do
+    POFILES="$POFILES $srcdirpre$lang.po"
+    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+    QMFILES="$QMFILES $srcdirpre$lang.qm"
+    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+  done
+  # CATALOGS depends on both $ac_dir and the user's LINGUAS
+  # environment variable.
+  INST_LINGUAS=
+  if test -n "$ALL_LINGUAS"; then
+    for presentlang in $ALL_LINGUAS; do
+      useit=no
+      if test "%UNSET%" != "$LINGUAS"; then
+        desiredlanguages="$LINGUAS"
+      else
+        desiredlanguages="$ALL_LINGUAS"
+      fi
+      for desiredlang in $desiredlanguages; do
+        # Use the presentlang catalog if desiredlang is
+        #   a. equal to presentlang, or
+        #   b. a variant of presentlang (because in this case,
+        #      presentlang can be used as a fallback for messages
+        #      which are not translated in the desiredlang catalog).
+        case "$desiredlang" in
+          "$presentlang"*) useit=yes;;
+        esac
+      done
+      if test $useit = yes; then
+        INST_LINGUAS="$INST_LINGUAS $presentlang"
+      fi
+    done
+  fi
+  CATALOGS=
+  JAVACATALOGS=
+  QTCATALOGS=
+  TCLCATALOGS=
+  CSHARPCATALOGS=
+  if test -n "$INST_LINGUAS"; then
+    for lang in $INST_LINGUAS; do
+      CATALOGS="$CATALOGS $lang.gmo"
+      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+      QTCATALOGS="$QTCATALOGS $lang.qm"
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+    done
+  fi
+
+  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+       @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+       \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+       @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+       \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if test -n "$POMAKEFILEDEPS"; then
+    cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+  fi
+  mv "$ac_file.tmp" "$ac_file"
+])
diff --git a/config/gettext-macros/printf-posix.m4 b/config/gettext-macros/printf-posix.m4
new file mode 100644 (file)
index 0000000..af10170
--- /dev/null
@@ -0,0 +1,44 @@
+# printf-posix.m4 serial 2 (gettext-0.13.1)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the printf() function supports POSIX/XSI format strings with
+dnl positions.
+
+AC_DEFUN([gt_PRINTF_POSIX],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
+    gt_cv_func_printf_posix,
+    [
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+   dollar expansion (possibly an autoconf bug).  */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+  sprintf (buf, format, 33, 55);
+  return (strcmp (buf, "55 33") != 0);
+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
+      [
+        AC_EGREP_CPP(notposix, [
+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
+  notposix
+#endif
+        ], gt_cv_func_printf_posix="guessing no",
+           gt_cv_func_printf_posix="guessing yes")
+      ])
+    ])
+  case $gt_cv_func_printf_posix in
+    *yes)
+      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
+        [Define if your printf() function supports format strings with positions.])
+      ;;
+  esac
+])
diff --git a/config/gettext-macros/progtest.m4 b/config/gettext-macros/progtest.m4
new file mode 100644 (file)
index 0000000..a56365c
--- /dev/null
@@ -0,0 +1,92 @@
+# progtest.m4 serial 4 (gettext-0.14.2)
+dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+AC_PREREQ(2.50)
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  [[\\/]]* | ?:[[\\/]]*)
+    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in ifelse([$5], , $PATH, [$5]); do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+          if [$3]; then
+            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+    ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
diff --git a/config/gettext-macros/signed.m4 b/config/gettext-macros/signed.m4
new file mode 100644 (file)
index 0000000..048f593
--- /dev/null
@@ -0,0 +1,17 @@
+# signed.m4 serial 1 (gettext-0.10.40)
+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([bh_C_SIGNED],
+[
+  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
+   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
+  if test $bh_cv_c_signed = no; then
+    AC_DEFINE(signed, ,
+              [Define to empty if the C compiler doesn't support this keyword.])
+  fi
+])
diff --git a/config/gettext-macros/size_max.m4 b/config/gettext-macros/size_max.m4
new file mode 100644 (file)
index 0000000..029e471
--- /dev/null
@@ -0,0 +1,60 @@
+# size_max.m4 serial 4
+dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+  AC_CHECK_HEADERS(stdint.h)
+  dnl First test whether the system already has SIZE_MAX.
+  AC_MSG_CHECKING([for SIZE_MAX])
+  result=
+  AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], result=yes)
+  if test -z "$result"; then
+    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+    dnl than the type 'unsigned long'. Try hard to find a definition that can
+    dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+    _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
+      [#include <stddef.h>
+#include <limits.h>], size_t_bits_minus_1=)
+    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
+      [#include <stddef.h>], fits_in_uint=)
+    if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+      if test $fits_in_uint = 1; then
+        dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+        dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+        AC_TRY_COMPILE([#include <stddef.h>
+          extern size_t foo;
+          extern unsigned long foo;
+          ], [], fits_in_uint=0)
+      fi
+      dnl We cannot use 'expr' to simplify this expression, because 'expr'
+      dnl works only with 'long' integers in the host environment, while we
+      dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+      if test $fits_in_uint = 1; then
+        result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+      else
+        result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+      fi
+    else
+      dnl Shouldn't happen, but who knows...
+      result='((size_t)~(size_t)0)'
+    fi
+  fi
+  AC_MSG_RESULT([$result])
+  if test "$result" != yes; then
+    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
+      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+  fi
+])
diff --git a/config/gettext-macros/stdint_h.m4 b/config/gettext-macros/stdint_h.m4
new file mode 100644 (file)
index 0000000..3355f35
--- /dev/null
@@ -0,0 +1,26 @@
+# stdint_h.m4 serial 5
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_STDINT_H],
+[
+  AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <stdint.h>],
+    [uintmax_t i = (uintmax_t) -1;],
+    gl_cv_header_stdint_h=yes,
+    gl_cv_header_stdint_h=no)])
+  if test $gl_cv_header_stdint_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/config/gettext-macros/uintmax_t.m4 b/config/gettext-macros/uintmax_t.m4
new file mode 100644 (file)
index 0000000..bf83ed7
--- /dev/null
@@ -0,0 +1,30 @@
+# uintmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
+[
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+    AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
+    test $ac_cv_type_unsigned_long_long = yes \
+      && ac_type='unsigned long long' \
+      || ac_type='unsigned long'
+    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+      [Define to unsigned long or unsigned long long
+       if <stdint.h> and <inttypes.h> don't define.])
+  else
+    AC_DEFINE(HAVE_UINTMAX_T, 1,
+      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+  fi
+])
diff --git a/config/gettext-macros/ulonglong.m4 b/config/gettext-macros/ulonglong.m4
new file mode 100644 (file)
index 0000000..dee10cc
--- /dev/null
@@ -0,0 +1,23 @@
+# ulonglong.m4 serial 4
+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
+AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
+    [unsigned long long ullmax = (unsigned long long) -1;
+     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+    ac_cv_type_unsigned_long_long=yes,
+    ac_cv_type_unsigned_long_long=no)])
+  if test $ac_cv_type_unsigned_long_long = yes; then
+    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+      [Define if you have the 'unsigned long long' type.])
+  fi
+])
diff --git a/config/gettext-macros/wchar_t.m4 b/config/gettext-macros/wchar_t.m4
new file mode 100644 (file)
index 0000000..cde2129
--- /dev/null
@@ -0,0 +1,20 @@
+# wchar_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
+    [AC_TRY_COMPILE([#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
+  if test $gt_cv_c_wchar_t = yes; then
+    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
+  fi
+])
diff --git a/config/gettext-macros/wint_t.m4 b/config/gettext-macros/wint_t.m4
new file mode 100644 (file)
index 0000000..b8fff9c
--- /dev/null
@@ -0,0 +1,20 @@
+# wint_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+    [AC_TRY_COMPILE([#include <wchar.h>
+       wint_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+  if test $gt_cv_c_wint_t = yes; then
+    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
+  fi
+])
diff --git a/config/gettext-macros/xsize.m4 b/config/gettext-macros/xsize.m4
new file mode 100644 (file)
index 0000000..85bb721
--- /dev/null
@@ -0,0 +1,13 @@
+# xsize.m4 serial 3
+dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_XSIZE],
+[
+  dnl Prerequisites of lib/xsize.h.
+  AC_REQUIRE([gl_SIZE_MAX])
+  AC_REQUIRE([AC_C_INLINE])
+  AC_CHECK_HEADERS(stdint.h)
+])
diff --git a/config/gnulib.m4i b/config/gnulib.m4i
deleted file mode 100644 (file)
index b211f5f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-m4_include([config/gnulib/absolute-header.m4])
-m4_include([config/gnulib/alloca.m4])
-m4_include([config/gnulib/arpa_inet_h.m4])
-m4_include([config/gnulib/eoverflow.m4])
-m4_include([config/gnulib/extensions.m4])
-m4_include([config/gnulib/getaddrinfo.m4])
-m4_include([config/gnulib/gnulib-cache.m4])
-m4_include([config/gnulib/gnulib-common.m4])
-m4_include([config/gnulib/gnulib-comp.m4])
-m4_include([config/gnulib/gnulib-tool.m4])
-m4_include([config/gnulib/inet_ntop.m4])
-m4_include([config/gnulib/intmax_t.m4])
-m4_include([config/gnulib/inttypes_h.m4])
-m4_include([config/gnulib/lib-ld.m4])
-m4_include([config/gnulib/lib-link.m4])
-m4_include([config/gnulib/lib-prefix.m4])
-m4_include([config/gnulib/lock.m4])
-m4_include([config/gnulib/longdouble.m4])
-m4_include([config/gnulib/longlong.m4])
-m4_include([config/gnulib/netinet_in_h.m4])
-m4_include([config/gnulib/onceonly_2_57.m4])
-m4_include([config/gnulib/size_max.m4])
-m4_include([config/gnulib/snprintf.m4])
-m4_include([config/gnulib/socklen.m4])
-m4_include([config/gnulib/sockpfaf.m4])
-m4_include([config/gnulib/stdbool.m4])
-m4_include([config/gnulib/stdint_h.m4])
-m4_include([config/gnulib/strdup.m4])
-m4_include([config/gnulib/string_h.m4])
-m4_include([config/gnulib/sys_socket_h.m4])
-m4_include([config/gnulib/vasnprintf.m4])
-m4_include([config/gnulib/visibility.m4])
-m4_include([config/gnulib/wchar_t.m4])
-m4_include([config/gnulib/wint_t.m4])
-m4_include([config/gnulib/xsize.m4])
index c649df0840adadc8282959c9b3e6df6f4337f3b7..5b7a2fc35f08d6bddc2f58eb0a1f887c2f8364a7 100644 (file)
@@ -1,5 +1,5 @@
-# absolute-header.m4 serial 6
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# absolute-header.m4 serial 7
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -32,7 +32,12 @@ dnl eval is necessary to expand ac_cpp.
 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
       AS_VAR_SET(gl_absolute_header,
 [`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`])
+sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
+       s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
+       s#^/[^/]#//&#
+       p
+       q
+}'`])
     fi
     AS_VAR_POPDEF([ac_header_exists])dnl
     ])dnl
diff --git a/config/gnulib/base64.m4 b/config/gnulib/base64.m4
new file mode 100644 (file)
index 0000000..24801ef
--- /dev/null
@@ -0,0 +1,16 @@
+# base64.m4 serial 3
+dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_BASE64],
+[
+  gl_PREREQ_BASE64
+])
+
+# Prerequisites of lib/base64.c.
+AC_DEFUN([gl_PREREQ_BASE64], [
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([AC_C_RESTRICT])
+])
index 143a9e5403b9a67dd3c44076c5843fb2696e955e..bcbb3ceee2c30bd23176dcd1e55af74185b7ec1b 100644 (file)
@@ -1,14 +1,14 @@
-# serial 4  -*- Autoconf -*-
+# serial 5  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2007 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 definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
 # Autoconf.  Perhaps we can remove this once we can assume Autoconf
-# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE.  The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
 AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-[
-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
-  AC_REQUIRE([AC_GNU_SOURCE])
-  AC_REQUIRE([AC_AIX])
-  AC_REQUIRE([AC_MINIX])
+  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+  if test "$MINIX" = yes; then
+    AC_DEFINE([_POSIX_SOURCE], [1],
+      [Define to 1 if you need to in order for `stat' and other
+       things to work.])
+    AC_DEFINE([_POSIX_1_SOURCE], [2],
+      [Define to 2 if the system does not provide POSIX.1 features
+       except with this defined.])
+    AC_DEFINE([_MINIX], [1],
+      [Define to 1 if on MINIX.])
+  fi
 
   AH_VERBATIM([__EXTENSIONS__],
-[/* Enable extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
+[/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
 #endif
+/* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+/* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
-#endif])
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
   AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
@@ -46,9 +68,11 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
        [ac_cv_safe_to_define___extensions__=no])])
   test $ac_cv_safe_to_define___extensions__ = yes &&
     AC_DEFINE([__EXTENSIONS__])
+  AC_DEFINE([_ALL_SOURCE])
+  AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
-])
+])# AC_USE_SYSTEM_EXTENSIONS
 
 # gl_USE_SYSTEM_EXTENSIONS
 # ------------------------
diff --git a/config/gnulib/file-list b/config/gnulib/file-list
new file mode 100644 (file)
index 0000000..f2c14fc
--- /dev/null
@@ -0,0 +1,55 @@
+## this file is automatically generated by autogen
+EXTRA_DIST += gnulib/absolute-header.m4
+EXTRA_DIST += gnulib/alloca.m4
+EXTRA_DIST += gnulib/arpa_inet_h.m4
+EXTRA_DIST += gnulib/base64.m4
+EXTRA_DIST += gnulib/eoverflow.m4
+EXTRA_DIST += gnulib/extensions.m4
+EXTRA_DIST += gnulib/float_h.m4
+EXTRA_DIST += gnulib/fsusage.m4
+EXTRA_DIST += gnulib/getaddrinfo.m4
+EXTRA_DIST += gnulib/gettimeofday.m4
+EXTRA_DIST += gnulib/gnulib-cache.m4
+EXTRA_DIST += gnulib/gnulib-common.m4
+EXTRA_DIST += gnulib/gnulib-comp.m4
+EXTRA_DIST += gnulib/gnulib-tool.m4
+EXTRA_DIST += gnulib/include_next.m4
+EXTRA_DIST += gnulib/inet_ntop.m4
+EXTRA_DIST += gnulib/intmax_t.m4
+EXTRA_DIST += gnulib/inttypes_h.m4
+EXTRA_DIST += gnulib/lib-ld.m4
+EXTRA_DIST += gnulib/lib-link.m4
+EXTRA_DIST += gnulib/lib-prefix.m4
+EXTRA_DIST += gnulib/lock.m4
+EXTRA_DIST += gnulib/longlong.m4
+EXTRA_DIST += gnulib/malloc.m4
+EXTRA_DIST += gnulib/mkdtemp.m4
+EXTRA_DIST += gnulib/netinet_in_h.m4
+EXTRA_DIST += gnulib/onceonly_2_57.m4
+EXTRA_DIST += gnulib/physmem.m4
+EXTRA_DIST += gnulib/safe-read.m4
+EXTRA_DIST += gnulib/safe-write.m4
+EXTRA_DIST += gnulib/size_max.m4
+EXTRA_DIST += gnulib/snprintf.m4
+EXTRA_DIST += gnulib/socklen.m4
+EXTRA_DIST += gnulib/sockpfaf.m4
+EXTRA_DIST += gnulib/ssize_t.m4
+EXTRA_DIST += gnulib/stdbool.m4
+EXTRA_DIST += gnulib/stdint_h.m4
+EXTRA_DIST += gnulib/stdint.m4
+EXTRA_DIST += gnulib/stdio_h.m4
+EXTRA_DIST += gnulib/stdlib_h.m4
+EXTRA_DIST += gnulib/strdup.m4
+EXTRA_DIST += gnulib/string_h.m4
+EXTRA_DIST += gnulib/sys_socket_h.m4
+EXTRA_DIST += gnulib/sys_stat_h.m4
+EXTRA_DIST += gnulib/sys_time_h.m4
+EXTRA_DIST += gnulib/tempname.m4
+EXTRA_DIST += gnulib/ulonglong.m4
+EXTRA_DIST += gnulib/unistd_h.m4
+EXTRA_DIST += gnulib/vasnprintf.m4
+EXTRA_DIST += gnulib/visibility.m4
+EXTRA_DIST += gnulib/wchar.m4
+EXTRA_DIST += gnulib/wchar_t.m4
+EXTRA_DIST += gnulib/wint_t.m4
+EXTRA_DIST += gnulib/xsize.m4
diff --git a/config/gnulib/float_h.m4 b/config/gnulib/float_h.m4
new file mode 100644 (file)
index 0000000..1b1ad10
--- /dev/null
@@ -0,0 +1,19 @@
+# float_h.m4 serial 2
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FLOAT_H],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  FLOAT_H=
+  case "$host_os" in
+    beos*)
+      FLOAT_H=float.h
+      gl_CHECK_NEXT_HEADERS([float.h])
+      ;;
+  esac
+  AC_SUBST([FLOAT_H])
+])
diff --git a/config/gnulib/fsusage.m4 b/config/gnulib/fsusage.m4
new file mode 100644 (file)
index 0000000..18eedbc
--- /dev/null
@@ -0,0 +1,269 @@
+#serial 23
+# Obtaining file system usage information.
+
+# Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FSUSAGE],
+[
+  AC_CHECK_HEADERS_ONCE(sys/param.h)
+  AC_CHECK_HEADERS_ONCE(sys/vfs.h sys/fs_types.h)
+  AC_CHECK_HEADERS(sys/mount.h, [], [],
+    [AC_INCLUDES_DEFAULT
+     [#if HAVE_SYS_PARAM_H
+       #include <sys/param.h>
+      #endif]])
+  gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
+  if test $gl_cv_fs_space = yes; then
+    AC_LIBOBJ(fsusage)
+    gl_PREREQ_FSUSAGE_EXTRA
+  fi
+])
+
+# Try to determine how a program can obtain file system usage information.
+# If successful, define the appropriate symbol (see fsusage.c) and
+# execute ACTION-IF-FOUND.  Otherwise, execute ACTION-IF-NOT-FOUND.
+#
+# gl_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([gl_FILE_SYSTEM_USAGE],
+[
+
+AC_MSG_NOTICE([checking how to get file system space usage])
+ac_fsusage_space=no
+
+# Perform only the link test since it seems there are no variants of the
+# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
+# because that got a false positive on SCO OSR5.  Adding the declaration
+# of a `struct statvfs' causes this test to fail (as it should) on such
+# systems.  That system is reported to work fine with STAT_STATFS4 which
+# is what it gets when this test fails.
+if test $ac_fsusage_space = no; then
+  # SVR4
+  AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
+                [AC_TRY_LINK([#include <sys/types.h>
+#if defined __GLIBC__ && !defined __BEOS__
+Do not use statvfs on systems with GNU libc, because that function stats
+all preceding entries in /proc/mounts, and that makes df hang if even
+one of the corresponding file systems is hard-mounted, but not available.
+statvfs in GNU libc on BeOS operates differently: it only makes a system
+call.
+#endif
+
+#ifdef __osf__
+"Do not use Tru64's statvfs implementation"
+#endif
+
+#include <sys/statvfs.h>],
+                             [struct statvfs fsd; statvfs (0, &fsd);],
+                             fu_cv_sys_stat_statvfs=yes,
+                             fu_cv_sys_stat_statvfs=no)])
+  if test $fu_cv_sys_stat_statvfs = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATVFS, 1,
+             [  Define if there is a function named statvfs.  (SVR4)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+  # DEC Alpha running OSF/1
+  AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
+  AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
+  [AC_TRY_RUN([
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+  int
+  main ()
+  {
+    struct statfs fsd;
+    fsd.f_fsize = 0;
+    return statfs (".", &fsd, sizeof (struct statfs)) != 0;
+  }],
+  fu_cv_sys_stat_statfs3_osf1=yes,
+  fu_cv_sys_stat_statfs3_osf1=no,
+  fu_cv_sys_stat_statfs3_osf1=no)])
+  AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
+  if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATFS3_OSF1, 1,
+             [   Define if  statfs takes 3 args.  (DEC Alpha running OSF/1)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+# AIX
+  AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
+member (AIX, 4.3BSD)])
+  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
+  [AC_TRY_RUN([
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+  int
+  main ()
+  {
+  struct statfs fsd;
+  fsd.f_bsize = 0;
+  return statfs (".", &fsd) != 0;
+  }],
+  fu_cv_sys_stat_statfs2_bsize=yes,
+  fu_cv_sys_stat_statfs2_bsize=no,
+  fu_cv_sys_stat_statfs2_bsize=no)])
+  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
+  if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATFS2_BSIZE, 1,
+[  Define if statfs takes 2 args and struct statfs has a field named f_bsize.
+   (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+# SVR3
+  AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
+  AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
+  [AC_TRY_RUN([#include <sys/types.h>
+#include <sys/statfs.h>
+  int
+  main ()
+  {
+  struct statfs fsd;
+  return statfs (".", &fsd, sizeof fsd, 0) != 0;
+  }],
+    fu_cv_sys_stat_statfs4=yes,
+    fu_cv_sys_stat_statfs4=no,
+    fu_cv_sys_stat_statfs4=no)])
+  AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
+  if test $fu_cv_sys_stat_statfs4 = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATFS4, 1,
+             [  Define if statfs takes 4 args.  (SVR3, Dynix, Irix, Dolphin)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+# 4.4BSD and NetBSD
+  AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
+member (4.4BSD and NetBSD)])
+  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
+  [AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+  int
+  main ()
+  {
+  struct statfs fsd;
+  fsd.f_fsize = 0;
+  return statfs (".", &fsd) != 0;
+  }],
+  fu_cv_sys_stat_statfs2_fsize=yes,
+  fu_cv_sys_stat_statfs2_fsize=no,
+  fu_cv_sys_stat_statfs2_fsize=no)])
+  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
+  if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATFS2_FSIZE, 1,
+[  Define if statfs takes 2 args and struct statfs has a field named f_fsize.
+   (4.4BSD, NetBSD)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+  # Ultrix
+  AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
+  AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
+  [AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+  int
+  main ()
+  {
+  struct fs_data fsd;
+  /* Ultrix's statfs returns 1 for success,
+     0 for not mounted, -1 for failure.  */
+  return statfs (".", &fsd) != 1;
+  }],
+  fu_cv_sys_stat_fs_data=yes,
+  fu_cv_sys_stat_fs_data=no,
+  fu_cv_sys_stat_fs_data=no)])
+  AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
+  if test $fu_cv_sys_stat_fs_data = yes; then
+    ac_fsusage_space=yes
+    AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
+[  Define if statfs takes 2 args and the second argument has
+   type struct fs_data.  (Ultrix)])
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+  # SVR2
+  AC_TRY_CPP([#include <sys/filsys.h>
+    ],
+    AC_DEFINE(STAT_READ_FILSYS, 1,
+      [Define if there is no specific function for reading file systems usage
+       information and you have the <sys/filsys.h> header file.  (SVR2)])
+    ac_fsusage_space=yes)
+fi
+
+AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
+
+])
+
+
+# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
+# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
+# enable the work-around code in fsusage.c.
+AC_DEFUN([gl_STATFS_TRUNCATES],
+[
+  AC_MSG_CHECKING([for statfs that truncates block counts])
+  AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(sun) && !defined(__sun)
+choke -- this is a workaround for a Sun-specific problem
+#endif
+#include <sys/types.h>
+#include <sys/vfs.h>]],
+    [[struct statfs t; long c = *(t.f_spare);
+      if (c) return 0;]])],
+    [fu_cv_sys_truncating_statfs=yes],
+    [fu_cv_sys_truncating_statfs=no])])
+  if test $fu_cv_sys_truncating_statfs = yes; then
+    AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
+      [Define if the block counts reported by statfs may be truncated to 2GB
+       and the correct values may be stored in the f_spare array.
+       (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
+       SunOS 4.1.1 seems not to be affected.)])
+  fi
+  AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
+])
+
+
+# Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE.
+AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
+[
+  AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h)
+  gl_STATFS_TRUNCATES
+])
index db285d94238641f3eb0fd9e80d6f706536036640..7be1e490ae68f96f83577a745404abce79a1b408 100644 (file)
@@ -1,11 +1,12 @@
-# getaddrinfo.m4 serial 11
-dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+# getaddrinfo.m4 serial 13
+dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_GETADDRINFO],
 [
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
   AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
 
   AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
@@ -28,12 +29,36 @@ AC_DEFUN([gl_GETADDRINFO],
     fi
     ])
 
-  AC_REPLACE_FUNCS(gai_strerror)
+  # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
+  # inline function declared in ws2tcpip.h, so we need to get that
+  # header included somehow.
+  AC_CHECK_HEADERS_ONCE(netdb.h)
+  AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
+    gl_cv_func_gai_strerror, [
+      AC_TRY_LINK([
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+], [gai_strerror (0);],
+        [gl_cv_func_gai_strerror=yes],
+        [gl_cv_func_gai_strerror=no])])
+  if test $gl_cv_func_gai_strerror = no; then
+    AC_LIBOBJ(gai_strerror)
+  fi
+
   gl_PREREQ_GETADDRINFO
 ])
 
 # Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
 AC_DEFUN([gl_PREREQ_GETADDRINFO], [
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
   AC_SEARCH_LIBS(gethostbyname, [inet nsl])
   AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
   AC_CHECK_FUNCS(gethostbyname,, [
@@ -56,7 +81,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
   AC_REQUIRE([gl_SOCKET_FAMILIES])
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])
   AC_REQUIRE([AC_C_INLINE])
-  AC_REQUIRE([AC_GNU_SOURCE])
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
   AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
   /* sys/types.h is not needed according to POSIX, but the
diff --git a/config/gnulib/gettimeofday.m4 b/config/gnulib/gettimeofday.m4
new file mode 100644 (file)
index 0000000..b9bbb10
--- /dev/null
@@ -0,0 +1,101 @@
+#serial 11
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+
+AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+  AC_CHECK_FUNCS_ONCE([gettimeofday])
+
+  AC_CACHE_CHECK([for gettimeofday with POSIX signature],
+    [gl_cv_func_gettimeofday_posix_signature],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+         [[#include <sys/time.h>
+           struct timeval c;
+         ]],
+         [[
+           int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
+           int x = f (&c, 0);
+           return !(x | c.tv_sec | c.tv_usec);
+         ]])],
+       [gl_cv_func_gettimeofday_posix_signature=yes],
+       [gl_cv_func_gettimeofday_posix_signature=no])])
+
+  gl_FUNC_GETTIMEOFDAY_CLOBBER
+
+  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
+    REPLACE_GETTIMEOFDAY=1
+    SYS_TIME_H=sys/time.h
+    if test $gl_cv_func_gettimeofday_clobber != yes; then
+      AC_LIBOBJ(gettimeofday)
+      gl_PREREQ_GETTIMEOFDAY
+    fi
+  fi
+])
+
+
+dnl See if gettimeofday clobbers the static buffer that localtime uses
+dnl for its return value.  The gettimeofday function from Mac OS X 10.0.4
+dnl (i.e., Darwin 1.3.7) has this problem.
+dnl
+dnl If it does, then arrange to use gettimeofday and localtime only via
+dnl the wrapper functions that work around the problem.
+
+AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
+[
+ AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+
+ AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
+  [gl_cv_func_gettimeofday_clobber],
+  [AC_RUN_IFELSE(
+     [AC_LANG_PROGRAM(
+       [[#include <string.h>
+         #include <sys/time.h>
+         #include <time.h>
+         #include <stdlib.h>
+       ]],
+       [[
+         time_t t = 0;
+         struct tm *lt;
+         struct tm saved_lt;
+         struct timeval tv;
+         lt = localtime (&t);
+         saved_lt = *lt;
+         gettimeofday (&tv, NULL);
+         return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
+       ]])],
+     [gl_cv_func_gettimeofday_clobber=no],
+     [gl_cv_func_gettimeofday_clobber=yes],
+     dnl When crosscompiling, assume it is broken.
+     [gl_cv_func_gettimeofday_clobber=yes])])
+
+ if test $gl_cv_func_gettimeofday_clobber = yes; then
+   REPLACE_GETTIMEOFDAY=1
+   SYS_TIME_H=sys/time.h
+   gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+   AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1,
+     [Define if gettimeofday clobbers the localtime buffer.])
+ fi
+])
+
+AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
+  AC_LIBOBJ(gettimeofday)
+  gl_PREREQ_GETTIMEOFDAY
+  AC_DEFINE([gmtime], [rpl_gmtime],
+    [Define to rpl_gmtime if the replacement function should be used.])
+  AC_DEFINE([localtime], [rpl_localtime],
+    [Define to rpl_localtime if the replacement function should be used.])
+])
+
+# Prerequisites of lib/gettimeofday.c.
+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
+  AC_CHECK_HEADERS([sys/timeb.h])
+  AC_CHECK_FUNCS([_ftime])
+])
index 717621bf2f0b12897268fa2c11fbe1c031d4b131..f1b01f7fb3c4438d5cdfa1cabc66ef09c21f3a72 100644 (file)
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
-gl_MODULES([getaddrinfo lock visibility])
+gl_MODULES([base64 fsusage getaddrinfo lock mkdtemp physmem visibility])
 gl_AVOID([])
 gl_SOURCE_BASE([gnulib])
 gl_M4_BASE([config/gnulib])
+gl_PO_BASE([])
 gl_DOC_BASE([doc])
 gl_TESTS_BASE([tests])
 gl_LIB([libgnu])
 gl_MAKEFILE_NAME([])
 gl_LIBTOOL
 gl_MACRO_PREFIX([gl])
+gl_PO_DOMAIN([])
index f26cf170927c98f2fbc92334799005125eb4d64c..3c363607ad367cc6e78c874183217013a949adbc 100644 (file)
@@ -42,21 +42,48 @@ AC_DEFUN([gl_INIT],
   gl_source_base='gnulib'
   gl_FUNC_ALLOCA
   gl_HEADER_ARPA_INET
-  dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
+  AC_PROG_MKDIR_P
+  gl_FUNC_BASE64
+  gl_FLOAT_H
+  gl_FSUSAGE
   gl_GETADDRINFO
+  AC_SUBST([LIBINTL])
+  AC_SUBST([LTLIBINTL])
+  gl_FUNC_GETTIMEOFDAY
   gl_INET_NTOP
   gl_LOCK
+  gl_FUNC_MALLOC_POSIX
+  gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+  gt_FUNC_MKDTEMP
+  gl_STDLIB_MODULE_INDICATOR([mkdtemp])
   gl_HEADER_NETINET_IN
+  AC_PROG_MKDIR_P
+  gl_PHYSMEM
+  gl_SAFE_READ
+  gl_SAFE_WRITE
   gl_SIZE_MAX
   gl_FUNC_SNPRINTF
+  gl_STDIO_MODULE_INDICATOR([snprintf])
   gl_TYPE_SOCKLEN_T
+  gt_TYPE_SSIZE_T
   AM_STDBOOL_H
+  gl_STDINT_H
+  gl_STDIO_H
+  gl_STDLIB_H
   gl_FUNC_STRDUP
+  gl_STRING_MODULE_INDICATOR([strdup])
   gl_HEADER_STRING_H
   gl_HEADER_SYS_SOCKET
   AC_PROG_MKDIR_P
+  gl_HEADER_SYS_STAT_H
+  AC_PROG_MKDIR_P
+  gl_HEADER_SYS_TIME_H
+  AC_PROG_MKDIR_P
+  gl_FUNC_GEN_TEMPNAME
+  gl_UNISTD_H
   gl_FUNC_VASNPRINTF
   gl_VISIBILITY
+  gl_WCHAR_H
   gl_XSIZE
   m4_popdef([AC_LIBSOURCES])
   m4_popdef([AC_REPLACE_FUNCS])
@@ -96,37 +123,71 @@ AC_DEFUN([gl_LIBSOURCES],
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
   build-aux/config.rpath
+  build-aux/link-warning.h
   lib/alloca_.h
   lib/asnprintf.c
+  lib/base64.c
+  lib/base64.h
+  lib/float+.h
+  lib/float_.h
+  lib/fsusage.c
+  lib/fsusage.h
+  lib/full-read.c
+  lib/full-read.h
+  lib/full-write.c
+  lib/full-write.h
   lib/gai_strerror.c
   lib/getaddrinfo.c
   lib/getaddrinfo.h
   lib/gettext.h
+  lib/gettimeofday.c
   lib/inet_ntop.c
   lib/inet_ntop.h
   lib/lock.c
   lib/lock.h
+  lib/malloc.c
+  lib/mkdtemp.c
+  lib/netinet_in_.h
+  lib/physmem.c
+  lib/physmem.h
   lib/printf-args.c
   lib/printf-args.h
   lib/printf-parse.c
   lib/printf-parse.h
+  lib/safe-read.c
+  lib/safe-read.h
+  lib/safe-write.c
+  lib/safe-write.h
   lib/size_max.h
   lib/snprintf.c
-  lib/snprintf.h
-  lib/socket_.h
   lib/stdbool_.h
+  lib/stdint_.h
+  lib/stdio_.h
+  lib/stdlib_.h
   lib/strdup.c
   lib/string_.h
+  lib/sys_socket_.h
+  lib/sys_stat_.h
+  lib/sys_time_.h
+  lib/tempname.c
+  lib/tempname.h
+  lib/unistd_.h
   lib/vasnprintf.c
   lib/vasnprintf.h
+  lib/wchar_.h
   lib/xsize.h
   m4/absolute-header.m4
   m4/alloca.m4
   m4/arpa_inet_h.m4
+  m4/base64.m4
   m4/eoverflow.m4
   m4/extensions.m4
+  m4/float_h.m4
+  m4/fsusage.m4
   m4/getaddrinfo.m4
+  m4/gettimeofday.m4
   m4/gnulib-common.m4
+  m4/include_next.m4
   m4/inet_ntop.m4
   m4/intmax_t.m4
   m4/inttypes_h.m4
@@ -134,21 +195,35 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/lib-link.m4
   m4/lib-prefix.m4
   m4/lock.m4
-  m4/longdouble.m4
   m4/longlong.m4
+  m4/malloc.m4
+  m4/mkdtemp.m4
   m4/netinet_in_h.m4
   m4/onceonly_2_57.m4
+  m4/physmem.m4
+  m4/safe-read.m4
+  m4/safe-write.m4
   m4/size_max.m4
   m4/snprintf.m4
   m4/socklen.m4
   m4/sockpfaf.m4
+  m4/ssize_t.m4
   m4/stdbool.m4
+  m4/stdint.m4
   m4/stdint_h.m4
+  m4/stdio_h.m4
+  m4/stdlib_h.m4
   m4/strdup.m4
   m4/string_h.m4
   m4/sys_socket_h.m4
+  m4/sys_stat_h.m4
+  m4/sys_time_h.m4
+  m4/tempname.m4
+  m4/ulonglong.m4
+  m4/unistd_h.m4
   m4/vasnprintf.m4
   m4/visibility.m4
+  m4/wchar.m4
   m4/wchar_t.m4
   m4/wint_t.m4
   m4/xsize.m4
diff --git a/config/gnulib/include_next.m4 b/config/gnulib/include_next.m4
new file mode 100644 (file)
index 0000000..7ce472b
--- /dev/null
@@ -0,0 +1,107 @@
+# include_next.m4 serial 4
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Derek Price.
+
+AC_DEFUN([gl_INCLUDE_NEXT],
+[
+  AC_LANG_PREPROC_REQUIRE()
+  AC_CACHE_CHECK([whether the preprocessor supports include_next],
+    [gl_cv_have_include_next],
+    [rm -rf conftestd1 conftestd2
+     mkdir conftestd1 conftestd2
+     cat <<EOF > conftestd1/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+     cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+     save_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
+     AC_COMPILE_IFELSE([#include <conftest.h>],
+       [gl_cv_have_include_next=yes],
+       [gl_cv_have_include_next=no])
+     CPPFLAGS="$save_CPPFLAGS"
+     rm -rf conftestd1 conftestd2
+    ])
+  if test $gl_cv_have_include_next = yes; then
+
+    dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it
+    dnl to use @INCLUDE_NEXT@ instead.
+    AC_DEFINE([HAVE_INCLUDE_NEXT], 1,
+             [Define if your compiler supports the #include_next directive.])
+
+    INCLUDE_NEXT=include_next
+  else
+    INCLUDE_NEXT=include
+  fi
+  AC_SUBST([INCLUDE_NEXT])
+])
+
+# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------------
+# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
+# '<foo.h>'; otherwise define it to be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# That way, a header file with the following line:
+#      #@INCLUDE_NEXT@ @NEXT_FOO_H@
+# behaves (after sed substitution) as if it contained
+#      #include_next <foo.h>
+# even if the compiler does not support include_next.
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+AC_DEFUN([gl_CHECK_NEXT_HEADERS],
+[
+  AC_REQUIRE([gl_INCLUDE_NEXT])
+  AC_CHECK_HEADERS_ONCE([$1])
+
+  AC_FOREACH([gl_HEADER_NAME], [$1],
+    [AS_VAR_PUSHDEF([gl_next_header],
+                   [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
+     if test $gl_cv_have_include_next = yes; then
+       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+     else
+       AC_CACHE_CHECK(
+        [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
+        m4_quote(m4_defn([gl_next_header])),
+        [AS_VAR_PUSHDEF([gl_header_exists],
+                        [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
+         if test AS_VAR_GET(gl_header_exists) = yes; then
+           AC_LANG_CONFTEST(
+             [AC_LANG_SOURCE(
+                [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+              )])
+           dnl eval is necessary to expand ac_cpp.
+           dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+           dnl so use subshell.
+           AS_VAR_SET([gl_next_header],
+             ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+              sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
+                s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'])
+         else
+           AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+         fi
+         AS_VAR_POPDEF([gl_header_exists])])
+     fi
+     AC_SUBST(
+       AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+       [AS_VAR_GET([gl_next_header])])
+     AS_VAR_POPDEF([gl_next_header])])
+])
index 0224f2ff870a1dc6650a2ab8d327b6a5c6cc7f38..4cc585ea2e7776c06afd41761afaacaad040cc93 100644 (file)
@@ -1,5 +1,5 @@
-# lock.m4 serial 6 (gettext-0.16)
-dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
+# lock.m4 serial 7 (gettext-0.16.2)
+dnl Copyright (C) 2005-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -35,7 +35,12 @@ AC_DEFUN([gl_LOCK_EARLY_BODY],
   AC_BEFORE([$0], [gl_ARGP])dnl
 
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
+  dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+  dnl AC_GNU_SOURCE.
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
   dnl Check for multithreading.
   AC_ARG_ENABLE(threads,
 AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
diff --git a/config/gnulib/longdouble.m4 b/config/gnulib/longdouble.m4
deleted file mode 100644 (file)
index 25590f4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# longdouble.m4 serial 2 (gettext-0.15)
-dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether the compiler supports the 'long double' type.
-dnl Prerequisite: AC_PROG_CC
-
-dnl This file is only needed in autoconf <= 2.59.  Newer versions of autoconf
-dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
-
-AC_DEFUN([gt_TYPE_LONGDOUBLE],
-[
-  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
-    [if test "$GCC" = yes; then
-       gt_cv_c_long_double=yes
-     else
-       AC_TRY_COMPILE([
-         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-         long double foo = 0.0;
-         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-         ], ,
-         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
-     fi])
-  if test $gt_cv_c_long_double = yes; then
-    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
-  fi
-])
diff --git a/config/gnulib/malloc.m4 b/config/gnulib/malloc.m4
new file mode 100644 (file)
index 0000000..764f2a9
--- /dev/null
@@ -0,0 +1,41 @@
+# malloc.m4 serial 8
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_FUNC_MALLOC_POSIX
+# --------------------
+# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails), and replace malloc if it is not.
+AC_DEFUN([gl_FUNC_MALLOC_POSIX],
+[
+  AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
+  if test $gl_cv_func_malloc_posix = yes; then
+    HAVE_MALLOC_POSIX=1
+    AC_DEFINE([HAVE_MALLOC_POSIX], 1,
+      [Define if the 'malloc' function is POSIX compliant.])
+  else
+    AC_LIBOBJ([malloc])
+    HAVE_MALLOC_POSIX=0
+  fi
+  AC_SUBST([HAVE_MALLOC_POSIX])
+])
+
+# Test whether malloc, realloc, calloc are POSIX compliant,
+# Set gl_cv_func_malloc_posix to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_POSIX],
+[
+  AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
+    [gl_cv_func_malloc_posix],
+    [
+      dnl It is too dangerous to try to allocate a large amount of memory:
+      dnl some systems go to their knees when you do that. So assume that
+      dnl all Unix implementations of the function are POSIX compliant.
+      AC_TRY_COMPILE([],
+        [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+         choke me
+         #endif
+        ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
+    ])
+])
diff --git a/config/gnulib/mkdtemp.m4 b/config/gnulib/mkdtemp.m4
new file mode 100644 (file)
index 0000000..0eeafbc
--- /dev/null
@@ -0,0 +1,20 @@
+# mkdtemp.m4 serial 5
+dnl Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gt_FUNC_MKDTEMP],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REPLACE_FUNCS(mkdtemp)
+  if test $ac_cv_func_mkdtemp = no; then
+    HAVE_MKDTEMP=0
+    gl_PREREQ_MKDTEMP
+  fi
+])
+
+# Prerequisites of lib/mkdtemp.c
+AC_DEFUN([gl_PREREQ_MKDTEMP],
+[:
+])
index d73531a051eb2b0d2474797c3472f86f89bb0cdd..096be740da7f4ab3c91116678b27c8d72a532b9d 100644 (file)
@@ -1,18 +1,30 @@
-# netinet_in_h.m4 serial 1
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# netinet_in_h.m4 serial 3
+dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Written by Simon Josefsson
-
 AC_DEFUN([gl_HEADER_NETINET_IN],
 [
-  AC_CHECK_HEADERS_ONCE([netinet/in.h])
-  if test $ac_cv_header_netinet_in_h = yes; then
+  AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
+    [gl_cv_header_netinet_in_h_selfcontained],
+    [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netinet/in.h>], [])],
+        [gl_cv_header_netinet_in_h_selfcontained=yes],
+        [gl_cv_header_netinet_in_h_selfcontained=no])
+    ])
+  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
     NETINET_IN_H=''
   else
     NETINET_IN_H='netinet/in.h'
+    AC_CHECK_HEADERS([netinet/in.h])
+    gl_CHECK_NEXT_HEADERS([netinet/in.h])
+    if test $ac_cv_header_netinet_in_h = yes; then
+      HAVE_NETINET_IN_H=1
+    else
+      HAVE_NETINET_IN_H=0
+    fi
+    AC_SUBST([HAVE_NETINET_IN_H])
   fi
-  AC_SUBST(NETINET_IN_H)
+  AC_SUBST([NETINET_IN_H])
 ])
diff --git a/config/gnulib/physmem.m4 b/config/gnulib/physmem.m4
new file mode 100644 (file)
index 0000000..456bb37
--- /dev/null
@@ -0,0 +1,39 @@
+# physmem.m4 serial 7
+dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Check for the external symbol, _system_configuration,
+# a struct with member `physmem'.
+AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
+  [AC_CACHE_CHECK(for external symbol _system_configuration,
+                 gl_cv_var__system_configuration,
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM(
+                     [[#include <sys/systemcfg.h>
+                     ]],
+                     [double x = _system_configuration.physmem;
+                      if (x > 0.0) return 0;])],
+      [gl_cv_var__system_configuration=yes],
+      [gl_cv_var__system_configuration=no])])
+
+    if test $gl_cv_var__system_configuration = yes; then
+      AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
+               [Define to 1 if you have the external variable,
+               _system_configuration with a member named physmem.])
+    fi
+  ]
+)
+
+AC_DEFUN([gl_PHYSMEM],
+[
+  AC_LIBOBJ([physmem])
+
+  # Prerequisites of lib/physmem.c.
+  AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \
+    machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
+    sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
+
+  AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
+  AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
+])
diff --git a/config/gnulib/safe-read.m4 b/config/gnulib/safe-read.m4
new file mode 100644 (file)
index 0000000..7a89d0a
--- /dev/null
@@ -0,0 +1,18 @@
+# safe-read.m4 serial 5
+dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SAFE_READ],
+[
+  AC_LIBOBJ([safe-read])
+
+  gl_PREREQ_SAFE_READ
+])
+
+# Prerequisites of lib/safe-read.c.
+AC_DEFUN([gl_PREREQ_SAFE_READ],
+[
+  AC_REQUIRE([gt_TYPE_SSIZE_T])
+])
diff --git a/config/gnulib/safe-write.m4 b/config/gnulib/safe-write.m4
new file mode 100644 (file)
index 0000000..db119ff
--- /dev/null
@@ -0,0 +1,18 @@
+# safe-write.m4 serial 3
+dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SAFE_WRITE],
+[
+  AC_LIBOBJ([safe-write])
+
+  gl_PREREQ_SAFE_WRITE
+])
+
+# Prerequisites of lib/safe-write.c.
+AC_DEFUN([gl_PREREQ_SAFE_WRITE],
+[
+  gl_PREREQ_SAFE_READ
+])
index 432e0375505c098bb865b3a76bed26afba951aac..f21200dceae21545280f5edb354a10694c99f181 100644 (file)
@@ -1,13 +1,29 @@
-# snprintf.m4 serial 2
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# snprintf.m4 serial 4
+dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_SNPRINTF],
 [
-  AC_REPLACE_FUNCS(snprintf)
-  AC_CHECK_DECLS_ONCE(snprintf)
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_CHECK_FUNCS([snprintf])
+  if test $ac_cv_func_snprintf = no; then
+    gl_REPLACE_SNPRINTF
+  fi
+  AC_CHECK_DECLS_ONCE([snprintf])
+  if test $ac_cv_have_decl_snprintf = no; then
+    HAVE_DECL_SNPRINTF=0
+  fi
+])
+
+AC_DEFUN([gl_REPLACE_SNPRINTF],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_LIBOBJ([snprintf])
+  if test $ac_cv_func_snprintf = yes; then
+    REPLACE_SNPRINTF=1
+  fi
   gl_PREREQ_SNPRINTF
 ])
 
index 5e3765a64bf0fc3e2da68259a3fcdb1e137cbaa3..d39a314e178451ebb30f1441dd99cfbe51a92434 100644 (file)
@@ -1,5 +1,5 @@
-# socklen.m4 serial 4
-dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# socklen.m4 serial 5
+dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,14 +12,14 @@ dnl types for the argument to getsockopt, getpeername, etc.  So we
 dnl have to test to find something that will work.
 
 dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
-dnl it there first.  That file is included by gnulib's socket_.h, which
+dnl it there first.  That file is included by gnulib's sys_socket_.h, which
 dnl all users of this module should include.  Cygwin must not include
 dnl ws2tcpip.h.
 AC_DEFUN([gl_TYPE_SOCKLEN_T],
   [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
    AC_CHECK_TYPE([socklen_t], ,
      [AC_MSG_CHECKING([for socklen_t equivalent])
-      AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv],
+      AC_CACHE_VAL([gl_cv_socklen_t_equiv],
        [# Systems have either "struct sockaddr *" or
         # "void *" as the second argument to getpeername
         gl_cv_socklen_t_equiv=
diff --git a/config/gnulib/ssize_t.m4 b/config/gnulib/ssize_t.m4
new file mode 100644 (file)
index 0000000..4eaef93
--- /dev/null
@@ -0,0 +1,21 @@
+# ssize_t.m4 serial 4 (gettext-0.15)
+dnl Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether ssize_t is defined.
+
+AC_DEFUN([gt_TYPE_SSIZE_T],
+[
+  AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
+    [AC_TRY_COMPILE([#include <sys/types.h>],
+       [int x = sizeof (ssize_t *) + sizeof (ssize_t);
+        return !x;],
+       [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
+  if test $gt_cv_ssize_t = no; then
+    AC_DEFINE([ssize_t], [int],
+              [Define as a signed type of the same size as size_t.])
+  fi
+])
diff --git a/config/gnulib/stdint.m4 b/config/gnulib/stdint.m4
new file mode 100644 (file)
index 0000000..03bb093
--- /dev/null
@@ -0,0 +1,395 @@
+# stdint.m4 serial 28
+dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Bruno Haible.
+dnl Test whether <stdint.h> is supported or must be substituted.
+
+AC_DEFUN([gl_STDINT_H],
+[
+  AC_PREREQ(2.59)dnl
+
+  dnl Check for long long int and unsigned long long int.
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  if test $ac_cv_type_long_long_int = yes; then
+    HAVE_LONG_LONG_INT=1
+  else
+    HAVE_LONG_LONG_INT=0
+  fi
+  AC_SUBST([HAVE_LONG_LONG_INT])
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+    HAVE_UNSIGNED_LONG_LONG_INT=1
+  else
+    HAVE_UNSIGNED_LONG_LONG_INT=0
+  fi
+  AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
+
+  dnl Check for <inttypes.h>.
+  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
+  if test $ac_cv_header_inttypes_h = yes; then
+    HAVE_INTTYPES_H=1
+  else
+    HAVE_INTTYPES_H=0
+  fi
+  AC_SUBST([HAVE_INTTYPES_H])
+
+  dnl Check for <sys/types.h>.
+  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
+  if test $ac_cv_header_sys_types_h = yes; then
+    HAVE_SYS_TYPES_H=1
+  else
+    HAVE_SYS_TYPES_H=0
+  fi
+  AC_SUBST([HAVE_SYS_TYPES_H])
+
+  gl_CHECK_NEXT_HEADERS([stdint.h])
+  if test $ac_cv_header_stdint_h = yes; then
+    HAVE_STDINT_H=1
+  else
+    HAVE_STDINT_H=0
+  fi
+  AC_SUBST([HAVE_STDINT_H])
+
+  dnl Now see whether we need a substitute <stdint.h>.
+  if test $ac_cv_header_stdint_h = yes; then
+    AC_CACHE_CHECK([whether stdint.h conforms to C99],
+      [gl_cv_header_working_stdint_h],
+      [gl_cv_header_working_stdint_h=no
+       AC_COMPILE_IFELSE([
+         AC_LANG_PROGRAM([[
+#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+]
+gl_STDINT_INCLUDES
+[
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+#define TYPE_MAXIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+struct s {
+  int check_PTRDIFF:
+      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+      ? 1 : -1;
+  /* Detect bug in FreeBSD 6.0 / ia64.  */
+  int check_SIG_ATOMIC:
+      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+      ? 1 : -1;
+  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+  int check_WCHAR:
+      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+      ? 1 : -1;
+  /* Detect bug in mingw.  */
+  int check_WINT:
+      WINT_MIN == TYPE_MINIMUM (wint_t)
+      && WINT_MAX == TYPE_MAXIMUM (wint_t)
+      ? 1 : -1;
+
+  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
+  int check_UINT8_C:
+        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+  int check_UINT16_C:
+        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
+#ifdef UINT8_MAX
+  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
+         ]])],
+         [gl_cv_header_working_stdint_h=yes])])
+  fi
+  if test "$gl_cv_header_working_stdint_h" = yes; then
+    STDINT_H=
+  else
+    dnl Check for <sys/inttypes.h>, and for
+    dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+    AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
+    if test $ac_cv_header_sys_inttypes_h = yes; then
+      HAVE_SYS_INTTYPES_H=1
+    else
+      HAVE_SYS_INTTYPES_H=0
+    fi
+    AC_SUBST([HAVE_SYS_INTTYPES_H])
+    if test $ac_cv_header_sys_bitypes_h = yes; then
+      HAVE_SYS_BITYPES_H=1
+    else
+      HAVE_SYS_BITYPES_H=0
+    fi
+    AC_SUBST([HAVE_SYS_BITYPES_H])
+
+    dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+    dnl character support).
+    AC_CHECK_HEADERS_ONCE([wchar.h])
+
+    gl_STDINT_TYPE_PROPERTIES
+    STDINT_H=stdint.h
+  fi
+  AC_SUBST(STDINT_H)
+])
+
+dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
+dnl Determine the size of each of the given types in bits.
+AC_DEFUN([gl_STDINT_BITSIZEOF],
+[
+  dnl Use a shell loop, to avoid bloating configure, and
+  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+  dnl   config.h.in,
+  dnl - extra AC_SUBST calls, so that the right substitutions are made.
+  AC_FOREACH([gltype], [$1],
+    [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+       [Define to the number of bits in type ']gltype['.])])
+  for gltype in $1 ; do
+    AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
+      [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
+         [$2
+#include <limits.h>], [result=unknown])
+       eval gl_cv_bitsizeof_${gltype}=\$result
+      ])
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+      dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
+      dnl do a syntax check even on unused #if conditions and give an error
+      dnl on valid C code like this:
+      dnl   #if 0
+      dnl   # if  > 32
+      dnl   # endif
+      dnl   #endif
+      result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
+  AC_FOREACH([gltype], [$1],
+    [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
+dnl Determine the signedness of each of the given types.
+dnl Define HAVE_SIGNED_TYPE if type is signed.
+AC_DEFUN([gl_CHECK_TYPES_SIGNED],
+[
+  dnl Use a shell loop, to avoid bloating configure, and
+  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+  dnl   config.h.in,
+  dnl - extra AC_SUBST calls, so that the right substitutions are made.
+  AC_FOREACH([gltype], [$1],
+    [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+       [Define to 1 if ']gltype[' is a signed integer type.])])
+  for gltype in $1 ; do
+    AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([$2[
+            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
+         result=yes, result=no)
+       eval gl_cv_type_${gltype}_signed=\$result
+      ])
+    eval result=\$gl_cv_type_${gltype}_signed
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    if test "$result" = yes; then
+      AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1)
+      eval HAVE_SIGNED_${GLTYPE}=1
+    else
+      eval HAVE_SIGNED_${GLTYPE}=0
+    fi
+  done
+  AC_FOREACH([gltype], [$1],
+    [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
+dnl Determine the suffix to use for integer constants of the given types.
+dnl Define t_SUFFIX for each such type.
+AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
+[
+  dnl Use a shell loop, to avoid bloating configure, and
+  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+  dnl   config.h.in,
+  dnl - extra AC_SUBST calls, so that the right substitutions are made.
+  AC_FOREACH([gltype], [$1],
+    [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+       [Define to l, ll, u, ul, ull, etc., as suitable for
+        constants of type ']gltype['.])])
+  for gltype in $1 ; do
+    AC_CACHE_CHECK([for $gltype integer literal suffix],
+      [gl_cv_type_${gltype}_suffix],
+      [eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)  gltype1='long int';;
+           ll) gltype1='long long int';;
+           i64)        gltype1='__int64';;
+           u)  gltype1='unsigned int';;
+           ul) gltype1='unsigned long int';;
+           ull)        gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([$2
+              extern $gltype foo;
+              extern $gltype1 foo;])],
+           [eval gl_cv_type_${gltype}_suffix=\$glsuf])
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done])
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
+  done
+  AC_FOREACH([gltype], [$1],
+    [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+])
+
+dnl gl_STDINT_INCLUDES
+AC_DEFUN([gl_STDINT_INCLUDES],
+[[
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
+]])
+
+dnl gl_STDINT_TYPE_PROPERTIES
+dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
+dnl of interest to stdint_.h.
+AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
+[
+  gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+    [gl_STDINT_INCLUDES])
+  gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
+    [gl_STDINT_INCLUDES])
+  gl_cv_type_ptrdiff_t_signed=yes
+  gl_cv_type_size_t_signed=no
+  gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
+    [gl_STDINT_INCLUDES])
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
+
+# Hey Emacs!
+# Local Variables:
+# indent-tabs-mode: nil
+# End:
diff --git a/config/gnulib/stdio_h.m4 b/config/gnulib/stdio_h.m4
new file mode 100644 (file)
index 0000000..b9a6998
--- /dev/null
@@ -0,0 +1,82 @@
+# stdio_h.m4 serial 7
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_STDIO_H],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([stdio.h])
+])
+
+AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_STDIO_H_DEFAULTS],
+[
+  GNULIB_FPRINTF_POSIX=0;  AC_SUBST([GNULIB_FPRINTF_POSIX])
+  GNULIB_PRINTF_POSIX=0;   AC_SUBST([GNULIB_PRINTF_POSIX])
+  GNULIB_SNPRINTF=0;       AC_SUBST([GNULIB_SNPRINTF])
+  GNULIB_SPRINTF_POSIX=0;  AC_SUBST([GNULIB_SPRINTF_POSIX])
+  GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
+  GNULIB_VPRINTF_POSIX=0;  AC_SUBST([GNULIB_VPRINTF_POSIX])
+  GNULIB_VSNPRINTF=0;      AC_SUBST([GNULIB_VSNPRINTF])
+  GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
+  GNULIB_VASPRINTF=0;      AC_SUBST([GNULIB_VASPRINTF])
+  GNULIB_FSEEK=0;          AC_SUBST([GNULIB_FSEEK])
+  GNULIB_FSEEKO=0;         AC_SUBST([GNULIB_FSEEKO])
+  GNULIB_FTELL=0;          AC_SUBST([GNULIB_FTELL])
+  GNULIB_FTELLO=0;         AC_SUBST([GNULIB_FTELLO])
+  GNULIB_FFLUSH=0;         AC_SUBST([GNULIB_FFLUSH])
+  GNULIB_GETDELIM=0;       AC_SUBST([GNULIB_GETDELIM])
+  GNULIB_GETLINE=0;        AC_SUBST([GNULIB_GETLINE])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  REPLACE_FPRINTF=0;       AC_SUBST([REPLACE_FPRINTF])
+  REPLACE_VFPRINTF=0;      AC_SUBST([REPLACE_VFPRINTF])
+  REPLACE_PRINTF=0;        AC_SUBST([REPLACE_PRINTF])
+  REPLACE_VPRINTF=0;       AC_SUBST([REPLACE_VPRINTF])
+  REPLACE_SNPRINTF=0;      AC_SUBST([REPLACE_SNPRINTF])
+  HAVE_DECL_SNPRINTF=1;    AC_SUBST([HAVE_DECL_SNPRINTF])
+  REPLACE_VSNPRINTF=0;     AC_SUBST([REPLACE_VSNPRINTF])
+  HAVE_DECL_VSNPRINTF=1;   AC_SUBST([HAVE_DECL_VSNPRINTF])
+  REPLACE_SPRINTF=0;       AC_SUBST([REPLACE_SPRINTF])
+  REPLACE_VSPRINTF=0;      AC_SUBST([REPLACE_VSPRINTF])
+  HAVE_VASPRINTF=1;        AC_SUBST([HAVE_VASPRINTF])
+  REPLACE_VASPRINTF=0;     AC_SUBST([REPLACE_VASPRINTF])
+  HAVE_FSEEKO=1;           AC_SUBST([HAVE_FSEEKO])
+  REPLACE_FSEEKO=0;        AC_SUBST([REPLACE_FSEEKO])
+  REPLACE_FSEEK=0;         AC_SUBST([REPLACE_FSEEK])
+  HAVE_FTELLO=1;           AC_SUBST([HAVE_FTELLO])
+  REPLACE_FTELLO=0;        AC_SUBST([REPLACE_FTELLO])
+  REPLACE_FTELL=0;         AC_SUBST([REPLACE_FTELL])
+  REPLACE_FFLUSH=0;        AC_SUBST([REPLACE_FFLUSH])
+  HAVE_DECL_GETDELIM=1;    AC_SUBST([HAVE_DECL_GETDELIM])
+  HAVE_DECL_GETLINE=1;     AC_SUBST([HAVE_DECL_GETLINE])
+  REPLACE_GETLINE=0;       AC_SUBST([REPLACE_GETLINE])
+])
+
+dnl Code shared by fseeko and ftello.  Determine if large files are supported,
+dnl but stdin does not start as a large file by default.
+AC_DEFUN([gl_STDIN_LARGE_OFFSET],
+  [
+    AC_CACHE_CHECK([whether stdin defaults to large file offsets],
+      [gl_cv_var_stdin_large_offset],
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
+[#if defined __SL64 && defined __SCLE /* cygwin */
+  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+     fseeko/ftello needlessly fail.  This bug was fixed at the same time
+     that cygwin started exporting asnprintf (cygwin 1.7.0), so we use
+     that as a link-time test for cross-compiles rather than building
+     a runtime test.  */
+  size_t s;
+  if (asnprintf (NULL, &s, ""))
+    return 0;
+#endif])],
+       [gl_cv_var_stdin_large_offset=yes],
+       [gl_cv_var_stdin_large_offset=no])])
+])
diff --git a/config/gnulib/stdlib_h.m4 b/config/gnulib/stdlib_h.m4
new file mode 100644 (file)
index 0000000..ea9286e
--- /dev/null
@@ -0,0 +1,35 @@
+# stdlib_h.m4 serial 3
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_STDLIB_H],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  gl_CHECK_NEXT_HEADERS([stdlib.h])
+])
+
+AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_STDLIB_H_DEFAULTS],
+[
+  GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
+  GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
+  GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
+  GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
+  GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
+  GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_CALLOC_POSIX=1;    AC_SUBST([HAVE_CALLOC_POSIX])
+  HAVE_GETSUBOPT=1;       AC_SUBST([HAVE_GETSUBOPT])
+  HAVE_MALLOC_POSIX=1;    AC_SUBST([HAVE_MALLOC_POSIX])
+  HAVE_MKDTEMP=1;         AC_SUBST([HAVE_MKDTEMP])
+  HAVE_REALLOC_POSIX=1;   AC_SUBST([HAVE_REALLOC_POSIX])
+  REPLACE_MKSTEMP=0;      AC_SUBST([REPLACE_MKSTEMP])
+])
index 84db7a59ba7ebadeae16994583d5d904b2d9bcac..ec51e9a0185d208e1f7391bb02f73ca8f73a91eb 100644 (file)
@@ -18,19 +18,52 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  gl_ABSOLUTE_HEADER([string.h])
-  ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\"
-  AC_SUBST([ABSOLUTE_STRING_H])
+  gl_CHECK_NEXT_HEADERS([string.h])
+])
+
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
 ])
 
 AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
 [
+  GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
+  GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
+  GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
+  GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
+  GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
+  GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
+  GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
+  GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
+  GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
+  GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
+  GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
+  GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
+  GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
+  GNULIB_MBSLEN=0;      AC_SUBST([GNULIB_MBSLEN])
+  GNULIB_MBSNLEN=0;     AC_SUBST([GNULIB_MBSNLEN])
+  GNULIB_MBSCHR=0;      AC_SUBST([GNULIB_MBSCHR])
+  GNULIB_MBSRCHR=0;     AC_SUBST([GNULIB_MBSRCHR])
+  GNULIB_MBSSTR=0;      AC_SUBST([GNULIB_MBSSTR])
+  GNULIB_MBSCASECMP=0;  AC_SUBST([GNULIB_MBSCASECMP])
+  GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
+  GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
+  GNULIB_MBSCASESTR=0;  AC_SUBST([GNULIB_MBSCASESTR])
+  GNULIB_MBSCSPN=0;     AC_SUBST([GNULIB_MBSCSPN])
+  GNULIB_MBSPBRK=0;     AC_SUBST([GNULIB_MBSPBRK])
+  GNULIB_MBSSPN=0;      AC_SUBST([GNULIB_MBSSPN])
+  GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
+  GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
   HAVE_DECL_MEMRCHR=1;         AC_SUBST([HAVE_DECL_MEMRCHR])
   HAVE_STPCPY=1;               AC_SUBST([HAVE_STPCPY])
   HAVE_STPNCPY=1;              AC_SUBST([HAVE_STPNCPY])
+  HAVE_STRCASECMP=1;           AC_SUBST([HAVE_STRCASECMP])
   HAVE_DECL_STRNCASECMP=1;     AC_SUBST([HAVE_DECL_STRNCASECMP])
   HAVE_STRCHRNUL=1;            AC_SUBST([HAVE_STRCHRNUL])
   HAVE_DECL_STRDUP=1;          AC_SUBST([HAVE_DECL_STRDUP])
@@ -39,8 +72,6 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   HAVE_DECL_STRNLEN=1;         AC_SUBST([HAVE_DECL_STRNLEN])
   HAVE_STRPBRK=1;              AC_SUBST([HAVE_STRPBRK])
   HAVE_STRSEP=1;               AC_SUBST([HAVE_STRSEP])
+  HAVE_STRCASESTR=1;           AC_SUBST([HAVE_STRCASESTR])
   HAVE_DECL_STRTOK_R=1;                AC_SUBST([HAVE_DECL_STRTOK_R])
-  REPLACE_STRCASECMP=0;                AC_SUBST([REPLACE_STRCASECMP])
-  REPLACE_STRSTR=0;            AC_SUBST([REPLACE_STRSTR])
-  REPLACE_STRCASESTR=0;                AC_SUBST([REPLACE_STRCASESTR])
 ])
index d3e45b48c1500018186bd193e765d2f07dae625a..d9659c2d75eee465474b20db7b34996fafed0389 100644 (file)
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 2
-dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 4
+dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,16 +8,44 @@ dnl From Simon Josefsson.
 
 AC_DEFUN([gl_HEADER_SYS_SOCKET],
 [
-  AC_CHECK_HEADERS_ONCE([sys/socket.h])
-  if test $ac_cv_header_sys_socket_h = yes; then
+  AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+    [gl_cv_header_sys_socket_h_selfcontained],
+    [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])],
+        [gl_cv_header_sys_socket_h_selfcontained=yes],
+        [gl_cv_header_sys_socket_h_selfcontained=no])
+    ])
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
     SYS_SOCKET_H=''
   else
-    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
-    dnl the check for those headers unconditional; yet cygwin reports
-    dnl that the headers are present but cannot be compiled (since on
-    dnl cygwin, all socket information should come from sys/socket.h).
-    AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
     SYS_SOCKET_H='sys/socket.h'
+
+    gl_CHECK_NEXT_HEADERS([sys/socket.h])
+    if test $ac_cv_header_sys_socket_h = yes; then
+      HAVE_SYS_SOCKET_H=1
+      HAVE_WINSOCK2_H=0
+      HAVE_WS2TCPIP_H=0
+    else
+      HAVE_SYS_SOCKET_H=0
+      dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+      dnl the check for those headers unconditional; yet cygwin reports
+      dnl that the headers are present but cannot be compiled (since on
+      dnl cygwin, all socket information should come from sys/socket.h).
+      AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
+      if test $ac_cv_header_winsock2_h = yes; then
+        HAVE_WINSOCK2_H=1
+      else
+        HAVE_WINSOCK2_H=0
+      fi
+      if test $ac_cv_header_ws2tcpip_h = yes; then
+        HAVE_WS2TCPIP_H=1
+      else
+        HAVE_WS2TCPIP_H=0
+      fi
+    fi
+    AC_SUBST([HAVE_SYS_SOCKET_H])
+    AC_SUBST([HAVE_WINSOCK2_H])
+    AC_SUBST([HAVE_WS2TCPIP_H])
   fi
-  AC_SUBST(SYS_SOCKET_H)
+  AC_SUBST([SYS_SOCKET_H])
 ])
diff --git a/config/gnulib/sys_stat_h.m4 b/config/gnulib/sys_stat_h.m4
new file mode 100644 (file)
index 0000000..1bc08a1
--- /dev/null
@@ -0,0 +1,48 @@
+# sys_stat_h.m4 serial 6   -*- Autoconf -*-
+dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake.
+dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
+
+AC_DEFUN([gl_HEADER_SYS_STAT_H],
+[
+  dnl Check for lstat.  Systems that lack it (mingw) also lack symlinks, so
+  dnl stat is a good replacement.
+  AC_CHECK_FUNCS_ONCE([lstat])
+  if test $ac_cv_func_lstat = yes; then
+    HAVE_LSTAT=1
+  else
+    HAVE_LSTAT=0
+  fi
+  AC_SUBST([HAVE_LSTAT])
+
+  dnl Check for mkdir.  Mingw has _mkdir(name) in the nonstandard <io.h>
+  dnl instead.
+  AC_CHECK_DECLS([mkdir],
+    [],
+    [AC_CHECK_HEADERS([io.h])],
+    [#include <sys/stat.h>])
+  if test $ac_cv_have_decl_mkdir = yes; then
+    HAVE_DECL_MKDIR=1
+  else
+    HAVE_DECL_MKDIR=0
+  fi
+  AC_SUBST([HAVE_DECL_MKDIR])
+  if test "$ac_cv_header_io_h" = yes; then
+    HAVE_IO_H=1
+  else
+    HAVE_IO_H=0
+  fi
+  AC_SUBST([HAVE_IO_H])
+  AC_REQUIRE([AC_C_INLINE])
+
+  dnl Check for broken stat macros.
+  AC_REQUIRE([AC_HEADER_STAT])
+
+  gl_CHECK_NEXT_HEADERS([sys/stat.h])
+  SYS_STAT_H='sys/stat.h'
+  AC_SUBST([SYS_STAT_H])
+]) # gl_HEADER_SYS_STAT_H
diff --git a/config/gnulib/sys_time_h.m4 b/config/gnulib/sys_time_h.m4
new file mode 100644 (file)
index 0000000..13ac576
--- /dev/null
@@ -0,0 +1,57 @@
+# Configure a replacement for <sys/time.h>.
+
+# Copyright (C) 2007 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Martin Lambers.
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H],
+[
+  dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement
+  dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1
+  dnl statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  gl_CHECK_NEXT_HEADERS([sys/time.h])
+
+  if test $ac_cv_header_sys_time_h = yes; then
+    HAVE_SYS_TIME_H=1
+  else
+    HAVE_SYS_TIME_H=0
+  fi
+  AC_SUBST([HAVE_SYS_TIME_H])
+
+  AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+         [[#if HAVE_SYS_TIME_H
+            #include <sys/time.h>
+           #endif
+           #include <time.h>
+         ]],
+         [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
+       [gl_cv_sys_struct_timeval=yes],
+       [gl_cv_sys_struct_timeval=no])])
+  if test $gl_cv_sys_struct_timeval = yes; then
+    HAVE_STRUCT_TIMEVAL=1
+  else
+    HAVE_STRUCT_TIMEVAL=0
+  fi
+  AC_SUBST([HAVE_STRUCT_TIMEVAL])
+
+  dnl Assume POSIX behavior unless another module says otherwise.
+  REPLACE_GETTIMEOFDAY=0
+  AC_SUBST([REPLACE_GETTIMEOFDAY])
+  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
+    SYS_TIME_H=sys/time.h
+  else
+    SYS_TIME_H=
+  fi
+  AC_SUBST([SYS_TIME_H])
+])
diff --git a/config/gnulib/tempname.m4 b/config/gnulib/tempname.m4
new file mode 100644 (file)
index 0000000..4c44d37
--- /dev/null
@@ -0,0 +1,22 @@
+#serial 3
+
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# glibc provides __gen_tempname as a wrapper for mk[ds]temp.  Expose
+# it as a public API, and provide it on systems that are lacking.
+AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
+[
+  AC_REQUIRE([AC_SYS_LARGEFILE])
+
+  AC_LIBOBJ([tempname])
+  gl_PREREQ_TEMPNAME
+])
+
+# Prerequisites of lib/tempname.c.
+AC_DEFUN([gl_PREREQ_TEMPNAME],
+[
+  :
+])
diff --git a/config/gnulib/ulonglong.m4 b/config/gnulib/ulonglong.m4
new file mode 100644 (file)
index 0000000..9fae98e
--- /dev/null
@@ -0,0 +1,48 @@
+# ulonglong.m4 serial 6
+dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
+# This fixes a bug in Autoconf 2.60, but can be removed once we
+# assume 2.61 everywhere.
+
+# Note: If the type 'unsigned long long int' exists but is only 32 bits
+# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
+# will not be defined. In this case you can treat 'unsigned long long int'
+# like 'unsigned long int'.
+
+AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
+[
+  AC_CACHE_CHECK([for unsigned long long int],
+    [ac_cv_type_unsigned_long_long_int],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+         [[unsigned long long int ull = 18446744073709551615ULL;
+           typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
+                          ? 1 : -1)];
+          int i = 63;]],
+         [[unsigned long long int ullmax = 18446744073709551615ull;
+           return (ull << 63 | ull >> 63 | ull << i | ull >> i
+                   | ullmax / ull | ullmax % ull);]])],
+       [ac_cv_type_unsigned_long_long_int=yes],
+       [ac_cv_type_unsigned_long_long_int=no])])
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
+      [Define to 1 if the system has the type `unsigned long long int'.])
+  fi
+])
+
+# This macro is obsolescent and should go away soon.
+AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+  ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int
+  if test $ac_cv_type_unsigned_long_long = yes; then
+    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+      [Define if you have the 'unsigned long long' type.])
+  fi
+])
diff --git a/config/gnulib/unistd_h.m4 b/config/gnulib/unistd_h.m4
new file mode 100644 (file)
index 0000000..b12f84e
--- /dev/null
@@ -0,0 +1,56 @@
+# unistd_h.m4 serial 9
+dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson, Bruno Haible.
+
+AC_DEFUN([gl_UNISTD_H],
+[
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+  gl_CHECK_NEXT_HEADERS([unistd.h])
+
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  if test $ac_cv_header_unistd_h = yes; then
+    HAVE_UNISTD_H=1
+  else
+    HAVE_UNISTD_H=0
+  fi
+  AC_SUBST([HAVE_UNISTD_H])
+])
+
+AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_UNISTD_H_DEFAULTS],
+[
+  GNULIB_CHOWN=0;         AC_SUBST([GNULIB_CHOWN])
+  GNULIB_DUP2=0;          AC_SUBST([GNULIB_DUP2])
+  GNULIB_FCHDIR=0;        AC_SUBST([GNULIB_FCHDIR])
+  GNULIB_FTRUNCATE=0;     AC_SUBST([GNULIB_FTRUNCATE])
+  GNULIB_GETCWD=0;        AC_SUBST([GNULIB_GETCWD])
+  GNULIB_GETLOGIN_R=0;    AC_SUBST([GNULIB_GETLOGIN_R])
+  GNULIB_LCHOWN=0;        AC_SUBST([GNULIB_LCHOWN])
+  GNULIB_LSEEK=0;         AC_SUBST([GNULIB_LSEEK])
+  GNULIB_READLINK=0;      AC_SUBST([GNULIB_READLINK])
+  GNULIB_SLEEP=0;         AC_SUBST([GNULIB_SLEEP])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
+  HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
+  HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
+  HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
+  HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+  REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
+  REPLACE_FCHDIR=0;       AC_SUBST([REPLACE_FCHDIR])
+  REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
+  REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
+])
index 72c9a13e2fb977b3bda0fb4bb8979b3805179e42..ef2de787f02bb1ac466983794d174adfd7d3da61 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 20
+dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,23 +7,33 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_VASNPRINTF],
 [
   AC_REQUIRE([gl_EOVERFLOW])
-  AC_REPLACE_FUNCS(vasnprintf)
+  AC_CHECK_FUNCS_ONCE([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
-    AC_LIBOBJ(printf-args)
-    AC_LIBOBJ(printf-parse)
-    AC_LIBOBJ(asnprintf)
-    gl_PREREQ_PRINTF_ARGS
-    gl_PREREQ_PRINTF_PARSE
-    gl_PREREQ_VASNPRINTF
-    gl_PREREQ_ASNPRINTF
+    gl_REPLACE_VASNPRINTF
   fi
 ])
 
+AC_DEFUN([gl_REPLACE_VASNPRINTF],
+[
+  AC_CHECK_FUNCS_ONCE([vasnprintf])
+  AC_LIBOBJ([vasnprintf])
+  AC_LIBOBJ([printf-args])
+  AC_LIBOBJ([printf-parse])
+  AC_LIBOBJ([asnprintf])
+  if test $ac_cv_func_vasnprintf = yes; then
+    AC_DEFINE([REPLACE_VASNPRINTF], 1,
+      [Define if vasnprintf exists but is overridden by gnulib.])
+  fi
+  gl_PREREQ_PRINTF_ARGS
+  gl_PREREQ_PRINTF_PARSE
+  gl_PREREQ_VASNPRINTF
+  gl_PREREQ_ASNPRINTF
+])
+
 # Prequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
 ])
@@ -32,7 +42,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_REQUIRE([AC_TYPE_SIZE_T])
@@ -45,10 +54,141 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
 [
   AC_REQUIRE([AC_FUNC_ALLOCA])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_CHECK_FUNCS(snprintf wcslen)
+  dnl Use the _snprintf function only if it is declared (because on NetBSD it
+  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+  AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
+[
+  AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
+  case "$gl_cv_func_printf_long_double" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
+        [Define if the vasnprintf implementation needs special code for
+         'long double' arguments.])
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
+[
+  AC_REQUIRE([gl_PRINTF_INFINITE])
+  case "$gl_cv_func_printf_infinite" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1,
+        [Define if the vasnprintf implementation needs special code for
+         infinite 'double' arguments.])
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
+[
+  AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
+  dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
+  dnl NEED_PRINTF_LONG_DOUBLE is already set.
+  AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
+  case "$gl_cv_func_printf_long_double" in
+    *yes)
+      case "$gl_cv_func_printf_infinite_long_double" in
+        *yes)
+          ;;
+        *)
+          AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1,
+            [Define if the vasnprintf implementation needs special code for
+             infinite 'long double' arguments.])
+          ;;
+      esac
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
+[
+  AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
+  case "$gl_cv_func_printf_directive_a" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
+        [Define if the vasnprintf implementation needs special code for
+         the 'a' and 'A' directives.])
+      AC_CHECK_FUNCS([nl_langinfo])
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
+[
+  AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
+  case "$gl_cv_func_printf_directive_f" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
+        [Define if the vasnprintf implementation needs special code for
+         the 'F' directive.])
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
+[
+  AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
+  case "$gl_cv_func_printf_flag_grouping" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1,
+        [Define if the vasnprintf implementation needs special code for the
+         ' flag.])
+      ;;
+  esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
+[
+  AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
+  case "$gl_cv_func_printf_flag_zero" in
+    *yes)
+      ;;
+    *)
+      AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1,
+        [Define if the vasnprintf implementation needs special code for the
+         0 flag.])
+      ;;
+  esac
+])
+
+# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
+[
+  AC_REQUIRE([gl_PREREQ_VASNPRINTF])
+  gl_PREREQ_VASNPRINTF_LONG_DOUBLE
+  gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
+  gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
+  gl_PREREQ_VASNPRINTF_DIRECTIVE_A
+  gl_PREREQ_VASNPRINTF_DIRECTIVE_F
+  gl_PREREQ_VASNPRINTF_FLAG_GROUPING
+  gl_PREREQ_VASNPRINTF_FLAG_ZERO
 ])
 
 # Prerequisites of lib/asnprintf.c.
diff --git a/config/gnulib/wchar.m4 b/config/gnulib/wchar.m4
new file mode 100644 (file)
index 0000000..70b1248
--- /dev/null
@@ -0,0 +1,54 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Eric Blake.
+
+# wchar.m4 serial 4
+
+AC_DEFUN([gl_WCHAR_H],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_CACHE_CHECK([whether <wchar.h> is standalone],
+    [gl_cv_header_wchar_h_standalone],
+    [AC_COMPILE_IFELSE([[#include <wchar.h>
+wchar_t w;]],
+      [gl_cv_header_wchar_h_standalone=yes],
+      [gl_cv_header_wchar_h_standalone=no])])
+  if test $gl_cv_header_wchar_h_standalone != yes; then
+    WCHAR_H=wchar.h
+  fi
+
+  dnl Prepare for creating substitute <wchar.h>.
+  dnl Do it always: WCHAR_H may be empty here but can be set later.
+  dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+  dnl character support).
+  AC_CHECK_HEADERS_ONCE([wchar.h])
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+  AC_SUBST([HAVE_WCHAR_H])
+  gl_CHECK_NEXT_HEADERS([wchar.h])
+])
+
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+  GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
+  REPLACE_WCWIDTH=0;   AC_SUBST([REPLACE_WCWIDTH])
+  WCHAR_H=
+  AC_SUBST([WCHAR_H])
+])
index 3706c047ddbf4e9d92bb529aa2f7dda748537a32..2cac1a710827d984fc9a31dd681a523f6ac5e4c6 100644 (file)
@@ -1,4 +1,4 @@
-# wint_t.m4 serial 2 (gettext-0.12)
+# wint_t.m4 serial 2 (gettext-0.16.2)
 dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 1a8353401c4223bf93e7d7dd76164de5400be672..4fbbae7b7ff932e5af542dbe9612f193a68ed4d1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2005-02-02.21
+scriptversion=2006-10-14.15
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,15 +39,24 @@ scriptversion=2005-02-02.21
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""       $nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
 doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
 
 mvprog="${MVPROG-mv}"
 cpprog="${CPPROG-cp}"
@@ -58,7 +67,13 @@ stripprog="${STRIPPROG-strip}"
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
-chmodcmd="$chmodprog 0755"
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
 chowncmd=
 chgrpcmd=
 stripcmd=
@@ -95,7 +110,7 @@ Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
     -c) shift
         continue;;
@@ -111,9 +126,15 @@ while test -n "$1"; do
 
     --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
+    -m) mode=$2
         shift
         shift
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
         continue;;
 
     -o) chowncmd="$chownprog $2"
@@ -136,25 +157,33 @@ while test -n "$1"; do
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    *)  # When -d is used, all remaining arguments are directories to create.
-       # When -t is used, the destination is already specified.
-       test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-       for arg
-       do
-          if test -n "$dstarg"; then
-           # $@ is not empty: it contains at least $arg.
-           set fnord "$@" "$dstarg"
-           shift # fnord
-         fi
-         shift # arg
-         dstarg=$arg
-       done
+    --)        shift
        break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
   esac
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dstarg"
+      shift # fnord
+    fi
+    shift # arg
+    dstarg=$arg
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
@@ -164,6 +193,33 @@ if test -z "$1"; then
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 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 starting with `-'.
@@ -173,15 +229,11 @@ do
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    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 '*'.
@@ -208,53 +260,188 @@ do
        echo "$0: $dstarg: Is a directory" >&2
        exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-
-  # Make sure that the destination directory exists.
-
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-        '
-    IFS="${IFS-$defaultIFS}"
-
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    shift
-    IFS=$oIFS
+  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-writeable 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
 
-    pathcomp=
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      # 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
+
+      case $posix_glob in
+        '')
+         if (set -f) 2>/dev/null; then
+           posix_glob=true
+         else
+           posix_glob=false
+         fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-       # mkdir can fail with a `File exist' error in case several
-       # install-sh are creating the directory concurrently.  This
-       # is OK.
-       test -d "$pathcomp" || exit
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && 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
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { 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
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -262,10 +449,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -276,10 +462,10 @@ do
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
 
     # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+    { $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
@@ -291,11 +477,12 @@ do
           # reasons.  In this case, the final cleanup might fail but the new
           # file should still install successfully.
           {
-            if test -f "$dstdir/$dstfile"; then
-              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+            if test -f "$dst"; then
+              $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 $dstdir/$dstfile" >&2
+                echo "$0: cannot unlink or rename $dst" >&2
                 (exit 1); exit 1
               }
             else
@@ -304,16 +491,13 @@ do
           } &&
 
           # Now rename the file to the real destination.
-          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+          $doit $mvcmd "$dsttmp" "$dst"
         }
-    }
-  fi || { (exit 1); exit 1; }
-done
+    } || exit 1
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit 0
-}
+    trap '' 0
+  fi
+done
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/config/libtool.m4 b/config/libtool.m4
new file mode 100644 (file)
index 0000000..285a567
--- /dev/null
@@ -0,0 +1,6214 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.
+
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+                [m4_ifdef([AC_PROVIDE_$1],
+                          [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+       [AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+            [define([LT_AC_PROG_GCJ],
+               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+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
+
+# 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 to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/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.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# 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.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+        [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# 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
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+        test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+        test "X$echo_testing_string" = "X$echo_test_string"; then
+       # Cool, printf works
+       :
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+       export CONFIG_SHELL
+       SHELL="$CONFIG_SHELL"
+       export SHELL
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+       # maybe with a smaller string...
+       prev=:
+
+       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+         then
+           break
+         fi
+         prev="$cmd"
+       done
+
+       if test "$prev" != 'sed 50q "[$]0"'; then
+         echo_test_string=`eval $prev`
+         export echo_test_string
+         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+       else
+         # Oops.  We lost completely, so just stick with echo.
+         echo=echo
+       fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_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 __oline__ "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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          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_TRY_LINK([],[],[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
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$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 "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# 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*)
+    # 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;
+    ;;
+
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  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
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
+[#line __oline__ "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}]
+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_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_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*)
+    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="-dld"],
+       [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="-dld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  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"
+    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_AC_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
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_AC_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
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_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 ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_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
+    AMANDA_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_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
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[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"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+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"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # 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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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
+  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'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  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*)
+  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=`$echo "X$lib" | $Xsed -e '\''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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        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
+      ;;
+    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
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # 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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-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='GNU ld.so'
+  ;;
+
+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[[123]]*) 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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+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
+  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'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       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 Linux ELF.
+linux*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;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'
+  ;;
+
+knetbsd*-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='GNU ld.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
+  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=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=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+solaris*)
+  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=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.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+    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
+  ;;
+
+uts4*)
+  version_type=linux
+  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
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AMANDA_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AMANDA_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AMANDA_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+       ;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         AC_LIBTOOL_LANG_CXX_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+         AC_LIBTOOL_LANG_F77_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+         AC_LIBTOOL_LANG_GCJ_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
+
+      RC)
+       AC_LIBTOOL_LANG_RC_CONFIG
+       ;;
+
+      *)
+       AC_MSG_ERROR([Unsupported tag name: $tagname])
+       ;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
+
+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
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_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
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_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])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])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])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+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
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[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
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise 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
+aix4* | aix5*)
+  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'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | 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
+  ;;
+
+gnu*)
+  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]) 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
+  ;;
+
+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 Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  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=unknown
+  ;;
+
+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
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+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
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AMANDA_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+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
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AMANDA_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
+  else
+    AMANDA_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+  fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## 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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil 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
+  ;;
+
+aix4* | aix5*)
+  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])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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_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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    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]].*|aix5*)
+       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_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    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
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+       else
+         # We have old collect2
+         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_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
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+       # -bexpall does not export symbols beginning with underscore (_)
+       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+       # Exported symbols can be pulled into shared objects from archives
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+       # This is similar to how AIX traditionally builds its shared libraries.
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_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'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      ghcx*)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      aCC*)
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+         ;;
+       *)
+         _LT_AC_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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case $host_cpu in
+           ia64*|hppa*64*)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+             ;;
+           *)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+       # SGI C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+         else
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+       ;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    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_AC_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_AC_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; echo $list'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+       _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc*)
+       # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC*)
+        # Portland Group C++ compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       _LT_AC_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'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+       # Compaq C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_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=`echo $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; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_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_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       _LT_AC_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=`echo $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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+         _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_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 "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_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=`echo $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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_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 "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      lcc*)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       case $host_os in
+         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+       output_verbose_link_cmd='echo'
+
+       # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx*)
+       # Green Hills C++ Compiler
+       _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+              _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -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 \"\-L\""
+              _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           else
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC ${wl}-G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+              _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC ${wl}-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 ${wl}-G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+              _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-Bstatic'
+           fi
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_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 \"\-L\""
+         fi
+
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_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...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([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.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+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...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $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
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p 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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
+          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$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_AC_TAGVAR(predep_objects, $1)"; then
+          _LT_AC_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+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
+  ;;
+aix4* | aix5*)
+  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])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_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"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_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...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# 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_AC_SYS_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"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then 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
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# 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.
+
+# 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//"
+
+# 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
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# 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
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# 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
+
+# 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
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# 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
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# 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
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# 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
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# 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
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\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
+EOF
+    ;;
+  esac
+
+  # 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)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# 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]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDRT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, 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.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_AC_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_save_LIBS"
+         CFLAGS="$lt_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 -f 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
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_AC_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
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           if test "$host_cpu" != ia64; then
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC*)
+           # Portland Group C++ compiler.
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      sco*)
+       case $cc_basename in
+         CC*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           if $CC -v --help 2>/dev/null | grep -- -static  > /dev/null 2> /dev/null; then
+             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           else
+             # GCC with Sun linker
+             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-Bstatic'
+            fi
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      unixware*)
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_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'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_AC_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]].*|aix5*)
+         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_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      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
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         else
+         # We have old collect2
+         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_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
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        _LT_AC_SYS_LIBPATH_AIX
+        _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+         # Exported symbols can be pulled into shared objects from archives
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       *)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+          ;;
+        *)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_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~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "x$archive_cmds" = "x"; then
+        if test "$GCC" = yes; then
+         wlarc='${wl}'
+         if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+         else
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+          fi
+        else
+         wlarc=''
+          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_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'
+          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+       fi
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+       *)
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_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'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# 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.                               #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_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
+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_MSG_RESULT([$SED])
+])
diff --git a/config/libtool.m4i b/config/libtool.m4i
deleted file mode 100644 (file)
index 771b86f..0000000
+++ /dev/null
@@ -1,6184 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.
-
-# serial 47 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-                [m4_ifdef([AC_PROVIDE_$1],
-                          [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-       [AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-            [define([LT_AC_PROG_GCJ],
-               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-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
-
-# 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 to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-       [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/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.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# 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.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-        [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-[$]*
-EOF
-  exit 0
-fi
-
-# 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
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
-
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
-
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
-       fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-    [AC_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 __oline__ "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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          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-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          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_TRY_LINK([],[],[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
-  ;;
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-  ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
-else
-    ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   printf "$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 "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
-       $SED '/^$/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
-else
-    ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# 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*)
-    # 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;
-    ;;
-
-  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`
-    ;;
-  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
-    ;;
-  *)
-    # 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.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-              = "XX$teststring") >/dev/null 2>&1 &&
-           new_result=`expr "X$teststring" : ".*" 2>&1` &&
-           lt_cv_sys_max_cmd_len=$new_result &&
-           test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    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`
-    ;;
-  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
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
-[#line __oline__ "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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=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;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}]
-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_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_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*)
-    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="-dld"],
-       [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="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
-  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"
-    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_AC_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
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_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
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_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 ..
-   rmdir conftest
-   $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_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
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_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
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[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"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
-  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'
-  ;;
-
-aix4* | aix5*)
-  version_type=linux
-  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*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  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*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # 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}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  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
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-kfreebsd*-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='GNU ld.so'
-  ;;
-
-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[[123]]*) 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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-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
-  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'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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 Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;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'
-  ;;
-
-knetbsd*-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='GNU ld.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
-  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=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=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  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"
-  ;;
-
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
-
-solaris*)
-  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=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.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      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
-    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
-  ;;
-
-uts4*)
-  version_type=linux
-  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
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-    fi
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-       ;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-           (test "X$CXX" != "Xg++"))) ; then
-         AC_LIBTOOL_LANG_CXX_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      F77)
-       if test -n "$F77" && test "X$F77" != "Xno"; then
-         AC_LIBTOOL_LANG_F77_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      GCJ)
-       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-         AC_LIBTOOL_LANG_GCJ_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
-
-      RC)
-       AC_LIBTOOL_LANG_RC_CONFIG
-       ;;
-
-      *)
-       AC_MSG_ERROR([Unsupported tag name: $tagname])
-       ;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-       [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-#- set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-       [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
-
-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
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_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
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_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])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])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])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-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
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[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
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise 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
-aix4* | aix5*)
-  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'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | kfreebsd*-gnu | 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
-  ;;
-
-gnu*)
-  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]) 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
-  ;;
-
-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 Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  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=unknown
-  ;;
-
-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
-  ;;
-
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  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
-    ;;
-  esac
-  ;;
-
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-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
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}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"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ---------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-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
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# --------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[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_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
-    ;;
-  esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
-  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
-  else
-    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
-    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
-  fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
-
-## 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...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-# Report which librarie types wil 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
-  ;;
-
-aix4* | aix5*)
-  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])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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_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
-  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
-  unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-  AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  aix4* | aix5*)
-    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]].*|aix5*)
-       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_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    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
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-       else
-         # We have old collect2
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_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
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-       # -bexpall does not export symbols beginning with underscore (_)
-       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-       # Exported symbols can be pulled into shared objects from archives
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-       # This is similar to how AIX traditionally builds its shared libraries.
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-  chorus*)
-    case $cc_basename in
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          _LT_AC_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'
-        fi
-        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      ghcx*)
-       # Green Hills C++ Compiler
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_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) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      case $host_cpu in
-      hppa*64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-        ;;
-      ia64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        ;;
-      *)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                             # but as the default
-                                             # location of the library.
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      aCC*)
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-         ;;
-       *)
-         _LT_AC_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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test $with_gnu_ld = no; then
-           case $host_cpu in
-           ia64*|hppa*64*)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-             ;;
-           *)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-       # SGI C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-         else
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-         fi
-       fi
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-       ;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux*)
-    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_AC_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_AC_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; echo $list'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-       _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-       ;;
-      icpc*)
-       # 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_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_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_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-       ;;
-      pgCC*)
-        # Portland Group C++ compiler
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-       _LT_AC_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'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-       # Compaq C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_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::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    _LT_AC_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_AC_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_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-         _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_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 "\-L"'
-
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-       # Archives containing C++ object files must be created using
-       # the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_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 "\-L"'
-
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sco*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case $cc_basename in
-      CC*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.x
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      lcc*)
-       # Lucid
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-       _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       case $host_os in
-         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-         *)
-           # The C++ compiler is used as linker so we must use $wl
-           # flag to pass the commands to the underlying system
-           # linker. We must also pass each convience library through
-           # to the system linker between allextract/defaultextract.
-           # The C++ compiler will combine linker options so we
-           # cannot just pass the convience library names through
-           # without $wl.
-           # Supported since Solaris 2.6 (maybe 2.5.1?)
-           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-           ;;
-       esac
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-       output_verbose_link_cmd='echo'
-
-       # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-       ;;
-      gcx*)
-       # Green Hills C++ Compiler
-       _LT_AC_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_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-         if $CC --version | grep -v '^2\.7' > /dev/null; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $CC -shared -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 \"\-L\""
-         else
-           # g++ 2.7 appears to require `-G' NOT `-shared' on this
-           # platform.
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_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 \"\-L\""
-         fi
-
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-       fi
-       ;;
-    esac
-    ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-       # NonStop-UX NCC 3.20
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_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...
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-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
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([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.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-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...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-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
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $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
-       else
-        prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-        case $p 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_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-          else
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
-          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-        else
-          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-        fi
-       fi
-       ;;
-
-    *.$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_AC_TAGVAR(predep_objects, $1)"; then
-          _LT_AC_TAGVAR(predep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-        fi
-       else
-        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_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
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-solaris*)
-  case $cc_basename in
-  CC*)
-    # 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.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
-    ;;
-  esac
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-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
-  ;;
-aix4* | aix5*)
-  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])
-
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_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"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_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...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# 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_AC_SYS_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"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then 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
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
-
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
-
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
-
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# 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.
-
-# 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//"
-
-# 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
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
-  case $host_os in
-  aix3*)
-    cat <<\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
-EOF
-    ;;
-  esac
-
-  # 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)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-])
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# 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]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDGIRSTW]]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris* | sysv5*)
-  symcode='[[BDRT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# 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
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, 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.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[     ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-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 <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_save_LIBS="$LIBS"
-         lt_save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$_LT_AC_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_save_LIBS"
-         CFLAGS="$lt_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 -f 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
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | os2* | pw32*)
-      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # 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*)
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix4* | aix5*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       else
-         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_AC_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
-       ;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           if test "$host_cpu" != ia64; then
-             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-           fi
-           ;;
-         aCC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux*)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         icpc* | ecpc*)
-           # Intel C++
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-           ;;
-         pgCC*)
-           # Portland Group C++ compiler.
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      sco*)
-       case $cc_basename in
-         CC*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      unixware*)
-       ;;
-      vxworks*)
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-       ;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_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_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | pw32* | os2*)
-      # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    sco3.2v5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # 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
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-],[
-  runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
-  # 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.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # 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
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = 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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [[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
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_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'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       _LT_AC_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}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       case $cc_basename,$host_cpu in
-       pgcc*)                          # Portland Group C compiler
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
-       esac
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-       if test $supports_anon_versioning = yes; then
-         _LT_AC_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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-       fi
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<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.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix4* | aix5*)
-      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
-       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-       else
-         _LT_AC_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]].*|aix5*)
-         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_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-      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
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         else
-         # We have old collect2
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_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
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-       if test "$host_cpu" = ia64; then
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        _LT_AC_SYS_LIBPATH_AIX
-        _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         # -bexpall does not export symbols beginning with underscore (_)
-         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-         # Exported symbols can be pulled into shared objects from archives
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # 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.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-         ;;
-       ia64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       *)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    openbsd*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      else
-       case $host_os in
-        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-          ;;
-        *)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-          ;;
-       esac
-      fi
-      ;;
-
-    os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_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~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    sco3.2v5*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       wlarc=''
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_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'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-       # The compiler driver will combine linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
-       *)
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-       sni)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-        ;;
-       motorola)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4.2uw2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
-
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv5*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_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'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
-      printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-        then
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-############################################################
-# 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.                               #
-############################################################
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_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
-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_MSG_RESULT([$SED])
-])
diff --git a/config/link-warning.h b/config/link-warning.h
new file mode 100644 (file)
index 0000000..fda0194
--- /dev/null
@@ -0,0 +1,28 @@
+/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
+   a linker warning on most glibc systems.
+   We use a linker warning rather than a preprocessor warning, because
+   #warning cannot be used inside macros.  */
+#ifndef GL_LINK_WARNING
+  /* This works on platforms with GNU ld and ELF object format.
+     Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
+     Testing __ELF__ guarantees the ELF object format.
+     Testing __GNUC__ is necessary for the compound expression syntax.  */
+# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
+#  define GL_LINK_WARNING(message) \
+     GL_LINK_WARNING1 (__FILE__, __LINE__, message)
+#  define GL_LINK_WARNING1(file, line, message) \
+     GL_LINK_WARNING2 (file, line, message)  /* macroexpand file and line */
+#  define GL_LINK_WARNING2(file, line, message) \
+     GL_LINK_WARNING3 (file ":" #line ": warning: " message)
+#  define GL_LINK_WARNING3(message) \
+     ({ static const char warning[sizeof (message)]            \
+          __attribute__ ((__unused__,                          \
+                          __section__ (".gnu.warning"),                \
+                          __aligned__ (1)))                    \
+          = message "\n";                                      \
+        (void)0;                                               \
+     })
+# else
+#  define GL_LINK_WARNING(message) ((void) 0)
+# endif
+#endif
index 9e71d27d86d48ea79d31f3be040ec3933bd76623..d74b5a67afb39d1e0ff7fcfeb85b119125ece0f3 100644 (file)
@@ -1,8 +1,8 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007  Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
 # This program is free software; you can redistribute it and/or modify
@@ -43,14 +43,22 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.20
-TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
-
-# 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
+VERSION=1.5.24
+TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_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
 
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
@@ -105,12 +113,14 @@ esac
 # These must not be set unconditionally because not all systems understand
 # e.g. LANG=C (notably SCO).
 # We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
-  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
-  save_LANG="$LANG"; LANG=C; export LANG
-fi
+for lt_var in LANG 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
+       fi"
+done
 
 # Make sure IFS has a sensible default
 lt_nl='
@@ -132,13 +142,54 @@ run=
 show="$echo"
 show_help=
 execute_dlfiles=
+duplicate_deps=no
+preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
 
 #####################################
 # Shell function definitions:
 # This seems to be the best place for them
 
+# 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 "$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" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+       exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -157,12 +208,17 @@ func_win32_libid ()
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-       sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
-      if test "X$win32_nmres" = "Ximport" ; then
-        win32_libid_type="x86 archive import"
-      else
-        win32_libid_type="x86 archive static"
-      fi
+       $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*)
@@ -219,7 +275,21 @@ func_infer_tag ()
            esac
            CC_quoted="$CC_quoted $arg"
          done
+           # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
+           trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
+           # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
+           extendcc=${host}-${CC}
+           # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc  
+           # (Gentoo-specific hack because we always export $CHOST)
+           mungedcc=${CHOST-${host}}-${trimedcc}
            case "$@ " in
+             "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
+             "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
+             tagname=CC
+             break ;;
+             "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
+             "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
+             "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
              " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
              # The compiler in the base compile command matches
              # the one in the tagged configuration.
@@ -289,15 +359,25 @@ func_extract_archives ()
        *) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xdir="$my_gentop/$my_xlib"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         extracted_serial=`expr $extracted_serial + 1`
+         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"
 
       $show "${rm}r $my_xdir"
       $run ${rm}r "$my_xdir"
       $show "$mkdir $my_xdir"
       $run $mkdir "$my_xdir"
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
-       exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+       exit $exit_status
       fi
       case $host in
       *-darwin*)
@@ -352,6 +432,8 @@ func_extract_archives ()
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -414,11 +496,12 @@ do
     ;;
 
   --version)
-    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
-    $echo
-    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
-    $echo "This is free software; see the source for copying conditions.  There is NO"
-    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2007  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."
     exit $?
     ;;
 
@@ -468,7 +551,11 @@ do
     preserve_args="$preserve_args $arg"
     ;;
 
-  --tag) prevopt="--tag" prev=tag ;;
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
   --tag=*)
     set tag "$optarg" ${1+"$@"}
     shift
@@ -500,6 +587,18 @@ if test -n "$prevopt"; then
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # 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.
@@ -699,9 +798,10 @@ if test -z "$show_help"; then
     *.class) xform=class ;;
     *.cpp) xform=cpp ;;
     *.cxx) xform=cxx ;;
-    *.f90) xform=f90 ;;
+    *.[fF][09]?) xform=[fF][09]. ;;
     *.for) xform=for ;;
     *.java) xform=java ;;
+    *.obj) xform=obj ;;
     esac
 
     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -795,7 +895,7 @@ if test -z "$show_help"; then
     # 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 $run ln "$progpath" "$lockfile" 2>/dev/null; do
+      until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
        $show "Waiting for $lockfile to be removed"
        sleep 2
       done
@@ -856,9 +956,9 @@ EOF
       if test ! -d "${xdir}$objdir"; then
        $show "$mkdir ${xdir}$objdir"
        $run $mkdir ${xdir}$objdir
-       status=$?
-       if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
-         exit $status
+       exit_status=$?
+       if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+         exit $exit_status
        fi
       fi
 
@@ -1061,6 +1161,7 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -1081,22 +1182,32 @@ EOF
     for arg
     do
       case $arg in
-      -all-static | -static)
-       if test "X$arg" = "X-all-static"; then
+      -all-static | -static | -static-libtool-libs)
+       case $arg in
+       -all-static)
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
          fi
          if test -n "$link_static_flag"; then
            dlopen_self=$dlopen_self_static
          fi
-       else
+         prefer_static_libs=yes
+         ;;
+       -static)
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
            dlopen_self=$dlopen_self_static
          fi
-       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
-       prefer_static_libs=yes
        break
        ;;
       esac
@@ -1271,6 +1382,11 @@ EOF
                  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"
+                 non_pic_objects="$non_pic_objects $non_pic_object"
                fi
              else
                # Only an error if not doing a dry-run.
@@ -1354,8 +1470,8 @@ EOF
          prev=
          continue
          ;;
-        darwin_framework)
-         compiler_flags="$compiler_flags $arg"
+       darwin_framework|darwin_framework_skip)
+         test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
          compile_command="$compile_command $arg"
          finalize_command="$finalize_command $arg"
          prev=
@@ -1419,13 +1535,17 @@ EOF
        continue
        ;;
 
-      -framework|-arch)
-        prev=darwin_framework
-        compiler_flags="$compiler_flags $arg"
+      -framework|-arch|-isysroot)
+       case " $CC " in
+         *" ${arg} ${1} "* | *" ${arg} ${1} "*) 
+               prev=darwin_framework_skip ;;
+         *) compiler_flags="$compiler_flags $arg"
+            prev=darwin_framework ;;
+       esac
        compile_command="$compile_command $arg"
        finalize_command="$finalize_command $arg"
-        continue
-        ;;
+       continue
+       ;;
 
       -inst-prefix-dir)
        prev=inst_prefix
@@ -1453,7 +1573,8 @@ EOF
          absdir=`cd "$dir" && pwd`
          if test -z "$absdir"; then
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-           exit $EXIT_FAILURE
+           absdir="$dir"
+           notinst_path="$notinst_path $dir"
          fi
          dir="$absdir"
          ;;
@@ -1467,10 +1588,15 @@ EOF
        esac
        case $host in
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+         testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
          case :$dllsearchpath: in
          *":$dir:"*) ;;
          *) dllsearchpath="$dllsearchpath:$dir";;
          esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
          ;;
        esac
        continue
@@ -1479,11 +1605,11 @@ EOF
       -l*)
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
          case $host in
-         *-*-cygwin* | *-*-pw32* | *-*-beos*)
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
            # These systems don't actually have a C or math library (as such)
            continue
            ;;
-         *-*-mingw* | *-*-os2*)
+         *-*-os2*)
            # These systems don't actually have a C library (as such)
            test "X$arg" = "X-lc" && continue
            ;;
@@ -1495,6 +1621,15 @@ EOF
            # Rhapsody C and math libraries are in the System framework
            deplibs="$deplibs -framework System"
            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
@@ -1518,7 +1653,7 @@ EOF
        continue
        ;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
        compiler_flags="$compiler_flags $arg"
        compile_command="$compile_command $arg"
        finalize_command="$finalize_command $arg"
@@ -1536,7 +1671,13 @@ EOF
       # +DA*, +DD* enable 64-bit mode on the HP compiler
       # -q* pass through compiler args for the IBM compiler
       # -m* pass through architecture-specific compiler args for GCC
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
        # Unknown arguments in both finalize_command and compile_command need
        # to be aesthetically quoted because they are evaled later.
@@ -1548,9 +1689,7 @@ EOF
        esac
         compile_command="$compile_command $arg"
         finalize_command="$finalize_command $arg"
-        if test "$with_gcc" = "yes" ; then
-          compiler_flags="$compiler_flags $arg"
-        fi
+        compiler_flags="$compiler_flags $arg"
         continue
         ;;
 
@@ -1566,9 +1705,9 @@ EOF
 
       -no-install)
        case $host in
-       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
          # The PATH hackery in wrapper scripts is required on Windows
-         # in order for the loader to find any dlls it needs.
+         # and Darwin in order for the loader to find any dlls it needs.
          $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
          $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
          fast_install=no
@@ -1627,7 +1766,7 @@ EOF
        continue
        ;;
 
-      -static)
+      -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
@@ -1788,6 +1927,11 @@ EOF
            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"
+           non_pic_objects="$non_pic_objects $non_pic_object"
          fi
        else
          # Only an error if not doing a dry-run.
@@ -1893,9 +2037,9 @@ EOF
     if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
-       exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+       exit $exit_status
       fi
     fi
 
@@ -1958,7 +2102,6 @@ EOF
     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 link"
@@ -2005,7 +2148,7 @@ EOF
        lib=
        found=no
        case $deplib in
-       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
          if test "$linkmode,$pass" = "prog,link"; then
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
@@ -2194,7 +2337,7 @@ EOF
        esac # case $deplib
        if test "$found" = yes || test -f "$lib"; then :
        else
-         $echo "$modename: cannot find the library \`$lib'" 1>&2
+         $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
          exit $EXIT_FAILURE
        fi
 
@@ -2401,7 +2544,9 @@ EOF
 
        if test "$linkmode,$pass" = "prog,link"; then
          if test -n "$library_names" &&
-            { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+            { { 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.
@@ -2445,8 +2590,12 @@ EOF
        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 "$prefer_static_libs" = no || test -z "$old_library"; }; then
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
          if test "$installed" = no; then
            notinst_deplibs="$notinst_deplibs $lib"
            need_relink=yes
@@ -2559,11 +2708,15 @@ EOF
              if test "$hardcode_direct" = no; then
                add="$dir/$linklib"
                case $host in
-                 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+                 *-*-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 module then we can not link against
                    # it, someone is ignoring the new warnings I added
-                   if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+                   if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
                      $echo "** Warning, lib $linklib is a module, not a shared library"
                      if test -z "$old_library" ; then
                        $echo
@@ -3089,7 +3242,7 @@ EOF
          # which has an extra 1 added just for fun
          #
          case $version_type in
-         darwin|linux|osf|windows)
+         darwin|linux|osf|windows|none)
            current=`expr $number_major + $number_minor`
            age="$number_minor"
            revision="$number_revision"
@@ -3100,9 +3253,10 @@ EOF
            age="0"
            ;;
          irix|nonstopux)
-           current=`expr $number_major + $number_minor - 1`
+           current=`expr $number_major + $number_minor`
            age="$number_minor"
            revision="$number_minor"
+           lt_irix_increment=no
            ;;
          esac
          ;;
@@ -3161,7 +3315,8 @@ EOF
          versuffix="$major.$age.$revision"
          # Darwin ld doesn't like 0 for these options...
          minor_current=`expr $current + 1`
-         verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+         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)
@@ -3175,8 +3330,11 @@ EOF
          ;;
 
        irix | nonstopux)
-         major=`expr $current - $age + 1`
-
+         if test "X$lt_irix_increment" = "Xno"; then
+           major=`expr $current - $age`
+         else
+           major=`expr $current - $age + 1`
+         fi
          case $version_type in
            nonstopux) verstring_prefix=nonstopux ;;
            *)         verstring_prefix=sgi ;;
@@ -3313,11 +3471,11 @@ EOF
       fi
 
       # Eliminate all temporary directories.
-      for path in $notinst_path; do
-       lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
-       deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
-       dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
-      done
+      #for path in $notinst_path; do
+      #        lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+      #        deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+      #        dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+      #done
 
       if test -n "$xrpath"; then
        # If the user specified any rpath flags, then add them.
@@ -3369,7 +3527,12 @@ EOF
            ;;
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
-           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-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.
@@ -3413,13 +3576,12 @@ EOF
          int main() { return 0; }
 EOF
          $rm conftest
-         $LTCC -o conftest conftest.c $deplibs
-         if test "$?" -eq 0 ; then
+         if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
              name=`expr $i : '-l\(.*\)'`
              # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" -ne "0"; then
+              if test "$name" != "" && test "$name" != "0"; then
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                  case " $predeps $postdeps " in
                  *" $i "*)
@@ -3458,9 +3620,7 @@ EOF
              # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
                $rm conftest
-               $LTCC -o conftest conftest.c $i
-               # Did it work?
-               if test "$?" -eq 0 ; then
+               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
@@ -3492,7 +3652,7 @@ EOF
                  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 "*** 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
@@ -3705,6 +3865,35 @@ EOF
        deplibs=$newdeplibs
       fi
 
+
+      # 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 "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      deplibs="$new_libs"
+
+
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3749,7 +3938,10 @@ EOF
             test -n "$hardcode_libdirs"; then
            libdir="$hardcode_libdirs"
            if test -n "$hardcode_libdir_flag_spec_ld"; then
-             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+             case $archive_cmds in
+             *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+             *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+             esac
            else
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
            fi
@@ -3788,6 +3980,7 @@ EOF
        fi
 
        lib="$output_objdir/$realname"
+       linknames=
        for link
        do
          linknames="$linknames $link"
@@ -4107,12 +4300,14 @@ EOF
       reload_conv_objs=
       gentop=
       # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec
+      # -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 reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+         reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
        else
          gentop="$output_objdir/${obj}x"
          generated="$generated $gentop"
@@ -4219,6 +4414,35 @@ EOF
         ;;
       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 "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $compile_deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      compile_deplibs="$new_libs"
+
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -4263,10 +4487,15 @@ EOF
        fi
        case $host in
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+         testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
          case :$dllsearchpath: in
          *":$libdir:"*) ;;
          *) dllsearchpath="$dllsearchpath:$libdir";;
          esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
          ;;
        esac
       done
@@ -4383,10 +4612,22 @@ extern \"C\" {
              export_symbols="$output_objdir/$outputname.exp"
              $run $rm $export_symbols
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+               $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+               $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
            else
-             $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
              $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+               $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+               $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
            fi
          fi
 
@@ -4503,16 +4744,29 @@ static const void *lt_preloaded_setup() {
          esac
 
          # Now compile the dynamic symbol file.
-         $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-         $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+         $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+         $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
          # Clean up the generated files.
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
 
          # Transform the symbol file into the correct name.
-         compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-         finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            else
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            ;;
+          esac
          ;;
        *)
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
@@ -4525,19 +4779,19 @@ static const void *lt_preloaded_setup() {
        # really was required.
 
        # Nullify the symbol file.
-       compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-       finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+       finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
       fi
 
       if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
        # Replace the output file specification.
-       compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+       compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
        link_command="$compile_command$compile_rpath"
 
        # We have no uninstalled library dependencies, so finalize right now.
        $show "$link_command"
        $run eval "$link_command"
-       status=$?
+       exit_status=$?
 
        # Delete the generated files.
        if test -n "$dlsyms"; then
@@ -4545,7 +4799,7 @@ static const void *lt_preloaded_setup() {
          $run $rm "$output_objdir/${outputname}S.${objext}"
        fi
 
-       exit $status
+       exit $exit_status
       fi
 
       if test -n "$shlibpath_var"; then
@@ -4618,7 +4872,7 @@ static const void *lt_preloaded_setup() {
        if test "$fast_install" != no; then
          link_command="$finalize_var$compile_command$finalize_rpath"
          if test "$fast_install" = yes; then
-           relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+           relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
          else
            # fast_install is set to needless
            relink_command=
@@ -4655,7 +4909,7 @@ static const void *lt_preloaded_setup() {
          fi
        done
        relink_command="(cd `pwd`; $relink_command)"
-       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+       relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
       fi
 
       # Quote $echo for shipping.
@@ -4685,10 +4939,12 @@ static const void *lt_preloaded_setup() {
        esac
        case $host in
          *cygwin* | *mingw* )
-           cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
-           cwrapper=`$echo ${output}.exe`
-           $rm $cwrappersource $cwrapper
-           trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            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
 
            cat > $cwrappersource <<EOF
 
@@ -4713,6 +4969,9 @@ EOF
 #include <malloc.h>
 #include <stdarg.h>
 #include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
 
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
@@ -4723,15 +4982,19 @@ EOF
 #endif
 
 #ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
 #endif
 
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
-#define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
-#endif
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
 #endif
 
 #ifndef DIR_SEPARATOR_2
@@ -4741,17 +5004,32 @@ EOF
         (((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 */
+
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
 const char *program_name = NULL;
 
 void * xmalloc (size_t num);
 char * xstrdup (const char *string);
-char * basename (const char *name);
-char * fnqualify(const char *path);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
 char * strendzap(char *str, const char *pat);
 void lt_fatal (const char *message, ...);
 
@@ -4761,29 +5039,50 @@ main (int argc, char *argv[])
   char **newargz;
   int i;
 
-  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
   newargz = XMALLOC(char *, argc+2);
 EOF
 
-           cat >> $cwrappersource <<EOF
-  newargz[0] = "$SHELL";
+            cat >> $cwrappersource <<EOF
+  newargz[0] = (char *) xstrdup("$SHELL");
 EOF
 
-           cat >> $cwrappersource <<"EOF"
-  newargz[1] = fnqualify(argv[0]);
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
   strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
+
+  for (i=0; i<argc+1; i++)
+  {
+    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
+    ;
+  }
+
 EOF
 
-           cat >> $cwrappersource <<EOF
+            case $host_os in
+              mingw*)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",(char const **)newargz);
+EOF
+              ;;
+              *)
+                cat >> $cwrappersource <<EOF
   execv("$SHELL",newargz);
 EOF
+              ;;
+            esac
 
-           cat >> $cwrappersource <<"EOF"
+            cat >> $cwrappersource <<"EOF"
   return 127;
 }
 
@@ -4804,48 +5103,148 @@ xstrdup (const char *string)
 ;
 }
 
-char *
-basename (const char *name)
+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 (name[0]) && name[1] == ':')
+  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 (char *) base;
+  return base;
 }
 
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
 char *
-fnqualify(const char *path)
+find_executable (const char* wrapper)
 {
-  size_t size;
-  char *p;
+  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;
+
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
-  assert(path != NULL);
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
 
-  /* Is it qualified already? */
+  /* 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)
-  if (isalpha (path[0]) && path[1] == ':')
-    return xstrdup (path);
+  }
 #endif
-  if (IS_DIR_SEPARATOR (path[0]))
-    return xstrdup (path);
 
-  /* prepend the current directory */
-  /* doesn't handle '~' */
+  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 ("getcwd failed");
+          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 ("getcwd failed");
-  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
-  p = XMALLOC(char, size);
-  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
-  return p;
+  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 *
@@ -4889,16 +5288,16 @@ lt_fatal (const char *message, ...)
   va_end (ap);
 }
 EOF
-         # we should really use a build-platform specific compiler
-         # here, but OTOH, the wrappers (shell script and this C one)
-         # are only useful if you want to execute the "real" binary.
-         # Since the "real" binary is built for $host, then this
-         # wrapper might as well be built for $host, too.
-         $run $LTCC -s -o $cwrapper $cwrappersource
-         ;;
-       esac
-       $rm $output
-       trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
        $echo > $output "\
 #! $SHELL
@@ -4917,6 +5316,20 @@ EOF
 Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
+# Be Bourne compatible (taken from Autoconf:_AS_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
@@ -5043,6 +5456,11 @@ else
        $echo >> $output "\
     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       # Run the actual program with our arguments.
+
+      # Make sure env LD_LIBRARY_PATH does not mess us up
+      if test -n \"\${LD_LIBRARY_PATH+set}\"; then
+        export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
+      fi
 "
        case $host in
        # Backslashes separate directories on plain windows
@@ -5059,7 +5477,7 @@ else
          ;;
        esac
        $echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      \$echo \"\$0: cannot exec \$program \$*\"
       exit $EXIT_FAILURE
     fi
   else
@@ -5128,9 +5546,9 @@ fi\
            $run ${rm}r "$gentop"
            $show "$mkdir $gentop"
            $run $mkdir "$gentop"
-           status=$?
-           if test "$status" -ne 0 && test ! -d "$gentop"; then
-             exit $status
+           exit_status=$?
+           if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+             exit $exit_status
            fi
          fi
 
@@ -5245,7 +5663,7 @@ 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
       if test "$hardcode_automatic" = yes ; then
        relink_command=
       fi
@@ -5270,9 +5688,53 @@ fi\
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
                  exit $EXIT_FAILURE
                fi
-               newdependency_libs="$newdependency_libs $libdir/$name"
+               if test "X$EGREP" = X ; then
+                       EGREP=egrep
+               fi
+               # We do not want portage's install root ($D) present.  Check only for
+               # this if the .la is being installed.
+               if test "$installed" = yes && test "$D"; then
+                 eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
+               else
+                 mynewdependency_lib="$libdir/$name"
+               fi
+               # Do not add duplicates
+               if test "$mynewdependency_lib"; then
+                 my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
+                 if test -z "$my_little_ninja_foo_1"; then
+                   newdependency_libs="$newdependency_libs $mynewdependency_lib"
+                 fi
+               fi
+               ;;
+                 *)
+               if test "$installed" = yes; then
+                 # Rather use S=WORKDIR if our version of portage supports it.
+                 # This is because some ebuild (gcc) do not use $S as buildroot.
+                 if test "$PWORKDIR"; then
+                   S="$PWORKDIR"
+                 fi
+                 # We do not want portage's build root ($S) present.
+                 my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
+                 # We do not want portage's install root ($D) present.
+                 my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
+                 if test -n "$my_little_ninja_foo_2" && test "$S"; then
+                   mynewdependency_lib=""
+                 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
+                   eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
+                 else
+                   mynewdependency_lib="$deplib"
+                 fi
+               else
+                 mynewdependency_lib="$deplib"
+               fi
+               # Do not add duplicates
+               if test "$mynewdependency_lib"; then
+                 my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
+                 if test -z "$my_little_ninja_foo_4"; then
+                       newdependency_libs="$newdependency_libs $mynewdependency_lib"
+                 fi
+               fi
                ;;
-             *) newdependency_libs="$newdependency_libs $deplib" ;;
              esac
            done
            dependency_libs="$newdependency_libs"
@@ -5324,6 +5786,10 @@ fi\
          case $host,$output,$installed,$module,$dlname in
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
          esac
+         # Do not add duplicates
+         if test "$installed" = yes && test "$D"; then
+           install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
+         fi
          $echo > $output "\
 # $outputname - a libtool library file
 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@@ -5590,9 +6056,9 @@ relink_command=\"$relink_command\""
 
          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%"`
+           relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
          else
-           relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+           relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
          fi
 
          $echo "$modename: warning: relinking \`$file'" 1>&2
@@ -5797,22 +6263,11 @@ relink_command=\"$relink_command\""
          outputname=
          if test "$fast_install" = no && test -n "$relink_command"; then
            if test "$finalize" = yes && test -z "$run"; then
-             tmpdir="/tmp"
-             test -n "$TMPDIR" && tmpdir="$TMPDIR"
-             tmpdir="$tmpdir/libtool-$$"
-             save_umask=`umask`
-             umask 0077
-             if $mkdir "$tmpdir"; then
-               umask $save_umask
-             else
-               umask $save_umask
-               $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
-               continue
-             fi
+             tmpdir=`func_mktempdir`
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
              outputname="$tmpdir/$file"
              # Replace the output file specification.
-             relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+             relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
 
              $show "$relink_command"
              if $run eval "$relink_command"; then :
@@ -5932,7 +6387,7 @@ relink_command=\"$relink_command\""
     # Exit here if they wanted silent mode.
     test "$show" = : && exit $EXIT_SUCCESS
 
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     $echo "Libraries have been installed in:"
     for libdir in $libdirs; do
       $echo "   $libdir"
@@ -5965,7 +6420,7 @@ relink_command=\"$relink_command\""
     $echo
     $echo "See any operating system documentation about shared libraries for"
     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
     ;;
 
@@ -6023,8 +6478,10 @@ relink_command=\"$relink_command\""
        if test -f "$dir/$objdir/$dlname"; then
          dir="$dir/$objdir"
        else
-         $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-         exit $EXIT_FAILURE
+         if test ! -f "$dir/$dlname"; then
+           $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+           exit $EXIT_FAILURE
+         fi
        fi
        ;;
 
@@ -6088,12 +6545,12 @@ relink_command=\"$relink_command\""
       fi
 
       # Restore saved environment variables
-      if test "${save_LC_ALL+set}" = set; then
-       LC_ALL="$save_LC_ALL"; export LC_ALL
-      fi
-      if test "${save_LANG+set}" = set; then
-       LANG="$save_LANG"; export LANG
-      fi
+      for lt_var in LANG 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
+             fi"
+      done
 
       # Now prepare to actually exec the command.
       exec_cmd="\$cmd$args"
@@ -6182,9 +6639,17 @@ relink_command=\"$relink_command\""
            rmfiles="$rmfiles $objdir/$n"
          done
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-         test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
-         if test "$mode" = uninstall; then
+         case "$mode" in
+         clean)
+           case "  $library_names " in
+           # "  " in the beginning catches empty $dlname
+           *" $dlname "*) ;;
+           *) rmfiles="$rmfiles $objdir/$dlname" ;;
+           esac
+            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+           ;;
+         uninstall)
            if test -n "$library_names"; then
              # Do each command in the postuninstall commands.
              cmds=$postuninstall_cmds
@@ -6217,7 +6682,8 @@ relink_command=\"$relink_command\""
              IFS="$save_ifs"
            fi
            # FIXME: should reinstall the best remaining shared library.
-         fi
+           ;;
+         esac
        fi
        ;;
 
@@ -6441,9 +6907,9 @@ The following components of LINK-COMMAND are treated specially:
   -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
+                    try to export only the symbols listed in SYMFILE
   -export-symbols-regex REGEX
-                   try to export only the symbols matching 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
@@ -6457,9 +6923,11 @@ The following components of LINK-COMMAND are treated specially:
   -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
-  -static           do not do any dynamic linking of libtool libraries
+  -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]
+                    specify library version info [each variable defaults to 0]
 
 All other options (arguments beginning with \`-') are ignored.
 
@@ -6516,12 +6984,11 @@ exit $?
 # 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
+disable_libs=shared
 # ### 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`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
diff --git a/config/macro-archive/ac_define_dir.m4 b/config/macro-archive/ac_define_dir.m4
new file mode 100644 (file)
index 0000000..f3d8734
--- /dev/null
@@ -0,0 +1,47 @@
+##### http://autoconf-archive.cryp.to/ac_define_dir.html
+#
+# SYNOPSIS
+#
+#   AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
+#
+# DESCRIPTION
+#
+#   This macro sets VARNAME to the expansion of the DIR variable,
+#   taking care of fixing up ${prefix} and such.
+#
+#   VARNAME is then offered as both an output variable and a C
+#   preprocessor symbol.
+#
+#   Example:
+#
+#      AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
+#
+# LAST MODIFICATION
+#
+#   2006-10-13
+#
+# COPYLEFT
+#
+#   Copyright (c) 2006 Stepan Kasal <kasal@ucw.cz>
+#   Copyright (c) 2006 Andreas Schwab <schwab@suse.de>
+#   Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2006 Alexandre Oliva
+#
+#   Copying and distribution of this file, with or without
+#   modification, are permitted in any medium without royalty provided
+#   the copyright notice and this notice are preserved.
+
+AC_DEFUN([AC_DEFINE_DIR], [
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
+dnl refers to ${prefix}.  Thus we have to use `eval' twice.
+  eval ac_define_dir="\"[$]$2\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  AC_SUBST($1, "$ac_define_dir")
+  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+])
diff --git a/config/macro-archive/ac_prog_perl_version.m4 b/config/macro-archive/ac_prog_perl_version.m4
new file mode 100644 (file)
index 0000000..886765d
--- /dev/null
@@ -0,0 +1,59 @@
+##### http://autoconf-archive.cryp.to/ac_prog_perl_version.html
+#
+# SYNOPSIS
+#
+#   AC_PROG_PERL_VERSION(VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+#   Makes sure that perl supports the version indicated. If true the
+#   shell commands in ACTION-IF-TRUE are executed. If not the shell
+#   commands in ACTION-IF-FALSE are run. Note if $PERL is not set (for
+#   example by running AC_CHECK_PROG or AC_PATH_PROG),
+#   AC_CHECK_PROG(PERL, perl, perl) will be run.
+#
+#   Example:
+#
+#     AC_PROG_PERL_VERSION(5.6.0)
+#
+#   This will check to make sure that the perl you have supports at
+#   least version 5.6.0.
+#
+# LAST MODIFICATION
+#
+#   2002-09-25
+#
+# COPYLEFT
+#
+#   Copyright (c) 2002 Dean Povey <povey@wedgetail.com>
+#
+#   Copying and distribution of this file, with or without
+#   modification, are permitted in any medium without royalty provided
+#   the copyright notice and this notice are preserved.
+
+AC_DEFUN([AC_PROG_PERL_VERSION],[dnl
+# Make sure we have perl
+if test -z "$PERL"; then
+AC_CHECK_PROG(PERL,perl,perl)
+fi
+
+# Check if version of Perl is sufficient
+ac_perl_version="$1"
+
+if test "x$PERL" != "x"; then
+  AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version)
+  # NB: It would be nice to log the error if there is one, but we cannot rely
+  # on autoconf internals
+  $PERL -e "use $ac_perl_version;" > /dev/null 2>&1
+  if test $? -ne 0; then
+    AC_MSG_RESULT(no);
+    $3
+  else
+    AC_MSG_RESULT(ok);
+    $2
+  fi
+else
+  AC_MSG_WARN(could not find perl)
+fi
+])dnl
+
diff --git a/config/macro-archive/ac_prog_swig.m4 b/config/macro-archive/ac_prog_swig.m4
new file mode 100644 (file)
index 0000000..20520b2
--- /dev/null
@@ -0,0 +1,124 @@
+# Modified by Dustin J. Mitchell, Zmanda, Inc. as follows:
+#  - remove warnings -- Amanda tarballs ship pre-swigged, so users
+#    need not be alarmed if they don't have SWIG.
+#
+##### http://autoconf-archive.cryp.to/ac_pkg_swig.html
+#
+# SYNOPSIS
+#
+#   AC_PROG_SWIG([major.minor.micro])
+#
+# DESCRIPTION
+#
+#   This macro searches for a SWIG installation on your system. If
+#   found you should call SWIG via $(SWIG). You can use the optional
+#   first argument to check if the version of the available SWIG is
+#   greater than or equal to the value of the argument. It should have
+#   the format: N[.N[.N]] (N is a number between 0 and 999. Only the
+#   first N is mandatory.)
+#
+#   If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks
+#   that the swig package is this version number or higher.
+#
+#   In configure.in, use as:
+#
+#     AC_PROG_SWIG(1.3.17)
+#     SWIG_ENABLE_CXX
+#     SWIG_MULTI_MODULE_SUPPORT
+#     SWIG_PYTHON
+#
+# LAST MODIFICATION
+#
+#   2006-10-22
+#
+# COPYLEFT
+#
+#   Copyright (c) 2006 Sebastian Huber <sebastian-huber@web.de>
+#   Copyright (c) 2006 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
+#   Copyright (c) 2006 Rafael Laboissiere <rafael@laboissiere.net>
+#   Copyright (c) 2006 Andrew Collier <colliera@ukzn.ac.za>
+#
+#   This program is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License as
+#   published by the Free Software Foundation; either version 2 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#   General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+#   02111-1307, USA.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+AC_DEFUN([AC_PROG_SWIG],[
+        AC_PATH_PROG([SWIG],[swig])
+        if test -z "$SWIG" ; then
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "$1" ; then
+                AC_MSG_CHECKING([for SWIG version])
+                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+                AC_MSG_RESULT([$swig_version])
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        [required=$1]
+                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_major" ; then
+                                [required_major=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_minor" ; then
+                                [required_minor=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_patch" ; then
+                                [required_patch=0]
+                        fi
+                        # Calculate the available version number components
+                        [available=$swig_version]
+                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_major" ; then
+                                [available_major=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_minor" ; then
+                                [available_minor=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_patch" ; then
+                                [available_patch=0]
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                        fi
+                else
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+        AC_SUBST([SWIG_LIB])
+])
diff --git a/config/macro-archive/ax_compare_version.m4 b/config/macro-archive/ax_compare_version.m4
new file mode 100644 (file)
index 0000000..a7581b4
--- /dev/null
@@ -0,0 +1,201 @@
+##### http://autoconf-archive.cryp.to/ax_compare_version.html
+#
+# SYNOPSIS
+#
+#   AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+#   This macro compares two version strings. It is used heavily in the
+#   macro _AX_PATH_BDB for library checking. Due to the various number
+#   of minor-version numbers that can exist, and the fact that string
+#   comparisons are not compatible with numeric comparisons, this is
+#   not necessarily trivial to do in a autoconf script. This macro
+#   makes doing these comparisons easy.
+#
+#   The six basic comparisons are available, as well as checking
+#   equality limited to a certain number of minor-version levels.
+#
+#   The operator OP determines what type of comparison to do, and can
+#   be one of:
+#
+#    eq  - equal (test A == B)
+#    ne  - not equal (test A != B)
+#    le  - less than or equal (test A <= B)
+#    ge  - greater than or equal (test A >= B)
+#    lt  - less than (test A < B)
+#    gt  - greater than (test A > B)
+#
+#   Additionally, the eq and ne operator can have a number after it to
+#   limit the test to that number of minor versions.
+#
+#    eq0 - equal up to the length of the shorter version
+#    ne0 - not equal up to the length of the shorter version
+#    eqN - equal up to N sub-version levels
+#    neN - not equal up to N sub-version levels
+#
+#   When the condition is true, shell commands ACTION-IF-TRUE are run,
+#   otherwise shell commands ACTION-IF-FALSE are run. The environment
+#   variable 'ax_compare_version' is always set to either 'true' or
+#   'false' as well.
+#
+#   Examples:
+#
+#     AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
+#
+#   would both be true.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
+#
+#   would both be false.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
+#
+#   would be true because it is only comparing two minor versions.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
+#
+#   would be true because it is only comparing the lesser number of
+#   minor versions of the two values.
+#
+#   Note: The characters that separate the version numbers do not
+#   matter. An empty string is the same as version 0. OP is evaluated
+#   by autoconf, not configure, so must be a string, not a variable.
+#
+#   The author would like to acknowledge Guido Draheim whose advice
+#   about the m4_case and m4_ifvaln functions make this macro only
+#   include the portions necessary to perform the specific comparison
+#   specified by the OP argument in the final configure script.
+#
+# LAST MODIFICATION
+#
+#   2004-03-01
+#
+# COPYLEFT
+#
+#   Copyright (c) 2004 Tim Toolan <toolan@ele.uri.edu>
+#
+#   This program is free software; you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License as
+#   published by the Free Software Foundation; either version 2 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#   General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+#   02111-1307, USA.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+dnl #########################################################################
+AC_DEFUN([AX_COMPARE_VERSION], [
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+  AS_VAR_PUSHDEF([A],[ax_compare_version_A])
+  A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  AS_VAR_PUSHDEF([B],[ax_compare_version_B])
+  B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
+  dnl # then the first line is used to determine if the condition is true.
+  dnl # The sed right after the echo is to remove any indented white space.
+  m4_case(m4_tolower($2),
+  [lt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [gt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [le],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],
+  [ge],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],[
+    dnl Split the operator from the subversion count if present.
+    m4_bmatch(m4_substr($2,2),
+    [0],[
+      # A count of zero means use the length of the shorter version.
+      # Determine the number of characters in A and B.
+      ax_compare_version_len_A=`echo "$A" | awk '{print(length)}'`
+      ax_compare_version_len_B=`echo "$B" | awk '{print(length)}'`
+
+      # Set A to no more than B's length and B to no more than A's length.
+      A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
+    ],
+    [[0-9]+],[
+      # A count greater than zero means use only that many subversions
+      A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+    ],
+    [.+],[
+      AC_WARNING(
+        [illegal OP numeric parameter: $2])
+    ],[])
+
+    # Pad zeros at end of numbers to make same length.
+    ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
+    B="$B`echo $A | sed 's/./0/g'`"
+    A="$ax_compare_version_tmp_A"
+
+    # Check for equality or inequality as necessary.
+    m4_case(m4_tolower(m4_substr($2,0,2)),
+    [eq],[
+      test "x$A" = "x$B" && ax_compare_version=true
+    ],
+    [ne],[
+      test "x$A" != "x$B" && ax_compare_version=true
+    ],[
+      AC_WARNING([illegal OP parameter: $2])
+    ])
+  ])
+
+  AS_VAR_POPDEF([A])dnl
+  AS_VAR_POPDEF([B])dnl
+
+  dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
+  if test "$ax_compare_version" = "true" ; then
+    m4_ifvaln([$4],[$4],[:])dnl
+    m4_ifvaln([$5],[else $5])dnl
+  fi
+]) dnl AX_COMPARE_VERSION
diff --git a/config/macro-archive/docbook-dtd.m4 b/config/macro-archive/docbook-dtd.m4
new file mode 100644 (file)
index 0000000..935b169
--- /dev/null
@@ -0,0 +1,112 @@
+##### http://autoconf-archive.cryp.to/ac_check_docbook_dtd.html
+#
+# SYNOPSIS
+#
+#   AC_CHECK_DOCBOOK_DTD([dtd-version])
+#
+# DESCRIPTION
+#
+#   Check for access to a docbook DTD of a particular revision.
+#
+#   This macro can be used for multiple versions within the same script.
+#
+#   Input:
+#    $1 is the version of docbook to search for; default 'current'
+#   Output:
+#    $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending
+#    on the results of the test, where VERS is $1, with '_' substituted
+#    for '.'  $HAVE_DOCBOOK_DTD will also be set to the same value.
+#
+#   Example:
+#    AC_CHECK_DOCBOOK_DTD(4.3)
+#    if test "x$HAVE_DOCBOOK_DTD_4_3" = "xyes"; then
+#      ..
+#
+# LAST MODIFICATION
+#
+#   2007-06-28
+#
+# AUTHOR
+#
+#   Dustin J. Mitchell <dustin@zmanda.com>
+#
+# COPYRIGHT
+#
+#   Copyright (c) 2007 Zmanda Inc.  All Rights Reserved.
+#  
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License version 2 as published
+#   by the Free Software Foundation.
+#  
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+#   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#   for more details.
+#  
+#   You should have received a copy of the GNU General Public License along
+#   with this program; if not, write to the Free Software Foundation, Inc.,
+#   59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+#
+#   Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+#   Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
+
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+
+    dnl define variable names ending in _VERS which will actually have the
+    dnl version number as a suffix
+    define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
+
+    AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
+    [
+       ac_cv_docbook_dtd_VERS=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
+           echo "conftest.xml:" >&AS_MESSAGE_LOG_FD
+           echo "====" >&AS_MESSAGE_LOG_FD
+           cat conftest.xml >&AS_MESSAGE_LOG_FD
+           echo "====" >&AS_MESSAGE_LOG_FD
+
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0 -o "$?" = 5; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest.out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_VERS=yes
+               fi
+           fi
+           cat conftest.out >&AS_MESSAGE_LOG_FD
+
+           rm -f conftest.xml conftest.out
+       fi
+    ])
+
+    HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
+    HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_VERS"
+
+    dnl clean up m4 namespace
+    undefine([_VERS])
+    undefine([ac_cv_docbook_dtd_VERS])
+    undefine([HAVE_DOCBOOK_DTD_VERS])
+])
diff --git a/config/macro-archive/docbook-xslt-min.m4 b/config/macro-archive/docbook-xslt-min.m4
new file mode 100644 (file)
index 0000000..e92c848
--- /dev/null
@@ -0,0 +1,108 @@
+##### http://autoconf-archive.cryp.to/ac_check_docbook_xslt_min.html
+#
+# SYNOPSIS
+#
+#   AC_CHECK_DOCBOOK_XSLT_MIN(min-xslt-version)
+#
+# DESCRIPTION
+#
+#   Check that the 'current' version of docbook is at least version 
+#   min-xslt-version.
+#
+#   If the test is successful, $DOCBOOK_XSLT_CURRENT_VERSION will be set to the
+#   current docbook version; if not, it will be set to 'no'.
+#
+#   Example:
+#    AC_CHECK_DOCBOOK_XSLT_MIN(1.72.0)
+#    if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
+#      ..
+#
+# LAST MODIFICATION
+#
+#   2007-06-28
+#
+# AUTHOR
+#
+#   Dustin J. Mitchell <dustin@zmanda.com>
+#
+# COPYRIGHT
+#
+#   Copyright (c) 2007 Zmanda Inc.  All Rights Reserved.
+#  
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License version 2 as published
+#   by the Free Software Foundation.
+#  
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+#   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#   for more details.
+#  
+#   You should have received a copy of the GNU General Public License along
+#   with this program; if not, write to the Free Software Foundation, Inc.,
+#   59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+#
+#   Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+#   Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
+
+    AC_CACHE_CHECK([for current Docbook XSLT version], [ac_cv_docbook_xslt_current_version],
+    [
+       ac_cv_docbook_xslt_current_version=no
+
+       if test -n "$XSLTPROC"; then
+           cat >conftest.xsl <<EOF
+               <xsl:stylesheet
+                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                   xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
+                   version="1.0">
+                   <xsl:output method="text"/>
+                   <xsl:template match="fm:project/fm:Version">
+                       <xsl:value-of select="." />
+                   </xsl:template>
+                   <!-- do nothing with any other text -->
+                   <xsl:template match="text()"/>
+               </xsl:stylesheet>
+EOF
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&AS_MESSAGE_LOG_FD
+           echo "====" >&AS_MESSAGE_LOG_FD
+           cat conftest.xsl >&AS_MESSAGE_LOG_FD
+           echo "====" >&AS_MESSAGE_LOG_FD
+
+           ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&AS_MESSAGE_LOG_FD`
+
+           if test "$?" != 0; then
+               ac_cv_docbook_xslt_current_version='no'
+           fi
+
+           rm conftest.xsl
+       fi
+    ])
+
+    DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version"
+    AC_MSG_CHECKING([whether Docbook XSLT version is $1 or newer])
+
+    if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+       AC_MSG_RESULT([no])
+    else
+       AX_COMPARE_VERSION([$DOCBOOK_XSLT_CURRENT_VERSION], [lt], [$1], [
+           # version is less than required, so mark it as "no"
+           DOCBOOK_XSLT_CURRENT_VERSION=no
+       ])
+
+       if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+           AC_MSG_RESULT([no])
+       else
+           AC_MSG_RESULT([yes ($DOCBOOK_XSLT_CURRENT_VERSION)])
+       fi
+    fi
+])
diff --git a/config/macro-archive/docbook-xslt.m4 b/config/macro-archive/docbook-xslt.m4
new file mode 100644 (file)
index 0000000..ab4b6ce
--- /dev/null
@@ -0,0 +1,93 @@
+##### http://autoconf-archive.cryp.to/ac_check_docbook_xslt.html
+#
+# SYNOPSIS
+#
+#   AC_CHECK_DOCBOOK_XSLT([xslt-version])
+#
+# DESCRIPTION
+#
+#   Check for access to docbook stylesheets of a particular revision.
+#
+#   This macro can be used for multiple versions within the same script.
+#
+#   Input:
+#    $1 is the version of docbook to search for; default 'current'
+#   Output:
+#    $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending
+#    on the results of the test, where VERS is $1, with '_' substituted
+#    for '.'  $HAVE_DOCBOOK_XSLT will also be set to the same value.
+#
+#   Example:
+#    AC_CHECK_DOCBOOK_XSLT(1.72.0)
+#    if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xyes"; then
+#      ..
+#
+# LAST MODIFICATION
+#
+#   2007-06-28
+#
+# AUTHOR
+#
+#   Dustin J. Mitchell <dustin@zmanda.com>
+#
+# COPYRIGHT
+#
+#   Copyright (c) 2007 Zmanda Inc.  All Rights Reserved.
+#  
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License version 2 as published
+#   by the Free Software Foundation.
+#  
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+#   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#   for more details.
+#  
+#   You should have received a copy of the GNU General Public License along
+#   with this program; if not, write to the Free Software Foundation, Inc.,
+#   59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+#
+#   Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+#   Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
+
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+
+    dnl define variable names ending in _VERS which will actually have the
+    dnl version number as a suffix
+    define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
+
+    AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
+    [
+       ac_cv_docbook_xslt_VERS=no
+       if test -n "$XSLTPROC"; then
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
+           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+
+           if test "$?" = 0; then
+               ac_cv_docbook_xslt_VERS=yes
+           fi
+       fi
+    ])
+
+    HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
+    HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_VERS"
+
+    dnl clean up m4 namespace
+    undefine([_VERS])
+    undefine([ac_cv_docbook_xslt_VERS])
+    undefine([HAVE_DOCBOOK_XSLT_VERS])
+])
diff --git a/config/macro-archive/file-list b/config/macro-archive/file-list
new file mode 100644 (file)
index 0000000..7773a1d
--- /dev/null
@@ -0,0 +1,9 @@
+## this file is automatically generated by autogen
+EXTRA_DIST += macro-archive/ac_define_dir.m4
+EXTRA_DIST += macro-archive/ac_prog_perl_version.m4
+EXTRA_DIST += macro-archive/ac_prog_swig.m4
+EXTRA_DIST += macro-archive/ax_compare_version.m4
+EXTRA_DIST += macro-archive/docbook-dtd.m4
+EXTRA_DIST += macro-archive/docbook-xslt.m4
+EXTRA_DIST += macro-archive/docbook-xslt-min.m4
+EXTRA_DIST += macro-archive/xsltproc.m4
diff --git a/config/macro-archive/xsltproc.m4 b/config/macro-archive/xsltproc.m4
new file mode 100644 (file)
index 0000000..b782967
--- /dev/null
@@ -0,0 +1,92 @@
+##### http://autoconf-archive.cryp.to/ac_prog_xsltproc.html
+#
+# SYNOPSIS
+#
+#   AC_PROG_XSLTPROC([default-flags])
+#
+# DESCRIPTION
+#
+#   Finds an xsltproc executable.
+#
+#   Input:
+#    default-flags is the default $XSLTPROC_FLAGS, which will be
+#    overridden if the user specifies --with-xsltproc-flags.
+#
+#   Output:
+#    $XSLTPROC contains the path to xsltproc, or is empty if none was
+#    found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
+#    contains the flags to use with xsltproc.
+#
+# LAST MODIFICATION
+#
+#   2007-04-17
+#
+# AUTHOR
+#
+#   Dustin J. Mitchell <dustin@zmanda.com>
+#
+# COPYRIGHT
+#
+#   Copyright (c) 2007 Zmanda Inc.  All Rights Reserved.
+#  
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License version 2 as published
+#   by the Free Software Foundation.
+#  
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+#   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#   for more details.
+#  
+#   You should have received a copy of the GNU General Public License along
+#   with this program; if not, write to the Free Software Foundation, Inc.,
+#   59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+#
+#   Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+#   Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+AC_DEFUN([AC_PROG_XSLTPROC],
+[
+XSLTPROC_FLAGS="$1"
+AC_SUBST(XSLTPROC_FLAGS)
+
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+AC_ARG_WITH(xsltproc,
+AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
+               [Use the xsltproc binary in in PATH.]),
+    [ ac_with_xsltproc=$withval; ],
+    [ ac_with_xsltproc=maybe; ])
+
+AC_ARG_WITH(xsltproc-flags,
+AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
+               [Flags to pass to xsltproc (default $1)]),
+    [ if test "x$withval" == "xno"; then
+       XSLTPROC_FLAGS=''
+    else
+       if test "x$withval" != "xyes"; then
+           XSLTPROC_FLAGS="$withval"
+       fi
+    fi
+       ])
+
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+    AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+else
+    if test "$ac_with_xsltproc" != "no"; then
+        if test -x "$ac_with_xsltproc"; then
+            XSLTPROC="$ac_with_xsltproc";
+        else
+            AMANDA_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative.])
+            AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+        fi
+    fi
+fi
+])
index 09edd8844dedc652ffe4d9aa931eed179489019f..1c8ff7049d8f3aaa9741c53e7f3145d9b76a77d8 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2005-02-08.22
+scriptversion=2006-05-10.23
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
 #   Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
@@ -19,8 +19,8 @@ scriptversion=2005-02-08.22
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,6 +33,8 @@ if test $# -eq 0; then
 fi
 
 run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
 # In the cases where this matters, `missing' is being run in the
 # srcdir already.
@@ -44,7 +46,7 @@ fi
 
 msg="missing on your system"
 
-case "$1" in
+case $1 in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -77,6 +79,7 @@ Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
   autoconf     touch file \`configure'
   autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
   automake     touch all \`Makefile.in' files
   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   flex         create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@ esac
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
 # the program).
-case "$1" in
+case $1 in
   lex|yacc)
     # Not GNU programs, they don't have --version.
     ;;
@@ -135,7 +138,7 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case "$1" in
+case $1 in
   aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
@@ -164,7 +167,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case "$f" in
+      case $f in
       *:*) touch_files="$touch_files "`echo "$f" |
                                       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
-    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -f "$file"; then
        touch $file
     else
@@ -214,25 +217,25 @@ WARNING: \`$1' $msg.  You should only need it if
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-       case "$LASTARG" in
+       case $LASTARG in
        *.y)
            SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-           if [ -f "$SRCFILE" ]; then
+           if test -f "$SRCFILE"; then
                 cp "$SRCFILE" y.tab.c
            fi
            SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-           if [ -f "$SRCFILE" ]; then
+           if test -f "$SRCFILE"; then
                 cp "$SRCFILE" y.tab.h
            fi
          ;;
        esac
     fi
-    if [ ! -f y.tab.h ]; then
+    if test ! -f y.tab.h; then
        echo >y.tab.h
     fi
-    if [ ! -f y.tab.c ]; then
+    if test ! -f y.tab.c; then
        echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
@@ -244,18 +247,18 @@ WARNING: \`$1' is $msg.  You should only need it if
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-       case "$LASTARG" in
+       case $LASTARG in
        *.l)
            SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-           if [ -f "$SRCFILE" ]; then
+           if test -f "$SRCFILE"; then
                 cp "$SRCFILE" lex.yy.c
            fi
          ;;
        esac
     fi
-    if [ ! -f lex.yy.c ]; then
+    if test ! -f lex.yy.c; then
        echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
@@ -267,11 +270,9 @@ WARNING: \`$1' is $msg.  You should only need it if
         \`Help2man' package in order for those modifications to take
         effect.  You can get \`Help2man' from any GNU archive site."
 
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
-    fi
-    if [ -f "$file" ]; then
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
        touch $file
     else
        test -z "$file" || exec >$file
@@ -289,14 +290,23 @@ WARNING: \`$1' is $msg.  You should only need it if
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
     touch $file
     ;;
 
@@ -314,13 +324,13 @@ WARNING: \`$1' is $msg.  You should only need it if
     fi
     firstarg="$1"
     if shift; then
-       case "$firstarg" in
+       case $firstarg in
        *o*)
            firstarg=`echo "$firstarg" | sed s/o//`
            tar "$firstarg" "$@" && exit 0
            ;;
        esac
-       case "$firstarg" in
+       case $firstarg in
        *h*)
            firstarg=`echo "$firstarg" | sed s/h//`
            tar "$firstarg" "$@" && exit 0
index 5d26a485f11223c19546f3e02ce59d201a5afe48..ef7e16fdafe243ab5e368763bd4cda18c5872c1f 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
 
-scriptversion=2005-02-02.21
+scriptversion=2006-05-11.19
 
 # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 # Created: 1993-05-16
@@ -11,8 +11,11 @@ scriptversion=2005-02-02.21
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+nl='
+'
+IFS=" ""       $nl"
 errstatus=0
-dirmode=""
+dirmode=
 
 usage="\
 Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@@ -103,13 +106,21 @@ esac
 
 for file
 do
-  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
   shift
+  IFS=$oIFS
 
-  pathcomp=
   for d
   do
-    pathcomp="$pathcomp$d"
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
     case $pathcomp in
       -*) pathcomp=./$pathcomp ;;
     esac
@@ -124,7 +135,7 @@ do
       else
        if test ! -z "$dirmode"; then
          echo "chmod $dirmode $pathcomp"
-         lasterr=""
+         lasterr=
          chmod "$dirmode" "$pathcomp" || lasterr=$?
 
          if test ! -z "$lasterr"; then
@@ -134,7 +145,7 @@ do
       fi
     fi
 
-    pathcomp="$pathcomp/"
+    pathcomp=$pathcomp/
   done
 done
 
diff --git a/config/ylwrap b/config/ylwrap
new file mode 100755 (executable)
index 0000000..102bd89
--- /dev/null
@@ -0,0 +1,223 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+#   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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case "$1" in
+  '')
+    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
+    exit 1
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+  INPUT is the input file
+  OUTPUT is one file PROG generates
+  DESIRED is the file we actually want instead of OUTPUT
+  PROGRAM is program to run
+  ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit $?
+    ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+  [\\/]* | ?:[\\/]*)
+    # Absolute path; do nothing.
+    ;;
+  *)
+    # Relative path.  Make it absolute.
+    input="`pwd`/$input"
+    ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  pairlist="$pairlist $1"
+  shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+  [\\/]* | ?:[\\/]*) ;;
+  *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines.  But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+  0) $prog "$input" ;;
+  *) $prog "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+  set X $pairlist
+  shift
+  first=yes
+  # Since DOS filename conventions don't allow two dots,
+  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+  y_tab_nodot="no"
+  if test -f y_tab.c || test -f y_tab.h; then
+    y_tab_nodot="yes"
+  fi
+
+  # The directory holding the input.
+  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+  # Quote $INPUT_DIR so we can use it in a regexp.
+  # FIXME: really we should care about more than `.' and `\'.
+  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+  while test "$#" -ne 0; do
+    from="$1"
+    # Handle y_tab.c and y_tab.h output by DOS
+    if test $y_tab_nodot = "yes"; then
+      if test $from = "y.tab.c"; then
+       from="y_tab.c"
+      else
+       if test $from = "y.tab.h"; then
+         from="y_tab.h"
+       fi
+      fi
+    fi
+    if test -f "$from"; then
+      # If $2 is an absolute path name, then just use that,
+      # otherwise prepend `../'.
+      case "$2" in
+       [\\/]* | ?:[\\/]*) target="$2";;
+       *) target="../$2";;
+      esac
+
+      # We do not want to overwrite a header file if it hasn't
+      # changed.  This avoid useless recompilations.  However the
+      # parser itself (the first file) should always be updated,
+      # because it is the destination of the .y.c rule in the
+      # Makefile.  Divert the output of all other files to a temporary
+      # file so we can compare them to existing versions.
+      if test $first = no; then
+       realtarget="$target"
+       target="tmp-`echo $target | sed s/.*[\\/]//g`"
+      fi
+      # Edit out `#line' or `#' directives.
+      #
+      # We don't want the resulting debug information to point at
+      # an absolute srcdir; it is better for it to just mention the
+      # .y file with no path.
+      #
+      # We want to use the real output file name, not yy.lex.c for
+      # instance.
+      #
+      # We want the include guards to be adjusted too.
+      FROM=`echo "$from" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+      TARGET=`echo "$2" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+      # Check whether header files must be updated.
+      if test $first = no; then
+       if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+         echo "$2" is unchanged
+         rm -f "$target"
+       else
+          echo updating "$2"
+          mv -f "$target" "$realtarget"
+        fi
+      fi
+    else
+      # A missing file is only an error for the first file.  This
+      # is a blatant hack to let us support using "yacc -d".  If -d
+      # is not specified, we don't want an error when the header
+      # file is "missing".
+      if test $first = yes; then
+        ret=1
+      fi
+    fi
+    shift
+    shift
+    first=no
+  done
+else
+  ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
index 08704fb549cc4f611ddd6e3e673bdefd295e1a2f..446d62378286675e85c01cad93a5a9216db166c4 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,25 +1,54 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
+# Generated by GNU Autoconf 2.61.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 Bourne compatible
+# 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=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -29,8 +58,43 @@ else
 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.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -44,18 +108,19 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+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
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -63,157 +128,388 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
         X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# 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
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
 fi
 
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  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
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
 
-       ;;
-  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
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
+  case $as_dir in
         /*)
-          if ("$as_dir/$as_base" -c '
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # 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 sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 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
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  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 -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+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=:
@@ -222,7 +518,28 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # 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'"
@@ -231,15 +548,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 
 
 # Check that we are running under the correct shell.
@@ -395,29 +703,26 @@ tagnames=${tagnames+${tagnames},}CXX
 
 tagnames=${tagnames+${tagnames},}F77
 
+exec 7<&0 </dev/null 6>&1
+
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME=
 PACKAGE_TARNAME=
@@ -429,43 +734,548 @@ ac_unique_file="common-src/amanda.h"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
 gl_header_list=
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CONFIGURE_COMMAND INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar SNAPSHOT_STAMP VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_COMMENT VERSION_SUFFIX CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H ARPA_INET_H SYS_SOCKET_H LIBPTH LTLIBPTH LIBPTH_PREFIX LIBTHREAD LTLIBTHREAD LIBMULTITHREAD LTLIBMULTITHREAD NETINET_IN_H STDBOOL_H HAVE__BOOL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_DECL_STRNCASECMP HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_DECL_STRTOK_R REPLACE_STRCASECMP REPLACE_STRSTR REPLACE_STRCASESTR ABSOLUTE_STRING_H MKDIR_P EOVERFLOW CFLAG_VISIBILITY HAVE_VISIBILITY GREP AMLINT AMLINTFLAGS DUMPER_DIR CONFIG_DIR USE_VERSION_SUFFIXES CLIENT_SCRIPTS_OPT DEFAULT_SERVER CLIENT_LOGIN SETUID_GROUP BINARY_OWNER DEFAULT_CONFIG DEFAULT_TAPE_SERVER DEFAULT_TAPE_DEVICE EXAMPLE_TAPEDEV DEFAULT_RAW_TAPE_DEVICE DEFAULT_CHANGER_DEVICE GNUTAR_LISTED_INCREMENTAL_DIRX GNUTAR_LISTED_INCREMENTAL_DIR SSH MAXTAPEBLOCKSIZE AMANDA_TMPDIR AMANDA_DBGDIR AMANDA_DEBUG_DAYS SERVICE_SUFFIX MT_FILE_FLAG AR YACC CAT COMPRESS DD GETCONF GNUPLOT GNUTAR SAMBA_CLIENT GZIP SORT MAILER MT CHIO CHS MTX MCUTIL PRINT PCAT PERL DUMP RESTORE XFSDUMP XFSRESTORE VXDUMP VXRESTORE VDUMP VRESTORE AMPLOT_COMPRESS AMPLOT_CAT_GZIP AMPLOT_CAT_COMPRESS AMPLOT_CAT_PACK LL_FMT LL_RFMT LN_S ECHO ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS LEX LEXLIB LEX_OUTPUT_ROOT READLINE_LIBS DB_EXT ac_n ac_c WANT_CLIENT_TRUE WANT_CLIENT_FALSE WANT_SAMBA_TRUE WANT_SAMBA_FALSE WANT_RESTORE_TRUE WANT_RESTORE_FALSE WANT_SERVER_TRUE WANT_SERVER_FALSE WANT_RECOVER_TRUE WANT_RECOVER_FALSE WANT_TAPE_TRUE WANT_TAPE_FALSE WANT_AMPLOT_TRUE WANT_AMPLOT_FALSE WANT_CHG_SCSI_TRUE WANT_CHG_SCSI_FALSE WANT_CHIO_SCSI_TRUE WANT_CHIO_SCSI_FALSE WANT_RUNTIME_PSEUDO_RELOC_TRUE WANT_RUNTIME_PSEUDO_RELOC_FALSE WANT_SETUID_CLIENT_TRUE WANT_SETUID_CLIENT_FALSE WANT_SSH_SECURITY_TRUE WANT_SSH_SECURITY_FALSE LTLIBOBJS LTALLOCA DOC_BUILD_DATE XSLTPROC_FLAGS XSLTPROC ENABLE_MANPAGE_BUILD_TRUE ENABLE_MANPAGE_BUILD_FALSE GCC_COMPILER_TRUE GCC_COMPILER_FALSE AM_CFLAGS LIBOBJS gl_LIBOBJS gl_LTLIBOBJS'
+gl_func_list=
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+PACKAGE
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+SNAPSHOT_STAMP
+VERSION_MAJOR
+VERSION_MINOR
+VERSION_PATCH
+VERSION_COMMENT
+VERSION_SUFFIX
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+RANLIB
+CPP
+GREP
+EGREP
+GL_COND_LIBTOOL_TRUE
+GL_COND_LIBTOOL_FALSE
+ALLOCA
+ALLOCA_H
+ARPA_INET_H
+INCLUDE_NEXT
+NEXT_FLOAT_H
+FLOAT_H
+NEXT_SYS_SOCKET_H
+HAVE_SYS_SOCKET_H
+HAVE_WINSOCK2_H
+HAVE_WS2TCPIP_H
+SYS_SOCKET_H
+LIBINTL
+LTLIBINTL
+NEXT_SYS_TIME_H
+HAVE_SYS_TIME_H
+HAVE_STRUCT_TIMEVAL
+REPLACE_GETTIMEOFDAY
+SYS_TIME_H
+LIBPTH
+LTLIBPTH
+LIBTHREAD
+LTLIBTHREAD
+LIBMULTITHREAD
+LTLIBMULTITHREAD
+HAVE_MALLOC_POSIX
+GNULIB_MALLOC_POSIX
+GNULIB_REALLOC_POSIX
+GNULIB_CALLOC_POSIX
+GNULIB_GETSUBOPT
+GNULIB_MKDTEMP
+GNULIB_MKSTEMP
+HAVE_CALLOC_POSIX
+HAVE_GETSUBOPT
+HAVE_MKDTEMP
+HAVE_REALLOC_POSIX
+REPLACE_MKSTEMP
+NEXT_NETINET_IN_H
+HAVE_NETINET_IN_H
+NETINET_IN_H
+GNULIB_FPRINTF_POSIX
+GNULIB_PRINTF_POSIX
+GNULIB_SNPRINTF
+GNULIB_SPRINTF_POSIX
+GNULIB_VFPRINTF_POSIX
+GNULIB_VPRINTF_POSIX
+GNULIB_VSNPRINTF
+GNULIB_VSPRINTF_POSIX
+GNULIB_VASPRINTF
+GNULIB_FSEEK
+GNULIB_FSEEKO
+GNULIB_FTELL
+GNULIB_FTELLO
+GNULIB_FFLUSH
+GNULIB_GETDELIM
+GNULIB_GETLINE
+REPLACE_FPRINTF
+REPLACE_VFPRINTF
+REPLACE_PRINTF
+REPLACE_VPRINTF
+REPLACE_SNPRINTF
+HAVE_DECL_SNPRINTF
+REPLACE_VSNPRINTF
+HAVE_DECL_VSNPRINTF
+REPLACE_SPRINTF
+REPLACE_VSPRINTF
+HAVE_VASPRINTF
+REPLACE_VASPRINTF
+HAVE_FSEEKO
+REPLACE_FSEEKO
+REPLACE_FSEEK
+HAVE_FTELLO
+REPLACE_FTELLO
+REPLACE_FTELL
+REPLACE_FFLUSH
+HAVE_DECL_GETDELIM
+HAVE_DECL_GETLINE
+REPLACE_GETLINE
+STDBOOL_H
+HAVE__BOOL
+HAVE_LONG_LONG_INT
+HAVE_UNSIGNED_LONG_LONG_INT
+HAVE_INTTYPES_H
+HAVE_SYS_TYPES_H
+NEXT_STDINT_H
+HAVE_STDINT_H
+HAVE_SYS_INTTYPES_H
+HAVE_SYS_BITYPES_H
+BITSIZEOF_PTRDIFF_T
+BITSIZEOF_SIG_ATOMIC_T
+BITSIZEOF_SIZE_T
+BITSIZEOF_WCHAR_T
+BITSIZEOF_WINT_T
+HAVE_SIGNED_SIG_ATOMIC_T
+HAVE_SIGNED_WCHAR_T
+HAVE_SIGNED_WINT_T
+PTRDIFF_T_SUFFIX
+SIG_ATOMIC_T_SUFFIX
+SIZE_T_SUFFIX
+WCHAR_T_SUFFIX
+WINT_T_SUFFIX
+STDINT_H
+NEXT_STDIO_H
+NEXT_STDLIB_H
+GNULIB_MEMMEM
+GNULIB_MEMPCPY
+GNULIB_MEMRCHR
+GNULIB_STPCPY
+GNULIB_STPNCPY
+GNULIB_STRCHRNUL
+GNULIB_STRDUP
+GNULIB_STRNDUP
+GNULIB_STRNLEN
+GNULIB_STRPBRK
+GNULIB_STRSEP
+GNULIB_STRCASESTR
+GNULIB_STRTOK_R
+GNULIB_MBSLEN
+GNULIB_MBSNLEN
+GNULIB_MBSCHR
+GNULIB_MBSRCHR
+GNULIB_MBSSTR
+GNULIB_MBSCASECMP
+GNULIB_MBSNCASECMP
+GNULIB_MBSPCASECMP
+GNULIB_MBSCASESTR
+GNULIB_MBSCSPN
+GNULIB_MBSPBRK
+GNULIB_MBSSPN
+GNULIB_MBSSEP
+GNULIB_MBSTOK_R
+HAVE_DECL_MEMMEM
+HAVE_MEMPCPY
+HAVE_DECL_MEMRCHR
+HAVE_STPCPY
+HAVE_STPNCPY
+HAVE_STRCASECMP
+HAVE_DECL_STRNCASECMP
+HAVE_STRCHRNUL
+HAVE_DECL_STRDUP
+HAVE_STRNDUP
+HAVE_DECL_STRNDUP
+HAVE_DECL_STRNLEN
+HAVE_STRPBRK
+HAVE_STRSEP
+HAVE_STRCASESTR
+HAVE_DECL_STRTOK_R
+NEXT_STRING_H
+HAVE_LSTAT
+HAVE_DECL_MKDIR
+HAVE_IO_H
+NEXT_SYS_STAT_H
+SYS_STAT_H
+GNULIB_CHOWN
+GNULIB_DUP2
+GNULIB_FCHDIR
+GNULIB_FTRUNCATE
+GNULIB_GETCWD
+GNULIB_GETLOGIN_R
+GNULIB_LCHOWN
+GNULIB_LSEEK
+GNULIB_READLINK
+GNULIB_SLEEP
+HAVE_DUP2
+HAVE_FTRUNCATE
+HAVE_READLINK
+HAVE_SLEEP
+HAVE_DECL_GETLOGIN_R
+REPLACE_CHOWN
+REPLACE_FCHDIR
+REPLACE_GETCWD
+REPLACE_LCHOWN
+REPLACE_LSEEK
+NEXT_UNISTD_H
+HAVE_UNISTD_H
+EOVERFLOW
+CFLAG_VISIBILITY
+HAVE_VISIBILITY
+GNULIB_WCWIDTH
+HAVE_DECL_WCWIDTH
+REPLACE_WCWIDTH
+WCHAR_H
+HAVE_WCHAR_H
+NEXT_WCHAR_H
+AMANDA_WARNING_CFLAGS
+CLIENT_LOGIN
+SETUID_GROUP
+CONFIG_DIR
+USE_VERSION_SUFFIXES
+GNUTAR_LISTED_INCREMENTAL_DIR
+AMANDA_TMPDIR
+BINARY_OWNER
+MAXTAPEBLOCKSIZE
+AMANDA_DBGDIR
+AMANDA_DEBUG_DAYS
+SERVICE_SUFFIX
+WANT_SETUID_CLIENT_TRUE
+WANT_SETUID_CLIENT_FALSE
+WANT_INSTALLPERMS_TRUE
+WANT_INSTALLPERMS_FALSE
+WANT_CLIENT_TRUE
+WANT_CLIENT_FALSE
+WANT_RESTORE_TRUE
+WANT_RESTORE_FALSE
+WANT_SERVER_TRUE
+WANT_SERVER_FALSE
+WANT_RECOVER_TRUE
+WANT_RECOVER_FALSE
+WANT_TAPE_TRUE
+WANT_TAPE_FALSE
+GNUPLOT
+PCAT
+COMPRESS
+GZIP
+AMPLOT_COMPRESS
+AMPLOT_CAT_GZIP
+AMPLOT_CAT_COMPRESS
+AMPLOT_CAT_PACK
+WANT_AMPLOT_TRUE
+WANT_AMPLOT_FALSE
+XSLTPROC_FLAGS
+XSLTPROC
+ENABLE_MANPAGE_BUILD_TRUE
+ENABLE_MANPAGE_BUILD_FALSE
+XSLREL
+DOC_BUILD_DATE
+DEFAULT_SERVER
+DEFAULT_CONFIG
+DEFAULT_TAPE_SERVER
+DEFAULT_TAPE_DEVICE
+EXAMPLE_TAPEDEV
+DEFAULT_CHANGER_DEVICE
+DEFAULT_AMANDATES_FILE
+GETCONF
+CHIO
+CHS
+MTX
+MCUTIL
+WANT_CHG_SCSI_TRUE
+WANT_CHG_SCSI_FALSE
+WANT_SCSI_LINUX_TRUE
+WANT_SCSI_LINUX_FALSE
+WANT_SCSI_HPUX_NEW_TRUE
+WANT_SCSI_HPUX_NEW_FALSE
+WANT_SCSI_IRIX_TRUE
+WANT_SCSI_IRIX_FALSE
+WANT_SCSI_SOLARIS_TRUE
+WANT_SCSI_SOLARIS_FALSE
+WANT_SCSI_AIX_TRUE
+WANT_SCSI_AIX_FALSE
+WANT_SCSI_CAM_TRUE
+WANT_SCSI_CAM_FALSE
+WANT_SCSI_BSD_TRUE
+WANT_SCSI_BSD_FALSE
+WANT_CHG_SCSI_CHIO_TRUE
+WANT_CHG_SCSI_CHIO_FALSE
+WANT_SCSI_HPUX_TRUE
+WANT_SCSI_HPUX_FALSE
+WANT_SCSI_CHIO_TRUE
+WANT_SCSI_CHIO_FALSE
+WANT_AMFLOCK_POSIX_TRUE
+WANT_AMFLOCK_POSIX_FALSE
+WANT_AMFLOCK_FLOCK_TRUE
+WANT_AMFLOCK_FLOCK_FALSE
+WANT_AMFLOCK_LOCKF_TRUE
+WANT_AMFLOCK_LOCKF_FALSE
+WANT_AMFLOCK_LNLOCK_TRUE
+WANT_AMFLOCK_LNLOCK_FALSE
+SWIG
+SWIG_LIB
+PERL
+PERL_INC
+WANT_CYGWIN_COPY_PERL_DLL_TRUE
+WANT_CYGWIN_COPY_PERL_DLL_FALSE
+PERLEXTLIBS
+CAT
+CLIENT_SCRIPTS_OPT
+amlibdir
+amlibexecdir
+amincludedir
+amperldir
+DUMPER_DIR
+MSGFMT
+GETTEXT
+USE_NLS
+GMSGFMT
+MSGFMT_015
+GMSGFMT_015
+XGETTEXT
+XGETTEXT_015
+MSGMERGE
+INTL_MACOSX_LIBS
+LIBICONV
+LTLIBICONV
+INTLLIBS
+POSUB
+CURL_CONFIG
+_libcurl_config
+LIBCURL_CPPFLAGS
+LIBCURL
+WANT_S3_DEVICE_TRUE
+WANT_S3_DEVICE_FALSE
+WANT_DEVPAY_TRUE
+WANT_DEVPAY_FALSE
+WANT_TAPE_XENIX_TRUE
+WANT_TAPE_XENIX_FALSE
+WANT_TAPE_AIX_TRUE
+WANT_TAPE_AIX_FALSE
+WANT_TAPE_UWARE_TRUE
+WANT_TAPE_UWARE_FALSE
+WANT_TAPE_POSIX_TRUE
+WANT_TAPE_POSIX_FALSE
+WANT_TAPE_DEVICE_TRUE
+WANT_TAPE_DEVICE_FALSE
+WANT_BSD_SECURITY_TRUE
+WANT_BSD_SECURITY_FALSE
+WANT_BSDTCP_SECURITY_TRUE
+WANT_BSDTCP_SECURITY_FALSE
+WANT_BSDUDP_SECURITY_TRUE
+WANT_BSDUDP_SECURITY_FALSE
+WANT_RSH_SECURITY_TRUE
+WANT_RSH_SECURITY_FALSE
+SSH
+WANT_SSH_SECURITY_TRUE
+WANT_SSH_SECURITY_FALSE
+WANT_KRB4_SECURITY_TRUE
+WANT_KRB4_SECURITY_FALSE
+WANT_KRB5_SECURITY_TRUE
+WANT_KRB5_SECURITY_FALSE
+XFSDUMP
+XFSRESTORE
+VXDUMP
+VXRESTORE
+VDUMP
+VRESTORE
+DUMP
+RESTORE
+GNUTAR
+SAMBA_CLIENT
+WANT_SAMBA_TRUE
+WANT_SAMBA_FALSE
+AMLINT
+AMLINTFLAGS
+LEX
+LEX_OUTPUT_ROOT
+LEXLIB
+AR
+YACC
+YFLAGS
+DD
+BASH
+SORT
+MAILER
+MT
+MT_FILE_FLAG
+PRINT
+GCC_COMPILER_TRUE
+GCC_COMPILER_FALSE
+LN_S
+ECHO
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+LIBTOOL_DEPS
+AMANDA_STATIC_LDFLAGS
+PKG_CONFIG
+GLIB_CFLAGS
+GLIB_LIBS
+GLIB_GENMARSHAL
+GOBJECT_QUERY
+GLIB_MKENUMS
+READLINE_LIBS
+LIBOBJS
+LTLIBOBJS
+gl_LIBOBJS
+gl_LTLIBOBJS
+SVN'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+GNUPLOT
+SWIG
+PERL
+GNUTAR
+YACC
+YFLAGS
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+F77
+FFLAGS
+PKG_CONFIG'
+
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -492,34 +1302,48 @@ x_libraries=NONE
 # 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'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+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"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -541,33 +1365,45 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -594,6 +1430,12 @@ do
   -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 ;;
@@ -618,13 +1460,16 @@ do
   | --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 | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -689,6 +1534,16 @@ do
   | --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 ;;
@@ -741,24 +1596,20 @@ do
   -with-* | --with-*)
     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -789,8 +1640,7 @@ Try \`$0 --help' for more information." >&2
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -810,27 +1660,19 @@ if test -n "$ac_prev"; then
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
+# Be sure to have absolute directory names.
+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
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-             localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -857,94 +1699,76 @@ 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 .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
 # 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 its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$0" : 'X\(//\)[^/]' \| \
         X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    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
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-ac_env_CXX_set=${CXX+set}
-ac_env_CXX_value=$CXX
-ac_cv_env_CXX_set=${CXX+set}
-ac_cv_env_CXX_value=$CXX
-ac_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_env_CXXFLAGS_value=$CXXFLAGS
-ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_cv_env_CXXFLAGS_value=$CXXFLAGS
-ac_env_CXXCPP_set=${CXXCPP+set}
-ac_env_CXXCPP_value=$CXXCPP
-ac_cv_env_CXXCPP_set=${CXXCPP+set}
-ac_cv_env_CXXCPP_value=$CXXCPP
-ac_env_F77_set=${F77+set}
-ac_env_F77_value=$F77
-ac_cv_env_F77_set=${F77+set}
-ac_cv_env_F77_value=$F77
-ac_env_FFLAGS_set=${FFLAGS+set}
-ac_env_FFLAGS_value=$FFLAGS
-ac_cv_env_FFLAGS_set=${FFLAGS+set}
-ac_cv_env_FFLAGS_value=$FFLAGS
+       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.
@@ -973,9 +1797,6 @@ Configuration:
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
@@ -993,15 +1814,22 @@ 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]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --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]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --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/PACKAGE]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1032,233 +1860,271 @@ Optional Features:
   --disable-threads       build without multithread safety
   --disable-rpath         do not hardcode runtime library paths
   --disable-largefile     omit support for large files
-  --enable-shared[=PKGS]
-                          build shared libraries [default=yes]
-  --enable-static[=PKGS]
-                          build static libraries [default=yes]
+  --disable-installperms  do not modify ownership and permissions on installed
+                          files
+  --enable-manpage-build  Build the manpages from their XML source (shipped
+                          manpages are usually sufficient)
+  --disable-nls           do not use Native Language Support
+  --disable-s3-device     disable the S3 device
+  --enable-devpay         Use devpay authentication for Amazon S3 driver
+  --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-manpage-build  Build the manpages from their XML source (shipped
-                          manpages are usually sufficient)
+  --enable-static-binary  To build statically linked binaries
+  --disable-glibtest      do not try to compile and run a test GLIB program
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-cflags=CFLAGS   arguments to the c compiler (-Wall, -g, etc)
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
   --without-libpth-prefix     don't search for libpth in includedir and libdir
-  --with-includes=DIR    site header files for readline, etc in DIR
-  --with-libraries=DIR   site library directories for readline, etc in DIR
-  --with-dumperdir=DIR   where we install the dumpers [EPREFIX/dumper]
-  --with-configdir=DIR   runtime config files in DIR [sysconfdir/amanda]
-  --with-indexdir        deprecated, use indexdir in amanda.conf
-  --with-dbdir           deprecated, use infofile in amanda.conf
-  --with-logdir          deprecated, use logfile in amanda.conf
+  --with-cflags=FLAGS     deprecated; use ./configure CFLAGS=...
+  --with-includes=INCLUDE-DIRS
+                          deprecated; use ./configure CPPFLAGS='-I.. -I..'
+  --with-libraries=LIBRARY-DIRS
+                          deprecated; use ./configure LDFLAGS='-L.. -L..' (add
+                          -R on Solaris, NetBSD)
+  --with-user=USER        force execution to USER on client systems (REQUIRED)
+  --with-group=GROUP      group allowed to execute setuid-root programs
+                          (REQUIRED)
+  --with-dumperdir=DIR    where we install the dumpers (default:
+                          exec_prefix/dumper)
+  --with-configdir=DIR    runtime config files in DIR [sysconfdir/amanda]
+  --with-indexdir         deprecated: use indexdir in amanda.conf
+  --with-dbdir            deprecated: use infofile in amanda.conf
+  --with-logdir           deprecated: use logfile in amanda.conf
   --with-suffixes        install binaries with version string appended to name
-  --with-client-only     deprecated, use --without-server
-  --with-server-only     deprecated, use --without-client
-  --without-client       do not build client stuff
-  --without-server       do not build server stuff (set --without-restore)
-  --without-restore      do not build amrestore nor amidxtaped
-  --without-amrecover    do not build amrecover
-  --with-index-server=HOST default amanda index server [`uname -n`]
-  --without-force-uid    do not force the uid to --with-user
-  --with-user=USER       force execution to USER on client systems [required]
-  --with-group=GROUP     group allowed to execute setuid-root programs [required]
-  --with-owner=USER       force ownership of files to USER [default == --with-user value]
-  --with-rundump         use rundump (setuid-root) to invoke dump
-  --with-config=CONFIG   default configuration [DailySet1]
-  --with-tape-server=HOST default restoring tape server is HOST [same as --with-index-server]
-  --with-tape-device=ARG restoring tape server HOST's no rewinding tape drive
-  --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d
-  --with-rew-tape        deprecated, use --with-tape-device
-  --with-norew-tape=ARG  deprecated, use --with-tape-device
-  --with-changer-device=ARG default tape changer device [/dev/ch0 if it exists]
-  --with-fqdn            use FQDN's to backup multiple networks
-  --with-broken-fsf      only enable if tape fsf calls fail mid-file
-  --without-reuseaddr    Don't closed network connections to be reused until full timeout period.
-  --with-gnutar[=PROG]      use PROG as GNU tar executable [default: looks for one]
-  --with-smbclient[=PROG]   use PROG as Samba's smbclient executable [default: looks for one]
-  --with-samba-user was deprecated
-  --with-gnutar-listdir=DIR  gnutar directory lists go in DIR [localstatedir/amanda/gnutar-lists]
-  --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir
-  --without-bsd-security do not use BSD rsh/rlogin style security
-  --without-amandahosts  use .rhosts instead of .amandahosts
-  --with-dbmalloc=DIR  Location of dbmalloc libs and headers
-  --with-ipv6             If IPv6 must be enabled (Default)
-  --without-ipv6          If IPv6 must be disable
-  --with-krb4-security=DIR   Location of Kerberos software [/usr/kerberos /usr/cygnus /usr /opt/kerberos]
-  --with-rsh-security use rsh as a transport
-  --with-ssh-security use ssh as a transport
-  --with-ssh-options=[OPTIONS]
-                          Use these ssh options for ssh security; the default
-                          should work
-  --with-bsdtcp-security use tcp as a transport
-  --with-bsdudp-security use udp as a transport
-    --with-server-principal=ARG    server host principal  ["amanda"]
-    --with-server-instance=ARG     server host instance   ["amanda"]
-    --with-server-keyfile=ARG      server host key file   ["/.amanda"]
-    --with-client-principal=ARG    client host principal  ["rcmd"]
-    --with-client-instance=ARG     client host instance   [HOSTNAME_INSTANCE]
-    --with-client-keyfile=ARG      client host key file   [KEYFILE]
-    --with-ticket-lifetime=ARG     ticket lifetime        [128]
-  --with-krb5-security=DIR   Location of Kerberos V software [/usr/kerberos /usr/cygnus /usr /opt/kerberos]
-  --with-low-tcpportrange=low,high     bind reserved TCP server sockets to ports within this range unlimited (mainly for amrecover)
-  --with-tcpportrange=low,high  bind unreserved TCP server sockets to ports within this range [unlimited]
-  --with-udpportrange=low,high  bind reserved UDP server sockets to ports within this range [unlimited]
-  --with-maxtapeblocksize=kb            Maximum size of a tape block
-  --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [text]
-  --with-mmap            force use of mmap instead of shared memory support
-  --with-buffered-dump   buffer the dumping sockets on the server for speed
-  --with-assertions      compile assertions into code
-  --with-tmpdir=/temp/dir area Amanda can use for temp files [/tmp/amanda]
-  --with[out]-debugging[=/debug/dir] [do not] record runtime debugging information in specified directory [--with-tmpdir]
-  --with-debug-days=NN    number of days to keep debugging files [default=4]
-  --with-testing[=suffix] use alternate service names
+  --with-gnutar-listdir=DIR
+                          put gnutar directory lists in DIR (default:
+                          localstatedir/amanda/gnutar-lists)
+  --with-gnutar-listed-incremental
+                          deprecated; use --with-gnutar-listdir
+  --with-tmpdir           directory for temporary and debugging files
+                          (default: /tmp/amanda)
+  --without-force-uid     do not check userids when running programs
+  --with-owner=USER
+            force ownership of installed files to USER (default same as --with-user)
+
+  --with-fqdn             use FQDN's to backup multiple networks
+  --without-reuseaddr     Don't reuse network connections until full timeout
+                          period
+  --with-low-tcpportrange=low/high
+                          bind reserved TCP server sockets to ports within
+                          this range (default: unlimited)
+  --with-tcpportrange=low/high
+                          bind unreserved TCP server sockets to ports within
+                          this range (default: unlimited)
+  --with-udpportrange=low/high
+                          bind reserved UDP server sockets to ports within
+                          this range (default: unlimited)
+  --with-buffered-dump    buffer the dumping sockets on the server for speed
+  --with-maxtapeblocksize=kb
+                          Maximum size of a tape block (default: 32)
+  --with-assertions       compile assertions into code
+  --with-debugging=DIR
+            put debug logs in DIR (default same as --with-tmpdir)
+
+  --with-debug-days=NN    number of days to keep debugging files (default: 4)
+  --with-testing[=SUFFIX] use alternate service names with suffix (default
+                          'test')
+  --with-single-userid
+            force amanda to run as a single userid (for testing)
+
+  --without-server        do not build server stuff (set --without-restore)
+  --without-client        do not build client stuff
+  --without-restore       do not build amrestore nor amidxtaped
+  --without-amrecover     do not build amrecover
+  --with-client-only      deprecated: use --without-server
+  --with-server-only      deprecated: use --without-client
   --with-gnuplot=PATH     use gnuplot executable at PATH in amplot
-  --with-dump-honor-nodump  if dump supports -h, use it for level0s too
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-pic              try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-tags[=TAGS]
-                          include additional configurations [automatic]
   --with-xsltproc[=PATH]
                           Use the xsltproc binary in in PATH.
     --with-xsltproc-flags=FLAGS
                           Flags to pass to xsltproc (default --nonet)
+  --with-index-server=HOST
+                          default amanda index server (default: `uname -n`)
+  --with-config=CONFIG    default amanda configuration (default: DailySet1)
+  --with-tape-server=HOST default tape server for restore (default: same as
+                          index-server)
+  --with-tape-device=DEVICE
+                          default device on restore tape server
+  --with-changer-device=DEV
+                          default tape changer device (default: /dev/ch0)
+  --with-amandates        default location for 'amandates' (default:
+                          $localstatedir/amanda/amandates)
+  --with-perlextlibs=libs extra LIBS for Perl extensions
+  --with-ipv6             enable IPv6 support (default if IPv6 is found)
+         --without-ipv6          disable IPv6
+  --with-mmap             force use of mmap instead of shared memory support
+  --with-amlibdir[=PATH]
+                          Where library are installed, default: $libdir/amanda
+         --without-amlibdir      Library are installed in $libdir
+  --with-amlibexecdir[=PATH]
+                          Where amanda own programs are installed, default:
+                          $libexecdir/amanda
+         --without-amlibexecdir  Amanda own programs are installed in $libexecdir
+  --with-amperldir[=PATH]
+                          Where amanda's perl modules are installed; default:
+                          installsitelib
+         --without-amperldir     Install amanda's perl modules in $amlibdir/perl
+  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
+  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
+  --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-libcurl=DIR      look for the curl library in DIR
+  --without-bsd-security  do not include BSD authentication
+   --without-amandahosts  use ".rhosts" instead of ".amandahosts"
+  --with-bsdtcp-security  include BSDTCP authentication
+  --with-bsdudp-security  include BSDUDP authentication
+  --with-rsh-security     include RSH authentication
+  --with-ssh-security     include SSH authentication
+   --with-ssh-options=[OPTIONS]
+                          Use these ssh options for ssh security; the default
+                          should work
+  --with-krb4-security=DIR
+                          Location of Kerberos software [/usr/kerberos
+                          /usr/cygnus /usr /opt/kerberos]
+   --with-server-principal=ARG
+                          server host principal ("amanda")
+   --with-server-instance=ARG
+                          server host instance ("amanda")
+   --with-server-keyfile=ARG
+                          server host key file ("/.amanda")
+   --with-client-principal=ARG
+                          client host principle ("rcmd")
+   --with-client-instance=ARG
+                          client host instance (HOSTNAME_INSTANCE)
+   --with-client-keyfile=ARG
+                          client host key file (KEYFILE)
+   --ticket-lifetime      ticket lifetime (128)
+  --with-krb5-security=DIR
+                          Location of Kerberos V software [/usr/kerberos
+                          /usr/cygnus /usr /opt/kerberos]
+  --with-dump-honor-nodump
+                          if dump supports -h, use it for level0s too
+  --with-gnutar=PROG      use PROG as GNU 'tar'
+  --with-smbclient=PROG   use PROG as 'smbclient'
+  --with-samba-user       deprecated; place username in 'amandapass'
+  --with-rundump          use rundump, a setuid-root wrapper, to invoke dump
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]      include additional configurations [automatic]
+  --with-readline         require readline support (for amrecover)
+  --without-readline      don't search for readline
 
 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>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  GNUPLOT     Location of the 'gnuplot' binary
+  SWIG        Path to the 'swig' binary (developers only)
+  PERL        Path to the 'perl' binary
+  GNUTAR      Location of the GNU 'tar' binary
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              the first program found out of: `bison -y', `byacc', `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
   F77         Fortran 77 compiler command
   FFLAGS      Fortran 77 compiler flags
+  PKG_CONFIG  path to pkg-config utility
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`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
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    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 ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
+    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
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style 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
-    elif test -f $ac_srcdir/configure.ac ||
-          test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+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
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.61
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+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 $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1277,7 +2143,7 @@ uname -v = `(uname -v) 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`
-hostinfo               = `(hostinfo) 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`
@@ -1291,6 +2157,7 @@ do
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1312,7 +2179,6 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1323,7 +2189,7 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1345,9 +2211,7 @@ do
          -* ) ac_must_keep_next=true ;;
        esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1358,8 +2222,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
 # 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: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# 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.
   {
@@ -1372,20 +2236,34 @@ trap 'exit_status=$?
 _ASBOX
     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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    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"
-      ;;
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1396,22 +2274,28 @@ _ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-       eval ac_val=$`echo $ac_var`
-       echo "$ac_var='"'"'$ac_val'"'"'"
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1423,26 +2307,24 @@ _ASBOX
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1473,14 +2355,17 @@ _ACEOF
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1496,8 +2381,8 @@ if test -r "$cache_file"; then
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1506,15 +2391,33 @@ echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
+gl_header_list="$gl_header_list arpa/inet.h"
+gl_header_list="$gl_header_list float.h"
+gl_header_list="$gl_header_list sys/param.h"
+gl_header_list="$gl_header_list sys/vfs.h"
+gl_header_list="$gl_header_list sys/fs_types.h"
+gl_header_list="$gl_header_list sys/socket.h"
+gl_header_list="$gl_header_list netdb.h"
+gl_header_list="$gl_header_list netinet/in.h"
+gl_header_list="$gl_header_list sys/time.h"
+gl_func_list="$gl_func_list gettimeofday"
+gl_header_list="$gl_header_list stdint.h"
+gl_header_list="$gl_header_list wchar.h"
+gl_header_list="$gl_header_list stdio.h"
+gl_header_list="$gl_header_list stdlib.h"
+gl_header_list="$gl_header_list string.h"
+gl_func_list="$gl_func_list lstat"
+gl_header_list="$gl_header_list sys/stat.h"
+gl_header_list="$gl_header_list unistd.h"
+gl_func_list="$gl_func_list vasnprintf"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+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"
+  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,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1539,8 +2442,7 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1557,18 +2459,7 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
    { (exit 1); exit 1; }; }
 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
-
 
-gl_header_list="$gl_header_list arpa/inet.h"
-gl_header_list="$gl_header_list sys/socket.h"
-gl_header_list="$gl_header_list netinet/in.h"
-gl_header_list="$gl_header_list netdb.h"
-gl_header_list="$gl_header_list string.h"
 
 
 
@@ -1584,108 +2475,163 @@ gl_header_list="$gl_header_list string.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
 
 
 
 ac_aux_dir=
-for ac_dir in config $srcdir/config; do
-  if test -f $ac_dir/install-sh; then
+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
+  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
+  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
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# 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.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  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 &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+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
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  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` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
+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
+
+
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
 if test "${ac_cv_target+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+  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` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+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.
@@ -1695,19 +2641,11 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-
-CONFIGURE_COMMAND="'$0'"
-for arg in "$@"; do
-  CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
-done
-
-cat >>confdefs.h <<_ACEOF
-#define CONFIGURE_COMMAND "$CONFIGURE_COMMAND"
-_ACEOF
+PACKAGE=amanda
 
 
+am__api_version='1.10'
 
-am__api_version="1.9"
 # 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:
@@ -1721,8 +2659,8 @@ am__api_version="1.9"
 # 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.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1744,7 +2682,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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.
@@ -1763,21 +2701,22 @@ case $as_dir/ in
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 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.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # 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 path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -1787,8 +2726,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
@@ -1830,20 +2769,20 @@ echo "$as_me: error: newly created file is older than distributed files!
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  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"
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
 # Double any \ or $.  echo might interpret backslashes.
 # By default was `s,x,x', remove it if useless.
 cat <<\_ACEOF >conftest.sed
 s/[\\$]/&&/g;s/;s,x,x,$//
 _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
 
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -1858,45 +2797,60 @@ else
 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # We used to keeping the `.' as first argument, in order to
-  # allow $(mkdir_p) to be used without argument.  As in
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.  However this is wrong
-  # for two reasons:
-  #  1. if the package is installed by a user who cannot write `.'
-  #     make install will fail,
-  #  2. the above comment should most certainly read
-  #     $(mkdir_p) $(DESTDIR)$(somedir)
-  #     so it does not work when $(somedir) is undefined and
-  #     $(DESTDIR) is not.
-  #  To support the latter case, we have to write
-  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
-  #  so the `.' trick is pointless.
-  mkdir_p='mkdir -p --'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
   else
-    mkdir_p='$(install_sh) -d'
+    # 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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
   fi
 fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
 
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1909,54 +2863,57 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$AWK" && break
 done
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-       @echo 'ac_maketemp="$(MAKE)"'
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+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 \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -1969,12 +2926,16 @@ else
 fi
 rmdir .tst 2>/dev/null
 
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
-   test -f $srcdir/config.status; then
-  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+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
+    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
    { (exit 1); exit 1; }; }
+  fi
 fi
 
 # test whether we have cygpath
@@ -1989,7 +2950,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=amanda
- VERSION=2.5.2p1
+ VERSION="2.6.0"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2017,7 +2978,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
 
 # Installed binaries are usually stripped using `strip' when the user
 # run `make install-strip'.  However `strip' might not be the right
@@ -2027,8 +2988,8 @@ 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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2041,32 +3002,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2079,33 +3042,47 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  STRIP=$ac_ct_STRIP
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
 else
   STRIP="$ac_cv_prog_STRIP"
 fi
 
 fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
@@ -2119,69 +3096,58 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
-          ac_config_headers="$ac_config_headers config/config.h"
+ac_config_headers="$ac_config_headers config/config.h"
 
 
 
-if test -f "$srcdir/SNAPSHOT"; then
-  cat < "$srcdir/SNAPSHOT"
 
-  snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT`
+#
+# Take care of some early Amanda-specific setup
+#
 
-  test -z "$snapdate" || VERSION="$VERSION-$snapdate"
-  SNAPSHOT_STAMP=SNAPSHOT
-else
-  SNAPSHOT_STAMP=
-fi
+    # initialize warnings file
+    rm -f config.warnings
 
 
-if test -f config.local; then
-    echo "running local script ./config.local"
-    . ./config.local
-fi
+    if test -f "$srcdir/SNAPSHOT"; then
+      cat < "$srcdir/SNAPSHOT"
 
+      snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT`
 
-VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'`
-VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'`
-VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
-VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\"
+      test -z "$snapdate" || VERSION="$VERSION-$snapdate"
+      SNAPSHOT_STAMP=SNAPSHOT
+    else
+      SNAPSHOT_STAMP=
+    fi
 
 
-VERSION_SUFFIX="$VERSION"
 
 
+    VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'`
+    VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'`
+    VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+    VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\"
 
 
+    VERSION_SUFFIX="$VERSION"
 
 
-SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc"
-LOCPATH=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin"
-)`
-SYSLOCPATH="$SYSPATH:$LOCPATH"
-LOCSYSPATH="$LOCPATH:$SYSPATH"
 
 
 
-# Check whether --with-cflags or --without-cflags was given.
-if test "${with_cflags+set}" = set; then
-  withval="$with_cflags"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;}
-   { (exit 1); exit 1; }; }
-           ;;
-       esac
-       CFLAGS="$withval"
 
-fi;
+    if test -f config.local; then
+       echo "running local script ./config.local"
+       . ./config.local
+    fi
 
-CFLAGS="-D_GNU_SOURCE $CFLAGS"
 
+#
+# Set up compiler location, basic flags, and include locations
+# and library locations before we start checking the system
+# configuration in more detail...
+#
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2190,8 +3156,8 @@ 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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2204,32 +3170,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2242,36 +3210,51 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&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.
+          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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2284,74 +3267,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2365,7 +3308,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
@@ -2376,6 +3319,7 @@ do
   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.
@@ -2393,22 +3337,23 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2421,36 +3366,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2463,29 +3410,45 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
@@ -2498,21 +3461,35 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -2537,47 +3514,77 @@ ac_clean_files="$ac_clean_files a.out 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.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # 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 | *.o | *.obj )
-       ;;
-    conftest.$ac_ext )
-       # This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
        ;;
     [ab].out )
        # We found the default executable, but exeext='' is most
        # certainly right.
        break;;
     *.* )
-       ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-       # FIXME: I believe we export ac_cv_exeext for Libtool,
-       # but it would be cool to find out if it's true.  Does anybody
-       # maintain Libtool? --akim.
-       export ac_cv_exeext
+        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
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
@@ -2589,19 +3596,21 @@ See \`config.log' for more details." >&2;}
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -2620,22 +3629,27 @@ See \`config.log' for more details." >&2;}
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -2646,9 +3660,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 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 | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-         export ac_cv_exeext
          break;;
     * ) break;;
   esac
@@ -2662,14 +3675,14 @@ See \`config.log' for more details." >&2;}
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2689,14 +3702,20 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  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 ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -2714,12 +3733,12 @@ fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2742,50 +3761,49 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+       ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2801,38 +3819,118 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+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
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$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
@@ -2848,12 +3946,12 @@ else
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2887,12 +3985,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
 /* 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 -std1 is added to get
+   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 -std1.  */
+   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);};
@@ -2907,205 +4010,57 @@ return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3113,7 +4068,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 DEPDIR="${am__leading_dot}deps"
 
-          ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
 
 
 am_make=${MAKE-make}
@@ -3123,8 +4078,8 @@ am__doit:
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
 am__include="#"
 am__quote=
 _am_result=none
@@ -3151,22 +4106,20 @@ if test "$am__include" = "#"; then
 fi
 
 
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
 rm -f confinc confmf
 
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+# Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
+  enableval=$enable_dependency_tracking;
+fi
 
-fi;
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
 fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
+ if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
   AMDEP_FALSE='#'
 else
@@ -3176,11 +4129,10 @@ fi
 
 
 
-
 depcc="$CC"   am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3244,6 +4196,7 @@ else
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
@@ -3269,13 +4222,11 @@ else
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-
-
-if
+ if
   test "x$enable_dependency_tracking" != xno \
   && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
   am__fastdepCC_TRUE=
@@ -3289,8 +4240,8 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3303,32 +4254,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3341,27 +4294,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -3378,8 +4345,8 @@ 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
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3413,24 +4380,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3439,9 +4404,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3451,24 +4417,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3479,6 +4443,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3496,8 +4461,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3520,24 +4485,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3546,9 +4509,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3558,24 +4522,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3586,6 +4548,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3608,52 +4571,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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"
+    { test -f "$ac_path_GREP" && $as_test_x "$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
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    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
+    ac_count=`expr $ac_count + 1`
+    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
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
 
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+else
+  ac_cv_path_GREP=$GREP
+fi
 
-echo "$as_me:$LINENO: checking for AIX" >&5
-echo $ECHO_N "checking for AIX... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef _AIX
-  yes
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-cat >>confdefs.h <<\_ACEOF
-#define _ALL_SOURCE 1
-_ACEOF
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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"
+    { test -f "$ac_path_EGREP" && $as_test_x "$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
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    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
+    ac_count=`expr $ac_count + 1`
+    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
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  ac_cv_path_EGREP=$EGREP
 fi
-rm -f conftest*
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3677,35 +4758,31 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+       ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+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.
@@ -3761,6 +4838,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* 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))
@@ -3780,18 +4858,27 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3804,12 +4891,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -3832,9 +4921,9 @@ 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -3848,38 +4937,35 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+       eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -3890,18 +4976,19 @@ fi
 done
 
 
-if test "${ac_cv_header_minix_config_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for minix/config.h" >&5
-echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+
+  if test "${ac_cv_header_minix_config_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_minix_config_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking minix/config.h usability" >&5
-echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3912,41 +4999,37 @@ $ac_includes_default
 #include <minix/config.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking minix/config.h presence" >&5
-echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3955,24 +5038,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <minix/config.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -3980,9 +5061,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4006,25 +5088,18 @@ echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compi
 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for minix/config.h" >&5
-echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_minix_config_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_minix_config_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; }
 
 fi
 if test $ac_cv_header_minix_config_h = yes; then
@@ -4034,7 +5109,7 @@ else
 fi
 
 
-if test "$MINIX" = yes; then
+  if test "$MINIX" = yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define _POSIX_SOURCE 1
@@ -4050,20 +5125,12 @@ cat >>confdefs.h <<\_ACEOF
 #define _MINIX 1
 _ACEOF
 
-fi
-
-
-
-
-
-
-
-
+  fi
 
 
 
-  echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
-echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; }
 if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4085,41 +5152,45 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_safe_to_define___extensions__=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_safe_to_define___extensions__=no
+       ac_cv_safe_to_define___extensions__=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
-echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6
+echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; }
   test $ac_cv_safe_to_define___extensions__ = yes &&
     cat >>confdefs.h <<\_ACEOF
 #define __EXTENSIONS__ 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
+_ACEOF
+
+  cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
 _ACEOF
 
   cat >>confdefs.h <<\_ACEOF
@@ -4135,17 +5206,18 @@ _ACEOF
 
 
 
-       # Check whether --enable-threads or --disable-threads was given.
+
+    # Check whether --enable-threads was given.
 if test "${enable_threads+set}" = set; then
-  enableval="$enable_threads"
-  gl_use_threads=$enableval
+  enableval=$enable_threads; gl_use_threads=$enableval
 else
   case "$host_os" in
                             osf*) gl_use_threads=no ;;
        *)    gl_use_threads=yes ;;
      esac
 
-fi;
+fi
+
   if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
     # For using <pthread.h>:
     case "$host_os" in
@@ -4179,8 +5251,8 @@ fi;
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
 if test "${ac_cv_working_alloca_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4195,44 +5267,42 @@ int
 main ()
 {
 char *p = (char *) alloca (2 * sizeof (int));
+                         if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_working_alloca_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_working_alloca_h=no
+       ac_cv_working_alloca_h=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
 if test $ac_cv_working_alloca_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -4241,8 +5311,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
 if test "${ac_cv_func_alloca_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4259,7 +5329,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #  include <malloc.h>
 #  define alloca _alloca
 # else
-#  if HAVE_ALLOCA_H
+#  ifdef HAVE_ALLOCA_H
 #   include <alloca.h>
 #  else
 #   ifdef _AIX
@@ -4277,44 +5347,42 @@ int
 main ()
 {
 char *p = (char *) alloca (1);
+                                   if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_func_alloca_works=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_alloca_works=no
+       ac_cv_func_alloca_works=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
 
 if test $ac_cv_func_alloca_works = yes; then
 
@@ -4328,15 +5396,15 @@ else
 # contain a buggy version.  If you still want to use their alloca,
 # use ar to extract alloca.o from them instead of compiling alloca.c.
 
-ALLOCA=alloca.$ac_objext
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
 cat >>confdefs.h <<\_ACEOF
 #define C_ALLOCA 1
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
 if test "${ac_cv_os_cray+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4346,7 +5414,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if defined(CRAY) && ! defined(CRAY2)
+#if defined CRAY && ! defined CRAY2
 webecray
 #else
 wenotbecray
@@ -4362,14 +5430,14 @@ fi
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6; }
 if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4395,68 +5463,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -4469,8 +5529,8 @@ fi
   done
 fi
 
-echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
 if test "${ac_cv_c_stack_direction+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4483,6 +5543,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
 int
 find_stack_direction ()
 {
@@ -4500,17 +5561,26 @@ find_stack_direction ()
 int
 main ()
 {
-  exit (find_stack_direction () < 0);
+  return find_stack_direction () < 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4523,11 +5593,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_c_stack_direction=-1
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
@@ -4544,18 +5616,19 @@ fi
 for ac_header in $gl_header_list
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4566,41 +5639,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4609,24 +5678,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -4634,9 +5701,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4660,25 +5728,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4695,8 +5757,77 @@ done
 
 
 
-echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5
-echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6; }
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_inline=$ac_kw
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6; }
+
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5
+echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; }
 if test "${ac_cv_c_restrict+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4710,42 +5841,53 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-float * $ac_kw x;
+typedef int * int_ptr;
+        int foo (int_ptr $ac_kw ip) {
+        return ip[0];
+       }
+int
+main ()
+{
+int s[1];
+        int * $ac_kw t = s;
+        t[0] = 0;
+        return foo(t)
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_restrict=$ac_kw; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_restrict=$ac_kw
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
    done
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5
-echo "${ECHO_T}$ac_cv_c_restrict" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5
+echo "${ECHO_T}$ac_cv_c_restrict" >&6; }
  case $ac_cv_c_restrict in
    restrict) ;;
    no)
@@ -4761,38 +5903,239 @@ _ACEOF
 
 
 
+  { echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5
+echo $ECHO_N "checking whether the preprocessor supports include_next... $ECHO_C" >&6; }
+if test "${gl_cv_have_include_next+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  rm -rf conftestd1 conftestd2
+     mkdir conftestd1 conftestd2
+     cat <<EOF > conftestd1/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+     cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+     save_CPPFLAGS="$CPPFLAGS"
+     CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
+     cat >conftest.$ac_ext <<_ACEOF
+#include <conftest.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_have_include_next=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       gl_cv_have_include_next=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     CPPFLAGS="$save_CPPFLAGS"
+     rm -rf conftestd1 conftestd2
 
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5
+echo "${ECHO_T}$gl_cv_have_include_next" >&6; }
+  if test $gl_cv_have_include_next = yes; then
 
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INCLUDE_NEXT 1
+_ACEOF
 
-  :
 
+    INCLUDE_NEXT=include_next
+  else
+    INCLUDE_NEXT=include
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
+echo $ECHO_N "checking whether <sys/socket.h> is self-contained... $ECHO_C" >&6; }
+if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_sys_socket_h_selfcontained=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       gl_cv_header_sys_socket_h_selfcontained=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  if test $ac_cv_header_sys_socket_h = yes; then
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
     SYS_SOCKET_H=''
   else
+    SYS_SOCKET_H='sys/socket.h'
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <sys/socket.h>" >&5
+echo $ECHO_N "checking absolute name of <sys/socket.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_sys_socket_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_sys_socket_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
+
+_ACEOF
+                                   gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/sys/socket.h#{
+                s#.*"\(.*/sys/socket.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+         fi
+
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5
+echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; }
+     fi
+     NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
+
+
+
+    if test $ac_cv_header_sys_socket_h = yes; then
+      HAVE_SYS_SOCKET_H=1
+      HAVE_WINSOCK2_H=0
+      HAVE_WS2TCPIP_H=0
+    else
+      HAVE_SYS_SOCKET_H=0
 
 
 for ac_header in winsock2.h ws2tcpip.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4803,41 +6146,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4846,24 +6185,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -4871,9 +6208,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4897,25 +6235,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4927,7 +6259,20 @@ fi
 
 done
 
-    SYS_SOCKET_H='sys/socket.h'
+      if test $ac_cv_header_winsock2_h = yes; then
+        HAVE_WINSOCK2_H=1
+      else
+        HAVE_WINSOCK2_H=0
+      fi
+      if test $ac_cv_header_ws2tcpip_h = yes; then
+        HAVE_WS2TCPIP_H=1
+      else
+        HAVE_WS2TCPIP_H=0
+      fi
+    fi
+
+
+
   fi
 
 
@@ -4940,6 +6285,12 @@ done
 
 
 
+
+
+
+
+
+
   :
 
 
@@ -4947,8 +6298,8 @@ done
 
 
 
-  echo "$as_me:$LINENO: checking for IPv4 sockets" >&5
-echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for IPv4 sockets" >&5
+echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6; }
   if test "${gl_cv_socket_ipv4+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4978,39 +6329,35 @@ int x = AF_INET; struct in_addr y; struct sockaddr_in z;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   gl_cv_socket_ipv4=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gl_cv_socket_ipv4=no
+       gl_cv_socket_ipv4=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5
-echo "${ECHO_T}$gl_cv_socket_ipv4" >&6
+  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5
+echo "${ECHO_T}$gl_cv_socket_ipv4" >&6; }
   if test $gl_cv_socket_ipv4 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5019,8 +6366,8 @@ _ACEOF
 
   fi
 
-  echo "$as_me:$LINENO: checking for IPv6 sockets" >&5
-echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for IPv6 sockets" >&5
+echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6; }
   if test "${gl_cv_socket_ipv6+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5050,39 +6397,35 @@ int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   gl_cv_socket_ipv6=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gl_cv_socket_ipv6=no
+       gl_cv_socket_ipv6=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5
-echo "${ECHO_T}$gl_cv_socket_ipv6" >&6
+  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5
+echo "${ECHO_T}$gl_cv_socket_ipv6" >&6; }
   if test $gl_cv_socket_ipv6 = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5091,77 +6434,240 @@ _ACEOF
 
   fi
 
-echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6
-if test "${ac_cv_c_inline+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_time_h='<'sys/time.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <sys/time.h>" >&5
+echo $ECHO_N "checking absolute name of <sys/time.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_sys_time_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_sys_time_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+
+_ACEOF
+                                   gl_cv_next_sys_time_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/sys/time.h#{
+                s#.*"\(.*/sys/time.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_sys_time_h='<'sys/time.h'>'
+         fi
+
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5
+echo "${ECHO_T}$gl_cv_next_sys_time_h" >&6; }
+     fi
+     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
+
+
+
+
+  if test $ac_cv_header_sys_time_h = yes; then
+    HAVE_SYS_TIME_H=1
+  else
+    HAVE_SYS_TIME_H=0
+  fi
+
+
+  { echo "$as_me:$LINENO: checking for struct timeval" >&5
+echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; }
+if test "${gl_cv_sys_struct_timeval+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
+#if HAVE_SYS_TIME_H
+            #include <sys/time.h>
+           #endif
+           #include <time.h>
 
+int
+main ()
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_inline=$ac_kw; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_sys_struct_timeval=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       gl_cv_sys_struct_timeval=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
+{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5
+echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; }
+  if test $gl_cv_sys_struct_timeval = yes; then
+    HAVE_STRUCT_TIMEVAL=1
+  else
+    HAVE_STRUCT_TIMEVAL=0
+  fi
 
 
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
+    REPLACE_GETTIMEOFDAY=0
+
+  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
+    SYS_TIME_H=sys/time.h
+  else
+    SYS_TIME_H=
+  fi
+
+
+
+
+
+
+
+
+
+
+for ac_func in $gl_func_list
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
 _ACEOF
-    ;;
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
 
 
 
@@ -5185,13 +6691,13 @@ esac
   prefix="$acl_save_prefix"
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
+# 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
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
-fi;
+fi
+
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
@@ -5208,8 +6714,8 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
-echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -5238,11 +6744,11 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
 fi
 if test "${acl_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5272,17 +6778,17 @@ fi
 
 LD="$acl_cv_path_LD"
 if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
 if test "${acl_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5294,15 +6800,15 @@ case `$LD -v 2>&1 </dev/null` in
   acl_cv_prog_gnu_ld=no ;;
 esac
 fi
-echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6
+echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$acl_cv_prog_gnu_ld
 
 
 
 
-                                                echo "$as_me:$LINENO: checking for shared library run path origin" >&5
-echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6
+                                                echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; }
 if test "${acl_cv_rpath+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5314,24 +6820,22 @@ else
     acl_cv_rpath=done
 
 fi
-echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
-echo "${ECHO_T}$acl_cv_rpath" >&6
+echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+echo "${ECHO_T}$acl_cv_rpath" >&6; }
   wl="$acl_cv_wl"
-  acl_libext="$acl_cv_libext"
-  acl_shlibext="$acl_cv_shlibext"
-  acl_libname_spec="$acl_cv_libname_spec"
-  acl_library_names_spec="$acl_cv_library_names_spec"
-  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  acl_hardcode_direct="$acl_cv_hardcode_direct"
-  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
-    # Check whether --enable-rpath or --disable-rpath was given.
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+    # Check whether --enable-rpath was given.
 if test "${enable_rpath+set}" = set; then
-  enableval="$enable_rpath"
-  :
+  enableval=$enable_rpath; :
 else
   enable_rpath=yes
-fi;
+fi
+
 
 
                   acl_libdirstem=lib
@@ -5360,8 +6864,8 @@ fi;
   LIBMULTITHREAD=
   LTLIBMULTITHREAD=
   if test "$gl_use_threads" != no; then
-        echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5
-echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6
+        echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5
+echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6; }
     gl_have_weak=no
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5380,52 +6884,50 @@ xyzzy();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   gl_have_weak=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-    echo "$as_me:$LINENO: result: $gl_have_weak" >&5
-echo "${ECHO_T}$gl_have_weak" >&6
+    echo "$as_me:$LINENO: result: $gl_have_weak" >&5
+echo "${ECHO_T}$gl_have_weak" >&6; }
     if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
       # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
       # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
       if test "${ac_cv_header_pthread_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for pthread.h" >&5
-echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_pthread_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking pthread.h usability" >&5
-echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking pthread.h usability" >&5
+echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5436,41 +6938,37 @@ $ac_includes_default
 #include <pthread.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking pthread.h presence" >&5
-echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking pthread.h presence" >&5
+echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5479,24 +6977,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <pthread.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -5504,9 +7000,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -5530,25 +7027,18 @@ echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"
 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for pthread.h" >&5
-echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_pthread_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_pthread_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
-echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
 
 fi
 if test $ac_cv_header_pthread_h = yes; then
@@ -5583,42 +7073,40 @@ pthread_mutex_lock((pthread_mutex_t*)0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   gl_have_pthread=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
         # Test for libpthread by looking for pthread_kill. (Not pthread_self,
         # since it is defined as a macro on OSF/1.)
         if test -n "$gl_have_pthread"; then
           # The program links fine without libpthread. But it may actually
           # need to link with libpthread in order to create multiple threads.
-          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
-echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6
+          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; }
 if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5631,56 +7119,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char pthread_kill ();
 int
 main ()
 {
-pthread_kill ();
+return pthread_kill ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_pthread_pthread_kill=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_pthread_kill=no
+       ac_cv_lib_pthread_pthread_kill=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; }
 if test $ac_cv_lib_pthread_pthread_kill = yes; then
   LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
              # On Solaris and HP-UX, most pthread functions exist also in libc.
@@ -5700,8 +7185,8 @@ fi
 
         else
           # Some library is needed. Try libpthread and libc_r.
-          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
-echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6
+          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; }
 if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5714,56 +7199,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char pthread_kill ();
 int
 main ()
 {
-pthread_kill ();
+return pthread_kill ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_pthread_pthread_kill=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_pthread_kill=no
+       ac_cv_lib_pthread_pthread_kill=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; }
 if test $ac_cv_lib_pthread_pthread_kill = yes; then
   gl_have_pthread=yes
              LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
@@ -5772,8 +7254,8 @@ fi
 
           if test -z "$gl_have_pthread"; then
             # For FreeBSD 4.
-            echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5
-echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5
+echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6; }
 if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5786,56 +7268,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char pthread_kill ();
 int
 main ()
 {
-pthread_kill ();
+return pthread_kill ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   ac_cv_lib_c_r_pthread_kill=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_c_r_pthread_kill=no
+       ac_cv_lib_c_r_pthread_kill=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5
-echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6; }
 if test $ac_cv_lib_c_r_pthread_kill = yes; then
   gl_have_pthread=yes
                LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
@@ -5864,8 +7343,8 @@ _ACEOF
           fi
           # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
           # pthread_rwlock_* functions.
-          echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
-echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6
+          echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
+echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5877,50 +7356,47 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <pthread.h>
 
+typedef pthread_rwlock_t ac__type_new_;
 int
 main ()
 {
-if ((pthread_rwlock_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (pthread_rwlock_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_pthread_rwlock_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_pthread_rwlock_t=no
+       ac_cv_type_pthread_rwlock_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5
-echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5
+echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6; }
 if test $ac_cv_type_pthread_rwlock_t = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5951,27 +7427,22 @@ return !x;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_PTHREAD_MUTEX_RECURSIVE 1
@@ -5981,8 +7452,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
         fi
       fi
     fi
@@ -6008,34 +7481,32 @@ thr_self();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   gl_have_solaristhread=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
         LIBS="$gl_save_LIBS"
         if test -n "$gl_have_solaristhread"; then
@@ -6068,8 +7539,8 @@ _ACEOF
 
 
 
-  echo "$as_me:$LINENO: checking how to link with libpth" >&5
-echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking how to link with libpth" >&5
+echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6; }
 if test "${ac_cv_libpth_libs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6077,7 +7548,6 @@ else
 
 
 
-
     use_additional=yes
 
   acl_save_prefix="$prefix"
@@ -6092,10 +7562,9 @@ else
   prefix="$acl_save_prefix"
 
 
-# Check whether --with-libpth-prefix or --without-libpth-prefix was given.
+# Check whether --with-libpth-prefix was given.
 if test "${with_libpth_prefix+set}" = set; then
-  withval="$with_libpth_prefix"
-
+  withval=$with_libpth_prefix;
     if test "X$withval" = "Xno"; then
       use_additional=no
     else
@@ -6118,11 +7587,11 @@ if test "${with_libpth_prefix+set}" = set; then
       fi
     fi
 
-fi;
+fi
+
       LIBPTH=
   LTLIBPTH=
   INCPTH=
-  LIBPTH_PREFIX=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -6156,50 +7625,20 @@ fi;
           found_la=
           found_so=
           found_a=
-          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-          if test -n "$acl_shlibext"; then
-            shrext=".$acl_shlibext"             # typically: shrext=.so
-          else
-            shrext=
-          fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
-                  fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
-                      found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
-                    fi
-                  done
-                fi
-              fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
               fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
               fi
             fi
           fi
@@ -6217,42 +7656,19 @@ fi;
               case "$x" in
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
-                                    if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
-                      found_dir="$dir"
-                      found_so="$dir/$libname$shrext"
-                    else
-                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                        ver=`(cd "$dir" && \
-                              for f in "$libname$shrext".*; do echo "$f"; done \
-                              | sed -e "s,^$libname$shrext\\\\.,," \
-                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                              | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                          found_dir="$dir"
-                          found_so="$dir/$libname$shrext.$ver"
-                        fi
-                      else
-                        eval library_names=\"$acl_library_names_spec\"
-                        for f in $library_names; do
-                          if test -f "$dir/$f"; then
-                            found_dir="$dir"
-                            found_so="$dir/$f"
-                            break
-                          fi
-                        done
-                      fi
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
                     fi
-                  fi
-                                    if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
                       found_dir="$dir"
-                      found_a="$dir/$libname.$acl_libext"
-                    fi
-                  fi
-                  if test "X$found_dir" != "X"; then
-                    if test -f "$dir/$libname.la"; then
-                      found_la="$dir/$libname.la"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
                     fi
                   fi
                   ;;
@@ -6278,10 +7694,10 @@ fi;
                 if test -z "$haveit"; then
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
-                                if test "$acl_hardcode_direct" = yes; then
+                                if test "$hardcode_direct" = yes; then
                                                       LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
                 else
-                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
                                                             LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
                                                             haveit=
                     for x in $rpathdirs; do
@@ -6313,7 +7729,7 @@ fi;
                     if test -z "$haveit"; then
                       LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir"
                     fi
-                    if test "$acl_hardcode_minus_L" != no; then
+                    if test "$hardcode_minus_L" != no; then
                                                                                         LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
                     else
                                                                                                                                                                                 LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
@@ -6332,7 +7748,6 @@ fi;
             case "$found_dir" in
               */$acl_libdirstem | */$acl_libdirstem/)
                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                LIBPTH_PREFIX="$basedir"
                 additional_includedir="$basedir/include"
                 ;;
             esac
@@ -6483,21 +7898,21 @@ fi;
     done
   done
   if test "X$rpathdirs" != "X"; then
-    if test -n "$acl_hardcode_libdir_separator"; then
+    if test -n "$hardcode_libdir_separator"; then
                         alldirs=
       for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
       done
             acl_save_libdir="$libdir"
       libdir="$alldirs"
-      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      eval flag=\"$hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
       LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
     else
             for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
-        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        eval flag=\"$hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
         LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
       done
@@ -6512,15 +7927,13 @@ fi;
     ac_cv_libpth_libs="$LIBPTH"
     ac_cv_libpth_ltlibs="$LTLIBPTH"
     ac_cv_libpth_cppflags="$INCPTH"
-    ac_cv_libpth_prefix="$LIBPTH_PREFIX"
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5
-echo "${ECHO_T}$ac_cv_libpth_libs" >&6
+echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5
+echo "${ECHO_T}$ac_cv_libpth_libs" >&6; }
   LIBPTH="$ac_cv_libpth_libs"
   LTLIBPTH="$ac_cv_libpth_ltlibs"
   INCPTH="$ac_cv_libpth_cppflags"
-  LIBPTH_PREFIX="$ac_cv_libpth_prefix"
 
   for element in $INCPTH; do
     haveit=
@@ -6546,7 +7959,6 @@ echo "${ECHO_T}$ac_cv_libpth_libs" >&6
 
 
 
-
       HAVE_LIBPTH=yes
 
 
@@ -6570,34 +7982,32 @@ pth_self();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   gl_have_pth=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
       LIBS="$gl_save_LIBS"
       if test -n "$gl_have_pth"; then
@@ -6643,18 +8053,250 @@ _ACEOF
       fi
     fi
   fi
-  echo "$as_me:$LINENO: checking for multithread API to use" >&5
-echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6
-  echo "$as_me:$LINENO: result: $gl_threads_api" >&5
-echo "${ECHO_T}$gl_threads_api" >&6
+  { echo "$as_me:$LINENO: checking for multithread API to use" >&5
+echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: result: $gl_threads_api" >&5
+echo "${ECHO_T}$gl_threads_api" >&6; }
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5
+echo $ECHO_N "checking whether malloc, realloc, calloc are POSIX compliant... $ECHO_C" >&6; }
+if test "${gl_cv_func_malloc_posix+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+                        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+         choke me
+         #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_malloc_posix=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_func_malloc_posix=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5
+echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; }
+
+
+  GNULIB_MALLOC_POSIX=0;
+  GNULIB_REALLOC_POSIX=0;
+  GNULIB_CALLOC_POSIX=0;
+  GNULIB_GETSUBOPT=0;
+  GNULIB_MKDTEMP=0;
+  GNULIB_MKSTEMP=0;
+    HAVE_CALLOC_POSIX=1;
+  HAVE_GETSUBOPT=1;
+  HAVE_MALLOC_POSIX=1;
+  HAVE_MKDTEMP=1;
+  HAVE_REALLOC_POSIX=1;
+  REPLACE_MKSTEMP=0;
+
+{ echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5
+echo $ECHO_N "checking for external symbol _system_configuration... $ECHO_C" >&6; }
+if test "${gl_cv_var__system_configuration+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/systemcfg.h>
+
+int
+main ()
+{
+double x = _system_configuration.physmem;
+                      if (x > 0.0) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gl_cv_var__system_configuration=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_var__system_configuration=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_var__system_configuration" >&5
+echo "${ECHO_T}$gl_cv_var__system_configuration" >&6; }
+
+    if test $gl_cv_var__system_configuration = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE__SYSTEM_CONFIGURATION 1
+_ACEOF
+
+    fi
+
+
+
+  { echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
+if test "${gt_cv_ssize_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main ()
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+        return !x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_ssize_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       gt_cv_ssize_t=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5
+echo "${ECHO_T}$gt_cv_ssize_t" >&6; }
+  if test $gt_cv_ssize_t = no; then
 
+cat >>confdefs.h <<\_ACEOF
+#define ssize_t int
+_ACEOF
 
+  fi
 
 
-      echo "$as_me:$LINENO: checking whether snprintf is declared" >&5
-echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6
+  GNULIB_FPRINTF_POSIX=0;
+  GNULIB_PRINTF_POSIX=0;
+  GNULIB_SNPRINTF=0;
+  GNULIB_SPRINTF_POSIX=0;
+  GNULIB_VFPRINTF_POSIX=0;
+  GNULIB_VPRINTF_POSIX=0;
+  GNULIB_VSNPRINTF=0;
+  GNULIB_VSPRINTF_POSIX=0;
+  GNULIB_VASPRINTF=0;
+  GNULIB_FSEEK=0;
+  GNULIB_FSEEKO=0;
+  GNULIB_FTELL=0;
+  GNULIB_FTELLO=0;
+  GNULIB_FFLUSH=0;
+  GNULIB_GETDELIM=0;
+  GNULIB_GETLINE=0;
+    REPLACE_FPRINTF=0;
+  REPLACE_VFPRINTF=0;
+  REPLACE_PRINTF=0;
+  REPLACE_VPRINTF=0;
+  REPLACE_SNPRINTF=0;
+  HAVE_DECL_SNPRINTF=1;
+  REPLACE_VSNPRINTF=0;
+  HAVE_DECL_VSNPRINTF=1;
+  REPLACE_SPRINTF=0;
+  REPLACE_VSPRINTF=0;
+  HAVE_VASPRINTF=1;
+  REPLACE_VASPRINTF=0;
+  HAVE_FSEEKO=1;
+  REPLACE_FSEEKO=0;
+  REPLACE_FSEEK=0;
+  HAVE_FTELLO=1;
+  REPLACE_FTELLO=0;
+  REPLACE_FTELL=0;
+  REPLACE_FFLUSH=0;
+  HAVE_DECL_GETDELIM=1;
+  HAVE_DECL_GETLINE=1;
+  REPLACE_GETLINE=0;
+
+
+      { echo "$as_me:$LINENO: checking whether snprintf is declared" >&5
+echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_snprintf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6669,7 +8311,7 @@ int
 main ()
 {
 #ifndef snprintf
-  char *p = (char *) snprintf;
+  (void) snprintf;
 #endif
 
   ;
@@ -6677,38 +8319,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_snprintf=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_snprintf=no
+       ac_cv_have_decl_snprintf=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5
-echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5
+echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; }
 if test $ac_cv_have_decl_snprintf = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -6726,8 +8364,8 @@ fi
 
 
 
-echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
+echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdbool_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6814,40 +8452,36 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdbool_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdbool_h=no
+       ac_cv_header_stdbool_h=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
-   echo "$as_me:$LINENO: checking for _Bool" >&5
-echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; }
+   echo "$as_me:$LINENO: checking for _Bool" >&5
+echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; }
 if test "${ac_cv_type__Bool+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6858,50 +8492,47 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef _Bool ac__type_new_;
 int
 main ()
 {
-if ((_Bool *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (_Bool))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type__Bool=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type__Bool=no
+       ac_cv_type__Bool=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-echo "${ECHO_T}$ac_cv_type__Bool" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+echo "${ECHO_T}$ac_cv_type__Bool" >&6; }
 if test $ac_cv_type__Bool = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -6919,11 +8550,260 @@ _ACEOF
 
    fi
 
+  { echo "$as_me:$LINENO: checking for long long int" >&5
+echo $ECHO_N "checking for long long int... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+long long int ll = 9223372036854775807ll;
+           long long int nll = -9223372036854775807LL;
+           typedef int a[((-9223372036854775807LL < 0
+                           && 0 < 9223372036854775807ll)
+                          ? 1 : -1)];
+           int i = 63;
+int
+main ()
+{
+long long int llmax = 9223372036854775807ll;
+           return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+                   | (llmax / ll) | (llmax % ll));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+                       if test "$cross_compiling" = yes; then
+  ac_cv_type_long_long_int=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <limits.h>
+              #ifndef LLONG_MAX
+              # define HALF \
+                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+              # define LLONG_MAX (HALF - 1 + HALF)
+              #endif
+int
+main ()
+{
+long long int n = 1;
+              int i;
+              for (i = 0; ; i++)
+                {
+                  long long int m = n << i;
+                  if (m >> i != n)
+                    return 1;
+                  if (LLONG_MAX / 2 < m)
+                    break;
+                }
+              return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long_long_int=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_type_long_long_int=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_long_long_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
+echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; }
+  if test $ac_cv_type_long_long_int = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_LONG_INT 1
+_ACEOF
+
+  fi
+
+
+  { echo "$as_me:$LINENO: checking for unsigned long long int" >&5
+echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; }
+if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+unsigned long long int ull = 18446744073709551615ULL;
+           typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
+                          ? 1 : -1)];
+          int i = 63;
+int
+main ()
+{
+unsigned long long int ullmax = 18446744073709551615ull;
+           return (ull << 63 | ull >> 63 | ull << i | ull >> i
+                   | ullmax / ull | ullmax % ull);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_type_unsigned_long_long_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_unsigned_long_long_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; }
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+_ACEOF
+
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  GNULIB_MEMMEM=0;
+  GNULIB_MEMPCPY=0;
+  GNULIB_MEMRCHR=0;
+  GNULIB_STPCPY=0;
+  GNULIB_STPNCPY=0;
+  GNULIB_STRCHRNUL=0;
+  GNULIB_STRDUP=0;
+  GNULIB_STRNDUP=0;
+  GNULIB_STRNLEN=0;
+  GNULIB_STRPBRK=0;
+  GNULIB_STRSEP=0;
+  GNULIB_STRCASESTR=0;
+  GNULIB_STRTOK_R=0;
+  GNULIB_MBSLEN=0;
+  GNULIB_MBSNLEN=0;
+  GNULIB_MBSCHR=0;
+  GNULIB_MBSRCHR=0;
+  GNULIB_MBSSTR=0;
+  GNULIB_MBSCASECMP=0;
+  GNULIB_MBSNCASECMP=0;
+  GNULIB_MBSPCASECMP=0;
+  GNULIB_MBSCASESTR=0;
+  GNULIB_MBSCSPN=0;
+  GNULIB_MBSPBRK=0;
+  GNULIB_MBSSPN=0;
+  GNULIB_MBSSEP=0;
+  GNULIB_MBSTOK_R=0;
     HAVE_DECL_MEMMEM=1;
   HAVE_MEMPCPY=1;
   HAVE_DECL_MEMRCHR=1;
   HAVE_STPCPY=1;
   HAVE_STPNCPY=1;
+  HAVE_STRCASECMP=1;
   HAVE_DECL_STRNCASECMP=1;
   HAVE_STRCHRNUL=1;
   HAVE_DECL_STRDUP=1;
@@ -6932,14 +8812,12 @@ _ACEOF
   HAVE_DECL_STRNLEN=1;
   HAVE_STRPBRK=1;
   HAVE_STRSEP=1;
+  HAVE_STRCASESTR=1;
   HAVE_DECL_STRTOK_R=1;
-  REPLACE_STRCASECMP=0;
-  REPLACE_STRSTR=0;
-  REPLACE_STRCASESTR=0;
 
 
-      echo "$as_me:$LINENO: checking whether strdup is declared" >&5
-echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking whether strdup is declared" >&5
+echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_strdup+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6954,7 +8832,7 @@ int
 main ()
 {
 #ifndef strdup
-  char *p = (char *) strdup;
+  (void) strdup;
 #endif
 
   ;
@@ -6962,38 +8840,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_strdup=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_strdup=no
+       ac_cv_have_decl_strdup=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6; }
 if test $ac_cv_have_decl_strdup = yes; then
 
 cat >>confdefs.h <<_ACEOF
 
 
 
-    echo "$as_me:$LINENO: checking absolute name of <string.h>" >&5
-echo $ECHO_N "checking absolute name of <string.h>... $ECHO_C" >&6
-if test "${gl_cv_absolute_string_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+
+
 
   :
 
 
 
 
-    if test $ac_cv_header_string_h = yes; then
-      cat >conftest.$ac_ext <<_ACEOF
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_string_h='<'string.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <string.h>" >&5
+echo $ECHO_N "checking absolute name of <string.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_string_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_string_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <string.h>
+
+_ACEOF
+                                   gl_cv_next_string_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/string.h#{
+                s#.*"\(.*/string.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_string_h='<'string.h'>'
+         fi
+
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5
+echo "${ECHO_T}$gl_cv_next_string_h" >&6; }
+     fi
+     NEXT_STRING_H=$gl_cv_next_string_h
+
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
+echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; }
+if test "${ac_cv_header_stat_broken+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
+
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stat_broken=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stat_broken=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
+echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_MACROS_BROKEN 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
 _ACEOF
-      gl_cv_absolute_string_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-sed -n '\#/string.h#{s#.*"\(.*/string.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'`
+        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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_largefile_CC=' -n32'; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
     fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=no; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=64; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -f conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=no; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=1; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
 fi
-echo "$as_me:$LINENO: result: $gl_cv_absolute_string_h" >&5
-echo "${ECHO_T}$gl_cv_absolute_string_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
-#define ABSOLUTE_STRING_H "$gl_cv_absolute_string_h"
+#define _LARGE_FILES $ac_cv_sys_large_files
 _ACEOF
+;;
+esac
+rm -f conftest*
+  fi
+fi
+
+
+  GNULIB_CHOWN=0;
+  GNULIB_DUP2=0;
+  GNULIB_FCHDIR=0;
+  GNULIB_FTRUNCATE=0;
+  GNULIB_GETCWD=0;
+  GNULIB_GETLOGIN_R=0;
+  GNULIB_LCHOWN=0;
+  GNULIB_LSEEK=0;
+  GNULIB_READLINK=0;
+  GNULIB_SLEEP=0;
+    HAVE_DUP2=1;
+  HAVE_FTRUNCATE=1;
+  HAVE_READLINK=1;
+  HAVE_SLEEP=1;
+  HAVE_DECL_GETLOGIN_R=1;
+  REPLACE_CHOWN=0;
+  REPLACE_FCHDIR=0;
+  REPLACE_GETCWD=0;
+  REPLACE_LCHOWN=0;
+  REPLACE_LSEEK=0;
+
 
 
-  ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\"
 
 
 
 
-  echo "$as_me:$LINENO: checking for EOVERFLOW" >&5
-echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6
+
+
+  { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5
+echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; }
 if test "${ac_cv_decl_EOVERFLOW+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7132,27 +9479,22 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -7179,46 +9521,42 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7242,27 +9580,22 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
@@ -7289,50 +9622,48 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+       ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
@@ -7360,47 +9691,36 @@ test_array [0] = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
 case $ac_lo in
 ?*) ac_cv_decl_EOVERFLOW=$ac_lo;;
 '')  ;;
 esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -7415,8 +9735,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <stdio.h>
 #include <stdlib.h>
 
-long longval () { return EOVERFLOW; }
-unsigned long ulongval () { return EOVERFLOW; }
+static long int longval () { return EOVERFLOW; }
+static unsigned long int ulongval () { return EOVERFLOW; }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -7425,35 +9745,44 @@ main ()
 
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
-    exit (1);
+    return 1;
   if ((EOVERFLOW) < 0)
     {
-      long i = longval ();
+      long int i = longval ();
       if (i != (EOVERFLOW))
-       exit (1);
+       return 1;
       fprintf (f, "%ld\n", i);
     }
   else
     {
-      unsigned long i = ulongval ();
+      unsigned long int i = ulongval ();
       if (i != (EOVERFLOW))
-       exit (1);
+       return 1;
       fprintf (f, "%lu\n", i);
     }
-  exit (ferror (f) || fclose (f) != 0);
+  return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -7464,8 +9793,7 @@ echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
       else
@@ -7474,8 +9802,8 @@ rm -f conftest.val
     fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5
-echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6
+echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5
+echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6; }
   if test "$ac_cv_decl_EOVERFLOW" != yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7487,9 +9815,15 @@ _ACEOF
   fi
 
 
-  echo "$as_me:$LINENO: checking for long long int" >&5
-echo $ECHO_N "checking for long long int... $ECHO_C" >&6
-if test "${ac_cv_type_long_long_int+set}" = set; then
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking for wchar_t" >&5
+echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; }
+if test "${gt_cv_c_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7498,46 +9832,58 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-long long int ll = 9223372036854775807ll;
-           long long int nll = -9223372036854775807LL;
-           typedef int a[((-9223372036854775807LL < 0
-                           && 0 < 9223372036854775807ll)
-                          ? 1 : -1)];
-           int i = 63;
+#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';
 int
 main ()
 {
-long long int llmax = 9223372036854775807ll;
-           return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-                   | (llmax / ll) | (llmax % ll));
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-                       if test "$cross_compiling" = yes; then
-  ac_cv_type_long_long_int=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_c_wchar_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gt_cv_c_wchar_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5
+echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; }
+  if test $gt_cv_c_wchar_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+  fi
+
+
+  { echo "$as_me:$LINENO: checking for wint_t" >&5
+echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; }
+if test "${gt_cv_c_wint_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -7545,146 +9891,56 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <limits.h>
-              #ifndef LLONG_MAX
-              # define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              # define LLONG_MAX (HALF - 1 + HALF)
-              #endif
+#include <wchar.h>
+       wint_t foo = (wchar_t)'\0';
 int
 main ()
 {
-long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_long_long_int=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_c_wint_t=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_type_long_long_int=no
+       gt_cv_c_wint_t=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_long_long_int=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
-  if test $ac_cv_type_long_long_int = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LONG_LONG_INT 1
-_ACEOF
-
-  fi
-
-
-  echo "$as_me:$LINENO: checking for long double" >&5
-echo $ECHO_N "checking for long double... $ECHO_C" >&6
-if test "${gt_cv_c_long_double+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$GCC" = yes; then
-       gt_cv_c_long_double=yes
-     else
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-         long double foo = 0.0;
-         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gt_cv_c_long_double=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-gt_cv_c_long_double=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
-fi
-echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5
-echo "${ECHO_T}$gt_cv_c_long_double" >&6
-  if test $gt_cv_c_long_double = yes; then
+{ echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5
+echo "${ECHO_T}$gt_cv_c_wint_t" >&6; }
+  if test $gt_cv_c_wint_t = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_LONG_DOUBLE 1
+#define HAVE_WINT_T 1
 _ACEOF
 
   fi
 
-
-  echo "$as_me:$LINENO: checking for wchar_t" >&5
-echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6
-if test "${gt_cv_c_wchar_t+set}" = set; then
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7693,131 +9949,62 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';
+$ac_includes_default
+typedef size_t ac__type_new_;
 int
 main ()
 {
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gt_cv_c_wchar_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_c_wchar_t=no
+       ac_cv_type_size_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5
-echo "${ECHO_T}$gt_cv_c_wchar_t" >&6
-  if test $gt_cv_c_wchar_t = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WCHAR_T 1
-_ACEOF
 
-  fi
-
-
-  echo "$as_me:$LINENO: checking for wint_t" >&5
-echo $ECHO_N "checking for wint_t... $ECHO_C" >&6
-if test "${gt_cv_c_wint_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+  :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
-   <wchar.h>.
-   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
-   before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>
-       wint_t foo = (wchar_t)'\0';
-int
-main ()
-{
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gt_cv_c_wint_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_c_wint_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5
-echo "${ECHO_T}$gt_cv_c_wint_t" >&6
-  if test $gt_cv_c_wint_t = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WINT_T 1
-_ACEOF
 
-  fi
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
+  { echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; }
+if test "${gl_cv_header_inttypes_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7826,65 +10013,57 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/types.h>
+#include <inttypes.h>
 int
 main ()
 {
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
+uintmax_t i = (uintmax_t) -1;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_inttypes_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_size_t=no
+       gl_cv_header_inttypes_h=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
-else
+{ echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; }
+  if test $gl_cv_header_inttypes_h = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
 _ACEOF
 
-fi
+  fi
 
 
-  echo "$as_me:$LINENO: checking for inttypes.h" >&5
-echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
-if test "${gl_cv_header_inttypes_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for stdint.h" >&5
+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; }
+if test "${gl_cv_header_stdint_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7894,60 +10073,56 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <inttypes.h>
+#include <stdint.h>
 int
 main ()
 {
-uintmax_t i = (uintmax_t) -1; return !i;
+uintmax_t i = (uintmax_t) -1;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_header_inttypes_h=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_stdint_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gl_cv_header_inttypes_h=no
+       gl_cv_header_stdint_h=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5
-echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6
-  if test $gl_cv_header_inttypes_h = yes; then
+{ echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5
+echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; }
+  if test $gl_cv_header_stdint_h = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+#define HAVE_STDINT_H_WITH_UINTMAX 1
 _ACEOF
 
   fi
 
 
-  echo "$as_me:$LINENO: checking for stdint.h" >&5
-echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
-if test "${gl_cv_header_stdint_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7956,60 +10131,47 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <stdint.h>
+long long ll = 1LL; int i = 63;
 int
 main ()
 {
-uintmax_t i = (uintmax_t) -1; return !i;
+long long llmax = (long long) -1;
+     return ll << i | ll >> i | llmax / ll | llmax % ll;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_header_stdint_h=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_type_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gl_cv_header_stdint_h=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       ac_cv_type_long_long=no
 fi
-echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5
-echo "${ECHO_T}$gl_cv_header_stdint_h" >&6
-  if test $gl_cv_header_stdint_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H_WITH_UINTMAX 1
-_ACEOF
-
-  fi
-
 
-
-  ac_cv_type_long_long=$ac_cv_type_long_long_int
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
   if test $ac_cv_type_long_long = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8021,8 +10183,8 @@ _ACEOF
 
 
 
-  echo "$as_me:$LINENO: checking for intmax_t" >&5
-echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for intmax_t" >&5
+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; }
 if test "${gt_cv_c_intmax_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8051,38 +10213,34 @@ intmax_t x = -1; return !x;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   gt_cv_c_intmax_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_c_intmax_t=no
+       gt_cv_c_intmax_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5
-echo "${ECHO_T}$gt_cv_c_intmax_t" >&6
+echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5
+echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; }
   if test $gt_cv_c_intmax_t = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8102,12 +10260,17 @@ _ACEOF
   fi
 
 
+  GNULIB_WCWIDTH=0;
+    HAVE_DECL_WCWIDTH=1;
+  REPLACE_WCWIDTH=0;
+  WCHAR_H=
+
 
 
 
 
 
-if true; then
+   if true; then
   GL_COND_LIBTOOL_TRUE=
   GL_COND_LIBTOOL_FALSE='#'
 else
@@ -8128,8 +10291,8 @@ fi
 
   # Define an additional variable used in the Makefile substitution.
   if test $ac_cv_working_alloca_h = yes; then
-    echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5
-echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5
+echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6; }
 if test "${gl_cv_rpl_alloca+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8156,8 +10319,8 @@ rm -f conftest*
 
 
 fi
-echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5
-echo "${ECHO_T}$gl_cv_rpl_alloca" >&6
+echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5
+echo "${ECHO_T}$gl_cv_rpl_alloca" >&6; }
     if test $gl_cv_rpl_alloca = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8194,143 +10357,210 @@ _ACEOF
   fi
 
 
+  { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+
+  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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+
 
-  { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5
-echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;}
 
-  echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5
-echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6
-if test "${ac_cv_search_getaddrinfo+set}" = set; then
+
+
+
+
+
+
+  FLOAT_H=
+  case "$host_os" in
+    beos*)
+      FLOAT_H=float.h
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_float_h='<'float.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <float.h>" >&5
+echo $ECHO_N "checking absolute name of <float.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_float_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_getaddrinfo=no
-cat >conftest.$ac_ext <<_ACEOF
+
+         if test $ac_cv_header_float_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <float.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getaddrinfo ();
-int
-main ()
-{
-getaddrinfo ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_getaddrinfo="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+                                   gl_cv_next_float_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/float.h#{
+                s#.*"\(.*/float.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_float_h='<'float.h'>'
+         fi
 
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_getaddrinfo" = no; then
-  for ac_lib in nsl socket; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+{ echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5
+echo "${ECHO_T}$gl_cv_next_float_h" >&6; }
+     fi
+     NEXT_FLOAT_H=$gl_cv_next_float_h
+
+
+
+      ;;
+  esac
+
+
+
+
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+for ac_header in sys/mount.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+     #if HAVE_SYS_PARAM_H
+       #include <sys/param.h>
+      #endif
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getaddrinfo ();
-int
-main ()
-{
-getaddrinfo ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_getaddrinfo="-l$ac_lib"
-break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5
-echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6
-if test "$ac_cv_search_getaddrinfo" != no; then
-  test "$ac_cv_search_getaddrinfo" = "none required" || LIBS="$ac_cv_search_getaddrinfo $LIBS"
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
 
+done
 
-for ac_func in getaddrinfo
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+
+
+{ echo "$as_me:$LINENO: checking how to get file system space usage" >&5
+echo "$as_me: checking how to get file system space usage" >&6;}
+ac_fsusage_space=no
+
+# Perform only the link test since it seems there are no variants of the
+# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
+# because that got a false positive on SCO OSR5.  Adding the declaration
+# of a `struct statvfs' causes this test to fail (as it should) on such
+# systems.  That system is reported to work fine with STAT_STATFS4 which
+# is what it gets when this test fails.
+if test $ac_fsusage_space = no; then
+  # SVR4
+  { echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5
+echo $ECHO_N "checking for statvfs function (SVR4)... $ECHO_C" >&6; }
+if test "${fu_cv_sys_stat_statvfs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -8339,172 +10569,153 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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>
+#include <sys/types.h>
+#if defined __GLIBC__ && !defined __BEOS__
+Do not use statvfs on systems with GNU libc, because that function stats
+all preceding entries in /proc/mounts, and that makes df hang if even
+one of the corresponding file systems is hard-mounted, but not available.
+statvfs in GNU libc on BeOS operates differently: it only makes a system
+call.
 #endif
 
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
+#ifdef __osf__
+"Do not use Tru64's statvfs implementation"
 #endif
 
+#include <sys/statvfs.h>
 int
 main ()
 {
-return f != $ac_func;
+struct statvfs fsd; statvfs (0, &fsd);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  fu_cv_sys_stat_statvfs=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       fu_cv_sys_stat_statvfs=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statvfs" >&6; }
+  if test $fu_cv_sys_stat_statvfs = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATVFS 1
 _ACEOF
 
-else
+  fi
+fi
 
-    echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5
-echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6
-if test "${gl_cv_w32_getaddrinfo+set}" = set; then
+if test $ac_fsusage_space = no; then
+  # DEC Alpha running OSF/1
+  { echo "$as_me:$LINENO: checking for 3-argument statfs function (DEC OSF/1)" >&5
+echo $ECHO_N "checking for 3-argument statfs function (DEC OSF/1)... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-      gl_cv_w32_getaddrinfo=no
-      am_save_LIBS="$LIBS"
-      LIBS="$LIBS -lws2_32"
-      cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  fu_cv_sys_stat_statfs3_osf1=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-
-int
-main ()
-{
-getaddrinfo(0, 0, 0, 0);
-  ;
-  return 0;
-}
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+  int
+  main ()
+  {
+    struct statfs fsd;
+    fsd.f_fsize = 0;
+    return statfs (".", &fsd, sizeof (struct statfs)) != 0;
+  }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  gl_cv_w32_getaddrinfo=yes
+  fu_cv_sys_stat_statfs3_osf1=yes
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+fu_cv_sys_stat_statfs3_osf1=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-    LIBS="$am_save_LIBS"
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5
-echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6
-    if test "$gl_cv_w32_getaddrinfo" = "yes"; then
-      LIBS="$LIBS -lws2_32"
-    else
-      gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext"
-    fi
+
 
 fi
-done
 
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs3_osf1" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs3_osf1" >&6; }
+  if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATFS3_OSF1 1
+_ACEOF
 
+  fi
+fi
 
-for ac_func in gai_strerror
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+if test $ac_fsusage_space = no; then
+# AIX
+  { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
+echo $ECHO_N "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  fu_cv_sys_stat_statfs2_bsize=no
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8512,355 +10723,662 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
 #endif
-#ifdef __cplusplus
-}
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
 #endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
+  int
+  main ()
+  {
+  struct statfs fsd;
+  fsd.f_bsize = 0;
+  return statfs (".", &fsd) != 0;
+  }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  fu_cv_sys_stat_statfs2_bsize=yes
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+( exit $ac_status )
+fu_cv_sys_stat_statfs2_bsize=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+
+
+fi
+
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_bsize" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs2_bsize" >&6; }
+  if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATFS2_BSIZE 1
 _ACEOF
 
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+# SVR3
+  { echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
+echo $ECHO_N "checking for four-argument statfs (AIX-3.2.5, SVR3)... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_stat_statfs4+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+  if test "$cross_compiling" = yes; then
+  fu_cv_sys_stat_statfs4=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/statfs.h>
+  int
+  main ()
+  {
+  struct statfs fsd;
+  return statfs (".", &fsd, sizeof fsd, 0) != 0;
+  }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  fu_cv_sys_stat_statfs4=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+fu_cv_sys_stat_statfs4=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-done
 
 
-  echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
-echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6
-if test "${ac_cv_search_gethostbyname+set}" = set; then
+fi
+
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs4" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs4" >&6; }
+  if test $fu_cv_sys_stat_statfs4 = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATFS4 1
+_ACEOF
+
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+# 4.4BSD and NetBSD
+  { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
+echo $ECHO_N "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_gethostbyname=no
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  fu_cv_sys_stat_statfs2_fsize=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char gethostbyname ();
-int
-main ()
-{
-gethostbyname ();
-  ;
-  return 0;
-}
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+  int
+  main ()
+  {
+  struct statfs fsd;
+  fsd.f_fsize = 0;
+  return statfs (".", &fsd) != 0;
+  }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); }; }; then
+  fu_cv_sys_stat_statfs2_fsize=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+fu_cv_sys_stat_statfs2_fsize=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_fsize" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_statfs2_fsize" >&6; }
+  if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATFS2_FSIZE 1
+_ACEOF
+
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+  # Ultrix
+  { echo "$as_me:$LINENO: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+echo $ECHO_N "checking for two-argument statfs with struct fs_data (Ultrix)... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_stat_fs_data+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  fu_cv_sys_stat_fs_data=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+  int
+  main ()
+  {
+  struct fs_data fsd;
+  /* Ultrix's statfs returns 1 for success,
+     0 for not mounted, -1 for failure.  */
+  return statfs (".", &fsd) != 1;
+  }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_gethostbyname="none required"
+  fu_cv_sys_stat_fs_data=yes
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+fu_cv_sys_stat_fs_data=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_gethostbyname" = no; then
-  for ac_lib in inet nsl; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_fs_data" >&5
+echo "${ECHO_T}$fu_cv_sys_stat_fs_data" >&6; }
+  if test $fu_cv_sys_stat_fs_data = yes; then
+    ac_fsusage_space=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_STATFS2_FS_DATA 1
+_ACEOF
+
+  fi
+fi
+
+if test $ac_fsusage_space = no; then
+  # SVR2
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/filsys.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char gethostbyname ();
-int
-main ()
-{
-gethostbyname ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STAT_READ_FILSYS 1
+_ACEOF
+
+    ac_fsusage_space=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi
+
+if test $ac_fsusage_space = yes; then
+  gl_cv_fs_space=yes
+else
+  gl_cv_fs_space=no
+fi
+
+
+
+  if test $gl_cv_fs_space = yes; then
+    gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext"
+
+
+
+
+
+for ac_header in dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_gethostbyname="-l$ac_lib"
-break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-LIBS=$ac_func_search_save_LIBS
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6
-if test "$ac_cv_search_gethostbyname" != no; then
-  test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS"
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
 
-  echo "$as_me:$LINENO: checking for library containing getservbyname" >&5
-echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6
-if test "${ac_cv_search_getservbyname+set}" = set; then
+done
+
+
+  { echo "$as_me:$LINENO: checking for statfs that truncates block counts" >&5
+echo $ECHO_N "checking for statfs that truncates block counts... $ECHO_C" >&6; }
+  if test "${fu_cv_sys_truncating_statfs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_getservbyname=no
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#if !defined(sun) && !defined(__sun)
+choke -- this is a workaround for a Sun-specific problem
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getservbyname ();
+#include <sys/types.h>
+#include <sys/vfs.h>
 int
 main ()
 {
-getservbyname ();
+struct statfs t; long c = *(t.f_spare);
+      if (c) return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_getservbyname="none required"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  fu_cv_sys_truncating_statfs=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       fu_cv_sys_truncating_statfs=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_getservbyname" = no; then
-  for ac_lib in inet nsl socket xnet; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+  if test $fu_cv_sys_truncating_statfs = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STATFS_TRUNCATES_BLOCK_COUNTS 1
+_ACEOF
+
+  fi
+  { echo "$as_me:$LINENO: result: $fu_cv_sys_truncating_statfs" >&5
+echo "${ECHO_T}$fu_cv_sys_truncating_statfs" >&6; }
+
+
+  fi
+
+
+    { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5
+echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;}
+
+  { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5
+echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; }
+if test "${ac_cv_search_getaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getservbyname ();
+char getaddrinfo ();
 int
 main ()
 {
-getservbyname ();
+return getaddrinfo ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+for ac_lib in '' nsl socket; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_getservbyname="-l$ac_lib"
-break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_getaddrinfo=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_getaddrinfo+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_getaddrinfo+set}" = set; then
+  :
+else
+  ac_cv_search_getaddrinfo=no
 fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5
-echo "${ECHO_T}$ac_cv_search_getservbyname" >&6
-if test "$ac_cv_search_getservbyname" != no; then
-  test "$ac_cv_search_getservbyname" = "none required" || LIBS="$ac_cv_search_getservbyname $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6; }
+ac_res=$ac_cv_search_getaddrinfo
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
 
-for ac_func in gethostbyname
+for ac_func in getaddrinfo
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -8886,68 +11404,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -8955,13 +11465,13 @@ _ACEOF
 
 else
 
-    echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5
-echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6
-if test "${gl_cv_w32_gethostbyname+set}" = set; then
+    { echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5
+echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6; }
+if test "${gl_cv_w32_getaddrinfo+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-      gl_cv_w32_gethostbyname=no
+      gl_cv_w32_getaddrinfo=no
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -lws2_32"
       cat >conftest.$ac_ext <<_ACEOF
@@ -8971,64 +11481,63 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
 #endif
 
 int
 main ()
 {
-gethostbyname(0);
+getaddrinfo(0, 0, 0, 0);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_w32_gethostbyname=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gl_cv_w32_getaddrinfo=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
     LIBS="$am_save_LIBS"
 fi
-echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5
-echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6
-    if test "$gl_cv_w32_gethostbyname" = "yes"; then
+{ echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5
+echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6; }
+    if test "$gl_cv_w32_getaddrinfo" = "yes"; then
       LIBS="$LIBS -lws2_32"
+    else
+      gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext"
     fi
 
 fi
 done
 
 
-
-
-
-
+  # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
+  # inline function declared in ws2tcpip.h, so we need to get that
+  # header included somehow.
 
   :
 
@@ -9036,24 +11545,19 @@ done
 
 
 
-
-
-
-  echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5
-echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then
+  { echo "$as_me:$LINENO: checking for gai_strerror (possibly via ws2tcpip.h)" >&5
+echo $ECHO_N "checking for gai_strerror (possibly via ws2tcpip.h)... $ECHO_C" >&6; }
+if test "${gl_cv_func_gai_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-  /* sys/types.h is not needed according to POSIX, but the
-     sys/socket.h in i386-unknown-freebsd4.10 and
-     powerpc-apple-darwin5.5 required it. */
 #include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
@@ -9065,83 +11569,409 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <ws2tcpip.h>
 #endif
 
-
 int
 main ()
 {
-#ifndef getaddrinfo
-  char *p = (char *) getaddrinfo;
-#endif
-
+gai_strerror (0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_have_decl_getaddrinfo=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gl_cv_func_gai_strerror=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_getaddrinfo=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       gl_cv_func_gai_strerror=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5
-echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6
-if test $ac_cv_have_decl_getaddrinfo = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETADDRINFO 1
-_ACEOF
-
 
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETADDRINFO 0
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_func_gai_strerror" >&5
+echo "${ECHO_T}$gl_cv_func_gai_strerror" >&6; }
+  if test $gl_cv_func_gai_strerror = no; then
+    gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext"
+  fi
 
 
-fi
-echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5
-echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then
+    { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_gethostbyname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-  /* sys/types.h is not needed according to POSIX, but the
-     sys/socket.h in i386-unknown-freebsd4.10 and
-     powerpc-apple-darwin5.5 required it. */
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' inet nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_gethostbyname=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_gethostbyname+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  :
+else
+  ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+  { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5
+echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_getservbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 getservbyname ();
+int
+main ()
+{
+return getservbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' inet nsl socket xnet; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_getservbyname=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_getservbyname+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_getservbyname+set}" = set; then
+  :
+else
+  ac_cv_search_getservbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5
+echo "${ECHO_T}$ac_cv_search_getservbyname" >&6; }
+ac_res=$ac_cv_search_getservbyname
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+for ac_func in gethostbyname
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+    { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5
+echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; }
+if test "${gl_cv_w32_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_cv_w32_gethostbyname=no
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS -lws2_32"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+int
+main ()
+{
+gethostbyname(0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gl_cv_w32_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$am_save_LIBS"
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5
+echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6; }
+    if test "$gl_cv_w32_gethostbyname" = "yes"; then
+      LIBS="$LIBS -lws2_32"
+    fi
+
+fi
+done
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5
+echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
 #endif
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
@@ -9154,8 +11984,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-#ifndef freeaddrinfo
-  char *p = (char *) freeaddrinfo;
+#ifndef getaddrinfo
+  (void) getaddrinfo;
 #endif
 
   ;
@@ -9163,38 +11993,115 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_getaddrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_getaddrinfo=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6; }
+if test $ac_cv_have_decl_getaddrinfo = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETADDRINFO 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETADDRINFO 0
+_ACEOF
+
+
+fi
+{ echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5
+echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef freeaddrinfo
+  (void) freeaddrinfo;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_freeaddrinfo=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_freeaddrinfo=no
+       ac_cv_have_decl_freeaddrinfo=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5
-echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6; }
 if test $ac_cv_have_decl_freeaddrinfo = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9209,8 +12116,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5
-echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5
+echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_gai_strerror+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9240,7 +12147,7 @@ int
 main ()
 {
 #ifndef gai_strerror
-  char *p = (char *) gai_strerror;
+  (void) gai_strerror;
 #endif
 
   ;
@@ -9248,38 +12155,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_gai_strerror=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_gai_strerror=no
+       ac_cv_have_decl_gai_strerror=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5
-echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5
+echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6; }
 if test $ac_cv_have_decl_gai_strerror = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9294,8 +12197,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5
-echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5
+echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_getnameinfo+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9325,7 +12228,7 @@ int
 main ()
 {
 #ifndef getnameinfo
-  char *p = (char *) getnameinfo;
+  (void) getnameinfo;
 #endif
 
   ;
@@ -9333,38 +12236,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_getnameinfo=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_getnameinfo=no
+       ac_cv_have_decl_getnameinfo=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5
-echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6; }
 if test $ac_cv_have_decl_getnameinfo = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -9381,8 +12280,8 @@ _ACEOF
 fi
 
 
-  echo "$as_me:$LINENO: checking for struct addrinfo" >&5
-echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for struct addrinfo" >&5
+echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; }
 if test "${ac_cv_type_struct_addrinfo+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9405,50 +12304,47 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
 
 
+typedef struct addrinfo ac__type_new_;
 int
 main ()
 {
-if ((struct addrinfo *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (struct addrinfo))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_struct_addrinfo=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_struct_addrinfo=no
+       ac_cv_type_struct_addrinfo=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5
-echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5
+echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6; }
 if test $ac_cv_type_struct_addrinfo = yes; then
 
 cat >>confdefs.h <<_ACEOF
 
 
 
-for ac_func in inet_ntop
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+
+
+
+
+  :
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5
+echo $ECHO_N "checking for gettimeofday with POSIX signature... $ECHO_C" >&6; }
+if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -9476,110 +12380,61 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+#include <sys/time.h>
+           struct timeval c;
 
 int
 main ()
 {
-return f != $ac_func;
+
+           int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
+           int x = f (&c, 0);
+           return !(x | c.tv_sec | c.tv_usec);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_func_gettimeofday_posix_signature=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       gl_cv_func_gettimeofday_posix_signature=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-else
-  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
-
-
-  :
-
-
-
+{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+echo "${ECHO_T}$gl_cv_func_gettimeofday_posix_signature" >&6; }
 
 
 
 
-
-  echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5
-echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_inet_ntop+set}" = set; then
+ { echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5
+echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6; }
+if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+       gl_cv_func_gettimeofday_clobber=yes
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -9587,111 +12442,88 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <arpa/inet.h>
+#include <string.h>
+         #include <sys/time.h>
+         #include <time.h>
+         #include <stdlib.h>
 
 int
 main ()
 {
-#ifndef inet_ntop
-  char *p = (char *) inet_ntop;
-#endif
+
+         time_t t = 0;
+         struct tm *lt;
+         struct tm saved_lt;
+         struct timeval tv;
+         lt = localtime (&t);
+         saved_lt = *lt;
+         gettimeofday (&tv, NULL);
+         return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_have_decl_inet_ntop=yes
+  gl_cv_func_gettimeofday_clobber=no
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_inet_ntop=no
+( exit $ac_status )
+gl_cv_func_gettimeofday_clobber=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5
-echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6
-if test $ac_cv_have_decl_inet_ntop = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_INET_NTOP 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_INET_NTOP 0
-_ACEOF
 
 
 fi
+{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5
+echo "${ECHO_T}$gl_cv_func_gettimeofday_clobber" >&6; }
 
+ if test $gl_cv_func_gettimeofday_clobber = yes; then
+   REPLACE_GETTIMEOFDAY=1
+   SYS_TIME_H=sys/time.h
 
+  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
 
 
-
-
-
-
-
-
-
-
-
-
-
-  :
-
-
-
-
-
-  if test $ac_cv_header_netinet_in_h = yes; then
-    NETINET_IN_H=''
-  else
-    NETINET_IN_H='netinet/in.h'
-  fi
-
-
-
-
-for ac_header in stdint.h
+for ac_header in sys/timeb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9702,41 +12534,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9745,24 +12573,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -9770,9 +12596,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -9796,25 +12623,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
 
 done
 
-    echo "$as_me:$LINENO: checking for SIZE_MAX" >&5
-echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6
-  if test "${gl_cv_size_max+set}" = set; then
+
+for ac_func in _ftime
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-    gl_cv_size_max=
-    cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Found it" >/dev/null 2>&1; then
-  gl_cv_size_max=yes
-fi
-rm -f conftest*
+#undef $ac_func
 
-    if test -z "$gl_cv_size_max"; then
-                        if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)];
-test_array [0] = 0
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
 int
 main ()
 {
-static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gmtime rpl_gmtime
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define localtime rpl_localtime
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1
+_ACEOF
+
+ fi
+
+
+  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
+    REPLACE_GETTIMEOFDAY=1
+    SYS_TIME_H=sys/time.h
+    if test $gl_cv_func_gettimeofday_clobber != yes; then
+      gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+
+
+for ac_header in sys/timeb.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+
+done
+
+
+for ac_func in _ftime
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-case $ac_lo in
-?*) size_t_bits_minus_1=$ac_lo;;
-'') size_t_bits_minus_1= ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+
+
+    fi
+  fi
+
+
+
+for ac_func in inet_ntop
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10133,471 +13021,206 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
-#include <limits.h>
-long longval () { return sizeof (size_t) * CHAR_BIT - 1; }
-unsigned long ulongval () { return sizeof (size_t) * CHAR_BIT - 1; }
-#include <stdio.h>
-#include <stdlib.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if ((sizeof (size_t) * CHAR_BIT - 1) < 0)
-    {
-      long i = longval ();
-      if (i != (sizeof (size_t) * CHAR_BIT - 1))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != (sizeof (size_t) * CHAR_BIT - 1))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  size_t_bits_minus_1=`cat conftest.val`
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-size_t_bits_minus_1=
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+       eval "$as_ac_var=no"
 fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-rm -f conftest.val
-      if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+
+
+  :
+
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5
+echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_inet_ntop+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stddef.h>
+#include <arpa/inet.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
-test_array [0] = 0
+#ifndef inet_ntop
+  (void) inet_ntop;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_inet_ntop=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       ac_cv_have_decl_inet_ntop=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)];
-test_array [0] = 0
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5
+echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6; }
+if test $ac_cv_have_decl_inet_ntop = yes; then
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 0
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-int
-main ()
-{
-static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) fits_in_uint=$ac_lo;;
-'') fits_in_uint= ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-long longval () { return sizeof (size_t) <= sizeof (unsigned int); }
-unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if ((sizeof (size_t) <= sizeof (unsigned int)) < 0)
-    {
-      long i = longval ();
-      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  fits_in_uint=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-fits_in_uint=
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
-        if test $fits_in_uint = 1; then
-                              cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  fits_in_uint=0
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-                                if test $fits_in_uint = 1; then
-          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        else
-          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        fi
-      else
-                gl_cv_size_max='((size_t)~(size_t)0)'
-      fi
-    fi
 
-fi
 
-  echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5
-echo "${ECHO_T}$gl_cv_size_max" >&6
-  if test "$gl_cv_size_max" != yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define SIZE_MAX $gl_cv_size_max
+
+
+
+
+
+
+  if test $gl_cv_func_malloc_posix = yes; then
+    HAVE_MALLOC_POSIX=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC_POSIX 1
 _ACEOF
 
+  else
+    gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+    HAVE_MALLOC_POSIX=0
   fi
 
 
 
-for ac_func in snprintf
+
+  GNULIB_MALLOC_POSIX=1
+
+
+
+
+for ac_func in mkdtemp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10623,68 +13246,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 fi
 done
 
+  if test $ac_cv_func_mkdtemp = no; then
+    HAVE_MKDTEMP=0
+    :
 
-  :
-
+  fi
 
 
 
+  GNULIB_MKDTEMP=1
 
-  :
 
-     echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
-if test "${ac_cv_type_socklen_t+set}" = set; then
+  { echo "$as_me:$LINENO: checking whether <netinet/in.h> is self-contained" >&5
+echo $ECHO_N "checking whether <netinet/in.h> is self-contained... $ECHO_C" >&6; }
+if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-      #if HAVE_SYS_SOCKET_H
-      # include <sys/socket.h>
-      #elif HAVE_WS2TCPIP_H
-      # include <ws2tcpip.h>
-      #endif
-
+#include <netinet/in.h>
 int
 main ()
 {
-if ((socklen_t *) 0)
-  return 0;
-if (sizeof (socklen_t))
-  return 0;
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_socklen_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_netinet_in_h_selfcontained=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_socklen_t=no
+       gl_cv_header_netinet_in_h_selfcontained=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
-if test $ac_cv_type_socklen_t = yes; then
-  :
-else
-  echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
-echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6
-      if test "${gl_cv_gl_cv_socklen_t_equiv+set}" = set; then
+{ echo "$as_me:$LINENO: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
+echo "${ECHO_T}$gl_cv_header_netinet_in_h_selfcontained" >&6; }
+  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+
+for ac_header in netinet/in.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  # Systems have either "struct sockaddr *" or
-        # "void *" as the second argument to getpeername
-        gl_cv_socklen_t_equiv=
-        for arg2 in "struct sockaddr" void; do
-          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
-            cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/socket.h>
-
-               int getpeername (int, $arg2 *, $t *);
-int
-main ()
-{
-$t len;
-               getpeername (0, 0, &len);
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gl_cv_socklen_t_equiv="$t"
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-            test "$gl_cv_socklen_t_equiv" != "" && break
-          done
-          test "$gl_cv_socklen_t_equiv" != "" && break
-        done
 
-fi
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-      if test "$gl_cv_socklen_t_equiv" = ""; then
-       { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5
-echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
-   { (exit 1); exit 1; }; }
-      fi
-      echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
-echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-cat >>confdefs.h <<_ACEOF
-#define socklen_t $gl_cv_socklen_t_equiv
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
+done
 
 
 
-  # Define two additional variables used in the Makefile substitution.
 
-  if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
-  else
-    STDBOOL_H='stdbool.h'
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <netinet/in.h>" >&5
+echo $ECHO_N "checking absolute name of <netinet/in.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_netinet_in_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_netinet_in_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <netinet/in.h>
+
+_ACEOF
+                                   gl_cv_next_netinet_in_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/netinet/in.h#{
+                s#.*"\(.*/netinet/in.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+         fi
+
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_netinet_in_h" >&5
+echo "${ECHO_T}$gl_cv_next_netinet_in_h" >&6; }
+     fi
+     NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
+
+
+
+    if test $ac_cv_header_netinet_in_h = yes; then
+      HAVE_NETINET_IN_H=1
+    else
+      HAVE_NETINET_IN_H=0
+    fi
+
   fi
 
 
-  if test "$ac_cv_type__Bool" = yes; then
-    HAVE__BOOL=1
+  { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
   else
-    HAVE__BOOL=0
+    # 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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
   fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
 
 
+  gl_LIBOBJS="$gl_LIBOBJS physmem.$ac_objext"
 
+  # Prerequisites of lib/physmem.c.
 
 
-for ac_func in strdup
+
+
+
+
+
+
+for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \
+    machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
+    sys/systemcfg.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10901,121 +13725,104 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 fi
 done
 
 
-  :
 
 
+  gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext"
 
 
 
-  if test $ac_cv_have_decl_strdup = no; then
-    HAVE_DECL_STRDUP=0
-  fi
-  :
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext"
 
 
 
-  :
 
 
 
 
 
-  if test $ac_cv_header_sys_socket_h = yes; then
-    SYS_SOCKET_H=''
-  else
-
 
-for ac_header in winsock2.h ws2tcpip.h
+for ac_header in stdint.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11026,41 +13833,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11069,24 +13872,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -11094,9 +13895,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -11120,25 +13922,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
 
 done
 
-    SYS_SOCKET_H='sys/socket.h'
-  fi
-
-
-       MKDIR_P='$(mkdir_p)'
-
-
-
-
-for ac_func in vasnprintf
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+    { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5
+echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; }
+  result=
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
 #endif
-#ifdef __cplusplus
-}
+#ifdef SIZE_MAX
+Found it
 #endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Found it" >/dev/null 2>&1; then
+  result=yes
+fi
+rm -f conftest*
+
+  if test -z "$result"; then
+                if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-fi
-done
-
-  if test $ac_cv_func_vasnprintf = no; then
-    gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
-    gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
-    gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
-
-
-
-
-
-
-
-
-
-
-
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
-echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6
-if test "${ac_cv_type_ptrdiff_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <stddef.h>
+#include <limits.h>
 int
 main ()
 {
-if ((ptrdiff_t *) 0)
-  return 0;
-if (sizeof (ptrdiff_t))
-  return 0;
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_ptrdiff_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_ptrdiff_t=no
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
-echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6
-if test $ac_cv_type_ptrdiff_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PTRDIFF_T 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-
-
-
-
-
-
-
-
-
-for ac_func in snprintf wcslen
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+#include <stddef.h>
+#include <limits.h>
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-
-
-
-
-  fi
-
-
-
-  CFLAG_VISIBILITY=
-  HAVE_VISIBILITY=0
-  if test -n "$GCC"; then
-    echo "$as_me:$LINENO: checking for simple visibility declarations" >&5
-echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6
-    if test "${gl_cv_cc_visibility+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+case $ac_lo in
+?*) size_t_bits_minus_1=$ac_lo;;
+'') size_t_bits_minus_1= ;;
+esac
 else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -fvisibility=hidden"
-      cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-         extern __attribute__((__visibility__("default"))) int exportedvar;
-         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+#include <stddef.h>
+#include <limits.h>
+static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; }
+static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; }
+#include <stdio.h>
+#include <stdlib.h>
 int
 main ()
 {
 
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if ((sizeof (size_t) * CHAR_BIT - 1) < 0)
+    {
+      long int i = longval ();
+      if (i != (sizeof (size_t) * CHAR_BIT - 1))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != (sizeof (size_t) * CHAR_BIT - 1))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  gl_cv_cc_visibility=yes
+  size_t_bits_minus_1=`cat conftest.val`
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gl_cv_cc_visibility=no
+( exit $ac_status )
+size_t_bits_minus_1=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.val
 
-    echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5
-echo "${ECHO_T}$gl_cv_cc_visibility" >&6
-    if test $gl_cv_cc_visibility = yes; then
-      CFLAG_VISIBILITY="-fvisibility=hidden"
-      HAVE_VISIBILITY=1
-    fi
-  fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VISIBILITY $HAVE_VISIBILITY
-_ACEOF
-
-
-
-
-
-
-for ac_header in stdint.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+    if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-# Check whether --enable-largefile or --disable-largefile was given.
-if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
-
-fi;
-if test "$enable_largefile" != no; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-        # IRIX 6.2 and later do not support large files by default,
-        # so use the C compiler's -n32 option if that helps.
-        cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+#include <stddef.h>
 int
 main ()
 {
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext
-        CC="$CC -n32"
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) fits_in_uint=$ac_lo;;
+'') fits_in_uint= ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); }
+static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if ((sizeof (size_t) <= sizeof (unsigned int)) < 0)
+    {
+      long int i = longval ();
+      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sys_largefile_CC=' -n32'; break
+  fits_in_uint=`cat conftest.val`
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+fits_in_uint=
 fi
-rm -f conftest.err conftest.$ac_objext
-        break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
+rm -f conftest.val
 
-  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  while :; do
-  ac_cv_sys_file_offset_bits=no
-  cat >conftest.$ac_ext <<_ACEOF
+    if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+      if test $fits_in_uint = 1; then
+                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+#include <stddef.h>
+          extern size_t foo;
+          extern unsigned long foo;
+
 int
 main ()
 {
@@ -11842,107 +14619,177 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  fits_in_uint=0
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      fi
+                        if test $fits_in_uint = 1; then
+        result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+      else
+        result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+      fi
+    else
+            result='((size_t)~(size_t)0)'
+    fi
+  fi
+  { echo "$as_me:$LINENO: result: $result" >&5
+echo "${ECHO_T}$result" >&6; }
+  if test "$result" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZE_MAX $result
+_ACEOF
+
+  fi
+
+
+
+
+for ac_func in snprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_file_offset_bits=64; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  break
-done
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
 
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
-rm -f conftest*
-  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_large_files+set}" = set; then
+done
+
+  if test $ac_cv_func_snprintf = no; then
+
+
+  gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext"
+  if test $ac_cv_func_snprintf = yes; then
+    REPLACE_SNPRINTF=1
+  fi
+  :
+
+  fi
+
+  :
+
+
+
+
+
+  if test $ac_cv_have_decl_snprintf = no; then
+    HAVE_DECL_SNPRINTF=0
+  fi
+
+
+
+  GNULIB_SNPRINTF=1
+
+     { echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_socklen_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  while :; do
-  ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11950,2744 +14797,2458 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+      #if HAVE_SYS_SOCKET_H
+      # include <sys/socket.h>
+      #elif HAVE_WS2TCPIP_H
+      # include <ws2tcpip.h>
+      #endif
+
+typedef socklen_t ac__type_new_;
 int
 main ()
 {
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_socklen_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_type_socklen_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; }
+if test $ac_cv_type_socklen_t = yes; then
+  :
+else
+  { echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
+echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6; }
+      if test "${gl_cv_socklen_t_equiv+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Systems have either "struct sockaddr *" or
+        # "void *" as the second argument to getpeername
+        gl_cv_socklen_t_equiv=
+        for arg2 in "struct sockaddr" void; do
+          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+            cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#define _LARGE_FILES 1
 #include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+               #include <sys/socket.h>
+
+               int getpeername (int, $arg2 *, $t *);
 int
 main ()
 {
-
+$t len;
+               getpeername (0, 0, &len);
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_large_files=1; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_socklen_t_equiv="$t"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  break
-done
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
+
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5
+echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      { echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
+echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6; }
 
 cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
+#define socklen_t $gl_cv_socklen_t_equiv
 _ACEOF
 
 fi
-rm -f conftest*
-fi
 
 
-for ac_prog in grep
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GREP+set}" = set; then
+  { echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
+if test "${gt_cv_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $GREP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main ()
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+        return !x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-fi
-GREP=$ac_cv_path_GREP
-
-if test -n "$GREP"; then
-  echo "$as_me:$LINENO: result: $GREP" >&5
-echo "${ECHO_T}$GREP" >&6
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gt_cv_ssize_t=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  test -n "$GREP" && break
-done
+       gt_cv_ssize_t=no
+fi
 
-if test -z "$GREP"; then
-    GREP=grep
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5
+echo "${ECHO_T}$gt_cv_ssize_t" >&6; }
+  if test $gt_cv_ssize_t = no; then
 
-cat >>confdefs.h <<_ACEOF
-#define GREP "$GREP"
+cat >>confdefs.h <<\_ACEOF
+#define ssize_t int
 _ACEOF
 
-for ac_prog in egrep
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $EGREP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
   fi
-done
-done
 
-  ;;
-esac
-fi
-EGREP=$ac_cv_path_EGREP
 
-if test -n "$EGREP"; then
-  echo "$as_me:$LINENO: result: $EGREP" >&5
-echo "${ECHO_T}$EGREP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$EGREP" && break
-done
 
+  # Define two additional variables used in the Makefile substitution.
 
-for ac_prog in lint
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AMLINT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $AMLINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
   fi
-done
-done
 
-  ;;
-esac
-fi
-AMLINT=$ac_cv_path_AMLINT
 
-if test -n "$AMLINT"; then
-  echo "$as_me:$LINENO: result: $AMLINT" >&5
-echo "${ECHO_T}$AMLINT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$AMLINT" && break
-done
-
-if test ! -z "$AMLINT"; then
-  $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AMLINTFLAGS="-n -s -u -m -x"
-    AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
-    AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
-    AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
-    AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
-    AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
   else
-    AMLINTFLAGS=""
-  fi
-else
-  for ac_prog in splint
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AMLINT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $AMLINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+    HAVE__BOOL=0
   fi
-done
-done
 
-  ;;
-esac
-fi
-AMLINT=$ac_cv_path_AMLINT
 
-if test -n "$AMLINT"; then
-  echo "$as_me:$LINENO: result: $AMLINT" >&5
-echo "${ECHO_T}$AMLINT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$AMLINT" && break
-done
 
-  if test ! -z "$AMLINT"; then
-    AMLINT="splint"
+
+  if test $ac_cv_type_long_long_int = yes; then
+    HAVE_LONG_LONG_INT=1
+  else
+    HAVE_LONG_LONG_INT=0
   fi
-  AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
-fi
 
 
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+    HAVE_UNSIGNED_LONG_LONG_INT=1
+  else
+    HAVE_UNSIGNED_LONG_LONG_INT=0
+  fi
 
-# Check whether --with-includes or --without-includes was given.
-if test "${with_includes+set}" = set; then
-  withval="$with_includes"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       INCLUDE_DIRS="$withval"
+      if test $ac_cv_header_inttypes_h = yes; then
+    HAVE_INTTYPES_H=1
+  else
+    HAVE_INTTYPES_H=0
+  fi
 
-fi;
 
-if test "$INCLUDE_DIRS"; then
-       for dir in $INCLUDE_DIRS; do
-           if test -d "$dir"; then
-               AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir"
-           else
-               { echo "$as_me:$LINENO: WARNING: *** Include directory $dir does not exist." >&5
-echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
-           fi
-       done
-fi
+      if test $ac_cv_header_sys_types_h = yes; then
+    HAVE_SYS_TYPES_H=1
+  else
+    HAVE_SYS_TYPES_H=0
+  fi
+
 
 
-# Check whether --with-libraries or --without-libraries was given.
-if test "${with_libraries+set}" = set; then
-  withval="$with_libraries"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       LIBRARY_DIRS="$withval"
-
-fi;
-
-if test "$LIBRARY_DIRS"; then
-       for dir in $LIBRARY_DIRS; do
-           if test -d "$dir"; then
-               case "$target" in
-                 *-solaris2*,*-netbsd*)
-                       AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir"
-                       ;;
-               esac
-               AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir"
-           else
-               { echo "$as_me:$LINENO: WARNING: *** Library directory $dir does not exist." >&5
-echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
-           fi
-       done
-fi
 
+  :
 
 
-# Check whether --with-dumperdir or --without-dumperdir was given.
-if test "${with_dumperdir+set}" = set; then
-  withval="$with_dumperdir"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-dumperdir option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-dumperdir option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       DUMPER_DIR="$withval"
 
-else
 
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-        DUMPER_DIR=$exec_prefix/dumper
 
 
-fi;
-DUMPER_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$DUMPER_DIR"
-)`
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdint_h='<'stdint.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <stdint.h>" >&5
+echo $ECHO_N "checking absolute name of <stdint.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_stdint_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_stdint_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdint.h>
 
-cat >>confdefs.h <<_ACEOF
-#define DUMPER_DIR "$DUMPER_DIR"
 _ACEOF
+                                   gl_cv_next_stdint_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/stdint.h#{
+                s#.*"\(.*/stdint.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_stdint_h='<'stdint.h'>'
+         fi
 
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5
+echo "${ECHO_T}$gl_cv_next_stdint_h" >&6; }
+     fi
+     NEXT_STDINT_H=$gl_cv_next_stdint_h
 
 
 
-# Check whether --with-configdir or --without-configdir was given.
-if test "${with_configdir+set}" = set; then
-  withval="$with_configdir"
+  if test $ac_cv_header_stdint_h = yes; then
+    HAVE_STDINT_H=1
+  else
+    HAVE_STDINT_H=0
+  fi
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CONFIG_DIR="$withval"
-         ;;
-       esac
 
+    if test $ac_cv_header_stdint_h = yes; then
+    { echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5
+echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6; }
+if test "${gl_cv_header_working_stdint_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${CONFIG_DIR="$sysconfdir/amanda"}
-
-fi;
-CONFIG_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$CONFIG_DIR"
-)`
+  gl_cv_header_working_stdint_h=no
+       cat >conftest.$ac_ext <<_ACEOF
 
-cat >>confdefs.h <<_ACEOF
-#define CONFIG_DIR "$CONFIG_DIR"
+         /* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
+#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
 
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-# Check whether --with-indexdir or --without-indexdir was given.
-if test "${with_indexdir+set}" = set; then
-  withval="$with_indexdir"
-     { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
-
-fi;
 
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+#define TYPE_MAXIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+struct s {
+  int check_PTRDIFF:
+      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+      ? 1 : -1;
+  /* Detect bug in FreeBSD 6.0 / ia64.  */
+  int check_SIG_ATOMIC:
+      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+      ? 1 : -1;
+  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+  int check_WCHAR:
+      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+      ? 1 : -1;
+  /* Detect bug in mingw.  */
+  int check_WINT:
+      WINT_MIN == TYPE_MINIMUM (wint_t)
+      && WINT_MAX == TYPE_MAXIMUM (wint_t)
+      ? 1 : -1;
+
+  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
+  int check_UINT8_C:
+        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+  int check_UINT16_C:
+        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
+#ifdef UINT8_MAX
+  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
 
-# Check whether --with-dbdir or --without-dbdir was given.
-if test "${with_dbdir+set}" = set; then
-  withval="$with_dbdir"
-     { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
+int
+main ()
+{
 
-fi;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_working_stdint_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
-# Check whether --with-logdir or --without-logdir was given.
-if test "${with_logdir+set}" = set; then
-  withval="$with_logdir"
-     { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
+fi
 
-fi;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5
+echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; }
+  fi
+  if test "$gl_cv_header_working_stdint_h" = yes; then
+    STDINT_H=
+  else
 
 
-# Check whether --with-suffixes or --without-suffixes was given.
-if test "${with_suffixes+set}" = set; then
-  withval="$with_suffixes"
-  USE_VERSION_SUFFIXES=$withval
+for ac_header in sys/inttypes.h sys/bitypes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  : ${USE_VERSION_SUFFIXES=no}
-
-fi;
-case "$USE_VERSION_SUFFIXES" in
-y | ye | yes)
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_VERSION_SUFFIXES 1
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-    program_suffix="-$VERSION"
-    # This is from the output of configure.in.
-    if test "x$program_transform_name" = xs,x,x,; then
-       program_transform_name=
-    else
-       # Double any \ or $.  echo might interpret backslashes.
-       cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
-       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-       rm -f conftestsed
-    fi
-    test "x$program_prefix" != xNONE &&
-       program_transform_name="s,^,${program_prefix},; $program_transform_name"
-    # Use a double $ so make ignores it.
-    test "x$program_suffix" != xNONE &&
-       program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-    # sed with no file args requires a program.
-    test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
-    # Remove empty command
-    cat <<\EOF_SED > conftestsed
-s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
-EOF_SED
-    program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-    rm -f conftestsed
-  ;;
-n | no) USE_VERSION_SUFFIXES=no
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_header_compiler=no
+fi
 
-case "$target" in
-    *-hp-*)
-       CLIENT_SCRIPTS_OPT=amhpfixdevs
-       ;;
-    *-sni-sysv4)
-       CLIENT_SCRIPTS_OPT=amsinixfixdevs
-       ;;
-    *)
-       CLIENT_SCRIPTS_OPT=
-       ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
+fi
 
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-# Check whether --with-client-only or --without-client-only was given.
-if test "${with_client_only+set}" = set; then
-  withval="$with_client_only"
-     { { echo "$as_me:$LINENO: error: *** --with-client-only is deprecated, use --without-server instead." >&5
-echo "$as_me: error: *** --with-client-only is deprecated, use --without-server instead." >&2;}
-   { (exit 1); exit 1; }; }
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-fi;
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Check whether --with-server-only or --without-server-only was given.
-if test "${with_server_only+set}" = set; then
-  withval="$with_server_only"
-     { { echo "$as_me:$LINENO: error: *** --with-server-only is deprecated, use --without-client instead." >&5
-echo "$as_me: error: *** --with-server-only is deprecated, use --without-client instead." >&2;}
-   { (exit 1); exit 1; }; }
+fi
 
-fi;
+done
 
+    if test $ac_cv_header_sys_inttypes_h = yes; then
+      HAVE_SYS_INTTYPES_H=1
+    else
+      HAVE_SYS_INTTYPES_H=0
+    fi
 
-# Check whether --with-client or --without-client was given.
-if test "${with_client+set}" = set; then
-  withval="$with_client"
+    if test $ac_cv_header_sys_bitypes_h = yes; then
+      HAVE_SYS_BITYPES_H=1
+    else
+      HAVE_SYS_BITYPES_H=0
+    fi
 
-       case "$withval" in
-       y | ye | yes) NO_CLIENT_MODE=false;;
-       n | no) NO_CLIENT_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-client option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-client option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
 
 
-fi;
+  :
 
 
-# Check whether --with-server or --without-server was given.
-if test "${with_server+set}" = set; then
-  withval="$with_server"
 
-       case "$withval" in
-       y | ye | yes) NO_SERVER_MODE=false ;;
-       n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&5
-echo "$as_me: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
 
 
-fi;
-if test "x${NO_SERVER_MODE+set}" != xset ; then
-   NO_SERVER_MODE=false
-fi
 
 
-# Check whether --with-restore or --without-restore was given.
-if test "${with_restore+set}" = set; then
-  withval="$with_restore"
 
-       case "$withval" in
-       y | ye | yes) NO_RESTORE_MODE=false;;
-       n | no) NO_RESTORE_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-restore option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-restore option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
 
 
-fi;
-if test "x${NO_RESTORE_MODE+set}" != xset ; then
-   NO_RESTORE_MODE=${NO_SERVER_MODE-false}
-fi
 
-if ${NO_SERVER_MODE-false}; then
-   if ${NO_RESTORE_MODE-false}; then
-                        true
-   else
-      { { echo "$as_me:$LINENO: error: *** --without-server requires --without-restore" >&5
-echo "$as_me: error: *** --without-server requires --without-restore" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
-fi
 
 
-# Check whether --with-amrecover or --without-amrecover was given.
-if test "${with_amrecover+set}" = set; then
-  withval="$with_amrecover"
 
-       case "$withval" in
-       y | ye | yes)
-           if ${NO_CLIENT_MODE-false}; then
-               { { echo "$as_me:$LINENO: error: *** --without-client and --with-amrecover are incompatible" >&5
-echo "$as_me: error: *** --without-client and --with-amrecover are incompatible" >&2;}
-   { (exit 1); exit 1; }; }
-           fi
-           NO_RECOVER_MODE=false;;
-       n | no) NO_RECOVER_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amrecover option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-amrecover option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
+  for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do
+    { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5
+echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; }
+if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-fi;
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Check whether --with-index-server or --without-index-server was given.
-if test "${with_index_server+set}" = set; then
-  withval="$with_index_server"
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_SERVER="$withval"
-         ;;
-       esac
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
-  : ${DEFAULT_SERVER=`uname -n`}
-
-fi;
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_SERVER "$DEFAULT_SERVER"
-_ACEOF
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-# Check whether --with-force-uid or --without-force-uid was given.
-if test "${with_force_uid+set}" = set; then
-  withval="$with_force_uid"
-  FORCE_USERID="$withval"
-else
-  : ${FORCE_USERID=yes}
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)];
+test_array [0] = 0
 
-fi;
-case "$FORCE_USERID" in
-y | ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define FORCE_USERID 1
+  ;
+  return 0;
+}
 _ACEOF
-
-  ;;
-n | no) :
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;}
-   { (exit 1); exit 1; }; }
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-# Check whether --with-user or --without-user was given.
-if test "${with_user+set}" = set; then
-  withval="$with_user"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_LOGIN="$withval"
-         ;;
-       esac
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "x${CLIENT_LOGIN+set}" != xset; then
-    { { echo "$as_me:$LINENO: error: *** --with-user=USER is missing" >&5
-echo "$as_me: error: *** --with-user=USER is missing" >&2;}
-   { (exit 1); exit 1; }; }
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_LOGIN "$CLIENT_LOGIN"
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Check whether --with-group or --without-group was given.
-if test "${with_group+set}" = set; then
-  withval="$with_group"
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SETUID_GROUP="$withval"
-         ;;
-       esac
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "x${SETUID_GROUP+set}" != xset; then
-    { { echo "$as_me:$LINENO: error: *** --with-group=GROUP is missing" >&5
-echo "$as_me: error: *** --with-group=GROUP is missing" >&2;}
-   { (exit 1); exit 1; }; }
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) result=$ac_lo;;
+'') result=unknown ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-# Check whether --with-owner or --without-owner was given.
-if test "${with_owner+set}" = set; then
-  withval="$with_owner"
+#include <limits.h>
+static long int longval () { return sizeof ($gltype) * CHAR_BIT; }
+static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-        case "$withval" in
-        "" | y | ye | yes | n | no)
-            { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;}
-   { (exit 1); exit 1; }; }
-          ;;
-        *) BINARY_OWNER="$withval"
-          ;;
-        esac
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if ((sizeof ($gltype) * CHAR_BIT) < 0)
+    {
+      long int i = longval ();
+      if (i != (sizeof ($gltype) * CHAR_BIT))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != (sizeof ($gltype) * CHAR_BIT))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  result=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "x${BINARY_OWNER+set}" != xset ; then
-   BINARY_OWNER=$CLIENT_LOGIN
+( exit $ac_status )
+result=unknown
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+       eval gl_cv_bitsizeof_${gltype}=\$result
 
-cat >>confdefs.h <<_ACEOF
-#define BINARY_OWNER "$BINARY_OWNER"
+fi
+ac_res=`eval echo '${'gl_cv_bitsizeof_${gltype}'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+                                                result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
 _ACEOF
 
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
 
 
 
-# Check whether --with-rundump or --without-rundump was given.
-if test "${with_rundump+set}" = set; then
-  withval="$with_rundump"
-
-    case "$withval" in
-       n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";;
-       *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rundump option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-rundump option." >&2;}
-   { (exit 1); exit 1; }; };;
-    esac
-
-
-fi;
 
 
-# Check whether --with-config or --without-config was given.
-if test "${with_config+set}" = set; then
-  withval="$with_config"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_CONFIG="$withval"
-         ;;
-       esac
 
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { echo "$as_me:$LINENO: checking whether $gltype is signed" >&5
+echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6; }
+if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${DEFAULT_CONFIG=DailySet1}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_CONFIG "$DEFAULT_CONFIG"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
+            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
+int
+main ()
+{
 
-
-# Check whether --with-tape-server or --without-tape-server was given.
-if test "${with_tape_server+set}" = set; then
-  withval="$with_tape_server"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_TAPE_SERVER="$withval"
-         ;;
-       esac
-
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  result=yes
 else
-  : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       result=no
+fi
 
-fi;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       eval gl_cv_type_${gltype}_signed=\$result
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER"
+fi
+ac_res=`eval echo '${'gl_cv_type_${gltype}_signed'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+    eval result=\$gl_cv_type_${gltype}_signed
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    if test "$result" = yes; then
+      cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGNED_${GLTYPE} 1
 _ACEOF
 
+      eval HAVE_SIGNED_${GLTYPE}=1
+    else
+      eval HAVE_SIGNED_${GLTYPE}=0
+    fi
+  done
 
 
+  gl_cv_type_ptrdiff_t_signed=yes
+  gl_cv_type_size_t_signed=no
 
-# Check whether --with-tape-device or --without-tape-device was given.
-if test "${with_tape_device+set}" = set; then
-  withval="$with_tape_device"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_TAPE_DEVICE="$withval"
-         ;;
-       esac
 
 
-fi;
 
-if test ! -z "$DEFAULT_TAPE_DEVICE"; then
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE"
-_ACEOF
 
 
-    EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE
+  for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do
+    { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5
+echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; }
+if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    EXAMPLE_TAPEDEV="/dev/null"
-fi
-
-
+  eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)  gltype1='long int';;
+           ll) gltype1='long long int';;
+           i64)        gltype1='__int64';;
+           u)  gltype1='unsigned int';;
+           ul) gltype1='unsigned long int';;
+           ull)        gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Check whether --with-ftape-raw-device or --without-ftape-raw-device was given.
-if test "${with_ftape_raw_device+set}" = set; then
-  withval="$with_ftape_raw_device"
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_RAW_TAPE_DEVICE="$withval"
-         ;;
-       esac
+              extern $gltype foo;
+              extern $gltype1 foo;
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval gl_cv_type_${gltype}_suffix=\$glsuf
 else
-
-       if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-           echo "$as_me:$LINENO: checking for raw ftape device" >&5
-echo $ECHO_N "checking for raw ftape device... $ECHO_C" >&6
-                   raw_tape_dev=/dev/null
-                               for num in 3 2 1 0 ; do
-                   td=/dev/rawft${num}
-                   if test -r $td; then
-                       raw_tape_dev=$td
-                   fi
-               done
-           DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev
-           echo "$as_me:$LINENO: result: $DEFAULT_RAW_TAPE_DEVICE" >&5
-echo "${ECHO_T}$DEFAULT_RAW_TAPE_DEVICE" >&6
-       fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi;
+fi
 
-if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-    DEFAULT_RAW_TAPE_DEVICE=/dev/null
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done
 fi
+ac_res=`eval echo '${'gl_cv_type_${gltype}_suffix'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
 
+  done
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_RAW_TAPE_DEVICE "$DEFAULT_RAW_TAPE_DEVICE"
-_ACEOF
 
 
+    STDINT_H=stdint.h
+  fi
 
 
-# Check whether --with-rew-tape or --without-rew-tape was given.
-if test "${with_rew_tape+set}" = set; then
-  withval="$with_rew_tape"
-     { { echo "$as_me:$LINENO: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&5
-echo "$as_me: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
 
-# Check whether --with-norew-tape or --without-norew-tape was given.
-if test "${with_norew_tape+set}" = set; then
-  withval="$with_norew_tape"
-     { { echo "$as_me:$LINENO: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&5
-echo "$as_me: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
+  :
 
-# Check whether --with-changer-device or --without-changer-device was given.
-if test "${with_changer_device+set}" = set; then
-  withval="$with_changer_device"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_CHANGER_DEVICE="$withval"
-         ;;
-       esac
 
-else
 
-       if test -z "$DEFAULT_CHANGER_DEVICE" &&
-          test -f /dev/ch0; then
-           DEFAULT_CHANGER_DEVICE=/dev/ch0
-       fi
 
 
-fi;
 
-if test -z "$DEFAULT_CHANGER_DEVICE"; then
-    DEFAULT_CHANGER_DEVICE=/dev/null
-fi
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdio_h='<'stdio.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <stdio.h>" >&5
+echo $ECHO_N "checking absolute name of <stdio.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_stdio_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
+         if test $ac_cv_header_stdio_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdio.h>
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE"
 _ACEOF
+                                   gl_cv_next_stdio_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/stdio.h#{
+                s#.*"\(.*/stdio.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_stdio_h='<'stdio.h'>'
+         fi
 
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5
+echo "${ECHO_T}$gl_cv_next_stdio_h" >&6; }
+     fi
+     NEXT_STDIO_H=$gl_cv_next_stdio_h
 
 
 
-# Check whether --with-fqdn or --without-fqdn was given.
-if test "${with_fqdn+set}" = set; then
-  withval="$with_fqdn"
-  USE_FQDN=$withval
-else
-  : ${USE_FQDN=no}
 
-fi;
-case "$USE_FQDN" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define USE_FQDN 1
-_ACEOF
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-fqdn option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-fqdn option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
 
-# Check whether --with-broken-fsf or --without-broken-fsf was given.
-if test "${with_broken_fsf+set}" = set; then
-  withval="$with_broken_fsf"
-  HAVE_BROKEN_FSF=$withval
-else
-  : ${HAVE_BROKEN_FSF=no}
 
-fi;
-case "$HAVE_BROKEN_FSF" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_FSF 1
-_ACEOF
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-broken-fsf option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-broken-fsf option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
+  :
 
 
-# Check whether --with-reuseports or --without-reuseports was given.
-if test "${with_reuseports+set}" = set; then
-  withval="$with_reuseports"
-   case "$withval" in
-        y | ye | yes)
-          REUSEADDR=no;;
-        n | no)
-          REUSEADDR=yes;;
-        *)
-          REUSEADDR=no;;
-      esac
 
-else
-   REUSEADDR=yes;
-fi;
-case "$REUSEADDR" in
-n | no) :
-    ;;
-y |  ye | yes)
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_REUSEADDR 1
-_ACEOF
 
-    ;;
-*)
-    { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-reuseports option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-reuseports option." >&2;}
-   { (exit 1); exit 1; }; }
-    ;;
-esac
 
 
-# Check whether --with-gnutar or --without-gnutar was given.
-if test "${with_gnutar+set}" = set; then
-  withval="$with_gnutar"
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdlib_h='<'stdlib.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <stdlib.h>" >&5
+echo $ECHO_N "checking absolute name of <stdlib.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_stdlib_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-       case "$withval" in
-           /*) GNUTAR="$withval";;
-           y|ye|yes) :;;
-           n|no) GNUTAR=;;
-           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
-   { (exit 1); exit 1; }; };;
-       esac
+         if test $ac_cv_header_stdlib_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+_ACEOF
+                                   gl_cv_next_stdlib_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/stdlib.h#{
+                s#.*"\(.*/stdlib.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_stdlib_h='<'stdlib.h'>'
+         fi
 
-fi;
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5
+echo "${ECHO_T}$gl_cv_next_stdlib_h" >&6; }
+     fi
+     NEXT_STDLIB_H=$gl_cv_next_stdlib_h
 
 
-# Check whether --with-smbclient or --without-smbclient was given.
-if test "${with_smbclient+set}" = set; then
-  withval="$with_smbclient"
 
-       case "$withval" in
-           /*) SAMBA_CLIENT="$withval";;
-           y|ye|yes) :;;
-           n|no) SAMBA_CLIENT=;;
-           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;}
-   { (exit 1); exit 1; }; };;
-       esac
 
 
-fi;
 
 
-# Check whether --with-samba-user or --without-samba-user was given.
-if test "${with_samba_user+set}" = set; then
-  withval="$with_samba_user"
-      { { echo "$as_me:$LINENO: error: *** The samba-user option was deprecated, the username go in the amandapass" >&5
-echo "$as_me: error: *** The samba-user option was deprecated, the username go in the amandapass" >&2;}
-   { (exit 1); exit 1; }; }
+for ac_func in strdup
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-fi;
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
+#undef $ac_func
 
-# Check whether --with-gnutar-listdir or --without-gnutar-listdir was given.
-if test "${with_gnutar_listdir+set}" = set; then
-  withval="$with_gnutar_listdir"
-
-       case "$withval" in
-           n | no)             unset GNUTAR_LISTDIR ;;
-           y | ye | yes)       : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;;
-           /*)                 GNUTAR_LISTDIR="$withval" ;;
-           *)                  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar-listdir" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-gnutar-listdir" >&2;}
-   { (exit 1); exit 1; }; }
-       esac
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"}
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "$GNUTAR_LISTDIR"; then
-    GNUTAR_LISTDIR=`(
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        eval echo "$GNUTAR_LISTDIR"
-    )`
+       eval "$as_ac_var=no"
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define GNUTAR_LISTED_INCREMENTAL_DIR "$GNUTAR_LISTDIR"
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-    GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR
 else
-    GNUTAR_LISTED_INCREMENTAL_DIRX=
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 fi
+done
 
 
+  :
 
-# Check whether --with-gnutar-listed-incremental or --without-gnutar-listed-incremental was given.
-if test "${with_gnutar_listed_incremental+set}" = set; then
-  withval="$with_gnutar_listed_incremental"
-      { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&5
-echo "$as_me: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&2;}
-   { (exit 1); exit 1; }; }
-
-
-fi;
-GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR
-
-
-
-# Check whether --with-bsd-security or --without-bsd-security was given.
-if test "${with_bsd_security+set}" = set; then
-  withval="$with_bsd_security"
-  BSD_SECURITY=$withval
-else
-  : ${BSD_SECURITY=yes}
 
-fi;
-case "$BSD_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSD_SECURITY 1
-_ACEOF
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsd-security option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-bsd-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
 
-# Check whether --with-amandahosts or --without-amandahosts was given.
-if test "${with_amandahosts+set}" = set; then
-  withval="$with_amandahosts"
-  USE_AMANDAHOSTS=$withval
-else
-  : ${USE_AMANDAHOSTS=yes}
+  if test $ac_cv_have_decl_strdup = no; then
+    HAVE_DECL_STRDUP=0
+  fi
+  :
 
-fi;
-case "$USE_AMANDAHOSTS" in
-n | no) : ;;
-y |  ye | yes) :
-  case "$BSD_SECURITY" in
-  y | ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define USE_AMANDAHOSTS 1
-_ACEOF
 
-    ;;
-  esac
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amandahosts option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-amandahosts option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
+  GNULIB_STRDUP=1
 
 
-# Check whether --with-dbmalloc or --without-dbmalloc was given.
-if test "${with_dbmalloc+set}" = set; then
-  withval="$with_dbmalloc"
-  DBMALLOC="$withval"
-else
-  : ${DBMALLOC=no}
 
-fi;
 
-case "$DBMALLOC" in
-n | no)
-    DBMALLOCCFLAGS=""
-    DBMALLOCLIBS=""
-    ;;
-*)
 
-echo "$as_me:$LINENO: checking for malloc in -ldbmalloc" >&5
-echo $ECHO_N "checking for malloc in -ldbmalloc... $ECHO_C" >&6
-if test "${ac_cv_lib_dbmalloc_malloc+set}" = set; then
+  { echo "$as_me:$LINENO: checking whether <sys/socket.h> is self-contained" >&5
+echo $ECHO_N "checking whether <sys/socket.h> is self-contained... $ECHO_C" >&6; }
+if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbmalloc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char malloc ();
+#include <sys/socket.h>
 int
 main ()
 {
-malloc ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dbmalloc_malloc=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_sys_socket_h_selfcontained=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dbmalloc_malloc=no
+       gl_cv_header_sys_socket_h_selfcontained=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dbmalloc_malloc" >&5
-echo "${ECHO_T}$ac_cv_lib_dbmalloc_malloc" >&6
-if test $ac_cv_lib_dbmalloc_malloc = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDBMALLOC 1
-_ACEOF
 
-  LIBS="-ldbmalloc $LIBS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
+{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+    SYS_SOCKET_H=''
+  else
+    SYS_SOCKET_H='sys/socket.h'
 
-    if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then
-      { echo "$as_me:$LINENO: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&5
-echo "$as_me: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&2;}
-      DBMALLOCCFLAGS=""
-      DBMALLOCLIBS=""
-    else
-      DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC"
-      DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc"
-    fi
-    ;;
-esac
 
 
-# Check whether --with-ipv6 or --without-ipv6 was given.
-if test "${with_ipv6+set}" = set; then
-  withval="$with_ipv6"
 
-       case "$withval" in
-       y | ye | yes) amanda_ipv6=true;;
-       n | no) amanda_ipv6=false;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
+  :
 
 
-fi;
 
 
-: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
 
 
-# Check whether --with-krb4-security or --without-krb4-security was given.
-if test "${with_krb4_security+set}" = set; then
-  withval="$with_krb4_security"
-  KRB4_SECURITY="$withval"
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <sys/socket.h>" >&5
+echo $ECHO_N "checking absolute name of <sys/socket.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_sys_socket_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${KRB4_SECURITY=no}
 
-fi;
+         if test $ac_cv_header_sys_socket_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/socket.h>
 
-case "$KRB4_SECURITY" in
-n | no) KRB4_SECURITY=no ;;
-y | ye | yes) : ;;
-*) KRB4_SPOTS="$KRB4_SECURITY"
-   KRB4_SECURITY=yes
-   ;;
-esac
+_ACEOF
+                                   gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/sys/socket.h#{
+                s#.*"\(.*/sys/socket.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+         fi
 
-echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5
-echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6
-if test "x${KRB4_SECURITY}" = xyes -a -f  ${srcdir-.}/common-src/krb4-security.c ; then
-    for dir in $KRB4_SPOTS; do
-       if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then
-           #
-           # This is the original Kerberos 4.
-           #
-           echo "$as_me:$LINENO: result: found in $dir" >&5
-echo "${ECHO_T}found in $dir" >&6
-           KRB4_SECURITY=yes
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5
+echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; }
+     fi
+     NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
 
-cat >>confdefs.h <<\_ACEOF
-#define KRB4_SECURITY 1
-_ACEOF
 
-           if test -d $dir/include/kerberosIV ; then
-               #
-               # This handles BSD/OS.
-               #
-               KRB4INCLUDES=-I$dir/include/kerberosIV
-           else
-               KRB4INCLUDES=-I$dir/include
-           fi
-           KRB4LDFLAGS=-L$dir/lib
-           KRB4LIBS="-lkrb -ldes"
-           if test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="$KRB4LIBS -lcom_err"
-           fi
-           break
-       elif test -f ${dir}/lib/libkrb4.a &&
-            test -f ${dir}/lib/libcrypto.a &&
-            test -f ${dir}/lib/libdes425.a ; then
-           #
-           # This is Kerberos 5 with Kerberos 4 back-support.
-           #
-           echo "$as_me:$LINENO: result: found in $dir" >&5
-echo "${ECHO_T}found in $dir" >&6
-           KRB4_SECURITY=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define KRB4_SECURITY 1
-_ACEOF
+    if test $ac_cv_header_sys_socket_h = yes; then
+      HAVE_SYS_SOCKET_H=1
+      HAVE_WINSOCK2_H=0
+      HAVE_WS2TCPIP_H=0
+    else
+      HAVE_SYS_SOCKET_H=0
 
-           KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV"
-           KRB4LDFLAGS=-L$dir/lib
-           if test -f ${dir}/lib/libkrb5.a &&
-               test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err"
-           else
-               KRB4LIBS="-lkrb4 -lcrypto -ldes425"
-           fi
-           break
-       fi
-    done
 
-    if test "x$KRB4LDFLAGS" = "x" ; then
-       echo "$as_me:$LINENO: result: no libraries found" >&5
-echo "${ECHO_T}no libraries found" >&6
-    fi
+for ac_header in winsock2.h ws2tcpip.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
-    echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-# Check whether --with-rsh-security or --without-rsh-security was given.
-if test "${with_rsh_security+set}" = set; then
-  withval="$with_rsh_security"
-  RSH_SECURITY=$withval
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  : ${RSH_SECURITY=yes}
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-case "$RSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define RSH_SECURITY 1
-_ACEOF
+  ac_header_preproc=no
+fi
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-rsh-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-rsh-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-# Check whether --with-ssh-security or --without-ssh-security was given.
-if test "${with_ssh_security+set}" = set; then
-  withval="$with_ssh_security"
-  SSH_SECURITY=$withval
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${SSH_SECURITY=no}
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-fi;
-case "$SSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define SSH_SECURITY 1
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-              SSH_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
+fi
 
-# find SSH and check for SSH options if we're using SSH security
-if test x"$SSH_SECURITY" = "xyes"; then
-    for ac_prog in ssh
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_SSH+set}" = set; then
+done
+
+      if test $ac_cv_header_winsock2_h = yes; then
+        HAVE_WINSOCK2_H=1
+      else
+        HAVE_WINSOCK2_H=0
+      fi
+      if test $ac_cv_header_ws2tcpip_h = yes; then
+        HAVE_WS2TCPIP_H=1
+      else
+        HAVE_WS2TCPIP_H=0
+      fi
+    fi
+
+
+
+  fi
+
+
+  { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $SSH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SSH="$SSH" # Let the user override the test with a path.
-  ;;
-  *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          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
 
-  ;;
-esac
 fi
-SSH=$ac_cv_path_SSH
 
-if test -n "$SSH"; then
-  echo "$as_me:$LINENO: result: $SSH" >&5
-echo "${ECHO_T}$SSH" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
 fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
 
-  test -n "$SSH" && break
-done
-
-
-cat >>confdefs.h <<_ACEOF
-#define SSH "$SSH"
-_ACEOF
-
-
-
-# Check whether --with-ssh-options or --without-ssh-options was given.
-if test "${with_ssh_options+set}" = set; then
-  withval="$with_ssh_options"
-   SSH_OPTIONS="$withval"
-else
-   SSH_OPTIONS=''
 
-fi;
 
-    case "$SSH_OPTIONS" in
-       y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5
-echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;}
-   { (exit 1); exit 1; }; };;
-       *) : ;;
-    esac
+  :
 
-    echo "$as_me:$LINENO: checking SSH options" >&5
-echo $ECHO_N "checking SSH options... $ECHO_C" >&6
-    # if we didn't get SSH options from the user, figure them out for ourselves
-    if test -z "$SSH_OPTIONS"; then
-       # TODO - quote these (or break them up in ssh-security??)
-       case `$SSH -V 2>&1` in
-           OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
-           *) SSH_OPTIONS='-x -o BatchMode=yes'
-       esac
-    fi
 
-    # now convert that to a comma-separated list of C strings
-    eval "set dummy ${SSH_OPTIONS}"; shift
-    SSH_OPTIONS=''
-    for i in "${@}"; do SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done
-    echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5
-echo "${ECHO_T}$SSH_OPTIONS" >&6
 
 
-cat >>confdefs.h <<_ACEOF
-#define SSH_OPTIONS $SSH_OPTIONS
-_ACEOF
 
-fi
+  if test $ac_cv_func_lstat = yes; then
+    HAVE_LSTAT=1
+  else
+    HAVE_LSTAT=0
+  fi
 
 
-# Check whether --with-bsdtcp-security or --without-bsdtcp-security was given.
-if test "${with_bsdtcp_security+set}" = set; then
-  withval="$with_bsdtcp_security"
-  BSDTCP_SECURITY=$withval
+      { echo "$as_me:$LINENO: checking whether mkdir is declared" >&5
+echo $ECHO_N "checking whether mkdir is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${BSDTCP_SECURITY=yes}
-
-fi;
-case "$BSDTCP_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSDTCP_SECURITY 1
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/stat.h>
 
-              BSDTCP_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-bsdudp-security or --without-bsdudp-security was given.
-if test "${with_bsdudp_security+set}" = set; then
-  withval="$with_bsdudp_security"
-  BSDUDP_SECURITY=$withval
-else
-  : ${BSDUDP_SECURITY=yes}
+int
+main ()
+{
+#ifndef mkdir
+  (void) mkdir;
+#endif
 
-fi;
-case "$BSDUDP_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSDUDP_SECURITY 1
+  ;
+  return 0;
+}
 _ACEOF
-
-              BSDUDP_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdudp-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-bsdudp-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
+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
-
-
-# Check whether --with-server-principal or --without-server-principal was given.
-if test "${with_server_principal+set}" = set; then
-  withval="$with_server_principal"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *)
-           SERVER_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_mkdir=yes
 else
-  : ${SERVER_HOST_PRINCIPLE="amanda"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_PRINCIPLE "$SERVER_HOST_PRINCIPLE"
-_ACEOF
-
-
-
-# Check whether --with-server-instance or --without-server-instance was given.
-if test "${with_server_instance+set}" = set; then
-  withval="$with_server_instance"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SERVER_HOST_INSTANCE="$withval"
-         ;;
-       esac
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-else
-  : ${SERVER_HOST_INSTANCE="amanda"}
+       ac_cv_have_decl_mkdir=no
+fi
 
-fi;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5
+echo "${ECHO_T}$ac_cv_have_decl_mkdir" >&6; }
+if test $ac_cv_have_decl_mkdir = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE"
+#define HAVE_DECL_MKDIR 1
 _ACEOF
 
 
-
-# Check whether --with-server-keyfile or --without-server-keyfile was given.
-if test "${with_server_keyfile+set}" = set; then
-  withval="$with_server_keyfile"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SERVER_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-
 else
-  : ${SERVER_HOST_KEY_FILE="/.amanda"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE"
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MKDIR 0
 _ACEOF
 
 
-
-# Check whether --with-client-principal or --without-client-principal was given.
-if test "${with_client_principal+set}" = set; then
-  withval="$with_client_principal"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-
+for ac_header in io.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  : ${CLIENT_HOST_PRINCIPLE="rcmd"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_PRINCIPLE "$CLIENT_HOST_PRINCIPLE"
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-
-# Check whether --with-client-instance or --without-client-instance was given.
-if test "${with_client_instance+set}" = set; then
-  withval="$with_client_instance"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_INSTANCE="$withval"
-         ;;
-       esac
-
-else
-  : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-
-
-
-# Check whether --with-client-keyfile or --without-client-keyfile was given.
-if test "${with_client_keyfile+set}" = set; then
-  withval="$with_client_keyfile"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
-  : ${CLIENT_HOST_KEY_FILE=KEYFILE}
-
-fi;
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Assume it's either KEYFILE (defined in krb.h), or a string filename...
-if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
-  CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
+       ac_header_compiler=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE
-_ACEOF
-
-
-
-# Check whether --with-ticket-lifetime or --without-ticket-lifetime was given.
-if test "${with_ticket_lifetime+set}" = set; then
-  withval="$with_ticket_lifetime"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) TICKET_LIFETIME="$withval"
-         ;;
-       esac
-
-else
-  : ${TICKET_LIFETIME=128}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define TICKET_LIFETIME $TICKET_LIFETIME
-_ACEOF
-
-
-
-: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
-
-
-# Check whether --with-krb5-security or --without-krb5-security was given.
-if test "${with_krb5_security+set}" = set; then
-  withval="$with_krb5_security"
-  KRB5_SECURITY="$withval"
-else
-  : ${KRB5_SECURITY=no}
-
-fi;
-
-case "$KRB5_SECURITY" in
-n | no) KRB5_SECURITY=no
-        KRB5_SPOTS=""
-       ;;
-y | ye | yes) : ;;
-*) KRB5_SPOTS="$KRB5_SECURITY"
-   KRB5_SECURITY=yes
-   ;;
-esac
-
-# if found, force the static versions of these libs (.a) by linking directly
-# with the .a files.  I don't know how to get -R dependancies checked
-# in autoconf at this time. -kashmir
-echo "$as_me:$LINENO: checking for Kerberos V" >&5
-echo $ECHO_N "checking for Kerberos V... $ECHO_C" >&6
-KRB5_DIR_FOUND=""
-KRB5_CFLAGS=""
-for dir in $KRB5_SPOTS; do
-  for lib in lib lib64; do
-    k5libdir=${dir}/${lib}
-    if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
-       if test -f ${k5libdir}/libk5crypto.a; then
-           K5CRYPTO=-lk5crypto
-       elif test -f ${k5libdir}/libcrypto.a; then
-           K5CRYPTO=-lcrypto
-       else
-           K5CRYPTO=""
-       fi
-       if test -f ${k5libdir}/libkrb5support.a; then
-           K5SUPPORT=-lkrb5support
-       else
-           K5SUPPORT=""
-       fi
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err"
-       KRB5CFLAGS=""
-       break
-    elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a"
-       KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
-       break
-    fi
-  done
-done
-
-if test "$KRB5_DIR_FOUND"; then
-       echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
-echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6
-       KRB5_SECURITY=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define KRB5_SECURITY 1
-_ACEOF
-
-       #
-       # some OS's, such as NetBSD, stick krb5 includes out of the way...
-       # should probably just use autoconf to look for various include
-       # options and set them, but don't quite want to do that until I've
-       # dug into it a bit more.
-       #
-       if test -d "$KRB5_DIR_FOUND/krb5" ; then
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5"
-       else
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include"
-       fi
-       if test "$KRB5_CFLAGS" ; then
-               KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS"
-       fi
-
-echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
-echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6
-if test "${ac_cv_lib_krb5support_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb5support  $LIBS"
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_krb5support_main=yes
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_krb5support_main=no
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
-echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6
-if test $ac_cv_lib_krb5support_main = yes; then
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB5SUPPORT 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-  LIBS="-lkrb5support $LIBS"
-
 fi
 
-       KRB5LDFLAGS=-L$k5libdir
-       break
-fi
+done
 
-if test "x$KRB5LDFLAGS" = "x" ; then
-    echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5
-echo "${ECHO_T}no krb5 system libraries found" >&6
 fi
 
 
+  if test $ac_cv_have_decl_mkdir = yes; then
+    HAVE_DECL_MKDIR=1
+  else
+    HAVE_DECL_MKDIR=0
+  fi
 
-# Check whether --with-low-tcpportrange or --without-low-tcpportrange was given.
-if test "${with_low_tcpportrange+set}" = set; then
-  withval="$with_low_tcpportrange"
+  if test "$ac_cv_header_io_h" = yes; then
+    HAVE_IO_H=1
+  else
+    HAVE_IO_H=0
+  fi
 
-       LOW_TCPPORTRANGE="$withval"
 
 
-fi;
 
-if test x"${LOW_TCPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
-       { { echo "$as_me:$LINENO: error: *** --with-low-tcpportrange requires two comma-separated positive numbers" >&5
-echo "$as_me: error: *** --with-low-tcpportrange requires two comma-separated positive numbers" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'`
-    max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'`
-    if test $min_low_tcp_port -gt $max_low_tcp_port; then
-       { { echo "$as_me:$LINENO: error: *** the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5
-echo "$as_me: error: *** the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    if test $min_low_tcp_port -lt 512; then
-       { echo "$as_me:$LINENO: WARNING: *** the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5
-echo "$as_me: WARNING: *** the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;}
-    fi
-    if test $max_low_tcp_port -ge 1024; then
-       { echo "$as_me:$LINENO: WARNING: *** the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5
-echo "$as_me: WARNING: *** the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;}
-    fi
 
-cat >>confdefs.h <<_ACEOF
-#define LOW_TCPPORTRANGE $LOW_TCPPORTRANGE
-_ACEOF
 
-fi
 
 
-# Check whether --with-tcpportrange or --without-tcpportrange was given.
-if test "${with_tcpportrange+set}" = set; then
-  withval="$with_tcpportrange"
+  :
 
-       TCPPORTRANGE="$withval"
 
 
-fi;
-if test x"${TCPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
-       { { echo "$as_me:$LINENO: error: *** --with-tcpportrange requires two comma-separated positive numbers" >&5
-echo "$as_me: error: *** --with-tcpportrange requires two comma-separated positive numbers" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
-    max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
-    if test $min_tcp_port -gt $max_tcp_port; then
-       { { echo "$as_me:$LINENO: error: *** the second TCP port number must be greater than the first in --with-tcpportrange" >&5
-echo "$as_me: error: *** the second TCP port number must be greater than the first in --with-tcpportrange" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    if test $min_tcp_port -lt 1024; then
-       { echo "$as_me:$LINENO: WARNING: *** the TCP port range should be 1024 or greater in --with-tcpportrange" >&5
-echo "$as_me: WARNING: *** the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;}
-    fi
-    if test $max_tcp_port -ge 65536; then
-       { echo "$as_me:$LINENO: WARNING: *** the TCP port range should be less than 65536 in --with-tcpportrange" >&5
-echo "$as_me: WARNING: *** the TCP port range should be less than 65536 in --with-tcpportrange" >&2;}
-    fi
 
-cat >>confdefs.h <<_ACEOF
-#define TCPPORTRANGE $TCPPORTRANGE
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <sys/stat.h>" >&5
+echo $ECHO_N "checking absolute name of <sys/stat.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_sys_stat_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+         if test $ac_cv_header_sys_stat_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+_ACEOF
+                                   gl_cv_next_sys_stat_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/sys/stat.h#{
+                s#.*"\(.*/sys/stat.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+         fi
 
 fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5
+echo "${ECHO_T}$gl_cv_next_sys_stat_h" >&6; }
+     fi
+     NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
 
 
-# Check whether --with-udpportrange or --without-udpportrange was given.
-if test "${with_udpportrange+set}" = set; then
-  withval="$with_udpportrange"
 
-       UDPPORTRANGE="$withval"
+  SYS_STAT_H='sys/stat.h'
 
 
-fi;
-if test x"${UDPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$UDPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
-       { { echo "$as_me:$LINENO: error: *** --with-udpportrange requires two comma-separated positive numbers" >&5
-echo "$as_me: error: *** --with-udpportrange requires two comma-separated positive numbers" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
-    max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
-    if test $min_udp_port -gt $max_udp_port; then
-       { { echo "$as_me:$LINENO: error: *** the second UDP port number must be greater than the first in --with-udpportrange" >&5
-echo "$as_me: error: *** the second UDP port number must be greater than the first in --with-udpportrange" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    if test $max_udp_port -ge 1024; then
-       { echo "$as_me:$LINENO: WARNING: *** the UDP port range should be less than 1024 in --with-udpportrange" >&5
-echo "$as_me: WARNING: *** the UDP port range should be less than 1024 in --with-udpportrange" >&2;}
-    fi
-    if test $min_udp_port -le 0; then
-       { echo "$as_me:$LINENO: WARNING: *** the UDP port range should be greater than 0 in --with-udpportrange" >&5
-echo "$as_me: WARNING: *** the UDP port range should be greater than 0 in --with-udpportrange" >&2;}
-    fi
+  { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
 
-cat >>confdefs.h <<_ACEOF
-#define UDPPORTRANGE $UDPPORTRANGE
-_ACEOF
+fi
 
+  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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
 fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
 
 
-# Check whether --with-maxtapeblocksize or --without-maxtapeblocksize was given.
-if test "${with_maxtapeblocksize+set}" = set; then
-  withval="$with_maxtapeblocksize"
 
-       MAXTAPEBLOCKSIZE="$withval"
 
+  { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${MAXTAPEBLOCKSIZE=32}
+  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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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;
+fi
 
+  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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE)
-_ACEOF
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS tempname.$ac_objext"
 
-# Check whether --with-db or --without-db was given.
-if test "${with_db+set}" = set; then
-  withval="$with_db"
+  :
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-db option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-db option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DB_STYLE="$withval"
-         ;;
-       esac
 
 
-fi;
-if test "$DB_STYLE"; then
-    case "$DB_STYLE" in
-       db | dbm | gdbm | ndbm | text)  ;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&5
-echo "$as_me: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&2;}
-   { (exit 1); exit 1; }; }
-           DB_STYLE=
-           ;;
-    esac
-fi
 
 
-# Check whether --with-mmap or --without-mmap was given.
-if test "${with_mmap+set}" = set; then
-  withval="$with_mmap"
-  FORCE_MMAP=$withval
-else
-  : ${FORCE_MMAP=no}
 
-fi;
-case "$FORCE_MMAP" in
-y | ye | yes | n | no) : ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
 
-# Check whether --with-buffered-dump or --without-buffered-dump was given.
-if test "${with_buffered_dump+set}" = set; then
-  withval="$with_buffered_dump"
-  DUMPER_SOCKET_BUFFERING=$withval
-else
-  : ${DUMPER_SOCKET_BUFFERING=no}
+  :
 
-fi;
-case "$DUMPER_SOCKET_BUFFERING" in
-n | no) :
-  ;;
-y | ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define DUMPER_SOCKET_BUFFERING 1
-_ACEOF
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-buffered-dump." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-buffered-dump." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
 
-# Check whether --with-assertions or --without-assertions was given.
-if test "${with_assertions+set}" = set; then
-  withval="$with_assertions"
-  ASSERTIONS="$withval"
-else
-  : ${ASSERTIONS=no}
 
-fi;
-case "$ASSERTIONS" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define ASSERTIONS 1
-_ACEOF
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_unistd_h='<'unistd.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <unistd.h>" >&5
+echo $ECHO_N "checking absolute name of <unistd.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_unistd_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-# Check whether --with-tmpdir or --without-tmpdir was given.
-if test "${with_tmpdir+set}" = set; then
-  withval="$with_tmpdir"
-  tmpdir="$withval"
-else
-  : ${tmpdir=yes}
-
-fi;
-tmpdir=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$tmpdir"
-)`
-case "$tmpdir" in
-n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5
-echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;}
-   { (exit 1); exit 1; }; };;
-y |  ye | yes)
-       AMANDA_TMPDIR="/tmp/amanda";;
-/*)
-       AMANDA_TMPDIR="$tmpdir";;
-*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-tmpdir option." >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-tmpdir option." >&2;}
-   { (exit 1); exit 1; }; };;
-esac
+         if test $ac_cv_header_unistd_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
 
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_TMPDIR "$AMANDA_TMPDIR"
 _ACEOF
+                                   gl_cv_next_unistd_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/unistd.h#{
+                s#.*"\(.*/unistd.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_unistd_h='<'unistd.h'>'
+         fi
 
+fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5
+echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; }
+     fi
+     NEXT_UNISTD_H=$gl_cv_next_unistd_h
 
 
 
-# Check whether --with-debugging or --without-debugging was given.
-if test "${with_debugging+set}" = set; then
-  withval="$with_debugging"
-  debugging="$withval"
-else
-  : ${debugging=yes}
-
-fi;
-debugging=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$debugging"
-)`
-case "$debugging" in
-n | no) AMANDA_DBGDIR="";;
-y |  ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
-/*) AMANDA_DBGDIR="$debugging";;
-*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-debugging option." >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-debugging option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-case "$AMANDA_DBGDIR" in
-"") :;;
-*)
-cat >>confdefs.h <<\_ACEOF
-#define DEBUG_CODE 1
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_DBGDIR "$AMANDA_DBGDIR"
-_ACEOF
+  :
 
-   ;;
-esac
 
 
-# Check whether --with-debug_days or --without-debug_days was given.
-if test "${with_debug_days+set}" = set; then
-  withval="$with_debug_days"
-  debug_days="$withval"
-else
-  : ${debug_days=4}
 
-fi;
-case "$debug_days" in
-n | no) AMANDA_DEBUG_DAYS=0 ;;
-y |  ye | yes) AMANDA_DEBUG_DAYS=4 ;;
-[0-9] | [0-9][0-9] | [0-9][0-9][0-9]) AMANDA_DEBUG_DAYS="$debug_days" ;;
-*) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5
-echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
 
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS
-_ACEOF
+  if test $ac_cv_header_unistd_h = yes; then
+    HAVE_UNISTD_H=1
+  else
+    HAVE_UNISTD_H=0
+  fi
 
 
 
 
-# Check whether --with-testing or --without-testing was given.
-if test "${with_testing+set}" = set; then
-  withval="$with_testing"
-  TESTING="$withval"
-else
-  : ${TESTING=no}
 
-fi;
-case "$TESTING" in
-n | no) SERVICE_SUFFIX="";;
-y |  ye | yes) SERVICE_SUFFIX="-test";;
-*) SERVICE_SUFFIX="-$TESTING";;
-esac
-AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
-KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
+  :
 
 
-cat >>confdefs.h <<_ACEOF
-#define SERVICE_SUFFIX "$SERVICE_SUFFIX"
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME"
-_ACEOF
 
+  if test $ac_cv_func_vasnprintf = no; then
 
-cat >>confdefs.h <<_ACEOF
-#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME"
-_ACEOF
 
+  :
 
-(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
 
-    tmp=`eval echo "$bindir"`
 
-cat >>confdefs.h <<_ACEOF
-#define bindir "$tmp"
-_ACEOF
 
 
-    tmp=`eval echo "$sbindir"`
+  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
+  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+  if test $ac_cv_func_vasnprintf = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define sbindir "$tmp"
+cat >>confdefs.h <<\_ACEOF
+#define REPLACE_VASNPRINTF 1
 _ACEOF
 
+  fi
 
-    tmp=`eval echo "$libexecdir"`
 
-cat >>confdefs.h <<_ACEOF
-#define libexecdir "$tmp"
-_ACEOF
 
 
-    tmp=`eval echo $mandir`
 
-cat >>confdefs.h <<_ACEOF
-#define mandir "$tmp"
-_ACEOF
 
-)
 
-DUMP_PROGRAMS="ufsdump dump backup"
-GETCONF_LFS="LFS"
 
-dump_returns_1=
-xenix_tapeio=
-case "$target" in
-    *-dec-osf*)
 
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_OSF1 1
-_ACEOF
-
-                       ;;
-    *-dg-*)
-                       DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
-                       : ${USE_RUNDUMP=yes}
-                       dump_returns_1=yes
-                       ;;
-    *-netbsd*)
-                       ;;
-    *-freebsd*)
-                       ;;
-    *-openbsd*)
-                       ;;
-    *-hp-*)
-                       MT_FILE_FLAG="-t"
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       case "$CC" in
-                           *gcc*)
-                               AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS"
-                               ;;
-                           *cc*)
-                               AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS"
-                               ;;
-                       esac
-                       ;;
-  *-ibm-aix*)
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
 
-cat >>confdefs.h <<\_ACEOF
-#define AIX_TAPEIO 1
+  { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
+echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_ptrdiff_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define AIX_BACKUP 1
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+typedef ptrdiff_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_ptrdiff_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-                       ;;
-  m88k-motorola-sysv4)
-                       ;;
-  *-nextstep3)
-                       ;;
-  *-pc-bsdi*)
-                       ;;
-  *-pc-linux-*)
-                       ;;
-  *-redhat-linux-*)
-                       ;;
-  *-suse-linux-*)
-                       ;;
-  x86_64-*-linux-*)
-                       ;;
-  alpha*-*-linux-*)
-                       ;;
-  sparc*-*-linux-*)
-                       ;;
-  powerpc-*-linux-*)
-                       ;;
-  *-sgi-irix3*)
-                                               CC=gcc
-                       ;;
-  *-sgi-irix4*)
-                       ;;
-  *-sgi-irix5*)
-                       ;;
-  *-sgi-irix6*)
-                       ;;
-  *-solaris2*)
-                       ;;
-  *-sun-sunos4.1*)
-                       ;;
-  *-ultrix*)
-                       : ${USE_RUNDUMP=yes}
+       ac_cv_type_ptrdiff_t=no
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_ULTRIX 1
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
+echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; }
+if test $ac_cv_type_ptrdiff_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
 _ACEOF
 
-                       dump_returns_1=yes
-                       ;;
-  *-sysv4.2uw2*)
 
-cat >>confdefs.h <<\_ACEOF
-#define UWARE_TAPEIO 1
-_ACEOF
+fi
 
-                       ;;
-  *-sco3.2v4*)
-                       DEV_PREFIX=/dev/
-                       RDEV_PREFIX=/dev/
-                       ;;
-  *-sco3.2v5*)
-                       xenix_tapeio=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_SCO_OS5 1
-_ACEOF
 
-                       ;;
-  i386-pc-isc4*)
-                       xenix_tapeio=yes
-                       ;;
-  *-sni-sysv4)
-                       ;;
-  *-pc-cygwin)
 
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_TAR_ERRORS 1
-_ACEOF
 
-                       # Cygwin needs PATH to find cygwin1.dll
 
-cat >>confdefs.h <<\_ACEOF
-#define NEED_PATH_ENV 1
-_ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_UID_CHECK 1
-_ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_FSTAB 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define DONT_SUID_ROOT 1
-_ACEOF
-
-                       NEED_SETUID_CLIENT=false
-                       NEED_RUNTIME_PSEUDO_RELOC=true
-                       BROKEN_IPV6=true
-                       ;;
-  *)
-                       cat <<END
-
-*****
-This machine, target type $target, is not known
-to be fully supported by this configure script.  If the
-installation of Amanda on this system succeeds or needed
-any patches, please email amanda-hackers@amanda.org with
-the patches or an indication of the sucess or failure of
-the Amanda installation on your system.
-*****
-
-END
-               ;;
-esac
-
-if test -n "$dump_returns_1"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define DUMP_RETURNS_1 1
-_ACEOF
-
-fi
-
-if test -n "$xenix_tapeio"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define XENIX_TAPEIO 1
-_ACEOF
-
-fi
-
-AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS"
-AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES"
-AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS"
-AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS"
-CFLAGS="$CFLAGS $AMANDA_CFLAGS"
-CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS"
-LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS"
-LIBS="$AMANDA_LIBS $LIBS"
-
-
-: ${MT_FILE_FLAG="-f"}
-
-
-cat >>confdefs.h <<_ACEOF
-#define MT_FILE_FLAG "$MT_FILE_FLAG"
-_ACEOF
-
-
-# ------ AX CREATE STDINT H -------------------------------------
-echo "$as_me:$LINENO: checking for stdint types" >&5
-echo $ECHO_N "checking for stdint types... $ECHO_C" >&6
-ac_stdint_h=`echo common-src/amanda-int.h`
-# try to shortcircuit - if the default include path of the compiler
-# can find a "stdint.h" header then we assume that all compilers can.
-if test "${ac_cv_header_stdint_t+set}" = set; then
+for ac_func in snprintf wcslen
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
-old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
-old_CFLAGS="$CFLAGS"     ; CFLAGS=""
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdint.h>
-int
-main ()
-{
-int_least32_t v = 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_stdint_result="(assuming C99 compatible system)"
- ac_cv_header_stdint_t="stdint.h";
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdint_t=""
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-CXXFLAGS="$old_CXXFLAGS"
-CPPFLAGS="$old_CPPFLAGS"
-CFLAGS="$old_CFLAGS"
-fi
-
-
-v="... $ac_cv_header_stdint_h"
-if test "$ac_stdint_h" = "stdint.h" ; then
- echo "$as_me:$LINENO: result: (are you sure you want them in ./stdint.h?)" >&5
-echo "${ECHO_T}(are you sure you want them in ./stdint.h?)" >&6
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- echo "$as_me:$LINENO: result: (are you sure you want them in ./inttypes.h?)" >&5
-echo "${ECHO_T}(are you sure you want them in ./inttypes.h?)" >&6
-elif test "_$ac_cv_header_stdint_t" = "_" ; then
- echo "$as_me:$LINENO: result: (putting them into $ac_stdint_h)$v" >&5
-echo "${ECHO_T}(putting them into $ac_stdint_h)$v" >&6
-else
- ac_cv_header_stdint="$ac_cv_header_stdint_t"
- echo "$as_me:$LINENO: result: $ac_cv_header_stdint (shortcircuit)" >&5
-echo "${ECHO_T}$ac_cv_header_stdint (shortcircuit)" >&6
-fi
-
-if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
-
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-inttype_headers=`echo  | sed -e 's/,/ /g'`
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-ac_cv_stdint_result="(no helpful system typedefs seen)"
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-echo "$as_me:$LINENO: checking for stdint uintptr_t" >&5
-echo $ECHO_N "checking for stdint uintptr_t... $ECHO_C" >&6
-if test "${ac_cv_header_stdint_x+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+#undef $ac_func
 
- ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
-  echo "$as_me:$LINENO: result: (..)" >&5
-echo "${ECHO_T}(..)" >&6
-  for i in    stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do
-   unset ac_cv_type_uintptr_t
-   unset ac_cv_type_uint64_t
-   echo "$as_me:$LINENO: checking for uintptr_t" >&5
-echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
-if test "${ac_cv_type_uintptr_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$i>
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
 int
 main ()
 {
-if ((uintptr_t *) 0)
-  return 0;
-if (sizeof (uintptr_t))
-  return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_uintptr_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uintptr_t=no
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
-echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
-if test $ac_cv_type_uintptr_t = yes; then
-  ac_cv_header_stdint_x=$i
-else
-  continue
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
+done
 
-   echo "$as_me:$LINENO: checking for uint64_t" >&5
-echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6
-if test "${ac_cv_type_uint64_t+set}" = set; then
+      { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5
+echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl__snprintf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14696,2705 +17257,1609 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include<$i>
+#include <stdio.h>
 
 int
 main ()
 {
-if ((uint64_t *) 0)
-  return 0;
-if (sizeof (uint64_t))
-  return 0;
+#ifndef _snprintf
+  (void) _snprintf;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_uint64_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl__snprintf=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uint64_t=no
+       ac_cv_have_decl__snprintf=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5
-echo "${ECHO_T}$ac_cv_type_uint64_t" >&6
-if test $ac_cv_type_uint64_t = yes; then
-  and64="/uint64_t"
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5
+echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; }
+if test $ac_cv_have_decl__snprintf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF 1
+_ACEOF
+
+
 else
-  and64=""
-fi
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF 0
+_ACEOF
 
-      stdint.h inttypes.h sys/inttypes.h $inttype_headers
- break
-  done
-  echo "$as_me:$LINENO: checking for stdint uintptr_t" >&5
-echo $ECHO_N "checking for stdint uintptr_t... $ECHO_C" >&6
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_x" >&5
-echo "${ECHO_T}$ac_cv_header_stdint_x" >&6
 
 
-if test "_$ac_cv_header_stdint_x" = "_" ; then
 
-echo "$as_me:$LINENO: checking for stdint uint32_t" >&5
-echo $ECHO_N "checking for stdint uint32_t... $ECHO_C" >&6
-if test "${ac_cv_header_stdint_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
- ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
-  echo "$as_me:$LINENO: result: (..)" >&5
-echo "${ECHO_T}(..)" >&6
-  for i in    inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   echo "$as_me:$LINENO: checking for uint32_t" >&5
-echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6
-if test "${ac_cv_type_uint32_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$i>
 
-int
-main ()
-{
-if ((uint32_t *) 0)
-  return 0;
-if (sizeof (uint32_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_uint32_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uint32_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5
-echo "${ECHO_T}$ac_cv_type_uint32_t" >&6
-if test $ac_cv_type_uint32_t = yes; then
-  ac_cv_header_stdint_o=$i
-else
-  continue
-fi
+  fi
 
-   echo "$as_me:$LINENO: checking for uint64_t" >&5
-echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6
-if test "${ac_cv_type_uint64_t+set}" = set; then
+
+
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5
+echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; }
+    if test "${gl_cv_cc_visibility+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include<$i>
-
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
 int
 main ()
 {
-if ((uint64_t *) 0)
-  return 0;
-if (sizeof (uint64_t))
-  return 0;
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_uint64_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_cc_visibility=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_uint64_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       gl_cv_cc_visibility=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5
-echo "${ECHO_T}$ac_cv_type_uint64_t" >&6
-if test $ac_cv_type_uint64_t = yes; then
-  and64="/uint64_t"
-else
-  and64=""
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$gl_save_CFLAGS"
 fi
 
-      inttypes.h sys/inttypes.h stdint.h $inttype_headers
- break
-   break;
-  done
-  echo "$as_me:$LINENO: checking for stdint uint32_t" >&5
-echo $ECHO_N "checking for stdint uint32_t... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5
+echo "${ECHO_T}$gl_cv_cc_visibility" >&6; }
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_o" >&5
-echo "${ECHO_T}$ac_cv_header_stdint_o" >&6
 
-fi
 
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-if test "_$ac_cv_header_stdint_o" = "_" ; then
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
 
-echo "$as_me:$LINENO: checking for stdint u_int32_t" >&5
-echo $ECHO_N "checking for stdint u_int32_t... $ECHO_C" >&6
-if test "${ac_cv_header_stdint_u+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
- ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
-  echo "$as_me:$LINENO: result: (..)" >&5
-echo "${ECHO_T}(..)" >&6
-  for i in    sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   echo "$as_me:$LINENO: checking for u_int32_t" >&5
-echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int32_t+set}" = set; then
+
+
+  { echo "$as_me:$LINENO: checking whether <wchar.h> is standalone" >&5
+echo $ECHO_N "checking whether <wchar.h> is standalone... $ECHO_C" >&6; }
+if test "${gl_cv_header_wchar_h_standalone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$i>
-
-int
-main ()
-{
-if ((u_int32_t *) 0)
-  return 0;
-if (sizeof (u_int32_t))
-  return 0;
-  ;
-  return 0;
-}
+#include <wchar.h>
+wchar_t w;
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_u_int32_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_header_wchar_h_standalone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_u_int32_t=no
+       gl_cv_header_wchar_h_standalone=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6
-if test $ac_cv_type_u_int32_t = yes; then
-  ac_cv_header_stdint_u=$i
-else
-  continue
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5
+echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; }
+  if test $gl_cv_header_wchar_h_standalone != yes; then
+    WCHAR_H=wchar.h
+  fi
 
-   echo "$as_me:$LINENO: checking for u_int64_t" >&5
-echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6
-if test "${ac_cv_type_u_int64_t+set}" = set; then
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+
+
+
+
+  :
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_wchar_h='<'wchar.h'>'
+     else
+       { echo "$as_me:$LINENO: checking absolute name of <wchar.h>" >&5
+echo $ECHO_N "checking absolute name of <wchar.h>... $ECHO_C" >&6; }
+if test "${gl_cv_next_wchar_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+         if test $ac_cv_header_wchar_h = yes; then
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include<$i>
+#include <wchar.h>
 
-int
-main ()
-{
-if ((u_int64_t *) 0)
-  return 0;
-if (sizeof (u_int64_t))
-  return 0;
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_u_int64_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+                                   gl_cv_next_wchar_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+              sed -n '\#/wchar.h#{
+                s#.*"\(.*/wchar.h\)".*#\1#
+                s#^/[^/]#//&#
+                p
+                q
+              }'`'"'
+         else
+           gl_cv_next_wchar_h='<'wchar.h'>'
+         fi
 
-ac_cv_type_u_int64_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6
-if test $ac_cv_type_u_int64_t = yes; then
-  and64="/u_int64_t"
-else
-  and64=""
 fi
+{ echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5
+echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; }
+     fi
+     NEXT_WCHAR_H=$gl_cv_next_wchar_h
+
+
+
 
-      sys/types.h inttypes.h sys/inttypes.h $inttype_headers
- break
-   break;
-  done
-  echo "$as_me:$LINENO: checking for stdint u_int32_t" >&5
-echo $ECHO_N "checking for stdint u_int32_t... $ECHO_C" >&6
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdint_u" >&5
-echo "${ECHO_T}$ac_cv_header_stdint_u" >&6
 
-fi fi
 
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-   echo "$as_me:$LINENO: checking for stdint datatype model" >&5
-echo $ECHO_N "checking for stdint datatype model... $ECHO_C" >&6
-   echo "$as_me:$LINENO: result: (..)" >&5
-echo "${ECHO_T}(..)" >&6
 
-   echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6
-if test "${ac_cv_type_char+set}" = set; then
+for ac_header in stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-if ((char *) 0)
-  return 0;
-if (sizeof (char))
-  return 0;
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_char=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_char=no
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6
 
-echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6
-if test "${ac_cv_sizeof_char+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$ac_cv_type_char" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
-test_array [0] = 0
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
-test_array [0] = 0
+fi
+
+done
+
+
+
+
+
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+
+
+
+    # support deprecated ./configure flags to set various compiler flags
+
+
+# Check whether --with-cflags was given.
+if test "${with_cflags+set}" = set; then
+  withval=$with_cflags;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;}
+   { (exit 1); exit 1; }; }
+               ;;
+           esac
+
+           CFLAGS="$withval"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+
+
+# Check whether --with-includes was given.
+if test "${with_includes+set}" = set; then
+  withval=$with_includes;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           esac
+
+           for dir in $withval; do
+               if test -d "$dir"; then
+                   CPPFLAGS="$CPPFLAGS -I$dir"
+               else
+
+    { echo "$as_me:$LINENO: WARNING: Include directory $dir does not exist." >&5
+echo "$as_me: WARNING: Include directory $dir does not exist." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Include directory $dir does not exist.
+AAW_EOF
+
+
+               fi
+           done
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+# Check whether --with-libraries was given.
+if test "${with_libraries+set}" = set; then
+  withval=$with_libraries;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           esac
+
+           for dir in $withval; do
+               if test -d "$dir"; then
+                   case "$target" in
+                     *-solaris2*,*-netbsd*)
+                           LDFLAGS="$LDFLAGS -R$dir"
+                           ;;
+                   esac
+                   LDFLAGS="$LDFLAGS -L$dir"
+               else
+
+    { echo "$as_me:$LINENO: WARNING: Library directory $dir does not exist." >&5
+echo "$as_me: WARNING: Library directory $dir does not exist." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Library directory $dir does not exist.
+AAW_EOF
+
+
+               fi
+           done
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+
+    # Warn for just about everything
+
+
+
+    { echo "$as_me:$LINENO: checking for gcc flag -Wall" >&5
+echo $ECHO_N "checking for gcc flag -Wall... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wall[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wall"
+
+
+    else
+       :
+    fi
+
+
+    # And add any extra warnings too
+
+
+
+    { echo "$as_me:$LINENO: checking for gcc flag -Wextra" >&5
+echo $ECHO_N "checking for gcc flag -Wextra... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wextra[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wextra"
+
+
+    else
+
+
+
+    { echo "$as_me:$LINENO: checking for gcc flag -W" >&5
+echo $ECHO_N "checking for gcc flag -W... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '^[:alnum:]-W^[:alnum:]-' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -W"
+
+
+    else
+       :
+    fi
+
+
+    fi
+
+
+
+CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+
+
+#
+# Configuration flags (--with-xxx and --enable-xxx)
+#
+
+
+
+# Check whether --with-user was given.
+if test "${with_user+set}" = set; then
+  withval=$with_user;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *)
+                    CLIENT_LOGIN="$withval"
+                  ;;
+            esac
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+
+    { echo "$as_me:$LINENO: WARNING: no user specified (--with-user) -- using 'amanda'" >&5
+echo "$as_me: WARNING: no user specified (--with-user) -- using 'amanda'" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+no user specified (--with-user) -- using 'amanda'
+AAW_EOF
+
+
+           CLIENT_LOGIN=amanda
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_LOGIN "$CLIENT_LOGIN"
+_ACEOF
+
+
+
+
+
+# Check whether --with-group was given.
+if test "${with_group+set}" = set; then
+  withval=$with_group;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) SETUID_GROUP="$withval"
+                  ;;
+            esac
+
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+
+
+    { echo "$as_me:$LINENO: WARNING: no group specified (--with-group) -- using 'backup'" >&5
+echo "$as_me: WARNING: no group specified (--with-group) -- using 'backup'" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+no group specified (--with-group) -- using 'backup'
+AAW_EOF
+
+
+           CLIENT_LOGIN=backup
+
+
+fi
+
+
+
+
+
+# Check whether --with-dumperdir was given.
+if test "${with_dumperdir+set}" = set; then
+  withval=$with_dumperdir;
+
+    { echo "$as_me:$LINENO: WARNING: --with-dumperdir is no longer used." >&5
+echo "$as_me: WARNING: --with-dumperdir is no longer used." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+--with-dumperdir is no longer used.
+AAW_EOF
+
+
+
+
+fi
+
+
+
+
+# Check whether --with-configdir was given.
+if test "${with_configdir+set}" = set; then
+  withval=$with_configdir;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;}
    { (exit 1); exit 1; }; }
+             ;;
+           *) CONFIG_DIR="$withval"
+             ;;
+           esac
+
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (char)); }
-unsigned long ulongval () { return (long) (sizeof (char)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (char))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (char))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (char))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+           : ${CONFIG_DIR='${sysconfdir}/amanda'} # (variable will be evaluated below)
 
-  ;
-  return 0;
-}
+
+fi
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$CONFIG_DIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  CONFIG_DIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONFIG_DIR "$ac_define_dir"
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_char=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&2;}
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+
+# Check whether --with-indexdir was given.
+if test "${with_indexdir+set}" = set; then
+  withval=$with_indexdir;    { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&2;}
    { (exit 1); exit 1; }; }
+
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+
+
+
+# Check whether --with-dbdir was given.
+if test "${with_dbdir+set}" = set; then
+  withval=$with_dbdir;    { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&2;}
+   { (exit 1); exit 1; }; }
+
 fi
+
+
+
+
+# Check whether --with-logdir was given.
+if test "${with_logdir+set}" = set; then
+  withval=$with_logdir;    { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&2;}
+   { (exit 1); exit 1; }; }
+
 fi
-rm -f conftest.val
+
+
+
+
+# Check whether --with-suffixes was given.
+if test "${with_suffixes+set}" = set; then
+  withval=$with_suffixes; USE_VERSION_SUFFIXES=$withval
 else
-  ac_cv_sizeof_char=0
-fi
+  : ${USE_VERSION_SUFFIXES=no}
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
 
 
-   echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6
-if test "${ac_cv_type_short+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((short *) 0)
-  return 0;
-if (sizeof (short))
-  return 0;
-  ;
-  return 0;
-}
+    case "$USE_VERSION_SUFFIXES" in
+    y | ye | yes) USE_VERSION_SUFFIXES=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_VERSION_SUFFIXES 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_short=yes
+
+
+       program_suffix="-$VERSION_SUFFIX"
+       # This is from the output of configure.in.
+       if test "x$program_transform_name" = xs,x,x,; then
+           program_transform_name=
+       else
+           # Double any \ or $.  echo might interpret backslashes.
+           cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+           program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+           rm -f conftestsed
+       fi
+       test "x$program_prefix" != xNONE &&
+           program_transform_name="s,^,${program_prefix},; $program_transform_name"
+       # Use a double $ so make ignores it.
+       test "x$program_suffix" != xNONE &&
+           program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+       # sed with no file args requires a program.
+       test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
+       # Remove empty command
+       cat <<\EOF_SED > conftestsed
+s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
+EOF_SED
+       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+       rm -f conftestsed
+      ;;
+    n | no) USE_VERSION_SUFFIXES=no
+      ;;
+    *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+    esac
+
+
+
+
+
+# Check whether --with-gnutar-listdir was given.
+if test "${with_gnutar_listdir+set}" = set; then
+  withval=$with_gnutar_listdir;
+            case "$withval" in
+                n | no) GNUTAR_LISTDIR= ;;
+                y | ye | yes) GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' ;;
+                *) GNUTAR_LISTDIR="$withval" ;;
+            esac
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_short=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+            GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists'
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6
 
-echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6
-if test "${ac_cv_sizeof_short+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$ac_cv_type_short" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
-test_array [0] = 0
+    # substitute $prefix, etc. if necessary
 
-  ;
-  return 0;
-}
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$GNUTAR_LISTDIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  GNUTAR_LISTED_INCREMENTAL_DIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNUTAR_LISTED_INCREMENTAL_DIR "$ac_define_dir"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+    # handle deprecated option
+
+# Check whether --with-gnutar-listed-incremental was given.
+if test "${with_gnutar_listed_incremental+set}" = set; then
+  withval=$with_gnutar_listed_incremental;
+            { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&5
+echo "$as_me: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&2;}
+   { (exit 1); exit 1; }; }
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+
+
+
+# Check whether --with-tmpdir was given.
+if test "${with_tmpdir+set}" = set; then
+  withval=$with_tmpdir;
+            tmpdir="$withval"
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)];
-test_array [0] = 0
+            tmpdir=yes
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+fi
+
+
+    case "$tmpdir" in
+        n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5
+echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;}
+   { (exit 1); exit 1; }; };;
+        y |  ye | yes) AMANDA_TMPDIR="/tmp/amanda";;
+        *) AMANDA_TMPDIR="$tmpdir";;
+    esac
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$AMANDA_TMPDIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  AMANDA_TMPDIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_TMPDIR "$ac_define_dir"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+
+# Check whether --with-force-uid was given.
+if test "${with_force_uid+set}" = set; then
+  withval=$with_force_uid; CHECK_USERID="$withval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  : ${CHECK_USERID=yes}
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+    case "$CHECK_USERID" in
+        y | ye | yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define CHECK_USERID 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+
+          ;;
+        n | no) :
+          ;;
+        *)
+            { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;}
+   { (exit 1); exit 1; }; }
+    esac
+
+
+
+
+# Check whether --with-owner was given.
+if test "${with_owner+set}" = set; then
+  withval=$with_owner;
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+                { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            *) BINARY_OWNER="$withval"
+              ;;
+            esac
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+            BINARY_OWNER="$CLIENT_LOGIN"
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_short=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define BINARY_OWNER "$BINARY_OWNER"
+_ACEOF
+
+
+
+
+
+# Check whether --with-fqdn was given.
+if test "${with_fqdn+set}" = set; then
+  withval=$with_fqdn;  USE_FQDN=$withval
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+   USE_FQDN=no
+fi
+
+
+    case "$USE_FQDN" in
+    n | no) : ;;
+    y |  ye | yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_FQDN 1
+_ACEOF
+
+      ;;
+    *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-fqdn option." >&5
+echo "$as_me: error: You must not supply an argument to --with-fqdn option." >&2;}
    { (exit 1); exit 1; }; }
+      ;;
+    esac
+
+
+
+# Check whether --with-reuseports was given.
+if test "${with_reuseports+set}" = set; then
+  withval=$with_reuseports;  case "$withval" in
+           y | ye | yes) USE_REUSEADDR=no;;
+           n | no) USE_REUSEADDR=yes;;
+           *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --without-reuseports" >&5
+echo "$as_me: error: You must not supply an argument to --without-reuseports" >&2;}
+   { (exit 1); exit 1; }; };;
+         esac
+
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (short)); }
-unsigned long ulongval () { return (long) (sizeof (short)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
+   USE_REUSEADDR=yes;
+fi
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (short))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (short))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (short))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+    if test x"$USE_REUSEADDR" = x"yes"; then
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define USE_REUSEADDR 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_short=`cat conftest.val`
+
+    fi
+
+
+
+# Check whether --with-low-tcpportrange was given.
+if test "${with_low_tcpportrange+set}" = set; then
+  withval=$with_low_tcpportrange;  LOW_TCPPORTRANGE="$withval"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   LOW_TCPPORTRANGE=unlimited
+fi
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short), 77
-See \`config.log' for more details." >&2;}
+
+    if test x"$LOW_TCPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
+           { { echo "$as_me:$LINENO: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&5
+echo "$as_me: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&2;}
    { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
+       fi
+       min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'`
+       max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'`
+       if test $min_low_tcp_port -gt $max_low_tcp_port; then
+           { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5
+echo "$as_me: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+       if test $min_low_tcp_port -lt 512; then
+
+    { echo "$as_me:$LINENO: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5
+echo "$as_me: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the low TCP port range should be 512 or greater in --with-low-tcpportrange
+AAW_EOF
+
+
+       fi
+       if test $max_low_tcp_port -ge 1024; then
+
+    { echo "$as_me:$LINENO: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5
+echo "$as_me: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the low TCP port range should be less than 1024 in --with-low-tcpportrange
+AAW_EOF
+
+
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define LOW_TCPPORTRANGE $LOW_TCPPORTRANGE
+_ACEOF
+
+    fi
+
+
+# Check whether --with-tcpportrange was given.
+if test "${with_tcpportrange+set}" = set; then
+  withval=$with_tcpportrange;  TCPPORTRANGE="$withval"
 else
-  ac_cv_sizeof_short=0
+   TCPPORTRANGE="unlimited"
 fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6
+
+
+    if test x"$TCPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
+           { { echo "$as_me:$LINENO: error: --with-tcpportrange requires two comma-separated positive numbers" >&5
+echo "$as_me: error: --with-tcpportrange requires two comma-separated positive numbers" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+       min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
+       max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
+       if test $min_tcp_port -gt $max_tcp_port; then
+           { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&5
+echo "$as_me: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+       if test $min_tcp_port -lt 1024; then
+
+    { echo "$as_me:$LINENO: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&5
+echo "$as_me: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the TCP port range should be 1024 or greater in --with-tcpportrange
+AAW_EOF
+
+
+       fi
+       if test $max_tcp_port -ge 65536; then
+
+    { echo "$as_me:$LINENO: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&5
+echo "$as_me: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the TCP port range should be less than 65536 in --with-tcpportrange
+AAW_EOF
+
+
+       fi
+
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
+#define TCPPORTRANGE $TCPPORTRANGE
 _ACEOF
 
+    fi
 
-   echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6
-if test "${ac_cv_type_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+# Check whether --with-udpportrange was given.
+if test "${with_udpportrange+set}" = set; then
+  withval=$with_udpportrange;  UDPPORTRANGE="$withval"
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((int *) 0)
-  return 0;
-if (sizeof (int))
-  return 0;
-  ;
-  return 0;
-}
+   UDPPORTRANGE="unlimited"
+fi
+
+    if test x"$UDPPORTRANGE" != x"unlimited"; then
+       if test x`echo "$UDPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then
+           { { echo "$as_me:$LINENO: error: --with-udpportrange requires two comma-separated positive numbers" >&5
+echo "$as_me: error: --with-udpportrange requires two comma-separated positive numbers" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+       min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
+       max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
+       if test $min_udp_port -gt $max_udp_port; then
+           { { echo "$as_me:$LINENO: error: the second UDP port number must be greater than the first in --with-udpportrange" >&5
+echo "$as_me: error: the second UDP port number must be greater than the first in --with-udpportrange" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+       if test $max_udp_port -ge 1024; then
+
+    { echo "$as_me:$LINENO: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&5
+echo "$as_me: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the UDP port range should be less than 1025 in --with-udpportrange
+AAW_EOF
+
+
+       fi
+       if test $min_udp_port -le 0; then
+
+    { echo "$as_me:$LINENO: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&5
+echo "$as_me: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+the UDP port range should be greater than 0 in --with-udpportrange
+AAW_EOF
+
+
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define UDPPORTRANGE $UDPPORTRANGE
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6
+    fi
 
-echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+# Check whether --with-buffered-dump was given.
+if test "${with_buffered_dump+set}" = set; then
+  withval=$with_buffered_dump;  DUMPER_SOCKET_BUFFERING=$withval
 else
-  if test "$ac_cv_type_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
-test_array [0] = 0
+   DUMPER_SOCKET_BUFFERING=no
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
+    case "$DUMPER_SOCKET_BUFFERING" in
+    n | no) ;;
+    y | ye | yes)
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define DUMPER_SOCKET_BUFFERING 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+
+      ;;
+    *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-buffered-dump." >&5
+echo "$as_me: error: You must not supply an argument to --with-buffered-dump." >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+
+
+
+# Check whether --with-maxtapeblocksize was given.
+if test "${with_maxtapeblocksize+set}" = set; then
+  withval=$with_maxtapeblocksize;  MAXTAPEBLOCKSIZE="$withval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   MAXTAPEBLOCKSIZE=32
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+cat >>confdefs.h <<_ACEOF
+#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE)
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+
+
+
+
+# Check whether --with-assertions was given.
+if test "${with_assertions+set}" = set; then
+  withval=$with_assertions;
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define ASSERTIONS 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+                  ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+            esac
+
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+
+
+
+
+# Check whether --with-debugging was given.
+if test "${with_debugging+set}" = set; then
+  withval=$with_debugging;  debugging="$withval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   debugging="yes"
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (int)); }
-unsigned long ulongval () { return (long) (sizeof (int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (int))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (int))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
 
-  ;
-  return 0;
-}
+    case "$debugging" in
+        n | no) { { echo "$as_me:$LINENO: error: Amanda no longer supports building with debugging disabled" >&5
+echo "$as_me: error: Amanda no longer supports building with debugging disabled" >&2;}
+   { (exit 1); exit 1; }; };;
+        y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
+        *) AMANDA_DBGDIR="$debugging";;
+    esac
+
+    # evaluate any extra variables in the directory
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$AMANDA_DBGDIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  AMANDA_DBGDIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_DBGDIR "$ac_define_dir"
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+
+# Check whether --with-debug_days was given.
+if test "${with_debug_days+set}" = set; then
+  withval=$with_debug_days;
+            debug_days="$withval"
+
 else
-  ac_cv_sizeof_int=0
-fi
+
+            debug_days="yes"
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+
+    case "$debug_days" in
+        n | no)
+            AMANDA_DEBUG_DAYS=0 ;;
+        y |  ye | yes)
+            AMANDA_DEBUG_DAYS=4 ;;
+        [0-9] | [0-9][0-9] | [0-9][0-9][0-9])
+            AMANDA_DEBUG_DAYS="$debug_days" ;;
+        *) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5
+echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;}
+   { (exit 1); exit 1; }; }
+          ;;
+    esac
+
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS
 _ACEOF
 
 
-   echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6
-if test "${ac_cv_type_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((long *) 0)
-  return 0;
-if (sizeof (long))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_long=yes
+
+
+
+# Check whether --with-testing was given.
+if test "${with_testing+set}" = set; then
+  withval=$with_testing;
+            TESTING="$withval"
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+            TESTING="no"
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6
 
-echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$ac_cv_type_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
-test_array [0] = 0
+    case "$TESTING" in
+        n | no) SERVICE_SUFFIX="";;
+        y |  ye | yes) SERVICE_SUFFIX="-test";;
+        *) SERVICE_SUFFIX="-$TESTING";;
+    esac
 
-  ;
-  return 0;
-}
+    AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
+    KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SERVICE_SUFFIX "$SERVICE_SUFFIX"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME"
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+
+cat >>confdefs.h <<_ACEOF
+#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+
+
+    SINGLE_USERID=${SINGLE_USERID:-no}
+    WANT_SETUID_CLIENT=${WANT_SETUID_CLIENT:-true}
+
+
+# Check whether --with-single-userid was given.
+if test "${with_single_userid+set}" = set; then
+  withval=$with_single_userid;    SINGLE_USERID=$withval
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+    case "$target" in
+        *-pc-cygwin)
+            WANT_SETUID_CLIENT=false
+           SINGLE_USERID=yes
+            ;;
+    esac
+
+    if test x"$WANT_SETUID_CLIENT" = x"true"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_SETUID_CLIENT 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+    fi
+     if test x"$WANT_SETUID_CLIENT" = x"true"; then
+  WANT_SETUID_CLIENT_TRUE=
+  WANT_SETUID_CLIENT_FALSE='#'
+else
+  WANT_SETUID_CLIENT_TRUE='#'
+  WANT_SETUID_CLIENT_FALSE=
+fi
+
+
+    if test x"$SINGLE_USERID" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SINGLE_USERID 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+
+    fi
+
+
+    WANT_INSTALLPERMS=yes
+    # Check whether --enable-installperms was given.
+if test "${enable_installperms+set}" = set; then
+  enableval=$enable_installperms;  WANT_INSTALLPERMS="$enableval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   WANT_INSTALLPERMS="yes"
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+     if test x"$WANT_INSTALLPERMS" = x"yes"; then
+  WANT_INSTALLPERMS_TRUE=
+  WANT_INSTALLPERMS_FALSE='#'
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  WANT_INSTALLPERMS_TRUE='#'
+  WANT_INSTALLPERMS_FALSE=
+fi
+
+
+
+
+#
+# Set up for Amanda components and modules
+#
+
+    WANT_SERVER=true
+
+# Check whether --with-server was given.
+if test "${with_server+set}" = set; then
+  withval=$with_server;
+           case "$withval" in
+           y | ye | yes) WANT_SERVER=true;;
+           n | no) WANT_SERVER=false;;
+           *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-server option." >&5
+echo "$as_me: error: You must not supply an argument to the --without-server option." >&2;}
+   { (exit 1); exit 1; }; } ;;
+           esac
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+    WANT_CLIENT=true
+
+# Check whether --with-client was given.
+if test "${with_client+set}" = set; then
+  withval=$with_client;
+           case "$withval" in
+           y | ye | yes) WANT_CLIENT=true;;
+           n | no) WANT_CLIENT=false;;
+           *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-client option." >&5
+echo "$as_me: error: You must not supply an argument to the --without-client option." >&2;}
+   { (exit 1); exit 1; }; } ;;
+           esac
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+
+
+    WANT_RESTORE=${WANT_SERVER-true}
+
+# Check whether --with-restore was given.
+if test "${with_restore+set}" = set; then
+  withval=$with_restore;
+           case "$withval" in
+           y | ye | yes) WANT_RESTORE=true;;
+           n | no) WANT_RESTORE=false;;
+           *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-restore option." >&5
+echo "$as_me: error: You must not supply an argument to --with-restore option." >&2;}
+   { (exit 1); exit 1; }; } ;;
+           esac
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
+
+
+
+
+    WANT_RECOVER=${WANT_CLIENT-true}
+
+# Check whether --with-amrecover was given.
+if test "${with_amrecover+set}" = set; then
+  withval=$with_amrecover;
+           case "$withval" in
+           y | ye | yes) WANT_RECOVER=false;;
+           n | no) WANT_RECOVER=false;;
+           *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-amrecover option." >&5
+echo "$as_me: error: You must not supply an argument to --with-amrecover option." >&2;}
    { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (long)); }
-unsigned long ulongval () { return (long) (sizeof (long)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
+           esac
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
+
+
+# Check whether --with-client-only was given.
+if test "${with_client_only+set}" = set; then
+  withval=$with_client_only;    { { echo "$as_me:$LINENO: error: --with-client-only is deprecated, use --without-server instead." >&5
+echo "$as_me: error: --with-client-only is deprecated, use --without-server instead." >&2;}
    { (exit 1); exit 1; }; }
+
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_long=0
-fi
+
+
+
+
+# Check whether --with-server-only was given.
+if test "${with_server_only+set}" = set; then
+  withval=$with_server_only;    { { echo "$as_me:$LINENO: error: --with-server-only is deprecated, use --without-client instead." >&5
+echo "$as_me: error: --with-server-only is deprecated, use --without-client instead." >&2;}
+   { (exit 1); exit 1; }; }
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
 
 
-   echo "$as_me:$LINENO: checking for void*" >&5
-echo $ECHO_N "checking for void*... $ECHO_C" >&6
-if test "${ac_cv_type_voidp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((void* *) 0)
-  return 0;
-if (sizeof (void*))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_voidp=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_voidp=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5
-echo "${ECHO_T}$ac_cv_type_voidp" >&6
-
-echo "$as_me:$LINENO: checking size of void*" >&5
-echo $ECHO_N "checking size of void*... $ECHO_C" >&6
-if test "${ac_cv_sizeof_voidp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$ac_cv_type_voidp" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void*))) >= 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void*))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void*))) < 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void*))) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void*))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_voidp=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void*), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+    # detect invalid combinations of components
+    if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then
+        { { echo "$as_me:$LINENO: error: --without-server requires --without-restore" >&5
+echo "$as_me: error: --without-server requires --without-restore" >&2;}
    { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (void*)); }
-unsigned long ulongval () { return (long) (sizeof (void*)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (void*))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (void*))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (void*))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_voidp=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void*), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void*), 77
-See \`config.log' for more details." >&2;}
+    fi
+    if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then
+        { { echo "$as_me:$LINENO: error: --without-client requires --without-amrecover" >&5
+echo "$as_me: error: --without-client requires --without-amrecover" >&2;}
    { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_voidp=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5
-echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
-_ACEOF
-
-
-   ac_cv_char_data_model=""
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model=""
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
-   echo "$as_me:$LINENO: checking data model" >&5
-echo $ECHO_N "checking data model... $ECHO_C" >&6
-   case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
-    122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
-    122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
-    122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
-    124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
-    124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
-    124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
-    124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
-    128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
-    128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;
-    222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
-    333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
-    444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
-    666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
-    888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
-    222/*|333/*|444/*|666/*|888/*) :
-                 ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
-     *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
-   esac
-   echo "$as_me:$LINENO: result: $ac_cv_data_model ($ac_cv_long_data_model, $n)" >&5
-echo "${ECHO_T}$ac_cv_data_model ($ac_cv_long_data_model, $n)" >&6
+    fi
 
+     if $WANT_CLIENT; then
+  WANT_CLIENT_TRUE=
+  WANT_CLIENT_FALSE='#'
+else
+  WANT_CLIENT_TRUE='#'
+  WANT_CLIENT_FALSE=
 fi
 
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "_$ac_cv_header_stdint_o" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "_$ac_cv_header_stdint_u" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
+     if $WANT_RESTORE; then
+  WANT_RESTORE_TRUE=
+  WANT_RESTORE_FALSE='#'
 else
-   ac_cv_header_stdint="stddef.h"
+  WANT_RESTORE_TRUE='#'
+  WANT_RESTORE_FALSE=
 fi
 
-echo "$as_me:$LINENO: checking for extra inttypes in chosen header" >&5
-echo $ECHO_N "checking for extra inttypes in chosen header... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: ($ac_cv_header_stdint)" >&5
-echo "${ECHO_T}($ac_cv_header_stdint)" >&6
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-echo "$as_me:$LINENO: checking for int_least32_t" >&5
-echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6
-if test "${ac_cv_type_int_least32_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+     if $WANT_SERVER; then
+  WANT_SERVER_TRUE=
+  WANT_SERVER_FALSE='#'
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_cv_header_stdint>
+  WANT_SERVER_TRUE='#'
+  WANT_SERVER_FALSE=
+fi
 
-int
-main ()
-{
-if ((int_least32_t *) 0)
-  return 0;
-if (sizeof (int_least32_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_int_least32_t=yes
+     if $WANT_RECOVER; then
+  WANT_RECOVER_TRUE=
+  WANT_RECOVER_FALSE='#'
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_int_least32_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  WANT_RECOVER_TRUE='#'
+  WANT_RECOVER_FALSE=
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5
-echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6
 
-echo "$as_me:$LINENO: checking for int_fast32_t" >&5
-echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6
-if test "${ac_cv_type_int_fast32_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include<$ac_cv_header_stdint>
 
-int
-main ()
-{
-if ((int_fast32_t *) 0)
-  return 0;
-if (sizeof (int_fast32_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_int_fast32_t=yes
+     if $WANT_SERVER || $WANT_RESTORE; then
+  WANT_TAPE_TRUE=
+  WANT_TAPE_FALSE='#'
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_int_fast32_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  WANT_TAPE_TRUE='#'
+  WANT_TAPE_FALSE=
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5
-echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6
 
-echo "$as_me:$LINENO: checking for intmax_t" >&5
-echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
-if test "${ac_cv_type_intmax_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_cv_header_stdint>
 
-int
-main ()
-{
-if ((intmax_t *) 0)
-  return 0;
-if (sizeof (intmax_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_intmax_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_intmax_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_intmax_t" >&6
+    SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/sfw/bin:/usr/bsd:/etc:/usr/etc"
+    # expand prefix or exec_prefix in LOCPATH
+    LOCPATH=`(
+       test "x$prefix" = xNONE && prefix=$ac_default_prefix
+       test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+       eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin"
+    )`
+    SYSLOCPATH="$SYSPATH:$LOCPATH"
+    LOCSYSPATH="$LOCPATH:$SYSPATH"
 
 
-fi # shortcircut to system "stdint.h"
-# ------------------ PREPARE VARIABLES ------------------------------
-if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
-else
-ac_cv_stdint_message="using $CC"
-fi
 
-echo "$as_me:$LINENO: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5
-echo "${ECHO_T}make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6
 
-# ----------------- DONE inttypes.h checks START header -------------
-          ac_config_commands="$ac_config_commands $ac_stdint_h"
 
+# Check whether --with-gnuplot was given.
+if test "${with_gnuplot+set}" = set; then
+  withval=$with_gnuplot;
+           case "$withval" in
+               y | ye | yes) : ;;
+               n | no) GNUPLOT=no ;;
+               *) GNUPLOT="$withval" ;;
+           esac
 
+fi
 
-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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AR+set}" = set; then
+    if test "x$GNUPLOT" = "xno"; then
+       GNUPLOT=
+    else
+       # Extract the first word of "gnuplot", so it can be a program name with args.
+set dummy gnuplot; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GNUPLOT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $AR in
+  case $GNUPLOT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_AR="$AR" # Let the user override the test with a path.
+  ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
-AR=$ac_cv_path_AR
-
-if test -n "$AR"; then
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+GNUPLOT=$ac_cv_path_GNUPLOT
+if test -n "$GNUPLOT"; then
+  { echo "$as_me:$LINENO: result: $GNUPLOT" >&5
+echo "${ECHO_T}$GNUPLOT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$AR" && break
-done
 
+    fi
 
-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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
+
+
+
+
+
+    # Extract the first word of "pcat", so it can be a program name with args.
+set dummy pcat; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PCAT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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
+  case $PCAT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+PCAT=$ac_cv_path_PCAT
+if test -n "$PCAT"; then
+  { echo "$as_me:$LINENO: result: $PCAT" >&5
+echo "${ECHO_T}$PCAT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$AWK" && break
-done
 
-for ac_prog in 'bison -y' byacc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_YACC+set}" = set; then
+
+
+
+    # Extract the first word of "compress", so it can be a program name with args.
+set dummy compress; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_COMPRESS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$YACC"; then
-  ac_cv_prog_YACC="$YACC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+  case $COMPRESS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_YACC="$ac_prog"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
-  echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6
+COMPRESS=$ac_cv_path_COMPRESS
+if test -n "$COMPRESS"; then
+  { echo "$as_me:$LINENO: result: $COMPRESS" >&5
+echo "${ECHO_T}$COMPRESS" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$YACC" && break
-done
-test -n "$YACC" || YACC="yacc"
 
-for ac_prog in cat
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_CAT+set}" = set; then
+
+
+
+    # Extract the first word of "gzip", so it can be a program name with args.
+set dummy gzip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GZIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $CAT in
+  case $GZIP in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
+  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
-CAT=$ac_cv_path_CAT
-
-if test -n "$CAT"; then
-  echo "$as_me:$LINENO: result: $CAT" >&5
-echo "${ECHO_T}$CAT" >&6
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+  { echo "$as_me:$LINENO: result: $GZIP" >&5
+echo "${ECHO_T}$GZIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$CAT" && break
-done
 
-if test -z "$CAT"; then
-    CAT=cat
-fi
-for ac_prog in compress
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_COMPRESS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $COMPRESS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-COMPRESS=$ac_cv_path_COMPRESS
 
-if test -n "$COMPRESS"; then
-  echo "$as_me:$LINENO: result: $COMPRESS" >&5
-echo "${ECHO_T}$COMPRESS" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$COMPRESS" && break
-done
 
-for ac_prog in dd
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_DD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $DD in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_DD="$DD" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-DD=$ac_cv_path_DD
 
-if test -n "$DD"; then
-  echo "$as_me:$LINENO: result: $DD" >&5
-echo "${ECHO_T}$DD" >&6
+
+
+    if test "x$GNUPLOT" != "x"; then
+       WANT_AMPLOT=true
+
+       # variable substitutions for amcat.awk
+       if test "$PCAT"; then
+           AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
+       else
+           AMPLOT_CAT_PACK=
+       fi
+       if test "$COMPRESS"; then
+           AMPLOT_COMPRESS=$COMPRESS
+           AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
+       else
+           AMPLOT_CAT_COMPRESS=
+       fi
+       if test "$GZIP"; then
+           AMPLOT_COMPRESS=$GZIP
+           AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
+       else
+           AMPLOT_CAT_GZIP=
+       fi
+
+
+
+
+
+    else
+       WANT_AMPLOT=false
+
+    { echo "$as_me:$LINENO: WARNING: Not building 'amplot', because gnuplot was not found" >&5
+echo "$as_me: WARNING: Not building 'amplot', because gnuplot was not found" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Not building 'amplot', because gnuplot was not found
+AAW_EOF
+
+
+    fi
+
+     if test x"$WANT_AMPLOT" = x"true"; then
+  WANT_AMPLOT_TRUE=
+  WANT_AMPLOT_FALSE='#'
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  WANT_AMPLOT_TRUE='#'
+  WANT_AMPLOT_FALSE=
 fi
 
-  test -n "$DD" && break
-done
 
-for ac_prog in getconf
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GETCONF+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $GETCONF in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GETCONF="$GETCONF" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GETCONF="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
+    # Check whether --enable-manpage-build was given.
+if test "${enable_manpage_build+set}" = set; then
+  enableval=$enable_manpage_build;  ENABLE_MANPAGE_BUILD=$enableval
+else
+   ENABLE_MANPAGE_BUILD=no
 fi
-GETCONF=$ac_cv_path_GETCONF
 
-if test -n "$GETCONF"; then
-  echo "$as_me:$LINENO: result: $GETCONF" >&5
-echo "${ECHO_T}$GETCONF" >&6
+
+    # and ensure that everything docbook-related is OK if we'll be using it
+    if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+       DOC_BUILD_DATE=`date '+%d-%m-%Y'`
+
+
+XSLTPROC_FLAGS="--nonet"
+
+
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+
+# Check whether --with-xsltproc was given.
+if test "${with_xsltproc+set}" = set; then
+  withval=$with_xsltproc;  ac_with_xsltproc=$withval;
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+   ac_with_xsltproc=maybe;
 fi
 
-  test -n "$GETCONF" && break
-done
 
 
+# Check whether --with-xsltproc-flags was given.
+if test "${with_xsltproc_flags+set}" = set; then
+  withval=$with_xsltproc_flags;  if test "x$withval" == "xno"; then
+       XSLTPROC_FLAGS=''
+    else
+       if test "x$withval" != "xyes"; then
+           XSLTPROC_FLAGS="$withval"
+       fi
+    fi
+
+fi
 
-# Check whether --with-gnuplot or --without-gnuplot was given.
-if test "${with_gnuplot+set}" = set; then
-  withval="$with_gnuplot"
-   ac_with_gnuplot=$withval;
-else
-   ac_with_gnuplot=maybe;
-fi;
 
-if test "$ac_with_gnuplot" = "yes" -o "$ac_with_gnuplot" = "maybe"; then
-    for ac_prog in gnuplot
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+    for ac_prog in xsltproc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GNUPLOT+set}" = set; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_XSLTPROC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $GNUPLOT in
+  case $XSLTPROC in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path.
+  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
-GNUPLOT=$ac_cv_path_GNUPLOT
-
-if test -n "$GNUPLOT"; then
-  echo "$as_me:$LINENO: result: $GNUPLOT" >&5
-echo "${ECHO_T}$GNUPLOT" >&6
+XSLTPROC=$ac_cv_path_XSLTPROC
+if test -n "$XSLTPROC"; then
+  { echo "$as_me:$LINENO: result: $XSLTPROC" >&5
+echo "${ECHO_T}$XSLTPROC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$GNUPLOT" && break
+
+  test -n "$XSLTPROC" && break
 done
 
 else
-    if test "$ac_with_gnuplot" != "no"; then
-        if test -x "$ac_with_gnuplot"; then
-            GNUPLOT="$ac_with_gnuplot";
+    if test "$ac_with_xsltproc" != "no"; then
+        if test -x "$ac_with_xsltproc"; then
+            XSLTPROC="$ac_with_xsltproc";
         else
-            { echo "$as_me:$LINENO: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&5
-echo "$as_me: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&2;}
-            { echo "$as_me:$LINENO: WARNING: executable, searching for an alternative." >&5
-echo "$as_me: WARNING: executable, searching for an alternative." >&2;}
-           for ac_prog in gnuplot
+
+    { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&5
+echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative.
+AAW_EOF
+
+
+            for ac_prog in xsltproc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GNUPLOT+set}" = set; then
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_XSLTPROC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $GNUPLOT in
+  case $XSLTPROC in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path.
+  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
-GNUPLOT=$ac_cv_path_GNUPLOT
-
-if test -n "$GNUPLOT"; then
-  echo "$as_me:$LINENO: result: $GNUPLOT" >&5
-echo "${ECHO_T}$GNUPLOT" >&6
+XSLTPROC=$ac_cv_path_XSLTPROC
+if test -n "$XSLTPROC"; then
+  { echo "$as_me:$LINENO: result: $XSLTPROC" >&5
+echo "${ECHO_T}$XSLTPROC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$GNUPLOT" && break
+
+  test -n "$XSLTPROC" && break
 done
 
         fi
 fi
 
 
-for ac_prog in gtar gnutar tar
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GNUTAR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $GNUTAR in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GNUTAR="$GNUTAR" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-GNUTAR=$ac_cv_path_GNUTAR
 
-if test -n "$GNUTAR"; then
-  echo "$as_me:$LINENO: result: $GNUTAR" >&5
-echo "${ECHO_T}$GNUTAR" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$GNUTAR" && break
-done
 
-if test ! -z "$GNUTAR"; then
-  case "`\"$GNUTAR\" --version 2>&1`" in
-   *GNU*tar* | *Free*paxutils* )
 
-cat >>confdefs.h <<_ACEOF
-#define GNUTAR "$GNUTAR"
-_ACEOF
 
-               ;;
-   *)
-               { echo "$as_me:$LINENO: WARNING: *** $GNUTAR is not GNU tar, so it will not be used." >&5
-echo "$as_me: WARNING: *** $GNUTAR is not GNU tar, so it will not be used." >&2;}
-               GNUTAR=
-               ;;
-  esac
-fi
 
-for ac_prog in smbclient
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then
+
+    { echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5
+echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6; }
+if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $SAMBA_CLIENT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SAMBA_CLIENT="$SAMBA_CLIENT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_SAMBA_CLIENT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT
+       ac_cv_docbook_xslt_1_72_0=no
+       if test -n "$XSLTPROC"; then
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl'" >&5
+           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl >&5 2>&5
+
+           if test "$?" = 0; then
+               ac_cv_docbook_xslt_1_72_0=yes
+           fi
+       fi
 
-if test -n "$SAMBA_CLIENT"; then
-  echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5
-echo "${ECHO_T}$SAMBA_CLIENT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5
+echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6; }
 
-  test -n "$SAMBA_CLIENT" && break
-done
+    HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0"
+    HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_1_72_0"
 
-if test ! -z "$SAMBA_CLIENT"; then
-  case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
-  *"Unknown host"*)
-               smbversion=1
-               ;;
-  *"Connection to not.a.host.name failed"*)
-               smbversion=2
-               ;;
-  *)
-               { echo "$as_me:$LINENO: WARNING: *** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5
-echo "$as_me: WARNING: *** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;}
-               SAMBA_CLIENT=
-               ;;
-  esac
-  if test -n "$SAMBA_CLIENT"; then
 
-cat >>confdefs.h <<_ACEOF
-#define SAMBA_CLIENT "$SAMBA_CLIENT"
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define SAMBA_VERSION $smbversion
-_ACEOF
 
-  fi
-fi
 
-for ac_prog in gzip
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GZIP+set}" = set; then
+
+
+    { echo "$as_me:$LINENO: checking for current Docbook XSLT version" >&5
+echo $ECHO_N "checking for current Docbook XSLT version... $ECHO_C" >&6; }
+if test "${ac_cv_docbook_xslt_current_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $GZIP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-GZIP=$ac_cv_path_GZIP
+       ac_cv_docbook_xslt_current_version=no
 
-if test -n "$GZIP"; then
-  echo "$as_me:$LINENO: result: $GZIP" >&5
-echo "${ECHO_T}$GZIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+       if test -n "$XSLTPROC"; then
+           cat >conftest.xsl <<EOF
+               <xsl:stylesheet
+                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                   xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
+                   version="1.0">
+                   <xsl:output method="text"/>
+                   <xsl:template match="fm:project/fm:Version">
+                       <xsl:value-of select="." />
+                   </xsl:template>
+                   <!-- do nothing with any other text -->
+                   <xsl:template match="text()"/>
+               </xsl:stylesheet>
+EOF
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&5
+           echo "====" >&5
+           cat conftest.xsl >&5
+           echo "====" >&5
 
-  test -n "$GZIP" && break
-done
+           ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&5`
 
-if test "$GZIP"; then
+           if test "$?" != 0; then
+               ac_cv_docbook_xslt_current_version='no'
+           fi
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GZIP 1
-_ACEOF
+           rm conftest.xsl
+       fi
 
-    COMPRESS_PATH="$GZIP"
-    COMPRESS_SUFFIX=".gz"
-    COMPRESS_FAST_OPT="--fast"
-    COMPRESS_BEST_OPT="--best"
-    UNCOMPRESS_PATH="$GZIP"
-    UNCOMPRESS_OPT="-dc"
-else
-    if test "$COMPRESS"; then
-       COMPRESS_PATH="$COMPRESS"
-       COMPRESS_SUFFIX=".Z"
-       COMPRESS_FAST_OPT="-f"
-       COMPRESS_BEST_OPT="-f"
-       UNCOMPRESS_PATH="$COMPRESS"
-       UNCOMPRESS_OPT="-dc"
-    else
-                               { echo "$as_me:$LINENO: WARNING: *** Cannot find either gzip or compress.  Using cat. ***" >&5
-echo "$as_me: WARNING: *** Cannot find either gzip or compress.  Using cat. ***" >&2;}
-       COMPRESS_PATH="$CAT"
-       COMPRESS_SUFFIX=""
-       COMPRESS_FAST_OPT=""
-       COMPRESS_BEST_OPT=""
-       UNCOMPRESS_PATH="$CAT"
-       UNCOMPRESS_OPT=""
-    fi
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_current_version" >&5
+echo "${ECHO_T}$ac_cv_docbook_xslt_current_version" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_PATH "$COMPRESS_PATH"
-_ACEOF
-
+    DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version"
+    { echo "$as_me:$LINENO: checking whether Docbook XSLT version is 1.72.0 or newer" >&5
+echo $ECHO_N "checking whether Docbook XSLT version is 1.72.0 or newer... $ECHO_C" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX"
-_ACEOF
+    if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    else
 
+  # Used to indicate true or false condition
+  ax_compare_version=false
 
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT"
-_ACEOF
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
 
+  ax_compare_version_A=`echo "$DOCBOOK_XSLT_CURRENT_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
 
-cat >>confdefs.h <<_ACEOF
-#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT"
-_ACEOF
 
+  ax_compare_version_B=`echo "1.72.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \
+                     -e 's/Z\([0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \
+                     -e 's/[^0-9]//g'`
 
-cat >>confdefs.h <<_ACEOF
-#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH"
-_ACEOF
 
+    ax_compare_version=`echo "x$ax_compare_version_A
+x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"`
 
-cat >>confdefs.h <<_ACEOF
-#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT"
-_ACEOF
 
 
-for ac_prog in sort
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_SORT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $SORT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SORT="$SORT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+    if test "$ax_compare_version" = "true" ; then
 
-  ;;
-esac
-fi
-SORT=$ac_cv_path_SORT
+           # version is less than required, so mark it as "no"
+           DOCBOOK_XSLT_CURRENT_VERSION=no
 
-if test -n "$SORT"; then
-  echo "$as_me:$LINENO: result: $SORT" >&5
-echo "${ECHO_T}$SORT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+      fi
 
-  test -n "$SORT" && break
-done
 
-if test -z "$SORT"; then
-    if $NO_SERVER_MODE; then
-       SORT="NONE"
-    else
-       { { echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5
-echo "$as_me: error: Set SORT to the path of the sort program." >&2;}
-   { (exit 1); exit 1; }; }
+       if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       else
+           { echo "$as_me:$LINENO: result: yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&5
+echo "${ECHO_T}yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&6; }
+       fi
     fi
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define SORT_PATH "$SORT"
-_ACEOF
 
 
-for ac_prog in Mail mailx mail
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_MAILER+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $MAILER in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MAILER="$MAILER" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MAILER="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-MAILER=$ac_cv_path_MAILER
 
-if test -n "$MAILER"; then
-  echo "$as_me:$LINENO: result: $MAILER" >&5
-echo "${ECHO_T}$MAILER" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$MAILER" && break
-done
 
-if test -z "$MAILER"; then
-    if $NO_SERVER_MODE; then
-       MAILER="NONE"
-       { echo "$as_me:$LINENO: WARNING: *** WARNING: Amanda cannot send mail reports without these programs." >&5
-echo "$as_me: WARNING: *** WARNING: Amanda cannot send mail reports without these programs." >&2;}
-    else
-       { { echo "$as_me:$LINENO: error: Set MAILER to some program that accepts -s subject user < message_file." >&5
-echo "$as_me: error: Set MAILER to some program that accepts -s subject user < message_file." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define MAILER "$MAILER"
-_ACEOF
 
 
-for ac_prog in mt
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_MT+set}" = set; then
+    { echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5
+echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6; }
+if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $MT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MT="$MT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-MT=$ac_cv_path_MT
+       ac_cv_docbook_dtd_4_1_2=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
+           echo "conftest.xml:" >&5
+           echo "====" >&5
+           cat conftest.xml >&5
+           echo "====" >&5
+
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0 -o "$?" = 5; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest.out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_4_1_2=yes
+               fi
+           fi
+           cat conftest.out >&5
+
+           rm -f conftest.xml conftest.out
+       fi
 
-if test -n "$MT"; then
-  echo "$as_me:$LINENO: result: $MT" >&5
-echo "${ECHO_T}$MT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5
+echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6; }
 
-  test -n "$MT" && break
-done
-test -n "$MT" || MT="mt"
+    HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2"
+    HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_1_2"
 
 
-for ac_prog in chio
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_CHIO+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $CHIO in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CHIO="$CHIO" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
+
+
+
+
+
+
+
+
+
+
+
+    { echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5
+echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6; }
+if test "${ac_cv_docbook_dtd_4_2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       ac_cv_docbook_dtd_4_2=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
+           echo "conftest.xml:" >&5
+           echo "====" >&5
+           cat conftest.xml >&5
+           echo "====" >&5
+
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0 -o "$?" = 5; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest.out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_4_2=yes
+               fi
+           fi
+           cat conftest.out >&5
+
+           rm -f conftest.xml conftest.out
+       fi
+
 fi
-CHIO=$ac_cv_path_CHIO
+{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5
+echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6; }
 
-if test -n "$CHIO"; then
-  echo "$as_me:$LINENO: result: $CHIO" >&5
-echo "${ECHO_T}$CHIO" >&6
+    HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2"
+    HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_2"
+
+
+
+
+
+
+       if test -z "$XSLTPROC"; then
+           { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5
+echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+
+       # if the 'current' Docbook revision is good enough, use that; otherwise,
+       # if 1.72.0 is available, use that.
+       XSLREL=current
+       if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
+           if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
+               { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&5
+echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&2;}
+   { (exit 1); exit 1; }; }
+           else
+               XSLREL=1.72.0
+           fi
+       fi
+
+       # disable validation if the correct DTDs are not available
+       if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
+
+    { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5
+echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation
+AAW_EOF
+
+
+           XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
+       fi
+    fi
+
+     if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+  ENABLE_MANPAGE_BUILD_TRUE=
+  ENABLE_MANPAGE_BUILD_FALSE='#'
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  ENABLE_MANPAGE_BUILD_TRUE='#'
+  ENABLE_MANPAGE_BUILD_FALSE=
 fi
 
-  test -n "$CHIO" && break
-done
-test -n "$CHIO" || CHIO="chio"
 
 
-for ac_prog in chs
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_CHS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+# Check whether --with-index-server was given.
+if test "${with_index_server+set}" = set; then
+  withval=$with_index_server;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           *) DEFAULT_SERVER="$withval"
+             ;;
+           esac
+
 else
-  case $CHS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CHS="$CHS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  : ${DEFAULT_SERVER=`uname -n`}
 
-  ;;
-esac
 fi
-CHS=$ac_cv_path_CHS
 
-if test -n "$CHS"; then
-  echo "$as_me:$LINENO: result: $CHS" >&5
-echo "${ECHO_T}$CHS" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_SERVER "$DEFAULT_SERVER"
+_ACEOF
+
+
+
+
+# Check whether --with-config was given.
+if test "${with_config+set}" = set; then
+  withval=$with_config;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           *) DEFAULT_CONFIG="$withval"
+             ;;
+           esac
+
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  : ${DEFAULT_CONFIG=DailySet1}
+
 fi
 
-  test -n "$CHS" && break
-done
-test -n "$CHS" || CHS="chs"
 
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_CONFIG "$DEFAULT_CONFIG"
+_ACEOF
+
+
+
+
+# Check whether --with-tape-server was given.
+if test "${with_tape_server+set}" = set; then
+  withval=$with_tape_server;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           *) DEFAULT_TAPE_SERVER="$withval"
+             ;;
+           esac
 
-for ac_prog in mtx
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_MTX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $MTX in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MTX="$MTX" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
 
-  ;;
-esac
 fi
-MTX=$ac_cv_path_MTX
 
-if test -n "$MTX"; then
-  echo "$as_me:$LINENO: result: $MTX" >&5
-echo "${ECHO_T}$MTX" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER"
+_ACEOF
+
+
+
+
+# Check whether --with-tape-device was given.
+if test "${with_tape_device+set}" = set; then
+  withval=$with_tape_device;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           *) DEFAULT_TAPE_DEVICE="$withval"
+             ;;
+           esac
+
+
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE"
+_ACEOF
+
+
+
+    if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then
+       EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE"
+    else
+       EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE"
+    fi
+
+
+
+# Check whether --with-changer-device was given.
+if test "${with_changer_device+set}" = set; then
+  withval=$with_changer_device;
+           case "$withval" in
+           "" | y | ye | yes | n | no)
+               { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           *) DEFAULT_CHANGER_DEVICE="$withval"
+             ;;
+           esac
+
+
+fi
+
+
+    if test -z "$DEFAULT_CHANGER_DEVICE"; then
+       DEFAULT_CHANGER_DEVICE=/dev/null
+       if test -f /dev/ch0; then
+           DEFAULT_CHANGER_DEVICE=/dev/ch0
+       fi
+    fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE"
+_ACEOF
+
+
+
+
+# Check whether --with-amandates was given.
+if test "${with_amandates+set}" = set; then
+  withval=$with_amandates;
+           case "$withval" in
+               n | no) { { echo "$as_me:$LINENO: error: *** --without-amandates is not allowed." >&5
+echo "$as_me: error: *** --without-amandates is not allowed." >&2;}
+   { (exit 1); exit 1; }; };;
+               y |  ye | yes) amandates='$localstatedir/amanda/amandates' ;;
+               *) amandates="$withval";;
+           esac
+
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  amandates='$localstatedir/amanda/amandates'
+
 fi
 
-  test -n "$MTX" && break
-done
-test -n "$MTX" || MTX="mtx"
 
 
-for ac_prog in mcutil
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_MCUTIL+set}" = set; then
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$amandates\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  DEFAULT_AMANDATES_FILE="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_AMANDATES_FILE "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+
+    # Extract the first word of "getconf", so it can be a program name with args.
+set dummy getconf; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GETCONF+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $MCUTIL in
+  case $GETCONF in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_MCUTIL="$MCUTIL" # Let the user override the test with a path.
+  ac_cv_path_GETCONF="$GETCONF" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
+for as_dir in $SYSPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GETCONF="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
-MCUTIL=$ac_cv_path_MCUTIL
-
-if test -n "$MCUTIL"; then
-  echo "$as_me:$LINENO: result: $MCUTIL" >&5
-echo "${ECHO_T}$MCUTIL" >&6
+GETCONF=$ac_cv_path_GETCONF
+if test -n "$GETCONF"; then
+  { echo "$as_me:$LINENO: result: $GETCONF" >&5
+echo "${ECHO_T}$GETCONF" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$MCUTIL" && break
-done
-test -n "$MCUTIL" || MCUTIL="mcutil"
 
 
-for ac_prog in lpr lp
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PRINT+set}" = set; then
+
+
+
+
+    # we use 'getconf', if it exists, to get the relevant
+    # compiler flags.
+    GETCONF_LFS="LFS"
+    case "$target" in
+        *-hp-*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
+        *-ibm-aix*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
+    esac
+
+    # Checks for compilers, typedefs, structures, and compiler characteristics.
+    # Check for large file compilation environment.
+    NEED_RESETOFS=yes
+    { echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5
+echo $ECHO_N "checking for large file compilation CFLAGS... $ECHO_C" >&6; }
+if test "${amanda_cv_LFS_CFLAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $PRINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PRINT="$PRINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PRINT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
+        amanda_cv_LFS_CFLAGS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
+                amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
+
+
 fi
-PRINT=$ac_cv_path_PRINT
+{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5
+echo "${ECHO_T}$amanda_cv_LFS_CFLAGS" >&6; }
+    CFLAGS="$CFLAGS $amanda_cv_LFS_CFLAGS"
 
-if test -n "$PRINT"; then
-  echo "$as_me:$LINENO: result: $PRINT" >&5
-echo "${ECHO_T}$PRINT" >&6
+
+    { echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5
+echo $ECHO_N "checking for large file compilation LDFLAGS... $ECHO_C" >&6; }
+if test "${amanda_cv_LFS_LDFLAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$PRINT" && break
-done
+        amanda_cv_LFS_LDFLAGS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
+                amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
 
-if test ! -z "$PRINT"; then
 
-cat >>confdefs.h <<_ACEOF
-#define LPRCMD "$PRINT"
-_ACEOF
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5
+echo "${ECHO_T}$amanda_cv_LFS_LDFLAGS" >&6; }
+    LDFLAGS="$LDFLAGS $amanda_cv_LFS_LDFLAGS"
 
-    echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5
-echo $ECHO_N "checking which flag to use to select a printer... $ECHO_C" >&6
-if test "${amanda_cv_printer_flag+set}" = set; then
+
+    { echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5
+echo $ECHO_N "checking for large file compilation LIBS... $ECHO_C" >&6; }
+if test "${amanda_cv_LFS_LIBS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-       amanda_cv_printer_flag=$PRINTER_FLAG
-       case "$PRINT" in
-       lpr|*/lpr) amanda_cv_printer_flag="-P";;
-       lp|*/lp) amanda_cv_printer_flag="-d";;
-       esac
+        amanda_cv_LFS_LIBS=
+        if test "$GETCONF"; then
+            if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
+                amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
+                NEED_RESETOFS=no
+            fi
+        fi
+
 
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5
-echo "${ECHO_T}$amanda_cv_printer_flag" >&6
-    if test ! -z "$amanda_cv_printer_flag"; then
+{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5
+echo "${ECHO_T}$amanda_cv_LFS_LIBS" >&6; }
+    LIBS="$amanda_cv_LFS_LIBS $LIBS"
 
-cat >>confdefs.h <<_ACEOF
-#define LPRFLAG "$amanda_cv_printer_flag"
+
+    if test x"$NEED_RESETOFS" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_RESETOFS 1
 _ACEOF
 
-    else
-       { echo "$as_me:$LINENO: WARNING: *** WARNING: amanda will always print to the default printer" >&5
-echo "$as_me: WARNING: *** WARNING: amanda will always print to the default printer" >&2;}
     fi
-fi
 
-for ac_prog in pcat
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PCAT+set}" = set; then
+
+
+    # Extract the first word of "chio", so it can be a program name with args.
+set dummy chio; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CHIO+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $PCAT in
+  case $CHIO in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path.
+  ac_cv_path_CHIO="$CHIO" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_CHIO" && ac_cv_path_CHIO="chio"
   ;;
 esac
 fi
-PCAT=$ac_cv_path_PCAT
-
-if test -n "$PCAT"; then
-  echo "$as_me:$LINENO: result: $PCAT" >&5
-echo "${ECHO_T}$PCAT" >&6
+CHIO=$ac_cv_path_CHIO
+if test -n "$CHIO"; then
+  { echo "$as_me:$LINENO: result: $CHIO" >&5
+echo "${ECHO_T}$CHIO" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$PCAT" && break
-done
 
-for ac_prog in perl5 perl
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PERL+set}" = set; then
+
+
+
+    # Extract the first word of "chs", so it can be a program name with args.
+set dummy chs; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CHS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $PERL in
+  case $CHS in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ac_cv_path_CHS="$CHS" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_CHS" && ac_cv_path_CHS="chs"
   ;;
 esac
 fi
-PERL=$ac_cv_path_PERL
-
-if test -n "$PERL"; then
-  echo "$as_me:$LINENO: result: $PERL" >&5
-echo "${ECHO_T}$PERL" >&6
+CHS=$ac_cv_path_CHS
+if test -n "$CHS"; then
+  { echo "$as_me:$LINENO: result: $CHS" >&5
+echo "${ECHO_T}$CHS" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$PERL" && break
-done
 
 
 
-for ac_prog in $DUMP_PROGRAMS
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_DUMP+set}" = set; then
+
+    # Extract the first word of "mtx", so it can be a program name with args.
+set dummy mtx; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MTX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $DUMP in
+  case $MTX in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_DUMP="$DUMP" # Let the user override the test with a path.
+  ac_cv_path_MTX="$MTX" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
+for as_dir in $LOCSYSPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_DUMP="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx"
   ;;
 esac
 fi
-DUMP=$ac_cv_path_DUMP
-
-if test -n "$DUMP"; then
-  echo "$as_me:$LINENO: result: $DUMP" >&5
-echo "${ECHO_T}$DUMP" >&6
+MTX=$ac_cv_path_MTX
+if test -n "$MTX"; then
+  { echo "$as_me:$LINENO: result: $MTX" >&5
+echo "${ECHO_T}$MTX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$DUMP" && break
-done
 
-if test -n "$DUMP"; then
-  if test "`basename $DUMP`" = "backup"; then
-    backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
-    if test $? -eq 0; then
-      DUMP=
-    fi
-  fi
-fi
-for ac_prog in ufsrestore restore
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_RESTORE+set}" = set; then
+
+
+
+    # Extract the first word of "mcutil", so it can be a program name with args.
+set dummy mcutil; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MCUTIL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $RESTORE in
+  case $MCUTIL in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_RESTORE="$RESTORE" # Let the user override the test with a path.
+  ac_cv_path_MCUTIL="$MCUTIL" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
+for as_dir in $LOCSYSPATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_RESTORE="$as_dir/$ac_word$ac_exec_ext"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_MCUTIL" && ac_cv_path_MCUTIL="mcutil"
   ;;
 esac
 fi
-RESTORE=$ac_cv_path_RESTORE
-
-if test -n "$RESTORE"; then
-  echo "$as_me:$LINENO: result: $RESTORE" >&5
-echo "${ECHO_T}$RESTORE" >&6
+MCUTIL=$ac_cv_path_MCUTIL
+if test -n "$MCUTIL"; then
+  { echo "$as_me:$LINENO: result: $MCUTIL" >&5
+echo "${ECHO_T}$MCUTIL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$RESTORE" && break
-done
 
-if test "$DUMP" -a "$RESTORE"; then
 
-cat >>confdefs.h <<_ACEOF
-#define DUMP "$DUMP"
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define RESTORE "$RESTORE"
-_ACEOF
 
-    if test -x $DUMP; then
-        echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5
-echo $ECHO_N "checking whether $DUMP supports -E or -S for estimates... $ECHO_C" >&6
-if test "${amanda_cv_dump_estimate+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-               case "$DUMP" in
-               *dump)
-                   { ac_try='$DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d-E 2>&1'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }
-                   cat conftest.d-E >&5
-                   { ac_try='$DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d-S 2>&1'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }
-                   cat conftest.d-S >&5
-                   { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d 2>&1'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }
-                   cat conftest.d >&5
-                   if { ac_try='cmp conftest.d-E conftest.d 1>&2'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-                       amanda_cv_dump_estimate=E
-                   elif { ac_try='cmp conftest.d-S conftest.d 1>&2'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-                       amanda_cv_dump_estimate=S
-                   else
-                       amanda_cv_dump_estimate=no
-                   fi
-                   rm -f conftest.d conftest.d-E conftest.d-S
-                 ;;
-               *) amanda_cv_dump_estimate=no
-                 ;;
-               esac
 
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5
-echo "${ECHO_T}$amanda_cv_dump_estimate" >&6
-    else
-       { echo "$as_me:$LINENO: WARNING: *** $DUMP is not executable, cannot run -E/-S test" >&5
-echo "$as_me: WARNING: *** $DUMP is not executable, cannot run -E/-S test" >&2;}
-       amanda_cv_dump_estimate=no
-    fi
-    if test "x$amanda_cv_dump_estimate" != xno; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DUMP_ESTIMATE "$amanda_cv_dump_estimate"
-_ACEOF
 
-    fi
 
 
-# Check whether --with-dump-honor-nodump or --without-dump-honor-nodump was given.
-if test "${with_dump_honor_nodump+set}" = set; then
-  withval="$with_dump_honor_nodump"
-   if test -x $DUMP; then
-        echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5
-echo $ECHO_N "checking whether $DUMP supports -h (honor nodump flag)... $ECHO_C" >&6
-if test "${amanda_cv_honor_nodump+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-           case "$DUMP" in
-           *dump)
-               { ac_try='$DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
-                   | $GREP -v Dumping
-                   | $GREP -v Date
-                   | $GREP -v Label >conftest.d-h 2>&1'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }
-               cat conftest.d-h >&5
-               { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
-                   | $GREP -v Dumping
-                   | $GREP -v Date
-                   | $GREP -v Label >conftest.d 2>&1'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }
-               cat conftest.d >&5
-               if { ac_try='diff conftest.d-h conftest.d 1>&2'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-                   amanda_cv_honor_nodump=yes
-               else
-                   amanda_cv_honor_nodump=no
-               fi
-               rm -f conftest.d conftest.d-h
-             ;;
-           *) amanda_cv_honor_nodump=no
-             ;;
-           esac
 
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5
-echo "${ECHO_T}$amanda_cv_honor_nodump" >&6
-      else
-       { echo "$as_me:$LINENO: WARNING: *** $DUMP is not executable, cannot run -h test" >&5
-echo "$as_me: WARNING: *** $DUMP is not executable, cannot run -h test" >&2;}
-       amanda_cv_honor_nodump=no
-      fi
-      if test "x$amanda_cv_honor_nodump" = xyes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_HONOR_NODUMP 1
-_ACEOF
 
-      fi
 
-fi;
-fi
 
-for ac_prog in xfsdump
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XFSDUMP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $XFSDUMP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XFSDUMP="$XFSDUMP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XFSDUMP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  ;;
-esac
-fi
-XFSDUMP=$ac_cv_path_XFSDUMP
 
-if test -n "$XFSDUMP"; then
-  echo "$as_me:$LINENO: result: $XFSDUMP" >&5
-echo "${ECHO_T}$XFSDUMP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-  test -n "$XFSDUMP" && break
-done
 
-for ac_prog in xfsrestore
+
+for ac_header in \
+       camlib.h \
+       chio.h \
+       linux/chio.h \
+       scsi/sg.h \
+       scsi/scsi_ioctl.h \
+       sys/chio.h \
+       sys/dsreq.h \
+       sys/mtio.h \
+       sys/scarray.h \
+       sys/gscdds.h \
+       sys/scsi.h \
+       sys/scsiio.h \
+       sys/scsi/impl/uscsi.h \
+       sys/scsi/scsi/ioctl.h \
+
 do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XFSRESTORE+set}" = set; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  case $XFSRESTORE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XFSRESTORE="$XFSRESTORE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XFSRESTORE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-fi
-XFSRESTORE=$ac_cv_path_XFSRESTORE
-
-if test -n "$XFSRESTORE"; then
-  echo "$as_me:$LINENO: result: $XFSRESTORE" >&5
-echo "${ECHO_T}$XFSRESTORE" >&6
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  test -n "$XFSRESTORE" && break
-done
+       ac_header_compiler=no
+fi
 
-if test "$XFSDUMP" -a "$XFSRESTORE"; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define XFSDUMP "$XFSDUMP"
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define XFSRESTORE "$XFSRESTORE"
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
 _ACEOF
-
-    { echo "$as_me:$LINENO: WARNING: *** xfsdump causes the setuid-root rundump program to be enabled" >&5
-echo "$as_me: WARNING: *** xfsdump causes the setuid-root rundump program to be enabled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: *** to disable it, just #undef XFSDUMP in config/config.h" >&5
-echo "$as_me: WARNING: *** to disable it, just #undef XFSDUMP in config/config.h" >&2;}
-fi
-
-VXSYSLOCPATH="$SYSLOCPATH:/usr/lib/fs/vxfs"
-for ac_prog in vxdump
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_VXDUMP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  case $VXDUMP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_VXDUMP="$VXDUMP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $VXSYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_VXDUMP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-esac
+  ac_header_preproc=no
 fi
-VXDUMP=$ac_cv_path_VXDUMP
 
-if test -n "$VXDUMP"; then
-  echo "$as_me:$LINENO: result: $VXDUMP" >&5
-echo "${ECHO_T}$VXDUMP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-  test -n "$VXDUMP" && break
-done
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-for ac_prog in vxrestore
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_VXRESTORE+set}" = set; then
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $VXRESTORE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_VXRESTORE="$VXRESTORE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $VXSYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_VXRESTORE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-  ;;
-esac
 fi
-VXRESTORE=$ac_cv_path_VXRESTORE
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-if test -n "$VXRESTORE"; then
-  echo "$as_me:$LINENO: result: $VXRESTORE" >&5
-echo "${ECHO_T}$VXRESTORE" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
 
-  test -n "$VXRESTORE" && break
 done
 
-if test "$VXDUMP" -a "$VXRESTORE"; then
 
-cat >>confdefs.h <<_ACEOF
-#define VXDUMP "$VXDUMP"
+    #
+    # chio support
+    #
+    if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
+       { echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5
+echo $ECHO_N "checking for HP/UX-like scsi changer support... $ECHO_C" >&6; }
+if test "${amanda_cv_hpux_scsi_chio+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+#include <sys/scsi.h>
 
-cat >>confdefs.h <<_ACEOF
-#define VXRESTORE "$VXRESTORE"
-_ACEOF
+int
+main ()
+{
 
-fi
+           static struct element_addresses changer_info;
+           int i = SIOC_ELEMENT_ADDRESSES;
+           int j = SIOC_ELEMENT_STATUS;
+           int k = SIOC_MOVE_MEDIUM;
 
-for ac_prog in vdump
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_VDUMP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_hpux_scsi_chio=yes
 else
-  case $VDUMP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_VDUMP="$VDUMP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_VDUMP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-esac
+       amanda_cv_hpux_scsi_chio=no
 fi
-VDUMP=$ac_cv_path_VDUMP
 
-if test -n "$VDUMP"; then
-  echo "$as_me:$LINENO: result: $VDUMP" >&5
-echo "${ECHO_T}$VDUMP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5
+echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6; }
+       if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
+           WANT_SCSI_HPUX=yes
+           WANT_CHG_SCSI=yes
+       fi
+    fi
 
-  test -n "$VDUMP" && break
-done
-
-for ac_prog in vrestore
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_VRESTORE+set}" = set; then
+    #
+    # Linux SCSI based on ioctl
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5
+echo $ECHO_N "checking for Linux like scsi support (ioctl)... $ECHO_C" >&6; }
+if test "${amanda_cv_linux_scsi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $VRESTORE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_VRESTORE="$VRESTORE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_VRESTORE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-VRESTORE=$ac_cv_path_VRESTORE
-
-if test -n "$VRESTORE"; then
-  echo "$as_me:$LINENO: result: $VRESTORE" >&5
-echo "${ECHO_T}$VRESTORE" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$VRESTORE" && break
-done
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-if test "$VDUMP" -a "$VRESTORE"; then
+#include <scsi/scsi_ioctl.h>
+#include <sys/mtio.h>
 
-cat >>confdefs.h <<_ACEOF
-#define VDUMP "$VDUMP"
-_ACEOF
+int
+main ()
+{
 
+           int device;
+           char *Command;
+           ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
 
-cat >>confdefs.h <<_ACEOF
-#define VRESTORE "$VRESTORE"
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_linux_scsi=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       amanda_cv_linux_scsi=no
 fi
 
-if test "$PCAT"; then
-    AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
-else
-    AMPLOT_CAT_PACK=
-fi
-if test "$COMPRESS"; then
-    AMPLOT_COMPRESS=$COMPRESS
-    AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
-else
-    AMPLOT_CAT_COMPRESS=
-fi
-if test "$GZIP"; then
-    AMPLOT_COMPRESS=$GZIP
-    AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
-else
-    AMPLOT_CAT_GZIP=
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5
+echo "${ECHO_T}$amanda_cv_linux_scsi" >&6; }
+    fi
 
-
-
-
-
-echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
-echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6
-    if test "${ac_cv_has_sockaddr_storage+set}" = set; then
+    #
+    # Linux SCSI based on sg
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_scsi_sg_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5
+echo $ECHO_N "checking for Linux like scsi support (sg)... $ECHO_C" >&6; }
+if test "${amanda_cv_linux_sg_scsi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19152,74 +20328,69 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#      include <sys/types.h>
-#      include <sys/socket.h>
+#include <sys/types.h>
+#include <scsi/sg.h>
+#include <sys/mtio.h>
+
 int
 main ()
 {
-u_int i = sizeof (struct sockaddr_storage)
+
+           int device;
+           struct sg_header *psg_header;
+           char *buffer;
+           write(device, buffer, 1);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_has_sockaddr_storage=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_linux_sg_scsi=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_has_sockaddr_storage=no
+       amanda_cv_linux_sg_scsi=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
-echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6
-    if test $ac_cv_has_sockaddr_storage = yes ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKADDR_STORAGE 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5
+echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6; }
+    fi
 
+    if test x"$amanda_cv_linux_scsi" = x"yes" ||
+     test x"$amanda_cv_linux_sg_scsi" = x"yes";then
+           WANT_SCSI_LINUX=yes
+           WANT_CHG_SCSI=yes
     fi
 
-# Determine the printf format characters to use when printing
-# values of type long long. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistant result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
-#
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
-#
-echo "$as_me:$LINENO: checking printf format modifier for 64-bit integers" >&5
-echo $ECHO_N "checking printf format modifier for 64-bit integers... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
-  echo "$as_me:$LINENO: result: assuming target platform uses ll" >&5
-echo "${ECHO_T}assuming target platform uses ll" >&6
-       LL_FMT="%lld"; LL_RFMT="lld"
+    #
+    # HP-UX SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5
+echo $ECHO_N "checking for HP-UX like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_hpux_scsi+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -19229,129 +20400,134 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 #include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-}
+#include <sys/ioctl.h>
+#include <sys/scsi.h>
+#include <sys/mtio.h>
+
+int
+main ()
+{
+
+           int device;
+           char *Command;
+           ioctl(device, SIOC_IO, Command);
 
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: ll" >&5
-echo "${ECHO_T}ll" >&6
-       LL_FMT="%lld"; LL_RFMT="lld"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_hpux_scsi=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-echo "$as_me:$LINENO: result: l" >&5
-echo "${ECHO_T}l" >&6
-       LL_FMT="%ld"; LL_RFMT="ld"
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+       amanda_cv_hpux_scsi=no
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define LL_FMT "$LL_FMT"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define LL_RFMT "$LL_RFMT"
-_ACEOF
-
-
-
-
-GZIP=
-
-need_resetofs=yes
-echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5
-echo $ECHO_N "checking for large file compilation CFLAGS... $ECHO_C" >&6
-if test "${amanda_cv_LFS_CFLAGS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-       amanda_cv_LFS_CFLAGS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
-               amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
-               need_resetofs=no
-           fi
-       fi
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5
-echo "${ECHO_T}$amanda_cv_LFS_CFLAGS" >&6
-echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5
-echo $ECHO_N "checking for large file compilation LDFLAGS... $ECHO_C" >&6
-if test "${amanda_cv_LFS_LDFLAGS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-       amanda_cv_LFS_LDFLAGS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
-               amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
-               need_resetofs=no
+{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5
+echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6; }
+           if test x"$amanda_cv_hpux_scsi" = x"yes";then
+                   WANT_SCSI_HPUX_NEW=yes
+                   WANT_CHG_SCSI=yes
+                   WANT_CHG_SCSI_CHIO=yes
            fi
-       fi
-
+    fi
 
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5
-echo "${ECHO_T}$amanda_cv_LFS_LDFLAGS" >&6
-echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5
-echo $ECHO_N "checking for large file compilation LIBS... $ECHO_C" >&6
-if test "${amanda_cv_LFS_LIBS+set}" = set; then
+    #
+    # IRIX SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for Irix like scsi support" >&5
+echo $ECHO_N "checking for Irix like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_irix_scsi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-       amanda_cv_LFS_LIBS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
-               amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
-               need_resetofs=no
-           fi
-       fi
+#include <sys/types.h>
+#include <sys/dsreq.h>
+#include <sys/mtio.h>
 
+int
+main ()
+{
 
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5
-echo "${ECHO_T}$amanda_cv_LFS_LIBS" >&6
-if test "x$need_resetofs" = xyes; then
+           int device=1;
+           char Command;
+           ioctl(device, DS_ENTER, &Command);
 
-cat >>confdefs.h <<\_ACEOF
-#define NEED_RESETOFS 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_irix_scsi=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       amanda_cv_irix_scsi=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5
+echo "${ECHO_T}$amanda_cv_irix_scsi" >&6; }
+           if test x"$amanda_cv_irix_scsi" = x"yes";then
+                   WANT_SCSI_IRIX=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
 
-CFLAGS="$amanda_cv_LFS_CFLAGS $CFLAGS"
-CPPFLAGS="$amanda_cv_LFS_CPPFLAGS $CPPFLAGS"
-LDFLAGS="$amanda_cv_LFS_LDFLAGS $LDFLAGS"
-LIBS="$amanda_cv_LFS_LIBS $LIBS"
-
-echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6
-if test "${ac_cv_type_int+set}" = set; then
+    #
+    # Solaris  SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5
+echo $ECHO_N "checking for Solaris-like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_solaris_scsi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19360,412 +20536,599 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include <sys/types.h>
+#include <sys/scsi/impl/uscsi.h>
+#include <sys/mtio.h>
+
 int
 main ()
 {
-if ((int *) 0)
-  return 0;
-if (sizeof (int))
-  return 0;
+
+           int device;
+           char *Command;
+           ioctl(device, USCSICMD, Command);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_int=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_solaris_scsi=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_int=no
+       amanda_cv_solaris_scsi=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6
+{ echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5
+echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6; }
+           if test x"$amanda_cv_solaris_scsi" = x"yes";then
+                   WANT_SCSI_SOLARIS=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
 
-echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_int+set}" = set; then
+    #
+    # AIX SCSI
+    #
+    if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
+       test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then
+           { echo "$as_me:$LINENO: checking for AIX like scsi support" >&5
+echo $ECHO_N "checking for AIX like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_aix_scsi+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include <sys/types.h>
+#include <sys/scarray.h>
+#include <sys/tape.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
-test_array [0] = 0
+
+           int device;
+           char *Command;
+           ioctl(device, STIOCMD, Command);
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_aix_scsi=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       amanda_cv_aix_scsi=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5
+echo "${ECHO_T}$amanda_cv_aix_scsi" >&6; }
+           if test x"$amanda_cv_aix_scsi" = x"yes";then
+                   WANT_SCSI_AIX=yes
+                   WANT_CHG_SCSI=yes
+           fi
+    fi
+    #
+    # BSD CAM SCSI
+    #
+    if test x"$ac_cv_header_cam_cam_h" = x"yes";then
+           { echo "$as_me:$LINENO: checking for CAM like scsi support" >&5
+echo $ECHO_N "checking for CAM like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_cam_scsi+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include <stdio.h>
+# include <fcntl.h>
+# include <cam/cam.h>
+# include <cam/cam_ccb.h>
+# include <cam/scsi/scsi_message.h>
+# include <cam/scsi/scsi_pass.h>
+# include <camlib.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
+
+           struct cam_device *curdev;
+
+           curdev = cam_open_pass("", O_RDWR, NULL);
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_cam_scsi=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       amanda_cv_cam_scsi=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5
+echo "${ECHO_T}$amanda_cv_cam_scsi" >&6; }
+           if test x"$amanda_cv_cam_scsi" = x"yes";then
+                   WANT_SCSI_CAM=yes
+                   WANT_CHG_SCSI=yes
+
+{ echo "$as_me:$LINENO: checking for main in -lcam" >&5
+echo $ECHO_N "checking for main in -lcam... $ECHO_C" >&6; }
+if test "${ac_cv_lib_cam_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcam  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_cam_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_cam_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5
+echo "${ECHO_T}$ac_cv_lib_cam_main" >&6; }
+if test $ac_cv_lib_cam_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCAM 1
+_ACEOF
+
+  LIBS="-lcam $LIBS"
+
+fi
+
+           fi
+    fi
+
+
+    #
+    # BSD SCSI
+    #
+    if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
+       test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
+       { echo "$as_me:$LINENO: checking for BSD like scsi support" >&5
+echo $ECHO_N "checking for BSD like scsi support... $ECHO_C" >&6; }
+if test "${amanda_cv_bsd_scsi+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include <sys/types.h>
+#include <sys/scsiio.h>
+#include <sys/mtio.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
-test_array [0] = 0
+
+       int device=1;
+       char Command;
+       ioctl(device, SCIOCCOMMAND, &Command);
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_bsd_scsi=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+       amanda_cv_bsd_scsi=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5
+echo "${ECHO_T}$amanda_cv_bsd_scsi" >&6; }
+       if test x"$amanda_cv_bsd_scsi" = x"yes";then
+          WANT_SCSI_BSD=yes
+          WANT_CHG_SCSI=yes
+       fi
+    fi
+
+    # Do not build chg-scsi-chio if we cannot find the needed support
+    # include files for the SCSI interfaces
+    # chio.h and sys/chio.h are chio based systems
+    if test x"$ac_cv_header_chio_h" = x"yes" ||
+       test x"$ac_cv_header_linux_chio_h" = x"yes" ||
+       test x"$ac_cv_header_sys_chio_h" = x"yes"; then
+       # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
+       # incompatible with the introduction of camlib.h
+       if test x"$ac_cv_header_camlib_h" != x"yes"; then
+        WANT_SCSI_CHIO=yes
+        # prefer to use chg-scsi, unless we already have a driver for that,
+        # in which case set it up as chg-scsi-chio.
+        if test x"$WANT_CHG_SCSI" = x"no"; then
+          WANT_CHG_SCSI=yes
+        else
+          WANT_CHG_SCSI_CHIO=yes
+        fi
+       fi
+    fi
+
+    # scsi-based implementations
+     if test x"$WANT_CHG_SCSI" = x"yes"; then
+  WANT_CHG_SCSI_TRUE=
+  WANT_CHG_SCSI_FALSE='#'
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  WANT_CHG_SCSI_TRUE='#'
+  WANT_CHG_SCSI_FALSE=
+fi
+
+     if test x"$WANT_SCSI_LINUX" = x"yes"; then
+  WANT_SCSI_LINUX_TRUE=
+  WANT_SCSI_LINUX_FALSE='#'
+else
+  WANT_SCSI_LINUX_TRUE='#'
+  WANT_SCSI_LINUX_FALSE=
+fi
 
-ac_lo= ac_hi=
+     if test x"$WANT_SCSI_HPUX_NEW" = x"yes"; then
+  WANT_SCSI_HPUX_NEW_TRUE=
+  WANT_SCSI_HPUX_NEW_FALSE='#'
+else
+  WANT_SCSI_HPUX_NEW_TRUE='#'
+  WANT_SCSI_HPUX_NEW_FALSE=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+     if test x"$WANT_SCSI_IRIX" = x"yes"; then
+  WANT_SCSI_IRIX_TRUE=
+  WANT_SCSI_IRIX_FALSE='#'
+else
+  WANT_SCSI_IRIX_TRUE='#'
+  WANT_SCSI_IRIX_FALSE=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
+
+     if test x"$WANT_SCSI_SOLARIS" = x"yes"; then
+  WANT_SCSI_SOLARIS_TRUE=
+  WANT_SCSI_SOLARIS_FALSE='#'
+else
+  WANT_SCSI_SOLARIS_TRUE='#'
+  WANT_SCSI_SOLARIS_FALSE=
+fi
+
+     if test x"$WANT_SCSI_AIX" = x"yes"; then
+  WANT_SCSI_AIX_TRUE=
+  WANT_SCSI_AIX_FALSE='#'
+else
+  WANT_SCSI_AIX_TRUE='#'
+  WANT_SCSI_AIX_FALSE=
+fi
+
+     if test x"$WANT_SCSI_CAM" = x"yes"; then
+  WANT_SCSI_CAM_TRUE=
+  WANT_SCSI_CAM_FALSE='#'
+else
+  WANT_SCSI_CAM_TRUE='#'
+  WANT_SCSI_CAM_FALSE=
+fi
+
+     if test x"$WANT_SCSI_BSD" = x"yes"; then
+  WANT_SCSI_BSD_TRUE=
+  WANT_SCSI_BSD_FALSE='#'
+else
+  WANT_SCSI_BSD_TRUE='#'
+  WANT_SCSI_BSD_FALSE=
+fi
+
+
+    # scsi-chio-based implementations
+     if test x"$WANT_CHG_SCSI_CHIO" = x"yes"; then
+  WANT_CHG_SCSI_CHIO_TRUE=
+  WANT_CHG_SCSI_CHIO_FALSE='#'
+else
+  WANT_CHG_SCSI_CHIO_TRUE='#'
+  WANT_CHG_SCSI_CHIO_FALSE=
+fi
+
+     if test x"$WANT_SCSI_HPUX" = x"yes"; then
+  WANT_SCSI_HPUX_TRUE=
+  WANT_SCSI_HPUX_FALSE='#'
+else
+  WANT_SCSI_HPUX_TRUE='#'
+  WANT_SCSI_HPUX_FALSE=
+fi
+
+     if test x"$WANT_SCSI_CHIO" = x"yes"; then
+  WANT_SCSI_CHIO_TRUE=
+  WANT_SCSI_CHIO_FALSE='#'
+else
+  WANT_SCSI_CHIO_TRUE='#'
+  WANT_SCSI_CHIO_FALSE=
+fi
+
+
+
+
+
+
+
+for ac_header in fstab.h \
+       mntent.h \
+       mnttab.h \
+       sys/vfstab.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (int)); }
-unsigned long ulongval () { return (long) (sizeof (int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (int))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (int))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+  ac_header_preproc=no
 fi
-rm -f conftest.val
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_sizeof_int=0
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+fi
 
-echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6
-if test "${ac_cv_type_long+set}" = set; then
+done
+
+
+
+for ac_func in endmntent
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19774,990 +21137,1381 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-if ((long *) 0)
-  return 0;
-if (sizeof (long))
-  return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_long=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long=no
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long+set}" = set; then
+fi
+done
+
+
+for ac_func in setmntent
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h \
+        sys/fcntl.h \
+       sys/types.h \
+       sys/file.h \
+       unistd.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
-test_array [0] = 0
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
+
+done
+
+
+    # find a working file-locking mechanism.
+    # Note: these all use AC_TRY_LINK to make sure that we can compile
+    # and link each variant.  They do not try to test the variants --
+    # that is left to runtime.
+    WORKING_FILE_LOCK="no"
+
+    # check POSIX locking
+    { echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5
+echo $ECHO_N "checking whether POSIX locking (with fcntl(2)) is available... $ECHO_C" >&6; }
+if test "${amanda_cv_posix_filelocking+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
+
+           struct flock lock;
+
+           lock.l_type = F_RDLCK;
+           lock.l_start = 0;
+           lock.l_whence = SEEK_CUR;
+           lock.l_len = 0;
+           return fcntl(1, F_SETLK, &lock);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+       amanda_cv_posix_filelocking="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+
+       amanda_cv_posix_filelocking="no"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (long)); }
-unsigned long ulongval () { return (long) (sizeof (long)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
-  ;
-  return 0;
-}
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5
+echo "${ECHO_T}$amanda_cv_posix_filelocking" >&6; }
+    if test "x$amanda_cv_posix_filelocking" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_POSIX 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
+       WANT_AMFLOCK_POSIX="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+     if test x"$WANT_AMFLOCK_POSIX" = x"yes"; then
+  WANT_AMFLOCK_POSIX_TRUE=
+  WANT_AMFLOCK_POSIX_FALSE='#'
 else
-  ac_cv_sizeof_long=0
-fi
+  WANT_AMFLOCK_POSIX_TRUE='#'
+  WANT_AMFLOCK_POSIX_FALSE=
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
 
 
-echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6
-if test "${ac_cv_type_long_long+set}" = set; then
+    # check flock-based (BSD) locking
+    { echo "$as_me:$LINENO: checking whether flock locking is available" >&5
+echo $ECHO_N "checking whether flock locking is available... $ECHO_C" >&6; }
+if test "${amanda_cv_flock_filelocking+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+
 int
 main ()
 {
-if ((long long *) 0)
-  return 0;
-if (sizeof (long long))
-  return 0;
+
+           return flock(1, LOCK_SH);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_long_long=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+       amanda_cv_flock_filelocking="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_long_long=no
+
+       amanda_cv_flock_filelocking="no"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6
+{ echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5
+echo "${ECHO_T}$amanda_cv_flock_filelocking" >&6; }
+    if test "x$amanda_cv_flock_filelocking" = xyes; then
 
-echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long_long+set}" = set; then
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_FLOCK 1
+_ACEOF
+
+       WANT_AMFLOCK_FLOCK="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+     if test x"$WANT_AMFLOCK_FLOCK" = x"yes"; then
+  WANT_AMFLOCK_FLOCK_TRUE=
+  WANT_AMFLOCK_FLOCK_FALSE='#'
+else
+  WANT_AMFLOCK_FLOCK_TRUE='#'
+  WANT_AMFLOCK_FLOCK_FALSE=
+fi
+
+
+    # check lockf-based (SVR2, SVR3, SVR4) locking
+    { echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5
+echo $ECHO_N "checking whether lockf(3) locking is available... $ECHO_C" >&6; }
+if test "${amanda_cv_lockf_filelocking+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
-test_array [0] = 0
+
+           return lockf(1, F_LOCK, 0);
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+       amanda_cv_lockf_filelocking="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+
+       amanda_cv_lockf_filelocking="no"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
-test_array [0] = 0
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
-test_array [0] = 0
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5
+echo "${ECHO_T}$amanda_cv_lockf_filelocking" >&6; }
+    if test "x$amanda_cv_lockf_filelocking" = xyes; then
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_LOCKF 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+       WANT_AMFLOCK_LOCKF="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+     if test x"$WANT_AMFLOCK_LOCKF" = x"yes"; then
+  WANT_AMFLOCK_LOCKF_TRUE=
+  WANT_AMFLOCK_LOCKF_FALSE='#'
+else
+  WANT_AMFLOCK_LOCKF_TRUE='#'
+  WANT_AMFLOCK_LOCKF_FALSE=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+
+    # check our homebrew hardlink-based locking (requires hardlinks)
+    { echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5
+echo $ECHO_N "checking whether link(2) is available for locking... $ECHO_C" >&6; }
+if test "${amanda_cv_lnlock_filelocking+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
+           cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
-test_array [0] = 0
+
+           return link("/tmp/foo", "/tmp/bar");
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+       amanda_cv_lnlock_filelocking="yes"
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+
+       amanda_cv_lnlock_filelocking="no"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (long long)); }
-unsigned long ulongval () { return (long) (sizeof (long long)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long long))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long long))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long long))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
-  ;
-  return 0;
-}
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5
+echo "${ECHO_T}$amanda_cv_lnlock_filelocking" >&6; }
+    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_AMFLOCK_LNLOCK 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
+       WANT_AMFLOCK_LNLOCK="yes"
+       WORKING_FILE_LOCK="yes"
+    fi
+     if test x"$WANT_AMFLOCK_LNLOCK" = x"yes"; then
+  WANT_AMFLOCK_LNLOCK_TRUE=
+  WANT_AMFLOCK_LNLOCK_FALSE='#'
 else
-  ac_cv_sizeof_long_long=0
-fi
+  WANT_AMFLOCK_LNLOCK_TRUE='#'
+  WANT_AMFLOCK_LNLOCK_FALSE=
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
 
 
-echo "$as_me:$LINENO: checking for intmax_t" >&5
-echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
-if test "${ac_cv_type_intmax_t+set}" = set; then
+    if test x"$WORKING_FILE_LOCK" = "no"; then
+       # this shouldn't happen, and is *bad* if it does
+       { { echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5
+echo "$as_me: error: *** No working file locking capability found!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+
+
+    for ac_prog in swig
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { echo "$as_me:$LINENO: result: $SWIG" >&5
+echo "${ECHO_T}$SWIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$SWIG" && break
+done
+
+
+
+        # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { echo "$as_me:$LINENO: result: $SWIG" >&5
+echo "${ECHO_T}$SWIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+        if test -z "$SWIG" ; then
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "1.3.28" ; then
+                { echo "$as_me:$LINENO: checking for SWIG version" >&5
+echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; }
+                swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+                { echo "$as_me:$LINENO: result: $swig_version" >&5
+echo "${ECHO_T}$swig_version" >&6; }
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        required=1.3.28
+                        required_major=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_major" ; then
+                                required_major=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_minor=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_minor" ; then
+                                required_minor=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_patch=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_patch" ; then
+                                required_patch=0
+                        fi
+                        # Calculate the available version number components
+                        available=$swig_version
+                        available_major=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_major" ; then
+                                available_major=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_minor=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_minor" ; then
+                                available_minor=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_patch=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_patch" ; then
+                                available_patch=0
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                SWIG='echo "Error: SWIG version >= 1.3.28 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                        fi
+                else
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+
+
+
+
+
+    for ac_prog in perl5 perl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$PERL" && break
+done
+
+
+    # Make sure we have perl
+if test -z "$PERL"; then
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="perl"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+
+# Check if version of Perl is sufficient
+ac_perl_version="5.6.0"
+
+if test "x$PERL" != "x"; then
+  { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
+echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; }
+  # NB: It would be nice to log the error if there is one, but we cannot rely
+  # on autoconf internals
+  $PERL -e "use $ac_perl_version;" > /dev/null 2>&1
+  if test $? -ne 0; then
+    { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };
+
+       { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
+echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
+   { (exit 1); exit 1; }; }
+
+  else
+    { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; };
+
+  fi
+else
+  { echo "$as_me:$LINENO: WARNING: could not find perl" >&5
+echo "$as_me: WARNING: could not find perl" >&2;}
+fi
+
+
+
+
+
+
+    # If we want cygwin to copy ddl to modules directory.
+    WANT_CYGWIN_COPY_PERL_DLL="false"
+
+    # get the include path for building perl extensions
+    PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc`
+
+
+    if test x"$enable_shared" = x"no"; then
+       { { echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5
+echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    case "$target" in
+       *freebsd[123456]*) # up to and including FreeBSD 6.*
+           # Before 7.0, FreeBSD systems don't include a DT_NEEDS segment in
+           # libgthread to automatically pull in the desired threading library.
+           # Instead, they assume that any application linking against
+           # libgthread will pull in the threading library.  This is fine for
+           # Amanda C applications, but for Perl applications this assumption
+           # means that the perl binary would pull in the threading library.
+           # But perl is compiled without threading by default.
+           #
+           # Specifically, this occurs on any FreeBSD using gcc-3.*: the linking
+           # decision is made in gcc's spec files, which were changed in
+           # gcc-4.0.  For a more in-depth discussion, see
+           #  http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_FreeBSD
+           #
+           # The easiest solution for the "default" case is to link all perl
+           # extension libraries against the threading library, so it is loaded
+           # when perl loads the extension library.  The default threading
+           # library in FreeBSD is libpthread.  The below default will work on
+           # such a FreeBSD system, but ports maintainers and those with
+           # different configurations may need to override this value with
+           # --with-perlextlibs.
+           #
+           # We can't use -pthread because gcc on FreeBSD ignores -pthread in
+           # combination with -shared.  See
+           #   http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026229.html
+
+           PERLEXTLIBS="-lpthread"
+           ;;
+       *-pc-cygwin)
+           # When need -lperl and the '-L' where it is located,
+           # we don't want the DynaLoader.a
+           PERLEXTLIBS=`perl -MExtUtils::Embed -e ldopts | sed -e 's/^.*-L/-L/'`
+           WANT_CYGWIN_COPY_PERL_DLL="true";
+           ;;
+    esac
+     if $WANT_CYGWIN_COPY_PERL_DLL; then
+  WANT_CYGWIN_COPY_PERL_DLL_TRUE=
+  WANT_CYGWIN_COPY_PERL_DLL_FALSE='#'
+else
+  WANT_CYGWIN_COPY_PERL_DLL_TRUE='#'
+  WANT_CYGWIN_COPY_PERL_DLL_FALSE=
+fi
+
+
+
+# Check whether --with-perlextlibs was given.
+if test "${with_perlextlibs+set}" = set; then
+  withval=$with_perlextlibs;
+           case "$withval" in
+               y|ye|yes) { { echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5
+echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;}
+   { (exit 1); exit 1; }; };;
+               n|no) PERLEXTLIBS='';;
+               *) PERLEXTLIBS="$withval" ;;
+           esac
+
+fi
+
+
+
+
+
+    # Extract the first word of "cat", so it can be a program name with args.
+set dummy cat; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CAT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CAT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CAT" && ac_cv_path_CAT="cat"
+  ;;
+esac
+fi
+CAT=$ac_cv_path_CAT
+if test -n "$CAT"; then
+  { echo "$as_me:$LINENO: result: $CAT" >&5
+echo "${ECHO_T}$CAT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+
+
+
+
+
+    if test "$GZIP"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GZIP 1
+_ACEOF
+
+       COMPRESS_PATH="$GZIP"
+       COMPRESS_SUFFIX=".gz"
+       COMPRESS_FAST_OPT="--fast"
+       COMPRESS_BEST_OPT="--best"
+       UNCOMPRESS_PATH="$GZIP"
+       UNCOMPRESS_OPT="-dc"
+    else
+       if test "$COMPRESS"; then
+           COMPRESS_PATH="$COMPRESS"
+           COMPRESS_SUFFIX=".Z"
+           COMPRESS_FAST_OPT="-f"
+           COMPRESS_BEST_OPT="-f"
+           UNCOMPRESS_PATH="$COMPRESS"
+           UNCOMPRESS_OPT="-dc"
+       else
+           # If we have to use cat, we don't define COMPRESS_FAST_OPT,
+           # COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
+           # look for a file by the name of "".
+           # XXX is the above true? --dustin
+
+
+    { echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress.  Using cat." >&5
+echo "$as_me: WARNING: Cannot find either gzip or compress.  Using cat." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Cannot find either gzip or compress.  Using cat.
+AAW_EOF
+
+
+           COMPRESS_PATH="$CAT"
+           COMPRESS_SUFFIX=""
+           COMPRESS_FAST_OPT=""
+           COMPRESS_BEST_OPT=""
+           UNCOMPRESS_PATH="$CAT"
+           UNCOMPRESS_OPT=""
+       fi
+    fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_PATH "$COMPRESS_PATH"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT"
+_ACEOF
+
+
+    # Empty GZIP so that make dist works.
+    GZIP=
+
+
+    { echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
+echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; }
+if test "${ac_cv_has_sockaddr_storage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#      include <sys/types.h>
+#      include <sys/socket.h>
 int
 main ()
 {
-if ((intmax_t *) 0)
-  return 0;
-if (sizeof (intmax_t))
-  return 0;
+u_int i = sizeof (struct sockaddr_storage)
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_intmax_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_has_sockaddr_storage=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_intmax_t=no
+       ac_cv_has_sockaddr_storage=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
-echo "${ECHO_T}$ac_cv_type_intmax_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
+echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; }
 
-echo "$as_me:$LINENO: checking size of intmax_t" >&5
-echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_intmax_t+set}" = set; then
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_STORAGE 1
+_ACEOF
+
+    fi
+
+
+
+
+    WORKING_IPV6=no
+
+# Check whether --with-ipv6 was given.
+if test "${with_ipv6+set}" = set; then
+  withval=$with_ipv6;
+           case "$withval" in
+           y | ye | yes) amanda_with_ipv6=yes;;
+           n | no) amanda_with_ipv6=no;;
+           *)
+               { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
+   { (exit 1); exit 1; }; }
+             ;;
+           esac
+
+else
+
+           amanda_with_ipv6=maybe
+
+
+fi
+
+
+    if test x"$amanda_with_ipv6" = x"yes" ||
+       test x"$amanda_with_ipv6" = x"maybe" ; then
+       { echo "$as_me:$LINENO: checking for working IPv6" >&5
+echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6; }
+if test "${amanda_cv_working_ipv6+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_intmax_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+           case "$target" in
+               *-pc-cygwin) amanda_cv_working_ipv6=no;;
+               *)
+                   if test "$cross_compiling" = yes; then
+   amanda_cv_working_ipv6=yes
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <sys/socket.h>
+#include <errno.h>
+
+main()
+{
+   int aa;
+   aa = socket(AF_INET6, SOCK_STREAM, 0);
+   if (aa > 0) return 0;
+   return aa;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+   amanda_cv_working_ipv6=yes
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+( exit $ac_status )
+ amanda_cv_working_ipv6=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+           esac
+
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5
+echo "${ECHO_T}$amanda_cv_working_ipv6" >&6; }
+
+       if test "$amanda_cv_working_ipv6" = yes; then
+           WORKING_IPV6=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define WORKING_IPV6 1
+_ACEOF
+
+       else
+           # error out only if the user specifically requested support
+           if test x"$amanda_with_ipv6" = x"yes"; then
+               { { echo "$as_me:$LINENO: error: IPv6 support was requested, but it is not working." >&5
+echo "$as_me: error: IPv6 support was requested, but it is not working." >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+       fi
+    fi
+
+
+
+
+# Check whether --with-mmap was given.
+if test "${with_mmap+set}" = set; then
+  withval=$with_mmap;
+           case "$FORCE_MMAP" in
+               y | ye | yes | n | no) : ;;
+               *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;}
+   { (exit 1); exit 1; }; } ;;
+           esac
+           FORCE_MMAP=$withval
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   : ${FORCE_MMAP=no}
+
+fi
+
+
+
 
+
+for ac_header in \
+           sys/shm.h \
+           sys/mman.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20765,249 +22519,271 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+for ac_header in stdlib.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_intmax_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (intmax_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (intmax_t)); }
-unsigned long ulongval () { return (long) (sizeof (intmax_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (intmax_t))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (intmax_t))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (intmax_t))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_intmax_t=`cat conftest.val`
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (intmax_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+  ac_header_preproc=no
 fi
-rm -f conftest.val
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_sizeof_intmax_t=0
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+fi
 
-echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6
-if test "${ac_cv_type_off_t+set}" = set; then
+done
+
+
+for ac_func in getpagesize
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21016,162 +22792,386 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-if ((off_t *) 0)
-  return 0;
-if (sizeof (off_t))
-  return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_off_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_off_t=no
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
 
-echo "$as_me:$LINENO: checking size of off_t" >&5
-echo $ECHO_N "checking size of off_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_off_t+set}" = set; then
+fi
+done
+
+{ echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; }
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_off_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
   if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h.  */
+# ifndef HAVE_SYS_PARAM_H
+#  define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)];
-test_array [0] = 0
+  char *data, *data2, *data3;
+  int i, pagesize;
+  int fd;
 
-  ;
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    return 1;
+  if (write (fd, data, pagesize) != pagesize)
+    return 1;
+  close (fd);
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    return 1;
+  data2 = (char *) malloc (2 * pagesize);
+  if (!data2)
+    return 1;
+  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      return 1;
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    return 1;
+  if (read (fd, data3, pagesize) != pagesize)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      return 1;
+  close (fd);
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
+
+fi
+rm -f conftest.mmap
+
+
+
+for ac_func in shmget
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+
+
+
+
+for ac_header in sys/types.h \
+           sys/ipc.h \
+           sys/shm.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21179,249 +23179,359 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+
+done
+
+
+       { echo "$as_me:$LINENO: checking for shmdt() argument type" >&5
+echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6; }
+if test "${amanda_cv_shmdt_arg_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+               if test "$ac_cv_func_shmget" = yes; then
+                   cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+#endif
+#ifdef HAVE_SYS_SHM_H
+# include <sys/shm.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void *shmat(int, void *, int);
+#else
+void *shmat();
+#endif
+
+int main()
+{
+    int i;
+    return 0;
+}
+EOF
+                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
+                   if test $? = 0; then
+                       amanda_cv_shmdt_arg_type=void
+                   else
+                       amanda_cv_shmdt_arg_type=char
+                   fi
+                   rm -f conftest*
+               else
+                   amanda_cv_shmdt_arg_type=nothing
+               fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5
+echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type
+_ACEOF
+
+
+
+           case "$FORCE_MMAP" in
+           n | no)
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYSVSHM 1
+_ACEOF
+
+             ;;
+           esac
+
+
+fi
+done
+
+
+ice_have_shmat=no
+
+for ac_func in shmat
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_shmat=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-case $ac_lo in
-?*) ac_cv_sizeof_off_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (off_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+
+if test "${ice_have_shmat}" = yes; then
+{ echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_shmat_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+ice_cv_have_shmat_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (off_t)); }
-unsigned long ulongval () { return (long) (sizeof (off_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (off_t))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (off_t))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (off_t))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+#include <$header>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_off_t=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (off_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmat[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmat_decl=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
+
+if test "$ice_cv_have_shmat_decl" = yes; then
+       break
 fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmat_decl=yes
 fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_off_t=0
+rm -f conftest*
+
+if test "$ice_cv_have_shmat_decl" = yes; then
+       break
 fi
+done
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6; }
+if test "$ice_cv_have_shmat_decl" = yes; then
+
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+#define HAVE_SHMAT_DECL 1
 _ACEOF
 
+fi
+fi
+
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
+ice_have_shmctl=no
+
+for ac_func in shmctl
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21430,412 +23540,515 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_size_t=no
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_shmctl=yes
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
+done
 
-echo "$as_me:$LINENO: checking size of size_t" >&5
-echo $ECHO_N "checking size of size_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_size_t+set}" = set; then
+if test "${ice_have_shmctl}" = yes; then
+{ echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_shmctl_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_size_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+
+ice_cv_have_shmctl_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)];
-test_array [0] = 0
+#include <$header>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmctl[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmctl_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_shmctl_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmctl[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmctl_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_shmctl_decl" = yes; then
+       break
+fi
+done
+
+fi
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6; }
+if test "$ice_cv_have_shmctl_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SHMCTL_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_shmdt=no
+
+for ac_func in shmdt
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_shmdt=yes
+fi
+done
+
+if test "${ice_have_shmdt}" = yes; then
+{ echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_shmdt_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+ice_cv_have_shmdt_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)];
-test_array [0] = 0
+#include <$header>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmdt[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmdt_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_shmdt_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)];
-test_array [0] = 0
+#include <$header>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmdt[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmdt_decl=yes
+fi
+rm -f conftest*
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+if test "$ice_cv_have_shmdt_decl" = yes; then
+       break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+done
+
+fi
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6; }
+if test "$ice_cv_have_shmdt_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SHMDT_DECL 1
+_ACEOF
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+
+
+ice_have_shmget=no
+
+for ac_func in shmget
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_shmget=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-case $ac_lo in
-?*) ac_cv_sizeof_size_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+
+if test "${ice_have_shmget}" = yes; then
+{ echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_shmget_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+ice_cv_have_shmget_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (size_t)); }
-unsigned long ulongval () { return (long) (sizeof (size_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (size_t))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (size_t))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (size_t))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+#include <$header>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_size_t=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmget[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmget_decl=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
+
+if test "$ice_cv_have_shmget_decl" = yes; then
+       break
 fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmget[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmget_decl=yes
 fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_size_t=0
+rm -f conftest*
+
+if test "$ice_cv_have_shmget_decl" = yes; then
+       break
 fi
+done
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6; }
+if test "$ice_cv_have_shmget_decl" = yes; then
+
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+#define HAVE_SHMGET_DECL 1
 _ACEOF
 
+fi
+fi
 
-echo "$as_me:$LINENO: checking for ssize_t" >&5
-echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
-if test "${ac_cv_type_ssize_t+set}" = set; then
+
+    if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
+       case "$FORCE_MMAP" in
+       n | no)
+           if test "x$ac_cv_func_shmget" != xyes; then
+
+    { echo "$as_me:$LINENO: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&5
+echo "$as_me: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Neither shmget() nor mmap() found. This system will not support the Amanda server.
+AAW_EOF
+
+
+               NO_SERVER_MODE=true
+           fi
+         ;;
+       y | ye | yes)
+
+    { echo "$as_me:$LINENO: WARNING: --with-mmap used on a system with no mmap() support.  This system will not support the Amanda server." >&5
+echo "$as_me: WARNING: --with-mmap used on a system with no mmap() support.  This system will not support the Amanda server." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+--with-mmap used on a system with no mmap() support.  This system will not support the Amanda server.
+AAW_EOF
+
+
+           NO_SERVER_MODE=true
+         ;;
+       esac
+    fi
+
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21844,412 +24057,485 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/types.h>
+#include <$ac_hdr>
+
 int
 main ()
 {
-if ((ssize_t *) 0)
-  return 0;
-if (sizeof (ssize_t))
-  return 0;
+if ((DIR *) 0)
+return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_ssize_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_ssize_t=no
+       eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
 
-echo "$as_me:$LINENO: checking size of ssize_t" >&5
-echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_ssize_t+set}" = set; then
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_ssize_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+  ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* 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 opendir ();
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= 0)];
-test_array [0] = 0
-
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_lib in '' dir; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_opendir=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
+else
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+  { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* 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 opendir ();
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return opendir ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_lib in '' x; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_opendir=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-cat >conftest.$ac_ext <<_ACEOF
+fi
+
+fi
+
+
+    # include the dirent headers as described in the autoconf documentation.
+    { echo "$as_me:$LINENO: checking whether readdir is declared" >&5
+echo $ECHO_N "checking whether readdir is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_readdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) < 0)];
-test_array [0] = 0
+#ifndef readdir
+  (void) readdir;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_readdir=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_readdir=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir" >&5
+echo "${ECHO_T}$ac_cv_have_decl_readdir" >&6; }
+if test $ac_cv_have_decl_readdir = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR 0
+_ACEOF
+
+
+fi
+{ echo "$as_me:$LINENO: checking whether readdir_r is declared" >&5
+echo $ECHO_N "checking whether readdir_r is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_readdir_r+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= $ac_mid)];
-test_array [0] = 0
+#ifndef readdir_r
+  (void) readdir_r;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_readdir_r=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+       ac_cv_have_decl_readdir_r=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir_r" >&5
+echo "${ECHO_T}$ac_cv_have_decl_readdir_r" >&6; }
+if test $ac_cv_have_decl_readdir_r = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR_R 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR_R 0
+_ACEOF
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+{ echo "$as_me:$LINENO: checking whether readdir64 is declared" >&5
+echo $ECHO_N "checking whether readdir64 is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_readdir64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)];
-test_array [0] = 0
+#ifndef readdir64
+  (void) readdir64;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_readdir64=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_cv_have_decl_readdir64=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_ssize_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (ssize_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (ssize_t)); }
-unsigned long ulongval () { return (long) (sizeof (ssize_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (ssize_t))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (ssize_t))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (ssize_t))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64" >&5
+echo "${ECHO_T}$ac_cv_have_decl_readdir64" >&6; }
+if test $ac_cv_have_decl_readdir64 = yes; then
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR64 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_ssize_t=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (ssize_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
+
 else
-  ac_cv_sizeof_ssize_t=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR64 0
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for time_t" >&5
-echo $ECHO_N "checking for time_t... $ECHO_C" >&6
-if test "${ac_cv_type_time_t+set}" = set; then
+fi
+{ echo "$as_me:$LINENO: checking whether readdir64_r is declared" >&5
+echo $ECHO_N "checking whether readdir64_r is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_readdir64_r+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -22258,1372 +24544,1554 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+
 int
 main ()
 {
-if ((time_t *) 0)
-  return 0;
-if (sizeof (time_t))
-  return 0;
+#ifndef readdir64_r
+  (void) readdir64_r;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_time_t=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_readdir64_r=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_time_t=no
+       ac_cv_have_decl_readdir64_r=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5
-echo "${ECHO_T}$ac_cv_type_time_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64_r" >&5
+echo "${ECHO_T}$ac_cv_have_decl_readdir64_r" >&6; }
+if test $ac_cv_have_decl_readdir64_r = yes; then
 
-echo "$as_me:$LINENO: checking size of time_t" >&5
-echo $ECHO_N "checking size of time_t... $ECHO_C" >&6
-if test "${ac_cv_sizeof_time_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$ac_cv_type_time_t" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR64_R 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_READDIR64_R 0
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+
+fi
+
+
+
+
+    # disk device prefixes
+    { echo "$as_me:$LINENO: checking disk device prefixes" >&5
+echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6; }
+
+    # Use df to find the mount point for the root filesystem.  Use
+    # the positional parameters to find the particular line from df
+    # that contains the root paritition.  We put it in a subshell so
+    # that the original positional parameters are not messed with.
+    dfline=`(
+       df / | while read line; do
+           set -- $line
+                   while test $# -gt 0; do
+               if test "x$1" = "x/"; then
+                   echo $line
+                   break 2
+               fi
+               shift
+           done
+       done
+    ) | sed 's/(//' | sed 's/)//' `
+
+    # Search for the mount point by using expr to find the parameter
+    # with dev in it.
+    mount=`(
+       set -- $dfline
+               while test $# -gt 0; do
+           if expr "$1" : '.*dev' >/dev/null 2>&1; then
+               echo $1
+               break
+           fi
+           shift
+       done
+    )`
+
+    # get any system-specific configuration information
+    case "$target" in
+       *-hp-*)
+           CLIENT_SCRIPTS_OPT=amhpfixdevs
+           case $mount in
+               /dev/vg*)
+
+    { echo "$as_me:$LINENO: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&5
+echo "$as_me: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Run amhpfixdevs on HP-UX systems using /dev/vg??.
+AAW_EOF
+
+
+                   ;;
+           esac
+           ;;
+       *-sni-sysv4)
+           DEV_PREFIX=/dev/dsk/
+           RDEV_PREFIX=/dev/rdsk/
+           CLIENT_SCRIPTS_OPT=amsinixfixdevs
+           if ! test -d /dev/dsk; then
+
+    { echo "$as_me:$LINENO: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&5
+echo "$as_me: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Run amsinixfixdevs on Sinix systems using VxFS.
+AAW_EOF
+
+
+           fi
+           ;;
+       *-sco3.2v4*)
+           DEV_PREFIX=/dev/
+           RDEV_PREFIX=/dev/
+           ;;
+       *)
+           CLIENT_SCRIPTS_OPT=
+           ;;
+    esac
+
+    if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
+       { echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5
+echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6; }
+    else
+       if test -d /dev/dsk; then
+           DEV_PREFIX=/dev/dsk/
+           if test -d /dev/rdsk; then
+               RDEV_PREFIX=/dev/rdsk/
+           else
+               RDEV_PREFIX=/dev/dsk/
+           fi
+       elif test -d /dev; then
+           DEV_PREFIX=/dev/
+
+           # Some systems, notably Linux, do not have raw disk devices
+           # names.  Check this by trying to see if a raw disk device name
+           # exists using the normal raw device path prepended to the
+           # mount point of the root filesystem.
+           if test "$mount"; then
+               dev_name="/dev/r`basename $mount`"
+               if test -b $dev_name -o -c $dev_name; then
+                   RDEV_PREFIX=/dev/r
+               else
+                   RDEV_PREFIX=/dev/
+               fi
+           else
+               RDEV_PREFIX=/dev/r
+           fi
+       else
+           # just fake it..
+           DEV_PREFIX=/
+           RDEV_PREFIX=/
+       fi
+       { echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5
+echo "${ECHO_T}$DEV_PREFIX - $RDEV_PREFIX" >&6; }
+    fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEV_PREFIX "${DEV_PREFIX}"
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+
+cat >>confdefs.h <<_ACEOF
+#define RDEV_PREFIX "${RDEV_PREFIX}"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
+
+
+
+
+    case "$target" in
+       *-dec-osf*)
+                   ;;
+       *-dg-*)
+                   ;;
+       *-netbsd*)
+                   ;;
+       *-freebsd*)
+                   ;;
+       *-openbsd*)
+                   ;;
+       *-hp-*)
+                   case "$CC" in
+                       *gcc*)
+                           CPPFLAGS="$CPPFLAGS -D__STDC_EXT__"
+
+                           ;;
+                       *cc*)
+                           CFLAGS="$CFLAGS -Ae"
+
+                           ;;
+                   esac
+                   ;;
+       *-ibm-aix*)
+                   ;;
+       m88k-motorola-sysv4)
+                   ;;
+       *-nextstep3)
+                   ;;
+       *-pc-bsdi*)
+                   ;;
+       *-pc-linux-*)
+                   ;;
+       *-redhat-linux-*)
+                   ;;
+       *-suse-linux-*)
+                   ;;
+       x86_64-*-linux-*)
+                   ;;
+       alpha*-*-linux-*)
+                   ;;
+       sparc*-*-linux-*)
+                   ;;
+       powerpc-*-linux-*)
+                   ;;
+        *-sgi-irix3*)
+                   # The old cc won't work!
+                   if test "x$GCC" != "xyes"; then
+                       { { echo "$as_me:$LINENO: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&5
+echo "$as_me: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&2;}
+   { (exit 1); exit 1; }; }
                    fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+                   ;;
+        *-sgi-irix4*)
+                   ;;
+        *-sgi-irix5*)
+                   ;;
+        *-sgi-irix6*)
+                   ;;
+        *-solaris2*)
+                   ;;
+        *-sun-sunos4.1*)
+                   ;;
+        *-ultrix*)
+                   ;;
+        *-sysv4.2uw2*)
+                   ;;
+        *-sco3.2v5*)
+                   ;;
+        i386-pc-isc4*)
+                   ;;
+        *-sni-sysv4)
+                   ;;
+        *-pc-cygwin)
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define IGNORE_TAR_ERRORS 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (time_t))) < 0)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+                   # Cygwin needs PATH to find cygwin1.dll
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_PATH_ENV 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+
+cat >>confdefs.h <<\_ACEOF
+#define IGNORE_FSTAB 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= $ac_mid)];
-test_array [0] = 0
 
-  ;
-  return 0;
-}
+                   LDFLAGS="$LDFLAGS -Wl,-enable-runtime-pseudo-reloc -no-undefined"
+
+                   ;;
+        *-apple-darwin7*) # MacOS X 10.3.* (Panther)
+                   ;;
+        *-apple-darwin8*) # MacOS X 10.4.* (Tiger)
+                   ;;
+      *)
+
+
+    cat <<AAW_EOF >>config.warnings
+*****
+This machine, target type $target, is not known to be fully supported
+by this configure script.  If the installation of Amanda on this system
+succeeds or needed any patches, please email amanda-hackers@amanda.org
+with the patches or an indication of the sucess or failure of the
+Amanda installation on your system.
+*****
+AAW_EOF
+
+                   ;;
+    esac
+
+
+
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$bindir\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  bindir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define bindir "$ac_define_dir"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$sbindir\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  sbindir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define sbindir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$libexecdir\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  libexecdir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define libexecdir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$mandir\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  mandir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define mandir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+    # amanda-specific directories
+    AMLIBDIR=$libdir/amanda
+
+# Check whether --with-amlibdir was given.
+if test "${with_amlibdir+set}" = set; then
+  withval=$with_amlibdir;
+           case "$withval" in
+               n | no) AMLIBDIR=$libdir ;;
+               y | ye | yes) AMLIBDIR=$libdir/amanda ;;
+               *) AMLIBDIR=$withval ;;
+           esac
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$AMLIBDIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  amlibdir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define amlibdir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+    AMLIBEXECDIR=$libexecdir/amanda
+
+# Check whether --with-amlibexecdir was given.
+if test "${with_amlibexecdir+set}" = set; then
+  withval=$with_amlibexecdir;
+           case "$withval" in
+               n | no) AMLIBEXECDIR=$libexecdir ;;
+               y | ye | yes) AMLIBEXECDIR=$libexecdir/amanda ;;
+               *) AMLIBEXECDIR=$withval ;;
+           esac
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$AMLIBEXECDIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  amlibexecdir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define amlibexecdir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+    amincludedir="${includedir}/amanda"
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$amincludedir\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  amincludedir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define amincludedir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+
+# Check whether --with-amperldir was given.
+if test "${with_amperldir+set}" = set; then
+  withval=$with_amperldir;
+           case "$withval" in
+               y | ye | yes) AMPERLLIB=DEFAULT ;;
+               n | no) AMPERLLIB=$amlibdir/perl ;;
+               *) AMPERLLIB=$withval ;;
+           esac
+
+else
+
+           AMPERLLIB=DEFAULT
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
+
+    # apply the default if no value was given.
+    if test x"$AMPERLLIB" = x"DEFAULT"; then
+       eval `$PERL -V:installsitelib`
+       AMPERLLIB=$installsitelib
+    fi
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$AMPERLLIB\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  amperldir="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define amperldir "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+
+    DUMPER_DIR='${amlibexecdir}/application'
+
+  prefix_NONE=
+  exec_prefix_NONE=
+  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
+  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
+  eval ac_define_dir="\"$DUMPER_DIR\""
+  eval ac_define_dir="\"$ac_define_dir\""
+  DUMPER_DIR="$ac_define_dir"
+
+
+cat >>confdefs.h <<_ACEOF
+#define DUMPER_DIR "$ac_define_dir"
+_ACEOF
+
+  test "$prefix_NONE" && prefix=NONE
+  test "$exec_prefix_NONE" && exec_prefix=NONE
+
+    # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR'
+
+
+#
+# Internationalization
+#
+
+    # FreeBSD needs to link libxpg4
+
+{ echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5
+echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6; }
+if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxpg4  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* 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 setlocale ();
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return setlocale ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_xpg4_setlocale=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_cv_lib_xpg4_setlocale=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5
+echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6; }
+if test $ac_cv_lib_xpg4_setlocale = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXPG4 1
+_ACEOF
+
+  LIBS="-lxpg4 $LIBS"
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+    # ------------------------------------------------------------------
+    # All list of languages for which a translation exist. Each
+    #  language is separated by a space.
+    # ------------------------------------------------------------------
+    ALL_LINGUAS=""
+
+
+    # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MSGFMT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-case $ac_lo in
-?*) ac_cv_sizeof_time_t=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (time_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
+done
+IFS=$as_save_IFS
+
+  ;;
 esac
+fi
+MSGFMT=$ac_cv_path_MSGFMT
+if test -n "$MSGFMT"; then
+  { echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6; }
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (time_t)); }
-unsigned long ulongval () { return (long) (sizeof (time_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (time_t))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (time_t))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (time_t))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_time_t=`cat conftest.val`
+    # Extract the first word of "gettext", so it can be a program name with args.
+set dummy gettext; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GETTEXT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $GETTEXT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GETTEXT="$GETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (time_t), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+  ;;
+esac
 fi
-rm -f conftest.val
+GETTEXT=$ac_cv_path_GETTEXT
+if test -n "$GETTEXT"; then
+  { echo "$as_me:$LINENO: result: $GETTEXT" >&5
+echo "${ECHO_T}$GETTEXT" >&6; }
 else
-  ac_cv_sizeof_time_t=0
-fi
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
-_ACEOF
 
 
 
-# Check whether --enable-shared or --disable-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
+
+
+  { echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; }
+    # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then
+  enableval=$enable_nls; USE_NLS=$enableval
 else
-  enable_shared=yes
-fi;
+  USE_NLS=yes
+fi
 
-# Check whether --enable-static or --disable-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
+  { echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6; }
+
+
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
 else
-  enable_static=yes
-fi;
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
 
-# Check whether --enable-fast-install or --disable-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
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case "$MSGFMT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
       done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+    ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+  { echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6; }
 else
-  enable_fast_install=yes
-fi;
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
-if test "${lt_cv_path_SED+set}" = set; then
+  # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # 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
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   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
-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
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   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
+done
+IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+  { echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-SED=$lt_cv_path_SED
-echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6
 
 
-# Check whether --with-gnu-ld or --without-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.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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` ;;
+    case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+    *) MSGFMT_015=$MSGFMT ;;
   esac
-  case $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
-    ;;
+
+  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
   esac
-elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
-else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
-fi
-if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
 else
-  # 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
+  ac_executable_p="test -f"
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
-with_gnu_ld=$lt_cv_prog_gnu_ld
+rm -f conf$$.file
 
-
-echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
-if test "${lt_cv_ld_reload_flag+set}" = set; then
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  lt_cv_ld_reload_flag='-r'
-fi
-echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$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
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
+  case "$XGETTEXT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
     ;;
 esac
-
-echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
-if test "${lt_cv_path_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}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"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi
-fi
-echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6
-NM="$lt_cv_path_NM"
-
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+  { echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
-if test "${lt_cv_deplibs_check_method+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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
-aix4* | aix5*)
-  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
-  ;;
+    rm -f messages.po
 
-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'
-  ;;
+    case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
 
-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'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-freebsd* | kfreebsd*-gnu | 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
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
   else
-    lt_cv_deplibs_check_method=pass_all
+    PATH_SEPARATOR=:
   fi
-  ;;
+  rm -f conf$$.sh
+fi
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
 
-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]) shared object file - PA-RISC [0-9].[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MSGMERGE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case "$MSGMERGE" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
     ;;
   *)
-    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
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+            ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
     ;;
-  esac
-  ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+  { echo "$as_me:$LINENO: result: $MSGMERGE" >&5
+echo "${ECHO_T}$MSGMERGE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-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 Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+        test -n "$localedir" || localedir='${datadir}/locale'
 
-netbsd*)
-  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
-  ;;
+  ac_config_commands="$ac_config_commands po-directories"
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
-  ;;
 
-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
-  ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  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
-    ;;
-  esac
-  ;;
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+  withval=$with_libiconv_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
-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
 
+      LIBICONV=
+  LTLIBICONV=
+  INCICONV=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='iconv '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBICONV; do
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$hardcode_direct" = yes; then
+                                                      LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBICONV; do
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-fi;
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                                                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+              else
+                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCICONV; do
 
-# 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:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+                    LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+            LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+      done
+    fi
   fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 23199 "configure"' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; 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
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+    done
   fi
-  rm -rf conftest*
-  ;;
 
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          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-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          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"
-  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
-if test "${lt_cv_cc_needs_belf+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5
+echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; }
+if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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
-
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <CoreFoundation/CFPreferences.h>
 int
 main ()
 {
-
+CFPreferencesCopyAppValue(NULL, NULL)
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  lt_cv_cc_needs_belf=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gt_cv_func_CFPreferencesCopyAppValue=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-lt_cv_cc_needs_belf=no
+       gt_cv_func_CFPreferencesCopyAppValue=no
 fi
-rm -f 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
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
 fi
-echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$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
-  ;;
-
-esac
-
-need_locks="$enable_libtool_lock"
-
+{ echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
+_ACEOF
 
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  fi
+    { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5
+echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; }
+if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+#include <CoreFoundation/CFLocale.h>
+int
+main ()
+{
+CFLocaleCopyCurrent();
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gt_cv_func_CFLocaleCopyCurrent=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       gt_cv_func_CFLocaleCopyCurrent=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
+echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; }
+  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CFLOCALECOPYCURRENT 1
+_ACEOF
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
 
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+    if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
 
-  test -n "$ac_ct_CXX" && break
-done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
 
-  CXX=$ac_ct_CXX
-fi
 
 
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
 
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+
+        { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5
+echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; }
+if test "${gt_cv_func_gnugettext1_libc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -23632,1205 +26100,944 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
 int
 main ()
 {
-#ifndef __GNUC__
-       choke me
-#endif
-
+bindtextdomain ("", "");
+return * gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gt_cv_func_gnugettext1_libc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+       gt_cv_func_gnugettext1_libc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cxx_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5
+echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; }
 
-int
-main ()
-{
+        if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cxx_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
+
+
+
+          am_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCICONV; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+  { echo "$as_me:$LINENO: checking for iconv" >&5
+echo $ECHO_N "checking for iconv... $ECHO_C" >&6; }
+if test "${am_cv_func_iconv+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
+
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
 #include <stdlib.h>
+#include <iconv.h>
 int
 main ()
 {
-exit (42);
+iconv_t cd = iconv_open("","");
+       iconv(cd,NULL,NULL,NULL,NULL);
+       iconv_close(cd);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  am_cv_func_iconv=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
+#include <stdlib.h>
+#include <iconv.h>
 int
 main ()
 {
-exit (42);
+iconv_t cd = iconv_open("","");
+         iconv(cd,NULL,NULL,NULL,NULL);
+         iconv_close(cd);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+
 fi
 
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      LIBS="$am_save_LIBS"
+    fi
 
-depcc="$CXX"  am_compiler_list=
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
+echo "${ECHO_T}$am_cv_func_iconv" >&6; }
+  if test "$am_cv_func_iconv" = yes; then
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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'.
-  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
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ICONV 1
+_ACEOF
 
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
-  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 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+  if test "$am_cv_lib_iconv" = yes; then
+    { echo "$as_me:$LINENO: checking how to link with libiconv" >&5
+echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; }
+    { echo "$as_me:$LINENO: result: $LIBICONV" >&5
+echo "${ECHO_T}$LIBICONV" >&6; }
+  else
+            CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
 
-    case $depmode in
-    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
-      ;;
-    none) break ;;
-    esac
-    # 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.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
 
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
-fi
 
-fi
-echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
 
 
-if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
 
+    use_additional=yes
 
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
 
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Check whether --with-libintl-prefix was given.
+if test "${with_libintl_prefix+set}" = set; then
+  withval=$with_libintl_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
 fi
 
+      LIBINTL=
+  LTLIBINTL=
+  INCINTL=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='intl '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$hardcode_direct" = yes; then
+                                                      LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                                                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+              else
+                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+                    LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+            LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+          fi
+        fi
+      fi
     done
-    ac_cv_prog_CXXCPP=$CXXCPP
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+    done
+  fi
 
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
+          { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5
+echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; }
+if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6
-ac_preproc_ok=false
-for ac_cxx_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 >conftest.$ac_ext <<_ACEOF
+  gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+                        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
 #endif
-                    Syntax error
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  gt_cv_func_gnugettext1_libintl=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
+       gt_cv_func_gnugettext1_libintl=no
 fi
-rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+                        if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ac_nonexistent.h>
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+int
+main ()
+{
+bindtextdomain ("", "");
+return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_cxx_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBINTL="$LIBINTL $LIBICONV"
+                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                gt_cv_func_gnugettext1_libintl=yes
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
+
 fi
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"
 fi
+{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5
+echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; }
+        fi
 
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+                                        if test "$gt_cv_func_gnugettext1_libc" = "yes" \
+           || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+                    LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
 
-fi
 
 
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
-  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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$F77"; then
-  ac_cv_prog_F77="$F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+                LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NLS 1
+_ACEOF
+
+    else
+      USE_NLS=no
+    fi
   fi
-done
-done
 
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
-  echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  { echo "$as_me:$LINENO: checking whether to use NLS" >&5
+echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6; }
+  if test "$USE_NLS" = "yes"; then
+    { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5
+echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; }
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
+    else
+      gt_source="included intl directory"
+    fi
+    { echo "$as_me:$LINENO: result: $gt_source" >&5
+echo "${ECHO_T}$gt_source" >&6; }
+  fi
 
-    test -n "$F77" && break
+  if test "$USE_NLS" = "yes"; then
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
+        { echo "$as_me:$LINENO: checking how to link with libintl" >&5
+echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; }
+        { echo "$as_me:$LINENO: result: $LIBINTL" >&5
+echo "${ECHO_T}$LIBINTL" >&6; }
+
+  for element in $INCINTL; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
   done
-fi
-if test -z "$F77"; then
-  ac_ct_F77=$F77
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+
+      fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETTEXT 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DCGETTEXT 1
+_ACEOF
+
+    fi
+
+        POSUB=po
+  fi
+
+
+
+    INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+#
+# Devices
+#
+
+    case "$target" in
+        sparc-sun-solaris2.10) # Solaris 10
+        # curl is not in the LD_LIBRARY_PATH on Solaris 10, so we search
+        # for it in a few common paths; we then extract the -L flags and
+        # translate them to -R flags, as required by the runtime linker.
+        # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_CURL_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_F77"; then
-  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+  case $CURL_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin"
+for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_F77="$ac_prog"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
-  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6
+CURL_CONFIG=$ac_cv_path_CURL_CONFIG
+if test -n "$CURL_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5
+echo "${ECHO_T}$CURL_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  test -n "$ac_ct_F77" && break
-done
 
-  F77=$ac_ct_F77
-fi
+        if test -n "$CURL_CONFIG"; then
+            curlflags=`$CURL_CONFIG --libs 2>/dev/null`
+            for flag in curlflags; do
+                case $flag in
+                    -L*) LDFLAGS="$LDFLAGS "`echo "x$flag" | sed -e 's/^x-L/-R/'`;;
+                esac
+            done
+        fi
+        ;;
+    esac
 
 
-# Provide some information about the compiler.
-echo "$as_me:24305:" \
-     "checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file.  (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-      program main
-#ifndef __GNUC__
-       choke me
-#endif
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_f77_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_f77_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_f77_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_f77_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_f77_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
-if test "$ac_test_FFLAGS" = set; then
-  FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-g -O2"
-  else
-    FFLAGS="-g"
-  fi
-else
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-O2"
-  else
-    FFLAGS=
-  fi
-fi
-
-G77=`test $ac_compiler_gnu = yes && echo yes`
-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
-
 
 
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
-# find the maximum length of command line arguments
-echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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*)
-    # 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;
-    ;;
 
-  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`
-    ;;
-  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
-    ;;
-  *)
-    # 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.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
-              = "XX$teststring") >/dev/null 2>&1 &&
-           new_result=`expr "X$teststring" : ".*" 2>&1` &&
-           lt_cv_sys_max_cmd_len=$new_result &&
-           test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    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`
-    ;;
-  esac
 
-fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
-else
-  echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
-fi
 
 
 
 
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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]*\)'
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDGIRSTW]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris* | sysv5*)
-  symcode='[BDRT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
 
-# 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
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
 
-# Try without a prefix undercore, 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.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
-  # Check to see that the pipe works correctly.
-  pipe_works=no
 
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
 
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { (eval echo "$as_me:$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=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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 <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
 
-EOF
-         # Now generate the symbol file.
-         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
-         cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
 
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-         cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
 
-#ifdef __cplusplus
-}
-#endif
-EOF
-         # Now try linking the two files.
-         mv conftest.$ac_objext conftstm.$ac_objext
-         lt_save_LIBS="$LIBS"
-         lt_save_CFLAGS="$CFLAGS"
-         LIBS="conftstm.$ac_objext"
-         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext}; then
-           pipe_works=yes
-         fi
-         LIBS="$lt_save_LIBS"
-         CFLAGS="$lt_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 -f 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
-  echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6
-else
-  echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
-fi
 
-echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6
-if test "${lt_cv_objdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
+# Check whether --with-libcurl was given.
+if test "${with_libcurl+set}" = set; then
+  withval=$with_libcurl; _libcurl_with=$withval
 else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
+  _libcurl_with=yes
 fi
-echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6
-objdir=$lt_cv_objdir
 
 
+  if test "$_libcurl_with" != "no" ; then
 
-
-
-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
-
-# 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 to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
+     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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
+  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
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
     echo "$as_me:$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
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+
+  test -n "$AWK" && break
+done
+
+
+     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
+
+     _libcurl_try_link=yes
+
+     if test -d "$_libcurl_with" ; then
+        LIBCURL_CPPFLAGS="-I$withval/include"
+        _libcurl_ldflags="-L$withval/lib"
+        # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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
+  case $_libcurl_config in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "$withval/bin"
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="ar"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
-fi
+  test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin""
+  ;;
+esac
 fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+echo "${ECHO_T}$_libcurl_config" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  AR=$ac_ct_AR
-else
-  AR="$ac_cv_prog_AR"
-fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
+     else
+        # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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
+  case $_libcurl_config in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+echo "${ECHO_T}$_libcurl_config" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+
+     fi
+
+     if test x$_libcurl_config != "x" ; then
+        { echo "$as_me:$LINENO: checking for the version of libcurl" >&5
+echo $ECHO_N "checking for the version of libcurl... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_curl_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5
+echo "${ECHO_T}$libcurl_cv_lib_curl_version" >&6; }
+
+        _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+        _libcurl_wanted=`echo 7.10.0 | $_libcurl_version_parse`
+
+        if test $_libcurl_wanted -gt 0 ; then
+           { echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5
+echo $ECHO_N "checking for libcurl >= version 7.10.0... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_version_ok+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+              if test $_libcurl_version -ge $_libcurl_wanted ; then
+                 libcurl_cv_lib_version_ok=yes
+              else
+                 libcurl_cv_lib_version_ok=no
+              fi
 
-  RANLIB=$ac_ct_RANLIB
-else
-  RANLIB="$ac_cv_prog_RANLIB"
 fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5
+echo "${ECHO_T}$libcurl_cv_lib_version_ok" >&6; }
+        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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+        if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+           fi
+           if test x"$LIBCURL" = "x" ; then
+              LIBCURL=`$_libcurl_config --libs`
+
+              # This is so silly, but Apple actually has a bug in their
+              # curl-config script.  Fixed in Tiger, but there are still
+              # lots of Panther installs around.
+              case "${host}" in
+                 powerpc-apple-darwin7*)
+                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+                 ;;
+              esac
+           fi
 
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+           # All curl-config scripts support --feature
+           _libcurl_features=`$_libcurl_config --feature`
 
-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
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+           # Is it modern enough to have --protocols? (7.12.4)
+           if test $_libcurl_version -ge 461828 ; then
+              _libcurl_protocols=`$_libcurl_config --protocols`
+           fi
+        else
+           _libcurl_try_link=no
+        fi
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+        unset _libcurl_wanted
+     fi
+
+     if test $_libcurl_try_link = yes ; then
 
-  STRIP=$ac_ct_STRIP
+        # we didn't find curl-config, so let's see if the user-supplied
+        # link line (or failing that, "-lcurl") is enough.
+        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+        { echo "$as_me:$LINENO: checking whether libcurl is usable" >&5
+echo $ECHO_N "checking whether libcurl is usable... $ECHO_C" >&6; }
+if test "${libcurl_cv_lib_curl_usable+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  STRIP="$ac_cv_prog_STRIP"
-fi
 
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBCURL $LIBS"
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <curl/curl.h>
+int
+main ()
+{
 
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  libcurl_cv_lib_curl_usable=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+       libcurl_cv_lib_curl_usable=no
 fi
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
 
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF 1>&2
+fi
+{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5
+echo "${ECHO_T}$libcurl_cv_lib_curl_usable" >&6; }
 
-*** 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
+        if test $libcurl_cv_lib_curl_usable = yes ; then
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
+           # Does curl_free() exist in this version of libcurl?
+           # If not, fake it with free()
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBS $LIBCURL"
 
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+           { echo "$as_me:$LINENO: checking for curl_free" >&5
+echo $ECHO_N "checking for curl_free... $ECHO_C" >&6; }
+if test "${ac_cv_func_curl_free+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF 1>&2
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define curl_free to an innocuous variant, in case <limits.h> declares curl_free.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define curl_free innocuous_curl_free
 
-*** 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
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char curl_free (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+#undef curl_free
+
+/* 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 curl_free ();
+/* 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_curl_free || defined __stub___curl_free
+choke me
+#endif
+
+int
+main ()
+{
+return curl_free ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_curl_free=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  else
-    MAGIC_CMD=:
-  fi
+       ac_cv_func_curl_free=no
 fi
 
-  fi
-  ;;
-esac
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5
+echo "${ECHO_T}$ac_cv_func_curl_free" >&6; }
+if test $ac_cv_func_curl_free = yes; then
+  :
+else
 
-enable_dlopen=no
-enable_win32_dll=no
+cat >>confdefs.h <<\_ACEOF
+#define curl_free free
+_ACEOF
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+fi
 
-fi;
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
 
-# Check whether --with-pic or --without-pic was given.
-if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
-else
-  pic_mode=default
-fi;
-test -z "$pic_mode" && pic_mode=default
 
-# Use C for the default configuration in the libtool script
-tagname=
-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
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCURL 1
+_ACEOF
 
 
-# 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;\n"
+           for _libcurl_feature in $_libcurl_features ; do
+              cat >>confdefs.h <<_ACEOF
+#define `echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
+_ACEOF
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+              eval `echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
+           done
 
+           if test "x$_libcurl_protocols" = "x" ; then
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+              # We don't have --protocols, so just assume that all
+              # protocols are available
+              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+              if test x$libcurl_feature_SSL = xyes ; then
+                 _libcurl_protocols="$_libcurl_protocols HTTPS"
 
+                 # FTPS wasn't standards-compliant until version
+                 # 7.11.0
+                 if test $_libcurl_version -ge 461568; then
+                    _libcurl_protocols="$_libcurl_protocols FTPS"
+                 fi
+              fi
+           fi
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+           for _libcurl_protocol in $_libcurl_protocols ; do
+              cat >>confdefs.h <<_ACEOF
+#define `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
+_ACEOF
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+              eval `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
+           done
+        else
+           unset LIBCURL
+           unset LIBCURL_CPPFLAGS
+        fi
+     fi
 
+     unset _libcurl_try_link
+     unset _libcurl_version_parse
+     unset _libcurl_config
+     unset _libcurl_feature
+     unset _libcurl_features
+     unset _libcurl_protocol
+     unset _libcurl_protocols
+     unset _libcurl_version
+     unset _libcurl_ldflags
+  fi
 
-#
-# Check for any special shared library compilation flags.
-#
-lt_prog_cc_shlib=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    lt_prog_cc_shlib='-belf'
-    ;;
-  esac
-fi
-if test -n "$lt_prog_cc_shlib"; then
-  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
-echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
-  if echo "$old_CC $old_CFLAGS " | grep "[     ]$lt_prog_cc_shlib[     ]" >/dev/null; then :
+  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+     # This is the IF-NO path
+     HAVE_CURL=no
   else
-    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
-echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
-    lt_cv_prog_cc_can_build_shared=no
+     # This is the IF-YES path
+     HAVE_CURL=yes
   fi
-fi
 
+  unset _libcurl_with
 
-#
-# Check to make sure the static flag actually works.
-#
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
-   printf "$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 "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
-       $SED '/^$/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_prog_compiler_static_works=yes
-       fi
-     else
-       lt_prog_compiler_static_works=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
+    if test x"$HAVE_CURL" = x"yes"; then
+       LIBS="$LIBCURL $LIBS"
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+       CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
 
-if test x"$lt_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
 
 
 
-## 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...
+    { echo "$as_me:$LINENO: checking for curl_off_t" >&5
+echo $ECHO_N "checking for curl_off_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_curl_off_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-lt_prog_compiler_no_builtin_flag=
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <curl/curl.h>
 
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+typedef curl_off_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_curl_off_t=yes
 else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   printf "$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:25407: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:25411: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_type_curl_off_t=no
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$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
-    :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_curl_off_t" >&6; }
+if test $ac_cv_type_curl_off_t = yes; then
+  :
+else
 
-fi
 
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
+cat >>confdefs.h <<\_ACEOF
+#define curl_off_t off_t
+_ACEOF
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
 
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
+fi
 
-    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*)
-      # 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'
-      ;;
+    fi
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
 
-    mingw* | pw32* | os2*)
-      # 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'
-      ;;
+    HAVE_HMAC=yes
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
+{ echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5
+echo $ECHO_N "checking for HMAC_CTX_init in -lcrypto... $ECHO_C" >&6; }
+if test "${ac_cv_lib_crypto_HMAC_CTX_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    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
-      ;;
+/* 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 HMAC_CTX_init ();
+int
+main ()
+{
+return HMAC_CTX_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_crypto_HMAC_CTX_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
+       ac_cv_lib_crypto_HMAC_CTX_init=no
+fi
 
-    hpux*)
-      # 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='-fPIC'
-       ;;
-      esac
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_HMAC_CTX_init" >&6; }
+if test $ac_cv_lib_crypto_HMAC_CTX_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
 
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    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
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic='-qnocommon'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-       esac
-       ;;
+  LIBS="-lcrypto $LIBS"
 
-    mingw* | pw32* | os2*)
-      # 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'
-      ;;
+else
+  HAVE_HMAC=no
+fi
 
-    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'
-      ;;
+    found_hmac_h=no
 
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       lt_prog_compiler_wl='-Wl,'
-       lt_prog_compiler_pic='-KPIC'
-       lt_prog_compiler_static='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # 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'
-        ;;
-      esac
-      ;;
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
+for ac_header in openssl/hmac.h crypto/hmac.h hmac.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    sco3.2v5*)
-      lt_prog_compiler_pic='-Kpic'
-      lt_prog_compiler_static='-dn'
-      ;;
+       ac_header_compiler=no
+fi
 
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-       lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+  ac_header_preproc=no
+fi
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_prog_compiler_pic='-Kconform_pic'
-       lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ found_hmac_h=yes; break
+fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+done
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
+    if test x"$found_hmac_h" != x"yes"; then
+       HAVE_HMAC=no
+    fi
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works=no
-  ac_outfile=conftest.$ac_objext
-   printf "$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:25669: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:25673: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works=yes
-     fi
-   fi
-   $rm conftest*
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
 
-if test x"$lt_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
+
+
+    if test "$libcurl_feature_SSL" != "yes" ||
+       test "$libcurl_protocol_HTTPS" != "yes"; then
+        s3_ssl=no
+    else
+       s3_ssl=yes
+    fi
+
+    # Check whether --enable-s3-device was given.
+if test "${enable_s3_device+set}" = set; then
+  enableval=$enable_s3_device;  WANT_S3_DEVICE=$enableval
 else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
+   WANT_S3_DEVICE=maybe
 fi
 
-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
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5
+echo $ECHO_N "checking whether to include the Amazon S3 device... $ECHO_C" >&6; }
+    # if the user didn't specify 'no', then check for support
+    if test x"$WANT_S3_DEVICE" != x"no"; then
+       if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then
+           WANT_S3_DEVICE=yes
+       else
+           # no support -- if the user explicitly enabled the device,
+           # then this is an error
+           if test x"$WANT_S3_DEVICE" = x"yes"; then
+               { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+               { { echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5
+echo "$as_me: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&2;}
+   { (exit 1); exit 1; }; }
+           else
+               WANT_S3_DEVICE=no
+           fi
+       fi
+    fi
+    { echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5
+echo "${ECHO_T}$WANT_S3_DEVICE" >&6; }
+
+     if test x"$WANT_S3_DEVICE" = x"yes"; then
+  WANT_S3_DEVICE_TRUE=
+  WANT_S3_DEVICE_FALSE='#'
 else
-  lt_cv_prog_compiler_c_o=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+  WANT_S3_DEVICE_TRUE='#'
+  WANT_S3_DEVICE_FALSE=
+fi
 
-   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:25731: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:25735: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || 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 ..
-   rmdir conftest
-   $rm conftest*
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+    # Now handle any setup for S3, if we want it.
+    if test x"$WANT_S3_DEVICE" = x"yes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define WANT_S3_DEVICE
+_ACEOF
 
-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
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
+       if test x"$s3_ssl" = x"no"; then
+
+    { echo "$as_me:$LINENO: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&5
+echo "$as_me: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+Encryption support is not available for S3; requests will be sent in plaintext.
+AAW_EOF
+
+
+       fi
+    fi
+
+
+    # Check whether --enable-devpay was given.
+if test "${enable_devpay+set}" = set; then
+  enableval=$enable_devpay; WANT_DEVPAY=$enableval
 else
-  need_locks=no
+  WANT_DEVPAY=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
 
-  runpath_var=
-  allow_undefined_flag=
-  enable_shared_with_static_runtimes=no
-  archive_cmds=
-  archive_expsym_cmds=
-  old_archive_From_new_cmds=
-  old_archive_from_expsyms_cmds=
-  export_dynamic_flag_spec=
-  whole_archive_flag_spec=
-  thread_safe_flag_spec=
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
-  hardcode_libdir_separator=
-  hardcode_direct=no
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  link_all_deplibs=unknown
-  hardcode_automatic=no
-  module_cmds=
-  module_expsym_cmds=
-  always_export_symbols=no
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # 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_"
-  # 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.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+    { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device's DevPay support" >&5
+echo $ECHO_N "checking whether to include the Amazon S3 device's DevPay support... $ECHO_C" >&6; }
+    if test x"$WANT_DEVPAY" = x"yes"; then
+       if test x"$WANT_S3_DEVICE" != x"yes"; then
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: DevPay support requires the S3 device (--enable-s3-device)" >&5
+echo "$as_me: error: DevPay support requires the S3 device (--enable-s3-device)" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
 
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # 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
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
+       if test "$s3_ssl" != "yes"; then
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+           { { echo "$as_me:$LINENO: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&5
+echo "$as_me: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&2;}
+   { (exit 1); exit 1; }; }
+       fi
 
-  ld_shlibs=yes
-  if test "$with_gnu_ld" = 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=
+cat >>confdefs.h <<\_ACEOF
+#define WANT_DEVPAY
+_ACEOF
+
     fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [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
+    { echo "$as_me:$LINENO: result: $WANT_DEVPAY" >&5
+echo "${ECHO_T}$WANT_DEVPAY" >&6; }
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       ld_shlibs=no
-       cat <<EOF 1>&2
+     if test "$WANT_DEVPAY" = "yes"; then
+  WANT_DEVPAY_TRUE=
+  WANT_DEVPAY_FALSE='#'
+else
+  WANT_DEVPAY_TRUE='#'
+  WANT_DEVPAY_FALSE=
+fi
 
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
 
-EOF
-      fi
-      ;;
 
-    amigaos*)
-      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
 
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs=no
-      ;;
 
-    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*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+for ac_header in \
+       linux/zftape.h \
+       sys/tape.h \
+       sys/mtio.h \
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$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}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       ld_shlibs=no
-      fi
-      ;;
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # 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; $echo \"$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' ;;
-       esac
-       archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       ac_header_compiler=no
+fi
 
-       if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-       fi
-      else
-       ld_shlibs=no
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-    netbsd*)
-      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 $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'
-      fi
-      ;;
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       ld_shlibs=no
-       cat <<EOF 1>&2
+  ac_header_preproc=no
+fi
 
-*** 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.
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       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
-      ;;
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       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
-      ;;
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+    # check for MTIOCTOP, an indicator of POSIX tape support
+    { echo "$as_me:$LINENO: checking for MTIOCTOP" >&5
+echo $ECHO_N "checking for MTIOCTOP... $ECHO_C" >&6; }
+if test "${amanda_cv_HAVE_MTIOCTOP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_SYS_TAPE_H
+# include <sys/tape.h>
+#endif
+#ifdef HAVE_SYS_MTIO_H
+# include <sys/mtio.h>
+#endif
+#ifndef MTIOCTOP
+#error MTIOCTOP not defined
+#endif
+
+int
+main ()
+{
+ int dummy = 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_HAVE_MTIOCTOP=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       amanda_cv_HAVE_MTIOCTOP=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP
+
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5
+echo "${ECHO_T}$amanda_cv_HAVE_MTIOCTOP" >&6; }
+
+    # decide which tape device to compile (arranged in such a way that
+    # only one actually gets compiled)
+    case "$target" in
+      *-ibm-aix*) aix_tapeio=yes ;;
+      *-sysv4.2uw2*) uware_tapeio=yes ;;
+      *-sco3.2v5*) xenix_tapeio=yes ;;
+      i386-pc-isc4*) xenix_tapeio=yes ;;
     esac
 
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
+    # maybe we have no tape device at all (e.g., Mac OS X)?
+    if test -n "$xenix_tapeio" ||
+       test -n "$aix_tapeio" ||
+       test -n "$uware_tapeio" ||
+       test -n "$HAVE_MTIOCTOP"; then
+       want_tape_device=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_TAPE_DEVICE 1
+_ACEOF
+
     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 "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       hardcode_direct=unsupported
-      fi
-      ;;
 
-    aix4* | aix5*)
-      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
-       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")) && (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
+     if test -n "$xenix_tapeio"; then
+  WANT_TAPE_XENIX_TRUE=
+  WANT_TAPE_XENIX_FALSE='#'
+else
+  WANT_TAPE_XENIX_TRUE='#'
+  WANT_TAPE_XENIX_FALSE=
+fi
 
-       # 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].*|aix5*)
-         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
+     if test -n "$aix_tapeio"; then
+  WANT_TAPE_AIX_TRUE=
+  WANT_TAPE_AIX_FALSE='#'
+else
+  WANT_TAPE_AIX_TRUE='#'
+  WANT_TAPE_AIX_FALSE=
+fi
 
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
+     if test -n "$uware_tapeio"; then
+  WANT_TAPE_UWARE_TRUE=
+  WANT_TAPE_UWARE_FALSE='#'
+else
+  WANT_TAPE_UWARE_TRUE='#'
+  WANT_TAPE_UWARE_FALSE=
+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.
+     if test -n "$HAVE_MTIOCTOP"; then
+  WANT_TAPE_POSIX_TRUE=
+  WANT_TAPE_POSIX_FALSE='#'
+else
+  WANT_TAPE_POSIX_TRUE='#'
+  WANT_TAPE_POSIX_FALSE=
+fi
 
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
+     if test -n "$want_tape_device"; then
+  WANT_TAPE_DEVICE_TRUE=
+  WANT_TAPE_DEVICE_FALSE='#'
+else
+  WANT_TAPE_DEVICE_TRUE='#'
+  WANT_TAPE_DEVICE_FALSE=
+fi
 
-      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
-         hardcode_direct=yes
-         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
-      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
 
-      # 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.
-       cat >conftest.$ac_ext <<_ACEOF
+    if test -n "$xenix_tapeio"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_TAPE_XENIX 1
+_ACEOF
+
+    fi
+
+    if test -n "$aix_tapeio"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_TAPE_AIX 1
+_ACEOF
+
+    fi
+
+    if test -n "$uware_tapeio"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_TAPE_UWARE 1
+_ACEOF
+
+    fi
+
+    #
+    # Check for various "mt status" related structure elements.
+    #
+    { echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5
+echo $ECHO_N "checking for mt_flags mtget structure element... $ECHO_C" >&6; }
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+
 int
 main ()
 {
 
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_flags;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_FLAGS 1
+_ACEOF
+
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    { echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5
+echo $ECHO_N "checking for mt_fileno mtget structure element... $ECHO_C" >&6; }
+    mt_fileno_result="found"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
+
 int
 main ()
 {
 
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_fileno;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_FILENO 1
+_ACEOF
+
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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'
-         # -bexpall does not export symbols beginning with underscore (_)
-         always_export_symbols=yes
-         # Exported symbols can be pulled into shared objects from archives
-         whole_archive_flag_spec=' '
-         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 $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    amigaos*)
-      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
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
-      ;;
+    { echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5
+echo $ECHO_N "checking for mt_blkno mtget structure element... $ECHO_C" >&6; }
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
-    cygwin* | mingw* | pw32*)
-      # 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.
-      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 `echo "$deplibs" | $SED -e '\''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'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
-      ;;
+int
+main ()
+{
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc=no
-      hardcode_direct=no
-      hardcode_automatic=yes
-      hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec=''
-      link_all_deplibs=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs=no
-          ;;
-      esac
-    fi
-      ;;
+           struct mtget buf;
+           long ds;
 
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
+           ds = buf.mt_blkno;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
-    # 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
-      ;;
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
-    # 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
-      ;;
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_BLKNO 1
+_ACEOF
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds='$CC -shared -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 -fPIC ${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
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-      # 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* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-         hardcode_libdir_flag_spec_ld='+b $libdir'
-         hardcode_libdir_separator=:
-         hardcode_direct=no
-         hardcode_shlibpath_var=no
-         ;;
-       ia64*)
-         hardcode_libdir_flag_spec='-L$libdir'
-         hardcode_direct=no
-         hardcode_shlibpath_var=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L=yes
-         ;;
-       *)
-         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-         hardcode_libdir_separator=:
-         hardcode_direct=yes
-         export_dynamic_flag_spec='${wl}-E'
+fi
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L=yes
-         ;;
-       esac
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec_ld='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      link_all_deplibs=yes
-      ;;
+    { echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5
+echo $ECHO_N "checking for mt_dsreg mtget structure element... $ECHO_C" >&6; }
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    netbsd*)
-      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
-      ;;
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
-    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
-      ;;
+int
+main ()
+{
 
-    openbsd*)
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      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
-      ;;
+           struct mtget buf;
+           long ds;
 
-    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'
-      ;;
+           ds = buf.mt_dsreg;
 
-    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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       allow_undefined_flag=' -expect_unresolved \*'
-       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
-    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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
-       # Both c and cxx compiler support -rpath directly
-       hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      hardcode_libdir_separator=:
-      ;;
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_DSREG 1
+_ACEOF
 
-    sco3.2v5*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
 
-    solaris*)
-      no_undefined_flag=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       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'
-      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 linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
-       *)
-         whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      link_all_deplibs=yes
-      ;;
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    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
-      ;;
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
+fi
 
-    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
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    sysv4.2uw2*)
-      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=no
-      hardcode_shlibpath_var=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+    { echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5
+echo $ECHO_N "checking for mt_erreg mtget structure element... $ECHO_C" >&6; }
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
-    sysv5*)
-      no_undefined_flag=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      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'
-      hardcode_libdir_flag_spec=
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-      ;;
+int
+main ()
+{
 
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
+           struct mtget buf;
+           long ds;
 
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-  fi
+           ds = buf.mt_erreg;
 
-echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6
-test "$ld_shlibs" = no && can_build_shared=no
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_ERREG 1
+_ACEOF
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 
-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
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 #
-# Do we need to explicitly link libc?
+# Security (authentication) mechansims
 #
-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.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+    BSD_SECURITY="yes"
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl
-        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:$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=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-         archive_cmds_need_lc=no
-        else
-         archive_cmds_need_lc=yes
-        fi
-        allow_undefined_flag=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
+# Check whether --with-bsd-security was given.
+if test "${with_bsd_security+set}" = set; then
+  withval=$with_bsd_security;
+            case "$withval" in
+                n | no) BSD_SECURITY=no ;;
+                y |  ye | yes) ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;}
+   { (exit 1); exit 1; }; }
+                    ;;
+            esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
-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
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+    USE_AMANDAHOSTS=yes
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
+# Check whether --with-amandahosts was given.
+if test "${with_amandahosts+set}" = set; then
+  withval=$with_amandahosts;
+            case "$withval" in
+                n | no ) USE_AMANDAHOSTS="no" ;;
+                y |  ye | yes) : ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5
+echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+            esac
 
-aix4* | aix5*)
-  version_type=linux
-  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*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
+fi
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  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
-  ;;
+    if test "x$BSD_SECURITY" = "xyes"; then
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+cat >>confdefs.h <<\_ACEOF
+#define BSD_SECURITY 1
+_ACEOF
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
+        if test "x$USE_AMANDAHOSTS" = "xyes"; then
 
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
+cat >>confdefs.h <<\_ACEOF
+#define USE_AMANDAHOSTS 1
+_ACEOF
 
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
+        fi
+    fi
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
+     if test x"$BSD_SECURITY" = x"yes"; then
+  WANT_BSD_SECURITY_TRUE=
+  WANT_BSD_SECURITY_FALSE='#'
+else
+  WANT_BSD_SECURITY_TRUE='#'
+  WANT_BSD_SECURITY_FALSE=
+fi
 
-dgux*)
-  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
-  ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
 
-kfreebsd*-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='GNU ld.so'
-  ;;
+    BSDTCP_SECURITY="no"
 
-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[123]*) 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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
+# Check whether --with-bsdtcp-security was given.
+if test "${with_bsdtcp_security+set}" = set; then
+  withval=$with_bsdtcp_security;
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) BSDTCP_SECURITY=yes ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
-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
-  hardcode_into_libs=yes
-  ;;
+fi
+
+
+    if test "x$BSDTCP_SECURITY" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define BSDTCP_SECURITY 1
+_ACEOF
 
-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'
-  ;;
+     if test x"$BSDTCP_SECURITY" = x"yes"; then
+  WANT_BSDTCP_SECURITY_TRUE=
+  WANT_BSDTCP_SECURITY_FALSE='#'
+else
+  WANT_BSDTCP_SECURITY_TRUE='#'
+  WANT_BSDTCP_SECURITY_FALSE=
+fi
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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 Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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
+    BSDUDP_SECURITY="no"
 
-  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
+# Check whether --with-bsdudp-security was given.
+if test "${with_bsdudp_security+set}" = set; then
+  withval=$with_bsdudp_security;
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) BSDUDP_SECURITY=yes ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
-  # 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'
-  ;;
+fi
 
-knetbsd*-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='GNU ld.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
-  ;;
+    if test "x$BSDUDP_SECURITY" = "xyes"; then
 
-newsos6)
-  version_type=linux
-  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
-  ;;
+cat >>confdefs.h <<\_ACEOF
+#define BSDUDP_SECURITY 1
+_ACEOF
 
-nto-qnx*)
-  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=yes
-  ;;
+    fi
+     if test x"$BSDUDP_SECURITY" = x"yes"; then
+  WANT_BSDUDP_SECURITY_TRUE=
+  WANT_BSDUDP_SECURITY_FALSE='#'
+else
+  WANT_BSDUDP_SECURITY_TRUE='#'
+  WANT_BSDUDP_SECURITY_FALSE=
+fi
 
-openbsd*)
-  version_type=sunos
-  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"
-  ;;
+    RSH_SECURITY=no
 
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
+# Check whether --with-rsh-security was given.
+if test "${with_rsh_security+set}" = set; then
+  withval=$with_rsh_security;
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) RSH_SECURITY=yes ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
-solaris*)
-  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=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
+fi
 
-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.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      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
-  ;;
+    if test "x$RSH_SECURITY" = "xyes"; then
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    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
-  ;;
+cat >>confdefs.h <<\_ACEOF
+#define RSH_SECURITY 1
+_ACEOF
 
-uts4*)
-  version_type=linux
-  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
+    fi
+     if test x"$RSH_SECURITY" = x"yes"; then
+  WANT_RSH_SECURITY_TRUE=
+  WANT_RSH_SECURITY_FALSE='#'
+else
+  WANT_RSH_SECURITY_TRUE='#'
+  WANT_RSH_SECURITY_FALSE=
+fi
+
+
+
+    SSH_SECURITY=no
+
+# Check whether --with-ssh-security was given.
+if test "${with_ssh_security+set}" = set; then
+  withval=$with_ssh_security;
+            case "$withval" in
+                n | no) : ;;
+                y |  ye | yes) SSH_SECURITY=yes ;;
+                *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
+
+fi
+
+
+    if test "x$SSH_SECURITY" = "xyes"; then
+        # find the SSH binary
+        for ac_prog in ssh
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SSH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SSH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SSH="$SSH" # Let the user override the test with a path.
   ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-*)
-  dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
+fi
+SSH=$ac_cv_path_SSH
+if test -n "$SSH"; then
+  { echo "$as_me:$LINENO: result: $SSH" >&5
+echo "${ECHO_T}$SSH" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var" || \
-   test "X$hardcode_automatic" = "Xyes" ; then
 
-  # We can hardcode non-existant 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_AC_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
+  test -n "$SSH" && break
+done
+
+
+        # see what options we should use
+
+# Check whether --with-ssh-options was given.
+if test "${with_ssh_options+set}" = set; then
+  withval=$with_ssh_options;  SSH_OPTIONS="$withval"
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6
+   SSH_OPTIONS=''
 
-if test "$hardcode_action" = relink; 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
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+
+        case "$SSH_OPTIONS" in
+            y | ye | yes | n | no)
+                { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5
+echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;}
+   { (exit 1); exit 1; }; };;
+            *) : ;;
+        esac
+
+        { echo "$as_me:$LINENO: checking SSH options" >&5
+echo $ECHO_N "checking SSH options... $ECHO_C" >&6; }
+        # if we didn't get SSH options from the user, figure them out for ourselves
+        if test -z "$SSH_OPTIONS"; then
+            case `$SSH -V 2>&1` in
+                OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
+                *) SSH_OPTIONS='-x -o BatchMode=yes' ;;
+            esac
+        fi
+
+        # now convert that to a comma-separated list of C strings
+        eval "set dummy ${SSH_OPTIONS}"; shift
+        SSH_OPTIONS=''
+       for i in "${@}"; do
+           quoted="\"`echo "$i" | sed -e 's/\"/\\\"/'`\""
+           SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }$quoted";
+       done
+        { echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5
+echo "${ECHO_T}$SSH_OPTIONS" >&6; }
+
+        # finally, make the various outputs for all of this
+
+cat >>confdefs.h <<\_ACEOF
+#define SSH_SECURITY 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SSH "$SSH"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SSH_OPTIONS $SSH_OPTIONS
+_ACEOF
+
+    fi
+     if test x"$SSH_SECURITY" = x"yes"; then
+  WANT_SSH_SECURITY_TRUE=
+  WANT_SSH_SECURITY_FALSE='#'
 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"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  WANT_SSH_SECURITY_TRUE='#'
+  WANT_SSH_SECURITY_FALSE=
 fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
+
+
+
+    # Specify --with-krb4-security if Kerberos software is in somewhere
+    # other than the listed KRB4_SPOTS.  We only compile kerberos support in
+    # if the right files are there.
+
+    : ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+    KRB4_SECURITY="no"
+
+# Check whether --with-krb4-security was given.
+if test "${with_krb4_security+set}" = set; then
+  withval=$with_krb4_security;
+            case "$withval" in
+                n | no) ;;
+                y | ye | yes) KRB4_SECURITY="yes" ;;
+                *) KRB4_SPOTS="$KRB4_SECURITY"
+                   KRB4_SECURITY="yes"
+                   ;;
+            esac
+
 fi
 
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
+
+    # check the remaining, subsidiary options
+
+    { echo "$as_me:$LINENO: checking host principal" >&5
+echo $ECHO_N "checking host principal... $ECHO_C" >&6; }
+
+# Check whether --with-server-principal was given.
+if test "${with_server_principal+set}" = set; then
+  withval=$with_server_principal;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) SERVER_HOST_PRINCIPAL="$withval" ;;
+            esac
+
 else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
+   : ${SERVER_HOST_PRINCIPAL="amanda"}
 
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
+fi
 
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
+    { echo "$as_me:$LINENO: result: $SERVER_HOST_PRINCIPAL" >&5
+echo "${ECHO_T}$SERVER_HOST_PRINCIPAL" >&6; }
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
+    { echo "$as_me:$LINENO: checking server host instance" >&5
+echo $ECHO_N "checking server host instance... $ECHO_C" >&6; }
+
+# Check whether --with-server-instance was given.
+if test "${with_server_instance+set}" = set; then
+  withval=$with_server_instance;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) SERVER_HOST_INSTANCE="$withval" ;;
+            esac
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+   : ${SERVER_HOST_INSTANCE="amanda"}
+
+fi
+
+    { echo "$as_me:$LINENO: result: $SERVER_HOST_INSTANCE" >&5
+echo "${ECHO_T}$SERVER_HOST_INSTANCE" >&6; }
+
+    { echo "$as_me:$LINENO: checking server host key file" >&5
+echo $ECHO_N "checking server host key file... $ECHO_C" >&6; }
+
+# Check whether --with-server-keyfile was given.
+if test "${with_server_keyfile+set}" = set; then
+  withval=$with_server_keyfile;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) SERVER_HOST_KEY_FILE="$withval" ;;
+            esac
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   : ${SERVER_HOST_KEY_FILE="/.amanda"}
 
-ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+    { echo "$as_me:$LINENO: result: $SERVER_HOST_KEY_FILE" >&5
+echo "${ECHO_T}$SERVER_HOST_KEY_FILE" >&6; }
+
+    { echo "$as_me:$LINENO: checking client host principle" >&5
+echo $ECHO_N "checking client host principle... $ECHO_C" >&6; }
+
+# Check whether --with-client-principal was given.
+if test "${with_client_principal+set}" = set; then
+  withval=$with_client_principal;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) CLIENT_HOST_PRINCIPAL="$withval" ;;
+            esac
+
+else
+   : ${CLIENT_HOST_PRINCIPAL="rcmd"}
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+
+    { echo "$as_me:$LINENO: result: $CLIENT_HOST_PRINCIPAL" >&5
+echo "${ECHO_T}$CLIENT_HOST_PRINCIPAL" >&6; }
+
+    { echo "$as_me:$LINENO: checking client host instance" >&5
+echo $ECHO_N "checking client host instance... $ECHO_C" >&6; }
+
+# Check whether --with-client-instance was given.
+if test "${with_client_instance+set}" = set; then
+  withval=$with_client_instance;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) CLIENT_HOST_INSTANCE="$withval" ;;
+            esac
+
 else
+   : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
+fi
+
+    { echo "$as_me:$LINENO: result: $CLIENT_HOST_INSTANCE" >&5
+echo "${ECHO_T}$CLIENT_HOST_INSTANCE" >&6; }
+
+    { echo "$as_me:$LINENO: checking client host key file" >&5
+echo $ECHO_N "checking client host key file... $ECHO_C" >&6; }
+
+# Check whether --with-client-keyfile was given.
+if test "${with_client_keyfile+set}" = set; then
+  withval=$with_client_keyfile;
+            case "$withval" in
+                "" | y | ye | yes | n | no)
+                    { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+                *) CLIENT_HOST_KEY_FILE="$withval" ;;
+            esac
+
+else
+   : ${CLIENT_HOST_KEY_FILE=KEYFILE}
 
 fi
 
-   ;;
+    # Assume it's either KEYFILE (defined in krb.h), or a string filename...
+    if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
+      # add quotes
+      CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
+    fi
+    { echo "$as_me:$LINENO: result: $CLIENT_HOST_KEY_FILE" >&5
+echo "${ECHO_T}$CLIENT_HOST_KEY_FILE" >&6; }
+
+    { echo "$as_me:$LINENO: checking ticket lifetime" >&5
+echo $ECHO_N "checking ticket lifetime... $ECHO_C" >&6; }
+
+# Check whether --with-ticket-lifetime was given.
+if test "${with_ticket_lifetime+set}" = set; then
+  withval=$with_ticket_lifetime;
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+                { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            *) TICKET_LIFETIME="$withval" ;;
+            esac
 
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+   : ${TICKET_LIFETIME=128}
+
+fi
+
+    { echo "$as_me:$LINENO: result: $TICKET_LIFETIME" >&5
+echo "${ECHO_T}$TICKET_LIFETIME" >&6; }
+
+
+    if test "x${KRB4_SECURITY}" = "xyes"; then
+        { echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5
+echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6; }
+        found="no"
+        for dir in $KRB4_SPOTS; do
+            if test \( -f ${dir}/lib/libkrb.a -o -f ${dir}/lib/libkrb.so \) -a \( -f ${dir}/lib/libdes.a -o -f ${dir}/lib/libdes.so \) ; then
+                #
+                # This is the original Kerberos 4.
+                #
+                { echo "$as_me:$LINENO: result: found in $dir" >&5
+echo "${ECHO_T}found in $dir" >&6; }
+                found="yes"
+
+                #
+                # This handles BSD/OS.
+                #
+                if test -d $dir/include/kerberosIV ; then
+                    CPPFLAGS="$CPPFLAGS -I$dir/include/kerberosIV"
+
+                else
+                    CPPFLAGS="$CPPFLAGS -I$dir/include"
+
+                fi
+                LDFLAGS="$LDFLAGS -L$dir/lib"
+
+                LIBS="-lkrb -ldes $LIBS"
+
+                if test -f ${dir}/lib/libcom_err.a; then
+                    LIBS="-lcom_err $LIBS"
+
+                fi
+                break
+            elif test \( -f ${dir}/lib/libkrb4.a -o -f ${dir}/lib/libkrb4.so \) &&
+                 test \( -f ${dir}/lib/libcrypto.a -o -f ${dir}/lib/libcrypto.so \) &&
+                 test \( -f ${dir}/lib/libdes425.a -o -f ${dir}/lib/libdes425.so \) ; then
+                #
+                # This is Kerberos 5 with Kerberos 4 back-support.
+                #
+                { echo "$as_me:$LINENO: result: found in $dir" >&5
+echo "${ECHO_T}found in $dir" >&6; }
+                found="yes"
+                CPPFLAGS="$CPPFLAGS -I$dir/include -I$dir/include/kerberosIV"
+
+                LDFLAGS="$LDFLAGS -L$dir/lib"
+
+                if test \( -f ${dir}/lib/libkrb5.a -o -f ${dir}/lib/libkrb5.so \) &&
+                   test \( -f ${dir}/lib/libcom_err.a -o -f ${dir}/lib/libcom_err.so \) ; then
+                    LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err $LIBS"
+
+                else
+                    LIBS="-lkrb4 -lcrypto -ldes425 $LIBS"
+
+                fi
+                break
+            fi
+        done
+
+        if test "x$found" = "xno" ; then
+            { echo "$as_me:$LINENO: result: no libraries found" >&5
+echo "${ECHO_T}no libraries found" >&6; }
+
+    { echo "$as_me:$LINENO: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&5
+echo "$as_me: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+No Kerberos IV libraries were found on your system; disabling krb4-security
+AAW_EOF
+
+
+            KRB4_SECURITY="no"
+        else
+
+cat >>confdefs.h <<\_ACEOF
+#define KRB4_SECURITY 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); 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
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_PRINCIPAL "$SERVER_HOST_PRINCIPAL"
+_ACEOF
 
-#undef shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* 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_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE"
+_ACEOF
 
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
+
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_PRINCIPAL "$CLIENT_HOST_PRINCIPAL"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define TICKET_LIFETIME $TICKET_LIFETIME
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_shl_load=no
+        fi
+    fi
+     if test x"$KRB4_SECURITY" = x"yes"; then
+  WANT_KRB4_SECURITY_TRUE=
+  WANT_KRB4_SECURITY_FALSE='#'
+else
+  WANT_KRB4_SECURITY_TRUE='#'
+  WANT_KRB4_SECURITY_FALSE=
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+
+
+    # Specify --with-krb5-security if Kerberos software is in somewhere
+    # other than the listed KRB5_SPOTS.  We only compile kerberos support in
+    # if the right files are there.
+
+    KRB5_SECURITY="no"
+    : ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+
+# Check whether --with-krb5-security was given.
+if test "${with_krb5_security+set}" = set; then
+  withval=$with_krb5_security;
+            case "$withval" in
+                n | no) KRB5_SECURITY=no ;;
+                y | ye | yes) KRB5_SECURITY=yes ;;
+                *) KRB5_SPOTS="$KRB5_SECURITY"
+                   KRB5_SECURITY=yes
+                   ;;
+            esac
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+
+
+    if test "x$KRB5_SECURITY" = "xyes"; then
+        # if found, force the static versions of these libs (.a) by linking directly
+        # with the .a files.  I don't know how to get -R dependancies checked
+        # in autoconf at this time. -kashmir
+        { echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5
+echo $ECHO_N "checking for Kerberos V libraries... $ECHO_C" >&6; }
+        KRB5_DIR_FOUND=""
+        for dir in $KRB5_SPOTS; do
+          for lib in lib lib64; do
+            k5libdir=${dir}/${lib}
+            if test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libgssapi_krb5.so -o -f ${k5libdir}/libgssapi_krb5.a \) -a \( -f ${k5libdir}/libcom_err.a -o -f ${k5libdir}/libcom_err.so \); then
+                if test -f ${k5libdir}/libk5crypto.a -o -f ${k5libdir}/libk5crypto.so; then
+                    K5CRYPTO=-lk5crypto
+                elif test -f ${k5libdir}/libcrypto.a -o -f ${k5libdir}/libcrypto.so; then
+                    K5CRYPTO=-lcrypto
+                else
+                    K5CRYPTO=""
+                fi
+                if test -f ${k5libdir}/libkrb5support.a -o -f ${k5libdir}/libkrb5support.so; then
+                    K5SUPPORT=-lkrb5support
+                else
+                    K5SUPPORT=""
+                fi
+                KRB5_DIR_FOUND=$dir
+                KRB5_LIBDIR_FOUND=$k5libdir
+                LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err $LIBS"
+
+                break
+            elif test \( -f ${k5libdir}/libkrb5.a -o -f ${k5libdir}/libkrb5.so \) -a \( -f ${k5libdir}/libasn1.a -o -f ${k5libdir}/libasn1.so \) -a \( -f ${k5libdir}/libgssapi.a -o -f ${k5libdir}/libgssapi.so \); then
+                LIBS="-lgssapi -lkrb5 -lasn1 $LIBS"
+
+                CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL_INCLUDES"
+
+                break
+            fi
+          done
+        done
+
+        if test "$KRB5_DIR_FOUND"; then
+            { echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
+echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6; }
+            #
+            # some OS's, such as NetBSD, stick krb5 includes out of the way...
+            # should probably just use autoconf to look for various include
+            # options and set them, but don't quite want to do that until I've
+            # dug into it a bit more.
+            #
+            if test -d "$KRB5_DIR_FOUND/krb5" ; then
+                CPPFLAGS="$CPPFLAGS -I$KRB5_DIR_FOUND/include/krb5"
+
+            else
+                CPPFLAGS="$CPPFLAGS -I$KRB5_DIR_FOUND/include"
+
+            fi
+
+{ echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
+echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6; }
+if test "${ac_cv_lib_krb5support_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
+LIBS="-lkrb5support  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -27582,10149 +29233,15032 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
+
 int
 main ()
 {
-shl_load ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_krb5support_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_shl_load=no
+       ac_cv_lib_krb5support_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6; }
+if test $ac_cv_lib_krb5support_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKRB5SUPPORT 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+  LIBS="-lkrb5support $LIBS"
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+fi
 
-#undef dlopen
+            LDFLAGS="$LDFLAGS -L$KRB5_LIBDIR_FOUND"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* 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_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define KRB5_SECURITY 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+        else
+            { echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5
+echo "${ECHO_T}no krb5 system libraries found" >&6; }
+            { { echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5
+echo "$as_me: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&2;}
+   { (exit 1); exit 1; }; }
+            KRB5_SECURITY="no"
+        fi
+    fi
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+     if test x"$KRB5_SECURITY" = x"yes"; then
+  WANT_KRB5_SECURITY_TRUE=
+  WANT_KRB5_SECURITY_FALSE='#'
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  WANT_KRB5_SECURITY_TRUE='#'
+  WANT_KRB5_SECURITY_FALSE=
+fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
+
+
+#
+# Dumpers
+#
+
+
+
+    for ac_prog in xfsdump
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_XFSDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $XFSDUMP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XFSDUMP="$XFSDUMP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_XFSDUMP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  ;;
+esac
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+XFSDUMP=$ac_cv_path_XFSDUMP
+if test -n "$XFSDUMP"; then
+  { echo "$as_me:$LINENO: result: $XFSDUMP" >&5
+echo "${ECHO_T}$XFSDUMP" >&6; }
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
+
+  test -n "$XFSDUMP" && break
+done
+
+    for ac_prog in xfsrestore
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_XFSRESTORE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $XFSRESTORE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XFSRESTORE="$XFSRESTORE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_XFSRESTORE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  ;;
+esac
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+XFSRESTORE=$ac_cv_path_XFSRESTORE
+if test -n "$XFSRESTORE"; then
+  { echo "$as_me:$LINENO: result: $XFSRESTORE" >&5
+echo "${ECHO_T}$XFSRESTORE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
-fi
+  test -n "$XFSRESTORE" && break
+done
 
+    if test "$XFSDUMP" -a "$XFSRESTORE"; then
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define XFSDUMP "$XFSDUMP"
+_ACEOF
 
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define XFSRESTORE "$XFSRESTORE"
+_ACEOF
 
 
-fi
+    { echo "$as_me:$LINENO: WARNING: xfsdump causes the setuid-root rundump program to be enabled.  To disable it, just #undef XFSDUMP in config/config.h" >&5
+echo "$as_me: WARNING: xfsdump causes the setuid-root rundump program to be enabled.  To disable it, just #undef XFSDUMP in config/config.h" >&2;}
 
 
-fi
+    cat <<AAW_EOF >>config.warnings
+xfsdump causes the setuid-root rundump program to be enabled.  To disable it, just #undef XFSDUMP in config/config.h
+AAW_EOF
 
-    ;;
-  esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
+    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"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
+    # Extract the first word of "vxdump", so it can be a program name with args.
+set dummy vxdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_VXDUMP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
+  case $VXDUMP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_VXDUMP="$VXDUMP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$SYSLOCPATH:/usr/lib/fs/vxfs"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_VXDUMP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+VXDUMP=$ac_cv_path_VXDUMP
+if test -n "$VXDUMP"; then
+  { echo "$as_me:$LINENO: result: $VXDUMP" >&5
+echo "${ECHO_T}$VXDUMP" >&6; }
 else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 27979 "configure"
-#include "confdefs.h"
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
 
-#include <stdio.h>
+    # Extract the first word of "vxrestore", so it can be a program name with args.
+set dummy vxrestore; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_VXRESTORE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $VXRESTORE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_VXRESTORE="$VXRESTORE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$SYSLOCPATH:/usr/lib/fs/vxfs"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_VXRESTORE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+  ;;
+esac
+fi
+VXRESTORE=$ac_cv_path_VXRESTORE
+if test -n "$VXRESTORE"; then
+  { echo "$as_me:$LINENO: result: $VXRESTORE" >&5
+echo "${ECHO_T}$VXRESTORE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-/* 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
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+    if test "$VXDUMP" -a "$VXRESTORE"; then
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+cat >>confdefs.h <<_ACEOF
+#define VXDUMP "$VXDUMP"
+_ACEOF
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
+cat >>confdefs.h <<_ACEOF
+#define VXRESTORE "$VXRESTORE"
+_ACEOF
 
+    fi
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
+
+
+    # Extract the first word of "vdump", so it can be a program name with args.
+set dummy vdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_VDUMP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
+  case $VDUMP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_VDUMP="$VDUMP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_VDUMP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+VDUMP=$ac_cv_path_VDUMP
+if test -n "$VDUMP"; then
+  { echo "$as_me:$LINENO: result: $VDUMP" >&5
+echo "${ECHO_T}$VDUMP" >&6; }
 else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 28077 "configure"
-#include "confdefs.h"
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
 
-#include <stdio.h>
+    # Extract the first word of "vrestore", so it can be a program name with args.
+set dummy vrestore; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_VRESTORE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $VRESTORE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_VRESTORE="$VRESTORE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_VRESTORE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+  ;;
+esac
+fi
+VRESTORE=$ac_cv_path_VRESTORE
+if test -n "$VRESTORE"; then
+  { echo "$as_me:$LINENO: result: $VRESTORE" >&5
+echo "${ECHO_T}$VRESTORE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-/* 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
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+    if test "$VDUMP" -a "$VRESTORE"; then
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+cat >>confdefs.h <<_ACEOF
+#define VDUMP "$VDUMP"
+_ACEOF
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
 
+cat >>confdefs.h <<_ACEOF
+#define VRESTORE "$VRESTORE"
+_ACEOF
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$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
+    # Extract the first word of "grep", so it can be a program name with args.
+set dummy grep; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GREP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep"
+  ;;
+esac
+fi
+GREP=$ac_cv_path_GREP
+if test -n "$GREP"; then
+  { echo "$as_me:$LINENO: result: $GREP" >&5
+echo "${ECHO_T}$GREP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
-# Report which librarie types wil actually be built
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
-test "$can_build_shared" = "no" && enable_shared=no
+cat >>confdefs.h <<_ACEOF
+#define GREP "$GREP"
+_ACEOF
 
-# 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
-  ;;
 
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler \
-    CC \
-    LD \
-    lt_prog_compiler_wl \
-    lt_prog_compiler_pic \
-    lt_prog_compiler_static \
-    lt_prog_compiler_no_builtin_flag \
-    export_dynamic_flag_spec \
-    thread_safe_flag_spec \
-    whole_archive_flag_spec \
-    enable_shared_with_static_runtimes \
-    old_archive_cmds \
-    old_archive_from_new_cmds \
-    predep_objects \
-    postdep_objects \
-    predeps \
-    postdeps \
-    compiler_lib_search_path \
-    archive_cmds \
-    archive_expsym_cmds \
-    postinstall_cmds \
-    postuninstall_cmds \
-    old_archive_from_expsyms_cmds \
-    allow_undefined_flag \
-    no_undefined_flag \
-    export_symbols_cmds \
-    hardcode_libdir_flag_spec \
-    hardcode_libdir_flag_spec_ld \
-    hardcode_libdir_separator \
-    hardcode_automatic \
-    module_cmds \
-    module_expsym_cmds \
-    lt_cv_prog_compiler_c_o \
-    exclude_expsyms \
-    include_expsyms; do
 
-    case $var in
-    old_archive_cmds | \
-    old_archive_from_new_cmds | \
-    archive_cmds | \
-    archive_expsym_cmds | \
-    module_cmds | \
-    module_expsym_cmds | \
-    old_archive_from_expsyms_cmds | \
-    export_symbols_cmds | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
+    # Set the order of dump programs to look for.  Finding the proper file
+    # system dumping program is problematic.  Some systems, notably HP-UX
+    # and AIX, have both the backup and dump programs.  HP-UX can't use the
+    # the backup program while AIX systems can't use the dump program.  So
+    # a variable is set up here to specify the order of dump programs to
+    # search for on the system.
+    DUMP_PROGRAMS="ufsdump dump backup"
+    dump_returns_1=
+    case "$target" in
+       *-dg-*)
+           DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
+           dump_returns_1=yes
+           ;;
+      *-ibm-aix*)
+           DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
 
-cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
+cat >>confdefs.h <<\_ACEOF
+#define AIX_BACKUP 1
+_ACEOF
 
-  cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
+           ;;
+      *-ultrix*)
+           dump_returns_1=yes
+           ;;
+    esac
 
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# 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 -n "$dump_returns_1"; then
 
-# A sed program that does not truncate output.
-SED=$lt_SED
+cat >>confdefs.h <<\_ACEOF
+#define DUMP_RETURNS_1 1
+_ACEOF
 
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
+    fi
 
-# 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
+    for ac_prog in $DUMP_PROGRAMS
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_DUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $DUMP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DUMP="$DUMP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_DUMP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# The names of the tagged configurations supported by this script.
-available_tags=
+  ;;
+esac
+fi
+DUMP=$ac_cv_path_DUMP
+if test -n "$DUMP"; then
+  { echo "$as_me:$LINENO: result: $DUMP" >&5
+echo "${ECHO_T}$DUMP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# ### BEGIN LIBTOOL CONFIG
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+  test -n "$DUMP" && break
+done
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+    for ac_prog in ufsrestore restore
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_RESTORE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $RESTORE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_RESTORE="$RESTORE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_RESTORE="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+  ;;
+esac
+fi
+RESTORE=$ac_cv_path_RESTORE
+if test -n "$RESTORE"; then
+  { echo "$as_me:$LINENO: result: $RESTORE" >&5
+echo "${ECHO_T}$RESTORE" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
+  test -n "$RESTORE" && break
+done
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+    # newer versions of GNU tar include a program named 'backup' which
+    # does *not* implement the expected 'dump' interface.  Detect that here
+    # and pretend we never saw it.
+    if test -n "$DUMP"; then
+      if test "`basename $DUMP`" = "backup"; then
+        backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
+        if test $? -eq 0; then
+          DUMP=
+        fi
+      fi
+    fi
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+    if test "$DUMP" -a "$RESTORE"; then
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+cat >>confdefs.h <<_ACEOF
+#define DUMP "$DUMP"
+_ACEOF
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+cat >>confdefs.h <<_ACEOF
+#define RESTORE "$RESTORE"
+_ACEOF
 
-# A C compiler.
-LTCC=$lt_LTCC
 
-# A language-specific compiler.
-CC=$lt_compiler
+       # check for an estimate flag
+       if test -x $DUMP; then
+           { echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5
+echo $ECHO_N "checking whether $DUMP supports -E or -S for estimates... $ECHO_C" >&6; }
+if test "${amanda_cv_dump_estimate+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
+                   case "$DUMP" in
+                   *dump)
+                       { ac_try='$DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-E 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+                       cat conftest.d-E >&5
+                       { ac_try='$DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-S 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+                       cat conftest.d-S >&5
+                       { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+                       cat conftest.d >&5
+                       if { ac_try='cmp conftest.d-E conftest.d 1>&2'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+                           amanda_cv_dump_estimate=E
+                       elif { ac_try='cmp conftest.d-S conftest.d 1>&2'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+                           amanda_cv_dump_estimate=S
+                       else
+                           amanda_cv_dump_estimate=no
+                       fi
+                       rm -f conftest.d conftest.d-E conftest.d-S
+                     ;;
+                   *) amanda_cv_dump_estimate=no
+                     ;;
+                   esac
+
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5
+echo "${ECHO_T}$amanda_cv_dump_estimate" >&6; }
+       else
 
-# An ERE matcher.
-EGREP=$lt_EGREP
+    { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5
+echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;}
 
-# The linker used to build libraries.
-LD=$lt_LD
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+    cat <<AAW_EOF >>config.warnings
+$DUMP is not executable, cannot run -E/-S test
+AAW_EOF
 
-# A BSD-compatible nm program.
-NM=$lt_NM
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+           amanda_cv_dump_estimate=no
+       fi
+       if test "x$amanda_cv_dump_estimate" != xno; then
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DUMP_ESTIMATE "$amanda_cv_dump_estimate"
+_ACEOF
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+       fi
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
 
-# Used on cygwin: assembler.
-AS="$AS"
+# Check whether --with-dump-honor-nodump was given.
+if test "${with_dump_honor_nodump+set}" = set; then
+  withval=$with_dump_honor_nodump;
+           if test -x $DUMP; then
+               { echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5
+echo $ECHO_N "checking whether $DUMP supports -h (honor nodump flag)... $ECHO_C" >&6; }
+if test "${amanda_cv_honor_nodump+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+                   case "$DUMP" in
+                   *dump)
+                       { ac_try='$DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d-h 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+                       cat conftest.d-h >&5
+                       { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
+                           | $GREP -v Dumping
+                           | $GREP -v Date
+                           | $GREP -v Label >conftest.d 2>&1'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+                       cat conftest.d >&5
+                       if { ac_try='diff conftest.d-h conftest.d 1>&2'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+                           amanda_cv_honor_nodump=yes
+                       else
+                           amanda_cv_honor_nodump=no
+                       fi
+                       rm -f conftest.d conftest.d-h
+                     ;;
+                   *) amanda_cv_honor_nodump=no
+                     ;;
+                   esac
+
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5
+echo "${ECHO_T}$amanda_cv_honor_nodump" >&6; }
+           else
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+    { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5
+echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;}
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+    cat <<AAW_EOF >>config.warnings
+$DUMP is not executable, cannot run -h test
+AAW_EOF
 
-# Old archive suffix (normally "a").
-libext="$libext"
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+               amanda_cv_honor_nodump=no
+           fi
+           if test "x$amanda_cv_honor_nodump" = xyes; then
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_HONOR_NODUMP 1
+_ACEOF
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
+           fi
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+fi
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+    fi
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
 
-# 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
 
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
+    # call with
 
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+# Check whether --with-gnutar was given.
+if test "${with_gnutar+set}" = set; then
+  withval=$with_gnutar;
+           # check withval
+           case "$withval" in
+               /*) GNUTAR="$withval";;
+               y|ye|yes) :;;
+               n|no) GNUTAR=no ;;
+               *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
+           # done
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
+fi
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+    if test "x$GNUTAR" != "xno"; then
+       # call ac_path_progs
+       for ac_prog in gtar gnutar tar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GNUTAR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GNUTAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GNUTAR="$GNUTAR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
+  ;;
+esac
+fi
+GNUTAR=$ac_cv_path_GNUTAR
+if test -n "$GNUTAR"; then
+  { echo "$as_me:$LINENO: result: $GNUTAR" >&5
+echo "${ECHO_T}$GNUTAR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
 
-# Library versioning type.
-version_type=$version_type
+  test -n "$GNUTAR" && break
+done
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+    else
+       GNUTAR=
+    fi
 
-# 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
+    if test ! -z "$GNUTAR"; then
+      case "`\"$GNUTAR\" --version 2>&1`" in
+       *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
+                   ;;
+       *)
+                   # warning..
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+    { echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5
+echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;}
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+    cat <<AAW_EOF >>config.warnings
+$GNUTAR is not GNU tar, so it will not be used.
+AAW_EOF
 
-# 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 and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+                   GNUTAR=''
+                   ;;
+      esac
+    fi
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
+    if test "x$GNUTAR" != "x"; then
+       # define unquoted
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+cat >>confdefs.h <<_ACEOF
+#define GNUTAR "$GNUTAR"
+_ACEOF
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
+    fi
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
 
-# 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
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
+# Check whether --with-smbclient was given.
+if test "${with_smbclient+set}" = set; then
+  withval=$with_smbclient;
+           case "$withval" in
+               /*) SAMBA_CLIENT="$withval";;
+               y|ye|yes) :;;
+               n|no) SAMBA_CLIENT=no ;;
+               *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
+fi
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
 
-# 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
+# Check whether --with-samba-user was given.
+if test "${with_samba_user+set}" = set; then
+  withval=$with_samba_user;  { { echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5
+echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;}
+   { (exit 1); exit 1; }; }
 
-# 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
+fi
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+    if test "x$SAMBA_CLIENT" != "xno"; then
+      # Extract the first word of "smbclient", so it can be a program name with args.
+set dummy smbclient; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SAMBA_CLIENT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SAMBA_CLIENT="$SAMBA_CLIENT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SAMBA_CLIENT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+  ;;
+esac
+fi
+SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT
+if test -n "$SAMBA_CLIENT"; then
+  { echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5
+echo "${ECHO_T}$SAMBA_CLIENT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+      smbversion=0
+      if test ! -z "$SAMBA_CLIENT"; then
+        case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
+        *"Unknown host"*)
+                     smbversion=1
+                     ;;
+        *"Connection to not.a.host.name failed"*)
+                     smbversion=2
+                     ;;
+        *)
 
-# 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
+    { echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5
+echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;}
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
+    cat <<AAW_EOF >>config.warnings
+$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.
+AAW_EOF
 
-# 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 the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
+                     SAMBA_CLIENT=
+                     ;;
+        esac
+        if test -n "$SAMBA_CLIENT"; then
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
+cat >>confdefs.h <<_ACEOF
+#define SAMBA_CLIENT "$SAMBA_CLIENT"
+_ACEOF
 
-# 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
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+cat >>confdefs.h <<_ACEOF
+#define SAMBA_VERSION $smbversion
+_ACEOF
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
+        fi
+      fi
+    fi
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+     if test -n "$SAMBA_CLIENT"; then
+  WANT_SAMBA_TRUE=
+  WANT_SAMBA_FALSE='#'
+else
+  WANT_SAMBA_TRUE='#'
+  WANT_SAMBA_FALSE=
+fi
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
+    USE_RUNDUMP=no
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
+    # some systems require rundump unconditionally
+    case "$target" in
+        *-ultrix*) USE_RUNDUMP=yes ;;
+        *-dg-*) USE_RUNDUMP=yes ;;
+    esac
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
+# Check whether --with-rundump was given.
+if test "${with_rundump+set}" = set; then
+  withval=$with_rundump;
+        case "$withval" in
+            n | no) USE_RUNDUMP=no ;;
+            y | ye | yes) USE_RUNDUMP=yes ;;
+            *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5
+echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;}
+   { (exit 1); exit 1; }; };;
+        esac
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
+fi
 
-# ### END LIBTOOL CONFIG
 
-__EOF__
+    if test x"$USE_RUNDUMP" = x"yes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define USE_RUNDUMP 1
+_ACEOF
 
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
+    fi
 
-# 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
-EOF
-    ;;
-  esac
 
-  # 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)
+#
+# Look for other programs Amanda will use
+#
 
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
 
+    # Extract the first word of "grep", so it can be a program name with args.
+set dummy grep; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
+  case $GREP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-fi
-
+done
+done
+IFS=$as_save_IFS
 
-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
+  test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep"
+  ;;
+esac
+fi
+GREP=$ac_cv_path_GREP
+if test -n "$GREP"; then
+  { echo "$as_me:$LINENO: result: $GREP" >&5
+echo "${ECHO_T}$GREP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-CC="$lt_save_CC"
 
 
-# Check whether --with-tags or --without-tags was given.
-if test "${with_tags+set}" = set; then
-  withval="$with_tags"
-  tagnames="$withval"
-fi;
+cat >>confdefs.h <<_ACEOF
+#define GREP "$GREP"
+_ACEOF
 
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
 
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
-    else
-      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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"
+    { test -f "$ac_path_EGREP" && $as_test_x "$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
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    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
+    ac_count=`expr $ac_count + 1`
+    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
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+    # 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
 
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
-    "") ;;
-    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-       ;;
-    esac
 
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+    $ac_path_EGREP_found && break 3
+  done
+done
 
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
+done
+IFS=$as_save_IFS
 
-      case $tagname in
-      CXX)
-       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-           (test "X$CXX" != "Xg++"))) ; then
-         ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
+fi
 
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+else
+  ac_cv_path_EGREP=$EGREP
+fi
 
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
 
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
-# Source file extension for C++ test sources.
-ac_ext=cpp
 
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+    # Extract the first word of "lint", so it can be a program name with args.
+set dummy lint; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_AMLINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AMLINT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+  ;;
+esac
+fi
+AMLINT=$ac_cv_path_AMLINT
+if test -n "$AMLINT"; then
+  { echo "$as_me:$LINENO: result: $AMLINT" >&5
+echo "${ECHO_T}$AMLINT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    if test ! -z "$AMLINT"; then
+      $AMLINT -flags 2>&1 | $GREP -- '-errfmt=' > /dev/null
+      if test $? -eq 0; then
+       AMLINTFLAGS="-n -s -u -m -x"
+       AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
+       AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
+       AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
+       AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
+       AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
+       AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
+       AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
+       AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
+       AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
+       AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
+       AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
+       AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
+       AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
+       AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
+       AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
+       AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
+       AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
+       AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
+       AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
+       AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
+       AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
+      else
+       AMLINTFLAGS=""
+      fi
+    else
+      # Extract the first word of "splint", so it can be a program name with args.
+set dummy splint; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_AMLINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AMLINT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+AMLINT=$ac_cv_path_AMLINT
+if test -n "$AMLINT"; then
+  { echo "$as_me:$LINENO: result: $AMLINT" >&5
+echo "${ECHO_T}$AMLINT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+      if test ! -z "$AMLINT"; then
+       AMLINT="splint"
+      else
+       AMLINT='echo "Error: LINT is not installed" ; false'
+      fi
+      AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
+    fi
 
 
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-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
+for ac_prog in flex lex
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LEX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
+done
+IFS=$as_save_IFS
 
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { echo "$as_me:$LINENO: result: $LEX" >&5
+echo "${ECHO_T}$LEX" >&6; }
 else
-  lt_prog_compiler_no_builtin_flag_CXX=
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
 
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ (ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ echo "$as_me:$LINENO: checking lex output file root" >&5
+echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  with_gnu_ld=no
-fi;
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+
+if test -f lex.yy.c; then
+  ac_cv_prog_lex_root=lex.yy
+elif test -f lexyy.c; then
+  ac_cv_prog_lex_root=lexyy
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { echo "$as_me:$LINENO: checking lex library" >&5
+echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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"
+
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_lex=$ac_lib
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
 fi
 
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+
+{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # POSIX says lex can declare yytext either as a pointer or an array; the
+# default is implementation-dependent.  Figure out which it is, since
+# not all implementations provide the %pointer and %array declarations.
+ac_cv_prog_lex_yytext_pointer=no
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_prog_lex_yytext_pointer=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
+if test $ac_cv_prog_lex_yytext_pointer = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define YYTEXT_POINTER 1
+_ACEOF
+
+fi
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+if test "$LEX" = :; then
+  LEX=${am_missing_run}flex
+fi
+
+
+    # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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
+  case $AR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AR="$AR" # Let the user override the test with a path.
   ;;
-*)
-  lt_cv_prog_gnu_ld=no
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
   ;;
 esac
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
-with_gnu_ld=$lt_cv_prog_gnu_ld
+AR=$ac_cv_path_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
 
 
-  # 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
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_CXX='${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}'
+    # Extract the first word of "gettext", so it can be a program name with args.
+set dummy gettext; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_GETTEXT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GETTEXT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GETTEXT="$GETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    # 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
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec_CXX=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
+  ;;
+esac
+fi
+GETTEXT=$ac_cv_path_GETTEXT
+if test -n "$GETTEXT"; then
+  { echo "$as_me:$LINENO: result: $GETTEXT" >&5
+echo "${ECHO_T}$GETTEXT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    # 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.
-    archive_cmds_CXX='$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 "\-L"'
 
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$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
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-# PORTME: fill in a description of your system's C++ link characteristics
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-ld_shlibs_CXX=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  aix4* | aix5*)
-    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].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         case $ld_flag in
-         *-brtl*)
-           aix_use_runtimelinking=yes
-           break
-           ;;
-         esac
-       done
-      esac
+  test -n "$AWK" && break
+done
 
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
+for ac_prog in 'bison -y' byacc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    # 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.
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    archive_cmds_CXX=''
-    hardcode_direct_CXX=yes
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
 
-    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
-         hardcode_direct_CXX=yes
-       else
-         # We have old collect2
-         hardcode_direct_CXX=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_CXX=yes
-         hardcode_libdir_flag_spec_CXX='-L$libdir'
-         hardcode_libdir_separator_CXX=
-       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
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
 
-    # 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_CXX=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_CXX='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
 
-int
-main ()
-{
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  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.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+
+
+    # Extract the first word of "dd", so it can be a program name with args.
+set dummy dd; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_DD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $DD in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DD="$DD" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+DD=$ac_cv_path_DD
+if test -n "$DD"; then
+  { echo "$as_me:$LINENO: result: $DD" >&5
+echo "${ECHO_T}$DD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-       hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-       allow_undefined_flag_CXX="-z nodefs"
-       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+    # Extract the first word of "bash", so it can be a program name with args.
+set dummy bash; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_BASH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $BASH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BASH="$BASH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+BASH=$ac_cv_path_BASH
+if test -n "$BASH"; then
+  { echo "$as_me:$LINENO: result: $BASH" >&5
+echo "${ECHO_T}$BASH" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-       hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok'
-       allow_undefined_flag_CXX=' ${wl}-berok'
-       # -bexpall does not export symbols beginning with underscore (_)
-       always_export_symbols_CXX=yes
-       # Exported symbols can be pulled into shared objects from archives
-       whole_archive_flag_spec_CXX=' '
-       archive_cmds_need_lc_CXX=yes
-       # This is similar to how AIX traditionally builds its shared libraries.
-       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-  chorus*)
-    case $cc_basename in
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-    esac
-    ;;
 
 
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-    # as there is no search path for DLLs.
-    hardcode_libdir_flag_spec_CXX='-L$libdir'
-    allow_undefined_flag_CXX=unsupported
-    always_export_symbols_CXX=no
-    enable_shared_with_static_runtimes_CXX=yes
 
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
-    else
-      ld_shlibs_CXX=no
-    fi
+
+
+
+    # Extract the first word of "sort", so it can be a program name with args.
+set dummy sort; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SORT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SORT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SORT="$SORT" # Let the user override the test with a path.
   ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      archive_cmds_need_lc_CXX=no
-      hardcode_direct_CXX=no
-      hardcode_automatic_CXX=yes
-      hardcode_shlibpath_var_CXX=unsupported
-      whole_archive_flag_spec_CXX=''
-      link_all_deplibs_CXX=yes
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          archive_cmds_CXX='$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'
-        fi
-        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_CXX=no
-          ;;
-      esac
-      fi
-        ;;
+  test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="NONE"
+  ;;
+esac
+fi
+SORT=$ac_cv_path_SORT
+if test -n "$SORT"; then
+  { echo "$as_me:$LINENO: result: $SORT" >&5
+echo "${ECHO_T}$SORT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-  dgux*)
-    case $cc_basename in
-      ec++*)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      ghcx*)
-       # Green Hills C++ Compiler
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-    esac
-    ;;
-  freebsd[12]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    ld_shlibs_CXX=no
-    ;;
-  freebsd-elf*)
-    archive_cmds_need_lc_CXX=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    ld_shlibs_CXX=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    hardcode_direct_CXX=yes
-    hardcode_minus_L_CXX=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
-      ld_shlibs_CXX=no
-      ;;
-    aCC*)
-      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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
-        ld_shlibs_CXX=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      case $host_cpu in
-      hppa*64*)
-       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-       hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
-       hardcode_libdir_separator_CXX=:
-        ;;
-      ia64*)
-       hardcode_libdir_flag_spec_CXX='-L$libdir'
-        ;;
-      *)
-       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-       hardcode_libdir_separator_CXX=:
-       export_dynamic_flag_spec_CXX='${wl}-E'
-        ;;
-      esac
+
+    # sort is only needed in the server build
+    if test x"$SORT" = x"NONE" && $WANT_SERVER; then
+        { { echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5
+echo "$as_me: error: Set SORT to the path of the sort program." >&2;}
+   { (exit 1); exit 1; }; }
     fi
-    case $host_cpu in
-    hppa*64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      ;;
-    ia64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-                                             # but as the default
-                                             # location of the library.
-      ;;
-    *)
-      hardcode_direct_CXX=yes
-      hardcode_minus_L_CXX=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
-       ld_shlibs_CXX=no
-       ;;
-      aCC*)
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-         ;;
-       *)
-         archive_cmds_CXX='$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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test $with_gnu_ld = no; then
-           case $host_cpu in
-           ia64*|hppa*64*)
-             archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-             ;;
-           *)
-             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${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
-         ld_shlibs_CXX=no
-       fi
-       ;;
-    esac
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-       # SGI C++
-       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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.
-       old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test "$with_gnu_ld" = no; then
-           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-         else
-           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-         fi
-       fi
-       link_all_deplibs_CXX=yes
-       ;;
-    esac
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    ;;
-  linux*)
-    case $cc_basename in
-      KCC*)
-       # Kuck and Associates, Inc. (KAI) C++ Compiler
+cat >>confdefs.h <<_ACEOF
+#define SORT_PATH "$SORT"
+_ACEOF
 
-       # 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.
-       archive_cmds_CXX='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'
-       archive_expsym_cmds_CXX='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; echo $list'
 
-       hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
-       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-       ;;
-      icpc*)
-       # 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."*)
-         archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         archive_expsym_cmds_CXX='$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
-         archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         ;;
-       esac
-       archive_cmds_need_lc_CXX=no
-       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-       whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-       ;;
-      pgCC*)
-        # Portland Group C++ compiler
-       archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-       archive_expsym_cmds_CXX='$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'
 
-       hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-       whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-       # Compaq C++
-       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+    for ac_prog in Mail mailx mail
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MAILER+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAILER in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MAILER="$MAILER" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MAILER="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-       runpath_var=LD_RUN_PATH
-       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-       hardcode_libdir_separator_CXX=:
+  ;;
+esac
+fi
+MAILER=$ac_cv_path_MAILER
+if test -n "$MAILER"; then
+  { echo "$as_me:$LINENO: result: $MAILER" >&5
+echo "${ECHO_T}$MAILER" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-       # 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=`echo $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; echo $list'
-       ;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      hardcode_libdir_flag_spec_CXX='-R$libdir'
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=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::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    ld_shlibs_CXX=no
-    ;;
-  openbsd*)
-    hardcode_direct_CXX=yes
-    hardcode_shlibpath_var_CXX=no
-    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      export_dynamic_flag_spec_CXX='${wl}-E'
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    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.
-       archive_cmds_CXX='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'
+  test -n "$MAILER" && break
+done
+test -n "$MAILER" || MAILER="NONE"
 
-       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-       hardcode_libdir_separator_CXX=:
+    if test x"$MAILER" = x"NONE"; then
 
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+    { echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5
+echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;}
 
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      cxx*)
-       allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
-       hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-       hardcode_libdir_separator_CXX=:
+    cat <<AAW_EOF >>config.warnings
+WARNING: Amanda cannot send mail reports without a mailer.
+AAW_EOF
 
-       # 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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
-         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-         hardcode_libdir_separator_CXX=:
+    else
 
-         # 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 "\-L"'
+cat >>confdefs.h <<_ACEOF
+#define MAILER "$MAILER"
+_ACEOF
 
-       else
-         # FIXME: insert proper C++ library support
-         ld_shlibs_CXX=no
-       fi
-       ;;
-    esac
-    ;;
-  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.
-       archive_cmds_CXX='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'
+    fi
 
-       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-       hardcode_libdir_separator_CXX=:
 
-       # Archives containing C++ object files must be created using
-       # the KAI C++ compiler.
-       old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      cxx*)
-       allow_undefined_flag_CXX=' -expect_unresolved \*'
-       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds_CXX='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'
 
-       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-       hardcode_libdir_separator_CXX=:
+    # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_MT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MT="$MT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-       # 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=`echo $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; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+  test -z "$ac_cv_path_MT" && ac_cv_path_MT="mt"
+  ;;
+esac
+fi
+MT=$ac_cv_path_MT
+if test -n "$MT"; then
+  { echo "$as_me:$LINENO: result: $MT" >&5
+echo "${ECHO_T}$MT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-         hardcode_libdir_separator_CXX=:
 
-         # 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 "\-L"'
 
-       else
-         # FIXME: insert proper C++ library support
-         ld_shlibs_CXX=no
-       fi
-       ;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  sco*)
-    archive_cmds_need_lc_CXX=no
-    case $cc_basename in
-      CC*)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-    esac
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.x
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      lcc*)
-       # Lucid
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
+    case "$target" in
+       *-hp-*) MT_FILE_FLAG="-t" ;;
+       *) MT_FILE_FLAG="-f" ;;
     esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.2, 5.x and Centerline C++
-        archive_cmds_need_lc_CXX=yes
-       no_undefined_flag_CXX=' -zdefs'
-       archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-       archive_expsym_cmds_CXX='$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'
 
-       hardcode_libdir_flag_spec_CXX='-R$libdir'
-       hardcode_shlibpath_var_CXX=no
-       case $host_os in
-         solaris2.[0-5] | solaris2.[0-5].*) ;;
-         *)
-           # The C++ compiler is used as linker so we must use $wl
-           # flag to pass the commands to the underlying system
-           # linker. We must also pass each convience library through
-           # to the system linker between allextract/defaultextract.
-           # The C++ compiler will combine linker options so we
-           # cannot just pass the convience library names through
-           # without $wl.
-           # Supported since Solaris 2.6 (maybe 2.5.1?)
-           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-           ;;
-       esac
-       link_all_deplibs_CXX=yes
 
-       output_verbose_link_cmd='echo'
 
-       # 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.
-       old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-       ;;
-      gcx*)
-       # Green Hills C++ Compiler
-       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+cat >>confdefs.h <<_ACEOF
+#define MT_FILE_FLAG "$MT_FILE_FLAG"
+_ACEOF
 
-       # The C++ compiler must be used to create the archive.
-       old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-       ;;
-      *)
-       # GNU C++ compiler with Solaris linker
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-         if $CC --version | grep -v '^2\.7' > /dev/null; then
-           archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $CC -shared -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 \"\-L\""
-         else
-           # g++ 2.7 appears to require `-G' NOT `-shared' on this
-           # platform.
-           archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           archive_expsym_cmds_CXX='$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 \"\-L\""
-         fi
 
-         hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-       fi
-       ;;
-    esac
-    ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
-    archive_cmds_need_lc_CXX=no
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-       # NonStop-UX NCC 3.20
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       ld_shlibs_CXX=no
-       ;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
+
+    for ac_prog in lpr lp
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PRINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PRINT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PRINT="$PRINT" # Let the user override the test with a path.
+  ;;
   *)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PRINT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
 esac
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
-test "$ld_shlibs_CXX" = no && can_build_shared=no
+fi
+PRINT=$ac_cv_path_PRINT
+if test -n "$PRINT"; then
+  { echo "$as_me:$LINENO: result: $PRINT" >&5
+echo "${ECHO_T}$PRINT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-GCC_CXX="$GXX"
-LD_CXX="$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...
+  test -n "$PRINT" && break
+done
 
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
+    if test ! -z "$PRINT"; then
 
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
+cat >>confdefs.h <<_ACEOF
+#define LPRCMD "$PRINT"
+_ACEOF
 
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
 
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+       { echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5
+echo $ECHO_N "checking which flag to use to select a printer... $ECHO_C" >&6; }
+if test "${amanda_cv_printer_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
+           amanda_cv_printer_flag=$PRINTER_FLAG
+           case "$PRINT" in
+               lpr|*/lpr) amanda_cv_printer_flag="-P";;
+               lp|*/lp) amanda_cv_printer_flag="-d";;
+           esac
 
-    -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
-       else
-        prev=
-       fi
+fi
+{ echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5
+echo "${ECHO_T}$amanda_cv_printer_flag" >&6; }
+       if test ! -z "$amanda_cv_printer_flag"; then
 
-       if test "$pre_test_object_deps_done" = no; then
-        case $p 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 "$compiler_lib_search_path_CXX"; then
-            compiler_lib_search_path_CXX="${prev}${p}"
-          else
-            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
-          postdeps_CXX="${prev}${p}"
-        else
-          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-        fi
-       fi
-       ;;
+cat >>confdefs.h <<_ACEOF
+#define LPRFLAG "$amanda_cv_printer_flag"
+_ACEOF
 
-    *.$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
+       else
 
-       if test "$pre_test_object_deps_done" = no; then
-        if test -z "$predep_objects_CXX"; then
-          predep_objects_CXX="$p"
-        else
-          predep_objects_CXX="$predep_objects_CXX $p"
-        fi
-       else
-        if test -z "$postdep_objects_CXX"; then
-          postdep_objects_CXX="$p"
-        else
-          postdep_objects_CXX="$postdep_objects_CXX $p"
-        fi
-       fi
-       ;;
+    { echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5
+echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;}
 
-    *) ;; # Ignore the rest.
 
-    esac
-  done
+    cat <<AAW_EOF >>config.warnings
+WARNING: amanda will always print to the default printer
+AAW_EOF
 
-  # Clean up.
-  rm -f a.out a.exe
+
+       fi
+    fi
+
+
+
+    # Extract the first word of "pcat", so it can be a program name with args.
+set dummy pcat; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PCAT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "libtool.m4: error: problem compiling CXX test program"
+  case $PCAT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PCAT=$ac_cv_path_PCAT
+if test -n "$PCAT"; then
+  { echo "$as_me:$LINENO: result: $PCAT" >&5
+echo "${ECHO_T}$PCAT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-$rm -f confest.$objext
 
-# PORTME: override above test on systems where it is broken
-case $host_os in
-solaris*)
-  case $cc_basename in
-  CC*)
-    # 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.
-    postdeps_CXX='-lCstd -lCrun'
-    ;;
-  esac
-esac
 
 
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+
+    for ac_prog in perl5 perl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PERL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
 esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+  test -n "$PERL" && break
+done
 
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-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_CXX='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # 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_CXX='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | os2* | pw32*)
-      # 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_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # 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*)
-       ;;
-      *)
-       lt_prog_compiler_pic_CXX='-fPIC'
-       ;;
-      esac
-      ;;
-    *)
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-    esac
+    # Make sure we have perl
+if test -z "$PERL"; then
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PERL="perl"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+
+# Check if version of Perl is sufficient
+ac_perl_version="5.6.0"
+
+if test "x$PERL" != "x"; then
+  { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
+echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; }
+  # NB: It would be nice to log the error if there is one, but we cannot rely
+  # on autoconf internals
+  $PERL -e "use $ac_perl_version;" > /dev/null 2>&1
+  if test $? -ne 0; then
+    { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; };
+
+       { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
+echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
+   { (exit 1); exit 1; }; }
+
   else
-    case $host_os in
-      aix4* | aix5*)
-       # All AIX code is PIC.
-       if test "$host_cpu" = ia64; then
-         # AIX 5 now supports IA64 processor
-         lt_prog_compiler_static_CXX='-Bstatic'
-       else
-         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-       fi
-       ;;
-      chorus*)
-       case $cc_basename in
-       cxch68*)
-         # Green Hills C++ Compiler
-         # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
-       ;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           lt_prog_compiler_pic_CXX='-qnocommon'
-           lt_prog_compiler_wl_CXX='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-       case $cc_basename in
-         ec++*)
-           lt_prog_compiler_pic_CXX='-KPIC'
-           ;;
-         ghcx*)
-           # Green Hills C++ Compiler
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      freebsd* | kfreebsd*-gnu | dragonfly*)
-       # FreeBSD uses GNU C++
-       ;;
-      hpux9* | hpux10* | hpux11*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           if test "$host_cpu" != ia64; then
-             lt_prog_compiler_pic_CXX='+Z'
-           fi
-           ;;
-         aCC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-           case $host_cpu in
-           hppa*64*|ia64*)
-             # +Z the default
-             ;;
-           *)
-             lt_prog_compiler_pic_CXX='+Z'
-             ;;
-           esac
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      irix5* | irix6* | nonstopux*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_static_CXX='-non_shared'
-           # CC pic flag -KPIC is the default.
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      linux*)
-       case $cc_basename in
-         KCC*)
-           # KAI C++ Compiler
-           lt_prog_compiler_wl_CXX='--backend -Wl,'
-           lt_prog_compiler_pic_CXX='-fPIC'
-           ;;
-         icpc* | ecpc*)
-           # Intel C++
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-KPIC'
-           lt_prog_compiler_static_CXX='-static'
-           ;;
-         pgCC*)
-           # Portland Group C++ compiler.
-           lt_prog_compiler_wl_CXX='-Wl,'
-           lt_prog_compiler_pic_CXX='-fpic'
-           lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
-           lt_prog_compiler_static_CXX='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      lynxos*)
-       ;;
-      m88k*)
-       ;;
-      mvs*)
-       case $cc_basename in
-         cxx*)
-           lt_prog_compiler_pic_CXX='-W c,exportall'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      netbsd*)
-       ;;
-      osf3* | osf4* | osf5*)
-       case $cc_basename in
-         KCC*)
-           lt_prog_compiler_wl_CXX='--backend -Wl,'
-           ;;
-         RCC*)
-           # Rational C++ 2.4.1
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         cxx*)
-           # Digital/Compaq C++
-           lt_prog_compiler_wl_CXX='-Wl,'
-           # Make sure the PIC flag is empty.  It appears that all Alpha
-           # Linux and Compaq Tru64 Unix objects are PIC.
-           lt_prog_compiler_pic_CXX=
-           lt_prog_compiler_static_CXX='-non_shared'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      psos*)
-       ;;
-      sco*)
-       case $cc_basename in
-         CC*)
-           lt_prog_compiler_pic_CXX='-fPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      solaris*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.2, 5.x and Centerline C++
-           lt_prog_compiler_pic_CXX='-KPIC'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           lt_prog_compiler_wl_CXX='-Qoption ld '
-           ;;
-         gcx*)
-           # Green Hills C++ Compiler
-           lt_prog_compiler_pic_CXX='-PIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      sunos4*)
-       case $cc_basename in
-         CC*)
-           # Sun C++ 4.x
-           lt_prog_compiler_pic_CXX='-pic'
-           lt_prog_compiler_static_CXX='-Bstatic'
-           ;;
-         lcc*)
-           # Lucid
-           lt_prog_compiler_pic_CXX='-pic'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      tandem*)
-       case $cc_basename in
-         NCC*)
-           # NonStop-UX NCC 3.20
-           lt_prog_compiler_pic_CXX='-KPIC'
-           ;;
-         *)
-           ;;
-       esac
-       ;;
-      unixware*)
-       ;;
-      vxworks*)
-       ;;
-      *)
-       lt_prog_compiler_can_build_shared_CXX=no
-       ;;
-    esac
+    { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; };
+
   fi
+else
+  { echo "$as_me:$LINENO: WARNING: could not find perl" >&5
+echo "$as_me: WARNING: could not find perl" >&2;}
+fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+
+    for ac_prog in swig
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  lt_prog_compiler_pic_works_CXX=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:30336: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:30340: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $rm conftest*
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { echo "$as_me:$LINENO: result: $SWIG" >&5
+echo "${ECHO_T}$SWIG" >&6; }
 else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$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:30398: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:30402: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=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 ..
-   rmdir conftest
-   $rm conftest*
+  test -n "$SWIG" && break
+done
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
+        # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  need_locks=no
-fi
-
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # 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
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
   ;;
   *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
   ;;
-  esac
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { echo "$as_me:$LINENO: result: $SWIG" >&5
+echo "${ECHO_T}$SWIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+        if test -z "$SWIG" ; then
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "1.3.28" ; then
+                { echo "$as_me:$LINENO: checking for SWIG version" >&5
+echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; }
+                swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+                { echo "$as_me:$LINENO: result: $swig_version" >&5
+echo "${ECHO_T}$swig_version" >&6; }
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        required=1.3.28
+                        required_major=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_major" ; then
+                                required_major=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_minor=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_minor" ; then
+                                required_minor=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_patch=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_patch" ; then
+                                required_patch=0
+                        fi
+                        # Calculate the available version number components
+                        available=$swig_version
+                        available_major=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_major" ; then
+                                available_major=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_minor=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_minor" ; then
+                                available_minor=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_patch=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_patch" ; then
+                                available_patch=0
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                SWIG='echo "Error: SWIG version >= 1.3.28 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                        fi
+                else
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+
+
 
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
-test "$ld_shlibs_CXX" = 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
 
 #
-# Do we need to explicitly link libc?
+# Compiler / system characteristics
 #
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX 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.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+#
+# compiler
+#
+if test $ac_cv_c_compiler_gnu = yes; then
+    { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; }
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_pattern="Autoconf.*'x'"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+else
+  ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-         archive_cmds_need_lc_CXX=no
-        else
-         archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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"`
+  if test $ac_cv_prog_gcc_traditional = no; then
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
+  if test $ac_cv_prog_gcc_traditional = yes; then
+    CC="$CC -traditional"
   fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
-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
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset cs;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
 
-aix4* | aix5*)
-  version_type=linux
-  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
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_const=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+       && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       # It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
   else
-    # 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
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
   fi
-  ;;
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-amigaos*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
+fi
 
-bsdi[45]*)
-  version_type=linux
-  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
-  ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long int l;
+    char c[sizeof (long int)];
+  } u;
+  u.l = 1;
+  return u.c[sizeof (long int) - 1] == 1;
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+  yes)
 
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
   *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
 
-dgux*)
-  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
-  ;;
+# GCC_COMPILER is needed in the gnulib Makefile to silence errors
+ if test "x$GCC" = "xyes"; then
+  GCC_COMPILER_TRUE=
+  GCC_COMPILER_FALSE='#'
+else
+  GCC_COMPILER_TRUE='#'
+  GCC_COMPILER_FALSE=
+fi
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
 
-kfreebsd*-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='GNU ld.so'
-  ;;
+#
+# Warnings
+#
 
-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[123]*) 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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
 
-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
-  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"
+
+    { echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5
+echo $ECHO_N "checking for gcc flag -Wparentheses... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
     else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
     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'
-  ;;
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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
-  ;;
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wparentheses"
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
 
-# This must be Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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
+    else
+       :
+    fi
 
-  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;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'
-  ;;
 
-knetbsd*-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='GNU ld.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
-  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=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=yes
-  ;;
+    { echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5
+echo $ECHO_N "checking for gcc flag -Wdeclaration-after-statement... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-openbsd*)
-  version_type=sunos
-  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
-  ;;
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wdeclaration-after-statement"
 
-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"
-  ;;
+    else
+       :
+    fi
 
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
 
-solaris*)
-  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=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.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      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
-    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
-  ;;
 
-uts4*)
-  version_type=linux
-  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
-  ;;
+    { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5
+echo $ECHO_N "checking for gcc flag -Wmissing-prototypes... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-prototypes"
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var_CXX" || \
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6
+    else
+       :
+    fi
 
-if test "$hardcode_action_CXX" = relink; 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
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}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"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-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*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
+    { echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5
+echo $ECHO_N "checking for gcc flag -Wstrict-prototypes... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wstrict-prototypes"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
+    else
+       :
+    fi
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
 
-fi
 
-   ;;
 
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); 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
+    { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5
+echo $ECHO_N "checking for gcc flag -Wmissing-declarations... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-#undef shl_load
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-declarations"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* 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_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    else
+       :
+    fi
 
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); 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 dlopen
+    { echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5
+echo $ECHO_N "checking for gcc flag -Wformat... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* 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_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat"
 
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    else
+       :
+    fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
+    { echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5
+echo $ECHO_N "checking for gcc flag -Wsign-compare... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wsign-compare"
 
-fi
 
+    else
+       :
+    fi
 
-fi
 
 
-fi
 
 
-fi
 
+    { echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5
+echo $ECHO_N "checking for gcc flag -Wfloat-equal... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-fi
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wfloat-equal"
 
-    ;;
-  esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
+    else
+       :
+    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"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
-#line 31775 "configure"
-#include "confdefs.h"
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
 
-#include <stdio.h>
+    { echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5
+echo $ECHO_N "checking for gcc flag -Wold-style-definition... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wold-style-definition"
 
-/* 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
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+    else
+       :
+    fi
 
-void fnord() { int i=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;
-      /* dlclose (self); */
-    }
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
+    # test for -W'warning', then add the 'no-' version.
 
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
-#line 31873 "configure"
-#include "confdefs.h"
+    { echo "$as_me:$LINENO: checking for gcc flag -Wstrict-aliasing" >&5
+echo $ECHO_N "checking for gcc flag -Wstrict-aliasing... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-strict-aliasing"
 
-#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
+    else
+       :
+    fi
 
-/* 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
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+    # test for -W'warning', then add the 'no-' version.
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
+
+    { echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5
+echo $ECHO_N "checking for gcc flag -Wunknown-pragmas... $ECHO_C" >&6; }
+    if test "x$GCC" = "xyes"; then
+               $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+           found_warning=no
+           { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       fi
+    else
+       found_warning=no
+       { echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+echo "${ECHO_T}no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-unknown-pragmas"
+
+
+    else
+       :
+    fi
+
+
+
+
+#
+# Libtool
+#
+# 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 :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
+else
+  enable_shared=yes
 fi
-rm -fr conftest*
 
 
+# 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
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$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
+# 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
 
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # 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
+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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_CXX \
-    CC_CXX \
-    LD_CXX \
-    lt_prog_compiler_wl_CXX \
-    lt_prog_compiler_pic_CXX \
-    lt_prog_compiler_static_CXX \
-    lt_prog_compiler_no_builtin_flag_CXX \
-    export_dynamic_flag_spec_CXX \
-    thread_safe_flag_spec_CXX \
-    whole_archive_flag_spec_CXX \
-    enable_shared_with_static_runtimes_CXX \
-    old_archive_cmds_CXX \
-    old_archive_from_new_cmds_CXX \
-    predep_objects_CXX \
-    postdep_objects_CXX \
-    predeps_CXX \
-    postdeps_CXX \
-    compiler_lib_search_path_CXX \
-    archive_cmds_CXX \
-    archive_expsym_cmds_CXX \
-    postinstall_cmds_CXX \
-    postuninstall_cmds_CXX \
-    old_archive_from_expsyms_cmds_CXX \
-    allow_undefined_flag_CXX \
-    no_undefined_flag_CXX \
-    export_symbols_cmds_CXX \
-    hardcode_libdir_flag_spec_CXX \
-    hardcode_libdir_flag_spec_ld_CXX \
-    hardcode_libdir_separator_CXX \
-    hardcode_automatic_CXX \
-    module_cmds_CXX \
-    module_expsym_cmds_CXX \
-    lt_cv_prog_compiler_c_o_CXX \
-    exclude_expsyms_CXX \
-    include_expsyms_CXX; do
-
-    case $var in
-    old_archive_cmds_CXX | \
-    old_archive_from_new_cmds_CXX | \
-    archive_cmds_CXX | \
-    archive_expsym_cmds_CXX | \
-    module_cmds_CXX | \
-    module_expsym_cmds_CXX | \
-    old_archive_from_expsyms_cmds_CXX | \
-    export_symbols_cmds_CXX | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
+  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
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
+fi
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+SED=$lt_cv_path_SED
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+# 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
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$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
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}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"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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.
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# A C compiler.
-LTCC=$lt_LTCC
+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
+  ;;
 
-# A language-specific compiler.
-CC=$lt_compiler_CXX
+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'
+  ;;
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
+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'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
 
-# An ERE matcher.
-EGREP=$lt_EGREP
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# The linker used to build libraries.
-LD=$lt_LD_CXX
+freebsd* | kfreebsd*-gnu | 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
+  ;;
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+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]) 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
+  ;;
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+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
+  ;;
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
+netbsd*)
+  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
+  ;;
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+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
+  ;;
 
-# Used on cygwin: assembler.
-AS="$AS"
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+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
+  ;;
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# Old archive suffix (normally "a").
-libext="$libext"
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  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
+    ;;
+  esac
+  ;;
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+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
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
 
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
+# 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:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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 32927 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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*
+  ;;
 
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          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-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
 
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+int
+main ()
+{
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+       lt_cv_cc_needs_belf=no
+fi
 
-# Library versioning type.
-version_type=$version_type
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$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
+  ;;
 
-# 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
+esac
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+need_locks="$enable_libtool_lock"
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+       ac_header_compiler=no
+fi
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
+  ac_header_preproc=no
+fi
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+fi
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+done
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# 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
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-# 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
+  test -n "$ac_ct_CXX" && break
+done
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# 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_CXX
+       ac_compiler_gnu=no
+fi
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
+int
+main ()
+{
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+       CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# 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_CXX
+int
+main ()
+{
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
+       ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+int
+main ()
+{
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
+fi
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
+depcc="$CXX"  am_compiler_list=
 
-# ### END LIBTOOL TAG CONFIG: $tagname
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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'.
+  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
 
-__EOF__
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  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 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    case $depmode in
+    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
+      ;;
+    none) break ;;
+    esac
+    # 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.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
 
+  cd ..
+  rm -rf conftest.dir
 else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
+  am_cv_CXX_dependencies_compiler_type=none
 fi
 
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
-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 "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
 
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-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
 
-       else
-         tagname=""
-       fi
-       ;;
 
-      F77)
-       if test -n "$F77" && test "X$F77" != "Xno"; then
 
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Broken: fails on valid input.
+continue
+fi
 
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
+rm -f conftest.err conftest.$ac_ext
 
-# Source file extension for f77 test sources.
-ac_ext=f
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+rm -f conftest.err conftest.$ac_ext
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
+  # Broken: fails on valid input.
+continue
+fi
 
+rm -f conftest.err conftest.$ac_ext
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
 
+rm -f conftest.err conftest.$ac_ext
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
 done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
+fi
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
-  ;;
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+  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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
-  ;;
-esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
-
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+done
+done
+IFS=$as_save_IFS
 
-test "$ld_shlibs_F77" = no && can_build_shared=no
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-GCC_F77="$G77"
-LD_F77="$LD"
 
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_F77='-Wl,'
-    lt_prog_compiler_static_F77='-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_F77='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # 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_F77='-m68020 -resident32 -malways-restore-a4'
-      ;;
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
 
-    mingw* | pw32* | os2*)
-      # 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_F77='-DDLL_EXPORT'
-      ;;
+  test -n "$ac_ct_F77" && break
+done
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_F77='-fno-common'
-      ;;
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
 
-    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_F77=no
-      enable_shared=no
-      ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       lt_prog_compiler_pic_F77=-Kconform_pic
-      fi
-      ;;
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
 
-    hpux*)
-      # 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_F77='-fPIC'
-       ;;
-      esac
-      ;;
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
 
-    *)
-      lt_prog_compiler_pic_F77='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static_F77='-Bstatic'
-      else
-       lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_F77='-qnocommon'
-         lt_prog_compiler_wl_F77='-Wl,'
-         ;;
-       esac
-       ;;
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_f77_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    mingw* | pw32* | os2*)
-      # 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_F77='-DDLL_EXPORT'
-      ;;
+       ac_compiler_gnu=no
+fi
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_F77='-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_F77='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
 
-    newsos6)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_f77_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       lt_prog_compiler_wl_F77='-Wl,'
-       lt_prog_compiler_pic_F77='-KPIC'
-       lt_prog_compiler_static_F77='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       lt_prog_compiler_wl_F77='-Wl,'
-       lt_prog_compiler_pic_F77='-fpic'
-       lt_prog_compiler_static_F77='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_F77='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_F77='-non_shared'
-        ;;
-      esac
-      ;;
+       ac_cv_prog_f77_g=no
+fi
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_F77='-Kpic'
-      lt_prog_compiler_static_F77='-dn'
-      ;;
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
 
-    solaris*)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       lt_prog_compiler_wl_F77='-Qoption ld ';;
-      *)
-       lt_prog_compiler_wl_F77='-Wl,';;
-      esac
-      ;;
+G77=`test $ac_compiler_gnu = yes && echo yes`
+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
 
-    sunos4*)
-      lt_prog_compiler_wl_F77='-Qoption ld '
-      lt_prog_compiler_pic_F77='-PIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_prog_compiler_pic_F77='-Kconform_pic'
-       lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
-    unicos*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
+# find the maximum length of command line arguments
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
 
-    uts4*)
-      lt_prog_compiler_pic_F77='-pic'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
+  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
+    ;;
 
-    *)
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-    esac
-  fi
+  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;
+    ;;
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+  cygwin* | mingw*)
+    # 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;
+    ;;
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
+  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;
+    ;;
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_F77=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_F77"
-   # 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:32758: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:32762: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_F77=yes
-     fi
-   fi
-   $rm conftest*
+  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`
+    ;;
+  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
+    ;;
+  *)
+    # 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.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    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`
+    ;;
+  esac
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
 
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
-    case $lt_prog_compiler_pic_F77 in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
-     esac
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
 else
-    lt_prog_compiler_pic_F77=
-     lt_prog_compiler_can_build_shared_F77=no
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
 fi
 
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_F77=
-    ;;
-  *)
-    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
-    ;;
-esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  lt_cv_prog_compiler_c_o_F77=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$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:32820: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:32824: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_F77=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 ..
-   rmdir conftest
-   $rm conftest*
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+# 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]*\)'
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-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
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+# 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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
-  runpath_var=
-  allow_undefined_flag_F77=
-  enable_shared_with_static_runtimes_F77=no
-  archive_cmds_F77=
-  archive_expsym_cmds_F77=
-  old_archive_From_new_cmds_F77=
-  old_archive_from_expsyms_cmds_F77=
-  export_dynamic_flag_spec_F77=
-  whole_archive_flag_spec_F77=
-  thread_safe_flag_spec_F77=
-  hardcode_libdir_flag_spec_F77=
-  hardcode_libdir_flag_spec_ld_F77=
-  hardcode_libdir_separator_F77=
-  hardcode_direct_F77=no
-  hardcode_minus_L_F77=no
-  hardcode_shlibpath_var_F77=unsupported
-  link_all_deplibs_F77=unknown
-  hardcode_automatic_F77=no
-  module_cmds_F77=
-  module_expsym_cmds_F77=
-  always_export_symbols_F77=no
-  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_F77=
-  # 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_F77="_GLOBAL_OFFSET_TABLE_"
-  # 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.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # 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
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDRT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
 
-  ld_shlibs_F77=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+# 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
 
-    # 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_F77='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec_F77=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [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
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       ld_shlibs_F77=no
-       cat <<EOF 1>&2
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
 
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
 
-EOF
-      fi
-      ;;
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[      ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
-    amigaos*)
-      archive_cmds_F77='$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_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
+  # Check to see that the pipe works correctly.
+  pipe_works=no
 
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_F77=no
-      ;;
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       allow_undefined_flag_F77=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$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=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
       else
-       ld_shlibs_F77=no
+       rm -f "$nlist"T
       fi
-      ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=no
-      enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      # 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 <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       ld_shlibs_F77=no
-      fi
-      ;;
+EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       case $cc_basename,$host_cpu in
-       pgcc*)                          # Portland Group C compiler
-         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
-         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
-       esac
-       archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
 
-       if test $supports_anon_versioning = yes; then
-         archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+         cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
        fi
       else
-       ld_shlibs_F77=no
+       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 -f conftest* conftst*
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
+  # 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
 
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       ld_shlibs_F77=no
-       cat <<EOF 1>&2
+fi
 
-*** 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.
+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
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
+else
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+fi
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs_F77=no
-      fi
-      ;;
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
 
-    sunos4*)
-      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs_F77=no
-      fi
-      ;;
-    esac
 
-    if test "$ld_shlibs_F77" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_F77=
-      export_dynamic_flag_spec_F77=
-      whole_archive_flag_spec_F77=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=yes
-      archive_expsym_cmds_F77='$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_F77=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       hardcode_direct_F77=unsupported
-      fi
-      ;;
 
-    aix4* | aix5*)
-      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
-       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-         export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-       else
-         export_symbols_cmds_F77='$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].*|aix5*)
-         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
+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
 
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
+# 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'
 
-      # 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.
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
 
-      archive_cmds_F77=''
-      hardcode_direct_F77=yes
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
-      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
-         hardcode_direct_F77=yes
-         else
-         # We have old collect2
-         hardcode_direct_F77=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_F77=yes
-         hardcode_libdir_flag_spec_F77='-L$libdir'
-         hardcode_libdir_separator_F77=
-         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
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
 
-      # 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_F77=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_F77='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-      program main
+# Constants:
+rm="rm -f"
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_f77_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-       archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-       if test "$host_cpu" = ia64; then
-         hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
-         allow_undefined_flag_F77="-z nodefs"
-         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        cat >conftest.$ac_ext <<_ACEOF
-      program main
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_f77_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-        hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok'
-         allow_undefined_flag_F77=' ${wl}-berok'
-         # -bexpall does not export symbols beginning with underscore (_)
-         always_export_symbols_F77=yes
-         # Exported symbols can be pulled into shared objects from archives
-         whole_archive_flag_spec_F77=' '
-         archive_cmds_need_lc_F77=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    amigaos*)
-      archive_cmds_F77='$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_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_F77=no
-      ;;
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    bsdi[45]*)
-      export_dynamic_flag_spec_F77=-rdynamic
-      ;;
 
-    cygwin* | mingw* | pw32*)
-      # 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.
-      hardcode_libdir_flag_spec_F77=' '
-      allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_F77='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_F77=yes
-      ;;
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_F77=no
-      hardcode_direct_F77=no
-      hardcode_automatic_F77=yes
-      hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77=''
-      link_all_deplibs_F77=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_F77=no
-          ;;
-      esac
-    fi
-      ;;
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    dgux*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
 
-    freebsd1*)
-      ld_shlibs_F77=no
-      ;;
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    # 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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    hpux9*)
-      if test "$GCC" = yes; then
-       archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_direct_F77=yes
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-E'
-      ;;
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
 
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-         hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-         hardcode_libdir_separator_F77=:
-         hardcode_direct_F77=no
-         hardcode_shlibpath_var_F77=no
-         ;;
-       ia64*)
-         hardcode_libdir_flag_spec_F77='-L$libdir'
-         hardcode_direct_F77=no
-         hardcode_shlibpath_var_F77=no
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L_F77=yes
-         ;;
-       *)
-         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-         hardcode_libdir_separator_F77=:
-         hardcode_direct_F77=yes
-         export_dynamic_flag_spec_F77='${wl}-E'
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L_F77=yes
-         ;;
-       esac
-      fi
-      ;;
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      link_all_deplibs_F77=yes
-      ;;
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
 
-    newsos6)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_shlibpath_var_F77=no
-      ;;
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-    openbsd*)
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-       archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-       export_dynamic_flag_spec_F77='${wl}-E'
-      else
-       case $host_os in
-        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-          archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-          hardcode_libdir_flag_spec_F77='-R$libdir'
-          ;;
-        *)
-          archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-          hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-          ;;
-       esac
-      fi
-      ;;
 
-    os2*)
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      allow_undefined_flag_F77=unsupported
-      archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF 1>&2
 
-    osf3*)
-      if test "$GCC" = yes; then
-       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       allow_undefined_flag_F77=' -expect_unresolved \*'
-       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+*** 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
+
+EOF
+         fi ;;
+       esac
       fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      ;;
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
 
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      else
-       allow_undefined_flag_F77=' -expect_unresolved \*'
-       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-       # Both c and cxx compiler support -rpath directly
-       hardcode_libdir_flag_spec_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_F77=:
-      ;;
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF 1>&2
 
-    sco3.2v5*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
+*** 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
 
-    solaris*)
-      no_undefined_flag_F77=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       wlarc=''
-       archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       archive_expsym_cmds_F77='$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'
+EOF
+         fi ;;
+       esac
       fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_shlibpath_var_F77=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-       # The compiler driver will combine linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
-       *)
-         whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      link_all_deplibs_F77=yes
-      ;;
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
 
-    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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
 
-    sysv4)
-      case $host_vendor in
-       sni)
-         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct_F77=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         reload_cmds_F77='$CC -r -o $output$reload_objs'
-         hardcode_direct_F77=no
-        ;;
-       motorola)
-         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
+  else
+    MAGIC_CMD=:
+  fi
+fi
 
-    sysv4.3*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='-Bexport'
-      ;;
+  fi
+  ;;
+esac
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_shlibpath_var_F77=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       ld_shlibs_F77=yes
-      fi
-      ;;
+enable_dlopen=no
+enable_win32_dll=no
 
-    sysv4.2uw2*)
-      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_F77='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-    sysv5*)
-      no_undefined_flag_F77=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_F77='$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'
-      hardcode_libdir_flag_spec_F77=
-      hardcode_shlibpath_var_F77=no
-      runpath_var='LD_RUN_PATH'
-      ;;
 
-    uts4*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
 
-    *)
-      ld_shlibs_F77=no
-      ;;
-    esac
-  fi
+test -z "$pic_mode" && pic_mode=default
 
-echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6
-test "$ld_shlibs_F77" = no && can_build_shared=no
+# Use C for the default configuration in the libtool script
+tagname=
+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
 
-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
 
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_F77=yes
+# Source file extension for C test sources.
+ac_ext=c
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_F77 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.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_F77
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
-        allow_undefined_flag_F77=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-         archive_cmds_need_lc_F77=no
-        else
-         archive_cmds_need_lc_F77=yes
-        fi
-        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    lt_prog_cc_shlib='-belf'
+    ;;
+  esac
 fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
+if test -n "$lt_prog_cc_shlib"; then
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
+    { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
 
-case $host_os in
-aix3*)
-  version_type=linux
-  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'
-  ;;
+    cat <<AAW_EOF >>config.warnings
+\`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries
+AAW_EOF
 
-aix4* | aix5*)
-  version_type=linux
-  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*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
+  if echo "$old_CC $old_CFLAGS " | grep "[     ]$lt_prog_cc_shlib[     ]" >/dev/null; then :
+  else
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
+    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
 
-bsdi[45]*)
-  version_type=linux
-  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*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+    cat <<AAW_EOF >>config.warnings
+add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure
+AAW_EOF
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # 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}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+    lt_cv_prog_cc_can_build_shared=no
   fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
+fi
 
-dgux*)
-  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
-  ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
+#
+# Check to make sure the static flag actually works.
+#
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+   printf "$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 "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
 
-kfreebsd*-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='GNU ld.so'
-  ;;
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
 
-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[123]*) 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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
 
-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
-  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'
-  ;;
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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
-  ;;
+## 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...
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
+lt_prog_compiler_no_builtin_flag=
 
-# This must be Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
-  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;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'
-  ;;
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$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:35214: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:35218: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
 
-knetbsd*-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='GNU ld.so'
-  ;;
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-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
-  ;;
+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
 
-newsos6)
-  version_type=linux
-  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
-  ;;
+fi
 
-nto-qnx*)
-  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=yes
-  ;;
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
 
-openbsd*)
-  version_type=sunos
-  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
-  ;;
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
-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
-  ;;
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
 
-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"
-  ;;
+    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
+      ;;
 
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
+    amigaos*)
+      # 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'
+      ;;
 
-solaris*)
-  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=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
-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
-  ;;
+    mingw* | pw32* | os2*)
+      # 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'
+      ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
       ;;
-    siemens)
-      need_lib_prefix=no
+
+    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
       ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
       ;;
-  esac
-  ;;
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    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
-  ;;
+    hpux*)
+      # 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='-fPIC'
+       ;;
+      esac
+      ;;
 
-uts4*)
-  version_type=linux
-  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
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
-
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var_F77" || \
-   test "X$hardcode_automatic_F77" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
-     test "$hardcode_minus_L_F77" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_F77=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_F77=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_F77=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6
-
-if test "$hardcode_action_F77" = relink; 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
-
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}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"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
-
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_F77 \
-    CC_F77 \
-    LD_F77 \
-    lt_prog_compiler_wl_F77 \
-    lt_prog_compiler_pic_F77 \
-    lt_prog_compiler_static_F77 \
-    lt_prog_compiler_no_builtin_flag_F77 \
-    export_dynamic_flag_spec_F77 \
-    thread_safe_flag_spec_F77 \
-    whole_archive_flag_spec_F77 \
-    enable_shared_with_static_runtimes_F77 \
-    old_archive_cmds_F77 \
-    old_archive_from_new_cmds_F77 \
-    predep_objects_F77 \
-    postdep_objects_F77 \
-    predeps_F77 \
-    postdeps_F77 \
-    compiler_lib_search_path_F77 \
-    archive_cmds_F77 \
-    archive_expsym_cmds_F77 \
-    postinstall_cmds_F77 \
-    postuninstall_cmds_F77 \
-    old_archive_from_expsyms_cmds_F77 \
-    allow_undefined_flag_F77 \
-    no_undefined_flag_F77 \
-    export_symbols_cmds_F77 \
-    hardcode_libdir_flag_spec_F77 \
-    hardcode_libdir_flag_spec_ld_F77 \
-    hardcode_libdir_separator_F77 \
-    hardcode_automatic_F77 \
-    module_cmds_F77 \
-    module_expsym_cmds_F77 \
-    lt_cv_prog_compiler_c_o_F77 \
-    exclude_expsyms_F77 \
-    include_expsyms_F77; do
-
-    case $var in
-    old_archive_cmds_F77 | \
-    old_archive_from_new_cmds_F77 | \
-    archive_cmds_F77 | \
-    archive_expsym_cmds_F77 | \
-    module_cmds_F77 | \
-    module_expsym_cmds_F77 | \
-    old_archive_from_expsyms_cmds_F77 | \
-    export_symbols_cmds_F77 | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
     *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      lt_prog_compiler_pic='-fPIC'
       ;;
     esac
-  done
+  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
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
+    mingw* | pw32* | os2*)
+      # 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'
+      ;;
 
-cfgfile="$ofile"
+    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'
+      ;;
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # 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'
+        ;;
+      esac
+      ;;
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+    sco3.2v5*)
+      lt_prog_compiler_pic='-Kpic'
+      lt_prog_compiler_static='-dn'
+      ;;
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
 
-# A C compiler.
-LTCC=$lt_LTCC
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
 
-# A language-specific compiler.
-CC=$lt_compiler_F77
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$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:35476: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:35480: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
 
-# An ERE matcher.
-EGREP=$lt_EGREP
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
 
-# The linker used to build libraries.
-LD=$lt_LD_F77
+if test x"$lt_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
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
+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
 
-# A BSD-compatible nm program.
-NM=$lt_NM
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-# A symbol stripping program
-STRIP=$lt_STRIP
+   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:35538: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:35542: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || 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 ..
+   rmdir conftest
+   $rm conftest*
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
+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
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
 
-# Used on cygwin: assembler.
-AS="$AS"
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+    cat <<AAW_EOF >>config.warnings
+\`$CC' does not support \`-c -o', so \`make -j' may be unsafe
+AAW_EOF
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
 
-# Old archive suffix (normally "a").
-libext="$libext"
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # 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_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-# Executable file suffix (normally "").
-exeext="$exeext"
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
 
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+    # 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>/dev/null` in
+      *\ [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
 
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
 
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
 
-# Library versioning type.
-version_type=$version_type
+EOF
+      fi
+      ;;
 
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
+    amigaos*)
+      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
 
-# 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
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
 
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
+    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
+      ;;
 
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
 
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # 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; $echo \"$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' ;;
+       esac
+       archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
+       if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
 
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
+    netbsd*)
+      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 $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'
+      fi
+      ;;
 
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<EOF 1>&2
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
+*** 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.
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       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
+      ;;
 
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       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
 
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+    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 "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
 
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+    aix4* | aix5*)
+      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
+       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")) && (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
 
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
+       # 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].*|aix5*)
+         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
 
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
 
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
+      # 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.
 
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
 
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
+      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
+         hardcode_direct=yes
+         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
+      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
 
-# 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
+      # 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.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+int
+main ()
+{
 
-# 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
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
 
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+fi
 
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# 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_F77
+int
+main ()
+{
 
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
+fi
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-# 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_F77
+        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'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec=' '
+         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 $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
+    amigaos*)
+      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
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+    cygwin* | mingw* | pw32*)
+      # 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.
+      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 `echo "$deplibs" | $SED -e '\''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'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-       else
-         tagname=""
-       fi
-       ;;
-
-      GCJ)
-       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
 
-ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
 
+    freebsd1*)
+      ld_shlibs=no
+      ;;
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+    # 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
+      ;;
 
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
 
-old_archive_cmds_GCJ=$old_archive_cmds
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${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
 
-## 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...
+      # 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'
+      ;;
 
-lt_prog_compiler_no_builtin_flag_GCJ=
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld='+b $libdir'
+         hardcode_libdir_separator=:
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
 
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator=:
+         hardcode_direct=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
+      ;;
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   printf "$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:34954: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:34958: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+    netbsd*)
+      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
+      ;;
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
-    :
-fi
+    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
+      ;;
 
-fi
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      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
+      ;;
 
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
+    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'
+      ;;
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+    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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
 
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_GCJ='-Wl,'
-    lt_prog_compiler_static_GCJ='-static'
+    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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
 
-    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_GCJ='-Bstatic'
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
       fi
+      hardcode_libdir_separator=:
       ;;
 
-    amigaos*)
-      # 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_GCJ='-m68020 -resident32 -malways-restore-a4'
+    sco3.2v5*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
       ;;
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "x$archive_cmds" = "x"; then
+        if test "$GCC" = yes; then
+         wlarc='${wl}'
+         if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+           archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+         else
+           archive_cmds='$CC ${wl}-G ${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 ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+          fi
+        else
+         wlarc=''
+          lt_prog_compiler_static='-static'
+         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'
+          lt_prog_compiler_static='-static'
+       fi
+      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 linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs=yes
       ;;
 
-    mingw* | pw32* | os2*)
-      # 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_GCJ='-DDLL_EXPORT'
+    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
       ;;
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_GCJ='-fno-common'
+    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
       ;;
 
-    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_GCJ=no
-      enable_shared=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
-       lt_prog_compiler_pic_GCJ=-Kconform_pic
+       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
       ;;
 
-    hpux*)
-      # 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_GCJ='-fPIC'
-       ;;
-      esac
+    sysv4.2uw2*)
+      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=no
+      hardcode_shlibpath_var=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
       ;;
 
-    *)
-      lt_prog_compiler_pic_GCJ='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       lt_prog_compiler_static_GCJ='-Bstatic'
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-       lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_GCJ='-qnocommon'
-         lt_prog_compiler_wl_GCJ='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | pw32* | os2*)
-      # 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_GCJ='-DDLL_EXPORT'
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
       ;;
 
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_GCJ='-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_GCJ='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+    sysv5*)
+      no_undefined_flag=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      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'
+      hardcode_libdir_flag_spec=
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
       ;;
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_GCJ='-non_shared'
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
       ;;
 
-    newsos6)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
+    *)
+      ld_shlibs=no
       ;;
+    esac
+  fi
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       lt_prog_compiler_wl_GCJ='-Wl,'
-       lt_prog_compiler_pic_GCJ='-KPIC'
-       lt_prog_compiler_static_GCJ='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       lt_prog_compiler_wl_GCJ='-Wl,'
-       lt_prog_compiler_pic_GCJ='-fpic'
-       lt_prog_compiler_static_GCJ='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_GCJ='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_GCJ='-non_shared'
-        ;;
-      esac
-      ;;
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
 
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
+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
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_GCJ='-Kpic'
-      lt_prog_compiler_static_GCJ='-dn'
-      ;;
+#
+# 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
 
-    solaris*)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       lt_prog_compiler_wl_GCJ='-Qoption ld ';;
-      *)
-       lt_prog_compiler_wl_GCJ='-Wl,';;
-      esac
+  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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-    sunos4*)
-      lt_prog_compiler_wl_GCJ='-Qoption ld '
-      lt_prog_compiler_pic_GCJ='-PIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+        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:$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=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc=no
+        else
+         archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
       ;;
+    esac
+  fi
+  ;;
+esac
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # 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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       lt_prog_compiler_pic_GCJ='-Kconform_pic'
-       lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
 
-    unicos*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
 
-    uts4*)
-      lt_prog_compiler_pic_GCJ='-pic'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
 
-    *)
-      lt_prog_compiler_can_build_shared_GCJ=no
+aix4* | aix5*)
+  version_type=linux
+  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
+  ;;
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+amigaos*)
+  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=`$echo "X$lib" | $Xsed -e '\''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'
+  ;;
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_pic_works_GCJ=no
-  ac_outfile=conftest.$ac_objext
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
-   # 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:35216: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:35220: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_prog_compiler_pic_works_GCJ=yes
-     fi
-   fi
-   $rm conftest*
+bsdi[45]*)
+  version_type=linux
+  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
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
 
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
-    case $lt_prog_compiler_pic_GCJ in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
-     esac
-else
-    lt_prog_compiler_pic_GCJ=
-     lt_prog_compiler_can_build_shared_GCJ=no
-fi
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
 
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_GCJ=
+    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="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        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
+      ;;
+    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
     ;;
+
   *)
-    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
-esac
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_GCJ=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
 
-   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:35278: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:35282: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_GCJ=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 ..
-   rmdir conftest
-   $rm conftest*
+dgux*)
+  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
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+freebsd1*)
+  dynamic_linker=no
+  ;;
 
+kfreebsd*-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='GNU ld.so'
+  ;;
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
+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[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
   fi
-else
-  need_locks=no
-fi
-
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
-
-  runpath_var=
-  allow_undefined_flag_GCJ=
-  enable_shared_with_static_runtimes_GCJ=no
-  archive_cmds_GCJ=
-  archive_expsym_cmds_GCJ=
-  old_archive_From_new_cmds_GCJ=
-  old_archive_from_expsyms_cmds_GCJ=
-  export_dynamic_flag_spec_GCJ=
-  whole_archive_flag_spec_GCJ=
-  thread_safe_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_ld_GCJ=
-  hardcode_libdir_separator_GCJ=
-  hardcode_direct_GCJ=no
-  hardcode_minus_L_GCJ=no
-  hardcode_shlibpath_var_GCJ=unsupported
-  link_all_deplibs_GCJ=unknown
-  hardcode_automatic_GCJ=no
-  module_cmds_GCJ=
-  module_expsym_cmds_GCJ=
-  always_export_symbols_GCJ=no
-  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_GCJ=
-  # 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_GCJ="_GLOBAL_OFFSET_TABLE_"
-  # 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.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
+  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
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
+  shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  cygwin* | mingw* | pw32*)
-    # 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
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
     ;;
-  openbsd*)
-    with_gnu_ld=no
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
     ;;
   esac
+  ;;
 
-  ld_shlibs_GCJ=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+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
+  hardcode_into_libs=yes
+  ;;
 
-    # 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_GCJ='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       whole_archive_flag_spec_GCJ=
+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
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [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 ;;
+    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'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       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
+  ;;
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       ld_shlibs_GCJ=no
-       cat <<EOF 1>&2
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
 
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+# This must be Linux ELF.
+linux*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # 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
 
-EOF
-      fi
-      ;;
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-    amigaos*)
-      archive_cmds_GCJ='$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_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
+  # 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'
+  ;;
 
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_GCJ=no
-      ;;
+knetbsd*-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='GNU ld.so'
+  ;;
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       allow_undefined_flag_GCJ=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       ld_shlibs_GCJ=no
-      fi
-      ;;
+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
+  ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=no
-      enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+newsos6)
+  version_type=linux
+  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
+  ;;
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       ld_shlibs_GCJ=no
-      fi
-      ;;
+nto-qnx*)
+  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=yes
+  ;;
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       case $cc_basename,$host_cpu in
-       pgcc*)                          # Portland Group C compiler
-         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
-         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
-       esac
-       archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+openbsd*)
+  version_type=sunos
+  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
+  ;;
 
-       if test $supports_anon_versioning = yes; then
-         archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-       fi
-      else
-       ld_shlibs_GCJ=no
-      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
+  ;;
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
+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"
+  ;;
 
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       ld_shlibs_GCJ=no
-       cat <<EOF 1>&2
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
 
-*** 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.
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs_GCJ=no
-      fi
-      ;;
+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
+  ;;
 
-    sunos4*)
-      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
       ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       ld_shlibs_GCJ=no
-      fi
+    siemens)
+      need_lib_prefix=no
       ;;
-    esac
-
-    if test "$ld_shlibs_GCJ" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_GCJ=
-      export_dynamic_flag_spec_GCJ=
-      whole_archive_flag_spec_GCJ=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=yes
-      archive_expsym_cmds_GCJ='$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_GCJ=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       hardcode_direct_GCJ=unsupported
-      fi
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
       ;;
+  esac
+  ;;
 
-    aix4* | aix5*)
-      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
-       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-         export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-       else
-         export_symbols_cmds_GCJ='$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
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    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
+  ;;
 
-       # 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].*|aix5*)
-         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
+uts4*)
+  version_type=linux
+  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
+  ;;
 
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-      # 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.
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
 
-      archive_cmds_GCJ=''
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
+  # We can hardcode non-existant 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_AC_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
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
 
-      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
-         hardcode_direct_GCJ=yes
-         else
-         # We have old collect2
-         hardcode_direct_GCJ=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_GCJ=yes
-         hardcode_libdir_flag_spec_GCJ='-L$libdir'
-         hardcode_libdir_separator_GCJ=
-         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
+if test "$hardcode_action" = relink; 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
 
-      # 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_GCJ=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_GCJ='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* 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
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
 
-       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-       archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-       if test "$host_cpu" = ia64; then
-         hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
-         allow_undefined_flag_GCJ="-z nodefs"
-         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        cat >conftest.$ac_ext <<_ACEOF
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); 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 shl_load
+
+/* 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 ();
+/* 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_shl_load || defined __stub___shl_load
+choke me
+#endif
 
 int
 main ()
 {
-
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_func_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-        hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok'
-         allow_undefined_flag_GCJ=' ${wl}-berok'
-         # -bexpall does not export symbols beginning with underscore (_)
-         always_export_symbols_GCJ=yes
-         # Exported symbols can be pulled into shared objects from archives
-         whole_archive_flag_spec_GCJ=' '
-         archive_cmds_need_lc_GCJ=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    amigaos*)
-      archive_cmds_GCJ='$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_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_GCJ=no
-      ;;
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    bsdi[45]*)
-      export_dynamic_flag_spec_GCJ=-rdynamic
-      ;;
+       ac_cv_lib_dld_shl_load=no
+fi
 
-    cygwin* | mingw* | pw32*)
-      # 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.
-      hardcode_libdir_flag_spec_GCJ=' '
-      allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_GCJ='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_GCJ=yes
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_GCJ=no
-      hardcode_direct_GCJ=no
-      hardcode_automatic_GCJ=yes
-      hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ=''
-      link_all_deplibs_GCJ=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_GCJ=no
-          ;;
-      esac
-    fi
-      ;;
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-    dgux*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-    freebsd1*)
-      ld_shlibs_GCJ=no
-      ;;
+#undef dlopen
 
-    # 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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+/* 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 ();
+/* 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_dlopen || defined __stub___dlopen
+choke me
+#endif
 
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+       ac_cv_func_dlopen=no
+fi
 
-    hpux9*)
-      if test "$GCC" = yes; then
-       archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_direct_GCJ=yes
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      ;;
-
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-         hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-         hardcode_libdir_separator_GCJ=:
-         hardcode_direct_GCJ=no
-         hardcode_shlibpath_var_GCJ=no
-         ;;
-       ia64*)
-         hardcode_libdir_flag_spec_GCJ='-L$libdir'
-         hardcode_direct_GCJ=no
-         hardcode_shlibpath_var_GCJ=no
-
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L_GCJ=yes
-         ;;
-       *)
-         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-         hardcode_libdir_separator_GCJ=:
-         hardcode_direct_GCJ=yes
-         export_dynamic_flag_spec_GCJ='${wl}-E'
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         hardcode_minus_L_GCJ=yes
-         ;;
-       esac
-      fi
-      ;;
+       ac_cv_lib_dl_dlopen=no
+fi
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      link_all_deplibs_GCJ=yes
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    newsos6)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+       ac_cv_lib_svld_dlopen=no
+fi
 
-    openbsd*)
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-       archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-       export_dynamic_flag_spec_GCJ='${wl}-E'
-      else
-       case $host_os in
-        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-          archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-          hardcode_libdir_flag_spec_GCJ='-R$libdir'
-          ;;
-        *)
-          archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-          hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-          ;;
-       esac
-      fi
-      ;;
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-    os2*)
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      allow_undefined_flag_GCJ=unsupported
-      archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    osf3*)
-      if test "$GCC" = yes; then
-       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       allow_undefined_flag_GCJ=' -expect_unresolved \*'
-       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      ;;
+       ac_cv_lib_dld_dld_link=no
+fi
 
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      else
-       allow_undefined_flag_GCJ=' -expect_unresolved \*'
-       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
 
-       # Both c and cxx compiler support -rpath directly
-       hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_GCJ=:
-      ;;
 
-    sco3.2v5*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
+fi
 
-    solaris*)
-      no_undefined_flag_GCJ=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       wlarc=''
-       archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       archive_expsym_cmds_GCJ='$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'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-       # The compiler driver will combine linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
-       *)
-         whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+fi
 
-    sysv4)
-      case $host_vendor in
-       sni)
-         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct_GCJ=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         reload_cmds_GCJ='$CC -r -o $output$reload_objs'
-         hardcode_direct_GCJ=no
-        ;;
-       motorola)
-         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    sysv4.3*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='-Bexport'
-      ;;
+fi
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       hardcode_shlibpath_var_GCJ=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       ld_shlibs_GCJ=yes
-      fi
-      ;;
 
-    sysv4.2uw2*)
-      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+fi
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_GCJ='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
 
-    sysv5*)
-      no_undefined_flag_GCJ=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_GCJ='$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'
-      hardcode_libdir_flag_spec_GCJ=
-      hardcode_shlibpath_var_GCJ=no
-      runpath_var='LD_RUN_PATH'
-      ;;
+fi
 
-    uts4*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
+    ;;
+  esac
 
-    *)
-      ld_shlibs_GCJ=no
-      ;;
-    esac
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6
-test "$ld_shlibs_GCJ" = 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
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_GCJ=yes
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_GCJ 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.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_GCJ
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
-        allow_undefined_flag_GCJ=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-         archive_cmds_need_lc_GCJ=no
-        else
-         archive_cmds_need_lc_GCJ=yes
-        fi
-        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
-      ;;
-    esac
-  fi
-  ;;
-esac
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
-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"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # 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.
-    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
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
+         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 <<EOF
+#line 37767 "configure"
+#include "confdefs.h"
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+#include <stdio.h>
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
 
-aix4* | aix5*)
-  version_type=linux
-  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
-      ;;
+/* 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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
     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
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
   fi
-  ;;
-
-amigaos*)
-  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=`$echo "X$lib" | $Xsed -e '\''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'
-  ;;
+fi
+rm -fr conftest*
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  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
-  ;;
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
+#line 37865 "configure"
+#include "confdefs.h"
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    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'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
-    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="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        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
-      ;;
-    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
-    ;;
+#include <stdio.h>
 
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
+/* 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
 
-dgux*)
-  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
-  ;;
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
 
-kfreebsd*-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='GNU ld.so'
-  ;;
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
 
-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[123]*) objformat=aout ;;
-    *) objformat=elf ;;
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
     esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
   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
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
+fi
+rm -fr conftest*
 
-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
-  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
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
     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'
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       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
-    ;;
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
   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
-  ;;
+  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
 
-# This must be Linux ELF.
-linux*)
-  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'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
+# Report which librarie types wil actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
 
-  # 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'
-  ;;
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
 
-knetbsd*-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='GNU ld.so'
+# 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
   ;;
 
-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'
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
   fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
 
-newsos6)
-  version_type=linux
-  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
-  ;;
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
 
-nto-qnx*)
-  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=yes
-  ;;
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
 
-openbsd*)
-  version_type=sunos
-  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  ;;
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
   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
-  ;;
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
 
-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"
-  ;;
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
 
-sco3.2v5*)
-  version_type=osf
-  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
-  ;;
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# 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.
 
-solaris*)
-  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=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
+# A sed program that does not truncate output.
+SED=$lt_SED
 
-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
-  ;;
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  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
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      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
-  ;;
+# 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
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    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
-  ;;
+# The names of the tagged configurations supported by this script.
+available_tags=
 
-uts4*)
-  version_type=linux
-  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
-  ;;
+# ### BEGIN LIBTOOL CONFIG
 
-*)
-  dynamic_linker=no
-  ;;
-esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
-test "$dynamic_linker" = no && can_build_shared=no
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var_GCJ" || \
-   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
-     test "$hardcode_minus_L_GCJ" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_GCJ=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_GCJ=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_GCJ=unsupported
-fi
-echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
-if test "$hardcode_action_GCJ" = relink; 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
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}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"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
 
-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=
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
 
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
+# A C compiler.
+LTCC=$lt_LTCC
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
+# A language-specific compiler.
+CC=$lt_compiler
 
-fi
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
 
-   ;;
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
+# The linker used to build libraries.
+LD=$lt_LD
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+# A BSD-compatible nm program.
+NM=$lt_NM
 
-#undef shl_load
+# A symbol stripping program
+STRIP=$lt_STRIP
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* 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_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
 
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Used on cygwin: assembler.
+AS="$AS"
 
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
 
-#undef dlopen
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* 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_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
+# Old archive suffix (normally "a").
+libext="$libext"
 
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Executable file suffix (normally "").
+exeext="$exeext"
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
 
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+# Do we need a version for libraries?
+need_version=$need_version
+
+# 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
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# 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
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# 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
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# 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 and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# 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
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# 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
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# 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
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# 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 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
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# 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
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# 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
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_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
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\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
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+EOF
+    ;;
+  esac
+
+  # 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)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+  withval=$with_tags; tagnames="$withval"
 fi
 
 
-fi
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+output file \`$ofile' does not exist
+AAW_EOF
+
+
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+output file \`$ofile' does not look like a libtool script
+AAW_EOF
+
+
+    else
+
+    { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+using \`LTCC=$LTCC', extracted from \`$ofile'
+AAW_EOF
+
+
+    fi
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+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
+  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
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# 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.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_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
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${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
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    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.
+    archive_cmds_CXX='$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 "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    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].*|aix5*)
+       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.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    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
+         hardcode_direct_CXX=yes
+       else
+         # We have old collect2
+         hardcode_direct_CXX=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_CXX=yes
+         hardcode_libdir_flag_spec_CXX='-L$libdir'
+         hardcode_libdir_separator_CXX=
+       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
+
+    # 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_CXX=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_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+       hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+       allow_undefined_flag_CXX="-z nodefs"
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok'
+       allow_undefined_flag_CXX=' ${wl}-berok'
+       # -bexpall does not export symbols beginning with underscore (_)
+       always_export_symbols_CXX=yes
+       # Exported symbols can be pulled into shared objects from archives
+       whole_archive_flag_spec_CXX=' '
+       archive_cmds_need_lc_CXX=yes
+       # This is similar to how AIX traditionally builds its shared libraries.
+       archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='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}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$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'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      ghcx*)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=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
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+       hardcode_libdir_separator_CXX=:
+        ;;
+      ia64*)
+       hardcode_libdir_flag_spec_CXX='-L$libdir'
+        ;;
+      *)
+       hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator_CXX=:
+       export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=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
+       ld_shlibs_CXX=no
+       ;;
+      aCC*)
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+         ;;
+       *)
+         archive_cmds_CXX='$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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case $host_cpu in
+           ia64*|hppa*64*)
+             archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+             ;;
+           *)
+             archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${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
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+       # SGI C++
+       archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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.
+       old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+         else
+           archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       link_all_deplibs_CXX=yes
+       ;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    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.
+       archive_cmds_CXX='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'
+       archive_expsym_cmds_CXX='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; echo $list'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc*)
+       # 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."*)
+         archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$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
+         archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       archive_cmds_need_lc_CXX=no
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC*)
+        # Portland Group C++ compiler
+       archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       archive_expsym_cmds_CXX='$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'
+
+       hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+       export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+       whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+       # Compaq C++
+       archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_CXX='$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
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # 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=`echo $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; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=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::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    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.
+       archive_cmds_CXX='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'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx*)
+       allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # 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=`echo $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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+         archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # 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 "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  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.
+       archive_cmds_CXX='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'
+
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      cxx*)
+       allow_undefined_flag_CXX=' -expect_unresolved \*'
+       archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_CXX='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'
+
+       hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+       hardcode_libdir_separator_CXX=:
+
+       # 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=`echo $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; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+        archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+         # 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 "\-L"'
+
+       else
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+       fi
+       ;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sco*)
+    archive_cmds_need_lc_CXX=no
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      lcc*)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+       no_undefined_flag_CXX=' -zdefs'
+       archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       archive_expsym_cmds_CXX='$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'
+
+       hardcode_libdir_flag_spec_CXX='-R$libdir'
+       hardcode_shlibpath_var_CXX=no
+       case $host_os in
+         solaris2.[0-5] | solaris2.[0-5].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       link_all_deplibs_CXX=yes
+
+       output_verbose_link_cmd='echo'
+
+       # 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.
+       old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx*)
+       # Green Hills C++ Compiler
+       archive_cmds_CXX='$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.
+       old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+             archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+              archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -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 \"\-L\""
+              lt_prog_compiler_static_CXX='-static'
+           else
+             archive_cmds_CXX='$CC ${wl}-G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+              archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC ${wl}-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 ${wl}-G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+              lt_prog_compiler_static_CXX='${wl}-Bstatic'
+           fi
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$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 \"\-L\""
+         fi
+
+         hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$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...
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $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
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p 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 "$compiler_lib_search_path_CXX"; then
+            compiler_lib_search_path_CXX="${prev}${p}"
+          else
+            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
+          postdeps_CXX="${prev}${p}"
+        else
+          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$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 "$predep_objects_CXX"; then
+          predep_objects_CXX="$p"
+        else
+          predep_objects_CXX="$predep_objects_CXX $p"
+        fi
+       else
+        if test -z "$postdep_objects_CXX"; then
+          postdep_objects_CXX="$p"
+        else
+          postdep_objects_CXX="$postdep_objects_CXX $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # 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.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-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_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # 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_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # 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_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # 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*)
+       ;;
+      *)
+       lt_prog_compiler_pic_CXX='-fPIC'
+       ;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         lt_prog_compiler_static_CXX='-Bstatic'
+       else
+         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+       ;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           if test "$host_cpu" != ia64; then
+             lt_prog_compiler_pic_CXX='+Z'
+           fi
+           ;;
+         aCC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             lt_prog_compiler_pic_CXX='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         icpc* | ecpc*)
+           # Intel C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         pgCC*)
+           # Portland Group C++ compiler.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fpic'
+           lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           lt_prog_compiler_pic_CXX='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      sco*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           lt_prog_compiler_wl_CXX='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-PIC'
+           ;;
+         *)
+           if $CC -v --help 2>/dev/null | grep -- -static  > /dev/null 2> /dev/null; then
+             lt_prog_compiler_static_CXX='-static'
+           else
+             # GCC with Sun linker
+             lt_prog_compiler_pic_CXX='-KPIC'
+             lt_prog_compiler_static_CXX='${wl}-Bstatic'
+            fi
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           lt_prog_compiler_pic_CXX='-pic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      unixware*)
+       ;;
+      vxworks*)
+       ;;
+      *)
+       lt_prog_compiler_can_build_shared_CXX=no
+       ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:40164: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:40168: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:40226: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:40230: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+\`$CC' does not support \`-c -o', so \`make -j' may be unsafe
+AAW_EOF
+
+
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # 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
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_CXX=no
+        else
+         archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # 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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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
+  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'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  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*)
+  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=`$echo "X$lib" | $Xsed -e '\''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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        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
+      ;;
+    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
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # 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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-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='GNU ld.so'
+  ;;
+
+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[123]*) 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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+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
+  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'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       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 Linux ELF.
+linux*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;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'
+  ;;
+
+knetbsd*-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='GNU ld.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
+  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=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=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  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"
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
+
+solaris*)
+  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=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.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+    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
+  ;;
+
+uts4*)
+  version_type=linux
+  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
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; 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
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+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*)
+    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
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; 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
+
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); 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 shl_load
+
+/* 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 ();
+/* 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_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); 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 dlopen
+
+/* 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 ();
+/* 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_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
+#line 41578 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
+#line 41676 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# 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
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# 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
+
+# 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
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# 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
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# 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
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# 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
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# 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_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# 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_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# 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
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+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
+
+       else
+         tagname=""
+       fi
+       ;;
+
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-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_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # 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_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # 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_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    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_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # 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_F77='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_F77='-Bstatic'
+      else
+       lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # 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_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-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_F77='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-KPIC'
+       lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_F77='-Wl,'
+       lt_prog_compiler_pic_F77='-fpic'
+       lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_prog_compiler_pic_F77='-Kpic'
+      lt_prog_compiler_static_F77='-dn'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_F77='-Kconform_pic'
+       lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # 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:42561: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:42565: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:42623: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:42627: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=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 ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+
+
+    cat <<AAW_EOF >>config.warnings
+\`$CC' does not support \`-c -o', so \`make -j' may be unsafe
+AAW_EOF
+
+
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # 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_F77="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = 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_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_F77=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_F77=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_F77='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_F77=no
+       cat <<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.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$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_F77=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      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
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_F77='$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].*|aix5*)
+         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_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      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
+         hardcode_direct_F77=yes
+         else
+         # We have old collect2
+         hardcode_direct_F77=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_F77=yes
+         hardcode_libdir_flag_spec_F77='-L$libdir'
+         hardcode_libdir_separator_F77=
+         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
+
+      # 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_F77=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_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_f77_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_F77="-z nodefs"
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_f77_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok'
+         allow_undefined_flag_F77=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols_F77=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_F77=' '
+         archive_cmds_need_lc_F77=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$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_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+         hardcode_libdir_separator_F77=:
+         hardcode_direct_F77=no
+         hardcode_shlibpath_var_F77=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec_F77='-L$libdir'
+         hardcode_direct_F77=no
+         hardcode_shlibpath_var_F77=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_F77=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator_F77=:
+         hardcode_direct_F77=yes
+         export_dynamic_flag_spec_F77='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_F77=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_F77='-R$libdir'
+          ;;
+        *)
+          archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_F77=' -expect_unresolved \*'
+       archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "x$archive_cmds" = "x"; then
+        if test "$GCC" = yes; then
+         wlarc='${wl}'
+         if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+           archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+         else
+           archive_cmds_F77='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+          fi
+        else
+         wlarc=''
+          lt_prog_compiler_static_F77='-static'
+         archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds_F77='$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'
+          lt_prog_compiler_static_F77='-static'
+       fi
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_F77='$CC -r -o $output$reload_objs'
+         hardcode_direct_F77=no
+        ;;
+       motorola)
+         archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_F77=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_F77=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_F77='$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'
+      hardcode_libdir_flag_spec_F77=
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = 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
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_F77=no
+        else
+         archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # 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.
+    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
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+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
+  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'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  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*)
+  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=`$echo "X$lib" | $Xsed -e '\''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'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  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*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    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="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        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
+      ;;
+    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
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # 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}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-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='GNU ld.so'
+  ;;
+
+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[123]*) 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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+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
+  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'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       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 Linux ELF.
+linux*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-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'
+  ;;
 
+knetbsd*-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='GNU ld.so'
+  ;;
 
-fi
+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
+  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
+  ;;
 
-fi
+nto-qnx*)
+  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=yes
+  ;;
 
-    ;;
+openbsd*)
+  version_type=sunos
+  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
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
+  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
-    enable_dlopen=no
+    shlibpath_overrides_runpath=yes
   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"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+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
+  ;;
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+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"
+  ;;
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
-#line 37526 "configure"
-#include "confdefs.h"
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
 
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
 
-#include <stdio.h>
+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
+  ;;
 
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL          RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL                DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL                0
-#  endif
-#endif
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
 
-/* 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
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    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
+  ;;
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
+uts4*)
+  version_type=linux
+  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
+  ;;
 
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
 
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
   fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
 fi
-rm -fr conftest*
-
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
 
+if test "$hardcode_action_F77" = relink; 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
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 37624 "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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=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;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
+# 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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
     ;;
   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
 
 
+
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
 # with your package, and you will get complaints that there are
@@ -37747,51 +44281,51 @@ if test -f "$ltmain"; then
     lt_cv_sys_global_symbol_to_c_name_address \
     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
     old_postinstall_cmds old_postuninstall_cmds \
-    compiler_GCJ \
-    CC_GCJ \
-    LD_GCJ \
-    lt_prog_compiler_wl_GCJ \
-    lt_prog_compiler_pic_GCJ \
-    lt_prog_compiler_static_GCJ \
-    lt_prog_compiler_no_builtin_flag_GCJ \
-    export_dynamic_flag_spec_GCJ \
-    thread_safe_flag_spec_GCJ \
-    whole_archive_flag_spec_GCJ \
-    enable_shared_with_static_runtimes_GCJ \
-    old_archive_cmds_GCJ \
-    old_archive_from_new_cmds_GCJ \
-    predep_objects_GCJ \
-    postdep_objects_GCJ \
-    predeps_GCJ \
-    postdeps_GCJ \
-    compiler_lib_search_path_GCJ \
-    archive_cmds_GCJ \
-    archive_expsym_cmds_GCJ \
-    postinstall_cmds_GCJ \
-    postuninstall_cmds_GCJ \
-    old_archive_from_expsyms_cmds_GCJ \
-    allow_undefined_flag_GCJ \
-    no_undefined_flag_GCJ \
-    export_symbols_cmds_GCJ \
-    hardcode_libdir_flag_spec_GCJ \
-    hardcode_libdir_flag_spec_ld_GCJ \
-    hardcode_libdir_separator_GCJ \
-    hardcode_automatic_GCJ \
-    module_cmds_GCJ \
-    module_expsym_cmds_GCJ \
-    lt_cv_prog_compiler_c_o_GCJ \
-    exclude_expsyms_GCJ \
-    include_expsyms_GCJ; do
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
 
     case $var in
-    old_archive_cmds_GCJ | \
-    old_archive_from_new_cmds_GCJ | \
-    archive_cmds_GCJ | \
-    archive_expsym_cmds_GCJ | \
-    module_cmds_GCJ | \
-    module_expsym_cmds_GCJ | \
-    old_archive_from_expsyms_cmds_GCJ | \
-    export_symbols_cmds_GCJ | \
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
     extract_expsyms_cmds | reload_cmds | finish_cmds | \
     postinstall_cmds | postuninstall_cmds | \
     old_postinstall_cmds | old_postuninstall_cmds | \
@@ -37828,10 +44362,10 @@ build_libtool_libs=$enable_shared
 build_old_libs=$enable_static
 
 # Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+build_libtool_need_lc=$archive_cmds_need_lc_F77
 
 # Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
 
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
@@ -37857,16 +44391,16 @@ AR_FLAGS=$lt_AR_FLAGS
 LTCC=$lt_LTCC
 
 # A language-specific compiler.
-CC=$lt_compiler_GCJ
+CC=$lt_compiler_F77
 
 # Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
+with_gcc=$GCC_F77
 
 # An ERE matcher.
 EGREP=$lt_EGREP
 
 # The linker used to build libraries.
-LD=$lt_LD_GCJ
+LD=$lt_LD_F77
 
 # Whether we need hard or soft links.
 LN_S=$lt_LN_S
@@ -37897,7 +44431,7 @@ reload_flag=$lt_reload_flag
 reload_cmds=$lt_reload_cmds
 
 # How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
+wl=$lt_lt_prog_compiler_wl_F77
 
 # Object file suffix (normally "o").
 objext="$ac_objext"
@@ -37912,14 +44446,14 @@ shrext_cmds='$shrext_cmds'
 exeext="$exeext"
 
 # Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_flag=$lt_lt_prog_compiler_pic_F77
 pic_mode=$pic_mode
 
 # What is the maximum length of a command?
 max_cmd_len=$lt_cv_sys_max_cmd_len
 
 # Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
 
 # Must we lock files when doing compilation?
 need_locks=$lt_need_locks
@@ -37940,19 +44474,19 @@ dlopen_self=$enable_dlopen_self
 dlopen_self_static=$enable_dlopen_self_static
 
 # Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
+link_static_flag=$lt_lt_prog_compiler_static_F77
 
 # Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
 
 # Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
 
 # Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
 
 # Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
 
 # Library versioning type.
 version_type=$version_type
@@ -37969,25 +44503,25 @@ soname_spec=$lt_soname_spec
 
 # Commands used to build and install an old-style archive.
 RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_archive_cmds=$lt_old_archive_cmds_F77
 old_postinstall_cmds=$lt_old_postinstall_cmds
 old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
 # Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
 
 # Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
 
 # Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
 postinstall_cmds=$lt_postinstall_cmds
 postuninstall_cmds=$lt_postuninstall_cmds
 
 # Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
 
 # Commands to strip libraries.
 old_striplib=$lt_old_striplib
@@ -37995,23 +44529,23 @@ striplib=$lt_striplib
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predep_objects=$lt_predep_objects_GCJ
+predep_objects=$lt_predep_objects_F77
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdep_objects=$lt_postdep_objects_GCJ
+postdep_objects=$lt_postdep_objects_F77
 
 # Dependencies to place before the objects being linked to create a
 # shared library.
-predeps=$lt_predeps_GCJ
+predeps=$lt_predeps_F77
 
 # Dependencies to place after the objects being linked to create a
 # shared library.
-postdeps=$lt_postdeps_GCJ
+postdeps=$lt_postdeps_F77
 
 # The library search path used internally by the compiler when linking
 # a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
 
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
@@ -38020,10 +44554,10 @@ deplibs_check_method=$lt_deplibs_check_method
 file_magic_cmd=$lt_file_magic_cmd
 
 # Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+allow_undefined_flag=$lt_allow_undefined_flag_F77
 
 # Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
+no_undefined_flag=$lt_no_undefined_flag_F77
 
 # Commands used to finish a libtool library installation in a directory.
 finish_cmds=$lt_finish_cmds
@@ -38050,45 +44584,45 @@ shlibpath_var=$shlibpath_var
 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
 # How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
+hardcode_action=$hardcode_action_F77
 
 # Whether we should hardcode library paths into libraries.
 hardcode_into_libs=$hardcode_into_libs
 
 # 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_GCJ
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
 
 # If ld is used when linking, flag to hardcode \$libdir into
 # a binary during linking. This must work even if \$libdir does
 # not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
 
 # Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
 
 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
 # resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
+hardcode_direct=$hardcode_direct_F77
 
 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
 # resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
+hardcode_minus_L=$hardcode_minus_L_F77
 
 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
 # the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
 
 # 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_GCJ
+hardcode_automatic=$hardcode_automatic_F77
 
 # Variables whose values should be saved in libtool wrapper scripts and
 # restored at relink time.
 variables_saved_for_relink="$variables_saved_for_relink"
 
 # Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
+link_all_deplibs=$link_all_deplibs_F77
 
 # Compile-time system search path for libraries
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
@@ -38097,22 +44631,22 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
 # Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+fix_srcfile_path="$fix_srcfile_path_F77"
 
 # Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
+always_export_symbols=$always_export_symbols_F77
 
 # The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+export_symbols_cmds=$lt_export_symbols_cmds_F77
 
 # The commands to extract the exported symbol list from a shared archive.
 extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
 # Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
+exclude_expsyms=$lt_exclude_expsyms_F77
 
 # Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
+include_expsyms=$lt_include_expsyms_F77
 
 # ### END LIBTOOL TAG CONFIG: $tagname
 
@@ -38143,22 +44677,22 @@ CC="$lt_save_CC"
        fi
        ;;
 
-      RC)
-
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
 
 
-# Source file extension for RC test sources.
-ac_ext=rc
+# Source file extension for Java test sources.
+ac_ext=java
 
-# Object file extension for compiled RC test sources.
+# Object file extension for compiled Java test sources.
 objext=o
-objext_RC=$objext
+objext_GCJ=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
@@ -38185,1820 +44719,2227 @@ $rm conftest*
 
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # 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
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_RC \
-    CC_RC \
-    LD_RC \
-    lt_prog_compiler_wl_RC \
-    lt_prog_compiler_pic_RC \
-    lt_prog_compiler_static_RC \
-    lt_prog_compiler_no_builtin_flag_RC \
-    export_dynamic_flag_spec_RC \
-    thread_safe_flag_spec_RC \
-    whole_archive_flag_spec_RC \
-    enable_shared_with_static_runtimes_RC \
-    old_archive_cmds_RC \
-    old_archive_from_new_cmds_RC \
-    predep_objects_RC \
-    postdep_objects_RC \
-    predeps_RC \
-    postdeps_RC \
-    compiler_lib_search_path_RC \
-    archive_cmds_RC \
-    archive_expsym_cmds_RC \
-    postinstall_cmds_RC \
-    postuninstall_cmds_RC \
-    old_archive_from_expsyms_cmds_RC \
-    allow_undefined_flag_RC \
-    no_undefined_flag_RC \
-    export_symbols_cmds_RC \
-    hardcode_libdir_flag_spec_RC \
-    hardcode_libdir_flag_spec_ld_RC \
-    hardcode_libdir_separator_RC \
-    hardcode_automatic_RC \
-    module_cmds_RC \
-    module_expsym_cmds_RC \
-    lt_cv_prog_compiler_c_o_RC \
-    exclude_expsyms_RC \
-    include_expsyms_RC; do
-
-    case $var in
-    old_archive_cmds_RC | \
-    old_archive_from_new_cmds_RC | \
-    archive_cmds_RC | \
-    archive_expsym_cmds_RC | \
-    module_cmds_RC | \
-    module_expsym_cmds_RC | \
-    old_archive_from_expsyms_cmds_RC | \
-    export_symbols_cmds_RC | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# 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_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# 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
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
+old_archive_cmds_GCJ=$old_archive_cmds
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_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...
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
+lt_prog_compiler_no_builtin_flag_GCJ=
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
 
-# ### END LIBTOOL TAG CONFIG: $tagname
 
-__EOF__
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$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:44770: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:44774: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
 
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
 else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
+    :
 fi
 
+fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
 
-CC="$lt_save_CC"
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
-       ;;
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
 
-      *)
-       { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-       ;;
-      esac
+    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_GCJ='-Bstatic'
+      fi
+      ;;
 
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
+    amigaos*)
+      # 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_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
 
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-fi
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
 
+    mingw* | pw32* | os2*)
+      # 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_GCJ='-DDLL_EXPORT'
+      ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+    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_GCJ=no
+      enable_shared=no
+      ;;
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
 
-# Prevent multiple expansion
+    hpux*)
+      # 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_GCJ='-fPIC'
+       ;;
+      esac
+      ;;
 
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+       lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
 
+    mingw* | pw32* | os2*)
+      # 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_GCJ='-DDLL_EXPORT'
+      ;;
 
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-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_GCJ='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
 
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
 
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
 
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-KPIC'
+       lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl_GCJ='-Wl,'
+       lt_prog_compiler_pic_GCJ='-fpic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
 
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
 
+    sco3.2v5*)
+      lt_prog_compiler_pic_GCJ='-Kpic'
+      lt_prog_compiler_static_GCJ='-dn'
+      ;;
 
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
 
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
 
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
 
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic_GCJ='-Kconform_pic'
+       lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
 
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
 
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
 
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
 
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
 
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
 
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # 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:45032: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:45036: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
 
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
 
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
 
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
 
-if test $ac_cv_c_compiler_gnu = yes; then
-    echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
-echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
-if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    ac_pattern="Autoconf.*'x'"
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sgtty.h>
-Autoconf TIOCGETP
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "$ac_pattern" >/dev/null 2>&1; then
-  ac_cv_prog_gcc_traditional=yes
-else
-  ac_cv_prog_gcc_traditional=no
-fi
-rm -f conftest*
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$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:45094: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:45098: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=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 ..
+   rmdir conftest
+   $rm conftest*
 
-  if test $ac_cv_prog_gcc_traditional = no; then
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <termio.h>
-Autoconf TCGETA
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "$ac_pattern" >/dev/null 2>&1; then
-  ac_cv_prog_gcc_traditional=yes
 fi
-rm -f conftest*
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
 
-  fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
-echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
-  if test $ac_cv_prog_gcc_traditional = yes; then
-    CC="$CC -traditional"
-  fi
-fi
 
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
 
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
 
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    cat <<AAW_EOF >>config.warnings
+\`$CC' does not support \`-c -o', so \`make -j' may be unsafe
+AAW_EOF
 
-ac_cv_c_const=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    need_locks=warn
+  fi
+else
+  need_locks=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
-fi
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # 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_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # 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.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # 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
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
 
-       echo "$as_me:$LINENO: checking for working unsigned long constants" >&5
-echo $ECHO_N "checking for working unsigned long constants... $ECHO_C" >&6
-if test "${amanda_cv_c_unsigned_long_constants+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
 
-               cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+    # 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_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [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
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
 
-int
-main ()
-{
+*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
 
-                       long l = 1ul;
+EOF
+      fi
+      ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_c_unsigned_long_constants=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    amigaos*)
+      archive_cmds_GCJ='$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_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
 
-amanda_cv_c_unsigned_long_constants=no
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag_GCJ=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
 
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_c_unsigned_long_constants" >&5
-echo "${ECHO_T}$amanda_cv_c_unsigned_long_constants" >&6
-       if test "$amanda_cv_c_unsigned_long_constants" = yes; then
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds_GCJ='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}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UNSIGNED_LONG_CONSTANTS 1
-_ACEOF
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
+       esac
+       archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
+       if test $supports_anon_versioning = yes; then
+         archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
        fi
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
 
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
 
-echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6
-if test "${ac_cv_type_off_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((off_t *) 0)
-  return 0;
-if (sizeof (off_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_off_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_off_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6
-if test $ac_cv_type_off_t = yes; then
-  :
-else
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       ld_shlibs_GCJ=no
+       cat <<EOF 1>&2
 
-cat >>confdefs.h <<_ACEOF
-#define off_t long
-_ACEOF
+*** 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.
 
-fi
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
 
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
-if test "${ac_cv_type_pid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((pid_t *) 0)
-  return 0;
-if (sizeof (pid_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_pid_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
 
-ac_cv_type_pid_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
-if test $ac_cv_type_pid_t = yes; then
-  :
-else
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
 
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$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_GCJ=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct_GCJ=unsupported
+      fi
+      ;;
 
-fi
+    aix4* | aix5*)
+      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
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds_GCJ='$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
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((size_t *) 0)
-  return 0;
-if (sizeof (size_t))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+       # 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].*|aix5*)
+         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
 
-ac_cv_type_size_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
-if test $ac_cv_type_size_t = yes; then
-  :
-else
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
 
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
-_ACEOF
+      # 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.
 
-fi
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
 
+      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
+         hardcode_direct_GCJ=yes
+         else
+         # We have old collect2
+         hardcode_direct_GCJ=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_GCJ=yes
+         hardcode_libdir_flag_spec_GCJ='-L$libdir'
+         hardcode_libdir_separator_GCJ=
+         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
 
-echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
-echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
-if test "${ac_cv_type_uid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+      # 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_GCJ=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_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "uid_t" >/dev/null 2>&1; then
-  ac_cv_type_uid_t=yes
-else
-  ac_cv_type_uid_t=no
-fi
-rm -f conftest*
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
-echo "${ECHO_T}$ac_cv_type_uid_t" >&6
-if test $ac_cv_type_uid_t = no; then
+int
+main ()
+{
 
-cat >>confdefs.h <<\_ACEOF
-#define uid_t int
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
 
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
-#define gid_t int
-_ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-if test "${ac_cv_type_signal+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+       archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag_GCJ="-z nodefs"
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
 
 int
 main ()
 {
-int i;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_signal=void
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_signal=int
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
 
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok'
+         allow_undefined_flag_GCJ=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         always_export_symbols_GCJ=yes
+         # Exported symbols can be pulled into shared objects from archives
+         whole_archive_flag_spec_GCJ=' '
+         archive_cmds_need_lc_GCJ=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$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_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # 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.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*|ia64*)
+         archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+         hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+         hardcode_libdir_separator_GCJ=:
+         hardcode_direct_GCJ=no
+         hardcode_shlibpath_var_GCJ=no
+         ;;
+       ia64*)
+         hardcode_libdir_flag_spec_GCJ='-L$libdir'
+         hardcode_direct_GCJ=no
+         hardcode_shlibpath_var_GCJ=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_GCJ=yes
+         ;;
+       *)
+         hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator_GCJ=:
+         hardcode_direct_GCJ=yes
+         export_dynamic_flag_spec_GCJ='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L_GCJ=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+        openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+          archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          hardcode_libdir_flag_spec_GCJ='-R$libdir'
+          ;;
+        *)
+          archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag_GCJ=' -expect_unresolved \*'
+       archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    sco3.2v5*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "x$archive_cmds" = "x"; then
+        if test "$GCC" = yes; then
+         wlarc='${wl}'
+         if $CC -v --help 2>/dev/null | grep -- -shared  > /dev/null 2> /dev/null; then
+           archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+         else
+           archive_cmds_GCJ='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+           $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+          fi
+        else
+         wlarc=''
+          lt_prog_compiler_static_GCJ='-static'
+         archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds_GCJ='$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'
+          lt_prog_compiler_static_GCJ='-static'
+       fi
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+       *)
+         whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+         hardcode_direct_GCJ=no
+        ;;
+       motorola)
+         archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var_GCJ=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv5*)
+      no_undefined_flag_GCJ=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      archive_expsym_cmds_GCJ='$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'
+      hardcode_libdir_flag_spec_GCJ=
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = 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
 
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
 
-echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
-if test "${ac_cv_struct_tm+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <time.h>
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ 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.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-int
-main ()
-{
-struct tm *tp; tp->tm_sec;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_struct_tm=time.h
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_struct_tm=sys/time.h
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6
-if test $ac_cv_struct_tm = sys/time.h; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TM_IN_SYS_TIME 1
-_ACEOF
-
-fi
-
-for ac_prog in flex lex
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LEX"; then
-  ac_cv_prog_LEX="$LEX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LEX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+  (exit $ac_status); }
+        then
+         archive_cmds_need_lc_GCJ=no
+        else
+         archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
+      ;;
+    esac
   fi
-done
-done
+  ;;
+esac
 
-fi
-fi
-LEX=$ac_cv_prog_LEX
-if test -n "$LEX"; then
-  echo "$as_me:$LINENO: result: $LEX" >&5
-echo "${ECHO_T}$LEX" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+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"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # 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.
+    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
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
 
-  test -n "$LEX" && break
-done
-test -n "$LEX" || LEX=":"
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
 
-if test -z "$LEXLIB"
-then
-  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
-echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
-if test "${ac_cv_lib_fl_yywrap+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char yywrap ();
-int
-main ()
-{
-yywrap ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_fl_yywrap=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
 
-ac_cv_lib_fl_yywrap=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
-if test $ac_cv_lib_fl_yywrap = yes; then
-  LEXLIB="-lfl"
-else
-  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
-echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
-if test "${ac_cv_lib_l_yywrap+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ll  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+aix4* | aix5*)
+  version_type=linux
+  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
+  ;;
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char yywrap ();
-int
-main ()
-{
-yywrap ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_l_yywrap=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+amigaos*)
+  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=`$echo "X$lib" | $Xsed -e '\''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'
+  ;;
 
-ac_cv_lib_l_yywrap=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
-echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
-if test $ac_cv_lib_l_yywrap = yes; then
-  LEXLIB="-ll"
-fi
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
 
-fi
+bsdi[45]*)
+  version_type=linux
+  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
+  ;;
 
-fi
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
 
-if test "x$LEX" != "x:"; then
-  echo "$as_me:$LINENO: checking lex output file root" >&5
-echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
-if test "${ac_cv_prog_lex_root+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # The minimal lex program is just a single line: %%.  But some broken lexes
-# (Solaris, I think it was) want two %% lines, so accommodate them.
-cat >conftest.l <<_ACEOF
-%%
-%%
-_ACEOF
-{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
-  (eval $LEX conftest.l) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-if test -f lex.yy.c; then
-  ac_cv_prog_lex_root=lex.yy
-elif test -f lexyy.c; then
-  ac_cv_prog_lex_root=lexyy
-else
-  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
-echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
-rm -f conftest.l
-LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    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'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
 
-echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
-echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
-if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # POSIX says lex can declare yytext either as a pointer or an array; the
-# default is implementation-dependent. Figure out which it is, since
-# not all implementations provide the %pointer and %array declarations.
-ac_cv_prog_lex_yytext_pointer=no
-echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
-ac_save_LIBS=$LIBS
-LIBS="$LIBS $LEXLIB"
-cat >conftest.$ac_ext <<_ACEOF
-`cat $LEX_OUTPUT_ROOT.c`
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_lex_yytext_pointer=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    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="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        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
+      ;;
+    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
+    ;;
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_save_LIBS
-rm -f "${LEX_OUTPUT_ROOT}.c"
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
-echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
-if test $ac_cv_prog_lex_yytext_pointer = yes; then
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${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`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
 
-cat >>confdefs.h <<\_ACEOF
-#define YYTEXT_POINTER 1
-_ACEOF
+dgux*)
+  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
+  ;;
 
-fi
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-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='GNU ld.so'
+  ;;
+
+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[123]*) 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
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
 
-fi
-if test "$LEX" = :; then
-  LEX=${am_missing_run}flex
-fi
+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
+  hardcode_into_libs=yes
+  ;;
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
+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'
+  ;;
 
-int
-main ()
-{
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       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
+  ;;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
 
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# This must be Linux ELF.
+linux*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # 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
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
+  # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-_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*
+  # 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'
+  ;;
 
-fi
+knetbsd*-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='GNU ld.so'
+  ;;
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
+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
+  ;;
 
-_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*
+newsos6)
+  version_type=linux
+  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
+  ;;
 
-fi
+nto-qnx*)
+  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=yes
+  ;;
 
-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 >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.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
+openbsd*)
+  version_type=sunos
+  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
+  ;;
 
-#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))
-      exit(2);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+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
+  ;;
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
+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"
+  ;;
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+sco3.2v5*)
+  version_type=osf
+  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
+  ;;
 
-fi
+solaris*)
+  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=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.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  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
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      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
+  ;;
 
-echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
-if test "${ac_cv_type_socklen_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  ac_cv_type_socklen_t=yes
-else
-  ac_cv_type_socklen_t=no
-fi
-rm -f conftest*
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    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
+  ;;
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
-if test "x$ac_cv_type_socklen_t" = xno; then
+uts4*)
+  version_type=linux
+  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
+  ;;
 
-cat >>confdefs.h <<\_ACEOF
-#define socklen_t int
-_ACEOF
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
 
-fi
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
-echo "$as_me:$LINENO: checking for sa_family_t" >&5
-echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6
-if test "${ac_cv_type_sa_family_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "(^|[^a-zA-Z_0-9])sa_family_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  ac_cv_type_sa_family_t=yes
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
 else
-  ac_cv_type_sa_family_t=no
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
 fi
-rm -f conftest*
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
 
+if test "$hardcode_action_GCJ" = relink; 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
-echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
-echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6
-if test "x$ac_cv_type_sa_family_t" = xno; then
-
-cat >>confdefs.h <<\_ACEOF
-#define sa_family_t unsigned short
-_ACEOF
 
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}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"
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+       ;;
+   *)
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
 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*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
 
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
 
-
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
-  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  darwin*)
+  # if libdl is installed we need to link against it
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <$ac_hdr>
 
+/* 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 ()
 {
-if ((DIR *) 0)
-return 0;
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+       ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
-_ACEOF
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
 
-ac_header_dirent=$ac_hdr; break
 fi
 
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
-if test "${ac_cv_search_opendir+set}" = set; then
+   ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in dir; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+#undef shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
+char shl_load ();
+/* 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_shl_load || defined __stub___shl_load
+choke me
+#endif
+
 int
 main ()
 {
-opendir ();
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_func_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
 else
-  echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
-if test "${ac_cv_search_opendir+set}" = set; then
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_opendir=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -40006,276 +46947,59 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="none required"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_opendir" = no; then
-  for ac_lib in x; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char opendir ();
+char shl_load ();
 int
 main ()
 {
-opendir ();
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_opendir="-l$ac_lib"
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6
-if test "$ac_cv_search_opendir" != no; then
-  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
-
-fi
-
-fi
-
-
-
-
-
-for ac_header in sys/wait.h wait.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
+       ac_cv_lib_dld_shl_load=no
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-echo "$as_me:$LINENO: checking whether wait uses union wait" >&5
-echo $ECHO_N "checking whether wait uses union wait... $ECHO_C" >&6
-if test "${cf_cv_arg_union_wait+set}" = set; then
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -40284,4239 +47008,3197 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
 
-#include <sys/types.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
+#ifdef __STDC__
+# include <limits.h>
 #else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
+# include <assert.h>
 #endif
 
-#ifdef __STDC__
-pid_t wait(union wait *);
+#undef dlopen
+
+/* 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 ();
+/* 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_dlopen || defined __stub___dlopen
+choke me
 #endif
 
 int
 main ()
 {
-
-  union wait x; int i;
-  wait(&x); i = WIFEXITED(x)
-
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_arg_union_wait=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cf_cv_arg_union_wait=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5
-echo "${ECHO_T}$cf_cv_arg_union_wait" >&6
-if test $cf_cv_arg_union_wait = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WAIT_USES_UNION 1
-_ACEOF
-
+       ac_cv_func_dlopen=no
 fi
 
-
-
-
-
-for ac_header in sys/wait.h wait.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&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 dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_lib_dl_dlopen=no
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-done
-
-echo "$as_me:$LINENO: checking whether wait uses int" >&5
-echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6
-if test "${cf_cv_arg_int+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
-
-#ifdef __STDC__
-pid_t wait(int *);
+/* 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 ()
 {
-
-  int x; int i;
-  wait(&x); i = WIFEXITED(x)
-
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_arg_int=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cf_cv_arg_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       ac_cv_lib_svld_dlopen=no
 fi
-echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5
-echo "${ECHO_T}$cf_cv_arg_int" >&6
-if test $cf_cv_arg_int = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define WAIT_USES_INT 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
-if test "${ac_cv_header_time+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.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 ()
 {
-if ((struct tm *) 0)
-return 0;
+return dld_link ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+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"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
+#line 47323 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
+#line 47421 "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
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=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;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_time=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  (exit $ac_status); } && 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$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
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# 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
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-ac_cv_header_time=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
-if test $ac_cv_header_time = yes; then
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
+# Used on cygwin: assembler.
+AS="$AS"
 
-fi
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
 
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
+# Old archive suffix (normally "a").
+libext="$libext"
 
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
+# Executable file suffix (normally "").
+exeext="$exeext"
 
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
 
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
+# 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
 
+# 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
 
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
 
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
 
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
 
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
 
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
 
+# Library versioning type.
+version_type=$version_type
 
+# 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
 
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
 
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
 
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
 
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
 
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
 
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
 
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
 
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
 
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
 
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
 
+# 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
 
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
 
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
 
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
 
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
 
+# 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
 
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
 
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
 
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
 
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
+# 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_GCJ
 
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
 
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
 
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
 
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
 
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
 
+# 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_GCJ
 
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
 
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
 
+# 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
 
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
 
-for ac_header in \
-       arpa/inet.h \
-       camlib.h \
-       cam/cam.h \
-       cam/scsi/scsi_message.h \
-       chio.h \
-       db.h \
-       dbm.h \
-       fcntl.h \
-       fnmatch.h \
-       fstab.h \
-       grp.h \
-       history.h \
-       libc.h \
-       libgen.h \
-       limits.h \
-       linux/zftape.h \
-       math.h \
-       mntent.h \
-       mnttab.h \
-       ndbm.h \
-       netdb.h \
-       netinet/in_systm.h \
-       readline.h \
-       readline/history.h \
-       readline/readline.h \
-       scsi/sg.h \
-       scsi/scsi_ioctl.h \
-       stdarg.h \
-       stdlib.h \
-       string.h \
-       strings.h \
-       sys/chio.h \
-       sys/dsreq.h \
-       sys/fcntl.h \
-       sys/file.h \
-       sys/ioctl.h \
-       sys/ipc.h \
-       sys/mman.h \
-       sys/mntent.h \
-       sys/mtio.h \
-       sys/param.h \
-       sys/scarray.h \
-       sys/gscdds.h \
-       sys/scsiio.h \
-       sys/scsi.h \
-       sys/scsi/impl/uscsi.h \
-       sys/scsi/scsi/ioctl.h \
-       sys/select.h \
-       sys/shm.h \
-       sys/stat.h \
-       sys/statfs.h \
-       sys/statvfs.h \
-       sys/tape.h \
-       sys/time.h \
-       sys/types.h \
-       sys/uio.h \
-       sys/vfs.h \
-       sys/vfstab.h \
-       syslog.h \
-       unistd.h \
-       vtblc.h \
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
 
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
 
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
 
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-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
 
-done
+CC="$lt_save_CC"
 
+       else
+         tagname=""
+       fi
+       ;;
 
+      RC)
 
-for ac_header in netinet/ip.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/socket.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#include <netinet/in.h>
 
+# Source file extension for RC test sources.
+ac_ext=rc
 
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
 
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
-fi
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
 
-done
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
-for ac_header in sys/mount.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # 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
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
 
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
 
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+cfgfile="$ofile"
 
-fi
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
 
-done
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-NO_SCSI_CHANGER_MODE=true
-NO_CHIO_CHANGER_MODE=true
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
-echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
-if test "${ac_cv_c_bigendian+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
-int
-main ()
-{
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
 
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-ac_cv_c_bigendian=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
-# It does not; compile a test program.
-if test "$cross_compiling" = yes; then
-  # try to guess the endianness by grepping values into an object file
-  ac_cv_c_bigendian=unknown
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-  ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-  if test "$ac_cv_c_bigendian" = unknown; then
-    ac_cv_c_bigendian=no
-  else
-    # finding both strings is unlikely to happen, but who knows?
-    ac_cv_c_bigendian=unknown
-  fi
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-int
-main ()
-{
-  /* Are we little or big endian?  From Harbison&Steele.  */
-  union
-  {
-    long l;
-    char c[sizeof (long)];
-  } u;
-  u.l = 1;
-  exit (u.c[sizeof (long) - 1] == 1);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=no
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
 
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-case $ac_cv_c_bigendian in
-  yes)
+# A C compiler.
+LTCC=$lt_LTCC
 
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
-  no)
-     ;;
-  *)
-    { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+# A language-specific compiler.
+CC=$lt_compiler_RC
 
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
 
-if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-    echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5
-echo $ECHO_N "checking for HP/UX-like scsi changer support... $ECHO_C" >&6
-if test "${amanda_cv_hpux_scsi_chio+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-#include <sys/scsi.h>
+# The linker used to build libraries.
+LD=$lt_LD_RC
 
-int
-main ()
-{
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
 
-       static struct element_addresses changer_info;
-       int i = SIOC_ELEMENT_ADDRESSES;
-       int j = SIOC_ELEMENT_STATUS;
-       int k = SIOC_MOVE_MEDIUM;
+# A BSD-compatible nm program.
+NM=$lt_NM
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_hpux_scsi_chio=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# A symbol stripping program
+STRIP=$lt_STRIP
 
-amanda_cv_hpux_scsi_chio=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5
-echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6
-    if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_HPUX_SCSI_CHIO 1
-_ACEOF
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-       NO_SCSI_CHANGER_MODE=false
-    fi
-fi
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5
-echo $ECHO_N "checking for Linux like scsi support (ioctl)... $ECHO_C" >&6
-if test "${amanda_cv_linux_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Used on cygwin: assembler.
+AS="$AS"
 
-#include <scsi/scsi_ioctl.h>
-#include <sys/mtio.h>
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-int
-main ()
-{
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-       int device;
-       char *Command;
-       ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_linux_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
-amanda_cv_linux_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5
-echo "${ECHO_T}$amanda_cv_linux_scsi" >&6
-fi
+# Old archive suffix (normally "a").
+libext="$libext"
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_scsi_sg_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5
-echo $ECHO_N "checking for Linux like scsi support (sg)... $ECHO_C" >&6
-if test "${amanda_cv_linux_sg_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
-#include <sys/types.h>
-#include <scsi/sg.h>
-#include <sys/mtio.h>
+# Executable file suffix (normally "").
+exeext="$exeext"
 
-int
-main ()
-{
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
 
-       int device;
-       struct sg_header *psg_header;
-       char *buffer;
-       write(device, buffer, 1);
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_linux_sg_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-amanda_cv_linux_sg_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5
-echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6
-fi
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
-if test x"$amanda_cv_linux_scsi" = x"yes" ||
- test x"$amanda_cv_linux_sg_scsi" = x"yes";then
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LINUX_LIKE_SCSI 1
-_ACEOF
+# Do we need a version for libraries?
+need_version=$need_version
 
-       NO_SCSI_CHANGER_MODE=false
-fi
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5
-echo $ECHO_N "checking for HP-UX like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_hpux_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
 
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/scsi.h>
-#include <sys/mtio.h>
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
 
-int
-main ()
-{
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
 
-       int device;
-       char *Command;
-       ioctl(device, SIOC_IO, Command);
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_hpux_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
 
-amanda_cv_hpux_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5
-echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6
-       if test x"$amanda_cv_hpux_scsi" = x"yes";then
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_HPUX_LIKE_SCSI 1
-_ACEOF
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
 
-               NO_SCSI_CHANGER_MODE=false
-               NO_CHIO_CHANGER_MODE=false
-       fi
-fi
+# Library versioning type.
+version_type=$version_type
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for Irix like scsi support" >&5
-echo $ECHO_N "checking for Irix like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_irix_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
 
-#include <sys/types.h>
-#include <sys/dsreq.h>
-#include <sys/mtio.h>
+# 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
 
-int
-main ()
-{
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
 
-       int device=1;
-       char Command;
-       ioctl(device, DS_ENTER, &Command);
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_irix_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
 
-amanda_cv_irix_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5
-echo "${ECHO_T}$amanda_cv_irix_scsi" >&6
-       if test x"$amanda_cv_irix_scsi" = x"yes";then
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_IRIX_LIKE_SCSI 1
-_ACEOF
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
 
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5
-echo $ECHO_N "checking for Solaris-like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_solaris_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
 
-#include <sys/types.h>
-#include <sys/scsi/impl/uscsi.h>
-#include <sys/mtio.h>
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
 
-int
-main ()
-{
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
 
-       int device;
-       char *Command;
-       ioctl(device, USCSICMD, Command);
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_solaris_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
 
-amanda_cv_solaris_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5
-echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6
-       if test x"$amanda_cv_solaris_scsi" = x"yes";then
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOLARIS_LIKE_SCSI 1
-_ACEOF
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
 
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
 
-if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
-   test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then
-       echo "$as_me:$LINENO: checking for AIX like scsi support" >&5
-echo $ECHO_N "checking for AIX like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_aix_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
 
-#include <sys/types.h>
-#include <sys/scarray.h>
-#include <sys/tape.h>
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
 
-int
-main ()
-{
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
 
-       int device;
-       char *Command;
-       ioctl(device, STIOCMD, Command);
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_aix_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# 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
 
-amanda_cv_aix_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5
-echo "${ECHO_T}$amanda_cv_aix_scsi" >&6
-       if test x"$amanda_cv_aix_scsi" = x"yes";then
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AIX_LIKE_SCSI 1
-_ACEOF
+# 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
 
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
-if test x"$ac_cv_header_cam_cam_h" = x"yes";then
-       echo "$as_me:$LINENO: checking for CAM like scsi support" >&5
-echo $ECHO_N "checking for CAM like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_cam_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
 
-#include <stdio.h>
-# include <fcntl.h>
-# include <cam/cam.h>
-# include <cam/cam_ccb.h>
-# include <cam/scsi/scsi_message.h>
-# include <cam/scsi/scsi_pass.h>
-# include <camlib.h>
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
 
-int
-main ()
-{
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
 
-       struct cam_device *curdev;
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
 
-       curdev = cam_open_pass("", O_RDWR, NULL);
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_cam_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# 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_RC
 
-amanda_cv_cam_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5
-echo "${ECHO_T}$amanda_cv_cam_scsi" >&6
-       if test x"$amanda_cv_cam_scsi" = x"yes";then
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CAM_LIKE_SCSI 1
-_ACEOF
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
 
-               NO_SCSI_CHANGER_MODE=false
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
 
-echo "$as_me:$LINENO: checking for main in -lcam" >&5
-echo $ECHO_N "checking for main in -lcam... $ECHO_C" >&6
-if test "${ac_cv_lib_cam_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcam  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
 
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_cam_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# 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_RC
 
-ac_cv_lib_cam_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5
-echo "${ECHO_T}$ac_cv_lib_cam_main" >&6
-if test $ac_cv_lib_cam_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCAM 1
-_ACEOF
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
 
-  LIBS="-lcam $LIBS"
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
 
-fi
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-       fi
-fi
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
 
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
-    echo "$as_me:$LINENO: checking for BSD like scsi support" >&5
-echo $ECHO_N "checking for BSD like scsi support... $ECHO_C" >&6
-if test "${amanda_cv_bsd_scsi+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
 
-#include <sys/types.h>
-#include <sys/scsiio.h>
-#include <sys/mtio.h>
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
 
-int
-main ()
-{
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-    int device=1;
-    char Command;
-    ioctl(device, SCIOCCOMMAND, &Command);
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_bsd_scsi=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
 
-amanda_cv_bsd_scsi=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5
-echo "${ECHO_T}$amanda_cv_bsd_scsi" >&6
-    if test x"$amanda_cv_bsd_scsi" = x"yes";then
+# ### END LIBTOOL TAG CONFIG: $tagname
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BSD_LIKE_SCSI 1
-_ACEOF
+__EOF__
 
-       NO_SCSI_CHANGER_MODE=false
-    fi
-fi
 
-if test x"$ac_cv_header_chio_h" = x"yes" ||
-   test x"$ac_cv_header_sys_chio_h" = x"yes"; then
-         if test x"$ac_cv_header_camlib_h" != x"yes"; then
-     if $NO_SCSI_CHANGER_MODE; then
-       NO_SCSI_CHANGER_MODE=false
-     else
-       NO_CHIO_CHANGER_MODE=false
-     fi
-   fi
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
 fi
 
 
-echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5
-echo $ECHO_N "checking for main in -lcur_colr... $ECHO_C" >&6
-if test "${ac_cv_lib_cur_colr_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcur_colr  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.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
 
+CC="$lt_save_CC"
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_cur_colr_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+       ;;
 
-ac_cv_lib_cur_colr_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5
-echo "${ECHO_T}$ac_cv_lib_cur_colr_main" >&6
-if test $ac_cv_lib_cur_colr_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCUR_COLR 1
-_ACEOF
+      *)
+       { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+       ;;
+      esac
 
-  LIBS="-lcur_colr $LIBS"
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
 
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 fi
 
 
 
-echo "$as_me:$LINENO: checking for main in -lintl" >&5
-echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_intl_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Prevent multiple expansion
 
-ac_cv_lib_intl_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_main" >&6
-if test $ac_cv_lib_intl_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBINTL 1
-_ACEOF
 
-  LIBS="-lintl $LIBS"
 
-fi
 
 
-case "$target" in
-    *sgi-irix*)
 
-echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_socket_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_socket_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
-if test $ac_cv_lib_socket_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
 
-  LIBS="-lsocket $LIBS"
 
-fi
 
-                       ;;
-    *)
 
-echo "$as_me:$LINENO: checking for main in -lresolv" >&5
-echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6
-if test "${ac_cv_lib_resolv_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_resolv_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_resolv_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6
-if test $ac_cv_lib_resolv_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
 
-  LIBS="-lresolv $LIBS"
 
-fi
 
 
-echo "$as_me:$LINENO: checking for main in -lnsl" >&5
-echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
 
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    # Check whether --enable-static-binary was given.
+if test "${enable_static_binary+set}" = set; then
+  enableval=$enable_static_binary;
+           case "$withval" in
+           "" | y | ye | yes)
+               AMANDA_STATIC_LDFLAGS=-static
+               if test x"$enable_static" = x"no"; then
+                       { { echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5
+echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;}
+   { (exit 1); exit 1; }; }
+               fi
+               ;;
+           *n | no)
+               AMANDA_STATIC_LDFLAGS=
+               ;;
+           esac
 
-ac_cv_lib_nsl_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
-if test $ac_cv_lib_nsl_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
 
-  LIBS="-lnsl $LIBS"
 
-fi
 
 
-echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_main+set}" = set; then
+#
+# headers
+#
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
 int
 main ()
 {
-main ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_socket_main=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_socket_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
-if test $ac_cv_lib_socket_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
-  LIBS="-lsocket $LIBS"
-
+       ac_cv_header_stdc=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-echo "$as_me:$LINENO: checking for main in -lsun" >&5
-echo $ECHO_N "checking for main in -lsun... $ECHO_C" >&6
-if test "${ac_cv_lib_sun_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsun  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <string.h>
 
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_sun_main=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_sun_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  ac_cv_header_stdc=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5
-echo "${ECHO_T}$ac_cv_lib_sun_main" >&6
-if test $ac_cv_lib_sun_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSUN 1
-_ACEOF
-
-  LIBS="-lsun $LIBS"
+rm -f conftest*
 
 fi
 
-                       ;;
-esac
-
-
-echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5
-echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6
-if test "${ac_cv_lib_termcap_tgetent+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltermcap  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <stdlib.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char tgetent ();
-int
-main ()
-{
-tgetent ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_termcap_tgetent=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_termcap_tgetent=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  ac_cv_header_stdc=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
-echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6
-if test $ac_cv_lib_termcap_tgetent = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBTERMCAP 1
-_ACEOF
-
-  LIBS="-ltermcap $LIBS"
+rm -f conftest*
 
 fi
 
-if test "x$ac_cv_lib_termcap_tgetent" != xyes; then
-
-echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5
-echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6
-if test "${ac_cv_lib_curses_tgetent+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+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
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurses  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char tgetent ();
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-tgetent ();
-  ;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_curses_tgetent=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_curses_tgetent=no
+( exit $ac_status )
+ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5
-echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6
-if test $ac_cv_lib_curses_tgetent = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCURSES 1
-_ACEOF
 
-  LIBS="-lcurses $LIBS"
 
 fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
-    if test "x$ac_cv_lib_curses_tgetent" != xyes; then
+fi
 
-echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5
-echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6
-if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char tgetent ();
 int
 main ()
 {
-tgetent ();
+if ((struct tm *) 0)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_ncurses_tgetent=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_time=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ncurses_tgetent=no
+       ac_cv_header_time=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
-echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6
-if test $ac_cv_lib_ncurses_tgetent = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNCURSES 1
-_ACEOF
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
 
-  LIBS="-lncurses $LIBS"
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
 
 fi
 
-    fi
-fi
-if test "x$ac_cv_lib_termcap_tgetent" = xyes ||
-   test "x$ac_cv_lib_curses_tgetent" = xyes ||
-   test "x$ac_cv_lib_ncurses_tgetent" = xyes; then
 
-echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
-echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6
-if test "${ac_cv_lib_readline_readline+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in arpa/inet.h \
+       grp.h \
+       libc.h \
+       libgen.h \
+       limits.h \
+       math.h \
+       netdb.h \
+       netinet/in.h \
+       stdarg.h \
+       stdlib.h \
+       string.h \
+       strings.h \
+       sys/file.h \
+       sys/ioctl.h \
+       sys/ipc.h \
+       sys/mntent.h \
+       sys/param.h \
+       sys/select.h \
+       sys/stat.h \
+       sys/shm.h \
+       sys/time.h \
+       sys/types.h \
+       sys/uio.h \
+       syslog.h \
+       unistd.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline  $LIBS"
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char readline ();
-int
-main ()
-{
-readline ();
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_readline_readline=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_readline_readline=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
-echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6
-if test $ac_cv_lib_readline_readline = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBREADLINE 1
-_ACEOF
-
-  LIBS="-lreadline $LIBS"
-
-fi
-
-    if test "x$ac_cv_lib_readline_readline" = xyes; then
-       READLINE_LIBS="-lreadline"
-
-    else
-       { echo "$as_me:$LINENO: WARNING: *** No readline library, no history and command line editing in amrecover!" >&5
-echo "$as_me: WARNING: *** No readline library, no history and command line editing in amrecover!" >&2;}
-    fi
-else
-    { echo "$as_me:$LINENO: WARNING: *** No terminal library, no history and command line editing in amrecover!" >&5
-echo "$as_me: WARNING: *** No terminal library, no history and command line editing in amrecover!" >&2;}
+       ac_header_compiler=no
 fi
 
-if test "x$ac_cv_header_linux_zftape_h" = xyes; then
-    if test "x$ac_cv_header_vtblc_h" = xyes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-echo "$as_me:$LINENO: checking for main in -lvtblc" >&5
-echo $ECHO_N "checking for main in -lvtblc... $ECHO_C" >&6
-if test "${ac_cv_lib_vtblc_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvtblc  $LIBS"
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_vtblc_main=yes
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_vtblc_main=no
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_vtblc_main" >&5
-echo "${ECHO_T}$ac_cv_lib_vtblc_main" >&6
-if test $ac_cv_lib_vtblc_main = yes; then
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBVTBLC 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-  LIBS="-lvtblc $LIBS"
-
 fi
 
-        if test "x$ac_cv_lib_vtblc_main" != xyes; then
-            { echo "$as_me:$LINENO: WARNING: *** vtblc library not found - no QIC volume table support!" >&5
-echo "$as_me: WARNING: *** vtblc library not found - no QIC volume table support!" >&2;}
-        fi
-    else
-        { echo "$as_me:$LINENO: WARNING: *** vtblc headers not found - no QIC volume table support!" >&5
-echo "$as_me: WARNING: *** vtblc headers not found - no QIC volume table support!" >&2;}
-    fi
-fi
+done
 
 
-echo "$as_me:$LINENO: checking for modf in -lm" >&5
-echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_modf+set}" = set; then
+#
+# Types
+#
+{ echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
+echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; }
+    if test "${ac_cv_has_sockaddr_storage+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char modf ();
+#      include <sys/types.h>
+#      include <sys/socket.h>
 int
 main ()
 {
-modf ();
+u_int i = sizeof (struct sockaddr_storage)
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_m_modf=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_has_sockaddr_storage=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_m_modf=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+       ac_cv_has_sockaddr_storage=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5
-echo "${ECHO_T}$ac_cv_lib_m_modf" >&6
-if test $ac_cv_lib_m_modf = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
-  LIBS="-lm $LIBS"
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
+    { echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
+echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; }
+    if test $ac_cv_has_sockaddr_storage = yes ; then
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_STORAGE 1
+_ACEOF
 
-echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5
-echo $ECHO_N "checking for mt_flags mtget structure element... $ECHO_C" >&6
-mt_flags_result="found"
-cat >conftest.$ac_ext <<_ACEOF
+    fi
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-
+$ac_includes_default
+typedef int ac__type_new_;
 int
 main ()
 {
-
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_flags;
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_FLAGS 1
-_ACEOF
-
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_int=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-mt_flags_result="not found"
+       ac_cv_type_int=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $mt_flags_result" >&5
-echo "${ECHO_T}$mt_flags_result" >&6
 
-echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5
-echo $ECHO_N "checking for mt_fileno mtget structure element... $ECHO_C" >&6
-mt_fileno_result="found"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-
+$ac_includes_default
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
-
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_fileno;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_FILENO 1
-_ACEOF
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-mt_fileno_result="not found"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $mt_fileno_result" >&5
-echo "${ECHO_T}$mt_fileno_result" >&6
-
-echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5
-echo $ECHO_N "checking for mt_blkno mtget structure element... $ECHO_C" >&6
-mt_blkno_result="found"
-cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-
+$ac_includes_default
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
-
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_blkno;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_BLKNO 1
-_ACEOF
-
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-mt_blkno_result="not found"
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $mt_blkno_result" >&5
-echo "${ECHO_T}$mt_blkno_result" >&6
 
-echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5
-echo $ECHO_N "checking for mt_dsreg mtget structure element... $ECHO_C" >&6
-mt_dsreg_result="found"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-
+$ac_includes_default
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
-
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_dsreg;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_DSREG 1
-_ACEOF
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-mt_dsreg_result="not found"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $mt_dsreg_result" >&5
-echo "${ECHO_T}$mt_dsreg_result" >&6
-
-echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5
-echo $ECHO_N "checking for mt_erreg mtget structure element... $ECHO_C" >&6
-mt_erreg_result="found"
-cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-
+$ac_includes_default
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
-
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_erreg;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_ERREG 1
-_ACEOF
-
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-mt_erreg_result="not found"
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $mt_erreg_result" >&5
-echo "${ECHO_T}$mt_erreg_result" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-DB_HEADER=
-DB_LIB=
+       ac_lo= ac_hi=
+fi
 
-save_LIBS="$LIBS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-echo "$as_me:$LINENO: checking for dbm_open in -lc" >&5
-echo $ECHO_N "checking for dbm_open in -lc... $ECHO_C" >&6
-if test "${ac_cv_lib_c_dbm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dbm_open ();
+$ac_includes_default
+   typedef int ac__type_sizeof_;
 int
 main ()
 {
-dbm_open ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_c_dbm_open=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_c_dbm_open=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_c_dbm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_c_dbm_open" >&6
-if test $ac_cv_lib_c_dbm_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBC 1
-_ACEOF
-
-  LIBS="-lc $LIBS"
-
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-LIBS="$save_LIBS"
-
-case "$DB_STYLE" in
-    db)
-       if test "x$ac_cv_header_db_h" = xyes; then
-
-echo "$as_me:$LINENO: checking for main in -ldb" >&5
-echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6
-if test "${ac_cv_lib_db_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi ;;
+esac
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
+$ac_includes_default
+   typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
 int
 main ()
 {
-main ();
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_db_main=yes
+  ac_cv_sizeof_int=`cat conftest.val`
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_db_main=no
+( exit $ac_status )
+if test "$ac_cv_type_int" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_int=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5
-echo "${ECHO_T}$ac_cv_lib_db_main" >&6
-if test $ac_cv_lib_db_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDB 1
-_ACEOF
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
 
-  LIBS="-ldb $LIBS"
 
-fi
 
-           if test "x$ac_cv_lib_db_main" = xyes; then
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
 
-echo "$as_me:$LINENO: checking for dbm_open in -ldb" >&5
-echo $ECHO_N "checking for dbm_open in -ldb... $ECHO_C" >&6
-if test "${ac_cv_lib_db_dbm_open+set}" = set; then
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dbm_open ();
+$ac_includes_default
+typedef long ac__type_new_;
 int
 main ()
 {
-dbm_open ();
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_db_dbm_open=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_db_dbm_open=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+       ac_cv_type_long=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_db_dbm_open" >&6
-if test $ac_cv_lib_db_dbm_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDB 1
-_ACEOF
-
-  LIBS="-ldb $LIBS"
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
 
-               if test "x$ac_cv_lib_db_dbm_open" = xyes; then
-                   DB_HEADER=db.h
-                   DB_LIB=db
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** db database library requested but dbm_open not found in -ldb." >&5
-echo "$as_me: WARNING: *** db database library requested but dbm_open not found in -ldb." >&2;}
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=db.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** db library requested but -ldb doesn't exist and dbm_open cannot be found." >&5
-echo "$as_me: WARNING: *** db library requested but -ldb doesn't exist and dbm_open cannot be found." >&2;}
-               fi
-           fi
-       else
-           DB_STYLE=
-           { echo "$as_me:$LINENO: WARNING: *** db database library requested but db.h not found." >&5
-echo "$as_me: WARNING: *** db database library requested but db.h not found." >&2;}
-       fi
-       ;;
-
-    dbm)
-       if test "x$ac_cv_header_dbm_h" = xyes; then
-
-echo "$as_me:$LINENO: checking for main in -ldbm" >&5
-echo $ECHO_N "checking for main in -ldbm... $ECHO_C" >&6
-if test "${ac_cv_lib_dbm_main+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbm  $LIBS"
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
+$ac_includes_default
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
-main ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dbm_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dbm_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_main" >&5
-echo "${ECHO_T}$ac_cv_lib_dbm_main" >&6
-if test $ac_cv_lib_dbm_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDBM 1
-_ACEOF
-
-  LIBS="-ldbm $LIBS"
-
-fi
-
-           if test "x$ac_cv_lib_dbm_main" = xyes; then
-
-echo "$as_me:$LINENO: checking for dbm_open in -ldbm" >&5
-echo $ECHO_N "checking for dbm_open in -ldbm... $ECHO_C" >&6
-if test "${ac_cv_lib_dbm_dbm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dbm_open ();
+$ac_includes_default
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
-dbm_open ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dbm_dbm_open=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dbm_dbm_open=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_dbm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_dbm_dbm_open" >&6
-if test $ac_cv_lib_dbm_dbm_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDBM 1
-_ACEOF
-
-  LIBS="-ldbm $LIBS"
-
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
 
-               if test "x$ac_cv_lib_dbm_dbm_open" = xyes; then
-                   DB_HEADER=dbm.h
-                   DB_LIB=dbm
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** dbm database library requested but dbm_open not found in -ldbm." >&5
-echo "$as_me: WARNING: *** dbm database library requested but dbm_open not found in -ldbm." >&2;}
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=dbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found." >&5
-echo "$as_me: WARNING: *** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found." >&2;}
-               fi
-           fi
-       else
-           DB_STYLE=
-           { echo "$as_me:$LINENO: WARNING: *** dbm database library requested but dbm.h not found." >&5
-echo "$as_me: WARNING: *** dbm database library requested but dbm.h not found." >&2;}
-       fi
-       ;;
-
-    gdbm)
-       if test "x$ac_cv_header_ndbm_h" = xyes; then
-
-echo "$as_me:$LINENO: checking for main in -lgdbm" >&5
-echo $ECHO_N "checking for main in -lgdbm... $ECHO_C" >&6
-if test "${ac_cv_lib_gdbm_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgdbm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
+$ac_includes_default
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
-main ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gdbm_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_gdbm_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_main" >&5
-echo "${ECHO_T}$ac_cv_lib_gdbm_main" >&6
-if test $ac_cv_lib_gdbm_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGDBM 1
-_ACEOF
-
-  LIBS="-lgdbm $LIBS"
-
-fi
-
-           if test "x$ac_cv_lib_gdbm_main" = xyes; then
-
-echo "$as_me:$LINENO: checking for dbm_open in -lgdbm" >&5
-echo $ECHO_N "checking for dbm_open in -lgdbm... $ECHO_C" >&6
-if test "${ac_cv_lib_gdbm_dbm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgdbm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dbm_open ();
+$ac_includes_default
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
-dbm_open ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gdbm_dbm_open=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_gdbm_dbm_open=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_dbm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_gdbm_dbm_open" >&6
-if test $ac_cv_lib_gdbm_dbm_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGDBM 1
-_ACEOF
 
-  LIBS="-lgdbm $LIBS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
 fi
 
-               if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=gdbm
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** gdbm database library requested but -lgdbm not found." >&5
-echo "$as_me: WARNING: *** gdbm database library requested but -lgdbm not found." >&2;}
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found." >&5
-echo "$as_me: WARNING: *** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found." >&2;}
-               fi
-           fi
-       else
-           DB_STYLE=
-           { echo "$as_me:$LINENO: WARNING: *** gdbm database library requested but ndbm.h not found." >&5
-echo "$as_me: WARNING: *** gdbm database library requested but ndbm.h not found." >&2;}
-       fi
-       ;;
-
-    ndbm)
-       if test "x$ac_cv_header_ndbm_h" = xyes; then
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-echo "$as_me:$LINENO: checking for main in -lndbm" >&5
-echo $ECHO_N "checking for main in -lndbm... $ECHO_C" >&6
-if test "${ac_cv_lib_ndbm_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lndbm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
+$ac_includes_default
+   typedef long ac__type_sizeof_;
 int
 main ()
 {
-main ();
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_ndbm_main=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ndbm_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ndbm_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ndbm_main" >&6
-if test $ac_cv_lib_ndbm_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNDBM 1
-_ACEOF
-
-  LIBS="-lndbm $LIBS"
-
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-           if test "x$ac_cv_lib_ndbm_main" = xyes; then
-
-echo "$as_me:$LINENO: checking for dbm_open in -lndbm" >&5
-echo $ECHO_N "checking for dbm_open in -lndbm... $ECHO_C" >&6
-if test "${ac_cv_lib_ndbm_dbm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi ;;
+esac
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lndbm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dbm_open ();
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
 int
 main ()
 {
-dbm_open ();
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ndbm_dbm_open=yes
+  ac_cv_sizeof_long=`cat conftest.val`
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ndbm_dbm_open=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ndbm_dbm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_ndbm_dbm_open" >&6
-if test $ac_cv_lib_ndbm_dbm_open = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNDBM 1
-_ACEOF
-
-  LIBS="-lndbm $LIBS"
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
-               if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=ndbm
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** ndbm database library requested but -lndbm not found." >&5
-echo "$as_me: WARNING: *** ndbm database library requested but -lndbm not found." >&2;}
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   { echo "$as_me:$LINENO: WARNING: *** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found." >&5
-echo "$as_me: WARNING: *** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found." >&2;}
-               fi
-           fi
-       else
-           DB_STYLE=
-           { echo "$as_me:$LINENO: WARNING: *** ndbm database library requested but ndbm.h not found." >&5
-echo "$as_me: WARNING: *** ndbm database library requested but ndbm.h not found." >&2;}
-       fi
-       ;;
-    text)
-       DB_HEADER=
-       DB_LIB=
-       ;;
-esac
-
-
-if test -z "$DB_STYLE"; then
-    DB_STYLE=text
-    DB_HEADER=
-    DB_LIB=
+rm -f conftest.val
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
 
 
-if test "x$DB_STYLE" = xtext; then
 
-cat >>confdefs.h <<\_ACEOF
-#define TEXTDB 1
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
 _ACEOF
 
-else
-    echo "$as_me:$LINENO: checking for database" >&5
-echo $ECHO_N "checking for database... $ECHO_C" >&6
-    echo "$as_me:$LINENO: result: header is $DB_HEADER, linking against -l$DB_LIB" >&5
-echo "${ECHO_T}header is $DB_HEADER, linking against -l$DB_LIB" >&6
-    case "$DB_STYLE" in
-       db)
-cat >>confdefs.h <<\_ACEOF
-#define USE_DB_H 1
-_ACEOF
-   ;;
-       dbm)
-cat >>confdefs.h <<\_ACEOF
-#define USE_DBM_H 1
-_ACEOF
-  ;;
-       gdbm)
-cat >>confdefs.h <<\_ACEOF
-#define USE_GDBM_H 1
-_ACEOF
- ;;
-       ndbm)
-cat >>confdefs.h <<\_ACEOF
-#define USE_NDBM_H 1
-_ACEOF
- ;;
-    esac
 
-    echo "$as_me:$LINENO: checking for struct datum declared in header files" >&5
-echo $ECHO_N "checking for struct datum declared in header files... $ECHO_C" >&6
-if test "${amanda_cv_struct_datum+set}" = set; then
+{ echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-           cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#if defined(USE_DB_H)
-#  include <db.h>
-#else
-#  if defined(USE_DBM_H)
-#    include <dbm.h>
-#  else
-#    if defined(USE_NDBM_H)
-#      include <ndbm.h>
-#    endif
-#  endif
-#endif
-
+$ac_includes_default
+typedef long long ac__type_new_;
 int
 main ()
 {
-
-                   datum a;
-
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_struct_datum=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_long_long=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-amanda_cv_struct_datum=no
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
+       ac_cv_type_long_long=no
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_struct_datum" >&5
-echo "${ECHO_T}$amanda_cv_struct_datum" >&6
-    if test "x$amanda_cv_struct_datum" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_DATUM 1
-_ACEOF
 
-    fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
 
-case "$DB_STYLE" in
-    db) DB_EXT=.db;;
-    gdbm) DB_EXT='""';;
-    dbm | ndbm) DB_EXT=".dir .pag";;
-    text) DB_EXT='""';;
-    *) DB_EXT=;;
-esac
-
-
-echo "$as_me:$LINENO: checking whether _POSIX2_RE_DUP_MAX is defined" >&5
-echo $ECHO_N "checking whether _POSIX2_RE_DUP_MAX is defined... $ECHO_C" >&6
-if test "${amanda_cv_have__posix2_re_dup_max+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
-#include <limits.h>
-#ifdef _POSIX2_RE_DUP_MAX
-  yes
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  amanda_cv_have__posix2_re_dup_max=yes
-else
-  amanda_cv_have__posix2_re_dup_max=no
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_have__posix2_re_dup_max" >&5
-echo "${ECHO_T}$amanda_cv_have__posix2_re_dup_max" >&6
-if test "x$amanda_cv_have__posix2_re_dup_max" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE__POSIX2_RE_DUP_MAX 1
+  ;
+  return 0;
+}
 _ACEOF
-
-fi
-
-echo "$as_me:$LINENO: checking whether CHAR_MIN is defined" >&5
-echo $ECHO_N "checking whether CHAR_MIN is defined... $ECHO_C" >&6
-if test "${amanda_cv_have_char_min+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
-#include <limits.h>
-#ifdef CHAR_MIN
-  yes
-#endif
-
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  amanda_cv_have_char_min=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
-  amanda_cv_have_char_min=no
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_have_char_min" >&5
-echo "${ECHO_T}$amanda_cv_have_char_min" >&6
-if test "x$amanda_cv_have_char_min" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CHAR_MIN 1
-_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
 
-echo "$as_me:$LINENO: checking whether CHAR_MAX is defined" >&5
-echo $ECHO_N "checking whether CHAR_MAX is defined... $ECHO_C" >&6
-if test "${amanda_cv_have_char_max+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
 
-#include <limits.h>
-#ifdef CHAR_MAX
-  yes
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  amanda_cv_have_char_max=yes
-else
-  amanda_cv_have_char_max=no
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_have_char_max" >&5
-echo "${ECHO_T}$amanda_cv_have_char_max" >&6
-if test "x$amanda_cv_have_char_max" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CHAR_MAX 1
+  ;
+  return 0;
+}
 _ACEOF
-
-fi
-
-echo "$as_me:$LINENO: checking whether CHAR_BIT is defined" >&5
-echo $ECHO_N "checking whether CHAR_BIT is defined... $ECHO_C" >&6
-if test "${amanda_cv_have_char_bit+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
 
-#include <limits.h>
-#ifdef CHAR_BIT
-  yes
-#endif
-
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then
-  amanda_cv_have_char_bit=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
-  amanda_cv_have_char_bit=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_have_char_bit" >&5
-echo "${ECHO_T}$amanda_cv_have_char_bit" >&6
-if test "x$amanda_cv_have_char_bit" = xyes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CHAR_BIT 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-ice_have_accept=no
-
-for ac_func in accept
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_accept=yes
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-done
 
-if test "${ice_have_accept}" = yes; then
-echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for accept declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_accept_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long_long=$ac_lo;;
+'') if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi ;;
+esac
 else
-
-ice_cv_have_accept_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}accept[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_accept_decl=yes
-fi
-rm -f conftest*
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-if test "$ice_cv_have_accept_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}accept[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_accept_decl=yes
-fi
-rm -f conftest*
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_accept_decl" = yes; then
-       break
+( exit $ac_status )
+if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi
 fi
-done
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+
 
-echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5
-echo "${ECHO_T}$ice_cv_have_accept_decl" >&6
-if test "$ice_cv_have_accept_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ACCEPT_DECL 1
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
 _ACEOF
 
-fi
-fi
 
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
-if test "${ac_cv_working_alloca_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for intmax_t" >&5
+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_intmax_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -44525,292 +50207,309 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <alloca.h>
+$ac_includes_default
+typedef intmax_t ac__type_new_;
 int
 main ()
 {
-char *p = (char *) alloca (2 * sizeof (int));
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_working_alloca_h=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_intmax_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_working_alloca_h=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_cv_type_intmax_t=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
-if test $ac_cv_working_alloca_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; }
 
-echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6
-if test "${ac_cv_func_alloca_works+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of intmax_t" >&5
+echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_intmax_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  if HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
 int
 main ()
 {
-char *p = (char *) alloca (1);
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_alloca_works=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_alloca_works=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
-
-if test $ac_cv_func_alloca_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=alloca.$ac_objext
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
-#define C_ALLOCA 1
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
 
-
-echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
-if test "${ac_cv_os_cray+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if defined(CRAY) && ! defined(CRAY2)
-webecray
-#else
-wenotbecray
-#endif
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then
-  ac_cv_os_cray=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
-  ac_cv_os_cray=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
-    break
-fi
-
-  done
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
-if test "${ac_cv_c_stack_direction+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_c_stack_direction=0
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_intmax_t=$ac_lo;;
+'') if test "$ac_cv_type_intmax_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_intmax_t=0
+   fi ;;
+esac
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -44818,66 +50517,93 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
+   typedef intmax_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
 int
-find_stack_direction ()
+main ()
 {
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
     {
-      addr = &dummy;
-      return find_stack_direction ();
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
     }
   else
-    return (&dummy > addr) ? 1 : -1;
-}
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
-int
-main ()
-{
-  exit (find_stack_direction () < 0);
+  ;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_stack_direction=1
+  ac_cv_sizeof_intmax_t=`cat conftest.val`
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-ac_cv_c_stack_direction=-1
+if test "$ac_cv_type_intmax_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_intmax_t=0
+   fi
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.val
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
 
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
 
 
-for ac_func in atexit
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_off_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -44886,270 +50612,403 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+$ac_includes_default
+typedef off_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_off_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+       ac_cv_type_off_t=no
+fi
 
-#undef $ac_func
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of off_t" >&5
+echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_off_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
+int
+main ()
 {
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_lo= ac_hi=
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
-
-ice_have_atof=no
 
-for ac_func in atof
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_atof=yes
-fi
-done
 
-if test "${ice_have_atof}" = yes; then
-echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5
-echo $ECHO_N "checking for atof declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_atof_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_off_t=$ac_lo;;
+'') if test "$ac_cv_type_off_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_off_t=0
+   fi ;;
+esac
 else
-
-ice_cv_have_atof_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef off_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atof[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_atof_decl=yes
-fi
-rm -f conftest*
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
-if test "$ice_cv_have_atof_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_off_t=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atof[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_atof_decl=yes
+( exit $ac_status )
+if test "$ac_cv_type_off_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_off_t=0
+   fi
 fi
-rm -f conftest*
-
-if test "$ice_cv_have_atof_decl" = yes; then
-       break
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
+rm -f conftest.val
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; }
+
 
-echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5
-echo "${ECHO_T}$ice_cv_have_atof_decl" >&6
-if test "$ice_cv_have_atof_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOF_DECL 1
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
 _ACEOF
 
-fi
-fi
-
-
-ice_have_atoi=no
 
-for ac_func in atoi
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -45158,334 +51017,403 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+typedef size_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_cv_type_size_t=no
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_atoi=yes
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
 
-if test "${ice_have_atoi}" = yes; then
-echo "$as_me:$LINENO: checking for atoi declaration in stdlib.h" >&5
-echo $ECHO_N "checking for atoi declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_atoi_decl+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of size_t" >&5
+echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_atoi_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atoi[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_atoi_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_atoi_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atoi[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_atoi_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_atoi_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_atoi_decl" >&5
-echo "${ECHO_T}$ice_cv_have_atoi_decl" >&6
-if test "$ice_cv_have_atoi_decl" = yes; then
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOI_DECL 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-fi
-
-
-ice_have_atol=no
 
-for ac_func in atol
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_atol=yes
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-done
 
-if test "${ice_have_atol}" = yes; then
-echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5
-echo $ECHO_N "checking for atol declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_atol_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-ice_cv_have_atol_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atol[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_atol_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_atol_decl" = yes; then
-       break
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_size_t=$ac_lo;;
+'') if test "$ac_cv_type_size_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atol[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_atol_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_atol_decl" = yes; then
-       break
-fi
-done
-
-fi
+$ac_includes_default
+   typedef size_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5
-echo "${ECHO_T}$ice_cv_have_atol_decl" >&6
-if test "$ice_cv_have_atol_decl" = yes; then
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOL_DECL 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_size_t=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+if test "$ac_cv_type_size_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.val
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
 
 
-ice_have_atoll=no
 
-for ac_func in atoll
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -45494,334 +51422,403 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+typedef ssize_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_ssize_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_cv_type_ssize_t=no
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_atoll=yes
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
+{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
+echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; }
 
-if test "${ice_have_atoll}" = yes; then
-echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5
-echo $ECHO_N "checking for atoll declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_atoll_decl+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of ssize_t" >&5
+echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_ssize_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_atoll_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atoll[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_atoll_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_atoll_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}atoll[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_atoll_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_atoll_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5
-echo "${ECHO_T}$ice_cv_have_atoll_decl" >&6
-if test "$ice_cv_have_atoll_decl" = yes; then
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOLL_DECL 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-fi
-
-
-ice_have_strtol=no
 
-for ac_func in strtol
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_strtol=yes
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-done
 
-if test "${ice_have_strtol}" = yes; then
-echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5
-echo $ECHO_N "checking for strtol declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_strtol_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-ice_cv_have_strtol_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strtol[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strtol_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_strtol_decl" = yes; then
-       break
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_ssize_t=$ac_lo;;
+'') if test "$ac_cv_type_ssize_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (ssize_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_ssize_t=0
+   fi ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef ssize_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strtol[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strtol_decl=yes
-fi
-rm -f conftest*
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_ssize_t=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_strtol_decl" = yes; then
-       break
+( exit $ac_status )
+if test "$ac_cv_type_ssize_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (ssize_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_ssize_t=0
+   fi
 fi
-done
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6; }
+
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strtol_decl" >&6
-if test "$ice_cv_have_strtol_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRTOL_DECL 1
+#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
 _ACEOF
 
-fi
-fi
-
-
-ice_have_strtoll=no
 
-for ac_func in strtoll
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for time_t" >&5
+echo $ECHO_N "checking for time_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_time_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -45830,436 +51827,403 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+typedef time_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_time_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+       ac_cv_type_time_t=no
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_strtoll=yes
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-done
+{ echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5
+echo "${ECHO_T}$ac_cv_type_time_t" >&6; }
 
-if test "${ice_have_strtoll}" = yes; then
-echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5
-echo $ECHO_N "checking for strtoll declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_strtoll_decl+set}" = set; then
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of time_t" >&5
+echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_time_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_strtoll_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
-# Check for ordinary declaration
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strtoll[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strtoll_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_strtoll_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strtoll[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strtoll_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_strtoll_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strtoll_decl" >&6
-if test "$ice_cv_have_strtoll_decl" = yes; then
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRTOLL_DECL 1
+  ;
+  return 0;
+}
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
 
-
-for ac_func in basename
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
+fi
 
-ice_have_bind=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-for ac_func in bind
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
 int
 main ()
 {
-return f != $ac_func;
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_bind=yes
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-done
 
-if test "${ice_have_bind}" = yes; then
-echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_bind_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_time_t=$ac_lo;;
+'') if test "$ac_cv_type_time_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (time_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_time_t=0
+   fi ;;
+esac
 else
-
-ice_cv_have_bind_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+   typedef time_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bind[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bind_decl=yes
-fi
-rm -f conftest*
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
 
-if test "$ice_cv_have_bind_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_time_t=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bind[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bind_decl=yes
+( exit $ac_status )
+if test "$ac_cv_type_time_t" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (time_t)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_time_t=0
+   fi
 fi
-rm -f conftest*
-
-if test "$ice_cv_have_bind_decl" = yes; then
-       break
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
+rm -f conftest.val
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; }
+
 
-echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bind_decl" >&6
-if test "$ice_cv_have_bind_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BIND_DECL 1
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
 _ACEOF
 
-fi
-fi
-
-
-ice_have_bcopy=no
 
-for ac_func in bcopy
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_off_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -46268,166 +52232,124 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+typedef off_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_off_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_bcopy=yes
+       ac_cv_type_off_t=no
 fi
-done
 
-if test "${ice_have_bcopy}" = yes; then
-echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
-echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_bcopy_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
+if test $ac_cv_type_off_t = yes; then
+  :
 else
 
-ice_cv_have_bcopy_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bcopy[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bcopy_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_bcopy_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+{ echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_pid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
+$ac_includes_default
+typedef pid_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bcopy[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bcopy_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_pid_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_bcopy_decl" = yes; then
-       break
+       ac_cv_type_pid_t=no
 fi
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6
-if test "$ice_cv_have_bcopy_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
+if test $ac_cv_type_pid_t = yes; then
+  :
+else
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BCOPY_DECL 1
+#define pid_t int
 _ACEOF
 
 fi
-fi
-
-
-ice_have_bzero=no
 
-for ac_func in bzero
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -46436,164 +52358,157 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
+typedef size_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_type_size_t=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
 _ACEOF
- ice_have_bzero=yes
+
 fi
-done
 
-if test "${ice_have_bzero}" = yes; then
-echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
-echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_bzero_decl+set}" = set; then
+{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; }
+if test "${ac_cv_type_uid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_bzero_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+#include <sys/types.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bzero[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bzero_decl=yes
+  $EGREP "uid_t" >/dev/null 2>&1; then
+  ac_cv_type_uid_t=yes
+else
+  ac_cv_type_uid_t=no
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_bzero_decl" = yes; then
-       break
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+#include <sys/types.h>
+#include <signal.h>
 
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bzero[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bzero_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_signal=int
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_bzero_decl" = yes; then
-       break
+       ac_cv_type_signal=void
 fi
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6
-if test "$ice_cv_have_bzero_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BZERO_DECL 1
+#define RETSIGTYPE $ac_cv_type_signal
 _ACEOF
 
-fi
-fi
 
-echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6
-if test "${ac_cv_func_closedir_void+set}" = set; then
+{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_closedir_void=yes
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -46601,62 +52516,61 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header_dirent>
-#ifndef __cplusplus
-int closedir ();
-#endif
+#include <sys/types.h>
+#include <time.h>
 
 int
 main ()
 {
-exit (closedir (opendir (".")) != 0);
+struct tm tm;
+                                    int *p = &tm.tm_sec;
+                                    return !p;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_closedir_void=no
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_struct_tm=time.h
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_closedir_void=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+       ac_cv_struct_tm=sys/time.h
 fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-echo "${ECHO_T}$ac_cv_func_closedir_void" >&6
-if test $ac_cv_func_closedir_void = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
 
 cat >>confdefs.h <<\_ACEOF
-#define CLOSEDIR_VOID 1
+#define TM_IN_SYS_TIME 1
 _ACEOF
 
 fi
 
 
-ice_have_closelog=no
 
-for ac_func in closelog
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_socklen_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -46665,166 +52579,74 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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>
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
 #endif
+#include <sys/socket.h>
 
-#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
+typedef socklen_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_socklen_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_closelog=yes
+       ac_cv_type_socklen_t=no
 fi
-done
-
-if test "${ice_have_closelog}" = yes; then
-echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
-echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6
-if test "${ice_cv_have_closelog_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_closelog_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in syslog.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}closelog[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_closelog_decl=yes
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest*
+{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; }
+if test $ac_cv_type_socklen_t = yes; then
+  :
+else
 
-if test "$ice_cv_have_closelog_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
+cat >>confdefs.h <<\_ACEOF
+#define socklen_t int
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}closelog[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_closelog_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_closelog_decl" = yes; then
-       break
-fi
-done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
-echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6
-if test "$ice_cv_have_closelog_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_CLOSELOG_DECL 1
-_ACEOF
-
-fi
-fi
 
 
-ice_have_connect=no
 
-for ac_func in connect
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking for sa_family_t" >&5
+echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_sa_family_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -46833,166 +52655,74 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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>
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
 #endif
+#include <sys/socket.h>
 
-#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
+typedef sa_family_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_sa_family_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_connect=yes
+       ac_cv_type_sa_family_t=no
 fi
-done
-
-if test "${ice_have_connect}" = yes; then
-echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_connect_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_connect_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}connect[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_connect_decl=yes
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest*
+{ echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
+echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6; }
+if test $ac_cv_type_sa_family_t = yes; then
+  :
+else
 
-if test "$ice_cv_have_connect_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
+cat >>confdefs.h <<\_ACEOF
+#define sa_family_t unsigned short
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}connect[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_connect_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_connect_decl" = yes; then
-       break
-fi
-done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
-echo "${ECHO_T}$ice_cv_have_connect_decl" >&6
-if test "$ice_cv_have_connect_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_CONNECT_DECL 1
-_ACEOF
-
-fi
-fi
 
 
-ice_have_dbm_open=no
 
-for ac_func in dbm_open
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking for in_port_t" >&5
+echo $ECHO_N "checking for in_port_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_in_port_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -47001,1109 +52731,1226 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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>
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
 #endif
+#include <netinet/in.h>
 
-#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
+typedef in_port_t ac__type_new_;
 int
 main ()
 {
-return f != $ac_func;
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_in_port_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_dbm_open=yes
+       ac_cv_type_in_port_t=no
 fi
-done
 
-if test "${ice_have_dbm_open}" = yes; then
-echo "$as_me:$LINENO: checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}" >&5
-echo $ECHO_N "checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}... $ECHO_C" >&6
-if test "${ice_cv_have_dbm_open_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5
+echo "${ECHO_T}$ac_cv_type_in_port_t" >&6; }
+if test $ac_cv_type_in_port_t = yes; then
+  :
 else
 
-ice_cv_have_dbm_open_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in ${DB_HEADER-no/db/header/file}; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}dbm_open[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_dbm_open_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_dbm_open_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define in_port_t unsigned short
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}dbm_open[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_dbm_open_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_dbm_open_decl" = yes; then
-       break
 fi
-done
 
-fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_dbm_open_decl" >&5
-echo "${ECHO_T}$ice_cv_have_dbm_open_decl" >&6
-if test "$ice_cv_have_dbm_open_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DBM_OPEN_DECL 1
-_ACEOF
 
-fi
-fi
 
 
-for ac_func in endmntent
+for ac_header in sys/wait.h wait.h
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#undef $ac_func
+       ac_header_compiler=no
+fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
-done
 
+done
 
-ice_have_fclose=no
-
-for ac_func in fclose
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking whether wait uses union wait" >&5
+echo $ECHO_N "checking whether wait uses union wait... $ECHO_C" >&6; }
+if test "${cf_cv_arg_union_wait+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+#include <sys/types.h>
 
-#ifdef __STDC__
-# include <limits.h>
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
 #else
-# include <assert.h>
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
 #endif
 
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
+#ifdef __STDC__
+pid_t wait(union wait *);
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+
+  union wait x; int i;
+  wait(&x); i = WIFEXITED(x)
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cf_cv_arg_union_wait=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       cf_cv_arg_union_wait=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5
+echo "${ECHO_T}$cf_cv_arg_union_wait" >&6; }
+    if test $cf_cv_arg_union_wait = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WAIT_USES_UNION 1
 _ACEOF
- ice_have_fclose=yes
-fi
-done
 
-if test "${ice_have_fclose}" = yes; then
-echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
-echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fclose_decl+set}" = set; then
+    fi
+
+
+
+
+
+for ac_header in sys/wait.h wait.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-
-ice_cv_have_fclose_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fclose[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fclose_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_fclose_decl" = yes; then
-       break
+       ac_header_compiler=no
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
+#include <$ac_header>
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fclose_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_fclose_decl" = yes; then
-       break
-fi
-done
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6
-if test "$ice_cv_have_fclose_decl" = yes; then
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FCLOSE_DECL 1
-_ACEOF
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
 fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+fi
 
-ice_have_fflush=no
+done
 
-for ac_func in fflush
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking whether wait uses int" >&5
+echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6; }
+if test "${cf_cv_arg_int+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+#include <sys/types.h>
 
-#ifdef __STDC__
-# include <limits.h>
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
 #else
-# include <assert.h>
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
 #endif
 
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
+#ifdef __STDC__
+pid_t wait(int *);
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+
+  int x; int i;
+  wait(&x); i = WIFEXITED(x)
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cf_cv_arg_int=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       cf_cv_arg_int=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+{ echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5
+echo "${ECHO_T}$cf_cv_arg_int" >&6; }
+if test $cf_cv_arg_int = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WAIT_USES_INT 1
 _ACEOF
- ice_have_fflush=yes
+
 fi
-done
 
-if test "${ice_have_fflush}" = yes; then
-echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
-echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fflush_decl+set}" = set; then
+
+#
+# Libraries
+#
+# cur_colr is on some HP's
+
+{ echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5
+echo $ECHO_N "checking for main in -lcur_colr... $ECHO_C" >&6; }
+if test "${ac_cv_lib_cur_colr_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_fflush_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcur_colr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
 
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fflush[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fflush_decl=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_cur_colr_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_cur_colr_main=no
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fflush_decl" = yes; then
-       break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5
+echo "${ECHO_T}$ac_cv_lib_cur_colr_main" >&6; }
+if test $ac_cv_lib_cur_colr_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCUR_COLR 1
+_ACEOF
+
+  LIBS="-lcur_colr $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for main in -lintl" >&5
+echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_intl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
 
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fflush[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fflush_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_intl_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_fflush_decl" = yes; then
-       break
+       ac_cv_lib_intl_main=no
 fi
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6
-if test "$ice_cv_have_fflush_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FFLUSH_DECL 1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_main" >&6; }
+if test $ac_cv_lib_intl_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL 1
 _ACEOF
 
-fi
+  LIBS="-lintl $LIBS"
+
 fi
 
 
-ice_have_flock=no
+    # Make sure we don't use -lnsl and -lsun on Irix systems.
+    case "$target" in
+       *sgi-irix*)
 
-for ac_func in flock
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_socket_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_lib_socket_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
+if test $ac_cv_lib_socket_main = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBSOCKET 1
 _ACEOF
- ice_have_flock=yes
+
+  LIBS="-lsocket $LIBS"
+
 fi
-done
 
-if test "${ice_have_flock}" = yes; then
-echo "$as_me:$LINENO: checking for flock declaration in sys/file.h" >&5
-echo $ECHO_N "checking for flock declaration in sys/file.h... $ECHO_C" >&6
-if test "${ice_cv_have_flock_decl+set}" = set; then
+                           ;;
+       *)
+
+{ echo "$as_me:$LINENO: checking for main in -lresolv" >&5
+echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6; }
+if test "${ac_cv_lib_resolv_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_flock_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/file.h; do
-# Check for ordinary declaration
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}flock[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_flock_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_flock_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}flock[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_flock_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_resolv_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_flock_decl" = yes; then
-       break
+       ac_cv_lib_resolv_main=no
 fi
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_flock_decl" >&5
-echo "${ECHO_T}$ice_cv_have_flock_decl" >&6
-if test "$ice_cv_have_flock_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FLOCK_DECL 1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6; }
+if test $ac_cv_lib_resolv_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRESOLV 1
 _ACEOF
 
-fi
-fi
+  LIBS="-lresolv $LIBS"
 
+fi
 
-ice_have_fprintf=no
 
-for ac_func in fprintf
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_nsl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_lib_nsl_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; }
+if test $ac_cv_lib_nsl_main = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBNSL 1
 _ACEOF
- ice_have_fprintf=yes
+
+  LIBS="-lnsl $LIBS"
+
 fi
-done
 
-if test "${ice_have_fprintf}" = yes; then
-echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fprintf_decl+set}" = set; then
+
+{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_fprintf_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fprintf[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fprintf_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_fprintf_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fprintf_decl=yes
-fi
-rm -f conftest*
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_socket_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_fprintf_decl" = yes; then
-       break
+       ac_cv_lib_socket_main=no
 fi
-done
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6
-if test "$ice_cv_have_fprintf_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FPRINTF_DECL 1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
+if test $ac_cv_lib_socket_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
 _ACEOF
 
-fi
-fi
+  LIBS="-lsocket $LIBS"
 
+fi
 
-ice_have_fputc=no
 
-for ac_func in fputc
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for main in -lsun" >&5
+echo $ECHO_N "checking for main in -lsun... $ECHO_C" >&6; }
+if test "${ac_cv_lib_sun_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsun  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_sun_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_lib_sun_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sun_main" >&6; }
+if test $ac_cv_lib_sun_main = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBSUN 1
 _ACEOF
- ice_have_fputc=yes
+
+  LIBS="-lsun $LIBS"
+
 fi
-done
 
-if test "${ice_have_fputc}" = yes; then
-echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
-echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fputc_decl+set}" = set; then
+                           ;;
+    esac
+
+
+    # search for pkg-config, which the glib configuration uses, adding a few
+    # system-specific search paths.
+    # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-ice_cv_have_fputc_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputc[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fputc_decl=yes
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fputc_decl" = yes; then
-       break
+
+
+    case "$target" in
+       sparc-sun-solaris2.8) # Solaris 8
+           # give the linker a runtime search path; pkg-config doesn't supply this.
+           # Users could also specify this with LD_LIBRARY_PATH to both ./configure
+           # and make.  Adding this support here makes straight './configure; make'
+           # "just work" on Solaris 8
+           if test -n "$PKG_CONFIG"; then
+               glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
+               LDFLAGS="$LDFLAGS $glib_R_flag"
+           fi
+           ;;
+    esac
+
+    # Check whether --enable-glibtest was given.
+if test "${enable_glibtest+set}" = set; then
+  enableval=$enable_glibtest;
+else
+  enable_glibtest=yes
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputc[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fputc_decl=yes
+
+  pkg_config_args=glib-2.0
+  for module in . gmodule gobject gthread
+  do
+      case "$module" in
+         gmodule)
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject)
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread)
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+      esac
+  done
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fputc_decl" = yes; then
-       break
+
 fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6
-if test "$ice_cv_have_fputc_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTC_DECL 1
-_ACEOF
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
 fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.16
+       { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       else
+               { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+               PKG_CONFIG=""
+       fi
+
 fi
 
+  no_glib=""
 
-ice_have_fputs=no
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
 
-for ac_func in fputs
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  min_glib_version=2.2.0
+  { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5
+echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; }
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+         echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+         enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+         :
+    else
+         no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+      rm -f conf.glibtest
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -48111,772 +53958,785 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+int
+main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
 
-#undef $ac_func
+  system ("touch conf.glibtest");
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    }
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+          (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+            GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+            glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+              major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
 }
-#endif
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_glib=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
+echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
+     :
+  else
+     { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <glib.h>
+#include <stdio.h>
 
 int
 main ()
 {
-return f != $ac_func;
+ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+        echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_fputs=yes
-fi
-done
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+
+       { { echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5
+echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&2;}
+   { (exit 1); exit 1; }; }
+
+  fi
+
+
+
+
+
+  rm -f conf.glibtest
+
+    CFLAGS="$CFLAGS $GLIB_CFLAGS"
+
+    CPPFLAGS="$CPPFLAGS $GLIB_CPPFLAGS"
+
+    LIBS="$GLIB_LIBS $LIBS"
+
+
+
+
+# Check whether --with-readline was given.
+if test "${with_readline+set}" = set; then
+  withval=$with_readline;
+            case "$withval" in
+                y | ye | yes | n | no) : ;;
+                *) { { echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5
+echo "$as_me: error: *** --with-readline does not take a value" >&2;}
+   { (exit 1); exit 1; }; }
+            esac
+            want_readline="$withval"
 
-if test "${ice_have_fputs}" = yes; then
-echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
-echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fputs_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fputs_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+            want_readline="maybe" # meaning "only if we can find it"
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputs[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fputs_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fputs_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
+
+    # unless the user said "no", look for readline.
+    if test x"$want_readline" != x"no"; then
+        # we need a tgetent() somewhere..
+        proceed="false"
+        { echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5
+echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6; }
+if test "${ac_cv_lib_termcap_tgetent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltermcap  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
 
+/* 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 tgetent ();
+int
+main ()
+{
+return tgetent ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputs[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fputs_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_fputs_decl" = yes; then
-       break
-fi
-done
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_termcap_tgetent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_lib_termcap_tgetent=no
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6
-if test "$ice_cv_have_fputs_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTS_DECL 1
-_ACEOF
-
-fi
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
+echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6; }
+if test $ac_cv_lib_termcap_tgetent = yes; then
 
+            READLINE_LIBS="-ltermcap"
+            proceed="true"
 
-ice_have_fread=no
+else
 
-for ac_func in fread
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+            { echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5
+echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6; }
+if test "${ac_cv_lib_curses_tgetent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
 #ifdef __cplusplus
-}
+extern "C"
 #endif
-
+char tgetent ();
 int
 main ()
 {
-return f != $ac_func;
+return tgetent ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_curses_tgetent=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_lib_curses_tgetent=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_fread=yes
-fi
-done
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5
+echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6; }
+if test $ac_cv_lib_curses_tgetent = yes; then
+
+                READLINE_LIBS="-lcurses"
+                proceed="true"
 
-if test "${ice_have_fread}" = yes; then
-echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_fread_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fread_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
-# Check for ordinary declaration
+                { echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5
+echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6; }
+if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
 
+/* 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 tgetent ();
+int
+main ()
+{
+return tgetent ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fread[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fread_decl=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_ncurses_tgetent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_ncurses_tgetent=no
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fread_decl" = yes; then
-       break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
+echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6; }
+if test $ac_cv_lib_ncurses_tgetent = yes; then
+
+                    READLINE_LIBS="-lncurses"
+                    proceed="true"
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fread[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fread_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fread_decl" = yes; then
-       break
+
 fi
-done
+
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fread_decl" >&6
-if test "$ice_cv_have_fread_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FREAD_DECL 1
-_ACEOF
+        if $proceed; then
+            proceed="false"
 
-fi
-fi
 
 
-ice_have_fseek=no
 
-for ac_func in fseek
+for ac_header in history.h readline.h readline/history.h readline/readline.h
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_fseek=yes
+       ac_header_compiler=no
 fi
-done
 
-if test "${ice_have_fseek}" = yes; then
-echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
-echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fseek_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-ice_cv_have_fseek_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
+#include <$ac_header>
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fseek[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fseek_decl=yes
-fi
-rm -f conftest*
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_fseek_decl" = yes; then
-       break
+  ac_header_preproc=no
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fseek[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fseek_decl=yes
-fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
-if test "$ice_cv_have_fseek_decl" = yes; then
-       break
-fi
-done
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6
-if test "$ice_cv_have_fseek_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FSEEK_DECL 1
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-fi
+                # found at least one of the headers, so we can proceed.
+                proceed="true"
+
 fi
 
+done
 
-ice_have_fwrite=no
+        fi
 
-for ac_func in fwrite
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+        if $proceed; then
+            proceed="false"
+            { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
+echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; }
+if test "${ac_cv_lib_readline_readline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lreadline $READLINE_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
 #ifdef __cplusplus
-}
+extern "C"
 #endif
-
+char readline ();
 int
 main ()
 {
-return f != $ac_func;
+return readline ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_readline_readline=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_fwrite=yes
-fi
-done
-
-if test "${ice_have_fwrite}" = yes; then
-echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_fwrite_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_fwrite_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fwrite[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fwrite_decl=yes
+       ac_cv_lib_readline_readline=no
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_fwrite_decl" = yes; then
-       break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
+echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; }
+if test $ac_cv_lib_readline_readline = yes; then
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fwrite[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fwrite_decl=yes
-fi
-rm -f conftest*
+                READLINE_LIBS="-lreadline $READLINE_LIBS"
+                proceed="true"
 
-if test "$ice_cv_have_fwrite_decl" = yes; then
-       break
 fi
-done
 
-fi
+        fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6
-if test "$ice_cv_have_fwrite_decl" = yes; then
+        if $proceed; then
+            # we have readline!
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FWRITE_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_READLINE 1
 _ACEOF
 
-fi
-fi
+        else
+            # no readline.  if the user *really* wanted it, bail out.
+            if test x"$want_readline" = x"yes"; then
+                { { echo "$as_me:$LINENO: error: *** No readline implementation found.  Try using --with-libraries and --with-includes" >&5
+echo "$as_me: error: *** No readline implementation found.  Try using --with-libraries and --with-includes" >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+            READLINE_LIBS=""
+        fi
+    fi
 
 
-for ac_func in getfsent
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+
+{ echo "$as_me:$LINENO: checking for modf in -lm" >&5
+echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_modf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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 $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
 #ifdef __cplusplus
-}
+extern "C"
 #endif
-
+char modf ();
 int
 main ()
 {
-return f != $ac_func;
+return modf ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_modf=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_lib_m_modf=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5
+echo "${ECHO_T}$ac_cv_lib_m_modf" >&6; }
+if test $ac_cv_lib_m_modf = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBM 1
 _ACEOF
 
+  LIBS="-lm $LIBS"
+
 fi
-done
 
 
-ice_have_gethostname=no
+#
+# Declarations
+#
+# Checks for library functions and if the function is declared in
+# an appropriate header file.  Functions which exist, but for which
+# no declaration is available, are declared in common-src/amanda.h.
+# It's not clear that any existing system implements but does not
+# declare common functions such as these.
+#
 
-for ac_func in gethostname
+ice_have_accept=no
+
+for ac_func in accept
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -48902,87 +54762,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_gethostname=yes
+ ice_have_accept=yes
 fi
 done
 
-if test "${ice_have_gethostname}" = yes; then
-echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
-echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_gethostname_decl+set}" = set; then
+if test "${ice_have_accept}" = yes; then
+{ echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for accept declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_accept_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_gethostname_decl=no
+ice_cv_have_accept_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -48994,12 +54846,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gethostname[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_gethostname_decl=yes
+  $EGREP "${ice_re_word}accept[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_accept_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_accept_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49013,243 +54865,218 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gethostname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_gethostname_decl=yes
+  $EGREP "${ice_re_word}accept[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_accept_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_accept_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
-echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6
-if test "$ice_cv_have_gethostname_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5
+echo "${ECHO_T}$ice_cv_have_accept_decl" >&6; }
+if test "$ice_cv_have_accept_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETHOSTNAME_DECL 1
+#define HAVE_ACCEPT_DECL 1
 _ACEOF
 
 fi
 fi
 
-# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
-echo "$as_me:$LINENO: checking for getmntent in -lsun" >&5
-echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6
-if test "${ac_cv_lib_sun_getmntent+set}" = set; then
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
+if test "${ac_cv_working_alloca_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsun  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getmntent ();
+#include <alloca.h>
 int
 main ()
 {
-getmntent ();
+char *p = (char *) alloca (2 * sizeof (int));
+                         if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_sun_getmntent=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_working_alloca_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_sun_getmntent=no
+       ac_cv_working_alloca_h=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6
-if test $ac_cv_lib_sun_getmntent = yes; then
-  LIBS="-lsun $LIBS"
-else
-  echo "$as_me:$LINENO: checking for getmntent in -lseq" >&5
-echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6
-if test "${ac_cv_lib_seq_getmntent+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA_H 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
+if test "${ac_cv_func_alloca_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lseq  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  ifdef HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#    endif
+#   endif
+#  endif
+# endif
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getmntent ();
+
 int
 main ()
 {
-getmntent ();
+char *p = (char *) alloca (1);
+                                   if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_seq_getmntent=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_alloca_works=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_seq_getmntent=no
+       ac_cv_func_alloca_works=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6
-if test $ac_cv_lib_seq_getmntent = yes; then
-  LIBS="-lseq $LIBS"
+{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
+
 else
-  echo "$as_me:$LINENO: checking for getmntent in -lgen" >&5
-echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6
-if test "${ac_cv_lib_gen_getmntent+set}" = set; then
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
+#define C_ALLOCA 1
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
+if test "${ac_cv_os_cray+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgen  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getmntent ();
-int
-main ()
-{
-getmntent ();
-  ;
-  return 0;
-}
+
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gen_getmntent=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then
+  ac_cv_os_cray=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_gen_getmntent=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6
-if test $ac_cv_lib_gen_getmntent = yes; then
-  LIBS="-lgen $LIBS"
-fi
-
+  ac_cv_os_cray=no
 fi
+rm -f conftest*
 
 fi
-
-
-for ac_func in getmntent
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49275,86 +55102,158 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
 _ACEOF
 
+    break
 fi
-done
 
+  done
+fi
+
+{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_c_stack_direction=0
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+  static char *addr = 0;
+  auto char dummy;
+  if (addr == 0)
+    {
+      addr = &dummy;
+      return find_stack_direction ();
+    }
+  else
+    return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+  return find_stack_direction () < 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_stack_direction=1
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
-ice_have_getopt=no
 
-for ac_func in getopt
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+
+for ac_func in atexit
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49380,149 +55279,77 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getopt=yes
-fi
-done
-
-if test "${ice_have_getopt}" = yes; then
-echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_getopt_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_getopt_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h unistd.h libc.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getopt[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getopt_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_getopt_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getopt[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getopt_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_getopt_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6
-if test "$ice_cv_have_getopt_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_getpeername=no
+ice_have_atof=no
 
-for ac_func in getpeername
+for ac_func in atof
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49548,87 +55375,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getpeername=yes
+ ice_have_atof=yes
 fi
 done
 
-if test "${ice_have_getpeername}" = yes; then
-echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getpeername_decl+set}" = set; then
+if test "${ice_have_atof}" = yes; then
+{ echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5
+echo $ECHO_N "checking for atof declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_atof_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_getpeername_decl=no
+ice_cv_have_atof_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -49640,12 +55459,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getpeername[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getpeername_decl=yes
+  $EGREP "${ice_re_word}atof[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_atof_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getpeername_decl" = yes; then
+if test "$ice_cv_have_atof_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49659,36 +55478,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getpeername[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getpeername_decl=yes
+  $EGREP "${ice_re_word}atof[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_atof_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getpeername_decl" = yes; then
+if test "$ice_cv_have_atof_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6
-if test "$ice_cv_have_getpeername_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5
+echo "${ECHO_T}$ice_cv_have_atof_decl" >&6; }
+if test "$ice_cv_have_atof_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPEERNAME_DECL 1
+#define HAVE_ATOF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in getpgrp
+ice_have_atol=no
+
+for ac_func in atol
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49714,148 +55535,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
+ ice_have_atol=yes
 fi
 done
 
-echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
-echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
-if test "${ac_cv_func_getpgrp_void+set}" = set; then
+if test "${ice_have_atol}" = yes; then
+{ echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5
+echo $ECHO_N "checking for atol declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_atol_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # Use it with a single arg.
+
+ice_cv_have_atol_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdlib.h; do
+# Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-getpgrp (0);
-  ;
-  return 0;
-}
+#include <$header>
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_getpgrp_void=no
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}atol[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_atol_decl=yes
+fi
+rm -f conftest*
 
-ac_cv_func_getpgrp_void=yes
+if test "$ice_cv_have_atol_decl" = yes; then
+       break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}atol[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_atol_decl=yes
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
-if test $ac_cv_func_getpgrp_void = yes; then
+rm -f conftest*
 
-cat >>confdefs.h <<\_ACEOF
-#define GETPGRP_VOID 1
+if test "$ice_cv_have_atol_decl" = yes; then
+       break
+fi
+done
+
+fi
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5
+echo "${ECHO_T}$ice_cv_have_atol_decl" >&6; }
+if test "$ice_cv_have_atol_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATOL_DECL 1
 _ACEOF
 
 fi
+fi
 
 
-ice_have_getsockname=no
+ice_have_atoll=no
 
-for ac_func in getsockname
+for ac_func in atoll
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49881,87 +55695,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockname=yes
+ ice_have_atoll=yes
 fi
 done
 
-if test "${ice_have_getsockname}" = yes; then
-echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getsockname_decl+set}" = set; then
+if test "${ice_have_atoll}" = yes; then
+{ echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5
+echo $ECHO_N "checking for atoll declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_atoll_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_getsockname_decl=no
+ice_cv_have_atoll_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -49973,12 +55779,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockname[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockname_decl=yes
+  $EGREP "${ice_re_word}atoll[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_atoll_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockname_decl" = yes; then
+if test "$ice_cv_have_atoll_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49992,38 +55798,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockname_decl=yes
+  $EGREP "${ice_re_word}atoll[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_atoll_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockname_decl" = yes; then
+if test "$ice_cv_have_atoll_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6
-if test "$ice_cv_have_getsockname_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5
+echo "${ECHO_T}$ice_cv_have_atoll_decl" >&6; }
+if test "$ice_cv_have_atoll_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKNAME_DECL 1
+#define HAVE_ATOLL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_getsockopt=no
+ice_have_strtol=no
 
-for ac_func in getsockopt
+for ac_func in strtol
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50049,87 +55855,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockopt=yes
+ ice_have_strtol=yes
 fi
 done
 
-if test "${ice_have_getsockopt}" = yes; then
-echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getsockopt_decl+set}" = set; then
+if test "${ice_have_strtol}" = yes; then
+{ echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5
+echo $ECHO_N "checking for strtol declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strtol_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_getsockopt_decl=no
+ice_cv_have_strtol_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50141,12 +55939,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockopt[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockopt_decl=yes
+  $EGREP "${ice_re_word}strtol[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strtol_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_strtol_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50160,38 +55958,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockopt_decl=yes
+  $EGREP "${ice_re_word}strtol[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strtol_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_strtol_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strtol_decl" >&6; }
+if test "$ice_cv_have_strtol_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKOPT_DECL 1
+#define HAVE_STRTOL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_gettimeofday=no
+ice_have_strtoll=no
 
-for ac_func in gettimeofday
+for ac_func in strtoll
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50217,87 +56015,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_gettimeofday=yes
+ ice_have_strtoll=yes
 fi
 done
 
-if test "${ice_have_gettimeofday}" = yes; then
-echo "$as_me:$LINENO: checking for gettimeofday declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for gettimeofday declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_gettimeofday_decl+set}" = set; then
+if test "${ice_have_strtoll}" = yes; then
+{ echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5
+echo $ECHO_N "checking for strtoll declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strtoll_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_gettimeofday_decl=no
+ice_cv_have_strtoll_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in time.h sys/time.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50309,12 +56099,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gettimeofday[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_gettimeofday_decl=yes
+  $EGREP "${ice_re_word}strtoll[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strtoll_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+if test "$ice_cv_have_strtoll_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50328,121 +56118,132 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gettimeofday[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_gettimeofday_decl=yes
+  $EGREP "${ice_re_word}strtoll[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strtoll_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+if test "$ice_cv_have_strtoll_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_gettimeofday_decl" >&5
-echo "${ECHO_T}$ice_cv_have_gettimeofday_decl" >&6
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strtoll_decl" >&6; }
+if test "$ice_cv_have_strtoll_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETTIMEOFDAY_DECL 1
+#define HAVE_STRTOLL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-
-       echo "$as_me:$LINENO: checking for gettimeofday number of arguments" >&5
-echo $ECHO_N "checking for gettimeofday number of arguments... $ECHO_C" >&6
-if test "${amanda_cv_gettimeofday_args+set}" = set; then
+for ac_func in basename
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-               cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
 #endif
 
 int
 main ()
 {
-
-                       struct timeval val;
-                       struct timezone zone;
-                       gettimeofday(&val, &zone);
-
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_gettimeofday_args=2
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-amanda_cv_gettimeofday_args=1
-
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_gettimeofday_args" >&5
-echo "${ECHO_T}$amanda_cv_gettimeofday_args" >&6
-       if test "$amanda_cv_gettimeofday_args" = 2; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TWO_ARG_GETTIMEOFDAY 1
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-       fi
-
-
+fi
+done
 
 
+ice_have_bind=no
 
-for ac_func in getvfsent initgroups isascii
+for ac_func in bind
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50468,85 +56269,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_bind=yes
+fi
+done
+
+if test "${ice_have_bind}" = yes; then
+{ echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_bind_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_bind_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/socket.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}bind[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bind_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_bind_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}bind[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bind_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_bind_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_initgroups=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bind_decl" >&6; }
+if test "$ice_cv_have_bind_decl" = yes; then
 
-for ac_func in initgroups
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BIND_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_bcopy=no
+
+for ac_func in bcopy
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50572,87 +56429,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_initgroups=yes
+ ice_have_bcopy=yes
 fi
 done
 
-if test "${ice_have_initgroups}" = yes; then
-echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_initgroups_decl+set}" = set; then
+if test "${ice_have_bcopy}" = yes; then
+{ echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
+echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_bcopy_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_initgroups_decl=no
+ice_cv_have_bcopy_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in grp.h sys/types.h unistd.h libc.h; do
+for header in string.h strings.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50664,12 +56513,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}initgroups[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_initgroups_decl=yes
+  $EGREP "${ice_re_word}bcopy[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bcopy_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_initgroups_decl" = yes; then
+if test "$ice_cv_have_bcopy_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50683,38 +56532,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}initgroups[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_initgroups_decl=yes
+  $EGREP "${ice_re_word}bcopy[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bcopy_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_initgroups_decl" = yes; then
+if test "$ice_cv_have_bcopy_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
-echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6
-if test "$ice_cv_have_initgroups_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6; }
+if test "$ice_cv_have_bcopy_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_INITGROUPS_DECL 1
+#define HAVE_BCOPY_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_ioctl=no
+ice_have_bzero=no
 
-for ac_func in ioctl
+for ac_func in bzero
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50740,87 +56589,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ioctl=yes
+ ice_have_bzero=yes
 fi
 done
 
-if test "${ice_have_ioctl}" = yes; then
-echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_ioctl_decl+set}" = set; then
+if test "${ice_have_bzero}" = yes; then
+{ echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
+echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_bzero_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_ioctl_decl=no
+ice_cv_have_bzero_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/ioctl.h unistd.h libc.h; do
+for header in string.h strings.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50832,12 +56673,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ioctl[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_ioctl_decl=yes
+  $EGREP "${ice_re_word}bzero[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_bzero_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50851,38 +56692,110 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ioctl[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ioctl_decl=yes
+  $EGREP "${ice_re_word}bzero[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_bzero_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
-echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6
-if test "$ice_cv_have_ioctl_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6; }
+if test "$ice_cv_have_bzero_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_IOCTL_DECL 1
+#define HAVE_BZERO_DECL 1
 _ACEOF
 
 fi
 fi
 
+{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5
+echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; }
+if test "${ac_cv_func_closedir_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_closedir_void=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
 
-ice_have_isnormal=no
+int
+main ()
+{
+return closedir (opendir (".")) != 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_closedir_void=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-for ac_func in isnormal
+( exit $ac_status )
+ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; }
+if test $ac_cv_func_closedir_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define CLOSEDIR_VOID 1
+_ACEOF
+
+fi
+
+
+ice_have_closelog=no
+
+for ac_func in closelog
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -50908,87 +56821,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_isnormal=yes
+ ice_have_closelog=yes
 fi
 done
 
-if test "${ice_have_isnormal}" = yes; then
-echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
-echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6
-if test "${ice_cv_have_isnormal_decl+set}" = set; then
+if test "${ice_have_closelog}" = yes; then
+{ echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
+echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_closelog_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_isnormal_decl=no
+ice_cv_have_closelog_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in math.h; do
+for header in syslog.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51000,12 +56905,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}isnormal[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
+  $EGREP "${ice_re_word}closelog[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_closelog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_isnormal_decl" = yes; then
+if test "$ice_cv_have_closelog_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51019,38 +56924,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}isnormal[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
+  $EGREP "${ice_re_word}closelog[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_closelog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_isnormal_decl" = yes; then
+if test "$ice_cv_have_closelog_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
-echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6
-if test "$ice_cv_have_isnormal_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
+echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6; }
+if test "$ice_cv_have_closelog_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ISNORMAL_DECL 1
+#define HAVE_CLOSELOG_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_listen=no
+ice_have_connect=no
 
-for ac_func in listen
+for ac_func in connect
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51076,84 +56981,76 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_listen=yes
+ ice_have_connect=yes
 fi
 done
 
-if test "${ice_have_listen}" = yes; then
-echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_listen_decl+set}" = set; then
+if test "${ice_have_connect}" = yes; then
+{ echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_connect_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_listen_decl=no
+ice_cv_have_connect_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
 for header in sys/types.h sys/socket.h; do
@@ -51168,12 +57065,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}listen[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_listen_decl=yes
+  $EGREP "${ice_re_word}connect[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_connect_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51187,38 +57084,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}listen[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_listen_decl=yes
+  $EGREP "${ice_re_word}connect[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_connect_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
-echo "${ECHO_T}$ice_cv_have_listen_decl" >&6
-if test "$ice_cv_have_listen_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
+echo "${ECHO_T}$ice_cv_have_connect_decl" >&6; }
+if test "$ice_cv_have_connect_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_LISTEN_DECL 1
+#define HAVE_CONNECT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_lstat=no
+ice_have_fclose=no
 
-for ac_func in lstat
+for ac_func in fclose
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51244,87 +57141,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_lstat=yes
+ ice_have_fclose=yes
 fi
 done
 
-if test "${ice_have_lstat}" = yes; then
-echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
-echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6
-if test "${ice_cv_have_lstat_decl+set}" = set; then
+if test "${ice_have_fclose}" = yes; then
+{ echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
+echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fclose_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_lstat_decl=no
+ice_cv_have_fclose_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/stat.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51336,12 +57225,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}lstat[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_lstat_decl=yes
+  $EGREP "${ice_re_word}fclose[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_lstat_decl" = yes; then
+if test "$ice_cv_have_fclose_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51355,38 +57244,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}lstat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_lstat_decl=yes
+  $EGREP "${ice_re_word}fclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_lstat_decl" = yes; then
+if test "$ice_cv_have_fclose_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
-echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6
-if test "$ice_cv_have_lstat_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6; }
+if test "$ice_cv_have_fclose_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_LSTAT_DECL 1
+#define HAVE_FCLOSE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_malloc=no
+ice_have_fflush=no
 
-for ac_func in malloc
+for ac_func in fflush
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51412,87 +57301,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_malloc=yes
+ ice_have_fflush=yes
 fi
 done
 
-if test "${ice_have_malloc}" = yes; then
-echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
-echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_malloc_decl+set}" = set; then
+if test "${ice_have_fflush}" = yes; then
+{ echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
+echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fflush_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_malloc_decl=no
+ice_cv_have_fflush_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51504,12 +57385,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}malloc[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_malloc_decl=yes
+  $EGREP "${ice_re_word}fflush[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fflush_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_malloc_decl" = yes; then
+if test "$ice_cv_have_fflush_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51523,38 +57404,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}malloc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_malloc_decl=yes
+  $EGREP "${ice_re_word}fflush[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fflush_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_malloc_decl" = yes; then
+if test "$ice_cv_have_fflush_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6
-if test "$ice_cv_have_malloc_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6; }
+if test "$ice_cv_have_fflush_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MALLOC_DECL 1
+#define HAVE_FFLUSH_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_memmove=no
+ice_have_fprintf=no
 
-for ac_func in memmove
+for ac_func in fprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51580,87 +57461,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memmove=yes
+ ice_have_fprintf=yes
 fi
 done
 
-if test "${ice_have_memmove}" = yes; then
-echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_memmove_decl+set}" = set; then
+if test "${ice_have_fprintf}" = yes; then
+{ echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_memmove_decl=no
+ice_cv_have_fprintf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51672,12 +57545,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memmove[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_memmove_decl=yes
+  $EGREP "${ice_re_word}fprintf[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_fprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51691,38 +57564,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memmove[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_memmove_decl=yes
+  $EGREP "${ice_re_word}fprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_fprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
-echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6
-if test "$ice_cv_have_memmove_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6; }
+if test "$ice_cv_have_fprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMMOVE_DECL 1
+#define HAVE_FPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_memset=no
+ice_have_fputc=no
 
-for ac_func in memset
+for ac_func in fputc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51748,87 +57621,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memset=yes
+ ice_have_fputc=yes
 fi
 done
 
-if test "${ice_have_memset}" = yes; then
-echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_memset_decl+set}" = set; then
+if test "${ice_have_fputc}" = yes; then
+{ echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
+echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fputc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_memset_decl=no
+ice_cv_have_fputc_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51840,12 +57705,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memset[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_memset_decl=yes
+  $EGREP "${ice_re_word}fputc[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fputc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51859,36 +57724,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memset[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_memset_decl=yes
+  $EGREP "${ice_re_word}fputc[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fputc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
-echo "${ECHO_T}$ice_cv_have_memset_decl" >&6
-if test "$ice_cv_have_memset_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6; }
+if test "$ice_cv_have_fputc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMSET_DECL 1
+#define HAVE_FPUTC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in mkdir
+ice_have_fputs=no
+
+for ac_func in fputs
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -51914,85 +57781,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_fputs=yes
+fi
+done
+
+if test "${ice_have_fputs}" = yes; then
+{ echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
+echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fputs_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_fputs_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}fputs[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fputs_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_fputs_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}fputs[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fputs_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_fputs_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_mkstemp=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6; }
+if test "$ice_cv_have_fputs_decl" = yes; then
 
-for ac_func in mkstemp
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FPUTS_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_fread=no
+
+for ac_func in fread
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -52018,87 +57941,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mkstemp=yes
+ ice_have_fread=yes
 fi
 done
 
-if test "${ice_have_mkstemp}" = yes; then
-echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
-echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_mkstemp_decl+set}" = set; then
+if test "${ice_have_fread}" = yes; then
+{ echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fread_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mkstemp_decl=no
+ice_cv_have_fread_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
+for header in stdio.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -52110,12 +58025,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mkstemp[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mkstemp_decl=yes
+  $EGREP "${ice_re_word}fread[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fread_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_fread_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -52129,38 +58044,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mkstemp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mkstemp_decl=yes
+  $EGREP "${ice_re_word}fread[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fread_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_fread_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fread_decl" >&6; }
+if test "$ice_cv_have_fread_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKSTEMP_DECL 1
+#define HAVE_FREAD_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mktemp=no
+ice_have_fseek=no
 
-for ac_func in mktemp
+for ac_func in fseek
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -52186,87 +58101,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktemp=yes
+ ice_have_fseek=yes
 fi
 done
 
-if test "${ice_have_mktemp}" = yes; then
-echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
-echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_mktemp_decl+set}" = set; then
+if test "${ice_have_fseek}" = yes; then
+{ echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
+echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fseek_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mktemp_decl=no
+ice_cv_have_fseek_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -52278,12 +58185,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktemp[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mktemp_decl=yes
+  $EGREP "${ice_re_word}fseek[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fseek_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -52297,38 +58204,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktemp[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mktemp_decl=yes
+  $EGREP "${ice_re_word}fseek[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fseek_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6
-if test "$ice_cv_have_mktemp_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6; }
+if test "$ice_cv_have_fseek_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTEMP_DECL 1
+#define HAVE_FSEEK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mktime=no
+ice_have_fwrite=no
 
-for ac_func in mktime
+for ac_func in fwrite
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -52354,87 +58261,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktime=yes
+ ice_have_fwrite=yes
 fi
 done
 
-if test "${ice_have_mktime}" = yes; then
-echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_mktime_decl+set}" = set; then
+if test "${ice_have_fwrite}" = yes; then
+{ echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_fwrite_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mktime_decl=no
+ice_cv_have_fwrite_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in time.h sys/time.h; do
+for header in stdio.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -52446,12 +58345,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktime[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mktime_decl=yes
+  $EGREP "${ice_re_word}fwrite[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fwrite_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_fwrite_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -52465,187 +58364,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktime[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mktime_decl=yes
+  $EGREP "${ice_re_word}fwrite[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fwrite_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_fwrite_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6
-if test "$ice_cv_have_mktime_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6; }
+if test "$ice_cv_have_fwrite_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTIME_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+#define HAVE_FWRITE_DECL 1
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
 fi
 
-done
 
+ice_have_gethostname=no
 
-for ac_func in getpagesize
+for ac_func in gethostname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -52671,258 +58421,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
 #ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_mmap_fixed_mapped=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-       mmap private not fixed
-       mmap private fixed at somewhere currently unmapped
-       mmap private fixed at somewhere already mapped
-       mmap shared not fixed
-       mmap shared fixed at somewhere currently unmapped
-       mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the file system buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propagated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h.  */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h.  */
-# if !HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  if HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192  /* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
+extern "C"
+#endif
+char $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
 int
 main ()
 {
-  char *data, *data2, *data3;
-  int i, pagesize;
-  int fd;
-
-  pagesize = getpagesize ();
-
-  /* First, make a file with some known garbage in it. */
-  data = (char *) malloc (pagesize);
-  if (!data)
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    *(data + i) = rand ();
-  umask (0);
-  fd = creat ("conftest.mmap", 0600);
-  if (fd < 0)
-    exit (1);
-  if (write (fd, data, pagesize) != pagesize)
-    exit (1);
-  close (fd);
-
-  /* Next, try to mmap the file at a fixed address which already has
-     something else allocated at it.  If we can, also make sure that
-     we see the same garbage.  */
-  fd = open ("conftest.mmap", O_RDWR);
-  if (fd < 0)
-    exit (1);
-  data2 = (char *) malloc (2 * pagesize);
-  if (!data2)
-    exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
-  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data2 + i))
-      exit (1);
-
-  /* Finally, make sure that changes to the mapped area do not
-     percolate back to the file as seen by read().  (This is a bug on
-     some variants of i386 svr4.0.)  */
-  for (i = 0; i < pagesize; ++i)
-    *(data2 + i) = *(data2 + i) + 1;
-  data3 = (char *) malloc (pagesize);
-  if (!data3)
-    exit (1);
-  if (read (fd, data3, pagesize) != pagesize)
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data3 + i))
-      exit (1);
-  close (fd);
-  exit (0);
+return $ac_func ();
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_mmap_fixed_mapped=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
+       eval "$as_ac_var=no"
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_gethostname=yes
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
+done
+
+if test "${ice_have_gethostname}" = yes; then
+{ echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
+echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_gethostname_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_gethostname_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in unistd.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}gethostname[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_gethostname_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_gethostname_decl" = yes; then
+       break
 fi
-rm -f conftest.mmap
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}gethostname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_gethostname_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_gethostname_decl" = yes; then
+       break
+fi
+done
 
+fi
 
-for ac_func in on_exit
+{ echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
+echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6; }
+if test "$ice_cv_have_gethostname_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTNAME_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_getopt=no
+
+for ac_func in getopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -52948,85 +58581,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_getopt=yes
+fi
+done
+
+if test "${ice_have_getopt}" = yes; then
+{ echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_getopt_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_getopt_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdlib.h unistd.h libc.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}getopt[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getopt_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_getopt_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}getopt[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getopt_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_getopt_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_openlog=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6; }
+if test "$ice_cv_have_getopt_decl" = yes; then
 
-for ac_func in openlog
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_getpeername=no
+
+for ac_func in getpeername
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53052,87 +58741,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_openlog=yes
+ ice_have_getpeername=yes
 fi
 done
 
-if test "${ice_have_openlog}" = yes; then
-echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
-echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6
-if test "${ice_cv_have_openlog_decl+set}" = set; then
+if test "${ice_have_getpeername}" = yes; then
+{ echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_getpeername_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_openlog_decl=no
+ice_cv_have_getpeername_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in syslog.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -53144,12 +58825,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}openlog[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_openlog_decl=yes
+  $EGREP "${ice_re_word}getpeername[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getpeername_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -53163,38 +58844,179 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}openlog[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_openlog_decl=yes
+  $EGREP "${ice_re_word}getpeername[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getpeername_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
-echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6
-if test "$ice_cv_have_openlog_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6; }
+if test "$ice_cv_have_getpeername_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENLOG_DECL 1
+#define HAVE_GETPEERNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
+{ echo "$as_me:$LINENO: checking for getpgrp" >&5
+echo $ECHO_N "checking for getpgrp... $ECHO_C" >&6; }
+if test "${ac_cv_func_getpgrp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define getpgrp to an innocuous variant, in case <limits.h> declares getpgrp.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define getpgrp innocuous_getpgrp
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char getpgrp (); 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
 
-ice_have_pclose=no
+#undef getpgrp
 
-for ac_func in pclose
+/* 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 getpgrp ();
+/* 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_getpgrp || defined __stub___getpgrp
+choke me
+#endif
+
+int
+main ()
+{
+return getpgrp ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_getpgrp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_getpgrp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6; }
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Use it with a single arg.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+getpgrp (0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_func_getpgrp_void=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_getpgrp_void=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6; }
+if test $ac_cv_func_getpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define GETPGRP_VOID 1
+_ACEOF
+
+fi
+
+
+ice_have_getsockname=no
+
+for ac_func in getsockname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53220,87 +59042,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_pclose=yes
+ ice_have_getsockname=yes
 fi
 done
 
-if test "${ice_have_pclose}" = yes; then
-echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
-echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_pclose_decl+set}" = set; then
+if test "${ice_have_getsockname}" = yes; then
+{ echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_getsockname_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_pclose_decl=no
+ice_cv_have_getsockname_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -53312,12 +59126,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}pclose[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_pclose_decl=yes
+  $EGREP "${ice_re_word}getsockname[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -53331,38 +59145,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}pclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_pclose_decl=yes
+  $EGREP "${ice_re_word}getsockname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
-echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6
-if test "$ice_cv_have_pclose_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6; }
+if test "$ice_cv_have_getsockname_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PCLOSE_DECL 1
+#define HAVE_GETSOCKNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_perror=no
+ice_have_getsockopt=no
 
-for ac_func in perror
+for ac_func in getsockopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53388,87 +59202,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_perror=yes
+ ice_have_getsockopt=yes
 fi
 done
 
-if test "${ice_have_perror}" = yes; then
-echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
-echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_perror_decl+set}" = set; then
+if test "${ice_have_getsockopt}" = yes; then
+{ echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_getsockopt_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_perror_decl=no
+ice_cv_have_getsockopt_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -53480,12 +59286,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}perror[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_perror_decl=yes
+  $EGREP "${ice_re_word}getsockopt[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_perror_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -53499,38 +59305,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}perror[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_perror_decl=yes
+  $EGREP "${ice_re_word}getsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_perror_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
-echo "${ECHO_T}$ice_cv_have_perror_decl" >&6
-if test "$ice_cv_have_perror_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6; }
+if test "$ice_cv_have_getsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PERROR_DECL 1
+#define HAVE_GETSOCKOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_printf=no
+ice_have_initgroups=no
 
-for ac_func in printf
+for ac_func in initgroups
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53556,87 +59362,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_printf=yes
+ ice_have_initgroups=yes
 fi
 done
 
-if test "${ice_have_printf}" = yes; then
-echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
-echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_printf_decl+set}" = set; then
+if test "${ice_have_initgroups}" = yes; then
+{ echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_initgroups_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_printf_decl=no
+ice_cv_have_initgroups_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in grp.h sys/types.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -53648,12 +59446,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}printf[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_printf_decl=yes
+  $EGREP "${ice_re_word}initgroups[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_initgroups_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_printf_decl" = yes; then
+if test "$ice_cv_have_initgroups_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -53667,36 +59465,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}printf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_printf_decl=yes
+  $EGREP "${ice_re_word}initgroups[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_initgroups_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_printf_decl" = yes; then
+if test "$ice_cv_have_initgroups_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_printf_decl" >&6
-if test "$ice_cv_have_printf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
+echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6; }
+if test "$ice_cv_have_initgroups_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PRINTF_DECL 1
+#define HAVE_INITGROUPS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in putenv
+ice_have_ioctl=no
+
+for ac_func in ioctl
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53722,85 +59522,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_ioctl=yes
+fi
+done
 
+if test "${ice_have_ioctl}" = yes; then
+{ echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_ioctl_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_ioctl_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/ioctl.h unistd.h libc.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}ioctl[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ioctl_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_ioctl_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}ioctl[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ioctl_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_ioctl_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_puts=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
+echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6; }
+if test "$ice_cv_have_ioctl_decl" = yes; then
 
-for ac_func in puts
+cat >>confdefs.h <<_ACEOF
+#define HAVE_IOCTL_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_isnormal=no
+
+for ac_func in isnormal
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53826,87 +59682,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_puts=yes
+ ice_have_isnormal=yes
 fi
 done
 
-if test "${ice_have_puts}" = yes; then
-echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
-echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_puts_decl+set}" = set; then
+if test "${ice_have_isnormal}" = yes; then
+{ echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
+echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_isnormal_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_puts_decl=no
+ice_cv_have_isnormal_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in math.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -53918,12 +59766,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}puts[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_puts_decl=yes
+  $EGREP "${ice_re_word}isnormal[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_isnormal_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -53937,38 +59785,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}puts[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_puts_decl=yes
+  $EGREP "${ice_re_word}isnormal[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_isnormal_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
-echo "${ECHO_T}$ice_cv_have_puts_decl" >&6
-if test "$ice_cv_have_puts_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
+echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6; }
+if test "$ice_cv_have_isnormal_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PUTS_DECL 1
+#define HAVE_ISNORMAL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_realloc=no
+ice_have_listen=no
 
-for ac_func in realloc
+for ac_func in listen
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -53994,87 +59842,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_realloc=yes
+ ice_have_listen=yes
 fi
 done
 
-if test "${ice_have_realloc}" = yes; then
-echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
-echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_realloc_decl+set}" = set; then
+if test "${ice_have_listen}" = yes; then
+{ echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_listen_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_realloc_decl=no
+ice_cv_have_listen_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -54086,12 +59926,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}realloc[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_realloc_decl=yes
+  $EGREP "${ice_re_word}listen[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_listen_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_listen_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -54105,38 +59945,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}realloc[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_realloc_decl=yes
+  $EGREP "${ice_re_word}listen[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_listen_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_listen_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6
-if test "$ice_cv_have_realloc_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
+echo "${ECHO_T}$ice_cv_have_listen_decl" >&6; }
+if test "$ice_cv_have_listen_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REALLOC_DECL 1
+#define HAVE_LISTEN_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_recvfrom=no
+ice_have_lstat=no
 
-for ac_func in recvfrom
+for ac_func in lstat
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54162,87 +60002,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_recvfrom=yes
+ ice_have_lstat=yes
 fi
 done
 
-if test "${ice_have_recvfrom}" = yes; then
-echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_recvfrom_decl+set}" = set; then
+if test "${ice_have_lstat}" = yes; then
+{ echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
+echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_lstat_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_recvfrom_decl=no
+ice_cv_have_lstat_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in sys/types.h sys/stat.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -54254,12 +60086,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}recvfrom[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_recvfrom_decl=yes
+  $EGREP "${ice_re_word}lstat[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_lstat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -54273,38 +60105,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}recvfrom[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_recvfrom_decl=yes
+  $EGREP "${ice_re_word}lstat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_lstat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
-echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
+echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6; }
+if test "$ice_cv_have_lstat_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RECVFROM_DECL 1
+#define HAVE_LSTAT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_remove=no
+ice_have_malloc=no
 
-for ac_func in remove
+for ac_func in malloc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54330,87 +60162,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_remove=yes
+ ice_have_malloc=yes
 fi
 done
 
-if test "${ice_have_remove}" = yes; then
-echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
-echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_remove_decl+set}" = set; then
+if test "${ice_have_malloc}" = yes; then
+{ echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
+echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_malloc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_remove_decl=no
+ice_cv_have_malloc_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -54422,12 +60246,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}remove[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_remove_decl=yes
+  $EGREP "${ice_re_word}malloc[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_malloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_remove_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -54441,38 +60265,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}remove[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_remove_decl=yes
+  $EGREP "${ice_re_word}malloc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_malloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_remove_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
-echo "${ECHO_T}$ice_cv_have_remove_decl" >&6
-if test "$ice_cv_have_remove_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6; }
+if test "$ice_cv_have_malloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REMOVE_DECL 1
+#define HAVE_MALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_rename=no
+ice_have_memmove=no
 
-for ac_func in rename
+for ac_func in memmove
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54498,87 +60322,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_rename=yes
+ ice_have_memmove=yes
 fi
 done
 
-if test "${ice_have_rename}" = yes; then
-echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
-echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_rename_decl+set}" = set; then
+if test "${ice_have_memmove}" = yes; then
+{ echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_memmove_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_rename_decl=no
+ice_cv_have_memmove_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -54590,12 +60406,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rename[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_rename_decl=yes
+  $EGREP "${ice_re_word}memmove[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_memmove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_memmove_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -54609,38 +60425,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rename[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_rename_decl=yes
+  $EGREP "${ice_re_word}memmove[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_memmove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_memmove_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
-echo "${ECHO_T}$ice_cv_have_rename_decl" >&6
-if test "$ice_cv_have_rename_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
+echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6; }
+if test "$ice_cv_have_memmove_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RENAME_DECL 1
+#define HAVE_MEMMOVE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_rewind=no
+ice_have_memset=no
 
-for ac_func in rewind
+for ac_func in memset
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54666,87 +60482,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_rewind=yes
+ ice_have_memset=yes
 fi
 done
 
-if test "${ice_have_rewind}" = yes; then
-echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
-echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_rewind_decl+set}" = set; then
+if test "${ice_have_memset}" = yes; then
+{ echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_memset_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_rewind_decl=no
+ice_cv_have_memset_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -54758,12 +60566,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rewind[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_rewind_decl=yes
+  $EGREP "${ice_re_word}memset[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_memset_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rewind_decl" = yes; then
+if test "$ice_cv_have_memset_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -54777,36 +60585,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rewind[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_rewind_decl=yes
+  $EGREP "${ice_re_word}memset[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_memset_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rewind_decl" = yes; then
+if test "$ice_cv_have_memset_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
-echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6
-if test "$ice_cv_have_rewind_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
+echo "${ECHO_T}$ice_cv_have_memset_decl" >&6; }
+if test "$ice_cv_have_memset_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REWIND_DECL 1
+#define HAVE_MEMSET_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in rmdir
+ice_have_mkstemp=no
+
+for ac_func in mkstemp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54832,85 +60642,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_mkstemp=yes
+fi
+done
+
+if test "${ice_have_mkstemp}" = yes; then
+{ echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
+echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_mkstemp_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_mkstemp_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdlib.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}mkstemp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_mkstemp_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}mkstemp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_mkstemp_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_ruserok=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6; }
+if test "$ice_cv_have_mkstemp_decl" = yes; then
 
-for ac_func in ruserok
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MKSTEMP_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_mktemp=no
+
+for ac_func in mktemp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -54936,87 +60802,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ruserok=yes
+ ice_have_mktemp=yes
 fi
 done
 
-if test "${ice_have_ruserok}" = yes; then
-echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
-echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_ruserok_decl+set}" = set; then
+if test "${ice_have_mktemp}" = yes; then
+{ echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
+echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_mktemp_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_ruserok_decl=no
+ice_cv_have_mktemp_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in netdb.h sys/socket.h libc.h unistd.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -55028,12 +60886,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ruserok[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_ruserok_decl=yes
+  $EGREP "${ice_re_word}mktemp[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mktemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -55047,38 +60905,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ruserok[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ruserok_decl=yes
+  $EGREP "${ice_re_word}mktemp[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mktemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
-echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6
-if test "$ice_cv_have_ruserok_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6; }
+if test "$ice_cv_have_mktemp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RUSEROK_DECL 1
+#define HAVE_MKTEMP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_select=no
+ice_have_mktime=no
 
-for ac_func in select
+for ac_func in mktime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55104,87 +60962,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_select=yes
+ ice_have_mktime=yes
 fi
 done
 
-if test "${ice_have_select}" = yes; then
-echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
-echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_select_decl+set}" = set; then
+if test "${ice_have_mktime}" = yes; then
+{ echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_mktime_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_select_decl=no
+ice_cv_have_mktime_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -55196,12 +61046,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}select[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_select_decl=yes
+  $EGREP "${ice_re_word}mktime[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -55215,109 +61065,132 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}select[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_select_decl=yes
+  $EGREP "${ice_re_word}mktime[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
-echo "${ECHO_T}$ice_cv_have_select_decl" >&6
-if test "$ice_cv_have_select_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6; }
+if test "$ice_cv_have_mktime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SELECT_DECL 1
+#define HAVE_MKTIME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-       echo "$as_me:$LINENO: checking for select() argument type" >&5
-echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6
-if test "${amanda_cv_select_arg_type+set}" = set; then
+for ac_func in on_exit
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-               rm -f conftest.c
-               cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#  include <sys/select.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
+
+#undef $ac_func
+
+/* 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
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+char $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
 #endif
 
-int main()
+int
+main ()
 {
-#ifdef FD_SET_POINTER
-       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
-#else
-       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
-#endif
-       return 0;
+return $ac_func ();
+  ;
+  return 0;
 }
-EOF
-
-                                                                                                                               amanda_cv_select_arg_type=no
-               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
-               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
-               if test $? -ne 0; then
-                   amanda_cv_select_arg_type=int
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
-                   if test $? -ne 0; then
-                       amanda_cv_select_arg_type=fd_set
-                   fi
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   wc_fdset=`wc -l <conftest.fd_set`
-                   wc_int=`wc -l <conftest.int`
-                   if test "$wc_fdset" -le "$wc_int"; then
-                       amanda_cv_select_arg_type=fd_set
-                   else
-                       amanda_cv_select_arg_type=int
-                   fi
-               fi
-               rm -f conftest*
-
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       eval "$as_ac_var=no"
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
-echo "${ECHO_T}$amanda_cv_select_arg_type" >&6
 
-cat >>confdefs.h <<_ACEOF
-#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
+fi
+done
 
 
+ice_have_openlog=no
 
-ice_have_sendto=no
-
-for ac_func in sendto
+for ac_func in openlog
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55343,87 +61216,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sendto=yes
+ ice_have_openlog=yes
 fi
 done
 
-if test "${ice_have_sendto}" = yes; then
-echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_sendto_decl+set}" = set; then
+if test "${ice_have_openlog}" = yes; then
+{ echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
+echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_openlog_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_sendto_decl=no
+ice_cv_have_openlog_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in syslog.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -55435,12 +61300,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sendto[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
+  $EGREP "${ice_re_word}openlog[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sendto_decl" = yes; then
+if test "$ice_cv_have_openlog_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -55454,38 +61319,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sendto[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
+  $EGREP "${ice_re_word}openlog[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sendto_decl" = yes; then
+if test "$ice_cv_have_openlog_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
-echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6
-if test "$ice_cv_have_sendto_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
+echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6; }
+if test "$ice_cv_have_openlog_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SENDTO_DECL 1
+#define HAVE_OPENLOG_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setegid=no
+ice_have_pclose=no
 
-for ac_func in setegid
+for ac_func in pclose
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55511,87 +61376,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setegid=yes
+ ice_have_pclose=yes
 fi
 done
 
-if test "${ice_have_setegid}" = yes; then
-echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setegid_decl+set}" = set; then
+if test "${ice_have_pclose}" = yes; then
+{ echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
+echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_pclose_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setegid_decl=no
+ice_cv_have_pclose_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -55603,12 +61460,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setegid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setegid_decl=yes
+  $EGREP "${ice_re_word}pclose[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setegid_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -55622,38 +61479,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setegid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setegid_decl=yes
+  $EGREP "${ice_re_word}pclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setegid_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6
-if test "$ice_cv_have_setegid_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
+echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6; }
+if test "$ice_cv_have_pclose_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEGID_DECL 1
+#define HAVE_PCLOSE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_seteuid=no
+ice_have_perror=no
 
-for ac_func in seteuid
+for ac_func in perror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55679,87 +61536,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_seteuid=yes
+ ice_have_perror=yes
 fi
 done
 
-if test "${ice_have_seteuid}" = yes; then
-echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
-echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_seteuid_decl+set}" = set; then
+if test "${ice_have_perror}" = yes; then
+{ echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
+echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_perror_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_seteuid_decl=no
+ice_cv_have_perror_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -55771,12 +61620,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}seteuid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_seteuid_decl=yes
+  $EGREP "${ice_re_word}perror[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -55790,36 +61639,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}seteuid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_seteuid_decl=yes
+  $EGREP "${ice_re_word}perror[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6
-if test "$ice_cv_have_seteuid_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
+echo "${ECHO_T}$ice_cv_have_perror_decl" >&6; }
+if test "$ice_cv_have_perror_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEUID_DECL 1
+#define HAVE_PERROR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in setmntent
+ice_have_printf=no
+
+for ac_func in printf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55845,83 +61696,139 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_printf=yes
+fi
+done
+
+if test "${ice_have_printf}" = yes; then
+{ echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
+echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_printf_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_printf_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}printf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_printf_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}printf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_printf_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_printf_decl" >&6; }
+if test "$ice_cv_have_printf_decl" = yes; then
 
-for ac_func in shquote
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PRINTF_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+for ac_func in putenv
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -55947,68 +61854,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 done
 
 
+ice_have_puts=no
 
-ice_have_setresgid=no
-
-for ac_func in setresgid
+for ac_func in puts
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56052,87 +61950,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresgid=yes
+ ice_have_puts=yes
 fi
 done
 
-if test "${ice_have_setresgid}" = yes; then
-echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setresgid_decl+set}" = set; then
+if test "${ice_have_puts}" = yes; then
+{ echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
+echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_puts_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setresgid_decl=no
+ice_cv_have_puts_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -56144,12 +62034,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresgid[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setresgid_decl=yes
+  $EGREP "${ice_re_word}puts[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -56163,38 +62053,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresgid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setresgid_decl=yes
+  $EGREP "${ice_re_word}puts[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6
-if test "$ice_cv_have_setresgid_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
+echo "${ECHO_T}$ice_cv_have_puts_decl" >&6; }
+if test "$ice_cv_have_puts_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESGID_DECL 1
+#define HAVE_PUTS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setresuid=no
+ice_have_realloc=no
 
-for ac_func in setresuid
+for ac_func in realloc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56220,87 +62110,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresuid=yes
+ ice_have_realloc=yes
 fi
 done
 
-if test "${ice_have_setresuid}" = yes; then
-echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setresuid_decl+set}" = set; then
+if test "${ice_have_realloc}" = yes; then
+{ echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
+echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_realloc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setresuid_decl=no
+ice_cv_have_realloc_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -56312,12 +62194,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresuid[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setresuid_decl=yes
+  $EGREP "${ice_re_word}realloc[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -56331,38 +62213,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresuid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setresuid_decl=yes
+  $EGREP "${ice_re_word}realloc[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6
-if test "$ice_cv_have_setresuid_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6; }
+if test "$ice_cv_have_realloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESUID_DECL 1
+#define HAVE_REALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_snprintf=no
+ice_have_recvfrom=no
 
-for ac_func in snprintf
+for ac_func in recvfrom
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56388,87 +62270,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_snprintf=yes
+ ice_have_recvfrom=yes
 fi
 done
 
-if test "${ice_have_snprintf}" = yes; then
-echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_snprintf_decl+set}" = set; then
+if test "${ice_have_recvfrom}" = yes; then
+{ echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_recvfrom_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_snprintf_decl=no
+ice_cv_have_recvfrom_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -56480,12 +62354,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}snprintf[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_snprintf_decl=yes
+  $EGREP "${ice_re_word}recvfrom[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_snprintf_decl" = yes; then
+if test "$ice_cv_have_recvfrom_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -56499,38 +62373,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}snprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_snprintf_decl=yes
+  $EGREP "${ice_re_word}recvfrom[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_snprintf_decl" = yes; then
+if test "$ice_cv_have_recvfrom_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6
-if test "$ice_cv_have_snprintf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
+echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6; }
+if test "$ice_cv_have_recvfrom_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SNPRINTF_DECL 1
+#define HAVE_RECVFROM_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_vsnprintf=no
+ice_have_remove=no
 
-for ac_func in vsnprintf
+for ac_func in remove
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56556,84 +62430,76 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vsnprintf=yes
+ ice_have_remove=yes
 fi
 done
 
-if test "${ice_have_vsnprintf}" = yes; then
-echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
+if test "${ice_have_remove}" = yes; then
+{ echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
+echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_remove_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_vsnprintf_decl=no
+ice_cv_have_remove_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
 for header in stdio.h; do
@@ -56648,155 +62514,57 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsnprintf[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vsnprintf_decl=yes
+  $EGREP "${ice_re_word}remove[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+if test "$ice_cv_have_remove_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsnprintf[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vsnprintf_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VSNPRINTF_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-echo "$as_me:$LINENO: checking for setpgid" >&5
-echo $ECHO_N "checking for setpgid... $ECHO_C" >&6
-if test "${ac_cv_func_setpgid+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define setpgid to an innocuous variant, in case <limits.h> declares setpgid.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define setpgid innocuous_setpgid
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char setpgid (); 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 setpgid
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char setpgid ();
-/* 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_setpgid) || defined (__stub___setpgid)
-choke me
-#else
-char (*f) () = setpgid;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != setpgid;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_setpgid=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-ac_cv_func_setpgid=no
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}remove[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest*
+
+if test "$ice_cv_have_remove_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
-echo "${ECHO_T}$ac_cv_func_setpgid" >&6
-if test $ac_cv_func_setpgid = yes; then
+done
 
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SETPGID 1
+{ echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
+echo "${ECHO_T}$ice_cv_have_remove_decl" >&6; }
+if test "$ice_cv_have_remove_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_REMOVE_DECL 1
 _ACEOF
 
+fi
+fi
 
-ice_have_setpgid=no
 
-for ac_func in setpgid
+ice_have_rename=no
+
+for ac_func in rename
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56822,87 +62590,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgid=yes
+ ice_have_rename=yes
 fi
 done
 
-if test "${ice_have_setpgid}" = yes; then
-echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
-echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setpgid_decl+set}" = set; then
+if test "${ice_have_rename}" = yes; then
+{ echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
+echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_rename_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setpgid_decl=no
+ice_cv_have_rename_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -56914,12 +62674,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgid_decl=yes
+  $EGREP "${ice_re_word}rename[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgid_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -56933,35 +62693,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgid_decl=yes
+  $EGREP "${ice_re_word}rename[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgid_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6
-if test "$ice_cv_have_setpgid_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
+echo "${ECHO_T}$ice_cv_have_rename_decl" >&6; }
+if test "$ice_cv_have_rename_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGID_DECL 1
+#define HAVE_RENAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-fi
+ice_have_rewind=no
 
-echo "$as_me:$LINENO: checking for setpgrp" >&5
-echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp+set}" = set; then
+for ac_func in rewind
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -56970,12 +62733,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define setpgrp to an innocuous variant, in case <limits.h> declares setpgrp.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define setpgrp innocuous_setpgrp
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char setpgrp (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -56985,146 +62748,143 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef setpgrp
+#undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char setpgrp ();
+char $ac_func ();
 /* 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_setpgrp) || defined (__stub___setpgrp)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = setpgrp;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != setpgrp;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_setpgrp=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_setpgrp=no
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp" >&6
-if test $ac_cv_func_setpgrp = yes; then
-  echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
-echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp_void+set}" = set; then
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_rewind=yes
+fi
+done
+
+if test "${ice_have_rewind}" = yes; then
+{ echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
+echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_rewind_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
-echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+ice_cv_have_rewind_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <$header>
 
-int
-main ()
-{
-/* If this system has a BSD-style setpgrp which takes arguments,
-  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
-  exit successfully. */
-  exit (setpgrp (1,1) == -1 ? 0 : 1);
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_setpgrp_void=no
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}rewind[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
+fi
+rm -f conftest*
 
-( exit $ac_status )
-ac_cv_func_setpgrp_void=yes
+if test "$ice_cv_have_rewind_decl" = yes; then
+       break
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}rewind[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
 fi
+rm -f conftest*
+
+if test "$ice_cv_have_rewind_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
-if test $ac_cv_func_setpgrp_void = yes; then
+done
 
-cat >>confdefs.h <<\_ACEOF
-#define SETPGRP_VOID 1
+fi
+
+{ echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
+echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6; }
+if test "$ice_cv_have_rewind_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_REWIND_DECL 1
 _ACEOF
 
 fi
-
 fi
 
 
-ice_have_setpgrp=no
+ice_have_ruserok=no
 
-for ac_func in setpgrp
+for ac_func in ruserok
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -57150,87 +62910,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgrp=yes
+ ice_have_ruserok=yes
 fi
 done
 
-if test "${ice_have_setpgrp}" = yes; then
-echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_setpgrp_decl+set}" = set; then
+if test "${ice_have_ruserok}" = yes; then
+{ echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
+echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_ruserok_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setpgrp_decl=no
+ice_cv_have_ruserok_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h unistd.h libc.h; do
+for header in netdb.h sys/socket.h libc.h unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -57242,12 +62994,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgrp[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgrp_decl=yes
+  $EGREP "${ice_re_word}ruserok[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -57261,39 +63013,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgrp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgrp_decl=yes
+  $EGREP "${ice_re_word}ruserok[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
+echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6; }
+if test "$ice_cv_have_ruserok_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGRP_DECL 1
+#define HAVE_RUSEROK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_select=no
 
-ice_have_setsockopt=no
-
-for ac_func in setsockopt
+for ac_func in select
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -57319,87 +63070,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setsockopt=yes
+ ice_have_select=yes
 fi
 done
 
-if test "${ice_have_setsockopt}" = yes; then
-echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_setsockopt_decl+set}" = set; then
+if test "${ice_have_select}" = yes; then
+{ echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
+echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_select_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setsockopt_decl=no
+ice_cv_have_select_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -57411,12 +63154,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setsockopt[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setsockopt_decl=yes
+  $EGREP "${ice_re_word}select[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_select_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -57430,24 +63173,24 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setsockopt_decl=yes
+  $EGREP "${ice_re_word}select[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_select_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
+echo "${ECHO_T}$ice_cv_have_select_decl" >&6; }
+if test "$ice_cv_have_select_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETSOCKOPT_DECL 1
+#define HAVE_SELECT_DECL 1
 _ACEOF
 
 fi
 
 
 
-for ac_func in shmget
+
+
+
+
+
+for ac_header in sys/time.h \
+           sys/types.h \
+           sys/select.h \
+           sys/socket.h \
+           unistd.h \
+
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); 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
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#undef $ac_func
+       ac_header_compiler=no
+fi
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+fi
+
+done
+
 
-       echo "$as_me:$LINENO: checking for shmdt() argument type" >&5
-echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6
-if test "${amanda_cv_shmdt_arg_type+set}" = set; then
+       { echo "$as_me:$LINENO: checking for select() argument type" >&5
+echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6; }
+if test "${amanda_cv_select_arg_type+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
+               rm -f conftest.c
+               cat <<EOF >conftest.$ac_ext
 #include "confdefs.h"
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
 #endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
+#ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
 #endif
-
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
 #endif
 
 int main()
 {
-    int i;
-    return 0;
+#ifdef FD_SET_POINTER
+       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
+#else
+       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
+#endif
+       return 0;
 }
 EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
+
+               # Figure out the select argument type by first trying to
+               # compile with the fd_set argument.  If the compile fails,
+               # then we know to use the int.  If it suceeds, then try to
+               # use the int.  If the int fails, then use fd_set.  If
+               # both suceeed, then do a line count on the number of
+               # lines that the compiler spit out, assuming that the
+               # compile outputing more lines had more errors.
+               amanda_cv_select_arg_type=no
+               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
+               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
+               if test $? -ne 0; then
+                   amanda_cv_select_arg_type=int
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
+                   if test $? -ne 0; then
+                       amanda_cv_select_arg_type=fd_set
+                   fi
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   wc_fdset=`wc -l <conftest.fd_set`
+                   wc_int=`wc -l <conftest.int`
+                   if test "$wc_fdset" -le "$wc_int"; then
+                       amanda_cv_select_arg_type=fd_set
                    else
-                       amanda_cv_shmdt_arg_type=char
+                       amanda_cv_select_arg_type=int
                    fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
                fi
+               rm -f conftest*
 
 
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5
-echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6
+{ echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
+echo "${ECHO_T}$amanda_cv_select_arg_type" >&6; }
 
 cat >>confdefs.h <<_ACEOF
-#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type
-_ACEOF
-
-
-
-       case "$FORCE_MMAP" in
-       n | no)
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYSVSHM 1
+#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
 _ACEOF
 
-         ;;
-       esac
-
 
-fi
-done
 
 
-ice_have_shmat=no
+ice_have_sendto=no
 
-for ac_func in shmat
+for ac_func in sendto
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -57655,87 +63466,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmat=yes
+ ice_have_sendto=yes
 fi
 done
 
-if test "${ice_have_shmat}" = yes; then
-echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmat_decl+set}" = set; then
+if test "${ice_have_sendto}" = yes; then
+{ echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_sendto_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmat_decl=no
+ice_cv_have_sendto_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -57747,12 +63550,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
+  $EGREP "${ice_re_word}sendto[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_sendto_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
+if test "$ice_cv_have_sendto_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -57766,38 +63569,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
+  $EGREP "${ice_re_word}sendto[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_sendto_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
+if test "$ice_cv_have_sendto_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6
-if test "$ice_cv_have_shmat_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
+echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6; }
+if test "$ice_cv_have_sendto_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMAT_DECL 1
+#define HAVE_SENDTO_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_shmctl=no
+ice_have_setegid=no
 
-for ac_func in shmctl
+for ac_func in setegid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -57823,87 +63626,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmctl=yes
+ ice_have_setegid=yes
 fi
 done
 
-if test "${ice_have_shmctl}" = yes; then
-echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmctl_decl+set}" = set; then
+if test "${ice_have_setegid}" = yes; then
+{ echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setegid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmctl_decl=no
+ice_cv_have_setegid_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -57915,12 +63710,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
+  $EGREP "${ice_re_word}setegid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmctl_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -57934,38 +63729,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
+  $EGREP "${ice_re_word}setegid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmctl_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6
-if test "$ice_cv_have_shmctl_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6; }
+if test "$ice_cv_have_setegid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMCTL_DECL 1
+#define HAVE_SETEGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_shmdt=no
+ice_have_seteuid=no
 
-for ac_func in shmdt
+for ac_func in seteuid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -57991,87 +63786,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmdt=yes
+ ice_have_seteuid=yes
 fi
 done
 
-if test "${ice_have_shmdt}" = yes; then
-echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmdt_decl+set}" = set; then
+if test "${ice_have_seteuid}" = yes; then
+{ echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
+echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_seteuid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmdt_decl=no
+ice_cv_have_seteuid_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -58083,12 +63870,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
+  $EGREP "${ice_re_word}seteuid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -58102,38 +63889,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
+  $EGREP "${ice_re_word}seteuid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6
-if test "$ice_cv_have_shmdt_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6; }
+if test "$ice_cv_have_seteuid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMDT_DECL 1
+#define HAVE_SETEUID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_shmget=no
+ice_have_setresgid=no
 
-for ac_func in shmget
+for ac_func in setresgid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58159,87 +63946,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmget=yes
+ ice_have_setresgid=yes
 fi
 done
 
-if test "${ice_have_shmget}" = yes; then
-echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmget_decl+set}" = set; then
+if test "${ice_have_setresgid}" = yes; then
+{ echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setresgid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmget_decl=no
+ice_cv_have_setresgid_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -58251,12 +64030,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
+  $EGREP "${ice_re_word}setresgid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmget_decl" = yes; then
+if test "$ice_cv_have_setresgid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -58270,60 +64049,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
+  $EGREP "${ice_re_word}setresgid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmget_decl" = yes; then
+if test "$ice_cv_have_setresgid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6
-if test "$ice_cv_have_shmget_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6; }
+if test "$ice_cv_have_setresgid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMGET_DECL 1
+#define HAVE_SETRESGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
-    case "$FORCE_MMAP" in
-    n | no)
-       if test "x$ac_cv_func_shmget" != xyes; then
-           { echo "$as_me:$LINENO: WARNING: *** Neither shmget() nor mmap() found!" >&5
-echo "$as_me: WARNING: *** Neither shmget() nor mmap() found!" >&2;}
-           { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
-echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
-           NO_SERVER_MODE=true
-       fi
-      ;;
-    y | ye | yes)
-       { echo "$as_me:$LINENO: WARNING: *** --with-mmap used on a system with no mmap() support!" >&5
-echo "$as_me: WARNING: *** --with-mmap used on a system with no mmap() support!" >&2;}
-       { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
-echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
-       NO_SERVER_MODE=true
-      ;;
-    esac
-fi
-
-
-
+ice_have_setresuid=no
 
-for ac_func in sigaction sigemptyset sigvec
+for ac_func in setresuid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58349,85 +64106,139 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_setresuid=yes
+fi
+done
 
+if test "${ice_have_setresuid}" = yes; then
+{ echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setresuid_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_setresuid_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in unistd.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}setresuid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_setresuid_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}setresuid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_setresuid_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_socket=no
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6; }
+if test "$ice_cv_have_setresuid_decl" = yes; then
 
-for ac_func in socket
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SETRESUID_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+for ac_func in shquote
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58453,149 +64264,77 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socket=yes
-fi
-done
-
-if test "${ice_have_socket}" = yes; then
-echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_socket_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_socket_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socket[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_socket_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_socket_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socket[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_socket_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_socket_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
-echo "${ECHO_T}$ice_cv_have_socket_decl" >&6
-if test "$ice_cv_have_socket_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKET_DECL 1
-_ACEOF
-
-fi
-fi
 
+ice_have_snprintf=no
 
-ice_have_socketpair=no
-
-for ac_func in socketpair
+for ac_func in snprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58621,87 +64360,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socketpair=yes
+ ice_have_snprintf=yes
 fi
 done
 
-if test "${ice_have_socketpair}" = yes; then
-echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_socketpair_decl+set}" = set; then
+if test "${ice_have_snprintf}" = yes; then
+{ echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_snprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_socketpair_decl=no
+ice_cv_have_snprintf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -58713,12 +64444,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socketpair[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_socketpair_decl=yes
+  $EGREP "${ice_re_word}snprintf[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socketpair_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -58732,38 +64463,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socketpair[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_socketpair_decl=yes
+  $EGREP "${ice_re_word}snprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socketpair_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
-echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6
-if test "$ice_cv_have_socketpair_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6; }
+if test "$ice_cv_have_snprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKETPAIR_DECL 1
+#define HAVE_SNPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_sscanf=no
+ice_have_vsnprintf=no
 
-for ac_func in sscanf
+for ac_func in vsnprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58789,84 +64520,76 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sscanf=yes
+ ice_have_vsnprintf=yes
 fi
 done
 
-if test "${ice_have_sscanf}" = yes; then
-echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
-echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_sscanf_decl+set}" = set; then
+if test "${ice_have_vsnprintf}" = yes; then
+{ echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_sscanf_decl=no
+ice_cv_have_vsnprintf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
 for header in stdio.h; do
@@ -58881,12 +64604,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sscanf[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_sscanf_decl=yes
+  $EGREP "${ice_re_word}vsnprintf[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vsnprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -58900,37 +64623,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sscanf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_sscanf_decl=yes
+  $EGREP "${ice_re_word}vsnprintf[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vsnprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6
-if test "$ice_cv_have_sscanf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6; }
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SSCANF_DECL 1
+#define HAVE_VSNPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-
-for ac_func in statfs statvfs
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+    { echo "$as_me:$LINENO: checking for setpgid" >&5
+echo $ECHO_N "checking for setpgid... $ECHO_C" >&6; }
+if test "${ac_cv_func_setpgid+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -58939,12 +64658,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+/* Define setpgid to an innocuous variant, in case <limits.h> declares setpgid.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define setpgid innocuous_setpgid
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    which can conflict with char setpgid (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -58954,87 +64673,77 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef setpgid
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
+char setpgid ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_setpgid || defined __stub___setpgid
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return setpgid ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_setpgid=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_func_setpgid=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
+echo "${ECHO_T}$ac_cv_func_setpgid" >&6; }
+if test $ac_cv_func_setpgid = yes; then
 
-fi
-done
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SETPGID 1
+_ACEOF
 
-ice_have_strerror=no
 
-for ac_func in strerror
+ice_have_setpgid=no
+
+for ac_func in setpgid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59060,87 +64769,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strerror=yes
+ ice_have_setpgid=yes
 fi
 done
 
-if test "${ice_have_strerror}" = yes; then
-echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_strerror_decl+set}" = set; then
+if test "${ice_have_setpgid}" = yes; then
+{ echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
+echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setpgid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strerror_decl=no
+ice_cv_have_setpgid_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h; do
+for header in sys/types.h unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -59152,12 +64853,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strerror[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strerror_decl=yes
+  $EGREP "${ice_re_word}setpgid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -59171,36 +64872,36 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strerror[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strerror_decl=yes
+  $EGREP "${ice_re_word}setpgid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6
-if test "$ice_cv_have_strerror_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6; }
+if test "$ice_cv_have_setpgid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR_DECL 1
+#define HAVE_SETPGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in strftime
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+fi
+
+
+{ echo "$as_me:$LINENO: checking for setpgrp" >&5
+echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6; }
+if test "${ac_cv_func_setpgrp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59209,12 +64910,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+/* Define setpgrp to an innocuous variant, in case <limits.h> declares setpgrp.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define setpgrp innocuous_setpgrp
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    which can conflict with char setpgrp (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -59224,161 +64925,145 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef setpgrp
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
+char setpgrp ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_setpgrp || defined __stub___setpgrp
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return setpgrp ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_setpgrp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       ac_cv_func_setpgrp=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
+{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp" >&6; }
+if test $ac_cv_func_setpgrp = yes; then
+  { echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6; }
+if test "${ac_cv_func_setpgrp_void+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strftime ();
+$ac_includes_default
 int
 main ()
 {
-strftime ();
+/* If this system has a BSD-style setpgrp which takes arguments,
+  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+  exit successfully. */
+  return setpgrp (1,1) != -1;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_intl_strftime=yes
+  ac_cv_func_setpgrp_void=no
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_strftime=no
+( exit $ac_status )
+ac_cv_func_setpgrp_void=yes
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6; }
+if test $ac_cv_func_setpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SETPGRP_VOID 1
 _ACEOF
 
-LIBS="-lintl $LIBS"
 fi
 
 fi
-done
 
 
-ice_have_strftime=no
+ice_have_setpgrp=no
 
-for ac_func in strftime
+for ac_func in setpgrp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59404,87 +65089,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strftime=yes
+ ice_have_setpgrp=yes
 fi
 done
 
-if test "${ice_have_strftime}" = yes; then
-echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_strftime_decl+set}" = set; then
+if test "${ice_have_setpgrp}" = yes; then
+{ echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setpgrp_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strftime_decl=no
+ice_cv_have_setpgrp_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in time.h sys/time.h; do
+for header in sys/types.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -59496,12 +65173,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strftime[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strftime_decl=yes
+  $EGREP "${ice_re_word}setpgrp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strftime_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -59515,38 +65192,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strftime[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strftime_decl=yes
+  $EGREP "${ice_re_word}setpgrp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strftime_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6
-if test "$ice_cv_have_strftime_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6; }
+if test "$ice_cv_have_setpgrp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME_DECL 1
+#define HAVE_SETPGRP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strncasecmp=no
+ice_have_setsockopt=no
 
-for ac_func in strncasecmp
+for ac_func in setsockopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59572,87 +65249,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strncasecmp=yes
+ ice_have_setsockopt=yes
 fi
 done
 
-if test "${ice_have_strncasecmp}" = yes; then
-echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
+if test "${ice_have_setsockopt}" = yes; then
+{ echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_setsockopt_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strncasecmp_decl=no
+ice_cv_have_setsockopt_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -59664,12 +65333,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strncasecmp[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strncasecmp_decl=yes
+  $EGREP "${ice_re_word}setsockopt[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -59683,38 +65352,134 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strncasecmp[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strncasecmp_decl=yes
+  $EGREP "${ice_re_word}setsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6; }
+if test "$ice_cv_have_setsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRNCASECMP_DECL 1
+#define HAVE_SETSOCKOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_syslog=no
 
-for ac_func in syslog
+
+for ac_func in sigaction sigemptyset sigvec
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ice_have_socket=no
+
+for ac_func in socket
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59740,87 +65505,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_syslog=yes
+ ice_have_socket=yes
 fi
 done
 
-if test "${ice_have_syslog}" = yes; then
-echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5
-echo $ECHO_N "checking for syslog declaration in syslog.h... $ECHO_C" >&6
-if test "${ice_cv_have_syslog_decl+set}" = set; then
+if test "${ice_have_socket}" = yes; then
+{ echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_socket_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_syslog_decl=no
+ice_cv_have_socket_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in syslog.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -59832,12 +65589,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}syslog[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_syslog_decl=yes
+  $EGREP "${ice_re_word}socket[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_syslog_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -59851,38 +65608,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}syslog[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_syslog_decl=yes
+  $EGREP "${ice_re_word}socket[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_syslog_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5
-echo "${ECHO_T}$ice_cv_have_syslog_decl" >&6
-if test "$ice_cv_have_syslog_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
+echo "${ECHO_T}$ice_cv_have_socket_decl" >&6; }
+if test "$ice_cv_have_socket_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SYSLOG_DECL 1
+#define HAVE_SOCKET_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_system=no
+ice_have_socketpair=no
 
-for ac_func in system
+for ac_func in socketpair
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59908,87 +65665,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_system=yes
+ ice_have_socketpair=yes
 fi
 done
 
-if test "${ice_have_system}" = yes; then
-echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5
-echo $ECHO_N "checking for system declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_system_decl+set}" = set; then
+if test "${ice_have_socketpair}" = yes; then
+{ echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_socketpair_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_system_decl=no
+ice_cv_have_socketpair_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdlib.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60000,12 +65749,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}system[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_system_decl=yes
+  $EGREP "${ice_re_word}socketpair[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_socketpair_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_system_decl" = yes; then
+if test "$ice_cv_have_socketpair_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60019,38 +65768,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}system[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_system_decl=yes
+  $EGREP "${ice_re_word}socketpair[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_socketpair_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_system_decl" = yes; then
+if test "$ice_cv_have_socketpair_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5
-echo "${ECHO_T}$ice_cv_have_system_decl" >&6
-if test "$ice_cv_have_system_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
+echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6; }
+if test "$ice_cv_have_socketpair_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SYSTEM_DECL 1
+#define HAVE_SOCKETPAIR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_time=no
+ice_have_sscanf=no
 
-for ac_func in time
+for ac_func in sscanf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60076,87 +65825,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_time=yes
+ ice_have_sscanf=yes
 fi
 done
 
-if test "${ice_have_time}" = yes; then
-echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for time declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_time_decl+set}" = set; then
+if test "${ice_have_sscanf}" = yes; then
+{ echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
+echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_sscanf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_time_decl=no
+ice_cv_have_sscanf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in time.h sys/time.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60168,12 +65909,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}time[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_time_decl=yes
+  $EGREP "${ice_re_word}sscanf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_time_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60187,38 +65928,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}time[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_time_decl=yes
+  $EGREP "${ice_re_word}sscanf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_time_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5
-echo "${ECHO_T}$ice_cv_have_time_decl" >&6
-if test "$ice_cv_have_time_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6; }
+if test "$ice_cv_have_sscanf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_TIME_DECL 1
+#define HAVE_SSCANF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_tolower=no
+ice_have_strerror=no
 
-for ac_func in tolower
+for ac_func in strerror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60244,87 +65985,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_tolower=yes
+ ice_have_strerror=yes
 fi
 done
 
-if test "${ice_have_tolower}" = yes; then
-echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5
-echo $ECHO_N "checking for tolower declaration in ctype.h... $ECHO_C" >&6
-if test "${ice_cv_have_tolower_decl+set}" = set; then
+if test "${ice_have_strerror}" = yes; then
+{ echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strerror_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_tolower_decl=no
+ice_cv_have_strerror_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in ctype.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60336,12 +66069,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}tolower[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_tolower_decl=yes
+  $EGREP "${ice_re_word}strerror[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strerror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_tolower_decl" = yes; then
+if test "$ice_cv_have_strerror_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60355,38 +66088,36 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}tolower[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_tolower_decl=yes
+  $EGREP "${ice_re_word}strerror[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strerror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_tolower_decl" = yes; then
+if test "$ice_cv_have_strerror_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5
-echo "${ECHO_T}$ice_cv_have_tolower_decl" >&6
-if test "$ice_cv_have_tolower_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6; }
+if test "$ice_cv_have_strerror_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_TOLOWER_DECL 1
+#define HAVE_STRERROR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_toupper=no
-
-for ac_func in toupper
+for ac_func in strftime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60412,149 +66143,148 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_toupper=yes
-fi
-done
 
-if test "${ice_have_toupper}" = yes; then
-echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5
-echo $ECHO_N "checking for toupper declaration in ctype.h... $ECHO_C" >&6
-if test "${ice_cv_have_toupper_decl+set}" = set; then
+else
+  # strftime is in -lintl on SCO UNIX.
+{ echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_intl_strftime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_toupper_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in ctype.h; do
-# Check for ordinary declaration
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
 
+/* 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 strftime ();
+int
+main ()
+{
+return strftime ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}toupper[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_toupper_decl=yes
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_intl_strftime=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_intl_strftime=no
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_toupper_decl" = yes; then
-       break
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; }
+if test $ac_cv_lib_intl_strftime = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRFTIME 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}toupper[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_toupper_decl=yes
+LIBS="-lintl $LIBS"
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_toupper_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5
-echo "${ECHO_T}$ice_cv_have_toupper_decl" >&6
-if test "$ice_cv_have_toupper_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TOUPPER_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_ungetc=no
+ice_have_strftime=no
 
-for ac_func in ungetc
+for ac_func in strftime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60580,87 +66310,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ungetc=yes
+ ice_have_strftime=yes
 fi
 done
 
-if test "${ice_have_ungetc}" = yes; then
-echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5
-echo $ECHO_N "checking for ungetc declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_ungetc_decl+set}" = set; then
+if test "${ice_have_strftime}" = yes; then
+{ echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strftime_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_ungetc_decl=no
+ice_cv_have_strftime_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60672,12 +66394,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ungetc[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_ungetc_decl=yes
+  $EGREP "${ice_re_word}strftime[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strftime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ungetc_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60691,36 +66413,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ungetc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ungetc_decl=yes
+  $EGREP "${ice_re_word}strftime[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strftime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ungetc_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_ungetc_decl" >&6
-if test "$ice_cv_have_ungetc_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6; }
+if test "$ice_cv_have_strftime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_UNGETC_DECL 1
+#define HAVE_STRFTIME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in vprintf
+ice_have_strncasecmp=no
+
+for ac_func in strncasecmp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60746,184 +66470,141 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_strncasecmp=yes
+fi
+done
 
-echo "$as_me:$LINENO: checking for _doprnt" >&5
-echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
-if test "${ac_cv_func__doprnt+set}" = set; then
+if test "${ice_have_strncasecmp}" = yes; then
+{ echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+ice_cv_have_strncasecmp_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in string.h strings.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define _doprnt innocuous__doprnt
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _doprnt (); 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
+#include <$header>
 
-#undef _doprnt
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}strncasecmp[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strncasecmp_decl=yes
+fi
+rm -f conftest*
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char _doprnt ();
-/* 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__doprnt) || defined (__stub____doprnt)
-choke me
-#else
-char (*f) () = _doprnt;
-#endif
-#ifdef __cplusplus
-}
-#endif
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-int
-main ()
-{
-return f != _doprnt;
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func__doprnt=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}strncasecmp[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strncasecmp_decl=yes
+fi
+rm -f conftest*
 
-ac_cv_func__doprnt=no
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+       break
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+done
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
-echo "${ECHO_T}$ac_cv_func__doprnt" >&6
-if test $ac_cv_func__doprnt = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DOPRNT 1
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6; }
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRNCASECMP_DECL 1
 _ACEOF
 
 fi
-
 fi
-done
-
 
 
-ice_have_vfprintf=no
+ice_have_syslog=no
 
-for ac_func in vfprintf
+for ac_func in syslog
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -60949,87 +66630,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vfprintf=yes
+ ice_have_syslog=yes
 fi
 done
 
-if test "${ice_have_vfprintf}" = yes; then
-echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for vfprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_vfprintf_decl+set}" = set; then
+if test "${ice_have_syslog}" = yes; then
+{ echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5
+echo $ECHO_N "checking for syslog declaration in syslog.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_syslog_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_vfprintf_decl=no
+ice_cv_have_syslog_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
+for header in syslog.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61041,12 +66714,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vfprintf[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vfprintf_decl=yes
+  $EGREP "${ice_re_word}syslog[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_syslog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vfprintf_decl" = yes; then
+if test "$ice_cv_have_syslog_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61060,38 +66733,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vfprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vfprintf_decl=yes
+  $EGREP "${ice_re_word}syslog[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_syslog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vfprintf_decl" = yes; then
+if test "$ice_cv_have_syslog_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_vfprintf_decl" >&6
-if test "$ice_cv_have_vfprintf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5
+echo "${ECHO_T}$ice_cv_have_syslog_decl" >&6; }
+if test "$ice_cv_have_syslog_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_VFPRINTF_DECL 1
+#define HAVE_SYSLOG_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_vprintf=no
+ice_have_system=no
 
-for ac_func in vprintf
+for ac_func in system
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61117,87 +66790,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vprintf=yes
+ ice_have_system=yes
 fi
 done
 
-if test "${ice_have_vprintf}" = yes; then
-echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for vprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_vprintf_decl+set}" = set; then
+if test "${ice_have_system}" = yes; then
+{ echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5
+echo $ECHO_N "checking for system declaration in stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_system_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_vprintf_decl=no
+ice_cv_have_system_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61209,12 +66874,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vprintf[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vprintf_decl=yes
+  $EGREP "${ice_re_word}system[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_system_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vprintf_decl" = yes; then
+if test "$ice_cv_have_system_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61228,38 +66893,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vprintf_decl=yes
+  $EGREP "${ice_re_word}system[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_system_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vprintf_decl" = yes; then
+if test "$ice_cv_have_system_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_vprintf_decl" >&6
-if test "$ice_cv_have_vprintf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5
+echo "${ECHO_T}$ice_cv_have_system_decl" >&6; }
+if test "$ice_cv_have_system_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF_DECL 1
+#define HAVE_SYSTEM_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_vsprintf=no
+ice_have_time=no
 
-for ac_func in vsprintf
+for ac_func in time
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61285,87 +66950,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vsprintf=yes
+ ice_have_time=yes
 fi
 done
 
-if test "${ice_have_vsprintf}" = yes; then
-echo "$as_me:$LINENO: checking for vsprintf declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for vsprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_vsprintf_decl+set}" = set; then
+if test "${ice_have_time}" = yes; then
+{ echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for time declaration in time.h sys/time.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_time_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_vsprintf_decl=no
+ice_cv_have_time_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61377,12 +67034,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsprintf[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vsprintf_decl=yes
+  $EGREP "${ice_re_word}time[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_time_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsprintf_decl" = yes; then
+if test "$ice_cv_have_time_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61396,130 +67053,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vsprintf_decl=yes
+  $EGREP "${ice_re_word}time[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_time_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsprintf_decl" = yes; then
+if test "$ice_cv_have_time_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_vsprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_vsprintf_decl" >&6
-if test "$ice_cv_have_vsprintf_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5
+echo "${ECHO_T}$ice_cv_have_time_decl" >&6; }
+if test "$ice_cv_have_time_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_VSPRINTF_DECL 1
-_ACEOF
-
-fi
-fi
-
-echo "$as_me:$LINENO: checking for wait4" >&5
-echo $ECHO_N "checking for wait4... $ECHO_C" >&6
-if test "${ac_cv_func_wait4+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define wait4 to an innocuous variant, in case <limits.h> declares wait4.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define wait4 innocuous_wait4
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char wait4 (); 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 wait4
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char wait4 ();
-/* 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_wait4) || defined (__stub___wait4)
-choke me
-#else
-char (*f) () = wait4;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != wait4;
-  ;
-  return 0;
-}
+#define HAVE_TIME_DECL 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_wait4=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_wait4=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5
-echo "${ECHO_T}$ac_cv_func_wait4" >&6
 
-#AC_REPLACE_FUNCS(writev)
 
-ice_have_writev=no
+ice_have_tolower=no
 
-for ac_func in writev
+for ac_func in tolower
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61545,87 +67110,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_writev=yes
+ ice_have_tolower=yes
 fi
 done
 
-if test "${ice_have_writev}" = yes; then
-echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
-echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6
-if test "${ice_cv_have_writev_decl+set}" = set; then
+if test "${ice_have_tolower}" = yes; then
+{ echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5
+echo $ECHO_N "checking for tolower declaration in ctype.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_tolower_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_writev_decl=no
+ice_cv_have_tolower_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h sys/uio.h; do
+for header in ctype.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61637,12 +67194,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}writev[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_writev_decl=yes
+  $EGREP "${ice_re_word}tolower[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_tolower_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_writev_decl" = yes; then
+if test "$ice_cv_have_tolower_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61656,38 +67213,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}writev[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_writev_decl=yes
+  $EGREP "${ice_re_word}tolower[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_tolower_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_writev_decl" = yes; then
+if test "$ice_cv_have_tolower_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
-echo "${ECHO_T}$ice_cv_have_writev_decl" >&6
-if test "$ice_cv_have_writev_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5
+echo "${ECHO_T}$ice_cv_have_tolower_decl" >&6; }
+if test "$ice_cv_have_tolower_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_WRITEV_DECL 1
+#define HAVE_TOLOWER_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strcasecmp=no
+ice_have_toupper=no
 
-for ac_func in strcasecmp
+for ac_func in toupper
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61713,87 +67270,79 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strcasecmp=yes
+ ice_have_toupper=yes
 fi
 done
 
-if test "${ice_have_strcasecmp}" = yes; then
-echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for strcasecmp declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_strcasecmp_decl+set}" = set; then
+if test "${ice_have_toupper}" = yes; then
+{ echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5
+echo $ECHO_N "checking for toupper declaration in ctype.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_toupper_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strcasecmp_decl=no
+ice_cv_have_toupper_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h; do
+for header in ctype.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61805,12 +67354,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strcasecmp[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strcasecmp_decl=yes
+  $EGREP "${ice_re_word}toupper[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_toupper_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
+if test "$ice_cv_have_toupper_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61824,37 +67373,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strcasecmp[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strcasecmp_decl=yes
+  $EGREP "${ice_re_word}toupper[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_toupper_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
+if test "$ice_cv_have_toupper_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strcasecmp_decl" >&6
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
+{ echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5
+echo "${ECHO_T}$ice_cv_have_toupper_decl" >&6; }
+if test "$ice_cv_have_toupper_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRCASECMP_DECL 1
+#define HAVE_TOUPPER_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_ungetc=no
 
-for ac_func in fnmatch
+for ac_func in ungetc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61880,309 +67430,142 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* 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_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
+ ice_have_ungetc=yes
 fi
 done
 
-
-
-echo "$as_me:$LINENO: checking disk device prefixes" >&5
-echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6
-dfline=`(
-    df / | while read line; do
-       set -- $line
-       while test $# -gt 0; do
-           if test "x$1" = "x/"; then
-               echo $line
-               break 2
-           fi
-           shift
-       done
-    done
-) | sed 's/(//' | sed 's/)//' `
-
-mount=`(
-    set -- $dfline
-    while test $# -gt 0; do
-       if expr "$1" : '.*dev' >/dev/null 2>&1; then
-           echo $1
-           break
-       fi
-       shift
-    done
-)`
-
-if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
-    echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5
-echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6
-else
-    if test -d /dev/dsk; then
-       DEV_PREFIX=/dev/dsk/
-       if test -d /dev/rdsk; then
-           RDEV_PREFIX=/dev/rdsk/
-       else
-           RDEV_PREFIX=/dev/dsk/
-       fi
-    elif test -d /dev; then
-       case "$target" in
-           *-sni-sysv4)
-               dev_prefix=/dev/dsk/
-               rdev_prefix=/dev/rdsk/
-               { echo "$as_me:$LINENO: WARNING: \"*** Run amsinixfixdevs on Sinix systems using VxFS.\"" >&5
-echo "$as_me: WARNING: \"*** Run amsinixfixdevs on Sinix systems using VxFS.\"" >&2;}
-               ;;
-
-            *)
-               DEV_PREFIX=/dev/
-               # Some systems, notably Linux, do not have raw disk devices
-               # names.  Check this by trying to see if a raw disk device name
-               # exists using the normal raw device path prepended to the
-               # mount point of the root filesystem.
-               if test "$mount"; then
-                   dev_name="/dev/r`basename $mount`"
-                   if test -b $dev_name -o -c $dev_name; then
-                       RDEV_PREFIX=/dev/r
-                   else
-                       RDEV_PREFIX=/dev/
-                   fi
-               else
-                   RDEV_PREFIX=/dev/r
-               fi
-               ;;
-       esac
-    else
-       DEV_PREFIX=/
-       RDEV_PREFIX=/
-    fi
-    echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5
-echo "${ECHO_T}$DEV_PREFIX - $RDEV_PREFIX" >&6
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DEV_PREFIX "${DEV_PREFIX}"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define RDEV_PREFIX "${RDEV_PREFIX}"
-_ACEOF
-
-
-case $mount in
-    /dev/vg*)
-       { echo "$as_me:$LINENO: WARNING: \"*** Run amhpfixdevs on HP-UX systems using /dev/vg??.\"" >&5
-echo "$as_me: WARNING: \"*** Run amhpfixdevs on HP-UX systems using /dev/vg??.\"" >&2;}
-       ;;
-esac
-
-echo "$as_me:$LINENO: checking whether posix fcntl locking works" >&5
-echo $ECHO_N "checking whether posix fcntl locking works... $ECHO_C" >&6
-if test "${amanda_cv_posix_filelocking+set}" = set; then
+if test "${ice_have_ungetc}" = yes; then
+{ echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5
+echo $ECHO_N "checking for ungetc declaration in stdio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_ungetc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-       if test "$cross_compiling" = yes; then
-
-       amanda_cv_posix_filelocking="no (cannot run test)"
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
+ice_cv_have_ungetc_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_POSIX_FCNTL
-#include "${srcdir-.}/common-src/amflock.c"
+#include <$header>
 
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-       amanda_cv_posix_filelocking=yes
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-
-       amanda_cv_posix_filelocking="no"
-
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-    rm -f /tmp/conftest.lock
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}ungetc[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ungetc_decl=yes
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5
-echo "${ECHO_T}$amanda_cv_posix_filelocking" >&6
-if test "x$amanda_cv_posix_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_POSIX_FCNTL 1
-_ACEOF
+rm -f conftest*
 
-    HAS_WORKING_FILE_LOCK=1
+if test "$ice_cv_have_ungetc_decl" = yes; then
+       break
 fi
-
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    echo "$as_me:$LINENO: checking whether flock locking works" >&5
-echo $ECHO_N "checking whether flock locking works... $ECHO_C" >&6
-if test "${amanda_cv_flock_filelocking+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-           if test "$cross_compiling" = yes; then
-
-                   amanda_cv_flock_filelocking="no (cannot run test)"
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_FLOCK
-#include "${srcdir-.}/common-src/amflock.c"
+#include <$header>
 
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-                   amanda_cv_flock_filelocking="yes"
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-
-                   amanda_cv_flock_filelocking="no"
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}ungetc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ungetc_decl=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest*
+
+if test "$ice_cv_have_ungetc_decl" = yes; then
+       break
 fi
-       rm -f /tmp/conftest.lock
+done
 
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5
-echo "${ECHO_T}$amanda_cv_flock_filelocking" >&6
-    if test "x$amanda_cv_flock_filelocking" = xyes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_FLOCK 1
+{ echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_ungetc_decl" >&6; }
+if test "$ice_cv_have_ungetc_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNGETC_DECL 1
 _ACEOF
 
-       HAS_WORKING_FILE_LOCK=1
-    fi
+fi
 fi
 
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    echo "$as_me:$LINENO: checking whether lockf locking works" >&5
-echo $ECHO_N "checking whether lockf locking works... $ECHO_C" >&6
-if test "${amanda_cv_lockf_filelocking+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-           if test "$cross_compiling" = yes; then
 
-                   amanda_cv_lockf_filelocking="no (cannot run test)"
+ice_have_vfprintf=no
 
+for ac_func in vfprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -62190,584 +67573,561 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_LOCKF
-#include "${srcdir-.}/common-src/amflock.c"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-                   amanda_cv_lockf_filelocking="yes"
+#undef $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-
-                   amanda_cv_lockf_filelocking="no"
-
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+       eval "$as_ac_var=no"
 fi
-       rm -f /tmp/conftest.lock
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5
-echo "${ECHO_T}$amanda_cv_lockf_filelocking" >&6
-    if test "x$amanda_cv_lockf_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_LOCKF 1
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-       HAS_WORKING_FILE_LOCK=1
-    fi
+ ice_have_vfprintf=yes
 fi
+done
 
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    echo "$as_me:$LINENO: checking whether lnlock locking works" >&5
-echo $ECHO_N "checking whether lnlock locking works... $ECHO_C" >&6
-if test "${amanda_cv_lnlock_filelocking+set}" = set; then
+if test "${ice_have_vfprintf}" = yes; then
+{ echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for vfprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_vfprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-           if test "$cross_compiling" = yes; then
-
-                   amanda_cv_lnlock_filelocking="no (cannot run test)"
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
+ice_cv_have_vfprintf_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h stdlib.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_LNLOCK
-#include "${srcdir-.}/common-src/amflock.c"
-#include "${srcdir-.}/common-src/alloc.c"
-#include "${srcdir-.}/common-src/error.c"
-#include "${srcdir-.}/common-src/snprintf.c"
+#include <$header>
 
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-                   amanda_cv_lnlock_filelocking="yes"
-
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-
-                   amanda_cv_lnlock_filelocking="no"
-
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}vfprintf[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vfprintf_decl=yes
 fi
-       rm -f /tmp/conftest.lock
+rm -f conftest*
 
+if test "$ice_cv_have_vfprintf_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5
-echo "${ECHO_T}$amanda_cv_lnlock_filelocking" >&6
-    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_LNLOCK 1
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-       HAS_WORKING_FILE_LOCK=1
-    fi
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}vfprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vfprintf_decl=yes
 fi
+rm -f conftest*
 
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    { echo "$as_me:$LINENO: WARNING: *** No working file locking capability found!" >&5
-echo "$as_me: WARNING: *** No working file locking capability found!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: *** Be VERY VERY careful." >&5
-echo "$as_me: WARNING: *** Be VERY VERY careful." >&2;}
+if test "$ice_cv_have_vfprintf_decl" = yes; then
+       break
 fi
+done
 
-
-
-
-
-
-
-
-
-if test x"$NO_CLIENT_MODE" != x"true"; then
-  WANT_CLIENT_TRUE=
-  WANT_CLIENT_FALSE='#'
-else
-  WANT_CLIENT_TRUE='#'
-  WANT_CLIENT_FALSE=
 fi
 
+{ echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_vfprintf_decl" >&6; }
+if test "$ice_cv_have_vfprintf_decl" = yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VFPRINTF_DECL 1
+_ACEOF
 
-if test ! -z "$SAMBA_CLIENT"; then
-  WANT_SAMBA_TRUE=
-  WANT_SAMBA_FALSE='#'
-else
-  WANT_SAMBA_TRUE='#'
-  WANT_SAMBA_FALSE=
 fi
-
-
-
-if test x"$NO_RESTORE_MODE" != x"true"; then
-  WANT_RESTORE_TRUE=
-  WANT_RESTORE_FALSE='#'
-else
-  WANT_RESTORE_TRUE='#'
-  WANT_RESTORE_FALSE=
 fi
 
 
+ice_have_vprintf=no
 
-if test x"$NO_SERVER_MODE" != x"true"; then
-  WANT_SERVER_TRUE=
-  WANT_SERVER_FALSE='#'
+for ac_func in vprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  WANT_SERVER_TRUE='#'
-  WANT_SERVER_FALSE=
-fi
-
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-if test x"$NO_RECOVER_MODE" != x"true" && test x"$NO_CLIENT_MODE" != x"true"; then
-  WANT_RECOVER_TRUE=
-  WANT_RECOVER_FALSE='#'
-else
-  WANT_RECOVER_TRUE='#'
-  WANT_RECOVER_FALSE=
-fi
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
+#undef $ac_func
 
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
-if test x"$NO_SERVER_MODE" != x"true" || test x"$NO_RESTORE_MODE" != x"true"; then
-  WANT_TAPE_TRUE=
-  WANT_TAPE_FALSE='#'
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  WANT_TAPE_TRUE='#'
-  WANT_TAPE_FALSE=
-fi
-
-
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test x"$NO_AMPLOT_MODE" != x"true"; then
-  WANT_AMPLOT_TRUE=
-  WANT_AMPLOT_FALSE='#'
-else
-  WANT_AMPLOT_TRUE='#'
-  WANT_AMPLOT_FALSE=
+       eval "$as_ac_var=no"
 fi
 
-
-
-if test x"$NO_SCSI_CHANGER_MODE" != x"true"; then
-  WANT_CHG_SCSI_TRUE=
-  WANT_CHG_SCSI_FALSE='#'
-else
-  WANT_CHG_SCSI_TRUE='#'
-  WANT_CHG_SCSI_FALSE=
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-
-
-
-if test x"$NO_CHIO_CHANGER_MODE" != x"true"; then
-  WANT_CHIO_SCSI_TRUE=
-  WANT_CHIO_SCSI_FALSE='#'
-else
-  WANT_CHIO_SCSI_TRUE='#'
-  WANT_CHIO_SCSI_FALSE=
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_vprintf=yes
 fi
+done
 
-
-
-if test x"$NEED_RUNTIME_PSEUDO_RELOC" = x"true"; then
-  WANT_RUNTIME_PSEUDO_RELOC_TRUE=
-  WANT_RUNTIME_PSEUDO_RELOC_FALSE='#'
+if test "${ice_have_vprintf}" = yes; then
+{ echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for vprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_vprintf_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  WANT_RUNTIME_PSEUDO_RELOC_TRUE='#'
-  WANT_RUNTIME_PSEUDO_RELOC_FALSE=
-fi
-
 
+ice_cv_have_vprintf_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h stdlib.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-if test x"$NEED_SETUID_CLIENT" != x"false"; then
-  WANT_SETUID_CLIENT_TRUE=
-  WANT_SETUID_CLIENT_FALSE='#'
-else
-  WANT_SETUID_CLIENT_TRUE='#'
-  WANT_SETUID_CLIENT_FALSE=
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}vprintf[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vprintf_decl=yes
 fi
+rm -f conftest*
 
-
-
-if test x"$SSH_SECURITY_SET" = x"true"; then
-  WANT_SSH_SECURITY_TRUE=
-  WANT_SSH_SECURITY_FALSE='#'
-else
-  WANT_SSH_SECURITY_TRUE='#'
-  WANT_SSH_SECURITY_FALSE=
+if test "$ice_cv_have_vprintf_decl" = yes; then
+       break
 fi
-
-
-case "${FORCE_USE_RUNDUMP-${USE_RUNDUMP}}" in
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define USE_RUNDUMP 1
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-;;
-esac
-
-# This is necessary so that .o files in LIBOBJS are also built via
-# the ANSI2KNR-filtering rules.
-LIBOBJS=`echo "$LIBOBJS" |
-             sed 's,\.[^.]* ,$U&,g;s,\.[^.]*$,$U&,'`
-LTLIBOBJS=`echo "$LIBOBJS" |
-           sed 's,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,'`
-
-
-LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'`
-
-
-## This stuff is needed for the documentation.
-DOC_BUILD_DATE=`date '+%d-%m-%Y'`
-
-
-# Check whether --enable-manpage-build or --disable-manpage-build was given.
-if test "${enable_manpage_build+set}" = set; then
-  enableval="$enable_manpage_build"
-   ENABLE_MANPAGE_BUILD=$enableval
-else
-   ENABLE_MANPAGE_BUILD=no
-fi;
-
-
-XSLTPROC_FLAGS="--nonet"
-
-
-# The (lack of) whitespace and overquoting here are all necessary for
-# proper formatting.
-
-# Check whether --with-xsltproc or --without-xsltproc was given.
-if test "${with_xsltproc+set}" = set; then
-  withval="$with_xsltproc"
-   ac_with_xsltproc=$withval;
-else
-   ac_with_xsltproc=maybe;
-fi;
-
-
-# Check whether --with-xsltproc-flags or --without-xsltproc-flags was given.
-if test "${with_xsltproc_flags+set}" = set; then
-  withval="$with_xsltproc_flags"
-   if test "x$withval" == "xno"; then
-       XSLTPROC_FLAGS=''
-    else
-       if test "x$withval" != "xyes"; then
-           XSLTPROC_FLAGS="$withval"
-       fi
-    fi
-
-fi;
-
-# search for xsltproc if it wasn't specified
-if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
-    for ac_prog in xsltproc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XSLTPROC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $XSLTPROC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-  ;;
-esac
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}vprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vprintf_decl=yes
 fi
-XSLTPROC=$ac_cv_path_XSLTPROC
+rm -f conftest*
 
-if test -n "$XSLTPROC"; then
-  echo "$as_me:$LINENO: result: $XSLTPROC" >&5
-echo "${ECHO_T}$XSLTPROC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+if test "$ice_cv_have_vprintf_decl" = yes; then
+       break
 fi
-
-  test -n "$XSLTPROC" && break
-done
-
-else
-    if test "$ac_with_xsltproc" != "no"; then
-        if test -x "$ac_with_xsltproc"; then
-            XSLTPROC="$ac_with_xsltproc";
-        else
-            { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&5
-echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&2;}
-            { echo "$as_me:$LINENO: WARNING: executable; searching for an alternative." >&5
-echo "$as_me: WARNING: executable; searching for an alternative." >&2;}
-            for ac_prog in xsltproc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_XSLTPROC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $XSLTPROC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
 done
 
-  ;;
-esac
 fi
-XSLTPROC=$ac_cv_path_XSLTPROC
 
-if test -n "$XSLTPROC"; then
-  echo "$as_me:$LINENO: result: $XSLTPROC" >&5
-echo "${ECHO_T}$XSLTPROC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+{ echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_vprintf_decl" >&6; }
+if test "$ice_cv_have_vprintf_decl" = yes; then
 
-  test -n "$XSLTPROC" && break
-done
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF_DECL 1
+_ACEOF
 
-        fi
-    fi
+fi
 fi
 
-
-
-
-
-
-
-
-
-    echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5
-echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6
-if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then
+{ echo "$as_me:$LINENO: checking for wait4" >&5
+echo $ECHO_N "checking for wait4... $ECHO_C" >&6; }
+if test "${ac_cv_func_wait4+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define wait4 to an innocuous variant, in case <limits.h> declares wait4.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define wait4 innocuous_wait4
 
-       ac_cv_docbook_xslt_1_72_0=no
-       if test -n "$XSLTPROC"; then
-           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl'" >&5
-           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl >&5 2>&1
-
-           if test "$?" = 0; then
-               ac_cv_docbook_xslt_1_72_0=yes
-           fi
-       fi
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char wait4 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-fi
-echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5
-echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
-    HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0"
-    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_1_72_0
+#undef wait4
 
+/* 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 wait4 ();
+/* 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_wait4 || defined __stub___wait4
+choke me
+#endif
 
+int
+main ()
+{
+return wait4 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_wait4=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_func_wait4=no
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5
+echo "${ECHO_T}$ac_cv_func_wait4" >&6; }
 
 
+ice_have_writev=no
 
+for ac_func in writev
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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
 
-    echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5
-echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6
-if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+#undef $ac_func
 
-       ac_cv_docbook_dtd_4_1_2=no
-       if test -n "$XSLTPROC"; then
-           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
-           cat <<EOF >conftest.xml
-<?xml version="1.0" encoding='ISO-8859-1'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-<book id="empty">
-</book>
-EOF
-           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
-           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
-           if test "$?" = 0; then
-               # failing to load the DTD is just a warning, so check for it in the output.
-               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
-                   : # no good..
-               else
-                   ac_cv_docbook_dtd_4_1_2=yes
-               fi
-           fi
-           cat conftest.out >&5
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
 
-           rm -f conftest.xml conftest.out
-       fi
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       eval "$as_ac_var=no"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5
-echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6
-
-    HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2"
-    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_1_2
-
-
-
-
-
-
-
-
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_writev=yes
+fi
+done
 
-    echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5
-echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6
-if test "${ac_cv_docbook_dtd_4_2+set}" = set; then
+if test "${ice_have_writev}" = yes; then
+{ echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
+echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_writev_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-       ac_cv_docbook_dtd_4_2=no
-       if test -n "$XSLTPROC"; then
-           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
-           cat <<EOF >conftest.xml
-<?xml version="1.0" encoding='ISO-8859-1'?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-<book id="empty">
-</book>
-EOF
-           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
-           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
-           if test "$?" = 0; then
-               # failing to load the DTD is just a warning, so check for it in the output.
-               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
-                   : # no good..
-               else
-                   ac_cv_docbook_dtd_4_2=yes
-               fi
-           fi
-           cat conftest.out >&5
+ice_cv_have_writev_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in unistd.h sys/uio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-           rm -f conftest.xml conftest.out
-       fi
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}writev[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_writev_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_writev_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5
-echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-    HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2"
-    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_2
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}writev[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_writev_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_writev_decl" = yes; then
+       break
+fi
+done
 
+fi
 
-# and ensure that everything docbook-related is OK if we'll be using it
-if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
-    if test -z "$XSLTPROC"; then
-       { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5
-echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+{ echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
+echo "${ECHO_T}$ice_cv_have_writev_decl" >&6; }
+if test "$ice_cv_have_writev_decl" = yes; then
 
-    if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
-       { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 was not found." >&5
-echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 was not found." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WRITEV_DECL 1
+_ACEOF
 
-    if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
-       { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5
-echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;}
-       XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
-    fi
 fi
-
-
-if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
-  ENABLE_MANPAGE_BUILD_TRUE=
-  ENABLE_MANPAGE_BUILD_FALSE='#'
-else
-  ENABLE_MANPAGE_BUILD_TRUE='#'
-  ENABLE_MANPAGE_BUILD_FALSE=
 fi
 
 
-echo "$as_me:$LINENO: checking for working IPv6" >&5
-echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6
-if test "${amanda_working_ipv6+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  amanda_working_ipv6=yes
+ice_have_strcasecmp=no
 
+for ac_func in strcasecmp
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -62775,151 +68135,152 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); 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
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
+
+#undef $ac_func
+
+/* 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
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
+char $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
 #endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <errno.h>
 
-main()
+int
+main ()
 {
-   int aa;
-   aa = socket(AF_INET6, SOCK_STREAM, 0);
-   if (aa > 0) return 0;
-   return aa;
+return $ac_func ();
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_working_ipv6=yes
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-amanda_working_ipv6=no
+       eval "$as_ac_var=no"
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $amanda_working_ipv6" >&5
-echo "${ECHO_T}$amanda_working_ipv6" >&6
-
-if test "$BROKEN_IPV6" = true; then
-    amanda_working_ipv6=no;
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_strcasecmp=yes
 fi
+done
 
-if test "$amanda_working_ipv6" = yes; then
-    if test "$amanda_ipv6" != false; then
+if test "${ice_have_strcasecmp}" = yes; then
+{ echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for strcasecmp declaration in string.h strings.h... $ECHO_C" >&6; }
+if test "${ice_cv_have_strcasecmp_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-cat >>confdefs.h <<\_ACEOF
-#define WORKING_IPV6 1
+ice_cv_have_strcasecmp_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in string.h strings.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-    fi
-else
-    if test "$amanda_ipv6" = true; then
-        { { echo "$as_me:$LINENO: error: Asked for IPv6 but it is not working." >&5
-echo "$as_me: error: Asked for IPv6 but it is not working." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}strcasecmp[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strcasecmp_decl=yes
 fi
+rm -f conftest*
 
-
-
-if test "x$CC" = "xgcc"; then
-  GCC_COMPILER_TRUE=
-  GCC_COMPILER_FALSE='#'
-else
-  GCC_COMPILER_TRUE='#'
-  GCC_COMPILER_FALSE=
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
+       break
 fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}strcasecmp[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strcasecmp_decl=yes
+fi
+rm -f conftest*
 
-#### Enforce amanda code cleanliness rules.
-#### Done here to allow configuration code to remain intact.
-if test "x$CC" = "xgcc"; then
-  AM_CFLAGS="$AM_CFLAGS -Wall"
-  $CC -v --help 2>&1 | $GREP -- '-Wextra ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wextra"
-  else
-   AM_CFLAGS="$AM_CFLAGS -W"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wparentheses' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wparentheses"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wdeclaration-after-statement' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wdeclaration-after-statement"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wmissing-prototypes ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wmissing-prototypes"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wstrict-prototypes ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wmissing-declarations ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wformat' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wformat"
-  fi
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
+       break
+fi
+done
 
-  $CC -v --help 2>&1 | $GREP -- '-Wsign-compare' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wsign-compare"
-  fi
+fi
 
-  $CC -v --help 2>&1 | $GREP -- '-fno-strict-aliasing' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -fno-strict-aliasing"
-  fi
+{ echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strcasecmp_decl" >&6; }
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
 
-  $CC -v --help 2>&1 | $GREP -- '-Wfloat-equal' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wfloat-equal"
-  fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASECMP_DECL 1
+_ACEOF
 
-  $CC -v --help 2>&1 | $GREP -- '-Wold-style-definition' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wold-style-definition"
-  fi
 fi
+fi
+
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files gnulib/Makefile amplot/amcat.awk amplot/amplot.sh amplot/Makefile amandad-src/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl changer-src/chg-lib.sh client-src/patch-system.sh client-src/Makefile dumper-src/amgtar.pl dumper-src/generic-dumper.pl dumper-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/chg-mcutil.conf example/amanda-client.conf man/Makefile docs/Makefile recover-src/Makefile oldrecover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh server-src/amcrypt.sh server-src/amaespipe.sh server-src/amcrypt-ossl.sh server-src/amcrypt-ossl-asym.sh tape-src/Makefile config/Makefile Makefile"
+ac_config_files="$ac_config_files Makefile amandad-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile common-src/versuff.c config/Makefile device-src/Makefile device-src/tests/Makefile dumper-src/Makefile example/Makefile example/amanda-client.conf example/amanda.conf example/chg-mcutil.conf example/template.d/amanda-S3.conf example/template.d/advanced.conf example/template.d/amanda-harddisk.conf example/template.d/amanda-single-tape.conf example/template.d/amanda-tape-changer.conf gnulib/Makefile installcheck/Makefile man/Makefile oldrecover-src/Makefile packaging/Makefile perl/Makefile po/Makefile recover-src/Makefile restore-src/Makefile server-src/Makefile tape-src/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -62940,39 +68301,58 @@ _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, don't put newlines in cache variables' values.
+# 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    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 \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -62981,32 +68361,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ 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[        ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[    ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[      ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`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.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
     gl_LTLIBOBJS=$gl_ltlibobjs
 
 
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+if test -z "${WANT_SETUID_CLIENT_TRUE}" && test -z "${WANT_SETUID_CLIENT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_CLIENT_TRUE}" && test -z "${WANT_CLIENT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined.
+if test -z "${WANT_INSTALLPERMS_TRUE}" && test -z "${WANT_INSTALLPERMS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_INSTALLPERMS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined.
+echo "$as_me: error: conditional \"WANT_INSTALLPERMS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_SAMBA_TRUE}" && test -z "${WANT_SAMBA_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined.
+if test -z "${WANT_CLIENT_TRUE}" && test -z "${WANT_CLIENT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined.
+echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -63106,6 +68472,13 @@ echo "$as_me: error: conditional \"WANT_AMPLOT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${WANT_CHG_SCSI_TRUE}" && test -z "${WANT_CHG_SCSI_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -63113,24 +68486,185 @@ echo "$as_me: error: conditional \"WANT_CHG_SCSI\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_CHIO_SCSI_TRUE}" && test -z "${WANT_CHIO_SCSI_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"WANT_CHIO_SCSI\" was never defined.
+if test -z "${WANT_SCSI_LINUX_TRUE}" && test -z "${WANT_SCSI_LINUX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_LINUX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"WANT_CHIO_SCSI\" was never defined.
+echo "$as_me: error: conditional \"WANT_SCSI_LINUX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_RUNTIME_PSEUDO_RELOC_TRUE}" && test -z "${WANT_RUNTIME_PSEUDO_RELOC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"WANT_RUNTIME_PSEUDO_RELOC\" was never defined.
+if test -z "${WANT_SCSI_HPUX_NEW_TRUE}" && test -z "${WANT_SCSI_HPUX_NEW_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"WANT_RUNTIME_PSEUDO_RELOC\" was never defined.
+echo "$as_me: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${WANT_SETUID_CLIENT_TRUE}" && test -z "${WANT_SETUID_CLIENT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined.
+if test -z "${WANT_SCSI_IRIX_TRUE}" && test -z "${WANT_SCSI_IRIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_IRIX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined.
+echo "$as_me: error: conditional \"WANT_SCSI_IRIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_SOLARIS_TRUE}" && test -z "${WANT_SCSI_SOLARIS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_AIX_TRUE}" && test -z "${WANT_SCSI_AIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_AIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_AIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_CAM_TRUE}" && test -z "${WANT_SCSI_CAM_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CAM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_CAM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_BSD_TRUE}" && test -z "${WANT_SCSI_BSD_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_BSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_BSD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_CHG_SCSI_CHIO_TRUE}" && test -z "${WANT_CHG_SCSI_CHIO_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_HPUX_TRUE}" && test -z "${WANT_SCSI_HPUX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_HPUX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SCSI_CHIO_TRUE}" && test -z "${WANT_SCSI_CHIO_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CHIO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SCSI_CHIO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_AMFLOCK_POSIX_TRUE}" && test -z "${WANT_AMFLOCK_POSIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_AMFLOCK_FLOCK_TRUE}" && test -z "${WANT_AMFLOCK_FLOCK_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_AMFLOCK_LOCKF_TRUE}" && test -z "${WANT_AMFLOCK_LOCKF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_AMFLOCK_LNLOCK_TRUE}" && test -z "${WANT_AMFLOCK_LNLOCK_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_CYGWIN_COPY_PERL_DLL_TRUE}" && test -z "${WANT_CYGWIN_COPY_PERL_DLL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_DEVPAY_TRUE}" && test -z "${WANT_DEVPAY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_DEVPAY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_DEVPAY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_TAPE_XENIX_TRUE}" && test -z "${WANT_TAPE_XENIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_XENIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_TAPE_XENIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_TAPE_AIX_TRUE}" && test -z "${WANT_TAPE_AIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_AIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_TAPE_AIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_TAPE_UWARE_TRUE}" && test -z "${WANT_TAPE_UWARE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_UWARE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_TAPE_UWARE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_TAPE_POSIX_TRUE}" && test -z "${WANT_TAPE_POSIX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_POSIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_TAPE_POSIX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_TAPE_DEVICE_TRUE}" && test -z "${WANT_TAPE_DEVICE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_TAPE_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_BSD_SECURITY_TRUE}" && test -z "${WANT_BSD_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_BSD_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_BSD_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_BSDTCP_SECURITY_TRUE}" && test -z "${WANT_BSDTCP_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_BSDUDP_SECURITY_TRUE}" && test -z "${WANT_BSDUDP_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_RSH_SECURITY_TRUE}" && test -z "${WANT_RSH_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_RSH_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_RSH_SECURITY\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -63141,10 +68675,24 @@ echo "$as_me: error: conditional \"WANT_SSH_SECURITY\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
+if test -z "${WANT_KRB4_SECURITY_TRUE}" && test -z "${WANT_KRB4_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB4_SECURITY\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
+echo "$as_me: error: conditional \"WANT_KRB4_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_KRB5_SECURITY_TRUE}" && test -z "${WANT_KRB5_SECURITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB5_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_KRB5_SECURITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_SAMBA_TRUE}" && test -z "${WANT_SAMBA_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -63155,6 +68703,13 @@ echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -63179,17 +68734,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# 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=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -63199,8 +68782,43 @@ else
 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.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+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
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  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
-
-       ;;
-  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
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # 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 sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 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
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  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 -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+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=:
@@ -63394,7 +68974,28 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # 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'"
@@ -63403,31 +69004,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# 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.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -63435,30 +69019,20 @@ generated by GNU Autoconf 2.59.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -63466,7 +69040,7 @@ current configuration.
 Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
+  -V, --version    print version number and configuration settings, then exit
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -63485,19 +69059,22 @@ Configuration commands:
 $config_commands
 
 Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -63508,39 +69085,24 @@ while test $# != 0
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -63550,18 +69112,24 @@ Try \`$0 --help' for more information." >&2;}
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    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.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 #
-# INIT-COMMANDS section.
+# INIT-COMMANDS
 #
-
 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-# variables for create stdint.h replacement
-PACKAGE="$PACKAGE"
-VERSION="$VERSION"
-ac_stdint_h="$ac_stdint_h"
-_ac_stdint_h=`echo "_$PACKAGE-$ac_stdint_h" | $as_tr_cpp`
-ac_cv_stdint_message="$ac_cv_stdint_message"
-ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
-ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
-ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
-ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
-ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
-ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
-ac_cv_char_data_model="$ac_cv_char_data_model"
-ac_cv_long_data_model="$ac_cv_long_data_model"
-ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
-ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
-ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+    # from automake < 1.5.
+    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="${LINGUAS-%UNSET%}"
 
 
 _ACEOF
 
-
-
 cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "gnulib/Makefile" ) CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;;
-  "amplot/amcat.awk" ) CONFIG_FILES="$CONFIG_FILES amplot/amcat.awk" ;;
-  "amplot/amplot.sh" ) CONFIG_FILES="$CONFIG_FILES amplot/amplot.sh" ;;
-  "amplot/Makefile" ) CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;;
-  "amandad-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES amandad-src/Makefile" ;;
-  "changer-src/chg-manual.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-manual.sh" ;;
-  "changer-src/chg-multi.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-multi.sh" ;;
-  "changer-src/chg-mtx.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-mtx.sh" ;;
-  "changer-src/chg-chs.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-chs.sh" ;;
-  "changer-src/chg-rth.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-rth.pl" ;;
-  "changer-src/chg-chio.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-chio.pl" ;;
-  "changer-src/chg-zd-mtx.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-zd-mtx.sh" ;;
-  "changer-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES changer-src/Makefile" ;;
-  "changer-src/chg-juke.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-juke.sh" ;;
-  "changer-src/chg-rait.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-rait.sh" ;;
-  "changer-src/chg-null.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-null.sh" ;;
-  "changer-src/chg-mcutil.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-mcutil.sh" ;;
-  "changer-src/chg-disk.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-disk.sh" ;;
-  "changer-src/chg-iomega.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-iomega.pl" ;;
-  "changer-src/chg-lib.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-lib.sh" ;;
-  "client-src/patch-system.sh" ) CONFIG_FILES="$CONFIG_FILES client-src/patch-system.sh" ;;
-  "client-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;;
-  "dumper-src/amgtar.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/amgtar.pl" ;;
-  "dumper-src/generic-dumper.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/generic-dumper.pl" ;;
-  "dumper-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;;
-  "common-src/versuff.c" ) CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;;
-  "common-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES common-src/Makefile" ;;
-  "example/amanda.conf" ) CONFIG_FILES="$CONFIG_FILES example/amanda.conf" ;;
-  "example/Makefile" ) CONFIG_FILES="$CONFIG_FILES example/Makefile" ;;
-  "example/chg-mcutil.conf" ) CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;;
-  "example/amanda-client.conf" ) CONFIG_FILES="$CONFIG_FILES example/amanda-client.conf" ;;
-  "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
-  "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
-  "recover-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;;
-  "oldrecover-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES oldrecover-src/Makefile" ;;
-  "restore-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;;
-  "server-src/amcheckdb.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcheckdb.sh" ;;
-  "server-src/amcleanup.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcleanup.sh" ;;
-  "server-src/amdump.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amdump.sh" ;;
-  "server-src/amfreetapes.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amfreetapes.sh" ;;
-  "server-src/amoverview.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amoverview.pl" ;;
-  "server-src/amrmtape.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amrmtape.sh" ;;
-  "server-src/amtoc.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amtoc.pl" ;;
-  "server-src/amverify.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amverify.sh" ;;
-  "server-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES server-src/Makefile" ;;
-  "server-src/amstatus.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amstatus.pl" ;;
-  "server-src/amverifyrun.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amverifyrun.sh" ;;
-  "server-src/amcrypt.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt.sh" ;;
-  "server-src/amaespipe.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amaespipe.sh" ;;
-  "server-src/amcrypt-ossl.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt-ossl.sh" ;;
-  "server-src/amcrypt-ossl-asym.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt-ossl-asym.sh" ;;
-  "tape-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES tape-src/Makefile" ;;
-  "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-  "$ac_stdint_h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;;
-  "config/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;;
+  case $ac_config_target in
+    "config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "amandad-src/Makefile") CONFIG_FILES="$CONFIG_FILES amandad-src/Makefile" ;;
+    "amplot/Makefile") CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;;
+    "changer-src/Makefile") CONFIG_FILES="$CONFIG_FILES changer-src/Makefile" ;;
+    "client-src/Makefile") CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;;
+    "common-src/Makefile") CONFIG_FILES="$CONFIG_FILES common-src/Makefile" ;;
+    "common-src/versuff.c") CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;;
+    "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
+    "device-src/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/Makefile" ;;
+    "device-src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/tests/Makefile" ;;
+    "dumper-src/Makefile") CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;;
+    "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;;
+    "example/amanda-client.conf") CONFIG_FILES="$CONFIG_FILES example/amanda-client.conf" ;;
+    "example/amanda.conf") CONFIG_FILES="$CONFIG_FILES example/amanda.conf" ;;
+    "example/chg-mcutil.conf") CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;;
+    "example/template.d/amanda-S3.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-S3.conf" ;;
+    "example/template.d/advanced.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/advanced.conf" ;;
+    "example/template.d/amanda-harddisk.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-harddisk.conf" ;;
+    "example/template.d/amanda-single-tape.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-single-tape.conf" ;;
+    "example/template.d/amanda-tape-changer.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-tape-changer.conf" ;;
+    "gnulib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;;
+    "installcheck/Makefile") CONFIG_FILES="$CONFIG_FILES installcheck/Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "oldrecover-src/Makefile") CONFIG_FILES="$CONFIG_FILES oldrecover-src/Makefile" ;;
+    "packaging/Makefile") CONFIG_FILES="$CONFIG_FILES packaging/Makefile" ;;
+    "perl/Makefile") CONFIG_FILES="$CONFIG_FILES perl/Makefile" ;;
+    "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
+    "recover-src/Makefile") CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;;
+    "restore-src/Makefile") CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;;
+    "server-src/Makefile") CONFIG_FILES="$CONFIG_FILES server-src/Makefile" ;;
+    "tape-src/Makefile") CONFIG_FILES="$CONFIG_FILES tape-src/Makefile" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   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
@@ -63691,502 +69237,965 @@ if $ac_need_defaults; then
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# 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 ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@target@,$target,;t t
-s,@target_cpu@,$target_cpu,;t t
-s,@target_vendor@,$target_vendor,;t t
-s,@target_os@,$target_os,;t t
-s,@CONFIGURE_COMMAND@,$CONFIGURE_COMMAND,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@SNAPSHOT_STAMP@,$SNAPSHOT_STAMP,;t t
-s,@VERSION_MAJOR@,$VERSION_MAJOR,;t t
-s,@VERSION_MINOR@,$VERSION_MINOR,;t t
-s,@VERSION_PATCH@,$VERSION_PATCH,;t t
-s,@VERSION_COMMENT@,$VERSION_COMMENT,;t t
-s,@VERSION_SUFFIX@,$VERSION_SUFFIX,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@GL_COND_LIBTOOL_TRUE@,$GL_COND_LIBTOOL_TRUE,;t t
-s,@GL_COND_LIBTOOL_FALSE@,$GL_COND_LIBTOOL_FALSE,;t t
-s,@ALLOCA@,$ALLOCA,;t t
-s,@ALLOCA_H@,$ALLOCA_H,;t t
-s,@ARPA_INET_H@,$ARPA_INET_H,;t t
-s,@SYS_SOCKET_H@,$SYS_SOCKET_H,;t t
-s,@LIBPTH@,$LIBPTH,;t t
-s,@LTLIBPTH@,$LTLIBPTH,;t t
-s,@LIBPTH_PREFIX@,$LIBPTH_PREFIX,;t t
-s,@LIBTHREAD@,$LIBTHREAD,;t t
-s,@LTLIBTHREAD@,$LTLIBTHREAD,;t t
-s,@LIBMULTITHREAD@,$LIBMULTITHREAD,;t t
-s,@LTLIBMULTITHREAD@,$LTLIBMULTITHREAD,;t t
-s,@NETINET_IN_H@,$NETINET_IN_H,;t t
-s,@STDBOOL_H@,$STDBOOL_H,;t t
-s,@HAVE__BOOL@,$HAVE__BOOL,;t t
-s,@HAVE_DECL_MEMMEM@,$HAVE_DECL_MEMMEM,;t t
-s,@HAVE_MEMPCPY@,$HAVE_MEMPCPY,;t t
-s,@HAVE_DECL_MEMRCHR@,$HAVE_DECL_MEMRCHR,;t t
-s,@HAVE_STPCPY@,$HAVE_STPCPY,;t t
-s,@HAVE_STPNCPY@,$HAVE_STPNCPY,;t t
-s,@HAVE_DECL_STRNCASECMP@,$HAVE_DECL_STRNCASECMP,;t t
-s,@HAVE_STRCHRNUL@,$HAVE_STRCHRNUL,;t t
-s,@HAVE_DECL_STRDUP@,$HAVE_DECL_STRDUP,;t t
-s,@HAVE_STRNDUP@,$HAVE_STRNDUP,;t t
-s,@HAVE_DECL_STRNDUP@,$HAVE_DECL_STRNDUP,;t t
-s,@HAVE_DECL_STRNLEN@,$HAVE_DECL_STRNLEN,;t t
-s,@HAVE_STRPBRK@,$HAVE_STRPBRK,;t t
-s,@HAVE_STRSEP@,$HAVE_STRSEP,;t t
-s,@HAVE_DECL_STRTOK_R@,$HAVE_DECL_STRTOK_R,;t t
-s,@REPLACE_STRCASECMP@,$REPLACE_STRCASECMP,;t t
-s,@REPLACE_STRSTR@,$REPLACE_STRSTR,;t t
-s,@REPLACE_STRCASESTR@,$REPLACE_STRCASESTR,;t t
-s,@ABSOLUTE_STRING_H@,$ABSOLUTE_STRING_H,;t t
-s,@MKDIR_P@,$MKDIR_P,;t t
-s,@EOVERFLOW@,$EOVERFLOW,;t t
-s,@CFLAG_VISIBILITY@,$CFLAG_VISIBILITY,;t t
-s,@HAVE_VISIBILITY@,$HAVE_VISIBILITY,;t t
-s,@GREP@,$GREP,;t t
-s,@AMLINT@,$AMLINT,;t t
-s,@AMLINTFLAGS@,$AMLINTFLAGS,;t t
-s,@DUMPER_DIR@,$DUMPER_DIR,;t t
-s,@CONFIG_DIR@,$CONFIG_DIR,;t t
-s,@USE_VERSION_SUFFIXES@,$USE_VERSION_SUFFIXES,;t t
-s,@CLIENT_SCRIPTS_OPT@,$CLIENT_SCRIPTS_OPT,;t t
-s,@DEFAULT_SERVER@,$DEFAULT_SERVER,;t t
-s,@CLIENT_LOGIN@,$CLIENT_LOGIN,;t t
-s,@SETUID_GROUP@,$SETUID_GROUP,;t t
-s,@BINARY_OWNER@,$BINARY_OWNER,;t t
-s,@DEFAULT_CONFIG@,$DEFAULT_CONFIG,;t t
-s,@DEFAULT_TAPE_SERVER@,$DEFAULT_TAPE_SERVER,;t t
-s,@DEFAULT_TAPE_DEVICE@,$DEFAULT_TAPE_DEVICE,;t t
-s,@EXAMPLE_TAPEDEV@,$EXAMPLE_TAPEDEV,;t t
-s,@DEFAULT_RAW_TAPE_DEVICE@,$DEFAULT_RAW_TAPE_DEVICE,;t t
-s,@DEFAULT_CHANGER_DEVICE@,$DEFAULT_CHANGER_DEVICE,;t t
-s,@GNUTAR_LISTED_INCREMENTAL_DIRX@,$GNUTAR_LISTED_INCREMENTAL_DIRX,;t t
-s,@GNUTAR_LISTED_INCREMENTAL_DIR@,$GNUTAR_LISTED_INCREMENTAL_DIR,;t t
-s,@SSH@,$SSH,;t t
-s,@MAXTAPEBLOCKSIZE@,$MAXTAPEBLOCKSIZE,;t t
-s,@AMANDA_TMPDIR@,$AMANDA_TMPDIR,;t t
-s,@AMANDA_DBGDIR@,$AMANDA_DBGDIR,;t t
-s,@AMANDA_DEBUG_DAYS@,$AMANDA_DEBUG_DAYS,;t t
-s,@SERVICE_SUFFIX@,$SERVICE_SUFFIX,;t t
-s,@MT_FILE_FLAG@,$MT_FILE_FLAG,;t t
-s,@AR@,$AR,;t t
-s,@YACC@,$YACC,;t t
-s,@CAT@,$CAT,;t t
-s,@COMPRESS@,$COMPRESS,;t t
-s,@DD@,$DD,;t t
-s,@GETCONF@,$GETCONF,;t t
-s,@GNUPLOT@,$GNUPLOT,;t t
-s,@GNUTAR@,$GNUTAR,;t t
-s,@SAMBA_CLIENT@,$SAMBA_CLIENT,;t t
-s,@GZIP@,$GZIP,;t t
-s,@SORT@,$SORT,;t t
-s,@MAILER@,$MAILER,;t t
-s,@MT@,$MT,;t t
-s,@CHIO@,$CHIO,;t t
-s,@CHS@,$CHS,;t t
-s,@MTX@,$MTX,;t t
-s,@MCUTIL@,$MCUTIL,;t t
-s,@PRINT@,$PRINT,;t t
-s,@PCAT@,$PCAT,;t t
-s,@PERL@,$PERL,;t t
-s,@DUMP@,$DUMP,;t t
-s,@RESTORE@,$RESTORE,;t t
-s,@XFSDUMP@,$XFSDUMP,;t t
-s,@XFSRESTORE@,$XFSRESTORE,;t t
-s,@VXDUMP@,$VXDUMP,;t t
-s,@VXRESTORE@,$VXRESTORE,;t t
-s,@VDUMP@,$VDUMP,;t t
-s,@VRESTORE@,$VRESTORE,;t t
-s,@AMPLOT_COMPRESS@,$AMPLOT_COMPRESS,;t t
-s,@AMPLOT_CAT_GZIP@,$AMPLOT_CAT_GZIP,;t t
-s,@AMPLOT_CAT_COMPRESS@,$AMPLOT_CAT_COMPRESS,;t t
-s,@AMPLOT_CAT_PACK@,$AMPLOT_CAT_PACK,;t t
-s,@LL_FMT@,$LL_FMT,;t t
-s,@LL_RFMT@,$LL_RFMT,;t t
-s,@LN_S@,$LN_S,;t t
-s,@ECHO@,$ECHO,;t t
-s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@CXX@,$CXX,;t t
-s,@CXXFLAGS@,$CXXFLAGS,;t t
-s,@ac_ct_CXX@,$ac_ct_CXX,;t t
-s,@CXXDEPMODE@,$CXXDEPMODE,;t t
-s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
-s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
-s,@CXXCPP@,$CXXCPP,;t t
-s,@F77@,$F77,;t t
-s,@FFLAGS@,$FFLAGS,;t t
-s,@ac_ct_F77@,$ac_ct_F77,;t t
-s,@LIBTOOL@,$LIBTOOL,;t t
-s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t
-s,@LEX@,$LEX,;t t
-s,@LEXLIB@,$LEXLIB,;t t
-s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
-s,@READLINE_LIBS@,$READLINE_LIBS,;t t
-s,@DB_EXT@,$DB_EXT,;t t
-s,@ac_n@,$ac_n,;t t
-s,@ac_c@,$ac_c,;t t
-s,@WANT_CLIENT_TRUE@,$WANT_CLIENT_TRUE,;t t
-s,@WANT_CLIENT_FALSE@,$WANT_CLIENT_FALSE,;t t
-s,@WANT_SAMBA_TRUE@,$WANT_SAMBA_TRUE,;t t
-s,@WANT_SAMBA_FALSE@,$WANT_SAMBA_FALSE,;t t
-s,@WANT_RESTORE_TRUE@,$WANT_RESTORE_TRUE,;t t
-s,@WANT_RESTORE_FALSE@,$WANT_RESTORE_FALSE,;t t
-s,@WANT_SERVER_TRUE@,$WANT_SERVER_TRUE,;t t
-s,@WANT_SERVER_FALSE@,$WANT_SERVER_FALSE,;t t
-s,@WANT_RECOVER_TRUE@,$WANT_RECOVER_TRUE,;t t
-s,@WANT_RECOVER_FALSE@,$WANT_RECOVER_FALSE,;t t
-s,@WANT_TAPE_TRUE@,$WANT_TAPE_TRUE,;t t
-s,@WANT_TAPE_FALSE@,$WANT_TAPE_FALSE,;t t
-s,@WANT_AMPLOT_TRUE@,$WANT_AMPLOT_TRUE,;t t
-s,@WANT_AMPLOT_FALSE@,$WANT_AMPLOT_FALSE,;t t
-s,@WANT_CHG_SCSI_TRUE@,$WANT_CHG_SCSI_TRUE,;t t
-s,@WANT_CHG_SCSI_FALSE@,$WANT_CHG_SCSI_FALSE,;t t
-s,@WANT_CHIO_SCSI_TRUE@,$WANT_CHIO_SCSI_TRUE,;t t
-s,@WANT_CHIO_SCSI_FALSE@,$WANT_CHIO_SCSI_FALSE,;t t
-s,@WANT_RUNTIME_PSEUDO_RELOC_TRUE@,$WANT_RUNTIME_PSEUDO_RELOC_TRUE,;t t
-s,@WANT_RUNTIME_PSEUDO_RELOC_FALSE@,$WANT_RUNTIME_PSEUDO_RELOC_FALSE,;t t
-s,@WANT_SETUID_CLIENT_TRUE@,$WANT_SETUID_CLIENT_TRUE,;t t
-s,@WANT_SETUID_CLIENT_FALSE@,$WANT_SETUID_CLIENT_FALSE,;t t
-s,@WANT_SSH_SECURITY_TRUE@,$WANT_SSH_SECURITY_TRUE,;t t
-s,@WANT_SSH_SECURITY_FALSE@,$WANT_SSH_SECURITY_FALSE,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-s,@LTALLOCA@,$LTALLOCA,;t t
-s,@DOC_BUILD_DATE@,$DOC_BUILD_DATE,;t t
-s,@XSLTPROC_FLAGS@,$XSLTPROC_FLAGS,;t t
-s,@XSLTPROC@,$XSLTPROC,;t t
-s,@ENABLE_MANPAGE_BUILD_TRUE@,$ENABLE_MANPAGE_BUILD_TRUE,;t t
-s,@ENABLE_MANPAGE_BUILD_FALSE@,$ENABLE_MANPAGE_BUILD_FALSE,;t t
-s,@GCC_COMPILER_TRUE@,$GCC_COMPILER_TRUE,;t t
-s,@GCC_COMPILER_FALSE@,$GCC_COMPILER_FALSE,;t t
-s,@AM_CFLAGS@,$AM_CFLAGS,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t
-s,@gl_LTLIBOBJS@,$gl_LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+SNAPSHOT_STAMP!$SNAPSHOT_STAMP$ac_delim
+VERSION_MAJOR!$VERSION_MAJOR$ac_delim
+VERSION_MINOR!$VERSION_MINOR$ac_delim
+VERSION_PATCH!$VERSION_PATCH$ac_delim
+VERSION_COMMENT!$VERSION_COMMENT$ac_delim
+VERSION_SUFFIX!$VERSION_SUFFIX$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+RANLIB!$RANLIB$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+GL_COND_LIBTOOL_TRUE!$GL_COND_LIBTOOL_TRUE$ac_delim
+GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_FALSE$ac_delim
+ALLOCA!$ALLOCA$ac_delim
+ALLOCA_H!$ALLOCA_H$ac_delim
+ARPA_INET_H!$ARPA_INET_H$ac_delim
+INCLUDE_NEXT!$INCLUDE_NEXT$ac_delim
+NEXT_FLOAT_H!$NEXT_FLOAT_H$ac_delim
+FLOAT_H!$FLOAT_H$ac_delim
+NEXT_SYS_SOCKET_H!$NEXT_SYS_SOCKET_H$ac_delim
+HAVE_SYS_SOCKET_H!$HAVE_SYS_SOCKET_H$ac_delim
+HAVE_WINSOCK2_H!$HAVE_WINSOCK2_H$ac_delim
+HAVE_WS2TCPIP_H!$HAVE_WS2TCPIP_H$ac_delim
+SYS_SOCKET_H!$SYS_SOCKET_H$ac_delim
+LIBINTL!$LIBINTL$ac_delim
+LTLIBINTL!$LTLIBINTL$ac_delim
+NEXT_SYS_TIME_H!$NEXT_SYS_TIME_H$ac_delim
+HAVE_SYS_TIME_H!$HAVE_SYS_TIME_H$ac_delim
+HAVE_STRUCT_TIMEVAL!$HAVE_STRUCT_TIMEVAL$ac_delim
+REPLACE_GETTIMEOFDAY!$REPLACE_GETTIMEOFDAY$ac_delim
+SYS_TIME_H!$SYS_TIME_H$ac_delim
+LIBPTH!$LIBPTH$ac_delim
+LTLIBPTH!$LTLIBPTH$ac_delim
+LIBTHREAD!$LIBTHREAD$ac_delim
+LTLIBTHREAD!$LTLIBTHREAD$ac_delim
+LIBMULTITHREAD!$LIBMULTITHREAD$ac_delim
+LTLIBMULTITHREAD!$LTLIBMULTITHREAD$ac_delim
+HAVE_MALLOC_POSIX!$HAVE_MALLOC_POSIX$ac_delim
+GNULIB_MALLOC_POSIX!$GNULIB_MALLOC_POSIX$ac_delim
+GNULIB_REALLOC_POSIX!$GNULIB_REALLOC_POSIX$ac_delim
+GNULIB_CALLOC_POSIX!$GNULIB_CALLOC_POSIX$ac_delim
+GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim
+GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim
+GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim
+HAVE_CALLOC_POSIX!$HAVE_CALLOC_POSIX$ac_delim
+HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim
+HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim
+HAVE_REALLOC_POSIX!$HAVE_REALLOC_POSIX$ac_delim
+REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim
+NEXT_NETINET_IN_H!$NEXT_NETINET_IN_H$ac_delim
+HAVE_NETINET_IN_H!$HAVE_NETINET_IN_H$ac_delim
+NETINET_IN_H!$NETINET_IN_H$ac_delim
+GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim
+GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim
+GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim
+GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim
+GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim
+GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim
+GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim
+GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim
+GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim
+GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim
+GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim
+GNULIB_FTELL!$GNULIB_FTELL$ac_delim
+GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim
+GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim
+GNULIB_GETDELIM!$GNULIB_GETDELIM$ac_delim
+GNULIB_GETLINE!$GNULIB_GETLINE$ac_delim
+REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim
+REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim
+REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim
+REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim
+REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim
+HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim
+REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim
+HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim
+REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim
+REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim
+HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim
+REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim
+HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim
+REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim
+REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim
+HAVE_FTELLO!$HAVE_FTELLO$ac_delim
+REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim
+REPLACE_FTELL!$REPLACE_FTELL$ac_delim
+REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim
+HAVE_DECL_GETDELIM!$HAVE_DECL_GETDELIM$ac_delim
+HAVE_DECL_GETLINE!$HAVE_DECL_GETLINE$ac_delim
+REPLACE_GETLINE!$REPLACE_GETLINE$ac_delim
+STDBOOL_H!$STDBOOL_H$ac_delim
+HAVE__BOOL!$HAVE__BOOL$ac_delim
+HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim
+HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim
+HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim
+HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim
+NEXT_STDINT_H!$NEXT_STDINT_H$ac_delim
+HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim
+HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim
+HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim
+BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim
+BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim
+BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim
+BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim
+BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim
+HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim
+HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim
+HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim
+SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim
+SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim
+WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim
+WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim
+STDINT_H!$STDINT_H$ac_delim
+NEXT_STDIO_H!$NEXT_STDIO_H$ac_delim
+NEXT_STDLIB_H!$NEXT_STDLIB_H$ac_delim
+GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim
+GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim
+GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim
+GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim
+GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim
+GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim
+GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim
+GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim
+GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim
+GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim
+GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim
+GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim
+GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim
+GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim
+GNULIB_MBSNLEN!$GNULIB_MBSNLEN$ac_delim
+GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim
+GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim
+GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim
+GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim
+GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim
+GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim
+GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim
+GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim
+GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim
+GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim
+GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim
+GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim
+HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim
+HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim
+HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim
+HAVE_STPCPY!$HAVE_STPCPY$ac_delim
+HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim
+HAVE_STRCASECMP!$HAVE_STRCASECMP$ac_delim
+HAVE_DECL_STRNCASECMP!$HAVE_DECL_STRNCASECMP$ac_delim
+HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim
+HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim
+HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim
+HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim
+HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim
+HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim
+HAVE_STRSEP!$HAVE_STRSEP$ac_delim
+HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim
+HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim
+NEXT_STRING_H!$NEXT_STRING_H$ac_delim
+HAVE_LSTAT!$HAVE_LSTAT$ac_delim
+HAVE_DECL_MKDIR!$HAVE_DECL_MKDIR$ac_delim
+HAVE_IO_H!$HAVE_IO_H$ac_delim
+NEXT_SYS_STAT_H!$NEXT_SYS_STAT_H$ac_delim
+SYS_STAT_H!$SYS_STAT_H$ac_delim
+GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim
+GNULIB_DUP2!$GNULIB_DUP2$ac_delim
+GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim
+GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim
+GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim
+GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim
+GNULIB_LCHOWN!$GNULIB_LCHOWN$ac_delim
+GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim
+GNULIB_READLINK!$GNULIB_READLINK$ac_delim
+GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim
+HAVE_DUP2!$HAVE_DUP2$ac_delim
+HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim
+HAVE_READLINK!$HAVE_READLINK$ac_delim
+HAVE_SLEEP!$HAVE_SLEEP$ac_delim
+HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim
+REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim
+REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim
+REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim
+REPLACE_LCHOWN!$REPLACE_LCHOWN$ac_delim
+REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim
+NEXT_UNISTD_H!$NEXT_UNISTD_H$ac_delim
+HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim
+EOVERFLOW!$EOVERFLOW$ac_delim
+CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim
+HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim
+GNULIB_WCWIDTH!$GNULIB_WCWIDTH$ac_delim
+HAVE_DECL_WCWIDTH!$HAVE_DECL_WCWIDTH$ac_delim
+REPLACE_WCWIDTH!$REPLACE_WCWIDTH$ac_delim
+WCHAR_H!$WCHAR_H$ac_delim
+HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim
+NEXT_WCHAR_H!$NEXT_WCHAR_H$ac_delim
+AMANDA_WARNING_CFLAGS!$AMANDA_WARNING_CFLAGS$ac_delim
+CLIENT_LOGIN!$CLIENT_LOGIN$ac_delim
+SETUID_GROUP!$SETUID_GROUP$ac_delim
+CONFIG_DIR!$CONFIG_DIR$ac_delim
+USE_VERSION_SUFFIXES!$USE_VERSION_SUFFIXES$ac_delim
+GNUTAR_LISTED_INCREMENTAL_DIR!$GNUTAR_LISTED_INCREMENTAL_DIR$ac_delim
+AMANDA_TMPDIR!$AMANDA_TMPDIR$ac_delim
+BINARY_OWNER!$BINARY_OWNER$ac_delim
+MAXTAPEBLOCKSIZE!$MAXTAPEBLOCKSIZE$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+AMANDA_DBGDIR!$AMANDA_DBGDIR$ac_delim
+AMANDA_DEBUG_DAYS!$AMANDA_DEBUG_DAYS$ac_delim
+SERVICE_SUFFIX!$SERVICE_SUFFIX$ac_delim
+WANT_SETUID_CLIENT_TRUE!$WANT_SETUID_CLIENT_TRUE$ac_delim
+WANT_SETUID_CLIENT_FALSE!$WANT_SETUID_CLIENT_FALSE$ac_delim
+WANT_INSTALLPERMS_TRUE!$WANT_INSTALLPERMS_TRUE$ac_delim
+WANT_INSTALLPERMS_FALSE!$WANT_INSTALLPERMS_FALSE$ac_delim
+WANT_CLIENT_TRUE!$WANT_CLIENT_TRUE$ac_delim
+WANT_CLIENT_FALSE!$WANT_CLIENT_FALSE$ac_delim
+WANT_RESTORE_TRUE!$WANT_RESTORE_TRUE$ac_delim
+WANT_RESTORE_FALSE!$WANT_RESTORE_FALSE$ac_delim
+WANT_SERVER_TRUE!$WANT_SERVER_TRUE$ac_delim
+WANT_SERVER_FALSE!$WANT_SERVER_FALSE$ac_delim
+WANT_RECOVER_TRUE!$WANT_RECOVER_TRUE$ac_delim
+WANT_RECOVER_FALSE!$WANT_RECOVER_FALSE$ac_delim
+WANT_TAPE_TRUE!$WANT_TAPE_TRUE$ac_delim
+WANT_TAPE_FALSE!$WANT_TAPE_FALSE$ac_delim
+GNUPLOT!$GNUPLOT$ac_delim
+PCAT!$PCAT$ac_delim
+COMPRESS!$COMPRESS$ac_delim
+GZIP!$GZIP$ac_delim
+AMPLOT_COMPRESS!$AMPLOT_COMPRESS$ac_delim
+AMPLOT_CAT_GZIP!$AMPLOT_CAT_GZIP$ac_delim
+AMPLOT_CAT_COMPRESS!$AMPLOT_CAT_COMPRESS$ac_delim
+AMPLOT_CAT_PACK!$AMPLOT_CAT_PACK$ac_delim
+WANT_AMPLOT_TRUE!$WANT_AMPLOT_TRUE$ac_delim
+WANT_AMPLOT_FALSE!$WANT_AMPLOT_FALSE$ac_delim
+XSLTPROC_FLAGS!$XSLTPROC_FLAGS$ac_delim
+XSLTPROC!$XSLTPROC$ac_delim
+ENABLE_MANPAGE_BUILD_TRUE!$ENABLE_MANPAGE_BUILD_TRUE$ac_delim
+ENABLE_MANPAGE_BUILD_FALSE!$ENABLE_MANPAGE_BUILD_FALSE$ac_delim
+XSLREL!$XSLREL$ac_delim
+DOC_BUILD_DATE!$DOC_BUILD_DATE$ac_delim
+DEFAULT_SERVER!$DEFAULT_SERVER$ac_delim
+DEFAULT_CONFIG!$DEFAULT_CONFIG$ac_delim
+DEFAULT_TAPE_SERVER!$DEFAULT_TAPE_SERVER$ac_delim
+DEFAULT_TAPE_DEVICE!$DEFAULT_TAPE_DEVICE$ac_delim
+EXAMPLE_TAPEDEV!$EXAMPLE_TAPEDEV$ac_delim
+DEFAULT_CHANGER_DEVICE!$DEFAULT_CHANGER_DEVICE$ac_delim
+DEFAULT_AMANDATES_FILE!$DEFAULT_AMANDATES_FILE$ac_delim
+GETCONF!$GETCONF$ac_delim
+CHIO!$CHIO$ac_delim
+CHS!$CHS$ac_delim
+MTX!$MTX$ac_delim
+MCUTIL!$MCUTIL$ac_delim
+WANT_CHG_SCSI_TRUE!$WANT_CHG_SCSI_TRUE$ac_delim
+WANT_CHG_SCSI_FALSE!$WANT_CHG_SCSI_FALSE$ac_delim
+WANT_SCSI_LINUX_TRUE!$WANT_SCSI_LINUX_TRUE$ac_delim
+WANT_SCSI_LINUX_FALSE!$WANT_SCSI_LINUX_FALSE$ac_delim
+WANT_SCSI_HPUX_NEW_TRUE!$WANT_SCSI_HPUX_NEW_TRUE$ac_delim
+WANT_SCSI_HPUX_NEW_FALSE!$WANT_SCSI_HPUX_NEW_FALSE$ac_delim
+WANT_SCSI_IRIX_TRUE!$WANT_SCSI_IRIX_TRUE$ac_delim
+WANT_SCSI_IRIX_FALSE!$WANT_SCSI_IRIX_FALSE$ac_delim
+WANT_SCSI_SOLARIS_TRUE!$WANT_SCSI_SOLARIS_TRUE$ac_delim
+WANT_SCSI_SOLARIS_FALSE!$WANT_SCSI_SOLARIS_FALSE$ac_delim
+WANT_SCSI_AIX_TRUE!$WANT_SCSI_AIX_TRUE$ac_delim
+WANT_SCSI_AIX_FALSE!$WANT_SCSI_AIX_FALSE$ac_delim
+WANT_SCSI_CAM_TRUE!$WANT_SCSI_CAM_TRUE$ac_delim
+WANT_SCSI_CAM_FALSE!$WANT_SCSI_CAM_FALSE$ac_delim
+WANT_SCSI_BSD_TRUE!$WANT_SCSI_BSD_TRUE$ac_delim
+WANT_SCSI_BSD_FALSE!$WANT_SCSI_BSD_FALSE$ac_delim
+WANT_CHG_SCSI_CHIO_TRUE!$WANT_CHG_SCSI_CHIO_TRUE$ac_delim
+WANT_CHG_SCSI_CHIO_FALSE!$WANT_CHG_SCSI_CHIO_FALSE$ac_delim
+WANT_SCSI_HPUX_TRUE!$WANT_SCSI_HPUX_TRUE$ac_delim
+WANT_SCSI_HPUX_FALSE!$WANT_SCSI_HPUX_FALSE$ac_delim
+WANT_SCSI_CHIO_TRUE!$WANT_SCSI_CHIO_TRUE$ac_delim
+WANT_SCSI_CHIO_FALSE!$WANT_SCSI_CHIO_FALSE$ac_delim
+WANT_AMFLOCK_POSIX_TRUE!$WANT_AMFLOCK_POSIX_TRUE$ac_delim
+WANT_AMFLOCK_POSIX_FALSE!$WANT_AMFLOCK_POSIX_FALSE$ac_delim
+WANT_AMFLOCK_FLOCK_TRUE!$WANT_AMFLOCK_FLOCK_TRUE$ac_delim
+WANT_AMFLOCK_FLOCK_FALSE!$WANT_AMFLOCK_FLOCK_FALSE$ac_delim
+WANT_AMFLOCK_LOCKF_TRUE!$WANT_AMFLOCK_LOCKF_TRUE$ac_delim
+WANT_AMFLOCK_LOCKF_FALSE!$WANT_AMFLOCK_LOCKF_FALSE$ac_delim
+WANT_AMFLOCK_LNLOCK_TRUE!$WANT_AMFLOCK_LNLOCK_TRUE$ac_delim
+WANT_AMFLOCK_LNLOCK_FALSE!$WANT_AMFLOCK_LNLOCK_FALSE$ac_delim
+SWIG!$SWIG$ac_delim
+SWIG_LIB!$SWIG_LIB$ac_delim
+PERL!$PERL$ac_delim
+PERL_INC!$PERL_INC$ac_delim
+WANT_CYGWIN_COPY_PERL_DLL_TRUE!$WANT_CYGWIN_COPY_PERL_DLL_TRUE$ac_delim
+WANT_CYGWIN_COPY_PERL_DLL_FALSE!$WANT_CYGWIN_COPY_PERL_DLL_FALSE$ac_delim
+PERLEXTLIBS!$PERLEXTLIBS$ac_delim
+CAT!$CAT$ac_delim
+CLIENT_SCRIPTS_OPT!$CLIENT_SCRIPTS_OPT$ac_delim
+amlibdir!$amlibdir$ac_delim
+amlibexecdir!$amlibexecdir$ac_delim
+amincludedir!$amincludedir$ac_delim
+amperldir!$amperldir$ac_delim
+DUMPER_DIR!$DUMPER_DIR$ac_delim
+MSGFMT!$MSGFMT$ac_delim
+GETTEXT!$GETTEXT$ac_delim
+USE_NLS!$USE_NLS$ac_delim
+GMSGFMT!$GMSGFMT$ac_delim
+MSGFMT_015!$MSGFMT_015$ac_delim
+GMSGFMT_015!$GMSGFMT_015$ac_delim
+XGETTEXT!$XGETTEXT$ac_delim
+XGETTEXT_015!$XGETTEXT_015$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-4.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+MSGMERGE!$MSGMERGE$ac_delim
+INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim
+LIBICONV!$LIBICONV$ac_delim
+LTLIBICONV!$LTLIBICONV$ac_delim
+INTLLIBS!$INTLLIBS$ac_delim
+POSUB!$POSUB$ac_delim
+CURL_CONFIG!$CURL_CONFIG$ac_delim
+_libcurl_config!$_libcurl_config$ac_delim
+LIBCURL_CPPFLAGS!$LIBCURL_CPPFLAGS$ac_delim
+LIBCURL!$LIBCURL$ac_delim
+WANT_S3_DEVICE_TRUE!$WANT_S3_DEVICE_TRUE$ac_delim
+WANT_S3_DEVICE_FALSE!$WANT_S3_DEVICE_FALSE$ac_delim
+WANT_DEVPAY_TRUE!$WANT_DEVPAY_TRUE$ac_delim
+WANT_DEVPAY_FALSE!$WANT_DEVPAY_FALSE$ac_delim
+WANT_TAPE_XENIX_TRUE!$WANT_TAPE_XENIX_TRUE$ac_delim
+WANT_TAPE_XENIX_FALSE!$WANT_TAPE_XENIX_FALSE$ac_delim
+WANT_TAPE_AIX_TRUE!$WANT_TAPE_AIX_TRUE$ac_delim
+WANT_TAPE_AIX_FALSE!$WANT_TAPE_AIX_FALSE$ac_delim
+WANT_TAPE_UWARE_TRUE!$WANT_TAPE_UWARE_TRUE$ac_delim
+WANT_TAPE_UWARE_FALSE!$WANT_TAPE_UWARE_FALSE$ac_delim
+WANT_TAPE_POSIX_TRUE!$WANT_TAPE_POSIX_TRUE$ac_delim
+WANT_TAPE_POSIX_FALSE!$WANT_TAPE_POSIX_FALSE$ac_delim
+WANT_TAPE_DEVICE_TRUE!$WANT_TAPE_DEVICE_TRUE$ac_delim
+WANT_TAPE_DEVICE_FALSE!$WANT_TAPE_DEVICE_FALSE$ac_delim
+WANT_BSD_SECURITY_TRUE!$WANT_BSD_SECURITY_TRUE$ac_delim
+WANT_BSD_SECURITY_FALSE!$WANT_BSD_SECURITY_FALSE$ac_delim
+WANT_BSDTCP_SECURITY_TRUE!$WANT_BSDTCP_SECURITY_TRUE$ac_delim
+WANT_BSDTCP_SECURITY_FALSE!$WANT_BSDTCP_SECURITY_FALSE$ac_delim
+WANT_BSDUDP_SECURITY_TRUE!$WANT_BSDUDP_SECURITY_TRUE$ac_delim
+WANT_BSDUDP_SECURITY_FALSE!$WANT_BSDUDP_SECURITY_FALSE$ac_delim
+WANT_RSH_SECURITY_TRUE!$WANT_RSH_SECURITY_TRUE$ac_delim
+WANT_RSH_SECURITY_FALSE!$WANT_RSH_SECURITY_FALSE$ac_delim
+SSH!$SSH$ac_delim
+WANT_SSH_SECURITY_TRUE!$WANT_SSH_SECURITY_TRUE$ac_delim
+WANT_SSH_SECURITY_FALSE!$WANT_SSH_SECURITY_FALSE$ac_delim
+WANT_KRB4_SECURITY_TRUE!$WANT_KRB4_SECURITY_TRUE$ac_delim
+WANT_KRB4_SECURITY_FALSE!$WANT_KRB4_SECURITY_FALSE$ac_delim
+WANT_KRB5_SECURITY_TRUE!$WANT_KRB5_SECURITY_TRUE$ac_delim
+WANT_KRB5_SECURITY_FALSE!$WANT_KRB5_SECURITY_FALSE$ac_delim
+XFSDUMP!$XFSDUMP$ac_delim
+XFSRESTORE!$XFSRESTORE$ac_delim
+VXDUMP!$VXDUMP$ac_delim
+VXRESTORE!$VXRESTORE$ac_delim
+VDUMP!$VDUMP$ac_delim
+VRESTORE!$VRESTORE$ac_delim
+DUMP!$DUMP$ac_delim
+RESTORE!$RESTORE$ac_delim
+GNUTAR!$GNUTAR$ac_delim
+SAMBA_CLIENT!$SAMBA_CLIENT$ac_delim
+WANT_SAMBA_TRUE!$WANT_SAMBA_TRUE$ac_delim
+WANT_SAMBA_FALSE!$WANT_SAMBA_FALSE$ac_delim
+AMLINT!$AMLINT$ac_delim
+AMLINTFLAGS!$AMLINTFLAGS$ac_delim
+LEX!$LEX$ac_delim
+LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
+LEXLIB!$LEXLIB$ac_delim
+AR!$AR$ac_delim
+YACC!$YACC$ac_delim
+YFLAGS!$YFLAGS$ac_delim
+DD!$DD$ac_delim
+BASH!$BASH$ac_delim
+SORT!$SORT$ac_delim
+MAILER!$MAILER$ac_delim
+MT!$MT$ac_delim
+MT_FILE_FLAG!$MT_FILE_FLAG$ac_delim
+PRINT!$PRINT$ac_delim
+GCC_COMPILER_TRUE!$GCC_COMPILER_TRUE$ac_delim
+GCC_COMPILER_FALSE!$GCC_COMPILER_FALSE$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+LIBTOOL_DEPS!$LIBTOOL_DEPS$ac_delim
+AMANDA_STATIC_LDFLAGS!$AMANDA_STATIC_LDFLAGS$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim
+GLIB_LIBS!$GLIB_LIBS$ac_delim
+GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim
+GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim
+GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim
+READLINE_LIBS!$READLINE_LIBS$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+gl_LIBOBJS!$gl_LIBOBJS$ac_delim
+gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
 
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-5.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
 _ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ 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[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-       cat >$tmp/stdin
-       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[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="$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 ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$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 "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
   esac
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  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 ||
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`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 ||
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    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 ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`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
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    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 ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    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
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$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
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # 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.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                    sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-        # Absolute (can't be DOS-style, as IFS=:)
-        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        echo "$f";;
-      *) # Relative
-        if test -f "$f"; then
-          # Build tree
-          echo "$f"
-        elif test -f "$srcdir/$f"; then
-          # Source tree
-          echo "$srcdir/$f"
-        else
-          # /dev/null tree
-          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# 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=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  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
   sed "$ac_vpsub
 $extrasub
@@ -64194,248 +70203,131 @@ _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='[        ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;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
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" | sed -f "$tmp/subs-5.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+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 "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-       cat >$tmp/stdin
-       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-        # Absolute (can't be DOS-style, as IFS=:)
-        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        # Do quote $f, to prevent DOS paths from being IFS'd.
-        echo "$f";;
-      *) # Relative
-        if test -f "$f"; then
-          # Build tree
-          echo "$f"
-        elif test -f "$srcdir/$f"; then
-          # Source tree
-          echo "$srcdir/$f"
-        else
-          # /dev/null tree
-          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then 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.
-cat >>conftest.undefs <<\_ACEOF
-s,^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[     ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
 
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # 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.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_file" : 'X\(//\)[^/]' \| \
-        X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
+  rm -f "$tmp/out12"
 # Compute $ac_file's index in $config_headers.
 _am_stamp_count=1
 for _am_header in $config_headers :; do
@@ -64446,135 +70338,39 @@ for _am_header in $config_headers :; do
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+echo "timestamp for $ac_file" >`$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 ||
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
 echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_dest" : 'X\(//\)[^/]' \| \
-        X"$ac_dest" : 'X\(//\)$' \| \
-        X"$ac_dest" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
 
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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.
@@ -64582,20 +70378,32 @@ echo "$as_me: executing $ac_dest commands" >&6;}
   # 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.
-  # So let's grep whole file.
-  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
+  # 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 10q "$mf" | grep '^#.*generated by automake' > /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 ||
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
   else
     continue
   fi
@@ -64617,556 +70425,340 @@ echo X"$mf" |
        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
     # Make sure the directory exists.
     test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
+    fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$file" : 'X\(//\)[^/]' \| \
         X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`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 ||
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    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 ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
     # echo "creating $dirpart/$file"
     echo '# dummy' > "$dirpart/$file"
   done
 done
  ;;
-    $ac_stdint_h )
-{ echo "$as_me:$LINENO: creating $ac_stdint_h : $_ac_stdint_h" >&5
-echo "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;}
-ac_stdint=$tmp/_stdint.h
-
-echo "#ifndef" $_ac_stdint_h >$ac_stdint
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
-echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_t" != "_" ; then
-echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
-echo "#include <stdint.h>" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-else
-
-cat >>$ac_stdint <<STDINT_EOF
-
-/* ................... shortcircuit part ........................... */
+    "po-directories":C)
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done ;;
 
-#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <stddef.h>
+  esac
+done # for ac_tag
 
-/* .................... configured part ............................ */
 
-STDINT_EOF
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
 
-echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-  ac_header="$ac_cv_header_stdint_x"
-  echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
-fi
 
-echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_o" != "_" ; then
-  ac_header="$ac_cv_header_stdint_o"
-  echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
+# 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 || { (exit 1); exit 1; }
 fi
 
-echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_u" != "_" ; then
-  ac_header="$ac_cv_header_stdint_u"
-  echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
-fi
 
-echo "" >>$ac_stdint
 
-if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
-  echo "#include <$ac_header>" >>$ac_stdint
-  echo "" >>$ac_stdint
-fi fi
 
-echo "/* which 64bit typedef has been found */" >>$ac_stdint
-if test "$ac_cv_type_uint64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
-fi
-if test "$ac_cv_type_u_int64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
 
-echo "/* which type model has been detected */" >>$ac_stdint
-if test "_$ac_cv_char_data_model" != "_" ; then
-echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
-echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
+    # Extract the first word of "svn", so it can be a program name with args.
+set dummy svn; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SVN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
-echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
+  case $SVN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SVN="$SVN" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-echo "/* whether int_least types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_least32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
-fi
-echo "/* whether int_fast types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_fast32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
+  ;;
+esac
 fi
-echo "/* whether intmax_t type was detected */" >>$ac_stdint
-if test "$ac_cv_type_intmax_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
+SVN=$ac_cv_path_SVN
+if test -n "$SVN"; then
+  { echo "$as_me:$LINENO: result: $SVN" >&5
+echo "${ECHO_T}$SVN" >&6; }
 else
-echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-echo "" >>$ac_stdint
-
-  cat >>$ac_stdint <<STDINT_EOF
-/* .................... detections part ............................ */
-
-/* whether we need to define bitspecific types from compiler base types */
-#ifndef _STDINT_HEADER_INTPTR
-#ifndef _STDINT_HEADER_UINT32
-#ifndef _STDINT_HEADER_U_INT32
-#define _STDINT_NEED_INT_MODEL_T
-#else
-#define _STDINT_HAVE_U_INT_TYPES
-#endif
-#endif
-#endif
-
-#ifdef _STDINT_HAVE_U_INT_TYPES
-#undef _STDINT_NEED_INT_MODEL_T
-#endif
-
-#ifdef  _STDINT_CHAR_MODEL
-#if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
-#ifndef _STDINT_BYTE_MODEL
-#define _STDINT_BYTE_MODEL 12
-#endif
-#endif
-#endif
-
-#ifndef _STDINT_HAVE_INT_LEAST32_T
-#define _STDINT_NEED_INT_LEAST_T
-#endif
-
-#ifndef _STDINT_HAVE_INT_FAST32_T
-#define _STDINT_NEED_INT_FAST_T
-#endif
-
-#ifndef _STDINT_HEADER_INTPTR
-#define _STDINT_NEED_INTPTR_T
-#ifndef _STDINT_HAVE_INTMAX_T
-#define _STDINT_NEED_INTMAX_T
-#endif
-#endif
-
-
-/* .................... definition part ............................ */
-
-/* some system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-#endif
-
-#ifndef _HAVE_UINT64_T
-/* .. here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-/* note: all ELF-systems seem to have loff-support which needs 64-bit */
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-  /* compiler/cpu type to define int64_t */
-#endif
-#endif
-#endif
-
-#if defined _STDINT_HAVE_U_INT_TYPES
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
-/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
-/* (btw, those nibble-addressable systems are way off, or so we assume) */
-
 
-#if defined _STDINT_BYTE_MODEL
-#if _STDINT_LONG_MODEL+0 == 242
-/* 2:4:2 =  IP16 = a normal 16-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
-/* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
-/* 4:4:4 = ILP32 = a normal 32-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
-/* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
-/* 4:8:8 =  LP64 = a normal 64-bit system                 */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* this system has a "long" of 64bit */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef unsigned long   uint64_t;
-typedef          long    int64_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 448
-/*      LLP64   a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* assuming the system has a "long long" */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef unsigned long long uint64_t;
-typedef          long long  int64_t;
-#endif
-#else
-#define _STDINT_NO_INT32_T
-#endif
-#else
-#define _STDINT_NO_INT8_T
-#define _STDINT_NO_INT32_T
-#endif
-#endif
 
-/*
- * quote from SunOS-5.8 sys/inttypes.h:
- * Use at your own risk.  As of February 1996, the committee is squarely
- * behind the fixed sized types; the "least" and "fast" types are still being
- * discussed.  The probability that the "fast" types may be removed before
- * the standard is finalized is high enough that they are not currently
- * implemented.
- */
+    { echo "$as_me:$LINENO: checking Subversion revision information" >&5
+echo $ECHO_N "checking Subversion revision information... $ECHO_C" >&6; }
+    if test -d $srcdir/.svn && test -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then
+       rev=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-`
+       url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-`
+       ( echo '#define BUILT_REV "'$rev'"'
+         echo '#define BUILT_BRANCH "'`basename "$url"`'"'
+       ) > common-src/svn-info.h
 
-#if defined _STDINT_NEED_INT_LEAST_T
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_least64_t;
-#endif
+       { echo "$as_me:$LINENO: result: updated" >&5
+echo "${ECHO_T}updated" >&6; }
+    else
+       # Makefiles will be upset if the file doesn't exist, so double-check
+       if test -f common-src/svn-info.h; then
+           : # all good
+           { echo "$as_me:$LINENO: result: not changed" >&5
+echo "${ECHO_T}not changed" >&6; }
+       else
+           echo '/* no information available */' > common-src/svn-info.h
+           { echo "$as_me:$LINENO: result: not available" >&5
+echo "${ECHO_T}not available" >&6; }
+       fi
+    fi
 
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-  /* least types */
-#endif
+    rm -f conftemp.svn
 
-#if defined _STDINT_NEED_INT_FAST_T
-typedef  int8_t    int_fast8_t;
-typedef  int       int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_fast64_t;
-#endif
 
-typedef uint8_t   uint_fast8_t;
-typedef unsigned  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-  /* fast types */
-#endif
 
-#ifdef _STDINT_NEED_INTMAX_T
-#ifdef _HAVE_UINT64_T
-typedef  int64_t       intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef          long  intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INTPTR_T
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-/* we encourage using "long" to store pointer values, never use "int" ! */
-#if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
-typedef  unsinged int   uintptr_t;
-typedef           int    intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
-typedef        uint64_t uintptr_t;
-typedef         int64_t  intptr_t;
-#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#endif
-#endif
-#endif
-
-/* The ISO C99 standard specifies that in C++ implementations these
-   should only be defined if explicitly requested.  */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-#ifndef UINT32_C
-
-/* Signed.  */
-# define INT8_C(c)      c
-# define INT16_C(c)     c
-# define INT32_C(c)     c
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INT64_C(c)    c ## L
-# else
-#  define INT64_C(c)    c ## LL
-# endif
+    echo "Compiler Flags:"
+    echo "  CFLAGS: ${CFLAGS-(none)}"
+    echo "  CPPFLAGS: ${CPPFLAGS-(none)}"
+    echo "  LDFLAGS: ${LDFLAGS-(none)}"
+    echo "  LIBS: ${LIBS-(none)}"
 
-/* Unsigned.  */
-# define UINT8_C(c)     c ## U
-# define UINT16_C(c)    c ## U
-# define UINT32_C(c)    c ## U
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define UINT64_C(c)   c ## UL
-# else
-#  define UINT64_C(c)   c ## ULL
-# endif
 
-/* Maximal type.  */
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INTMAX_C(c)   c ## L
-#  define UINTMAX_C(c)  c ## UL
-# else
-#  define INTMAX_C(c)   c ## LL
-#  define UINTMAX_C(c)  c ## ULL
-# endif
+    components=''
+    if $WANT_SERVER; then
+       components="$components server";
+    else
+       components="$components (no server)";
+    fi
+    if $WANT_RESTORE; then
+       components="$components restore";
+    else
+       components="$components (no restore)";
+    fi
+    if $WANT_CLIENT; then
+       components="$components client";
+    else
+       components="$components (no client)";
+    fi
+    if $WANT_RECOVER; then
+       components="$components amrecover";
+    else
+       components="$components (no amrecover)";
+    fi
 
-  /* literalnumbers */
-#endif
-#endif
+    echo "Amanda Components: $components"
 
-/* These limits are merily those of a two complement byte-oriented system */
 
-/* Minimum of signed integral types.  */
-# define INT8_MIN               (-128)
-# define INT16_MIN              (-32767-1)
-# define INT32_MIN              (-2147483647-1)
-# define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
-/* Maximum of signed integral types.  */
-# define INT8_MAX               (127)
-# define INT16_MAX              (32767)
-# define INT32_MAX              (2147483647)
-# define INT64_MAX              (__INT64_C(9223372036854775807))
+    echo "Working IPv6:" $WORKING_IPV6
 
-/* Maximum of unsigned integral types.  */
-# define UINT8_MAX              (255)
-# define UINT16_MAX             (65535)
-# define UINT32_MAX             (4294967295U)
-# define UINT64_MAX             (__UINT64_C(18446744073709551615))
 
-/* Minimum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MIN         INT8_MIN
-# define INT_LEAST16_MIN        INT16_MIN
-# define INT_LEAST32_MIN        INT32_MIN
-# define INT_LEAST64_MIN        INT64_MIN
-/* Maximum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MAX         INT8_MAX
-# define INT_LEAST16_MAX        INT16_MAX
-# define INT_LEAST32_MAX        INT32_MAX
-# define INT_LEAST64_MAX        INT64_MAX
+    echo "Build documentation:" $ENABLE_MANPAGE_BUILD
 
-/* Maximum of unsigned integral types having a minimum size.  */
-# define UINT_LEAST8_MAX        UINT8_MAX
-# define UINT_LEAST16_MAX       UINT16_MAX
-# define UINT_LEAST32_MAX       UINT32_MAX
-# define UINT_LEAST64_MAX       UINT64_MAX
 
-  /* shortcircuit*/
-#endif
-  /* once */
-#endif
-#endif
-STDINT_EOF
-fi
-    if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
-      { echo "$as_me:$LINENO: $ac_stdint_h is unchanged" >&5
-echo "$as_me: $ac_stdint_h is unchanged" >&6;}
-    else
-      ac_dir=`(dirname "$ac_stdint_h") 2>/dev/null ||
-$as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_stdint_h" : 'X\(//\)[^/]' \| \
-        X"$ac_stdint_h" : 'X\(//\)$' \| \
-        X"$ac_stdint_h" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_stdint_h" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+    echo "Directories:"
+    echo "  Perl modules (amperldir): $amperldir"
+    echo "  Dumper: $DUMPER_DIR"
+    echo "  Configuration: $CONFIG_DIR"
+    echo "  GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR"
+    echo "  Temporary: $AMANDA_TMPDIR"
 
-      rm -f $ac_stdint_h
-      mv $ac_stdint $ac_stdint_h
+    if test -f config.warnings; then
+       echo "WARNINGS:"
+       cat config.warnings | sed -e 's/^/  /g'
+       rm config.warnings
     fi
- ;;
-  esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# 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 || { (exit 1); exit 1; }
-fi
 
index a15742a6a5ce97e1f904bac18fc4006ecf030ca3..e304e0a5f105c28ace245f365d01ac37bb363553 100644 (file)
-
 AC_INIT
 AC_CONFIG_SRCDIR([common-src/amanda.h])
 AC_CONFIG_AUX_DIR(config)
 AC_CANONICAL_TARGET([])
 
+PACKAGE=amanda
+AC_SUBST(PACKAGE)
 
-CONFIGURE_COMMAND="'$0'"
-for arg in "$@"; do
-  CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
-done
-AC_DEFINE_UNQUOTED(CONFIGURE_COMMAND,"$CONFIGURE_COMMAND",
-         [Saves the original ./configure command line arguments])
-AC_SUBST(CONFIGURE_COMMAND)
-
-AM_INIT_AUTOMAKE(amanda, 2.5.2p1)
-AM_CONFIG_HEADER(config/config.h)
-
-AC_PREREQ(2.59)                dnl Minimum Autoconf version required.
-
-if test -f "$srcdir/SNAPSHOT"; then
-  cat < "$srcdir/SNAPSHOT"
-changequote(,)
-  snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT`
-changequote([,])
-  test -z "$snapdate" || VERSION="$VERSION-$snapdate"
-  SNAPSHOT_STAMP=SNAPSHOT
-else
-  SNAPSHOT_STAMP=
-fi
-AC_SUBST(SNAPSHOT_STAMP)
-
-if test -f config.local; then
-    echo "running local script ./config.local"
-    . ./config.local
-fi
-
-dnl
-dnl Set the version number of this release of Amanda from the VERSION
-dnl string, which is set in AM_INIT_AUTOMAKE.
-dnl
-changequote(,)
-VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'`
-VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'`
-VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
-VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\"
-changequote([,])
-
-VERSION_SUFFIX="$VERSION"
-AC_SUBST(VERSION_MAJOR)
-AC_SUBST(VERSION_MINOR)
-AC_SUBST(VERSION_PATCH)
-AC_SUBST(VERSION_COMMENT)
-AC_SUBST(VERSION_SUFFIX)
+AM_INIT_AUTOMAKE(amanda, "2.6.0")
+AC_CONFIG_HEADERS([config/config.h])
 
-dnl
-dnl runtime and compile time paths
-dnl
-SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc"
-LOCPATH=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin"
-)`
-SYSLOCPATH="$SYSPATH:$LOCPATH"
-LOCSYSPATH="$LOCPATH:$SYSPATH"
-
-dnl
-dnl Set up compiler location, basic CFLAGS, and include locations
-dnl and library locations before we start checking the system
-dnl configuration in more detail...
-dnl
+dnl Minimum Autoconf version required.
+AC_PREREQ(2.59)
 
-AC_ARG_WITH(cflags,
-    [  --with-cflags=CFLAGS   arguments to the c compiler (-Wall, -g, etc)],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-cflags option.])
-           ;;
-       esac
-       CFLAGS="$withval"
-    ])
-
-CFLAGS="-D_GNU_SOURCE $CFLAGS"
+#
+# Take care of some early Amanda-specific setup
+#
+AMANDA_INIT_SUMMARY
+AMANDA_SNAPSHOT_STAMP
+AMANDA_SPLIT_VERSION
+AMANDA_CONFIG_LOCAL
 
+#
+# Set up compiler location, basic flags, and include locations
+# and library locations before we start checking the system
+# configuration in more detail...
+#
 AC_PROG_CC
 gl_EARLY
 gl_INIT
 AC_OBJEXT
 AC_EXEEXT
-AC_SYS_LARGEFILE
-
-dnl
-dnl Process tool locations for tools we need right away to configure.
-dnl
-AC_PATH_PROGS(GREP,grep,,$LOCSYSPATH)
-if test -z "$GREP"; then
-    GREP=grep
-fi
-AC_DEFINE_UNQUOTED(GREP,"$GREP",[Define the location of the grep program. ])
-AC_PATH_PROGS(EGREP,egrep,,$LOCSYSPATH)
-
-AC_PATH_PROGS(AMLINT,lint,,/opt/SUNWspro/bin:$SYSLOCPATH)
-if test ! -z "$AMLINT"; then
-  $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AMLINTFLAGS="-n -s -u -m -x"
-    AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
-    AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
-    AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
-    AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
-    AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
-  else
-    AMLINTFLAGS=""
-  fi
-else
-  AC_PATH_PROGS(AMLINT,splint,,$SYSLOCPATH)
-  if test ! -z "$AMLINT"; then
-    AMLINT="splint"
-  fi
-  AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
-fi
-AC_SUBST(AMLINTFLAGS)
-
-AC_ARG_WITH(includes,
-    [  --with-includes=DIR    site header files for readline, etc in DIR],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.])
-         ;;
-       esac
-       INCLUDE_DIRS="$withval"
-    ])
-
-if test "$INCLUDE_DIRS"; then
-       for dir in $INCLUDE_DIRS; do
-           if test -d "$dir"; then
-               AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir"
-           else
-               AC_MSG_WARN([*** Include directory $dir does not exist.])
-           fi
-       done
-fi
-
-AC_ARG_WITH(libraries,
-    [  --with-libraries=DIR   site library directories for readline, etc in DIR],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.])
-         ;;
-       esac
-       LIBRARY_DIRS="$withval"
-    ])
-
-if test "$LIBRARY_DIRS"; then
-       for dir in $LIBRARY_DIRS; do
-           if test -d "$dir"; then
-               case "$target" in
-                 *-solaris2*,*-netbsd*)
-                       AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir"
-                       ;;
-               esac
-               AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir"
-           else
-               AC_MSG_WARN([*** Library directory $dir does not exist.])
-           fi
-       done
-fi
+AMANDA_INIT_FLAGS
+AMANDA_ADD_CPPFLAGS([-D_GNU_SOURCE])
 
-dnl
-dnl Process configuration flags
-dnl
-
-AC_ARG_WITH(dumperdir,
-    [  --with-dumperdir=DIR   where we install the dumpers [[EPREFIX/dumper]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-dumperdir option.])
-         ;;
-       esac
-       DUMPER_DIR="$withval"
-    ], [
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-        DUMPER_DIR=$exec_prefix/dumper
-    ]
-)
-DUMPER_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$DUMPER_DIR"
-)`
-AC_DEFINE_UNQUOTED(DUMPER_DIR,"$DUMPER_DIR",[Directory in which dumper interfaces should be installed and searched. ])
-AC_SUBST(DUMPER_DIR)
-
-AC_ARG_WITH(configdir,
-    [  --with-configdir=DIR   runtime config files in DIR [[sysconfdir/amanda]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-configdir option.])
-         ;;
-       *) CONFIG_DIR="$withval"
-         ;;
-       esac
-    ],
-    : ${CONFIG_DIR="$sysconfdir/amanda"}
-)
-CONFIG_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$CONFIG_DIR"
-)`
-AC_DEFINE_UNQUOTED(CONFIG_DIR,"$CONFIG_DIR",
-  [The directory in which configuration directories should be created. ])
-AC_SUBST(CONFIG_DIR)
-
-AC_ARG_WITH(indexdir,
-    [  --with-indexdir        deprecated, use indexdir in amanda.conf],
-    [   AC_MSG_ERROR([*** --with-indexdir is deprecated, use indexdir in amanda.conf instead.])
-    ],)
-
-AC_ARG_WITH(dbdir,
-    [  --with-dbdir           deprecated, use infofile in amanda.conf],
-    [   AC_MSG_ERROR([*** --with-dbdir is deprecated, use infofile in amanda.conf instead.])
-    ],)
-
-AC_ARG_WITH(logdir,
-    [  --with-logdir          deprecated, use logfile in amanda.conf],
-    [   AC_MSG_ERROR([*** --with-logdir is deprecated, use logdir in amanda.conf instead.])
-    ],)
-
-AC_ARG_WITH(suffixes,
-    [  --with-suffixes        install binaries with version string appended to name],
-    USE_VERSION_SUFFIXES=$withval,
-    : ${USE_VERSION_SUFFIXES=no}
-)
-case "$USE_VERSION_SUFFIXES" in
-y | ye | yes)
-    AC_DEFINE(USE_VERSION_SUFFIXES, 1,
-       [Define to have programs use version suffixes when calling other programs.])
-
-    program_suffix="-$VERSION"
-    # This is from the output of configure.in.
-    if test "x$program_transform_name" = xs,x,x,; then
-       program_transform_name=
-    else
-       # Double any \ or $.  echo might interpret backslashes.
-       cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
-       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-       rm -f conftestsed
-    fi
-    test "x$program_prefix" != xNONE &&
-       program_transform_name="s,^,${program_prefix},; $program_transform_name"
-    # Use a double $ so make ignores it.
-    test "x$program_suffix" != xNONE &&
-       program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-    # sed with no file args requires a program.
-    test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
-    # Remove empty command
-    cat <<\EOF_SED > conftestsed
-s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
-EOF_SED
-    program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-    rm -f conftestsed
-  ;;
-n | no) USE_VERSION_SUFFIXES=no
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-suffixes option.])
-  ;;
-esac
-AC_SUBST(USE_VERSION_SUFFIXES)
-
-case "$target" in
-    *-hp-*)
-       CLIENT_SCRIPTS_OPT=amhpfixdevs
-       ;;
-    *-sni-sysv4)
-       CLIENT_SCRIPTS_OPT=amsinixfixdevs
-       ;;
-    *)
-       CLIENT_SCRIPTS_OPT=
-       ;;
-esac
-
-AC_SUBST(CLIENT_SCRIPTS_OPT)
-
-AC_ARG_WITH(client-only,
-    [  --with-client-only     deprecated, use --without-server],
-    [   AC_MSG_ERROR([*** --with-client-only is deprecated, use --without-server instead.])
-    ],)
-AC_ARG_WITH(server-only,
-    [  --with-server-only     deprecated, use --without-client],
-    [   AC_MSG_ERROR([*** --with-server-only is deprecated, use --without-client instead.])
-    ],)
-
-AC_ARG_WITH(client,
-    [  --without-client       do not build client stuff],
-    [
-       case "$withval" in
-       y | ye | yes) NO_CLIENT_MODE=false;;
-       n | no) NO_CLIENT_MODE=true;;
-       *)
-           AC_MSG_ERROR([*** You must not supply an argument to --with-client option.])
-         ;;
-       esac
-    ]
-)
-
-AC_ARG_WITH(server,
-    [  --without-server       do not build server stuff (set --without-restore)],
-    [
-       case "$withval" in
-       y | ye | yes) NO_SERVER_MODE=false ;;
-       n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;;
-       *)
-           AC_MSG_ERROR([*** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval])
-         ;;
-       esac
-    ]
-)
-if test "x${NO_SERVER_MODE+set}" != xset ; then
-   NO_SERVER_MODE=false
-fi
-
-AC_ARG_WITH(restore,
-    [  --without-restore      do not build amrestore nor amidxtaped],
-    [
-       case "$withval" in
-       y | ye | yes) NO_RESTORE_MODE=false;;
-       n | no) NO_RESTORE_MODE=true;;
-       *)
-           AC_MSG_ERROR([*** You must not supply an argument to --with-restore option.])
-         ;;
-       esac
-    ]
-)
-if test "x${NO_RESTORE_MODE+set}" != xset ; then
-   NO_RESTORE_MODE=${NO_SERVER_MODE-false}
-fi
-
-if ${NO_SERVER_MODE-false}; then
-   if ${NO_RESTORE_MODE-false}; then
-      dnl
-      dnl --without-server and --without-restore is OK
-      dnl
-      true
-   else
-      AC_MSG_ERROR([*** --without-server requires --without-restore])
-   fi
-fi
-
-AC_ARG_WITH(amrecover,
-    [  --without-amrecover    do not build amrecover],
-    [
-       case "$withval" in
-       y | ye | yes)
-           if ${NO_CLIENT_MODE-false}; then
-               AC_MSG_ERROR([*** --without-client and --with-amrecover are incompatible])
-           fi
-           NO_RECOVER_MODE=false;;
-       n | no) NO_RECOVER_MODE=true;;
-       *)
-           AC_MSG_ERROR([*** You must not supply an argument to --with-amrecover option.])
-         ;;
-       esac
-    ]
-)
-
-AC_ARG_WITH(index-server,
-   [  --with-index-server=HOST default amanda index server [[`uname -n`]]],
-   [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
-         ;;
-       *) DEFAULT_SERVER="$withval"
-         ;;
-       esac
-   ],
-   : ${DEFAULT_SERVER=`uname -n`}
-)
-AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
-  [This is the default Amanda index server. ])
-AC_SUBST(DEFAULT_SERVER)
-
-AC_ARG_WITH(force-uid,
-    [  --without-force-uid    do not force the uid to --with-user],
-    FORCE_USERID="$withval",
-    : ${FORCE_USERID=yes}
-)
-case "$FORCE_USERID" in
-y | ye | yes) AC_DEFINE(FORCE_USERID, 1,
-       [Define to force to another user on client machines. ])
-  ;;
-n | no) :
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.])
-esac
-
-AC_ARG_WITH(user,
-    [  --with-user=USER       force execution to USER on client systems [[required]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-user option.])
-         ;;
-       *) CLIENT_LOGIN="$withval"
-         ;;
-       esac
-    ]
-)
-if test "x${CLIENT_LOGIN+set}" != xset; then
-    AC_MSG_ERROR([*** --with-user=USER is missing])
-fi
-AC_DEFINE_UNQUOTED(CLIENT_LOGIN,"$CLIENT_LOGIN",
-  [Define as a the user to force to on client machines. ])
-AC_SUBST(CLIENT_LOGIN)
-
-AC_ARG_WITH(group,
-    [  --with-group=GROUP     group allowed to execute setuid-root programs [[required]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-group option.])
-         ;;
-       *) SETUID_GROUP="$withval"
-         ;;
-       esac
-    ]
-)
-if test "x${SETUID_GROUP+set}" != xset; then
-    AC_MSG_ERROR([*** --with-group=GROUP is missing])
-fi
-AC_SUBST(SETUID_GROUP)
-
-AC_ARG_WITH(owner,
-    [  --with-owner=USER       force ownership of files to USER [[default == --with-user value]]],
-    [
-        case "$withval" in
-        "" | y | ye | yes | n | no)
-            AC_MSG_ERROR([*** You must supply an argument to the --with-owner option.])
-          ;;
-        *) BINARY_OWNER="$withval"
-          ;;
-        esac
-    ]
-)
-if test "x${BINARY_OWNER+set}" != xset ; then
-   BINARY_OWNER=$CLIENT_LOGIN
-fi
-AC_DEFINE_UNQUOTED(BINARY_OWNER,"$BINARY_OWNER",
-  [Define as the user who owns installed binaries. ])
-AC_SUBST(BINARY_OWNER)
-
-AC_ARG_WITH(rundump,
-    [  --with-rundump         use rundump (setuid-root) to invoke dump],
-    [
-    case "$withval" in
-       n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";;
-       *) AC_MSG_ERROR([*** You must not supply an argument to --with-rundump option.]);;
-    esac
-    ]
-)
-
-AC_ARG_WITH(config,
-   [  --with-config=CONFIG   default configuration [[DailySet1]]],
-   [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
-         ;;
-       *) DEFAULT_CONFIG="$withval"
-         ;;
-       esac
-   ],
-   : ${DEFAULT_CONFIG=DailySet1}
-)
-AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
-  [This is the default Amanda configuration. ])
-AC_SUBST(DEFAULT_CONFIG)
-
-AC_ARG_WITH(tape-server,
-    [  --with-tape-server=HOST default restoring tape server is HOST [[same as --with-index-server]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
-         ;;
-       *) DEFAULT_TAPE_SERVER="$withval"
-         ;;
-       esac
-    ],
-    : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
-)
-AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",[This is the default restoring Amanda tape server. ])
-AC_SUBST(DEFAULT_TAPE_SERVER)
-
-AC_ARG_WITH(tape-device,
-    [  --with-tape-device=ARG restoring tape server HOST's no rewinding tape drive],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
-         ;;
-       *) DEFAULT_TAPE_DEVICE="$withval"
-         ;;
-       esac
-    ]
-)
-
-if test ! -z "$DEFAULT_TAPE_DEVICE"; then
-    AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",[This is the default no-rewinding tape device. ])
-    AC_SUBST(DEFAULT_TAPE_DEVICE)
-    EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE
-else
-    EXAMPLE_TAPEDEV="/dev/null"
-fi
-AC_SUBST(EXAMPLE_TAPEDEV)
-
-AC_ARG_WITH(ftape-raw-device,
-    [  --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-ftape-rawdevice option.])
-         ;;
-       *) DEFAULT_RAW_TAPE_DEVICE="$withval"
-         ;;
-       esac
-    ],
-    [
-       if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-           AC_MSG_CHECKING(for raw ftape device)
-           dnl Look for tape devices in /dev.
-           raw_tape_dev=/dev/null
-               dnl Look for tape devices in /dev.
-               for num in 3 2 1 0 ; do
-                   td=/dev/rawft${num}
-                   if test -r $td; then
-                       raw_tape_dev=$td
-                   fi
-               done
-           DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev
-           AC_MSG_RESULT($DEFAULT_RAW_TAPE_DEVICE)
-       fi
-    ]
-)
-
-if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-    DEFAULT_RAW_TAPE_DEVICE=/dev/null
-fi
-
-AC_DEFINE_UNQUOTED(DEFAULT_RAW_TAPE_DEVICE,"$DEFAULT_RAW_TAPE_DEVICE",[For Linux systems with floppy tapes: 
- * QIC volume table support via raw tape device. ])
-AC_SUBST(DEFAULT_RAW_TAPE_DEVICE)
-
-AC_ARG_WITH(rew-tape,
-    [  --with-rew-tape        deprecated, use --with-tape-device],
-    [   AC_MSG_ERROR([*** --with-rew-tape is deprecated, use --with-tape-device instead.])
-    ],)
-
-AC_ARG_WITH(norew-tape,
-    [  --with-norew-tape=ARG  deprecated, use --with-tape-device],
-    [   AC_MSG_ERROR([*** --with-norew-tape is deprecated, use --with-tape-device instead.])
-    ],)
-
-AC_ARG_WITH(changer-device,
-    [  --with-changer-device=ARG default tape changer device [[/dev/ch0 if it exists]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.])
-         ;;
-       *) DEFAULT_CHANGER_DEVICE="$withval"
-         ;;
-       esac
-    ],
-    [
-       if test -z "$DEFAULT_CHANGER_DEVICE" &&
-          test -f /dev/ch0; then
-           DEFAULT_CHANGER_DEVICE=/dev/ch0
-       fi
-    ]
-)
-
-if test -z "$DEFAULT_CHANGER_DEVICE"; then
-    DEFAULT_CHANGER_DEVICE=/dev/null
-fi
-
-AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",[This is the default changer device. ])
-AC_SUBST(DEFAULT_CHANGER_DEVICE)
-
-AC_ARG_WITH(fqdn,
-    [  --with-fqdn            use FQDN's to backup multiple networks],
-    USE_FQDN=$withval,
-    : ${USE_FQDN=no}
-)
-case "$USE_FQDN" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(USE_FQDN,1,[Define for backups being done on a multiple networks and FQDNs are used. ])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-fqdn option.])
-  ;;
-esac
-
-AC_ARG_WITH(broken-fsf,
-    [  --with-broken-fsf      only enable if tape fsf calls fail mid-file],
-    HAVE_BROKEN_FSF=$withval,
-    : ${HAVE_BROKEN_FSF=no}
-)
-case "$HAVE_BROKEN_FSF" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(HAVE_BROKEN_FSF,1,[Define this if issuing a fsf on a tape fails when you are not at a tape
- * mark, for instance, if amrecover gives I/O errors when skipping.
-])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-broken-fsf option.])
-  ;;
-esac
-
-AC_ARG_WITH(reuseports,
-    [  --without-reuseaddr    Don't closed network connections to be reused until full timeout period.],
-    [ case "$withval" in
-        y | ye | yes)
-          REUSEADDR=no;;
-        n | no)
-          REUSEADDR=yes;;
-        *)
-          REUSEADDR=no;;
-      esac
-    ],
-    [ REUSEADDR=yes; ])
-case "$REUSEADDR" in
-n | no) :
-    ;;
-y |  ye | yes)
-    AC_DEFINE(USE_REUSEADDR,1,[Define to set SO_REUSEADDR on network connections.])
-    ;;
-*)
-    AC_MSG_ERROR([*** You must not supply an argument to --with-reuseports option.])
-    ;;
-esac
-
-AC_ARG_WITH(gnutar,
-    [  --with-gnutar[[=PROG]]      use PROG as GNU tar executable [[default: looks for one]]],
-    [
-       case "$withval" in
-           /*) GNUTAR="$withval";;
-           y|ye|yes) :;;
-           n|no) GNUTAR=;;
-           *)  AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);;
-       esac
-    ]
-)
-
-AC_ARG_WITH(smbclient,
-    [  --with-smbclient[[=PROG]]   use PROG as Samba's smbclient executable [[default: looks for one]]],
-    [
-       case "$withval" in
-           /*) SAMBA_CLIENT="$withval";;
-           y|ye|yes) :;;
-           n|no) SAMBA_CLIENT=;;
-           *)  AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);;
-       esac
-    ]
-)
-
-AC_ARG_WITH(samba-user,
-   [  --with-samba-user was deprecated],
-   [    AC_MSG_ERROR([*** The samba-user option was deprecated, the username go in the amandapass])
-   ]
-)
-
-AC_ARG_WITH(gnutar-listdir,
-   [  --with-gnutar-listdir=DIR  gnutar directory lists go in DIR [[localstatedir/amanda/gnutar-lists]]],
-   [
-       case "$withval" in
-           n | no)             unset GNUTAR_LISTDIR ;;
-           y | ye | yes)       : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;;
-           /*)                 GNUTAR_LISTDIR="$withval" ;;
-           *)                  AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar-listdir])
-       esac
-    ],
-    : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"}
-)
-if test "$GNUTAR_LISTDIR"; then
-    GNUTAR_LISTDIR=`(
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        eval echo "$GNUTAR_LISTDIR"
-    )`
-    AC_DEFINE_UNQUOTED(GNUTAR_LISTED_INCREMENTAL_DIR,"$GNUTAR_LISTDIR",[The directory in which GNU tar should store directory lists for incrementals. ])
-    GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR
-else
-    GNUTAR_LISTED_INCREMENTAL_DIRX=
-fi
-AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIRX)
-
-AC_ARG_WITH(gnutar-listed-incremental,
-   [  --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir],
-   [    AC_MSG_ERROR([*** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead])
-   ]
-)
-GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR
-AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIR)
-
-AC_ARG_WITH(bsd-security,
-    [  --without-bsd-security do not use BSD rsh/rlogin style security],
-    BSD_SECURITY=$withval,
-    : ${BSD_SECURITY=yes}
-)
-case "$BSD_SECURITY" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(BSD_SECURITY,1,[Define to use BSD .rhosts/.amandahosts security. ])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-bsd-security option.])
-  ;;
-esac
-
-AC_ARG_WITH(amandahosts,
-    [  --without-amandahosts  use .rhosts instead of .amandahosts],
-    USE_AMANDAHOSTS=$withval,
-    : ${USE_AMANDAHOSTS=yes}
-)
-case "$USE_AMANDAHOSTS" in
-n | no) : ;;
-y |  ye | yes) :
-  case "$BSD_SECURITY" in
-  y | ye | yes) AC_DEFINE(USE_AMANDAHOSTS,1,[Define if you want to use the .amandahosts for BSD security. ])
-    ;;
-  esac
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-amandahosts option.])
-  ;;
-esac
-
-dnl Specify --with-dbmalloc if you desire dbmalloc to be linked in
-
-AC_ARG_WITH(dbmalloc,
-    [  --with-dbmalloc=DIR  Location of dbmalloc libs and headers],
-    DBMALLOC="$withval",
-    : ${DBMALLOC=no}
-)
-
-case "$DBMALLOC" in
-n | no)
-    DBMALLOCCFLAGS=""
-    DBMALLOCLIBS=""
-    ;;
-*) 
-    AC_CHECK_LIB(dbmalloc,malloc)
-    if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then
-      AC_MSG_WARN([*** dbmalloc library not found - no malloc debugging support!])
-      DBMALLOCCFLAGS=""
-      DBMALLOCLIBS=""
-    else
-      DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC"
-      DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc"
-    fi
-    ;;
-esac
-
-AC_ARG_WITH(ipv6,
-    AS_HELP_STRING([--with-ipv6],
-                  [If IPv6 must be enabled (Default)])
-AS_HELP_STRING([--without-ipv6],
-              [If IPv6 must be disable]),
-    [
-       case "$withval" in
-       y | ye | yes) amanda_ipv6=true;;
-       n | no) amanda_ipv6=false;;
-       *)
-           AC_MSG_ERROR([*** You must not supply an argument to --with-ipv6 option.])
-         ;;
-       esac
-    ]
-)
+dnl -------------------------------------------------------------------------
 
-dnl Specify --with-krb4-security if Kerberos software is in somewhere
-dnl other than the listed KRB4_SPOTS.  We only compile kerberos support in
-dnl if the right files are there.
-
-: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
-
-AC_ARG_WITH(krb4-security,
-    [  --with-krb4-security=DIR   Location of Kerberos software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]],
-    KRB4_SECURITY="$withval",
-    : ${KRB4_SECURITY=no}
-)
-
-case "$KRB4_SECURITY" in
-n | no) KRB4_SECURITY=no ;;
-y | ye | yes) : ;;
-*) KRB4_SPOTS="$KRB4_SECURITY"
-   KRB4_SECURITY=yes
-   ;;
-esac
-
-AC_MSG_CHECKING(for Kerberos and Amanda kerberos4 bits)
-if test "x${KRB4_SECURITY}" = xyes -a -f  ${srcdir-.}/common-src/krb4-security.c ; then
-    for dir in $KRB4_SPOTS; do
-       if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then
-           #
-           # This is the original Kerberos 4.
-           #
-           AC_MSG_RESULT(found in $dir)
-           KRB4_SECURITY=yes
-           AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ])
-           if test -d $dir/include/kerberosIV ; then
-               #
-               # This handles BSD/OS.
-               #
-               KRB4INCLUDES=-I$dir/include/kerberosIV
-           else
-               KRB4INCLUDES=-I$dir/include
-           fi
-           KRB4LDFLAGS=-L$dir/lib
-           KRB4LIBS="-lkrb -ldes"
-           if test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="$KRB4LIBS -lcom_err"
-           fi
-           break
-       elif test -f ${dir}/lib/libkrb4.a &&
-            test -f ${dir}/lib/libcrypto.a &&
-            test -f ${dir}/lib/libdes425.a ; then
-           #
-           # This is Kerberos 5 with Kerberos 4 back-support.
-           #
-           AC_MSG_RESULT(found in $dir)
-           KRB4_SECURITY=yes
-           AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ])
-           KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV"
-           KRB4LDFLAGS=-L$dir/lib
-           if test -f ${dir}/lib/libkrb5.a &&
-               test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err"
-           else
-               KRB4LIBS="-lkrb4 -lcrypto -ldes425"
-           fi
-           break
-       fi
-    done
-
-    if test "x$KRB4LDFLAGS" = "x" ; then
-       AC_MSG_RESULT(no libraries found)
-    fi
-else
-    AC_MSG_RESULT(no)
-fi
-
-AC_ARG_WITH(rsh-security,
-    [  --with-rsh-security use rsh as a transport],
-    RSH_SECURITY=$withval,
-    : ${RSH_SECURITY=yes}
-)
-case "$RSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(RSH_SECURITY,1,[Define if RSH transport should be enabled. ])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument the to --with-rsh-security option.])
-  ;;
-esac
-
-AC_ARG_WITH(ssh-security,
-    [  --with-ssh-security use ssh as a transport],
-    SSH_SECURITY=$withval,
-    : ${SSH_SECURITY=no}
-)
-case "$SSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(SSH_SECURITY,1,[Define if SSH transport should be enabled. ])
-              SSH_SECURITY_SET=true
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.])
-  ;;
-esac
-
-# find SSH and check for SSH options if we're using SSH security
-if test x"$SSH_SECURITY" = "xyes"; then
-    AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH)
-    AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary])
-
-    AC_ARG_WITH(ssh-options,
-    AS_HELP_STRING([--with-ssh-options=@<:@OPTIONS@:>@],
-                  [Use these ssh options for ssh security; the default should work]),
-       [ SSH_OPTIONS="$withval" ],
-       [ SSH_OPTIONS='' ]
-    )
-
-    case "$SSH_OPTIONS" in
-       y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to --with-ssh-options.]);;
-       *) : ;;
-    esac
-
-    AC_MSG_CHECKING([SSH options])
-    # if we didn't get SSH options from the user, figure them out for ourselves
-    if test -z "$SSH_OPTIONS"; then
-       # TODO - quote these (or break them up in ssh-security??)
-       case `$SSH -V 2>&1` in
-           OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
-           *) SSH_OPTIONS='-x -o BatchMode=yes'
-       esac
-    fi
-
-    # now convert that to a comma-separated list of C strings
-    eval "set dummy ${SSH_OPTIONS}"; shift
-    SSH_OPTIONS=''
-    for i in "${@}"; do SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done
-    AC_MSG_RESULT($SSH_OPTIONS)
-
-    AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS, [Arguments to ssh])
-fi
-
-AC_ARG_WITH(bsdtcp-security,
-    [  --with-bsdtcp-security use tcp as a transport],
-    BSDTCP_SECURITY=$withval,
-    : ${BSDTCP_SECURITY=yes}
-)
-case "$BSDTCP_SECURITY" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(BSDTCP_SECURITY,1,[Define if BSDTCP transport should be enabled. ])
-              BSDTCP_SECURITY_SET=true
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument the to --with-bsdtcp-security option.])
-  ;;
-esac
-
-AC_ARG_WITH(bsdudp-security,
-    [  --with-bsdudp-security use udp as a transport],
-    BSDUDP_SECURITY=$withval,
-    : ${BSDUDP_SECURITY=yes}
-)
-case "$BSDUDP_SECURITY" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(BSDUDP_SECURITY,1,[Define if BSDUDP transport should be enabled. ])
-              BSDUDP_SECURITY_SET=true
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument the to --with-bsdudp-security option.])
-  ;;
-esac
-
-AC_ARG_WITH(server-principal,
-    [    --with-server-principal=ARG    server host principal  [["amanda"]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-server-principal option.])
-         ;;
-       *)
-           SERVER_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-    ],
-    : ${SERVER_HOST_PRINCIPLE="amanda"}
-)
-AC_DEFINE_UNQUOTED(SERVER_HOST_PRINCIPLE,"$SERVER_HOST_PRINCIPLE",[The Kerberos server principle. ])
-
-AC_ARG_WITH(server-instance,
-    [    --with-server-instance=ARG     server host instance   [["amanda"]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-server-instance option.])
-         ;;
-       *) SERVER_HOST_INSTANCE="$withval"
-         ;;
-       esac
-    ],
-    : ${SERVER_HOST_INSTANCE="amanda"}
-)
-AC_DEFINE_UNQUOTED(SERVER_HOST_INSTANCE,"$SERVER_HOST_INSTANCE",[The Kerberos server instance. ])
-
-AC_ARG_WITH(server-keyfile,
-    [    --with-server-keyfile=ARG      server host key file   [["/.amanda"]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-server-keyfile option.])
-         ;;
-       *) SERVER_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-    ],
-    : ${SERVER_HOST_KEY_FILE="/.amanda"}
-)
-AC_DEFINE_UNQUOTED(SERVER_HOST_KEY_FILE,"$SERVER_HOST_KEY_FILE",[The Kerberos server key file. ])
-
-AC_ARG_WITH(client-principal,
-    [    --with-client-principal=ARG    client host principal  [["rcmd"]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-client-principal option.])
-         ;;
-       *) CLIENT_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-    ],
-    : ${CLIENT_HOST_PRINCIPLE="rcmd"}
-)
-AC_DEFINE_UNQUOTED(CLIENT_HOST_PRINCIPLE,"$CLIENT_HOST_PRINCIPLE",[The Kerberos client host principle. ])
-
-AC_ARG_WITH(client-instance,
-    [    --with-client-instance=ARG     client host instance   [[HOSTNAME_INSTANCE]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-client-instance option.])
-         ;;
-       *) CLIENT_HOST_INSTANCE="$withval"
-         ;;
-       esac
-    ],
-    : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
-)
-AC_DEFINE_UNQUOTED(CLIENT_HOST_INSTANCE,$CLIENT_HOST_INSTANCE,[The Kerberos client host instance. ])
-
-AC_ARG_WITH(client-keyfile,
-    [    --with-client-keyfile=ARG      client host key file   [[KEYFILE]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-client-keyfile option.])
-         ;;
-       *) CLIENT_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-    ],
-    : ${CLIENT_HOST_KEY_FILE=KEYFILE}
-)
-
-# Assume it's either KEYFILE (defined in krb.h), or a string filename...
-if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
-  CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
-fi
-
-AC_DEFINE_UNQUOTED(CLIENT_HOST_KEY_FILE,$CLIENT_HOST_KEY_FILE,[The Kerberos client host key file. ])
-
-AC_ARG_WITH(ticket-lifetime,
-    [    --with-ticket-lifetime=ARG     ticket lifetime        [[128]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-ticket-lifetime option.])
-         ;;
-       *) TICKET_LIFETIME="$withval"
-         ;;
-       esac
-    ],
-    : ${TICKET_LIFETIME=128}
-)
-AC_DEFINE_UNQUOTED(TICKET_LIFETIME,$TICKET_LIFETIME,[The Kerberos ticket lifetime. ])
-
-dnl Specify --with-krb5-security if Kerberos software is in somewhere
-dnl other than the listed KRB5_SPOTS.  We only compile kerberos support in
-dnl if the right files are there.
-
-: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
-
-AC_ARG_WITH(krb5-security,
-    [  --with-krb5-security=DIR   Location of Kerberos V software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]],
-    KRB5_SECURITY="$withval",
-    : ${KRB5_SECURITY=no}
-)
-
-case "$KRB5_SECURITY" in
-n | no) KRB5_SECURITY=no
-        KRB5_SPOTS=""
-       ;;
-y | ye | yes) : ;;
-*) KRB5_SPOTS="$KRB5_SECURITY"
-   KRB5_SECURITY=yes
-   ;;
-esac
-
-# if found, force the static versions of these libs (.a) by linking directly
-# with the .a files.  I don't know how to get -R dependancies checked
-# in autoconf at this time. -kashmir
-AC_MSG_CHECKING(for Kerberos V)
-KRB5_DIR_FOUND=""
-KRB5_CFLAGS=""
-for dir in $KRB5_SPOTS; do
-  for lib in lib lib64; do
-    k5libdir=${dir}/${lib}
-    if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
-       if test -f ${k5libdir}/libk5crypto.a; then
-           K5CRYPTO=-lk5crypto
-       elif test -f ${k5libdir}/libcrypto.a; then
-           K5CRYPTO=-lcrypto
-       else
-           K5CRYPTO=""
-       fi
-       if test -f ${k5libdir}/libkrb5support.a; then
-           K5SUPPORT=-lkrb5support
-       else
-           K5SUPPORT=""
-       fi
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err"
-       KRB5CFLAGS=""
-       break
-    elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a"
-       KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
-       break
-    fi
-  done
-done
-
-if test "$KRB5_DIR_FOUND"; then
-       AC_MSG_RESULT(found in $KRB5_DIR_FOUND)
-       KRB5_SECURITY=yes
-       AC_DEFINE(KRB5_SECURITY,1,[Define if Kerberos 5 security is to be enabled. ])
-       #
-       # some OS's, such as NetBSD, stick krb5 includes out of the way...
-       # should probably just use autoconf to look for various include
-       # options and set them, but don't quite want to do that until I've
-       # dug into it a bit more.
-       #
-       if test -d "$KRB5_DIR_FOUND/krb5" ; then
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5"
-       else
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include"
-       fi
-       if test "$KRB5_CFLAGS" ; then
-               KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS"
-       fi
-        AC_CHECK_LIB(krb5support,main)
-       KRB5LDFLAGS=-L$k5libdir
-       break
-fi
-
-if test "x$KRB5LDFLAGS" = "x" ; then
-    AC_MSG_RESULT(no krb5 system libraries found)
-fi
-
-
-AC_ARG_WITH(low-tcpportrange,
-    [  --with-low-tcpportrange=low,high     bind reserved TCP server sockets to ports within this range [unlimited] (mainly for amrecover)],
-    [
-       LOW_TCPPORTRANGE="$withval"
-    ]
-)
-if test x"${LOW_TCPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
-       AC_MSG_ERROR([*** --with-low-tcpportrange requires two comma-separated positive numbers])
-    fi
-    min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'`
-    max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'`
-    if test $min_low_tcp_port -gt $max_low_tcp_port; then
-       AC_MSG_ERROR([*** the second TCP port number must be greater than the first in --with-low-tcpportrange])
-    fi
-    if test $min_low_tcp_port -lt 512; then
-       AC_MSG_WARN([*** the low TCP port range should be 512 or greater in --with-low-tcpportrange])
-    fi
-    if test $max_low_tcp_port -ge 1024; then
-       AC_MSG_WARN([*** the low TCP port range should be less than 1024 in --with-low-tcpportrange])
-    fi
-    AC_DEFINE_UNQUOTED(LOW_TCPPORTRANGE,$LOW_TCPPORTRANGE,[A comma-separated list of two integers, determining the minimum and
-   maximum reserved TCP port numbers sockets should be bound to. (mainly for amrecover) ])
-fi
-
-AC_ARG_WITH(tcpportrange,
-    [  --with-tcpportrange=low,high  bind unreserved TCP server sockets to ports within this range [[unlimited]]],
-    [
-       TCPPORTRANGE="$withval"
-    ]
-)
-if test x"${TCPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
-       AC_MSG_ERROR([*** --with-tcpportrange requires two comma-separated positive numbers])
-    fi
-    min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
-    max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
-    if test $min_tcp_port -gt $max_tcp_port; then
-       AC_MSG_ERROR([*** the second TCP port number must be greater than the first in --with-tcpportrange])
-    fi
-    if test $min_tcp_port -lt 1024; then
-       AC_MSG_WARN([*** the TCP port range should be 1024 or greater in --with-tcpportrange])
-    fi
-    if test $max_tcp_port -ge 65536; then
-       AC_MSG_WARN([*** the TCP port range should be less than 65536 in --with-tcpportrange])
-    fi
-    AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE,[A comma-separated list of two integers, determining the minimum and
-   maximum unreserved TCP port numbers sockets should be bound to. ])
-fi
-
-AC_ARG_WITH(udpportrange,
-    [  --with-udpportrange=low,high  bind reserved UDP server sockets to ports within this range [[unlimited]]],
-    [
-       UDPPORTRANGE="$withval"
-    ]
-)
-if test x"${UDPPORTRANGE+set}" = x"set"; then
-    if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
-       AC_MSG_ERROR([*** --with-udpportrange requires two comma-separated positive numbers])
-    fi
-    min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
-    max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
-    if test $min_udp_port -gt $max_udp_port; then
-       AC_MSG_ERROR([*** the second UDP port number must be greater than the first in --with-udpportrange])
-    fi
-    if test $max_udp_port -ge 1024; then
-       AC_MSG_WARN([*** the UDP port range should be less than 1024 in --with-udpportrange])
-    fi
-    if test $min_udp_port -le 0; then
-       AC_MSG_WARN([*** the UDP port range should be greater than 0 in --with-udpportrange])
-    fi
-    AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE,[A comma-separated list of two integers, determining the minimum and
-   maximum reserved UDP port numbers sockets should be bound to. ])
-fi
-
-AC_ARG_WITH(maxtapeblocksize,
-    [  --with-maxtapeblocksize=kb            Maximum size of a tape block],
-    [
-       MAXTAPEBLOCKSIZE="$withval"
-    ],
-    : ${MAXTAPEBLOCKSIZE=32}
-)
-
-AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE),[Maximum size of a tape block in KBytes.])
-AC_SUBST(MAXTAPEBLOCKSIZE)
-
-AC_ARG_WITH(db,
-    [  --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [[text]]],
-    [
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           AC_MSG_ERROR([*** You must supply an argument to the --with-db option.])
-         ;;
-       *) DB_STYLE="$withval"
-         ;;
-       esac
-    ]
-)
-if test "$DB_STYLE"; then
-    case "$DB_STYLE" in
-       db | dbm | gdbm | ndbm | text)  ;;
-       *)
-           AC_MSG_ERROR([*** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text.])
-           DB_STYLE=
-           ;;
-    esac
-fi
-
-AC_ARG_WITH(mmap,
-    [  --with-mmap            force use of mmap instead of shared memory support],
-    FORCE_MMAP=$withval,
-    : ${FORCE_MMAP=no}
-)
-case "$FORCE_MMAP" in
-y | ye | yes | n | no) : ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.])
-  ;;
-esac
-
-AC_ARG_WITH(buffered-dump,
-    [  --with-buffered-dump   buffer the dumping sockets on the server for speed],
-    DUMPER_SOCKET_BUFFERING=$withval,
-    : ${DUMPER_SOCKET_BUFFERING=no}
-)
-case "$DUMPER_SOCKET_BUFFERING" in
-n | no) :
-  ;;
-y | ye | yes) AC_DEFINE(DUMPER_SOCKET_BUFFERING,1,[Define if dumper should buffer the sockets for faster throughput. ])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-buffered-dump.])
-  ;;
-esac
-
-AC_ARG_WITH(assertions,
-    [  --with-assertions      compile assertions into code],
-    ASSERTIONS="$withval",
-    : ${ASSERTIONS=no}
-)
-case "$ASSERTIONS" in
-n | no) : ;;
-y |  ye | yes) AC_DEFINE(ASSERTIONS,1,[Define if you want assertion checking. ])
-  ;;
-*) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.])
-  ;;
-esac
-
-AC_ARG_WITH(tmpdir,
-    [  --with-tmpdir[=/temp/dir] area Amanda can use for temp files [[/tmp/amanda]]],
-    tmpdir="$withval",
-    : ${tmpdir=yes}
-)
-tmpdir=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$tmpdir"
-)`
-case "$tmpdir" in
-n | no) AC_MSG_ERROR([*** --without-tmpdir is not allowed.]);;
-y |  ye | yes)
-       AMANDA_TMPDIR="/tmp/amanda";;
-/*)
-       AMANDA_TMPDIR="$tmpdir";;
-*) AC_MSG_ERROR([*** You must supply a full pathname to --with-tmpdir option.]);;
-esac
-AC_DEFINE_UNQUOTED(AMANDA_TMPDIR,"$AMANDA_TMPDIR",[The directory in which Amanda should create temporary files. ])
-AC_SUBST(AMANDA_TMPDIR)
-
-AC_ARG_WITH(debugging,
-    [  --with[[out]]-debugging[[=/debug/dir]] [[do not]] record runtime debugging information in specified directory [[--with-tmpdir]]],
-    debugging="$withval",
-    : ${debugging=yes}
-)
-debugging=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$debugging"
-)`
-case "$debugging" in
-n | no) AMANDA_DBGDIR="";;
-y |  ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
-/*) AMANDA_DBGDIR="$debugging";;
-*) AC_MSG_ERROR([*** You must supply a full pathname to --with-debugging option.])
-  ;;
-esac
-case "$AMANDA_DBGDIR" in
-"") :;;
-*) AC_DEFINE(DEBUG_CODE,1,[Define if you want debugging. ])
-   AC_DEFINE_UNQUOTED(AMANDA_DBGDIR,"$AMANDA_DBGDIR",[Location of Amanda directories and files. ])
-   AC_SUBST(AMANDA_DBGDIR);;
-esac
-
-AC_ARG_WITH(debug_days,
-    [  --with-debug-days=NN    number of days to keep debugging files [[default=4]]],
-    debug_days="$withval",
-    : ${debug_days=4}
-)
-case "$debug_days" in
-n | no) AMANDA_DEBUG_DAYS=0 ;;
-y |  ye | yes) AMANDA_DEBUG_DAYS=4 ;;
-[[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]]) AMANDA_DEBUG_DAYS="$debug_days" ;;
-*) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.])
-  ;;
-esac
-AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS,[Number of days to keep debugging files. ])
-AC_SUBST(AMANDA_DEBUG_DAYS)
-
-AC_ARG_WITH(testing,
-    [  --with-testing[[=suffix]] use alternate service names],
-    TESTING="$withval",
-    : ${TESTING=no}
-)
-case "$TESTING" in
-n | no) SERVICE_SUFFIX="";;
-y |  ye | yes) SERVICE_SUFFIX="-test";;
-*) SERVICE_SUFFIX="-$TESTING";;
-esac
-AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
-KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
-AC_SUBST(SERVICE_SUFFIX)
-AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX",[A suffix that will be appended to service names.
- * Useful for testing in parallel with a working version. ])
-AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME,  "$AMANDA_SERVICE_NAME", [The name for the Amanda service. ])
-AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME", [The name for the Kerberized Amanda service. ])
-
-(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-
-    tmp=`eval echo "$bindir"`
-    AC_DEFINE_UNQUOTED(bindir,"$tmp",[Directory in which user binaries should be installed. ])
-
-    tmp=`eval echo "$sbindir"`
-    AC_DEFINE_UNQUOTED(sbindir,"$tmp",[Directory in which administrator binaries should be installed. ])
-
-    tmp=`eval echo "$libexecdir"`
-    AC_DEFINE_UNQUOTED(libexecdir,"$tmp",[Directory in which internal binaries should be installed. ])
-
-    tmp=`eval echo $mandir`
-    AC_DEFINE_UNQUOTED(mandir,"$tmp",[Directory in which man-pages should be installed])
-)
-
-dnl Set the order of dump programs to look for.  Finding the proper file
-dnl system dumping program is problematic.  Some systems, notably HP-UX
-dnl and AIX, have both the backup and dump programs.  HP-UX can't use the
-dnl the backup program while AIX systems can't use the dump program.  So
-dnl a variable is set up here to specify the order of dump programs to
-dnl search for on the system.
-DUMP_PROGRAMS="ufsdump dump backup"
-GETCONF_LFS="LFS"
-
-dump_returns_1=
-xenix_tapeio=
-case "$target" in
-    *-dec-osf*)
-                       AC_DEFINE(STATFS_OSF1,1,[Define on OSF1. ])
-                       ;;
-    *-dg-*)
-                       DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
-                       : ${USE_RUNDUMP=yes}
-                       dump_returns_1=yes
-                       ;;
-    *-netbsd*)
-                       ;;
-    *-freebsd*)
-                       ;;
-    *-openbsd*)
-                       ;;
-    *-hp-*)
-                       MT_FILE_FLAG="-t"
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       case "$CC" in
-                           *gcc*)
-                               AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS"
-                               ;;
-                           *cc*)
-                               AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS"
-                               ;;
-                       esac
-                       ;;
-  *-ibm-aix*)
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
-                       AC_DEFINE(AIX_TAPEIO,1,[Define on AIX. ])
-                       AC_DEFINE(AIX_BACKUP,1,[Define on AIX. ])
-                       ;;
-  m88k-motorola-sysv4)
-                       ;;
-  *-nextstep3)
-                       ;;
-  *-pc-bsdi*)
-                       ;;
-  *-pc-linux-*)
-                       ;;
-  *-redhat-linux-*)
-                       ;;
-  *-suse-linux-*)
-                       ;;
-  x86_64-*-linux-*)
-                       ;;
-  alpha*-*-linux-*)
-                       ;;
-  sparc*-*-linux-*)
-                       ;;
-  powerpc-*-linux-*)
-                       ;;
-  *-sgi-irix3*)
-                       dnl The old cc won't work!
-                       CC=gcc
-                       ;;
-  *-sgi-irix4*)
-                       ;;
-  *-sgi-irix5*)
-                       ;;
-  *-sgi-irix6*)
-                       ;;
-  *-solaris2*)
-                       ;;
-  *-sun-sunos4.1*)
-                       ;;
-  *-ultrix*)
-                       : ${USE_RUNDUMP=yes}
-                       AC_DEFINE(STATFS_ULTRIX,1,[Define on Ultrix. ])
-                       dump_returns_1=yes
-                       ;;
-  *-sysv4.2uw2*)
-                       AC_DEFINE(UWARE_TAPEIO,1,[Define on UnixWare. ])
-                       ;;
-  *-sco3.2v4*)
-                       DEV_PREFIX=/dev/
-                       RDEV_PREFIX=/dev/
-                       ;;
-  *-sco3.2v5*)
-                       xenix_tapeio=yes
-                       AC_DEFINE(STATFS_SCO_OS5,1,[Define on SCO OS5. ])
-                       ;;
-  i386-pc-isc4*)
-                       xenix_tapeio=yes
-                       ;;
-  *-sni-sysv4)
-                       ;;
-  *-pc-cygwin)
-                       AC_DEFINE(IGNORE_TAR_ERRORS,1,[Define on Cygwin. ])
-                       # Cygwin needs PATH to find cygwin1.dll
-                       AC_DEFINE(NEED_PATH_ENV,1,[Define on Cygwin. ])
-                       AC_DEFINE(IGNORE_UID_CHECK,1,[Define on Cygwin. ])
-                       AC_DEFINE(IGNORE_FSTAB,1,[Define on Cygwin. ])
-                       AC_DEFINE(DONT_SUID_ROOT,1,[Define on Cygwin. ])
-                       NEED_SETUID_CLIENT=false
-                       NEED_RUNTIME_PSEUDO_RELOC=true
-                       BROKEN_IPV6=true
-                       ;;
-  *)
-                       cat <<END
-
-*****
-This machine, target type $target, is not known
-to be fully supported by this configure script.  If the
-installation of Amanda on this system succeeds or needed
-any patches, please email amanda-hackers@amanda.org with
-the patches or an indication of the sucess or failure of
-the Amanda installation on your system.
-*****
-
-END
-               ;;
-esac
-
-if test -n "$dump_returns_1"; then
-  AC_DEFINE(DUMP_RETURNS_1,1,[Define this if this system's dump exits with 1 as a success code. ])
-fi
+#
+# Configuration flags (--with-xxx and --enable-xxx)
+#
 
-if test -n "$xenix_tapeio"; then
-  AC_DEFINE(XENIX_TAPEIO,1,[Define on XENIX/ISC. ])
-fi
+AMANDA_WITH_USER
+AMANDA_WITH_GROUP
+AMANDA_WITH_DUMPERDIR
+AMANDA_WITH_CONFIGDIR
+AMANDA_WITH_INDEXDIR
+AMANDA_WITH_DBDIR
+AMANDA_WITH_LOGDIR
+AMANDA_WITH_SUFFIXES
+AMANDA_WITH_GNUTAR_LISTDIR
+AMANDA_WITH_TMPDIR
+AMANDA_WITH_FORCE_UID
+AMANDA_WITH_OWNER
+AMANDA_WITH_FQDN
+AMANDA_WITH_REUSEPORTS
+AMANDA_WITH_PORTRANGES
+AMANDA_WITH_BUFFERED_DUMP
+AMANDA_WITH_MAXTAPEBLOCKSIZE
+AMANDA_WITH_ASSERTIONS
+AMANDA_WITH_DEBUGGING
+AMANDA_WITH_DEBUG_DAYS
+AMANDA_WITH_TESTING
+AMANDA_WITH_SINGLE_USERID
+AMANDA_DISABLE_INSTALLPERMS
+
+dnl -------------------------------------------------------------------------
 
-AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS"
-AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES"
-AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS"
-AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS"
-CFLAGS="$CFLAGS $AMANDA_CFLAGS"
-CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS"
-LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS"
-LIBS="$AMANDA_LIBS $LIBS"
+#
+# Set up for Amanda components and modules
+#
+AMANDA_CHECK_COMPONENTS
+AMANDA_SETUP_AMPLOT
+AMANDA_SETUP_DOCUMENTATION
+AMANDA_SETUP_DEFAULTS
+AMANDA_SETUP_LFS
+AMANDA_SETUP_CHANGER
+AMANDA_SETUP_GETFSENT
+AMANDA_SETUP_FILE_LOCKING
+AMANDA_SETUP_SWIG
+AMANDA_CHECK_COMPRESSION
+AMANDA_CHECK_IPV6
+AMANDA_CHECK_SHMEM
+AMANDA_CHECK_READDIR
+AMANDA_CHECK_DEVICE_PREFIXES
+AMANDA_SYSHACKS
+AMANDA_EXPAND_DIRS
 
+#
+# Internationalization
+#
+AMANDA_SETUP_I18N
+dnl These lines *must* be in configure.in, and not indented
+AM_GNU_GETTEXT_VERSION([0.15])
+AM_GNU_GETTEXT([external])
 
-dnl This specifies the flag for mt that tells mt the proper tape drive
-dnl to use.
-: ${MT_FILE_FLAG="-f"}
-AC_SUBST(MT_FILE_FLAG)
-AC_DEFINE_UNQUOTED(MT_FILE_FLAG, "$MT_FILE_FLAG",[Defined to the switch to be used when invoking mt to specify the
- * tape device. ])
+#
+# Devices
+#
+AMANDA_S3_DEVICE
+AMANDA_TAPE_DEVICE
 
-AX_CREATE_STDINT_H(common-src/amanda-int.h)
+#
+# Security (authentication) mechansims
+#
+AMANDA_BSD_SECURITY
+AMANDA_BSDTCP_SECURITY
+AMANDA_BSDUDP_SECURITY
+AMANDA_RSH_SECURITY
+AMANDA_SSH_SECURITY
+AMANDA_KRB4_SECURITY
+AMANDA_KRB5_SECURITY
 
-dnl Check for programs.
-AC_PATH_PROGS(AR,ar,,$LOCSYSPATH)
+#
+# Dumpers
+#
+AMANDA_PROG_XFSDUMP_XFSRESTORE
+AMANDA_PROG_VXDUMP_VXRESTORE
+AMANDA_PROG_VDUMP_VRESTORE
+AMANDA_PROG_DUMP_RESTORE
+AMANDA_PROG_GNUTAR
+AMANDA_PROG_SAMBA_CLIENT
+AMANDA_CHECK_USE_RUNDUMP
 
+#
+# Look for other programs Amanda will use
+# 
+AMANDA_PROG_GREP
+AC_PROG_EGREP
+AMANDA_PROG_LINT
+AM_PROG_LEX
+AMANDA_PROG_AR
+AMANDA_PROG_GETTEXT
 AC_PROG_AWK
 AC_PROG_YACC
-AC_PATH_PROGS(CAT,cat,,$LOCSYSPATH)
-if test -z "$CAT"; then
-    CAT=cat
-fi
-AC_PATH_PROGS(COMPRESS,compress,,$LOCSYSPATH)
-AC_PATH_PROGS(DD,dd,,$LOCSYSPATH)
-AC_PATH_PROGS(GETCONF,getconf,,$SYSPATH)
-
-AC_ARG_WITH(gnuplot,
-AS_HELP_STRING([--with-gnuplot=PATH],
-               [use gnuplot executable at PATH in amplot]),
-    [ ac_with_gnuplot=$withval; ],
-    [ ac_with_gnuplot=maybe; ])
-
-if test "$ac_with_gnuplot" = "yes" -o "$ac_with_gnuplot" = "maybe"; then
-    AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
-else
-    if test "$ac_with_gnuplot" != "no"; then
-        if test -x "$ac_with_gnuplot"; then
-            GNUPLOT="$ac_with_gnuplot";
-        else
-            AC_MSG_WARN([Specified gnuplot of $ac_with_gnuplot isn't])
-            AC_MSG_WARN([executable, searching for an alternative.])
-           AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
-        fi
-    fi
-fi
-AC_SUBST(GNUPLOT)
-
-AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
-if test ! -z "$GNUTAR"; then
-  case "`\"$GNUTAR\" --version 2>&1`" in
-   *GNU*tar* | *Free*paxutils* )
-               AC_DEFINE_UNQUOTED(GNUTAR,"$GNUTAR",[Define to the location of Gnu tar. ])
-               ;;
-   *)
-               AC_MSG_WARN([*** $GNUTAR is not GNU tar, so it will not be used.])
-               GNUTAR=
-               ;;
-  esac
-fi
-
-AC_PATH_PROGS(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
-if test ! -z "$SAMBA_CLIENT"; then
-  case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
-  *"Unknown host"*)
-               smbversion=1
-               ;;
-  *"Connection to not.a.host.name failed"*)
-               smbversion=2
-               ;;
-  *)
-               AC_MSG_WARN([*** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used.])
-               SAMBA_CLIENT=
-               ;;
-  esac
-  if test -n "$SAMBA_CLIENT"; then
-    AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT",[Define the location of smbclient for backing up Samba PC clients. ])
-    AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion,
-      [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ])
-  fi
-fi
-
-AC_PATH_PROGS(GZIP,gzip,,$LOCSYSPATH)
-if test "$GZIP"; then
-    AC_DEFINE(HAVE_GZIP,1,[Define if Amanda is using the gzip program. ])
-    COMPRESS_PATH="$GZIP"
-    COMPRESS_SUFFIX=".gz"
-    COMPRESS_FAST_OPT="--fast"
-    COMPRESS_BEST_OPT="--best"
-    UNCOMPRESS_PATH="$GZIP"
-    UNCOMPRESS_OPT="-dc"
-else
-    if test "$COMPRESS"; then
-       COMPRESS_PATH="$COMPRESS"
-       COMPRESS_SUFFIX=".Z"
-       COMPRESS_FAST_OPT="-f"
-       COMPRESS_BEST_OPT="-f"
-       UNCOMPRESS_PATH="$COMPRESS"
-       UNCOMPRESS_OPT="-dc"
-    else
-       dnl If we have to use cat, we don't define COMPRESS_FAST_OPT,
-       dnl COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
-       dnl look for a file by the name of "".
-       AC_MSG_WARN([*** Cannot find either gzip or compress.  Using cat. ***])
-       COMPRESS_PATH="$CAT"
-       COMPRESS_SUFFIX=""
-       COMPRESS_FAST_OPT=""
-       COMPRESS_BEST_OPT=""
-       UNCOMPRESS_PATH="$CAT"
-       UNCOMPRESS_OPT=""
-    fi
-fi
-AC_DEFINE_UNQUOTED(COMPRESS_PATH,"$COMPRESS_PATH",[Define to the exact path to the gzip or the compress program. ])
-AC_DEFINE_UNQUOTED(COMPRESS_SUFFIX,"$COMPRESS_SUFFIX",[Define to the suffix for the COMPRESS_PATH compression program. ])
-AC_DEFINE_UNQUOTED(COMPRESS_FAST_OPT,"$COMPRESS_FAST_OPT",[Define as the command line option for fast compression. ])
-AC_DEFINE_UNQUOTED(COMPRESS_BEST_OPT,"$COMPRESS_BEST_OPT",[Define as the command line option for best compression. ])
-AC_DEFINE_UNQUOTED(UNCOMPRESS_PATH,"$UNCOMPRESS_PATH",[Define as the exact path to the gzip or compress command. ])
-AC_DEFINE_UNQUOTED(UNCOMPRESS_OPT,"$UNCOMPRESS_OPT",[Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. ])
-
-AC_PATH_PROGS(SORT,sort,,$LOCSYSPATH)
-if test -z "$SORT"; then
-    if $NO_SERVER_MODE; then
-       SORT="NONE"
-    else
-       AC_MSG_ERROR([Set SORT to the path of the sort program.])
-    fi
-fi
-AC_DEFINE_UNQUOTED(SORT_PATH,"$SORT",[Define to the exact path to the sort program. ])
-
-AC_PATH_PROGS(MAILER,Mail mailx mail)
-if test -z "$MAILER"; then
-    if $NO_SERVER_MODE; then
-       MAILER="NONE"
-       AC_MSG_WARN([*** WARNING: Amanda cannot send mail reports without these programs.])
-    else
-       AC_MSG_ERROR([Set MAILER to some program that accepts -s subject user < message_file.])
-    fi
-fi
-AC_DEFINE_UNQUOTED(MAILER,"$MAILER",[Define to a program that understands -s "subject" user < message_file])
-
-AC_PATH_PROGS(MT,mt,mt,$LOCSYSPATH)
-
-AC_PATH_PROGS(CHIO,chio,chio,$LOCSYSPATH)
-
-AC_PATH_PROGS(CHS,chs,chs,$LOCSYSPATH)
-
-AC_PATH_PROGS(MTX,mtx,mtx,$LOCSYSPATH)
+AC_PROG_MKDIR_P
+AMANDA_PROG_DD
+AMANDA_PROG_BASH
+AMANDA_PROG_SORT
+AMANDA_PROG_MAILER
+AMANDA_PROG_MT
+AMANDA_PROG_PRINT
+AMANDA_PROG_PCAT
+AMANDA_PROG_PERL
+AMANDA_PROG_SWIG
+
+dnl -------------------------------------------------------------------------
 
-AC_PATH_PROGS(MCUTIL,mcutil,mcutil,$LOCSYSPATH)
-
-AC_PATH_PROGS(PRINT, lpr lp)
-if test ! -z "$PRINT"; then
-    AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT",[Command for starting printing jobs. ])
-    AC_CACHE_CHECK([which flag to use to select a printer],
-       amanda_cv_printer_flag, [
-       amanda_cv_printer_flag=$PRINTER_FLAG
-       case "$PRINT" in
-       lpr|*/lpr) amanda_cv_printer_flag="-P";;
-       lp|*/lp) amanda_cv_printer_flag="-d";;
-       esac
-    ])
-    if test ! -z "$amanda_cv_printer_flag"; then
-       AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag",[LPRCMD switch for specifying a printer name. ])
-    else
-       AC_MSG_WARN([*** WARNING: amanda will always print to the default printer])
-    fi
-fi
-
-AC_PATH_PROGS(PCAT,pcat,,$LOCSYSPATH)
-AC_PATH_PROGS(PERL,perl5 perl,,$LOCSYSPATH)
-
-dnl AC_PATH_PROGS(MAKEINFO,makeinfo,,$LOCSYSPATH)
-dnl AC_PATH_PROGS(TEXI2DVI,texi2dvi,,$LOCSYSPATH)
-
-AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
-if test -n "$DUMP"; then
-  if test "`basename $DUMP`" = "backup"; then
-    backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
-    if test $? -eq 0; then
-      DUMP=
-    fi
-  fi
-fi
-AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
-if test "$DUMP" -a "$RESTORE"; then
-    AC_DEFINE_UNQUOTED(DUMP,"$DUMP",[Define the location of the ufsdump, backup, or dump program. ])
-    AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE",[Define the location of the ufsrestore or restore program. ])
-    if test -x $DUMP; then
-        AC_CACHE_CHECK(
-           [whether $DUMP supports -E or -S for estimates],
-           amanda_cv_dump_estimate,
-           [
-               case "$DUMP" in
-               *dump)
-                   AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d-E 2>&1)
-                   cat conftest.d-E >&AS_MESSAGE_LOG_FD()
-                   AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d-S 2>&1)
-                   cat conftest.d-S >&AS_MESSAGE_LOG_FD()
-                   AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
-                       | $GREP -v Dumping
-                       | $GREP -v Date
-                       | $GREP -v Label >conftest.d 2>&1)
-                   cat conftest.d >&AS_MESSAGE_LOG_FD()
-                   if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then
-                       amanda_cv_dump_estimate=E
-                   elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then
-                       amanda_cv_dump_estimate=S
-                   else
-                       amanda_cv_dump_estimate=no
-                   fi
-                   rm -f conftest.d conftest.d-E conftest.d-S
-                 ;;
-               *) amanda_cv_dump_estimate=no
-                 ;;
-               esac
-           ])
-    else
-       AC_MSG_WARN([*** $DUMP is not executable, cannot run -E/-S test])
-       amanda_cv_dump_estimate=no
-    fi
-    if test "x$amanda_cv_dump_estimate" != xno; then
-       AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate",[Define to the string that enables dump estimates. ])
-    fi
-
-    AC_ARG_WITH(dump-honor-nodump,
-    [  --with-dump-honor-nodump  if dump supports -h, use it for level0s too],
-    [ if test -x $DUMP; then
-        AC_CACHE_CHECK(
-         [whether $DUMP supports -h (honor nodump flag)],
-         amanda_cv_honor_nodump,
-         [
-           case "$DUMP" in
-           *dump)
-               AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
-                   | $GREP -v Dumping
-                   | $GREP -v Date
-                   | $GREP -v Label >conftest.d-h 2>&1)
-               cat conftest.d-h >&AS_MESSAGE_LOG_FD()
-               AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
-                   | $GREP -v Dumping
-                   | $GREP -v Date
-                   | $GREP -v Label >conftest.d 2>&1)
-               cat conftest.d >&AS_MESSAGE_LOG_FD()
-               if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then
-                   amanda_cv_honor_nodump=yes
-               else
-                   amanda_cv_honor_nodump=no
-               fi
-               rm -f conftest.d conftest.d-h
-             ;;
-           *) amanda_cv_honor_nodump=no
-             ;;
-           esac
-         ])
-      else
-       AC_MSG_WARN([*** $DUMP is not executable, cannot run -h test])
-       amanda_cv_honor_nodump=no
-      fi
-      if test "x$amanda_cv_honor_nodump" = xyes; then
-       AC_DEFINE(HAVE_HONOR_NODUMP,1,[Define this if dump accepts -h for honoring nodump. ])
-      fi
-    ])
-fi
-
-AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH)
-AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH)
-if test "$XFSDUMP" -a "$XFSRESTORE"; then
-    AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP",[Define the location of the xfsdump program on Irix hosts. ])
-    AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE",[Define the location of the xfsrestore program on Irix hosts. ])
-    AC_MSG_WARN([*** xfsdump causes the setuid-root rundump program to be enabled])
-    AC_MSG_WARN([[*** to disable it, just #undef XFSDUMP in config/config.h]])
-fi
-
-VXSYSLOCPATH="$SYSLOCPATH:/usr/lib/fs/vxfs"
-AC_PATH_PROGS(VXDUMP,vxdump,,$VXSYSLOCPATH)
-AC_PATH_PROGS(VXRESTORE,vxrestore,,$VXSYSLOCPATH)
-if test "$VXDUMP" -a "$VXRESTORE"; then
-    AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP",[Define the location of the vxdump program on HPUX and SINIX hosts or on
- * other hosts where the Veritas filesystem (vxfs) has been installed. ])
-    AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE",[Define the location of the vxrestore program on HPUX and SINIX hosts or on
- * other hosts where the Veritas filesystem (vxfs) has been installed. ])
-fi
-
-AC_PATH_PROGS(VDUMP,vdump,,$SYSLOCPATH)
-AC_PATH_PROGS(VRESTORE,vrestore,,$SYSLOCPATH)
-if test "$VDUMP" -a "$VRESTORE"; then
-    AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ])
-    AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ])
-fi
-
-dnl Handle all of the substitutions to make amplot work.
-if test "$PCAT"; then
-    AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
-else
-    AMPLOT_CAT_PACK=
-fi
-if test "$COMPRESS"; then
-    AMPLOT_COMPRESS=$COMPRESS
-    AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
-else
-    AMPLOT_CAT_COMPRESS=
-fi
-if test "$GZIP"; then
-    AMPLOT_COMPRESS=$GZIP
-    AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
-else
-    AMPLOT_CAT_GZIP=
-fi
-AC_SUBST(AMPLOT_COMPRESS)
-AC_SUBST(AMPLOT_CAT_GZIP)
-AC_SUBST(AMPLOT_CAT_COMPRESS)
-AC_SUBST(AMPLOT_CAT_PACK)
-
-AC_SOCKADDR_STORAGE
-
-# Determine the printf format characters to use when printing
-# values of type long long. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistant result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
 #
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
+# Compiler / system characteristics
 #
-AC_MSG_CHECKING(printf format modifier for 64-bit integers)
-AC_TRY_RUN([
-#include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-} 
-],
-       [AC_MSG_RESULT(ll)
-       LL_FMT="%lld"; LL_RFMT="lld"],
-       [AC_MSG_RESULT(l)
-       LL_FMT="%ld"; LL_RFMT="ld"],
-       [AC_MSG_RESULT(assuming target platform uses ll)
-       LL_FMT="%lld"; LL_RFMT="lld"])
-AC_DEFINE_UNQUOTED(LL_FMT,"$LL_FMT",
-  [Format for a long long printf. ])
-AC_DEFINE_UNQUOTED(LL_RFMT,"$LL_RFMT",
-  [Format for a long long printf. ])
-AC_SUBST(LL_FMT)
-AC_SUBST(LL_RFMT)
-
-dnl Empty GZIP so that make dist works.
-GZIP=
 
-dnl Checks for compilers, typedefs, structures, and compiler characteristics.
-dnl Check for large file compilation environment.
-need_resetofs=yes
-AC_CACHE_CHECK(
-    [for large file compilation CFLAGS],
-    amanda_cv_LFS_CFLAGS,
-    [
-       amanda_cv_LFS_CFLAGS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
-               amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
-               need_resetofs=no
-           fi
-       fi
-    ]
-)
-AC_CACHE_CHECK(
-    [for large file compilation LDFLAGS],
-    amanda_cv_LFS_LDFLAGS,
-    [
-       amanda_cv_LFS_LDFLAGS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
-               amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
-               need_resetofs=no
-           fi
-       fi
-    ]
-)
-AC_CACHE_CHECK(
-    [for large file compilation LIBS],
-    amanda_cv_LFS_LIBS,
-    [
-       amanda_cv_LFS_LIBS=
-       if test "$GETCONF"; then
-           if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
-               amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
-               need_resetofs=no
-           fi
-       fi
-    ]
-)
-if test "x$need_resetofs" = xyes; then
-    AC_DEFINE(NEED_RESETOFS,1,[Define if we have to reset tape offsets when reacing 2GB. ])
-fi
+#
+# compiler
+#
+AC_PROG_GCC_TRADITIONAL
+AC_C_CONST
+AC_C_BIGENDIAN
 
+# GCC_COMPILER is needed in the gnulib Makefile to silence errors
+AM_CONDITIONAL([GCC_COMPILER], [test "x$GCC" = "xyes"])
 
-CFLAGS="$amanda_cv_LFS_CFLAGS $CFLAGS"
-CPPFLAGS="$amanda_cv_LFS_CPPFLAGS $CPPFLAGS"
-LDFLAGS="$amanda_cv_LFS_LDFLAGS $LDFLAGS"
-LIBS="$amanda_cv_LFS_LIBS $LIBS"
+#
+# Warnings
+#
+AMANDA_ENABLE_GCC_WARNING([parentheses])
+AMANDA_ENABLE_GCC_WARNING([declaration-after-statement])
+AMANDA_ENABLE_GCC_WARNING([missing-prototypes])
+AMANDA_ENABLE_GCC_WARNING([strict-prototypes])
+AMANDA_ENABLE_GCC_WARNING([missing-declarations])
+AMANDA_ENABLE_GCC_WARNING([format])
+AMANDA_ENABLE_GCC_WARNING([sign-compare])
+AMANDA_ENABLE_GCC_WARNING([float-equal])
+AMANDA_ENABLE_GCC_WARNING([old-style-definition])
+AMANDA_DISABLE_GCC_WARNING([strict-aliasing])
+AMANDA_DISABLE_GCC_WARNING([unknown-pragmas])
 
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(intmax_t)
-AC_CHECK_SIZEOF(off_t)
-AC_CHECK_SIZEOF(size_t)
-AC_CHECK_SIZEOF(ssize_t)
-AC_CHECK_SIZEOF(time_t)
 
+#
+# Libtool
+#
 AM_PROG_LIBTOOL
 AC_SUBST(LIBTOOL_DEPS)
+AMANDA_STATIC_FLAGS
 
-AC_PROG_GCC_TRADITIONAL
-AC_C_CONST
-AMANDA_C_UNSIGNED_LONG_CONSTANTS
-AC_TYPE_OFF_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-
-AC_TYPE_UID_T
-AC_TYPE_SIGNAL
-AC_STRUCT_TM
-AM_PROG_LEX
-
-dnl From here on we need to know about STDC_HEADERS
+#
+# headers
+#
 AC_HEADER_STDC
-
-dnl AC_CHECK_TYPE does not work for socklen_t because it does not look
-dnl in <sys/socket.h>, so this is a variant that adds another header.
-AC_DEFUN([AMANDA_CHECK_TYPE],
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
-[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <$3>], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
-AC_MSG_RESULT($ac_cv_type_$1)
-if test "x$ac_cv_type_$1" = xno; then
-  AC_DEFINE($1, $2, [Define if $1 is not a standard system type])
-fi
-])
-AMANDA_CHECK_TYPE(socklen_t, int, sys/socket.h)
-AMANDA_CHECK_TYPE(sa_family_t, unsigned short, sys/socket.h)
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-CF_WAIT
-CF_WAIT_INT
 AC_HEADER_TIME
-AC_CHECK_HEADERS(\
+AC_CHECK_HEADERS(
        arpa/inet.h \
-       camlib.h \
-       cam/cam.h \
-       cam/scsi/scsi_message.h \
-       chio.h \
-       db.h \
-       dbm.h \
-       fcntl.h \
-       fnmatch.h \
-       fstab.h \
        grp.h \
-       history.h \
        libc.h \
        libgen.h \
        limits.h \
-       linux/zftape.h \
        math.h \
-       mntent.h \
-       mnttab.h \
-       ndbm.h \
        netdb.h \
-       netinet/in_systm.h \
-       readline.h \
-       readline/history.h \
-       readline/readline.h \
-       scsi/sg.h \
-       scsi/scsi_ioctl.h \
+       netinet/in.h \
        stdarg.h \
        stdlib.h \
        string.h \
        strings.h \
-       sys/chio.h \
-       sys/dsreq.h \
-       sys/fcntl.h \
        sys/file.h \
        sys/ioctl.h \
        sys/ipc.h \
-       sys/mman.h \
        sys/mntent.h \
-       sys/mtio.h \
        sys/param.h \
-       sys/scarray.h \
-       sys/gscdds.h \
-       sys/scsiio.h \
-       sys/scsi.h \
-       sys/scsi/impl/uscsi.h \
-       sys/scsi/scsi/ioctl.h \
        sys/select.h \
-       sys/shm.h \
        sys/stat.h \
-       sys/statfs.h \
-       sys/statvfs.h \
-       sys/tape.h \
+       sys/shm.h \
        sys/time.h \
        sys/types.h \
        sys/uio.h \
-       sys/vfs.h \
-       sys/vfstab.h \
        syslog.h \
        unistd.h \
-       vtblc.h \
 )
 
-AC_CHECK_HEADERS(netinet/ip.h,,,
-[[#include <sys/socket.h>
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#include <netinet/in.h>
-]])
-
-AC_CHECK_HEADERS(sys/mount.h,,,
-[[#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-]])
-
-NO_SCSI_CHANGER_MODE=true
-NO_CHIO_CHANGER_MODE=true
-
-AC_C_BIGENDIAN
-
-dnl
-dnl chio support
-dnl
-if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
-    AC_CACHE_CHECK([for HP/UX-like scsi changer support],
-       amanda_cv_hpux_scsi_chio,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/scsi.h>
-]], [[
-       static struct element_addresses changer_info;
-       int i = SIOC_ELEMENT_ADDRESSES;
-       int j = SIOC_ELEMENT_STATUS;
-       int k = SIOC_MOVE_MEDIUM;
-]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])])
-    if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
-       AC_DEFINE(HAVE_HPUX_SCSI_CHIO,1,[Define to enable HPUX chio based changer support. ])
-       NO_SCSI_CHANGER_MODE=false
-    fi
-fi
-
-dnl
-dnl Linux SCSI based on ioctl
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then 
-       AC_CACHE_CHECK([for Linux like scsi support (ioctl)],
-       amanda_cv_linux_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <scsi/scsi_ioctl.h>
-#include <sys/mtio.h>
-]], [[
-       int device;
-       char *Command;
-       ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
-]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])])
-fi
-
-dnl
-dnl Linux SCSI based on sg
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_scsi_sg_h" = x"yes"; then 
-       AC_CACHE_CHECK([for Linux like scsi support (sg)],
-       amanda_cv_linux_sg_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <scsi/sg.h>
-#include <sys/mtio.h>
-]], [[
-       int device;
-       struct sg_header *psg_header;
-       char *buffer;
-       write(device, buffer, 1);
-]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])])
-fi
-
-if test x"$amanda_cv_linux_scsi" = x"yes" ||
- test x"$amanda_cv_linux_sg_scsi" = x"yes";then
-       AC_DEFINE(HAVE_LINUX_LIKE_SCSI,1,[Define to enable Linux tape-changer support.])
-       NO_SCSI_CHANGER_MODE=false
-fi
-
-dnl
-dnl HP-UX SCSI
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsi_h" = x"yes"; then 
-       AC_CACHE_CHECK([for HP-UX like scsi support],
-       amanda_cv_hpux_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <sys/scsi.h>
-#include <sys/mtio.h>
-]], [[
-       int device;
-       char *Command;
-       ioctl(device, SIOC_IO, Command);
-]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])])
-       if test x"$amanda_cv_hpux_scsi" = x"yes";then
-               AC_DEFINE(HAVE_HPUX_LIKE_SCSI,1,[Define to enable HPUX tape-changer support. ])
-               NO_SCSI_CHANGER_MODE=false
-               NO_CHIO_CHANGER_MODE=false
-       fi
-fi
-
-dnl
-dnl IRIX SCSI
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then 
-       AC_CACHE_CHECK([for Irix like scsi support],
-       amanda_cv_irix_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/dsreq.h>
-#include <sys/mtio.h>
-]], [[
-       int device=1;
-       char Command;
-       ioctl(device, DS_ENTER, &Command);
-]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])])
-       if test x"$amanda_cv_irix_scsi" = x"yes";then
-               AC_DEFINE(HAVE_IRIX_LIKE_SCSI,1,[Define to enable IRIX tape-changer support])
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
-
-dnl
-dnl Solaris  SCSI
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then 
-       AC_CACHE_CHECK([for Solaris-like scsi support],
-       amanda_cv_solaris_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scsi/impl/uscsi.h>
-#include <sys/mtio.h>
-]], [[
-       int device;
-       char *Command;
-       ioctl(device, USCSICMD, Command);
-]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])])
-       if test x"$amanda_cv_solaris_scsi" = x"yes";then
-               AC_DEFINE(HAVE_SOLARIS_LIKE_SCSI,1,[Define to enable Solaris tape-changer support])
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
-
-dnl
-dnl AIX SCSI
-dnl
-if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
-   test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then 
-       AC_CACHE_CHECK([for AIX like scsi support],
-       amanda_cv_aix_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scarray.h>
-#include <sys/tape.h>
-]], [[
-       int device;
-       char *Command;
-       ioctl(device, STIOCMD, Command);
-]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])])
-       if test x"$amanda_cv_aix_scsi" = x"yes";then
-               AC_DEFINE(HAVE_AIX_LIKE_SCSI,1,[Define to enable AIX tape-changer support])
-               NO_SCSI_CHANGER_MODE=false
-       fi
-fi
-dnl
-dnl BSD CAM SCSI
-dnl
-if test x"$ac_cv_header_cam_cam_h" = x"yes";then
-       AC_CACHE_CHECK([for CAM like scsi support],
-       amanda_cv_cam_scsi,
-       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-# include <fcntl.h>
-# include <cam/cam.h>
-# include <cam/cam_ccb.h>
-# include <cam/scsi/scsi_message.h>
-# include <cam/scsi/scsi_pass.h>
-# include <camlib.h>
-]], [[
-       struct cam_device *curdev;
-
-       curdev = cam_open_pass("", O_RDWR, NULL);
-]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])])
-       if test x"$amanda_cv_cam_scsi" = x"yes";then
-               AC_DEFINE(HAVE_CAM_LIKE_SCSI,1,[Define to enable CAM tape-changer support])
-               NO_SCSI_CHANGER_MODE=false
-               AC_CHECK_LIB(cam,main)
-       fi
-fi
-
-
-dnl
-dnl BSD SCSI
-dnl
-if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
-   test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
-    AC_CACHE_CHECK([for BSD like scsi support],
-    amanda_cv_bsd_scsi,
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/scsiio.h>
-#include <sys/mtio.h>
-]], [[
-    int device=1;
-    char Command;
-    ioctl(device, SCIOCCOMMAND, &Command);
-]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])])
-    if test x"$amanda_cv_bsd_scsi" = x"yes";then
-       AC_DEFINE(HAVE_BSD_LIKE_SCSI,1,[Define to enable BSD tape-changer support])
-       NO_SCSI_CHANGER_MODE=false
-    fi
-fi
-
-dnl Do not build chg-scsi-chio if we cannot find the needed support
-dnl include files for the SCSI interfaces
-dnl chio.h and sys/chio.h are chio based systems
-if test x"$ac_cv_header_chio_h" = x"yes" ||
-   test x"$ac_cv_header_sys_chio_h" = x"yes"; then
-   dnl chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
-   dnl incompatible with the introduction of camlib.h
-   if test x"$ac_cv_header_camlib_h" != x"yes"; then
-     if $NO_SCSI_CHANGER_MODE; then
-       NO_SCSI_CHANGER_MODE=false
-     else
-       NO_CHIO_CHANGER_MODE=false
-     fi
-   fi
-fi
+#
+# Types
+#
+AC_SOCKADDR_STORAGE
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(intmax_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ssize_t)
+AC_CHECK_SIZEOF(time_t)
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+AC_TYPE_SIGNAL
+AC_STRUCT_TM
+AMANDA_CHECK_TYPE(socklen_t, int, sys/socket.h)
+AMANDA_CHECK_TYPE(sa_family_t, unsigned short, sys/socket.h)
+AMANDA_CHECK_TYPE(in_port_t, unsigned short, netinet/in.h)
+CF_WAIT
+CF_WAIT_INT
 
-dnl cur_colr is on some HP's
+#
+# Libraries
+#
+# cur_colr is on some HP's
 AC_CHECK_LIB(cur_colr,main)
-
 AC_CHECK_LIB(intl,main)
-
-dnl Make sure we don't use -lnsl and -lsun on Irix systems.
-case "$target" in
-    *sgi-irix*)
-                       AC_CHECK_LIB(socket,main)
-                       ;;
-    *)
-                       AC_CHECK_LIB(resolv,main)
-                       AC_CHECK_LIB(nsl,main)
-                       AC_CHECK_LIB(socket,main)
-                       AC_CHECK_LIB(sun,main)
-                       ;;
-esac
-
-AC_CHECK_LIB(termcap,tgetent)
-if test "x$ac_cv_lib_termcap_tgetent" != xyes; then
-    AC_CHECK_LIB(curses,tgetent)
-    if test "x$ac_cv_lib_curses_tgetent" != xyes; then
-       AC_CHECK_LIB(ncurses,tgetent)
-    fi
-fi
-if test "x$ac_cv_lib_termcap_tgetent" = xyes ||
-   test "x$ac_cv_lib_curses_tgetent" = xyes ||
-   test "x$ac_cv_lib_ncurses_tgetent" = xyes; then
-    AC_CHECK_LIB(readline,readline)
-    if test "x$ac_cv_lib_readline_readline" = xyes; then
-       READLINE_LIBS="-lreadline"
-       AC_SUBST(READLINE_LIBS)
-    else
-       AC_MSG_WARN([*** No readline library, no history and command line editing in amrecover!])
-    fi
-else
-    AC_MSG_WARN([*** No terminal library, no history and command line editing in amrecover!])
-fi
-
-if test "x$ac_cv_header_linux_zftape_h" = xyes; then
-    if test "x$ac_cv_header_vtblc_h" = xyes; then
-        AC_CHECK_LIB(vtblc,main)
-        if test "x$ac_cv_lib_vtblc_main" != xyes; then
-            AC_MSG_WARN([*** vtblc library not found - no QIC volume table support!])
-        fi
-    else
-        AC_MSG_WARN([*** vtblc headers not found - no QIC volume table support!])
-    fi
-fi
-
+AMANDA_CHECK_NET_LIBS
+AMANDA_CHECK_GLIB
+AMANDA_CHECK_READLINE
 AC_CHECK_LIB(m,modf)
 
-dnl Check for various "mt status" related structure elements.
-
-AC_MSG_CHECKING(for mt_flags mtget structure element)
-mt_flags_result="found"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-]], [[
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_flags;
-]])],[AC_DEFINE(HAVE_MT_FLAGS,1,Define if the mtget structure has an mt_flags field)],[mt_flags_result="not found"])
-AC_MSG_RESULT($mt_flags_result)
-
-AC_MSG_CHECKING(for mt_fileno mtget structure element)
-mt_fileno_result="found"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-]], [[
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_fileno;
-]])],[AC_DEFINE(HAVE_MT_FILENO,1,Define if the mtget structure has an mt_fileno field)],[mt_fileno_result="not found"])
-AC_MSG_RESULT($mt_fileno_result)
-
-AC_MSG_CHECKING(for mt_blkno mtget structure element)
-mt_blkno_result="found"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-]], [[
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_blkno;
-]])],[AC_DEFINE(HAVE_MT_BLKNO,1,Define if the mtget structure has an mt_blkno field)],[mt_blkno_result="not found"])
-AC_MSG_RESULT($mt_blkno_result)
-
-AC_MSG_CHECKING(for mt_dsreg mtget structure element)
-mt_dsreg_result="found"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-]], [[
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_dsreg;
-]])],[AC_DEFINE(HAVE_MT_DSREG,1,Define if the mtget structure has an mt_dsreg field)],[mt_dsreg_result="not found"])
-AC_MSG_RESULT($mt_dsreg_result)
-
-AC_MSG_CHECKING(for mt_erreg mtget structure element)
-mt_erreg_result="found"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mtio.h>
-]], [[
-    struct mtget buf;
-    long ds;
-
-    ds = buf.mt_erreg;
-]])],[AC_DEFINE(HAVE_MT_ERREG,1,Define if the mtget structure has an mt_erreg field)],[mt_erreg_result="not found"])
-AC_MSG_RESULT($mt_erreg_result)
-
-dnl
-
-dnl Check if the system does support the user requested database library.
-dnl Begin by checking for the header file.  If it is not there, then do
-dnl not use the library.  If the header file is there, then try to link
-dnl against the library.   If it's not there, then try to link using
-dnl just the -lc library.  If the link against -lc fails, then do not
-dnl use this library.
-DB_HEADER=
-DB_LIB=
-
-dnl Testing if libc contains the dbm_open routine is tested for a
-dnl lot of times below.  We do it once here now.
-save_LIBS="$LIBS"
-AC_CHECK_LIB(c,dbm_open)
-LIBS="$save_LIBS"
-
-case "$DB_STYLE" in
-    db)
-       if test "x$ac_cv_header_db_h" = xyes; then
-           AC_CHECK_LIB(db,main)
-           if test "x$ac_cv_lib_db_main" = xyes; then
-               AC_CHECK_LIB(db,dbm_open)
-               if test "x$ac_cv_lib_db_dbm_open" = xyes; then
-                   DB_HEADER=db.h
-                   DB_LIB=db
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** db database library requested but dbm_open not found in -ldb.])
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=db.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** db library requested but -ldb doesn't exist and dbm_open cannot be found.])
-               fi
-           fi
-       else
-           DB_STYLE=
-           AC_MSG_WARN([*** db database library requested but db.h not found.])
-       fi
-       ;;
-
-    dbm)
-       if test "x$ac_cv_header_dbm_h" = xyes; then
-           AC_CHECK_LIB(dbm,main)
-           if test "x$ac_cv_lib_dbm_main" = xyes; then
-               AC_CHECK_LIB(dbm,dbm_open)
-               if test "x$ac_cv_lib_dbm_dbm_open" = xyes; then
-                   DB_HEADER=dbm.h
-                   DB_LIB=dbm
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** dbm database library requested but dbm_open not found in -ldbm.])
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=dbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found.])
-               fi
-           fi
-       else
-           DB_STYLE=
-           AC_MSG_WARN([*** dbm database library requested but dbm.h not found.])
-       fi
-       ;;
-
-    gdbm)
-       if test "x$ac_cv_header_ndbm_h" = xyes; then
-           AC_CHECK_LIB(gdbm,main)
-           if test "x$ac_cv_lib_gdbm_main" = xyes; then
-               AC_CHECK_LIB(gdbm,dbm_open)
-               if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=gdbm
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** gdbm database library requested but -lgdbm not found.])
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found.])
-               fi
-           fi
-       else
-           DB_STYLE=
-           AC_MSG_WARN([*** gdbm database library requested but ndbm.h not found.])
-       fi
-       ;;
-
-    ndbm)
-       if test "x$ac_cv_header_ndbm_h" = xyes; then
-           AC_CHECK_LIB(ndbm,main)
-           if test "x$ac_cv_lib_ndbm_main" = xyes; then
-               AC_CHECK_LIB(ndbm,dbm_open)
-               if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=ndbm
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** ndbm database library requested but -lndbm not found.])
-               fi
-           else
-               if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-                   DB_HEADER=ndbm.h
-                   DB_LIB=c
-               else
-                   DB_STYLE=
-                   AC_MSG_WARN([*** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found.])
-               fi
-           fi
-       else
-           DB_STYLE=
-           AC_MSG_WARN([*** ndbm database library requested but ndbm.h not found.])
-       fi
-       ;;
-    text)
-       DB_HEADER=
-       DB_LIB=
-       ;;
-esac
-
-dnl If a database style was not specified select an appropriate one
-dnl automatically.
-dnl Nowadays we default to our own internal text database, but I have left
-dnl the code that does the testing here just in case it is needed one day.
-
-if test -z "$DB_STYLE"; then
-    DB_STYLE=text
-    DB_HEADER=
-    DB_LIB=
-fi
-
-dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then
-dnl     AC_CHECK_LIB(ndbm,dbm_open)
-dnl     if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then
-dnl    DB_STYLE=ndbm
-dnl    DB_HEADER=ndbm.h
-dnl    DB_LIB=ndbm
-dnl     elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
-dnl    DB_STYLE=ndbm
-dnl    DB_HEADER=ndbm.h
-dnl    DB_LIB=c
-dnl    fi
-dnl fi
-dnl
-dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_db_h" = xyes; then
-dnl    AC_CHECK_LIB(db,dbm_open)
-dnl    if test "x$ac_cv_lib_db_dbm_open" = xyes; then
-dnl    DB_STYLE=db
-dnl    DB_HEADER=db.h
-dnl    DB_LIB=db
-dnl    elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
-dnl    DB_STYLE=db
-dnl    DB_HEADER=db.h
-dnl    DB_LIB=c
-dnl    fi
-dnl fi
-dnl
-dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_dbm_h" = xyes; then
-dnl    AC_CHECK_LIB(dbm,dbm_open)
-dnl    if test "x$ac_cv_lib_db_dbm_open" = xyes; then
-dnl    DB_STYLE=dbm
-dnl    DB_HEADER=dbm.h
-dnl    DB_LIB=dbm
-dnl    elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
-dnl    DB_STYLE=dbm
-dnl    DB_HEADER=dbm.h
-dnl    DB_LIB=c
-dnl    fi
-dnl fi
-dnl
-dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then
-dnl    AC_CHECK_LIB(gdbm,dbm_open)
-dnl    if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then
-dnl    DB_STYLE=gdbm
-dnl    DB_HEADER=ndbm.h
-dnl    DB_LIB=gdbm
-dnl    elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
-dnl    DB_STYLE=gdbm
-dnl    DB_HEADER=ndbm.h
-dnl    DB_LIB=c
-dnl    fi
-dnl fi
-dnl
-dnl if test -z "$DB_STYLE"; then
-dnl    if test "x$ac_cv_lib_c_dbm_open" = xyes; then
-dnl    AC_MSG_WARN([*** A dbm_open() routine was found in -lc, but no header])
-dnl    AC_MSG_WARN([*** files exist.  Please remedy the situation.])
-dnl    else
-dnl    AC_MSG_WARN([*** No dbm_open() routine found!])
-dnl    fi
-dnl    AC_MSG_WARN([*** You may want to install the gdbm library from])
-dnl    AC_MSG_WARN([*** ftp://prep.ai.mit.edu/pub/gnu/gdbm-1.7.3.tar.gz.])
-dnl
-dnl    AC_MSG_WARN([*** Using the built-in text database.])
-dnl    DB_STYLE=text
-dnl    DB_HEADER=
-dnl    DB_LIB=
-dnl fi
-
-if test "x$DB_STYLE" = xtext; then
-    AC_DEFINE(TEXTDB,1,[Define to enable the text-based database format. ])
-else
-    AC_MSG_CHECKING([for database])
-    AC_MSG_RESULT([header is $DB_HEADER, linking against -l$DB_LIB])
-    case "$DB_STYLE" in
-       db)     AC_DEFINE(USE_DB_H,1,[Define to enable db databases. ])   ;;
-       dbm)    AC_DEFINE(USE_DBM_H,1,[Define to enable dbm databases. ])  ;;
-       gdbm)   AC_DEFINE(USE_GDBM_H,1,[Define to enable gdbm databases. ]) ;;
-       ndbm)   AC_DEFINE(USE_NDBM_H,1,[Define to enable ndbm databases. ]) ;;
-    esac
-
-    AC_CACHE_CHECK(
-       [for struct datum declared in header files],
-       amanda_cv_struct_datum,
-       [
-           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#if defined(USE_DB_H)
-#  include <db.h>
-#else
-#  if defined(USE_DBM_H)
-#    include <dbm.h>
-#  else
-#    if defined(USE_NDBM_H)
-#      include <ndbm.h>
-#    endif
-#  endif
-#endif
-               ]], [[
-                   datum a;
-               ]])],[amanda_cv_struct_datum=yes],[amanda_cv_struct_datum=no
-           ])
-       ])
-    if test "x$amanda_cv_struct_datum" = xyes; then
-       AC_DEFINE(HAVE_STRUCT_DATUM,1,[Define if the database header declares struct datum. ])
-    fi
-fi
-
-case "$DB_STYLE" in
-    db) DB_EXT=.db;;
-    gdbm) DB_EXT='""';;
-    dbm | ndbm) DB_EXT=".dir .pag";;
-    text) DB_EXT='""';;
-    *) DB_EXT=;;
-esac
-AC_SUBST(DB_EXT)
-
-AC_CACHE_CHECK(whether _POSIX2_RE_DUP_MAX is defined,
-    amanda_cv_have__posix2_re_dup_max,
-    AC_EGREP_CPP(yes, [
-#include <limits.h>
-#ifdef _POSIX2_RE_DUP_MAX
-  yes
-#endif
-], amanda_cv_have__posix2_re_dup_max=yes, amanda_cv_have__posix2_re_dup_max=no))
-if test "x$amanda_cv_have__posix2_re_dup_max" = xyes; then
-    AC_DEFINE(HAVE__POSIX2_RE_DUP_MAX,1,[Define if limits.h defines _POSIX2_RE_DUP_MAX. ])
-fi
-
-AC_CACHE_CHECK(whether CHAR_MIN is defined,
-    amanda_cv_have_char_min,
-    AC_EGREP_CPP(yes, [
-#include <limits.h>
-#ifdef CHAR_MIN
-  yes
-#endif
-], amanda_cv_have_char_min=yes, amanda_cv_have_char_min=no))
-if test "x$amanda_cv_have_char_min" = xyes; then
-    AC_DEFINE(HAVE_CHAR_MIN,1,[Define if limits.h defines CHAR_MIN. ])
-fi
-
-AC_CACHE_CHECK(whether CHAR_MAX is defined,
-    amanda_cv_have_char_max,
-    AC_EGREP_CPP(yes, [
-#include <limits.h>
-#ifdef CHAR_MAX
-  yes
-#endif
-], amanda_cv_have_char_max=yes, amanda_cv_have_char_max=no))
-if test "x$amanda_cv_have_char_max" = xyes; then
-    AC_DEFINE(HAVE_CHAR_MAX,1,[Define if limits.h defines CHAR_MAX. ])
-fi
-
-AC_CACHE_CHECK(whether CHAR_BIT is defined,
-    amanda_cv_have_char_bit,
-    AC_EGREP_CPP(yes, [
-#include <limits.h>
-#ifdef CHAR_BIT
-  yes
-#endif
-], amanda_cv_have_char_bit=yes, amanda_cv_have_char_bit=no))
-if test "x$amanda_cv_have_char_bit" = xyes; then
-    AC_DEFINE(HAVE_CHAR_BIT,1,[Define if limits.h defines CHAR_BIT. ])
-fi
-
-dnl Checks for library functions and if the function is declared in
-dnl an appropriate header file.  Add some of the missing functions
-dnl to LIBOBJS.
+#
+# Declarations
+#
+# Checks for library functions and if the function is declared in
+# an appropriate header file.  Functions which exist, but for which
+# no declaration is available, are declared in common-src/amanda.h.
+# It's not clear that any existing system implements but does not
+# declare common functions such as these.
+#
 ICE_CHECK_DECL(accept,sys/types.h sys/socket.h)
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(atexit)
 ICE_CHECK_DECL(atof,stdlib.h)
-ICE_CHECK_DECL(atoi,stdlib.h)
 ICE_CHECK_DECL(atol,stdlib.h)
 ICE_CHECK_DECL(atoll,stdlib.h)
 ICE_CHECK_DECL(strtol,stdlib.h)
@@ -2787,29 +274,21 @@ ICE_CHECK_DECL(bzero,string.h strings.h stdlib.h)
 AC_FUNC_CLOSEDIR_VOID
 ICE_CHECK_DECL(closelog,syslog.h)
 ICE_CHECK_DECL(connect,sys/types.h sys/socket.h)
-ICE_CHECK_DECL(dbm_open,${DB_HEADER-no/db/header/file})
-AC_CHECK_FUNCS(endmntent)
 ICE_CHECK_DECL(fclose,stdio.h)
 ICE_CHECK_DECL(fflush,stdio.h)
-ICE_CHECK_DECL(flock,sys/file.h)
 ICE_CHECK_DECL(fprintf,stdio.h)
 ICE_CHECK_DECL(fputc,stdio.h)
 ICE_CHECK_DECL(fputs,stdio.h)
 ICE_CHECK_DECL(fread,stdio.h stdlib.h)
 ICE_CHECK_DECL(fseek,stdio.h)
 ICE_CHECK_DECL(fwrite,stdio.h stdlib.h)
-AC_CHECK_FUNCS(getfsent)
 ICE_CHECK_DECL(gethostname,unistd.h)
-AC_FUNC_GETMNTENT
 ICE_CHECK_DECL(getopt,stdlib.h unistd.h libc.h)
 ICE_CHECK_DECL(getpeername,sys/types.h sys/socket.h)
-AC_CHECK_FUNCS(getpgrp)
+AC_CHECK_FUNC(getpgrp)
 AC_FUNC_GETPGRP
 ICE_CHECK_DECL(getsockname,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(getsockopt,sys/types.h sys/socket.h)
-ICE_CHECK_DECL(gettimeofday,time.h sys/time.h)
-AMANDA_FUNC_GETTIMEOFDAY_ARGS
-AC_CHECK_FUNCS(getvfsent initgroups isascii)
 ICE_CHECK_DECL(initgroups,grp.h sys/types.h unistd.h libc.h)
 ICE_CHECK_DECL(ioctl,sys/ioctl.h unistd.h libc.h)
 ICE_CHECK_DECL(isnormal,math.h)
@@ -2818,12 +297,9 @@ ICE_CHECK_DECL(lstat,sys/types.h sys/stat.h)
 ICE_CHECK_DECL(malloc,stdlib.h)
 ICE_CHECK_DECL(memmove,string.h strings.h)
 ICE_CHECK_DECL(memset,string.h strings.h)
-AC_CHECK_FUNCS(mkdir)
 ICE_CHECK_DECL(mkstemp,stdlib.h)
 ICE_CHECK_DECL(mktemp,stdlib.h)
 ICE_CHECK_DECL(mktime,time.h sys/time.h)
-AC_FUNC_MMAP
-dnl atexit() is prefered, sunos (maybe others?) define on_exit
 AC_CHECK_FUNCS(on_exit)
 ICE_CHECK_DECL(openlog,syslog.h)
 ICE_CHECK_DECL(pclose,stdio.h)
@@ -2836,68 +312,25 @@ ICE_CHECK_DECL(recvfrom,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(remove,stdio.h)
 ICE_CHECK_DECL(rename,stdio.h)
 ICE_CHECK_DECL(rewind,stdio.h)
-AC_CHECK_FUNCS(rmdir)
 ICE_CHECK_DECL(ruserok,netdb.h sys/socket.h libc.h unistd.h)
 ICE_CHECK_DECL(select,sys/types.h sys/socket.h sys/select.h time.h sys/time.h)
 AMANDA_FUNC_SELECT_ARG_TYPE
 ICE_CHECK_DECL(sendto,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(setegid,unistd.h)
 ICE_CHECK_DECL(seteuid,unistd.h)
-AC_CHECK_FUNCS(setmntent)
-AC_CHECK_FUNCS(shquote)
-
 ICE_CHECK_DECL(setresgid,unistd.h)
 ICE_CHECK_DECL(setresuid,unistd.h)
+AC_CHECK_FUNCS(shquote)
 ICE_CHECK_DECL(snprintf,stdio.h)
 ICE_CHECK_DECL(vsnprintf,stdio.h)
-
-dnl arguments for setpgrp or not
-AC_CHECK_FUNC(setpgid, [
-       AC_DEFINE(HAVE_SETPGID,1,[Define if setpgid() is available. ])
-       ICE_CHECK_DECL(setpgid,sys/types.h unistd.h)
-])
+AMANDA_FUNC_SETPGID
 AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP])
 ICE_CHECK_DECL(setpgrp,sys/types.h unistd.h libc.h)
-
 ICE_CHECK_DECL(setsockopt,sys/types.h sys/socket.h)
-
-AC_CHECK_FUNCS(shmget,
-    [
-       AMANDA_FUNC_SHM_ARG_TYPE
-       case "$FORCE_MMAP" in
-       n | no)
-           AC_DEFINE(HAVE_SYSVSHM,1,[Define if SysV shared-memory functions are available. ])
-         ;;
-       esac
-    ]
-)
-ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h)
-ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h)
-ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h)
-ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h)
-
-if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
-    case "$FORCE_MMAP" in
-    n | no)
-       if test "x$ac_cv_func_shmget" != xyes; then
-           AC_MSG_WARN([*** Neither shmget() nor mmap() found!])
-           AC_MSG_WARN([*** This system will not support the Amanda server.])
-           NO_SERVER_MODE=true
-       fi
-      ;;
-    y | ye | yes)
-       AC_MSG_WARN([*** --with-mmap used on a system with no mmap() support!])
-       AC_MSG_WARN([*** This system will not support the Amanda server.])
-       NO_SERVER_MODE=true
-      ;;
-    esac
-fi
-
 AC_CHECK_FUNCS(sigaction sigemptyset sigvec)
 ICE_CHECK_DECL(socket,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(socketpair,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(sscanf,stdio.h)
-AC_CHECK_FUNCS(statfs statvfs)
 ICE_CHECK_DECL(strerror,string.h strings.h)
 AC_FUNC_STRFTIME
 ICE_CHECK_DECL(strftime,time.h sys/time.h)
@@ -2908,431 +341,52 @@ ICE_CHECK_DECL(time,time.h sys/time.h)
 ICE_CHECK_DECL(tolower,ctype.h)
 ICE_CHECK_DECL(toupper,ctype.h)
 ICE_CHECK_DECL(ungetc,stdio.h)
-AC_FUNC_VPRINTF
 ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h)
 ICE_CHECK_DECL(vprintf,stdio.h stdlib.h)
-ICE_CHECK_DECL(vsprintf,stdio.h stdlib.h)
 AC_CHECK_FUNC(wait4)
-#AC_REPLACE_FUNCS(writev)
 ICE_CHECK_DECL(writev, unistd.h sys/uio.h)
 ICE_CHECK_DECL(strcasecmp,string.h strings.h)
 
-AC_CHECK_FUNCS(fnmatch)
-
-
-dnl disk device prefixes
-AC_MSG_CHECKING(disk device prefixes)
-dnl Use df to find the mount point for the root filesystem.  Use
-dnl the positional parameters to find the particular line from df
-dnl that contains the root paritition.  We put it in a subshell so
-dnl that the original positional parameters are not messed with.
-dfline=`(
-    df / | while read line; do
-       set -- $line
-       while test $# -gt 0; do
-           if test "x$1" = "x/"; then
-               echo $line
-               break 2
-           fi
-           shift
-       done
-    done
-) | sed 's/(//' | sed 's/)//' `
-
-dnl Search for the mount point by using expr to find the parameter
-dnl with dev in it.
-mount=`(
-    set -- $dfline
-    while test $# -gt 0; do
-       if expr "$1" : '.*dev' >/dev/null 2>&1; then
-           echo $1
-           break
-       fi
-       shift
-    done
-)`
-
-if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
-    AC_MSG_RESULT((predefined) $DEV_PREFIX - $RDEV_PREFIX)
-else
-    if test -d /dev/dsk; then
-       DEV_PREFIX=/dev/dsk/
-       if test -d /dev/rdsk; then
-           RDEV_PREFIX=/dev/rdsk/
-       else
-           RDEV_PREFIX=/dev/dsk/
-       fi
-    elif test -d /dev; then
-       case "$target" in
-           *-sni-sysv4)
-               dev_prefix=/dev/dsk/
-               rdev_prefix=/dev/rdsk/
-               AC_MSG_WARN("*** Run amsinixfixdevs on Sinix systems using VxFS.")
-               ;;
-
-            *)
-               DEV_PREFIX=/dev/
-               # Some systems, notably Linux, do not have raw disk devices
-               # names.  Check this by trying to see if a raw disk device name
-               # exists using the normal raw device path prepended to the
-               # mount point of the root filesystem.
-               if test "$mount"; then
-                   dev_name="/dev/r`basename $mount`"
-                   if test -b $dev_name -o -c $dev_name; then
-                       RDEV_PREFIX=/dev/r
-                   else
-                       RDEV_PREFIX=/dev/
-                   fi
-               else
-                   RDEV_PREFIX=/dev/r
-               fi
-               ;;
-       esac
-    else
-       DEV_PREFIX=/
-       RDEV_PREFIX=/
-    fi
-    AC_MSG_RESULT($DEV_PREFIX - $RDEV_PREFIX)
-fi
-
-AC_DEFINE_UNQUOTED(DEV_PREFIX,"${DEV_PREFIX}",[Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ ])
-AC_DEFINE_UNQUOTED(RDEV_PREFIX,"${RDEV_PREFIX}",[Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ ])
-
-case $mount in
-    /dev/vg*)
-       AC_MSG_WARN("*** Run amhpfixdevs on HP-UX systems using /dev/vg??.")
-       ;;
-esac
-
-dnl lock/flock/fcntl
-AC_CACHE_CHECK(
-   [whether posix fcntl locking works],
-   amanda_cv_posix_filelocking,
-   [
-       AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_POSIX_FCNTL
-#include "${srcdir-.}/common-src/amflock.c"
-]])],[
-       amanda_cv_posix_filelocking=yes
-],[
-       amanda_cv_posix_filelocking="no"
-],[
-       amanda_cv_posix_filelocking="no (cannot run test)"
-])
-    rm -f /tmp/conftest.lock
+dnl -------------------------------------------------------------------------
+
+dnl
+dnl Set up files for autoconf substitution.  All files are listed here, in
+dnl order by subdirectory, as a central location for this list.  
+dnl
+AC_CONFIG_FILES([
+    Makefile
+    amandad-src/Makefile
+    amplot/Makefile
+    changer-src/Makefile
+    client-src/Makefile
+    common-src/Makefile
+    common-src/versuff.c
+    config/Makefile
+    device-src/Makefile
+    device-src/tests/Makefile
+    dumper-src/Makefile
+    example/Makefile
+    example/amanda-client.conf
+    example/amanda.conf
+    example/chg-mcutil.conf
+    example/template.d/amanda-S3.conf
+    example/template.d/advanced.conf
+    example/template.d/amanda-harddisk.conf
+    example/template.d/amanda-single-tape.conf
+    example/template.d/amanda-tape-changer.conf
+    gnulib/Makefile
+    installcheck/Makefile
+    man/Makefile
+    oldrecover-src/Makefile
+    packaging/Makefile
+    perl/Makefile
+    po/Makefile
+    recover-src/Makefile
+    restore-src/Makefile
+    server-src/Makefile
+    tape-src/Makefile
 ])
-if test "x$amanda_cv_posix_filelocking" = xyes; then
-    AC_DEFINE(USE_POSIX_FCNTL,1,[Define to use Posix fcntl for file locking.])
-    HAS_WORKING_FILE_LOCK=1
-fi
-
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    AC_CACHE_CHECK(
-       [whether flock locking works],
-       amanda_cv_flock_filelocking,
-       [
-           AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_FLOCK
-#include "${srcdir-.}/common-src/amflock.c"
-]])],[
-                   amanda_cv_flock_filelocking="yes"
-],[
-                   amanda_cv_flock_filelocking="no"
-],[
-                   amanda_cv_flock_filelocking="no (cannot run test)"
-])
-       rm -f /tmp/conftest.lock
-])
-    if test "x$amanda_cv_flock_filelocking" = xyes; then
-       AC_DEFINE(USE_FLOCK,1,[Define to use flock for file locking.])
-       HAS_WORKING_FILE_LOCK=1
-    fi
-fi
-
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    AC_CACHE_CHECK(
-       [whether lockf locking works],
-       amanda_cv_lockf_filelocking,
-       [
-           AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_LOCKF
-#include "${srcdir-.}/common-src/amflock.c"
-]])],[
-                   amanda_cv_lockf_filelocking="yes"
-],[
-                   amanda_cv_lockf_filelocking="no"
-],[
-                   amanda_cv_lockf_filelocking="no (cannot run test)"
-])
-       rm -f /tmp/conftest.lock
-])
-    if test "x$amanda_cv_lockf_filelocking" = xyes; then
-       AC_DEFINE(USE_LOCKF,1,[Define to use lockf for file locking.])
-       HAS_WORKING_FILE_LOCK=1
-    fi
-fi
-
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    AC_CACHE_CHECK(
-       [whether lnlock locking works],
-       amanda_cv_lnlock_filelocking,
-       [
-           AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#undef  ASSERTIONS
-#define CONFIGURE_TEST
-#define USE_LNLOCK
-#include "${srcdir-.}/common-src/amflock.c"
-#include "${srcdir-.}/common-src/alloc.c"
-#include "${srcdir-.}/common-src/error.c"
-#include "${srcdir-.}/common-src/snprintf.c"
-]])],[
-                   amanda_cv_lnlock_filelocking="yes"
-],[
-                   amanda_cv_lnlock_filelocking="no"
-],[
-                   amanda_cv_lnlock_filelocking="no (cannot run test)"
-])
-       rm -f /tmp/conftest.lock
-])
-    if test "x$amanda_cv_lnlock_filelocking" = xyes; then
-       AC_DEFINE(USE_LNLOCK,1,[Define to use a hard-link based approach for file locking.])
-       HAS_WORKING_FILE_LOCK=1
-    fi
-fi
-
-if test -z "$HAS_WORKING_FILE_LOCK"; then
-    AC_MSG_WARN([*** No working file locking capability found!])
-    AC_MSG_WARN([*** Be VERY VERY careful.])
-fi
-
-dnl extra substitution parameters
-AC_SUBST(CHS)
-AC_SUBST(MTX)
-AC_SUBST(MCUTIL)
-AC_SUBST(ac_n)
-AC_SUBST(ac_c)
-
-AM_CONDITIONAL(WANT_CLIENT, test x"$NO_CLIENT_MODE" != x"true")
-AM_CONDITIONAL(WANT_SAMBA, test ! -z "$SAMBA_CLIENT")
-AM_CONDITIONAL(WANT_RESTORE, test x"$NO_RESTORE_MODE" != x"true")
-AM_CONDITIONAL(WANT_SERVER, test x"$NO_SERVER_MODE" != x"true")
-AM_CONDITIONAL(WANT_RECOVER, test x"$NO_RECOVER_MODE" != x"true" && test x"$NO_CLIENT_MODE" != x"true")
-AM_CONDITIONAL(WANT_TAPE, test x"$NO_SERVER_MODE" != x"true" || test x"$NO_RESTORE_MODE" != x"true")
-AM_CONDITIONAL(WANT_AMPLOT, test x"$NO_AMPLOT_MODE" != x"true")
-AM_CONDITIONAL(WANT_CHG_SCSI, test x"$NO_SCSI_CHANGER_MODE" != x"true")
-AM_CONDITIONAL(WANT_CHIO_SCSI, test x"$NO_CHIO_CHANGER_MODE" != x"true")
-AM_CONDITIONAL(WANT_RUNTIME_PSEUDO_RELOC, test x"$NEED_RUNTIME_PSEUDO_RELOC" = x"true")
-AM_CONDITIONAL(WANT_SETUID_CLIENT, test x"$NEED_SETUID_CLIENT" != x"false")
-AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY_SET" = x"true")
-
-case "${FORCE_USE_RUNDUMP-${USE_RUNDUMP}}" in
-y |  ye | yes) AC_DEFINE(USE_RUNDUMP,1,[Define to invoke rundump (setuid-root) instead of DUMP program directly. ]);;
-esac
-
-# This is necessary so that .o files in LIBOBJS are also built via
-# the ANSI2KNR-filtering rules.
-LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
-             sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
-LTLIBOBJS=`echo "$LIB@&t@OBJS" |
-           sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
-AC_SUBST(LTLIBOBJS)
-
-LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'`
-AC_SUBST(LTALLOCA)
-
-## This stuff is needed for the documentation.
-DOC_BUILD_DATE=`date '+%d-%m-%Y'`
-AC_SUBST(DOC_BUILD_DATE)
-
-AC_ARG_ENABLE(manpage-build,
-AS_HELP_STRING([--enable-manpage-build],
-              [Build the manpages from their XML source (shipped manpages are usually sufficient)]),
-    [ ENABLE_MANPAGE_BUILD=$enableval ],
-    [ ENABLE_MANPAGE_BUILD=no ])
-
-AC_PROG_XSLTPROC([--nonet])
-AC_CHECK_DOCBOOK_XSLT([1.72.0])
-AC_CHECK_DOCBOOK_DTD([4.1.2])
-AC_CHECK_DOCBOOK_DTD([4.2])
-
-# and ensure that everything docbook-related is OK if we'll be using it
-if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
-    if test -z "$XSLTPROC"; then
-       AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.])
-    fi
-
-    if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
-       AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 was not found.])
-    fi
-
-    if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
-       AC_MSG_WARN([Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation])
-       XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
-    fi
-fi
-AM_CONDITIONAL(ENABLE_MANPAGE_BUILD, test "x$ENABLE_MANPAGE_BUILD" = "xyes")
-
-AC_CACHE_CHECK([for working IPv6],
-              amanda_working_ipv6,
-  [AC_TRY_RUN([#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <errno.h>
-
-main()
-{
-   int aa;
-   aa = socket(AF_INET6, SOCK_STREAM, 0);
-   if (aa > 0) return 0;
-   return aa;
-}],amanda_working_ipv6=yes,
-   amanda_working_ipv6=no,
-   amanda_working_ipv6=yes
-  )
-  ]
-)
-
-if test "$BROKEN_IPV6" = true; then
-    amanda_working_ipv6=no;
-fi
-
-if test "$amanda_working_ipv6" = yes; then
-    if test "$amanda_ipv6" != false; then
-       AC_DEFINE(WORKING_IPV6,1,[Define if IPv6 is working. ])
-    fi
-else
-    if test "$amanda_ipv6" = true; then
-        AC_MSG_ERROR([Asked for IPv6 but it is not working.])
-    fi
-fi
-
-AM_CONDITIONAL([GCC_COMPILER], [test "x$CC" = "xgcc"])
-
-#### Enforce amanda code cleanliness rules.
-#### Done here to allow configuration code to remain intact.
-if test "x$CC" = "xgcc"; then
-  AM_CFLAGS="$AM_CFLAGS -Wall"
-  $CC -v --help 2>&1 | $GREP -- '-Wextra ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wextra"
-  else
-   AM_CFLAGS="$AM_CFLAGS -W"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wparentheses' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wparentheses"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wdeclaration-after-statement' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wdeclaration-after-statement"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wmissing-prototypes ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wmissing-prototypes"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wstrict-prototypes ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wmissing-declarations ' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wformat' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wformat"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wsign-compare' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wsign-compare"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-fno-strict-aliasing' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -fno-strict-aliasing"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wfloat-equal' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wfloat-equal"
-  fi
-
-  $CC -v --help 2>&1 | $GREP -- '-Wold-style-definition' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AM_CFLAGS="$AM_CFLAGS -Wold-style-definition"
-  fi
-fi
-AC_SUBST(AM_CFLAGS)
-
-AC_CONFIG_FILES([\
-       gnulib/Makefile                                                 \
-                                                                       \
-       amplot/amcat.awk                amplot/amplot.sh                \
-       amplot/Makefile                                                 \
-                                                                       \
-       amandad-src/Makefile                                            \
-                                                                       \
-       changer-src/chg-manual.sh       changer-src/chg-multi.sh        \
-       changer-src/chg-mtx.sh          changer-src/chg-chs.sh          \
-       changer-src/chg-rth.pl          changer-src/chg-chio.pl         \
-       changer-src/chg-zd-mtx.sh       changer-src/Makefile            \
-       changer-src/chg-juke.sh         changer-src/chg-rait.sh         \
-       changer-src/chg-null.sh         changer-src/chg-mcutil.sh       \
-       changer-src/chg-disk.sh         changer-src/chg-iomega.pl       \
-    changer-src/chg-lib.sh                                  \
-                                                                       \
-       client-src/patch-system.sh      client-src/Makefile             \
-                                                                       \
-        dumper-src/amgtar.pl           dumper-src/generic-dumper.pl    \
-       dumper-src/Makefile                                             \
-                                                                       \
-       common-src/versuff.c            common-src/Makefile             \
-                                                                       \
-       example/amanda.conf             example/Makefile                \
-       example/chg-mcutil.conf         example/amanda-client.conf      \
-                                                                       \
-       man/Makefile                                                    \
-                                                                       \
-       docs/Makefile                                                   \
-                                                                       \
-       recover-src/Makefile                                            \
-
-       oldrecover-src/Makefile                                         \
-                                                                       \
-       restore-src/Makefile                                            \
-                                                                       \
-       server-src/amcheckdb.sh         server-src/amcleanup.sh         \
-       server-src/amdump.sh            server-src/amfreetapes.sh       \
-       server-src/amoverview.pl        server-src/amrmtape.sh          \
-       server-src/amtoc.pl             server-src/amverify.sh          \
-       server-src/Makefile             server-src/amstatus.pl          \
-       server-src/amverifyrun.sh       server-src/amcrypt.sh           \
-       server-src/amaespipe.sh         server-src/amcrypt-ossl.sh      \
-       server-src/amcrypt-ossl-asym.sh                                 \
-       tape-src/Makefile                                               \
-                                                                       \
-       config/Makefile                 Makefile])
 
 AC_OUTPUT
+AMANDA_GET_SVN_INFO
+AMANDA_SHOW_SUMMARY
index 314321247778a8df48be070fd6701c45f2edaabd..e6948697f292856e892897aff9b6f0d7fdf34c3d 100644 (file)
@@ -22,7 +22,6 @@
 # -----------------------------------------------------------------------
 # History:
 #
-# $Log: set_prod_link.pl,v $
 # Revision 1.3  2006/05/25 01:47:13  johnfranks
 # Allow spaces and arbitrary binary characters in file names
 # and configuration files.
diff --git a/device-src/Makefile.am b/device-src/Makefile.am
new file mode 100644 (file)
index 0000000..75177d7
--- /dev/null
@@ -0,0 +1,64 @@
+# Makefile for Amanda tape library.
+
+SUBDIRS = . tests
+
+include $(top_srcdir)/config/automake/precompile.am
+
+INCLUDES =     -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib
+
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
+sbin_PROGRAMS =
+
+## libamdevice.la
+
+amlib_LTLIBRARIES =    libamdevice.la
+libamdevice_la_LDFLAGS = -release $(VERSION) 
+libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \
+       null-device.c rait-device.c vfs-device.c 
+libamdevice_la_LIBADD = ../common-src/libamanda.la
+
+# tape-device has *lots* of conditionals; the first is whether to support
+# the device at all, and the remainder select a particular kind of OS-specific
+# backend.
+
+if WANT_TAPE_DEVICE
+libamdevice_la_SOURCES += tape-device.c
+
+if WANT_TAPE_XENIX
+libamdevice_la_SOURCES += tape-xenix.c
+endif
+if WANT_TAPE_AIX
+libamdevice_la_SOURCES += tape-aix.c
+endif
+if WANT_TAPE_UWARE
+libamdevice_la_SOURCES += tape-uware.c
+endif
+if WANT_TAPE_POSIX
+libamdevice_la_SOURCES += tape-posix.c
+endif
+
+endif
+
+if WANT_S3_DEVICE
+libamdevice_la_SOURCES += s3-device.c s3.c
+endif
+
+## activate-devpay
+
+if WANT_DEVPAY
+sbin_PROGRAMS += activate-devpay
+activate_devpay_SOURCES = activate-devpay.c
+endif
+
+## headers
+
+noinst_HEADERS = null-device.h semaphore.h \
+       tape-ops.h property.h rait-device.h s3.h \
+       s3-device.h tape-device.h vfs-device.h \
+       device.h queueing.h
+       
+aminclude_HEADERS = 
diff --git a/device-src/Makefile.in b/device-src/Makefile.in
new file mode 100644 (file)
index 0000000..e23935b
--- /dev/null
@@ -0,0 +1,1121 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+
+# Makefile for Amanda tape library.
+
+# vim:ft=automake
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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@
+DIST_COMMON = $(aminclude_HEADERS) $(noinst_HEADERS) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/precompile.am
+sbin_PROGRAMS = $(am__EXEEXT_1)
+
+# tape-device has *lots* of conditionals; the first is whether to support
+# the device at all, and the remainder select a particular kind of OS-specific
+# backend.
+@WANT_TAPE_DEVICE_TRUE@am__append_1 = tape-device.c
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__append_2 = tape-xenix.c
+@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__append_3 = tape-aix.c
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__append_4 = tape-uware.c
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__append_5 = tape-posix.c
+@WANT_S3_DEVICE_TRUE@am__append_6 = s3-device.c s3.c
+@WANT_DEVPAY_TRUE@am__append_7 = activate-devpay
+subdir = device-src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" \
+       "$(DESTDIR)$(amincludedir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamdevice_la_DEPENDENCIES = ../common-src/libamanda.la
+am__libamdevice_la_SOURCES_DIST = property.c device.c queueing.c \
+       semaphore.c null-device.c rait-device.c vfs-device.c \
+       tape-device.c tape-xenix.c tape-aix.c tape-uware.c \
+       tape-posix.c s3-device.c s3.c
+@WANT_TAPE_DEVICE_TRUE@am__objects_1 = tape-device.lo
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__objects_2 =  \
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@  tape-xenix.lo
+@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__objects_3 =  \
+@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@    tape-aix.lo
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__objects_4 =  \
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@  tape-uware.lo
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__objects_5 =  \
+@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@  tape-posix.lo
+@WANT_S3_DEVICE_TRUE@am__objects_6 = s3-device.lo s3.lo
+am_libamdevice_la_OBJECTS = property.lo device.lo queueing.lo \
+       semaphore.lo null-device.lo rait-device.lo vfs-device.lo \
+       $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+       $(am__objects_4) $(am__objects_5) $(am__objects_6)
+libamdevice_la_OBJECTS = $(am_libamdevice_la_OBJECTS)
+libamdevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamdevice_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_DEVPAY_TRUE@am__EXEEXT_1 = activate-devpay$(EXEEXT)
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(sbin_PROGRAMS)
+am__activate_devpay_SOURCES_DIST = activate-devpay.c
+@WANT_DEVPAY_TRUE@am_activate_devpay_OBJECTS =  \
+@WANT_DEVPAY_TRUE@     activate-devpay.$(OBJEXT)
+activate_devpay_OBJECTS = $(am_activate_devpay_OBJECTS)
+activate_devpay_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES)
+DIST_SOURCES = $(am__libamdevice_la_SOURCES_DIST) \
+       $(am__activate_devpay_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+       html-recursive info-recursive install-data-recursive \
+       install-dvi-recursive install-exec-recursive \
+       install-html-recursive install-info-recursive \
+       install-pdf-recursive install-ps-recursive install-recursive \
+       installcheck-recursive installdirs-recursive pdf-recursive \
+       ps-recursive uninstall-recursive
+amincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(aminclude_HEADERS) $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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@
+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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = . tests
+INCLUDES = -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib
+
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+amlib_LTLIBRARIES = libamdevice.la
+libamdevice_la_LDFLAGS = -release $(VERSION) 
+libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \
+       null-device.c rait-device.c vfs-device.c $(am__append_1) \
+       $(am__append_2) $(am__append_3) $(am__append_4) \
+       $(am__append_5) $(am__append_6)
+libamdevice_la_LIBADD = ../common-src/libamanda.la
+@WANT_DEVPAY_TRUE@activate_devpay_SOURCES = activate-devpay.c
+noinst_HEADERS = null-device.h semaphore.h \
+       tape-ops.h property.h rait-device.h s3.h \
+       s3-device.h tape-device.h vfs-device.h \
+       device.h queueing.h
+
+aminclude_HEADERS = 
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  device-src/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  device-src/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-amlibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
+       done
+
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libamdevice.la: $(libamdevice_la_OBJECTS) $(libamdevice_la_DEPENDENCIES) 
+       $(libamdevice_la_LINK) -rpath $(amlibdir) $(libamdevice_la_OBJECTS) $(libamdevice_la_LIBADD) $(LIBS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+       @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         if test -f $$p \
+            || test -f $$p1 \
+         ; then \
+           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
+         else :; fi; \
+       done
+
+uninstall-sbinPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+         echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+       done
+
+clean-sbinPROGRAMS:
+       @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+activate-devpay$(EXEEXT): $(activate_devpay_OBJECTS) $(activate_devpay_DEPENDENCIES) 
+       @rm -f activate-devpay$(EXEEXT)
+       $(LINK) $(activate_devpay_OBJECTS) $(activate_devpay_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activate-devpay.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null-device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rait-device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-aix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-posix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-uware.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-xenix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-device.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-amincludeHEADERS: $(aminclude_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(amincludedir)" || $(MKDIR_P) "$(DESTDIR)$(amincludedir)"
+       @list='$(aminclude_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(amincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(amincludedir)/$$f'"; \
+         $(amincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(amincludedir)/$$f"; \
+       done
+
+uninstall-amincludeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(aminclude_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(amincludedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amincludedir)/$$f"; \
+       done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; 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; \
+         (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"
+
+$(RECURSIVE_CLEAN_TARGETS):
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       rev=''; for subdir in $$list; do \
+         if test "$$subdir" = "."; then :; else \
+           rev="$$subdir $$rev"; \
+         fi; \
+       done; \
+       rev="$$rev ."; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+ctags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       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 || \
+             tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$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 \
+           test -d "$(distdir)/$$subdir" \
+           || $(MKDIR_P) "$(distdir)/$$subdir" \
+           || exit 1; \
+           distdir=`$(am__cd) $(distdir) && pwd`; \
+           top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$top_distdir" \
+               distdir="$$distdir/$$subdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"; 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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-amlibLTLIBRARIES clean-generic clean-libtool \
+       clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-amincludeHEADERS install-amlibLTLIBRARIES
+
+install-dvi: install-dvi-recursive
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \
+       uninstall-sbinPROGRAMS
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+       install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+       all all-am check check-am clean clean-amlibLTLIBRARIES \
+       clean-generic clean-libtool clean-sbinPROGRAMS ctags \
+       ctags-recursive distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am \
+       install-amincludeHEADERS install-amlibLTLIBRARIES 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 installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+       uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \
+       uninstall-sbinPROGRAMS
+
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
+# 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/device-src/activate-devpay.c b/device-src/activate-devpay.c
new file mode 100644 (file)
index 0000000..196834d
--- /dev/null
@@ -0,0 +1,226 @@
+/* This program creates the token and certificate files for Amazon Devpay's
+ * Simple Token Service (STS). Right now you can then use those files with
+ * the S3 device. */
+
+#include "amanda.h"
+
+#include <curl/curl.h>
+#include <glib.h>
+
+#include <errno.h>
+#include <getopt.h>
+
+#include "base64.h"
+#include "s3.h"
+
+#ifndef WANT_DEVPAY
+# error activate_devpay only works if devpay is enabled.
+#endif
+
+#define MAX_RESPONSE_SIZE (1024*1024)
+
+typedef struct {
+    GString * user_token;
+    GString * access_key;
+    GString * secret_key;
+} Credentials;
+
+static void usage(void) {
+    g_fprintf(stderr,
+"USAGE: activate-devpay KEY [ >> amanda.conf ]\n"
+"  This tool uses an Amazon Devpay activation key to retrieve an\n"
+"  user token, access key, and secret key for use with Amazon S3. Output\n"
+"  is in a form suitable for placement in an Amanda configuration file\n");
+
+    exit(EXIT_FAILURE);
+}
+
+/* This function is **not** thread-safe. Sorry. */
+static const char * parse_commandline(int argc, char ** argv) {
+    if (argc != 2) {
+        usage();
+        return NULL;
+    } else {
+        return argv[1];
+    }
+}
+
+static char * activation_url(const char *key) {
+    char * url;
+    char * encoded_key;
+    
+    encoded_key = curl_escape(key, 0);
+    url = g_strdup_printf(STS_BASE_URL "?Action=ActivateDesktopProduct&ActivationKey=%s&ProductToken=" STS_PRODUCT_TOKEN "&Version=2007-06-05", encoded_key);
+    curl_free(encoded_key);
+
+    return url;
+}
+
+/* This function is a CURLOPT_WRITEFUNCTION and a wrapper for
+   g_markup_parse_context_parse(). It's not very smart about errors. */
+static size_t libcurl_gmarkup_glue(void *ptr, size_t size1, size_t size2,
+                                   void *stream) {
+    GMarkupParseContext *context = stream;
+    /* If this overflows, we have real problems, because we are expected to
+     * return the result of this multiplication in a size_t. */
+    size_t read_size = size1 * size2;
+    GError * error = NULL;
+
+    read_size = size1 * size2;
+
+    if (g_markup_parse_context_parse(context, ptr, read_size, &error)) {
+        return read_size;
+    } else {
+        if (error == NULL) {
+            g_fprintf(stderr, "Internal error parsing XML.\n");
+        } else {
+            g_fprintf(stderr, "Error parsing XML: %s\n",
+                    error->message);
+            g_error_free(error);
+        }
+        exit(EXIT_FAILURE);
+    }
+}
+
+static void do_server_stuff(const char * key, GMarkupParseContext * parser) {
+    char * url;
+    CURL* handle;
+    char curl_error_buffer[CURL_ERROR_SIZE];
+
+    handle = curl_easy_init();
+    
+    curl_easy_setopt(handle, CURLOPT_NOPROGRESS, TRUE);
+    curl_easy_setopt(handle, CURLOPT_NOSIGNAL, TRUE);
+    curl_easy_setopt(handle, CURLOPT_AUTOREFERER, TRUE);
+    curl_easy_setopt(handle, CURLOPT_ENCODING, ""); /* Support everything. */
+#ifdef CURLOPT_MAXFILESIZE
+    curl_easy_setopt(handle, CURLOPT_MAXFILESIZE, MAX_RESPONSE_SIZE);
+#endif
+    curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, curl_error_buffer);
+
+    curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, libcurl_gmarkup_glue);
+    curl_easy_setopt(handle, CURLOPT_WRITEDATA, parser);
+    url = activation_url(key);
+    curl_easy_setopt(handle, CURLOPT_URL, url);
+
+    if (curl_easy_perform(handle) != 0) {
+        g_error("Problem fetching data from server:\n%s",
+                curl_error_buffer);
+        exit(EXIT_FAILURE);
+    }
+    
+    g_free(url);
+}
+
+static void parser_got_text(GMarkupParseContext * context,
+                            const char * text,
+                            size_t text_len,
+                            gpointer user_data,
+                            GError ** error) {
+    Credentials * rval = user_data;
+
+    const char * current_tag = g_markup_parse_context_get_element(context);
+
+    g_assert(rval != NULL);
+    g_assert(*error == NULL);
+
+    /* We use strrstr instead of strcmp because Amazon uses namespaces
+     * that I don't want to deal with. */
+    if (g_strrstr(current_tag, "UserToken")) {
+        g_string_append_len(rval->user_token, text, text_len);
+        return;
+    } else if (g_strrstr(current_tag, "AWSAccessKeyId")) {
+        g_string_append_len(rval->access_key, text, text_len);
+        return;
+    } else if (g_strrstr(current_tag, "SecretAccessKey")) {
+        g_string_append_len(rval->secret_key, text, text_len);
+        return;
+    } else if (g_strrstr(current_tag, "Code")) {
+        /* Is it a code we know? */
+        if (strncmp(text, "ExpiredActivationKey", text_len) == 0) {
+            g_set_error(error, G_MARKUP_ERROR, -1,
+                        "Activation key has expired; get a new one.");
+        } else if (strncmp(text, "InvalidActivationKey", text_len) == 0) {
+            g_set_error(error, G_MARKUP_ERROR, -1,
+                        "Activation key is not valid; double-check.");
+        } else {
+            /* Do nothing; wait for the message. */
+        }
+    } else if (g_strrstr(current_tag, "Message")) {
+        g_set_error(error, G_MARKUP_ERROR, -1, "%.*s", text_len, text);
+    }
+}               
+
+static void parser_got_error(GMarkupParseContext * context G_GNUC_UNUSED,
+                             GError * error,
+                             gpointer user_data G_GNUC_UNUSED) {
+    g_fprintf (stderr, "Problem with Amazon response: %s\n", error->message);
+    exit(EXIT_FAILURE);
+}
+
+static GMarkupParseContext * parser_init(Credentials * credentials) {
+    static const GMarkupParser parser_settings = {
+        NULL, /* start_element */
+        NULL, /* end_element */
+        parser_got_text, /* text */
+        NULL, /* passthrough */
+        parser_got_error /* error */
+    };
+    bzero(credentials, sizeof(*credentials));
+
+    credentials->user_token = g_string_new("");
+    credentials->access_key = g_string_new("");
+    credentials->secret_key = g_string_new("");
+
+    return g_markup_parse_context_new(&parser_settings, 0, credentials, NULL);
+}
+
+static void parser_cleanup(GMarkupParseContext * context) {
+    GError * error = NULL;
+    g_markup_parse_context_end_parse(context, &error);
+    
+    if (error != NULL) {
+        g_fprintf (stderr, "Unexpected end of Amazon response: %s\n",
+                 error->message);
+        exit(EXIT_FAILURE);
+    }
+
+    g_markup_parse_context_free(context);
+}
+
+/* This function is responsible for the whole output thing. */
+static void do_output(Credentials * rare) {
+    if (rare == NULL ||
+        rare->user_token == NULL || !rare->user_token->len ||
+        rare->access_key == NULL || !rare->access_key->len ||
+        rare->secret_key == NULL || !rare->secret_key->len) {
+        g_fprintf(stderr, "Missing authentication data in response!\n");
+        exit(EXIT_FAILURE);
+    }
+
+    g_printf("device_property \"S3_USER_TOKEN\" \"%s\"\n"
+             "device_property \"S3_ACCESS_KEY\" \"%s\"\n"
+             "device_property \"S3_SECRET_KEY\" \"%s\"\n",
+             rare->user_token->str, rare->access_key->str,
+             rare->secret_key->str);
+}
+
+int main(int argc, char ** argv) {
+    const char * key;
+    GMarkupParseContext * parser;
+    Credentials credentials;
+
+    key = parse_commandline(argc, argv);
+
+    curl_global_init(CURL_GLOBAL_ALL);
+    parser = parser_init(&credentials);
+
+    do_server_stuff(key, parser);
+
+    curl_global_cleanup();
+    parser_cleanup(parser);
+
+    do_output(&credentials);
+    
+    return 0;
+}
diff --git a/device-src/device.c b/device-src/device.c
new file mode 100644 (file)
index 0000000..bf8cbd4
--- /dev/null
@@ -0,0 +1,1083 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The Device API abstracts device workings, interaction, properties, and
+ * capabilities from the rest of the Amanda code base. It supports
+ * pluggable modules for different kinds of devices. */
+
+#include "amanda.h"
+#include "conffile.h"
+
+#include <regex.h>
+
+#include "device.h"
+#include "queueing.h"
+#include "property.h"
+
+#include "null-device.h"
+#include "timestamp.h"
+#include "vfs-device.h"
+#include "util.h"
+#ifdef WANT_TAPE_DEVICE
+#include "tape-device.h"
+#endif
+#include "rait-device.h"
+#ifdef WANT_S3_DEVICE
+  #include "s3-device.h"
+#endif
+
+static GHashTable* driverList = NULL;
+
+void device_api_init(void) {
+    g_type_init();
+    amanda_thread_init();
+    device_property_init();
+    driverList = g_hash_table_new(g_str_hash, g_str_equal);
+
+    /* register other types and devices. */
+    null_device_register();
+    vfs_device_register();
+#ifdef WANT_TAPE_DEVICE
+    tape_device_register();
+#endif
+    rait_device_register();
+#ifdef WANT_S3_DEVICE
+    s3_device_register();
+#endif
+}
+
+void register_device(DeviceFactory factory,
+                     const char ** device_prefix_list) {
+    char ** tmp;
+    g_assert(driverList != NULL);
+    g_assert(factory != NULL);
+    g_return_if_fail(device_prefix_list != NULL);
+    g_return_if_fail(*device_prefix_list != NULL);
+
+    tmp = (char**)device_prefix_list;
+    while (*tmp != NULL) {
+        g_hash_table_insert(driverList, *tmp, (gpointer)factory);
+        tmp ++;
+    }
+}
+
+static DeviceFactory lookup_device_factory(const char *device_name) {
+    gpointer key, value;
+    g_assert(driverList != NULL);
+
+    if (g_hash_table_lookup_extended(driverList, device_name, &key, &value)) {
+        return (DeviceFactory)value;
+    } else {
+        return NULL;
+    }
+}
+
+static const GFlagsValue read_label_status_flags_values[] = {
+    { READ_LABEL_STATUS_SUCCESS,
+      "READ_LABEL_STATUS_SUCCESS",
+      "Success" },
+    { READ_LABEL_STATUS_DEVICE_MISSING,
+      "READ_LABEL_STATUS_DEVICE_MISSING",
+      "Device not found" },
+    { READ_LABEL_STATUS_DEVICE_ERROR,
+      "READ_LABEL_STATUS_DEVICE_ERROR",
+      "Device error" },
+    { READ_LABEL_STATUS_VOLUME_MISSING,
+      "READ_LABEL_STATUS_VOLUME_MISSING",
+      "Volume not found" },
+    { READ_LABEL_STATUS_VOLUME_UNLABELED,
+      "READ_LABEL_STATUS_VOLUME_UNLABELED",
+      "Volume not labeled" },
+    { READ_LABEL_STATUS_VOLUME_ERROR,
+      "READ_LABEL_STATUS_VOLUME_ERROR",
+      "Volume error" },
+    { 0, NULL, NULL }
+};
+
+GType read_label_status_flags_get_type(void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_flags_register_static("ReadLabelStatusFlags",
+                                       read_label_status_flags_values);
+    }
+    return type;
+}
+
+/* Device class definition starts here. */
+
+struct DevicePrivate_s {
+    /* This is the return value of the device_get_property_list()
+       method. */
+    GArray *property_list;
+    GHashTable * property_response;
+};
+
+/* This holds the default response to a particular property. */
+typedef struct {
+    PropertyAccessFlags access;
+    GValue response;
+} PropertyResponse;
+
+#define selfp (self->private)
+
+/* here are local prototypes, so we can make function pointers. */
+static void device_init (Device * o) G_GNUC_UNUSED;
+static void device_class_init (DeviceClass * c) G_GNUC_UNUSED;
+
+static void property_response_free(PropertyResponse *o);
+
+static gboolean default_device_open_device(Device * self, char * device_name);
+static gboolean default_device_finish(Device * self);
+static gboolean default_device_start(Device * self, DeviceAccessMode mode,
+                                     char * label, char * timestamp);
+static gboolean default_device_start_file (Device * self,
+                                           const dumpfile_t * jobinfo);
+static gboolean default_device_write_block (Device * self, guint size,
+                                            gpointer data, gboolean last);
+static gboolean default_device_write_from_fd(Device *self, int fd);
+static gboolean default_device_finish_file (Device * self);
+static dumpfile_t* default_device_seek_file (Device * self, guint file);
+static gboolean default_device_seek_block (Device * self, guint64 block);
+static int default_device_read_block (Device * self, gpointer buffer,
+                                      int * size);
+static gboolean default_device_read_to_fd(Device *self, int fd);
+static gboolean default_device_property_get(Device * self, DevicePropertyId ID,
+                                            GValue * value);
+
+/* pointer to the class of our parent */
+static GObjectClass *parent_class = NULL;
+
+GType
+device_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (DeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (Device),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) device_init,
+            NULL
+        };
+        
+        type = g_type_register_static (G_TYPE_OBJECT, "Device", &info,
+                                       (GTypeFlags)G_TYPE_FLAG_ABSTRACT);
+    }
+    
+    return type;
+}
+
+static void device_finalize(GObject *obj_self) {
+    Device *self G_GNUC_UNUSED = DEVICE (obj_self);
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+
+    /* Here we call device_finish() if it hasn't been done
+       yet. Subclasses may need to do this same check earlier. */
+    if (self->access_mode != ACCESS_NULL) {
+        device_finish(self);
+    }
+
+    amfree(self->device_name);
+    amfree(self->volume_label);
+    amfree(self->volume_time);
+    g_array_free(selfp->property_list, TRUE);
+    g_hash_table_destroy(selfp->property_response);
+    amfree(self->private);
+}
+
+static void 
+device_init (Device * self G_GNUC_UNUSED)
+{
+    self->private = malloc(sizeof(DevicePrivate));
+    self->device_name = NULL;
+    self->access_mode = ACCESS_NULL;
+    self->is_eof = FALSE;
+    self->file = -1;
+    self->block = 0;
+    self->in_file = FALSE;
+    self->volume_label = NULL;
+    self->volume_time = NULL;
+    selfp->property_list = g_array_new(TRUE, FALSE, sizeof(DeviceProperty));
+    selfp->property_response =
+        g_hash_table_new_full(g_direct_hash,
+                              g_direct_equal,
+                              NULL,
+                              (GDestroyNotify) property_response_free);
+}
+
+static void 
+device_class_init (DeviceClass * c G_GNUC_UNUSED)
+{
+    GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+    
+    parent_class = g_type_class_ref (G_TYPE_OBJECT);
+    
+    c->open_device = default_device_open_device;
+    c->finish = default_device_finish;
+    c->read_label = NULL;
+    c->start = default_device_start;
+    c->start_file = default_device_start_file;
+    c->write_block = default_device_write_block;
+    c->write_from_fd = default_device_write_from_fd;
+    c->finish_file = default_device_finish_file;
+    c->seek_file = default_device_seek_file;
+    c->seek_block = default_device_seek_block;
+    c->read_block = default_device_read_block;
+    c->read_to_fd = default_device_read_to_fd;
+    c->property_get = default_device_property_get;
+    c->property_set = NULL;
+    c->recycle_file = NULL;
+    g_object_class->finalize = device_finalize;
+}
+
+static void property_response_free(PropertyResponse * resp) {
+    g_value_unset(&(resp->response));
+    amfree(resp);
+}
+
+static char *
+regex_message(int result, regex_t *regex) {
+    char * rval;
+    size_t size;
+
+    size = regerror(result, regex, NULL, 0);
+    rval = malloc(size);
+    regerror(result, regex, rval, size);
+
+    return rval;
+}
+
+static gboolean
+handle_device_regex(const char * user_name, char ** driver_name,
+                    char ** device) {
+    regex_t regex;
+    int reg_result;
+    regmatch_t pmatch[3];
+    static const char * regex_string = "^([a-z0-9]+):(.*)$";
+
+    bzero(&regex, sizeof(regex));
+
+    reg_result = regcomp(&regex, regex_string, REG_EXTENDED | REG_ICASE);
+    if (reg_result != 0) {
+        char * message = regex_message(reg_result, &regex);
+        g_fprintf(stderr, "Error compiling regular expression \"%s\": %s\n",
+               regex_string, message);
+        amfree(message);
+        return FALSE;
+    }
+
+    reg_result = regexec(&regex, user_name, 3, pmatch, 0);
+    if (reg_result != 0 && reg_result != REG_NOMATCH) {
+        char * message = regex_message(reg_result, &regex);
+        g_fprintf(stderr, "Error applying regular expression \"%s\" to string \"%s\":\n"
+               "%s\n", user_name, regex_string, message);
+        regfree(&regex);
+        return FALSE;
+    } else if (reg_result == REG_NOMATCH) {
+#ifdef WANT_TAPE_DEVICE
+        g_fprintf(stderr, "\"%s\" uses deprecated device naming convention; \n"
+                "using \"tape:%s\" instead.\n",
+                user_name, user_name);
+        *driver_name = stralloc("tape");
+        *device = stralloc(user_name);
+#else /* !WANT_TAPE_DEVICE */
+        g_fprintf(stderr, "\"%s\" is not a valid device name.\n", user_name);
+       regfree(&regex);
+       return FALSE;
+#endif /* WANT_TAPE_DEVICE */
+    } else {
+        *driver_name = find_regex_substring(user_name, pmatch[1]);
+        *device = find_regex_substring(user_name, pmatch[2]);
+    }
+    regfree(&regex);
+    return TRUE;
+}
+
+Device* 
+device_open (char * device_name)
+{
+    char *device_driver_name = NULL;
+    char *device_node_name = NULL;
+    DeviceFactory factory;
+    Device *device;
+
+    g_return_val_if_fail (device_name != NULL, NULL);
+
+    if (driverList == NULL) {
+        g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
+              "device_open() called without device_api_init()!\n");
+        g_assert_not_reached();
+    }
+
+    if (!handle_device_regex(device_name, &device_driver_name, &device_node_name)) {
+        amfree(device_driver_name);
+        amfree(device_node_name);
+        return NULL;
+    }
+
+    factory = lookup_device_factory(device_driver_name);
+
+    if (factory == NULL) {
+        g_fprintf(stderr, "Device driver %s is not known.\n",
+                device_driver_name);
+        amfree(device_driver_name);
+        amfree(device_node_name);
+        return NULL;
+    }
+
+    device = factory(device_driver_name, device_node_name);
+    amfree(device_driver_name);
+    amfree(device_node_name);
+    return device;
+}
+
+void 
+device_add_property (Device * self, DeviceProperty * prop, GValue * response)
+{
+    unsigned int i;
+    g_return_if_fail (self != NULL);
+    g_return_if_fail (IS_DEVICE (self));
+    g_assert(selfp->property_list != NULL);
+    g_assert(selfp->property_response != NULL);
+
+    /* Delete it if it already exists. */
+    for(i = 0; i < selfp->property_list->len; i ++) {
+        if (g_array_index(selfp->property_list,
+                          DeviceProperty, i).base->ID == prop->base->ID) {
+            g_array_remove_index_fast(selfp->property_list, i);
+            break;
+        }
+    }
+
+    g_array_append_val(selfp->property_list, *prop);
+    
+    if (response != NULL) {
+        PropertyResponse * property_response;
+        
+        g_return_if_fail(G_IS_VALUE(response));
+        
+        property_response = malloc(sizeof(*property_response));
+        property_response->access = prop->access;
+        bzero(&(property_response->response),
+              sizeof(property_response->response));
+        g_value_init(&(property_response->response),
+                     G_VALUE_TYPE(response));
+        g_value_copy(response, &(property_response->response));
+        
+        g_hash_table_insert(selfp->property_response,
+                            GINT_TO_POINTER(prop->base->ID),
+                            property_response);
+    }
+}
+
+const DeviceProperty * 
+device_property_get_list (Device * self)
+{
+       g_return_val_if_fail (self != NULL, (const DeviceProperty * )0);
+       g_return_val_if_fail (IS_DEVICE (self), (const DeviceProperty * )0);
+
+        return (const DeviceProperty*) selfp->property_list->data;
+}
+
+guint device_write_min_size(Device * self) {
+    GValue g_tmp;
+    int block_size, min_block_size;
+    
+    bzero(&g_tmp, sizeof(g_tmp));
+    device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp);
+    block_size = g_value_get_int(&g_tmp);
+    g_value_unset(&g_tmp);
+    if (block_size > 0) {
+        return block_size;
+    }
+
+    /* variable block size */
+    device_property_get(self, PROPERTY_MIN_BLOCK_SIZE, &g_tmp);
+    min_block_size = g_value_get_uint(&g_tmp);
+    g_value_unset(&g_tmp);
+    return min_block_size;
+}
+
+guint device_write_max_size(Device * self) {
+    GValue g_tmp;
+    int block_size, max_block_size;
+    
+    bzero(&g_tmp, sizeof(g_tmp));
+    device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp);
+    block_size = g_value_get_int(&g_tmp);
+    g_value_unset(&g_tmp);
+    if (block_size > 0) {
+        return block_size;
+    }
+
+    /* variable block size */
+    device_property_get(self, PROPERTY_MAX_BLOCK_SIZE, &g_tmp);
+    max_block_size = g_value_get_uint(&g_tmp);
+    g_value_unset(&g_tmp);
+    return max_block_size;
+}
+
+guint device_read_max_size(Device * self) {
+    GValue g_tmp;
+    
+    bzero(&g_tmp, sizeof(g_tmp));
+    if (device_property_get(self, PROPERTY_READ_BUFFER_SIZE, &g_tmp)) {
+        guint rval = g_value_get_uint(&g_tmp);
+        g_value_unset(&g_tmp);
+        return rval;
+    } else {
+        return device_write_max_size(self);
+    }
+}
+
+char * device_build_amanda_header(Device * self, const dumpfile_t * info,
+                                  int * size, gboolean * oneblock) {
+    char *amanda_header;
+    unsigned int min_header_length;
+    unsigned int header_buffer_size;
+
+    min_header_length = device_write_min_size(self);
+    amanda_header = build_header(info, min_header_length);
+    header_buffer_size = MAX(min_header_length, strlen(amanda_header)+1);
+    if (size != NULL)
+        *size = header_buffer_size;
+    if (oneblock != NULL)
+        *oneblock = (header_buffer_size <=  device_write_max_size(self));
+    return amanda_header;
+}
+
+dumpfile_t * make_tapestart_header(Device * self, char * label,
+                                   char * timestamp) {
+    dumpfile_t * rval;
+
+    g_return_val_if_fail(label != NULL, NULL);
+
+    rval = malloc(sizeof(*rval));
+    fh_init(rval);
+    rval->type = F_TAPESTART;
+    amfree(self->volume_time);
+    if (get_timestamp_state(timestamp) == TIME_STATE_REPLACE) {
+        self->volume_time = get_proper_stamp_from_time(time(NULL));
+    } else {
+        self->volume_time = g_strdup(timestamp);
+    }
+    strncpy(rval->datestamp, self->volume_time, sizeof(rval->datestamp));
+    strncpy(rval->name, label, sizeof(rval->name));
+
+    return rval;
+}
+
+dumpfile_t * make_tapeend_header(void) {
+    dumpfile_t * rval;
+    char * timestamp;
+
+    rval = malloc(sizeof(*rval));
+    rval->type = F_TAPEEND;
+    timestamp = get_timestamp_from_time(time(NULL));
+    strncpy(rval->datestamp, timestamp, sizeof(rval->datestamp));
+    amfree(timestamp);
+    return rval;
+}
+
+/* Try setting max/fixed blocksize on a device. Check results, fallback, and
+ * print messages for problems. */
+static void try_set_blocksize(Device * device, guint blocksize,
+                              gboolean try_max_first) {
+    GValue val;
+    gboolean success;
+    bzero(&val, sizeof(val));
+    g_value_init(&val, G_TYPE_UINT);
+    g_value_set_uint(&val, blocksize);
+    if (try_max_first) {
+        success = device_property_set(device,
+                                      PROPERTY_MAX_BLOCK_SIZE,
+                                      &val);
+        if (!success) {
+            g_fprintf(stderr, "Setting MAX_BLOCK_SIZE to %u "
+                    "not supported for device %s.\n"
+                    "trying BLOCK_SIZE instead.\n",
+                    blocksize, device->device_name);
+        } else {
+            g_value_unset(&val);
+            return;
+        }
+    }
+
+    g_value_unset(&val);
+    g_value_init(&val, G_TYPE_INT);
+    g_value_set_int(&val, blocksize);
+    success = device_property_set(device,
+                                  PROPERTY_BLOCK_SIZE,
+                                  &val);
+    if (!success) {
+        g_fprintf(stderr, "Setting BLOCK_SIZE to %u "
+                "not supported for device %s.\n",
+                blocksize, device->device_name);
+    }
+    g_value_unset(&val);
+}
+
+/* A GHFunc (callback for g_hash_table_foreach) */
+static void set_device_property(gpointer key_p, gpointer value_p,
+                                   gpointer user_data_p) {
+    char * property_s = key_p;
+    char * value_s = value_p;
+    Device * device = user_data_p;
+    const DevicePropertyBase* property_base;
+    GValue property_value;
+
+    g_return_if_fail(IS_DEVICE(device));
+    g_return_if_fail(property_s != NULL);
+    g_return_if_fail(value_s != NULL);
+
+    property_base = device_property_get_by_name(property_s);
+    if (property_base == NULL) {
+        /* Nonexistant property name. */
+        g_fprintf(stderr, _("Unknown device property name %s.\n"), property_s);
+        return;
+    }
+    
+    bzero(&property_value, sizeof(property_value));
+    g_value_init(&property_value, property_base->type);
+    if (!g_value_set_from_string(&property_value, value_s)) {
+        /* Value type could not be interpreted. */
+        g_fprintf(stderr,
+                _("Could not parse property value %s for property type %s.\n"),
+                value_s, g_type_name(property_base->type));
+        return;
+    } else {
+        g_assert (G_VALUE_HOLDS(&property_value, property_base->type));
+    }
+
+    if (!device_property_set(device, property_base->ID, &property_value)) {
+        /* Device rejects property. */
+        g_fprintf(stderr, _("Could not set property %s to %s on device %s.\n"),
+                property_base->name, value_s, device->device_name);
+        return;
+    }
+}
+
+/* Set up first-run properties, including DEVICE_MAX_VOLUME_USAGE property
+ * based on the tapetype. */
+void device_set_startup_properties_from_config(Device * device) {
+    char * tapetype_name = getconf_str(CNF_TAPETYPE);
+    if (tapetype_name != NULL) {
+        tapetype_t * tapetype = lookup_tapetype(tapetype_name);
+        if (tapetype != NULL) {
+            GValue val;
+            guint64 length;
+            guint blocksize_kb;
+            gboolean success;
+
+            bzero(&val, sizeof(GValue));
+
+            if (tapetype_seen(tapetype, TAPETYPE_LENGTH)) {
+               length = tapetype_get_length(tapetype);
+                g_value_init(&val, G_TYPE_UINT64);
+                g_value_set_uint64(&val, length * 1024);
+                /* If this fails, it's not really an error. */
+                device_property_set(device, PROPERTY_MAX_VOLUME_USAGE, &val);
+                g_value_unset(&val);
+            }
+
+            if (tapetype_seen(tapetype, TAPETYPE_READBLOCKSIZE)) {
+               blocksize_kb = tapetype_get_readblocksize(tapetype);
+                g_value_init(&val, G_TYPE_UINT);
+                g_value_set_uint(&val, blocksize_kb * 1024);
+                success = device_property_set(device,
+                                              PROPERTY_READ_BUFFER_SIZE,
+                                              &val);
+                g_value_unset(&val);
+                if (!success) {
+                    g_fprintf(stderr, "Setting READ_BUFFER_SIZE to %llu "
+                            "not supported for device %s.\n",
+                            1024*(long long unsigned int)blocksize_kb,
+                           device->device_name);
+                }
+            }
+
+            if (tapetype_seen(tapetype, TAPETYPE_BLOCKSIZE)) {
+               blocksize_kb = tapetype_get_blocksize(tapetype);
+                try_set_blocksize(device, blocksize_kb * 1024,
+                                  !tapetype_get_file_pad(tapetype));
+            }
+        }
+    }
+
+    g_hash_table_foreach(getconf_proplist(CNF_DEVICE_PROPERTY),
+                         set_device_property, device);
+}
+
+void device_clear_volume_details(Device * device) {
+    if (device == NULL || device->access_mode != ACCESS_NULL) {
+        return;
+    }
+
+    amfree(device->volume_label);
+    amfree(device->volume_time);
+}
+
+/* Here we put default implementations of virtual functions. Since
+   this class is virtual, many of these functions offer at best
+   incomplete functionality. But they do offer the useful commonality
+   that all devices can expect to need. */
+
+/* This function only updates access_mode, volume_label, and volume_time. */
+static gboolean
+default_device_start (Device * self, DeviceAccessMode mode, char * label,
+                      char * timestamp) {
+    if (mode != ACCESS_WRITE && self->volume_label == NULL) {
+        if (device_read_label(self) != READ_LABEL_STATUS_SUCCESS)
+            return FALSE;
+    } else if (mode == ACCESS_WRITE) {
+        self->volume_label = newstralloc(self->volume_label, label);
+        self->volume_time = newstralloc(self->volume_time, timestamp);
+    }
+    self->access_mode = mode;
+
+    return TRUE;
+}
+
+static gboolean default_device_open_device(Device * self,
+                                           char * device_name) {
+    DeviceProperty prop;
+    guint i;
+
+    self->device_name = stralloc(device_name);
+
+    prop.base = &device_property_canonical_name;
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+
+    for(i = 0; i < selfp->property_list->len; i ++) {
+        if (g_array_index(selfp->property_list,
+                          DeviceProperty, i).base->ID == prop.base->ID) {
+            return TRUE;
+        }
+    }
+    /* If we got here, the property was not registered. */
+    device_add_property(self, &prop, NULL);
+
+    return TRUE;
+}
+
+/* This default implementation does very little. */
+static gboolean
+default_device_finish (Device * self) {
+    self->access_mode = ACCESS_NULL;
+    return TRUE;
+}
+
+/* This function updates the file, in_file, and block attributes. */
+static gboolean
+default_device_start_file (Device * self,
+                           const dumpfile_t * jobInfo G_GNUC_UNUSED) {
+    self->in_file = TRUE;
+    if (self->file <= 0)
+        self->file = 1;
+    else
+        self->file ++;
+    self->block = 0;
+    return TRUE;
+}
+
+/* This function lies: It updates the block number and maybe calls
+   device_finish_file(), but returns FALSE. */
+static gboolean
+default_device_write_block(Device * self, guint size G_GNUC_UNUSED,
+                           gpointer data G_GNUC_UNUSED, gboolean last_block) {
+    self->block ++;
+    if (last_block)
+        device_finish_file(self);
+    return FALSE;
+}
+
+/* This function lies: It updates the block number, but returns
+   -1. */
+static int
+default_device_read_block(Device * self, gpointer buf G_GNUC_UNUSED,
+                          int * size G_GNUC_UNUSED) {
+    self->block ++;
+    return -1;
+}
+
+/* This function just updates the in_file field. */
+static gboolean
+default_device_finish_file(Device * self) {
+    self->in_file = FALSE;
+    return TRUE;
+}
+
+/* This function just updates the file number. */
+static dumpfile_t *
+default_device_seek_file(Device * self, guint file) {
+    self->in_file = TRUE;
+    self->file = file;
+    return NULL;
+}
+
+/* This function just updates the block number. */
+static gboolean
+default_device_seek_block(Device * self, guint64 block) {
+    self->block = block;
+    return TRUE;
+}
+
+/* This default implementation serves up static responses, and
+   implements a default response to the "canonical name" property. */
+
+static gboolean
+default_device_property_get(Device * self, DevicePropertyId ID,
+                            GValue * value) {
+    const PropertyResponse * resp;
+
+    resp = (PropertyResponse*)g_hash_table_lookup(selfp->property_response,
+                                                  GINT_TO_POINTER(ID));
+    if (resp == NULL) {
+        if (ID == PROPERTY_CANONICAL_NAME) {
+            g_value_unset_init(value, G_TYPE_STRING);
+            g_value_set_string(value, self->device_name);
+           return TRUE;
+        } else {
+            return FALSE;
+        }
+    }
+
+    g_value_unset_copy(&resp->response, value);
+
+    return TRUE;
+}
+
+static gboolean
+default_device_read_to_fd(Device *self, int fd) {
+    return do_consumer_producer_queue(device_read_producer,
+                                      self,
+                                      fd_write_consumer,
+                                      GINT_TO_POINTER(fd));
+}
+
+static gboolean
+default_device_write_from_fd(Device *self, int fd) {
+    return do_consumer_producer_queue(fd_read_producer,
+                                      GINT_TO_POINTER(fd),
+                                      device_write_consumer,
+                                      self);
+}
+
+/* XXX WARNING XXX
+ * All the functions below this comment are stub functions that do nothing
+ * but implement the virtual function table. Call these functions and they
+ * will do what you expect vis-a-vis virtual functions. But don't put code
+ * in them beyond error checking and VFT lookup. */
+
+gboolean 
+device_open_device (Device * self, char * device_name)
+{
+        DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+       g_return_val_if_fail (device_name != NULL, FALSE);
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->open_device)
+            return (*klass->open_device)(self,device_name);
+       else
+               return FALSE;
+}
+
+ReadLabelStatusFlags device_read_label(Device * self) {
+    DeviceClass * klass;
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail(IS_DEVICE(self), FALSE);
+    g_return_val_if_fail(self->access_mode == ACCESS_NULL, FALSE);
+
+    klass = DEVICE_GET_CLASS(self);
+    if (klass->read_label) {
+        return (klass->read_label)(self);
+    } else {
+        return ~ READ_LABEL_STATUS_SUCCESS;
+    }
+}
+
+gboolean
+device_finish (Device * self) {
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+
+        if (self->access_mode == ACCESS_NULL)
+            return TRUE;
+
+       klass = DEVICE_GET_CLASS(self);
+        if (klass->finish) {
+            return (*klass->finish)(self);
+        } else {
+            return FALSE;
+        }
+}
+
+/* For a good combination of synchronization and public simplicity,
+   this stub function does not take a timestamp, but the actual
+   implementation function does. We generate the timestamp here with
+   time(). */
+gboolean 
+device_start (Device * self, DeviceAccessMode mode,
+              char * label, char * timestamp)
+{
+       DeviceClass *klass;
+
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+        g_return_val_if_fail (mode != ACCESS_NULL, FALSE);
+        g_return_val_if_fail (mode != ACCESS_WRITE || label != NULL,
+                              FALSE);
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->start) {
+           char * local_timestamp = NULL;
+           gboolean rv;
+
+           /* fill in a timestamp if none was given */
+           if (mode == ACCESS_WRITE &&
+               get_timestamp_state(timestamp) == TIME_STATE_REPLACE) {
+               local_timestamp = timestamp = 
+                   get_proper_stamp_from_time(time(NULL));
+           }
+
+            rv = (*klass->start)(self, mode, label, timestamp);
+           amfree(local_timestamp);
+           return rv;
+        } else {
+            return FALSE;
+        }
+}
+
+gboolean
+device_write_block (Device * self, guint size, gpointer block,
+                    gboolean short_block)
+{
+    DeviceClass *klass;
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (IS_DEVICE (self), FALSE);
+    g_return_val_if_fail (size > 0, FALSE);
+    g_return_val_if_fail (short_block ||
+                          size >= device_write_min_size(self), FALSE);
+    g_return_val_if_fail (size <= device_write_max_size(self), FALSE);
+    g_return_val_if_fail (block != NULL, FALSE);
+    g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode),
+                          FALSE);
+
+    klass = DEVICE_GET_CLASS(self);
+    
+    if(klass->write_block)
+        return (*klass->write_block)(self,size, block, short_block);
+    else
+        return FALSE;
+}
+
+gboolean 
+device_write_from_fd (Device * self, int fd)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+       g_return_val_if_fail (fd >= 0, FALSE);
+        g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode),
+                              FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->write_from_fd)
+               return (*klass->write_from_fd)(self,fd);
+       else
+               return FALSE;
+}
+
+gboolean
+device_start_file (Device * self, const dumpfile_t * jobInfo) {
+    DeviceClass * klass;
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (IS_DEVICE (self), FALSE);
+    g_return_val_if_fail (!(self->in_file), FALSE);
+    g_return_val_if_fail (jobInfo != NULL, FALSE);
+
+    klass = DEVICE_GET_CLASS(self);
+    
+    if(klass->start_file)
+        return (*klass->start_file)(self, jobInfo );
+    else
+        return FALSE;
+}
+
+gboolean 
+device_finish_file (Device * self)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+        g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode),
+                              FALSE);
+        g_return_val_if_fail (self->in_file, FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->finish_file)
+               return (*klass->finish_file)(self);
+       else
+               return FALSE;
+}
+
+dumpfile_t*
+device_seek_file (Device * self, guint file)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, NULL);
+       g_return_val_if_fail (IS_DEVICE (self), NULL);
+        g_return_val_if_fail (self->access_mode == ACCESS_READ,
+                              NULL);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->seek_file)
+               return (*klass->seek_file)(self,file);
+       else
+               return FALSE;
+}
+
+gboolean 
+device_seek_block (Device * self, guint64 block)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+        g_return_val_if_fail (self->access_mode == ACCESS_READ,
+                              FALSE);
+        g_return_val_if_fail (self->in_file, FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->seek_block)
+               return (*klass->seek_block)(self,block);
+       else
+               return FALSE;
+}
+
+int
+device_read_block (Device * self, gpointer buffer, int * size)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, -1);
+       g_return_val_if_fail (IS_DEVICE (self), -1);
+       g_return_val_if_fail (size != NULL, -1);
+        g_return_val_if_fail (self->access_mode == ACCESS_READ, -1);
+        if (*size != 0) {
+            g_return_val_if_fail (buffer != NULL, -1);
+        }
+
+        /* Do a quick check here, so fixed-block subclasses don't have to. */
+        if (*size == 0 &&
+            device_write_min_size(self) == device_write_max_size(self)) {
+            *size = device_write_min_size(self);
+            return 0;
+        }
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->read_block)
+            return (*klass->read_block)(self,buffer,size);
+       else
+            return -1;
+}
+
+gboolean 
+device_read_to_fd (Device * self, int fd)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+       g_return_val_if_fail (fd >= 0, FALSE);
+        g_return_val_if_fail (self->access_mode == ACCESS_READ, FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->read_to_fd)
+               return (*klass->read_to_fd)(self,fd);
+       else
+               return FALSE;
+}
+
+
+gboolean 
+device_property_get (Device * self, DevicePropertyId id, GValue * val)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+        g_return_val_if_fail (device_property_get_by_id(id) != NULL, FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+        /* FIXME: Check access flags? */
+
+       if(klass->property_get)
+               return (*klass->property_get)(self,id,val);
+       else
+               return FALSE;
+}
+
+gboolean 
+device_property_set (Device * self, DevicePropertyId id, GValue * val)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+        /* FIXME: Check access flags? */
+
+       if(klass->property_set)
+               return (*klass->property_set)(self,id,val);
+       else
+               return FALSE;
+}
+
+gboolean 
+device_recycle_file (Device * self, guint filenum)
+{
+       DeviceClass *klass;
+       g_return_val_if_fail (self != NULL, FALSE);
+       g_return_val_if_fail (IS_DEVICE (self), FALSE);
+        g_return_val_if_fail (self->access_mode == ACCESS_APPEND, FALSE);
+
+       klass = DEVICE_GET_CLASS(self);
+
+       if(klass->recycle_file)
+               return (*klass->recycle_file)(self,filenum);
+       else
+               return FALSE;
+}
+
diff --git a/device-src/device.h b/device-src/device.h
new file mode 100644 (file)
index 0000000..e01efdc
--- /dev/null
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The Device API abstracts device workings, interaction, properties, and
+ * capabilities from the rest of the Amanda code base. It supports
+ * pluggable modules for different kinds of devices. */
+
+#ifndef DEVICE_H
+#define DEVICE_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "property.h"
+#include "fileheader.h"
+
+/* Device API version. */
+#define DEVICE_API_VERSION 0
+
+extern void device_api_init(void);
+
+/* Different access modes */
+typedef enum {
+    ACCESS_NULL, /* Device is not yet opened. */
+    ACCESS_READ,
+    ACCESS_WRITE,
+    ACCESS_APPEND
+} DeviceAccessMode;
+
+#define IS_WRITABLE_ACCESS_MODE(mode) ((mode) == ACCESS_WRITE || \
+                                       (mode) == ACCESS_APPEND)
+
+/* Device object definition follows. */
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_DEVICE    (device_get_type())
+#define DEVICE(obj)    G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device)
+#define DEVICE_CONST(obj)      G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device const)
+#define DEVICE_CLASS(klass)    G_TYPE_CHECK_CLASS_CAST((klass), device_get_type(), DeviceClass)
+#define IS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), device_get_type ())
+
+#define DEVICE_GET_CLASS(obj)  G_TYPE_INSTANCE_GET_CLASS((obj), device_get_type(), DeviceClass)
+
+typedef struct DevicePrivate_s DevicePrivate;
+
+/*
+ * Main object structure
+ */
+typedef struct {
+    GObject __parent__;
+
+    /* You can peek at the stuff below, but only subclasses should
+       change these values.*/
+
+    /* What file, block are we at? (and are we in the middle of a
+     * file?) This is automatically updated by
+     * the default implementations of start_file, finish_file,
+     * write_block, read_block, seek_file, and seek_block. */
+    int file;
+    guint64 block;
+    gboolean in_file;
+    /* Holds the user-specified device name. */
+    char * device_name;
+    /* Holds the user-specified access-mode. */
+    DeviceAccessMode access_mode;
+    /* In reading mode, FALSE unless all the data from the current file
+     * was successfully read. */
+    gboolean is_eof;
+    /* Holds the label and time of the currently-inserted volume,
+     * or NULL if it has not been read/written yet. */
+    char * volume_label;
+    char * volume_time;
+
+    DevicePrivate * private;
+} Device;
+
+/* Pointer to factory function for device types. The factory functions
+   take control of their arguments, which should be dynamically
+   allocated. The factory should call open_device() with this
+   device_name. */
+typedef Device* (*DeviceFactory)(char * device_type,
+                                 char * device_name);
+
+/* This function registers a new device with the allocation system.
+ * Call it after you register your type with the GLib type system.
+ * This function takes ownership of the strings inside device_prefix_list,
+ * but not the device_prefix_list itself. */
+extern void register_device(DeviceFactory factory,
+                            const char ** device_prefix_list);
+
+/* This structure is a Flags (bitwise OR of values). Zero indicates success;
+ * any other value indicates some kind of problem reading the label. If
+ * multiple bits are set, it does not necessarily indicate that /all/ of
+ * the specified issues occured, but rather that /at least one/ did. */
+typedef enum {
+    /* When changing, Also update read_label_status_flags_values in device.c */
+    READ_LABEL_STATUS_SUCCESS          = 0,
+    READ_LABEL_STATUS_DEVICE_MISSING   = (1 << 0),
+    READ_LABEL_STATUS_DEVICE_ERROR     = (1 << 1),
+    READ_LABEL_STATUS_VOLUME_MISSING   = (1 << 2),
+    READ_LABEL_STATUS_VOLUME_UNLABELED = (1 << 3),
+    READ_LABEL_STATUS_VOLUME_ERROR     = (1 << 4),
+    READ_LABEL_STATUS_FLAGS_MAX              = (1 << 5)
+} ReadLabelStatusFlags;
+
+#define READ_LABEL_STATUS_FLAGS_MASK (READ_LABEL_STATUS_MAX-1)
+#define READ_LABEL_STATUS_FLAGS_TYPE (read_label_status_flags_get_type())
+GType read_label_status_flags_get_type(void);
+
+/*
+ * Class definition
+ */
+typedef struct _DeviceClass DeviceClass;
+struct _DeviceClass {
+    GObjectClass __parent__;
+    gboolean (* open_device) (Device * self,
+                              char * device_name); /* protected */
+    ReadLabelStatusFlags (* read_label)(Device * self);
+    gboolean (* start) (Device * self, DeviceAccessMode mode,
+                        char * label, char * timestamp);
+    gboolean (* start_file) (Device * self, const dumpfile_t * info);
+    gboolean (* write_block) (Device * self, guint size, gpointer data,
+                              gboolean last_block);
+    gboolean (* write_from_fd) (Device * self, int fd);
+    gboolean (* finish_file) (Device * self);
+    dumpfile_t* (* seek_file) (Device * self, guint file);
+    gboolean (* seek_block) (Device * self, guint64 block);
+    gboolean (* read_block) (Device * self, gpointer buf, int * size);
+    gboolean (* read_to_fd) (Device * self, int fd);
+    gboolean (* property_get) (Device * self, DevicePropertyId id,
+                               GValue * val);
+    gboolean (* property_set) (Device * self, DevicePropertyId id,
+                               GValue * val);
+    gboolean (* recycle_file) (Device * self, guint filenum);
+    gboolean (* finish) (Device * self);
+};
+
+
+/*
+ * Public methods
+ *
+ * Note to implementors: The default implementation of many of these
+ * methods does not follow the documentation. For example, the default
+ * implementation of device_read_block will always return -1, but
+ * nonetheless update the block index in the Device structure. In
+ * general, it is OK to chain up to the default implmentation after
+ * successfully implementing whatever appears below. The particulars
+ * of what the default implementations do is documented in device.c.
+ */
+GType  device_get_type (void);
+
+/* This is how you get a new Device. Pass in a device name like
+ * file:/path/to/storage, and (assuming everything goes OK) you will get
+ * back a nice happy Device* that you can do operations on. Note that you
+ * must device_start() it before you can do anything besides talk about
+ * properties or read the label. device_name remains the responsibility
+ * of the caller. */
+Device*        device_open     (char * device_name);
+
+/* This instructs the device to read the label on the current
+ * volume. device->volume_label will not be initalized until after this
+ * is called. You are encouraged to read the label only after setting any
+ * properties that may affect the label-reading process. */
+ReadLabelStatusFlags        device_read_label (Device * self);
+
+/* This tells the Device that it's OK to start reading and writing
+ * data. Before you call this, you can only call
+ * device_property_{get, set} and device_read_label. You can only call
+ * this a second time if you call device_finish() first.
+ *
+ * You should pass a label and timestamp if and only if you are
+ * opening in WRITE mode (not READ or APPEND). The label and timestamp
+ * remain the caller's responsibility in terms of memory management. The
+ * passed timestamp may be NULL, in which case it will be filled in with 
+ * the current time. */
+gboolean       device_start    (Device * self,
+                                 DeviceAccessMode mode, char * label,
+                                 char * timestamp);
+
+/* This undoes device_start, returning you to the NULL state. Do this
+ * if you want to (for example) change access mode.
+ * 
+ * Note to subclass implementors: Call this function first from your
+ * finalization function. */
+gboolean       device_finish   (Device * self);
+
+/* But you can't write any data until you call this function, too.
+ * This function does not take ownership of the passed dumpfile_t; you must
+ * free it yourself. */
+gboolean        device_start_file       (Device * self,
+                                         const dumpfile_t * jobInfo);
+
+guint           device_write_min_size   (Device * self);
+guint           device_write_max_size   (Device * self);
+guint           device_read_max_size   (Device * self);
+
+/* Does what you expect. size had better be inside the block size
+ * range, or this function will write nothing.
+ *
+ * The short_block parameter needs some additional explanation: If
+ * short_block is set to TRUE, then this function will accept a write
+ * smaller than the minimum block size, subject to the following
+ * caveats:
+ * % The block may be padded with NULL bytes, which will be present on
+ *   restore.
+ * % device_write_block will automatically call device_finish_file()
+ *   after writing this short block.
+ * It is permitted to use short_block with a block that is not short;
+ * in this case, it is equivalent to calling device_write() and then
+ * calling device_finish_file(). */
+gboolean       device_write_block      (Device * self,
+                                         guint size,
+                                         gpointer data,
+                                         gboolean short_block);
+
+/* This will drain the given fd (reading until EOF), and write the
+ * resulting data out to the device using maximally-sized blocks. */
+gboolean       device_write_from_fd    (Device * self,
+                                       int fd);
+
+/* Call this when you are finished writing a file. This function will
+ * write a filemark or the local equivalent, flush the buffers, and do
+ * whatever dirty work needs to be done at such a point in time. */
+gboolean       device_finish_file      (Device * self);
+
+/* For reading only: Seeks to the beginning of a particular
+ * filemark. Only do this when reading; opening in
+ * ACCESS_WRITE will start you out at the first file, and opening in
+ * ACCESS_APPEND will automatically seek to the end of the medium.
+ * 
+ * If the requested file doesn't exist, this function will seek to the
+ * next-numbered valid file. You can check where this function seeked to
+ * by examining the file field of the Device structure. If the requested
+ * file number is exactly one more than the last valid file, this
+ * function returns a TAPEEND header.
+ *
+ * If an error occurs or if the requested file is two or more beyond the
+ * last valid file, this function returns NULL.
+ *
+ * Example results for a volume that has only files 1 and 3:
+ * 1 -> Seeks to file 1
+ * 2 -> Seeks to file 3
+ * 3 -> Seeks to file 3
+ * 4 -> Returns TAPEEND
+ * 5 -> Returns NULL
+ *
+ * The returned dumpfile_t is yours to keep, at no extra charge. */
+dumpfile_t*    device_seek_file        (Device * self,
+                                       guint file);
+
+/* After you have called device_seek_file (and /only/ after having
+ * called device_seek_file), you can call this to seek to a particular
+ * block inside the file. It works like SEEK_SET, only in blocks. */
+gboolean       device_seek_block       (Device * self,
+                                       guint64 block);
+
+/* After you have called device_seek_file and/or device_seek_block,
+ * you can start calling this function. It always reads exactly one whole
+ * block at a time, however big that might be. You must pass in a buffer and
+ * specify its size. If the buffer is big enough, the read is
+ * performed, and both *size and the return value are equal to the
+ * number of bytes actually read. If the buffer is not big enough, then
+ * no read is performed, the function returns 0, and *size is set
+ * to the minimum buffer size required to read the next block. If an
+ * error occurs, the function returns -1  and *size is left unchanged.
+ * 
+ * It is not an error if buffer == NULL and *size == 0. This should be
+ * treated as a query as to the possible size of the next block. */
+int    device_read_block       (Device * self,
+                                 gpointer buffer,
+                                 int * size);
+
+/* This is the reading equivalent of device_write_from_fd(). It will
+ * read from the device from the current location until end of file,
+ * and drains the results out into the specified fd. Returns FALSE if
+ * there is a problem writing to the fd. */
+gboolean       device_read_to_fd       (Device * self,
+                                       int fd);
+
+/* This function tells you what properties are supported by this
+ * device, and when you are allowed to get and set them. The return
+ * value is an array of DeviceProperty structs. The last struct in
+ * the array is zeroed, so you know when the end is (check the
+ * pointer element "base"). The return value from this function on any
+ * given object (or physical device) should be invariant. */
+const DeviceProperty *         device_property_get_list        (Device * self);
+
+/* These functions get or set a particular property. The val should be
+ * compatible with the DevicePropertyBase associated with the given
+ * DevicePropertyId, and this function should only be called when
+ * DeviceProperty.access says it is OK. Otherwise you will get an
+ * error and not the tasty property action you wanted. */
+gboolean       device_property_get     (Device * self,
+                                         DevicePropertyId id,
+                                         GValue * val);
+gboolean       device_property_set     (Device * self,
+                                         DevicePropertyId id,
+                                         GValue * val);
+
+/* On devices that support it (check PROPERTY_PARTIAL_DELETION),
+ * this will free only the space associated with a particular file. 
+ * This way, you can apply a different retention policy to every file
+ * on the volume, appending new data at the end and recycling anywhere
+ * in the middle -- even simultaneously (via different Device
+ * handles)! Note that you generally can't recycle a file that is presently in
+ * use (being read or written).
+ *
+ * To use this, open the device as DEVICE_MODE_APPEND. But you don't
+ * have to call device_start_file(), unless you want to write some
+ * data, too. */
+gboolean       device_recycle_file     (Device * self,
+                                       guint filenum);
+
+/* Protected methods. Don't call these except in subclass implementations. */
+
+/* Registers a new device / property pair. Every superclass of Device
+ * should call this in its init() function. At the moment, any
+ * particular property Id can only be registered once per object.
+ *
+ * If you want to register a standard response to a property (e.g.,
+ * whether or not the device supports compression), you can pass a
+ * non-NULL response. Then the default implementation of
+ * device_get_property (which you may override) will return this
+ * response.
+ * The contents of prop and response are copied into a private array, so the
+ * calling function retains ownership of all arguments.
+ */
+void            device_add_property(Device * self, DeviceProperty * prop,
+                                    GValue * response);
+
+/* This method provides post-construction initalization once the
+ * device name is known. It should only be used by Device
+ * factories. It is provided here as a virtual method (instead of
+ * a static function) because some devices may want to chain
+ * initilization to their parents. */
+gboolean device_open_device (Device * self,
+                             char * device_name);
+
+/* Builds a proper header based on device block size possibilities.
+ * If non-null, size is filled in with the number of bytes that should
+ * be written.
+ * If non-null, oneblock is filled in with TRUE if the header will fit
+ * in a single Device block (FALSE otherwise). */
+char * device_build_amanda_header(Device * self, const dumpfile_t * jobinfo,
+                                  int * size, gboolean * oneblock);
+
+/* Does what you expect. You have to free the returned header. Ensures
+   that self->volume_time matches the header written to tape. */
+dumpfile_t * make_tapestart_header(Device * self, char * label,
+                                   char * timestamp);
+
+/* Does what you expect. Uses the current time. */
+dumpfile_t * make_tapeend_header(void);
+
+/* Set up first-run properties from loaded configuration file, including
+ * DEVICE_MAX_VOLUME_USAGE property based on the tapetype. */
+void device_set_startup_properties_from_config(Device * device);
+
+/* Erase any stored volume information. Use this if something happens (e.g.,
+ * a property is set) that voids previously-read volume details.
+ * This function is a NOOP unless the device is in the NULL state. */
+void device_clear_volume_details(Device * device);
+
+#endif /* DEVICE_H */
diff --git a/device-src/null-device.c b/device-src/null-device.c
new file mode 100644 (file)
index 0000000..a6b1a02
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amanda.h"
+#include "device.h"
+#include "null-device.h"
+
+#define NULL_DEVICE_MIN_BLOCK_SIZE (1)
+#define NULL_DEVICE_MAX_BLOCK_SIZE SHRT_MAX
+
+/* here are local prototypes */
+static void null_device_init (NullDevice * o);
+static void null_device_class_init (NullDeviceClass * c);
+static gboolean null_device_start (Device * self, DeviceAccessMode mode,
+                                   char * label, char * timestamp);
+static gboolean null_device_write_block (Device * self, guint size,
+                                         gpointer data, gboolean last);
+static Device* null_device_factory(char * device_type,
+                                   char * device_name);
+
+/* pointer to the class of our parent */
+static DeviceClass *parent_class = NULL;
+
+void null_device_register(void) {
+    static const char * device_prefix_list[] = { "null", NULL };
+    register_device(null_device_factory, device_prefix_list);
+}
+
+GType
+null_device_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (NullDeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) null_device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (NullDevice),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) null_device_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TYPE_DEVICE, "NullDevice", &info,
+                                       (GTypeFlags)0);
+    }
+
+    return type;
+}
+
+static void 
+null_device_init (NullDevice * self)
+{
+    Device * o;
+    DeviceProperty prop;
+    GValue response;
+
+    o = (Device*)(self);
+    bzero(&response, sizeof(response));
+
+    /* Register properties */
+    prop.base = &device_property_concurrency;
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+    g_value_init(&response, CONCURRENCY_PARADIGM_TYPE);
+    g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+
+    prop.base = &device_property_streaming;
+    g_value_init(&response, STREAMING_REQUIREMENT_TYPE);
+    g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.base = &device_property_block_size;
+    g_value_init(&response, G_TYPE_INT);
+    g_value_set_int(&response, -1);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.base = &device_property_min_block_size;
+    g_value_init(&response, G_TYPE_UINT);
+    g_value_set_uint(&response, NULL_DEVICE_MIN_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_max_block_size;
+    g_value_set_uint(&response, NULL_DEVICE_MAX_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_appendable;
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, FALSE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_partial_deletion;
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_canonical_name;
+    g_value_init(&response, G_TYPE_STRING);
+    g_value_set_static_string(&response, "null:");
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_medium_access_type;
+    g_value_init(&response, MEDIA_ACCESS_MODE_TYPE);
+    g_value_set_enum(&response, MEDIA_ACCESS_MODE_WRITE_ONLY);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+}
+
+static void 
+null_device_class_init (NullDeviceClass * c G_GNUC_UNUSED)
+{
+    DeviceClass *device_class = (DeviceClass *)c;
+
+    parent_class = g_type_class_ref (TYPE_DEVICE);
+
+    device_class->start = null_device_start;
+    device_class->write_block = null_device_write_block;
+}
+
+
+static Device* null_device_factory(char * device_type,
+                                   char * device_name G_GNUC_UNUSED) {
+    g_assert(0 == strcmp(device_type, "null"));
+    return DEVICE(g_object_new(TYPE_NULL_DEVICE, NULL));
+    
+}
+
+/* Begin virtual function overrides */
+
+static gboolean 
+null_device_start (Device * pself, DeviceAccessMode mode,
+                   char * label, char * timestamp) {
+    NullDevice * self;
+    self = NULL_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+
+    if (mode == ACCESS_WRITE) {
+        if (parent_class->start) {
+            return parent_class->start((Device*)self, mode, label, timestamp);
+        } else {
+            return TRUE;
+        }
+    } else {
+        g_fprintf(stderr, "Can't open NULL device for reading or appending.\n");
+        return FALSE;
+    }
+}
+
+static gboolean
+null_device_write_block (Device * pself, guint size, gpointer data,
+                         gboolean last_block) {
+    NullDevice * self;
+    self = NULL_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (data != NULL, FALSE);
+    
+    if ((size < NULL_DEVICE_MIN_BLOCK_SIZE && !last_block) ||
+        size > NULL_DEVICE_MAX_BLOCK_SIZE) {
+        return FALSE;
+    } else {
+        if (parent_class->write_block) {
+            /* Calls device_finish_file(). */
+            parent_class->write_block((Device*)self, size, data, last_block);
+        }
+        return TRUE;
+    }
+
+    g_assert_not_reached();
+}
diff --git a/device-src/null-device.h b/device-src/null-device.h
new file mode 100644 (file)
index 0000000..b68a824
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The NULL device accepts data and sends it to the bit bucket. Like
+   /dev/null, you cannot read from the NULL device -- only
+   write. While useful for testing, the NULL device is incredibly
+   dangerous in practice (because it eats your data). So it will
+   generate warnings whenever you use it. */
+
+#include <glib.h>
+#include <glib-object.h>
+#ifndef __NULL_DEVICE_H__
+#define __NULL_DEVICE_H__
+
+/* This header file is very boring, because the class just overrides
+   existing methods. */
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_NULL_DEVICE       (null_device_get_type())
+#define NULL_DEVICE(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice)
+#define NULL_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice const)
+#define NULL_DEVICE_CLASS(klass)       G_TYPE_CHECK_CLASS_CAST((klass), null_device_get_type(), NullDeviceClass)
+#define IS_NULL_DEVICE(obj)    G_TYPE_CHECK_INSTANCE_TYPE((obj), null_device_get_type ())
+
+#define NULL_DEVICE_GET_CLASS(obj)     G_TYPE_INSTANCE_GET_CLASS((obj), null_device_get_type(), NullDeviceClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_NULL_DEVICE__
+#define __TYPEDEF_NULL_DEVICE__
+typedef struct _NullDevice NullDevice;
+#endif
+struct _NullDevice {
+       Device __parent__;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _NullDeviceClass NullDeviceClass;
+struct _NullDeviceClass {
+    DeviceClass __parent__;
+    gboolean in_file;
+};
+
+
+/*
+ * Public methods
+ */
+GType  null_device_get_type    (void);
+void    null_device_register    (void);
+
+#endif
diff --git a/device-src/property.c b/device-src/property.c
new file mode 100644 (file)
index 0000000..3980a3f
--- /dev/null
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amanda.h"
+
+#include "property.h"
+
+static const GEnumValue _concurrency_paradigm_values[] = {
+        { CONCURRENCY_PARADIGM_EXCLUSIVE,
+          "CONCURRENCY_PARADIGM_EXCLUSIVE",
+          "exclusive" },
+        { CONCURRENCY_PARADIGM_SHARED_READ, 
+          "CONCURRENCY_PARADIGM_SHARED_READ",
+          "shared-read" },
+        { CONCURRENCY_PARADIGM_RANDOM_ACCESS,
+          "CONCURRENCY_PARADIGM_RANDOM_ACCESS",
+          "random-access" },
+        { 0, NULL, NULL }
+};
+
+GType concurrency_paradigm_get_type (void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_enum_register_static ("ConcurrencyParadigm",
+                                       _concurrency_paradigm_values);
+    }
+    return type;
+}
+
+static const GEnumValue _streaming_requirement_values[] = {
+        { STREAMING_REQUIREMENT_NONE,
+          "STREAMING_REQUIREMENT_NONE",
+          "none" },
+        { STREAMING_REQUIREMENT_DESIRED,
+          "STREAMING_REQUIREMENT_DESIRED",
+          "desired" },
+        { STREAMING_REQUIREMENT_REQUIRED,
+          "STREAMING_REQUIREMENT_REQUIRED",
+          "required" },
+        { 0, NULL, NULL }
+};
+
+GType streaming_requirement_get_type (void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_enum_register_static ("StreamingRequirement",
+                                       _streaming_requirement_values);
+    }
+    return type;
+}
+
+static const GEnumValue _media_access_mode_values[] = {
+        { MEDIA_ACCESS_MODE_READ_ONLY,
+          "MEDIA_ACCESS_MODE_READ_ONLY",
+          (char *)"read-only" },
+        { MEDIA_ACCESS_MODE_WORM,
+          "MEDIA_ACCESS_MODE_WORM",
+          (char *)"write-once-read-many" },
+        { MEDIA_ACCESS_MODE_READ_WRITE,
+          "MEDIA_ACCESS_MODE_READ_WRITE",
+          (char *)"read-write" },
+        { MEDIA_ACCESS_MODE_WRITE_ONLY,
+          "MEDIA_ACCESS_MODE_WRITE_ONLY",
+          (char *)"write-many-read-never" },
+        { 0, NULL, NULL }
+};
+
+GType media_access_mode_get_type (void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_enum_register_static ("MediaAccessMode",
+                                       _media_access_mode_values);
+    }
+    return type;
+}
+
+/* Copy function for GBoxed QualifiedSize. */
+static gpointer qualified_size_copy(gpointer source) {
+    gpointer rval = malloc(sizeof(QualifiedSize));
+    memcpy(rval, source, sizeof(QualifiedSize));
+    return rval;
+}
+
+GType qualified_size_get_type (void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_boxed_type_register_static ("QualifiedSize",
+                                             qualified_size_copy,
+                                             free);
+    }
+    return type;
+}
+
+static const GFlagsValue _feature_support_flags_values[] = {
+    { FEATURE_STATUS_ENABLED,
+      "FEATURE_STATUS_ENABLED",
+      "enabled" },
+    { FEATURE_STATUS_DISABLED,
+      "FEATURE_STATUS_DISABLED",
+      "disabled" },
+    { FEATURE_SURETY_BAD,
+      "FEATURE_SURETY_BAD",
+      "bad" },
+    { FEATURE_SURETY_GOOD,
+      "FEATURE_SURETY_GOOD",
+      "good" },
+    { FEATURE_SOURCE_DEFAULT,
+      "FEATURE_SOURCE_DEFAULT",
+      "default" },
+    { FEATURE_SOURCE_DETECTED,
+      "FEATURE_SOURCE_DETECTED",
+      "detected" },
+    { FEATURE_SOURCE_USER,
+      "FEATURE_SOURCE_USER",
+      "user"},
+    { 0, NULL, NULL }
+};
+
+GType feature_support_get_type (void) {
+    static GType type = 0;
+    if (G_UNLIKELY(type == 0)) {
+        type = g_flags_register_static ("FeatureSupportFlags",
+                                        _feature_support_flags_values);
+    }
+    return type;
+}
+
+gboolean feature_support_flags_is_valid(FeatureSupportFlags f) {
+    int status = 0, surety = 0, source = 0;
+
+    if (f & FEATURE_STATUS_ENABLED)
+        status ++;
+    if (f & FEATURE_STATUS_DISABLED)
+        status ++;
+    if (f & FEATURE_SURETY_BAD)
+        surety ++;
+    if (f & FEATURE_SURETY_GOOD)
+        surety ++;
+    if (f & FEATURE_SOURCE_DEFAULT)
+        source ++;
+    if (f & FEATURE_SOURCE_DETECTED)
+        source ++;
+    if (f & FEATURE_SOURCE_USER)
+        source ++;
+
+    return (!(f & ~FEATURE_SUPPORT_FLAGS_MASK) &&
+            status == 1  &&  surety == 1  &&  source == 1);
+}
+
+static GSList* device_property_base_list = NULL;
+
+const DevicePropertyBase* device_property_get_by_id(DevicePropertyId id) {
+    GSList *iter;
+
+    iter = device_property_base_list;
+    while (iter != NULL) {
+        DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data);
+        if (rval->ID == id) {
+            return rval;
+        }
+        iter = g_slist_next(iter);
+    }
+
+    return NULL;
+}
+
+const DevicePropertyBase* device_property_get_by_name(const char *name) {
+    GSList *iter = device_property_base_list;
+
+    g_return_val_if_fail(name != NULL, NULL);
+
+    while (iter != NULL) {
+        DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data);
+        if (strcasecmp(rval->name, name) == 0) {
+            return rval;
+        }
+        iter = g_slist_next(iter);
+    }
+
+    return NULL;
+}
+
+DevicePropertyId device_property_register(DevicePropertyBase* base) {
+    static guint id = 0;
+    g_assert(base != NULL);
+    g_assert(base->ID == -1);
+    g_assert(base->name != NULL);
+    g_assert(base->description != NULL);
+    
+    base->ID = id++;
+
+    device_property_base_list = g_slist_prepend(device_property_base_list,
+                                                base);
+    return id;
+}
+
+/* Does the same thing, but fills in a new DevicePropertyBase. */
+static void
+device_property_fill_and_register(DevicePropertyBase * base,
+                                  GType type,
+                                  const char * name,
+                                  const char * desc) {
+    base->type = type;
+    base->name = name;
+    base->description = desc;
+    base->ID = -1;
+    device_property_register(base);
+}
+
+
+void device_property_init(void) {
+    device_property_fill_and_register(&device_property_concurrency,
+                                      CONCURRENCY_PARADIGM_TYPE, "concurrency",
+      "Supported concurrency mode (none, multiple readers, multiple writers)");
+    device_property_fill_and_register(&device_property_streaming,
+                                      STREAMING_REQUIREMENT_TYPE, "streaming",
+      "Streaming desirability (unnecessary, desired, required)");
+    device_property_fill_and_register(&device_property_compression,
+                                      G_TYPE_BOOLEAN, "compression",
+      "Is device performing data compression?");
+    device_property_fill_and_register(&device_property_compression_rate,
+                                      G_TYPE_DOUBLE, "compression_rate",
+      "Compression rate, "
+          "averaged for some (currently undefined) period of time)");
+    device_property_fill_and_register(&device_property_block_size,
+                                      G_TYPE_INT, "block_size",
+                                      "Device blocking factor in bytes.");
+    device_property_fill_and_register(&device_property_min_block_size,
+                                      G_TYPE_UINT, "min_block_size",
+      "Minimum supported blocking factor.");
+    device_property_fill_and_register(&device_property_max_block_size,
+                                      G_TYPE_UINT, "max_block_size",
+      "Maximum supported blocking factor.");
+    device_property_fill_and_register(&device_property_appendable,
+                                      G_TYPE_BOOLEAN, "appendable",
+      "Does device support appending to previously-written media?");
+    device_property_fill_and_register(&device_property_canonical_name,
+                                      G_TYPE_STRING, "canonical_name",
+      "The most reliable device name to use to refer to this device.");
+    device_property_fill_and_register(&device_property_medium_access_type,
+                                      MEDIA_ACCESS_MODE_TYPE,
+                                      "medium_access_type",
+      "What kind of media (RO/WORM/RW/WORN) do we have here?");
+    device_property_fill_and_register(&device_property_partial_deletion,
+                                     G_TYPE_BOOLEAN, "partial_deletion",
+      "Does this device support recycling just part of a volume?" );
+    device_property_fill_and_register(&device_property_free_space,
+                                      QUALIFIED_SIZE_TYPE, "free_space",
+      "Remaining capacity of the device.");
+    device_property_fill_and_register(&device_property_max_volume_usage,
+                                      G_TYPE_UINT64, "max_volume_usage",
+      "Artificial limit to data written to volume.");
+    device_property_fill_and_register(&device_property_fsf,
+                                      FEATURE_SUPPORT_FLAGS_TYPE, "fsf",
+      "Does this drive support the MTFSF command?");
+    device_property_fill_and_register(&device_property_bsf,
+                                      FEATURE_SUPPORT_FLAGS_TYPE, "bsf",
+      "Does this drive support the MTBSF command?" );
+    device_property_fill_and_register(&device_property_fsr,
+                                      FEATURE_SUPPORT_FLAGS_TYPE, "fsr",
+      "Does this drive support the MTFSR command?");
+    device_property_fill_and_register(&device_property_bsr,
+                                      FEATURE_SUPPORT_FLAGS_TYPE, "bsr",
+      "Does this drive support the MTBSR command?");
+    /* FIXME: Is this feature even useful? */
+    device_property_fill_and_register(&device_property_eom,
+                                      FEATURE_SUPPORT_FLAGS_TYPE, "eom",
+      "Does this drive support the MTEOM command?");
+    device_property_fill_and_register(&device_property_bsf_after_eom,
+                                      FEATURE_SUPPORT_FLAGS_TYPE,
+                                      "bsf_after_eom",
+      "Does this drive require an MTBSF after MTEOM in order to append?" );
+    device_property_fill_and_register(&device_property_final_filemarks,
+                                      G_TYPE_UINT, "final_filemarks",
+      "How many filemarks to write after the last tape file?" );
+    device_property_fill_and_register(&device_property_read_buffer_size,
+                                      G_TYPE_UINT, "read_buffer_size",
+      "What buffer size should be used for reading?");
+    device_property_fill_and_register(&device_property_s3_secret_key,
+                                      G_TYPE_STRING, "s3_secret_key",
+       "Secret access key to authenticate with Amazon S3");
+    device_property_fill_and_register(&device_property_s3_access_key,
+                                      G_TYPE_STRING, "s3_access_key",
+       "Access key ID to authenticate with Amazon S3");
+#ifdef WANT_DEVPAY
+    device_property_fill_and_register(&device_property_s3_user_token,
+                                      G_TYPE_STRING, "s3_user_token",
+       "User token for authentication Amazon devpay requests");
+#endif
+    device_property_fill_and_register(&device_property_verbose,
+                                     G_TYPE_BOOLEAN, "verbose",
+       "Should the device produce verbose output?");
+}
+
+DevicePropertyBase device_property_concurrency;
+DevicePropertyBase device_property_streaming;
+DevicePropertyBase device_property_compression;
+DevicePropertyBase device_property_compression_rate;
+DevicePropertyBase device_property_block_size;
+DevicePropertyBase device_property_min_block_size;
+DevicePropertyBase device_property_max_block_size;
+DevicePropertyBase device_property_appendable;
+DevicePropertyBase device_property_canonical_name;
+DevicePropertyBase device_property_medium_access_type;
+DevicePropertyBase device_property_partial_deletion;
+DevicePropertyBase device_property_free_space;
+DevicePropertyBase device_property_max_volume_usage;
+DevicePropertyBase device_property_fsf;
+DevicePropertyBase device_property_bsf;
+DevicePropertyBase device_property_fsr;
+DevicePropertyBase device_property_bsr;
+DevicePropertyBase device_property_eom;
+DevicePropertyBase device_property_bsf_after_eom;
+DevicePropertyBase device_property_final_filemarks;
+DevicePropertyBase device_property_read_buffer_size;
+DevicePropertyBase device_property_s3_access_key;
+DevicePropertyBase device_property_s3_secret_key;
+DevicePropertyBase device_property_s3_user_token;
+DevicePropertyBase device_property_verbose;
diff --git a/device-src/property.h b/device-src/property.h
new file mode 100644 (file)
index 0000000..8138a05
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef DEVICE_PROPERTY_H
+#define DEVICE_PROPERTY_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+/* The properties interface defines define capabilities and other interesting
+ * properties. */
+
+typedef enum {
+    PROPERTY_PHASE_BEFORE_START       = (1 << 0),
+    PROPERTY_PHASE_BETWEEN_FILE_WRITE = (1 << 1),
+    PROPERTY_PHASE_INSIDE_FILE_WRITE  = (1 << 2),
+    PROPERTY_PHASE_BETWEEN_FILE_READ  = (1 << 3),
+    PROPERTY_PHASE_INSIDE_FILE_READ   = (1 << 4),
+    PROPERTY_PHASE_MAX                = (1 << 5)
+} PropertyPhaseFlags;
+
+#define PROPERTY_PHASE_MASK (PROPERTY_PHASE_MAX-1)
+#define PROPERTY_PHASE_SHIFT (PROPERTY_PHASE_MASK/2)
+
+typedef enum {
+    PROPERTY_ACCESS_GET_BEFORE_START = (PROPERTY_PHASE_BEFORE_START),
+    PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE =
+        (PROPERTY_PHASE_BETWEEN_FILE_WRITE),
+    PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE = (PROPERTY_PHASE_INSIDE_FILE_WRITE),
+    PROPERTY_ACCESS_GET_BETWEEN_FILE_READ =
+        (PROPERTY_PHASE_BETWEEN_FILE_READ),
+    PROPERTY_ACCESS_GET_INSIDE_FILE_READ = (PROPERTY_PHASE_INSIDE_FILE_READ),
+
+    PROPERTY_ACCESS_SET_BEFORE_START =
+        (PROPERTY_PHASE_BEFORE_START << PROPERTY_PHASE_SHIFT),
+    PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE =
+        (PROPERTY_PHASE_BETWEEN_FILE_WRITE << PROPERTY_PHASE_SHIFT),
+    PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE =
+        (PROPERTY_PHASE_INSIDE_FILE_WRITE << PROPERTY_PHASE_SHIFT),
+    PROPERTY_ACCESS_SET_BETWEEN_FILE_READ =
+        (PROPERTY_PHASE_BETWEEN_FILE_READ << PROPERTY_PHASE_SHIFT),
+    PROPERTY_ACCESS_SET_INSIDE_FILE_READ =
+        (PROPERTY_PHASE_INSIDE_FILE_READ << PROPERTY_PHASE_SHIFT)
+} PropertyAccessFlags;
+
+#define PROPERTY_ACCESS_GET_MASK (PROPERTY_PHASE_MASK)
+#define PROPERTY_ACCESS_SET_MASK (PROPERTY_PHASE_MASK << PROPERTY_PHASE_SHIFT)
+
+
+/* This structure is usually statically allocated.
+ * It holds information about a property that is common to all devices of
+ * a given type. */
+
+typedef int DevicePropertyId;
+
+typedef struct {
+    DevicePropertyId ID; /* Set by device_property_register() */
+    GType type;
+    const char *name;
+    const char *description;
+} DevicePropertyBase;
+
+/* This structure is usually held inside a Device object. It holds
+ * information about a property that is specific to the device/medium
+ * in question. */
+typedef struct {
+    const DevicePropertyBase *base;
+    PropertyAccessFlags access;
+} DeviceProperty;
+
+/* Registers a new property and returns its ID. This function takes ownership
+ * of its argument; it must not be freed later. */
+extern DevicePropertyId device_property_register(DevicePropertyBase*);
+
+/* This should be called exactly once from device_api_init(). */
+extern void device_property_init(void);
+
+/* Gets a DevicePropertyBase from its ID. */
+extern const DevicePropertyBase* device_property_get_by_id(DevicePropertyId);
+extern const DevicePropertyBase* device_property_get_by_name(const char*);
+
+/* Standard property value types here.
+ * Important: see property.c for the other half of type declarations.*/
+typedef enum {
+    CONCURRENCY_PARADIGM_EXCLUSIVE,
+    CONCURRENCY_PARADIGM_SHARED_READ,
+    CONCURRENCY_PARADIGM_RANDOM_ACCESS
+} ConcurrencyParadigm;
+#define CONCURRENCY_PARADIGM_TYPE concurrency_paradigm_get_type()
+GType concurrency_paradigm_get_type (void);
+
+typedef enum {
+    STREAMING_REQUIREMENT_NONE,
+    STREAMING_REQUIREMENT_DESIRED,
+    STREAMING_REQUIREMENT_REQUIRED
+} StreamingRequirement;
+#define STREAMING_REQUIREMENT_TYPE streaming_requirement_get_type()
+GType streaming_requirement_get_type (void);
+
+typedef enum {
+    MEDIA_ACCESS_MODE_READ_ONLY,
+    MEDIA_ACCESS_MODE_WORM,
+    MEDIA_ACCESS_MODE_READ_WRITE,
+    MEDIA_ACCESS_MODE_WRITE_ONLY
+} MediaAccessMode;
+#define MEDIA_ACCESS_MODE_TYPE media_access_mode_get_type()
+GType media_access_mode_get_type (void);
+
+/* This one is not a Glibified enum */
+typedef enum {
+    SIZE_ACCURACY_UNKNOWN,
+    SIZE_ACCURACY_ESTIMATE,
+    SIZE_ACCURACY_REAL
+} SizeAccuracy;
+
+/* But SizeAccuracy does apear in this Glibified (gBoxed) struct. */
+typedef struct {
+    SizeAccuracy accuracy;
+    guint64           bytes;
+} QualifiedSize;
+#define QUALIFIED_SIZE_TYPE qualified_size_get_type()
+GType qualified_size_get_type (void);
+
+/* Some features can only be occasionally (or unreliably) detected, so
+   this enum allows the user to override the detected or default
+   setting. */
+typedef enum {
+    /* Feature support status. (exactly one of these is set) */
+        /* Feature is supported & will be used */
+        FEATURE_STATUS_ENABLED   = (1 << 0),
+        /* Features will not be used. */
+        FEATURE_STATUS_DISABLED  = (1 << 1),
+
+    /* Feature support confidence. (exactly one of these is set). */
+        /* Support is not based on conclusive evidence. */
+        FEATURE_SURETY_BAD       = (1 << 2),
+        /* Support is based on conclusive evidence. */
+        FEATURE_SURETY_GOOD      = (1 << 3),
+
+   /* Source of this information. (exactly one of these is set). */
+        /* Source of status is from default setting. */
+        FEATURE_SOURCE_DEFAULT   = (1 << 4),
+        /* Source of status is from device query. */
+        FEATURE_SOURCE_DETECTED  = (1 << 5),
+        /* Source of status is from user override. */
+        FEATURE_SOURCE_USER      = (1 << 6),
+
+    FEATURE_SUPPORT_FLAGS_MAX = (1 << 7)
+} FeatureSupportFlags;
+
+#define FEATURE_SUPPORT_FLAGS_MASK (FEATURE_SUPPORT_FLAGS_MAX-1)
+#define FEATURE_SUPPORT_FLAGS_STATUS_MASK (FEATURE_STATUS_ENABLED |  \
+                                           FEATURE_STATUS_DISABLED)
+#define FEATURE_SUPPORT_FLAGS_SURETY_MASK (FEATURE_SURETY_BAD |      \
+                                           FEATURE_SURETY_GOOD)
+#define FEATURE_SUPPORT_FLAGS_SOURCE_MASK (FEATURE_SOURCE_DEFAULT |  \
+                                           FEATURE_SOURCE_DETECTED | \
+                                           FEATURE_SOURCE_USER)
+/* Checks that mutually exclusive flags are not set. */
+gboolean feature_support_flags_is_valid(FeatureSupportFlags);
+#define FEATURE_SUPPORT_FLAGS_TYPE feature_support_get_type()
+GType feature_support_get_type (void);    
+
+/* Standard property definitions follow. See also property.c. */
+
+/* Value is a ConcurrencyParadigm */
+extern DevicePropertyBase device_property_concurrency;
+#define PROPERTY_CONCURRENCY (device_property_concurrency.ID)
+
+/* Value is a StreamingRequirement */
+extern DevicePropertyBase device_property_streaming;
+#define PROPERTY_STREAMING (device_property_streaming.ID)
+
+/* Value is a gboolean. */
+extern DevicePropertyBase device_property_compression;
+#define PROPERTY_COMPRESSION (device_property_compression.ID)
+
+/* Value is a gdouble, representing (compressed size)/(original
+   size). The period over which this value is measured is undefined. */
+extern DevicePropertyBase device_property_compression_rate;
+#define PROPERTY_COMPRESSION_RATE (device_property_compression_rate.ID)
+
+/* Value is a gint, where a negative number indicates variable block size. */
+extern DevicePropertyBase device_property_block_size;
+#define PROPERTY_BLOCK_SIZE (device_property_block_size.ID)
+
+/* Value is a guint. */
+extern DevicePropertyBase device_property_min_block_size;
+extern DevicePropertyBase device_property_max_block_size;
+#define PROPERTY_MIN_BLOCK_SIZE (device_property_min_block_size.ID)
+#define PROPERTY_MAX_BLOCK_SIZE (device_property_max_block_size.ID)
+
+/* Value is a gboolean. */
+extern DevicePropertyBase device_property_appendable;
+#define PROPERTY_APPENDABLE (device_property_appendable.ID)
+
+/* Value is a string. */
+extern DevicePropertyBase device_property_canonical_name;
+#define PROPERTY_CANONICAL_NAME (device_property_canonical_name.ID)
+
+/* Value is MediaAccessMode. */
+extern DevicePropertyBase device_property_medium_access_type;
+#define PROPERTY_MEDIUM_TYPE (device_property_medium_access_type.ID)
+
+/* Value is a gboolean. */
+extern DevicePropertyBase device_property_partial_deletion;
+#define PROPERTY_PARTIAL_DELETION (device_property_partial_deletion.ID)
+
+/* Value is a QualifiedSize, though the accuracy may be SIZE_ACCURACY_NONE. */
+extern DevicePropertyBase device_property_free_space;
+#define PROPERTY_FREE_SPACE (device_property_free_space.ID)
+
+/* Value is a guint64. On devices that support it, this property will
+   limit the total amount of data written to a volume; attempts to
+   write beyond this point will cause the device to simulate "out of
+   space". Zero means no limit. */
+extern DevicePropertyBase device_property_max_volume_usage;
+#define PROPERTY_MAX_VOLUME_USAGE (device_property_max_volume_usage.ID)
+
+/* Tape device properties. These properties do not exist on non-linear
+   devices. All of them have a value type of FeatureSupportFlags. */
+extern DevicePropertyBase device_property_fsf;
+#define PROPERTY_FSF (device_property_fsf.ID)
+
+extern DevicePropertyBase device_property_bsf;
+#define PROPERTY_BSF (device_property_bsf.ID)
+
+extern DevicePropertyBase device_property_fsr;
+#define PROPERTY_FSR (device_property_fsr.ID)
+
+extern DevicePropertyBase device_property_bsr;
+#define PROPERTY_BSR (device_property_bsr.ID)
+
+/* Is EOM supported? Must be able to read file number afterwards as
+   well. */
+extern DevicePropertyBase device_property_eom;
+#define PROPERTY_EOM (device_property_eom.ID)
+
+/* Is it necessary to perform a BSF after EOM? */
+extern DevicePropertyBase device_property_bsf_after_eom;
+#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID)
+
+/* How many filemarks to write at EOD? (Default is 2).
+ * This property is a G_TYPE_UINT, but can only really be set to 1 or 2. */
+extern DevicePropertyBase device_property_final_filemarks;
+#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID)
+
+/* What buffer size is used for reading? */
+extern DevicePropertyBase device_property_read_buffer_size;
+#define PROPERTY_READ_BUFFER_SIZE (device_property_read_buffer_size.ID)
+
+/* Authentication information for Amazon S3. Both of these are strings. */
+extern DevicePropertyBase device_property_s3_secret_key;
+extern DevicePropertyBase device_property_s3_access_key;
+#define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID)
+#define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID)
+
+#ifdef WANT_DEVPAY
+/* Same, but for S3 with DevPay. This directory can be relative to the
+ * config director, or absolute. */
+extern DevicePropertyBase device_property_s3_user_token;
+#define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID)
+#endif
+
+/* Should the device produce verbose output?  Value is a gboolean.  Not
+ * recognized by all devices. */
+extern DevicePropertyBase device_property_verbose;
+#define PROPERTY_VERBOSE (device_property_verbose.ID)
+
+#endif
diff --git a/device-src/queueing.c b/device-src/queueing.c
new file mode 100644 (file)
index 0000000..504102f
--- /dev/null
@@ -0,0 +1,542 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "queueing.h"
+#include "device.h"
+#include "semaphore.h"
+#include "amanda.h"
+
+/* Queueing framework here. */
+typedef struct {
+    guint block_size;
+    ProducerFunctor producer;
+    gpointer producer_user_data;
+    ConsumerFunctor consumer;
+    gpointer consumer_user_data;
+    GAsyncQueue *data_queue, *free_queue;
+    semaphore_t *free_memory;
+    StreamingRequirement streaming_mode;
+} queue_data_t;
+
+static queue_buffer_t *invent_buffer(void) {
+    queue_buffer_t *rval;
+    rval = malloc(sizeof(*rval));
+
+    rval->data = NULL;
+    rval->alloc_size = 0;
+    rval->data_size = 0;
+    rval->offset = 0;
+
+    return rval;
+}
+
+void free_buffer(queue_buffer_t *buf) {
+    if (buf != NULL)
+        amfree(buf->data);
+    amfree(buf);
+}
+
+static queue_buffer_t * merge_buffers(queue_buffer_t *buf1,
+                                      queue_buffer_t *buf2) {
+    if (buf1 == NULL)
+        return buf2;
+    else if (buf2 == NULL)
+        return buf1;
+
+    if (buf2->offset >= buf1->data_size) {
+        /* We can fit buf1 at the beginning of buf2. */
+        memcpy(buf2->data + buf2->offset - buf1->data_size,
+               buf1->data + buf1->offset,
+               buf1->data_size);
+        buf2->offset -= buf1->data_size;
+        buf2->data_size += buf1->data_size;
+        free_buffer(buf1);
+        return buf2;
+    } else if (buf1->alloc_size - buf1->offset - buf1->data_size
+               >= buf2->data_size) {
+        /* We can fit buf2 at the end of buf1. */
+        memcpy(buf1->data + buf1->offset + buf1->data_size,
+               buf2->data + buf2->offset, buf2->data_size);
+        buf1->data_size += buf2->data_size;
+        free_buffer(buf2);
+        return buf1;
+    } else {
+        /* We can grow buf1 and put everything there. */
+        if (buf1->offset != 0) {
+            /* But first we have to fix up buf1. */
+            memmove(buf1->data, buf1->data + buf1->offset, buf1->data_size);
+            buf1->offset = 0;
+        }
+        buf1->alloc_size = buf1->data_size + buf2->data_size;
+        buf1->data = realloc(buf1->data, buf1->alloc_size);
+        memcpy(buf1->data + buf1->data_size, buf2->data + buf2->offset,
+               buf2->data_size);
+        buf1->data_size = buf1->alloc_size;
+        free_buffer(buf2);
+        return buf1;
+    }
+}
+
+/* Invalidate the first "bytes" bytes of the buffer, by adjusting the
+   offset and data size. */
+static void consume_buffer(queue_buffer_t* buf, int bytes) {
+    buf->offset += bytes;
+    buf->data_size -= bytes;
+}
+
+/* Looks at the buffer to see how much free space it has. If it has more than
+ * twice the data size of unused space at the end, or more than four times
+ * the data size of unused space at the beginning, then that space is
+ * reclaimed. */
+static void heatshrink_buffer(queue_buffer_t *buf) {
+    if (buf == NULL)
+        return;
+
+    if (G_UNLIKELY(buf->data_size * 4 > buf->offset)) {
+        /* Consolodate with memmove. We will reclaim the space in the next
+         * step. */
+        memmove(buf->data, buf->data + buf->offset, buf->data_size);
+        buf->offset = 0;
+    } 
+
+    if (buf->alloc_size > buf->data_size*2 + buf->offset) {
+        buf->alloc_size = buf->data_size + buf->offset;
+        buf->data = realloc(buf->data, buf->alloc_size);
+    }
+}
+
+static gpointer do_producer_thread(gpointer datap) {
+    queue_data_t* data = datap;
+
+    for (;;) {
+        queue_buffer_t *buf;
+        gboolean result;
+
+        semaphore_decrement(data->free_memory, 0);
+        buf = g_async_queue_try_pop(data->free_queue);
+        if (buf != NULL && buf->data == NULL) {
+            /* Consumer is finished, then so are we. */
+            amfree(buf);
+            return GINT_TO_POINTER(TRUE);
+        }
+
+        if (buf == NULL) {
+            buf = invent_buffer();
+        }
+        buf->offset = 0;
+        buf->data_size = 0;
+
+        result = data->producer(data->producer_user_data, buf,
+                                data->block_size);
+
+        // Producers can allocate way too much memory.
+        heatshrink_buffer(buf);
+
+        if (buf->data_size > 0) {
+            semaphore_force_adjust(data->free_memory, -buf->alloc_size);
+            
+            g_async_queue_push(data->data_queue, buf);
+            buf = NULL;
+        } else {
+            g_assert(result != PRODUCER_MORE);
+            free_buffer(buf);
+            buf = NULL;
+        }
+
+
+        if (result == PRODUCER_MORE) {
+            continue;
+        } else {
+            /* We are finished (and the first to do so). */
+            g_async_queue_push(data->data_queue, invent_buffer());
+            semaphore_force_set(data->free_memory, INT_MIN);
+
+            return GINT_TO_POINTER(result == PRODUCER_FINISHED);
+        }
+    }
+}
+
+static gpointer do_consumer_thread(gpointer datap) {
+    queue_data_t* data = datap;
+    gboolean finished = FALSE;
+    queue_buffer_t *buf = NULL;
+
+    if (data->streaming_mode != STREAMING_REQUIREMENT_NONE) {
+        semaphore_wait_empty(data->free_memory);
+    }
+
+    for (;;) {
+        gboolean result;
+
+        if (finished) {
+            return GINT_TO_POINTER(TRUE);
+        }
+
+        while (buf == NULL || buf->data_size < data->block_size) {
+            queue_buffer_t *next_buf;
+            if (data->streaming_mode == STREAMING_REQUIREMENT_DESIRED) {
+                do {
+                    next_buf = g_async_queue_try_pop(data->data_queue);
+                    if (next_buf == NULL) {
+                        semaphore_wait_empty(data->free_memory);
+                    }
+                } while (next_buf == NULL);
+            } else {
+                next_buf = g_async_queue_pop(data->data_queue);
+                g_assert(next_buf != NULL);
+            }
+
+            if (next_buf->data == NULL) {
+                /* Producer is finished, then so are we.*/
+                free_buffer(next_buf);
+                if (buf != NULL) {
+                    /* But we can't quit yet, we have a buffer to flush.*/
+                    finished = TRUE;
+                    break;
+                } else {
+                    /* We are so outta here. */
+                    return GINT_TO_POINTER(TRUE);
+                }            
+            }
+
+            semaphore_increment(data->free_memory, next_buf->alloc_size);
+            
+            buf = merge_buffers(buf, next_buf);
+        }
+
+        result = data->consumer(data->consumer_user_data, buf);
+
+        if (result > 0) {
+            consume_buffer(buf, result);
+            if (buf->data_size == 0) {
+                g_async_queue_push(data->free_queue, buf);
+                buf = NULL;
+            }
+            continue;
+        } else {
+            free_buffer(buf);
+            return GINT_TO_POINTER(FALSE);
+        }
+    }
+}
+
+/* Empties a buffer queue and frees all the buffers associated with it.
+ *
+ * If full_cleanup is TRUE, then we delete the queue itself.
+ * If full_cleanup is FALSE, then we leave the queue around, with a
+ *         signal element in it. */
+static void cleanup_buffer_queue(GAsyncQueue *Q, gboolean full_cleanup) {
+    g_async_queue_lock(Q);
+    for (;;) {
+        queue_buffer_t *buftmp;
+        buftmp = g_async_queue_try_pop_unlocked(Q);
+        if (buftmp == NULL)
+            break;
+
+        free_buffer(buftmp);
+    }
+    if (!full_cleanup)
+        g_async_queue_push_unlocked(Q, invent_buffer());
+
+    g_async_queue_unlock(Q);
+    
+    if (full_cleanup)
+        g_async_queue_unref(Q);
+}
+
+/* This function sacrifices performance, but will still work just
+   fine, on systems where threads are not supported. */
+static queue_result_flags
+do_unthreaded_consumer_producer_queue(guint block_size,
+                                      ProducerFunctor producer,
+                                      gpointer producer_user_data,
+                                      ConsumerFunctor consumer,
+                                      gpointer consumer_user_data) {
+    queue_buffer_t *buf = NULL, *next_buf = NULL;
+    gboolean finished = FALSE;
+    queue_result_flags rval = 0;
+
+    /* The basic theory of operation here is to read until we have
+       enough data to write, then write until we don't.. */
+    while (!finished) {
+        int result;
+        
+        while ((buf == NULL || buf->data_size < block_size) && !finished) {
+            if (next_buf == NULL)
+                next_buf = invent_buffer();
+
+            result = producer(producer_user_data, next_buf, block_size);
+
+            if (result != PRODUCER_MORE) {
+                finished = TRUE;
+                if (result != PRODUCER_FINISHED) {
+                    rval |= QUEUE_PRODUCER_ERROR;
+                }
+            }
+
+            buf = merge_buffers(buf, next_buf);
+            next_buf = NULL;
+        }
+
+        while (buf != NULL && buf->data_size > 0 &&
+               (buf->data_size >= block_size || finished)) {
+            result = consumer(consumer_user_data, buf);
+            
+            if (result > 0) {
+                consume_buffer(buf, result);
+                if (buf->data_size == 0) {
+                    next_buf = buf;
+                    buf = NULL;
+                }
+            } else {
+                finished = TRUE;
+                rval |= QUEUE_CONSUMER_ERROR;
+                break;
+            }
+        }
+    }
+
+    free_buffer(buf);
+    free_buffer(next_buf);
+    return rval;
+}
+
+gboolean do_consumer_producer_queue(ProducerFunctor producer,
+                                    gpointer producer_user_data,
+                                    ConsumerFunctor consumer,
+                                    gpointer consumer_user_data) {
+    return QUEUE_SUCCESS ==
+        do_consumer_producer_queue_full(producer, producer_user_data,
+                                        consumer, consumer_user_data,
+                                        0, DEFAULT_MAX_BUFFER_MEMORY,
+                                        STREAMING_REQUIREMENT_NONE);
+}
+
+queue_result_flags
+do_consumer_producer_queue_full(ProducerFunctor producer,
+                                gpointer producer_user_data,
+                                ConsumerFunctor consumer,
+                                gpointer consumer_user_data,
+                                int block_size,
+                                size_t max_memory,
+                                StreamingRequirement streaming_mode) {
+    GThread     * producer_thread;
+    GThread     * consumer_thread;
+    queue_data_t  queue_data;
+    gpointer      producer_result;
+    gpointer      consumer_result;
+    queue_result_flags rval;
+
+    if (block_size <= 0) {
+        block_size = DISK_BLOCK_BYTES;
+    }
+
+    g_return_val_if_fail(producer != NULL, FALSE);
+    g_return_val_if_fail(consumer != NULL, FALSE);
+
+    if (!g_thread_supported()) {
+        return do_unthreaded_consumer_producer_queue(block_size, producer,
+                                                     producer_user_data,
+                                                     consumer,
+                                                     consumer_user_data);
+    }
+
+    queue_data.block_size = block_size;
+    queue_data.producer = producer;
+    queue_data.producer_user_data = producer_user_data;
+    queue_data.consumer = consumer;
+    queue_data.consumer_user_data = consumer_user_data;
+    queue_data.streaming_mode = streaming_mode;
+
+    queue_data.data_queue = g_async_queue_new();
+    queue_data.free_queue = g_async_queue_new();
+
+    max_memory = MAX(1,MIN(max_memory, INT_MAX / 2));
+    queue_data.free_memory = semaphore_new_with_value(max_memory);
+
+    producer_thread = g_thread_create(do_producer_thread, &queue_data,
+                                      TRUE,
+                                      NULL /* FIXME: Should handle
+                                              errors. */);
+    consumer_thread = g_thread_create(do_consumer_thread, &queue_data,
+                                      TRUE,
+                                      NULL /* FIXME: Should handle
+                                              errors. */);
+    
+    /* The order of cleanup here is very important, to avoid deadlock. */
+    /* 1) Reap the consumer. */
+    consumer_result = g_thread_join(consumer_thread);
+    /* 2) Stop the producer. */
+    semaphore_force_set(queue_data.free_memory, -1);
+    /* 3) Cleanup the free queue; add a signal flag. */
+    cleanup_buffer_queue(queue_data.free_queue, FALSE);
+    /* 4) Restart the producer (so it can exit). */
+    semaphore_force_set(queue_data.free_memory, INT_MAX);
+    /* 5) Reap the producer. */
+    producer_result = g_thread_join(producer_thread);
+
+    cleanup_buffer_queue(queue_data.free_queue, TRUE);
+    cleanup_buffer_queue(queue_data.data_queue, TRUE);
+
+    semaphore_free(queue_data.free_memory);
+    
+    rval = 0;
+    if (!GPOINTER_TO_INT(producer_result)) {
+        rval |= QUEUE_PRODUCER_ERROR;
+    }
+    if (!GPOINTER_TO_INT(consumer_result)) {
+        rval |= QUEUE_CONSUMER_ERROR;
+    }
+    return rval;
+}
+
+/* Commonly-useful producers and consumers below. */
+
+producer_result_t device_read_producer(gpointer devicep,
+                                       queue_buffer_t *buffer,
+                                       int hint_size G_GNUC_UNUSED) {
+    Device* device;
+
+    device = (Device*) devicep;
+    g_assert(IS_DEVICE(device));
+
+    buffer->offset = 0;
+    for (;;) {
+        int result, read_size;
+        read_size = buffer->alloc_size;
+        result = device_read_block(device, buffer->data, &read_size);
+        if (result > 0) {
+            buffer->data_size = read_size;
+            return PRODUCER_MORE;
+        } else if (result == 0) {
+            buffer->data = realloc(buffer->data, read_size);
+            buffer->alloc_size = read_size;
+        } else if (device->is_eof) {
+            return PRODUCER_FINISHED;
+        } else {
+            buffer->data_size = 0;
+            return PRODUCER_ERROR;
+        }
+    }
+}
+
+int device_write_consumer(gpointer devicep, queue_buffer_t *buffer) {
+    Device* device;
+    unsigned int write_size;
+
+    device = (Device*) devicep;
+    g_assert(IS_DEVICE(device));
+    write_size = MIN(buffer->data_size,
+                     device_write_max_size(device));
+
+    if (device_write_block(device, write_size,
+                           buffer->data + buffer->offset,
+                           buffer->data_size <
+                               device_write_min_size(device))) {
+        /* Success! */
+        return write_size;
+    } else {
+        /* Nope, really an error. */
+        return -1;
+    }
+}
+
+producer_result_t fd_read_producer(gpointer fdp, queue_buffer_t *buffer,
+                                   int hint_size) {
+    int fd;
+
+    fd = GPOINTER_TO_INT(fdp);
+    g_assert(fd >= 0);
+    g_assert(buffer->data_size == 0);
+
+    buffer->offset = 0;
+
+    if (buffer->data == NULL) {
+        /* Set up the buffer. */
+        buffer->data = malloc(hint_size);
+        buffer->alloc_size = hint_size;
+    }
+
+    for (;;) {
+        int result;
+        result = read(fd, buffer->data, buffer->alloc_size);
+
+        if (result > 0) {
+            buffer->data_size = result;
+            return PRODUCER_MORE;
+        } else if (result == 0) {
+            /* End of file. */
+            return PRODUCER_FINISHED;
+        } else if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                ) {
+                /* Try again. */
+                continue;
+        } else {
+            /* Error occured. */
+            g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno));
+            return PRODUCER_ERROR;
+        }
+    }
+}
+
+int fd_write_consumer(gpointer fdp, queue_buffer_t *buffer) {
+    int fd;
+
+    fd = GPOINTER_TO_INT(fdp);
+    g_assert(fd >= 0);
+
+    g_return_val_if_fail(buffer->data_size > 0, 0);
+
+    for (;;) {
+        int write_size;
+        write_size = write(fd, buffer->data + buffer->offset,
+                           buffer->data_size);
+        
+        if (write_size > 0) {
+            return write_size;
+        } else if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                ) {
+                /* Try again. */
+                continue;
+        } else {
+            /* Error occured. */
+            g_fprintf(stderr, "Error writing fd %d: %s\n", fd, strerror(errno));
+            return -1;
+        }        
+    }
+}
diff --git a/device-src/queueing.h b/device-src/queueing.h
new file mode 100644 (file)
index 0000000..4a22081
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef QUEUEING_H
+#define QUEUEING_H
+
+/* This file contains the code for fast threaded reading and writing to/from
+ * media, for devices that don't require any special handling. Some
+ * devices (e.g., CD-ROM) may use a different method for bulk reads or
+ * writes. */
+
+#include <glib.h>
+#include "property.h"
+
+#define DEFAULT_MAX_BUFFER_MEMORY (1*1024*1024)
+
+/* Valid data in this structure starts at data + offset, and has size
+ * data_size. Allocation starts at data and has size alloc_size. */
+typedef struct {
+    char *data;
+    guint alloc_size;
+    guint data_size;
+    guint offset;
+} queue_buffer_t;
+
+void free_buffer(queue_buffer_t*);
+
+typedef enum {
+    PRODUCER_MORE,     /* Means the producer should be run again. */
+    PRODUCER_FINISHED, /* Means that no error occured, but the
+                          producer should not be run again. */
+    PRODUCER_ERROR     /* Means an error occured, and the producer
+                          should not be run again. */
+} producer_result_t;
+
+typedef enum {
+    QUEUE_SUCCESS = 0,
+    QUEUE_PRODUCER_ERROR = 1 << 0,
+    QUEUE_CONSUMER_ERROR = 1 << 1,
+    QUEUE_INTERNAL_ERROR = 1 << 2
+} queue_result_flags;
+
+/* The producer takes the given buffer (which is not itself NULL, but
+ * may contain a NULL data segment), and fills it with data. The
+ * producer should feel free to allocate or reallocate data as
+ * necessary; the queueing system will free it when necessary. The
+ * result of the production operation is specified in the return
+ * value, but if the buffer is left without data, then that is
+ * interpreted as PRODUCER_ERROR. It is preferred (but not required)
+ * that the producer produce hint_size bytes of data, 
+ *
+ * The consumer takes the given buffer (which will not be NULL, nor
+ * contain a NULL data segment) and processess it. If there is a
+ * problem consuming data (such that no further data should be
+ * consumed), the consumer may return -1. Otherwise, the consumer
+ * should return the number of bytes actually consumed.
+ * If an error occurs, return -1, regardless of the number of bytes consumed.
+ * If the amount of data written is not a full block, then this is the
+ * last (partial block) of data. The consumer should do whatever is
+ * appropriate in that case.
+ *
+ * Note that the handling of the queue_buffer_t is different between
+ * the two functions: The producer should update queue_buffer_t as
+ * necessary to corespond to read data, while the consumer should
+ * leave the queue_buffer_t unadjusted: The queueing framework will
+ * invalidate data in the buffer according to the return value of the
+ * consumer.*/
+typedef producer_result_t (* ProducerFunctor)(gpointer user_data,
+                                              queue_buffer_t* buffer,
+                                              int hint_size);
+typedef int (* ConsumerFunctor)(gpointer user_data,
+                                queue_buffer_t* buffer);
+
+
+/* These functions make the magic happen. The first one assumes
+   reasonable defaults, the second one provides more options.
+   % producer           : A function that provides data to write.
+   % producer_user_data : A pointer to pass to that function.
+   % consumer           : A function that writes data out.
+   % consumer_user_data : A pointer to pass to that function.
+   % block_size         : Size of chunks to write out to consumer. If
+                          nonpositive, data will be written in
+                          variable-sized chunks.
+   % max_memory         : Amount of memory to be used for buffering.
+                          (default is DEFAULT_MAX_BUFFER_MEMORY).
+   % streaming_mode     : Describes streaming mode.
+         STREAMING_REQUIREMENT_NONE:     Data will be written as fast
+                                         as possible. No prebuffering
+                                         will be done.
+         STREAMING_REQUIREMENT_DESIRED:  max_memory bytes of data will
+                                         be prebuffered, and if the
+                                         buffer ever empties, no data
+                                         will be written until it
+                                         fills again.
+         STREAMING_REQUIREMENT_REQUIRED: max_memory bytes of data will
+                                         be prebuffered, and
+                                         thereafter data will be
+                                         written as fast as possible.
+*/
+gboolean
+do_consumer_producer_queue(ProducerFunctor producer,
+                           gpointer producer_user_data,
+                           ConsumerFunctor consumer,
+                           gpointer consumer_user_data);
+queue_result_flags
+do_consumer_producer_queue_full(ProducerFunctor producer,
+                                gpointer producer_user_data,
+                                ConsumerFunctor consumer,
+                                gpointer consumer_user_data,
+                                int block_size,
+                                size_t max_memory,
+                                StreamingRequirement streaming_mode);
+
+/* Some commonly-useful producers and consumers.*/
+
+/* These functions will call device_read_block and device_write_block
+ * respectively. The user data should be a Device*.
+ *
+ * device_write_consumer assumes that the block_size passed to
+ * do_consumer_producer_queue_full is at least device_write_min_size();
+ * do_consumer_thread() will not pass a buffer of less than block_size
+ * to the consumer unless it has received EOF from the producer thread.
+ */
+producer_result_t device_read_producer(gpointer device,
+                                       queue_buffer_t *buffer,
+                                       int hint_size);
+int device_write_consumer(gpointer device, queue_buffer_t *buffer);
+
+/* These functions will call read() or write() respectively. The user
+   data should be a file descriptor stored with GINT_TO_POINTER. */
+producer_result_t fd_read_producer(gpointer fd, queue_buffer_t *buffer,
+                                   int hint_size);
+int fd_write_consumer(gpointer fd, queue_buffer_t *buffer);
+
+
+
+#endif /* QUEUEING_H */
diff --git a/device-src/rait-device.c b/device-src/rait-device.c
new file mode 100644 (file)
index 0000000..b38bf8d
--- /dev/null
@@ -0,0 +1,1802 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The RAIT device encapsulates some number of other devices into a single
+ * redundant device. */
+
+#include "rait-device.h"
+#include <amanda.h>
+#include "property.h"
+#include <util.h>
+
+typedef enum {
+    RAIT_STATUS_COMPLETE, /* All subdevices OK. */
+    RAIT_STATUS_DEGRADED, /* One subdevice failed. */
+    RAIT_STATUS_FAILED    /* Two or more subdevices failed. */
+} RaitStatus;
+
+struct RaitDevicePrivate_s {
+    GPtrArray * children;
+    /* These flags are only relevant for reading. */
+    RaitStatus status;
+    /* If status == RAIT_STATUS_DEGRADED, this holds the index of the
+       failed node. It holds a negative number otherwise. */
+    int failed;
+    guint block_size;
+};
+
+#define PRIVATE(o) (o->private)
+
+/* here are local prototypes */
+static void rait_device_init (RaitDevice * o);
+static void rait_device_class_init (RaitDeviceClass * c);
+static gboolean rait_device_open_device (Device * self, char * device_name);
+static gboolean rait_device_start (Device * self, DeviceAccessMode mode,
+                                   char * label, char * timestamp);
+static gboolean rait_device_start_file(Device * self, const dumpfile_t * info);
+static gboolean rait_device_write_block (Device * self, guint size,
+                                         gpointer data, gboolean last_block);
+static gboolean rait_device_finish_file (Device * self);
+static dumpfile_t * rait_device_seek_file (Device * self, guint file);
+static gboolean rait_device_seek_block (Device * self, guint64 block);
+static int      rait_device_read_block (Device * self, gpointer buf,
+                                        int * size);
+static gboolean rait_device_property_get (Device * self, DevicePropertyId id,
+                                          GValue * val);
+static gboolean rait_device_property_set (Device * self, DevicePropertyId id,
+                                          GValue * val);
+static gboolean rait_device_recycle_file (Device * self, guint filenum);
+static gboolean rait_device_finish (Device * self);
+static ReadLabelStatusFlags rait_device_read_label(Device * dself);
+static void find_simple_params(RaitDevice * self, guint * num_children,
+                               guint * data_children, int * blocksize);
+
+/* pointer to the class of our parent */
+static DeviceClass *parent_class = NULL;
+
+/* This function is replicated here in case we have GLib from before 2.4.
+ * It should probably go eventually. */
+#if !GLIB_CHECK_VERSION(2,4,0)
+static void
+g_ptr_array_foreach (GPtrArray *array,
+                     GFunc      func,
+                     gpointer   user_data)
+{
+  guint i;
+
+  g_return_if_fail (array);
+
+  for (i = 0; i < array->len; i++)
+    (*func) (array->pdata[i], user_data);
+}
+#endif
+
+GType
+rait_device_get_type (void)
+{
+    static GType type = 0;
+
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (RaitDeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) rait_device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (RaitDevice),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) rait_device_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TYPE_DEVICE, "RaitDevice", &info,
+                                       (GTypeFlags)0);
+       }
+    
+    return type;
+}
+
+static void g_object_unref_foreach(gpointer data,
+                                   gpointer user_data G_GNUC_UNUSED) {
+    g_return_if_fail(G_IS_OBJECT(data));
+    g_object_unref(data);
+}
+
+static void
+rait_device_finalize(GObject *obj_self)
+{
+    RaitDevice *self G_GNUC_UNUSED = RAIT_DEVICE (obj_self);
+    if(G_OBJECT_CLASS(parent_class)->finalize) \
+           (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+    if(self->private->children) {
+        g_ptr_array_foreach(self->private->children,
+                            g_object_unref_foreach, NULL);
+        g_ptr_array_free (self->private->children, TRUE);
+        self->private->children = NULL;
+    }
+    amfree(self->private);
+}
+
+static void 
+rait_device_init (RaitDevice * o G_GNUC_UNUSED)
+{
+    PRIVATE(o) = malloc(sizeof(RaitDevicePrivate));
+    PRIVATE(o)->children = g_ptr_array_new();
+    PRIVATE(o)->status = RAIT_STATUS_COMPLETE;
+    PRIVATE(o)->failed = -1;
+}
+
+static void 
+rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED)
+{
+    GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c;
+    DeviceClass *device_class = (DeviceClass *)c;
+
+    parent_class = g_type_class_ref (TYPE_DEVICE);
+
+    device_class->open_device = rait_device_open_device;
+    device_class->start = rait_device_start;
+    device_class->start_file = rait_device_start_file;
+    device_class->write_block = rait_device_write_block;
+    device_class->finish_file = rait_device_finish_file;
+    device_class->seek_file = rait_device_seek_file;
+    device_class->seek_block = rait_device_seek_block;
+    device_class->read_block = rait_device_read_block;
+    device_class->property_get = rait_device_property_get;
+    device_class->property_set = rait_device_property_set;
+    device_class->recycle_file = rait_device_recycle_file; 
+    device_class->finish = rait_device_finish;
+    device_class->read_label = rait_device_read_label;
+
+    g_object_class->finalize = rait_device_finalize;
+
+    g_thread_pool_set_max_unused_threads(-1);
+}
+
+/* This function does something a little clever and a little
+ * complicated. It takes an array of operations and runs the given
+ * function on each element in the array. The trick is that it runs them
+ * all in parallel, in different threads. This is more efficient than it
+ * sounds because we use a GThreadPool, which means calling this function
+ * will probably not start any new threads at all, but rather use
+ * existing ones. The func is called with two gpointer arguments: The
+ * first from the array, the second is the data argument.
+ * 
+ * When it returns, all the operations have been successfully
+ * executed. If you want results from your operations, do it yourself
+ * through the array. */
+static void do_thread_pool_op(GFunc func, GPtrArray * ops, gpointer data) {
+    GThreadPool * pool;
+    guint i;
+
+    pool = g_thread_pool_new(func, data, -1, FALSE, NULL);
+    for (i = 0; i < ops->len; i ++) {
+        g_thread_pool_push(pool, g_ptr_array_index(ops, i), NULL);
+    }
+
+    g_thread_pool_free(pool, FALSE, TRUE);
+}
+
+/* This does the above, in a serial fashion (and without using threads) */
+static void do_unthreaded_ops(GFunc func, GPtrArray * ops,
+                              gpointer data G_GNUC_UNUSED) {
+    guint i;
+
+    for (i = 0; i < ops->len; i ++) {
+        func(g_ptr_array_index(ops, i), NULL);
+    }
+}
+
+/* This is the one that code below should call. It switches
+   automatically between do_thread_pool_op and do_unthreaded_ops,
+   depending on g_thread_supported(). */
+static void do_rait_child_ops(GFunc func, GPtrArray * ops, gpointer data) {
+    if (g_thread_supported()) {
+        do_thread_pool_op(func, ops, data);
+    } else {
+        do_unthreaded_ops(func, ops, data);
+    }
+}
+
+/* Take a text string user_name, and break it out into an argv-style
+   array of strings. For example, {foo,{bar,baz},bat} would return the
+   strings "foo", "{bar,baz}", "bat", and NULL. Returns NULL on
+   error. */
+static char ** parse_device_name(char * user_name) {
+    GPtrArray * rval;
+    char * cur_end = user_name;
+    char * cur_begin = user_name;
+    
+    rval = g_ptr_array_new();
+    
+    /* Check opening brace. */
+    if (*cur_begin != '{')
+        return NULL;
+    cur_begin ++;
+    
+    cur_end = cur_begin;
+    for (;;) {
+        switch (*cur_end) {
+        case ',': {
+            g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin));
+            cur_end ++;
+            cur_begin = cur_end;
+            continue;
+        }
+
+        case '{':
+            /* We read until the matching closing brace. */
+            while (*cur_end != '}' && *cur_end != '\0')
+                cur_end ++;
+            if (*cur_end == '}')
+                cur_end ++;
+            continue;
+            
+        case '}':
+            g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin));
+            goto OUTER_END; /* break loop, not switch */
+
+        case '\0':
+            /* Unexpected NULL; abort. */
+            g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name);
+            g_ptr_array_free_full(rval);
+            return NULL;
+
+        default:
+            cur_end ++;
+            continue;
+        }
+        g_assert_not_reached();
+    }
+ OUTER_END:
+    
+    if (cur_end[1] != '\0') {
+        g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name);
+        g_ptr_array_free_full(rval);
+        return NULL;
+    }
+
+    g_ptr_array_add(rval, NULL);
+
+    return (char**) g_ptr_array_free(rval, FALSE);
+}
+
+/* Find a workable block size. */
+static gboolean find_block_size(RaitDevice * self) {
+    uint min = 0;
+    uint max = G_MAXUINT;
+    uint result;
+    GValue val;
+    gboolean rval;
+    guint i;
+    guint data_children;
+    
+    for (i = 0; i < self->private->children->len; i ++) {
+        uint child_min, child_max;
+        GValue property_result;
+        bzero(&property_result, sizeof(property_result));
+
+        if (!device_property_get(g_ptr_array_index(self->private->children, i),
+                                 PROPERTY_MIN_BLOCK_SIZE, &property_result))
+            return FALSE;
+        child_min = g_value_get_uint(&property_result);
+        g_return_val_if_fail(child_min > 0, FALSE);
+        if (!device_property_get(g_ptr_array_index(self->private->children, i),
+                                 PROPERTY_MAX_BLOCK_SIZE, &property_result))
+            return FALSE;
+        child_max = g_value_get_uint(&property_result);
+        g_return_val_if_fail(child_max > 0, FALSE);
+        
+        if (child_min > max || child_max < min || child_min == 0) {
+            return FALSE;
+        } else {
+            min = MAX(min, child_min);
+            max = MIN(max, child_max);
+        }
+    }
+
+    /* Now pick a number. */
+    g_assert(min <= max);
+    if (max < MAX_TAPE_BLOCK_BYTES)
+        result = max;
+    else if (min > MAX_TAPE_BLOCK_BYTES)
+        result = min;
+    else
+        result = MAX_TAPE_BLOCK_BYTES;
+
+    /* User reads and writes bigger blocks. */
+    find_simple_params(self, NULL, &data_children, NULL);
+    self->private->block_size = result * data_children;
+
+    bzero(&val, sizeof(val));
+    g_value_init(&val, G_TYPE_INT);
+    g_value_set_int(&val, result);
+    /* We can't do device_property_set because it's disallowed
+       according to the registered property base. */
+    rval = rait_device_property_set(DEVICE(self), PROPERTY_BLOCK_SIZE, &val);
+    g_value_unset(&val);
+    return rval;
+}
+
+/* Register properties that belong to the RAIT device proper, and not
+   to subdevices. */
+static void register_rait_properties(RaitDevice * self) {
+    Device * o = DEVICE(self);
+    DeviceProperty prop;
+
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+
+    prop.base = &device_property_min_block_size;
+    device_add_property(o, &prop, NULL);
+
+    prop.base = &device_property_max_block_size;
+    device_add_property(o, &prop, NULL);
+  
+    prop.base = &device_property_block_size;
+    device_add_property(o, &prop, NULL);
+
+    prop.base = &device_property_canonical_name;
+    device_add_property(o, &prop, NULL);
+}
+
+static void property_hash_union(GHashTable * properties,
+                                DeviceProperty * prop) {
+    PropertyAccessFlags before, after;
+    gpointer tmp;
+    gboolean found;
+    
+    found = g_hash_table_lookup_extended(properties,
+                                         GUINT_TO_POINTER(prop->base->ID),
+                                         NULL, &tmp);
+    before = GPOINTER_TO_UINT(tmp);
+    
+    if (!found) {
+        after = prop->access;
+    } else {
+        after = before & prop->access;
+    }
+    
+    g_hash_table_insert(properties, GUINT_TO_POINTER(prop->base->ID),
+                        GUINT_TO_POINTER(after));
+}
+
+/* A GHRFunc. */
+static gboolean zero_value(gpointer key G_GNUC_UNUSED, gpointer value,
+                           gpointer user_data G_GNUC_UNUSED) {
+    return (0 == GPOINTER_TO_UINT(value));
+}
+
+/* A GHFunc */
+static void register_property_hash(gpointer key, gpointer value,
+                                   gpointer user_data) {
+    DevicePropertyId id = GPOINTER_TO_UINT(key);
+    DeviceProperty prop;
+    Device * device = (Device*)user_data;
+
+    g_assert(IS_DEVICE(device));
+
+    prop.access = GPOINTER_TO_UINT(value);
+    prop.base = device_property_get_by_id(id);
+
+    device_add_property(device, &prop, NULL);
+}
+
+/* This function figures out which properties exist for all children, and 
+ * exports the unioned access mask. */
+static void register_properties(RaitDevice * self) {
+    GHashTable * properties; /* PropertyID => PropertyAccessFlags */
+    guint j;
+    
+    properties = g_hash_table_new(g_direct_hash, g_direct_equal);
+
+    /* Iterate the device list, find all properties. */
+    for (j = 0; j < self->private->children->len; j ++) {
+        int i;
+        Device * child = g_ptr_array_index(self->private->children, j);
+        const DeviceProperty* device_property_list;
+
+        device_property_list = device_property_get_list(child);
+        for (i = 0; device_property_list[i].base != NULL; i ++) {
+            property_hash_union(properties, (gpointer)&(device_property_list[i]));
+        }
+    }
+
+    /* Then toss properties that can't be accessed. */
+    g_hash_table_foreach_remove(properties, zero_value, NULL);
+    g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_BLOCK_SIZE));
+    g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MIN_BLOCK_SIZE));
+    g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MAX_BLOCK_SIZE));
+    g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_CANONICAL_NAME));
+
+    /* Finally, register the lot. */
+    g_hash_table_foreach(properties, register_property_hash, self);
+
+    g_hash_table_destroy(properties);
+
+    /* Then we have some of our own properties to register. */
+    register_rait_properties(self);
+}
+
+/* This structure contains common fields for many operations. Not all
+   operations use all fields, however. */
+typedef struct {
+    gpointer result; /* May be a pointer; may be an integer or boolean
+                        stored with GINT_TO_POINTER. */
+    Device * child;  /* The device in question. Used by all
+                        operations. */
+    guint child_index; /* For recoverable operations (read-related
+                          operations), this field provides the number
+                          of this child in the self->private->children
+                          array. */
+} GenericOp;
+
+typedef gboolean (*BooleanExtractor)(gpointer data);
+
+/* A BooleanExtractor */
+static gboolean extract_boolean_generic_op(gpointer data) {
+    GenericOp * op = data;
+    return GPOINTER_TO_INT(op->result);
+}
+
+/* A BooleanExtractor */
+static gboolean extract_boolean_pointer_op(gpointer data) {
+    GenericOp * op = data;
+    return op->result != NULL;
+}
+
+/* Does the equivalent of this perl command:
+     ! (first { !extractor($_) } @_
+   That is, calls extractor on each element of the array, and returns
+   TRUE if and only if all calls to extractor return TRUE.
+*/
+static gboolean g_ptr_array_and(GPtrArray * array,
+                                BooleanExtractor extractor) {
+    guint i;
+    if (array == NULL || array->len <= 0)
+        return FALSE;
+
+    for (i = 0; i < array->len; i ++) {
+        if (!extractor(g_ptr_array_index(array, i)))
+            return FALSE;
+    }
+
+    return TRUE;
+}
+
+/* Takes a RaitDevice, and makes a GPtrArray of GenericOp. */
+static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) {
+    GPtrArray * rval;
+    guint i;
+
+    rval = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        GenericOp * op;
+        op = malloc(sizeof(*op));
+        op->child = g_ptr_array_index(self->private->children, i);
+        op->child_index = i;
+        g_ptr_array_add(rval, op);
+    }
+
+    return rval;
+}
+
+/* Takes a GPtrArray of GenericOp, and a BooleanExtractor, and does
+   all the proper handling for the result of operations that allow
+   device isolation. Returns FALSE only if an unrecoverable error
+   occured. */
+static gboolean g_ptr_array_union_robust(RaitDevice * self, GPtrArray * ops,
+                                         BooleanExtractor extractor) {
+    gboolean success;
+    gpointer isolated_op = NULL;
+
+    for (;;) {
+        success = g_ptr_array_and(ops, extractor);
+        
+        if (success || self->private->status != RAIT_STATUS_COMPLETE) {
+            break;
+        } else {
+            guint i;
+            /* First device failure, note the device and march on. */
+            self->private->status = RAIT_STATUS_DEGRADED;
+            for (i = 0; i < ops->len; i ++) {
+                GenericOp * op = g_ptr_array_index(ops, i);
+                if (!(op->result)) {
+                    isolated_op = g_ptr_array_remove_index_fast(ops, i);
+                    self->private->failed = op->child_index;
+                    g_fprintf(stderr, "RAIT array %s Isolated device %s.\n",
+                            DEVICE(self)->device_name,
+                            op->child->device_name);
+                    break;
+                }
+            }
+        }
+    }
+
+    /* Return isolated op so any data members can be freed. */
+    if (isolated_op != NULL) {
+        g_ptr_array_add(ops, isolated_op);
+    }
+    return success;
+}
+
+typedef struct {
+    Device * result;    /* IN */
+    char * device_name; /* OUT */
+} OpenDeviceOp;
+
+/* A GFunc. */
+static void open_device_do_op(gpointer data,
+                              gpointer user_data G_GNUC_UNUSED) {
+    OpenDeviceOp * op = data;
+
+    op->result = device_open(op->device_name);
+    amfree(op->device_name);
+}
+
+/* Returns TRUE if and only if the volume label and time are equal. */
+static gboolean compare_volume_results(Device * a, Device * b) {
+    if (a->volume_time != b->volume_time)
+        return FALSE;
+    if (a->volume_label == NULL && b->volume_label == NULL)
+        return TRUE;
+    if (a->volume_label == NULL || b->volume_label == NULL)
+        return FALSE;
+    return 0 == strcmp(a->volume_label, b->volume_label);
+}
+
+static gboolean 
+rait_device_open_device (Device * dself, char * device_name) {
+    char ** device_names;
+    GPtrArray * open_device_ops;
+    guint i;
+    gboolean failure;
+    RaitDevice * self;
+
+    self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail (device_name != NULL, FALSE);
+
+    device_names = parse_device_name(device_name);
+    
+    if (device_names == NULL)
+        return FALSE;
+
+    /* Open devices in a separate thread, in case they have to rewind etc. */
+    open_device_ops = g_ptr_array_new();
+
+    for (i = 0; device_names[i] != NULL; i ++) {
+        OpenDeviceOp *op;
+
+        op = malloc(sizeof(*op));
+        op->device_name = device_names[i];
+        op->result = NULL;
+        g_ptr_array_add(open_device_ops, op);
+    }
+
+    free(device_names);
+    do_rait_child_ops(open_device_do_op, open_device_ops, NULL);
+
+    failure = FALSE;
+    /* Check results of opening devices. */
+    for (i = 0; i < open_device_ops->len; i ++) {
+        OpenDeviceOp *op = g_ptr_array_index(open_device_ops, i);
+        
+        if (op->result != NULL) {
+            g_ptr_array_add(self->private->children, op->result);
+        } else {
+            failure = TRUE;
+        }
+    }
+
+    g_ptr_array_free_full(open_device_ops);
+
+    failure = failure || !find_block_size(self);
+    if (failure)
+        return FALSE; /* This will clean up any created children. */
+
+    register_properties(self);
+
+    /* Chain up. */
+    if (parent_class->open_device) {
+        return parent_class->open_device(dself, device_name);
+    } else {
+        return TRUE;
+    }
+}
+
+/* A GFunc. */
+static void read_label_do_op(gpointer data,
+                             gpointer user_data G_GNUC_UNUSED) {
+    GenericOp * op = data;
+    op->result = GINT_TO_POINTER(device_read_label(op->child));
+}
+
+static ReadLabelStatusFlags rait_device_read_label(Device * dself) {
+    RaitDevice * self;
+    GPtrArray * ops;
+    ReadLabelStatusFlags failed_result = 0;
+    ReadLabelStatusFlags rval;
+    GenericOp * failed_op = NULL; /* If this is non-null, we will isolate. */
+    unsigned int i;
+    Device * first_success = NULL;
+
+    self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    amfree(dself->volume_label);
+
+    ops = make_generic_boolean_op_array(self);
+    
+    do_rait_child_ops(read_label_do_op, ops, NULL);
+    
+    for (i = 0; i < ops->len; i ++) {
+        GenericOp * op = g_ptr_array_index(ops, i);
+        ReadLabelStatusFlags result = GPOINTER_TO_INT(op->result);
+        if (op->result == READ_LABEL_STATUS_SUCCESS) {
+            if (first_success == NULL) {
+                /* This is the first successful device. */
+                first_success = op->child;
+            } else if (!compare_volume_results(first_success, op->child)) {
+                /* Doesn't match. :-( */
+                g_fprintf(stderr, "Inconsistant volume labels: "
+                        "Got %s/%s against %s/%s.\n",
+                        first_success->volume_label,
+                        first_success->volume_time, 
+                        op->child->volume_label,
+                        op->child->volume_time);
+                failed_result |= READ_LABEL_STATUS_VOLUME_ERROR;
+                failed_op = NULL;
+            }
+        } else {
+            if (failed_result == 0 &&
+                self->private->status == RAIT_STATUS_COMPLETE) {
+                /* This is the first failed device; note it and we'll isolate
+                   later. */
+                failed_op = op;
+                failed_result = result;
+            } else {
+                /* We've encountered multiple failures. OR them together. */
+                failed_result |= result;
+                failed_op = NULL;
+            }
+        }
+    }
+
+    if (failed_op != NULL) {
+        /* We have a single device to isolate. */
+        failed_result = READ_LABEL_STATUS_SUCCESS; /* Recover later */
+        self->private->failed = failed_op->child_index;
+        g_fprintf(stderr, "RAIT array %s Isolated device %s.\n",
+                dself->device_name,
+                failed_op->child->device_name);
+    }
+
+    if (failed_result != READ_LABEL_STATUS_SUCCESS) {
+        /* We had multiple failures or an inconsistency. */
+        rval = failed_result;
+    } else {
+        /* Everything peachy. */
+        rval = READ_LABEL_STATUS_SUCCESS;
+        g_assert(first_success != NULL);
+        if (first_success->volume_label != NULL) {
+            dself->volume_label = g_strdup(first_success->volume_label);
+        }
+        if (first_success->volume_time != NULL) {
+            dself->volume_time = g_strdup(first_success->volume_time);
+        }
+    }
+    
+    g_ptr_array_free_full(ops);
+
+    return rval;
+}
+
+typedef struct {
+    GenericOp base;
+    DeviceAccessMode mode; /* IN */
+    char * label;          /* IN */
+    char * timestamp;      /* IN */
+} StartOp;
+
+/* A GFunc. */
+static void start_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
+    DeviceClass *klass;
+    StartOp * param = data;
+    
+    klass = DEVICE_GET_CLASS(param->base.child);
+    if (klass->start) {
+        param->base.result =
+            GINT_TO_POINTER((klass->start)(param->base.child,
+                                            param->mode, param->label,
+                                            param->timestamp));
+    } else {
+        param->base.result = FALSE;
+    }
+}
+
+static gboolean 
+rait_device_start (Device * dself, DeviceAccessMode mode, char * label,
+                   char * timestamp) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    RaitDevice * self;
+
+    self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        StartOp * op;
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->mode = mode;
+        op->label = g_strdup(label);
+        op->timestamp = g_strdup(timestamp);
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(start_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->start) {
+        return parent_class->start(dself, mode, label, timestamp);
+    } else {
+        return TRUE;
+    }
+}
+
+typedef struct {
+    GenericOp base;
+    const dumpfile_t * info; /* IN */
+} StartFileOp;
+
+/* a GFunc */
+static void start_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
+    StartFileOp * op = data;
+    op->base.result = GINT_TO_POINTER(device_start_file(op->base.child,
+                                                        op->info));
+}
+
+static gboolean
+rait_device_start_file (Device * dself, const dumpfile_t * info) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    RaitDevice * self;
+
+    self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        StartFileOp * op;
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->info = info;
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(start_file_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->start_file) {
+        return parent_class->start_file(dself, info);
+    } else {
+        return TRUE;
+    }
+}
+
+static void find_simple_params(RaitDevice * self,
+                               guint * num_children,
+                               guint * data_children,
+                               int * blocksize) {
+    int num, data;
+    
+    num = self->private->children->len;
+    if (num > 1)
+        data = num - 1;
+    else
+        data = num;
+    if (num_children != NULL)
+        *num_children = num;
+    if (data_children != NULL)
+        *data_children = data;
+
+    if (blocksize != NULL) {
+        *blocksize = device_write_min_size(DEVICE(self));
+    }
+}
+
+typedef struct {
+    GenericOp base;
+    guint size;           /* IN */
+    gpointer data;        /* IN */
+    gboolean short_block; /* IN */
+    gboolean data_needs_free; /* bookkeeping */
+} WriteBlockOp;
+
+/* a GFunc. */
+static void write_block_do_op(gpointer data,
+                              gpointer user_data G_GNUC_UNUSED) {
+    WriteBlockOp * op = data;
+
+    op->base.result =
+        GINT_TO_POINTER(device_write_block(op->base.child, op->size, op->data,
+                                           op->short_block));
+}
+
+/* Parity block generation. Performance of this function can be improved
+   considerably by using larger-sized integers or
+   assembly-coded vector instructions. Parameters are:
+   % data       - All data chunks in series (chunk_size * num_chunks bytes)
+   % parity     - Allocated space for parity block (chunk_size bytes)
+ */
+static void make_parity_block(char * data, char * parity,
+                              guint chunk_size, guint num_chunks) {
+    guint i;
+    bzero(parity, chunk_size);
+    for (i = 0; i < num_chunks - 1; i ++) {
+        guint j;
+        for (j = 0; j < chunk_size; j ++) {
+            parity[j] ^= data[chunk_size*i + j];
+        }
+    }
+}
+
+/* Does the same thing as make_parity_block, but instead of using a
+   single memory chunk holding all chunks, it takes a GPtrArray of
+   chunks. */
+static void make_parity_block_extents(GPtrArray * data, char * parity,
+                                      guint chunk_size) {
+    guint i;
+    bzero(parity, chunk_size);
+    for (i = 0; i < data->len; i ++) {
+        guint j;
+        char * data_chunk;
+        data_chunk = g_ptr_array_index(data, i);
+        for (j = 0; j < chunk_size; j ++) {
+            parity[j] ^= data_chunk[j];
+        }
+    }
+}
+
+/* Does the parity creation algorithm. Allocates and returns a single
+   device block from a larger RAIT block. chunks and chunk are 1-indexed. */
+static char * extract_data_block(char * data, guint size,
+                                 guint chunks, guint chunk) {
+    char * rval;
+    guint chunk_size;
+
+    g_return_val_if_fail(chunks > 0 && chunk > 0 && chunk <= chunks, NULL);
+    g_return_val_if_fail(data != NULL, NULL);
+    g_return_val_if_fail(size > 0 && size % (chunks - 1) == 0, NULL);
+
+    chunk_size = size / (chunks - 1);
+    rval = malloc(chunk_size);
+    if (chunks != chunk) {
+        /* data block. */
+        memcpy(rval, data + chunk_size * (chunk - 1), chunk_size);
+    } else {
+        make_parity_block(data, rval, chunk_size, chunks);
+    }
+    
+    return rval;
+}
+
+static gboolean 
+rait_device_write_block (Device * dself, guint size, gpointer data,
+                         gboolean last_block) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    guint data_children, num_children;
+    int blocksize;
+    RaitDevice * self;
+
+    self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    find_simple_params(RAIT_DEVICE(self), &num_children, &data_children,
+                       &blocksize);
+    num_children = self->private->children->len;
+    if (num_children != 1)
+        data_children = num_children - 1;
+    else
+        data_children = num_children;
+    
+    g_return_val_if_fail(size % data_children == 0 || last_block, FALSE);
+
+    if (last_block) {
+        char *new_data;
+
+        new_data = malloc(blocksize);
+        memcpy(new_data, data, size);
+        bzero(new_data + size, blocksize - size);
+
+        data = new_data;
+        size = blocksize;
+    }
+
+    ops = g_ptr_array_sized_new(num_children);
+    for (i = 0; i < self->private->children->len; i ++) {
+        WriteBlockOp * op;
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->short_block = last_block;
+        op->size = size / data_children;
+        if (num_children <= 2) {
+            op->data = data;
+            op->data_needs_free = FALSE;
+        } else {
+            op->data_needs_free = TRUE;
+            op->data = extract_data_block(data, size, num_children, i + 1);
+        }
+        g_ptr_array_add(ops, op);
+    }
+
+    if (last_block) {
+        amfree(data);
+    }
+    
+    do_rait_child_ops(write_block_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    for (i = 0; i < self->private->children->len; i ++) {
+        WriteBlockOp * op = g_ptr_array_index(ops, i);
+        if (op->data_needs_free)
+            free(op->data);
+    }
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else {
+        /* We don't chain up here because we must handle finish_file
+           differently. If we were called with last_block, then the
+           children have already called finish_file themselves. So we
+           update the device block numbers manually. */
+        dself->block ++;
+        if (last_block)
+            dself->in_file = FALSE;
+
+        return TRUE;
+    }
+}
+
+/* A GFunc */
+static void finish_file_do_op(gpointer data,
+                              gpointer user_data G_GNUC_UNUSED) {
+    GenericOp * op = data;
+    op->result = GINT_TO_POINTER(device_finish_file(op->child));
+}
+
+static gboolean 
+rait_device_finish_file (Device * self) {
+    GPtrArray * ops;
+    gboolean success;
+
+    ops = make_generic_boolean_op_array(RAIT_DEVICE(self));
+    
+    do_rait_child_ops(finish_file_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->finish_file) {
+        return parent_class->finish_file(self);
+    } else {
+        return TRUE;
+    }
+}
+
+typedef struct {
+    GenericOp base;
+    guint requested_file;                /* IN */
+    guint actual_file;                   /* OUT */
+} SeekFileOp;
+
+/* a GFunc. */
+static void seek_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
+    SeekFileOp * op = data;
+    op->base.result = device_seek_file(op->base.child, op->requested_file);
+    op->actual_file = op->base.child->file;
+}
+
+static dumpfile_t * 
+rait_device_seek_file (Device * dself, guint file) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    dumpfile_t * rval;
+    RaitDevice * self = RAIT_DEVICE(dself);
+    guint actual_file = 0;
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        SeekFileOp * op;
+        if ((int)i == self->private->failed)
+            continue; /* This device is broken. */
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->base.child_index = i;
+        op->requested_file = file;
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(seek_file_do_op, ops, NULL);
+
+    /* This checks for NULL values, but we still have to check for
+       consistant headers. */
+    success = g_ptr_array_union_robust(RAIT_DEVICE(self),
+                                       ops, extract_boolean_pointer_op);
+
+    rval = NULL;
+    for (i = 0; i < self->private->children->len; i ++) {
+        SeekFileOp * this_op;
+        dumpfile_t * this_result;
+        guint this_actual_file;
+        if ((int)i == self->private->failed)
+            continue;
+        
+        this_op = (SeekFileOp*)g_ptr_array_index(ops, i);
+        this_result = this_op->base.result;
+        this_actual_file = this_op->actual_file;
+
+        if (rval == NULL) {
+            rval = this_result;
+            actual_file = this_actual_file;
+        } else {
+            if (headers_are_equal(rval, this_result) &&
+                actual_file == this_actual_file) {
+                /* Do nothing. */
+            } else {
+                success = FALSE;
+            }
+            free(this_result);
+        }
+    }
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        amfree(rval);
+        return NULL;
+    } else if (parent_class->seek_file) {
+        parent_class->seek_file(dself, file);
+    }
+
+    return rval;
+}
+
+typedef struct {
+    GenericOp base;
+    guint64 block; /* IN */
+} SeekBlockOp;
+
+/* a GFunc. */
+static void seek_block_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
+    SeekBlockOp * op = data;
+    op->base.result =
+        GINT_TO_POINTER(device_seek_block(op->base.child, op->block));
+}
+
+static gboolean 
+rait_device_seek_block (Device * dself, guint64 block) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+
+    RaitDevice * self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        SeekBlockOp * op;
+        if ((int)i == self->private->failed)
+            continue; /* This device is broken. */
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->base.child_index = i;
+        op->block = block;
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(seek_block_do_op, ops, NULL);
+
+    success = g_ptr_array_union_robust(RAIT_DEVICE(self),
+                                       ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->seek_block) {
+        return parent_class->seek_block(dself, block);
+    } else {
+        return success;
+    }
+}
+
+typedef struct {
+    GenericOp base;
+    gpointer buffer; /* IN */
+    int read_size;      /* IN/OUT -- note not a pointer */
+    int desired_read_size; /* bookkeeping */
+} ReadBlockOp;
+
+/* a GFunc. */
+static void read_block_do_op(gpointer data,
+                             gpointer user_data G_GNUC_UNUSED) {
+    ReadBlockOp * op = data;
+    op->base.result =
+        GINT_TO_POINTER(device_read_block(op->base.child, op->buffer,
+                                          &(op->read_size)));
+}
+
+/* A BooleanExtractor. This one checks for a successful read. */
+static gboolean extract_boolean_read_block_op_data(gpointer data) {
+    ReadBlockOp * op = data;
+    return GPOINTER_TO_INT(op->base.result) == op->desired_read_size;
+}
+
+/* A BooleanExtractor. This one checks for EOF. */
+static gboolean extract_boolean_read_block_op_eof(gpointer data) {
+    ReadBlockOp * op = data;
+    return op->base.child->is_eof;
+}
+
+static int g_ptr_array_count(GPtrArray * array, BooleanExtractor filter) {
+    int rval;
+    unsigned int i;
+    rval = 0;
+    for (i = 0; i < array->len ; i++) {
+        if (filter(g_ptr_array_index(array, i)))
+            rval ++;
+    }
+    return rval;
+}
+
+static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops,
+                                      gpointer buf) {
+    guint num_children, data_children;
+    int blocksize, child_blocksize;
+    guint i;
+    int parity_child;
+    gpointer parity_block = NULL;
+    gboolean success;
+
+    success = TRUE;
+    find_simple_params(self, &num_children, &data_children, &blocksize);
+    if (num_children > 1)
+        parity_child = num_children - 1;
+    else
+        parity_child = -1;
+
+    child_blocksize = blocksize / data_children;
+
+    for (i = 0; i < ops->len; i ++) {
+        ReadBlockOp * op = g_ptr_array_index(ops, i);
+        if (!extract_boolean_read_block_op_data(op))
+            continue;
+        if ((int)(op->base.child_index) == parity_child) {
+            parity_block = op->buffer;
+        } else {
+            memcpy((char *)buf + child_blocksize * op->base.child_index, op->buffer,
+                   child_blocksize);
+        }
+    }
+
+    if (self->private->status == RAIT_STATUS_COMPLETE) {
+        if (num_children >= 2) {
+            /* Verify the parity block. This code is inefficient but
+               does the job for the 2-device case, too. */
+            gpointer constructed_parity;
+            GPtrArray * data_extents;
+            
+            constructed_parity = malloc(child_blocksize);
+            data_extents = g_ptr_array_sized_new(data_children);
+            for (i = 0; i < data_children; i ++) {
+                ReadBlockOp * op = g_ptr_array_index(ops, i);
+                g_assert(extract_boolean_read_block_op_data(op));
+                if ((int)op->base.child_index == parity_child)
+                    continue;
+                g_ptr_array_add(data_extents, op->buffer);
+            }
+            make_parity_block_extents(data_extents, constructed_parity,
+                                      child_blocksize);
+            
+            if (0 != memcmp(parity_block, constructed_parity,
+                            child_blocksize)) {
+                g_fprintf(stderr, "RAIT is inconsistant: "
+                        "Parity block did not match data blocks.\n");
+                success = FALSE;
+            }
+            g_ptr_array_free(data_extents, TRUE);
+            amfree(constructed_parity);
+        } else { /* do nothing. */ }
+    } else if (self->private->status == RAIT_STATUS_DEGRADED) {
+        /* We are in degraded mode. What's missing? */
+        if (self->private->failed == parity_child) {
+            /* do nothing. */
+        } else if (num_children >= 2) {
+            /* Reconstruct failed block from parity block. */
+            GPtrArray * data_extents = g_ptr_array_new();            
+
+            for (i = 0; i < data_children; i ++) {
+                ReadBlockOp * op = g_ptr_array_index(ops, i);
+                if (!extract_boolean_read_block_op_data(op))
+                    continue;
+                g_ptr_array_add(data_extents, op->buffer);
+            }
+
+            /* Conveniently, the reconstruction is the same procedure
+               as the parity generation. This even works if there is
+               only one remaining device! */
+            make_parity_block_extents(data_extents,
+                                      (char *)buf + (child_blocksize *
+                                             self->private->failed),
+                                      child_blocksize);
+
+            /* The array members belong to our ops argument. */
+            g_ptr_array_free(data_extents, TRUE);
+        } else {
+            g_assert_not_reached();
+        }
+    } else {
+        success = FALSE;
+    }
+    return success;
+}
+
+static int
+rait_device_read_block (Device * dself, gpointer buf, int * size) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    guint num_children, data_children;
+    int blocksize;
+
+    RaitDevice * self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, -1);
+
+    find_simple_params(self, &num_children, &data_children,
+                       &blocksize);
+
+    g_return_val_if_fail(*size >= (int)device_write_min_size(dself), -1);
+    g_assert(blocksize % data_children == 0); /* If not we are screwed */
+
+
+    ops = g_ptr_array_sized_new(num_children);
+    for (i = 0; i < num_children; i ++) {
+        ReadBlockOp * op;
+        if ((int)i == self->private->failed)
+            continue; /* This device is broken. */
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->base.child_index = i;
+        op->buffer = malloc(blocksize / data_children);
+        op->desired_read_size = op->read_size = blocksize / data_children;
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(read_block_do_op, ops, NULL);
+
+    if (g_ptr_array_count(ops, extract_boolean_read_block_op_data)) {
+        success =
+            g_ptr_array_union_robust(RAIT_DEVICE(self),
+                                     ops,
+                                     extract_boolean_read_block_op_data) &&
+            raid_block_reconstruction(RAIT_DEVICE(self),
+                                      ops, buf);
+    } else {
+        success = FALSE;
+        if (g_ptr_array_union_robust(RAIT_DEVICE(self),
+                                     ops,
+                                     extract_boolean_read_block_op_eof)) {
+            /* We hit EOF. */
+            dself->is_eof = TRUE;
+        }
+    }
+
+    for (i = 0; i < ops->len; i ++) {
+        ReadBlockOp * op = g_ptr_array_index(ops, i);
+        amfree(op->buffer);
+    }
+    g_ptr_array_free_full(ops);
+
+    if (success) {
+        if (parent_class->read_block)
+            parent_class->read_block(dself, buf, size);
+        return blocksize;
+    } else {
+        return -1;
+    }
+}
+
+typedef struct {
+    GenericOp base;
+    DevicePropertyId id;   /* IN */
+    GValue value;          /* IN/OUT */
+    gboolean label_changed; /* Did the device label change? OUT; _set only*/
+} PropertyOp;
+
+/* Creates a GPtrArray of PropertyOf for a get or set operation. */
+static GPtrArray * make_property_op_array(RaitDevice * self,
+                                          DevicePropertyId id,
+                                          GValue * value) {
+    guint i;
+    GPtrArray * ops;
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        PropertyOp * op;
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->id = id;
+        bzero(&(op->value), sizeof(op->value));
+        if (value != NULL) {
+            g_value_unset_copy(value, &(op->value));
+        }
+        g_ptr_array_add(ops, op);
+    }
+
+    return ops;
+}
+
+/* A GFunc. */
+static void property_get_do_op(gpointer data,
+                               gpointer user_data G_GNUC_UNUSED) {
+    PropertyOp * op = data;
+
+    bzero(&(op->value), sizeof(op->value));
+    op->base.result =
+        GINT_TO_POINTER(device_property_get(op->base.child, op->id,
+                                            &(op->value)));
+}
+
+/* Merge ConcurrencyParadigm results. */
+static gboolean property_get_concurrency(GPtrArray * ops, GValue * val) {
+    ConcurrencyParadigm result = CONCURRENCY_PARADIGM_RANDOM_ACCESS;
+    guint i = 0;
+    
+    for (i = 0; i < ops->len; i ++) {
+        ConcurrencyParadigm cur;
+        PropertyOp * op = g_ptr_array_index(ops, i);
+        g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) ==
+                             CONCURRENCY_PARADIGM_TYPE, FALSE);
+        cur = g_value_get_enum(&(op->value));
+        if (result == CONCURRENCY_PARADIGM_EXCLUSIVE ||
+            cur == CONCURRENCY_PARADIGM_EXCLUSIVE) {
+            result = CONCURRENCY_PARADIGM_EXCLUSIVE;
+        } else if (result == CONCURRENCY_PARADIGM_SHARED_READ ||
+                   cur == CONCURRENCY_PARADIGM_SHARED_READ) {
+            result = CONCURRENCY_PARADIGM_SHARED_READ;
+        } else if (result == CONCURRENCY_PARADIGM_RANDOM_ACCESS &&
+                   cur == CONCURRENCY_PARADIGM_RANDOM_ACCESS) {
+            result = CONCURRENCY_PARADIGM_RANDOM_ACCESS;
+        } else {
+            g_return_val_if_fail(FALSE, FALSE);
+        }
+    }
+
+    g_value_unset_init(val, CONCURRENCY_PARADIGM_TYPE);
+    g_value_set_enum(val, result);
+    return TRUE;
+}
+
+/* Merge StreamingRequirement results. */
+static gboolean property_get_streaming(GPtrArray * ops, GValue * val) {
+    StreamingRequirement result = STREAMING_REQUIREMENT_NONE;
+    guint i = 0;
+    
+    for (i = 0; i < ops->len; i ++) {
+        StreamingRequirement cur;
+        PropertyOp * op = g_ptr_array_index(ops, i);
+        g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) ==
+                             STREAMING_REQUIREMENT_TYPE, FALSE);
+        cur = g_value_get_enum(&(op->value));
+        if (result == STREAMING_REQUIREMENT_REQUIRED ||
+            cur == STREAMING_REQUIREMENT_REQUIRED) {
+            result = STREAMING_REQUIREMENT_REQUIRED;
+        } else if (result == STREAMING_REQUIREMENT_DESIRED ||
+                   cur == STREAMING_REQUIREMENT_DESIRED) {
+            result = STREAMING_REQUIREMENT_DESIRED;
+        } else if (result == STREAMING_REQUIREMENT_NONE &&
+                   cur == STREAMING_REQUIREMENT_NONE) {
+            result = STREAMING_REQUIREMENT_NONE;
+        } else {
+            g_return_val_if_fail(FALSE, FALSE);
+        }
+    }
+
+    g_value_unset_init(val, STREAMING_REQUIREMENT_TYPE);
+    g_value_set_enum(val, result);
+    return TRUE;
+}
+    
+/* Merge MediaAccessMode results. */
+static gboolean property_get_medium_type(GPtrArray * ops, GValue * val) {
+    MediaAccessMode result = 0;
+    guint i = 0;
+
+    for (i = 0; i < ops->len; i ++) {
+        MediaAccessMode cur;
+        PropertyOp * op = g_ptr_array_index(ops, i);
+        g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) ==
+                             MEDIA_ACCESS_MODE_TYPE, FALSE);
+        cur = g_value_get_enum(&(op->value));
+        
+        if (i == 0) {
+            result = cur;
+        } else if ((result == MEDIA_ACCESS_MODE_READ_ONLY &&
+                    cur == MEDIA_ACCESS_MODE_WRITE_ONLY) ||
+                   (result == MEDIA_ACCESS_MODE_WRITE_ONLY &&
+                    cur == MEDIA_ACCESS_MODE_READ_ONLY)) {
+            /* Invalid combination; one device can only read, other
+               can only write. */
+            return FALSE;
+        } else if (result == MEDIA_ACCESS_MODE_READ_ONLY ||
+                   cur == MEDIA_ACCESS_MODE_READ_ONLY) {
+            result = MEDIA_ACCESS_MODE_READ_ONLY;
+        } else if (result == MEDIA_ACCESS_MODE_WRITE_ONLY ||
+                   cur == MEDIA_ACCESS_MODE_WRITE_ONLY) {
+            result = MEDIA_ACCESS_MODE_WRITE_ONLY;
+        } else if (result == MEDIA_ACCESS_MODE_WORM ||
+                   cur == MEDIA_ACCESS_MODE_WORM) {
+            result = MEDIA_ACCESS_MODE_WORM;
+        } else if (result == MEDIA_ACCESS_MODE_READ_WRITE &&
+                   cur == MEDIA_ACCESS_MODE_READ_WRITE) {
+            result = MEDIA_ACCESS_MODE_READ_WRITE;
+        } else {
+            g_return_val_if_fail(FALSE, FALSE);
+        }
+    }
+    
+    g_value_unset_init(val, MEDIA_ACCESS_MODE_TYPE);
+    g_value_set_enum(val, result);
+    return TRUE;
+}
+    
+/* Merge QualifiedSize results. */
+static gboolean property_get_free_space(GPtrArray * ops, GValue * val) {
+    QualifiedSize result;
+    guint i = 0;
+
+    for (i = 0; i < ops->len; i ++) {
+        QualifiedSize cur;
+        PropertyOp * op = g_ptr_array_index(ops, i);
+        g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) ==
+                             QUALIFIED_SIZE_TYPE, FALSE);
+        cur = *(QualifiedSize*)(g_value_get_boxed(&(op->value)));
+
+        if (result.accuracy != cur.accuracy) {
+            result.accuracy = SIZE_ACCURACY_ESTIMATE;
+        }
+
+        if (result.accuracy == SIZE_ACCURACY_UNKNOWN &&
+            cur.accuracy != SIZE_ACCURACY_UNKNOWN) {
+            result.bytes = cur.bytes;
+        } else if (result.accuracy != SIZE_ACCURACY_UNKNOWN &&
+                   cur.accuracy == SIZE_ACCURACY_UNKNOWN) {
+            /* result.bytes unchanged. */
+        } else {
+            result.bytes = MIN(result.bytes, cur.bytes);
+        }
+    }
+
+    g_value_unset_init(val, QUALIFIED_SIZE_TYPE);
+    g_value_set_boxed(val, &result);
+    return TRUE;
+}
+    
+/* Merge boolean results by ANDing them together. */
+static gboolean property_get_boolean_and(GPtrArray * ops, GValue * val) {
+    gboolean result = FALSE;
+    guint i = 0;
+
+    for (i = 0; i < ops->len; i ++) {
+        gboolean cur;
+        PropertyOp * op = g_ptr_array_index(ops, i);
+        g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&(op->value)), FALSE);
+        cur = g_value_get_boolean(&(op->value));
+
+        result = result && cur;
+    }
+
+    g_value_unset_init(val, G_TYPE_BOOLEAN);
+    g_value_set_boolean(val, result);
+    return TRUE;
+}
+    
+
+static gboolean 
+rait_device_property_get (Device * dself, DevicePropertyId id, GValue * val) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+    GValue result;
+    GValue * first_value;
+    RaitDevice * self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    /* Some properties are handled completely differently. */
+    if (id == PROPERTY_BLOCK_SIZE) {
+        g_value_unset_init(val, G_TYPE_INT);
+        g_value_set_int(val, self->private->block_size);
+        return TRUE;
+    } else if (id == PROPERTY_MIN_BLOCK_SIZE ||
+        id == PROPERTY_MAX_BLOCK_SIZE) {
+        g_value_unset_init(val, G_TYPE_UINT);
+        g_value_set_uint(val, self->private->block_size);
+        return TRUE;
+    } else if (id == PROPERTY_CANONICAL_NAME) {
+        if (parent_class->property_get != NULL) {
+            return parent_class->property_get(dself, id, val);
+        } else {
+            return FALSE;
+        }
+    }
+
+    ops = make_property_op_array(self, id, NULL);
+    
+    do_rait_child_ops(property_get_do_op, ops, NULL);
+
+    if (id == PROPERTY_CONCURRENCY) {
+        success = property_get_concurrency(ops, val);
+    } else if (id == PROPERTY_STREAMING) { 
+        success = property_get_streaming(ops, val);
+    } else if (id == PROPERTY_APPENDABLE ||
+               id == PROPERTY_PARTIAL_DELETION) {
+        success = property_get_boolean_and(ops, val);
+    } else if (id == PROPERTY_MEDIUM_TYPE) {
+        success = property_get_medium_type(ops, val);
+    } else if (id == PROPERTY_FREE_SPACE) {
+        success = property_get_free_space(ops, val);
+    } else {
+        /* Generic handling; if all results are the same, we succeed
+           and return that result. If not, we fail. */
+        success = TRUE;
+        
+        /* Set up comparison value. */
+        bzero(&result, sizeof(result));
+        first_value = &(((PropertyOp*)g_ptr_array_index(ops,0))->value);
+        if (G_IS_VALUE(first_value)) {
+            g_value_unset_copy(first_value, &result);
+        } else {
+            success = FALSE;
+        }
+        
+        for (i = 0; i < ops->len; i ++) {
+            PropertyOp * op = g_ptr_array_index(ops, i);
+            if (!GPOINTER_TO_INT(op->base.result) ||
+                !G_IS_VALUE(first_value) ||
+                !g_value_compare(&result, &(op->value))) {
+                success = FALSE;
+            }
+            g_value_unset(&(op->value));
+        }
+
+        if (success) {
+            memcpy(val, &result, sizeof(result));
+        } else if (G_IS_VALUE(&result)) {
+            g_value_unset(&result);
+        }
+    }
+
+    g_ptr_array_free_full(ops);
+
+    return success;
+}
+
+/* A GFunc. */
+static void property_set_do_op(gpointer data,
+                               gpointer user_data G_GNUC_UNUSED) {
+    PropertyOp * op = data;
+    gboolean label_set = (op->base.child->volume_label != NULL);
+    op->base.result =
+        GINT_TO_POINTER(device_property_set(op->base.child, op->id,
+                                            &(op->value)));
+    op->label_changed = (label_set != (op->base.child->volume_label != NULL));
+}
+
+/* A BooleanExtractor */
+static gboolean extract_label_changed_property_op(gpointer data) {
+    PropertyOp * op = data;
+    return op->label_changed;
+}
+
+/* A GFunc. */
+static void clear_volume_details_do_op(gpointer data,
+                                       gpointer user_data G_GNUC_UNUSED) {
+    GenericOp * op = data;
+    device_clear_volume_details(op->child);
+}
+
+static gboolean 
+rait_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) {
+    RaitDevice * self;
+    GPtrArray * ops;
+    gboolean success;
+    gboolean label_changed;
+
+    self = RAIT_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = make_property_op_array(self, id, val);
+    
+    do_rait_child_ops(property_set_do_op, ops, NULL);
+
+    success = g_ptr_array_union_robust(self, ops, extract_boolean_generic_op);
+    label_changed =
+        g_ptr_array_union_robust(self, ops,
+                                 extract_label_changed_property_op);
+    g_ptr_array_free_full(ops);
+
+    if (label_changed) {
+        /* At least one device considered this property set a label-changing
+         * operation, so now we clear labels on all devices. */
+        ops = make_generic_boolean_op_array(self);
+        do_rait_child_ops(clear_volume_details_do_op, ops, NULL);
+        g_ptr_array_free_full(ops);
+    }
+
+    return success;
+}
+
+typedef struct {
+    GenericOp base;
+    guint filenum;
+} RecycleFileOp;
+
+/* A GFunc */
+static void recycle_file_do_op(gpointer data,
+                               gpointer user_data G_GNUC_UNUSED) {
+    RecycleFileOp * op = data;
+    op->base.result =
+        GINT_TO_POINTER(device_recycle_file(op->base.child, op->filenum));
+}
+
+static gboolean 
+rait_device_recycle_file (Device * dself, guint filenum) {
+    GPtrArray * ops;
+    guint i;
+    gboolean success;
+
+    RaitDevice * self = RAIT_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    ops = g_ptr_array_sized_new(self->private->children->len);
+    for (i = 0; i < self->private->children->len; i ++) {
+        RecycleFileOp * op;
+        op = malloc(sizeof(*op));
+        op->base.child = g_ptr_array_index(self->private->children, i);
+        op->filenum = filenum;
+        g_ptr_array_add(ops, op);
+    }
+    
+    do_rait_child_ops(recycle_file_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->recycle_file) {
+        return parent_class->recycle_file(dself, filenum);
+    } else {
+        return TRUE;
+    }
+}
+
+/* GFunc */
+static void finish_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) {
+    GenericOp * op = data;
+    op->result = GINT_TO_POINTER(device_finish(op->child));
+}
+
+static gboolean 
+rait_device_finish (Device * self) {
+    GPtrArray * ops;
+    gboolean success;
+
+    ops = make_generic_boolean_op_array(RAIT_DEVICE(self));
+    
+    do_rait_child_ops(finish_do_op, ops, NULL);
+
+    success = g_ptr_array_and(ops, extract_boolean_generic_op);
+
+    g_ptr_array_free_full(ops);
+
+    if (!success) {
+        return FALSE;
+    } else if (parent_class->finish) {
+        return parent_class->finish(self);
+    } else {
+        return TRUE;
+    }
+}
+
+Device *
+rait_device_factory (char * type, char * name) {
+    Device * rval;
+    g_assert(0 == strcmp(type, "rait"));
+    rval = DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL));
+    if (!device_open_device(rval, name)) {
+        g_object_unref(rval);
+        return NULL;
+    } else {
+        return rval;
+    }
+}
+
+Device * rait_device_new_from_devices(Device ** devices) {
+    RaitDevice * rval;
+    int i;
+    gboolean success = TRUE;
+
+    g_return_val_if_fail(devices != NULL && *devices != NULL, NULL);
+
+    rval = RAIT_DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL));
+
+    for (i = 0; devices[i] != NULL; i ++) {
+        g_assert(IS_DEVICE(devices[i]));
+        if (devices[i]->access_mode != ACCESS_NULL) {
+            success = FALSE;
+            break;
+        }
+        g_object_ref(devices[i]);
+        g_ptr_array_add(PRIVATE(rval)->children, devices[i]);
+    }
+
+    success = success && find_block_size(rval);
+
+    if (!success) {
+        g_ptr_array_free(PRIVATE(rval)->children, TRUE);
+        return NULL;
+    } else {
+        register_properties(rval);
+
+        return DEVICE(rval);
+    }
+}
+
+void 
+rait_device_register (void) {
+    static const char * device_prefix_list[] = {"rait", NULL};
+    register_device(rait_device_factory, device_prefix_list);
+}
diff --git a/device-src/rait-device.h b/device-src/rait-device.h
new file mode 100644 (file)
index 0000000..b7df6bb
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The RAIT device encapsulates some number of other devices into a single
+ * redundant device. */
+
+#ifndef RAIT_DEVICE_H
+#define RAIT_DEVICE_H
+
+#include <glib.h>
+#include <glib-object.h>
+#include "device.h"
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_RAIT_DEVICE       (rait_device_get_type())
+#define RAIT_DEVICE(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice)
+#define RAIT_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice const)
+#define RAIT_DEVICE_CLASS(klass)       G_TYPE_CHECK_CLASS_CAST((klass), rait_device_get_type(), RaitDeviceClass)
+#define IS_RAIT_DEVICE(obj)    G_TYPE_CHECK_INSTANCE_TYPE((obj), rait_device_get_type ())
+
+#define RAIT_DEVICE_GET_CLASS(obj)     G_TYPE_INSTANCE_GET_CLASS((obj), rait_device_get_type(), RaitDeviceClass)
+
+/*
+ * Main object structure
+ */
+typedef struct RaitDevicePrivate_s RaitDevicePrivate;
+typedef struct RaitDevice_s {
+    Device __parent__;
+
+    RaitDevicePrivate * private;
+} RaitDevice;
+
+/*
+ * Class definition
+ */
+typedef struct _RaitDeviceClass RaitDeviceClass;
+struct _RaitDeviceClass {
+    DeviceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  rait_device_get_type    (void);
+Device * rait_device_factory   (char * type,
+                                 char * name);
+/* Pass this factory a NULL-terminated array of Devices, and it will make a
+   RAIT out of them. The returned device refss the passed devices, so unref
+   them yourself. */
+Device * rait_device_new_from_devices(Device ** devices);
+void   rait_device_register    (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/device-src/s3-device.c b/device-src/s3-device.c
new file mode 100644 (file)
index 0000000..ca83d52
--- /dev/null
@@ -0,0 +1,1183 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* An S3 device uses Amazon's S3 service (http://www.amazon.com/s3) to store 
+ * data.  It stores data in keys named with a user-specified prefix, inside a
+ * user-specified bucket.  Data is stored in the form of numbered (large) 
+ * blocks. 
+ */
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <regex.h>
+#include <time.h>
+#include "util.h"
+#include "amanda.h"
+#include "conffile.h"
+#include "device.h"
+#include "s3-device.h"
+#include <curl/curl.h>
+#ifdef HAVE_OPENSSL_HMAC_H
+# include <openssl/hmac.h>
+#else
+# ifdef HAVE_CRYPTO_HMAC_H
+#  include <crypto/hmac.h>
+# else
+#  ifdef HAVE_HMAC_H
+#   include <hmac.h>
+#  endif
+# endif
+#endif
+
+/*
+ * Constants and static data
+ */
+
+/* Maximum key length as specified in the S3 documentation
+ * (*excluding* null terminator) */
+#define S3_MAX_KEY_LENGTH 1024
+
+#define S3_DEVICE_MIN_BLOCK_SIZE 1024
+#define S3_DEVICE_MAX_BLOCK_SIZE (10*1024*1024)
+
+/* This goes in lieu of file number for metadata. */
+#define SPECIAL_INFIX "special-"
+
+/* pointer to the class of our parent */
+static DeviceClass *parent_class = NULL;
+
+/*
+ * prototypes
+ */
+
+/* 
+ * utility functions */
+
+/* Given file and block numbers, return an S3 key.
+ * 
+ * @param self: the S3Device object
+ * @param file: the file number
+ * @param block: the block within that file
+ * @returns: a newly allocated string containing an S3 key.
+ */
+static char * 
+file_and_block_to_key(S3Device *self, 
+                      int file, 
+                      guint64 block);
+
+/* Given the name of a special file (such as 'tapestart'), generate
+ * the S3 key to use for that file.
+ *
+ * @param self: the S3Device object
+ * @param special_name: name of the special file
+ * @param file: a file number to include; omitted if -1
+ * @returns: a newly alocated string containing an S3 key.
+ */
+static char * 
+special_file_to_key(S3Device *self, 
+                    char *special_name, 
+                    int file);
+/* Write an amanda header file to S3.
+ *
+ * @param self: the S3Device object
+ * @param label: the volume label
+ * @param timestamp: the volume timestamp
+ */
+static gboolean 
+write_amanda_header(S3Device *self, 
+                    char *label, 
+                    char * timestamp);
+
+/* "Fast forward" this device to the end by looking up the largest file number
+ * present and setting the current file number one greater.
+ *
+ * @param self: the S3Device object
+ */
+static gboolean 
+seek_to_end(S3Device *self);
+
+/* Find the number of the last file that contains any data (even just a header). 
+ *
+ * @param self: the S3Device object
+ * @returns: the last file, or -1 in event of an error
+ */
+static int 
+find_last_file(S3Device *self);
+
+/* Delete all blocks in the given file, including the filestart block
+ *
+ * @param self: the S3Device object
+ * @param file: the file to delete
+ */
+static gboolean 
+delete_file(S3Device *self, 
+            int file);
+
+/* Set up self->s3 as best as possible.  Unless SILENT is TRUE,
+ * any problems will generate warnings (with g_warning).  Regardless,
+ * the return value is TRUE iff self->s3 is useable.
+ *
+ * @param self: the S3Device object
+ * @param silent: silence warnings
+ * @returns: TRUE if the handle is set up
+ */
+static gboolean 
+setup_handle(S3Device * self, 
+            gboolean ignore_problems);
+
+/* 
+ * class mechanics */
+
+static void
+s3_device_init(S3Device * o);
+
+static void
+s3_device_class_init(S3DeviceClass * c);
+
+static void
+s3_device_finalize(GObject * o);
+
+static Device*
+s3_device_factory(char * device_type,
+                  char * device_name);
+
+/* 
+ * virtual functions */
+
+static gboolean
+s3_device_open_device(Device *pself, 
+                      char *device_name);
+
+static ReadLabelStatusFlags s3_device_read_label(Device * self);
+
+static gboolean 
+s3_device_start(Device * self, 
+                DeviceAccessMode mode, 
+                char * label, 
+                char * timestamp);
+
+static gboolean 
+s3_device_start_file(Device * self,
+                     const dumpfile_t * jobInfo);
+
+static gboolean 
+s3_device_write_block(Device * self, 
+                      guint size, 
+                      gpointer data, 
+                      gboolean last);
+
+static gboolean 
+s3_device_finish_file(Device * self);
+
+static dumpfile_t* 
+s3_device_seek_file(Device *pself, 
+                    guint file);
+
+static gboolean 
+s3_device_seek_block(Device *pself, 
+                     guint64 block);
+
+static gboolean 
+s3_device_read_block(Device * pself, 
+                     gpointer data, 
+                     int *size_req);
+
+static gboolean 
+s3_device_recycle_file(Device *pself, 
+                       guint file);
+
+static gboolean s3_device_property_set(Device * p_self, DevicePropertyId id,
+                                       GValue * val);
+static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id,
+                                       GValue * val);
+/*
+ * Private functions
+ */
+
+/* {{{ file_and_block_to_key */
+static char *
+file_and_block_to_key(S3Device *self, 
+                      int file, 
+                      guint64 block)
+{
+    char *s3_key = g_strdup_printf("%sf%08x-b%016llx.data",
+                                   self->prefix, file, (long long unsigned int)block);
+    g_assert(strlen(s3_key) <= S3_MAX_KEY_LENGTH);
+    return s3_key;
+}
+/* }}} */
+
+/* {{{ special_file_to_key */
+static char *
+special_file_to_key(S3Device *self, 
+                    char *special_name, 
+                    int file)
+{
+    if (file == -1)
+        return g_strdup_printf("%s" SPECIAL_INFIX "%s", self->prefix, special_name);
+    else
+        return g_strdup_printf("%sf%08x-%s", self->prefix, file, special_name);
+}
+/* }}} */
+
+/* {{{ write_amanda_header */
+static gboolean
+write_amanda_header(S3Device *self, 
+                    char *label, 
+                    char * timestamp)
+{
+    char * amanda_header = NULL;
+    char * key = NULL;
+    int header_size;
+    gboolean header_fits, result;
+    dumpfile_t * dumpinfo = NULL;
+
+    /* build the header */
+    dumpinfo = make_tapestart_header(DEVICE(self), label, timestamp);
+    amanda_header = device_build_amanda_header(DEVICE(self), dumpinfo, 
+                                               &header_size, &header_fits);
+    if (!header_fits) {
+        fprintf(stderr,
+                _("Amanda tapestart header won't fit in a single block!\n"));
+       g_free(amanda_header);
+       return FALSE;
+    }
+
+    /* write out the header and flush the uploads. */
+    key = special_file_to_key(self, "tapestart", -1);
+    result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size);
+    g_free(amanda_header);
+    g_free(key);
+
+    if (!result) {
+        fprintf(stderr, _("While writing amanda header: %s\n"),
+                s3_strerror(self->s3));
+    }
+    return result;
+}
+/* }}} */
+
+/* {{{ seek_to_end */
+static gboolean
+seek_to_end(S3Device *self) {
+    int last_file;
+
+    Device *pself = DEVICE(self);
+
+    last_file = find_last_file(self);
+    if (last_file < 0)
+        return FALSE;
+
+    pself->file = last_file;
+
+    return TRUE;
+}
+/* }}} */
+
+/* Convert an object name into a file number, assuming the given prefix
+ * length. Returns -1 if the object name is invalid, or 0 if the object name
+ * is a "special" key. */
+static int key_to_file(guint prefix_len, const char * key) {
+    int file;
+    int i;
+    
+    /* skip the prefix */
+    g_return_val_if_fail(strlen(key) > prefix_len, -1);
+
+    key += prefix_len;
+
+    if (strncmp(key, SPECIAL_INFIX, strlen(SPECIAL_INFIX)) == 0) {
+        return 0;
+    }
+    
+    /* check that key starts with 'f' */
+    g_return_val_if_fail(key[0] == 'f', -1);
+    key++;
+    
+    /* check that key is of the form "%08x-" */
+    for (i = 0; i < 8; i++) {
+        if (!(key[i] >= '0' && key[i] <= '9') &&
+            !(key[i] >= 'a' && key[i] <= 'f') &&
+            !(key[i] >= 'A' && key[i] <= 'F')) break;
+    }
+    if (key[i] != '-') return -1;
+    if (i < 8) return -1;
+
+    /* convert the file number */
+    errno = 0;
+    file = strtoul(key, NULL, 16);
+    if (errno != 0) {
+        g_warning(_("unparseable file number '%s'"), key);
+        return -1;
+    }
+    
+    return file;
+}
+
+/* {{{ find_last_file */
+/* Find the number of the last file that contains any data (even just a header). 
+ * Returns -1 in event of an error
+ */
+static int
+find_last_file(S3Device *self) {
+    gboolean result;
+    GSList *keys;
+    unsigned int prefix_len = strlen(self->prefix);
+    int last_file = 0;
+
+    /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */
+    result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys);
+    if (!result) {
+        fprintf(stderr, _("While listing S3 keys: %s\n"),
+                s3_strerror(self->s3));
+        return -1;
+    }
+
+    for (; keys; keys = g_slist_remove(keys, keys->data)) {
+        int file = key_to_file(prefix_len, keys->data);
+
+        /* and if it's the last, keep it */
+        if (file > last_file)
+            last_file = file;
+    }
+
+    return last_file;
+}
+/* }}} */
+
+/* {{{ find_next_file */
+/* Find the number of the file following the requested one, if any. 
+ * Returns 0 if there is no such file or -1 in event of an error
+ */
+static int
+find_next_file(S3Device *self, int last_file) {
+    gboolean result;
+    GSList *keys;
+    unsigned int prefix_len = strlen(self->prefix);
+    int next_file = 0;
+
+    /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */
+    result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys);
+    if (!result) {
+        fprintf(stderr, _("While listing S3 keys: %s\n"),
+                s3_strerror(self->s3));
+        return -1;
+    }
+
+    for (; keys; keys = g_slist_remove(keys, keys->data)) {
+        int file;
+
+        file = key_to_file(prefix_len, (char*)keys->data);
+
+        if (file < 0) {
+            /* Set this in case we don't find a next file; this is not a
+             * hard error, so if we can find a next file we'll return that
+             * instead. */
+            next_file = -1;
+        }
+
+        if (file < next_file && file > last_file) {
+            next_file = file;
+        }
+    }
+
+    return last_file;
+}
+/* }}} */
+
+/* {{{ delete_file */
+static gboolean
+delete_file(S3Device *self,
+            int file)
+{
+    gboolean result;
+    GSList *keys;
+    char *my_prefix = g_strdup_printf("%sf%08x-", self->prefix, file);
+    
+    result = s3_list_keys(self->s3, self->bucket, my_prefix, NULL, &keys);
+    if (!result) {
+        fprintf(stderr, _("While listing S3 keys: %s\n"),
+                s3_strerror(self->s3));
+        return FALSE;
+    }
+
+    /* this will likely be a *lot* of keys */
+    for (; keys; keys = g_slist_remove(keys, keys->data)) {
+        if (self->verbose) g_debug(_("Deleting %s"), (char*)keys->data);
+        if (!s3_delete(self->s3, self->bucket, keys->data)) {
+            fprintf(stderr, _("While deleting key '%s': %s\n"),
+                    (char*)keys->data, s3_strerror(self->s3));
+            g_slist_free(keys);
+            return FALSE;
+        }
+    }
+
+    return TRUE;
+}
+/* }}} */
+
+/*
+ * Class mechanics
+ */
+
+/* {{{ s3_device_register */
+void 
+s3_device_register(void)
+{
+    static const char * device_prefix_list[] = { "s3", NULL };
+    g_assert(s3_init());
+    register_device(s3_device_factory, device_prefix_list);
+}
+/* }}} */
+
+/* {{{ s3_device_get_type */
+GType
+s3_device_get_type(void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (S3DeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) s3_device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (S3Device),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) s3_device_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TYPE_DEVICE, "S3Device", &info,
+                                       (GTypeFlags)0);
+    }
+
+    return type;
+}
+/* }}} */
+
+/* {{{ s3_device_init */
+static void 
+s3_device_init(S3Device * self)
+{
+    Device * o;
+    DeviceProperty prop;
+    GValue response;
+
+    self->initializing = TRUE;
+
+    /* Register property values */
+    o = (Device*)(self);
+    bzero(&response, sizeof(response));
+
+    prop.base = &device_property_concurrency;
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+    g_value_init(&response, CONCURRENCY_PARADIGM_TYPE);
+    g_value_set_enum(&response, CONCURRENCY_PARADIGM_SHARED_READ);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.base = &device_property_streaming;
+    g_value_init(&response, STREAMING_REQUIREMENT_TYPE);
+    g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.base = &device_property_block_size;
+    g_value_init(&response, G_TYPE_INT);
+    g_value_set_int(&response, -1); /* indicates a variable block size; see below */
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.base = &device_property_min_block_size;
+    g_value_init(&response, G_TYPE_UINT);
+    g_value_set_uint(&response, S3_DEVICE_MIN_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_max_block_size;
+    g_value_set_uint(&response, S3_DEVICE_MAX_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_appendable;
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_partial_deletion;
+    g_value_set_boolean(&response, TRUE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_canonical_name;
+    g_value_init(&response, G_TYPE_STRING);
+    g_value_set_static_string(&response, "s3:");
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_medium_access_type;
+    g_value_init(&response, MEDIA_ACCESS_MODE_TYPE);
+    g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+    
+    prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START;
+    prop.base = &device_property_s3_secret_key;
+    device_add_property(o, &prop, NULL);
+    prop.base = &device_property_s3_access_key;
+    device_add_property(o, &prop, NULL);
+#ifdef WANT_DEVPAY
+    prop.base = &device_property_s3_user_token;
+    device_add_property(o, &prop, NULL);
+#endif
+}
+/* }}} */
+
+/* {{{ s3_device_class_init */
+static void 
+s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED)
+{
+    GObjectClass *g_object_class = (GObjectClass*) c;
+    DeviceClass *device_class = (DeviceClass *)c;
+
+    parent_class = g_type_class_ref (TYPE_DEVICE);
+
+    device_class->open_device = s3_device_open_device;
+    device_class->read_label = s3_device_read_label;
+    device_class->start = s3_device_start;
+
+    device_class->start_file = s3_device_start_file;
+    device_class->write_block = s3_device_write_block;
+    device_class->finish_file = s3_device_finish_file;
+
+    device_class->seek_file = s3_device_seek_file;
+    device_class->seek_block = s3_device_seek_block;
+    device_class->read_block = s3_device_read_block;
+    device_class->recycle_file = s3_device_recycle_file;
+
+    device_class->property_set = s3_device_property_set;
+    device_class->property_get = s3_device_property_get;
+
+    g_object_class->finalize = s3_device_finalize;
+}
+/* }}} */
+
+/* {{{ s3_device_factory */
+static Device* 
+s3_device_factory(char * device_type,
+                  char * device_name)
+{
+    Device *rval;
+    S3Device * s3_rval;
+    g_assert(0 == strcmp(device_type, "s3"));
+    rval = DEVICE(g_object_new(TYPE_S3_DEVICE, NULL));
+    s3_rval = (S3Device*)rval;
+
+    if (!device_open_device(rval, device_name)) {
+        g_object_unref(rval);
+        return NULL;
+    } else {
+        s3_rval->initializing = FALSE;
+        return rval;
+    }
+    
+}
+/* }}} */
+
+/*
+ * Virtual function overrides
+ */
+
+/* {{{ s3_device_open_device */
+static gboolean 
+s3_device_open_device(Device *pself, 
+                      char *device_name)
+{
+    S3Device *self = S3_DEVICE(pself);
+    char * name_colon;
+
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    /* Device name may be bucket/prefix, to support multiple volumes in a
+     * single bucket. */
+    name_colon = index(device_name, '/');
+    if (name_colon == NULL) {
+        self->bucket = g_strdup(device_name);
+        self->prefix = g_strdup("");
+    } else {
+        self->bucket = g_strndup(device_name, name_colon - device_name);
+        self->prefix = g_strdup(name_colon + 1);
+    }
+    
+    if (self->bucket == NULL || self->bucket[0] == '\0') {
+        fprintf(stderr, _("Empty bucket name in device %s.\n"), device_name);
+        amfree(self->bucket);
+        amfree(self->prefix);
+        return FALSE;
+    }
+
+    g_debug(_("S3 driver using bucket '%s', prefix '%s'"), self->bucket, self->prefix);
+
+    /* default value */
+    self->verbose = FALSE;
+
+    if (parent_class->open_device) {
+        parent_class->open_device(pself, device_name);
+    }
+
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_device_finalize */
+static void s3_device_finalize(GObject * obj_self) {
+    S3Device *self = S3_DEVICE (obj_self);
+
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+
+    if(self->s3) s3_free(self->s3);
+    if(self->bucket) g_free(self->bucket);
+    if(self->prefix) g_free(self->prefix);
+}
+/* }}} */
+
+static gboolean setup_handle(S3Device * self, G_GNUC_UNUSED gboolean silent) {
+    if (self->s3 == NULL) {
+        if (self->access_key == NULL) {
+           if (!silent) fprintf(stderr, _("No S3 access key specified\n"));
+            return FALSE;
+       }
+       if (self->secret_key == NULL) {
+           if (!silent) fprintf(stderr, _("No S3 secret key specified\n"));
+            return FALSE;
+       }
+#ifdef WANT_DEVPAY
+       if (self->user_token == NULL) {
+           if (!silent) fprintf(stderr, _("No S3 user token specified\n"));
+            return FALSE;
+       }
+#endif
+        self->s3 = s3_open(self->access_key, self->secret_key
+#ifdef WANT_DEVPAY
+                           , self->user_token
+#endif
+                           );
+        if (self->s3 == NULL) {
+            fprintf(stderr, "Internal error creating S3 handle.\n");
+            return FALSE;
+        }
+    }
+
+    s3_verbose(self->s3, self->verbose);
+
+    return TRUE;
+}
+
+/* {{{ s3_device_read_label */
+static ReadLabelStatusFlags
+s3_device_read_label(Device *pself) {
+    S3Device *self = S3_DEVICE(pself);
+    char *key;
+    gpointer buf;
+    guint buf_size;
+    dumpfile_t amanda_header;
+    
+    if (!setup_handle(self, self->initializing))
+        return READ_LABEL_STATUS_DEVICE_ERROR;
+
+    key = special_file_to_key(self, "tapestart", -1);
+    if (!s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE)) {
+        guint response_code;
+        s3_error_code_t s3_error_code;
+        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+
+        /* if it's an expected error (not found), just return FALSE */
+        if (response_code == 404 && 
+             (s3_error_code == S3_ERROR_NoSuchKey || s3_error_code == S3_ERROR_NoSuchBucket)) {
+            g_debug(_("Amanda header not found while reading tapestart header (this is expected for empty tapes)"));
+            return READ_LABEL_STATUS_VOLUME_UNLABELED;
+        }
+
+        /* otherwise, log it and return */
+        fprintf(stderr, _("While trying to read tapestart header: %s\n"),
+                s3_strerror(self->s3));
+        return READ_LABEL_STATUS_DEVICE_ERROR;
+    }
+
+    g_assert(buf != NULL);
+    fh_init(&amanda_header);
+    parse_file_header(buf, &amanda_header, buf_size);
+
+    g_free(buf);
+
+    if (amanda_header.type != F_TAPESTART) {
+        fprintf(stderr, _("Invalid amanda header\n"));
+        return READ_LABEL_STATUS_VOLUME_ERROR;
+    }
+
+    amfree(pself->volume_label);
+    pself->volume_label = g_strdup(amanda_header.name);
+    amfree(pself->volume_time);
+    pself->volume_time = g_strdup(amanda_header.datestamp);
+
+    return READ_LABEL_STATUS_SUCCESS;
+}
+/* }}} */
+
+/* {{{ s3_device_start */
+static gboolean 
+s3_device_start (Device * pself, DeviceAccessMode mode,
+                 char * label, char * timestamp) {
+    S3Device * self;
+    int file, last_file;
+
+    self = S3_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+
+    if (!setup_handle(self, FALSE))
+        return FALSE;
+
+    /* try creating the bucket, in case it doesn't exist */
+    if (mode != ACCESS_READ && !s3_make_bucket(self->s3, self->bucket)) {
+        guint response_code;
+        s3_error_code_t s3_error_code;
+        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+
+        /* if it isn't an expected error (bucket already exists),
+         * return FALSE */
+        if (response_code != 409 ||
+            s3_error_code != S3_ERROR_BucketAlreadyExists) {
+            fprintf(stderr, _("While creating new S3 bucket: %s\n"),
+                    s3_strerror(self->s3));
+            return FALSE;
+        }
+    }
+
+    /* call up to the parent (Device) to set access_mode, volume_label,
+     * and volume_time, either from the arguments (ACCESS_WRITE) or by 
+     * reading from the 0th file (otherwise)
+     */
+    if (parent_class->start) 
+        if (!parent_class->start((Device*)self, mode, label, timestamp))
+            return FALSE;
+
+    /* take care of any dirty work for this mode */
+    switch (mode) {
+        case ACCESS_READ:
+            break;
+
+        case ACCESS_WRITE:
+            /* delete all files */
+            last_file = find_last_file(self);
+            if (last_file < 0) return FALSE;
+            for (file = 0; file <= last_file; file++) {
+                if (!delete_file(self, file)) return FALSE;
+            }
+
+            /* write a new amanda header */
+            if (!write_amanda_header(self, label, timestamp)) {
+                return FALSE;
+            }
+            break;
+
+        case ACCESS_APPEND:
+            return seek_to_end(self);
+            break;
+        case ACCESS_NULL:
+            g_assert_not_reached();
+    }
+
+    g_assert(pself->access_mode == mode);
+
+    return TRUE;
+}
+/* }}} */
+
+static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id,
+                                       GValue * val) {
+    S3Device * self;
+    const DevicePropertyBase * base;
+
+    self = S3_DEVICE(p_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    base = device_property_get_by_id(id);
+    g_return_val_if_fail(self != NULL, FALSE);
+    
+    g_value_unset_init(val, base->type);
+    
+    if (id == PROPERTY_S3_SECRET_KEY) {
+        if (self->secret_key != NULL) {
+            g_value_set_string(val, self->secret_key);
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    } else if (id == PROPERTY_S3_ACCESS_KEY) {
+        if (self->access_key != NULL) {
+            g_value_set_string(val, self->access_key);
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    }
+#ifdef WANT_DEVPAY
+    else if (id == PROPERTY_S3_USER_TOKEN) {
+        if (self->user_token != NULL) {
+            g_value_set_string(val, self->user_token);
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    }
+#endif /* WANT_DEVPAY */
+    else if (id == PROPERTY_VERBOSE) {
+        g_value_set_boolean(val, self->verbose);
+        return TRUE;
+    } else {
+        /* chain up */
+        if (parent_class->property_get) {
+            return (parent_class->property_get)(p_self, id, val);
+        } else {
+            return FALSE;
+        }
+    }
+
+    g_assert_not_reached();
+}
+
+static gboolean s3_device_property_set(Device * p_self, DevicePropertyId id,
+                                       GValue * val) {
+    S3Device * self;
+    const DevicePropertyBase * base;
+
+    self = S3_DEVICE(p_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    base = device_property_get_by_id(id);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE);
+
+    if (id == PROPERTY_S3_SECRET_KEY) {
+        if (p_self->access_mode != ACCESS_NULL)
+            return FALSE;
+        amfree(self->secret_key);
+        self->secret_key = g_value_dup_string(val);
+        device_clear_volume_details(p_self);
+        return TRUE;
+    } else if (id == PROPERTY_S3_ACCESS_KEY) {
+        if (p_self->access_mode != ACCESS_NULL)
+            return FALSE;
+        amfree(self->access_key);
+        self->access_key = g_value_dup_string(val);
+        device_clear_volume_details(p_self);
+        return TRUE;
+    }
+#ifdef WANT_DEVPAY
+    else if (id == PROPERTY_S3_USER_TOKEN) {
+        if (p_self->access_mode != ACCESS_NULL)
+            return FALSE;
+        amfree(self->user_token);
+        self->user_token = g_value_dup_string(val);
+        device_clear_volume_details(p_self);
+        return TRUE;
+    }
+#endif /* WANT_DEVPAY */
+    else if (id == PROPERTY_VERBOSE) {
+        self->verbose = g_value_get_boolean(val);
+       /* Our S3 handle may not yet have been instantiated; if so, it will
+        * get the proper verbose setting when it is created */
+       if (self->s3)
+           s3_verbose(self->s3, self->verbose);
+       return TRUE;
+    } else {
+        if (parent_class->property_set) {
+            return (parent_class->property_set)(p_self, id, val);
+        } else {
+            return FALSE;
+        }
+    }
+
+    g_assert_not_reached();
+}
+
+/* functions for writing */
+
+/* {{{ s3_device_start_file */
+
+static gboolean
+s3_device_start_file (Device *pself, const dumpfile_t *jobInfo) {
+    S3Device *self = S3_DEVICE(pself);
+    char *amanda_header;
+    int header_size;
+    gboolean header_fits, result;
+    char *key;
+
+    g_return_val_if_fail (self != NULL, FALSE);
+
+    /* Build the amanda header. */
+    amanda_header = device_build_amanda_header(pself, jobInfo,
+                                               &header_size, &header_fits);
+    g_return_val_if_fail(amanda_header != NULL, FALSE);
+    g_return_val_if_fail(header_fits, FALSE);
+
+    /* set the file and block numbers correctly */
+    pself->file = (pself->file > 0)? pself->file+1 : 1;
+    pself->block = 0;
+    pself->in_file = TRUE;
+
+    /* write it out as a special block (not the 0th) */
+    key = special_file_to_key(self, "filestart", pself->file);
+    result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size);
+    g_free(amanda_header);
+    g_free(key);
+    if (!result) {
+        fprintf(stderr, _("While writing filestart header: %s\n"),
+                s3_strerror(self->s3));
+        return FALSE;
+    }
+
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_device_write_block */
+static gboolean
+s3_device_write_block (Device * pself, guint size, gpointer data,
+                         gboolean last_block) {
+    gboolean result;
+    char *filename;
+    S3Device * self = S3_DEVICE(pself);;
+
+    g_assert (self != NULL);
+    g_assert (data != NULL);
+    
+    filename = file_and_block_to_key(self, pself->file, pself->block);
+
+    result = s3_upload(self->s3, self->bucket, filename, data, size);
+    g_free(filename);
+    if (!result) {
+        fprintf(stderr, _("While writing data block to S3: %s\n"),
+                s3_strerror(self->s3));
+        return FALSE;
+    }
+
+    pself->block++;
+
+    /* if this is the last block, finish the file */
+    if (last_block) {
+        return s3_device_finish_file(pself);
+    }
+
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_device_finish_file */
+static gboolean
+s3_device_finish_file (Device * pself) {
+    /* we're not in a file anymore */
+    pself->in_file = FALSE;
+
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_device_recycle_file */
+static gboolean
+s3_device_recycle_file(Device *pself, guint file) {
+    S3Device *self = S3_DEVICE(pself);
+
+    return delete_file(self, file);
+}
+/* }}} */
+
+/* functions for reading */
+
+/* {{{ s3_device_seek_file */
+static dumpfile_t*
+s3_device_seek_file(Device *pself, guint file) {
+    S3Device *self = S3_DEVICE(pself);
+    gboolean result;
+    char *key;
+    gpointer buf;
+    guint buf_size;
+    dumpfile_t *amanda_header;
+
+    pself->file = file;
+    pself->block = 0;
+    pself->in_file = TRUE;
+
+    /* read it in */
+    key = special_file_to_key(self, "filestart", pself->file);
+    result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE);
+    g_free(key);
+    if (!result) {
+        guint response_code;
+        s3_error_code_t s3_error_code;
+        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+
+        /* if it's an expected error (not found), check what to do. */
+        if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) {
+            int next_file;
+            pself->file = -1;
+            pself->in_file = FALSE;
+            next_file = find_next_file(self, pself->file);
+            if (next_file > 0) {
+                /* Note short-circut of dispatcher. */
+                return s3_device_seek_file(pself, next_file);
+            } else if (next_file == 0) {
+                /* No next file. Check if we are one past the end. */
+                key = special_file_to_key(self, "filestart", pself->file - 1);
+                result = s3_read(self->s3, self->bucket, key, &buf, &buf_size,
+                                 S3_DEVICE_MAX_BLOCK_SIZE);
+                g_free(key);
+                if (result) {
+                    return make_tapeend_header();
+                } else {
+                    return NULL;
+                }
+            }
+        } else {
+            /* An error occured finding out if we are the last file. */
+            return NULL;
+        }
+    }
+   
+    /* and make a dumpfile_t out of it */
+    g_assert(buf != NULL);
+    amanda_header = g_new(dumpfile_t, 1);
+    fh_init(amanda_header);
+    parse_file_header(buf, amanda_header, buf_size);
+    g_free(buf);
+
+    switch (amanda_header->type) {
+        case F_DUMPFILE:
+        case F_CONT_DUMPFILE:
+        case F_SPLIT_DUMPFILE:
+            return amanda_header;
+
+        default:
+            fprintf(stderr,
+                    _("Invalid amanda header while reading file header\n"));
+            g_free(amanda_header);
+            return NULL;
+    }
+}
+/* }}} */
+
+/* {{{ s3_device_seek_block */
+static gboolean
+s3_device_seek_block(Device *pself, guint64 block) {
+    pself->block = block;
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_device_read_block */
+static int
+s3_device_read_block (Device * pself, gpointer data, int *size_req) {
+    S3Device * self = S3_DEVICE(pself);
+    char *key;
+    gpointer buf;
+    gboolean result;
+    guint buf_size;
+
+    g_assert (self != NULL);
+
+    /* get the file*/
+    key = file_and_block_to_key(self, pself->file, pself->block);
+    g_assert(key != NULL);
+    if (self->cached_key && (0 == strcmp(key, self->cached_key))) {
+        /* use the cached copy and clear the cache */
+        buf = self->cached_buf;
+        buf_size = self->cached_size;
+
+        self->cached_buf = NULL;
+        g_free(self->cached_key);
+        self->cached_key = NULL;
+    } else {
+        /* clear the cache and actually download the file */
+        if (self->cached_buf) {
+            g_free(self->cached_buf);
+            self->cached_buf = NULL;
+        }
+        if (self->cached_key) {
+            g_free(self->cached_key);
+            self->cached_key = NULL;
+        }
+
+        result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE);
+        if (!result) {
+            guint response_code;
+            s3_error_code_t s3_error_code;
+            s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+
+            g_free(key);
+            key = NULL;
+
+            /* if it's an expected error (not found), just return -1 */
+            if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) {
+                pself->is_eof = TRUE;
+                return -1;
+            }
+
+            /* otherwise, log it and return FALSE */
+            fprintf(stderr, _("While reading data block from S3: %s\n"),
+                    s3_strerror(self->s3));
+            return -1;
+        }
+    }
+
+    /* INVARIANT: cache is NULL */
+    g_assert(self->cached_buf == NULL);
+    g_assert(self->cached_key == NULL);
+
+    /* now see how the caller wants to deal with that */
+    if (data == NULL || *size_req < 0 || buf_size > (guint)*size_req) {
+        /* A size query or short buffer -- load the cache and return the size*/
+        self->cached_buf = buf;
+        self->cached_key = key;
+        self->cached_size = buf_size;
+
+        *size_req = buf_size;
+        return 0;
+    } else {
+        /* ok, all checks are passed -- copy the data */
+        *size_req = buf_size;
+        g_memmove(data, buf, buf_size);
+        g_free(key);
+        g_free(buf);
+
+        /* move on to the next block */
+        pself->block++;
+
+        return buf_size;
+    }
+}
+/* }}} */
diff --git a/device-src/s3-device.h b/device-src/s3-device.h
new file mode 100644 (file)
index 0000000..286cb36
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef __S3_DEVICE_H__
+#define __S3_DEVICE_H__
+#include <glib.h>
+#include <curl/curl.h>
+#include <glib-object.h>
+#include "s3.h"
+
+/*
+ * Constants
+ */
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_S3_DEVICE (s3_device_get_type())
+#define S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device)
+#define S3_DEVICE_CONST(obj)   G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device const)
+#define S3_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), s3_device_get_type(), S3DeviceClass)
+#define IS_S3_DEVICE(obj)      G_TYPE_CHECK_INSTANCE_TYPE((obj), s3_device_get_type ())
+
+#define S3_DEVICE_GET_CLASS(obj)       G_TYPE_INSTANCE_GET_CLASS((obj), s3_device_get_type(), S3DeviceClass)
+
+/*
+ * Main object structure
+ */
+typedef struct _S3MetadataFile S3MetadataFile;
+
+#ifndef __TYPEDEF_S3_DEVICE__
+#define __TYPEDEF_S3_DEVICE__
+typedef struct _S3Device S3Device;
+#endif
+struct _S3Device {
+    Device __parent__;
+    
+    /* The "easy" curl handle we use to access Amazon S3 */
+    S3Handle *s3;
+
+    /* S3 access information */
+    char *bucket;
+    char *prefix;
+
+    /* The S3 access information. */
+    char *secret_key;
+    char *access_key;
+#ifdef WANT_DEVPAY
+    char *user_token;
+#endif
+
+    /* a cache for unsuccessful reads (where we get the file but the caller
+     * doesn't have space for it or doesn't want it), where we expect the
+     * next call will request the same file.
+     */
+    char *cached_buf;
+    char *cached_key;
+    int cached_size;
+
+    /* Produce verbose output? */
+    gboolean verbose;
+    /* Set to FALSE once s3_device_open_device is finished. */
+    gboolean initializing;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _S3DeviceClass S3DeviceClass;
+struct _S3DeviceClass {
+    DeviceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  s3_device_get_type      (void);
+void    s3_device_register    (void);
+
+#endif
diff --git a/device-src/s3.c b/device-src/s3.c
new file mode 100644 (file)
index 0000000..161ff4e
--- /dev/null
@@ -0,0 +1,1372 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* TODO
+ * - Compute and send Content-MD5 header
+ * - check SSL certificate
+ * - collect speed statistics
+ * - debugging mode
+ */
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <regex.h>
+#include <time.h>
+#include "util.h"
+#include "amanda.h"
+#include "s3.h"
+#include "base64.h"
+#include <curl/curl.h>
+
+/* Constant renamed after version 7.10.7 */
+#ifndef CURLINFO_RESPONSE_CODE
+#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE
+#endif
+
+/* We don't need OpenSSL's kerberos support, and it's broken in
+ * RHEL 3 anyway. */
+#define OPENSSL_NO_KRB5
+
+#ifdef HAVE_OPENSSL_HMAC_H
+# include <openssl/hmac.h>
+#else
+# ifdef HAVE_CRYPTO_HMAC_H
+#  include <crypto/hmac.h>
+# else
+#  ifdef HAVE_HMAC_H
+#   include <hmac.h>
+#  endif
+# endif
+#endif
+
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+
+/*
+ * Constants / definitions
+ */
+
+/* Maximum key length as specified in the S3 documentation
+ * (*excluding* null terminator) */
+#define S3_MAX_KEY_LENGTH 1024
+
+#if defined(LIBCURL_FEATURE_SSL) && defined(LIBCURL_PROTOCOL_HTTPS)
+# define S3_URL "https://s3.amazonaws.com"
+#else
+# define S3_URL "http://s3.amazonaws.com"
+#endif
+
+#define AMAZON_SECURITY_HEADER "x-amz-security-token"
+
+/* parameters for exponential backoff in the face of retriable errors */
+
+/* start at 0.01s */
+#define EXPONENTIAL_BACKOFF_START_USEC 10000
+/* double at each retry */
+#define EXPONENTIAL_BACKOFF_BASE 2
+/* retry 15 times (for a total of about 5 minutes spent waiting) */
+#define EXPONENTIAL_BACKOFF_MAX_RETRIES 5
+
+/* general "reasonable size" parameters */
+#define MAX_ERROR_RESPONSE_LEN (100*1024)
+
+/* Results which should always be retried */
+#define RESULT_HANDLING_ALWAYS_RETRY \
+        { 400,  S3_ERROR_RequestTimeout,     0,                         S3_RESULT_RETRY }, \
+        { 409,  S3_ERROR_OperationAborted,   0,                         S3_RESULT_RETRY }, \
+        { 412,  S3_ERROR_PreconditionFailed, 0,                         S3_RESULT_RETRY }, \
+        { 500,  S3_ERROR_InternalError,      0,                         S3_RESULT_RETRY }, \
+        { 501,  S3_ERROR_NotImplemented,     0,                         S3_RESULT_RETRY }, \
+        { 0,    0,                           CURLE_COULDNT_CONNECT,     S3_RESULT_RETRY }, \
+        { 0,    0,                           CURLE_PARTIAL_FILE,        S3_RESULT_RETRY }, \
+        { 0,    0,                           CURLE_OPERATION_TIMEOUTED, S3_RESULT_RETRY }, \
+        { 0,    0,                           CURLE_SEND_ERROR,          S3_RESULT_RETRY }, \
+        { 0,    0,                           CURLE_RECV_ERROR,          S3_RESULT_RETRY }
+
+/*
+ * Data structures and associated functions
+ */
+
+struct S3Handle {
+    /* (all strings in this struct are freed by s3_free()) */
+
+    char *access_key;
+    char *secret_key;
+#ifdef WANT_DEVPAY
+    char *user_token;
+#endif
+
+    CURL *curl;
+
+    gboolean verbose;
+
+    /* information from the last request */
+    char *last_message;
+    guint last_response_code;
+    s3_error_code_t last_s3_error_code;
+    CURLcode last_curl_code;
+    guint last_num_retries;
+    void *last_response_body;
+    guint last_response_body_size;
+};
+
+/*
+ * S3 errors */
+
+/* (see preprocessor magic in s3.h) */
+
+static char * s3_error_code_names[] = {
+#define S3_ERROR(NAME) #NAME
+    S3_ERROR_LIST
+#undef S3_ERROR
+};
+
+/* Convert an s3 error name to an error code.  This function
+ * matches strings case-insensitively, and is appropriate for use
+ * on data from the network.
+ *
+ * @param s3_error_code: the error name
+ * @returns: the error code (see constants in s3.h)
+ */
+static s3_error_code_t
+s3_error_code_from_name(char *s3_error_name);
+
+/* Convert an s3 error code to a string
+ *
+ * @param s3_error_code: the error code to convert
+ * @returns: statically allocated string
+ */
+static const char *
+s3_error_name_from_code(s3_error_code_t s3_error_code);
+
+/*
+ * result handling */
+
+/* result handling is specified by a static array of result_handling structs,
+ * which match based on response_code (from HTTP) and S3 error code.  The result
+ * given for the first match is used.  0 acts as a wildcard for both response_code
+ * and s3_error_code.  The list is terminated with a struct containing 0 for both
+ * response_code and s3_error_code; the result for that struct is the default
+ * result.
+ *
+ * See RESULT_HANDLING_ALWAYS_RETRY for an example.
+ */
+typedef enum {
+    S3_RESULT_RETRY = -1,
+    S3_RESULT_FAIL = 0,
+    S3_RESULT_OK = 1
+} s3_result_t;
+
+typedef struct result_handling {
+    guint response_code;
+    s3_error_code_t s3_error_code;
+    CURLcode curl_code;
+    s3_result_t result;
+} result_handling_t;
+
+/* Lookup a result in C{result_handling}.
+ *
+ * @param result_handling: array of handling specifications
+ * @param response_code: response code from operation
+ * @param s3_error_code: s3 error code from operation, if any
+ * @param curl_code: the CURL error, if any
+ * @returns: the matching result
+ */
+static s3_result_t
+lookup_result(const result_handling_t *result_handling,
+              guint response_code,
+              s3_error_code_t s3_error_code,
+              CURLcode curl_code);
+
+/*
+ * Precompiled regular expressions */
+
+static const char *error_name_regex_string = "<Code>[:space:]*([^<]*)[:space:]*</Code>";
+static const char *message_regex_string = "<Message>[:space:]*([^<]*)[:space:]*</Message>";
+static regex_t error_name_regex, message_regex;
+
+/*
+ * Utility functions
+ */
+
+/* Build a resource URI as /[bucket[/key]], with proper URL
+ * escaping.
+ *
+ * The caller is responsible for freeing the resulting string.
+ *
+ * @param bucket: the bucket, or NULL if none is involved
+ * @param key: the key within the bucket, or NULL if none is involved
+ * @returns: completed URI
+ */
+static char *
+build_resource(const char *bucket,
+               const char *key);
+
+/* Create proper authorization headers for an Amazon S3 REST
+ * request to C{headers}.
+ *
+ * @note: C{X-Amz} headers (in C{headers}) must
+ *  - be in lower-case
+ *  - be in alphabetical order
+ *  - have no spaces around the colon
+ * (don't yell at me -- see the Amazon Developer Guide)
+ *
+ * @param hdl: the S3Handle object
+ * @param verb: capitalized verb for this request ('PUT', 'GET', etc.)
+ * @param resource: the resource being accessed
+ */
+static struct curl_slist *
+authenticate_request(S3Handle *hdl,
+                     const char *verb,
+                     const char *resource);
+
+/* Interpret the response to an S3 operation, assuming CURL completed its request
+ * successfully.  This function fills in the relevant C{hdl->last*} members.
+ *
+ * @param hdl: The S3Handle object
+ * @param body: the response body
+ * @param body_len: the length of the response body
+ * @returns: TRUE if the response should be retried (e.g., network error)
+ */
+static gboolean
+interpret_response(S3Handle *hdl,
+                   CURLcode curl_code,
+                   char *curl_error_buffer,
+                   void *body,
+                   guint body_len);
+
+/* Perform an S3 operation.  This function handles all of the details
+ * of retryig requests and so on.
+ * 
+ * @param hdl: the S3Handle object
+ * @param resource: the UTF-8 encoded resource to access
+                    (without query parameters)
+ * @param uri: the urlencoded URI to access at Amazon (may be identical to resource)
+ * @param verb: the HTTP request method
+ * @param request_body: the request body, or NULL if none should be sent
+ * @param request_body_size: the length of the request body
+ * @param max_response_size: the maximum number of bytes to accept in the
+ * response, or 0 for no limit.
+ * @param preallocate_response_size: for more efficient operation, preallocate
+ * a buffer of this size for the response body.  Addition space will be allocated
+ * if the response exceeds this size.
+ * @param result_handling: instructions for handling the results; see above.
+ * @returns: the result specified by result_handling; details of the response
+ * are then available in C{hdl->last*}
+ */
+static s3_result_t
+perform_request(S3Handle *hdl,
+                const char *resource,
+                const char *uri,
+                const char *verb,
+                const void *request_body,
+                guint request_body_size,
+                guint max_response_size,
+                guint preallocate_response_size,
+                const result_handling_t *result_handling);
+
+/*
+ * Static function implementations
+ */
+
+/* {{{ s3_error_code_from_name */
+static s3_error_code_t
+s3_error_code_from_name(char *s3_error_name)
+{
+    int i;
+
+    if (!s3_error_name) return S3_ERROR_Unknown;
+
+    /* do a brute-force search through the list, since it's not sorted */
+    for (i = 0; i < S3_ERROR_END; i++) {
+        if (strcasecmp(s3_error_name, s3_error_code_names[i]) == 0)
+            return i;
+    }
+
+    return S3_ERROR_Unknown;
+}
+/* }}} */
+
+/* {{{ s3_error_name_from_code */
+static const char *
+s3_error_name_from_code(s3_error_code_t s3_error_code)
+{
+    if (s3_error_code >= S3_ERROR_END)
+        s3_error_code = S3_ERROR_Unknown;
+
+    if (s3_error_code == 0)
+        return NULL;
+
+    return s3_error_code_names[s3_error_code];
+}
+/* }}} */
+
+/* {{{ lookup_result */
+static s3_result_t
+lookup_result(const result_handling_t *result_handling,
+              guint response_code,
+              s3_error_code_t s3_error_code,
+              CURLcode curl_code)
+{
+    g_return_val_if_fail(result_handling != NULL, S3_RESULT_FAIL);
+
+    while (result_handling->response_code
+        || result_handling->s3_error_code 
+        || result_handling->curl_code) {
+        if ((result_handling->response_code && result_handling->response_code != response_code)
+         || (result_handling->s3_error_code && result_handling->s3_error_code != s3_error_code)
+         || (result_handling->curl_code && result_handling->curl_code != curl_code)) {
+            result_handling++;
+            continue;
+        }
+
+        return result_handling->result;
+    }
+
+    /* return the result for the terminator, as the default */
+    return result_handling->result;
+}
+/* }}} */
+
+/* {{{ build_resource */
+static char *
+build_resource(const char *bucket,
+               const char *key)
+{
+    char *esc_bucket = NULL, *esc_key = NULL;
+    char *resource = NULL;
+
+    if (bucket)
+        if (!(esc_bucket = curl_escape(bucket, 0)))
+            goto cleanup;
+
+    if (key)
+        if (!(esc_key = curl_escape(key, 0)))
+            goto cleanup;
+
+    if (esc_bucket) {
+        if (esc_key) {
+            resource = g_strdup_printf("/%s/%s", esc_bucket, esc_key);
+        } else {
+            resource = g_strdup_printf("/%s", esc_bucket);
+        }
+    } else {
+        resource = g_strdup("/");
+    }
+cleanup:
+    if (esc_bucket) curl_free(esc_bucket);
+    if (esc_key) curl_free(esc_key);
+
+    return resource;
+}
+/* }}} */
+
+/* {{{ authenticate_request */
+static struct curl_slist *
+authenticate_request(S3Handle *hdl,
+                     const char *verb,
+                     const char *resource) 
+{
+    time_t t;
+    struct tm tmp;
+    char date[100];
+    char * buf;
+    HMAC_CTX ctx;
+    char md_value[EVP_MAX_MD_SIZE+1];
+    char auth_base64[40];
+    unsigned int md_len;
+    struct curl_slist *headers = NULL;
+    char * auth_string;
+
+    /* calculate the date */
+    t = time(NULL);
+    if (!localtime_r(&t, &tmp)) perror("localtime");
+    if (!strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %Z", &tmp)) 
+        perror("strftime");
+
+    /* run HMAC-SHA1 on the canonicalized string */
+    HMAC_CTX_init(&ctx);
+    HMAC_Init_ex(&ctx, hdl->secret_key, strlen(hdl->secret_key), EVP_sha1(), NULL);
+    auth_string = g_strconcat(verb, "\n\n\n", date, "\n",
+#ifdef WANT_DEVPAY
+                              AMAZON_SECURITY_HEADER, ":",
+                              hdl->user_token, ",",
+                              STS_PRODUCT_TOKEN, "\n",
+#endif
+                              resource, NULL);
+    HMAC_Update(&ctx, (unsigned char*) auth_string, strlen(auth_string));
+    g_free(auth_string);
+    md_len = EVP_MAX_MD_SIZE;
+    HMAC_Final(&ctx, (unsigned char*)md_value, &md_len);
+    HMAC_CTX_cleanup(&ctx);
+    base64_encode(md_value, md_len, auth_base64, sizeof(auth_base64));
+
+    /* append the new headers */
+#ifdef WANT_DEVPAY
+    /* Devpay headers are included in hash. */
+    buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", hdl->user_token);
+    headers = curl_slist_append(headers, buf);
+    amfree(buf);
+
+    buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", STS_PRODUCT_TOKEN);
+    headers = curl_slist_append(headers, buf);
+    amfree(buf);
+#endif
+
+    buf = g_strdup_printf("Authorization: AWS %s:%s",
+                          hdl->access_key, auth_base64);
+    headers = curl_slist_append(headers, buf);
+    amfree(buf);
+    
+    buf = g_strdup_printf("Date: %s", date);
+    headers = curl_slist_append(headers, buf);
+    amfree(buf);
+
+    return headers;
+}
+/* }}} */
+
+/* {{{ interpret_response */
+static void
+regex_error(regex_t *regex, int reg_result)
+{
+    char *message;
+    int size;
+
+    size = regerror(reg_result, regex, NULL, 0);
+    message = g_malloc(size);
+    if (!message) abort(); /* we're really out of luck */
+    regerror(reg_result, regex, message, size);
+
+    /* this is programmer error (bad regexp), so just log
+     * and abort().  There's no good way to signal a
+     * permanaent error from interpret_response. */
+    g_error(_("Regex error: %s"), message);
+    g_assert_not_reached();
+}
+
+static gboolean
+interpret_response(S3Handle *hdl,
+                   CURLcode curl_code,
+                   char *curl_error_buffer,
+                   void *body,
+                   guint body_len)
+{
+    long response_code = 0;
+    regmatch_t pmatch[2];
+    int reg_result;
+    char *error_name = NULL, *message = NULL;
+    char *body_copy = NULL;
+
+    if (!hdl) return FALSE;
+
+    if (hdl->last_message) g_free(hdl->last_message);
+    hdl->last_message = NULL;
+
+    /* bail out from a CURL error */
+    if (curl_code != CURLE_OK) {
+        hdl->last_curl_code = curl_code;
+        hdl->last_message = g_strdup_printf("CURL error: %s", curl_error_buffer);
+        return FALSE;
+    }
+
+    /* CURL seems to think things were OK, so get its response code */
+    curl_easy_getinfo(hdl->curl, CURLINFO_RESPONSE_CODE, &response_code);
+    hdl->last_response_code = response_code;
+
+    /* 2xx and 3xx codes won't have a response body*/
+    if (200 <= response_code && response_code < 400) {
+        hdl->last_s3_error_code = S3_ERROR_None;
+        return FALSE;
+    }
+
+    /* Now look at the body to try to get the actual Amazon error message. Rather
+     * than parse out the XML, just use some regexes. */
+
+    /* impose a reasonable limit on body size */
+    if (body_len > MAX_ERROR_RESPONSE_LEN) {
+        hdl->last_message = g_strdup("S3 Error: Unknown (response body too large to parse)");
+        return FALSE;
+    } else if (!body || body_len == 0) {
+        hdl->last_message = g_strdup("S3 Error: Unknown (empty response body)");
+        return TRUE; /* perhaps a network error; retry the request */
+    }
+
+    /* use strndup to get a zero-terminated string */
+    body_copy = g_strndup(body, body_len);
+    if (!body_copy) goto cleanup;
+
+    reg_result = regexec(&error_name_regex, body_copy, 2, pmatch, 0);
+    if (reg_result != 0) {
+        if (reg_result == REG_NOMATCH) {
+            error_name = NULL;
+        } else {
+            regex_error(&error_name_regex, reg_result);
+            g_assert_not_reached();
+        }
+    } else {
+        error_name = find_regex_substring(body_copy, pmatch[1]);
+    }
+
+    reg_result = regexec(&message_regex, body_copy, 2, pmatch, 0);
+    if (reg_result != 0) {
+        if (reg_result == REG_NOMATCH) {
+            message = NULL;
+        } else {
+            regex_error(&message_regex, reg_result);
+            g_assert_not_reached();
+        }
+    } else {
+        message = find_regex_substring(body_copy, pmatch[1]);
+    }
+
+    if (error_name) {
+        hdl->last_s3_error_code = s3_error_code_from_name(error_name);
+    }
+
+    if (message) {
+        hdl->last_message = message;
+        message = NULL; /* steal the reference to the string */
+    }
+
+cleanup:
+    if (body_copy) g_free(body_copy);
+    if (message) g_free(message);
+    if (error_name) g_free(error_name);
+
+    return FALSE;
+}
+/* }}} */
+
+/* {{{ perform_request */
+size_t buffer_readfunction(void *ptr, size_t size,
+                           size_t nmemb, void * stream) {
+    CurlBuffer *data = stream;
+    guint bytes_desired = size * nmemb;
+
+    /* check the number of bytes remaining, just to be safe */
+    if (bytes_desired > data->buffer_len - data->buffer_pos)
+        bytes_desired = data->buffer_len - data->buffer_pos;
+
+    memcpy((char *)ptr, data->buffer + data->buffer_pos, bytes_desired);
+    data->buffer_pos += bytes_desired;
+
+    return bytes_desired;
+}
+
+size_t
+buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+    CurlBuffer * data = stream;
+    guint new_bytes = size * nmemb;
+    guint bytes_needed = data->buffer_pos + new_bytes;
+
+    /* error out if the new size is greater than the maximum allowed */
+    if (data->max_buffer_size && bytes_needed > data->max_buffer_size)
+        return 0;
+
+    /* reallocate if necessary. We use exponential sizing to make this
+     * happen less often. */
+    if (bytes_needed > data->buffer_len) {
+        guint new_size = MAX(bytes_needed, data->buffer_len * 2);
+        if (data->max_buffer_size) {
+            new_size = MIN(new_size, data->max_buffer_size);
+        }
+        data->buffer = g_realloc(data->buffer, new_size);
+        data->buffer_len = new_size;
+    }
+    g_return_val_if_fail(data->buffer, 0); /* returning zero signals an error to libcurl */
+
+    /* actually copy the data to the buffer */
+    memcpy(data->buffer + data->buffer_pos, ptr, new_bytes);
+    data->buffer_pos += new_bytes;
+
+    /* signal success to curl */
+    return new_bytes;
+}
+
+static int 
+curl_debug_message(CURL *curl G_GNUC_UNUSED, 
+                  curl_infotype type, 
+                  char *s, 
+                  size_t len, 
+                  void *unused G_GNUC_UNUSED)
+{
+    char *lineprefix;
+    char *message;
+    char **lines, **line;
+
+    switch (type) {
+       case CURLINFO_TEXT:
+           lineprefix="";
+           break;
+
+       case CURLINFO_HEADER_IN:
+           lineprefix="Hdr In: ";
+           break;
+
+       case CURLINFO_HEADER_OUT:
+           lineprefix="Hdr Out: ";
+           break;
+
+       default:
+           /* ignore data in/out -- nobody wants to see that in the
+            * debug logs! */
+           return 0;
+    }
+
+    /* split the input into lines */
+    message = g_strndup(s, len);
+    lines = g_strsplit(message, "\n", -1);
+    g_free(message);
+
+    for (line = lines; *line; line++) {
+       if (**line == '\0') continue; /* skip blank lines */
+       g_debug("%s%s", lineprefix, *line);
+    }
+    g_strfreev(lines);
+
+    return 0;
+}
+
+static s3_result_t
+perform_request(S3Handle *hdl,
+                const char *resource,
+                const char *uri,
+                const char *verb,
+                const void *request_body,
+                guint request_body_size,
+                guint max_response_size,
+                guint preallocate_response_size,
+                const result_handling_t *result_handling)
+{
+    char *url = NULL;
+    s3_result_t result = S3_RESULT_FAIL; /* assume the worst.. */
+    CURLcode curl_code = CURLE_OK;
+    char curl_error_buffer[CURL_ERROR_SIZE] = "";
+    struct curl_slist *headers = NULL;
+    CurlBuffer readdata = { (void*)request_body, request_body_size, 0, 0 };
+    CurlBuffer writedata = { NULL, 0, 0, max_response_size };
+    gboolean should_retry;
+    guint retries = 0;
+    gulong backoff = EXPONENTIAL_BACKOFF_START_USEC;
+
+    g_return_val_if_fail(hdl != NULL && hdl->curl != NULL, S3_RESULT_FAIL);
+
+    s3_reset(hdl);
+
+    url = g_strconcat(S3_URL, uri, NULL);
+    if (!url) goto cleanup;
+
+    if (preallocate_response_size) {
+        writedata.buffer = g_malloc(preallocate_response_size);
+        if (!writedata.buffer) goto cleanup;
+        writedata.buffer_len = preallocate_response_size;
+    }
+
+    while (1) {
+        /* reset things */
+        if (headers) {
+            curl_slist_free_all(headers);
+        }
+        readdata.buffer_pos = 0;
+        writedata.buffer_pos = 0;
+       curl_error_buffer[0] = '\0';
+
+        /* set up the request */
+        headers = authenticate_request(hdl, verb, resource);
+
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_VERBOSE, hdl->verbose)))
+            goto curl_error;
+       if (hdl->verbose)
+           if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_DEBUGFUNCTION, 
+                                             curl_debug_message)))
+               goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_ERRORBUFFER,
+                                          curl_error_buffer)))
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOPROGRESS, 1)))
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_URL, url)))
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPHEADER,
+                                          headers)))
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST,
+                                          verb)))
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEFUNCTION, buffer_writefunction))) 
+            goto curl_error;
+        if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEDATA, &writedata))) 
+            goto curl_error;
+        if (max_response_size) {
+#ifdef CURLOPT_MAXFILESIZE_LARGE
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE_LARGE, (curl_off_t)max_response_size))) 
+                goto curl_error;
+#else
+# ifdef CURLOPT_MAXFILESIZE
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE, (long)max_response_size))) 
+                goto curl_error;
+# else
+           /* no MAXFILESIZE option -- that's OK */
+# endif
+#endif
+       }
+
+        if (request_body) {
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 1))) 
+                goto curl_error;
+#ifdef CURLOPT_INFILESIZE_LARGE
+           if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)request_body_size))) 
+                goto curl_error;
+#else
+           if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE, (long)request_body_size))) 
+                goto curl_error;
+#endif
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, buffer_readfunction))) 
+                goto curl_error;
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, &readdata))) 
+                goto curl_error;
+        } else {
+            /* Clear request_body options. */
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 0))) 
+                goto curl_error;
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION,
+                                              NULL)))
+                goto curl_error;
+            if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, 
+                                              NULL)))
+                goto curl_error;
+        }
+
+        /* Perform the request */
+        curl_code = curl_easy_perform(hdl->curl);
+
+
+        /* interpret the response into hdl->last* */
+    curl_error: /* (label for short-circuiting the curl_easy_perform call) */
+        should_retry = interpret_response(hdl, curl_code, curl_error_buffer, 
+                            writedata.buffer, writedata.buffer_pos);
+        
+        /* and, unless we know we need to retry, see what we're to do now */
+        if (!should_retry) {
+            result = lookup_result(result_handling, hdl->last_response_code, 
+                                   hdl->last_s3_error_code, hdl->last_curl_code);
+
+            /* break out of the while(1) unless we're retrying */
+            if (result != S3_RESULT_RETRY)
+                break;
+        }
+
+        if (retries >= EXPONENTIAL_BACKOFF_MAX_RETRIES) {
+            /* we're out of retries, so annotate hdl->last_message appropriately and bail
+             * out. */
+            char *m = g_strdup_printf("Too many retries; last message was '%s'", hdl->last_message);
+            if (hdl->last_message) g_free(hdl->last_message);
+            hdl->last_message = m;
+            result = S3_RESULT_FAIL;
+            break;
+        }
+
+        g_usleep(backoff);
+        retries++;
+        backoff *= EXPONENTIAL_BACKOFF_BASE;
+    }
+
+    if (result != S3_RESULT_OK) {
+        g_debug(_("%s %s failed with %d/%s"), verb, url,
+                hdl->last_response_code,
+                s3_error_name_from_code(hdl->last_s3_error_code)); 
+    }
+
+cleanup:
+    if (url) g_free(url);
+    if (headers) curl_slist_free_all(headers);
+    
+    /* we don't deallocate the response body -- we keep it for later */
+    hdl->last_response_body = writedata.buffer;
+    hdl->last_response_body_size = writedata.buffer_pos;
+    hdl->last_num_retries = retries;
+
+    return result;
+}
+/* }}} */
+
+/*
+ * Public function implementations
+ */
+
+/* {{{ s3_init */
+gboolean
+s3_init(void)
+{
+    char regmessage[1024];
+    int size;
+    int reg_result;
+
+    reg_result = regcomp(&error_name_regex, error_name_regex_string, REG_EXTENDED | REG_ICASE);
+    if (reg_result != 0) {
+        size = regerror(reg_result, &error_name_regex, regmessage, sizeof(regmessage));
+        g_error(_("Regex error: %s"), regmessage);
+        return FALSE;
+    }
+
+    reg_result = regcomp(&message_regex, message_regex_string, REG_EXTENDED | REG_ICASE);
+    if (reg_result != 0) {
+        size = regerror(reg_result, &message_regex, regmessage, sizeof(regmessage));
+        g_error(_("Regex error: %s"), regmessage);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+/* }}} */
+
+/* {{{ s3_open */
+S3Handle *
+s3_open(const char *access_key,
+        const char *secret_key
+#ifdef WANT_DEVPAY
+        ,
+        const char *user_token
+#endif
+        ) {
+    S3Handle *hdl;
+
+    hdl = g_new0(S3Handle, 1);
+    if (!hdl) goto error;
+
+    hdl->verbose = FALSE;
+
+    hdl->access_key = g_strdup(access_key);
+    if (!hdl->access_key) goto error;
+
+    hdl->secret_key = g_strdup(secret_key);
+    if (!hdl->secret_key) goto error;
+
+#ifdef WANT_DEVPAY
+    hdl->user_token = g_strdup(user_token);
+    if (!hdl->user_token) goto error;
+#endif
+
+    hdl->curl = curl_easy_init();
+    if (!hdl->curl) goto error;
+
+    return hdl;
+
+error:
+    s3_free(hdl);
+    return NULL;
+}
+/* }}} */
+
+/* {{{ s3_free */
+void
+s3_free(S3Handle *hdl)
+{
+    s3_reset(hdl);
+
+    if (hdl) {
+        if (hdl->access_key) g_free(hdl->access_key);
+        if (hdl->secret_key) g_free(hdl->secret_key);
+#ifdef WANT_DEVPAY
+        if (hdl->user_token) g_free(hdl->user_token);
+#endif
+        if (hdl->curl) curl_easy_cleanup(hdl->curl);
+
+        g_free(hdl);
+    }
+}
+/* }}} */
+
+/* {{{ s3_reset */
+void
+s3_reset(S3Handle *hdl)
+{
+    if (hdl) {
+        /* We don't call curl_easy_reset here, because doing that in curl
+         * < 7.16 blanks the default CA certificate path, and there's no way
+         * to get it back. */
+        if (hdl->last_message) {
+            g_free(hdl->last_message);
+            hdl->last_message = NULL;
+        }
+
+        hdl->last_response_code = 0;
+        hdl->last_curl_code = 0;
+        hdl->last_s3_error_code = 0;
+        hdl->last_num_retries = 0;
+
+        if (hdl->last_response_body) {
+            g_free(hdl->last_response_body);
+            hdl->last_response_body = NULL;
+        }
+
+        hdl->last_response_body_size = 0;
+    }
+}
+/* }}} */
+
+/* {{{ s3_error */
+void
+s3_error(S3Handle *hdl,
+         const char **message,
+         guint *response_code,
+         s3_error_code_t *s3_error_code,
+         const char **s3_error_name,
+         CURLcode *curl_code,
+         guint *num_retries)
+{
+    if (hdl) {
+        if (message) *message = hdl->last_message;
+        if (response_code) *response_code = hdl->last_response_code;
+        if (s3_error_code) *s3_error_code = hdl->last_s3_error_code;
+        if (s3_error_name) *s3_error_name = s3_error_name_from_code(hdl->last_s3_error_code);
+        if (curl_code) *curl_code = hdl->last_curl_code;
+        if (num_retries) *num_retries = hdl->last_num_retries;
+    } else {
+        /* no hdl? return something coherent, anyway */
+        if (message) *message = "NULL S3Handle";
+        if (response_code) *response_code = 0;
+        if (s3_error_code) *s3_error_code = 0;
+        if (s3_error_name) *s3_error_name = NULL;
+        if (curl_code) *curl_code = 0;
+        if (num_retries) *num_retries = 0;
+    }
+}
+/* }}} */
+
+/* {{{ s3_verbose */
+void
+s3_verbose(S3Handle *hdl, gboolean verbose)
+{
+    hdl->verbose = verbose;
+}
+/* }}} */
+
+/* {{{ s3_sterror */
+char *
+s3_strerror(S3Handle *hdl)
+{
+    const char *message;
+    guint response_code;
+    const char *s3_error_name;
+    CURLcode curl_code;
+    guint num_retries;
+
+    char s3_info[256] = "";
+    char response_info[16] = "";
+    char curl_info[32] = "";
+    char retries_info[32] = "";
+
+    s3_error(hdl, &message, &response_code, NULL, &s3_error_name, &curl_code, &num_retries);
+
+    if (!message) 
+        message = "Unkonwn S3 error";
+    if (s3_error_name)
+        g_snprintf(s3_info, sizeof(s3_info), " (%s)", s3_error_name);
+    if (response_code)
+        g_snprintf(response_info, sizeof(response_info), " (HTTP %d)", response_code);
+    if (curl_code)
+        g_snprintf(curl_info, sizeof(curl_info), " (CURLcode %d)", curl_code);
+    if (num_retries) 
+        g_snprintf(retries_info, sizeof(retries_info), " (after %d retries)", num_retries);
+
+    return g_strdup_printf("%s%s%s%s%s", message, s3_info, curl_info, response_info, retries_info);
+}
+/* }}} */
+
+/* {{{ s3_upload */
+/* Perform an upload. When this function returns, KEY and
+ * BUFFER remain the responsibility of the caller.
+ *
+ * @param self: the s3 device
+ * @param key: the key to which the upload should be made
+ * @param buffer: the data to be uploaded
+ * @param buffer_len: the length of the data to upload
+ * @returns: false if an error ocurred
+ */
+gboolean
+s3_upload(S3Handle *hdl,
+          const char *bucket,
+          const char *key, 
+          gpointer buffer,
+          guint buffer_len)
+{
+    char *resource = NULL;
+    s3_result_t result = S3_RESULT_FAIL;
+    static result_handling_t result_handling[] = {
+        { 200,  0,          0,                   S3_RESULT_OK },
+        RESULT_HANDLING_ALWAYS_RETRY,
+        { 0, 0,    0,                /* default: */ S3_RESULT_FAIL }
+        };
+
+    g_return_val_if_fail(hdl != NULL, FALSE);
+
+    resource = build_resource(bucket, key);
+    if (resource) {
+        result = perform_request(hdl, resource, resource, "PUT",
+                                 buffer, buffer_len, MAX_ERROR_RESPONSE_LEN, 0,
+                                 result_handling);
+        g_free(resource);
+    }
+
+    return result == S3_RESULT_OK;
+}
+/* }}} */
+
+/* {{{ s3_list_keys */
+
+/* Private structure for our "thunk", which tracks where the user is in the list
+ * of keys. */
+struct list_keys_thunk {
+    GSList *filename_list; /* all pending filenames */
+
+    gboolean in_contents; /* look for "key" entities in here */
+    gboolean in_common_prefixes; /* look for "prefix" entities in here */
+
+    gboolean is_truncated;
+    gchar *next_marker;
+
+    gboolean want_text;
+    
+    gchar *text;
+    gsize text_len;
+};
+
+/* Functions for a SAX parser to parse the XML from Amazon */
+
+static void
+list_start_element(GMarkupParseContext *context G_GNUC_UNUSED, 
+                   const gchar *element_name, 
+                   const gchar **attribute_names G_GNUC_UNUSED, 
+                   const gchar **attribute_values G_GNUC_UNUSED, 
+                   gpointer user_data, 
+                   GError **error G_GNUC_UNUSED)
+{
+    struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data;
+
+    thunk->want_text = 0;
+    if (strcasecmp(element_name, "contents") == 0) {
+        thunk->in_contents = 1;
+    } else if (strcasecmp(element_name, "commonprefixes") == 0) {
+        thunk->in_common_prefixes = 1;
+    } else if (strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
+        thunk->want_text = 1;
+    } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
+        thunk->want_text = 1;
+    } else if (strcasecmp(element_name, "istruncated")) {
+        thunk->want_text = 1;
+    } else if (strcasecmp(element_name, "nextmarker")) {
+        thunk->want_text = 1;
+    }
+}
+
+static void
+list_end_element(GMarkupParseContext *context G_GNUC_UNUSED, 
+                 const gchar *element_name,
+                 gpointer user_data, 
+                 GError **error G_GNUC_UNUSED)
+{
+    struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data;
+
+    if (strcasecmp(element_name, "contents") == 0) {
+        thunk->in_contents = 0;
+    } else if (strcasecmp(element_name, "commonprefixes") == 0) {
+        thunk->in_common_prefixes = 0;
+    } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
+        thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
+        thunk->text = NULL;
+    } else if (strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
+        thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
+        thunk->text = NULL;
+    } else if (strcasecmp(element_name, "istruncated") == 0) {
+        if (thunk->text && strncasecmp(thunk->text, "false", 5) != 0)
+            thunk->is_truncated = TRUE;
+    } else if (strcasecmp(element_name, "nextmarker") == 0) {
+        if (thunk->next_marker) g_free(thunk->next_marker);
+        thunk->next_marker = thunk->text;
+        thunk->text = NULL;
+    }
+}
+
+static void
+list_text(GMarkupParseContext *context G_GNUC_UNUSED,
+          const gchar *text, 
+          gsize text_len, 
+          gpointer user_data, 
+          GError **error G_GNUC_UNUSED)
+{
+    struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data;
+
+    if (thunk->want_text) {
+        if (thunk->text) g_free(thunk->text);
+        thunk->text = g_strndup(text, text_len);
+    }
+}
+
+/* Helper function for list_fetch */
+static gboolean
+list_build_url_component(char **rv,
+                         const char *delim,
+                         const char *key,
+                         const char *value)
+{
+    char *esc_value = NULL;
+    char *new_rv = NULL;
+
+    esc_value = curl_escape(value, 0);
+    if (!esc_value) goto cleanup;
+
+    new_rv = g_strconcat(*rv, delim, key, "=", esc_value, NULL);
+    if (!new_rv) goto cleanup;
+
+    g_free(*rv);
+    *rv = new_rv;
+    curl_free(esc_value);
+
+    return TRUE;
+
+cleanup:
+    if (new_rv) g_free(new_rv);
+    if (esc_value) curl_free(esc_value);
+
+    return FALSE;
+}
+
+/* Perform a fetch from S3; several fetches may be involved in a
+ * single listing operation */
+static s3_result_t
+list_fetch(S3Handle *hdl,
+           const char *resource,
+           const char *prefix, 
+           const char *delimiter, 
+           const char *marker,
+           const char *max_keys)
+{
+    char *urldelim = "?";
+    char *uri = g_strdup(resource);
+    s3_result_t result = S3_RESULT_FAIL;
+    static result_handling_t result_handling[] = {
+        { 200,  0,          0,                   S3_RESULT_OK },
+        RESULT_HANDLING_ALWAYS_RETRY,
+        { 0, 0,    0,                /* default: */ S3_RESULT_FAIL  }
+        };
+
+    /* build the URI */
+    if (prefix) {
+        if (!list_build_url_component(&uri, urldelim, "prefix", prefix)) goto cleanup;
+        urldelim = "&";
+    }
+    if (delimiter) {
+        if (!list_build_url_component(&uri, urldelim, "delimiter", delimiter)) goto cleanup;
+        urldelim = "&";
+    }
+    if (marker) {
+        if (!list_build_url_component(&uri, urldelim, "marker", marker)) goto cleanup;
+        urldelim = "&";
+    }
+    if (max_keys) {
+        if (!list_build_url_component(&uri, urldelim, "max-keys", max_keys)) goto cleanup;
+        urldelim = "&";
+    }
+
+    /* and perform the request on that URI */
+    result = perform_request(hdl, resource, uri, "GET", NULL,
+                             0, MAX_ERROR_RESPONSE_LEN, 0, result_handling);
+
+cleanup:
+    if (uri) g_free(uri);
+    return result;
+}
+
+gboolean
+s3_list_keys(S3Handle *hdl,
+              const char *bucket,
+              const char *prefix,
+              const char *delimiter,
+              GSList **list)
+{
+    char *resource = NULL;
+    struct list_keys_thunk thunk;
+    GMarkupParseContext *ctxt = NULL;
+    static GMarkupParser parser = { list_start_element, list_end_element, list_text, NULL, NULL };
+    GError *err = NULL;
+    s3_result_t result = S3_RESULT_FAIL;
+
+    g_assert(list);
+    *list = NULL;
+    thunk.filename_list = NULL;
+    thunk.text = NULL;
+    thunk.next_marker = NULL;
+
+    resource = build_resource(bucket, NULL);
+    if (!resource) goto cleanup;
+
+    /* Loop until S3 has given us the entire picture */
+    do {
+        /* get some data from S3 */
+        result = list_fetch(hdl, resource, prefix, delimiter, thunk.next_marker, NULL);
+        if (result != S3_RESULT_OK) goto cleanup;
+
+        /* run the parser over it */
+        thunk.in_contents = FALSE;
+        thunk.in_common_prefixes = FALSE;
+        thunk.is_truncated = FALSE;
+        thunk.want_text = FALSE;
+
+        ctxt = g_markup_parse_context_new(&parser, 0, (gpointer)&thunk, NULL);
+
+        if (!g_markup_parse_context_parse(ctxt, hdl->last_response_body, 
+                                          hdl->last_response_body_size, &err)) {
+            if (hdl->last_message) g_free(hdl->last_message);
+            hdl->last_message = g_strdup(err->message);
+            result = S3_RESULT_FAIL;
+            goto cleanup;
+        }
+
+        if (!g_markup_parse_context_end_parse(ctxt, &err)) {
+            if (hdl->last_message) g_free(hdl->last_message);
+            hdl->last_message = g_strdup(err->message);
+            result = S3_RESULT_FAIL;
+            goto cleanup;
+        }
+        
+        g_markup_parse_context_free(ctxt);
+        ctxt = NULL;
+    } while (thunk.next_marker);
+
+cleanup:
+    if (err) g_error_free(err);
+    if (thunk.text) g_free(thunk.text);
+    if (thunk.next_marker) g_free(thunk.next_marker);
+    if (resource) g_free(resource);
+    if (ctxt) g_markup_parse_context_free(ctxt);
+
+    if (result != S3_RESULT_OK) {
+        g_slist_free(thunk.filename_list);
+        return FALSE;
+    } else {
+        *list = thunk.filename_list;
+        return TRUE;
+    }
+}
+/* }}} */
+
+/* {{{ s3_read */
+gboolean
+s3_read(S3Handle *hdl,
+        const char *bucket,
+        const char *key,
+        gpointer *buf_ptr,
+        guint *buf_size,
+        guint max_size)
+{
+    char *resource = NULL;
+    s3_result_t result = S3_RESULT_FAIL;
+    static result_handling_t result_handling[] = {
+        { 200,  0,          0,                   S3_RESULT_OK },
+        RESULT_HANDLING_ALWAYS_RETRY,
+        { 0, 0,    0,                /* default: */ S3_RESULT_FAIL  }
+        };
+
+    g_return_val_if_fail(hdl != NULL, FALSE);
+    g_assert(buf_ptr != NULL);
+    g_assert(buf_size != NULL);
+
+    *buf_ptr = NULL;
+    *buf_size = 0;
+
+    resource = build_resource(bucket, key);
+    if (resource) {
+        result = perform_request(hdl, resource, resource,
+                                 "GET", NULL, 0, max_size, 0, result_handling);
+        g_free(resource);
+
+        /* copy the pointer to the result parameters and remove
+         * our reference to it */
+        if (result == S3_RESULT_OK) {
+            *buf_ptr = hdl->last_response_body;
+            *buf_size = hdl->last_response_body_size;
+            
+            hdl->last_response_body = NULL;
+            hdl->last_response_body_size = 0;
+        }
+    }        
+
+    return result == S3_RESULT_OK;
+}
+/* }}} */
+
+/* {{{ s3_delete */
+gboolean
+s3_delete(S3Handle *hdl,
+          const char *bucket,
+          const char *key)
+{
+    char *resource = NULL;
+    s3_result_t result = S3_RESULT_FAIL;
+    static result_handling_t result_handling[] = {
+        { 204,  0,          0,                   S3_RESULT_OK },
+        RESULT_HANDLING_ALWAYS_RETRY,
+        { 0, 0,    0,                /* default: */ S3_RESULT_FAIL  }
+        };
+
+    g_return_val_if_fail(hdl != NULL, FALSE);
+
+    resource = build_resource(bucket, key);
+    if (resource) {
+        result = perform_request(hdl, resource, resource, "DELETE", NULL, 0,
+                                 MAX_ERROR_RESPONSE_LEN, 0, result_handling);
+        g_free(resource);
+    }
+
+    return result == S3_RESULT_OK;
+}
+/* }}} */
+
+/* {{{ s3_make_bucket */
+gboolean
+s3_make_bucket(S3Handle *hdl,
+               const char *bucket)
+{
+    char *resource = NULL;
+    s3_result_t result = result = S3_RESULT_FAIL;
+    static result_handling_t result_handling[] = {
+        { 200,  0,          0,                   S3_RESULT_OK },
+        RESULT_HANDLING_ALWAYS_RETRY,
+        { 0, 0,    0,                /* default: */ S3_RESULT_FAIL  }
+        };
+
+    g_return_val_if_fail(hdl != NULL, FALSE);
+
+    resource = build_resource(bucket, NULL);
+    if (resource) {
+        result = perform_request(hdl, resource, resource, "PUT", NULL, 0, 
+                                 MAX_ERROR_RESPONSE_LEN, 0, result_handling);
+        g_free(resource);
+    }
+
+    return result == S3_RESULT_OK;
+}
+/* }}} */
diff --git a/device-src/s3.h b/device-src/s3.h
new file mode 100644 (file)
index 0000000..086b6f0
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef __S3_H__
+#define __S3_H__
+#include <glib.h>
+#include <curl/curl.h>
+
+/*
+ * Data types
+ */
+
+/* An opaque handle.  S3Handles should only be accessed from a single
+ * thread at any given time, although it is fine to use different handles
+ * in different threads simultaneously. */
+typedef struct S3Handle S3Handle;
+
+/*
+ * Constants
+ */
+
+#ifdef WANT_DEVPAY
+/* These are assumed to be already URL-escaped. */
+# define STS_BASE_URL "https://sts.amazonaws.com/"
+# define STS_PRODUCT_TOKEN "{ProductToken}AAAGQXBwVGtu4geoGybuwuk8VEEPzJ9ZANpu0yzbf9g4Gs5Iarzff9B7qaDBEEaWcAzWpcN7zmdMO765jOtEFc4DWTRNkpPSzUnTdkHbdYUamath73OreaZtB86jy/JF0gsHZfhxeKc/3aLr8HNT//DsX3r272zYHLDPWWUbFguOwqNjllnt6BshYREx59l8RrWABLSa37dyJeN+faGvz3uQxiDakZRn3LfInOE6d9+fTFl50LPoP08LCqI/SJfpouzWix7D/cep3Jq8yYNyM1rgAOTF7/wh7r8OuPDLJ/xZUDLfykePIAM="
+#endif
+
+/* This preprocessor magic will enumerate constants named S3_ERROR_XxxYyy for
+ * each of the errors in parentheses.
+ *
+ * see http://docs.amazonwebservices.com/AmazonS3/2006-03-01/ErrorCodeList.html
+ * for Amazon's breakdown of error responses.
+ */
+#define S3_ERROR_LIST \
+    S3_ERROR(None), \
+    S3_ERROR(AccountProblem), \
+    S3_ERROR(AllAccessDisabled), \
+    S3_ERROR(AmbiguousGrantByEmailAddress), \
+    S3_ERROR(OperationAborted), \
+    S3_ERROR(BadDigest), \
+    S3_ERROR(BucketAlreadyExists), \
+    S3_ERROR(BucketNotEmpty), \
+    S3_ERROR(CredentialsNotSupported), \
+    S3_ERROR(EntityTooLarge), \
+    S3_ERROR(IncompleteBody), \
+    S3_ERROR(InternalError), \
+    S3_ERROR(InvalidAccessKeyId), \
+    S3_ERROR(InvalidArgument), \
+    S3_ERROR(InvalidBucketName), \
+    S3_ERROR(InvalidDigest), \
+    S3_ERROR(InvalidRange), \
+    S3_ERROR(InvalidSecurity), \
+    S3_ERROR(InvalidSOAPRequest), \
+    S3_ERROR(InvalidStorageClass), \
+    S3_ERROR(InvalidTargetBucketForLogging), \
+    S3_ERROR(KeyTooLong), \
+    S3_ERROR(InvalidURI), \
+    S3_ERROR(MalformedACLError), \
+    S3_ERROR(MaxMessageLengthExceeded), \
+    S3_ERROR(MetadataTooLarge), \
+    S3_ERROR(MethodNotAllowed), \
+    S3_ERROR(MissingAttachment), \
+    S3_ERROR(MissingContentLength), \
+    S3_ERROR(MissingSecurityElement), \
+    S3_ERROR(MissingSecurityHeader), \
+    S3_ERROR(NoLoggingStatusForKey), \
+    S3_ERROR(NoSuchBucket), \
+    S3_ERROR(NoSuchKey), \
+    S3_ERROR(NotImplemented), \
+    S3_ERROR(NotSignedUp), \
+    S3_ERROR(PreconditionFailed), \
+    S3_ERROR(RequestTimeout), \
+    S3_ERROR(RequestTimeTooSkewed), \
+    S3_ERROR(RequestTorrentOfBucketError), \
+    S3_ERROR(SignatureDoesNotMatch), \
+    S3_ERROR(TooManyBuckets), \
+    S3_ERROR(UnexpectedContent), \
+    S3_ERROR(UnresolvableGrantByEmailAddress), \
+    S3_ERROR(Unknown), \
+    S3_ERROR(END)
+
+typedef enum {
+#define S3_ERROR(NAME) S3_ERROR_ ## NAME
+    S3_ERROR_LIST
+#undef S3_ERROR
+} s3_error_code_t;
+
+/*
+ * Functions
+ */
+
+/* Initialize S3 operation
+ *
+ * As a requirement of C{curl_global_init}, which this function calls,
+ * s3_init I{must} be called before any other threads are started.
+ *
+ * If an error occurs in this function, diagnostic information is 
+ * printed to stderr.
+ *
+ * @returns: false if an error occurred
+ */
+gboolean
+s3_init(void);
+
+/* Set up an S3Handle.
+ */
+S3Handle *
+s3_open(const char * access_key, const char *secret_key
+#ifdef WANT_DEVPAY
+        , const char * user_token
+#endif
+        );
+
+/* Deallocate an S3Handle
+ *
+ * @param hdl: the S3Handle object
+ */
+void
+s3_free(S3Handle *hdl);
+
+/* Reset the information about the last request, including
+ * freeing any allocated memory.  The S3Handle itself is not
+ * freed and may be used again.  This function is called
+ * automatically as needed, and should be called to free memory
+ * when the handle will not be used for some time.
+ *
+ * @param hdl: the S3Handle object
+ */
+void
+s3_reset(S3Handle *hdl);
+
+/* Get the error information for the last operation
+ *
+ * All results are returned via result parameters.  If any parameter is
+ * NULL, that result will not be returned.  Caller is not responsible for
+ * freeing any returned strings, although the results are only valid until
+ * the next call to an S3 function with this handle.
+ * 
+ * @param hdl: the S3Handle object
+ * @param message: (result) the error message, or NULL if none exists
+ * @param response_code: (result) the HTTP response code (or 0 if none exists)
+ * @param s3_error_code: (result) the S3 error code (see constants, above)
+ * @param s3_error_name: (result) the S3 error name (e.g., "RequestTimeout"),
+ * or NULL if none exists
+ * @param curl_code: (result) the curl error code (or 0 if none exists)
+ * @param num_retries: (result) number of retries
+ */
+void
+s3_error(S3Handle *hdl,
+         const char **message,
+         guint *response_code,
+         s3_error_code_t *s3_error_code,
+         const char **s3_error_name,
+         CURLcode *curl_code,
+         guint *num_retries);
+
+/* Control verbose output of HTTP transactions, etc.
+ *
+ * @param hdl: the S3Handle object
+ * @param verbose: if true, send HTTP transactions, etc. to debug output
+ */
+void
+s3_verbose(S3Handle *hdl,
+          gboolean verbose);
+
+/* Get the error information from the last operation on this handle,
+ * formatted as a string.
+ *
+ * Caller is responsible for freeing the resulting string.
+ *
+ * @param hdl: the S3Handle object
+ * @returns: string, or NULL if no error occurred
+ */
+char *
+s3_strerror(S3Handle *hdl);
+
+/* Perform an upload.
+ * 
+ * When this function returns, KEY and BUFFER remain the
+ * responsibility of the caller.
+ *
+ * @param hdl: the S3Handle object
+ * @param bucket: the bucket to which the upload should be made
+ * @param key: the key to which the upload should be made
+ * @param buffer: the data to be uploaded
+ * @param buffer_len: the length of the data to upload
+ * @returns: false if an error ocurred
+ */
+gboolean
+s3_upload(S3Handle *hdl,
+          const char *bucket,
+          const char *key, 
+          gpointer buffer,
+          guint buffer_len);
+
+/* List all of the files matching the pseudo-glob C{PREFIX*DELIMITER*}, 
+ * returning only that portion which matches C{PREFIX*DELIMITER}.  S3 supports
+ * this particular semantics, making it quite efficient.  The returned list
+ * should be freed by the caller.
+ *
+ * @param hdl: the S3Handle object
+ * @param bucket: the bucket to list
+ * @param prefix: the prefix
+ * @param delimiter: delimiter (any length string)
+ * @param list: (output) the list of files
+ * @returns: FALSE if an error occurs
+ */
+gboolean
+s3_list_keys(S3Handle *hdl,
+              const char *bucket,
+              const char *prefix,
+              const char *delimiter,
+              GSList **list);
+
+/* Read an entire file.  The buffer returned is the responsibility of the caller.  A
+ * buffer is only returned if no error occurred, and will be NULL otherwise.
+ *
+ * @param hdl: the S3Handle object
+ * @param bucket: the bucket to read from
+ * @param key: the key to read from
+ * @param buf_ptr: (result) a pointer to a C{gpointer} which will contain a pointer to
+ * the block read
+ * @param buf_size: (result) a pointer to a C{guint} which will contain the size of the
+ * block read
+ * @param max_size: maximum size of the file
+ * @returns: FALSE if an error occurs
+ */
+gboolean
+s3_read(S3Handle *hdl,
+        const char *bucket,
+        const char *key,
+        gpointer *buf_ptr,
+        guint *buf_size,
+        guint max_size);
+
+/* Delete a file.
+ *
+ * @param hdl: the S3Handle object
+ * @param bucket: the bucket to delete from
+ * @param key: the key to delete
+ * @returns: FALSE if an error occurs; a non-existent file is I{not} considered an error.
+ */
+gboolean
+s3_delete(S3Handle *hdl,
+          const char *bucket,
+          const char *key);
+
+/* Create a bucket.
+ *
+ * @param hdl: the S3Handle object
+ * @param bucket: the bucket to create
+ * @returns: FALSE if an error occurs
+ */
+gboolean
+s3_make_bucket(S3Handle *hdl,
+               const char *bucket);
+
+/* Attempt a RefreshAWSSecurityToken on a token; if it succeeds, the old
+ * token will be freed and replaced by the new. If it fails, the old
+ * token is left unchanged and FALSE is returned. */
+gboolean sts_refresh_token(char ** token, const char * directory);
+
+/* These functions are for if you want to use curl on your own. You get more
+ * control, but it's a lot of work that way: */
+typedef struct {
+    char *buffer;
+    guint buffer_len;
+    guint buffer_pos;
+    guint max_buffer_size;
+} CurlBuffer;
+
+/* a CURLOPT_READFUNCTION to read data from a buffer. */
+size_t buffer_readfunction(void *ptr, size_t size,
+                           size_t nmemb, void * stream);
+
+/* a CURLOPT_WRITEFUNCTION to write data to a buffer. */
+size_t
+buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream);
+
+/* Adds a null termination to a buffer. */
+void terminate_buffer(CurlBuffer *);
+
+#endif
diff --git a/device-src/semaphore.c b/device-src/semaphore.c
new file mode 100644 (file)
index 0000000..20a2a95
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* GLib does not provide semaphores, which are useful in queue.c.
+   So, we implement it here. */
+
+#include "semaphore.h"
+#include "amanda.h"
+
+semaphore_t* semaphore_new_with_value(int value) {
+    semaphore_t *rval;
+
+    if (!g_thread_supported())
+        return NULL;
+
+    rval = malloc(sizeof(*rval));
+    rval->value = value;
+    rval->mutex = g_mutex_new();
+    rval->decrement_cond = g_cond_new();
+    rval->zero_cond = g_cond_new();
+    
+    if (rval->mutex == NULL || rval->decrement_cond == NULL ||
+        rval->zero_cond == NULL) {
+        semaphore_free(rval);
+        return NULL;
+    } else {
+        return rval;
+    }
+}
+
+void semaphore_free(semaphore_t* o) {
+    g_mutex_free(o->mutex);
+    g_cond_free(o->decrement_cond);
+    g_cond_free(o->zero_cond);
+    free(o);
+}
+
+/* This function checks if the semaphore would is zero or negative.
+ * If so, the zero_cond is signalled. We assume that the mutex is
+ * locked. */
+static void check_empty(semaphore_t * o) {
+    if (o->value <= 0) {
+        g_cond_broadcast(o->zero_cond);
+    }
+}
+
+void semaphore_increment(semaphore_t* o, unsigned int inc) {
+    g_return_if_fail(o != NULL);
+    g_return_if_fail(inc != 0);
+
+    semaphore_force_adjust(o, inc);
+}
+
+void semaphore_decrement(semaphore_t* o, unsigned int dec) {
+    int sdec;
+    g_return_if_fail(o != NULL);
+    sdec = (int) dec;
+    g_return_if_fail(sdec >= 0);
+
+    g_mutex_lock(o->mutex);
+    while (o->value < sdec) {
+        g_cond_wait(o->decrement_cond, o->mutex);
+    }
+    o->value -= sdec;
+    check_empty(o);
+    g_mutex_unlock(o->mutex);
+}
+
+void semaphore_force_adjust(semaphore_t* o, int inc) {
+    g_return_if_fail(o != NULL);
+
+    g_mutex_lock(o->mutex);
+    o->value += inc;
+    if (inc < 0)
+       check_empty(o);
+    else
+       g_cond_broadcast(o->decrement_cond);
+    g_mutex_unlock(o->mutex);
+
+}
+
+void semaphore_force_set(semaphore_t* o, int value) {
+    int oldvalue;
+    g_return_if_fail(o != NULL);
+    
+    g_mutex_lock(o->mutex);
+    oldvalue = o->value;
+    o->value = value;
+    if (value < oldvalue)
+       check_empty(o);
+    else
+       g_cond_broadcast(o->decrement_cond);
+    g_mutex_unlock(o->mutex);
+    
+}
+
+void semaphore_wait_empty(semaphore_t * o) {
+    g_return_if_fail(o != NULL);
+    
+    g_mutex_lock(o->mutex);
+    while (o->value > 0) {
+        g_cond_wait(o->zero_cond, o->mutex);
+    }
+    g_mutex_unlock(o->mutex);
+}
diff --git a/device-src/semaphore.h b/device-src/semaphore.h
new file mode 100644 (file)
index 0000000..17d41fe
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* GLib does not provide semaphores, which are useful in queue.c.
+   So, we implement it here. */
+
+#include <glib.h>
+
+#ifndef SEMAPHORE_H
+
+typedef struct {
+    int value;
+    GMutex *mutex;
+    GCond * decrement_cond;
+    GCond * zero_cond;
+} semaphore_t;
+
+/* Create a new semaphore object with the given value.
+ *
+ * @param value: new value
+ * @returns: newly allocated semaphore_t
+ */
+semaphore_t* semaphore_new_with_value(int value);
+
+/* Shortcut to make a new semaphore with value 1.
+ */
+#define semaphore_new() semaphore_new_with_value(1)
+
+/* Free a semaphore allocated by semaphore_with_new_value().  Be sure the
+ * semaphore is no longer in use by any threads.
+ *
+ * @param sem: the semaphore to free
+ */
+void semaphore_free(semaphore_t *sem);
+
+/* Increment the value of the semaphore by incr.  This corresponds to
+ * Dijkstra's V(), or the typical semaphore's release().
+ *
+ * This function will not block, but may wake other threads waiting
+ * on semaphore_decrement().
+ *
+ * @param sem: the semaphore
+ * @param incr: added to the semaphore's value
+ */
+void semaphore_increment(semaphore_t *sem, unsigned int incr);
+
+/* Shortcut to increment the semaphore by 1.
+ */
+#define semaphore_up(semaphore) semphore_increment(semaphore,1)
+
+/* Decrement the value of the semaphore by incr.  If this operation
+ * would make the semaphore zero or less, block until the semaphore
+ * value is large enough, then perform the decerement operation. Threads
+ * waiting on semaphore_wait_empty() may be awakened if the value
+ * reaches 0.
+ *
+ * @param sem: the semaphore
+ * @param decr: subtracted from the semaphore's value
+ */
+void semaphore_decrement(semaphore_t *sem, unsigned int decr);
+
+/* Shortcut to decrement the semaphore by 1.
+ */
+#define semaphore_down(semaphore) semaphore_decrement(semaphore, 1)
+
+/* Increment or decrement (with a negative incr) the value without
+ * blocking.  Threads waiting on semaphore_decrement() or
+ * semaphore_wait_empty() will be awakened if necessary.
+ *
+ * @param sem: the semaphore
+ * @param incr: added to the semaphore's value
+ */
+void semaphore_force_adjust(semaphore_t *sem, int incr);
+
+/* Set the semaphore to a given value without blocking.  Threads
+ * waiting on semaphore_decrement() or semaphore_wait_empty()
+ * will be awakened if necessary.
+ *
+ * @param sem: the semaphore
+ * @param value: the new value
+ */
+void semaphore_force_set(semaphore_t *sem, int value);
+
+/* Block until the semaphore's value is zero.
+ *
+ * @param sem: the semaphore
+ */
+void semaphore_wait_empty(semaphore_t *sem);
+
+#endif /* SEMAPHORE_H */
diff --git a/device-src/tape-aix.c b/device-src/tape-aix.c
new file mode 100644 (file)
index 0000000..b5701a1
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include <amanda.h>
+#include "tape-ops.h"
+
+/* Tape operations for AIX systems. Most of this stuff is based on
+   documentation from 
+   http://publibn.boulder.ibm.com/doc_link/Ja_JP/a_doc_lib/files/aixfiles/rmt.htm */
+
+/* Uncomment to test compilation on non-AIX systems. */
+/* ---
+#undef MTIOCTOP
+#define STIOCTOP 0
+#define stop mtop
+#define st_op mt_op
+#define st_count mt_count
+#define STREW MTREW
+#define STFSF MTFSF
+#define STRSF MTBSF
+#define STFSR MTFSR
+#define STRSR MTBSR
+#define STWEOF MTWEOF
+--- */
+
+gboolean tape_rewind(int fd) {
+    struct stop st;
+    st.st_op = STREW;
+    st.st_count = 1;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gboolean tape_fsf(int fd, guint count) {
+    struct stop st;
+    st.st_op = STFSF;
+    st.st_count = count;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gboolean tape_bsf(int fd, guint count) {
+    struct stop st;
+    st.st_op = STRSF;
+    st.st_count = count;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gboolean tape_fsr(int fd, guint count) {
+    struct stop st;
+    st.st_op = STFSR;
+    st.st_count = count;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gboolean tape_bsr(int fd, guint count) {
+    struct stop st;
+    st.st_op = STRSR;
+    st.st_count = count;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gint tape_eod(int fd) {
+    g_assert_not_reached();
+    return TAPE_OP_ERROR;
+}
+
+gboolean tape_weof(int fd, guint8 count) {
+    struct stop st;
+    st.st_op = STWEOF;
+    st.st_count = count;
+    return 0 == ioctl(fd, STIOCTOP, &st);
+}
+
+gboolean tape_setcompression(int fd, gboolean on) {
+    return FALSE;
+}
+
+TapeCheckResult tape_is_tape_device(int fd) {
+    /* AIX doesn't have a no-op. */
+    return TAPE_CHECK_UNKNOWN;
+}
+
+TapeCheckResult tape_is_ready(int fd) {
+    return TAPE_CHECK_UNKNOWN;
+}
+
+void tape_device_discover_capabilities(TapeDevice * t_self) {
+    Device * self;
+    GValue val;
+
+    self = DEVICE(t_self);
+    g_return_if_fail(self != NULL);
+
+    bzero(&val, sizeof(val));
+    g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE);
+
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_EOM, &val);
+
+    g_value_unset_init(&val, G_TYPE_UINT);
+    g_value_set_uint(&val, 2);
+    device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val);
+}
diff --git a/device-src/tape-device.c b/device-src/tape-device.c
new file mode 100644 (file)
index 0000000..538c06f
--- /dev/null
@@ -0,0 +1,1308 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include <string.h> /* memset() */
+#include "util.h"
+#include "tape-device.h"
+#include "tape-ops.h"
+
+/* This is equal to 2*1024*1024*1024 - 16*1024*1024 - 1, but written 
+   explicitly to avoid overflow issues. */
+#define RESETOFS_THRESHOLD (0x7effffff)
+
+/* Largest possible block size on SCSI systems. */
+#define LARGEST_BLOCK_ESTIMATE (16 * 1024 * 1024)
+
+struct TapeDevicePrivate_s {
+    /* This holds the total number of bytes written to the device,
+       modulus RESETOFS_THRESHOLD. */
+    int write_count;
+};
+
+/* Possible (abstracted) results from a system I/O operation. */
+typedef enum {
+    RESULT_SUCCESS,
+    RESULT_ERROR,        /* Undefined error. */
+    RESULT_SMALL_BUFFER, /* Tried to read with a buffer that is too
+                            small. */
+    RESULT_NO_DATA,      /* End of File, while reading */
+    RESULT_NO_SPACE,     /* Out of space. Sometimes we don't know if
+                            it was this or I/O error, but this is the
+                            preferred explanation. */
+    RESULT_MAX
+} IoResult;
+
+/* here are local prototypes */
+static void tape_device_init (TapeDevice * o);
+static void tape_device_class_init (TapeDeviceClass * c);
+static gboolean tape_device_open_device (Device * self, char * device_name);
+static ReadLabelStatusFlags tape_device_read_label(Device * self);
+static gboolean tape_device_write_block(Device * self, guint size,
+                                        gpointer data, gboolean short_block);
+static gboolean tape_device_read_block(Device * self,  gpointer buf,
+                                       int * size_req);
+static gboolean tape_device_start (Device * self, DeviceAccessMode mode,
+                                   char * label, char * timestamp);
+static gboolean tape_device_start_file (Device * self, const dumpfile_t * ji);
+static dumpfile_t * tape_device_seek_file (Device * self, guint file);
+static gboolean tape_device_seek_block (Device * self, guint64 block);
+static gboolean tape_device_property_get (Device * self, DevicePropertyId id,
+                                          GValue * val);
+static gboolean tape_device_property_set (Device * self, DevicePropertyId id,
+                                          GValue * val);
+static gboolean tape_device_finish (Device * self);
+static IoResult tape_device_robust_read (TapeDevice * self, void * buf,
+                                               int * count);
+static IoResult tape_device_robust_write (TapeDevice * self, void * buf, int count);
+static gboolean tape_device_fsf (TapeDevice * self, guint count);
+static gboolean tape_device_bsf (TapeDevice * self, guint count, guint file);
+static gboolean tape_device_fsr (TapeDevice * self, guint count);
+static gboolean tape_device_bsr (TapeDevice * self, guint count, guint file, guint block);
+static gboolean tape_device_eod (TapeDevice * self);
+
+/* pointer to the class of our parent */
+static DeviceClass *parent_class = NULL;
+
+GType tape_device_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TapeDeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) tape_device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TapeDevice),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) tape_device_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TYPE_DEVICE, "TapeDevice",
+                                       &info, (GTypeFlags)0);
+    }
+
+    return type;
+}
+
+static void 
+tape_device_init (TapeDevice * self) {
+    Device * device_self;
+    DeviceProperty prop;
+    GValue response;
+
+    device_self = (Device*)self;
+    bzero(&response, sizeof(response));
+
+    self->private = malloc(sizeof(TapeDevicePrivate));
+
+    /* Clear all fields. */
+    self->min_block_size = self->fixed_block_size = 32768;
+    self->max_block_size = self->read_block_size = MAX_TAPE_BLOCK_BYTES;
+
+    self->fd = -1;
+    
+    self->fsf = self->bsf = self->fsr = self->bsr = self->eom =
+        self->bsf_after_eom = self->compression = self->first_file = 0;
+    self->final_filemarks = 2;
+
+    self->private->write_count = 0;
+
+    /* Register properites */
+    prop.base = &device_property_concurrency;
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+    g_value_init(&response, CONCURRENCY_PARADIGM_TYPE);
+    g_value_set_enum(&response, CONCURRENCY_PARADIGM_EXCLUSIVE);
+    device_add_property(device_self, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_streaming;
+    g_value_init(&response, STREAMING_REQUIREMENT_TYPE);
+    g_value_set_enum(&response, STREAMING_REQUIREMENT_DESIRED);
+    device_add_property(device_self, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_appendable;
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE);
+    device_add_property(device_self, &prop, &response);
+
+    prop.base = &device_property_partial_deletion;
+    g_value_set_boolean(&response, FALSE);
+    device_add_property(device_self, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_medium_access_type;
+    g_value_init(&response, MEDIA_ACCESS_MODE_TYPE);
+    g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE);
+    device_add_property(device_self, &prop, &response);
+    g_value_unset(&response);
+
+    prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK;
+    prop.base = &device_property_compression;
+    device_add_property(device_self, &prop, NULL);
+
+    prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START;
+    prop.base = &device_property_min_block_size;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_max_block_size;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_block_size;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_fsf;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_bsf;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_fsr;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_bsr;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_eom;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_bsf_after_eom;
+    device_add_property(device_self, &prop, NULL);
+    prop.base = &device_property_final_filemarks;
+    device_add_property(device_self, &prop, NULL);
+    
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+    prop.base = &device_property_canonical_name;
+    device_add_property(device_self, &prop, NULL);
+}
+
+static void tape_device_finalize(GObject * obj_self) {
+    TapeDevice * self = TAPE_DEVICE(obj_self);
+
+    if(G_OBJECT_CLASS(parent_class)->finalize) \
+           (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+
+    robust_close(self->fd);
+    self->fd = -1;
+    amfree(self->private);
+}
+
+static void 
+tape_device_class_init (TapeDeviceClass * c)
+{
+    DeviceClass *device_class = (DeviceClass *)c;
+    GObjectClass *g_object_class = (GObjectClass *)c;
+
+    parent_class = g_type_class_ref (TYPE_DEVICE);
+    
+    device_class->open_device = tape_device_open_device;
+    device_class->read_label = tape_device_read_label;
+    device_class->write_block = tape_device_write_block;
+    device_class->read_block = tape_device_read_block;
+    device_class->start = tape_device_start;
+    device_class->start_file = tape_device_start_file;
+    device_class->seek_file = tape_device_seek_file;
+    device_class->seek_block = tape_device_seek_block;
+    device_class->property_get = tape_device_property_get;
+    device_class->property_set = tape_device_property_set;
+    device_class->finish = tape_device_finish;
+    
+    g_object_class->finalize = tape_device_finalize;
+}
+
+void tape_device_register(void) {
+    static const char * device_prefix_list[] = { "tape", NULL };
+    register_device(tape_device_factory, device_prefix_list);
+}
+
+#ifdef O_NONBLOCK
+/* Open the tape device, trying various combinations of O_RDWR and
+   O_NONBLOCK. */
+static int try_open_tape_device(TapeDevice * self, char * device_name) {
+    int rval;
+    rval  = robust_open(device_name, O_RDWR | O_NONBLOCK, 0);
+    if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) {
+        /* Maybe we don't support O_NONBLOCK for tape devices. */
+        rval = robust_open(device_name, O_RDWR, 0);
+    }
+    if (rval >= 0) {
+        self->write_open_errno = 0;
+    } else {
+        if (errno == EACCES || errno == EPERM) {
+            /* Device is write-protected. */
+            self->write_open_errno = errno;
+            rval = robust_open(device_name, O_RDONLY | O_NONBLOCK, 0);
+            if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) {
+                rval = robust_open(device_name, O_RDONLY, 0);
+            }
+        }
+    }
+    /* Clear O_NONBLOCK for operations from now on. */
+    fcntl(rval, F_SETFL, fcntl(rval, F_GETFL, 0) & ~O_NONBLOCK);
+    return rval;
+}
+#else /* !defined(O_NONBLOCK) */
+static int try_open_tape_device(TapeDevice * self, char * device_name) {
+    int rval;
+    rval = robust_open(device_name, O_RDWR);
+    if (rval >= 0) {
+        self->write_open_errno = 0;
+    } else {
+        if (errno == EACCES || errno == EPERM) {
+            /* Device is write-protected. */
+            self->write_open_errno = errno;
+            rval = robust_open(device_name, O_RDONLY);
+        }
+    }
+    return rval;
+}
+#endif /* O_NONBLOCK */
+
+static gboolean 
+tape_device_open_device (Device * d_self, char * device_name) {
+    TapeDevice * self;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (device_name != NULL, FALSE);
+
+    self->fd = try_open_tape_device(self, device_name);
+
+    if (self->fd < 0) {
+        g_fprintf(stderr, "Can't open tape device %s: %s\n",
+                device_name, strerror(errno));
+        return FALSE;
+    }
+
+    /* Check that this is actually a tape device. */
+    if (tape_is_tape_device(self->fd) == TAPE_CHECK_FAILURE) {
+        g_fprintf(stderr, "File %s is not a tape device.\n",
+                device_name);
+        robust_close(self->fd);
+        return FALSE;
+    }
+
+    if (tape_is_ready(self->fd) == TAPE_CHECK_FAILURE) {
+        g_fprintf(stderr,
+                  "Tape device %s is not ready or is empty.\n",
+                  device_name);
+        robust_close(self->fd);
+        return FALSE;
+    }
+
+    /* Rewind it. */
+    if (!tape_rewind(self->fd)) {
+        g_fprintf(stderr, "Error rewinding device %s\n",
+                device_name);
+        robust_close(self->fd);
+        return FALSE;
+    }
+
+    /* Get tape drive/OS info */
+    tape_device_discover_capabilities(self);
+
+    /* And verify the above. */
+    g_assert(feature_support_flags_is_valid(self->fsf));
+    g_assert(feature_support_flags_is_valid(self->bsf));
+    g_assert(feature_support_flags_is_valid(self->fsr));
+    g_assert(feature_support_flags_is_valid(self->bsr));
+    g_assert(feature_support_flags_is_valid(self->eom));
+    g_assert(feature_support_flags_is_valid(self->bsf_after_eom));
+    g_assert(self->final_filemarks == 1 ||
+             self->final_filemarks == 2);
+
+    /* Chain up */
+    if (parent_class->open_device) {
+        if (!(parent_class->open_device)(d_self, device_name)) {
+            robust_close(self->fd);
+            return FALSE;
+        }
+    }
+
+    return TRUE;
+}
+
+static ReadLabelStatusFlags tape_device_read_label(Device * dself) {
+    TapeDevice * self;
+    char * header_buffer;
+    int buffer_len;
+    IoResult result;
+    dumpfile_t header;
+
+    self = TAPE_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    if (!tape_rewind(self->fd)) {
+        g_fprintf(stderr, "Error rewinding device %s\n",
+                dself->device_name);
+        return (READ_LABEL_STATUS_DEVICE_ERROR |
+                READ_LABEL_STATUS_VOLUME_ERROR);
+    }   
+
+    buffer_len = self->read_block_size;
+    header_buffer = malloc(buffer_len);
+    result = tape_device_robust_read(self, header_buffer, &buffer_len);
+
+    if (result != RESULT_SUCCESS) {
+        free(header_buffer);
+        tape_rewind(self->fd);
+        /* I/O error. */
+        g_fprintf(stderr, "Error reading Amanda header.\n");
+        if (result == RESULT_NO_DATA) {
+            return (READ_LABEL_STATUS_VOLUME_ERROR |
+                    READ_LABEL_STATUS_VOLUME_UNLABELED);
+        } else {
+            return (READ_LABEL_STATUS_DEVICE_ERROR |
+                    READ_LABEL_STATUS_VOLUME_ERROR |
+                    READ_LABEL_STATUS_VOLUME_UNLABELED);
+        }
+    }
+
+    parse_file_header(header_buffer, &header, buffer_len);
+    amfree(header_buffer);
+    if (header.type != F_TAPESTART) {
+        return READ_LABEL_STATUS_VOLUME_UNLABELED;
+    }
+     
+    dself->volume_label = g_strdup(header.name);
+    dself->volume_time = g_strdup(header.datestamp);
+   
+    if (parent_class->read_label) {
+        return parent_class->read_label(dself);
+    } else {
+        return READ_LABEL_STATUS_SUCCESS;
+    }
+}
+
+static gboolean
+tape_device_write_block(Device * pself, guint size,
+                        gpointer data, gboolean short_block) {
+    TapeDevice * self;
+    char *replacement_buffer = NULL;
+    IoResult result;
+
+    self = TAPE_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (self->fd >= 0, FALSE);
+   
+    if (short_block && self->min_block_size > size) {
+        replacement_buffer = malloc(self->min_block_size);
+        memcpy(replacement_buffer, data, size);
+        bzero(replacement_buffer+size, self->min_block_size-size);
+        
+        data = replacement_buffer;
+        size = self->min_block_size;
+    }
+
+    result = tape_device_robust_write(self, data, size);
+    if (result == RESULT_SUCCESS) {
+        if (parent_class->write_block) {
+            (parent_class->write_block)(pself, size, data, short_block);
+        }
+        amfree(replacement_buffer);
+        return TRUE;
+    } else {
+        amfree(replacement_buffer);
+        return FALSE;
+    }
+    
+    g_assert_not_reached();
+}
+
+static int tape_device_read_block (Device * pself, gpointer buf,
+                                   int * size_req) {
+    TapeDevice * self;
+    int size;
+    IoResult result;
+    
+    self = TAPE_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, -1);
+
+    if (buf == NULL || *size_req < (int)self->read_block_size) {
+        /* Just a size query. */
+        *size_req = self->read_block_size;
+        return 0;
+    }
+
+    size = *size_req;
+    result = tape_device_robust_read(self, buf, &size);
+    switch (result) {
+    case RESULT_SUCCESS:
+        *size_req = size;
+        return size;
+    case RESULT_SMALL_BUFFER: {
+        int new_size;
+        /* If this happens, it means that we have:
+         *     (next block size) > (buffer size) >= (read_block_size)
+         * The solution is to ask for an even bigger buffer. We also play
+         * some games to refrain from reading above the SCSI limit or from
+         * integer overflow. */
+        new_size = MIN(INT_MAX/2 - 1, *size_req) * 2;
+        if (new_size > LARGEST_BLOCK_ESTIMATE &&
+            *size_req < LARGEST_BLOCK_ESTIMATE) {
+            new_size = LARGEST_BLOCK_ESTIMATE;
+        }
+        if (new_size <= *size_req) {
+            return -1;
+        } else {
+            *size_req = new_size;
+            return 0;
+        }
+    }
+    case RESULT_NO_DATA:
+        pself->is_eof = TRUE;
+        /* FALLTHROUGH */
+    default:
+        return -1;
+    }
+
+    g_assert_not_reached();
+}
+
+/* Just a helper function for tape_device_start(). */
+static gboolean write_tapestart_header(TapeDevice * self, char * label,
+                                       char * timestamp) {
+     IoResult result;
+     dumpfile_t * header;
+     char * header_buf;
+     int header_size;
+     gboolean header_fits;
+     Device * d_self = (Device*)self;
+     tape_rewind(self->fd);
+    
+     header = make_tapestart_header(d_self, label, timestamp);
+     g_assert(header != NULL);
+     header_buf = device_build_amanda_header(d_self, header, &header_size,
+                                             &header_fits);
+     amfree(header);
+     g_assert(header_buf != NULL);
+                                             
+     if (!header_fits) {
+         amfree(header_buf);
+         g_fprintf(stderr, "Tapestart header won't fit in a single block!\n");
+         return FALSE;
+     }
+
+     g_assert(header_size >= (int)self->min_block_size);
+     result = tape_device_robust_write(self, header_buf, header_size);
+     amfree(header_buf);
+     return (result == RESULT_SUCCESS);
+}
+
+static gboolean 
+tape_device_start (Device * d_self, DeviceAccessMode mode, char * label,
+                   char * timestamp) {
+    TapeDevice * self;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+    
+    if (IS_WRITABLE_ACCESS_MODE(mode)) {
+        if (self->write_open_errno != 0) {
+            /* We tried and failed to open the device in write mode. */
+            g_fprintf(stderr, "Can't open tape device %s for writing: %s\n",
+                    d_self->device_name, strerror(self->write_open_errno));
+            return FALSE;
+        } else if (!tape_rewind(self->fd)) {
+            g_fprintf(stderr, "Couldn't rewind device: %s\n",
+                    strerror(errno));
+        }
+    }
+
+    /* Position the tape */
+    switch (mode) {
+    case ACCESS_APPEND:
+        if (!tape_device_eod(self))
+            return FALSE;
+        self->first_file = TRUE;
+        break;
+        
+    case ACCESS_READ:
+        if (!tape_rewind(self->fd)) {
+            g_fprintf(stderr, "Error rewinding device %s\n",
+                    d_self->device_name);
+            return FALSE;
+        }
+        d_self->file = 0;
+        break;
+
+    case ACCESS_WRITE:
+        if (!write_tapestart_header(self, label, timestamp)) {
+            return FALSE;
+        }
+        self->first_file = TRUE;
+        break;
+
+    default:
+        g_assert_not_reached();
+    }
+
+    if (parent_class->start) {
+        return parent_class->start(d_self, mode, label, timestamp);
+    } else {
+        return TRUE;
+    }
+}
+
+static gboolean tape_device_start_file(Device * d_self,
+                                       const dumpfile_t * info) {
+    TapeDevice * self;
+    IoResult result;
+    char * amanda_header;
+    int header_size;
+    gboolean header_fits;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail (self->fd >= 0, FALSE);
+
+    if (!(d_self->access_mode == ACCESS_APPEND && self->first_file)) {
+        if (!tape_weof(self->fd, 1)) {
+            g_fprintf(stderr, "Error writing filemark: %s\n", strerror(errno));
+            return FALSE;
+        }
+    }
+
+    self->first_file = FALSE;
+
+    /* Make the Amanda header suitable for writing to the device. */
+    /* Then write the damn thing. */
+    amanda_header = device_build_amanda_header(d_self, info,
+                                               &header_size, &header_fits);
+    g_return_val_if_fail(amanda_header != NULL, FALSE);
+    g_return_val_if_fail(header_fits, FALSE);
+    result = tape_device_robust_write(self, amanda_header, header_size);
+    amfree(amanda_header);
+    if (result == RESULT_SUCCESS) {
+        /* Chain up. */
+        if (parent_class->start_file) {
+            parent_class->start_file(d_self, info);
+        }
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+static dumpfile_t * 
+tape_device_seek_file (Device * d_self, guint file) {
+    TapeDevice * self;
+    int difference;
+    char * header_buffer;
+    dumpfile_t * rval;
+    int buffer_len;
+    IoResult result;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(d_self != NULL, NULL);
+
+    d_self->in_file = FALSE;
+
+    difference = file - d_self->file;
+
+    /* Check if we already read a filemark. */
+    if (d_self->is_eof) {
+        difference --;
+    }
+
+    if (difference > 0) {
+        /* Seeking forwards */
+        if (!tape_device_fsf(self, difference)) {
+            tape_rewind(self->fd);
+            return NULL;
+        }
+    } else if (difference < 0) {
+        /* Seeking backwards */
+        if (!tape_device_bsf(self, -difference, d_self->file)) {
+            tape_rewind(self->fd);
+            return NULL;
+        }
+    }
+
+    buffer_len = self->read_block_size;
+    header_buffer = malloc(buffer_len);
+    d_self->is_eof = FALSE;
+    result = tape_device_robust_read(self, header_buffer, &buffer_len);
+
+    if (result != RESULT_SUCCESS) {
+        free(header_buffer);
+        tape_rewind(self->fd);
+        if (result == RESULT_NO_DATA) {
+            /* If we read 0 bytes, that means we encountered a double
+             * filemark, which indicates end of tape. This should
+             * work even with QIC tapes on operating systems with
+             * proper support. */
+            return make_tapeend_header();
+        }
+        /* I/O error. */
+        g_fprintf(stderr, "Error reading Amanda header.\n");
+        return FALSE;
+    }
+        
+    rval = malloc(sizeof(*rval));
+    parse_file_header(header_buffer, rval, buffer_len);
+    amfree(header_buffer);
+    switch (rval->type) {
+    case F_DUMPFILE:
+    case F_CONT_DUMPFILE:
+    case F_SPLIT_DUMPFILE:
+        d_self->in_file = TRUE;
+        d_self->file = file;
+        return rval;
+    default:
+        tape_rewind(self->fd);
+        amfree(rval);
+        return NULL;
+    }
+}
+
+static gboolean 
+tape_device_seek_block (Device * d_self, guint64 block) {
+    TapeDevice * self;
+    int difference;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(d_self != NULL, FALSE);
+
+    difference = block - d_self->block;
+    
+    if (difference > 0) {
+        if (!tape_device_fsr(self, difference))
+            return FALSE;
+    } else if (difference < 0) {
+        if (!tape_device_bsr(self, difference, d_self->file, d_self->block))
+            return FALSE;
+    }
+
+    if (parent_class->seek_block) {
+        return (parent_class->seek_block)(d_self, block);
+    } else {
+        return TRUE;
+    }
+}
+
+/* Just checks that the flag is valid before setting it. */
+static gboolean get_feature_flag(GValue * val, FeatureSupportFlags f) {
+    if (feature_support_flags_is_valid(f)) {
+        g_value_set_flags(val, f);
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+static gboolean 
+tape_device_property_get (Device * d_self, DevicePropertyId id, GValue * val) {
+    TapeDevice * self;
+    const DevicePropertyBase * base;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    base = device_property_get_by_id(id);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    g_value_unset_init(val, base->type);
+
+    if (id == PROPERTY_COMPRESSION) {
+        g_value_set_boolean(val, self->compression);
+        return TRUE;
+    } else if (id == PROPERTY_MIN_BLOCK_SIZE) {
+        g_value_set_uint(val, self->min_block_size);
+        return TRUE;
+    } else if (id == PROPERTY_MAX_BLOCK_SIZE) {
+        g_value_set_uint(val, self->max_block_size);
+        return TRUE;
+    } else if (id == PROPERTY_BLOCK_SIZE) {
+        if (self->fixed_block_size == 0) {
+            g_value_set_int(val, -1);
+        } else {
+            g_value_set_int(val, self->fixed_block_size);
+        }
+        return TRUE;
+    } else if (id == PROPERTY_FSF) {
+        return get_feature_flag(val, self->fsf);
+    } else if (id == PROPERTY_BSF) {
+        return get_feature_flag(val, self->bsf);
+    } else if (id == PROPERTY_FSR) {
+        return get_feature_flag(val, self->fsr);
+    } else if (id == PROPERTY_BSR) {
+        return get_feature_flag(val, self->bsr);
+    } else if (id == PROPERTY_EOM) {
+        return get_feature_flag(val, self->eom);
+    } else if (id == PROPERTY_BSF_AFTER_EOM) {
+        return get_feature_flag(val, self->bsf_after_eom);
+    } else if (id == PROPERTY_FINAL_FILEMARKS) {
+        g_value_set_uint(val, self->final_filemarks);
+        return TRUE;
+    } else {
+        /* Chain up */
+        if (parent_class->property_get) {
+            return (parent_class->property_get)(d_self, id, val);
+        } else {
+            return FALSE;
+        }
+    }
+
+    g_assert_not_reached();
+}
+
+/* We don't allow overriding of flags with _GOOD surety. That way, if
+   e.g., a feature has no matching IOCTL on a given platform, we don't
+   ever try to set it. */
+static gboolean flags_settable(FeatureSupportFlags request,
+                               FeatureSupportFlags existing) {
+    if (!feature_support_flags_is_valid(request))
+        return FALSE;
+    else if (!feature_support_flags_is_valid(existing))
+        return TRUE;
+    else if (request == existing)
+        return TRUE;
+    else if (existing & FEATURE_SURETY_GOOD)
+        return FALSE;
+    else
+        return TRUE;
+}
+
+/* If the access listed is NULL, and the provided flags can override the
+   existing ones, then do it and return TRUE. */
+static gboolean try_set_feature(DeviceAccessMode mode,
+                                FeatureSupportFlags request,
+                                FeatureSupportFlags * existing) {
+    if (mode != ACCESS_NULL) {
+        return FALSE;
+    } else if (flags_settable(request, *existing)) {
+        *existing = request;
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+static gboolean 
+tape_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) {
+    TapeDevice * self;
+    FeatureSupportFlags feature_request_flags = 0;
+    const DevicePropertyBase * base;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    base = device_property_get_by_id(id);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE);
+
+    if (base->type == FEATURE_SUPPORT_FLAGS_TYPE) {
+        feature_request_flags = g_value_get_flags(val);
+        g_return_val_if_fail(
+            feature_support_flags_is_valid(feature_request_flags), FALSE);
+    }
+
+    if (id == PROPERTY_COMPRESSION) {
+        /* We allow this property to be set at any time. This is mostly
+         * because setting compression is a hit-and-miss proposition
+         * at any time; some drives accept the mode setting but don't
+         * actually support compression, while others do support
+         * compression but do it via density settings or some other
+         * way. Set this property whenever you want, but all we'll do
+         * is report whether or not the ioctl succeeded. */
+        gboolean request = g_value_get_boolean(val);
+        if (tape_setcompression(self->fd, request)) {
+            self->compression = request;
+            device_clear_volume_details(d_self);
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    } else if (id == PROPERTY_MIN_BLOCK_SIZE) {
+        if (d_self->access_mode != ACCESS_NULL)
+            return FALSE;
+        self->min_block_size = g_value_get_uint(val);
+        device_clear_volume_details(d_self);
+        return TRUE;
+    } else if (id == PROPERTY_MAX_BLOCK_SIZE) {
+        if (d_self->access_mode != ACCESS_NULL)
+            return FALSE;
+        self->max_block_size = g_value_get_uint(val);
+        device_clear_volume_details(d_self);
+        return TRUE;
+    } else if (id == PROPERTY_BLOCK_SIZE) {
+        if (d_self->access_mode != ACCESS_NULL)
+            return FALSE;
+
+        self->fixed_block_size = g_value_get_int(val);
+        device_clear_volume_details(d_self);
+        return TRUE;
+    } else if (id == PROPERTY_FSF) {
+        return try_set_feature(d_self->access_mode,
+                               feature_request_flags,
+                               &(self->fsf));
+    } else if (id == PROPERTY_BSF) {
+        return try_set_feature(d_self->access_mode,
+                               feature_request_flags,
+                               &(self->bsf));
+    } else if (id == PROPERTY_FSR) {
+        return try_set_feature(d_self->access_mode,
+                               feature_request_flags,
+                               &(self->fsr));
+    } else if (id == PROPERTY_BSR) {
+        return try_set_feature(d_self->access_mode,
+                               feature_request_flags,
+                               &(self->bsr));
+    } else if (id == PROPERTY_EOM) {
+        /* Setting this to disabled also clears BSF after EOM. */
+        if (try_set_feature(d_self->access_mode,
+                            feature_request_flags,
+                            &(self->eom))) {
+            feature_request_flags &= ~FEATURE_SUPPORT_FLAGS_STATUS_MASK;
+            feature_request_flags |= FEATURE_STATUS_DISABLED;
+            self->bsf_after_eom = feature_request_flags;
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    } else if (id == PROPERTY_BSF_AFTER_EOM) {
+        /* You can only set this if EOM is enabled. */
+        if (self->bsf | FEATURE_STATUS_DISABLED)
+            return FALSE;
+        else
+            return try_set_feature(d_self->access_mode,
+                                   feature_request_flags,
+                                   &(self->bsf_after_eom));
+    } else if (id == PROPERTY_FINAL_FILEMARKS) {
+        guint request = g_value_get_uint(val);
+        if (request == 1 || request == 2) {
+            self->final_filemarks = request;
+            return TRUE;
+        } else {
+            return FALSE;
+        }
+    } else {
+        /* Chain up */
+        if (parent_class->property_set) {
+            return (parent_class->property_set)(d_self, id, val);
+        } else {
+            return FALSE;
+        }
+    }
+
+    g_assert_not_reached();
+}
+
+static gboolean 
+tape_device_finish (Device * d_self) {
+    TapeDevice * self;
+
+    self = TAPE_DEVICE(d_self);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    /* Polish off this file, if relevant. */
+    if (d_self->in_file && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) {
+        if (!device_finish_file(d_self))
+            return FALSE;
+    }
+
+    /* Write an extra filemark, if needed. The OS will give us one for
+       sure. */
+    if (self->final_filemarks > 1 &&
+        IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) {
+        if (!tape_weof(self->fd, 1)) {
+            g_fprintf(stderr, "Error writing final filemark: %s\n",
+                    strerror(errno));
+            return FALSE;
+        }
+    }
+
+    /* Rewind. */
+    if (!tape_rewind(self->fd)) {
+        g_fprintf(stderr, "Error rewinding tape: %s\n", strerror(errno));
+        return FALSE;
+    }
+
+    d_self->access_mode = ACCESS_NULL;
+
+    if (parent_class->finish) {
+        return (parent_class->finish)(d_self);
+    } else {
+        return TRUE;
+    }
+
+}
+
+/* Works just like read(), except for the following:
+ * 1) Retries on EINTR & friends.
+ * 2) Stores count in parameter, not return value.
+ * 3) Provides explicit return result. */
+static IoResult
+tape_device_robust_read (TapeDevice * self, void * buf, int * count) {
+    Device * d_self;
+    int result;
+
+    d_self = (Device*)self;
+    g_return_val_if_fail(self != NULL, RESULT_ERROR);
+    g_return_val_if_fail(*count >= 0, RESULT_ERROR);
+    /* Callers should ensure this. */
+    g_assert((guint)(*count) <= self->read_block_size);
+
+    for (;;) {
+        result = read(self->fd, buf, *count);
+        if (result > 0) {
+            /* Success. By definition, we read a full block. */
+            *count = result;
+            return RESULT_SUCCESS;
+        } else if (result == 0) {
+            return RESULT_NO_DATA;
+        } else {
+            if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                ) {
+                /* Interrupted system call */
+                continue;
+            } else if ((self->fixed_block_size == 0) &&
+                       (0
+#ifdef ENOMEM
+                        || errno == ENOMEM /* bad user-space buffer */
+#endif
+#ifdef EOVERFLOW
+                        || errno == EOVERFLOW /* bad kernel-space buffer */
+#endif
+#ifdef EINVAL
+                        || errno == EINVAL /* ??? */
+#endif
+                        )) {
+                /* Buffer too small. */
+                return RESULT_SMALL_BUFFER;
+            } else {
+                g_fprintf(stderr, "Error reading %d bytes from %s: %s\n",
+                        *count, d_self->device_name, strerror(errno));
+                return RESULT_ERROR;
+            }
+        }
+
+    }
+
+    g_assert_not_reached();
+}
+
+/* Kernel workaround: If needed, poke the kernel so it doesn't fail.
+   at the 2GB boundry. Parameters are G_GNUC_UNUSED in case NEED_RESETOFS
+   is not defined. */
+static void check_resetofs(TapeDevice * self G_GNUC_UNUSED,
+                           int count G_GNUC_UNUSED) {
+#ifdef NEED_RESETOFS
+    int result;
+
+    self->private->write_count += count;
+    if (self->private->write_count < RESETOFS_THRESHOLD) {
+        return;
+    }
+
+    result = lseek(self->fd, 0, SEEK_SET);
+    if (result < 0) {
+        g_fprintf(stderr,
+                "Warning: lseek() failed during kernel 2GB workaround.\n");
+    }
+#endif
+}
+
+static IoResult 
+tape_device_robust_write (TapeDevice * self, void * buf, int count) {
+    Device * d_self;
+    int result;
+
+    g_return_val_if_fail(self != NULL, RESULT_ERROR);
+    d_self = (Device*)self;
+    
+    check_resetofs(self, count);
+
+    for (;;) {
+        result = write(self->fd, buf, count);
+
+        if (result == count) {
+            /* Success. */
+
+            self->private->write_count ++;
+            return RESULT_SUCCESS;
+        } else if (result >= 0) {
+            /* write() returned a short count. This should not happen. */
+            g_fprintf(stderr,
+                  "Mysterious short write on tape device: Tried %d, got %d.\n",
+                    count, result);
+            return RESULT_ERROR;
+        } else if (0
+#ifdef EAGAIN
+                   || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                   || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                   || errno == EINTR
+#endif
+                   ) {
+                /* Interrupted system call */
+            continue;
+        } else if (0
+#ifdef ENOSPC
+                   || errno == ENOSPC
+#endif
+#ifdef EIO
+                   || errno == EIO
+#endif
+                   ) {
+            /* Probably EOT. Print a message if we got EIO. */
+#ifdef EIO
+            if (errno == EIO) {
+                g_fprintf(stderr, "Got EIO on %s, assuming end of tape.\n",
+                        d_self->device_name);
+            }
+#endif
+            return RESULT_NO_SPACE;
+        } else {
+            /* WTF */
+            g_fprintf(stderr,
+     "Kernel gave unexpected write() result of \"%s\" on device %s.\n",
+                    strerror(errno), d_self->device_name);
+            return RESULT_ERROR;
+        }
+    }
+
+    g_assert_not_reached();
+}
+
+/* Reads some number of tape blocks into the bit-bucket. If the count
+   is negative, then we read the rest of the entire file. Returns the
+   number of blocks read, or -1 if an error occured. If we encounter
+   EOF (as opposed to some other error) we return the number of blocks
+   actually read. */
+static int drain_tape_blocks(TapeDevice * self, int count) {
+    char * buffer;
+    int buffer_size;
+    int i;
+
+    buffer_size = self->read_block_size;
+
+    buffer = malloc(sizeof(buffer_size));
+
+    for (i = 0; i < count || count < 0;) {
+        int result;
+
+        result = read(self->fd, buffer, buffer_size);
+        if (result > 0) {
+            i ++;
+            continue;
+        } else if (result == 0) {
+            free(buffer);
+            return i;
+        } else {
+            /* First check for interrupted system call. */
+            if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                ) {
+                /* Interrupted system call */
+                continue;
+            } else if (0
+#ifdef ENOSPC
+                       || errno == ENOSPC /* bad user-space buffer */
+#endif
+#ifdef EOVERFLOW
+                       || errno == EOVERFLOW /* bad kernel-space buffer */
+#endif
+#ifdef EINVAL
+                       || errno == EINVAL /* ??? */
+#endif
+                       ) {
+                /* The buffer may not be big enough. But the OS is not
+                   100% clear. We double the buffer and try again, but
+                   in no case allow a buffer bigger than 32 MB. */
+                buffer_size *= 2;
+
+                if (buffer_size > 32*1024*1024) {
+                    free(buffer);
+                    return -1;
+                } else {
+                    buffer = realloc(buffer, buffer_size);
+                    continue;
+                }
+            }
+        }
+    }
+    
+    return count;
+}
+
+/* FIXME: Make sure that there are no cycles in reimplementation
+   dependencies. */
+
+static gboolean 
+tape_device_fsf (TapeDevice * self, guint count) {
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+    
+    if (self->fsf & FEATURE_STATUS_ENABLED) {
+        return tape_fsf(self->fd, count);
+    } else {
+        guint i;
+        for (i = 0; i < count; i ++) {
+            if (drain_tape_blocks(self, -1) < 0)
+                return FALSE;
+        }
+        return TRUE;
+    }
+}
+
+/* Seek back over count + 1 filemarks to the start of the given file. */
+static gboolean 
+tape_device_bsf (TapeDevice * self, guint count, guint file) {
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+
+    if (self->bsf & FEATURE_STATUS_ENABLED) {
+        /* The BSF operation is not very smart; it includes the
+           filemark of the present file as part of the count, and seeks
+           to the wrong (BOT) side of the filemark. We compensate for
+           this by seeking one filemark too many, then FSFing back over
+           it.
+
+           If this procedure fails for some reason, we can still try
+           the backup plan. */
+        if (tape_bsf(self->fd, count + 1) &&
+            tape_device_fsf(self, 1))
+            return TRUE;
+    } /* Fall through to backup plan. */
+
+    /* We rewind the tape, then seek forward the given number of
+       files. */
+    if (!tape_rewind(self->fd))
+        return FALSE;
+
+    return tape_device_fsf(self, file);
+}
+
+
+static gboolean 
+tape_device_fsr (TapeDevice * self, guint count) {
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+
+    if (self->fsr & FEATURE_STATUS_ENABLED) {
+        return tape_fsr(self->fd, count);
+    } else {
+        int result = drain_tape_blocks(self, count);
+        return result > 0 && (int)count == result;
+    }
+}
+
+/* Seek back the given number of blocks to block number block within
+ * the current file, numbered file. */
+
+static gboolean 
+tape_device_bsr (TapeDevice * self, guint count, guint file, guint block) {
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+    
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+
+    if (self->bsr & FEATURE_STATUS_ENABLED) {
+        return tape_bsr(self->fd, count);
+    } else {
+        /* We BSF, then FSR. */
+        if (!tape_device_bsf(self, 0, file))
+            return FALSE;
+        
+        return tape_device_fsr(self, block);
+    }
+    g_assert_not_reached();
+}
+
+/* Go to the right place to write more data, and update the file
+   number if possible. */
+static gboolean 
+tape_device_eod (TapeDevice * self) {
+    Device * d_self;
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0);
+    d_self = (Device*)self;
+
+    if (self->eom & FEATURE_STATUS_ENABLED) {
+        int result;
+        result = tape_eod(self->fd); 
+        if (result == TAPE_OP_ERROR) {
+            return FALSE;
+        } else if (result == TAPE_POSITION_UNKNOWN) {
+            d_self->file = -1;
+        } else {
+            /* We drop by 1 because Device will increment the first
+               time the user does start_file. */
+            d_self->file = result - 1;
+        }
+        return TRUE;
+    } else {
+        int count = 0;
+        if (!tape_rewind(self->fd))
+            return FALSE;
+        
+        for (;;) {
+            /* We alternately read a block and FSF. If the read is
+               successful, then we are not there yet and should FSF
+               again. */
+            int result;
+            result = drain_tape_blocks(self, 1);
+            if (result == 1) {
+                /* More data, FSF. */
+                tape_device_fsf(self, 1);
+                count ++;
+            } else if (result == 0) {
+                /* Finished. */
+                d_self->file = count;
+                return TRUE;
+            } else {
+                return FALSE;
+            }
+        }
+    }
+}
+
+Device *
+tape_device_factory (char * device_type, char * device_name) {
+    Device * rval;
+    g_assert(0 == strcmp(device_type, "tape"));
+    rval = DEVICE(g_object_new(TYPE_TAPE_DEVICE, NULL));
+    if (!device_open_device(rval, device_name)) {
+        g_object_unref(rval);
+        return NULL;
+    } else {
+        return rval;
+    }
+}
diff --git a/device-src/tape-device.h b/device-src/tape-device.h
new file mode 100644 (file)
index 0000000..7bfa1da
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef TAPE_DEVICE_H
+#define TAPE_DEVICE_H
+
+#include <device.h>
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_TAPE_DEVICE       (tape_device_get_type())
+#define TAPE_DEVICE(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice)
+#define TAPE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice const)
+#define TAPE_DEVICE_CLASS(klass)       G_TYPE_CHECK_CLASS_CAST((klass), tape_device_get_type(), TapeDeviceClass)
+#define IS_TAPE_DEVICE(obj)    G_TYPE_CHECK_INSTANCE_TYPE((obj), tape_device_get_type ())
+
+#define TAPE_DEVICE_GET_CLASS(obj)     G_TYPE_INSTANCE_GET_CLASS((obj), tape_device_get_type(), TapeDeviceClass)
+
+/*
+ * Main object structure
+ */
+typedef struct TapeDevicePrivate_s TapeDevicePrivate;
+typedef struct _TapeDevice {
+    Device __parent__;
+
+    /* It should go without saying that all this stuff is
+     * look-but-don't-touch. */
+    guint min_block_size, max_block_size, fixed_block_size, read_block_size;
+    FeatureSupportFlags fsf, bsf, fsr, bsr, eom, bsf_after_eom;
+    int final_filemarks;
+    gboolean compression;
+    /* 0 if we opened with O_RDWR; error otherwise. */
+    gboolean write_open_errno;
+    gboolean first_file; /* Is this the first file in append mode? */
+    int fd;
+
+    TapeDevicePrivate * private;
+} TapeDevice;
+
+/*
+ * Class definition
+ */
+typedef struct _TapeDeviceClass TapeDeviceClass;
+struct _TapeDeviceClass {
+       DeviceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  tape_device_get_type    (void);
+Device*        tape_device_factory     (char * type,
+                                 char * name);
+void    tape_device_register    (void);
+
+#endif
diff --git a/device-src/tape-ops.h b/device-src/tape-ops.h
new file mode 100644 (file)
index 0000000..2448373
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef TAPE_OPS_H
+
+#include <glib.h>
+#include "tape-device.h"
+#include "amanda.h"
+
+#ifdef HAVE_SYS_TAPE_H
+# include <sys/tape.h>
+#endif
+#ifdef HAVE_SYS_MTIO_H
+# include <sys/mtio.h>
+#endif
+
+/* Return codes for tape_eod */
+#define TAPE_OP_ERROR -1
+#define TAPE_POSITION_UNKNOWN -2
+
+/* Real Operations (always return FALSE if not implemented). These are
+ * implemented in one of tape-{uware,aix,xenix,posix}.c, depending on
+ * the platform. */
+gboolean tape_rewind(int fd);
+gboolean tape_fsf(int fd, guint count);
+gboolean tape_bsf(int fd, guint count);
+gboolean tape_fsr(int fd, guint count);
+gboolean tape_bsr(int fd, guint count);
+/* Returns tape position file number, or one of the return codes above. */
+gint tape_eod(int fd);
+gboolean tape_weof(int fd, guint8 count);
+gboolean tape_setcompression(int fd, gboolean on);
+
+typedef enum {
+    TAPE_CHECK_SUCCESS,
+    TAPE_CHECK_UNKNOWN,
+    TAPE_CHECK_FAILURE
+} TapeCheckResult;
+TapeCheckResult tape_is_tape_device(int fd);
+TapeCheckResult tape_is_ready(int fd);
+
+/* Also implemented in above files. Sets properties on the device. */
+void tape_device_discover_capabilities(TapeDevice * self);
+
+#endif
+
diff --git a/device-src/tape-posix.c b/device-src/tape-posix.c
new file mode 100644 (file)
index 0000000..a9a31bb
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amanda.h"
+#include "util.h"
+#include "tape-ops.h"
+#include "property.h"
+#include <glob.h>
+
+/* Having one name for every operation would be too easy. */
+#if !defined(MTCOMPRESSION) && defined(MTCOMP)
+# define MTCOMPRESSION MTCOMP
+#endif
+
+#if !defined(MTSETBLK) && defined(MTSETBSIZ)
+# define MTSETBLK MTSETBSIZ
+#endif
+
+#if !defined(MTEOM) && defined(MTEOD)
+# define MTEOM MTEOD
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+gboolean tape_rewind(int fd) {
+    int count = 5;
+    time_t stop_time;
+
+    /* We will retry this for up to 30 seconds or 5 retries,
+       whichever is less, because some hardware/software combinations
+       (notably EXB-8200 on FreeBSD) can fail to rewind. */
+    stop_time = time(NULL) + 30;
+
+    while (--count >= 0 && time(NULL) < stop_time) {
+        struct mtop mt;
+        mt.mt_op = MTREW;
+        mt.mt_count = 1;
+
+        if (0 == ioctl(fd, MTIOCTOP, &mt))
+            return TRUE;
+
+        sleep(3);
+    }
+
+    return FALSE;
+}
+
+gboolean tape_fsf(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTFSF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_bsf(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTBSF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_fsr(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTFSR;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_bsr(int fd, guint count) {
+    struct mtop mt;
+    mt.mt_op = MTBSR;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gint tape_eod(int fd) {
+    struct mtop mt;
+    struct mtget get;
+    mt.mt_op = MTEOM;
+    mt.mt_count = 1;
+    if (0 != ioctl(fd, MTIOCTOP, &mt))
+        return TAPE_OP_ERROR;
+
+    /* Ignored result. This is just to flush buffers. */
+    mt.mt_op = MTNOP;
+    ioctl(fd, MTIOCTOP, &mt);
+
+    if (0 != ioctl(fd, MTIOCGET, &get))
+        return TAPE_POSITION_UNKNOWN;
+    if (get.mt_fileno < 0)
+        return TAPE_POSITION_UNKNOWN;
+    else
+        return get.mt_fileno;
+}
+
+gboolean tape_weof(int fd, guint8 count) {
+    struct mtop mt;
+    mt.mt_op = MTWEOF;
+    mt.mt_count = count;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+}
+
+gboolean tape_setcompression(int fd G_GNUC_UNUSED, 
+       gboolean on G_GNUC_UNUSED) {
+#ifdef MTCOMPRESSION
+    struct mtop mt;
+    mt.mt_op = MTCOMPRESSION;
+    mt.mt_count = on;
+    return 0 == ioctl(fd, MTIOCTOP, &mt);
+#else
+    return 0;
+#endif
+}
+
+TapeCheckResult tape_is_tape_device(int fd) {
+    struct mtop mt;
+    mt.mt_op = MTNOP;
+    mt.mt_count = 1;
+    if (0 == ioctl(fd, MTIOCTOP, &mt)) {
+        return TAPE_CHECK_SUCCESS;
+    } else {
+       dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s",
+                strerror(errno));
+        return TAPE_CHECK_FAILURE;
+    }
+}
+
+TapeCheckResult tape_is_ready(int fd) {
+    struct mtget get;
+    if (0 == ioctl(fd, MTIOCGET, &get)) {
+#if defined(GMT_DR_OPEN)
+        if (!GMT_DR_OPEN(get.mt_gstat)) {
+            return TAPE_CHECK_SUCCESS;
+        } else {
+           dbprintf("tape_is_read: ioctl(MTIOCGET) failed: %s", strerror(errno));
+            return TAPE_CHECK_FAILURE;
+        }
+#else /* Neither macro is defined. */
+        return TAPE_CHECK_UNKNOWN;
+#endif
+    } else {
+        return TAPE_CHECK_FAILURE;
+    }
+}
+
+void tape_device_discover_capabilities(TapeDevice * t_self) {
+    Device * self;
+    GValue val;
+
+    self = DEVICE(t_self);
+    g_return_if_fail(self != NULL);
+
+    bzero(&val, sizeof(val));
+    g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE);
+
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_EOM, &val);
+
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_BAD | 
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSF_AFTER_EOM, &val);
+
+    g_value_unset_init(&val, G_TYPE_UINT);
+    g_value_set_uint(&val, 2);
+    device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val);
+}
diff --git a/device-src/tape-uware.c b/device-src/tape-uware.c
new file mode 100644 (file)
index 0000000..4f21616
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* Tape operations for SVR4 systems. Most of this stuff is based on
+   documentation from http://docsrv.sco.com/cgi-bin/man/man?sdi+7 */
+
+#include <amanda.h>
+#include <tape-ops.h>
+
+/* Uncomment to test on non-SYSV4 systems. */
+/* ---
+#undef MTIOCTOP
+#define T_RWD 0
+#define T_SFF 0
+#define T_SFB 0
+#define T_SBF 0
+#define T_SBB 0
+#define T_WRFILEM 0
+#define T_RDBLKLEN 0
+#define T_WRBLKLEN 0
+#define T_SETCOMP 0
+
+struct blklen {
+    int min_blen, max_blen;
+};
+
+ --- */
+
+gboolean tape_rewind(int fd) {
+    return 0 == ioctl(fd, T_RWD);
+}
+
+gboolean tape_fsf(int fd, guint count) {
+    return 0 == ioctl(fd, T_SFF, count);
+}
+
+gboolean tape_bsf(int fd, guint count) {
+    return 0 == ioctl(fd, T_SFB, count);
+}
+
+gboolean tape_fsr(int fd, guint count) {
+    return 0 == ioctl(fd, T_SBF, count);
+}
+
+gboolean tape_bsr(int fd, guint count) {
+    return 0 == ioctl(fd, T_SBB, count);
+}
+
+int tape_eod(int fd) {
+    g_assert_not_reached();
+    return TAPE_OP_ERROR;
+}
+
+gboolean tape_weof(int fd, guint8 count) {
+    return 0 == ioctl(fd, T_WRFILEM, count);
+}
+
+gboolean tape_setcompression(int fd, gboolean on) {
+    int cmd;
+    if (on) {
+        cmd = 3;
+    } else {
+        cmd = 2;
+    }
+
+    return 0 == ioctl(fd, T_SETCOMP, cmd);
+}
+
+TapeCheckResult tape_is_tape_device(int fd) {
+    /* If we can read block information, it's probably a tape device. */
+    struct blklen result;
+    if (0 == ioctl(fd, T_RDBLKLEN, &result)) {
+        return TAPE_CHECK_SUCCESS;
+    } else {
+        return TAPE_CHECK_FAILURE;
+    }
+}
+
+TapeCheckResult tape_is_tape_ready(int fd) {
+    return TAPE_CHECK_UNKNOWN;
+}
+
+void tape_device_discover_capabilities(TapeDevice * t_self) {
+    Device * self;
+    GValue val;
+
+    self = DEVICE(t_self);
+    g_return_if_fail(self != NULL);
+
+    bzero(&val, sizeof(val));
+    g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE);
+
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_EOM, &val);
+
+    g_value_unset_init(&val, G_TYPE_UINT);
+    g_value_set_uint(&val, 2);
+    device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val);
+}
diff --git a/device-src/tape-xenix.c b/device-src/tape-xenix.c
new file mode 100644 (file)
index 0000000..87be604
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* Tape operations for XENIX systems. Most of this stuff is based on
+   documentation from
+   http://www.ifthenfi.nl:8080/cgi-bin/ssl_getmanpage?tape+HW+XNX234+tape
+*/
+
+#include <amanda.h>
+#include <tape-ops.h>
+
+/* Uncomment to test compilation on non-XENIX systems. */
+/* --- 
+#undef MTIOCTOP
+#define MT_REWIND 0
+#define MT_STATUS 0
+#define T_RFM 0
+#define T_WFM 0
+struct tape_info {};
+  --- */
+
+gboolean tape_rewind(int fd) {
+    return 0 == ioctl(fd, MT_REWIND);
+}
+
+gboolean tape_fsf(int fd, guint count) {
+    while (--count >= 0) {
+        if (0 != ioctl(fd, T_RFM))
+            return FALSE;
+    }
+    return TRUE;
+}
+
+gboolean tape_bsf(int fd, guint count) {
+    g_assert_not_reached();
+    return FALSE;
+}
+
+gboolean tape_fsr(int fd, guint count) {
+    g_assert_not_reached();
+    return FALSE;
+}
+
+gboolean tape_bsr(int fd, guint count) {
+    g_assert_not_reached();
+    return FALSE;
+}
+
+gint tape_eod(int fd) {
+    g_assert_not_reached();
+    return TAPE_OP_ERROR;
+}
+
+gboolean tape_weof(int fd, guint8 count) {
+    while (count -- > 0) {
+        if (0 != ioctl(fd, T_WFM))
+            return FALSE;
+    } 
+
+    return TRUE;
+}
+
+gboolean tape_setcompression(int fd, gboolean on) {
+    return FALSE;
+}
+
+TapeCheckResult tape_is_tape_device(int fd) {
+    struct tape_info result;
+    if (0 == ioctl(fd, MT_STATUS, &result)) {
+        return TAPE_CHECK_SUCCESS;
+    } else {
+        return TAPE_CHECK_FAILURE;
+    }
+}
+
+TapeCheckResult tape_is_ready(int fd) {
+    /* We can probably do better. */
+    return TAPE_CHECK_UNKNOWN;
+}
+
+void tape_device_discover_capabilities(TapeDevice * t_self) {
+    Device * self;
+    GValue val;
+
+    self = DEVICE(t_self);
+    g_return_if_fail(self != NULL);
+
+    bzero(&val, sizeof(val));
+    g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE);
+
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSF, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_FSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_BSR, &val);
+    
+    g_value_set_flags(&val,
+                      FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD |
+                      FEATURE_SOURCE_DEFAULT);
+    device_property_set(self, PROPERTY_EOM, &val);
+
+    g_value_unset_init(&val, G_TYPE_UINT);
+    g_value_set_uint(&val, 2);
+    device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val);
+}
diff --git a/device-src/tests/Makefile.am b/device-src/tests/Makefile.am
new file mode 100644 (file)
index 0000000..9c54473
--- /dev/null
@@ -0,0 +1,28 @@
+# Makefile for Amanda tape library.
+
+INCLUDES =     -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib \
+               -I$(top_srcdir)/device-src
+
+# automake-style tests
+
+noinst_PROGRAMS = queue_test device_test $(TESTS)
+
+###
+# Because libamanda includes routines (e.g. regex) provided by some system
+# libraries, and because of the way libtool sets up the command line, we
+# need to list libamanda twice here, first to override the system library
+# routines, and second to pick up any references in the other libraries.
+###
+LDADD = ../../common-src/libamanda.la \
+       ../libamdevice.la \
+       ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+
+
+TESTS = semaphore-test vfs_test
+
+semaphore_test_SOURCES = semaphore-test.c
+
+vfs_test_SOURCES = vfs_test.c
diff --git a/device-src/tests/Makefile.in b/device-src/tests/Makefile.in
new file mode 100644 (file)
index 0000000..fd8b7ec
--- /dev/null
@@ -0,0 +1,963 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+
+# Makefile for Amanda tape library.
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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@
+noinst_PROGRAMS = queue_test$(EXEEXT) device_test$(EXEEXT) \
+       $(am__EXEEXT_1)
+TESTS = semaphore-test$(EXEEXT) vfs_test$(EXEEXT)
+subdir = device-src/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+am__EXEEXT_1 = semaphore-test$(EXEEXT) vfs_test$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+device_test_SOURCES = device_test.c
+device_test_OBJECTS = device_test.$(OBJEXT)
+device_test_LDADD = $(LDADD)
+device_test_DEPENDENCIES = ../../common-src/libamanda.la \
+       ../libamdevice.la ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+queue_test_SOURCES = queue_test.c
+queue_test_OBJECTS = queue_test.$(OBJEXT)
+queue_test_LDADD = $(LDADD)
+queue_test_DEPENDENCIES = ../../common-src/libamanda.la \
+       ../libamdevice.la ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+am_semaphore_test_OBJECTS = semaphore-test.$(OBJEXT)
+semaphore_test_OBJECTS = $(am_semaphore_test_OBJECTS)
+semaphore_test_LDADD = $(LDADD)
+semaphore_test_DEPENDENCIES = ../../common-src/libamanda.la \
+       ../libamdevice.la ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+am_vfs_test_OBJECTS = vfs_test.$(OBJEXT)
+vfs_test_OBJECTS = $(am_vfs_test_OBJECTS)
+vfs_test_LDADD = $(LDADD)
+vfs_test_DEPENDENCIES = ../../common-src/libamanda.la \
+       ../libamdevice.la ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = device_test.c queue_test.c $(semaphore_test_SOURCES) \
+       $(vfs_test_SOURCES)
+DIST_SOURCES = device_test.c queue_test.c $(semaphore_test_SOURCES) \
+       $(vfs_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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@
+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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib \
+               -I$(top_srcdir)/device-src
+
+
+###
+# Because libamanda includes routines (e.g. regex) provided by some system
+# libraries, and because of the way libtool sets up the command line, we
+# need to list libamanda twice here, first to override the system library
+# routines, and second to pick up any references in the other libraries.
+###
+LDADD = ../../common-src/libamanda.la \
+       ../libamdevice.la \
+       ../../common-src/libamanda.la \
+       ../../gnulib/libgnu.la
+
+semaphore_test_SOURCES = semaphore-test.c
+vfs_test_SOURCES = vfs_test.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  device-src/tests/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  device-src/tests/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+device_test$(EXEEXT): $(device_test_OBJECTS) $(device_test_DEPENDENCIES) 
+       @rm -f device_test$(EXEEXT)
+       $(LINK) $(device_test_OBJECTS) $(device_test_LDADD) $(LIBS)
+queue_test$(EXEEXT): $(queue_test_OBJECTS) $(queue_test_DEPENDENCIES) 
+       @rm -f queue_test$(EXEEXT)
+       $(LINK) $(queue_test_OBJECTS) $(queue_test_LDADD) $(LIBS)
+semaphore-test$(EXEEXT): $(semaphore_test_OBJECTS) $(semaphore_test_DEPENDENCIES) 
+       @rm -f semaphore-test$(EXEEXT)
+       $(LINK) $(semaphore_test_OBJECTS) $(semaphore_test_LDADD) $(LIBS)
+vfs_test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) 
+       @rm -f vfs_test$(EXEEXT)
+       $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore-test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_test.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       srcdir=$(srcdir); export srcdir; \
+       list=' $(TESTS) '; \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               echo "XPASS: $$tst"; \
+             ;; \
+             *) \
+               echo "PASS: $$tst"; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xfail=`expr $$xfail + 1`; \
+               echo "XFAIL: $$tst"; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               echo "FAIL: $$tst"; \
+             ;; \
+             esac; \
+           else \
+             skip=`expr $$skip + 1`; \
+             echo "SKIP: $$tst"; \
+           fi; \
+         done; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="All $$all tests passed"; \
+           else \
+             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+           fi; \
+         else \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all tests failed"; \
+           else \
+             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+           fi; \
+         fi; \
+         dashes="$$banner"; \
+         skipped=""; \
+         if test "$$skip" -ne 0; then \
+           skipped="($$skip tests were not run)"; \
+           test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$skipped"; \
+         fi; \
+         report=""; \
+         if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+           report="Please report to $(PACKAGE_BUGREPORT)"; \
+           test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$report"; \
+         fi; \
+         dashes=`echo "$$dashes" | sed s/./=/g`; \
+         echo "$$dashes"; \
+         echo "$$banner"; \
+         test -z "$$skipped" || echo "$$skipped"; \
+         test -z "$$report" || echo "$$report"; \
+         echo "$$dashes"; \
+         test "$$failed" -eq 0; \
+       else :; fi
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$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
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS)
+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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-noinstPROGRAMS \
+       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
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+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
+
+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 all all-am check check-TESTS check-am clean \
+       clean-generic clean-libtool clean-noinstPROGRAMS ctags \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am
+
+# 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/device-src/tests/device_test.c b/device-src/tests/device_test.c
new file mode 100644 (file)
index 0000000..9a46fee
--- /dev/null
@@ -0,0 +1,198 @@
+#include <device.h>
+#include <amanda.h>
+#include <timestamp.h>
+
+int blocksize;
+unsigned int seed = 0;
+
+static char * make_rand_buf(int size) {
+    char * rval;
+    unsigned int i;
+
+    rval = malloc(size);
+    i = size;
+    while (i > sizeof(int)) {
+        int rand;
+        rand = rand_r(&seed);
+        memcpy(rval + size - i, &rand, sizeof(int));
+        i -= sizeof(int);
+    }
+    
+    if (size > 0) {
+        int rand;
+        rand = rand_r(&seed);
+        memcpy(rval + size - i, &rand, i);
+    }
+
+    return rval;
+}
+
+static gboolean write_whole_file(Device * device) {
+    dumpfile_t dumpfile;
+    char * tmp;
+    int i;
+
+    fh_init(&dumpfile);
+    dumpfile.type = F_DUMPFILE;
+    tmp = get_timestamp_from_time(time(NULL));
+    strcpy(dumpfile.datestamp, tmp);
+    amfree(tmp);
+    strcpy(dumpfile.name, "localhost");
+    tmp = g_get_current_dir();
+    strcpy(dumpfile.disk, tmp);
+    amfree(tmp);
+    strcpy(dumpfile.program, "TESTER");
+    strcpy(dumpfile.recover_cmd, "recover_cmd");
+
+    blocksize = device_write_max_size(device);
+    
+    g_return_val_if_fail(device_start_file(device, &dumpfile), FALSE);
+    
+    for (i = 0; i < 1000; i ++) {
+        int size;
+        char * buf;
+        if (i == 999)
+            size = blocksize / 2;
+        else
+            size = blocksize;
+        buf = make_rand_buf(size);
+        g_return_val_if_fail(device_write_block(device, size, buf, i == 999),
+                             FALSE);
+        amfree(buf);
+    }
+    
+    g_return_val_if_fail(device->in_file == FALSE, FALSE);
+
+    return TRUE;
+}
+
+static gboolean read_whole_file(Device * device, int fileno) {
+    int size = 0;
+    dumpfile_t * file = device_seek_file(device, fileno + 1);
+    int i;
+    char *buf;
+
+    if (file == NULL)
+        g_assert_not_reached();
+    else
+        amfree(file);
+
+    g_return_val_if_fail(device_seek_block(device, 0), FALSE);
+    
+    g_return_val_if_fail(0 == device_read_block(device, NULL, &size),
+                         FALSE);
+    g_assert(size >= blocksize);
+        
+    for (i = 0; i < 1000; i ++) {
+        int size, size2;
+        char buf2[blocksize];
+        size2 = blocksize;
+        if (i == 999)
+            size = blocksize/2;
+        else
+            size = blocksize;
+        buf = make_rand_buf(size);
+        
+        g_return_val_if_fail(device_read_block(device, buf2, &size2),
+                             FALSE);
+        g_assert(size2 == size || size2 == blocksize);
+        g_assert(memcmp(buf, buf2, size) == 0);
+        amfree(buf);
+    }
+    
+    size = blocksize;
+    buf = malloc(blocksize);
+    g_assert(-1 == device_read_block(device, &buf, &size));
+    g_return_val_if_fail(device->is_eof, FALSE);
+    free(buf);
+
+    return TRUE;
+}
+
+static MediaAccessMode get_medium_type(Device * device) {
+    GValue value;
+    MediaAccessMode rval;
+    
+    bzero(&value, sizeof(value));
+
+    g_return_val_if_fail(device_property_get(device, PROPERTY_MEDIUM_TYPE,
+                                             &value), 0);
+
+    rval = g_value_get_enum(&value);
+    g_value_unset(&value);
+    return rval;
+}
+
+int main(int argc, char ** argv) {
+    Device * device;
+    int h;
+    MediaAccessMode medium_type;
+    
+    g_return_val_if_fail(argc == 2, 1);
+
+    device_api_init();
+
+    device = device_open(argv[1]);
+    g_return_val_if_fail(device != NULL, 2);
+
+    medium_type = get_medium_type(device);
+
+    if (device->volume_label) {
+        printf("Last header: %s %s\n", device->volume_label,
+               device->volume_time);
+    }
+
+    if (medium_type != MEDIA_ACCESS_MODE_READ_ONLY) {
+        g_return_val_if_fail(device_start(device, ACCESS_WRITE, 
+                                          "foo", NULL),
+                             2);
+        
+        for (h = 0; h < 10; h ++) {
+            gboolean appendable;
+            GValue value;
+            g_return_val_if_fail(write_whole_file(device), 3);
+            
+            bzero(&value, sizeof(value));
+            g_return_val_if_fail(device_property_get(device,
+                                                     PROPERTY_APPENDABLE,
+                                                     &value), 4);
+            appendable = g_value_get_boolean(&value);
+            g_value_unset(&value);
+            
+            if (appendable && h == 5) {
+                g_object_unref(device);
+                
+                device = device_open(argv[1]);
+                g_return_val_if_fail(device != NULL, 6);
+                
+                g_return_val_if_fail(device_start(device, ACCESS_APPEND, 
+                                                  "foo", NULL),
+                                     2);
+            }
+        }
+        
+        g_object_unref(device);    
+        
+        device = device_open(argv[1]);
+        g_return_val_if_fail(device != NULL, 6);
+    }
+
+    /* Fixme: check for readable access mode. */
+    if (medium_type != MEDIA_ACCESS_MODE_WRITE_ONLY) {
+        g_return_val_if_fail(device->volume_label, 7);
+        printf("This header: %s %s\n", device->volume_label,
+               device->volume_time);    
+        
+        g_return_val_if_fail(device_start(device, ACCESS_READ, 
+                                          "foo", NULL),
+                             2);
+        seed = 0;
+        for (h = 0; h < 10; h ++) {
+            g_return_val_if_fail(read_whole_file(device, h), 8);
+        }
+    }
+
+    g_object_unref(device);    
+
+    return 0;
+}
diff --git a/device-src/tests/queue_test.c b/device-src/tests/queue_test.c
new file mode 100644 (file)
index 0000000..f6cef95
--- /dev/null
@@ -0,0 +1,21 @@
+#include <queueing.h>
+#include <device.h>
+#include <amanda.h>
+
+int main(void) {
+    /* ignore SIGPIPE */
+    signal(SIGPIPE, SIG_IGN);
+
+    /* Comment out this line to disable threads. */
+    device_api_init();
+
+    /* The integer here is the block size to use. Set it to something
+     * bigger for better performance. */
+    return !do_consumer_producer_queue_full(fd_read_producer,
+                                            GINT_TO_POINTER(0),
+                                            fd_write_consumer,
+                                            GINT_TO_POINTER(1),
+                                            1,  /* Block size */
+                                            10, /* Buffer size. */
+                                            STREAMING_REQUIREMENT_DESIRED);
+}
diff --git a/device-src/tests/semaphore-test.c b/device-src/tests/semaphore-test.c
new file mode 100644 (file)
index 0000000..cdfac17
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "semaphore.h"
+#include "amanda.h"
+
+/*
+ * test that decrement waits properly
+ */
+
+struct test_decr_wait_data {
+    semaphore_t *sem;
+    gboolean increment_called;
+};
+
+static gpointer
+test_decr_wait_thread(gpointer datap)
+{
+    struct test_decr_wait_data *data = datap;
+
+    /* should block */
+    semaphore_decrement(data->sem, 20);
+
+    /* if increment hasn't been called yet, that's an error. */
+    if (!data->increment_called)
+       return GINT_TO_POINTER(0);
+
+    return GINT_TO_POINTER(1);
+}
+
+static gboolean
+test_decr_wait(void)
+{
+    GThread *th;
+    struct test_decr_wait_data data = {
+       semaphore_new_with_value(10),
+       FALSE
+    };
+    int rv;
+
+    /* die after 10 seconds (default signal disposition is to fail) */
+    alarm(10);
+
+    th = g_thread_create(test_decr_wait_thread, (gpointer)&data, TRUE, NULL);
+
+    /* sleep to give semaphore_decrement() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* and then increment the semaphore enough that the decrement can succeed */
+    data.increment_called = TRUE;
+    semaphore_increment(data.sem, 10);
+
+    /* join the thread and see how it fared. */
+    rv = GPOINTER_TO_INT(g_thread_join(th));
+
+    semaphore_free(data.sem);
+
+    if (rv == 1) {
+       printf(" PASS: semaphore-test.test_decr_wait\n");
+       return TRUE;
+    } else {
+       printf(" FAIL: semaphore-test.test_decr_wait\n");
+       return FALSE;
+    }
+}
+
+
+/*
+ * test that semaphore_wait_empty waits properly
+ */
+
+static gpointer
+test_wait_empty_thread(gpointer datap)
+{
+    semaphore_t *sem = datap;
+
+    /* should block */
+    semaphore_decrement(sem, 20);
+
+    /* value should be 10 now (decremented from 30) */
+    if (sem->value != 10)
+       return GINT_TO_POINTER(1);
+
+    /* sleep for a bit */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* decrement those last 10, which should trigger the zero */
+    semaphore_decrement(sem, 10);
+
+    return GINT_TO_POINTER(0);
+}
+
+static gboolean
+test_wait_empty(void)
+{
+    GThread *th;
+    semaphore_t *sem = semaphore_new_with_value(10);
+    int rv;
+
+    /* die after 10 seconds (default signal disposition is to fail) */
+    alarm(10);
+
+    th = g_thread_create(test_wait_empty_thread, (gpointer)sem, TRUE, NULL);
+
+    /* sleep to give semaphore_decrement() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* add another 10, so decrement can hit zero next time it's called */
+    semaphore_increment(sem, 10);
+
+    /* and wait on the semaphore emptying */
+    semaphore_wait_empty(sem);
+
+    /* join the thread and see how it fared. */
+    rv = GPOINTER_TO_INT(g_thread_join(th));
+
+    semaphore_free(sem);
+
+    if (rv == 1) {
+       printf(" PASS: semaphore-test.test_wait_empty\n");
+       return TRUE;
+    } else {
+       printf(" FAIL: semaphore-test.test_wait_empty\n");
+       return FALSE;
+    }
+}
+
+/*
+ * test that semaphore_force_adjust correctly wakes both
+ * semaphore_decrement and semaphore_wait_empty.
+ */
+
+static gpointer
+test_force_adjust_thread(gpointer datap)
+{
+    semaphore_t *sem = datap;
+
+    /* this should block */
+    semaphore_decrement(sem, 20);
+
+    /* and this should block, too - it's fun */
+    semaphore_wait_empty(sem);
+
+    return NULL;
+}
+
+static gboolean
+test_force_adjust(void)
+{
+    GThread *th;
+    semaphore_t *sem = semaphore_new_with_value(10);
+
+    /* die after 10 seconds (default signal disposition is to fail) */
+    alarm(10);
+
+    th = g_thread_create(test_force_adjust_thread, (gpointer)sem, TRUE, NULL);
+
+    /* sleep to give semaphore_decrement() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* add another 20, so decrement can proceed, but leave the value at 10 */
+    semaphore_force_adjust(sem, 20);
+
+    /* sleep to give semaphore_wait_empty() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* and empty out the semaphore */
+    semaphore_force_adjust(sem, -10);
+
+    g_thread_join(th);
+
+    semaphore_free(sem);
+
+    /* it we didn't hang yet, it's all good */
+    printf(" PASS: semaphore-test.test_force_adjust\n");
+    return TRUE;
+}
+
+/*
+ * test that semaphore_force_set correctly wakes both
+ * semaphore_decrement and semaphore_wait_empty.
+ */
+
+static gpointer
+test_force_set_thread(gpointer datap)
+{
+    semaphore_t *sem = datap;
+
+    /* this should block */
+    semaphore_decrement(sem, 20);
+
+    /* and this should block, too - it's fun */
+    semaphore_wait_empty(sem);
+
+    return NULL;
+}
+
+static gboolean
+test_force_set(void)
+{
+    GThread *th;
+    semaphore_t *sem = semaphore_new_with_value(10);
+
+    /* die after 10 seconds (default signal disposition is to fail) */
+    alarm(10);
+
+    th = g_thread_create(test_force_set_thread, (gpointer)sem, TRUE, NULL);
+
+    /* sleep to give semaphore_decrement() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* set it to 30, so decrement can proceed, but leave the value at 10 */
+    semaphore_force_set(sem, 30);
+
+    /* sleep to give semaphore_wait_empty() a chance to block (or not). */
+    g_usleep(G_USEC_PER_SEC / 4);
+
+    /* and empty out the semaphore */
+    semaphore_force_set(sem, 0);
+
+    g_thread_join(th);
+
+    semaphore_free(sem);
+
+    /* it we didn't hang yet, it's all good */
+    printf(" PASS: semaphore-test.test_force_set\n");
+    return TRUE;
+}
+
+/*
+ * Main loop
+ */
+
+int
+main(void)
+{
+    gboolean pass = TRUE;
+
+#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
+    amanda_thread_init(NULL);
+
+    pass = test_decr_wait() && pass;
+    pass = test_wait_empty() && pass;
+    pass = test_force_adjust() && pass;
+    pass = test_force_set() && pass;
+
+    return pass?0:1;
+#else
+    printf("No thread support on this platform -- nothing to test\n");
+    return 0;
+#endif
+}
diff --git a/device-src/tests/vfs_test.c b/device-src/tests/vfs_test.c
new file mode 100644 (file)
index 0000000..5b63f2b
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include <device.h>
+#include <amanda.h>
+
+/* global so the 'atexit' handler can access it */
+
+static void
+cleanup_vtape_dir(char *device_path)
+{
+    char *quoted = g_shell_quote(device_path);
+    char *cmd = vstralloc("rm -rf ", quoted, NULL);
+
+    /* would you rather write 'rm -rf' here? */
+    if (system(cmd) == -1) {
+       exit(1);
+    }
+
+    amfree(cmd);
+    amfree(quoted);
+}
+
+static char *
+setup_vtape_dir(void)
+{
+    char *cwd = g_get_current_dir();
+    char *device_path = NULL;
+    char *data_dir = NULL;
+
+    device_path = vstralloc(cwd, "/vfs-test-XXXXXX", NULL);
+    amfree(cwd);
+
+    if (mkdtemp(device_path) == NULL) {
+       fprintf(stderr, "Could not create temporary directory in %s\n", cwd);
+       return NULL;
+    }
+
+    /* append "/data/" to that for the VFS device*/
+    data_dir = vstralloc(device_path, "/data/", NULL);
+    if (mkdir(data_dir, 0777) == -1) {
+       fprintf(stderr, "Could not create %s: %s\n", cwd, strerror(errno));
+       amfree(data_dir);
+       return NULL;
+    }
+
+    amfree(data_dir);
+    return device_path;
+}
+
+static Device *
+setup_device(char *device_path)
+{
+    Device *device;
+    char *device_name = NULL;
+
+    device_name = vstralloc("file:", device_path, NULL);
+    device = device_open(device_name);
+    if (!device) {
+       fprintf(stderr, "Could not open device %s\n", device_name);
+    }
+
+    amfree(device_name);
+    return device;
+}
+
+static gboolean
+check_free_space(Device *device)
+{
+    GValue value;
+    QualifiedSize qsize;
+
+    bzero(&value, sizeof(value));
+    if (!device_property_get(device, PROPERTY_FREE_SPACE, &value)) {
+       fprintf(stderr, "Could not get property_free_space\n");
+       return FALSE;
+    }
+
+    qsize = *(QualifiedSize*)g_value_get_boxed(&value);
+    g_value_unset(&value);
+
+    if (qsize.accuracy != SIZE_ACCURACY_REAL) {
+       fprintf(stderr, "property_free_space accuracy is not SIZE_ACCURACY_REAL\n");
+       return FALSE;
+    }
+
+    if (qsize.bytes == 0) {
+       fprintf(stderr, "property_free_space returned bytes=0\n");
+       return FALSE;
+    }
+
+    return TRUE;
+}
+
+int
+main(int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED)
+{
+    Device *device = NULL;
+    gboolean ok = TRUE;
+    char *device_path = NULL;
+    pid_t pid;
+    amwait_t status;
+
+    amanda_thread_init(NULL);
+
+    device_path = setup_vtape_dir();
+
+    /* run the tests in a subprocess so we can clean up even if they fail */
+    switch (pid = fork()) {
+       case -1: /* error */
+           perror("fork");
+           g_assert_not_reached();
+
+       case 0: /* child */
+           device_api_init();
+
+           device = setup_device(device_path);
+           if (!device)
+               return 1;
+
+           ok = ok && check_free_space(device);
+
+           g_object_unref(device);
+
+           if (!ok) exit(1);
+           exit(0);
+           g_assert_not_reached();
+
+       default: /* parent */
+           if (waitpid(pid, &status, 0) == -1)
+               perror("waitpid");
+
+           /* cleanup */
+           cleanup_vtape_dir(device_path);
+           amfree(device_path);
+
+           /* figure our own return status */
+           if (WIFEXITED(status))
+               return WEXITSTATUS(status);
+           else if (WIFSIGNALED(status)) {
+               fprintf(stderr, "Test failed with signal %d\n", (int)WTERMSIG(status));
+               return 1;
+           } else {
+               /* weird.. */
+               return 1;
+           }
+           g_assert_not_reached();
+    }
+}
diff --git a/device-src/vfs-device.c b/device-src/vfs-device.c
new file mode 100644 (file)
index 0000000..b197dcc
--- /dev/null
@@ -0,0 +1,1263 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include <string.h> /* memset() */
+
+#include "vfs-device.h"
+#include "fsusage.h"
+#include "amanda.h"
+#include "util.h"
+#include <regex.h>
+
+/* This regex will match all VfsDevice files in a directory. We use it
+   for cleanup and verification. Note that this regex does NOT match
+   the volume label. */
+#define VFS_DEVICE_FILE_REGEX "^[0-9]+[\\.-]"
+
+/* The name of the volume lockfile. Should be the same as that
+   generated by lockfile_name(0). */
+#define VOLUME_LOCKFILE_NAME "00000-lock"
+
+/* Possible (abstracted) results from a system I/O operation. */
+typedef enum {
+    RESULT_SUCCESS,
+    RESULT_ERROR,        /* Undefined error. */
+    RESULT_NO_DATA,      /* End of File, while reading */
+    RESULT_NO_SPACE,     /* Out of space. Sometimes we don't know if
+                            it was this or I/O error, but this is the
+                            preferred explanation. */
+    RESULT_MAX
+} IoResult;
+
+/* here are local prototypes */
+static void vfs_device_init (VfsDevice * o);
+static void vfs_device_class_init (VfsDeviceClass * c);
+static void vfs_device_finalize (GObject * o);
+
+static gboolean vfs_device_start(Device * pself, DeviceAccessMode mode,
+                                 char * label, char * timestamp);
+static gboolean vfs_device_open_device (Device * pself,
+                                        char * device_name);
+static gboolean vfs_device_start_file (Device * pself, const dumpfile_t * ji);
+static gboolean vfs_device_finish_file (Device * pself);
+static dumpfile_t * vfs_device_seek_file (Device * self, guint file);
+static gboolean vfs_device_seek_block (Device * self, guint64 block);
+static gboolean vfs_device_property_get (Device * pself, DevicePropertyId ID,
+                                         GValue * val);
+static gboolean vfs_device_property_set (Device * pself, DevicePropertyId ID,
+                                         GValue * val);
+static gboolean vfs_device_recycle_file (Device * pself, guint filenum);
+static Device * vfs_device_factory(char * device_type,
+                                   char * device_name);
+static ReadLabelStatusFlags vfs_device_read_label(Device * dself);
+static gboolean vfs_device_write_block(Device * self, guint size,
+                                       gpointer data, gboolean last_block);
+static int vfs_device_read_block(Device * self, gpointer data, int * size_req);
+static IoResult vfs_device_robust_write(VfsDevice * self,  char *buf,
+                                              int count);
+static IoResult vfs_device_robust_read(VfsDevice * self, char *buf,
+                                             int *count);
+
+/* Various helper functions. */
+static void release_file(VfsDevice * self);
+static gboolean check_is_dir(const char * name, gboolean printmsg);
+static char* file_number_to_file_name(VfsDevice * self, guint file);
+static gboolean file_number_to_file_name_functor(const char * filename,
+                                                 gpointer datap);
+//static char* lockfile_name(VfsDevice * self, guint file);
+static gboolean open_lock(VfsDevice * self, int file, gboolean exclusive);
+static void promote_volume_lock(VfsDevice * self);
+static void demote_volume_lock(VfsDevice * self);
+static gboolean delete_vfs_files(VfsDevice * self);
+static gboolean delete_vfs_files_functor(const char * filename,
+                                         gpointer self);
+static gboolean check_dir_empty_functor(const char * filename,
+                                        gpointer self);
+static gboolean clear_and_prepare_label(VfsDevice * self, char * label,
+                                        char * timestamp);
+static gint get_last_file_number(VfsDevice * self);
+static gboolean get_last_file_number_functor(const char * filename,
+                                             gpointer datap);
+static char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji);
+static gboolean try_unlink(const char * file);
+
+/* pointer to the classes of our parents */
+static DeviceClass *parent_class = NULL;
+
+void vfs_device_register(void) {
+    static const char * device_prefix_list[] = { "file", NULL };
+    register_device(vfs_device_factory, device_prefix_list);
+}
+
+GType
+vfs_device_get_type (void)
+{
+    static GType type = 0;
+
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (VfsDeviceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) vfs_device_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (VfsDevice),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) vfs_device_init,
+            NULL
+        };
+
+        type = g_type_register_static (TYPE_DEVICE, "VfsDevice",
+                                       &info, (GTypeFlags)0);
+    }
+    
+    return type;
+}
+
+static void 
+vfs_device_init (VfsDevice * self) {
+    Device * o;
+    DeviceProperty prop;
+    GValue response;
+
+    self->dir_handle = NULL;
+    self->dir_name = self->file_name = NULL;
+    self->file_lock_name = self->volume_lock_name = NULL;
+    self->file_lock_fd = self->volume_lock_fd = self->open_file_fd = -1;
+    self->block_size = VFS_DEVICE_DEFAULT_BLOCK_SIZE;
+    self->volume_bytes = 0; 
+    self->volume_limit = 0;
+
+    /* Register Properties */
+    o = DEVICE(self);
+    bzero(&response, sizeof(response));
+    prop.base = &device_property_concurrency;
+    prop.access = PROPERTY_ACCESS_GET_MASK;
+    g_value_init(&response, CONCURRENCY_PARADIGM_TYPE);
+    g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_streaming;
+    g_value_init(&response, STREAMING_REQUIREMENT_TYPE);
+    g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_min_block_size;
+    g_value_init(&response, G_TYPE_UINT);
+    g_value_set_uint(&response, VFS_DEVICE_MIN_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_max_block_size;
+    g_value_set_uint(&response, VFS_DEVICE_MAX_BLOCK_SIZE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    prop.base = &device_property_appendable;
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE);
+    device_add_property(o, &prop, &response);
+
+    prop.base = &device_property_partial_deletion;
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    /* This one is handled by Device's get_property handler. */
+    prop.base = &device_property_canonical_name;
+    device_add_property(o, &prop, NULL);
+
+    prop.base = &device_property_medium_access_type;
+    g_value_init(&response, MEDIA_ACCESS_MODE_TYPE);
+    g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE);
+    device_add_property(o, &prop, &response);
+    g_value_unset(&response);
+
+    /* These are dynamic, handled in vfs_device_property_xxx */
+    prop.base = &device_property_block_size;
+    prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START;
+    device_add_property(o, &prop, NULL);
+
+    prop.base = &device_property_max_volume_usage;
+    prop.access =
+        (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
+        (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE);
+    device_add_property(o, &prop, NULL);
+}
+
+static void 
+vfs_device_class_init (VfsDeviceClass * c G_GNUC_UNUSED)
+{
+    GObjectClass *g_object_class = (GObjectClass*) c;
+    DeviceClass *device_class = (DeviceClass *)c;
+
+    parent_class = g_type_class_ref(TYPE_DEVICE);
+
+    device_class->open_device = vfs_device_open_device;
+    device_class->start = vfs_device_start;
+    device_class->start_file = vfs_device_start_file;
+    device_class->read_label = vfs_device_read_label;
+    device_class->write_block = vfs_device_write_block;
+    device_class->read_block = vfs_device_read_block;
+    device_class->finish_file = vfs_device_finish_file;
+    device_class->seek_file = vfs_device_seek_file;
+    device_class->seek_block = vfs_device_seek_block;
+    device_class->property_get = vfs_device_property_get;
+    device_class->property_set = vfs_device_property_set;
+    device_class->recycle_file = vfs_device_recycle_file;
+    g_object_class->finalize = vfs_device_finalize;
+}
+
+/* Drops everything associated with the volume file: Its name and fd,
+   its lock, and its lock's name and fd. */
+static void release_file(VfsDevice * self) {
+    /* Doesn't hurt. */
+    robust_close(self->open_file_fd);
+    amfree(self->file_name);
+
+    if (self->file_lock_fd > 0) {
+        amfunlock(self->file_lock_fd, self->file_lock_name);
+        close(self->file_lock_fd);
+        amfree(self->file_lock_name);
+    }
+    self->file_lock_fd = self->open_file_fd = -1;
+}
+
+static void vfs_device_finalize(GObject * obj_self) {
+    VfsDevice *self = VFS_DEVICE (obj_self);
+    Device * d_self = (Device*)self;
+
+    if (d_self->access_mode != ACCESS_NULL) {
+        device_finish(d_self);
+    }
+
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+
+    amfree(self->dir_name);
+
+    if(self->dir_handle) {
+        closedir (self->dir_handle);
+        self->dir_handle = NULL;
+    }
+
+    release_file(self);
+
+    if (self->volume_lock_fd >= 0) {
+        amfunlock(self->volume_lock_fd, self->volume_lock_name);
+        close(self->volume_lock_fd);
+    }
+
+    amfree(self->volume_lock_name);
+}
+
+static Device * vfs_device_factory(char * device_type,
+                                   char * device_name) {
+    Device * rval;
+    g_assert(0 == strcmp(device_type, "file"));
+    rval = DEVICE(g_object_new(TYPE_VFS_DEVICE, NULL));
+    if (!device_open_device(rval, device_name)) {
+        g_object_unref(rval);
+        return NULL;
+    } else {
+        return rval;
+    }
+}
+
+static gboolean check_is_dir(const char * name, gboolean printmsg) {
+    struct stat dir_status;
+    
+    if (stat(name, &dir_status) < 0) {
+#ifdef EINTR
+        if (errno == EINTR) {
+            return check_is_dir(name, printmsg);
+        }
+#endif /* EINTR */
+        if (printmsg) {
+            g_fprintf(stderr, "Error checking directory %s: %s\n",
+                    name, strerror(errno));
+        }
+        return FALSE;
+    } else if (!S_ISDIR(dir_status.st_mode)) {
+        if (printmsg) {
+            g_fprintf(stderr, "VFS Device path %s is not a directory.\n",
+                    name);
+        }
+        return FALSE;
+    } else {
+        return TRUE;
+    }
+}
+
+typedef struct {
+    VfsDevice * self;
+    int count;
+    char * result;
+} fnfn_data;
+
+/* A SearchDirectoryFunctor. */
+static gboolean file_number_to_file_name_functor(const char * filename,
+                                                 gpointer datap) {
+    char * result_tmp;
+    struct stat file_status;
+    fnfn_data *data = (fnfn_data*)datap;
+    
+    result_tmp = vstralloc(data->self->dir_name, "/", filename, NULL);    
+    
+    /* Just to be thorough, let's check that it's a real
+       file. */
+    if (0 != stat(result_tmp, &file_status)) {
+        g_fprintf(stderr, "Cannot stat file %s (%s), ignoring it.\n", 
+                result_tmp, strerror(errno));
+    } else if (!S_ISREG(file_status.st_mode)) {
+        g_fprintf(stderr, "%s is not a regular file, ignoring it.\n",
+                result_tmp);
+    } else {
+        data->count ++;
+        if (data->result == NULL) {
+            data->result = result_tmp;
+            result_tmp = NULL;
+        }
+    }
+    amfree(result_tmp);
+    return TRUE;
+}
+
+/* This function finds the filename for a given file number. We search
+ * for a filesystem file matching the regex /^0*$device_file\./; if
+ * there is more than one such file we make a warning and take an
+ * arbitrary one. */
+static char * file_number_to_file_name(VfsDevice * self, guint device_file) {
+    char * regex;
+    fnfn_data data;
+
+    g_return_val_if_fail(self != NULL, NULL);
+    data.self = self;
+    data.count = 0;
+    data.result = NULL;
+
+    regex = g_strdup_printf("^0*%u\\.", device_file);
+
+    search_directory(self->dir_handle, regex,
+                     file_number_to_file_name_functor, &data);
+
+    amfree(regex);
+
+    if (data.count == 0) {
+        g_assert(data.result == NULL);
+        return NULL;
+    } else if (data.count > 1) {
+        g_fprintf(stderr,
+                "Found multiple names for file number %d, choosing file %s.\n",
+                device_file, data.result);
+        return data.result;
+    } else {
+        g_assert(data.result != NULL);
+        return data.result;
+    }
+    g_assert_not_reached();
+}
+
+/* This function returns the dynamically-allocated lockfile name for a
+   given file number. */
+/*
+static char * lockfile_name(VfsDevice * self, guint number) {
+    return g_strdup_printf("%s/%05d-lock", self->dir_name, number);
+}
+*/
+
+/* Does what you expect. If the lock already exists, it is released
+ * and regained, in case the mode is changing.
+ * The file field has several options:
+ * - file > 0: Open a lock on a real volume file.
+ * - file = 0: Open the volume lock as a volume file (for setup).
+ * - file < 0: Open the volume lock as a volume lock (persistantly).
+ */
+static gboolean open_lock(G_GNUC_UNUSED VfsDevice * self,
+                         G_GNUC_UNUSED int file,
+                         G_GNUC_UNUSED gboolean exclusive) {
+
+    /* At the moment, file locking is horribly broken. */
+    return TRUE;
+
+/*
+    int fd;
+    char * name;
+    if (file < 0) {
+        if (self->volume_lock_name == NULL) {
+            self->volume_lock_name = lockfile_name(self, 0);
+        } else if (self->volume_lock_fd >= 0) {
+            amfunlock(self->volume_lock_fd, self->volume_lock_name);
+            close(self->volume_lock_fd);
+        }
+        name = self->volume_lock_name;
+    } else {
+        if (self->file_lock_fd >= 0 && self->file_lock_name != NULL) {
+            amfunlock(self->file_lock_fd, self->file_lock_name);
+        }
+        amfree(self->file_lock_name);
+        close(self->file_lock_fd);
+        name = self->file_lock_name = lockfile_name(self, file);
+    }
+        
+
+    fd = robust_open(name, O_CREAT | O_WRONLY, VFS_DEVICE_CREAT_MODE);
+
+    if (fd < 0) {
+        g_fprintf(stderr, "Can't open lock file %s: %s\n",
+                name, strerror(errno));
+        return FALSE;
+    }
+
+    if (exclusive) {
+        amflock(fd, name);
+    } else {
+        amroflock(fd, name);
+    }
+
+    if (file < 0) {
+        self->volume_lock_fd = fd;
+    } else {
+        self->file_lock_fd = fd;
+    }
+    return TRUE;
+*/
+}
+
+/* For now, does it the bad way. */
+static void promote_volume_lock(VfsDevice * self) {
+    amfunlock(self->volume_lock_fd, self->volume_lock_name);
+    amflock(self->volume_lock_fd, self->volume_lock_name);
+}
+
+static void demote_volume_lock(VfsDevice * self) {
+    amfunlock(self->volume_lock_fd, self->volume_lock_name);
+    amroflock(self->volume_lock_fd, self->volume_lock_name);
+}
+
+/* A SearchDirectoryFunctor */
+static gboolean update_volume_size_functor(const char * filename,
+                                           gpointer user_data) {
+    char * full_filename;
+    struct stat stat_buf;
+    VfsDevice * self = user_data;
+    g_return_val_if_fail(IS_VFS_DEVICE(self), FALSE);
+    
+    full_filename = vstralloc(self->dir_name, "/", filename, NULL);
+
+    if (stat(full_filename, &stat_buf) < 0) {
+        /* Log it and keep going. */
+        g_fprintf(stderr, "Couldn't stat file %s: %s\n",
+                full_filename, strerror(errno));
+        amfree(full_filename);
+        return TRUE;
+    }
+
+    amfree(full_filename);
+    self->volume_bytes += stat_buf.st_size;
+
+    return TRUE;
+}
+
+static void update_volume_size(VfsDevice * self) {
+    self->volume_bytes = 0;
+    search_directory(self->dir_handle, "^[0-9]+\\.",
+                     update_volume_size_functor, self);
+
+}
+
+static gboolean 
+vfs_device_open_device (Device * pself, char * device_name) {
+    VfsDevice * self;
+    dumpfile_t * rval;
+    
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (device_name != NULL, FALSE);
+
+    /* We don't have to free this ourselves; it will be freed by
+     * vfs_device_finalize whether we succeed here or not. */
+    self->dir_name = g_strconcat(device_name, "/data/", NULL);
+    if (!check_is_dir(self->dir_name, TRUE)) {
+        return FALSE;
+    }
+
+    /* Next open the directory itself. */
+    self->dir_handle = opendir(self->dir_name);
+    if (self->dir_handle == NULL) {
+        g_fprintf(stderr, "Couldn't open directory %s for reading: %s\n",
+                device_name, strerror(errno));
+        return FALSE;
+    }
+
+    if (!open_lock(self, -1, FALSE))
+        return FALSE;
+
+    /* Not an error if this fails. Note that we ignore the class hierarchy.
+     */
+    rval = vfs_device_seek_file(pself, 0);
+    amfree(rval);
+
+    if (parent_class->open_device) {
+        /* Will call vfs_device_read_label. */
+        return (parent_class->open_device)(pself, device_name);
+    } else {
+        return TRUE;
+    }
+}
+
+/* A SearchDirectoryFunctor */
+static gboolean delete_vfs_files_functor(const char * filename,
+                                         gpointer user_data) {
+    VfsDevice * self;
+    char * path_name;
+
+    self = VFS_DEVICE(user_data);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    /* Skip the volume lock. */
+    if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0)
+        return TRUE;
+
+    path_name = vstralloc(self->dir_name, "/", filename, NULL);
+    if (unlink(path_name) != 0) {
+        g_fprintf(stderr, "Error unlinking %s: %s\n", path_name,
+                strerror(errno));
+    }
+    amfree(path_name);
+    return TRUE;
+}
+
+/* delete_vfs_files deletes all VfsDevice files in the directory except the
+   volume lockfile. */
+static gboolean delete_vfs_files(VfsDevice * self) {
+    g_assert(self != NULL);
+    g_assert(self->dir_handle != NULL);
+
+    /* This function assumes that the volume is locked! */
+    search_directory(self->dir_handle, VFS_DEVICE_FILE_REGEX,
+                     delete_vfs_files_functor, self);
+    return TRUE;
+}
+
+/* This is a functor suitable for search_directory. It simply prints a
+   warning. It also dodges the volume lockfile. */
+static gboolean check_dir_empty_functor(const char * filename,
+                                        gpointer user_data) {
+    VfsDevice * self;
+    char * path_name;
+
+    self = VFS_DEVICE(user_data);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0)
+        return TRUE;
+
+    path_name = vstralloc(self->dir_name, "/", filename, NULL);
+
+    g_fprintf(stderr, "Found spurious storage file %s\n", path_name);
+
+    amfree(path_name);
+    return TRUE;
+}
+
+/* This function is used to write volume and dump headers. */
+static gboolean write_amanda_header(VfsDevice * self,
+                                    const dumpfile_t * header) {
+    char * label_buffer;
+    IoResult result;
+    
+    g_return_val_if_fail(header != NULL, FALSE);
+    g_return_val_if_fail(self != NULL, FALSE);
+    label_buffer = build_header(header, VFS_DEVICE_LABEL_SIZE);
+    if (strlen(label_buffer)+1 > VFS_DEVICE_LABEL_SIZE) {
+        amfree(label_buffer);
+        g_fprintf(stderr, "Amanda header header won't fit on VFS device!\n");
+        return FALSE;
+    }
+
+    result = vfs_device_robust_write(self, label_buffer, VFS_DEVICE_LABEL_SIZE);
+    amfree(label_buffer);
+    return (result == RESULT_SUCCESS);
+}
+
+/* clear_and_label will erase the contents of the directory, and write
+ * this label in its place. This function assumes we already have a volume
+ * label write lock in place (e.g., promote_lock() has been called.) */
+static gboolean clear_and_prepare_label(VfsDevice * self, char * label,
+                                        char * timestamp) {
+    dumpfile_t * label_header;
+
+    release_file(self);
+
+    /* Delete any extant data, except our volume lock. */
+    if (!delete_vfs_files(self)) {
+        return FALSE;
+    }
+
+    /* Print warnings about any remaining files. */
+    search_directory(self->dir_handle, VFS_DEVICE_FILE_REGEX,
+                     check_dir_empty_functor, self);
+
+    self->file_name = g_strdup_printf("%s/00000.%s", self->dir_name, label);
+
+    self->open_file_fd = robust_open(self->file_name,
+                                     O_CREAT | O_EXCL | O_WRONLY,
+                                     VFS_DEVICE_CREAT_MODE);
+    if (self->open_file_fd < 0) {
+        g_fprintf(stderr, "Can't open file %s: %s\n", self->file_name,
+                strerror(errno));
+        return FALSE;
+    }
+
+    label_header = make_tapestart_header(DEVICE(self), label, timestamp);
+    if (write_amanda_header(self, label_header)) {
+        amfree(label_header);
+        self->volume_bytes = VFS_DEVICE_LABEL_SIZE;
+        return TRUE;
+    } else {
+        amfree(label_header);
+        return FALSE;
+    }
+}
+
+static ReadLabelStatusFlags vfs_device_read_label(Device * dself) {
+    dumpfile_t * amanda_header;
+    VfsDevice * self;
+
+    self = VFS_DEVICE(dself);
+    g_return_val_if_fail(self != NULL, ~READ_LABEL_STATUS_SUCCESS);
+
+    amanda_header = vfs_device_seek_file(dself, 0);
+    if (amanda_header == NULL) {
+        /* This means an error occured getting locks or opening the header
+         * file. */
+        return (READ_LABEL_STATUS_DEVICE_ERROR |
+                READ_LABEL_STATUS_VOLUME_ERROR |
+                READ_LABEL_STATUS_VOLUME_UNLABELED);
+    }
+
+    if (amanda_header->type != F_TAPESTART) {
+        /* This is an error, and should not happen. */
+        g_fprintf(stderr, "Got a bad volume label\n");
+        amfree(amanda_header);
+        return READ_LABEL_STATUS_VOLUME_ERROR;
+    }
+
+    dself->volume_label = g_strdup(amanda_header->name);
+    dself->volume_time = g_strdup(amanda_header->datestamp);
+    amfree(amanda_header);
+
+    update_volume_size(self);
+
+    if (parent_class->read_label) {
+        return (parent_class->read_label)(dself);
+    } else {
+        return READ_LABEL_STATUS_SUCCESS;
+    }
+}
+
+static gboolean vfs_device_write_block(Device * pself, guint size,
+                                       gpointer data, gboolean last_block) {
+    VfsDevice * self = VFS_DEVICE(pself);
+    IoResult result;
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail(last_block || size >= (guint)self->block_size, FALSE);
+    g_return_val_if_fail(pself->in_file, FALSE);
+    g_assert(self->open_file_fd >= 0);
+
+    if (self->volume_limit > 0 &&
+        self->volume_bytes + size > self->volume_limit) {
+        /* Simulate EOF. */
+        pself->is_eof = TRUE;
+        return FALSE;
+    }
+
+    result = vfs_device_robust_write(self, data, size);
+    if (result == RESULT_SUCCESS) {
+        self->volume_bytes += size;
+        if (parent_class->write_block) {
+            (parent_class->write_block)(pself, size, data, last_block);
+        }
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
+static int
+vfs_device_read_block(Device * pself, gpointer data, int * size_req) {
+    VfsDevice * self;
+    int size;
+    IoResult result;
+    
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, -1);
+
+    if (data == NULL || *size_req < self->block_size) {
+        /* Just a size query. */
+        *size_req = self->block_size;
+        return 0;
+    }
+
+    size = self->block_size;
+    result = vfs_device_robust_read(self, data, &size);
+    switch (result) {
+    case RESULT_SUCCESS:
+        *size_req = size;
+        return size;
+    case RESULT_NO_DATA:
+        pself->is_eof = TRUE;
+        /* FALLTHROUGH */
+    default:
+        return -1;
+    }
+
+    g_assert_not_reached();
+}
+
+static gboolean        vfs_device_start(Device * pself,
+                                 DeviceAccessMode mode, char * label,
+                                 char * timestamp) {
+    VfsDevice * self;
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail(parent_class->start != NULL, FALSE);
+    
+    if (mode == ACCESS_WRITE) {
+        promote_volume_lock(self);
+        if (!clear_and_prepare_label(self, label, timestamp)) {
+            demote_volume_lock(self);
+            return FALSE;
+        }
+        demote_volume_lock(self);
+    }
+
+    release_file(self);
+    if (parent_class->start) {
+        return parent_class->start(pself, mode, label, timestamp);
+    } else {
+        return TRUE;
+    }
+}
+
+typedef struct {
+    VfsDevice * self;
+    int rval;
+} glfn_data;
+
+/* A SearchDirectoryFunctor. */
+static gboolean get_last_file_number_functor(const char * filename,
+                                             gpointer datap) {
+    guint64 file;
+    glfn_data * data = (glfn_data*)datap;
+    g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE);
+    file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */
+    if (file > G_MAXINT) {
+        g_fprintf(stderr, "Super-large device file %s found, ignoring.\n",
+               filename);
+        return TRUE;
+    }
+    /* This condition is needlessly complex due to sign issues. */
+    if (data->rval < 0 || ((guint)data->rval) < file) {
+        data->rval = file;
+    }
+    return TRUE;
+}
+
+static gint get_last_file_number(VfsDevice * self) {
+    glfn_data data;
+    int count;
+    data.self = self;
+    data.rval = -1;
+    
+    count = search_directory(self->dir_handle, "^[0-9]+\\.",
+                             get_last_file_number_functor, &data);
+
+    if (count <= 0) {
+        /* Somebody deleted something important while we weren't looking. */
+        g_fprintf(stderr, "Error identifying VFS device contents!\n");
+        return -1;
+    } else {
+        g_assert(data.rval >= 0);
+    }
+    
+    return data.rval;
+}
+
+typedef struct {
+    VfsDevice * self;
+    guint request;
+    int best_found;
+} gnfn_data;
+
+/* A SearchDirectoryFunctor. */
+static gboolean get_next_file_number_functor(const char * filename,
+                                             gpointer datap) {
+    guint file;
+    gnfn_data * data = (gnfn_data*)datap;
+    g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE);
+    file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */
+    if (file > G_MAXINT) {
+        g_fprintf(stderr, "Super-large device file %s found, ignoring.\n",
+               filename);
+        return TRUE;
+    }
+    /* This condition is needlessly complex due to sign issues. */
+    if (file >= data->request &&
+        (data->best_found < 0 || file < (guint)data->best_found)) {
+        data->best_found = file;
+    }
+    return TRUE;
+}
+
+/* Returns the file number equal to or greater than the given requested
+ * file number. */
+static gint get_next_file_number(VfsDevice * self, guint request) {
+    gnfn_data data;
+    int count;
+    data.self = self;
+    data.request = request;
+    data.best_found = -1;
+    
+    count = search_directory(self->dir_handle, "^[0-9]+\\.",
+                             get_next_file_number_functor, &data);
+
+    if (count <= 0) {
+        /* Somebody deleted something important while we weren't looking. */
+        g_fprintf(stderr, "Error identifying VFS device contents!\n");
+        return -1;
+    }
+    
+    /* Could be -1. */
+    return data.best_found;
+}
+
+/* Finds the file number, acquires a lock, and returns the new file name. */
+static
+char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji) {
+    char * rval;
+    char *base, *sanitary_base;
+    int fileno;
+
+    for (;;) {
+        fileno = 1 + get_last_file_number(self);
+        if (fileno <= 0)
+            return NULL;
+    
+        if (open_lock(self, fileno, TRUE)) {
+            break;
+        } else {
+            continue;
+        }
+    }
+
+    base = g_strdup_printf("%05d.%s.%s.%d", fileno, ji->name, ji->disk,
+                           ji->dumplevel);
+    sanitary_base = sanitise_filename(base);
+    amfree(base);
+    rval = g_strdup_printf("%s/%s", self->dir_name, sanitary_base);
+    amfree(sanitary_base);
+    return rval;
+}
+
+static gboolean 
+vfs_device_start_file (Device * pself, const dumpfile_t * ji) {
+    VfsDevice * self;
+
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (ji != NULL, FALSE);
+
+    if (self->volume_limit > 0 &&
+        self->volume_bytes + VFS_DEVICE_LABEL_SIZE > self->volume_limit) {
+        /* No more room. */
+        return FALSE;
+    }
+
+    /* The basic idea here is thus:
+       1) Try to get a lock on the next filenumber.
+       2) If that fails, update our idea of "next filenumber" and try again.
+       3) Then open the file itself.
+       4) Write the label.
+       5) Chain up. */
+
+    self->file_name = make_new_file_name(self, ji);
+    if (self->file_name == NULL)
+        return FALSE;
+
+    self->open_file_fd = robust_open(self->file_name,
+                                     O_CREAT | O_EXCL | O_RDWR,
+                                     VFS_DEVICE_CREAT_MODE);
+    if (self->open_file_fd < 0) {
+        g_fprintf(stderr, "Can't create file %s: %s\n", self->file_name,
+                strerror(errno));
+        release_file(self);
+        return FALSE;
+    }
+
+    
+    if (!write_amanda_header(self, ji)) {
+        release_file(self);
+        return FALSE;
+    }
+
+    self->volume_bytes += VFS_DEVICE_LABEL_SIZE;
+
+    if (parent_class->start_file) {
+        parent_class->start_file(pself, ji);
+    }
+    return TRUE;
+}
+
+static gboolean 
+vfs_device_finish_file (Device * pself) {
+    VfsDevice * self;
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail(self != NULL, FALSE);
+
+    release_file(self);
+    
+    if (parent_class->finish_file) {
+        return parent_class->finish_file(pself);
+    } else {
+        return TRUE;
+    }
+    g_assert_not_reached();
+}
+
+/* This function is used for two purposes, rather than one. In
+ * addition to its documented behavior, we also use it to open the
+ * volume label for reading at startup. In that second case, we avoid
+ * FdDevice-related side effects. */
+static dumpfile_t * 
+vfs_device_seek_file (Device * pself, guint requested_file) {
+    VfsDevice * self;
+    int file;
+    dumpfile_t * rval;
+    char header_buffer[VFS_DEVICE_LABEL_SIZE];
+    int header_buffer_size = sizeof(header_buffer);
+    IoResult result;
+
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, NULL);
+
+    pself->in_file = FALSE;
+    
+    release_file(self);
+
+    if (requested_file > 0) {
+        file = get_next_file_number(self, requested_file);
+    } else {
+        file = requested_file;
+    }
+
+    if (file < 0) {
+        /* Did they request one past the end? */
+        char * tmp_file_name;
+        tmp_file_name = file_number_to_file_name(self, requested_file - 1);
+        if (tmp_file_name != NULL) {
+            free(tmp_file_name);
+            return make_tapeend_header();
+        } else {
+            return NULL;
+        }
+    }
+
+    if (!open_lock(self, file, FALSE)) {
+        return NULL;
+    }
+
+    self->file_name = file_number_to_file_name(self, file);
+    if (self->file_name == NULL) {
+        release_file(self);
+        return NULL;
+    }
+
+    self->open_file_fd = robust_open(self->file_name, O_RDONLY, 0);
+    if (self->open_file_fd <= 0) {
+        g_fprintf(stderr, "Couldn't open file %s: %s\n", self->file_name,
+                strerror(errno));
+        amfree(self->file_name);
+        release_file(self);
+        return NULL;
+    }
+
+    result = vfs_device_robust_read(self, header_buffer,
+                                    &header_buffer_size);
+    if (result != RESULT_SUCCESS) {
+        g_fprintf(stderr, "Problem reading Amanda header.\n");
+        release_file(self);
+        return NULL;
+    }
+
+    rval = malloc(sizeof(*rval));
+    parse_file_header(header_buffer, rval, header_buffer_size);
+    if (file > 0) {
+        switch (rval->type) {
+        case F_DUMPFILE:
+        case F_CONT_DUMPFILE:
+        case F_SPLIT_DUMPFILE:
+            /* Chain up. */
+            if (parent_class->seek_file) {
+                parent_class->seek_file(pself, file);
+            }
+            return rval;
+        default:
+            amfree(rval);
+            release_file(self);
+            return NULL;
+        }
+    } else if (file == 0) {
+        return rval;
+    } else {
+        amfree(rval);
+        return NULL;
+    }
+}
+
+static gboolean 
+vfs_device_seek_block (Device * pself, guint64 block) {
+    VfsDevice * self;
+    off_t result;
+
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (self->open_file_fd >= 0, FALSE);
+    g_assert(sizeof(off_t) >= sizeof(guint64));
+
+    /* Pretty simple. We figure out the blocksize and use that. */
+    result = lseek(self->open_file_fd,
+                   (block) * self->block_size + VFS_DEVICE_LABEL_SIZE,
+                   SEEK_SET);
+    return (result != (off_t)(-1));
+}
+
+static gboolean
+vfs_device_property_get (Device * pself, DevicePropertyId ID, GValue * val) {
+    VfsDevice * self;
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail(self != NULL, FALSE);
+    if (ID == PROPERTY_BLOCK_SIZE) {
+        g_value_unset_init(val, G_TYPE_INT);
+        g_value_set_int(val, self->block_size);
+        return TRUE;
+    } else if (ID == PROPERTY_MAX_VOLUME_USAGE) {
+        g_value_unset_init(val, G_TYPE_UINT64);
+        g_value_set_uint64(val, self->volume_limit);
+        return TRUE;
+    } else if (ID == PROPERTY_FREE_SPACE) {
+       QualifiedSize qsize;
+       struct fs_usage fsusage;
+       guint64 bytes_avail;
+
+       if (get_fs_usage(self->dir_name, NULL, &fsusage) == 0) {
+           if (fsusage.fsu_bavail_top_bit_set)
+               bytes_avail = 0;
+           else
+               bytes_avail = fsusage.fsu_bavail * fsusage.fsu_blocksize;
+           if (self->volume_limit && (guint64)self->volume_limit < bytes_avail / 1024)
+               bytes_avail = (guint64)self->volume_limit * 1024;
+
+           qsize.accuracy = SIZE_ACCURACY_REAL;
+           qsize.bytes = bytes_avail;
+       } else {
+           g_warning(_("get_fs_usage('%s') failed: %s"), self->dir_name, strerror(errno));
+           qsize.accuracy = SIZE_ACCURACY_UNKNOWN;
+           qsize.bytes = 0;
+       }
+       g_value_unset_init(val, QUALIFIED_SIZE_TYPE);
+       g_value_set_boxed(val, &qsize);
+       return TRUE;
+    } else {
+        if (parent_class->property_get) {
+            return parent_class->property_get(pself, ID, val);
+        } else {
+            return FALSE;
+        }
+    }
+    g_assert_not_reached();
+}
+
+static gboolean 
+vfs_device_property_set (Device * pself, DevicePropertyId ID, GValue * val) {
+    VfsDevice * self;
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail(self != NULL, FALSE);
+    if (ID == PROPERTY_BLOCK_SIZE) {
+        int block_size = g_value_get_int(val);
+        g_return_val_if_fail(block_size > 0, FALSE);
+        self->block_size = block_size;
+        return TRUE;
+    } else if (ID == PROPERTY_MAX_VOLUME_USAGE) {
+        self->volume_limit = g_value_get_uint64(val);
+        return TRUE;
+    } else {
+        if (parent_class->property_get) {
+            return parent_class->property_get(pself, ID, val);
+        } else {
+            return FALSE;
+        }
+    }
+    g_assert_not_reached();
+}
+
+static gboolean try_unlink(const char * file) {
+    if (unlink(file) < 0) {
+        g_fprintf(stderr, "Can't unlink file %s: %s\n", file, strerror(errno));
+        return FALSE;
+    } else {
+        return TRUE;
+    }
+}
+
+static gboolean 
+vfs_device_recycle_file (Device * pself, guint filenum) {
+    VfsDevice * self;
+    struct stat file_status;
+    off_t file_size;
+
+    self = VFS_DEVICE(pself);
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail(!(pself->in_file), FALSE);
+
+    /* Game Plan:
+     * 1) Get a write lock on the file in question.
+     * 2) Unlink the file in question.
+     * 3) Unlink the lock.
+     * 4) Release the lock.
+     * FIXME: Is it OK to unlink the lockfile?
+     */
+
+    self->file_name = file_number_to_file_name(self, filenum);
+
+    if (self->file_name == NULL)
+        return FALSE;
+
+    if (!open_lock(self, filenum, TRUE))
+        return FALSE;
+
+    if (0 != stat(self->file_name, &file_status)) {
+        fprintf(stderr, "Cannot stat file %s (%s), so not removing.\n",
+                self->file_name, strerror(errno));
+        return FALSE;
+    }
+    file_size = file_status.st_size;
+    
+    if (!try_unlink(self->file_name) ||
+        !try_unlink(self->file_lock_name)) {
+        release_file(self);
+        return FALSE;
+    }
+
+    self->volume_bytes -= file_size;
+    release_file(self);
+    return TRUE;
+}
+
+static IoResult vfs_device_robust_read(VfsDevice * self, char *buf,
+                                             int *count) {
+    int fd = self->open_file_fd;
+    int want = *count, got = 0;
+
+    while (got < want) {
+        int result;
+        result = read(fd, buf + got, want - got);
+        if (result > 0) {
+            got += result;
+        } else if (result == 0) {
+            /* end of file */
+            if (got == 0) {
+                return RESULT_NO_DATA;
+            } else {
+                *count = got;
+                return RESULT_SUCCESS;
+            }
+        } else if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                   ) {
+            /* Try again. */
+            continue;
+        } else {
+            /* Error occured. */
+            g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno));
+            *count = got;
+            return -1;
+        }
+    }
+
+    *count = got;
+    return RESULT_SUCCESS;
+}
+
+static IoResult
+vfs_device_robust_write(VfsDevice * self,  char *buf, int count) {
+    int fd = self->open_file_fd;
+    int rval = 0;
+
+    while (rval < count) {
+        int result;
+        result = write(fd, buf + rval, count - rval);
+        if (result > 0) {
+            rval += result;
+            continue;
+        } else if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                   ) {
+            /* Try again. */
+            continue;
+        } else if (0
+#ifdef EFBIG
+                   || errno == EFBIG
+#endif
+#ifdef ENOSPC
+                   || errno == ENOSPC
+#endif
+                   ) {
+            /* We are definitely out of space. */
+            return RESULT_NO_SPACE;
+        } else {
+            /* Error occured. Note that here we handle EIO as an error. */
+            g_fprintf(stderr, "Error writing device fd %d: %s\n",
+                    fd, strerror(errno));
+            
+            return RESULT_ERROR;
+        }
+    }
+    return RESULT_SUCCESS;
+}
diff --git a/device-src/vfs-device.h b/device-src/vfs-device.h
new file mode 100644 (file)
index 0000000..6b5796f
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * 
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as 
+ * published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * 
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* The VFS device is the driver formerly known as the vtape driver or
+ * the file driver. It uses a directory on the UNIX filesystem as a
+ * data store. */
+
+#include <glib.h>
+#include <glib-object.h>
+#include "device.h"
+#include <dirent.h>
+
+#ifndef VFS_DEVICE_H
+#define VFS_DEVICE_H
+
+#define VFS_DEVICE_MIN_BLOCK_SIZE (1)
+#define VFS_DEVICE_MAX_BLOCK_SIZE (INT_MAX)
+#define VFS_DEVICE_DEFAULT_BLOCK_SIZE (MAX_TAPE_BLOCK_BYTES)
+#define VFS_DEVICE_LABEL_SIZE (32768)
+
+/* This looks dangerous, but is actually modified by the umask. */
+#define VFS_DEVICE_CREAT_MODE 0666
+
+/*
+ * Type checking and casting macros
+ */
+#define TYPE_VFS_DEVICE        (vfs_device_get_type())
+#define VFS_DEVICE(obj)        G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice)
+#define VFS_DEVICE_CONST(obj)  G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice const)
+#define VFS_DEVICE_CLASS(klass)        G_TYPE_CHECK_CLASS_CAST((klass), vfs_device_get_type(), VfsDeviceClass)
+#define IS_VFS_DEVICE(obj)     G_TYPE_CHECK_INSTANCE_TYPE((obj), vfs_device_get_type ())
+
+#define VFS_DEVICE_GET_CLASS(obj)      G_TYPE_INSTANCE_GET_CLASS((obj), vfs_device_get_type(), VfsDeviceClass)
+
+/*
+ * Main object structure
+ */
+typedef struct {
+    Device __parent__;
+
+    /*< private >*/
+    DIR * dir_handle;
+    char * dir_name;
+    char * file_name;
+    int file_lock_fd;
+    char * file_lock_name;
+    int volume_lock_fd;
+    char * volume_lock_name;
+    int open_file_fd;
+    
+    /* Properties */
+    int block_size;
+    guint64 volume_bytes;
+    guint64 volume_limit;
+} VfsDevice;
+
+/*
+ * Class definition
+ */
+typedef struct {
+    DeviceClass __parent__;
+} VfsDeviceClass;
+
+
+/*
+ * Public methods
+ */
+GType  vfs_device_get_type     (void);
+void    vfs_device_register     (void);
+
+#endif
+
diff --git a/docs/Appendix.txt b/docs/Appendix.txt
deleted file mode 100644 (file)
index 62d4433..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-
-Part VII. Appendixes
-Prev            Next
-
--------------------------------------------------------------------------------
-
-
-Part VII. Appendixes
-
-Table of Contents
-
-
-  36._The_Amanda_Manual_Pages.
-
-
-        amadmin \14 administrative interface to control Amanda backups
-
-        amaespipe \14 wrapper program for aespipe
-
-        amanda \14 Advanced Maryland Automatic Network Disk Archiver
-
-        amanda.conf \14 Main configuration file for Amanda, the Advanced Maryland
-        Automatic Network Disk Archiver
-
-        amanda-client.conf \14 Client configuration file for Amanda, the Advanced
-        Maryland Automatic Network Disk Archiver
-
-        amcheck \14 run Amanda self-checks
-
-        amcheckdb \14 check Amanda database for tape consistency
-
-        amcleanup \14 run the Amanda cleanup process after a failure
-
-        amcrypt \14 reference crypt program for Amanda symmetric data encryption
-
-        amcrypt-ossl \14 crypt program for Amanda symmetric data encryption using
-        OpenSSL
-
-        amcrypt-ossl-asym \14 crypt program for Amanda asymmetric data encryption
-        using OpenSSL
-
-        amdd \14 Amanda version of dd
-
-        amdump \14 back up all disks in an Amanda configuration
-
-        amfetchdump \14 extract backup images from multiple Amanda tapes.
-
-        amflush \14 flush Amanda backup files from holding disk to tape
-
-        amgetconf \14 look up amanda.conf variables
-
-        amlabel \14 label an Amanda tape
-
-        ammt \14 Amanda version of mt
-
-        amoverview \14 display file systems processed by Amanda over time
-
-        amplot \14 visualize the behavior of Amanda
-
-        amrecover \14 Amanda index database browser
-
-        amreport \14 generate a formatted output of statistics for an Amanda run
-
-        amrestore \14 extract backup images from an Amanda tape
-
-        amrmtape \14 remove a tape from the Amanda database
-
-        amstatus \14 display the state of an Amanda run
-
-        amtape \14 user interface to Amanda tape changer controls
-
-        amtapetype \14 generate a tapetype definition.
-
-        amtoc \14 generate TOC (Table Of Contents) for an Amanda run
-
-        amverify \14 check an Amanda tape for errors
-
-        amverifyrun \14 check the tapes written by the last Amanda run
-
-
-  37._Web_Ressources
-
--------------------------------------------------------------------------------
-
-Prev                                                                   Next
-Chapter 35. Usage of floppy tape Home  Chapter 36. The Amanda Manual Pages.
-drives on Linux 
-
diff --git a/docs/Makefile.am b/docs/Makefile.am
deleted file mode 100644 (file)
index d4bbf41..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-## Process this file with automake to produce Makefile.in
-pkgdata_DATA = \
-       Appendix.txt \
-       amadmin.8.txt \
-       amaespipe.8.txt \
-       amanda.8.txt \
-       amanda.conf.5.txt \
-       amanda-client.conf.5.txt \
-       amcheck.8.txt \
-       amcheckdb.8.txt \
-       amcleanup.8.txt \
-       amcrypt.8.txt \
-       amcrypt-asym-ossl.8.txt \
-       amcrypt-ossl.8.txt \
-       amdd.8.txt \
-       amdump.8.txt \
-       amfetchdump.8.txt \
-       amflush.8.txt \
-       amgetconf.8.txt \
-       amlabel.8.txt \
-       ammt.8.txt \
-       amoverview.8.txt \
-       amplot.8.txt \
-       amrecover.8.txt \
-       amreport.8.txt \
-       amrestore.8.txt \
-       amrmtape.8.txt \
-       amstatus.8.txt \
-       amtape.8.txt \
-       amtapetype.8.txt \
-       amtoc.8.txt \
-       amverify.8.txt \
-       amverifyrun.8.txt \
-       chgscsi.txt \
-       dumperapi.txt \
-       eventapi.txt \
-       exclude.txt \
-       faq.txt \
-       historical.txt \
-       howto-afs.txt \
-       howto-auth.txt \
-       howto-cygwin.txt \
-       howto-filedriver.txt \
-       howto-wrapper.txt \
-       howtos.txt \
-       index.txt \
-       indexing.txt \
-       install.txt \
-       internals.txt \
-       introduction.txt \
-       ix01.txt \
-       kerberos.txt \
-       labelprinting.txt \
-       links.txt \
-       manpages.txt \
-       multitape.txt \
-       portusage.txt \
-       pr01.txt \
-       pr02.txt \
-       pr03.txt \
-       pr04.txt \
-       rait.txt \
-       references.txt \
-       restore.txt \
-       samba.txt \
-       security-api.txt \
-       security.txt \
-       strategy-api.txt \
-       survey.txt \
-       systemnotes.txt \
-       tapechangers.txt \
-       tapesnchangers.txt \
-       tapetypes.txt \
-       technical.txt \
-       topten.txt \
-       upgrade.txt \
-       using.txt \
-       various.txt \
-       vtape-api.txt \
-       whatwasnew.txt \
-       wishlist.txt \
-       y2k.txt \
-       zftape.txt
-
-EXTRA_DIST = $(pkgdata_DATA)
diff --git a/docs/Makefile.in b/docs/Makefile.in
deleted file mode 100644 (file)
index a7846b1..0000000
+++ /dev/null
@@ -1,610 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  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@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-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 = docs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
-       $(top_srcdir)/config/gnulib/alloca.m4 \
-       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
-       $(top_srcdir)/config/gnulib/eoverflow.m4 \
-       $(top_srcdir)/config/gnulib/extensions.m4 \
-       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
-       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
-       $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
-       $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
-       $(top_srcdir)/config/gnulib/longlong.m4 \
-       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
-       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
-       $(top_srcdir)/config/gnulib/snprintf.m4 \
-       $(top_srcdir)/config/gnulib/socklen.m4 \
-       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
-       $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
-       $(top_srcdir)/config/gnulib/strdup.m4 \
-       $(top_srcdir)/config/gnulib/string_h.m4 \
-       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
-       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
-       $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-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 = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(pkgdatadir)"
-pkgdataDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(pkgdata_DATA)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-ALLOCA_H = @ALLOCA_H@
-AMANDA_DBGDIR = @AMANDA_DBGDIR@
-AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
-AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMLINT = @AMLINT@
-AMLINTFLAGS = @AMLINTFLAGS@
-AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
-AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
-AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
-AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
-AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
-AR = @AR@
-ARPA_INET_H = @ARPA_INET_H@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BINARY_OWNER = @BINARY_OWNER@
-CAT = @CAT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
-CHIO = @CHIO@
-CHS = @CHS@
-CLIENT_LOGIN = @CLIENT_LOGIN@
-CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
-COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
-CONFIG_DIR = @CONFIG_DIR@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
-DD = @DD@
-DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
-DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
-DEFAULT_SERVER = @DEFAULT_SERVER@
-DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
-DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DOC_BUILD_DATE = @DOC_BUILD_DATE@
-DUMP = @DUMP@
-DUMPER_DIR = @DUMPER_DIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
-EOVERFLOW = @EOVERFLOW@
-EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
-GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
-GNUPLOT = @GNUPLOT@
-GNUTAR = @GNUTAR@
-GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
-GREP = @GREP@
-GZIP = @GZIP@
-HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
-HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
-HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
-HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
-HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
-HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
-HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
-HAVE_MEMPCPY = @HAVE_MEMPCPY@
-HAVE_STPCPY = @HAVE_STPCPY@
-HAVE_STPNCPY = @HAVE_STPNCPY@
-HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
-HAVE_STRNDUP = @HAVE_STRNDUP@
-HAVE_STRPBRK = @HAVE_STRPBRK@
-HAVE_STRSEP = @HAVE_STRSEP@
-HAVE_VISIBILITY = @HAVE_VISIBILITY@
-HAVE__BOOL = @HAVE__BOOL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LEX = @LEX@
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBMULTITHREAD = @LIBMULTITHREAD@
-LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
-LIBS = @LIBS@
-LIBTHREAD = @LIBTHREAD@
-LIBTOOL = @LIBTOOL@
-LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
-LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
-LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
-LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
-LTLIBTHREAD = @LTLIBTHREAD@
-MAILER = @MAILER@
-MAKEINFO = @MAKEINFO@
-MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
-MCUTIL = @MCUTIL@
-MKDIR_P = @MKDIR_P@
-MT = @MT@
-MTX = @MTX@
-MT_FILE_FLAG = @MT_FILE_FLAG@
-NETINET_IN_H = @NETINET_IN_H@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PCAT = @PCAT@
-PERL = @PERL@
-PRINT = @PRINT@
-RANLIB = @RANLIB@
-READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
-RESTORE = @RESTORE@
-SAMBA_CLIENT = @SAMBA_CLIENT@
-SERVICE_SUFFIX = @SERVICE_SUFFIX@
-SETUID_GROUP = @SETUID_GROUP@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
-SORT = @SORT@
-SSH = @SSH@
-STDBOOL_H = @STDBOOL_H@
-STRIP = @STRIP@
-SYS_SOCKET_H = @SYS_SOCKET_H@
-USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
-VDUMP = @VDUMP@
-VERSION = @VERSION@
-VERSION_COMMENT = @VERSION_COMMENT@
-VERSION_MAJOR = @VERSION_MAJOR@
-VERSION_MINOR = @VERSION_MINOR@
-VERSION_PATCH = @VERSION_PATCH@
-VERSION_SUFFIX = @VERSION_SUFFIX@
-VRESTORE = @VRESTORE@
-VXDUMP = @VXDUMP@
-VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
-XFSDUMP = @XFSDUMP@
-XFSRESTORE = @XFSRESTORE@
-XSLTPROC = @XSLTPROC@
-XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
-YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-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@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-gl_LIBOBJS = @gl_LIBOBJS@
-gl_LTLIBOBJS = @gl_LTLIBOBJS@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-pkgdata_DATA = \
-       Appendix.txt \
-       amadmin.8.txt \
-       amaespipe.8.txt \
-       amanda.8.txt \
-       amanda.conf.5.txt \
-       amanda-client.conf.5.txt \
-       amcheck.8.txt \
-       amcheckdb.8.txt \
-       amcleanup.8.txt \
-       amcrypt.8.txt \
-       amcrypt-asym-ossl.8.txt \
-       amcrypt-ossl.8.txt \
-       amdd.8.txt \
-       amdump.8.txt \
-       amfetchdump.8.txt \
-       amflush.8.txt \
-       amgetconf.8.txt \
-       amlabel.8.txt \
-       ammt.8.txt \
-       amoverview.8.txt \
-       amplot.8.txt \
-       amrecover.8.txt \
-       amreport.8.txt \
-       amrestore.8.txt \
-       amrmtape.8.txt \
-       amstatus.8.txt \
-       amtape.8.txt \
-       amtapetype.8.txt \
-       amtoc.8.txt \
-       amverify.8.txt \
-       amverifyrun.8.txt \
-       chgscsi.txt \
-       dumperapi.txt \
-       eventapi.txt \
-       exclude.txt \
-       faq.txt \
-       historical.txt \
-       howto-afs.txt \
-       howto-auth.txt \
-       howto-cygwin.txt \
-       howto-filedriver.txt \
-       howto-wrapper.txt \
-       howtos.txt \
-       index.txt \
-       indexing.txt \
-       install.txt \
-       internals.txt \
-       introduction.txt \
-       ix01.txt \
-       kerberos.txt \
-       labelprinting.txt \
-       links.txt \
-       manpages.txt \
-       multitape.txt \
-       portusage.txt \
-       pr01.txt \
-       pr02.txt \
-       pr03.txt \
-       pr04.txt \
-       rait.txt \
-       references.txt \
-       restore.txt \
-       samba.txt \
-       security-api.txt \
-       security.txt \
-       strategy-api.txt \
-       survey.txt \
-       systemnotes.txt \
-       tapechangers.txt \
-       tapesnchangers.txt \
-       tapetypes.txt \
-       technical.txt \
-       topten.txt \
-       upgrade.txt \
-       using.txt \
-       various.txt \
-       vtape-api.txt \
-       whatwasnew.txt \
-       wishlist.txt \
-       y2k.txt \
-       zftape.txt
-
-EXTRA_DIST = $(pkgdata_DATA)
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-       @for dep in $?; do \
-         case '$(am__configure_deps)' in \
-           *$$dep*) \
-             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  docs/Makefile'; \
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --gnu  docs/Makefile
-.PRECIOUS: 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:  $(am__configure_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-libtool:
-       -rm -rf .libs _libs
-
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-install-pkgdataDATA: $(pkgdata_DATA)
-       @$(NORMAL_INSTALL)
-       test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)"
-       @list='$(pkgdata_DATA)'; for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         f=$(am__strip_dir) \
-         echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
-         $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
-       done
-
-uninstall-pkgdataDATA:
-       @$(NORMAL_UNINSTALL)
-       @list='$(pkgdata_DATA)'; for p in $$list; do \
-         f=$(am__strip_dir) \
-         echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
-         rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
-       done
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
-         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
-         if test -d $$d/$$file; then \
-           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
-           fi; \
-           cp -pR $$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:
-       for dir in "$(DESTDIR)$(pkgdatadir)"; 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:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-libtool
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-pkgdataDATA
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-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-info-am uninstall-pkgdataDATA
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       distclean distclean-generic distclean-libtool distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-exec install-exec-am \
-       install-info install-info-am install-man install-pkgdataDATA \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       uninstall uninstall-am uninstall-info-am uninstall-pkgdataDATA
-
-# 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/docs/amadmin.8.txt b/docs/amadmin.8.txt
deleted file mode 100644 (file)
index 5fea43a..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-
-                              amadmin
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amadmin \14 administrative interface to control Amanda backups
-
-Synopsis
-
-amadmin config command [command_options...] [-oconfigoption]...
-
-DESCRIPTION
-
-Amadmin performs various administrative tasks on the config Amanda
-configuration.
-See the amanda(8) man page for more details about Amanda.
-
-COMMANDS
-
-Commands that take a hostname [ disks ] parameter pair operate on all disks in
-the disklist for that hostname if no disks are specified. Where hostname is
-also marked as being optional, the command operates on all hosts and disks in
-the disklist. Both hostname and disks are special expressions; see the "HOST &
-DISK EXPRESSION" section of amanda(8) for a description.
-Commands that take one or more dumpspec parameters operate on the set of dumps
-specified by all of the expressions. See the "DUMP SPECIFICATIONS" section of
-amanda(8) for a description.
-
-
-  version
-      Show the current version and some compile time and runtime parameters.
-      The config parameter must be present but is ignored.
-
-  force-bump [ hostname [ disks ]* ]+
-      Force the disks on hostname to bump to a new incremental level during the
-      next Amanda run.
-
-  force-no-bump [ hostname [ disks ]* ]+
-      Force the disks on hostname to not bump to a new incremental level during
-      the next Amanda run.
-
-  unforce-bump [ hostname [ disks ]* ]+
-      Undo a previous force-bump or force-no-bump command.
-
-  force [ hostname [ disks ]* ]+
-      Force the disks on hostname to do a full (level 0) backup during the next
-      Amanda run.
-
-  unforce [ hostname [ disks ]* ]+
-      Undo a previous force command.
-
-  reuse tapelabel [ ... ]
-      The tapes listed will be available for reuse at their point in the tape
-      cycle.
-
-  no-reuse tapelabel [ ... ]
-      The tapes listed will not be reused when their turn comes up again in the
-      tape cycle. Note that if this causes the number of reusable tapes to drop
-      below the amanda.conf tapecycle value, Amanda will request new tapes
-      until the count is satisfied again.
-
-  due [ hostname [ disks ]* ]*
-      Show when the next full dump is due.
-
-  find [ --sort hkdlpb ] [ hostname [ disks ]* ]*
-      Display all backups currently on tape or in the holding disk. The tape
-      label or holding disk filename, file number, and status are displayed.
-      The --sort option changes the sort order using the following flags:
-
-        h: host name
-        k: disk name
-        d: dump date
-        l: backup level
-        p: dump part
-        b: tape label
-
-      An uppercase letter reverses the sort order for that key. The default
-      sort order is hkdlpb.
-
-  holding delete hostname [ disk [ datestamp [ .. ] ] ]
-      Delete holding files matching the given specification. At least a
-      hostname must be provided.
-
-  holding list [-l] [ hostname [ disk [ datestamp [ .. ] ] ] ]
-      List holding files matching the given specification, or all holding files
-      if no specification is provided. With '-l', additional information (size
-      and level) is provided.
-
-  delete [ hostname [ disks ]* ]+
-      Delete the specified disks on hostname from the Amanda database.
-
-      Note
-
-      If you do not also remove the disk from the disklist file, Amanda will
-      treat it as a new disk during the next run.
-
-  tape
-      Display the tape(s) Amanda expects to write to during the next run. See
-      also amcheck(8).
-
-  bumpsize
-      Display the current bump threshold parameters, calculated for all backup
-      levels.
-
-  balance [ --days <num> ]
-      Display the distribution of full backups throughout the dump schedule.
-
-  export [ hostname [ disks ]* ]*
-      Convert records from the Amanda database to a text format that may be
-      transmitted to another Amanda machine and imported.
-
-  import
-      Convert exported records read from standard input to a form Amanda uses
-      and insert them into the database on this machine.
-
-  disklist [ hostname [ disks ]* ]*
-      Display the disklist information for each of the disks on hostname (or
-      all hosts). Mostly used for debugging.
-
-  info [ hostname [ disks ]* ]*
-      Display the database record for each of the disks on hostname (or all
-      hosts). Mostly used for debugging.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLES
-
-Request three specific file systems on machine-a get a full level 0 backup
-during the next Amanda run.
-
-  $ amadmin daily force machine-a / /var /usr
-  amadmin: machine-a:/ is set to a forced level 0 tonight.
-  amadmin: machine-a:/var is set to a forced level 0 tonight.
-  amadmin: machine-a:/usr is set to a forced level 0 tonight.
-
-Request all file systems on machine-b get a full level 0 backup during the next
-Amanda run.
-
-  $ amadmin daily force machine-b
-  amadmin: machine-b:/ is set to a forced level 0 tonight.
-  amadmin: machine-b:/var is set to a forced level 0 tonight.
-  amadmin: machine-b:/usr is set to a forced level 0 tonight.
-  amadmin: machine-b:/home is set to a forced level 0 tonight.
-
-Undo the previous force request for /home on machine-b. The other file systems
-will still get a full level 0 backup.
-
-  $ amadmin daily unforce machine-b /home
-  amadmin: force command for machine-b:/home cleared.
-
-Locate backup images of /var from machine-c. The tape or file column displays
-either a tape label or a filename depending on whether the image is on tape or
-is still in the holding disk. If the image is on tape, the file column tells
-you which file on the tape has the image (file number zero is a tape label).
-This column shows zero and is not meaningful if the image is still in the
-holding disk. The status column tells you whether the backup was successful or
-had some type of error.
-
-  $ amadmin daily find machine-c /var
-  date        host      disk lv tape or file                 file part  status
-  2000-11-09  machine-c /var  0 000110                       9   --  OK
-  2000-11-08  machine-c /var  2 000109                       2   --  OK
-  2000-11-07  machine-c /var  2 /amanda/20001107/machine-c._var.2  0 OK
-  2000-11-06  machine-c /var  2 000107                       2   --  OK
-  2000-11-05  machine-c /var  2 000106                       3   --  OK
-  2000-11-04  machine-c /var  2 000105                       2   --  OK
-  2000-11-03  machine-c /var  2 000104                       2   --  OK
-  2000-11-02  machine-c /var  2 000103                       2   --  OK
-  2000-11-01  machine-c /var  1 000102                       5   --  OK
-  2000-10-31  machine-c /var  1 000101                       3   --  OK
-
-Forget about the /workspace disk on machine-d. If you do not also remove the
-disk from the disklist file, Amanda will treat it as a new disk during the next
-run.
-
-  $ amadmin daily delete machine-d /workspace
-  amadmin: machine-d:/workspace deleted from database.
-  amadmin: NOTE: you'll have to remove these from the disklist yourself.
-
-Find the next tape Amanda will use (in this case, 123456).
-
-  $ amadmin daily tape
-  The next Amanda run should go onto tape 123456 or a new tape.
-
-Show how well full backups are balanced across the dump cycle. The due-date
-column is the day the backups are due for a full backup. #fs shows the number
-of filesystems doing full backups that night, and orig KB and out KB show the
-estimated total size of the backups before and after any compression,
-respectively.
-The balance column shows how far off that night's backups are from the average
-size (shown at the bottom of the balance column). Amanda tries to keep the
-backups within +/- 5%, but since the amount of data on each filesystem is
-always changing, and Amanda will never delay backups just to rebalance the
-schedule, it is common for the schedule to fluctuate by larger percentages. In
-particular, in the case of a tape or backup failure, a bump will occur the
-following night, which will not be smoothed out until the next pass through the
-schedule.
-The last line also shows an estimate of how many Amanda runs will be made
-between full backups for a file system. In the example, a file system will
-probably have a full backup done every eight times Amanda is run (e.g. every
-eight days).
-
-  $ amadmin daily balance
-   due-date  #fs   orig KB    out KB  balance
-  -------------------------------------------
-  11/10 Mon   21    930389    768753    +5.1%
-  11/11 Tue   29   1236272    733211    +0.2%
-  11/12 Wed   31   1552381    735796    +0.6%
-  11/13 Thu   23   1368447    684552    -6.4%
-  11/14 Fri   32   1065603    758155    +3.6%
-  11/15 Sat   14   1300535    738430    +0.9%
-  11/16 Sun   31   1362696    740365    +1.2%
-  11/17 Mon   30   1427936    773397    +5.7%
-  11/18 Tue   11   1059191    721786    -1.3%
-  11/19 Wed   19   1108737    661867    -9.5%
-  -------------------------------------------
-  TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
-
-
-FILES
-
-/usr/local/etc/amanda/config/amanda.conf
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amcheck(8), amdump(8), amrestore(8), amfetchdump(8)
--------------------------------------------------------------------------------
-
-Prev                                   Up        Next
-Chapter 36. The Amanda Manual Pages.  Home  amaespipe
-
diff --git a/docs/amaespipe.8.txt b/docs/amaespipe.8.txt
deleted file mode 100644 (file)
index b222701..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-                             amaespipe
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amaespipe \14 wrapper program for aespipe
-
-Synopsis
-
-amaespipe
-
-DESCRIPTION
-
-amaespipe requires aespipe, uuencode and gpg to work. Aespipe is available from
-http://loop-aes.sourceforge.net
-amaespipe will search for the aespipe program in the following directories: /
-usr/bin:/usr/local/bin:/sbin:/usr/sbin.
-amaespipe is called by amcrypt for Amanda data encryption.
-amaespipe is based on aespipe's bzaespipe program. It calls aespipe to encrypt
-data using AES256 as the encryption and SHA256 as the hash function. GPG key
-should be stored in $AMANDA_HOME/.gnupg/am_key.gpg. amaespipe reads passphrase
-from file descriptor 3. During decryption, amaespipe autodects encryption type
-and hash function from the encrypted image.
-
-SEE ALSO
-
-amanda(8), amanda.conf(5), aespipe(1), amcrypt(8), gpg(1)
--------------------------------------------------------------------------------
-
-Prev      Up     Next
-amadmin  Home  amanda
-
diff --git a/docs/amanda-client.conf.5.txt b/docs/amanda-client.conf.5.txt
deleted file mode 100644 (file)
index 50bdd40..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-
-                      amanda-client.conf
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amanda-client.conf \14 Client configuration file for Amanda, the Advanced
-Maryland Automatic Network Disk Archiver
-
-DESCRIPTION
-
-amanda-client.conf is the client configuration file for Amanda. This manpage
-lists the relevant sections and parameters of this file for quick reference.
-The files <CONFIG_DIR>/amanda-client.conf and <CONFIG_DIR>/<config>/amanda-
-client.conf are loaded.
-
-PARAMETERS
-
-There are a number of configuration parameters that control the behavior of the
-Amanda programs. All have default values, so you need not specify the parameter
-in amanda-client.conf if the default is suitable.
-Lines starting with # are ignored, as are blank lines. Comments may be placed
-on a line with a directive by starting the comment with a #. The remainder of
-the line is ignored.
-Keywords are case insensitive, i.e. auth and Auth are treated the same.
-Integer arguments may have one of the following (case insensitive) suffixes,
-some of which have a multiplier effect:
-
-POSSIBLE SUFFIXES
-
-
-
-  b byte bytes
-      Some number of bytes.
-
-  bps
-      Some number of bytes per second.
-
-  k kb kbyte kbytes kilobyte kilobytes
-      Some number of kilobytes (bytes*1024).
-
-  kps kbps
-      Some number of kilobytes per second (bytes*1024).
-
-  m mb meg mbyte mbytes megabyte megabytes
-      Some number of megabytes (bytes*1024*1024).
-
-  mps mbps
-      Some number of megabytes per second (bytes*1024*1024).
-
-  g gb gbyte gbytes gigabyte gigabytes
-      Some number of gigabytes (bytes*1024*1024*1024).
-
-  tape tapes
-      Some number of tapes.
-
-  day days
-      Some number of days.
-
-  week weeks
-      Some number of weeks (days*7).
-
-      Note
-
-      The value inf may be used in most places where an integer is expected to
-      mean an infinite amount.
-      Boolean arguments may have any of the values y, yes, t, true or on to
-      indicate a true state, or n, no, f, false or off to indicate a false
-      state. If no argument is given, true is assumed.
-
-
-PARAMETERS
-
-
-
-  conf string
-      Default: Set by configure. The conf use by amrecover.
-
-  index_server string
-      Default: Set by configure. The amindexd server amrecover will connect to.
-
-  tape_server string
-      Default: Set by configure. The amidxtaped server amrecover will connect
-      to.
-
-  tapedev string
-      Default: Set by configure. The tapedev amrecover will use.
-
-  auth string
-      Default: bsd. Type of authorization to perform between tape server and
-      backup client hosts.
-      bsd, bsd authorization with udp initial connection and one tcp connection
-      by data stream.
-      bsdtcp, bsd authorization but use only one tcp connection.
-      bsdudp, like bsd, but will use only one tcp connection for all data
-      stream.
-      krb4 to use Kerberos-IV authorization.
-      krb5 to use Kerberos-V authorization.
-      rsh to use rsh authorization.
-      ssh to use OpenSSH authorization.
-
-  ssh_keys string
-      Default: No default. The key file the ssh auth will use, it must be the
-      private key. If this parameter is not specified, then the deafult ssh key
-      will be used.
-
-  gnutar_list_dir string
-      Default from configure --with-gnutar-listdir=DIR. The directory where
-      gnutar keep its state file.
-
-  amandates string
-      Default: /etc/amandates. The file where amanda keep the last date of each
-      dumplevel.
-
-  connect_tries int
-      Default: 3. How many times the server will try a connection.
-
-  rep_tries int
-      Default: 5. How many times amandad will resend a REP packet if it doesn't
-      get the ACK packet.
-
-  debug_amandad int
-      Default: 0. Debug level of the amandad process
-
-  debug_amidxtaped int
-      Default: 0. Debug level of the amidxtaped process
-
-  debug_amindexd int
-      Default: 0. Debug level of the amindexd process
-
-  debug_amrecover int
-      Default: 0. Debug level of the amrecover process
-
-  debug_auth int
-      Default: 0. Debug level of the auth module
-
-  debug_event int
-      Default: 0. Debug level of the event module
-
-  debug_holding int
-      Default: 0. Debug level of the holdingdisk module
-
-  debug_protocol int
-      Default: 0. Debug level of the protocol module
-
-  debug_selfcheck int
-      Default: 0. Debug level of the selfcheck process
-
-  debug_sendsize int
-      Default: 0. Debug level of the sendsize process
-
-  debug_sendbackup int
-      Default: 0. Debug level of the sendbackup process
-
-  reserved-udp-port int,int
-      Default: --with-udpportrange or 512,1023. Reserved udp port that will be
-      used (amrecover with bsd or bsdudp)
-
-  reserved-tcp-port int,int
-      Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will
-      be used (amrecover with bsdtcp)
-
-  unreserved-tcp-port int,int
-      Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will
-      be used (bsd, bsdudp)
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion, major update, splitting
-
-SEE ALSO
-
-amanda(8), amanda.conf(5), amcrypt(8), aespipe(1),
--------------------------------------------------------------------------------
-
-Prev          Up      Next
-amanda.conf  Home  amcheck
-
diff --git a/docs/amanda.8.txt b/docs/amanda.8.txt
deleted file mode 100644 (file)
index 845dfee..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-
-                               amanda
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amanda \14 Advanced Maryland Automatic Network Disk Archiver
-
-Synopsis
-
-amadmin config command [options]
-amcheck [options] config
-amcheckdb config
-amcleanup config
-amcrypt
-amdd [options]
-amdump config
-amaespipe
-amflush [-f ] config
-amgetconf [config] parameter
-amlabel config label [ slot slot ]
-ammt [options]
-amoverview config [options]
-amplot [options] amdump-files
-amrecover [config] [options]
-amreport [config] [options]
-amrestore [options] tapedevice [ hostname [diskname]]
-amfetchdump [options] config [ hostname [ diskname [ date [level]]]]
-amrmtape [options] config label
-amstatus config [options]
-amtape config command [options]
-amtapetype [options]
-amtoc [options] logfile
-amverify config
-amverifyrun config
-
-DESCRIPTION
-
-Amanda is the "Advanced Maryland Automatic Network Disk Archiver". This manual
-page gives an overview of the Amanda commands and configuration files for quick
-reference.
-Here are all the Amanda commands. Each one has its own manual page. See them
-for all the gory details.
-
-
-  amdump
-      Take care of automatic Amanda backups. This is normally executed by cron
-      on a computer called the tape server host and requests backups of file
-      systems located on backup clients. Amdump backs up all disks in the
-      disklist file (discussed below) to tape or, if there is a problem, to a
-      special holding disk. After all backups are done, amdump sends mail
-      reporting failures and successes.
-
-  amflush
-      Flush backups from the holding disk to tape. Amflush is used after amdump
-      has reported it could not write backups to tape for some reason. When
-      this happens, backups stay in the holding disk. Run amflush after the
-      tape problem is corrected to write backups from the holding disk to tape.
-
-  amcleanup
-      Clean up after an interrupted amdump. This command is only needed if
-      amdump was unable to complete for some reason, usually because the tape
-      server host crashed while amdump was running.
-
-  amrecover
-      Provides an interactive interface to browse the Amanda index files
-      (backup image catalogues) and select which tapes to recover files from.
-      It can also run amrestore and a restore program (e.g. tar) to actually
-      recover the files.
-
-  amrestore
-      Read an Amanda tape, searching for requested backups. Amrestore is
-      suitable for everything from interactive restores of single files to a
-      full restore of all partitions on a failed disk.
-
-  amfetchdump
-      Performs Amanda tape restoration, similar to amrestore. Additional
-      capabilities include "hands-off" searching of multiple tapes, automatic
-      retrieval of specific dump files based on dump logs, and assembly of
-      tape-spanning split dump files.
-
-  amlabel
-      Write an Amanda format label onto a tape. All Amanda tapes must be
-      labeled with amlabel. Amdump and amflush will not write to an unlabeled
-      tape (see TAPE MANAGEMENT below).
-
-  amcheck
-      Verify the correct tape is mounted and all file systems on all backup
-      client systems are ready to be backed up. Often run by cron before amdump
-      to generate a mail warning that backups might fail unless corrective
-      action is taken.
-
-  amadmin
-      Take care of administrative tasks like finding out which tapes are needed
-      to restore a filesystem, forcing hosts to do full backups of selected
-      disks and looking at schedule balance information.
-
-  amtape
-      Take care of tape changer control operations like loading particular
-      tapes, ejecting tapes and scanning the tape storage slots.
-
-  amverify
-      Check Amanda backup tapes for errors.
-
-  amrmtape
-      Delete a tape from the Amanda databases.
-
-  amstatus
-      Report the status of a running or completed amdump.
-
-  amoverview
-      Display a chart of hosts and file systems backed up every run.
-
-  amplot
-      Generate utilization plots of Amanda runs for performance tuning.
-
-  amreport
-      Generate an Amanda summary E-mail report.
-
-  amtoc
-      Generate table of content files for Amanda tapes.
-
-  amcheckdb
-      Verify every tape Amanda knows about is consistent in the database.
-
-  amgetconf
-      Look up parameters in the Amanda configuration file.
-
-  amtapetype
-      Generate a tapetype definition.
-
-  amaespipe
-      Wrapper program from aespipe (data encryption utility)
-
-  amcrypt
-      Reference encryption program for Amanda symmetric data encryption
-
-
-CONFIGURATION
-
-There are three user-editable files that control the behavior of Amanda.
-The first is amanda.conf, the main configuration file. It contains parameters
-to customize Amanda for the site. Refer to the amanda.conf(5), manpage for
-details on Amanda configuration parameters.
-Second is the disklist file, which lists hosts and disk partitions to back up.
-Third is the tapelist file, which lists tapes that are currently active. These
-files are described in more detail in the following sections.
-All files are stored in individual configuration directories under /usr/local/
-etc/amanda/. A site will often have more than one configuration. For example,
-it might have a normal configuration for everyday backups and an archive
-configuration for infrequent full archival backups. The configuration files
-would be stored under directories /usr/local/etc/amanda/normal/ and /usr/local/
-etc/amanda/archive/, respectively. Part of the job of an Amanda administrator
-is to create, populate and maintain these directories.
-All log and database files generated by Amanda go in corresponding directories
-somewhere. The exact location is controlled by entries in amanda.conf. A
-typical location would be under /var/adm/amanda. For the above example, the
-files might go in /var/adm/amanda/normal/ and /var/adm/amanda/archive/.
-As log files are no longer needed (no longer contain relevant information),
-Amanda cycles them out in various ways, depending on the type of file.
-Detailed information about amdump runs are stored in files named amdump.NN
-where NN is a sequence number, with 1 being the most recent file. Amdump
-rotates these files each run, keeping roughly the last tapecycle (see below)
-worth of them.
-The file used by amreport to generate the mail summary is named log.YYYYMMDD.NN
-where YYYYMMDD is the datestamp of the start of the amdump run and NN is a
-sequence number started at 0. At the end of each amdump run, log files for runs
-whose tapes have been reused are renamed into a subdirectory of the main log
-directory (see the logdir parameter below) named oldlog. It is up to the Amanda
-administrator to remove them from this directory when desired.
-Index (backup image catalogue) files older than the full dump matching the
-oldest backup image for a given client and disk are removed by amdump at the
-end of each run.
-
-DISKLIST FILE
-
-The disklist file determines which disks will be backed up by Amanda. The file
-usually contains one line per disk:
-
-  hostname diskname [diskdevice] dumptype [spindle [interface] ]
-
-All pairs [ hostname diskname ] must be unique.
-Lines starting with # are ignored, as are blank lines. The fields have the
-following meanings:
-
-
-  hostname
-      The name of the host to be backed up. If diskdevice refers to a PC share,
-      this is the host Amanda will run the Samba smbclient program on to back
-      up the share.
-
-  diskname
-      The name of the disk (a label). In most case, you set your diskname to
-      the diskdevice and you don't set the diskdevice. If you want multiple
-      entries with the same diskdevice, you must set a different diskname for
-      each entry. It's the diskname that you use on the commandline for any
-      Amanda command. Look at the example/disklist file for example.
-
-  diskdevice
-      Default: same as diskname. The name of the disk device to be backed up.
-      It may be a full device name, a device name without the /dev/ prefix,
-      e.g. sd0a, or a mount point such as /usr.
-      It may also refer to a PC share by starting the name with two (forward)
-      slashes, e.g. //some-pc/home. In this case, the program option in the
-      associated dumptype must be entered as GNUTAR. It is the combination of
-      the double slash disk name and program GNUTAR in the dumptype that
-      triggers the use of Samba.
-
-  dumptype
-      Refers to a dumptype defined in the amanda.conf file. Dumptypes specify
-      backup related parameters, such as whether to compress the backups,
-      whether to record backup results in /etc/dumpdates, the disk's relative
-      priority, etc.
-
-  spindle
-      Default: -1. A number used to balance backup load on a host. Amanda will
-      not run multiple backups at the same time on the same spindle, unless the
-      spindle number is -1, which means there is no spindle restriction.
-
-  interface
-      Default: local. The name of a network interface definition in the
-      amanda.conf file, used to balance network load.
-
-Instead of naming a dumptype, it is possible to define one in-line, enclosing
-dumptype options within curly braces, one per line, just like a dumptype
-definition in amanda.conf. Since pre-existing dumptypes are valid option names,
-this syntax may be used to customize dumptypes for particular disks.
-A line break must follow the left curly bracket.
-For instance, if a dumptype named normal is used for most disks, but use of the
-holding disk needs to be disabled for the file system that holds it, this would
-work instead of defining a new dumptype:
-
-  hostname diskname [ diskdevice ] {
-    normal
-    holdingdisk never
-  } [ spindle [ interface ] ]
-
-
-TAPE MANAGEMENT
-
-The tapelist file contains the list of tapes in active use. This file is
-maintained entirely by Amanda and should not be created or edited during normal
-operation. It contains lines of the form:
-
-  YYYYMMDD label flags
-
-Where YYYYMMDD is the date the tape was written, label is a label for the tape
-as written by amlabel and flags tell Amanda whether the tape may be reused, etc
-(see the reuse options of amadmin).
-Amdump and amflush will refuse to write to an unlabeled tape, or to a labeled
-tape that is considered active. There must be more tapes in active rotation
-(see the tapecycle option) than there are runs in the backup cycle (see the
-dumpcycle option) to prevent overwriting a backup image that would be needed to
-do a full recovery.
-
-OUTPUT DRIVERS
-
-The normal value for the tapedev parameter, or for what a tape changer returns,
-is a full path name to a non-rewinding tape device, such as /dev/nst0 or /dev/
-rmt/0mn or /dev/nst0.1 or whatever conventions the operating system uses.
-Amanda provides additional application level drivers that support non-
-traditional tape-simulations or features. To access a specific output driver,
-set tapedev (or configure your changer to return) a string of the form driver:
-driver-info where driver is one of the supported drivers and driver-info is
-optional additional information needed by the driver.
-The supported drivers are:
-
-
-  tape
-      This is the default driver. The driver-info is the tape device name.
-      Entering
-
-        tapedev /dev/rmt/0mn
-
-      is really a short hand for
-
-        tapedev tape:/dev/rmt/0mn
-
-
-  null
-      This driver throws away anything written to it and returns EOF for any
-      reads except a special case is made for reading a label, in which case a
-      "fake" value is returned that Amanda checks for and allows through
-      regardless of what you have set in labelstr. The driver-info field is not
-      used and may be left blank:
-
-        tapedev null:
-
-      The length value from the associated tapetype is used to limit the amount
-      of data written. When the limit is reached, the driver will simulate end
-      of tape.
-
-      Note
-
-      This driver should only be used for debugging and testing, and probably
-      only with the record option set to no.
-
-  rait
-      Redundant Array of Inexpensive (?) Tapes. Reads and writes tapes mounted
-      on multiple drives by spreading the data across N-1 drives and using the
-      last drive for a checksum. See docs/RAIT for more information.
-      The driver-info field describes the devices to use. Curly braces indicate
-      multiple replacements in the string. For instance:
-
-        tapedev rait:/dev/rmt/tps0d{4,5,6}n
-
-      would use the following devices:
-      /dev/rmt/tps0d4n /dev/rmt/tps0d5n /dev/rmt/tps0d6n
-
-
-
-  file
-      This driver emulates a tape device with a set of files in a directory.
-      The driver-info field must be the name of an existing directory. The
-      driver will test for a subdirectory of that named data and return offline
-      until it is present. When present, the driver uses two files in the data
-      subdirectory for each tape file. One contains the actual data. The other
-      contains record length information.
-      The driver uses a file named status in the file device directory to hold
-      driver status information, such as tape position. If not present, the
-      driver will create it as though the device is rewound.
-      The length value from the associated tapetype is used to limit the amount
-      of data written. When the limit is reached, the driver will simulate end
-      of tape.
-      One way to use this driver with a real device such as a CD-writer is to
-      create a directory for the file device and one or more other directories
-      for the actual data. Create a symlink named data in the file directory to
-      one of the data directories. Set the tapetype length to whatever the
-      medium will hold.
-      When Amanda fills the file device, remove the symlink and (optionally)
-      create a new symlink to another data area. Use a CD writer software
-      package to burn the image from the first data area.
-      To read the CD, mount it and create the data symlink in the file device
-      directory.
-
-
-AUTHORIZATION
-
-Amanda processes on the tape server host run as the dumpuser user listed in
-amanda.conf. When they connect to a backup client, they do so with an Amanda-
-specific protocol. They do not, for instance, use rsh or ssh directly.
-On the client side, the amandad daemon validates the connection using one of
-several methods, depending on how it was compiled and on options it is passed:
-
-
-  .rhosts
-      Even though Amanda does not use rsh, it can use .rhosts-style
-      authentication and a .rhosts file.
-
-  .amandahosts
-      This is essentially the same as .rhosts authentication except a different
-      file, with almost the same format, is used. This is the default mechanism
-      built into Amanda.
-      The format of the .amandahosts file is:
-      hostname [ username [ service ]*]
-      If username is ommitted, it defaults to the user running amandad, i.e.
-      the user listed in the inetd or xinetd configuration file.
-      The service is a list of the service the client is authorized to execute:
-      amdump, noop, selfcheck, sendsize, sendbackup, amindexd, amidxtaped.
-      amdump is a shortcut for "noop selfcheck sendsize sendbackup"
-
-  Kerberos
-      Amanda may use the Kerberos authentication system. Further information is
-      in the docs/KERBEROS file that comes with an Amanda distribution.
-      For Samba access, Amanda needs a file on the Samba server (which may or
-      may not also be the tape server) named /etc/amandapass with share names,
-      (clear text) passwords and (optional) domain names, in that order, one
-      per line, whitespace separated. By default, the user used to connect to
-      the PC is the same for all PC's and is compiled into Amanda. It may be
-      changed on a host by host basis by listing it first in the password field
-      followed by a percent sign and then the password. For instance:
-
-          //some-pc/home normalpw
-          //another-pc/disk otheruser%otherpw
-
-      With clear text passwords, this file should obviously be tightly
-      protected. It only needs to be readable by the Amanda-user on the Samba
-      server.
-      You can find further information in the docs/SAMBA file that comes with
-      an Amanda distribution.
-
-
-HOST & DISK EXPRESSION
-
-All host and disk arguments to programs are special expressions. The command
-applies to all disks that match your arguments. This section describes the
-matcher.
-The matcher matches by word, each word is a glob expression, words are
-separated by the separator '.' for host and '/' for disk. You can anchor the
-expression at left with a '^'. You can anchor the expression at right with a
-'$'. The matcher is case insensitive for host but is case sensitive for disk. A
-match succeeds if all words in your expression match contiguous words in the
-host or disk.
-
-.  word separator for a host
-/  word separator for a disk
-^  anchor at left
-$  anchor at right
-?  match exactly one character except the separator
-*  match zero or more characters except the separator
-** match zero or more characters including the separator
-
-Some examples:
-
-EXPRESSION WILL MATCH        WILL NOT MATCH
-hosta      hosta             hostb
-           hoSTA.dOMAIna.ORG  
-           foo.hosta.org      
-host       host              hosta
-host?      hosta             host
-           hostb              
-ho*na      hoina             ho.aina.org
-ho**na     hoina              
-           ho.aina.org        
-^hosta     hosta             foo.hosta.org
-sda*       /dev/sda1          
-           /dev/sda12         
-/opt       opt (disk)        opt (host)
-.opt.      opt (host)        opt (disk)
-/          /                 any other disk
-/usr       /usr               
-           /usr/opt           
-/usr$      /usr              /usr/opt
-
-
-DATESTAMP EXPRESSION
-
-A datestamp expression is a range expression where we only match the prefix.
-Leading ^ is removed. Trailing $ forces an exact match.
- _________________________________________________________________________
-|20001212-14|match_all_dates_beginning_with_20001212,_20001213_or_20001214|
-|20001212-4_|same_as_previous_____________________________________________|
-|20001212-24|match_all_dates_between_20001212_and_20001224________________|
-|2000121____|match_all_dates_that_start_with_2000121_(20001210-20001219)__|
-|2__________|match_all_dates_that_start_with_2_(20000101-29991231)________|
-|2000-10____|match_all_dates_between_20000101-20101231____________________|
-|200010$____|match_only_200010____________________________________________|
-
-
-DUMP SPECIFICATIONS
-
-A dump specification selects one or more dumps. It has the form [host][:disk]
-[@datestamp], where each component is a pattern as described above. If a
-component is missing, it is treated as a wildcard. The characters ':', '@', and
-'\' may be escaped within any component by preceding them with a '\'.
-Some examples:
-
-DUMPSPEC                        DESCRIPTION
-client17                        all dumps of client17
-@20080615                       All dumps on with datestamps matching 20080615
-webserver:/var/www              All dumps of /var/www on host webserver
-webserver:/var/www@200806150317 The dump of webserver with datestamp
-                                200806150317
-:/var/www                       All dumps of /var/www on any host
-
-
-CONFIGURATION OVERRIDE
-
-Most command allow to overwrite any configuration parameter on the command line
-with the -o option.
--o NAME=value
-eg. -o runtapes=2
-eg. -o DUMPTYPE:no-compress:compress="server fast"
-eg. -o TAPETYPE:HP-DAT:length=2000m
-eg. -o INTERFACE:local:use="2000 kbps"
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion, major update
-
-SEE ALSO
-
-amadmin(8), amanda.conf(5), amanda-client.conf(5), amcheck(8), amcheckdb(8),
-amcleanup(8), amdd(8), amdump(8), amfetchdump(8) amflush(8), amgetconf(8),
-amlabel(8), ammt(8), amoverview(8), amplot(8), amrecover(8), amreport(8),
-amrestore(8), amrmtape(8), amstatus(8), amtape(8), amtapetype(8), amtoc(8),
-amverify(8), amverifyrun(8)
--------------------------------------------------------------------------------
-
-Prev        Up          Next
-amaespipe  Home  amanda.conf
-
diff --git a/docs/amanda.conf.5.txt b/docs/amanda.conf.5.txt
deleted file mode 100644 (file)
index c1ddfdd..0000000
+++ /dev/null
@@ -1,1057 +0,0 @@
-
-                           amanda.conf
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amanda.conf \14 Main configuration file for Amanda, the Advanced Maryland
-Automatic Network Disk Archiver
-
-DESCRIPTION
-
-amanda.conf is the main configuration file for Amanda. This manpage lists the
-relevant sections and parameters of this file for quick reference.
-The file <CONFIG_DIR>/<config>/amanda.conf is loaded.
-
-PARAMETERS
-
-There are a number of configuration parameters that control the behavior of the
-Amanda programs. All have default values, so you need not specify the parameter
-in amanda.conf if the default is suitable.
-Lines starting with # are ignored, as are blank lines. Comments may be placed
-on a line with a directive by starting the comment with a #. The remainder of
-the line is ignored.
-Keywords are case insensitive, i.e. mailto and MailTo are treated the same.
-Integer arguments may have one of the following (case insensitive) suffixes,
-some of which have a multiplier effect:
-
-POSSIBLE SUFFIXES
-
-
-
-  b byte bytes
-      Some number of bytes.
-
-  bps
-      Some number of bytes per second.
-
-  k kb kbyte kbytes kilobyte kilobytes
-      Some number of kilobytes (bytes*1024).
-
-  kps kbps
-      Some number of kilobytes per second (bytes*1024).
-
-  m mb meg mbyte mbytes megabyte megabytes
-      Some number of megabytes (bytes*1024*1024).
-
-  mps mbps
-      Some number of megabytes per second (bytes*1024*1024).
-
-  g gb gbyte gbytes gigabyte gigabytes
-      Some number of gigabytes (bytes*1024*1024*1024).
-
-  tape tapes
-      Some number of tapes.
-
-  day days
-      Some number of days.
-
-  week weeks
-      Some number of weeks (days*7).
-
-      Note
-
-      The value inf may be used in most places where an integer is expected to
-      mean an infinite amount.
-      Boolean arguments may have any of the values y, yes, t, true or on to
-      indicate a true state, or n, no, f, false or off to indicate a false
-      state. If no argument is given, true is assumed.
-
-
-PARAMETERS
-
-
-
-  org string
-      Default: daily. A descriptive name for the configuration. This string
-      appears in the Subject line of mail reports. Each Amanda configuration
-      should have a different string to keep mail reports distinct.
-
-  mailto string
-      Default: operators. A space separated list of recipients for mail
-      reports.
-
-  dumpcycle int
-      Default: 10 days. The number of days in the backup cycle. Each disk will
-      get a full backup at least this often. Setting this to zero tries to do a
-      full backup each run.
-
-      Note
-
-      This parameter may also be set in a specific dumptype (see below). This
-      value sets the default for all dumptypes so must appear in amanda.conf
-      before any dumptypes are defined.
-
-  runspercycle int
-      Default: same as dumpcycle. The number of amdump runs in dumpcycle days.
-      A value of 0 means the same value as dumpcycle. A value of -1 means guess
-      the number of runs from the tapelist file, which is the number of tapes
-      used in the last dumpcycle days / runtapes.
-
-  tapecycle int
-      Default: 15 tapes. Typically tapes are used by Amanda in an ordered
-      rotation. The tapecycle parameter defines the size of that rotation. The
-      number of tapes in rotation must be larger than the number of tapes
-      required for a complete dump cycle (see the dumpcycle parameter).
-      This is calculated by multiplying the number of amdump runs per dump
-      cycle (runspercycle parameter) times the number of tapes used per run
-      (runtapes parameter). Typically two to four times this calculated number
-      of tapes are in rotation. While Amanda is always willing to use a new
-      tape in its rotation, it refuses to reuse a tape until at least
-      'tapecycle -1' number of other tapes have been used.
-      It is considered good administrative practice to set the tapecycle
-      parameter slightly lower than the actual number of tapes in rotation.
-      This allows the administrator to more easily cope with damaged or
-      misplaced tapes or schedule adjustments that call for slight adjustments
-      in the rotation order.
-
-  usetimestamps bool
-      Default: No. By default, Amanda can only track at most one run per
-      calendar day. When this option is enabled, however, Amanda can track as
-      many runs as you care to make.
-      WARNING: This option is not backward-compatible. Do not enable it if you
-      intend to downgrade your server installation to Amanda community edition
-      2.5.0
-
-  label_new_tapes string
-      Default: not set. When set, this directive will cause Amanda to
-      automatically write an Amanda tape label to any blank tape she
-      encounters. This option is DANGEROUS because when set, Amanda will ERASE
-      any non-Amanda tapes you may have, and may also ERASE any near-failing
-      tapes. Use with caution.
-      When using this directive, specify the template for new tape labels. The
-      template should contain some number of contiguous '%' characters, which
-      will be replaced with a generated number. Be sure to specify enough '%'
-      characters that you do not run out of tape labels. Example:
-      label_new_tapes "DailySet1-%%%"
-
-  dumpuser string
-      Default: amanda. The login name Amanda uses to run the backups. The
-      backup client hosts must allow access from the tape server host as this
-      user via .rhosts or .amandahosts, depending on how the Amanda software
-      was built.
-
-  printer string
-      Printer to use when doing tape labels. See the lbl-templ tapetype option.
-
-  tapedev string
-      Default: null:. The path name of the non-rewinding tape device. Non-
-      rewinding tape device names often have an 'n' in the name, e.g. /dev/rmt/
-      0mn, however this is operating system specific and you should consult
-      that documentation for detailed naming information.
-      If a tape changer is configured (see the tpchanger option), this option
-      might not be used.
-      If the null output driver is selected (see the section OUTPUT DRIVERS in
-      the amanda(8) manpage for more information), programs such as amdump will
-      run normally but all images will be thrown away. This should only be used
-      for debugging and testing, and probably only with the record option set
-      to no.
-
-  rawtapedev string
-      Default: null:. The path name of the raw tape device. This is only used
-      if Amanda is compiled for Linux machines with floppy tapes and is needed
-      for QIC volume table operations.
-
-  tpchanger string
-      Default: none. The name of the tape changer. If a tape changer is not
-      configured, this option is not used and should be commented out of the
-      configuration file.
-      If a tape changer is configured, choose one of the changer scripts (e.g.
-      chg-scsi) and enter that here.
-
-  changerdev string
-      Default: /dev/null. A tape changer configuration parameter. Usage depends
-      on the particular changer defined with the tpchanger option.
-
-  changerfile string
-      Default: /usr/adm/amanda/log/changer-status. A tape changer configuration
-      parameter. Usage depends on the particular changer defined with the
-      tpchanger option.
-
-  runtapes int
-      Default: 1. The maximum number of tapes used in a single run. If a tape
-      changer is not configured, this option is not used and should be
-      commented out of the configuration file.
-      If a tape changer is configured, this may be set larger than one to let
-      Amanda write to more than one tape.
-      Note that this is an upper bound on the number of tapes, and Amanda may
-      use less.
-      Also note that as of this release, Amanda does not support true tape
-      overflow. When it reaches the end of one tape, the backup image Amanda
-      was processing starts over again on the next tape.
-
-  maxdumpsize int
-      Default: runtapes*tape_length. Maximum number of bytes the planner will
-      schedule for a run.
-
-  taperalgo [first|firstfit|largest|largestfit|smallest|last]
-      Default: first. The algorithm used to choose which dump image to send to
-      the taper.
-
-
-        first
-            First in, first out.
-
-        firstfit
-            The first dump image that will fit on the current tape.
-
-        largest
-            The largest dump image.
-
-        largestfit
-            The largest dump image that will fit on the current tape.
-
-        smallest
-            The smallest dump image.
-
-        last
-            Last in, first out.
-
-
-  labelstr string
-      Default: .*. The tape label constraint regular expression. All tape
-      labels generated (see amlabel(8)) and used by this configuration must
-      match the regular expression. If multiple configurations are run from the
-      same tape server host, it is helpful to set their labels to different
-      strings (for example, "DAILY[0-9][0-9]*" vs. "ARCHIVE[0-9][0-9]*") to
-      avoid overwriting each other's tapes.
-
-  tapetype string
-      Default: EXABYTE. The type of tape drive associated with tapedev or
-      tpchanger. This refers to one of the defined tapetypes in the config file
-      (see below), which specify various tape parameters, like the length,
-      filemark size, and speed of the tape media and device.
-      First character of a tapetype string must be an alphabetic character
-
-  ctimeout int
-      Default: 30 seconds. Maximum amount of time that amcheck will wait for
-      each client host.
-
-  dtimeout int
-      Default: 1800 seconds. Amount of idle time per disk on a given client
-      that a dumper running from within amdump will wait before it fails with a
-      data timeout error.
-
-  etimeout int
-      Default: 300 seconds. Amount of time per disk on a given client that the
-      planner step of amdump will wait to get the dump size estimates. For
-      instance, with the default of 300 seconds and four disks on client A,
-      planner will wait up to 20 minutes for that machine. A negative value
-      will be interpreted as a total amount of time to wait per client instead
-      of per disk.
-
-  connect_tries int
-      Default: 3. How many times the server will try a connection.
-
-  req_tries int
-      Default: 3. How many times the server will resend a REQ packet if it
-      doesn't get the ACK packet.
-
-  netusage int
-      Default: 300 Kbps. The maximum network bandwidth allocated to Amanda, in
-      Kbytes per second. See also the interface section.
-
-  inparallel int
-      Default: 10. The maximum number of backups that Amanda will attempt to
-      run in parallel. Amanda will stay within the constraints of network
-      bandwidth and holding disk space available, so it doesn't hurt to set
-      this number a bit high. Some contention can occur with larger numbers of
-      backups, but this effect is relatively small on most systems.
-
-  displayunit "k|m|g|t"
-      Default: "k". The unit used to print many numbers, k=kilo, m=mega,
-      g=giga, t=tera.
-
-  dumporder string
-      Default: tttTTTTTTT. The priority order of each dumper:
-
-        s: smallest size
-        S: largest size
-        t: smallest time
-        T: largest time
-        b: smallest bandwidth
-        B: largest bandwidth
-
-
-  maxdumps int
-      Default: 1. The maximum number of backups from a single host that Amanda
-      will attempt to run in parallel. See also the inparallel option.
-      Note that this parameter may also be set in a specific dumptype (see
-      below). This value sets the default for all dumptypes so must appear in
-      amanda.conf before any dumptypes are defined.
-
-  bumpsize int
-      Default: 10 Mbytes. The minimum savings required to trigger an automatic
-      bump from one incremental level to the next, expressed as size. If Amanda
-      determines that the next higher backup level will be this much smaller
-      than the current level, it will do the next level. The value of this
-      parameter is used only if the parameter bumppercent is set to 0.
-      The global setting of this parameter can be overwritten inside of a
-      dumptype-definition.
-      See also the options bumppercent, bumpmult and bumpdays.
-
-  bumppercent int
-      Default: 0 percent. The minimum savings required to trigger an automatic
-      bump from one incremental level to the next, expressed as percentage of
-      the current size of the DLE (size of current level 0). If Amanda
-      determines that the next higher backup level will be this much smaller
-      than the current level, it will do the next level.
-      If this parameter is set to 0, the value of the parameter bumpsize is
-      used to trigger bumping.
-      The global setting of this parameter can be overwritten inside of a
-      dumptype-definition.
-      See also the options bumpsize, bumpmult and bumpdays.
-
-  bumpmult float
-      Default: 1.5. The bump size multiplier. Amanda multiplies bumpsize by
-      this factor for each level. This prevents active filesystems from bumping
-      too much by making it harder to bump to the next level. For example, with
-      the default bumpsize and bumpmult set to 2.0, the bump threshold will be
-      10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level
-      three, and so on.
-      The global setting of this parameter can be overwritten inside of a
-      dumptype-definition.
-
-  bumpdays int
-      Default: 2 days. To insure redundancy in the dumps, Amanda keeps
-      filesystems at the same incremental level for at least bumpdays days,
-      even if the other bump threshold criteria are met.
-      The global setting of this parameter can be overwritten inside of a
-      dumptype-definition.
-
-  diskfile string
-      Default: disklist. The file name for the disklist file holding client
-      hosts, disks and other client dumping information.
-
-  infofile string
-      Default: /usr/adm/amanda/curinfo. The file or directory name for the
-      historical information database. If Amanda was configured to use DBM
-      databases, this is the base file name for them. If it was configured to
-      use text formated databases (the default), this is the base directory and
-      within here will be a directory per client, then a directory per disk,
-      then a text file of data.
-
-  logdir string
-      Default: /usr/adm/amanda. The directory for the amdump and log files.
-
-  indexdir string
-      Default /usr/adm/amanda/index. The directory where index files (backup
-      image catalogues) are stored. Index files are only generated for
-      filesystems whose dumptype has the index option enabled.
-
-  tapelist string
-      Default: tapelist. The file name for the active tapelist file. Amanda
-      maintains this file with information about the active set of tapes.
-
-  tapebufs int
-      Default: 20. The number of buffers used by the taper process run by
-      amdump and amflush to hold data as it is read from the network or disk
-      before it is written to tape. Each buffer is a little larger than 32
-      KBytes and is held in a shared memory region.
-
-  reserve number
-      Default: 100. The part of holding-disk space that should be reserved for
-      incremental backups if no tape is available, expressed as a percentage of
-      the available holding-disk space (0-100). By default, when there is no
-      tape to write to, degraded mode (incremental) backups will be performed
-      to the holding disk. If full backups should also be allowed in this case,
-      the amount of holding disk space reserved for incrementals should be
-      lowered.
-
-  autoflush bool
-      Default: off. Whether an amdump run will flush the dumps from holding
-      disk to tape.
-
-  amrecover_do_fsf bool
-      Default: on. Amrecover will call amrestore with the -f flag for faster
-      positioning of the tape.
-
-  amrecover_check_label bool
-      Default: on. Amrecover will call amrestore with the -l flag to check the
-      label.
-
-  amrecover_changer string
-      Default: ''. Amrecover will use the changer if you use 'settape <string>'
-      and that string is the same as the amrecover_changer setting.
-
-  columnspec string
-      Defines the width of columns amreport should use. String is a comma (',')
-      separated list of triples. Each triple consists of three parts which are
-      separated by a equal sign ('=') and a colon (':') (see the example).
-      These three parts specify:
-
-        1. the name of the column, which may be:
-
-               Compress (compression ratio)
-               Disk (client disk name)
-               DumpRate (dump rate in KBytes/sec)
-               DumpTime (total dump time in hours:minutes)
-               HostName (client host name)
-               Level (dump level)
-               OrigKB (original image size in KBytes)
-               OutKB (output image size in KBytes)
-               TapeRate (tape writing rate in KBytes/sec)
-               TapeTime (total tape time in hours:minutes)
-               
-
-        2. the amount of space to display before the column (used to get
-           whitespace between columns).
-        3. the width of the column itself. If set to a negative value, the
-           width will be calculated on demand to fit the largest entry in this
-           column.
-
-      Here is an example:
-
-        columnspec "Disk=1:18,HostName=0:10,OutKB=1:7"
-
-      The above will display the disk information in 18 characters and put one
-      space before it. The hostname column will be 10 characters wide with no
-      space to the left. The output KBytes column is seven characters wide with
-      one space before it.
-
-  includefile string
-      Default: none. The name of an Amanda configuration file to include within
-      the current file. Useful for sharing dumptypes, tapetypes and interface
-      definitions among several configurations.
-
-  debug_auth int
-      Default: 0. Debug level of the auth module
-
-  debug_event int
-      Default: 0. Debug level of the event module
-
-  debug_holding int
-      Default: 0. Debug level of the holdingdisk module
-
-  debug_protocol int
-      Default: 0. Debug level of the protocol module
-
-  debug_planner int
-      Default: 0. Debug level of the planner process
-
-  debug_driver int
-      Default: 0. Debug level of the driver process
-
-  debug_dumper int
-      Default: 0. Debug level of the dumper process
-
-  debug_chunker int
-      Default: 0. Debug level of the chunker process
-
-  debug_taper int
-      Default: 0. Debug level of the taper process
-
-  reserved-udp-port int,int
-      Default: --with-udpportrange or 512,1023. Reserved udp port that will be
-      used (bsd, bsdudp)
-
-  reserved-tcp-port int,int
-      Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will
-      be used (bsdtcp)
-
-  unreserved-tcp-port int,int
-      Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will
-      be used (bsd, bsdudp)
-
-
-HOLDINGDISK SECTION
-
-The amanda.conf file may define one or more holding disks used as buffers to
-hold backup images before they are written to tape. The syntax is:
-
-  holdingdisk name {
-      holdingdisk-option holdingdisk-value
-      ...
-  }
-
-Name is a logical name for this holding disk.
-The options and values are:
-
-
-  comment string
-      Default: none. A comment string describing this holding disk.
-
-  directory disk
-      Default: /dumps/amanda. The path to this holding area.
-
-  use int
-      Default: 0 Gb. Amount of space that can be used in this holding disk
-      area. If the value is zero, all available space on the file system is
-      used. If the value is negative, Amanda will use all available space minus
-      that value.
-
-  chunksize int
-      Default: 1 Gb. Holding disk chunk size. Dumps larger than the specified
-      size will be stored in multiple holding disk files. The size of each
-      chunk will not exceed the specified value. However, even though dump
-      images are split in the holding disk, they are concatenated as they are
-      written to tape, so each dump image still corresponds to a single
-      continuous tape section.
-      If 0 is specified, Amanda will create holding disk chunks as large as (
-      (INT_MAX/1024)-64) Kbytes.
-      Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk
-      size is 64 Kbytes (but that would be really silly).
-      Operating systems that are limited to a maximum file size of 2 Gbytes
-      actually cannot handle files that large. They must be at least one byte
-      less than 2 Gbytes. Since Amanda works with 32 Kbyte blocks, and to
-      handle the final read at the end of the chunk, the chunk size should be
-      at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size,
-      e.g. 2047 Mbytes.
-
-
-DUMPTYPE SECTION
-
-The amanda.conf file may define multiple sets of backup options and refer to
-them by name from the disklist file. For instance, one set of options might be
-defined for file systems that can benefit from high compression, another set
-that does not compress well, another set for file systems that should always
-get a full backup and so on.
-A set of backup options are entered in a dumptype section, which looks like
-this:
-
-  define dumptype name {
-      dumptype-option dumptype-value
-      ...
-  }
-
-Name is the name of this set of backup options. It is referenced from the
-disklist file.
-Some of the options in a dumptype section are the same as those in the main
-part of amanda.conf. The main option value is used to set the default for all
-dumptype sections. For instance, setting dumpcycle to 50 in the main part of
-the config file causes all following dumptype sections to start with that
-value, but the value may be changed on a section by section basis. Changes to
-variables in the main part of the config file must be done before (earlier in
-the file) any dumptypes are defined.
-The dumptype options and values are:
-
-
-  auth string
-      Default: bsd. Type of authorization to perform between tape server and
-      backup client hosts.
-      bsd, bsd authorization with udp initial connection and one tcp connection
-      by data stream.
-      bsdtcp, bsd authorization but use only one tcp connection.
-      bsdudp, like bsd, but will use only one tcp connection for all data
-      stream.
-      krb4 to use Kerberos-IV authorization.
-      krb5 to use Kerberos-V authorization.
-      rsh to use rsh authorization.
-      ssh to use OpenSSH authorization.
-
-  amandad_path string
-      Default: $libexec/amandad. Specify the amandad path of the client, only
-      use with rsh/ssh authentification.
-
-  client_username string
-      Default: CLIENT_LOGIN. Specify the username to connect on the client,
-      only use with rsh/ssh authentification.
-
-  bumpsize int
-      Default: 10 Mbytes. The minimum savings required to trigger an automatic
-      bump from one incremental level to the next, expressed as size. If Amanda
-      determines that the next higher backup level will be this much smaller
-      than the current level, it will do the next level. The value of this
-      parameter is used only if the parameter bumppercent is set to 0.
-      See also the options bumppercent, bumpmult and bumpdays.
-
-  bumppercent int
-      Default: 0 percent. The minimum savings required to trigger an automatic
-      bump from one incremental level to the next, expressed as percentage of
-      the current size of the DLE (size of current level 0). If Amanda
-      determines that the next higher backup level will be this much smaller
-      than the current level, it will do the next level.
-      If this parameter is set to 0, the value of the parameter bumpsize is
-      used to trigger bumping.
-      See also the options bumpsize, bumpmult and bumpdays.
-
-  bumpmult float
-      Default: 1.5. The bump size multiplier. Amanda multiplies bumpsize by
-      this factor for each level. This prevents active filesystems from bumping
-      too much by making it harder to bump to the next level. For example, with
-      the default bumpsize and bumpmult set to 2.0, the bump threshold will be
-      10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level
-      three, and so on.
-
-  bumpdays int
-      Default: 2 days. To insure redundancy in the dumps, Amanda keeps
-      filesystems at the same incremental level for at least bumpdays days,
-      even if the other bump threshold criteria are met.
-
-  comment string
-      Default: none. A comment string describing this set of backup options.
-
-  comprate float [, float ]
-      Default: 0.50, 0.50. The expected full and incremental compression factor
-      for dumps. It is only used if Amanda does not have any history
-      information on compression rates for a filesystem, so should not usually
-      need to be set. However, it may be useful for the first time a very large
-      filesystem that compresses very little is backed up.
-
-  compress [client|server] string
-      Default: client fast. If Amanda does compression of the backup images, it
-      can do so either on the backup client host before it crosses the network
-      or on the tape server host as it goes from the network into the holding
-      disk or to tape. Which place to do compression (if at all) depends on how
-      well the dump image usually compresses, the speed and load on the client
-      or server, network capacity, holding disk capacity, availability of tape
-      hardware compression, etc.
-      For either type of compression, Amanda also allows the selection of three
-      styles of compression. Best is the best compression available, often at
-      the expense of CPU overhead. Fast is often not as good a compression as
-      best, but usually less CPU overhead. Or to specify Custom to use your own
-      compression method. (See dumptype custom-compress in example/amanda.conf
-      for reference)
-      So the compress options line may be one of:
-
-
-        compress none
-
-        compress client fast
-
-        compress client best
-
-        compress client custom
-            Specify client_custom_compress "PROG"
-            PROG must not contain white space and it must accept -d for
-            uncompress.
-
-        compress server fast
-
-        compress server best
-
-        compress server custom
-            Specify server_custom_compress "PROG"
-            PROG must not contain white space and it must accept -d for
-            uncompress.
-
-      Note that some tape devices do compression and this option has nothing to
-      do with whether that is used. If hardware compression is used (usually
-      via a particular tape device name or mt option), Amanda (software)
-      compression should be disabled.
-
-  dumpcycle int
-      Default: 10 days. The number of days in the backup cycle. Each disk using
-      this set of options will get a full backup at least this of ten. Setting
-      this to zero tries to do a full backup each run.
-
-  encrypt [none|client|server]
-      Default: none. To encrypt backup images, it can do so either on the
-      backup client host before it crosses the network or on the tape server
-      host as it goes from the network into the holding disk or to tape.
-      So the encrypt options line may be one of:
-
-
-        encrypt none
-
-        encrypt client
-            Specify client_encrypt "PROG"
-            PROG must not contain white space.
-            Specify client_decrypt_option "decryption-parameter" Default: "-d"
-            decryption-parameter must not contain white space.
-            (See dumptype server-encrypt-fast in example/amanda.conf for
-            reference)
-
-        encrypt server
-            Specify server_encrypt "PROG"
-            PROG must not contain white space.
-            Specify server_decrypt_option "decryption-parameter" Default: "-d"
-            decryption-parameter must not contain white space.
-            (See dumptype client-encrypt-nocomp in example/amanda.conf for
-            reference)
-
-      Note that current logic assumes compression then encryption during backup
-      (thus decrypt then uncompress during restore). So specifying client-
-      encryption AND server-compression is not supported. amcrypt which is a
-      wrapper of aespipe is provided as a reference symmetric encryption
-      program.
-
-  estimate client|calcsize|server
-      Default: client. Determine the way Amanda does it's estimate.
-
-
-        client
-            Use the same program as the dumping program, this is the most
-            accurate way to do estimates, but it can take a long time.
-
-        calcsize
-            Use a faster program to do estimates, but the result is less
-            accurate.
-
-        server
-            Use only statistics from the previous run to give an estimate, it
-            takes only a few seconds but the result is not accurate if your
-            disk usage changes from day to day.
-
-
-  exclude [ list|file ][[optional][ append ][ string ]+]
-      Default: file. There are two exclude lists, exclude file and exclude
-      list. With exclude file , the string is a GNU-tar exclude expression.
-      With exclude list , the string is a file name on the client containing
-      GNU-tar exclude expressions. The path to the specified exclude list file,
-      if present (see description of 'optional' below), must be readable by the
-      Amanda user.
-      All exclude expressions are concatenated in one file and passed to GNU-
-      tar as an --exclude-from argument.
-      Exclude expressions must always be specified as relative to the head
-      directory of the DLE.
-      With the append keyword, the string is appended to the current list,
-      without it, the string overwrites the list.
-      If optional is specified for exclude list, then amcheck will not complain
-      if the file doesn't exist or is not readable.
-      For exclude list, if the file name is relative, the disk name being
-      backed up is prepended. So if this is entered:
-
-            exclude list ".amanda.excludes"
-
-      the actual file used would be /var/.amanda.excludes for a backup of /var,
-      /usr/local/.amanda.excludes for a backup of /usr/local, and so on.
-
-  holdingdisk [ never|auto|required ]
-      Default: auto. Whether a holding disk should be used for these backups or
-      whether they should go directly to tape. If the holding disk is a portion
-      of another file system that Amanda is backing up, that file system should
-      refer to a dumptype with holdingdisk set to never to avoid backing up the
-      holding disk into itself.
-
-
-        never|no|false|off
-            Never use a holdingdisk, the dump will always go directly to tape.
-            There will be no dump if you have a tape error.
-
-        auto|yes|true|on
-            Use the holding disk, unless there is a problem with the holding
-            disk, the dump won't fit there or the medium doesn't require
-            spooling (e.g., VFS device)
-
-        required
-            Always dump to holdingdisk, never directly to tape. There will be
-            no dump if it doesn't fit on holdingdisk
-
-
-  ignore boolean
-      Default: no. Whether disks associated with this backup type should be
-      backed up or not. This option is useful when the disklist file is shared
-      among several configurations, some of which should not back up all the
-      listed file systems.
-
-  include [ list|file ][[optional][ append ][ string ]+]
-      Default: file ".". There are two include lists, include file and include
-      list. With include file , the string is a glob expression. With include
-      list , the string is a file name on the client containing glob
-      expressions.
-      All include expressions are expanded by Amanda, concatenated in one file
-      and passed to GNU-tar as a --files-from argument. They must start with
-      "./" and contain no other "/".
-      Include expressions must always be specified as relative to the head
-      directory of the DLE.
-
-      Note
-
-      For globbing to work at all, even the limited single level, the top level
-      directory of the DLE must be readable by the Amanda user.
-      With the append keyword, the string is appended to the current list,
-      without it, the string overwrites the list.
-      If optional is specified for include list, then amcheck will not complain
-      if the file doesn't exist or is not readable.
-      For include list, If the file name is relative, the disk name being
-      backed up is prepended.
-
-  index boolean
-      Default: no. Whether an index (catalogue) of the backup should be
-      generated and saved in indexdir. These catalogues are used by the
-      amrecover utility.
-
-  kencrypt boolean
-      Default: no. Whether the backup image should be encrypted by Kerberos as
-      it is sent across the network from the backup client host to the tape
-      server host.
-
-  maxdumps int
-      Default: 1. The maximum number of backups from a single host that Amanda
-      will attempt to run in parallel. See also the main section parameter
-      inparallel.
-
-  maxpromoteday int
-      Default: 10000. The maximum number of day for a promotion, set it 0 if
-      you don't want promotion, set it to 1 or 2 if your disks get
-      overpromoted.
-
-  priority string
-      Default: medium. When there is no tape to write to, Amanda will do
-      incremental backups in priority order to the holding disk. The priority
-      may be high (2), medium (1), low (0) or a number of your choice.
-
-  program string
-      Default: DUMP. The type of backup to perform. Valid values are DUMP for
-      the native operating system backup program, and GNUTAR to use GNU-tar or
-      to do PC backups using Samba.
-
-  record boolean
-      Default: yes. Whether to ask the backup program to update its database
-      (e.g. /etc/dumpdates for DUMP or /usr/local/var/amanda/gnutar-lists for
-      GNUTAR) of time stamps. This is normally enabled for daily backups and
-      turned off for periodic archival runs.
-
-  skip-full boolean
-      Default: no. If true and planner has scheduled a full backup, these disks
-      will be skipped, and full backups should be run off-line on these days.
-      It was reported that Amanda only schedules level 1 incrementals in this
-      configuration; this is probably a bug.
-
-  skip-incr boolean
-      Default: no. If true and planner has scheduled an incremental backup,
-      these disks will be skipped.
-
-  starttime int
-      Default: none. Backups will not start until after this time of day. The
-      value should be hh*100+mm, e.g. 6:30PM (18:30) would be entered as 1830.
-
-  strategy string
-      Default: standard. Strategy to use when planning what level of backup to
-      run next. Values are:
-
-
-        standard
-            The standard Amanda schedule.
-
-        nofull
-            Never do full backups, only level 1 incrementals.
-
-        noinc
-            Never do incremental backups, only full dumps.
-
-        skip
-            Never do backups (useful when sharing the disklist file).
-
-        incronly
-            Only do incremental dumps. amadmin force should be used to tell
-            Amanda that a full dump has been performed off-line, so that it
-            resets to level 1. It is similar to skip-full, but with incronly
-            full dumps may be scheduled manually. Unfortunately, it appears
-            that Amanda will perform full backups with this configuration,
-            which is probably a bug.
-
-
-  tape_splitsize int
-      Default: none. Split dump file on tape into pieces of a specified size.
-      This allows dumps to be spread across multiple tapes, and can potentially
-      make more efficient use of tape space. Note that if this value is too
-      large (more than half the size of the average dump being split),
-      substantial tape space can be wasted. If too small, large dumps will be
-      split into innumerable tiny dumpfiles, adding to restoration complexity.
-      A good rule of thumb, usually, is 1/10 of the size of your tape.
-
-  split_diskbuffer string
-      Default: none. When dumping a split dump in PORT-WRITE mode (usually
-      meaning "no holding disk"), buffer the split chunks to a file in the
-      directory specified by this option.
-
-  fallback_splitsize int
-      Default: 10M. When dumping a split dump in PORT-WRITE mode, if no
-      split_diskbuffer is specified (or if we somehow fail to use our
-      split_diskbuffer), we must buffer split chunks in memory. This specifies
-      the maximum size split chunks can be in this scenario, and thus the
-      maximum amount of memory consumed for in-memory splitting. The size of
-      this buffer can be changed from its (very conservative) default to a
-      value reflecting the amount of memory that each taper process on the dump
-      server may reasonably consume.
-
-The following dumptype entries are predefined by Amanda:
-
-  define dumptype no-compress {
-      compress none
-  }
-  define dumptype compress-fast {
-      compress client fast
-  }
-  define dumptype compress-best {
-      compress client best
-  }
-  define dumptype srvcompress {
-      compress server fast
-  }
-  define dumptype bsd-auth {
-      auth bsd
-  }
-  define dumptype krb4-auth {
-      auth krb4
-  }
-  define dumptype no-record {
-      record no
-  }
-  define dumptype no-hold {
-      holdingdisk no
-  }
-  define dumptype no-full {
-      skip-full yes
-  }
-
-In addition to options in a dumptype section, one or more other dumptype names
-may be entered, which make this dumptype inherit options from other previously
-defined dumptypes. For instance, two sections might be the same except for the
-record option:
-
-  define dumptype normal {
-      comment "Normal backup, no compression, do indexing"
-      no-compress
-      index yes
-      maxdumps 2
-  }
-  define dumptype testing {
-      comment "Test backup, no compression, do indexing, no recording"
-      normal
-      record no
-  }
-
-Amanda provides a dumptype named global in the sample amanda.conf file that all
-dumptypes should reference. This provides an easy place to make changes that
-will affect every dumptype.
-
-TAPETYPE SECTION
-
-The amanda.conf file may define multiple types of tape media and devices. The
-information is entered in a tapetype section, which looks like this in the
-config file:
-
-  define tapetype name {
-      tapetype-option tapetype-value
-      ...
-  }
-
-Name is the name of this type of tape medium/device. It is referenced from the
-tapetype option in the main part of the config file.
-The tapetype options and values are:
-
-
-  comment string
-      Default: none. A comment string describing this set of tape information.
-
-  filemark int
-      Default: 1 kbytes. How large a file mark (tape mark) is, measured in
-      kbytes. If the size is only known in some linear measurement (e.g.
-      inches), convert it to kbytes using the device density.
-
-  length int
-      Default: 2000 kbytes. How much data will fit on a tape.
-      Note that this value is only used by Amanda to schedule which backups
-      will be run. Once the backups start, Amanda will continue to write to a
-      tape until it gets an error, regardless of what value is entered for
-      length (but see the section OUTPUT DRIVERS in the amanda(8) manpage for
-      exceptions).
-
-  blocksize int
-      Default: 32 kbytes. How much data will be written in each tape record
-      expressed in KiloBytes. The tape record size (= blocksize) can not be
-      reduced below the default 32 KBytes. The parameter blocksize can only be
-      raised if Amanda was compiled with the configure option --with-
-      maxtapeblocksize=N set with "N" greater than 32 during configure.
-
-  readblocksize int
-      Default: (from configure --with-maxtapeblocksize). How much data will be
-      read in each tape record expressed in KiloBytes. Some hardware require a
-      value not too large, and some require it to be equal to the blocksize. It
-      is useful if you configured amanda with a big --with-maxtapeblocksize and
-      your hardware don't work with a value that big.
-
-  file-pad boolean
-      Default: true. If true, every record, including the last one in the file,
-      will have the same length. This matches the way Amanda wrote tapes prior
-      to the availability of this parameter. It may also be useful on devices
-      that only support a fixed blocksize.
-      Note that the last record on the tape probably includes trailing null
-      byte padding, which will be passed back to gzip, compress or the restore
-      program. Most programs just ignore this (although possibly with a
-      warning).
-      If this parameter is false, the last record in a file may be shorter than
-      the block size. The file will contain the same amount of data the dump
-      program generated, without trailing null byte padding. When read, the
-      same amount of data that was written will be returned.
-
-  speed int
-      Default: 200 bps. How fast the drive will accept data, in bytes per
-      second. This parameter is NOT currently used by Amanda.
-
-  lbl-templ string
-      A PostScript template file used by amreport to generate labels. Several
-      sample files are provided with the Amanda sources in the example
-      directory. See the amreport(8) man page for more information.
-
-In addition to options, another tapetype name may be entered, which makes this
-tapetype inherit options from another tapetype. For instance, the only
-difference between a DLT4000 tape drive using Compact-III tapes and one using
-Compact-IV tapes is the length of the tape. So they could be entered as:
-
-  define tapetype DLT4000-III {
-      comment "DLT4000 tape drives with Compact-III tapes"
-      length 12500 mbytes         # 10 Gig tapes with some compression
-      filemark 2000 kbytes
-      speed 1536 kps
-  }
-  define tapetype DLT4000-IV {
-      DLT4000-III
-      comment "DLT4000 tape drives with Compact-IV tapes"
-      length 25000 mbytes         # 20 Gig tapes with some compression
-  }
-
-
-INTERFACE SECTION
-
-The amanda.conf file may define multiple types of network interfaces. The
-information is entered in an interface section, which looks like this:
-
-  define interface name {
-      interface-option interface-value
-      ...
-  }
-
-name is the name of this type of network interface. It is referenced from the
-disklist file.
-Note that these sections define network interface characteristics, not the
-actual interface that will be used. Nor do they impose limits on the bandwidth
-that will actually be taken up by Amanda. Amanda computes the estimated
-bandwidth each file system backup will take based on the estimated size and
-time, then compares that plus any other running backups with the limit as
-another of the criteria when deciding whether to start the backup. Once a
-backup starts, Amanda will use as much of the network as it can leaving
-throttling up to the operating system and network hardware.
-The interface options and values are:
-
-
-  comment string
-      Default: none. A comment string describing this set of network
-      information.
-
-  use int
-      Default: 300 Kbps. The speed of the interface in Kbytes per second.
-
-In addition to options, another interface name may be entered, which makes this
-interface inherit options from another interface. At the moment, this is of
-little use.
-
-AUTHOR
-
-James da Silva, <jds@amanda.org>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion, major update, splitting
-
-SEE ALSO
-
-amanda(8), amanda-client.conf(5), amcrypt(8), aespipe(1),
--------------------------------------------------------------------------------
-
-Prev     Up                 Next
-amanda  Home  amanda-client.conf
-
diff --git a/docs/amcheck.8.txt b/docs/amcheck.8.txt
deleted file mode 100644 (file)
index f043cf9..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-
-                              amcheck
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcheck \14 run Amanda self-checks
-
-Synopsis
-
-amcheck [-am] [-w] [-sclt] [-M address] config [ host [disk...] ...] [ -
-o configoption]...
-
-DESCRIPTION
-
-Amcheck runs a number of self-checks on both the Amanda tape server host and
-the Amanda client hosts.
-On the tape server host, amcheck can go through the same tape checking used at
-the start of the nightly amdump run to verify the correct tape for the next run
-is mounted.
-Amcheck can also do a self-check on all client hosts to make sure each host is
-running and that permissions on filesystems to be backed up are correct.
-You can specify many host/disk expressions, only disks that match an expression
-will be checked. All disks are checked if no expressions are given.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -s
-      Run the tape server local and tape checks (same as -lt).
-
-  -c
-      Run the client host checks. Multiple specific clients can be checked by
-      specifying the client name.
-
-  -l
-      Run the local tests (e.g. permissions) on the server host.
-
-  -t
-      Run the tape tests on the server host.
-
-  -w
-      Enables a DESTRUCTIVE check for write-protection on the tape (which would
-      otherwise cause the subsequent amdump to fail). If the tape is writable,
-      this check causes all data after the tape label to be erased. If the
-      label_new_tapes option is enabled, this check may ERASE any non-Amanda
-      tape in the drive or changer. The check enable the tape tests on the
-      server host and is only made if the tape is otherwise correct.
-
-  -m
-      Nothing is printed, but mail is sent if any errors are detected. The mail
-      goes to the mailto address specified in the amanda.conf file or the
-      address value if -M is set.
-
-  -a
-      Like -m but the mail is always sent.
-
-  -M address
-      Mail the report to address instead of the mailto value from amanda.conf.
-      Implies -m.
-
-  host [disk]*
-      Specify the host and disk on which the command will work.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-The default is -cs.
-
-EXAMPLES
-
-In this example, both the tape server and client tests are run. The results are
-displayed on standard output.
-
-  % amcheck daily
-  Amanda Tape Server Host Check
-  -----------------------------
-  /amanda2/amanda/work: 911475 KB disk space available, that's plenty.
-  NOTE: skipping tape-writable test.
-  Tape VOL10 label ok.
-  Server check took 34.966 seconds.
-
-  Amanda Backup Client Hosts Check
-  --------------------------------
-  WARNING: northstar: selfcheck request timed out.  Host down?
-  WARNING: drinkme: selfcheck request timed out.  Host down?
-  WARNING: scruffy: selfcheck request timed out.  Host down?
-  Client check: 136 hosts checked in 51.945 seconds, 3 problems found.
-
-  (brought to you by Amanda 2.5.0)
-
-In this example, if the line mailto csd-amanda is in amanda.conf, mail will be
-sent to csd-amanda if the server check returns an error.
-
-  % amcheck -s -m daily
-
-
-MESSAGES
-
-
-
-  fatal slot slot: error message
-      (error) The tape changer detected some kind of fatal error while trying
-      to load slot slot.
-
-  slot slot: error message
-      (warning) The tape changer detected some kind of non-fatal error (e.g. an
-      empty slot was detected) while trying to load slot slot, or an error was
-      detected trying to read the tape label.
-
-  slot slot: date YYYYMMDD label label (result)
-      (info) Tape label in slot slot was loaded and found to have been last
-      written on YYYYMMDD. If the tape is new, the date field will be an X. The
-      result may be one of:
-
-
-        exact label match
-            This is the expected tape.
-
-        no match
-            This label does not match the labelstr pattern in amanda.conf. Tape
-            scanning will continue.
-
-        active tape
-            This tape is still active and cannot be overwritten. Tape scanning
-            will continue.
-
-        first labelstr match
-            This tape is the first one that matches the labelstr pattern in
-            amanda.conf. Tape scanning will continue if necessary.
-
-        labelstr match
-            This tape is the next one that matches the labelstr pattern in
-            amanda.conf. Tape scanning will continue.
-
-
-  ERROR: cannot look up dump user user
-      (error) Dump user user from amanda.conf could not be found in the system
-      password information.
-
-  ERROR: cannot look up my own uid (uid)
-      (error) User id uid running amcheck could not be found in the system
-      password information.
-
-  ERROR: running as user runuser instead of dumpuser
-      (error) Amcheck should be run as the dump user dumpuser from amanda.conf
-      instead of runuser.
-
-  ERROR: program dir directory: not accessible
-      (error) The directory Amanda expects to find its auxiliary programs in,
-      directory, is not accessible.
-
-  ERROR: program program: does not exist
-      (error) Program program needed on the tape server could not be found.
-
-  ERROR: program program: not a file
-      (error) Program program needed on the tape server exists but is not a
-      file.
-
-  ERROR: program program: not executable
-      (error) Program program needed on the tape server exists but is not
-      executable.
-
-  WARNING: program program: not setuid-root
-      (warning) Program program needed on the tape server exists but should be
-      owned by user "root" and setuid.
-
-  ERROR: XXX dir directory: not writable
-      (error) Directory directory is either not writable, i.e. the dump user
-      will not be able to create or remove files, or cannot be accessed,
-      perhaps because a parent directory does not allow search permission. The
-      XXX may be:
-
-
-        log
-            for the Amanda log directory (see logdir in amanda.conf)
-
-        oldlog
-            for the directory that holds the old log files (see logdir in
-            amanda.conf)
-
-        info
-            for an Amanda database information directory (see curinfo in
-            amanda.conf) or
-
-        index
-            for an Amanda index directory (see indexdir in amanda.conf)
-
-        tapelist
-            for the Amanda tapelist directory (see tapelist in amanda.conf)
-
-
-  NOTE: XXX dir directory: does not exist
-      (info) A database (info) or index directory does not exist or cannot be
-      accessed. This might just mean this is a new client or disk, but if that
-      is not the case, this should be treated as an error.
-
-  NOTE: it will be created on the next run
-      (info) This indicates the info directory listed in the previous message
-      will be created on the next run.
-
-  ERROR: XXX dir name: not a directory
-      (error) Amcheck expected name to be a directory, but it is something else
-      (e.g. file).
-
-  WARNING: info file file: does not exist
-      (warning) File file does not exist in the text format database. Since the
-      parent directories do exist, the file should already have been created.
-
-  ERROR: info file name: not a file
-      (error) Amcheck expected name to be a file, but it is something else
-      (e.g. file).
-
-  ERROR: info file file: not readable
-      (error) The text format database file file is not readable.
-
-  ERROR: log file file: not writable
-      (error) Log file file (file log in logdir from amanda.conf) is either not
-      writable, or cannot be accessed, perhaps because a parent directory does
-      not allow search permission.
-
-  ERROR: tape list tapelist: not writable
-      (error) Amanda tape list file tapelist (see tapelist in amanda.conf) is
-      not writable or was not found.
-
-  ERROR: tape list tapelist: parse error
-      (error) Amanda tape list file tapelist (see tapelist in amanda.conf)
-      could not be read or parsed.
-
-  WARNING: tapedev is /dev/null, dumps will be thrown away
-      (warning) The tapedev parameter in amanda.conf is set to /dev/null and
-      Amanda uses that when debugging to throw all the dump images away.
-
-  WARNING: hold file file exists
-      (info) Hold file file exists and will cause amdump to pause at the
-      beginning until it is removed.
-
-  ERROR: holding disk disk: statfs: error message
-      (error) An error was returned from the statfs system call on holding disk
-      disk (maybe because it does not exist).
-
-  ERROR: holding disk disk: not writable
-      (error) Holding disk disk, is not writable, probably because the caller
-      does not have write permission or a parent directory does not allow
-      search permission.
-
-  WARNING: holding disk disk: available space unknown N KB requested.
-      (warning) Amcheck could not determine the amount of available space on
-      holding disk disk to see if there were at least N KBytes available.
-
-  WARNING: holding disk disk: only F KB free (R KB requested).
-      (warning) amanda.conf requested R KBytes of free space on holding disk
-      disk, but only F KBytes were available. 10 MBytes is subtracted for each
-      backup process (see the inparallel amanda.conf option) to allow for
-      unexpected overruns.
-
-      Note
-
-      Even though this message is listed as a warning, it causes amcheck to
-      exit with a non-zero status.
-
-
-
-  Holding disk disk: N KB disk space available, that's plenty.
-      (info) There was sufficient free space on holding disk disk.
-
-  WARNING: holding disk disk: only F KB free, using nothing
-      (warning) Holding disk disk has F KBytes of free space, but that is not
-      enough for what is requested in amanda.conf.
-
-  Holding disk disk: F KB disk space available, using U KB
-      (info) Holding disk disk has F KBytes of free space and Amanda will be
-      using up to U Kbytes.
-
-  WARNING: if a tape changer is not available, runtapes must be set to 1.
-      (warning) The runtapes amanda.conf option must be set to 1 if the
-      tpchanger amanda.conf option is not set.
-
-  ERROR: error message.
-      (error) An error was detected while initializing the tape changer.
-
-  ERROR: tape device: error message.
-      (error) An error was detected while processing the tape label.
-
-  ERROR: cannot overwrite active tape label.
-      (error) Tape label is still active and cannot be used.
-
-  ERROR: label label doesn't match labelstr pattern .
-      (error) The label on tape label does not match the labelstr amanda.conf
-      option.
-
-  (expecting a new tape)
-      (info) The tape is not OK and a new tape was expected.
-
-  (expecting tape label or a new tape)
-      (info) The tape is not OK and either tape label or a new tape was
-      expected.
-
-  ERROR: tape label label ok, but is not writable.
-      (error) Tape label is OK, but the write enable test failed.
-
-  Tape label is writable.
-      (info) Tape label is OK and the write enable test succeeded.
-
-  NOTE: skipping tape-writable test.
-      (info) The tape write test (see the -w option) was not enabled.
-
-  WARNING: skipping tape test because amdump or amflush seem to be running,
-  WARNING: if they are not, you must run amcleanup
-      (warning) It looked to amcheck like either amdump or amflush were running
-      because a log file or amdump file exists. If they are not running, you
-      probably need to run amcleanup to clear up a previous failure. Otherwise,
-      you need to wait until they complete before running amcheck.
-
-  NOTE: skipping tape checks
-      (info) The tape tests are being skipped because you used the -t command
-      line option.
-
-  WARNING: compress is not executable, server-compression and indexing will not
-  work
-      (warning) Compression program compress is not executable, so compression
-      on the tape server host and creating index files will not work.
-
-  Tape label label ok.
-      (info) Tape label is OK for the next run.
-
-  Server check took S seconds.
-      (info) Reports how long the tape server host checks took.
-
-  ERROR: host: could not resolve hostname
-      (error) Could not look up client hostname host.
-
-  Client check: H hosts checked in S seconds, N problems found.
-      (info) Reports the number of client hosts checked, how long it took and
-      the number of errors detected.
-
-  WARNING: host: selfcheck request timed out. Host down?
-      (warning) There was no response from host when trying to do the client
-      checks. The host might really be down or it might not be configured
-      properly.
-
-  ERROR: host NAK: message
-      (error) Host reported a negative acknowledgment error of message to the
-      status check request.
-
-  ERROR: host NAK: [NAK parse failed]
-      (error) Amcheck could not parse the negative acknowledgment error from
-      host. There might be an Amanda version mismatch between the host running
-      amcheck and host.
-
-  ERROR: host [mutual-authentication failed]
-      (error) Kerberos authentication failed while contacting host.
-
-  ERROR: host: message
-      (error) Error message was reported by the status check on host.
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amdump(8)
--------------------------------------------------------------------------------
-
-Prev                 Up        Next
-amanda-client.conf  Home  amcheckdb
-
diff --git a/docs/amcheckdb.8.txt b/docs/amcheckdb.8.txt
deleted file mode 100644 (file)
index 8821ca6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-                             amcheckdb
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcheckdb \14 check Amanda database for tape consistency
-
-Synopsis
-
-amcheckdb config
-
-DESCRIPTION
-
-Amcheckdb verifies that every tape mentioned in the Amanda database is still
-valid in the tapelist file.
-See the amanda(8) man page for more details about Amanda.
-
-EXAMPLE
-
-This shows a normal response:
-
-  # amcheckdb daily
-  Ready.
-
-This shows tape DMP014 is still listed in the database but is no longer listed
-in the tapelist file:
-
-  # amcheckdb daily
-  Tape DMP014 missing in /usr/local/etc/amanda//daily/tapelist
-  Ready.
-
-
-AUTHOR
-
-Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amadmin(8), amrmtape(8), amanda(8)
--------------------------------------------------------------------------------
-
-Prev      Up        Next
-amcheck  Home  amcleanup
-
diff --git a/docs/amcleanup.8.txt b/docs/amcleanup.8.txt
deleted file mode 100644 (file)
index c09e7b3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-                             amcleanup
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcleanup \14 run the Amanda cleanup process after a failure
-
-Synopsis
-
-amcleanup config
-
-DESCRIPTION
-
-Amcleanup generates the Amanda Mail Report and updates the Amanda databases
-after a system failure on a tape server host. This cleanup process is normally
-done automatically as part of the amdump program, but if amdump cannot complete
-for some reason (usually because of a tape server host crash), amcleanup must
-be run some time later (usually during system boot).
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -k
-      Kill all Amanda processes.
-
-
-EXAMPLES
-
-This example runs the Amanda cleanup process by hand after a failure.
-
-  % amcleanup daily
-
-Putting the following line in a system boot script (e.g. /etc/rc.local) runs
-the Amanda cleanup process as part of the reboot, eliminating the need to run
-it by hand.
-
-  /usr/local/sbin/amcleanup daily
-
-If nothing needs to be done, amcleanup exits normally with the message:
-
-  amcleanup: no unprocessed logfile to clean up.
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amdump(8)
--------------------------------------------------------------------------------
-
-Prev        Up      Next
-amcheckdb  Home  amcrypt
-
diff --git a/docs/amcrypt-asym-ossl.8.txt b/docs/amcrypt-asym-ossl.8.txt
deleted file mode 100644 (file)
index 711be5c..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-
-                       amcrypt-ossl-asym
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcrypt-ossl-asym \14 crypt program for Amanda asymmetric data encryption using
-OpenSSL
-
-Synopsis
-
-amcrypt-ossl-asym [-d]
-
-DESCRIPTION
-
-amcrypt-ossl-asym uses OpenSSL to encrypt and decrypt data. OpenSSL is
-available from www.openssl.org. OpenSSL offers a wide variety of cipher choices
-( amcrypt-ossl-asym defaults to 256-bit AES) and can use hardware cryptographic
-accelerators on several platforms.
-amcrypt-ossl-asym will search for the OpenSSL program in the following
-directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin.
-
-GENERATING PUBLIC AND PRIVATE KEYS
-
-RSA keys can be generated with the standard OpenSSL commands, e.g.:
-
-  $ cd /var/lib/amanda
-  $ openssl genrsa -aes128 -out backup-privkey.pem 1024
-  Generating RSA private key, 1024 bit long modulus
-  [...]
-  Enter pass phrase for backup-privkey.pem: ENTER YOUR PASS PHRASE
-  Verifying - Enter pass phrase for backup-key.pem: ENTER YOUR PASS PHRASE
-
-  $ openssl rsa -in backup-privkey.pem -pubout -out backup-pubkey.pem
-  Enter pass phrase for backup-privkey.pem: ENTER YOUR PASS PHRASE
-  Writing RSA key
-
-To generate a private key without a passphrase, omit the -aes128 option. See
-openssl_genrsa(1) for more key generation options.
-Note that it is always possible to generate the public key from the private
-key.
-
-KEY AND PASSPHRASE MANAGEMENT
-
-amcrypt-ossl-asym uses the public key to encrypt data. The security of the data
-does not depend on the confidentiality of the public key. The private key is
-used to decrypt data, and must be protected. Encrypted backup data cannot be
-recovered without the private key. The private key may optionally be encrypted
-with a passphrase.
-While the public key must be online at all times to perorm backups, the private
-key and optional passphrase are only needed to restore data. It is recommended
-that the latter be stored offline all other times. For example, you could keep
-the private key on removable media, and copy it into place for a restore; or
-you could keep the private key online, encrypted with a passphrase that is
-present only for a restore.
-OpenSSL's key derivation routines use a salt to guard against dictionary
-attacks on the pass phrase; still it is important to pick a pass phrase that is
-hard to guess. The Diceware method (see www.diceware.com) can be used to create
-passphrases that are difficult to guess and easy to remember.
-
-FILES
-
-
-
-  /var/lib/amanda/backup-privkey.pem
-      File containing the RSA private key. It should not be readable by any
-      user other than the Amanda user.
-
-  /var/lib/amanda/backup-pubkey.pem
-      File containing the RSA public key.
-
-  /var/lib/amanda/.am_passphrase
-      File containing the passphrase. It should not be readable by any user
-      other than the Amanda user.
-
-
-SEE ALSO
-
-amanda(8), amanda.conf(5), openssl(1), amcrypt-ossl(8)
--------------------------------------------------------------------------------
-
-Prev           Up   Next
-amcrypt-ossl  Home  amdd
-
diff --git a/docs/amcrypt-ossl.8.txt b/docs/amcrypt-ossl.8.txt
deleted file mode 100644 (file)
index c3eb0b6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-
-                           amcrypt-ossl
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcrypt-ossl \14 crypt program for Amanda symmetric data encryption using OpenSSL
-
-Synopsis
-
-amcrypt-ossl [-d]
-
-DESCRIPTION
-
-amcrypt-ossl uses OpenSSL to encrypt and decrypt data. OpenSSL is available
-from www.openssl.org. OpenSSL offers a wide variety of cipher choices
-( amcrypt-ossl defaults to 256-bit AES) and can use hardware cryptographic
-accelerators on several platforms.
-amcrypt-ossl will search for the OpenSSL program in the following directories:
-/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin.
-
-PASSPHRASE MANAGEMENT
-
-amcrypt-ossl uses the same pass phrase to encrypt and decrypt data. It is very
-important to store and protect the pass phrase properly. Encrypted backup data
-can only be recovered with the correct passphrase.
-OpenSSL's key derivation routines use a salt to guard against dictionary
-attacks on the pass phrase; still it is important to pick a pass phrase that is
-hard to guess. The Diceware method (see www.diceware.com) can be used to create
-passphrases that are difficult to guess and easy to remember.
-
-FILES
-
-
-
-  /var/lib/amanda/.am_passphrase
-      File containing the pass phrase. It should not be readable by any user
-      other than the Amanda user.
-
-
-SEE ALSO
-
-amanda(8), amanda.conf(5), openssl(1), amcrypt-ossl-asym(8)
--------------------------------------------------------------------------------
-
-Prev      Up                Next
-amcrypt  Home  amcrypt-ossl-asym
-
diff --git a/docs/amcrypt.8.txt b/docs/amcrypt.8.txt
deleted file mode 100644 (file)
index 1282fd3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-
-                              amcrypt
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amcrypt \14 reference crypt program for Amanda symmetric data encryption
-
-Synopsis
-
-amcrypt
-
-DESCRIPTION
-
-amcrypt requires aespipe, uuencode and gpg to work. Aespipe is available from
-http://loop-aes.sourceforge.net
-amcrypt will search for the aespipe program in the following directories: /usr/
-bin:/usr/local/bin:/sbin:/usr/sbin.
-amcrypt calls amaespipe and pass the passphrase through file descriptor 3. The
-passphrase should be stored in ~amanda/.am_passphrase.
-
-How to create encryption keys for amcrypt
-
-1. Create 65 random encryption keys and encrypt those keys using gpg. Reading
-from /dev/random may take indefinitely long if kernel's random entropy pool is
-empty. If that happens, do some other work on some other console (use keyboard,
-mouse and disks).
-head -c 2925 /dev/random | uuencode -m - | head -n 66 | tail -n 65 \ | gpg --
-symmetric -a > ~amanda/.gnupg/am_key.gpg
-This will ask for a passphrase. Remember this passphrase as you will need it in
-the next step.
-2. Store the passphrase inside the home-directory of the AMANDA-user and
-protect it with proper permissions:
-
-  echo my_secret_passphrase > ~amanda/.am_passphrase
-  chown amanda:disk ~amanda/.am_passphrase
-  chmod 700 ~amanda/.am_passphrase
-
-
-Key and Passphrase
-
-amcrypt uses the same key to encrypt and decrypt data.
-It is very important to store and protect the key and the passphrase properly.
-Encrypted backup data can only be recovered with the correct key and
-passphrase.
-
-SEE ALSO
-
-amanda(8), amanda.conf(5), aespipe(1), amaespipe(8), gpg(1)
--------------------------------------------------------------------------------
-
-Prev        Up           Next
-amcleanup  Home  amcrypt-ossl
-
diff --git a/docs/amdd.8.txt b/docs/amdd.8.txt
deleted file mode 100644 (file)
index 13ea42b..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-
-                                 amdd
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amdd \14 Amanda version of dd
-
-Synopsis
-
-amdd [-d ] [if=input] [of=output] [bs=blocksize] [skip=count] [count=count]
-
-DESCRIPTION
-
-Amdd provides just enough of the standard UNIX dd command for the needs of
-Amanda. This is handy when doing a full restore and the standard dd program has
-not yet been found.
-Amdd also provides access to the Amanda output drivers that support various
-tape simulations. This may be used for debugging or to convert from one format
-to another.
-See the amanda(8) man page for more details about Amanda. See the OUTPUT
-DRIVERS section of amanda(8) for more information on the Amanda output drivers.
-
-OPTIONS
-
-
-
-  -d
-      Turn on debugging output.
-
-  -llength
-      Set the output length. If the output driver limits the output size, this
-      controls when end of tape will be simulated.
-      Length may have a multiplier suffix:
-
-      k -> 1024 (Kilobytes)
-      b -> 512 (Blocks)
-      M -> 1024*1024 (Megabytes)
-      The default is no multiplier (bytes).
-
-
-
-  if=input
-      Input to dd. Default is stdin.
-
-  of=output
-      Where to send the output of dd. Default is stdout.
-
-  bs=blocksize
-      Size of each record. Input records smaller than this will not be padded.
-      Output records will be the same size as the corresponding input record.
-      Default is 512 bytes.
-      Blocksize may have a multiplier suffix:
-
-      k -> 1024 (Kilobytes)
-      b -> 512 (Blocks)
-      M -> 1024*1024 (Megabytes)
-      The default is no multiplier (bytes).
-
-
-
-  count=count
-      Number of records to copy. Default is all records until end of file.
-
-  skip=count
-      Number of records to skip before copying input to output. Default is
-      zero.
-
-
-AUTHOR
-
-Marc Mengel <mengel@fnal.gov>, John R. Jackson <jrj@purdue.edu> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8)
--------------------------------------------------------------------------------
-
-Prev                Up     Next
-amcrypt-ossl-asym  Home  amdump
-
diff --git a/docs/amdump.8.txt b/docs/amdump.8.txt
deleted file mode 100644 (file)
index bcfbf6e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-                               amdump
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amdump \14 back up all disks in an Amanda configuration
-
-Synopsis
-
-amdump config [ host [disk...] ...] [ -o configoption]...
-
-DESCRIPTION
-
-Amdump switches to the appropriate Amanda configuration directory, e.g. /usr/
-local/etc/amanda/config, then attempts to back up every disk specified by the
-amanda.conf file. Amdump is normally run by cron.
-You can specify many host/disk expressions, only disks that match an expression
-will be dumped. All disks are dumped if no expressions are given.
-If the file /usr/local/etc/amanda/config/hold exists, amdump will wait until it
-is removed before starting the backups. This allows scheduled backups to be
-delayed when circumstances warrant, for example, if the tape device is being
-used for some other purpose. While waiting, amdump checks for the hold file
-every minute.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  host [disk]*
-      Specify the host and disk on which the command will work.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLE
-
-Here is a typical crontab entry. It runs amdump every weeknight at 1 a.m. as
-user bin:
-
-  0 1 * * 1-5 bin /usr/local/sbin/amdump daily
-
-Please see the crontab(5) or crontab(1) manual page for the correct crontab
-format for your system.
-
-MESSAGES
-
-
-
-  amdump: waiting for hold file to be removed
-      The "hold" file exists and amdump is waiting for it to be removed before
-      starting backups.
-
-  amdump: amdump or amflush is already running, or you must run amcleanup
-      Amdump detected another amdump or amflush running, or the remains of a
-      previous incomplete amdump or amflush run. This run is terminated. If the
-      problem is caused by the remains of a previous run, you must execute
-      amcleanup(8) and then rerun amdump.
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amcheck(8), amcleanup(8), amrestore(8), amflush(8), cron(8)
--------------------------------------------------------------------------------
-
-Prev   Up          Next
-amdd  Home  amfetchdump
-
diff --git a/docs/amfetchdump.8.txt b/docs/amfetchdump.8.txt
deleted file mode 100644 (file)
index 7015e6c..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-
-                           amfetchdump
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amfetchdump \14 extract backup images from multiple Amanda tapes.
-
-Synopsis
-
-amfetchdump [-pcClawns] [-d device] [-O directory] [-i logfile] [-b blocksize]
-config hostname [ disk [ date [ level [ hostname [...] ] ] ] ] [ -
-o configoption]...
-
-DESCRIPTION
-
-Amfetchdump pulls one or more matching dumps from tape or from the holding
-disk, handling the reassembly of multi-tape split dump files as well as any
-tape autochanger operations.
-It will automatically use the logs created by amdump(8) to locate available
-dumps on tape, in the same way that the find feature of amadmin(8) lists
-available dumps. If these logs are unavailable, it can search tape-by-tape to
-find what it needs, and can generate new logs to serve as an emergency tape
-inventory.
-The hostname, diskname, datestamp, and level dump pattern-matching works as in
-amrestore(8), with the added requirement that at minimum a hostname must be
-specified when not in inventory mode.
-Unless -p is used, backup images are extracted to files in the current
-directory named:
-hostname.diskname.datestamp.dumplevel
-
-OPTIONS
-
-
-
-  -p
-      Pipe exactly one complete dump file to stdout, instead of writing the
-      file to disk. This will restore only the first matching dumpfile (where
-      "first" is determined by the dump log search facility).
-
-  -d device
-      Restore from this tape device instead of the default.
-
-  -O directory
-      Output restored files to this directory, instead of to the current
-      working directory.
-
-  -c
-      Compress output, fastest method available.
-
-  -C
-      Compress output, smallest file size method available.
-
-  -l
-      Leave dumps in the compressed/uncompressed state in which they were found
-      on tape. By default, amfetchdump will automatically uncompress when
-      restoring.
-
-  -a
-      Assume that all tapes are already available, via tape changer or
-      otherwise, instead of prompting the operator to ensure that all tapes are
-      loaded.
-
-  -i filename
-      Generate an inventory of all dumps "seen" on the tapes we search, for
-      later use as a log.
-
-  -w
-      Wait to put split dumps together until all chunks have been restored.
-      Normally, amfetchdump will attempt to read pieces of a split file from
-      tape in order, so that it can assemble them simply by appending each file
-      to the first. This option disables the appending behavior, and instead
-      restores each piece as an individual file and reassembles them only after
-      all have been restored.
-
-      Note
-
-      This requires at least double the size of your dump in free disk space,
-      in order to build the final assembled dumpfile.
-      This behavior is implicitly invoked in circumstances where knowing the
-      location of all dumps on tape in advance is not possible, such as when
-      you are restoring without log files.
-
-  -n
-      Do not reassemble split dump files at all, just restore each piece as an
-      individual file.
-
-  -s
-      Do not fast-forward straight to needed files on tape. This will slow down
-      most restores substantially. Only use this option if your tape drive does
-      not properly support the fast-forward operation.
-
-  -b blocksize
-      Force a particular block size when reading from tapes. This value will
-      usually be autodetected, and should not normally need to be set.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLES
-
-All the examples here assume your configuration is called SetA.
-Here's a simple case, restoring all known dumps of the host vanya to the
-current working directory.
-
-$ amfetchdump SetA vanya
-A more likely scenario involves restoring a particular dump from a particular
-date. We'll pipe this one to GNU-tar as well, to automatically extract the
-dump.
-
-$ amfetchdump -p SetA vanya /home 20051020 | gtar -xvpf -
-In a situation where all of our dump logs have been wiped out, we could also
-use amfetchdump to inventory our tapes and recreate an imitation of those logs,
-which we'll send to stdout for casual perusal.
-
-$ amfetchdump -i - SetA
-Note that you can specify a restore while in inventory mode, and amfetchdump
-will continue searching for more dumps from this host even after successfully
-restoring a dump, inventorying all the while. If your backup searcher has been
-trashed, this is a handy way to recover what you have.
-
-$ amfetchdump -i /var/amanda/log SetA backupserver
-
-CAVEATS
-
-Amfetchdump is dependent on accessing your server's config, tape changer, and
-(normally) dump logs. As such, it's not necessarily the most useful tool when
-those have all been wiped out and you desperately need to pull things from your
-tape. Pains have been taken to make it as capable as possible, but for
-seriously minimialist restores, look to amrestore(8) or dd(8) instead.
-
-AUTHOR
-
-John Stange, <building@nap.edu>, National Academies Press
-Ian Turner, <ian@zmanda.com>: XML-conversion
-
-SEE ALSO
-
-amanda(8), amadmin(8), amrestore(8), tar(1) restore(8)
--------------------------------------------------------------------------------
-
-Prev     Up      Next
-amdump  Home  amflush
-
diff --git a/docs/amflush.8.txt b/docs/amflush.8.txt
deleted file mode 100644 (file)
index df6d970..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-
-                              amflush
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amflush \14 flush Amanda backup files from holding disk to tape
-
-Synopsis
-
-amflush [-b] [-f] [-s] [-D datestamp] config [ host [disk...] ...] [ -
-o configoption]...
-
-DESCRIPTION
-
-Amflush writes Amanda backups from the holding disks to tape, and updates the
-Amanda info database and tapelist accordingly. Backups may stay in a holding
-disk when something is wrong with the tape at the time amdump is run. When this
-happens, the problem must be corrected and amflush run by hand.
-
-OPTIONS
-
-
-
-  -b
-      Run amflush in batch mode. All datestamps are selected unless specified.
-      The flush is started without confirmation.
-
-  -f
-      Run amflush in foreground. Amflush normally detaches itself from the tty
-      and runs as a background process. With the -f option, amflush stays in
-      the foreground. This is useful if amflush is run as part of another
-      script that, for example, advances the tape after the flush is completed.
-
-  -s
-      Write log to stdout/stderr instead of the amflush log file. Requires the
-      -f option.
-
-  -D datestamp
-      specify a datestamp expression you want to flush, see the "DATESTAMP
-      EXPRESSION" section of amanda(8) for a description. -D 20001225-7 will
-      flush all dumps from 25 december 2000 to 27 december 2000.
-
-  host [disk]*
-      Specify the host and disk on which the command will work.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-You can specify many host/disk expressions, only disks that match an expression
-will be flushed. All disks are flushed if no expressions are given. see the
-"HOST & DISK EXPRESSION" section of amanda(8) for a description.
-Amflush will look in the holding disks specified by the amanda.conf file in /
-usr/local/etc/amanda/config for any non-empty Amanda work directories. It then
-prompts you to select a directory or to process all of the directories. The
-work directories in the holding disks are named by the date at the time amdump
-was run, e.g. 19910215.
-See the amanda(8) man page for more details about Amanda.
-
-EXAMPLE
-
-Amflush will search for holding areas associated with the daily configuration.
-After you select which holding area to flush, amflush writes the data to tape,
-updates the databases and sends a mail report similar to amdump(8).
-
-  % amflush daily
-  Scanning /amanda-hold...
-    20001113: found Amanda directory.
-    20001114: found Amanda directory.
-
-  Multiple Amanda directories, please pick one by letter:
-    A. 20001113
-    B. 20001114
-  Select directories to flush [A..B]: [ALL] all
-
-  Flushing dumps in 20001113, 20001114,
-  today: 20001117
-  to tape drive /dev/rmt/0mn.
-  Expecting tape DMP014 or a new tape.  (The last dumps were to tape DMP013)
-  Are you sure you want to do this? yes
-  Running in background, you can log off now.
-  You'll get mail when amflush is finished.
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amdump(8)
--------------------------------------------------------------------------------
-
-Prev          Up        Next
-amfetchdump  Home  amgetconf
-
diff --git a/docs/amgetconf.8.txt b/docs/amgetconf.8.txt
deleted file mode 100644 (file)
index af20932..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-
-                             amgetconf
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amgetconf \14 look up amanda.conf variables
-
-Synopsis
-
-amgetconf [config] [--list] parameter [ -o configoption]...
-
-DESCRIPTION
-
-Amgetconf looks up parameters in amanda.conf, the Amanda configuration file, or
-from the build and runtime environment, and returns their corresponding value.
-If config is not specified, amgetconf assumes it is being run from the
-configuration directory and that amanda.conf is present.
-If parameter begins with build., the (case insensitive) string following the
-period is a build environment variable. Variables without a value (e.g. XFSDUMP
-on a system that does not support that type of file system) will not report an
-error and will return an empty string as the value. Flag variables (e.g.
-USE_AMANDAHOSTS) will return 1 if the flag is set or an empty string if it is
-not.
-If parameter begins with dbopen., the string following the period is a program
-name and an Amanda debug file will be created for the caller. The name of the
-file is returned.
-If parameter begins with dbclose., the string following the period is a program
-name previously used with dbopen., followed by a colon (:) and the previously
-opened file name.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  --list
-      The parameter must be 'tapetype', 'dumptype, 'holdingdisk' or
-      'interface'. It will output, one by line, the list of identifier for the
-      parameter.
-
-
-        --list tapetype
-            Output the list of tapetype, one by line.
-
-        --list dumptype
-            Output the list of dumptype, one by line.
-
-        --list holdingdisk
-            Output the list of holdingdisk, one by line.
-
-        --list interface
-            Output the list of interface, one by line.
-
-
-  parameter
-      It could be one of the below format:
-
-
-        runtapes
-
-        DUMPTYPE:no-compress:compress
-
-        TAPETYPE:HP-DAT:length
-
-        INTERFACE:local:use
-
-        HOLDINGDISK:hd1:use
-
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLE
-
-Find out the path to the log file directory:
-
-% amgetconf daily logdir
-/usr/local/etc/amanda//daily
-Find out the current tape type:
-
-% amgetconf daily tapetype
-DLT4000-IV
-Find out the default configuration directory:
-
-% amgetconf daily build.CONFIG_DIR
-/usr/local/etc/amanda/
-Create, use and close a debug file in a script:
-
-% set debug_file = `amgetconf daily dbopen.myscript`
-% echo debug information >> $debug_file
-% amgetconf daily dbclose.myscript:$debug_file
-
-MESSAGES
-
-
-
-  amgetconf: no such parameter param
-      Parameter param is not a known keyword (e.g. not a valid amanda.conf
-      keyword).
-
-
-SEE ALSO
-
-amanda(8)
--------------------------------------------------------------------------------
-
-Prev      Up      Next
-amflush  Home  amlabel
-
diff --git a/docs/amlabel.8.txt b/docs/amlabel.8.txt
deleted file mode 100644 (file)
index 89a0985..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-
-                              amlabel
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amlabel \14 label an Amanda tape
-
-Synopsis
-
-amlabel [-f ] config label [slot slot] [ -o configoption]...
-
-DESCRIPTION
-
-All Amanda tapes must be pre-labeled before they are used. Amanda verifies the
-label in amdump and amflush before writing to make sure the proper tape is
-loaded.
-Amlabel writes an Amanda label on the tape in the device specified by the
-amanda.conf file in /usr/local/etc/amanda/config. Label may be any string that
-does not contain whitespace and that matches the amanda.conf labelstr regular
-expression option. It is up to the system administrator to define a naming
-convention.
-Amlabel appends the new tape to the tapelist file so it will be used by Amanda
-before it reuses any other tapes. When you amlabel multiple tapes, they will be
-used in the order you amlabel them.
-Amlabel will not write the label if the tape contains an active Amanda tape or
-if the label specified is on an active tape. The -f (force) flag bypasses these
-verifications.
-An optional slot may be specified after the tape label. If a tape changer is in
-use, amlabel will label the tape in the specified slot instead of the currently
-loaded tape.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLE
-
-Write an Amanda label with the string "DMP000" on the tape loaded in the device
-named in the tapedev option in /usr/local/etc/amanda/daily/amanda.conf:
-
-  % amlabel daily DMP000
-
-Label the tape in slot 3 of the currently configured tape changer with the
-string "DMP003":
-
-  % amlabel daily DMP003 slot 3
-
-
-MESSAGES
-
-
-
-  label label doesn't match labelstr str
-      Label label on the command line does not match the labelstr regular
-      expression str from amanda.conf.
-
-  label label already on a tape
-      Label label is already listed as an active Amanda tape.
-
-  no tpchanger specified in path , so slot command invalid
-      The command line has the slot parameter but the amanda.conf file in path
-      does not have a tape changer configured.
-
-  reading label label, tape is in another amanda configuration
-      This tape appears to be a valid Amanda tape, but label does not match
-      labelstr for this configuration so it is probably part of a different
-      Amanda configuration.
-
-  reading label label, tape is active
-      Tape label appears to already be part of this Amanda configuration and
-      active, i.e. has valid data on it.
-
-  no label found, are you sure tape is non-rewinding?
-      While checking that the label was written correctly, amlabel got an error
-      that might be caused by mis-configuring Amanda with a rewinding tape
-      device name instead of a non-rewinding device name for tape.
-
-
-AUTHOR
-
-James da Silva, <jds@amanda.org>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8) amdump(8) amflush(8)
--------------------------------------------------------------------------------
-
-Prev        Up   Next
-amgetconf  Home  ammt
-
diff --git a/docs/ammt.8.txt b/docs/ammt.8.txt
deleted file mode 100644 (file)
index 353ef27..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-
-                                 ammt
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-ammt \14 Amanda version of mt
-
-Synopsis
-
-ammt [-d ] [ -f | -t | device ] command [count]
-
-DESCRIPTION
-
-Ammt provides just enough of the standard UNIX mt command for the needs of
-Amanda. This is handy when doing a full restore and the standard mt program has
-not yet been found.
-Ammt also provides access to the Amanda output drivers that support various
-tape simulations.
-See the amanda(8) man page for more details about Amanda. See the OUTPUT
-DRIVERS section of amanda(8) for more information on the Amanda output drivers.
-
-OPTIONS
-
-
-
-  -d
-      Turn on debugging output.
-
-  -fdevice
-      Access tape device device. If not specified, the TAPE environment
-      variable is used.
-
-  -tdevice
-      Same as -f.
-
-  commandcount
-      Which command to issue, and an optional count of operations.
-
-
-COMMANDS
-
-Each command may be abbreviated to whatever length makes it unique.
-
-
-  eof|weofcount
-      Write count (default: 1) end of file marks (tapemarks).
-
-  fsfcount
-      Skip forward count (default: 1) files.
-
-  bsfcount
-      Skip backward count (default: 1) files.
-
-  asfcount
-      Position to file number count (default: 0) where zero is beginning of
-      tape. This is the same as a rewind followed by a fsf count.
-
-  rewind
-      Rewind to beginning of tape.
-
-  offline|rewoffl
-      Rewind to beginning of tape and unload the tape from the drive.
-
-  status
-      Report status information about the drive. Which data reported, and what
-      it means, depends on the underlying operating system, and may include:
-
-
-        ONLINE
-            Indicates the drive is online and ready.
-
-        OFFLINE
-            Indicates the drive is offline or not ready.
-
-        BOT
-            Indicates the drive is at beginning of tape.
-
-        EOT
-            Indicates the drive is at end of tape.
-
-        PROTECTED
-            Indicates the tape is write protected.
-
-        ds
-            Device status.
-
-        er
-            Error register.
-
-        fileno
-            Current tape file number.
-
-        blkno
-            Current tape block number file.
-
-
-
-Note
-
-Many systems only report good data when a tape is in the drive and ready.
-
-AUTHOR
-
-Marc Mengel <mengel@fnal.gov>, John R. Jackson <jrj@purdue.edu>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8)
--------------------------------------------------------------------------------
-
-Prev      Up         Next
-amlabel  Home  amoverview
-
diff --git a/docs/amoverview.8.txt b/docs/amoverview.8.txt
deleted file mode 100644 (file)
index a5f93e6..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-
-                            amoverview
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amoverview \14 display file systems processed by Amanda over time
-
-Synopsis
-
-amoverview [[-config ] config ] [-hostwidth width] [-diskwidth width] [-
-skipmissed] [-last] [-num0] [-togo0] [-verbose]
-
-DESCRIPTION
-
-Amoverview displays a chart showing hosts and file systems processed by Amanda
-along with the backup level performed each day.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -config config
-      Use configuration config instead of configuration daily.
-
-  -hostwidth width
-      Set host field column width to width characters instead of 8.
-
-  -diskwidth width
-      Set disk field column width to width characters instead of 20.
-
-  -skipmissed
-      Compacts the output by only printing stats for the days Amanda actually
-      ran.
-
-  -last
-      Outputs the last status of each disk at the start. Useful for long
-      tapecycles and/or sparse reports.
-
-  -num0
-      Outputs the number of level 0 dumps for each disk.
-
-  -togo0
-      Outputs the number of runs until the last level 0 dump is overwritten.
-
-  -verbose
-      Amoverview can take a long while on large systems. This option reports
-      intermediate steps while it is working.
-
-
-RESULTS
-
-amoverview is a summary of the output of " amadmin <config> find ". When the
-last column of amadmin find contains anything other than "OK", amoverview
-translates this into "E" for that day.
-A number indicates the level of backup and it succeeded. An "E" indicates an
-error for that day. You get an "E" for all errors, like failed to connect,
-datatimeout, computer crashed, etc, but also for failing to write to tape.
-You can have an "E" followed by a number if a filesystem ran into end-of-tape
-once (gives an "E", and later that day, you flush it to a second tape (a
-number: the level, indicating success). If the flush failed too, you get a
-double "EE" for that day.
-You can also have a double code if you have two tapes in the changer and Amanda
-failed to write to tape the first time because it hit end of tape (resulting in
-"E0", for a full, "E1" for an incremental etc.) or twice with error ("EE"), and
-may a successful flush afterwards giving maybe "EE0". (Only the latest 2
-characters are printed).
-
-EXAMPLE
-
-This shows the /home file system on host2 was backed up at level 3 on the 8th,
-9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th
-and a level 2 on the 13th.
-
-  # amoverview
-                           date 12 12 12 12 12 12
-  host     disk                 08 09 10 11 12 13
-
-  host1    /                     0  1  1  1  1  1
-  host1    /var                  0  1  1  1  1  1
-  host2    /                     1  1  1  1  1  0
-  host2    /home                 3  3  3  0  1  2
-  host2    /opt                  1  1  1  1  1  1
-  host2    /var                  1  1  0  1  1  1
-
-
-SEE ALSO
-
-amadmin(8), amanda(8)
--------------------------------------------------------------------------------
-
-Prev   Up     Next
-ammt  Home  amplot
-
diff --git a/docs/amplot.8.txt b/docs/amplot.8.txt
deleted file mode 100644 (file)
index bba73ea..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-
-                               amplot
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amplot \14 visualize the behavior of Amanda
-
-Synopsis
-
-amplot [-b ] [-c ] [-e ] [-g ] [-l ] [-p ] [ -t T ] amdump_files
-
-DESCRIPTION
-
-Amplot reads an amdump output file that Amanda generates each run (e.g.
-amdump.1) and translates the information into a picture format that may be used
-to determine how your installation is doing and if any parameters need to be
-changed. Amplot also prints out amdump lines that it either does not understand
-or knows to be warning or error lines and a summary of the start, end and total
-time for each backup image.
-Amplot is a shell script that executes an awk program (amplot.awk) to scan the
-amdump output file. It then executes a gnuplot program (amplot.g) to generate
-the graph. The awk program is written in an enhanced version of awk, such as
-GNU awk (gawk version 2.15 or later) or nawk.
-During execution, amplot generates a few temporary files that gnuplot uses.
-These files are deleted at the end of execution.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -b
-      Generate b/w postscript file (need -p).
-
-  -c
-      Compress amdump_files after plotting.
-
-  -e
-      Extend the X (time) axis if needed.
-
-  -g
-      Direct gnuplot output directly to the X11 display (default).
-
-  -p
-      Direct postscript output to file YYYYMMDD.ps (opposite of -g).
-
-  -l
-      Generate landscape oriented output (needs -p).
-
-  -tT
-      Set the right edge of the plot to be T hours.
-
-The amdump_files may be in various compressed formats (compress, gzip, pact,
-compact).
-
-INTERPRETATION
-
-The figure is divided into a number of regions. There are titles on the top
-that show important statistical information about the configuration and from
-this execution of amdump. In the figure, the X axis is time, with 0 being the
-moment amdump was started. The Y axis is divided into 5 regions:
-QUEUES: How many backups have not been started, how many are waiting on space
-in the holding disk and how many have been transferred successfully to tape.
-%BANDWIDTH: Percentage of allowed network bandwidth in use.
-HOLDING DISK: The higher line depicts space allocated on the holding disk to
-backups in progress and completed backups waiting to be written to tape. The
-lower line depicts the fraction of the holding disk containing completed
-backups waiting to be written to tape including the file currently being
-written to tape. The scale is percentage of the holding disk.
-TAPE: Tape drive usage.
-%DUMPERS: Percentage of active dumpers.
-The idle period at the left of the graph is time amdump is asking the machines
-how much data they are going to dump. This process can take a while if hosts
-are down or it takes them a long time to generate estimates.
-
-AUTHOR
-
-Olafur Gudmundsson <ogud@tis.com>, Trusted Information Systems, formerly at
-University of Maryland, College Park: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-BUGS
-
-Reports lines it does not recognize, mainly error cases but some are legitimate
-lines the program needs to be taught about.
-
-SEE ALSO
-
-amanda(8), amdump(8), gawk(1), nawk(1), awk(1), gnuplot(1), sh(1), compress(1),
-gzip(1)
--------------------------------------------------------------------------------
-
-Prev         Up        Next
-amoverview  Home  amrecover
-
diff --git a/docs/amrecover.8.txt b/docs/amrecover.8.txt
deleted file mode 100644 (file)
index b0f5373..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-
-                             amrecover
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amrecover \14 Amanda index database browser
-
-Synopsis
-
-amrecover [-C config] [-s index-server] [-t tape-server] [-d tape-device] [ -
-o configoption]...
-
-DESCRIPTION
-
-Amrecover browses the database of Amanda index files to determine which tapes
-contain files to recover. Furthermore, it is able to recover files.
-In order to restore files in place, you must invoke amrecover from the root of
-the backed up filesystem, or use lcd to move into that directory, otherwise a
-directory tree that resembles the backed up filesystem will be created in the
-current directory. See the examples below for details.
-Amrecover will read the amanda-client.conf file and the config/amanda-
-client.conf file.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-Note
-
-The Default values are those set at compile-time. Use amrestore to recover
-client-encrypted or client-custom-compressed tapes.
-
-
-  [ -C ] config
-      Amanda configuration.
-
-  -s index-server
-      Host that runs the index daemon.
-
-  -t tape-server
-      Host that runs the tape server daemon.
-
-  -d tape-device
-      Tape device to use on the tape server host.
-
-  -o clientconfigoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-COMMANDS
-
-Amrecover connects to the index server and then presents a command line prompt.
-Usage is similar to an ftp client. The GNU readline library is used to provide
-command line history and editing if it was built in to amrecover.
-The purpose of browsing the database is to build up a restore list of files to
-be extracted from the backup system. The following commands are available:
-
-
-  sethost hostname
-      Specifies which host to look at backup files for (default: the local
-      host).
-
-  setdate YYYY-MM-DD-HH-MM[-SS] | YYYY-MM-DD
-      Set the restore time (default: now). File listing commands only return
-      information on backup images for this day, for the day before with the
-      next lower dump level, and so on, until the most recent level 0 backup on
-      or before the specified date is encountered.
-      For example, if:
-
-      1996-07-01 was a level 0 backup
-      1996-07-02 through 1996-07-05 were level 1 backups
-      1996-07-06 through 1997-07-08 were level 2 backups
-      then the command setdate 1997-07-08-00 would yield files from the
-      following days:
-
-      1997-07-08 (the latest level 2 backup)
-      1997-07-05 (the latest level 1 backup)
-      1997-07-01 (the latest level 0 backup)
-      Only the most recent version of a file will be presented.
-      The following abbreviated date specifications are accepted:
-
-
-        --MM-DD
-            dates in the current year
-
-        ---DD
-            dates in the current month of the current year
-
-
-
-
-  setdisk diskname [mountpoint]
-      Specifies which disk to consider (default: the disk holding the working
-      directory where amrecover is started). It can only be set after the host
-      is set with sethost. Diskname is the device name specified in the
-      amanda.conf or disklist configuration file. The disk must be local to the
-      host. If mountpoint is not specified, all pathnames will be relative to
-      the (unknown) mount point instead of full pathnames.
-
-  listhost [diskdevice]
-      List all host
-
-  listdisk [diskdevice]
-      List all diskname
-
-  settape [[server]:][tapedev|default]
-      Specifies the host to use as the tape server, and which of its tape
-      devices to use. If the server is omitted, but the colon is not, the
-      server name reverts to the configure-time default. If the tape device is
-      omitted, it remains unchanged. To use the default tape device selected by
-      the tape server, the word default must be specified. If no argument is
-      specified, or the argument is an empty string, no changes occur, and the
-      current settings are displayed.
-      If you want amrecover to use your changer, the tapedev must be equal to
-      the amrecover_changer setting on the server.
-      If you need to change the protocol (tape:, rait:, file:, null:) then you
-      must specify the hostname.
-
-        settape 192.168.0.10:file:/file1
-
-      You can change the tape device when amrecover ask you to load the tape:
-
-        Load tape DMP014 now
-        Continue? [Y/n/t]: t
-        Tape device: server2:/dev/nst2
-        Continue? [Y/n/t]: Y
-        Using tape /dev/nst2 from server server2.
-
-
-
-
-  setmode mode
-      Set the extraction mode for Samba shares. If mode is smb, shares are sent
-      to the Samba server to be restored back onto the PC. If mode is tar, they
-      are extracted on the local machine the same way tar volumes are
-      extracted.
-
-  mode
-      Displays the extracting mode for Samba shares.
-
-  history
-      Show the backup history of the current host and disk. Dates, levels,
-      tapes and file position on tape of each backup are displayed.
-
-  pwd
-      Display the name of the current backup working directory.
-
-  cd dir
-      Change the backup working directory to dir. If the mount point was
-      specified with setdisk, this can be a full pathname or it can be relative
-      to the current backup working directory. If the mount point was not
-      specified, paths are relative to the mount point if they start with "/",
-      otherwise they are relative to the current backup working directory. The
-      dir can be a shell style wildcards.
-
-  cdx dir
-      Like the cd command but allow regular expression.
-
-  lpwd
-      Display the amrecover working directory. Files will be restored under
-      this directory, relative to the backed up filesystem.
-
-  lcd path
-      Change the amrecover working directory to path.
-
-  ls
-      List the contents of the current backup working directory. See the
-      description of the setdate command for how the view of the directory is
-      built up. The backup date is shown for each file.
-
-  add item1 item2 ...
-      Add the specified files or directories to the restore list. Each item may
-      have shell style wildcards.
-
-  addx item1 item2 ...
-      Add the specified files or directories to the restore list. Each item may
-      be a regular expression.
-
-  delete item1 item2 ...
-      Delete the specified files or directories from the restore list. Each
-      item may have shell style wildcards.
-
-  deletex item1 item2 ...
-      Delete the specified files or directories from the restore list. Each
-      item may be a regular expression.
-
-  list file
-      Display the contents of the restore list. If a file name is specified,
-      the restore list is written to that file. This can be used to manually
-      extract the files from the Amanda tapes with amrestore.
-
-  clear
-      Clear the restore list.
-
-  quit
-      Close the connection to the index server and exit.
-
-  exit
-      Close the connection to the index server and exit.
-
-  extract
-      Start the extract sequence (see the examples below). Make sure the local
-      working directory is the root of the backed up filesystem, or another
-      directory that will behave like that. Use lpwd to display the local
-      working directory, and lcd to change it.
-
-  help
-      Display a brief list of these commands.
-
-
-EXAMPLES
-
-The following shows the recovery of an old syslog file.
-
-  # cd /var/log
-  # ls -l syslog.7
-  syslog.7: No such file or directory
-  # amrecover
-  AMRECOVER Version 2.4.2. Contacting server on oops ...
-  220 oops Amanda index server (2.4.2) ready.
-  Setting restore date to today (1997-12-09)
-  200 Working date set to 1997-12-09.
-  200 Config set to daily.
-  200 Dump host set to this-host.some.org.
-  $CWD '/var/log' is on disk '/var' mounted at '/var'.
-  200 Disk set to /var.
-  /var/log
-  WARNING: not on root of selected filesystem, check man-page!
-  amrecover> ls
-  1997-12-09 daemon.log
-  1997-12-09 syslog
-  1997-12-08 authlog
-  1997-12-08 sysidconfig.log
-  1997-12-08 syslog.0
-  1997-12-08 syslog.1
-  1997-12-08 syslog.2
-  1997-12-08 syslog.3
-  1997-12-08 syslog.4
-  1997-12-08 syslog.5
-  1997-12-08 syslog.6
-  1997-12-08 syslog.7
-  amrecover> add syslog.7
-  Added /log/syslog.7
-  amrecover> lpwd
-  /var/log
-  amrecover> lcd ..
-  /var
-  amrecover> extract
-
-  Extracting files using tape drive /dev/nst0 on host 192.168.0.10
-
-  The following tapes are needed: DMP014
-
-  Restoring files into directory /var
-  Continue? [Y/n]: y
-
-  Load tape DMP014 now
-  Continue? [Y/n/t]: y
-  set owner/mode for '.'? [yn] n
-  amrecover> quit
-  200 Good bye.
-  # ls -l syslog.7
-  total 26
-  -rw-r--r--   1 root     other      12678 Oct 14 16:36 syslog.7
-
-If you do not want to overwrite existing files, create a subdirectory to run
-amrecover from and then move the restored files afterward.
-
-  # cd /var
-  # (umask 077 ; mkdir .restore)
-  # cd .restore
-  # amrecover
-  AMRECOVER Version 2.4.2. Contacting server on oops ...
-  ...
-  amrecover> cd log
-  /var/log
-  amrecover> ls
-  ...
-  amrecover> add syslog.7
-  Added /log/syslog.7
-  amrecover> lpwd
-  /var/.restore
-  amrecover> extract
-
-  Extracting files using tape drive /dev/nst0 on host 192.168.0.10
-  ...
-  amrecover> quit
-  200 Good bye.
-  # mv -i log/syslog.7 ../log/syslog.7-restored
-  # cd ..
-  # rm -fr .restore
-
-If you need to run amrestore by hand instead of letting amrecover control it,
-use the list command after browsing to display the needed tapes.
-
-  # cd /var/log
-  # amrecover
-  AMRECOVER Version 2.4.2. Contacting server on oops ...
-  ...
-  amrecover> ls
-  ...
-  amrecover> add syslog syslog.6 syslog.7
-  Added /log/syslog
-  Added /log/syslog.6
-  Added /log/syslog.7
-  amrecover> list
-  TAPE DMP014 LEVEL 0 DATE 1997-12-08
-          /log/syslog.7
-          /log/syslog.6
-  TAPE DMP015 LEVEL 1 DATE 1997-12-09
-          /log/syslog
-  amrecover> quit
-
-The history command shows each tape that has a backup of the current disk along
-with the date of the backup, the level, the tape label and the file position on
-the tape. All active tapes are listed, not just back to the most recent full
-dump.
-Tape file position zero is a label. The first backup image is in file position
-one.
-
-  # cd /var/log
-  # amrecover
-  AMRECOVER Version 2.4.2. Contacting server on oops ...
-  ...
-  amrecover> history
-  200- Dump history for config "daily" host "this-host.some.org" disk "/var"
-  201- 1997-12-09 1 DMP015 9
-  201- 1997-12-08 1 DMP014 11
-  201- 1997-12-07 0 DMP013 22
-  201- 1997-12-06 1 DMP012 16
-  201- 1997-12-05 1 DMP011 9
-  201- 1997-12-04 0 DMP010 11
-  201- 1997-12-03 1 DMP009 7
-  201- 1997-12-02 1 DMP008 7
-  201- 1997-12-01 1 DMP007 9
-  201- 1997-11-30 1 DMP006 6
-  ...
-  amrecover> quit
-
-
-ENVIRONMENT
-
-PAGER The ls and list commands will use $PAGER to display the file lists.
-Defaults to more if PAGER is not set.
-AMANDA_SERVER If set, $AMANDA_SERVER will be used as index-server. The value
-will take precedence over the compiled default, but will be overridden by the -
-s switch.
-AMANDA_TAPE_SERVER If set, $AMANDA_TAPE_SERVER will be used as tape-server. The
-value will take precedence over the compiled default, but will be overridden by
-the -t switch.
-
-AUTHOR
-
-Alan M. McIvor <alan@kauri.auck.irl.cri.nz> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amanda-client.conf(5), amrestore(8), amfetchdump(8), readline(3)
--------------------------------------------------------------------------------
-
-Prev     Up       Next
-amplot  Home  amreport
-
diff --git a/docs/amreport.8.txt b/docs/amreport.8.txt
deleted file mode 100644 (file)
index 21c0b0c..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-
-                              amreport
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amreport \14 generate a formatted output of statistics for an Amanda run
-
-Synopsis
-
-amreport [config] [-i] [-M address] [-l logfile] [-f outputfile] [-
-p postscriptfile] [ -o configoption]...
-
-DESCRIPTION
-
-Amreport generates a summary report of an amanda(8) backup run. If no
-configuration name is specified, amanda.conf is read from the current
-directory.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  config
-      Name of the configuration to process.
-
-  -i
-      Don't email the report.
-
-  -M address
-      Mail the report to address instead of the mailto value from amanda.conf.
-
-  -l logfile
-      Name of the log file to parse to generate the report. If a log file is
-      not specified, it defaults to the file:
-
-logdir/log
-where logdir is the log directory defined in amanda.conf.
-
-
-  -f outputfile
-      Normally, amreport sends the report via e-mail to the mailto user as
-      defined in the amanda.conf file. If outputfile is specified, then the
-      report is put in outputfile.
-
-  -p postscriptfile
-      Send the postscript output to the file postscriptfile instead of to the
-      lpr(1) command. This option has an effect only if the lbl-templ directive
-      is specified in amanda.conf.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-LABEL PRINTING
-
-Amanda can print postscript labels describing the contents of tape(s) written
-in a run. The labels are designed to be folded and inserted into the tape case
-along with the tape or hole punched and put in a 3-ring binder. Various label
-templates are provided to format data for different tape sizes.
-The information printed varies slightly between label templates due to size
-constraints. Labels contain one line for each host/file-system pair and may
-also contain the file number on the tape, the level of the dump, the original
-size of the dump and the size of the (possibly compressed) tape file.
-Add the lbl-templ parameter to the tapetype definition in amanda.conf to enable
-labels. If you don't add this line to your tapetype definition, amreport will
-not print tape labels.
-You may use the remap='I'>printer keyword in amanda.conf to print to other than
-the system default printer.
-
-TEMPLATES
-
-Amanda provides label templates for the following tape types. These are pretty
-generic labels and should be easy to customize for other tape types or
-particular site needs.
-
-* ExaByte 8mm tapes
-* DAT 4mm tapes
-* DLT tapes
-* 3-ring binder
-The 3-ring binder type is the most generic. It may be used to make a hardcopy
-log of the tapes.
-
-SEE ALSO
-
-amanda(8), amflush(8)
--------------------------------------------------------------------------------
-
-Prev        Up        Next
-amrecover  Home  amrestore
-
diff --git a/docs/amrestore.8.txt b/docs/amrestore.8.txt
deleted file mode 100644 (file)
index 2d8add1..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-
-                             amrestore
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amrestore \14 extract backup images from an Amanda tape
-
-Synopsis
-
-amrestore [ -r | -c | -C ] [ -b | blocksize ] [ -f | fileno ] [ -l | label ] [-
-p] [-h] tapedevice | holdingfile [ hostname [ diskname [ datestamp [ hostname
-[ diskname [ datestamp | ... ]]]]]]
-
-DESCRIPTION
-
-Amrestore extracts backup images from the tape mounted on tapedevice or from
-the holding disk file holdingfile that match hostname, diskname and datestamp
-patterns given on the command line. The tape or holding file must be in a
-format written by the amdump or amflush program.
-If diskname is not specified, all backups on the tape for the previous hostname
-are candidates. If datestamp is not specified, all backups on the tape for the
-previous hostname and diskname are candidates. If no hostname, diskname or
-datestamp are specified, every backup on the tape is a candidate.
-Hostname and diskname are special expressions described in the "HOST & DISK
-EXPRESSION" section of amanda(8). Datestamp are special expression described in
-the "DATESTAMP EXPRESSION" section of amanda(8). For example, if diskname is
-"rz[23]a", it would match disks rz2a and rz3a.
-Datestamp is useful if amflush writes multiple backup runs to a single tape.
-Unless -p is used, candidate backup images are extracted to files in the
-current directory named:
-hostname.diskname.datestamp.dumplevel
-Amrestore doesn't use a changer, it restore from the tape already loaded in the
-tapedevice.
-
-OPTIONS
-
-
-
-  -b
-      Set the blocksize used to read the tape or holding file. All holding
-      files must be read with a blocksize of 32 KBytes. Amrestore should
-      normally be able to determine the blocksize for tapes on its own and not
-      need this parameter.
-
-The default is 32 KBytes.
-
-
-  -f
-      Do a rewind followed by a fsf <fileno> before trying to restore an image.
-
-  -l
-      Check if we restoring from the tape with the right label
-
-  -p
-      Pipe output. The first matching backup image is sent to standard output,
-      which is normally a pipe to restore or tar, then amrestore quits. It may
-      be run again to continue selecting backups to process. Make sure you
-      specify the no-rewind tapedevice when doing this.
-
-Note: restore may report "short read" errors when reading from a pipe. Most
-versions of restore support a blocking factor option to let you set the read
-block size, and you should set it to 2. See the example below.
-
-
-  -c
-      Compress output using the fastest method the compression program
-      provides. Amrestore normally writes output files in a format understood
-      by restore or tar, even if the backups on the tape are compressed. With
-      the -c or -C option, amrestore writes all files in compressed format,
-      even if the backups on the tape are not compressed. Output file names
-      will have a .Z or .gz extension depending on whether compress or gzip is
-      the preferred compression program. This option is useful when the current
-      directory disk is small.
-
-  -C
-      Compress output using the best method the compression program provides
-      (may be very CPU intensive). See the notes above about the -c option.
-
-  -r
-      Raw output. Backup images are output exactly as they are on the tape,
-      including the amdump headers. Output file names will have a .RAW
-      extension. This option is only useful for debugging and other strange
-      circumstances.
-
-  -h
-      Header output. The tape header block is output at the beginning of each
-      file. This is like -r except -c or -C may also be used to compress the
-      result. Amrecover uses the header to determine the restore program to
-      use.
-
-If a header is written (-r or -h), only 32 KBytes are output regardless of the
-tape blocksize. This makes the resulting image usable as a holding file.
-
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-
-EXAMPLES
-
-The following does an interactive restore of disk rz3g from host seine, to
-restore particular files. Note the use of the b option to restore, which causes
-it to read in units of two 512-byte blocks (1 Kbyte) at a time. This helps keep
-it from complaining about short reads.
-
-% amrestore -p /dev/nrmt9 seine rz3g | restore -ivbf 2 -
-The next example extracts all backup images for host seine. This is the usual
-way to extract all data for a host after a disk crash.
-
-% amrestore /dev/nrmt9 seine
-If the backup datestamp in the above example is 19910125 and seine has level 0
-backups of disks rz1a and rz1g on the tape, these files will be created in the
-current directory:
-
-seine.rz1a.19910125.0
-seine.rz1g.19910125.0
-You may also use amrestore to extract a backup image from a holding disk file
-that has not yet been flushed to tape:
-
-% amrestore -p /amanda/20001119/seine.rz1a.2 | restore -ivbf 2 -
-Amrestore may be used to generate a listing of images on a tape:
-
-% mt -f /dev/nrmt9 rewind
-% amrestore -p /dev/nrmt9 no-such-host > /dev/null
-This asks amrestore to find images for host no-such-host. It will not find any
-entries that match, but along the way will report each image it skips.
-
-CAVEATS
-
-GNU-tar must be used to restore files from backup images created with the
-GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images.
-
-AUTHOR
-
-James da Silva, <jds@amanda.org>, University of Maryland, College Park:
-Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8), amdump(8), amflush(8), tar(1) restore(8)
--------------------------------------------------------------------------------
-
-Prev       Up       Next
-amreport  Home  amrmtape
-
diff --git a/docs/amrmtape.8.txt b/docs/amrmtape.8.txt
deleted file mode 100644 (file)
index ffe340a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-                              amrmtape
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amrmtape \14 remove a tape from the Amanda database
-
-Synopsis
-
-amrmtape [-n ] [-v ] [-q ] [-d ] config label
-
-DESCRIPTION
-
-Amrmtape invalidates the contents of an existing backup tape in the
-configuration database. This is meant as a recovery mechanism when a good
-backup is damaged either by faulty hardware or user error, e.g. the tape is
-eaten by the drive or is overwritten.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-
-
-  -n
-      Generate new tapelist and database files with label removed, but leave
-      them in /tmp and do not update the original copies.
-
-  -v
-      List backups of hosts and disks that are being discarded. Enabled by
-      default.
-
-  -q
-      Opposite of -v.
-
-  -d
-      Run in debugging mode so all executed commands are shown.
-
-
-EXAMPLE
-
-Remove tape labeled DAILY034 from the DailySet1 configuration.
-
-  # amrmtape DailySet1 DAILY034
-
-
-AUTHOR
-
-Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>: Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amadmin(8), amanda(8)
--------------------------------------------------------------------------------
-
-Prev        Up       Next
-amrestore  Home  amstatus
-
diff --git a/docs/amstatus.8.txt b/docs/amstatus.8.txt
deleted file mode 100644 (file)
index 2f0e1c3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-
-                              amstatus
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amstatus \14 display the state of an Amanda run
-
-Synopsis
-
-amstatus [--config ] config [ --file amdumpfile ] [--summary ] [--dumping ] [--
-waitdumping ] [--waittaper ] [--dumpingtape ] [--writingtape ] [--finished ] [-
--failed ] [--estimate ] [--gestimate ] [--stats ]
-
-DESCRIPTION
-
-Amstatus gives the current state of the Amanda run specified by the config
-configuration. If there is no active Amanda running, it summarizes the result
-of the last run. It may also be used to summarize the results of a previous
-run.
-See the amanda(8) man page for more details about Amanda.
-
-OPTIONS
-
-All options may be abbreviated to the shortest non-ambiguous sub-string. If no
-options are given, everything is displayed.
-
-
-  [--config] config
-      Specify the Amanda configuration you want to display the state for.
-
-  --file amdumpfile
-      Specify an alternate file instead of the amdump or amflush file.
-
-  --summary
-      Display a summary of the state of the run.
-
-  --dumping
-      Display all partitions that are dumping.
-
-  --waitdumping|wdumping
-      Display all partitions that are waiting to be dumped.
-
-  --waittaper|wtaper
-      Display all partitions dumped that are waiting to be written to tape.
-
-  --dumpingtape|dtape
-      Display all partitions that are dumping directly to tape.
-
-  --writingtape|wtape
-      Display all partitions that are writing to tape.
-
-  --finished
-      Display all partitions that are dumped and written to tape.
-
-  --failed|error
-      Display all partitions that failed.
-
-  --estimate
-      Display all partitions whose estimate is finished. Works only during the
-      estimate phase.
-
-  --gestimate|gettingestimate
-      Display all partitions whose estimate is not finished. Works only during
-      the estimate phase.
-
-  --stats|statistics
-      Display statistics about active-time of taper and dumpers.
-
-
-SEE ALSO
-
-amanda(8), amcheck(8), amdump(8), amrestore(8), amadmin(8)
--------------------------------------------------------------------------------
-
-Prev       Up     Next
-amrmtape  Home  amtape
-
diff --git a/docs/amtape.8.txt b/docs/amtape.8.txt
deleted file mode 100644 (file)
index fe67380..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-
-                               amtape
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amtape \14 user interface to Amanda tape changer controls
-
-Synopsis
-
-amtape config command [command_options...] [-oconfigoption]...
-
-DESCRIPTION
-
-Amtape performs tape changer control operations. It uses the underlying tape
-changer script defined by the tpchanger option for a particular Amanda
-configuration as specified by the config argument.
-Tape changers maintain a notion of the current and next slot for each
-configuration. These may or may not correspond to an actual physical state of
-the device, but do tend to minimize searching through the tape storage slots.
-If the desired tape is in the current slot, it is likely the next tape needed
-is in the next slot rather than at some random position in the storage slots.
-See the amanda(8) man page for more details about Amanda.
-
-COMMANDS
-
-
-
-  reset
-      Reset the tape changer to a known state. The current slot is set to the
-      first slot. Other device-specific side effects may occur. Some gravity
-      stackers need to be reset to the top position by hand. This command
-      notifies Amanda the stacker is back in that position.
-
-  eject
-      If a tape is loaded in the drive, it is ejected and returned to the slot
-      from which it was loaded.
-
-  clean
-      If a cleaning tape is defined for the changer, it is used to clean the
-      drive.
-
-  show
-      Show the contents of all slots. This can be slow.
-
-  label label
-      Search for and load the Amanda tape with label label.
-
-  taper
-      Perform the taper scan algorithm. Load the next tape in the
-      configuration's tape sequence, or a fresh tape with a suitable label.
-
-  device
-      Display the name of the current tape device on stdout.
-
-  current
-      Display the current slot.
-
-  update
-      Update the changer label database, if it has one, to match the tapes now
-      available.
-
-  slot slot
-      Eject any tape in the drive and put it away, then load the tape from slot
-      slot and reset current.
-
-  slot current
-      Eject any tape in the drive and put it away, then load the tape from the
-      current slot.
-
-  slot prev
-      Eject any tape in the drive and put it away, then load the tape from the
-      previous slot and reset current.
-
-  slot next
-      Eject any tape in the drive and put it away, then load the tape from the
-      next slot and reset current.
-
-  slot first
-      Eject any tape in the drive and put it away, then load the tape from the
-      first slot and reset current.
-
-  slot last
-      Eject any tape in the drive and put it away, then load the tape from the
-      last slot and reset current.
-
-  slot advance
-      Eject any tape in the drive and put it away. Advance current to the next
-      tape, but do not load it.
-
-  -o configoption
-      See the "CONFIGURATION OVERRIDE" section in amanda(8).
-
-This is useful with non-gravity stackers to unload the last tape used and set
-up Amanda for the next run. If you just use eject, the current tape will be
-mounted again in the next run, where it will be rejected as being still in use,
-ejected and the next tape requested. Using slot next followed by eject does an
-unnecessary mount.
-Note: most changers optimize the slot commands to not eject the loaded tape if
-it is the one being requested.
-
-AUTHOR
-
-James da Silva, <jds@amanda.org> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amanda(8)
--------------------------------------------------------------------------------
-
-Prev       Up         Next
-amstatus  Home  amtapetype
-
diff --git a/docs/amtapetype.8.txt b/docs/amtapetype.8.txt
deleted file mode 100644 (file)
index 7813ddd..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-
-                            amtapetype
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amtapetype \14 generate a tapetype definition.
-
-Synopsis
-
-amtapetype [-h ] [-c ] [-o ] [-b blocksize] -e estsize [-f tapedev] [-
-t typename]
-
-DESCRIPTION
-
-amtapetype generates a tapetype entry for Amanda.
-
-OPTIONS
-
-
-
-  -h
-      Display an help message.
-
-  -c
-      Run only the hardware compression detection heuristic test and stop. This
-      takes a few minutes only.
-
-  -o
-      Overwrite the tape, even if it's an Amanda tape.
-
-  -bblocksize
-      record block size (default: 32k)
-
-  -eestsize
-      estimated tape size (No default!)
-
-  -ftapedev
-      tape device name (default: $TAPE) The device to perform the test.
-
-  -ttypename
-      tapetype name (default: unknown-tapetype)
-
-
-EXAMPLE
-
-Generate a tapetype definition for your tape device:
-
-% amtapetype -f /dev/nst0 -e 150G
-
-NOTES
-
-Hardware compression is detected by measuring the writing speed difference of
-the tape drive when writing an amount of compressable and uncompresseable data.
-It does not rely on the status bits of the tape drive or the OS parameters. If
-your tape drive has very large buffers or is very fast, the program could fail
-to detect hardware compression status reliably.
-During the first pass, it writes files that are estimated to be 1% of the
-expected tape capacity. It gets the expected capacity from the -e command line
-flag, or defaults to 1 GByte. In a perfect world (which means there is zero
-chance of this happening with tapes :-), there would be 100 files and 100 file
-marks.
-During the second pass, the file size is cut in half. In that same fairyland
-world, this means 200 files and 200 file marks.
-In both passes the total amount of data written is summed as well as the number
-of file marks written. At the end of the second pass, quoting from the code:
-* Compute the size of a filemark as the difference in data written between pass
-1 and pass 2 divided by the difference in number of file marks written between
-pass 1 and pass 2. ... *
-So if we wrote 1.0 GBytes on the first pass and 100 file marks, and 0.9 GBytes
-on the second pass with 200 file marks, those additional 100 file marks in the
-second pass took 0.1 GBytes and therefor a file mark is 0.001 GBytes (1 MByte).
-Note that if the estimated capacity is wrong, the only thing that happens is a
-lot more (or less, but unlikely) files, and thus, file marks, get written. But
-the math still works out the same. The -e flag is there to keep the number of
-file marks down because they can be slow (since they force the drive to flush
-all its buffers to physical media).
-All sorts of things might happen to cause the amount of data written to vary
-enough to generate a big file mark size guess. A little more "shoe shining"
-because of the additional file marks (and flushes), dirt left on the heads from
-the first pass of a brand new tape, the temperature/humidity changed during the
-multi-hour run, a different amount of data was written after the last file mark
-before EOT was reported, etc.
-Note that the file mark size might really be zero for whatever device this is,
-and it was just the measured capacity variation that caused amtapetype to think
-those extra file marks in pass 2 actually took up space.
-It also explains why amtapetype used to sometimes report a negative file mark
-size if the math happened to end up that way. When that happens now we just
-report it as zero.
-
-SEE ALSO
-
-amanda(8)
--------------------------------------------------------------------------------
-
-Prev     Up    Next
-amtape  Home  amtoc
-
diff --git a/docs/amtoc.8.txt b/docs/amtoc.8.txt
deleted file mode 100644 (file)
index 4260b7f..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-
-                                amtoc
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amtoc \14 generate TOC (Table Of Contents) for an Amanda run
-
-Synopsis
-
-amtoc [-a ] [-i ] [-t ] [ -f file ] [ -s subs ] [-w ] [-- ] logfile
-
-DESCRIPTION
-
-Amtoc generates a table of contents for an Amanda run. It's a perl script (if
-you don't have perl, install it first!).
-
-OPTIONS
-
-
-
-  -a
-      The output file name will be label-of-the-tape.toc in the same directory
-      as logfile.
-
-  -i
-      Display help about amtoc.
-
-  -t
-      Generate the output in tabular form.
-
-  -f file
-      Write the output to a file ('-' for stdout).
-
-  -s subs
-      Evaluate the output file name from subs, with $_ set to label-of-the-
-      tape. The -a option is equivalent to -s 's/$_/.toc/'.
-
-  -w
-      Separate tapes with form-feeds and display blank lines before totals.
-
-  --
-      Marks the last option so the next parameter is the logfile.
-
-  logfile
-      (use '-' for stdin)
-
-
-OUTPUT FORMAT
-
-The standard output has five fields separated by two spaces:
-
-#  Server:/partition  date  level  size[Kb]
-0  daily-05:  19991005  -  -
-1  cuisun15:/cuisun15/home  19991005  1  96
-2  cuinfs:/export/dentiste  19991005  1  96
-  ...
-103  cuisg11:/  19991005  0  4139136
-103  total:  -  -  16716288
-
-
-In tabular format (-t), this would look like:
-
-  #  Server:/partition           date      lev  size[Kb]
-  0  daily-05:                   19991005    -         -
-  1  cuisun15:/cuisun15/home     19991005    1        96
-  2  cuinfs:/export/dentiste     19991005    1        96
-  ...
-103  cuisg11:/                   19991005    0   4139136
-103  total:                      -           -  16716288
-
-
-USAGE
-
-The easiest way to use it is to run amtoc right after amdump in the cron job:
-
-amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-
-9] | head -1` ; amtoc -a $log
-which will generate /usr/local/etc/amanda//daily/tape_label.toc. You may also
-want to call amtoc after an amflush.
-
-SEE ALSO
-
-amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl
-
-AUTHOR
-
-Nicolas Mayencourt <Nicolas.Mayencourt@cui.unige.ch>, University of Geneva/
-Switzerland : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
--------------------------------------------------------------------------------
-
-Prev         Up       Next
-amtapetype  Home  amverify
-
diff --git a/docs/amverify.8.txt b/docs/amverify.8.txt
deleted file mode 100644 (file)
index c4e11f5..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-
-                              amverify
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amverify \14 check an Amanda tape for errors
-
-Synopsis
-
-amverify config [ slot [runtapes]]
-
-DESCRIPTION
-
-Amverify reads an Amanda format tape and makes sure each backup image can be
-processed by amrestore and, if possible, the appropriate restore program (e.g.
-tar).
-Amverify runs amrestore on each file of the tape and pipes the output to a
-restore program (if available) with an option to create a catalogue of the
-backup. The catalogue itself is discarded. Only the success or failure of the
-operation itself is reported.
-If the backup image cannot be processed by the restore program, e.g. if it was
-written on a different operating system, the image is sent through dd to /dev/
-null. This still determines if the tape is readable, but does not do any
-internal consistency check on the image.
-If config is set up to use a tape changer, the slot argument may be used to
-choose the first tape to process. Otherwise, the current slot is used.
-The runtapes configuration parameter determines how many tapes are processed
-unless it is specified on the command line.
-See the amanda(8) man page for more details about Amanda.
-
-AUTHOR
-
-Axel Zinser <fifi@icem.de> : Original text
-Stefan G. Weichinger, <sgw@amanda.org>, maintainer of the Amanda-documentation:
-XML-conversion
-
-SEE ALSO
-
-amrestore(8), amanda(8), amverifyrun(8)
--------------------------------------------------------------------------------
-
-Prev    Up          Next
-amtoc  Home  amverifyrun
-
diff --git a/docs/amverifyrun.8.txt b/docs/amverifyrun.8.txt
deleted file mode 100644 (file)
index 59a3bfe..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-                           amverifyrun
-Prev  Chapter 36. The Amanda Manual Pages.  Next
-
--------------------------------------------------------------------------------
-
-Name
-
-amverifyrun \14 check the tapes written by the last Amanda run
-
-Synopsis
-
-amverifyrun config
-
-DESCRIPTION
-
-Amverifyrun read the log from the last Amanda run to find the slot of the first
-tape used and the number of tapes used. It call amverify with these argument.
-
-SEE ALSO
-
-amanda(8), amverify(8)
--------------------------------------------------------------------------------
-
-Prev       Up                         Next
-amverify  Home  Chapter 37. Web Ressources
-
diff --git a/docs/chgscsi.txt b/docs/chgscsi.txt
deleted file mode 100644 (file)
index 2ce8b22..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-
-                   Chapter 9. chg-scsi
-Prev  Part II. About Tapes and Changers  Next
-
--------------------------------------------------------------------------------
-
-Chapter 9. chg-scsi
-
-
-Jason X (report real name to <sgw@amanda.org>)
-
-Original version
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Command_line_options
-
-  Notes_about_changer.conf
-
-  Amanda's_actual_usage_of_chg-scsi
-
-  Configuration_notes
-
-  Hacking_notes
-
-Jason's new and improved chg-scsi documentation.
-This documentation will also include an occasional reference to the mtx suite
-as I have attempted to use chg-zd-mtx. I use mtx often as a fast query tool.
-Please also refer to Amanda_Tape_Changer_Support for additional details.
-My equipment list is as follows:
-
-* Redhat 7.0 machine
-*
-  o Dual Processor P-III
-  o Sony DDS3 tape drive
-  o lots of hard disk space
-
-* Quantum/ATL L500 SCSI changer
-* DLT tape drive (three possible)
-* barcode reader fourteen tape slots
-
-I base this documentation on the following:
-
-* mtx version 1.2.16rel
-* Amanda version 2.4.3b3
-* SCSI2 specification: X3T9.2/375R revision 10L
-* Quantum/ATL Field Service Manual 6321101-03 Ver.3, rel.0
-* Quantum DLT800 Tape system product manual 02 April, 2001 81-60118-04
-* the SCSI bus and IDE interface 2nd ed by Friedhelm Schmidt pub: Addison-
-  Wesley 1998
-
-Note that Quantum/ATL's L-series changers follow the SCSI command set, and do
-not use any proprietary commands. Thus, it was fairly simple to make this work.
-I had to install Amanda --with-suffixes and setup my server's client side of
-things using Amanda-2.4.2p2 --with-suffixes.
-Please note that my usage of "barcode" and "barcode reader" throughout this
-document really refers to "physical tape identification system". for example:
-the EEPROM in the AIT cartridge.
-
- Command line options
-
-chg-scsi's command line options:
-
-  -slot <param>
-  -info
-  -reset
-  -eject
-  -clean
-  -label <param>
-  -search <param>
-  -status <param>
-  -trace <param>
-  -inventory
-  -dumpdb
-  -scan
-  -genconf
-
-Note that chg-scsi is called by Amanda in the context of whatever Amanda
-configuration Amanda is currently using. In short, to call chg-scsi by hand,
-change to your Amanda configuration directory, then run chg-scsi.
--slot <param> command:
-this command takes either a slot number, or any one of the following: current,
-next, prev, first, last, advance
-It then loads the appropriate tape into the drive.
-Note that if the tape is already loaded, no changer motion will happen. No
-reading of the tape is done here.
--info command:
-four numbers are printed: <slot# loaded> <number of slots> <reversable>
-<searchable>
-with chg-scsi, the reversable number is always 1. Searchable is set based on if
-a barcode reader is available and working correctly.
--reset command:
-Tape is unloaded, and slot 0 is loaded. No actual reset command is sent to the
-changer.
--eject command:
-Tape is unloaded, and put back into its original slot.
--clean command:
-Cleaning tape (if configured) is loaded into the tape. It is probably unloaded
-when done. I haven't looked closely at this yet.
--label <param> command:
-This appears to take the currently loaded tape's barcode and write it to the
-labelfile with the given parameter as it's tape header. I have not tested this.
--search <param> command:
-this only should be used if a barcode reader is present, or emulate barcode is
-turned on.
-the required parameter is an Amanda tape label. The label searched in the
-labelfile. If a barcode is found, then that tape is loaded directly.
-I believe the fallback is to search the entire magazine.
--status command:
-The tape changer is queried, and the results are printed out. Values printed
-are what slots exist, are they full or empty, and what volume labels (barcodes)
-they are.
-Q. what about changers that don't retain current slot? A. this is what the
-"statfile" is for.
--trace command:
-present only for a particular type of changer.
--inventory: (this takes a LONG time to do)
-unloads tape back to its slot issues command to changer to do an inventory of
-itself (read all barcodes...)
-loads each tape, retrieves the barcode, and reads the Amanda
-label off of the tape itself stores/updates the label database file
--dumpdb:
-prints out in human readable form the label database contents from the
-labelfile.
--scan: (aka scanbus)
-scans the SCSI generic interfaces (eg: linux sg), and prints out the device
-name and the device types. I found that linux didn't classify either of my tape
-devices as generic, but this facility did.
-USE THIS FOR FINDING VALUE OF SCSItapedev. Be certain though you have the
-correct tape drive: I came close to wreaking havoc with my DDS3 drive while it
-was flushing Amanda data...and my changer has a DLT drive! Please refer to my
-configuration notes below.
--genconf:
-prints out a SAMPLE changer.conf file. Note that I said sample. except for that
-it also does a scanbus. if you have more than one tape drive, please be certain
-it is correct as chg-scsi uses the first one it finds.
-Please refer to my configuration notes below.
-
- Notes about changer.conf
-
-Here, I try to be a bit more clear on what these config values mean.
-"number_configs" MUST be the first entry (not counting comments)
-"emubarcode" will set this value in chg-scsi regardless of the value you try to
-assign it. If you don't want "emubarcode" set, don't list it!
-"havebarcode" have barcode is tempered by what devices chg-scsi is aware of. if
-chg-scsi doesn't know about your changer explicitly, it will default to a
-default changer. the default changer has no barcode reader.
-In a patch I plan to post, I have added a generic changer that does use a
-barcode. set "changerident" to "genericbarcode" to use this.
-"sleep" number of seconds for chg-scsi to wait for a "tape drive ready" command
-after loading a new tape. Mine is 140 as I have a DLT tape drive, and my tape
-drive manual reports a max of 133 seconds to be ready.
-"config" this is a header telling chg-scsi that all values following, up to the
-next "config" line apply to this drive number. It is this number that is
-refered to in your amanda.conf file as line tapedev
-"drivenum" this is the tape drive number in your changer. For a single tape
-drive, this is zero. Mine can handle up to three, so I expect I could make this
-0, 1, or 2.
-"dev" the SCSI device of your tape drive. under linux, in my case it is /dev/
-nst1. This MUST be defined.
-"SCSItapedev" The generic SCSI device of your tape drive. this is simply the
-generic interface to the device "dev" above. This entry is optional. In my
-case, it is /dev/sg2. If this entry exists and is legitimate, then SCSI
-commands are formed directly instead of using ioctl commands.
-"startuse" "enduse" The start and end slots of your changer. Note that these
-also start with zero.
-"eject" chg-scsi tells the tape changer to eject. You might need to explicitly
-tell the tape drive to unload first. That's what this setting is for. Have you
-ever removed a loaded VCR tape by hand?
-"changerident" chg-scsi will first read the changer's identification from the
-return of the SCSI "inquiry" command. If changerident is set in the
-configuration file, the SCSI inquiry's value is overridden. chg-scsi will
-attempt to match the value with its built-in changertypes.
-"generic" is what the chg-scsi will default to "genericbarcode" is a hack of
-mine that forces the changer's barcode reader to work. Note that if your
-changer uses a superset of the SCSI command set, this probably won't work.
-"L500" is another addition of mine that will enable a quantum/atl L500 to work
-correctly. It might even work with an L200.
-other values are (taken from the code)
-
-* C1553A (HP Auto Loader)
-* EXB-10e, EXB-120 (Exabyte Robot)
-* EXB-85058HE-0000 (Exabyte Tape)
-* TDS 1420 (Tandberg Robot)
-* VLS DLT, VLS SDX (ADIC VLS DLT Library)
-* FastStor DLT (ADIC FastStor DLT Library)
-* Scalar DLT 448 (ADIC DLT 448)
-* 215 (Spectra Logic TreeFrog)
-* Quad 7 (Breece Hill)
-* DLT7000, DLT4000 (DLT Tape)
-
-"debuglevel" setting this to "9:0" is very informative.
-"statfile" stores which "slot" that the tape in the drive came from
-"labelfile" binary file that stores the tape header and barcode information
-cleanmax cleancart cleanfile I have my changer set to autoclean, and the slot
-the cleaning cartridge is in is not available for any other use.
-
- Amanda's actual usage of chg-scsi
-
-this should be brief: Amanda really only issues "slot next" type commands.
-Currently Amanda doesn't ask chg-scsi to load "tape x with label Daily_set023".
-the chg-scsi mechanism is there for use, and functions quite well for the user
-to load a particular tape. I understand they (the Amanda team) are working on
-this.
-
- Configuration notes
-
-(assuming one changer with one tape drive!)
-in amanda.conf:
-set tpchanger to chg-scsi set changerfile to <pathname>/changer.conf set
-tapedev to 0 set changerdev to /dev/<changer generic device>
-
-* this value is usually listed in the system boot messages or will be printed
-  via syslog when the appropriate kernel module is loaded. eg: linux modprobe
-  sg
-
-in changer.conf: set number_configs to 1 set dev to <non-rewinding tape device
-eg: /dev/nst1> set debug to 9:0
-run "chg-scsi -scan" from your Amanda configuration directory I get: name /dev/
-sg0 Tape Count 1 name /dev/sg1 Changer Count 2 name /dev/sg2 Tape Count 3
-I set SCSItapedev to /dev/sg0 to test with, then ran chg-scsi -info. Check the
-chg-scsi debug file for tapeidentification details. This is where I discoverd
-that "sg0" was not the correct tape!
-set SCSItapedev to "/dev/<generic device>"
-if you have no barcode, try "changerident generic" if you have a barcode reader
-try "changerident genericbarcode"
-
- Hacking notes
-
-My hacks are:
-
-* adding printout of "emubarcode" values in the debug file
-* added dlt8000 tape drive to ChangerIO[], and SenseType[]
-* added genericbarcode to ChangerIO[], and SenseType[]
-* added L500 to ChangerIO[], and SenseType[]
-* added a couple of basic sensecodes listed in the SCSI specs for the generic
-  and genericbarcode tape changers.
-
-My desires are:
-
-* modify the sensecode code such that all SCSI devices inherit the standard
-  SCSI codes and may override or append to them as needed.
-
-
-* modify the configuration reading code and the inquiry command to allow
-  spaces. eg: my changer displays the following ident data: "L500 6320000" but
-  I had to create a type called "L500" or else the spaces would throw off the
-  comparisons.
-
-
-Note
-
-Refer to http://www.amanda.org/docs/chgscsi.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                            Up                                   Next
-Chapter 8. Amanda Tape Changer Home  Chapter 10. RAIT (Redundant Array of
-Support                                         Inexpensive Tape) Support
-
diff --git a/docs/dumperapi.txt b/docs/dumperapi.txt
deleted file mode 100644 (file)
index 661fa51..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-
-        Chapter 23. Amanda dumper API
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 23. Amanda dumper API
-
-
-Alexandre Oliva
-
-Original text
-AMANDA Core Team
-<oliva@dcc.unicamp.br>>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  The_Problem
-
-  Overview_of_the_API
-
-
-        The_`support'_command
-
-
-  The_`selfcheck'_command
-
-  The_`estimate'_and_`estimate-parse'_commands
-
-  The_`backup'_and_`backup-parse'_commands
-
-  The_`index-from-output'_and_`index-from-image'_commands
-
-  The_`restore'_command
-
-  The_`print-command'_command
-
-  Conclusion
-
-
- Introduction
-
-This is a proposal of a mechanism for Amanda to support arbitrary backup
-programs, that relies on a generic backup driver and scripts or programs that
-interface with backup programs such as dump, tar, smbclient, and others. It can
-also be used to introduce pre- and post-backup commands.
-The interface is simple, but supports everything that is currently supported by
-Amanda, and it can be consistently extended to support new abstractions that
-may be introduced in the backup driver in the future.
-This proposal does not imply any modification in the Amanda protocol or in
-Amanda servers; only Amanda clients have to be modified. By Amanda clients, we
-refer to hosts whose disks are to be backed up; an Amanda server is a host
-connected to a tape unit.
-Currently (as of release 2.4.1 of Amanda), Amanda clients support three
-operations: selfcheck, estimate and backup.
-Selfcheck is used by the server program amcheck, to check whether a client is
-responding or if there are configuration or permission problems in the client
-that might prevent the backup from taking place.
-Estimates are requested by the Amanda planner, that runs on the server and
-collects information about the expected sizes of backups of each disk at
-several levels. Given this information and the amount of available tape space,
-the planner can select which disks and which levels it should tell dumper to
-run.
-dumper is yet another server-side program; it requests clients to perform
-dumps, as determined by planner, and stores these dumps in holding disks or
-sends them directly to the taper program. The interaction between dumper and
-taper is beyond the scope of this text.
-We are going to focus on the interaction between the Amanda client program and
-wrappers of dump programs. These wrappers must implement the DUMPER API. The
-dumptype option `program' should name the wrapper that will be used to back up
-filesystems of that dumptype. One wrapper may call another, so as to extend its
-functionality.
-
- The Problem
-
-Different backup programs present distinct requirements; some must be run as
-super-user, whereas others can be run under other user-ids. Some require a
-directory name, the root of the tree to be backed up; others prefer a raw
-device name; some don't even refer to local disks (SAMBA). Some wrappers may
-need to know a filesystem type in order to decide which particular backup
-program to use (dump, vdump, vxdump, xfsdump, backup).
-Some provide special options for estimates, whereas others must be started as
-if a complete dump were to be performed, and must be killed as soon as they
-print an estimate.
-Furthermore, the output formats of these backup programs vary wildly. Some will
-print estimates and total sizes in bytes, in 512-byte tape blocks units, in
-Kbytes, Mbytes, Gbytes, and possibly Tbytes in the near future. Some will print
-a timestamp for the backup; some won't.
-There are also restrictions related with possible scheduling policies. For
-example, some backup programs only support full backups or incrementals based
-on the last full backup (0-1). Some support full backups or incrementals based
-on the last backup, be it a full or an incremental backup (0-inf++). Some
-support incrementals based on a timestamp (incr/date); whereas others are based
-on a limited number of incremental levels, but incrementals of the same level
-can be repeated, such as dump (0-9).
-Amanda was originally built upon DUMP incremental levels, so this is the only
-model it currently supports. Backup programs that use other incremental
-management mechanisms had to be adapted to this policy. Wrapper scripts are
-responsible for this adaptation.
-Another important issue has to do with index generation. Some backup programs
-can generate indexes, but each one lists files in its own particular format,
-but they must be stored in a common format, so that the Amanda server can
-manipulate them.
-The DUMPER API must accomodate for all these variations.
-
- Overview of the API
-
-We are going to define a standard format of argument lists that the backup
-driver will provide to wrapper programs, and the expected result of the
-execution of these wrappers.
-The first argument to a wrapper should always be a command name. If no
-arguments are given, or an unsupported command is requested, an error message
-should be printed to stderr, and the program should terminate with exit status
-1.
-
- The `support' command
-
-As a general mechanism for Amanda to probe for features provided by a backup
-program, a wrapper script must support at least the `support' command. Some
-features must be supported, and Amanda won't ever ask about them. Others will
-be considered as extensions, and Amanda will ask the wrapper whether they are
-supported before issuing the corresponding commands.
-
- The `level-incrementals' subcommand
-
-For example, before requesting for an incremental backup of a given level,
-Amanda should ask the wrapper whether the backup program supports level-based
-incrementals. We don't currently support backup programs that don't, but we may
-in the future, so it would be nice if wrappers already implemented the command
-`support level-incrementals', by returning a 0 exit status, printing, say, the
-maximum incremental level it supports, i.e., 9. A sample session would be:
-
-  % /usr/local/amanda/libexec/wrappers/dump support level-incrementals hda0 9
-       
-
-Note that the result of this support command may depend on filesystem
-information, so the disklist filesystem entry should be specified as a command
-line argument. In the next examples, we are not going to use full pathnames to
-wrapper scripts any more.
-We could have defined a `support' command for full backups, but I can't think
-of a backup program that does not support full backups...
-
- The `index' subcommand
-
-The ability to produce index files is also subject to an invocation of
-`support' command. When the support sub-command is `index', like in the
-invocation below, the wrapper must print a list of valid indexing mechanisms,
-one per line, most preferred first. If indexing is not supported, nothing
-should be printed, and the exit status should be 1.
-DUMP support index hda0
-The currently known indexing mechanisms are:
-output: implies that the command `index-from-output' generates an index file
-from the output produced by the backup program (for example, from tar -cv).
-image: implies that the command `index-from-image' generates an index file from
-a backup image (for example, tar -t).
-direct: implies that the `backup' command can produce an index file as it
-generates the backup image.
-parse: implies that the `backup-parse' command can produce an index file as it
-generates the backup formatted output .
-The indexing mechanisms will be explicitly requested with the additionnal
-option `index-<mode>' in the `backup' and `backup-parse' command invocation.
-`index-from-image' should be supported, if possible, even if other index
-commands are not, since it can be used in the future to create index files from
-previously backed up filesystems.
-
- The `parse-estimate' subcommand
-
-The `parse-estimate' support subcommand print a list of valid mechanisms to
-parse the estimate output and write the estimate size to its output, the two
-mechanisms are:
-direct: implies that the `estimate' command can produce the estimate output.
-parse: implies that the `estimate-parse' command can produce the estimate
-output when fed with the `estimate' output.
-The estimate parsing mechanisms will be explicitly requested with the
-additionnal option `estimate-<mode>' in the `estimate' and `estimate-parse'
-command invocation.
-
- The `parse-backup' subcommand
-
-The `parse-backup' support subcommand print a list of valid mechanisms to parse
-the backup stderr, the two mechanisms are:
-direct: implies that the `backup' command can produce the backup-formatted-
-ouput.
-parse: implies that the `backup-parse' command can produce the backup-
-formatted-ouput when fed with the `backup' stderr.
-The backup parsing mechanisms will be explicitly requested with the additional
-option `backup-<mode>' in the `backup' and `backup-parse' command invocation.
-
- Other subcommands
-
-Some other standard `support' sub-commands are `exclude' and `exclude-list'.
-One may think (and several people did :-) ) that there should be only one
-support command, that would print information about all supported commands. The
-main arguments against this proposal have to do with extensibility:
-The availability of commands might vary from filesystem to filesystem. No, I
-don't have an example, I just want to keep it as open as possible :-) one
-support subcommand may require command line arguments that others don't, and we
-can't know in advance what these command line arguments are going to be
-The output format and exit status conventions of a support command may vary
-from command to command; the only pre-defined convention is that, if a wrapper
-does not know about a support subcommand, it should return exit status 1,
-implying that the inquired feature is not supported.
-
- The `selfcheck' command
-
-We should support commands to perform self-checks, run estimates, backups and
-restores (for future extensions of the Amanda protocol so as to support
-restores)
-A selfcheck request would go like this:
-DUMP selfcheck hda0 option option=value ...
-The options specified as command-line arguments are dumptype options enabled
-for that disk, such as `index', `norecord', etc. Unknown options should be
-ignored. For each successful check, a message such as:
-OK [/dev/hda0 is readable] OK [/usr/sbin/dump is executable]
-Errors should be printed as:
-ERROR [/etc/dumpdates is not writable]
-A wrapper script will certainly have to figure out either the disk device name
-or its mount point, given a filesystem name such as `hda0', as specified in the
-disklist. In order to help these scripts, Amanda provides a helper program that
-can guess device names, mount points and filesystem types, when given disklist
-entries.
-The filesystem type can be useful on some operation systems, in which more than
-one dump program is available; this information can help automatically
-selecting the appropriate dump program.
-The exit status of selfcheck and of this alternate script are probably going to
-be disregarded. Anyway, for consistency, selfcheck should return exit status 0
-for complete success, 1 if any failures have occurred.
-
- The `estimate' and `estimate-parse' commands
-
-Estimate requests can be on several different forms. An estimate of a full
-backup may be requested, or estimates for level- or timestamp-based
-incrementals:
-DUMP estimate full hda0 option ... DUMP estimate level 1 hda0 option ... DUMP
-estimate diff 1998:09:24:01:02:03 hda0 option ...
-If requested estimate type is not supported, exit status 3 should be returned.
-If the option `estimate-direct' is set, then the `estimate' command should
-write to stdout the estimated size, in bytes, a pair of numbers that,
-multiplied by one another, yield the estimated size in bytes.
-If the option `estimate-parse' is set, then the `estimate' command should write
-to stdout the informations needed by the `estimate-parse' command, that should
-extract from its input the estimated size.
-The syntax of `estimate-parse' is identical to that of `estimate'.
-Both `estimate' and `estimate-parse' can output the word `KILL', after printing
-the estimate. In this case, Amanda will send a SIGTERM signal to the process
-group of the `estimate' process. If it does not die within a few seconds, a
-SIGKILL will be issued.
-If `estimate' or `estimate-parse' succeed, they should exit 0, otherwise exit
-1, except for the already listed cases of exit status 3.
-
- The `backup' and `backup-parse' commands
-
-The syntax of `backup' is the same as that of `estimate'. The backup image
-should be written to standard output, whereas stderr should be used for the
-user-oriented output of the backup program and other messages.
-If the option `backup-direct' is set, then the `backup' command should write to
-stderr a formatted-output-backup.
-If the option `backup-parse' is set, then the `backup' command should write to
-stderr the informations needed by the `backup-parse' command, that should edit
-its input so that it prints to standard output a formatted-output-backup.
-If the option `no-record' is set, then the `backup' command should not modify
-its state file (ex. dump should not modify /etc/dumpdates).
-The syntax of `backup-parse' is identical to that of `backup'.
-The syntax of the formatted-output-backup is as follow: All lines should start
-with either `| ' for normal output, `? ' for strange output or `& ' for error
-output. If the wrapper can determine the total backup size from the output of
-the backup program, it should print a line starting with `# ', followed by the
-total backup size in bytes or by a pair of numbers that, multiplied, yield the
-total backup size; this number will be used for consistency check.
-The option `index-direct' should cause commands `backup' to output the index
-directly to file descriptor 3. The option `index-parse' should cause commands
-`backup-parse' to output the index directly to file descriptor 3. The syntax of
-the index file is described in the next section.
-
- The `index-from-output' and `index-from-image' commands
-
-The syntax of the `index-from-output' and `index-from-image' commands is
-identical to the one of `backup'. They are fed the backup output or image, and
-they must produce a list of files and directories, one per line, to the
-standard output. Directories must be identified by the `/' termination.
-After the file name and a blank space, any additional information about the
-file or directory, such as permission data, size, etc, can be added. For this
-reason, blanks and backslashes within filenames should be quoted with
-backslashes. Linefeeds should be represented as `\n', although it is not always
-possible to distinguish linefeeds in the middle of filenames from ones that
-separate one file from another, in the output of, say `restore -t'. It is not
-clear whether we should also support quoting mechanisms such as `\xHH', `\OOO'
-or `\uXXXX'.
-
- The `restore' command
-
-Yet to be specified.
-
- The `print-command' command
-
-This command must be followed by a valid backup or restore command, and it
-should print a shell-command that would produce an equivalent result, i.e.,
-that would perform the backup to standard output, or that would restore the
-whole filesystem reading from standard input. This command is to be included in
-the header of backup images, to ease crash-recovery.
-
- Conclusion
-
-Well, that's all. Drop us a note at the amanda-hackers mailing list (mailto://
-amanda-hackers@amanda.org) if you have suggestions to improve this document
-and/or the API. Some help on its implementation would be welcome, too.
-
-Note
-
-Refer to http://www.amanda.org/docs/dumperapi.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                     Up                           Next
-Chapter 22. How Amanda uses UDP and TCP Home  Chapter 24. Amanda Internals
-ports 
-
diff --git a/docs/eventapi.txt b/docs/eventapi.txt
deleted file mode 100644 (file)
index 51c8992..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-
-         Chapter 25. Amanda Event API
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 25. Amanda Event API
-
-
-Mike Grupenhoff
-
-Original text
-AMANDA Core Team
-<kashmir@munge.com>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  The_API
-
-
-        event_register
-
-        event_release
-
-        event_loop
-
-        event_wait
-
-        event_wakeup
-
-
-  Data_types
-
-
-        event_handle_t
-
-        event_id_t
-
-        event_type_t
-
-        event_fn_t
-
-
-  Event_Types
-
-
-        EV_READFD
-
-        EV_WRITEFD
-
-        EV_SIG
-
-        EV_TIME
-
-        EV_WAIT
-
-
-
- Introduction
-
-This is a document of the API for the event handler. The purpose of the event
-handler is to allow scheduling and serialization of multiple different types of
-events.
-
- The API
-
-
- event_register
-
-event_handle_t *event_register(event_id_t data, event_type_t type, event_fn_t
-callback, void *arg);
-Sets up an event of the given type to call the given function with the given
-argument.
-The 'data' argument is type specific.
-EV_READFD, EV_WRITEFD - the file descriptor to monitor EV_SIG - the signal
-number to monitor EV_TIME - the number of seconds between each pulse EV_WAIT -
-the wait identifier used with event_wakeup() EV_DEAD - internal use only
-
- event_release
-
-void event_release(event_handle_t *handle);
-Remove an event from the queue. This can happen at any time, even while the
-event is firing.
-
- event_loop
-
-void event_loop(int dontblock);
-Process all pending events. If the argument is zero, this will keep running
-until all events have been released. If the argument is nonzero, this will do
-one pass over all pending events, and fire the ones that are immediately ready,
-and then return.
-
- event_wait
-
-void event_wait(event_id_t id);
-Like event_loop(0), except that it will stop as soon as the event id is
-serviced.
-
- event_wakeup
-
-int event_wakeup(event_id_t id);
-Fire all EV_WAIT events registered with an argument value of 'id' immediately.
-Returns the number of events that were fired.
-
- Data types
-
-
- event_handle_t
-
-This is an opaque structure that describes a registered event. It is only
-useful to keep if you need to unregister the event later.
-
- event_id_t
-
-This is type-specific data. The contents and format depend on on the type of
-the event. This is an unsigned integral type.
-
- event_type_t
-
-This is an enumerated type describing the different events we handle.
-
- event_fn_t
-
-typedef void (*event_fn_t)(void *arg);
-This is a function signature for the type of function that needs to get passed
-to event_register. The argument to the function is a pointer of the caller's
-choosing.
-
- Event Types
-
-
- EV_READFD
-
-This type of event will fire when the file descriptor passed to event_register
-has data waiting to be read.
-
- EV_WRITEFD
-
-This type of event will fire when the file descriptor passed to event_register
-can have data written to it without blocking.
-
- EV_SIG
-
-This type of event will fire when the signal number passed to event_register
-has been caught. Note that if a signal is caught while processing is not in
-event_loop(), the event will be delayed until processing returns to event_loop
-().
-
- EV_TIME
-
-This type of event will fire repeatedly with a delay of the number of seconds
-passed to event_register between each interval.
-
- EV_WAIT
-
-This type of event will fire when someone calls event_wakeup() with the numeric
-argument equal to the argument this event was registered with.
-
-Note
-
-Refer to http://www.amanda.org/docs/eventapi.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                           Up                              Next
-Chapter 24. Amanda Internals  Home  Chapter 26. Amanda Security API
-
diff --git a/docs/exclude.txt b/docs/exclude.txt
deleted file mode 100644 (file)
index 030c06b..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-
-         Chapter 3. Excluding
-Prev  Part I. Installation  Next
-
--------------------------------------------------------------------------------
-
-Chapter 3. Excluding
-
-
-Andrew Hall
-
-Original text
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  Please_Read
-
-  Before_We_Begin
-
-  Choosing_an_exclude_mechanism
-
-
-        Exclude_Mechanisms
-
-
-  Expression
-
-  Wildcard_Expansion
-
-  Troubleshooting
-
-
-        Broken_gnutar?
-
-        The_ps_command_is_your_friend.
-
-
-
- Introduction
-
-There are times when data needs to be excluded from a backup. When these times
-arise be confident that Amanda has this capability. (Actually it's not Amanda,
-it's tar.) There are three ways of excluding data in an Amanda backup:
-
-* Exclude an individual item explicitly in the dumptype
-* Utilize an "Exclude List"
-* Do not include the data in the disklist
-
-This document is based on Amanda 2.4.2 and some of this might not work with
-older versions. This was compiled from my personal experience and with help
-from the members of the amanda-users mailing list (mailto://amanda-
-users@amanda.org) when I was originally setting this up, to whom I wish to
-thank for all of their support.
-
- Please Read
-
-As far as I am able to tell the only way to exclude files or directories with
-Amanda is to use GNU-tar as the dump program (others?). The file system dump
-programs provided with unix systems (e.g. dump, ufsdump) get data at a raw
-drive level and generally do not allow exclusion of specific files or
-directories.
-The GNU version of tar, (GNU-tar or gtar), reads its data at a file system, (or
-higher), level and does include the option to exclude specific files and/or
-directories. It should be mentioned here that tar will change the access times
-on files. Tar has the ability to preserve the access times however, doing so
-effectively disables incremental backups since resetting the access time alters
-the inode change time, which in turn causes the file to look like it needs to
-be archived again.
-The only exception that I am aware of is to just not include the data in
-question in the disklist. This option may not be suitable for everyone's needs
-and can confuse the issue some, so I have elected to include this mechanism in
-its own section named Do_not_include_the_data_in_the_disklist.
-For the purpose of this document an Amanda backup configuration named "exclude-
-test" will be used. The machine that contains the tape drive which receives
-data to be archived will be referred to as "SERVER". The machine that data is
-being archived from will be referred to as "CLIENT". These two systems are
-usually different machines but are not required to be, and may be the same
-machine. Parts of this setup are on the server and some are on the client.
-
-Note
-
-When Amanda attempts to exclude a file or directory it does so relative to the
-area being archived. For example if /var is in your disklist and you want to
-exclude /var/log/somefile, then your exclude file would contain ./log/somefile.
-You may use one exclude file in multiple dumptypes without any restriction.
-
- Before We Begin
-
-The first step that should be taken is to verify that backups are currently
-working. Connect to SERVER and run amcheck as your Amanda user, to verify that
-there are no errors in the current setup.
-
-  $ amcheck -cl CLIENT
-
-Output should look something like below for success:
-
-       Amanda Tape Server Host Check
-       -----------------------------
-
-       /path/to/holding-disk: 4771300 KB disk space available, that's plenty.
-       Amanda Backup Client Hosts Check
-       --------------------------------
-       Client check: 1 host checked in 0.084 seconds, 0 problems found.
-
-Next make sure that GNU-tar is the dump program currently in use. The easiest
-way to tell if your dumptype is using gnutar is to run the following:
-
-  $ amadmin exclude-test disklist CLIENT
-
-Among all the output is the "program" value currently in use. This value is
-also specified with the "program" option in the dumptype. If the dumptype has
-the line "program GNUTAR" your setup should be ready to exclude data.
-If GNU-tar is not in use add the line "program GNUTAR" to the dumptype, and
-then run amcheck again to verify that backups should work. The capitalization
-of GNUTAR is required.
-The dumptype should look something like:
-
-  define dumptype exclude-test {
-  comment "test dumptype for documentation"
-  priority high
-  program "GNUTAR"
-  }
-
-
- Choosing an exclude mechanism
-
-If the need is to exclude only one file or directory then the easiest way to
-accomplish this is to exclude an individual item explicitly in the dumptype. If
-the need is to exclude multiple files or directories then use an Exclude List.
-
- Exclude Mechanisms
-
-
- Exclude an individual item explicitly in the dumptype
-
-The easiest way to exclude a file or directory is to specify it with the
-"exclude" option in the dumptype. This option accepts an argument of the file
-or directory to be excluded. Amanda allows only one exclude option in any
-dumptype at a time.
-
-Note
-
-UPDATE: Recent Amanda-releases bring the option "exclude append" which enables
-the administrator to define more than one exclusion-pattern within one dumptype
-without using a exclude-list. Please look at the amanda.conf.5-manpage for
-details.
-Any path specified to be excluded must be encapsulated with quotes. Continuing
-with our example from above /var/log/somefile and using the same dumptype as
-above, the dumptype would now look like:
-
-  define dumptype exclude-test {
-  comment "test dumptype for documentation"
-  priority high
-  program "GNUTAR"
-  exclude "./log/somefile"
-  }
-
-Next run amcheck again to verify that there are no problems with the revised
-Amanda configuration. If the data is not being excluded as expected please see
-the Troubleshooting section below. This completes the setup of excluding an
-individual item in the dumptype.
-
- Utilize an Exclude List
-
-An exclude list is a file that resides on the CLIENT machine and contains paths
-to be excluded, one per line. This file can be in any location on the CLIENT so
-long as the same path is specified in the dumptype. Some find /usr/local/etc/
-amanda an appropriate location, but it is up to you. I personally like to have
-a subdirectory for exclude files but it is up to you where you place this file.
-The exclude file may also be placed in the area being archived. This is an easy
-way to have a different exclusion file for each disklist entry without needing
-separate dumptype definitions. To use this technique, enter a path relative to
-the area being archived as the exclude file below instead of an absolute path.
-Connect to CLIENT and create the exclude directory as root. For example:
-
-  $ mkdir -p /usr/local/etc/amanda/exclude
-  $ cd /usr/local/etc/amanda/exclude
-
-Next create the exclude list for Amanda to use. You can name the exclude file
-anything you wish it to be. Create a file, and in this file place all paths to
-files and directories that are to be excluded. Keeping with the /var example,
-assume that /var/log/XFree86.0.log, and /var/log/maillog need to be excluded.
-Remember that all paths are relative. The exclude list would look like:
-
-  ./log/XFree86.0.log
-  ./log/maillog
-
-Make sure that permissions are restricted on this file. Run the following as
-root, where exclude-filename is the name of the file you just created. For
-example:
-
-  $ chmod 644 /usr/local/etc/amanda/exclude/exclude-filename
-
-This concludes the necessary configuration on the client.
-Connect to SERVER and cd to the exclude-test Amanda configuration directory.
-Edit the Amanda configuration file e.g. amanda.conf. Add an entry similar to
-the following line, to the dumptype for the client in question, where the
-exclude-filename is the file that was created on CLIENT in the step above
-including the quotes. For example:
-
-  exclude list "/usr/local/etc/amanda/exclude/exclude-filename"
-
-The new dumptype should look something like:
-
-  define dumptype exclude-test{
-  comment "test dumptype for documentation"
-  priority high
-  program "GNUTAR"
-  exclude list "/usr/local/etc/amanda/exclude/exclude-filename"
-  }
-
-Save the file. Run amcheck again to verify that there are no problems with the
-revised Amanda configuration. If amcheck succeeds then run amdump to verify the
-data is being excluded correctly. If the data is not being excluded as expected
-please see the Troubleshooting section below. This completes the setup of an
-exclude list.
-
- Do not include the data in the disklist
-
-Amanda uses disklist entries to define which directories or partitions should
-be archived. This allows us to exclude data by just not placing the data in
-question in the disklist. Assume that there is a disk mounted on /example. The
-directory /example has five subdirectories "a", "b", "c", "d", and "e". The
-directories "a", "b", and "c" need to be archived, while "d" and "e" should
-not. This can be accomplished by not specifying "d" and "e" in the disklist.
-Using the same dumptype and host in the above examples the disklist would
-contain:
-
-  CLIENT /examples/a   exclude-test
-  CLIENT /examples/b   exclude-test
-  CLIENT /examples/c   exclude-test
-
-Run amcheck to verify that Amanda is working correctly. If the data is not
-being excluded as expected please see the Troubleshooting section below. This
-completes the setup of using a disklist to exclude data.
-
- Expression
-
-Quiz: what is the difference between the following entries in an exclude list?
-
-  ./foo
-  ./foo/
-  ./foo/*
-
-case 1 : directory ./foo won't be in the backup image (that's what you want)
-case 2 : matches nothing (don't use it) case 3 : directory ./foo will be in the
-backup image but nothing below it.
-
- Wildcard Expansion
-
-Amanda has the ability to use wildcard expansion while excluding data as
-implemented by tar(1). The only places that wildcard expansion is allowed is in
-the "exclude" option in the dumptype, or in the exclude list. Some simple
-examples:
-Exclude any file or directory that ends in ".log" e.g. ppp.log, XFree86.0.log
-
-  ./*.log
-
-Exclude any file or directory with the string "log" e.g. logfile, maillog,
-syslog, ppp.log, XFree86.0.log
-
-  */*log*
-
-Exclude any file or directory that starts with string "cron" and ends in ".gz"
-e.g. cron.1.gz, cron.2.gz, log/cron.1.gz
-
-  ./*cron*.gz
-
-The question mark can be used to specify a single character. e.g. log.1, log.2,
-etc
-
-  ./log.?
-
-
- Troubleshooting
-
-If you find that you are having trouble getting the exclude patterns to match
-correctly, check out this really cool script written by John R. Jackson.
-ftp://gandalf.cc.purdue.edu/pub/amanda/gtartest-exclude
-This script allows you to test your patterns before placing them in an exclude
-list or in the dumptype. Instructions on how to run the script are included in
-the script.
-
- Broken gnutar?
-
-There are versions of GNU-tar that do not correctly exclude data. Version 1.12
-(plus the Amanda patches from http://www.amanda.org) are known to work
-correctly, as does version 1.13.19 (and later). Anything else is questionable.
-
-Note
-
-UPDATE:Using GNU-tar 1.13.25 is recommended.
-
- The ps command is your friend.
-
-Connect to CLIENT and run a
-
-  ps ax | grep tar
-
-(or
-
-  ps ef | grep tar
-
-on Solaris)
-to see exactly how the tar command is running. Look in the output for the --
-exclude or --exclude-from options in the running tar process. For example:
-
-  $ ps ax | grep tar
-
-  ?        R      0:37 /bin/tar --create --directory /var
-  --listed-incremental /var/lib/amanda/gnutar-lists/CLIENTvar_0.new
-  --sparse --one-file-system --ignore-failed-read --totals --file
-  /dev/null --exclude-from=/usr/local/etc/amanda/exclude-test/exclude.var
-  .
-
-In the above output notice the string "--exclude-from=". The string following
-the "=" is the exclude file currently in use. If the string was "--exclude"
-then the string following the "=" is the file or directory that is currently
-set to be excluded.
-Contact the amanda-users mailing list: mailto://amanda-users@amanda.org.
-Subscription information is available at http://www.amanda.org.
-
-Note
-
-Refer to http://www.amanda.org/docs/exclude.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                   Up                              Next
-Chapter 2. Amanda Installation Notes  Home  Chapter 4. Indexing with Amanda
-
diff --git a/docs/faq.txt b/docs/faq.txt
deleted file mode 100644 (file)
index 9e4da7b..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-
-             Chapter 19. Amanda FAQ
-Prev  Part IV. Various Information  Next
-
--------------------------------------------------------------------------------
-
-Chapter 19. Amanda FAQ
-
-
-Amanda Core Team
-
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-This file contains answers to some questions that are frequently asked in the
-Amanda mailing lists, specially by new users. Please take a look at this file
-before posting, this can save us time that could be spent improving Amanda and
-its documentation.
-New entries and modifications are welcome; send them to mailto://amanda-
-users@amanda.org or mailto://amanda-hackers@amanda.org.
-You may also want to take a look at the Amanda FAQ-O-Matic http://
-www.amanda.org/fom-serve/cache/1.html.
-
-
-  Why_does_Amanda_fail_to_build_on_my_system?
-
-  Why_does_amdump_report_that_all_disks_failed?
-
-  Why_does_amcheck_say_"port_NNN_is_not_secure"?
-
-  Why_does_amcheck_claim_that_the_tape_is_"not_an_Amanda_tape"?
-
-  Why_does_amcheck_report_"selfcheck_request_timed_out"?
-
-  Why_does_amandad.debug_contain_"error_receiving_message"?
-
-  Why_does_amcheck_say_"access_as_<username>_not_allowed..."?
-
-  Why_does_amcheck_report_"ip_address_#.#.#.#"_is_not_in_the_ip_list_list_for
-  <hostname>'?
-
-  Why_does_amcheck_say_"cannot_overwrite_active_tape"?
-
-  Why_does_amcheck_tell_me_"DUMP_program_not_available"?
-
-  Which_tape_changer_configuration_should_I_use_in_amanda.conf?
-
-  Where_do_I_get_my_tapetype-definition_from?_Do_I_have_to_run_amtapetype?
-
-  Should_I_use_software_or_hardware_compression?
-
-  How_can_I_configure_Amanda_so_that_it_performs_full_backups_on_the_week-end
-  and_incrementals_on_weekdays?
-
-  What_if_my_tape_unit_uses_expensive_tapes,_and_I_don't_want_to_use_one_tape
-  per_day?_Can't_Amanda_append_to_tapes?
-
-  How_can_I_configure_Amanda_for_long-term_archiving?
-
-  Can_I_backup_separate_disks_of_the_same_host_in_different_configurations?
-
-  Can_Amanda_span_large_filesystems_across_multiple_tapes?
-
-  What's_the_difference_between_option_"skip-full"_and_"strategy_nofull"?
-
-  Why_does_amdump_report_"results_missing"?
-
-  Why_does_amdump_report_"disk_offline"?
-
-  What_if_amdump_reports_"dumps_way_too_big,_must_skip_incremental_dumps"?
-
-  amdump_reported_"infofile_update_failed"._What_should_I_do?
-
-  Why_does_Amanda_sometimes_promote_full_dumps?
-
-  Why_does_amrecover_report_"no_index_records"_or_"disk_not_found"?
-
-  Ok,_I'm_done_with_testing_Amanda,_now_I_want_to_put_it_in_production._How_can
-  I_reset_its_databases_so_as_to_start_from_scratch?
-
-  The_man-page_of_dump_says_that_active_filesystems_may_be_backed_up
-  inconsistently._What_does_Amanda_do_to_prevent_inconsistent_backups?
-
-  Which_version_of_GNU-tar_should_I_use?
-
-  What_does_"bumping"_mean?
-
-  How_do_I_backup_a_Windows_server?
-
-  How_do_I_tell_my_iptables-based_firewall_to_allow_Amanda_through?
-
-  How_do_I_get_rid_of_pressing_"q"_to_get_rid_of_a_pager_prompt_when_using
-  amrecover?
-
-  Is_there_a_way_to_tell_the_pager_that_my_terminal_has_"y"_lines?
-
-
- Why does Amanda fail to build on my system?
- One of the most common reasons for compile-time errors is stale information in
- config.cache, after a build on a different platform using the same build tree.
- In order to avoid this problem, make sure you don't ever reuse build trees
- across platforms, or at least run make distclean before running configure on
- another platform.
- Another common reason for failure, that causes link-time errors, is a problem
- in libtool that causes it to search for symbols in already-installed amanda
- libraries, instead of in the just-built ones. This problem is known to affect
- SunOS 4.1.3 and FreeBSD. You can usually work around it by specifying a
- different prefix when you configure the new version of Amanda. However, it may
- not work if the previous version of Amanda was installed in /usr/local and gcc
- searches this directory by default; in this case, you must either remove the
- old libraries (which you don't want to do, right? :-) or call configure with
- the flag --disable-libtool. In this case, Amanda won't create shared
- libraries, so binaries will be larger, but you may worry about that later.
- You may also want to take a look at Amanda_2.5.0_-_System-Specific
- Installation_Notes, as well as to the Amanda Patches Page (http://
- www.amanda.org/patches/) for other known problems. If everything fails, you
- should read the manual, but since we don't have one yet, just post a help
- request to the amanda-users mailing list (mailto://amanda-users@amanda.org),
- showing the last few lines of the failed build.
- Why does amdump report that all disks failed?
- Probably because the Amanda clients are not properly configured. Before you
- ever run amdump, make sure amcheck succeeds. When it does, so should amdump.
- Make sure you run amcheck as the same user that is supposed to start amdump,
- otherwise you may get incorrect results.
- Why does amcheck say "port NNN is not secure"?
- Because amcheck, as some other Amanda programs, must be installed as setuid-
- root. Run make install as "root", or chown all Amanda setuid programs to
- "root", then chown u+s them again, if chown drops the setuid bit.
- Why does amcheck claim that the tape is "not an Amanda tape"?
- Because Amanda requires you to label tapes before it uses them. Run amlabel in
- order to label a tape.
- If, even after labeling a tape, amcheck still complains about it, make sure
- the regular expression specified in amanda.conf matches the label you have
- specified, and check whether you have configured non-rewinding tape devices
- for Amanda to use. For example, use /dev/nrst0 instead of /dev/rst0, /dev/rmt/
- 0bn instead of /dev/rmt/0b, or some other system-dependent device name that
- contains an "n", instead of one that does not. The "n" stands for non-
- rewinding.
- If you have labeled any tapes using the rewiding device configuration, you'll
- have to label them again.
- Why does amcheck report "selfcheck request timed out"?
- This can occur under several different situations. First, make sure this
- problem is repeatable; if Amanda programs are NFS-auto-mounted, some clients
- may fail to mount the Amanda binaries in time.
- If the error is repeatable, log into the client, and check whether the
- directory /tmp/amanda exists, and a file named amandad.debug exists in there:
- amandad will create this file whenever it starts. If this file does not exist,
- amandad is not starting properly, or it lacks permission to create /tmp/
- amanda/amandad.debug.
- In the latter case, wipe out /tmp/amanda, and amandad should create it next
- time it runs. In the former case, check your inetd configuration. Make sure
- you have added the Amanda services to /etc/services (or the NIS services map),
- that /etc/inetd.conf was properly configured, and that you have signalled
- inetd to reread this file (some systems may need rebooting). Check section 2.2
- from in the Amanda_Installation_Notes for details. Check the inetd man-page
- for possible differences between the standard format of /etc/inetd.conf and
- the one in your system.
- Pay special attention to typos in /etc/inetd.conf; error messages will
- probably appear in /var/adm/messages or /var/log/messages if you have typed
- the amandad program name incorrectly. Make sure the same user that you have
- specified at configure-time (configure --with-user=<USERNAME>) is listed in /
- etc/inetd.conf. Check whether this user has permission to run amandad, as well
- as any shared libraries amandad depends upon, by running the specified amandad
- command by hand, as the Amanda user. It should just time-out after 30 seconds
- waiting for a UDP packet. If you type anything, it will abort immediately,
- because it can't read a UDP packet from the keyboard.
- As soon as you have properly configured /etc/inetd.conf so as to run amandad,
- you should no longer get the "selfcheck request timed out" message. A nice
- tool to help make sure inetd is really listening on the amandad port is lsof,
- available at ftp://vic.cc.purdue.edu/pub/tools/unix/lsof.
- Why does amandad.debug contain "error receiving message"?
- One possibility is that you have run amandad from the command line prompt and
- typed anything instead of waiting for it to time-out: in this case, it will
- try to read a UDP packet from the keyboard, and this was reported not to work
- on most keyboards :-). However, if you have run amandad as any user other than
- the one listed in /etc/inetd.conf, it may have created a /tmp/amanda directory
- that the Amanda user cannot write to, so you should wipe it out.
- Another possibility is that the Amanda service was not properly configured as
- a UDP service; check /etc/services and /etc/inetd.conf.
- Why does amcheck say "access as <username> not allowed..."?
- There must be something wrong with .amandahosts configuration (or .rhosts, if
- you have configured --without-amandahosts).
- First, if the <username> is not what you expect (i.e., not what you have
- specified in the --with-user flag, at configure time), check the inetd
- configuration file: you must have specified the wrong username there.
- Make sure you specify the names exactly as they appear in the error message
- after the `@' sign in .amandahosts/.rhosts. You'll need a fully-qualified
- domain name or not, depending on how your client resolves IP addresses to host
- names.
- Why does amcheck report "ip address #.#.#.#" is not in the ip list list for
- <hostname>'?
- Check your DNS configuration tables. In order to avoid DNS-spoofing, Amanda
- double-checks hostname<->IP address mapping. If the IP address the request
- comes from maps to a hostname, but this hostname does not map back to the
- incoming IP address, the request is denied.
- Why does amcheck say "cannot overwrite active tape"?
- Because, if you configure Amanda to use N tapes, by setting tapecycle to N in
- amanda.conf, before Amanda overwrites a tape, it must write to at least other
- N-1 tapes. Of course, Amanda will always refuse to overwrite a tape marked for
- `noreuse' with amadmin. Furthermore, such tapes are not counted when Amanda
- computes `N-1' tapes.
- If, for some reason, you want to tell Amanda to overwrite a particular tape,
- regardless of its position in the cycle, use amrmtape. This command will
- remove this tape from the tapelist file, that is used to manage the tape
- cycle, and will delete information about backups stored in that tape from the
- Amanda database.
- Why does amcheck tell me "DUMP program not available"?
- Because configure could not find dump when it was first run. This is a common
- problem on Linux hosts, because most Linux distributions do not install dump
- by default.
- If you don't have a DUMP program installed, install it, remove config.cache,
- run configure again and rebuild Amanda. While configure is running, make sure
- it can find the installed DUMP program. If it cannot, you may have to set the
- environment variables DUMP and RESTORE by hand, before running configure.
- If you can't or don't want to install DUMP, you may use GNU tar, but make sure
- it as release 1.12 or newer; release 1.11.8 may work, but estimates will be
- slow as hell.
- Which tape changer configuration should I use in amanda.conf?
- If you only have one tape unit, you have two choices:
-
-   i. Don't use a tape changer at all, i.e., set runtapes to 1, set tapedev to
-      the non-rewinding device corresponding to the tape unit, and comment out
-      tpchanger, changerfile and changerdev
-  ii. Set up chg-manual, so that you can change tapes manually. If you select
-      chg-manual, you will not be able to start amdump as a cron job, and you
-      should always run amflush -f, because chg-manual will ask you to press
-      return in the terminal where you started the controlling program.
-
- If you have several tape units, which you want to use to emulate a tape
- changer, you want chg-multi. Even if you do own a real tape changer, that
- operates based on ejecting a tape or such, chg-multi may be useful.
- Actual tape changers usually require specialized changer programs, such as
- mtx, chio or specific system calls. The availability of these programs is much
- more dependent on the operating system you're running than on the particular
- tape changer hardware you have.
- mtx, for example, is available for several platforms. However, even if you
- find it for your platform, beware that there exist several different programs
- named mtx, that require different command line arguments, and print different
- output, and Amanda's chg-mtx does not support them all. You may have to edit
- the script, which shouldn't be hard to do.
- In section BUILT-IN TAPE CHANGERS of Amanda_Tape_Changer_Support you will find
- details about the tape changer interfacing programs provided with Amanda, that
- can interact with common tape changer programs and with tape changer-related
- system calls provided by some operating system. If none of them matches your
- needs, you may have to develop your own tape changer interface script.
- Before posting a question to the Amanda mailing lists, *please* search the
- archives, and try to obtain as much information about driving your tape
- changer hardware from the vendor of the changer hardware and of the operating
- system, rather than from the Amanda mailing lists. We usually don't have much
- to say about tape changer units, and several questions about them remain
- unanswered. :-(
- Anyway, if you decide to post a question, make sure you specify both the tape
- changer hardware *and* the OS/platform that is going to interface with it.
- Good luck! :-)
- Where do I get my tapetype-definition from? Do I have to run amtapetype?
- It is not mandatory to run amtapetype at installation-time. It is very likely
- that your tapedrive or -changer is one of the devices that are already covered
- by one of the existing tapetype-definitions.
- You may find tapetype-definitions in the example amanda.conf, in the
- mailinglist-archives of the amanda-users-mailinglist at http://
- marc.theaimsgroup.com/?l=amanda-users or in the Amanda-FAQ-O-Matic at http://
- www.amanda.org/fom-serve/cache/1.html.
- Reasons to run amtapetype for your device:
-
- * You want to generate your own tapetype-definition because you can't find any
-   suitable tapetype-definition for your device.
- * You want to determine the performance of your device.
- * You want to determine if your device has hardware-compression enabled.
-
- If you decide to run amtapetype, please refer to the chapter Tapetypes and the
- manpage amtapetype(8).
- Should I use software or hardware compression?
- When you enable software compression, you drastically reduce the compression
- that might be achieved by hardware. In fact, tape drives will usually use
- *more* tape if you tell them to try to further compress already compressed
- data.
- Thus, you must choose whether you're going to use software or hardware
- compression; don't ever enable both unless you want to waste tape space.
- Since Amanda prefers to have complete information about tape sizes and
- compression rates, it can do a better job if you use software compression.
- However, if you can't afford the extra CPU usage, Amanda can live with the
- unpredictability of hardware compression, but you'll have to be very
- conservative about the specified tape size, specially if there are filesystems
- that contain mostly uncompressible data.
- You might want to run amtapetype to determine if you have hardware-compression
- enabled for your tape-drive.
- How can I configure Amanda so that it performs full backups on the week-end
- and incrementals on weekdays?
- You can't. Amanda doesn't work this way. You just have to tell Amanda how many
- tapes you have (tapecycle), and how often you want it to perform full backups
- of each filesystem (dumpcycle). If you don't run it once a daily (including
- Saturdays and Sundays :-), you'll also want to tell Amanda how many times
- you'll run it per dumpcycle (runspercycle). It will spread full backups along
- the dumpcycle, so you won't have any full-only or incremental-only runs.
- Please also refer to "the friday-tape-question" in Collection_of_the_top_ten
- Amanda_questions._And_answers..
- What if my tape unit uses expensive tapes, and I don't want to use one tape
- per day? Can't Amanda append to tapes?
- It can't, and this is good. Tape drives and OS drivers are (in)famous for
- rewinding tapes at unexpected times, without telling the program that's
- writing to them. If you have a month's worth of backups in that tape, you
- really don't want them to be overwritten, so Amanda has taken the safe
- approach of requiring tapes to be written from the beginning on every run.
- This can be wasteful, specially if you have a small amount of data to back up,
- but expensive large-capacity tapes. One possible approach is to run amdump
- with tapes only, say once a week, to perform full backups, and run it without
- tape on the other days, so that it performs incremental backups and stores
- them in the holding disk. Once or twice a week, you flush all backups in the
- holding disk to a single tape.
- If you don't trust your holding disk, and you'd rather have all your data on
- tapes daily, you can create an alternate configuration, with two tapes, that
- backs up the holding disk only, always as a full backup. You'd run this
- configuration always after your regular backup, so you always have a complete
- image of the holding disk on tape, just in case it fails.
- How can I configure Amanda for long-term archiving?
- The best approach is to create a separate configuration for your archive
- backups. It should use a separate set of tapes, and have all dumptypes
- configured with `record no', so it doesn't interfere with regular backups.
- Can I backup separate disks of the same host in different configurations?
- Yes, but you have to be careful. Amanda uses UDP to issue estimate and backup
- requests and, although replies to backup requests are immediate (so that TCP
- connections for the actual backup can be established), replies to estimate
- requests are not and, while one request is being processed, any other request
- is ignored. The effect is two-fold:
-
-   i. If another configuration requests for estimates, the request will be
-      ignored, and the requester will end up timing out;
-  ii. If another configuration has already finished the estimates, and is now
-      requesting for backups, the backup requests will time-out.
-
- So, there are two easy ways out:
-
-   i. Ensure that the configurations never run concurrently, or
-  ii. set up two different installations of the Amanda server, using different
-      services names to contact the clients, i.e., different port numbers. This
-      can be attained with the configure flag --with-testing=<service-suffix>.
-      Yes, the flag name is not appropriate, but so what?
-
- If you don't want to set up two installations of Amanda (I agree, it's
- overkill), but you still want to back up disks of the same host in separate
- configurations, you can set up Amanda so that one configuration only starts
- after the first one has already finished its One possible way to work-around
- this limitation is to start one configuration only after you know the
- estimates for the first one have already finished (modifying the crontab
- entries, according to history data). You'll also have to delay the starttime
- (a dumptype option) of the disks in the first configuration, so that they
- don't start backing up before the estimates of the second configuration
- finish.
- Can Amanda span large filesystems across multiple tapes?
- Not yet :-(
- This is an open project, looking for developers. If you'd like to help, please
- take a look at the Amanda Ongoing Projects Page (http://www.amanda.org/
- ongoing.php), where more up-to-date information is likely to be found about
- this project.
- Update September 2004: Refer to the archive of the amanda-hackers mailinglist
- (http://marc.theaimsgroup.com/?l=amanda-hackers). A patch by John Stange is
- being discussed there, which allows splitting and spanning.
- The current work-around is to use GNU tar to back up subdirectories of the
- huge filesystem separately. But be aware of the problems listed in the
- question about "results missing".
- What's the difference between option "skip-full" and "strategy nofull"?
- "strategy nofull" is supposed to handle the following situation: you run a
- full dump off-line once a millenium :-), because that disk isn't supposed to
- change at all and, if it does, changes are minimal. Amanda will run only level
- 1 backups of that filesystem, to avoid the risk of overwriting a level 1
- backup needed to do a restore. Remember, you run full dumps once a millenium,
- and your tape cycle probably won't last that long :-)
- "skip-full", OTOH, is supposed to let the user run full dumps off-line
- regularly (i.e., as often as specified in the dumpcycle), while Amanda takes
- care of the incrementals. Currently, Amanda will tell you when you're supposed
- to run the level 0 backups but, if you fail to do so, Amanda will not only
- skip a full day's worth of valuable backups of the filesystem, on the day it
- told you to the full backup manually, but it will also run a level 1 backup on
- the next day, even if you have not performed the full backup yet. Worse yet:
- it might perform a level 2 on the next day, just after you have run the level
- 0, so, if the disk should crash, you'd have to restore a level 0 then a level
- 2, but not the level 1! Not a real problem, but definitely strange, eh?
- Why does amdump report "results missing"?
- One of the possible reasons is that you have requested too many backups of the
- host. In this case, the estimate request or the reply may not fit in a UDP
- packet. This will cause Amanda not to perform some of the backups. Fixing this
- problem involves modifying the way estimate requests are issued, so that no
- packet exceeds the maximum packet size, and issuing additional requests that
- did not fit in a UDP packet after a reply for the previous set is obtained.
- The probability of getting this problem has been considerably reduced since we
- increased the maximum UDP packet size from 1Kb to 64Kb, but some operating
- systems may not support such large packets.
- One possible work-around is to try to shorten the pathnames of the directories
- and the exclude file names, so that more requests fit in the UDP packet. You
- may create short-named links in some directory closer to the root (/) so as to
- reduce the length of names. I.e., instead of backing up /usr/home/foo and /
- usr/home/bar, create the following links:
-
-   /.foo -> /usr/home/foo
-   /.bar -> /usr/home/bar
-
- then list /.foo and /.bar in the disklist.
- Another approach is to group sub-directories in backup sets, instead of
- backing up them all separately. For example, create /usr/home/.bkp1 and move
- `foo' and `bar' into it, then create links so that the original pathnames
- remain functional. Then, list /usr/home/.bkp1 in the disklist. You may create
- as many `.bkp<N>' directories as you need.
- A simpler approach, that may work for you, is to backup only a subset of the
- subdirectories of a filesystem separately. The others can be backed up
- together with the root of the filesystem, using an exclude list that prevents
- duplicate backups.
- Why does amdump report "disk offline"?
- Well, assuming the disk is not really off line :-), it may be a permission
- problem, but then, amcheck would have reported it.
- Another possible reason for this failure is a filesystem error, that causes
- DUMP to crash before it estimates the backup size; a fsck may help.
- Yet another possibility is that the filesystem is so large that the backup
- program is incorrectly reporting the estimated size, for example, by printing
- a negative value that Amanda will not accept as a valid estimate. If you are
- using dump, contact your vendor and request a patch for dump that fixes this
- bug. If you are using GNU-tar, make sure it is release 1.12 or newer; 1.11.8
- won't do! Even release 1.12 may require a patch to correctly report estimates
- and dump sizes, as well as to handle sparse files correctly and quickly
- instead of printing error messages like `Read error at byte 0, reading 512
- bytes, in file ./var/log/lastlog: Bad file number' in sendsize.debug and being
- very slow. Check the patches directory of the Amanda distribution.
- What if amdump reports "dumps way too big, must skip incremental dumps"?
- It means Amanda couldn't back up some disk because it wouldn't fit in the tape
- (s) you have configured Amanda to use. It considered performing some
- incrementals instead of full dumps, so that all disks would fit, but this
- wouldn't be enough, so the disk really had to be dropped in this run.
- In general, you can just ignore this message if it happens only once in a
- while. Low-priority disks are discarded first, so you'll hardly miss really
- important data.
- One real work-around is to configure Amanda to use more tapes: increase
- `runtapes' in amanda.conf. Even if you don't have a real tape changer, you can
- act yourself as a changer (`chg-manual'; more details in the question about
- tape changer configuration), or use `chg-multi' with a single tape unit, and
- lie to Amanda that it will have two tapes to use. If you have a holding disk
- as large as a tape, and configure Amanda (2.4.1b1 or newer) not to reserve any
- space for degraded dumps, dumps that would be stored in the second tape of a
- run will be performed to the holding disk, so you can flush them to tape in
- the morning.
- amdump reported "infofile update failed". What should I do?
- Make sure all directories and files are readable and writable by the Amanda
- user, within the directory you specified as `infofile' in amanda.conf. From
- then on, only run amanda server commands ( amadmin, amdump, amflush,
- amcleanup) as the Amanda user, not as root.
- Why does Amanda sometimes promote full dumps?
- To spread the full dumps along the dumpcycle, so that daily runs take roughly
- the same amount of tape and time. As soon as you start using Amanda, it will
- run full dumps of all filesystems. Then, on the following runs, it will
- promote some backups, so as to adjust the balance. After one or two
- dumpcycles, it should stop promoting dumps. You can see how well it is doing
- with amadmin <conf> balance. If you find the results surprising, you may want
- to adjust dumpcycle or runspercycle.
- Why does amrecover report "no index records" or "disk not found"?
- The most common cause of this problem is not having enabled index generation
- in amanda.conf. The `index yes' option must be present in every dumptype for
- whose disks indexes should be generated.
- Another possibility is that amrecover is not selecting the configuration name
- that contains the backups for the selected disk. You may specify a
- configuration name with the `-C' switch, when you invoke amrecover. The
- default configuration name can only be specified at Amanda configure time
- (configure --with-config=<name>).
- Indexes are currently generated at backup-time only, so, if a backup was
- performed without creating an index, you won't be able to use amrecover to
- restore it, you'll have to use amrestore.
- Ok, I'm done with testing Amanda, now I want to put it in production. How can
- I reset its databases so as to start from scratch?
- First, remove the `curinfo' database. By default, it is a directory, but, if
- you have selected any other database format (don't, they're deprecated), they
- may be files with extensions such as .dir and .pag.
- Then, remove any log files from the log directory: log.<TIMESTAMP>.<count> and
- amdump.<count>. Finally, remove the tapelist file, stored in the directory
- that contains amanda.conf, unless amanda.conf specifies otherwise. Depending
- on the tape changer you have selected, you may also want to reset its state
- file.
- The man-page of dump says that active filesystems may be backed up
- inconsistently. What does Amanda do to prevent inconsistent backups?
- Nothing. When you back up an active filesystem, there are two possibilities:
- dump may print strange error messages about invalid blocks, then fail; in this
- case, Amanda will retry the backup on the next run.
- Files that are modified while dump runs may be backed up inconsistently. But
- then, they will be included in the next incremental backup, which should
- usually be enough.
- Large, critical files such as databases should be locked somehow, to avoid
- inconsistent backups, but there's no direct support for that in Amanda. The
- best bet is to configure Amanda to use a wrapper to dump, that locks and
- unlocks the database when appropriate.
- Which version of GNU-tar should I use?
- (This answer was slightly adapted from a posting by Paul Bijnens
- <paul.bijnens@xplanation.com>, Mon, 11 Apr 2005):
-
- * 1.13.19 is good.
-   However it still sets return code 2 for some infrequent conditions even with
-   --ignore-failed-read option. This results in Amanda thinking the total
-   archive is bad, and drops the complete archive. Those conditions are very
-   rare on a quiet filesystem.
- * 1.13.25 is good: no problems found (yet).
- * 1.13.9x is not good.
-   It has changed the format of "tar -t", resulting in amrecover not able to
-   use the indexes.
- * 1.14.x is not good.
-   It writes good archives, but when restoring, it has trouble with sparse
-   files; the sparse file itself, and *all* files after it cannot be read
-   anymore. But you can read the archive with a good tar version (i.e. the tar
-   images produced are fine).
- * 1.15.1 is good: no problems found (yet).
-   Paul Bijnens: "I'm using this version on most of my clients since january
-   this year (2005), and have already done successful restore too."
-
- What does "bumping" mean?
- The term "bumping" is used to describe the change from one backup-level to the
- next higher level. If Amanda changes from Level 0 to Level 1 for a specific
- DLE, it "bumps".
- The basic goal of "bumping" is to save precious space on the backup media as
- higher level incremental backups are smaller in size than lower level
- incremental backups.
- The disadvantage of increasing backup levels is the fact that restoring from
- higher level incremental backups needs more tapes. This increases the amount
- of work time that are needed to fully restore a DLE as well as the possibility
- of tape-errors and similar problems during the process of restore. So in
- general it is recommended to keep the levels as low as possible with the given
- hardware and data.
- There are various amanda.conf parameters to control and fine-tune Amanda's
- behavior when it comes to "bumping":
- Please refer to the amanda-manpage and the example amanda.conf for details on
- the parameters bumppercent, bumpsize, bumpdays and bumpmult.
- How do I backup a Windows server?
- Amanda is able to use smbclient to dump SMB/CIFS-shares. Refer to the Backup
- PC_hosts_using_Samba for details.
- How do I tell my iptables-based firewall to allow Amanda through?
- posted by Matt Hyclak <hyclak@math.ohiou.edu>:
- Use something like
-
-        iptables -A INPUT -p udp -s $AMANDA_SERVER -d $AMANDA_CLIENT --dport
-   10080 -j ACCEPT
-
- and load the ip_conntrack_amanda kernel module. I use the following in /etc/
- modprobe.conf:
-
-        options ip_conntrack_amanda master_timeout=2400
-        install ip_tables /sbin/modprobe --ignore-install ip_tables && /sbin/
-   modprobe ip_conntrack_amanda
-
- This sets the UDP timeout for Amanda packets to 2400 seconds, up from the
- default 300 (don't hold me to that, it might be 600). I was getting estimate
- timeouts since they were taking longer than 300/600 seconds and the firewall
- would close the port.
- Makes things a little more secure than opening up everything > 1024 ;-)
- How do I get rid of pressing "q" to get rid of a pager prompt when using
- amrecover?
- compiled from postings by Paul Bijnens <paul.bijnens@xplanation.com> and Jon
- LaBadie <jon@jgcomp.com>
- Paul Bijnens wrote:
- If you have to press "q" all the time in amrecover this is related to the
- pager-binary you use. If you use Linux this will be most likely less. To teach
- less to quit when hitting EOF, you need to set something like LESS=--QUIT-AT-
- EOF; export LESS, for example in your .profile. Refer to the manpage of less
- for details.
- Jon LaBadie wrote:
- If you don't like the quit at EOF behavior "except" when in amrecover create
- an alias or a wrapper; something like:
- alias amrecov='LESS="$LESS -E" _pathto_your_amrecover'
- Is there a way to tell the pager that my terminal has "y" lines?
- Jon LaBadie <jon@jgcomp.com> wrote:
- The pager normally does it's best to find out how many lines your terminal
- has, given the right TERM-variable. Even terminals with elastic boundaries
- (e.g. xterms) work. But I have to admit that on Solaris the settings are not
- always correct. You can fix it quickly by setting an environment variable to
- e.g. LINES=24 (and export it).
-
-
-Note
-
-Refer to http://www.amanda.org/docs/faq.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                       Up                                           Next
-Chapter 18. Using Amanda  Home  Chapter 20. Collection of the top ten Amanda
-                                                     questions. And answers.
-
diff --git a/docs/historical.txt b/docs/historical.txt
deleted file mode 100644 (file)
index c97fc9e..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-
-Part VI. Historical files
-Prev                 Next
-
--------------------------------------------------------------------------------
-
-
-Part VI. Historical files
-
-
-
-Old and outdated material, proposals and drafts.
-
-Here you find some chapters which contain outdated informations. These chapters
-nonetheless can help to get a more complete picture of Amanda.
-
-Note
-
-Please realize that the following does not necessarily describe current
-features of Amanda. There are also features described which were never added to
-Amanda.
-Table of Contents
-
-
-  29._Response_to_CPIO_Security_Notice_Issue_11:
-
-
-        Affected_Versions
-
-        Workaround
-
-        Acknowledgements
-
-
-  30._Upgrade_Issues
-
-  31._What_once_was_new
-
-
-        What's_new_in_Amanda_2.3
-
-
-              Indexing_backups_for_easier_restore
-
-              Samba_Support
-
-              GnuTar_Support
-
-              Multiple_backups_in_parallel_from_one_client_host
-
-              Multiple_tapes_in_one_run
-
-              Bottleneck_determination
-
-              2_Gb_limit_removed
-
-              amadmin_import/export
-
-
-        What's_new_in_Amanda_2.2
-
-
-              Client_side_setup_has_changed
-
-              Version_suffixes_on_executables
-
-              Kerberos
-
-              Multiple_holding_disks
-
-              Remote_self-checks
-
-              mmap_support
-
-              gzip_support
-
-              Mount_point_names_in_disklist
-
-              Initial_tape-changer_support_included
-
-              Generic_tape_changer_wrapper_script
-
-              New_command_amtape
-
-              Changer_support_added_to_command_amlabel
-
-              Tape_changer_support_improved
-
-              A_few_words_about_multi-tape_runs
-
-              Big_planner_changes
-
-              Level-0_dumps_allowed_with_no_tape
-
-
-
-  32._Multitape_support_in_Amanda_2.2
-
-
-        Introduction
-
-        New_Planner_Algorithm
-
-
-              Time
-
-              Full_Backups
-
-              Schedule_Balancing
-
-              Overwrite_Detection
-
-
-        Taper_Algorithm
-
-
-              Choosing_a_tape
-
-              End_of_tape_handling
-
-              Tape_Format_Changes
-
-              Tapelist_File_Changes
-
-
-
-  33._Thoughts_about_a_Strategy_API
-
-  34._Y2K_Compliancy
-
-  35._Usage_of_floppy_tape_drives_on_Linux
-
--------------------------------------------------------------------------------
-
-Prev                                                                   Next
-Chapter 28. Using Kerberos with Home  Chapter 29. Response to CPIO Security
-Amanda                                                     Notice Issue 11:
-
diff --git a/docs/howto-afs.txt b/docs/howto-afs.txt
deleted file mode 100644 (file)
index 481ac54..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-     Chapter 14. AFS HOWTO
-Prev  Part III. HOWTOs  Next
-
--------------------------------------------------------------------------------
-
-Chapter 14. AFS HOWTO
-
-
-Amanda Core Team
-
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-You need to download the following package if you want to backup AFS volume
-with amanda:
-ftp://ftp.ccmr.cornell.edu/pub/amanda-afs/amanda-afs.tar.gz
-or anonymous cvs from :pserver:anonymous@cvs.ccmr.cornell.edu:/usr/common/cvs
-and checkout project 'amanda-afs'
-The patch to Amanda is already included in this distribution.
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-afs.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                     Up                               Next
-Chapter 13. How to use the Amanda file- Home  Chapter 15. How to use a wrapper
-driver 
-
diff --git a/docs/howto-auth.txt b/docs/howto-auth.txt
deleted file mode 100644 (file)
index 6098b4a..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-
-Chapter 17. How to use different auth with Amanda
-Prev  Part III. HOWTOs                       Next
-
--------------------------------------------------------------------------------
-
-Chapter 17. How to use different auth with Amanda
-
-
-Jean-Louis Martineau
-
-Original text;XML-conversion;Updates
-AMANDA Core Team
-<martinea@iro.umontreal.ca>
-Table of Contents
-
-
-  Introduction
-
-  BSD
-
-  BSDTCP
-
-  BSDUDP
-
-  KRB4
-
-  KRB5
-
-  RSH
-
-  SSH
-
-
-        For_amdump:
-
-        For_amrecover:
-
-
-This document covers the use of the auth in Amanda 2.5.1 and higher.
-
-Introduction
-
-
- BSD
-
-You must configure amanda with --with-bsd-security and --with-amandahosts.
-The xinetd.d/amanda file on the client:
-
-  service amanda
-  {
-        only_from               = 127.0.0.1
-        socket_type             = dgram
-        protocol                = udp
-        wait                    = yes
-        user                    = amanda
-        group                   = amanda
-        groups                  = yes
-        server                  = /path/to/amandad
-        server_args             = -auth=bsd amdump
-        disable                 = no
-  }
-
-The only_from line should list your tape server ip address.
-The ~amanda/.amandahosts file on the client:
-
-  tapeserver.fqdn amanda amdump
-
-If you want to also enable amindexd and amidxtaped, you must change the
-server_args line in the xinetd.d/amanda file on the tape server:
-
-        server_args             = -auth=bsd amdump amindexd amidxtaped
-
-The only_from line should list all machine that can use amdump/amrecover. It's
-the .amandahosts that will limit which client can use amdump/amindexd/
-amidxtaped.
-The ~amanda/.amandahosts file on the tape server must have a line for each
-machi ne:
-
-  clientmachine1 amanda amindexd amidxtaped
-  clientmachine2 amanda amindexd amidxtaped
-
-
- BSDTCP
-
-Like bsd but you must configure amanda with --with-bsdtcp-security and --with-
-amandahosts and do 4 changes in the xinetd.d/amanda file:
-
-        socket_type             = stream
-        protocol                = tcp
-        wait                    = no
-        server_args             = -auth=bsdtcp amdump
-
-
- BSDUDP
-
-Like bsd but you must configure amanda with --with-bsdudp-security and --with-
-amandahosts and do 1 change in the xinetd.d/amanda file:
-
-        server_args             = -auth=bsdudp amdump
-
-
- KRB4
-
-You must configure amanda with --with-krb4-security.
-
- KRB5
-
-You must configure amanda with --with-krb5-security.
-
- RSH
-
-You must configure amanda with --with-rsh-security.
-It's your system that should allow your server user to rsh to your client user.
-If your server username and client username are different, you must add the
-client_username option in all DLE for that host.
-
-  client_username "client_username"
-
-If your server amandad path and client amandad path are different, you must set
-the amandad_path option in all DLE for that hosts.
-
-  amandad_path "client/amandad/path"
-
-
- SSH
-
-You must configure amanda with --with-ssh-security.
-
- For amdump:
-
-You must create an ssh key for your server. In this example, the key is put in
-the id_rsa_amdump file:
-
-  ssh-keygen -t rsa
-  Enter file in which to save the key (/home/amanda/.ssh/id_rsa)? /home/
-  amanda/.ssh/id_rsa_amdump
-
-You must set the ssh_keys option in all DLE for that host:
-
-  ssh_keys "/home/amanda/.ssh/id_rsa_amdump"
-
-You mush append the /home/amanda/.ssh/id_rsa_amdump.pub file to the .ssh/
-authorized_keys file of all client host.
-For security reason, you must prepend the line with the following:
-
-  from="tape_server_fqdn_name",no-port-forwarding,no-X11-forwarding,no-agent-
-  forwarding,command="/path/to/amandad -auth=ssh amdump"
-
-That will limit that key to connect only from your server and only be able to
-execute amandad.
-Like rsh if your server username and client username are different, you must
-add the client_username option in all DLE for that host:
-
-  client_username "client_username"
-
-Like rsh, if your server amandad path and client amandad path are different,
-you must set the amandad_path option in all DLE for that hosts:
-
-  amandad_path "client/amandad/path"
-
-
- For amrecover:
-
-You must create an ssh key for root on all clients that can use amrecover. In
-this example, the key is put in the /root/.ssh/id_ rsa_amrecover file:
-Log in as root:
-
-  ssh-keygen -t rsa
-  Enter file in which to save the key (/root/.ssh/id_rsa)? /root/.ssh/
-  id_rsa_amrecover
-
-You must set the ssh_keys option in the amanda_client.conf file
-
-  ssh_keys "/root/.ssh/id_rsa_amrecover"
-
-You mush append all client /home/root/.ssh/id_rsa_amrecover.pub file to the /
-home/amanda/.ssh/authorized_keys of the server.
-For security reason, you must prefix all lines with the following:
-
-  from="aclient_fqdn_name",no-port-forwarding,no-X11-forwarding,no-agent-
-  forwarding,command="/path/to/amandad -auth=ssh amindexd amidxtaped"
-
-That will limit every client key to connect from the client and only be able to
-execute amandad.
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-auth.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                      Up                           Next
-Chapter 16. How to do Amanda-server-side Home  Part IV. Various Information
-gpg-encrypted backups. 
-
diff --git a/docs/howto-cygwin.txt b/docs/howto-cygwin.txt
deleted file mode 100644 (file)
index 6f2e403..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-
-Chapter 12. Amanda on Cygwin HOWTO
-Prev  Part III. HOWTOs        Next
-
--------------------------------------------------------------------------------
-
-Chapter 12. Amanda on Cygwin HOWTO
-
-
-Doug Kingston
-
-Original text<dpk@randomnotes.org>
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Install_Cygwin
-
-  Other_Preparation
-
-  Compile_Amanda
-
-  Configure_Cygwin_files
-
-  Configure_Windows_System_Files
-
-  Configure_inetd_to_run_automatically_as_a_service
-
-  Windows_98/ME
-
-  Windows_NT/2000/XP
-
-  Notes_on_Amanda_backup_options
-
-
-        Compression
-
-        Exclude_Lists
-
-        Debugging_Files
-
-
-by Doug Kingston, 30 January 2003. Based on Cygwin 1.3.18, and Amanda 2.4.3-
-20021027 and some fixes which will be in the official release by the time you
-see this.
-With thanks to Enrico Bernardini from whom I have borrowed some material from
-an earlier attempt at documenting the installation of Amanda on Cygwin in 2001.
-Please send annotations and corrections to mailto://amanda-hackers@amanda.org.
-I can be reached as dpk (at) randomnotes.org (do the obvious).
-
- Install Cygwin
-
-The following Cygwin packages are required for binary installation (may be
-incomplete):
-
-* Category BASE: standard
-* Category MISC: gzip
-* Category MISC: tar
-* Category NET: inetutils
-
-You need also these packages to build from source (may be incomplete):
-
-* Category DEVELOP: ALL
-* Category INTERPRETERS: m4, gawk ?
-* Category LIBS:default selection? (libc, libiconv, others?)
-
-I have most or the basic utilities and libraries installed so I cannot give you
-a more specific list of what is required. If someone has a more definitive
-list, I would appreciate and email to mailto://amanda-hackers@amanda.org.
-One user reported some problems with access rights when running under Cygwin,
-which he solved by setting the CYGWIN environment variable to nontsec. I do not
-believe this is necessary if you run the Amanda daemon as System (see below).
-
- Other Preparation
-
-When doing backups on a NT, Windows 2000 or Windows XP system, the choice of
-user and group will be important if you are to properly interact with the
-security mechanisms of these more modern Microsoft product. For Windows 95/98/
-ME this is probably a non-issue. The most privileged account on the Windows
-systems is 'System', and I have chosen to use this account for Amanda backups
-to ensure that I can access the widest set of files. On Unix we would run as
-root, with equivalent access permissions. I have also chose to run under the
-'Administrators' group, another standard Windows group. Ensure these exist
-before you continue - or identify another account to use. The Cygwin
-installation postinstall script should have already populated /etc/passwd and
-etc/group with these entries.
-
-* Make sure that System (or SYSTEM) has a home directory specified in /etc/
-  passwd.
-
-I used _/home/root_. You'll need to put the file .amandahosts here later. The
-relevant lines from my file /etc/passwd are:
-
-  SYSTEM:*:18:18:,S-1-5-18:/home/root:
-  root:*:18:18:,S-1-5-18:/home/root:
-
-
- Compile Amanda
-
-After installing Cygwin, unpack the Amanda sources, typically in /usr/src/
-Amanda or something similar. In the Amanda directory, you will need to execute:
-
-  automake  # this may not be necessary in the official release
-  autoconf  # this may not be necessary in the official release
-
-  ./configure --without-server \
-    --without-force-uid \
-    --with-user=yourlogin \
-    --with-group=Administrators
-  make
-  make       # yes, I needed to run it a second time
-  make install
-
-The use of your own login instead of SYSTEM requires some explanation. If you
-were to call runconfigure with SYSTEM instead of your own login id as part of
-the -with-user parameter, the installation process will fail due to the way
-Cygwin and the NT/W2K/XP security system interact. Once you chown a file to
-another user (like SYSTEM) you are no longer able to chgrp or chmod the file.
-The installation process will abort at this point. By installing the files
-owned by yourself, you will be able to chgrp and chmod them as expected. Note
-that you still RUN as SYSTEM from /etc/inetd.conf (see below).
-
- Configure Cygwin files
-
-You have to modify some config files:
-
-* /etc/inetd.conf: cleanup un-needed entries: Comment out any entries you do
-  not need by placing a '#' at the start of the lines. This is just good
-  practice, and if any of the entries reference non- existent users (e.g. uucp)
-  inetd may not start up.
-
-
-* /etc/inetd.conf: add
-
-               amanda dgram udp wait System /usr/local/libexec/amandad amandad
-
-  ATTENTION: Use tabs, don't use spaces.
-
-
-* create _/home/root/.amandahosts_ (or whereever System's home directory is):
-  <amanda server> <amanda user>
-
-Then create the following Amanda directories and the file amandates:
-
-       mkdir -p /usr/local/var/amanda/gnutar-lists
-
-       mkdir /tmp/amanda
-
-       touch /etc/amandates
-
-
- Configure Windows System Files
-
-Update the Windows services list
-
-* WINDIR\Services: add
-
-               amanda  10080/udp       # Amanda backup services
-               amandaidx       10082/tcp       # Amanda backup services
-               amidxtape       10083/tcp       # Amanda backup services
-
-
-where WINDIR is C:\WINNT\system32\drivers\etc or something similar. The last
-two lines are needed if you want to use amrecover.
-Ensure that the default Windows PATH environment variable include your Cygwin /
-bin directory. This is necessary since inetd and hence the amandad that it
-spawns will not have the advantage of being started by the standard bash shell
-startup script and won't find the needed dynamic libraries (e.g. cygwin1.dll).
-My PATH is:
-
-  _%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin_
-
-This is on XP; My Computer, right click Properties, click on Environment
-Variables (at the bottom). Yours may vary, but make sure the Cygwin bin
-directory is represented somewhere in the PATH.
-
- Configure inetd to run automatically as a service
-
-If you want to test your installation, you can call inetd from bash prompt:
-
-  /usr/sbin/inetd -d
-
-
- Windows 98/ME
-
-
-* To start after the user logs in: Create a shortcut to c:
-  \cygwin\usr\sbin\inetd.exe in WINDIR\start menu\programs\startup
-
-
-* To start before the user logs in: Add the string key
-
-    CygwinInetd=C:\cygwin\usr\sbin\inetd.exe
-
-  under
-
-    HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
-
-  in the registry. You'll see a dos-like window on the startup: I did not find
-  a solution to iconize or to make invisible (suggestions are welcome).
-
-
- Windows NT/2000/XP
-
-From bash prompt, type:
-
-  /usr/sbin/inetd --install-as-service
-
-Then, to start/stop the inetd service use the Services control panel or the
-following Windows command:
-net start/stop inetd
-
- Notes on Amanda backup options
-
-
- Compression
-
-Currently, client side compression does not work, probably due to problems in
-pipe emulation in Cygwin. I have not tried to debug this yet. This may be
-addressed in a subsequent release, or it could be fixed in later releases of
-Cygwin. Due to this issue, we recommend that if you want compressed dumps from
-Windows clients, you configure Amanda for server compression in amanda.conf on
-your Amanda server:
-
-  define dumptype srv-comp-tar {
-      global
-      comment "partitions dumped via tar with server compression"
-      program "GNUTAR"
-      compress server fast
-      exclude list ".Amanda.exclude"
-  }
-
-
- Exclude Lists
-
-A note on exclude lists is also in order. If you specify a relative path, it
-will be expected that the file is in or relative to the root of the directory
-you are planning to dump. Typically this will not be '/' but '/cygdrive/c' or
-something similar if you want to get the Windows files and the Cygwin files. '/
-' is taken to be the root of the Cygwin tree, normally something like C:
-\cygwin or possibly C:\Program Files\cygwin.
-
- Debugging Files
-
-Amanda will leave debugging files in /tmp/amanda if it exists. I have
-recommended to create this directory above.
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-cygwin.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev               Up                                            Next
-Part III. HOWTOs  Home  Chapter 13. How to use the Amanda file-driver
-
diff --git a/docs/howto-filedriver.txt b/docs/howto-filedriver.txt
deleted file mode 100644 (file)
index 0d31047..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-
-Chapter 13. How to use the Amanda file-driver
-Prev  Part III. HOWTOs                   Next
-
--------------------------------------------------------------------------------
-
-Chapter 13. How to use the Amanda file-driver
-
-
-Stefan G. Weichinger
-
-Original text;XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  Possible_Uses
-
-  Setup
-
-
-        Basics
-
-
-  Recovery
-
-This document covers the use of the file-driver in Amanda 2.4.3 and higher.
-Examples given here have been taken from a SuSE-Linux-8.2-Pro-environment,
-using Amanda 2.4.4p1 and the snapshot 2.4.4p1-20031202. Please adjust paths,
-configuration names and other parameters to your system.
-Stefan G. Weichinger, November - December, 2003 ; minor updates in April, 2005.
-
-Introduction
-
-Since release 2.4.3 Amanda supports the usage of a output driver called "file".
-See man amanda, section OUTPUT DRIVERS, for more information on its
-implementation. As the name suggests, this driver uses files as virtual (or
-file) tapes. Once created and labeled, these file tapes can be selected and
-changed with the standard tape-changer-interface of the Amanda server.
-
- Possible Uses
-
-
-* test installations
-  You can easily explore the rich features of Amanda on systems without tape
-  drives.
-* cheap installations
-  Without buying a tape drive you can enjoy the benefits of Amanda and backup
-  to a bunch of harddisks. You can create CD/DVD-sized backups which you can
-  burn onto optical disks later.
-* disk-based installations
-  You can use the file-driver to backup onto a set of file tapes hosted on a
-  bunch of hard-disks or a RAID-system. Combined with another Amanda-
-  configuration that dumps the file tapes to real tapes, you can provide
-  reliable backup with faster tapeless recovery. This is called "disk-to-disk-
-  to-tape"-backup by some people today.
-
-
- Setup
-
-
- Basics
-
-This guide assumes you have setup the basic Amanda-services as described in
-Amanda_Installation_Notes
-The configuration in this HOWTO is called "daily". The file tapes are also
-called  vtapes in this document, which stands for "virtual tapes".
-Please be sure to understand the differences between holding disks and file
-tapes. The two serve different purposes; holding disks allow for parallelism of
-multiple DLE's being backed up while file tapes are a replacement for physical
-tapes.
-Before beginning you will need to decide on (a) dedicated part(s) of your hard
-disk(s) for your file tape storage. While this space could be spread among
-several file systems and hard disks, I recommend to dedicate at least a
-specific partition, better a specific physical harddisk to the task of keeping
-your vtapes. The use of a dedicated disk will speed things up definitely.
-The disk space you dedicate for your vtapes should NOT be backed up by Amanda.
-Also, for performance reasons there should be NO holding disks on the same
-partition as the vtapes, preferably not even on the same physical drive.
-If you only have one harddisk, it will work out, too, but you will suffer low
-performance due to massive head-moving in your harddisk, resulting from copying
-data between the filesystems.
-Steps
-
-  1. Prepare the filesystem(s) used for the tapes.
-     Decide on where to put your files, create the appropriate partition(s) and
-     filesystem(s) and mount them.
-     In our example we have the dedicated partition hdc1, mounted on /
-     amandatapes for vtape storage.
-
-               $ mount
-               [...]
-               /dev/hdc1 on /amandatapes type reiserfs (rw)
-               [...]
-               
-
-     Make sure there is space left. Determine the amount of space you will use.
-
-               $ df -h /amandatapes
-               Filesystem      Size  Used  Avail  Use%   Mounted on
-               /dev/hdc1        20G    0G    20G    0%   /amandatapes
-               
-
-     In our example we have 20GB diskspace left on /amandatapes.
-  2. Determine length and number of tapes
-     After deciding on the number of vtapes you want to create, evenly allocate
-     the available space among them.
-     Look at the following rule of thumb:
-     As many filesystems exhibit dramatically reduced performance when they are
-     nearly full I have chosen to allocate only 90% of the available space. So
-     we have:
-     (Available Space * 0.9) >= tapelength * tapecycle
-     This is a very conservative approach to make sure you don´t suffer any
-     performance drop due to a nearly-full-filesystem.
-     As it is uncommon for Amanda to fill, or almost fill an entire tape you
-     may also wish to use more space than that.
-     So you could determine possible combinations of tapelength/tapecycle with
-     the more general formula:
-     Available Space >= tapelength * tapecycle
-     In our example we take the conservative approach:
-
-     * 20 GB * 0.9 = 18 GB to use
-       and so we could create the following combinations:
-
-
-     * 18 GB = 18 GB * 1
-     * 18 GB = 9 GB * 2
-     * 18 GB = 6 GB * 3
-     * 18 GB = 3 GB * 6
-     * 18 GB = ......... you get the picture.
-
-     Using only one tape is generally considered a bad idea when it comes to
-     backup, so we should use at least 3 tapes (for testing purposes), better 6
-     or more tapes.
-
-     * 18 GB = 3 GB * 6
-       so we get the value 3 GB for the tapelength if we want to use 6 tapes.
-
-  3. Create a tapetype definition.
-     Add a new tapetype definition similar to the following to your
-     amanda.conf. I named my definition "HARD-DISK". Choose whatever name you
-     consider appropriate.
-
-               define tapetype HARD-DISK {
-                       comment "Dump onto hard disk"
-                       length 3072 mbytes      # specified in mbytes to get the exact size of 3GB
-               }
-               
-
-     You don´t have to specify the parameter speed (as it is commonly listed in
-     tapetype definitions and reported by the program amtapetype). Amanda does
-     not use this parameter right now.
-     There is also an optional parameter filemark, which indicates the amount
-     of space "wasted" after each tape-listitem. Leave it blank and Amanda uses
-     the default of 1KB.
-  4. Think about tapechangers.
-     As you will use a set of vtapes, you have to also use a kind of vtape-
-     changer. There are several tape-changer-scripts included in the Amanda-
-     tarball. Read more about tape-changer-scripts in Amanda_Tape_Changer
-     Support.
-     Right now there are two scripts that can be used with vtapes. These
-     scripts take different approaches to the handling of tapes.
-     The script chg-multi handles many drives with a tape in each drive. The
-     script chg-disk handles a library with one drive and multiple tapes.
-     So with vtapes you could look at it this way:
-     chg-multi simulates multiple tape drives with one tape in each drive. chg-
-     disk simulates one tape-library with multiple tapes in.
-     As chg-multi exists for a much longer time than chg-disk, it is still used
-     in many Amanda-vtape-installations.
-     chg-disk was introduced with the snapshot 20031202. Contrary to chg-multi,
-     which is a generic changer-script that must be somewhat adjusted to the
-     use of the file-driver, chg-disk offers exactly the behavior needed for
-     handling vtapes
-     IMHO the approach is much more logical, so I recommend to use chg-disk in
-     new Amanda-vtape-installations.
-
-     Note
-
-     To use chg-disk you need to have at least amanda-2.4.4p1-20031202.
-     Choose the one that fits your way of vtape-handling and -maintenance.
-     In this HOWTO I only cover the use of chg-disk. Usage of chg-multi is
-     pretty similar and will maybe covered in a later version of this document.
-  5. Set up your tape-config.
-     In the general section you have to set the parameters tapecycle , tapetype
-     , tpchanger , changerfile , tapedev , rawtapedev and changerdev.
-     Example:
-
-               $ vi /usr/local/etc/amanda/daily/amanda.conf
-               ...
-
-               tapecycle 6
-               tapetype HARD-DISK
-               tpchanger "chg-disk"
-               changerfile "/usr/local/etc/amanda/daily/changer"
-               tapedev  "file:/amandatapes/daily"
-               
-
-     This reflects the use of your defined tapetype.
-     The parameter tapecycle tells Amanda how much tapes can be used, Set this
-     value according to the number of tapes you want to use.
-     The parameter tapetype , points to the tapetype definition you have
-     created before.
-     The parameter tpchanger tells Amanda to use the generic tape-changer-
-     script to handle the vtapes. You can think of it as a virtual tape-
-     changer-device.
-     The parameter changerfile is used to give chg-disk the "prefix" for the
-     "%s-changer, %s-clean, %s-slot" files it needs. Use something like
-     "changer" in your config-dir. Please note that this file does NOT have to
-     exist, but it won't hurt anyway.
-     The parameter tapedev tells the chg-disk-script where the root-dir for
-     your vtapes is.
-     In our example the vtape-files go to /amandatapes.
-     To separate multiple configurations, we decided to use subdirectories
-     according to the configuration name "daily".
-
-     Note
-
-     The parameter changerdev is NOT needed with chg-disk as it is not parsed
-     by chg-disk.
-  6. Create the virtual tapes.
-
-     Note
-
-     Gene Heskett has committed a shell-script which creates and labels the
-     vtapes in one step. Stefan G. Weichinger will generalize this script and
-     contribute it, this script will just read your settings in amanda.conf and
-     create the appropriate vtape-directories.
-     Now you have to create the tape-directories. chg-disk needs a directory
-     structure like:
-
-               slot_root_dir -|
-                              |- info
-                              |- data -> slot1/
-                              |- slot1/
-                              |- slot2/
-                              |- ...
-                              |- slotn/
-                       
-
-     where 'slot_root_dir' is the tapedev 'file:xxx' parameter and 'n' is the
-     tapecycle parameter.
-     So in our example we do:
-
-               $ mkdir /amandatapes/daily
-               
-
-     for the 'slot_root_dir' and
-
-               $ mkdir /amandatapes/daily/slot1
-               $ mkdir /amandatapes/daily/slot2
-               ....
-               
-
-     for the virtual slots that will later contain the vtapes.
-     If you have many vtapes to create and their names follow a pattern you may
-     be able to do them all with a single loop such as:
-
-               $ for n in 1 2 3 4 5 6 7 8 9 10 11 12
-               > do
-               >    mkdir /amandatapes/daily/slot${n}
-               > done
-               
-
-     Create the info-file:
-
-               $ touch /amandatapes/daily/info
-               
-
-     and link the first slot to the data-file (to "load" the vtape into the
-     first slot):
-
-               $ ln -s /amandatapes/daily/slot1 /amandatapes/daily/data
-               
-
-     Make sure the Amanda-user has write-permissions on these directories:
-
-               $ chown -R amanda_user /amandatapes
-               $ chgrp -R amanda_group /amandatapes
-               $ chmod -R 750 /amandatapes
-               
-
-  7. Label the virtual tapes.
-     As the virtual tapes are handled just like physical tapes by the Amanda-
-     Server they have to be labeled before use.
-
-               Usage: amlabel [-f] <conf> <label> [slot <slot-number>]
-               
-
-     Example:
-
-               $ amlabel daily daily1 slot 1
-               ....
-               $ amlabel daily daily2 slot 2
-               ....
-               
-
-     If you have many vtapes to label and their names follow a pattern you may
-     be able to do them all with a single loop such as:
-
-               $ for n in 1 2 3 4 5 6 7 8 9 10 11 12
-               > do
-               >    amlabel daily daily${n} slot ${n}
-               > done
-               
-
-     Label all your created tapes according to the "labelstr"-parameter in your
-     amanda.conf. Consult the amlabel-man-page for details.
-  8. Test your setup with amcheck.
-     Run amcheck daily (or, more general, amcheck <config>) and look for
-     anything Amanda complains about.
-     A proper output looks like:
-
-               $ amcheck daily
-               Amanda Tape Server Host Check
-               --
-               Holding disk /amhold: 6924940 KB disk space available,
-               that's plenty
-               amcheck-server: slot 2: date 20031115 label daily02
-               (exact label match)
-               NOTE: skipping tape-writable test
-               Tape daily02 label ok
-               Server check took 0.377 seconds
-               
-
-     Recheck your files if errors occur.
-
-
- Recovery
-
-Recovering files from vtapes is very similar to recovering files from a "real"
-tapechanger.
-Make sure you read the chapter Restore.
-I will simply paste a amrecover-session here (provided by JC Simonetti, author
-of chg-disk):
-
-  # /usr/local/amanda/sbin/amrecover woo
-  AMRECOVER Version 2.4.4p3. Contacting server on backupserver.local ...
-  220 backupserver Amanda index server (2.4.4p3) ready.
-  200 Access OK
-  Setting restore date to today (2004-10-08)
-  200 Working date set to 2004-10-08.
-  Scanning /BACKUP2/holding...
-  Scanning /BACKUP/holding...
-  200 Config set to woo.
-  200 Dump host set to backupserver.local.
-  Trying disk /tmp ...
-  $CWD '/tmp/RECOVER' is on disk '/tmp' mounted at '/tmp'.
-  200 Disk set to /tmp.
-  Invalid directory - /tmp/RECOVER
-  amrecover> sethost backupserver.local
-  200 Dump host set to backupserver.local.
-  amrecover> setdisk /
-  200 Disk set to /.
-  amrecover> cd /etc
-  /etc
-  amrecover> add passwd
-  Added /etc/passwd
-  amrecover> list
-  TAPE B3_14 LEVEL 0 DATE 2004-09-26
-          /etc/passwd
-  amrecover> extract
-
-  Extracting files using tape drive file:/BACKUP2/slots/ on host
-  backupserver.local. The following tapes are needed: B3_14
-
-  Restoring files into directory /tmp/RECOVER
-  Continue [?/Y/n]? Y
-
-  Extracting files using tape drive file:/BACKUP2/slots/ on host
-  backupserver.local. Load tape B3_14 now
-  Continue [?/Y/n/s/t]? Y
-  ./etc/passwd
-  amrecover> quit
-  200 Good bye.
-
-Nothing spectacular? The trick is this:
-When Amanda asks you
-
-  Load tape B3_14 now Continue [?/Y/n/s/t]?
-
-you have to run the following in a second terminal:
-
-  $ amtape woo slot 14
-  amtape: changed to slot 14 on file:/BACKUP2/slots/
-
-This step is necessary to load the proper tape into your virtual changer.
-Let me express this in a more general way:
-When amrecover prompts for the tape it needs to restore the files you
-requested, you have to "load" the tape it requests.
-The recommended way to do this is to use amtape. The options that make sense in
-this context are:
-
-  # amtape
-  Usage: amtape <conf> <command>
-          Valid commands are:
-               [...]
-                  slot <slot #>        load tape from slot <slot #>
-               [...]
-                  label <label>        find and load labeled tape
-               [...]
-               
-
-If you know which slot contains the requested tape (for example, if you have
-tape daily01 in slot 1, tape daily02 in slot 2, and so on) you may use the
-first option. If you just know the label of the tape you need, use the second
-option.
-To continue the upper example:
-
-  amtape woo slot 14   # option 1 OR
-  amtape woo label B3_14       # option 2
-
-amtape will return something like:
-
-  amtape: label B3_14 is now loaded.
-
-After this you can return to your amrecover-session and continue restoring your
-files.
-Please be aware of the fact reported by JC Simonetti: " I have never never used
-the "settape" command of amrecover [with chg-disk] since there's some problems
-with it (tape not loaded correctly, or impossible to change from tape to tape
-when restoring data shared accross multiple tapes...) "
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-filedriver.html for the current
-version of this document.
--------------------------------------------------------------------------------
-
-Prev                                 Up                    Next
-Chapter 12. Amanda on Cygwin HOWTO  Home  Chapter 14. AFS HOWTO
-
diff --git a/docs/howto-wrapper.txt b/docs/howto-wrapper.txt
deleted file mode 100644 (file)
index ca8b8c8..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-
-Chapter 15. How to use a wrapper
-Prev  Part III. HOWTOs      Next
-
--------------------------------------------------------------------------------
-
-Chapter 15. How to use a wrapper
-
-
-Bert de Ridder
-
-Original text
-
-Paul Bijnens
-
-Original text
-
-Stefan G. Weichinger
-
-XML-conversion; Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Bert_de_Ridder's_suggestions
-
-  Paul_Bijnens's_suggestions
-
-
-Note
-
-The script used in this document is not part of the official Amanda release.
-The Amanda core team does not take any responsibility for this script.
-
-Bert de Ridder's suggestions
-
-This is a mini-howto explaining how to control other running tasks on a server
-where the Amanda software is used to backup data.
-Problem : Lots of software is picky about their datafiles being backed up while
-the files are in use. It sometimes is even necessary to know the state of the
-datafiles at the moment of backup so that when restoring you know exactly
-*what* you are restoring. And most of the time there are dependencies between
-the datafiles as well (for instance, the pure datafiles and the controlfiles of
-an Oracle database.)
-The solution is actually quite simple; you just use a custom made backupscript
-instead of the standard tar command. Inside this tar command, you do some
-necessary processing before executing the tar command and - if necessary - do
-some more processing. This way, you can easily stop an Oracle database, tar the
-files, send them to the tape server and restart the Oracle database. This of
-course is just an example, anything you can do in a shell script can be done.
-
-  1. Create the script
-     This is the most important step, this script is the work horse of the
-     solution. I've called it /bin/amandatar. You can call it whatever you want
-     though. It's a Perl script, it may not be very pretty code, but it does
-     the job. In the script, an example is given for the backup of a Lotus
-     Notes Domino server.
-
-       #!/usr/bin/perl
-
-       # Tar wrapper for Amanda's tar.
-       #
-
-       use Getopt::Long qw(:config pass_through);
-
-       # Obtain directory and file information from the command line.
-
-       $result = GetOptions (
-        'directory=s' => \$dir,
-        'file=s' => \$file
-       );
-
-       # Check whether Amanda wants to do some administrative task (eg.
-       indexinfo
-       # or obtain the number of bytes to be backed up)
-       # if file = /dev/null it's an administrative task and most of the time,
-       no extra
-       #   processing is necessary.
-
-       # What you see here is just a log of the backup start time, and more
-       important
-       #   the stopping of the domino server
-
-       if ( $file ne '/dev/null' )
-       {
-         if ( $dir eq '/local/notesdata' )
-         {
-           system "echo 'Start backup notes at ' >> /var/lib/amanda/runtime" ;
-           system "date >> /var/lib/amanda/runtime";
-           system ( "/etc/init.d/domino stop >> /var/lib/amanda/runtime" );
-         }
-       }
-
-       # The command line is being 'reconstructed'. Necessary because the
-       GetOptions
-       #   call above has stripped the file and directory information.
-       # This is what I meant with 'ugly'  code ;-)
-
-       while ( $ARGV[0] ne '' )
-       {
-         $val = $ARGV[0] ;
-         unshift ( @NEWARGV, $val, ) ;
-         shift @ARGV;
-       }
-
-       while ( $NEWARGV[0] ne '' )
-       {
-         $val = $NEWARGV[0] ;
-         unshift ( @ARGV, $val ) ;
-         shift @NEWARGV;
-       }
-
-       if ( $dir ne '' )
-       {
-         unshift ( @ARGV, '--directory', $dir );
-       }
-       if ( $file ne '' )
-       {
-         unshift ( @ARGV, '--file', $file );
-       }
-
-       if ( $file ne '/dev/null' )
-       {
-         system "echo 'Backing up directory ' $dir >> /var/lib/amanda/runtime"
-       ;
-       }
-
-       # And finally make sure tar is called :-)
-       #   (path may differ on your installation)
-       unshift ( @ARGV , "/bin/tar" ) ;
-
-       system ( @ARGV ) ;
-
-       # Postprocessing
-       #
-       # If Notes backup was requested, restart the server.
-       # Log the backup end time.
-       #
-
-       if ( $file ne '/dev/null' )
-       {
-         if ( $dir eq '/local/notesdata' )
-         {
-           system ( "/etc/init.d/domino start >> /var/lib/amanda/runtime" );
-           system "echo 'End backup notes at ' >> /var/lib/amanda/runtime" ;
-           system "date >> /var/lib/amanda/runtime";
-         }
-       }
-
-       exit 0;
-
-       # End script
-
-     On some systems it may be necessary to setuid root the script.
-  2. Rebuild Amanda so that it uses your newly created script.
-     Download the sources, untar them to a directory. I'm sure there are lots
-     of documents already available on how to do this, so I won't go into too
-     much detail. (Refer to Amanda_Installation_Notes).
-     fast path :
-
-       /usr/local/src # tar -xvzf amanda-source.tar.gz
-       /usr/local/src # cd amanda-version
-       /usr/local/src/amanda-version # ./configure \
-         --with-user=amanda \
-         --prefix=/usr/local \
-         --exec-prefix=/usr \
-         --bindir=/usr/bin \
-         --sbindir=/usr/sbin \
-         --libexecdir=/usr/lib/amanda \
-         --with-configdir=/etc/amanda \
-         --with-group=disk \
-         --with-gnutar=/bin/amandatar \
-         --with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
-         --with-tmpdir=/tmp/amanda \
-         --with-smbclient=/usr/bin/smbclient \
-         --mandir=/usr/local/man
-
-     Here, it may be necessary to adjust some paths to match your installation.
-     This setup works on SuSE Linux (also SLES) and MacOSX although you may
-     have to use another binary tar.
-     As you see, you may also "replace" the smbclient if necessary. I haven't
-     yet tested it though. I'll leave it as an exercise for the reader <g>.
-
-       /usr/local/src/amanda-version # make
-       /usr/local/src/amanda-version # make install
-
-     Now proceed as with a "normal" installation.
-
-
-Paul Bijnens's suggestions
-
-How do I run pre- and post dump programs, e.g. database stop/start?
-Currently (Amanda 2.4.5) there is no direct support to run a program before or
-after a backup on a client. But there is an easy workaround by using a wrapper
-for GNU-tar that does the additional tasks.
-Let's suppose you want to stop a database before the backup, and start it up
-again when the backup is finished. You have already two scripts "shutdb" and
-"startdb" to shutdown and startup the database.
-First you have to configure Amanda on the client to use the gnutar-wrapper
-instead of the real GNU-tar:
-
-  ./configure ... --with-gnutar=/usr/local/bin/amgtar ...
-
-and re-compile Amanda. The program "amgtar" can be a simple link to the real
-GNU-tar-binary on clients that don't need special handling, or it can be a
-script.
-Amanda expects that the bytestream on stdout is the backup image, and the
-bytestream on stderr are messages. The stderr messages are filtered against a
-known set of strings, and anything unexpected is flagged as "STRANGE" in the
-Amanda report. The return-codes of the program should be the same as the
-return-codes of GNU-tar:
-
-* 0 = ok (backup image will be put on tape)
-* 1 = not ok (backup image will not be put on tape, same level will be tried
-  next time).
-
-The arguments passed to the program are pretty static (see in the sources
-client-src/sendbackup-gnutar.c, line 483). To decide if you need to stop/start
-the database you have to check if:
-
-* this run makes a backup and not a restore: look for "--create"
-* this it is not an estimate run: look for "--file /dev/null" (estimate) or "--
-  file -" (real run)
-* this run is for the database directory: look for "--directory /my/data/base"
-
-In all other cases, we just pass the args and run the real GNU-tar.
-Here is an example script in Bourne shell:
-Example 15.1. 
-
-  #!/bin/sh
-
-  # # uncomment next block to follow the flow
-  # LOG=/tmp/amanda/mytar.debug
-  # date >> $LOG
-  # echo "$@" >> $LOG
-  # if [ "$3" = "/dev/null" ]
-  # then echo "Estimate only" >> $LOG
-  # else echo "Real backup" >> $LOG
-  # fi
-
-  # - Avoid output to stdout! (the backup stream by tar)
-  # - Any output to stderr is flagged as "strange" by amanda
-  #   and may be used to pass error messages into the report
-
-  if [ "$1" = "--create"  -a  "$3" = "-"  -a  "$5" = "/my/dir" ]
-  then
-      # echo "/my/dir: want to execute some progs first" >>$LOG
-      /usr/local/bin/shutdb thedb >&2
-      /usr/local/bin/gtar "$@"
-      rc=$?
-      # echo "Finished the real backup; some postprocessing" >>$LOG
-      /usr/local/bin/startdb thedb >&2
-      exit $rc
-  else
-      /usr/local/bin/gtar "$@"
-  fi
-
-
-Here is an example script in perl:
-Example 15.2. 
-
-  #!/usr/bin/perl -w
-
-  use Getopt::Long qw(:config pass_through);
-
-  my @saveopts = @ARGV;
-  GetOptions (
-          'create' => \$create,
-          'directory=s' => \$dir,
-          'file=s' => \$file,
-  );
-  @ARGV = @saveopts;
-
-  my $postproc = 0;
-  if ($create  &&  $dir eq '/my/data/base' &&  $file ne '/dev/null') {
-      system '/usr/local/bin/dbshut thedb >/tmp/amanda/dbshut.debug 2>&1';
-      $postproc = 1;
-  }
-
-  unshift(@ARGV, "/usr/local/bin/gtar");
-  system @ARGV;
-
-  my $rc = $? >> 8;
-
-  if ($postproc) {
-      system '/usr/local/bin/dbstart thedb >/tmp/amanda/dbstart.debug 2>&1';
-  }
-
-  exit $rc;
-
-
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-wrapper.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev                    Up                                            Next
-Chapter 14. AFS HOWTO  Home  Chapter 16. How to do Amanda-server-side gpg-
-                                                        encrypted backups.
-
diff --git a/docs/howtos.txt b/docs/howtos.txt
deleted file mode 100644 (file)
index bd0a5a3..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-
-Part III. HOWTOs
-Prev        Next
-
--------------------------------------------------------------------------------
-
-
-Part III. HOWTOs
-
-
-
-How to do this?
-
-This section contains some HOWTO-style-documents which should help you to get
-Amanda up and going with Cygwin, AFS or chg-disk ...
-Table of Contents
-
-
-  12._Amanda_on_Cygwin_HOWTO
-
-
-        Install_Cygwin
-
-        Other_Preparation
-
-        Compile_Amanda
-
-        Configure_Cygwin_files
-
-        Configure_Windows_System_Files
-
-        Configure_inetd_to_run_automatically_as_a_service
-
-        Windows_98/ME
-
-        Windows_NT/2000/XP
-
-        Notes_on_Amanda_backup_options
-
-
-              Compression
-
-              Exclude_Lists
-
-              Debugging_Files
-
-
-
-  13._How_to_use_the_Amanda_file-driver
-
-
-        Introduction
-
-        Possible_Uses
-
-        Setup
-
-
-              Basics
-
-
-        Recovery
-
-
-  14._AFS_HOWTO
-
-  15._How_to_use_a_wrapper
-
-
-        Bert_de_Ridder's_suggestions
-
-        Paul_Bijnens's_suggestions
-
-
-  16._How_to_do_Amanda-server-side_gpg-encrypted_backups.
-
-
-        Setup
-
-        Test
-
-        Plans
-
-
-  17._How_to_use_different_auth_with_Amanda
-
-
-        Introduction
-
-        BSD
-
-        BSDTCP
-
-        BSDUDP
-
-        KRB4
-
-        KRB5
-
-        RSH
-
-        SSH
-
-
-              For_amdump:
-
-              For_amrecover:
-
-
-
--------------------------------------------------------------------------------
-
-Prev                                                                Next
-Chapter 11. Printing of Labels  Home  Chapter 12. Amanda on Cygwin HOWTO
-
diff --git a/docs/index.txt b/docs/index.txt
deleted file mode 100644 (file)
index 0c84738..0000000
+++ /dev/null
@@ -1,908 +0,0 @@
-
-The Official AMANDA Documentation
-                             Next
-
--------------------------------------------------------------------------------
-
-
-The Official AMANDA Documentation
-
-
-Edited by
-
-
-Stefan G. Weichinger
-
-AMANDA Core Team
-<sgw@amanda.org>
-
-Edited by
-
-
-Amanda Core Team
-
-AMANDA Core Team
--------------------------------------------------------------------------------
-Table of Contents
-
-
-  Abstract
-
-  Copyright_Information
-
-  Attributions
-
-  I._Installation
-
-
-        1._Amanda_2.5.0_-_System-Specific_Installation_Notes
-
-
-              Solaris_2.6
-
-              Solaris
-
-              Trusted_Solaris
-
-              SunOS_4.x
-
-              Ultrix
-
-              HP/UX
-
-              Linux
-
-              Digital_Unix_4
-
-              Sinix_5.43_(Reliant_Unix)
-
-              IRIX_(all)
-
-              IRIX_6
-
-              IRIX_6.5.x
-
-              SCO
-
-              FreeBSD_3.0
-
-              FreeBSD_4.9
-
-              FreeBSD_5.1
-
-              AIX
-
-              Microsoft_Windows
-
-              Mac_OS_X
-
-
-        2._Amanda_Installation_Notes
-
-
-              Before_doing_anything
-
-              Compiling_the_Amanda_sources
-
-              Setting_up_your_Amanda_Configuration
-
-
-                    Setting_up_the_Tape_Server_Host
-
-                    Set_up_the_Backup_Client_Hosts
-
-
-
-        3._Excluding
-
-
-              Introduction
-
-              Please_Read
-
-              Before_We_Begin
-
-              Choosing_an_exclude_mechanism
-
-
-                    Exclude_Mechanisms
-
-
-              Expression
-
-              Wildcard_Expansion
-
-              Troubleshooting
-
-
-                    Broken_gnutar?
-
-                    The_ps_command_is_your_friend.
-
-
-
-        4._Indexing_with_Amanda
-
-
-              Database_Format
-
-              Database_Browsing
-
-              File_Extraction
-
-              Protocol_Between_amindexd_and_amrecover
-
-              Installation_Notes
-
-              Permissions
-
-              Changes_from_amindex-1.0
-
-              Changes_from_amindex-0.3
-
-              Changes_from_amindex-0.2
-
-              Changes_from_amindex-0.1
-
-              Changes/additions_to_2.3.0
-
-              Known_Bugs
-
-
-        5._Backup_PC_hosts_using_Samba
-
-
-              Installation
-
-              Setup
-
-              Example
-
-              Bugs_and_notes
-
-
-        6._Restore
-
-
-  II._About_Tapes_and_Changers
-
-
-        7._Tapetypes
-
-        8._Amanda_Tape_Changer_Support
-
-
-              Introduction
-
-              Specifying_a_tape_changer_in_amanda.conf
-
-              Device-specific_tapechanger_script
-
-              Slot_names_and_the_"current"_slot
-
-              Operator_interface
-
-              How_amdump_interacts_with_the_tape_changer
-
-              Builtin_tape-changers
-
-
-                    chg-multi_(formerly_chg-generic)
-
-                    chg-manual_(formerly_no-changer)
-
-                    chg-mtx_(formerly_hp-changer)
-
-                    chg-zd-mtx
-
-                    chg-scsi-chio_(formerly_seagate-changer,_then_chg-chio)
-
-                    chg-scsi_(new_interface,_try_to_drive_a_robot_with_direct
-                    scsi_commands)
-
-                    chg-chio
-
-                    chg-chs
-
-                    chg-rth
-
-                    chg-juke
-
-                    chg-rait
-
-                    chg-disk
-
-                    chg-iomega
-
-                    chg-null
-
-
-
-        9._chg-scsi
-
-
-              Command_line_options
-
-              Notes_about_changer.conf
-
-              Amanda's_actual_usage_of_chg-scsi
-
-              Configuration_notes
-
-              Hacking_notes
-
-
-        10._RAIT_(Redundant_Array_of_Inexpensive_Tape)_Support
-
-
-              What_is_a_RAIT?
-
-              Using_a_RAIT
-
-              Disaster_Recovery
-
-
-        11._Printing_of_Labels
-
-
-              The_New_Feature
-
-              Labels_provided
-
-              History
-
-              How_it_works
-
-
-
-  III._HOWTOs
-
-
-        12._Amanda_on_Cygwin_HOWTO
-
-
-              Install_Cygwin
-
-              Other_Preparation
-
-              Compile_Amanda
-
-              Configure_Cygwin_files
-
-              Configure_Windows_System_Files
-
-              Configure_inetd_to_run_automatically_as_a_service
-
-              Windows_98/ME
-
-              Windows_NT/2000/XP
-
-              Notes_on_Amanda_backup_options
-
-
-                    Compression
-
-                    Exclude_Lists
-
-                    Debugging_Files
-
-
-
-        13._How_to_use_the_Amanda_file-driver
-
-
-              Introduction
-
-              Possible_Uses
-
-              Setup
-
-
-                    Basics
-
-
-              Recovery
-
-
-        14._AFS_HOWTO
-
-        15._How_to_use_a_wrapper
-
-
-              Bert_de_Ridder's_suggestions
-
-              Paul_Bijnens's_suggestions
-
-
-        16._How_to_do_Amanda-server-side_gpg-encrypted_backups.
-
-
-              Setup
-
-              Test
-
-              Plans
-
-
-        17._How_to_use_different_auth_with_Amanda
-
-
-              Introduction
-
-              BSD
-
-              BSDTCP
-
-              BSDUDP
-
-              KRB4
-
-              KRB5
-
-              RSH
-
-              SSH
-
-
-                    For_amdump:
-
-                    For_amrecover:
-
-
-
-
-  IV._Various_Information
-
-
-        18._Using_Amanda
-
-
-              An_Introduction
-
-              Amanda_Features
-
-              Future_Capabilities_of_Amanda
-
-              Amanda_Resources
-
-              Installing_Amanda
-
-
-                    Install_Related_Packages
-
-                    Perform_Preliminary_Setup
-
-                    Configure_the_Amanda_Build
-
-                    Build_and_Install_Amanda
-
-                    Configuring_Amanda
-
-                    Decide_on_a_Tape_Server
-
-                    Decide_Which_Tape_Devices_to_Use
-
-                    Decide_Whether_to_Use_Compression
-
-                    Decide_Where_the_Holding_Space_Will_Be
-
-                    Compute_Your_Dump_Cycle
-
-                    Copy_and_Edit_the_Default_Configuration_File
-
-                    Configure_the_Holding_Disk
-
-                    Configure_Tape_Devices_and_Label_Tapes
-
-                    Configure_Backup_Clients
-
-                    Test_and_Debug_Setup
-
-
-              Operating_Amanda
-
-
-                    Run_amdump
-
-                    Read_Amanda's_Reports
-
-                    Monitor_Tape_and_Holding_Disk_Status
-
-                    Adding_Tapes_at_a_Particular_Position_in_the_Cycle
-
-                    Miscellanous_Operational_Notes
-
-
-              Advanced_Amanda_Configuration
-
-
-                    Adjust_the_Backup_Cycle
-
-                    Adjust_Parallelism
-
-                    Monitor_for_Possible_Improvements
-
-                    Excluding_Files
-
-
-              Restoring_with_Amanda
-
-
-                    Configuring_and_Using_amrecover
-
-                    Using_amrestore
-
-                    Restoring_Without_Amanda
-
-
-
-        19._Amanda_FAQ
-
-        20._Collection_of_the_top_ten_Amanda_questions._And_answers.
-
-
-              Reason_for_starting_this_list.
-
-              the_DLE-question
-
-              the_localhost-question
-
-              the_friday-tape-question
-
-              the_multiple-dumps-question
-
-              the_mailing-list-question
-
-              the_distro-question
-
-              the_index-question
-
-              the_tapetype-questions
-
-              the_size-question
-
-              the_GUI-question
-
-              the_holding-disk_question
-
-              ...
-
-
-        21._Amanda_WISHLIST
-
-
-  V._Technical_Background
-
-
-        22._How_Amanda_uses_UDP_and_TCP_ports
-
-
-              TCP_port_allocation
-
-              User_TCP_port_range_(--with-tcpportrange)_summary
-
-              UDP_port_allocation
-
-              User_UDP_port_range_(--with-udpportrange)_summary
-
-              Firewalls_and_NAT
-
-
-        23._Amanda_dumper_API
-
-
-              Introduction
-
-              The_Problem
-
-              Overview_of_the_API
-
-
-                    The_`support'_command
-
-
-              The_`selfcheck'_command
-
-              The_`estimate'_and_`estimate-parse'_commands
-
-              The_`backup'_and_`backup-parse'_commands
-
-              The_`index-from-output'_and_`index-from-image'_commands
-
-              The_`restore'_command
-
-              The_`print-command'_command
-
-              Conclusion
-
-
-        24._Amanda_Internals
-
-
-              Protocols
-
-              server_and_amandad_on_client
-
-              planner_and_driver
-
-              driver_and_dumper
-
-              taper(read)_and_taper(write)
-
-
-        25._Amanda_Event_API
-
-
-              Introduction
-
-              The_API
-
-
-                    event_register
-
-                    event_release
-
-                    event_loop
-
-                    event_wait
-
-                    event_wakeup
-
-
-              Data_types
-
-
-                    event_handle_t
-
-                    event_id_t
-
-                    event_type_t
-
-                    event_fn_t
-
-
-              Event_Types
-
-
-                    EV_READFD
-
-                    EV_WRITEFD
-
-                    EV_SIG
-
-                    EV_TIME
-
-                    EV_WAIT
-
-
-
-        26._Amanda_Security_API
-
-
-              Introduction
-
-              The_Problem
-
-              The_API
-
-
-                    protocol_packet_transmission_functions
-
-                    stream_functions
-
-
-              Data_Types
-
-
-                    security_driver_t
-
-                    security_handle_t
-
-                    security_stream_t
-
-                    security_status_t
-
-
-              SECURITY_DRIVERS
-
-
-                    name
-
-                    connect
-
-                    accept
-
-                    close
-
-                    sendpkt
-
-                    recvpkt
-
-                    recvpkt_cancel
-
-                    stream_server
-
-                    stream_accept
-
-                    stream_client
-
-                    stream_close
-
-                    stream_auth
-
-                    stream_id
-
-                    stream_write
-
-                    stream_read
-
-                    stream_read_cancel
-
-
-
-        27._Virtual_Tape_API
-
-        28._Using_Kerberos_with_Amanda
-
-
-              Amanda_2.5.0_-_KERBEROS_v4_SUPPORT_NOTES
-
-
-                    Configuration
-
-                    Installation
-
-                    conf_file
-
-
-              Amanda_2.5.0_-_KERBEROS_v5_SUPPORT_NOTES
-
-
-                    Building
-
-                    Installation
-
-                    conf_file
-
-                    Destination_Host_Permissions_file
-
-
-
-
-  VI._Historical_files
-
-
-        29._Response_to_CPIO_Security_Notice_Issue_11:
-
-
-              Affected_Versions
-
-              Workaround
-
-              Acknowledgements
-
-
-        30._Upgrade_Issues
-
-        31._What_once_was_new
-
-
-              What's_new_in_Amanda_2.3
-
-
-                    Indexing_backups_for_easier_restore
-
-                    Samba_Support
-
-                    GnuTar_Support
-
-                    Multiple_backups_in_parallel_from_one_client_host
-
-                    Multiple_tapes_in_one_run
-
-                    Bottleneck_determination
-
-                    2_Gb_limit_removed
-
-                    amadmin_import/export
-
-
-              What's_new_in_Amanda_2.2
-
-
-                    Client_side_setup_has_changed
-
-                    Version_suffixes_on_executables
-
-                    Kerberos
-
-                    Multiple_holding_disks
-
-                    Remote_self-checks
-
-                    mmap_support
-
-                    gzip_support
-
-                    Mount_point_names_in_disklist
-
-                    Initial_tape-changer_support_included
-
-                    Generic_tape_changer_wrapper_script
-
-                    New_command_amtape
-
-                    Changer_support_added_to_command_amlabel
-
-                    Tape_changer_support_improved
-
-                    A_few_words_about_multi-tape_runs
-
-                    Big_planner_changes
-
-                    Level-0_dumps_allowed_with_no_tape
-
-
-
-        32._Multitape_support_in_Amanda_2.2
-
-
-              Introduction
-
-              New_Planner_Algorithm
-
-
-                    Time
-
-                    Full_Backups
-
-                    Schedule_Balancing
-
-                    Overwrite_Detection
-
-
-              Taper_Algorithm
-
-
-                    Choosing_a_tape
-
-                    End_of_tape_handling
-
-                    Tape_Format_Changes
-
-                    Tapelist_File_Changes
-
-
-
-        33._Thoughts_about_a_Strategy_API
-
-        34._Y2K_Compliancy
-
-        35._Usage_of_floppy_tape_drives_on_Linux
-
-
-  VII._Appendixes
-
-
-        36._The_Amanda_Manual_Pages.
-
-
-              amadmin \14 administrative interface to control Amanda backups
-
-              amaespipe \14 wrapper program for aespipe
-
-              amanda \14 Advanced Maryland Automatic Network Disk Archiver
-
-              amanda.conf \14 Main configuration file for Amanda, the Advanced
-              Maryland Automatic Network Disk Archiver
-
-              amanda-client.conf \14 Client configuration file for Amanda, the
-              Advanced Maryland Automatic Network Disk Archiver
-
-              amcheck \14 run Amanda self-checks
-
-              amcheckdb \14 check Amanda database for tape consistency
-
-              amcleanup \14 run the Amanda cleanup process after a failure
-
-              amcrypt \14 reference crypt program for Amanda symmetric data
-              encryption
-
-              amcrypt-ossl \14 crypt program for Amanda symmetric data encryption
-              using OpenSSL
-
-              amcrypt-ossl-asym \14 crypt program for Amanda asymmetric data
-              encryption using OpenSSL
-
-              amdd \14 Amanda version of dd
-
-              amdump \14 back up all disks in an Amanda configuration
-
-              amfetchdump \14 extract backup images from multiple Amanda tapes.
-
-              amflush \14 flush Amanda backup files from holding disk to tape
-
-              amgetconf \14 look up amanda.conf variables
-
-              amlabel \14 label an Amanda tape
-
-              ammt \14 Amanda version of mt
-
-              amoverview \14 display file systems processed by Amanda over time
-
-              amplot \14 visualize the behavior of Amanda
-
-              amrecover \14 Amanda index database browser
-
-              amreport \14 generate a formatted output of statistics for an
-              Amanda run
-
-              amrestore \14 extract backup images from an Amanda tape
-
-              amrmtape \14 remove a tape from the Amanda database
-
-              amstatus \14 display the state of an Amanda run
-
-              amtape \14 user interface to Amanda tape changer controls
-
-              amtapetype \14 generate a tapetype definition.
-
-              amtoc \14 generate TOC (Table Of Contents) for an Amanda run
-
-              amverify \14 check an Amanda tape for errors
-
-              amverifyrun \14 check the tapes written by the last Amanda run
-
-
-        37._Web_Ressources
-
-
-  Index
-
-List of Tables
-
-
-  4.1. Protocol_between_amindexd_and_amrecover
-
-List of Examples
-
-
-  2.1. /etc/crontab
-
-  2.2. /etc/services
-
-  2.3. /etc/inetd.conf
-
-  2.4. /etc/xinetd.d/amandaidx
-
-  2.5. /etc/xinetd.d/amidxtape
-
-  2.6. /etc/amanda/supervise/amandaidx/run
-
-  2.7. /etc/amanda/supervise/amidxtape/run
-
-  2.8. /etc/services
-
-  2.9. /etc/inetd.conf
-
-  2.10. /etc/xinetd.d/amanda
-
-  2.11. /etc/amanda/supervise/amanda/run
-
-  15.1.
-
-  15.2.
-
-  16.1. /usr/local/libexec/amgtar
-
-  16.2. /usr/local/bin/amaespipe
-
-  16.3. bz2aespipe.patch
-
-  18.1. A_C_Program_to_Check_the_Amanda_Service_Numbers
-
--------------------------------------------------------------------------------
-
-         Next
-     Abstract
-
diff --git a/docs/indexing.txt b/docs/indexing.txt
deleted file mode 100644 (file)
index 561abc3..0000000
+++ /dev/null
@@ -1,371 +0,0 @@
-
-Chapter 4. Indexing with Amanda
-Prev  Part I. Installation  Next
-
--------------------------------------------------------------------------------
-
-Chapter 4. Indexing with Amanda
-
-
-Alan M. McIvor
-
-Original text
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Database_Format
-
-  Database_Browsing
-
-  File_Extraction
-
-  Protocol_Between_amindexd_and_amrecover
-
-  Installation_Notes
-
-  Permissions
-
-  Changes_from_amindex-1.0
-
-  Changes_from_amindex-0.3
-
-  Changes_from_amindex-0.2
-
-  Changes_from_amindex-0.1
-
-  Changes/additions_to_2.3.0
-
-  Known_Bugs
-
-This file describes how the index files are generated and how amrecover is
-used.
-
- Database Format
-
-The database consists of a directory tree of the format: $host/$disk/
-$date_$level.gz
-The host and disk are those listed in the disklist file, the "$host/$disk/" is
-like the curinfo database, '/' are changed for '_'. There is an index file for
-each dump, the name of the file is made of the date and the level, they will
-have the .gz suffix if they are compressed with gzip.
-ex. The file foo/_usr/19991231_0.gz is the index of the level 0 made on
-19991231 of the disk /usr of the host foo.
-The files are ASCII text files containing a list of the directory and files of
-the dump, one per line. Each entry is the filename relative to the mount point,
-starting with a /, e.g., /home/user1/data from the disk mounted on /home would
-generate the entry /user1/data. The index files are stored in compressed format
-(eg gzip or compress).
-
- Database Browsing
-
-The client is called amrecover and is loosely based on the functionality of the
-program recover from Backup Copilot. A user starts up amrecover. This requires
-specifying the index server and the Amanda config name (defaults for both are
-compiled in as part of the installation). Then the user has to specify the name
-of the host information is wanted about, the disk name, and (optionally) the
-disk mount point. Finally a date needs to be specified. Given all this, the
-user can then roam around a virtual file system using ls and cd much like in a
-FTP client. The file system contains all files backed up on the specified date,
-or before that date, back to the last level 0 backup. Only the most recent
-version of any file is shown.
-As the file system is traversed, the user can add and delete files to a
-"shopping list", and print the list out.
-
- File Extraction
-
-When a user has built up a list of files to extract, they can be extracted by
-issuing the command extract within amrecover.
-Files are extracted by the following, for each different tape needed.
-As part of the installation, a "tape server" daemon amidxtaped is installed on
-one or more designated hosts, which have an attached tape drive. This is used
-to read the tapes. See the config files for the options for specifying a
-default.
-amrecover contacts amidxtaped on the tape server host specifying which tape
-device to use, which host and disk files are needed for. On the tape server
-host, amidxtaped executes amrestore to get the dump image file off the tape,
-and returns the data to amrecover.
-If dumps are stored compressed for the client, then amrecover pipes the data
-through the appropriate uncompression routine to uncompress it before piping it
-into restore, which then extracts the required files from the dump image.
-Note that a user can only extract files from a host running the same operating
-system as he/she is executing amrecover on, since the native dump/restore tools
-are used - unless GNU-tar is used.
-
- Protocol Between amindexd and amrecover
-
-The protocol talked between amindexd and amrecover is a simple ASCII chat
-protocol based on that used in FTP. amrecover sends a 1 line command, and
-amindexd replies with a 1 line or multi-line reply. Each line of the reply
-starts with a three digit code, starting with a '5' if an error occurred. For 1
-line replies, and the last line of a multi-line reply, the 4th character is a
-space. For all but the last line of a multi-line reply, the 4th character is a
-'-'.
-The commands and replies other than acknowledgments are:
-Table 4.1. Protocol between amindexd and amrecover
- ____________________________________________________________________________
-|QUIT_______________|finish_up_and_close_connection__________________________|
-|HOST_<host>________|set_host_to_host________________________________________|
-|DISK_<disk>________|set_disk_to_disk________________________________________|
-|LISTDISK_[<device>]|list_the_disks_for_the_current_host_____________________|
-|SCNF_<config>______|set_Amanda_configuration_to_config______________________|
-|DATE_<date>________|set_date_to_date________________________________________|
-|DHST_______________|return_dump_history_of_current_disk_____________________|
-|                   |Opaque is directory? query. Is the directory dir present|
-|OISD <dir>         |in the backups of the current disk back to and including|
-|___________________|the_last_level_0_dump.__________________________________|
-|                   |Opaque list directory. Give all filenames present in dir|
-|OLSD <dir>         |in the backups of the current disk back to and including|
-|___________________|the_last_level_0_dump.__________________________________|
-|                   |Opaque recursive list directory. Give all filenames     |
-|ORLD <dir>         |present in dir and subdir in the backups of the current |
-|___________________|disk_back_to_and_including_the_last_level_0_dump._______|
-|TAPE_______________|return_value_of_tapedev_from_amanda.conf_if_set.________|
-|DCMP               |returns "YES" if dumps for disk are compressed, "NO" if |
-|___________________|dumps_aren't.___________________________________________|
-
-
-
- Installation Notes
-
-
-  1. Whether or not an index is created for a disk is controlled by a disk
-     configuration option index. So, in amanda.conf you need to define a
-     disktype with this option, e.g.,
-
-       define dumptype comp-user-index {
-       comment "Non-root partitions on reasonably fast machines"
-       compress client fast
-       index yes
-       priority medium
-       }
-
-  2. You need to define disks that you want to generate an index for to
-     be of one of the disktypes you defined which contain the index option.
-     This cause sendbackup-dump on the client machine to generate an index file
-     which is stored local to the client, for later recovery by amgetidx (which
-     is called by amdump).
-  3. Amanda saves all the index files under a directory specified by
-     "indexdir" in amanda.conf. You need to create this directory by hand. It
-     needs to have read/write permissions set for the user you defined to run
-     Amanda.
-     If you are using the "text database" option you may set indexdir and
-     infofile to be the same directory.
-  4. The index browser, amrecover, currently gets installed as part of the
-     client software. Its location may not be appropriate for your system and
-     you may need to move it to a more accessible place such as /usr/local/bin.
-     See its man page for how to use it.
-     Note that amindexd, amgetidx, amidxtaped, and amtrmidx all write debug
-     files on the server in /tmp (unless this feature is disabled in the source
-     code), which are useful for diagnosing problems. amrecover writes a debug
-     file in /tmp on the machine it is invoked.
-
-
- Permissions
-
-The userid chosen to run the Amanda client code must have permission to run
-restore since this is used by createindex-dump to generate the index files.
-For a user to be able to restore files from within amrecover, that user must
-have permission to run restore.
-
- Changes from amindex-1.0
-
-Get index directory from amanda.conf.
-Integration into Amanda-2.3.0.4.
-Rewriting of amgetidx to use amandad instead of using rsh/rcp.
-
- Changes from amindex-0.3
-
-Support for index generation using GNU-tar.
-Support for restoring files from within amrecover.
-Bug fixes:
-
-* index/client/amrecover.c (guess_disk): Removed inclusion of mntent.h and use
-  of MAXMNTSTR since this was non-portable, as pointed out by Izzy Ergas
-  <erga00@nbhd.org>.
-
-
-* index/client/display_commands.c (list_directory): Removed point where
-  list_directory() could sleep for ever waiting for input that wasn't going to
-  come.
-
-
-* index/server/amindexd.c index/client/uscan.l Installed patches from Les
-  Gondor <les@trigraph.on.ca> to make amrecover handle spaces in file names.
-
-
-* server-src/amcontrol.sh: As pointed out by Neal Becker <neal@ctd.comsat.com>
-  there were still a few sh-style comments that needed conversion to c-style.
-
-
- Changes from amindex-0.2
-
-
-* index/client/Makefile.in
-* index/client/help.c
-* index/client/amrecover.h
-* index/client/uparse.y
-* index/client/uscan.l Added a help command.
-
-
-* index/client/set_commands.c: set_disk() and set_host() now check for empty
-  extract list.
-
-
-* index/client/extract_list.c:
-* index/client/amrecover.h:
-* index/client/uparse.y:
-* index/client/uscan.l: Added clear extract list command.
-
-
-* index/client/set_commands.c (set_disk): Added code so working directory set
-  to mount point.
-
-
-* index/client/extract_list.c: If the last item on a tape list is deleted, the
-  tape list itself is now deleted from the extract list.
-
-
-* index/client/amrecover.c:
-* index/server/amindex.c: If the server started up and found that the index dir
-  doesn't exist, then it exited immediately and the client got informative
-  message. Corrected this so it is obvious what is wrong to the user, since
-  this is most likely to occur when somebody is setting up for the first time
-  and needs all the help they can get.
-
-
-* server-src/amgetidx.c Added patch from Pete Geenhuizen
-  <pete@gasbuggy.rockledge.fl.us> so that it works even when remote shell is
-  csh.
-
-
-* server-src/amcontrol.sh
-* server-src/Makefile.in Amcontrol is now parameterized like other scripts and
-  run through munge to generate installable version.
-
-
-* index/server/amindexd.c (main): Added code to set userid if FORCE_USERID set.
-
-
-* index/server/amindexd.c Removed #define for full path of grep. Assumed now to
-  be on path.
-
-
-* client-src/createindex-dump.c
-* client-src/sendbackup-dump.c
-* man/Makefile.in Added patch from Philippe Charnier <charnier@lirmm.fr> so
-  they work when things are installed with version numbers. This was also
-  reported by Neal Becker <neal@ctd.comsat.com>. Also patch to set installed
-  man page modes and create directory if needed.
-
-
-* config/options.h-sunos4 Corrected definition for flex library.
-
-
-* server-src/amtrmidx.c Added some pclose() commands, used remove() instead of
-  system("rm .."). Problems reported by Pete Geenhuizen
-  (<pete@gasbuggy.rockledge.fl.us>) on a system with small ulimits set.
-
-
-* index/server/amindexd.[ch]
-* index/server/list_dir.c
-* index/client/amrecover.c
-* index/client/set_commands.c
-* index/client/uparse.y Changes developed with the help of Pete Geenhuizen
-  <pete@gasbuggy.rockledge.fl.us> to support disks specified by logical names.
-  Also, now debug files generated by amrecover include PID so multiple users
-  can use amrecover simultaneously and without file deletion permission
-  problems.
-
-
-* config/config.h-hpux:
-* config/config-common.h:
-* server-src/amgetidx.c: Changes from Neal Becker re remote shell, making it a
-  configuration parameter.
-
-
-* config/options.h-sunos4 Had -Lfl instead of -lfl
-
-
- Changes from amindex-0.1
-
-
-* index/client/uscan.l: added support for abbreviated date specs
-
-
-* index/client/amrecover.c (guess_disk): guess_disk got disk_path wrong if
-  mount point other than / (as subsequently pointed out by Eir Doutreleau
-  <ed@cti.ecp.fr>)
-
-
-* server-src/amtrmidx: Added amtrmidx which removes old index files.
-
-
-* index/client: Added a pwd command
-
-
-* server-src/amgetidx.c (main): Added use of CLIENT_LOGIN username on r
-  commands. (as pointed out by Eric Payan <Eric.Payan@ufrima.imag.fr>)
-
-
-* server-src/amgetidx.c: Bug: It was copying from all clients irrespective of
-  whether the client was configured for indices. A '}' in the wrong place.
-
-
-* server-src/amgetidx.c: Removed user configuration section. Instead include
-  amindexd.h to get information.
-
-
- Changes/additions to 2.3.0
-
-common-src/conffile.[ch]
-
-* added "index" as a valid option
-
-server-src/driverio.c
-
-* added code to optionstr() to write "index" into option string
-
-client-src/sendback-dump.c
-
-* added code to generate index if requested.
-
-client-src/indexfilename.[ch] client-src/createindex-dump.c
-
-* code to generate index.
-
-client-src/Makefile.in
-
-* a new target. Another file for sendbackup-dump
-
-config/config-common.h
-
-* added def of restore.
-
-
- Known Bugs
-
-
-* Empty directories don't get into the listing for a dump (at all dump levels).
-
-
-* When amrecover starts up, it tries to guess the disk and mount point from the
-  current directory of the working system. This doesn't work for disks
-  specified by logical names, nor when an automounter is being used, or a link
-  is in the path.
-
-
-Note
-
-Refer to http://www.amanda.org/docs/indexing.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                   Up                                     Next
-Chapter 3. Excluding  Home  Chapter 5. Backup PC hosts using Samba
-
diff --git a/docs/install.txt b/docs/install.txt
deleted file mode 100644 (file)
index 3bb1641..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-
-Chapter 2. Amanda Installation Notes
-Prev  Part I. Installation      Next
-
--------------------------------------------------------------------------------
-
-Chapter 2. Amanda Installation Notes
-
-
-James da Silva
-
-Original text
-AMANDA Core Team
-<jds@amanda.org>
-
-Stefan G. Weichinger
-
-XML-conversion, Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Before_doing_anything
-
-  Compiling_the_Amanda_sources
-
-  Setting_up_your_Amanda_Configuration
-
-
-        Setting_up_the_Tape_Server_Host
-
-        Set_up_the_Backup_Client_Hosts
-
-
-This document covers the compilation, installation, and runtime setup of Amanda
-2.4.2 and higher.
-
- Before doing anything
-
-
-* Read this document all the way through.
-* Consult Amanda_2.4.x_-_System-Specific_Installation_Notes for installation
-  notes specific to particular operating systems. There is often important
-  information there, so don't forget this step.
-* Read Upgrade_Issues if you are upgrading from a previous Amanda version.
-  There are some issues that you will need to be aware of.
-* If you are using KERBEROS authentication, read Kerberos for details on
-  installing and running the kerberized version of Amanda.
-* Check the Amanda Patches Page, http://www.amanda.org/patches/.
-
-
- Compiling the Amanda sources
-
-If you have multiple architectures, you only need to install the whole Amanda
-package on the tape server host (the one with tape drive). On the backup client
-hosts (the ones you are going to dump), you only need to compile some of the
-Amanda programs (see section Set_up_the_Backup_Client_Hosts below).
-
- Source configuration
-
-
-* Amanda can optionally make use of the following packages to back up different
-  types of clients or clients with different filesystem dumping programs.
-
-  o GNU-tar:
-    If you wish to use GNU-tar to back up filesystems, it is recommended to use
-    GNU-tar 1.13.25. Plain GNU-tar 1.12 needs to be patched to handle large
-    files (> 2GB). Plain GNU-tar 1.13 creates bad index-lists which amrecover
-    cannot handle, as does the rarely used GNU-tar 1.13.9x, which changed the
-    index-format again in an incompatible way.
-    Refer to the Amanda_FAQ for more information about issues with the various
-    releases of GNU-tar.
-    If you need to use GNU-tar 1.12, get it at
-    ftp://ftp.gnu.org/pub/gnu/tar/tar-1.12.tar.gz
-    and apply the patch from patches/tar-1.12.patch. The first hunk may be
-    enough, unless it's a SunOS4 host. Read more about the patches in the patch
-    file itself.
-    GNU-tar 1.13.25 can be found at:
-    ftp://alpha.gnu.org/pub/gnu/tar/tar-1.13.25.tar.gz
-  o Samba:
-    Samba allows Unix systems to talk to PC clients. Amanda can back up
-    Microsoft Windows clients using Samba:
-    http://www.samba.org
-    Read Backup_PC_hosts_using_Samba for configuration tips and known
-    limitations.
-    Look at http://www.amanda.org/patches/ for up to date information on
-    patches.
-  o Perl:
-    If you wish to make use of some of the scripts that come with Amanda, you
-    will need to install Perl. You can get Perl from any CPAN site.
-    ftp://ftp.cpan.org/pub/CPAN/src/perl-5.6.1.tar.gz
-  o Awk:
-    One of the programs included in this package is amplot, which reads a data
-    file that Amanda generates for each dump and translates that information in
-    it into a nice picture that can be used to determine how your installation
-    is doing and if any parameters need to be changed. To use amplot, you need
-    a version of awk that understands command line variable substitutions, such
-    as nawk or gawk, which is available from
-    ftp://ftp.gnu.org/pub/gnu/gawk/gawk-3.1.1.tar.gz
-  o GNUplot:
-    Amplot also required that gnuplot be installed on your system. Gnuplot is
-    available at
-    http://www.gnuplot.org/ ftp://ftp.gnuplot.org/pub/gnuplot
-  o Other packages:
-    The process of building Amanda requires that some other packages be
-    installed on your system. The following packages are used:
-    ftp://ftp.gnu.org/pub/gnu/readline/readline-5.0.tar.gz
-    amrecover optionally uses the readline library for its command-line edition
-    mechanisms. (If you use a package-based distribution, check for the package
-    readline-devel-X.Y.rpm.) This library itself requires either termcap,
-    curses or ncurses. termcap is preferred, and it may be obtained from:
-    ftp://ftp.gnu.org/pub/gnu/termcap/termcap-1.3.1.tar.gz.
-    If you wish to edit and enhance Amanda, you may need to install the
-    following tools. Autoconf and automake are required if you are going to
-    rebuild the Makefiles and auto configuration scripts. Bison is only needed
-    if you are going to work on the index server and client code.
-    ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.53.tar.gz ftp://ftp.gnu.org/
-    pub/gnu/automake/automake-1.6.3.tar.gz ftp://ftp.gnu.org/pub/gnu/bison/
-    bison-1.27.tar.gz ftp://ftp.gnu.org/pub/gnu/flex/flex-2.5.4a.tar.gz
-
-* Read about the different configuration options available for building and
-  running Amanda. To see the options, do both:
-
-  o Run ./configure --help to see the available options that configure takes.
-  o Read the file example/config.site which gives longer descriptions to the
-    same options.
-
-* Choose which user and group you will run the dumps under. Common choices for
-  user are `bin' or another user specifically created for Amanda, such as
-  `amanda'; common choices for group are `operator' or `disk'. If you do not
-  specify --with-user=<username> and --with-group=<groupname>, configure will
-  abort. Also choose the default name for your configuration, such as `csd' or
-  `DailySet1'). This name is used by the Amanda commands to choose one of
-  multiple possible configurations. You may specify it using the --with-
-  config=<confgname>.
-* Decide where Amanda will live. You need to choose a root directory for
-  Amanda. Let this root directory be called $prefix. Unless you change the
-  default behavior with the appropriate command line options, Amanda will
-  install itself as. Listed below you find the appropriate configure-option for
-  each directory to change the location of this part of Amanda.
-
-    --sbindir=$prefix/sbin                                     Amanda server side programs
-    --libexecdir=$prefix/libexec                               Amanda backup client programs
-    --libdir=$prefix/lib                                       Amanda dynamic libraries
-    --with-configdir=$prefix/etc/amanda                        Runtime configuration files
-    --with-gnutar-listdir=$prefix/var/amanda/gnutar-lists      Directory for GNU-tar
-    lists (client)
-    --mandir=$prefix/man                                       Directory for manual pages
-
-  Note that the GNU-tar listdir should be a local filesystem on each client
-  that is going to be backed up with GNU-tar. If it really must be NFS-mounted,
-  make sure the filesystem is exported so that the client has root access to
-  it.
-* Decide if you are compiling Amanda on a server only or a client only
-  platform. If you have a particular operating system that will only be a
-  Amanda client and will never run as the master tape host, then add the --
-  without-server option to configure. In the unlikely case that you have a
-  particular operating system that will serve as the tape host and you do not
-  wish to back up any machines that run this operating system, add the --
-  without-client option to the configure options. There are many other
-  configuration switches for Amanda. You may learn more about them by running
-  configure --help and by reading examples/config.site.
-* Now configure Amanda. There are two ways of doing this. If you are running
-  Amanda on a single OS, then probably the first method works better for you.
-  If you need to support multiple platforms, then the second method will work
-  better.
-
-  o Run configure as non-root-user with the appropriate command line options.
-    You will probably want to remember the command line options for future
-    builds of Amanda.
-  o Edit examples/config.site and install it in the directory $prefix/etc or
-    $prefix/share. When configure runs the next time it will look for this file
-    and use it to configure Amanda.
-
-
-
- Building and installing the binaries
-
-
-* Back at the top-level source directory, build the sources:
-
-    make
-    su root; make install
-
-  Make sure that you don't build the software as root, you may run the first
-  make-command as the Amanda-user, for example. On the other hand you have to
-  run make install as root to get the binaries installed with the proper
-  permissions. If you want to change the compiler flags, you can do so like
-  this:
-
-    make CFLAGS="-O3 -Wall"
-
-* If you have built with USE_VERSION_SUFFIXES, you will want to create symlinks
-  to the version you wish to use, eg: ln -s amdump-x.y.z amdump This is not
-  done automatically by the install process, so that you can have multiple
-  Amanda versions co-existing, and choose yourself which to make the default
-  version. The script contrib/set_prod_link.pl may save you some keystrokes.
-* Run ldconfig as root to update the paths to the recently installed shared
-  libraries.
-
-
- Setting up your Amanda Configuration
-
-
- Setting up the Tape Server Host
-
-
-* Create the config directory (eg. /usr/local/etc/amanda/confname) and copy the
-  example/ files into that directory. Edit these files to be correct for your
-  site, consulting the amanda(8) man page if necessary. You can also send mail
-  to mailto://amanda-users@amanda.org if you are having trouble deciding how to
-  set things up. You will also need to create the directory for the log and
-  database files for the configuration to use (eg /usr/local/var/amanda/
-  confname), and the work directory on the holding disk. These directories need
-  to agree with the parameters in amanda.conf. Don't forget to make all these
-  directories writable by the dump user!
-  Make sure that you specify the *no-rewind* version of the tape device in your
-  amanda.conf file. This is a frequently encountered problem for new sites.
-  Note that you might want to temporarily set the option "no-record" in all
-  your dumptypes when first installing Amanda if you'd like to run tests of
-  Amanda in parallel with your existing dump scheme. Amanda will then run but
-  will not interfere with your current dumpdates. However, you don't want to
-  run with "no-record" under normal operations.
-* Put Amanda into your crontab. Here's a sample:
-  Example 2.1. /etc/crontab
-
-    0 16 * * 1-5 /usr/local/sbin/amcheck -m confname
-    45 0 * * 2-6 /usr/local/sbin/amdump confname
-
-
-  This is for SunOS 4.x, which has a per-user crontab; most other systems also
-  require a userid on each cron line. See your cron(8) for details. With these
-  cron lines, Amanda will check that the correct tape is in the drive every
-  weekday afternoon at 4pm (if it isn't, all the operators will get mail). At
-  12:45am that night the dumps will be run.
-* Put the Amanda services into your /etc/services file. Add entries like:
-  Example 2.2. /etc/services
-
-    amanda             10080/udp
-    amandaidx  10082/tcp
-    amidxtape  10083/tcp
-
-
-  You may choose a different port number if you like, but it must match that in
-  the services file on the client hosts too.
-  If you are running NIS (aka YP), you have to enter the Amanda service into
-  your NIS services database. Consult your NIS documentation for details.
-  You may use the `patch-system' script, from client-src, in order to modify
-  this file. Run it with a `-h' argument for usage.
-* If you are going to use the indexing capabilities of Amanda, follow one of
-  the following steps:
-
-  o If your server uses inetd, then add these lines to your inetd.conf on the
-    tape server host:
-    Example 2.3. /etc/inetd.conf
-
-       amandaidx stream tcp nowait $USER $AMINDEXD_PATH amindexd
-       amidxtape stream tcp nowait $USER $AMIDXTAPED_PATH amidxtaped
-
-
-    where $AMINDEXD_PATH and $AMIDXTAPED_PATH are the complete paths to where
-    the amindexd and amidxtaped executables (usually libexec_dir/amindexd and
-    libexec_dir/amidxtaped), and USER is the Amanda user.
-    You may use the `patch-system' script, from client-src, in order to modify
-    this file. Run it with a `-h' argument for usage.
-  o If your tape server uses xinetd instead of inetd, then you have to add the
-    following two files to your xinetd-configuration (usually /etc/xinetd.d)
-    and edit the paths:
-    Example 2.4. /etc/xinetd.d/amandaidx
-
-       service amandaidx
-      {
-       socket_type             = stream
-               protocol                = tcp
-               wait                    = no
-               user                    = $USER
-               group                   = $GROUP
-               groups                  = yes
-               server                  = $AMINDEXD_PATH/amindexd }
-
-
-    Example 2.5. /etc/xinetd.d/amidxtape
-
-      service amidxtape
-      {
-       socket_type             = stream
-               protocol                = tcp
-               wait                    = no
-               user                    = $USER
-               group                   = $GROUP
-               groups                  = yes
-               server                  = $AMIDXTAPED_PATH/amidxtaped }
-
-
-  o If your tape server uses Dan Bernstein's daemontools http://cr.yp.to/
-    daemontools.html) instead of (x)inetd, you have to create amandaidx and
-    amidxtape services by hand.
-
-    # Create service directories:
-
-        mkdir -p $prefix/etc/amanda/supervise/amandaidx
-        mkdir -p $prefix/etc/amanda/supervise/amidxtape
-
-    # Create service startup files and make them executable:
-      Example 2.6. /etc/amanda/supervise/amandaidx/run
-
-        #!/bin/sh
-        exec /usr/local/bin/setuidgid amanda \
-        /usr/local/bin/tcpserver -DHRl0 0 10082 \
-        /usr/local/libexec/amindexd >/dev/null 2>/dev/null
-
-
-      Example 2.7. /etc/amanda/supervise/amidxtape/run
-
-        #!/bin/sh
-        exec /usr/local/bin/setuidgid amanda \
-        /usr/local/bin/tcpserver -DHRl0 0 10083 \
-        /usr/local/libexec/amidxtaped >/dev/null 2>/dev/null
-
-
-    # Link service directories into your svscan directory:
-
-        cd /service
-        ln -s $prefix/etc/amanda/supervise/amandaidx .
-        ln -s $prefix/etc/amanda/supervise/amidxtape .
-
-
-
-* If the tape server host is itself going to be backed up (as is usually the
-  case), you must also follow the client-side install instructions below on the
-  server host, INCLUDING setting up the file .amandahosts so that the server
-  host lets itself in. This is a frequently encountered problem for new sites.
-
-
- Set up the Backup Client Hosts
-
-
-* When using BSD-style security (enabled by default), set up your
-  ~dumpuser/.amandahosts (or ~dumpuser/.rhosts and/or /etc/hosts.equiv, if you
-  have configured --without-amandahosts) so that the dumpuser is allowed in
-  from the server host. Only canonical host names will be accepted in
-  .amandahosts, and usernames must be present in every line, because this is
-  safer.
-* Set up your raw disk devices so that the dumpuser can read them, and /etc/
-  dumpdates so that the dumpuser can write to it. Normally this is done by
-  making the disk devices readable by (and dumpdates read/writable by) group
-  `operator', and putting the dumpuser into that group.
-* Put the Amanda service into your /etc/services file. Add entry like:
-  Example 2.8. /etc/services
-
-    amanda             10080/udp
-    amandaidx  10082/tcp
-    amidxtape  10083/tcp
-
-
-  You may choose a different port number if you like, but it must match that in
-  the services file on the tape server host too.
-  If you are running NIS (aka YP), you have to enter the Amanda service into
-  your NIS services database. Consult your NIS documentation for details.
-  You may use the `patch-system' script, from client-src, in order to modify
-  this file. Run it with a `-h' argument for usage.
-* Follow one of the following steps to set up the Amanda client service:
-
-  o If your Amanda client uses inetd, put the Amanda client service into
-    inetd's config file. This file is usually found in /etc/inetd.conf, but on
-    older systems it is /etc/servers. The format is different on different
-    OSes, so you must consult the inetd man page for your site. Here is an
-    example from our site, again from SunOS 4.x:
-    Example 2.9. /etc/inetd.conf
-
-      amanda dgram udp wait USER AMANDAD_PATH amandad
-
-
-    You may use the `patch-system' script, from client-src, in order to modify
-    this file. Run it with a `-h' argument for usage.
-  o If your Amanda client uses xinetd, you have to add the following file to
-    your xinetd-configuration (usually /etc/xinetd.d) and edit it to reflect
-    your settings and paths:
-    Example 2.10. /etc/xinetd.d/amanda
-
-      service amanda
-      {
-      socket_type              = dgram
-      protocol         = udp
-      wait                     = yes
-      user                     = $USER
-      group                    = $GROUP
-      groups                   = yes
-      server                   = $AMANDAD_PATH/amandad
-      }
-
-
-  o If your Amanda client uses Dan Bernstein's daemontools (http://cr.yp.to/
-    daemontools.html) instead of (x)inetd, you have to create the amanda
-    service by hand. You will need also an UDP super-server (netcat in this
-    example).
-
-    # Create service directory:
-
-        mkdir -p /etc/amanda/supervise/amanda
-
-    # Create service startup file and make it executable:
-      Example 2.11. /etc/amanda/supervise/amanda/run
-
-        #!/bin/sh
-        exec /usr/local/bin/setuidgid amanda \
-          /usr/bin/netcat -l -u -p 10080 -q 0 \
-          -e /usr/local/libexec/amandad >/dev/null 2>/dev/null
-
-
-
-      Note
-
-      The netcat-binary used in this run-file might also be called /usr/bin/nc
-      on your system, depending on the OS-distribution you use. Refer to http:/
-      /netcat.sourceforge.net for details of netcat.
-    # Link service directory into your svscan directory:
-
-        cd /service
-        ln -s /etc/amanda/supervise/amanda .
-
-
-
-* If you are using (x)inetd, kick inetd/xinetd to make it read its config file.
-  On most systems you can just execute kill -HUP inetd (or xinetd). On older
-  systems you may have to kill it completely and restart it. Note that killing/
-  restarting (x)inetd is not safe to do unless you are sure that no (x)inetd
-  services (like rlogin) are currently in use, otherwise (x)inetd will not be
-  able to bind that port and that service will be unavailable.
-  If you are using the daemontools, svscan should detect and start your new
-  services automatically.
-* If you intend to back up xfs filesystems on hosts running IRIX, you must
-  create the directory /var/xfsdump/inventory, otherwise xfsdump will not work.
-
-THAT'S IT! YOU ARE READY TO RUN, UNLESS WE FORGOT SOMETHING.
-Please send mail to mailto://amanda-users@amanda.org if you have any comments
-or questions. We're not afraid of negative reviews, so let us have it!
-Before writing questions, you may prefer to take a look at the Amanda_FAQ and
-at the Amanda home page, at http://www.amanda.org. Browsable archives of Amanda
-mailing-lists are available at http://marc.theaimsgroup.com/?l=amanda-users and
-http://marc.theaimsgroup.com/?l=amanda-hackers.
-
-Note
-
-Refer to http://www.amanda.org/docs/install.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                       Up                   Next
-Chapter 1. Amanda 2.5.0 - System-Specific Home  Chapter 3. Excluding
-Installation Notes 
-
diff --git a/docs/internals.txt b/docs/internals.txt
deleted file mode 100644 (file)
index 5516728..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-
-         Chapter 24. Amanda Internals
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 24. Amanda Internals
-
-
-George Scott
-
-Original text<George.Scott@cc.monash.edu.au>
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Protocols
-
-  server_and_amandad_on_client
-
-  planner_and_driver
-
-  driver_and_dumper
-
-  taper(read)_and_taper(write)
-
-This is an attempt to document Amanda's internals. Please feel free to make
-comments and suggest changes. Text for new sections gratefully accepted!
-
- Protocols
-
-
-Note
-
-The following was an ASCII-illustration in the original docs, I managed to
-transfer it at last. Maybe someone will convert this to the first image in the
-Amanda-docs ;-) . sgw.
-
-
-        Client I Server         +-planner-+
-               I                |         |
-               I                |         |
-               I                |         |                     ______
-  +-amandad-+  I                |         |                    (______)
-  |         |  I                |         |                    |amdump|
-  |         |  I                |         |           all ::::>|      |
-  |         |  I                |         |           stderr   |      |
-  |         |  I                |         |                    |      |
-  |         |  I                |   so    |                    +------+
-  |         |  I                +---------+
-  |         |  I                    ::                          ______
-  |         |  I                    \/                         (______)
-  |         |  I                +-driver--+                    | log  |
-  +---------+  I                |   si    |           all ::::>|      |
-               I                |         |           log      |      |
-               I                |         |                    |      |
-  +-sendback+  I                |         |                    +------+
-  |         |  I                |         |
-  |         |  I        ::::::::|         |<::::::
-  |         |  I       ::       |         |      ::
-  |         |  I      ::   ::::>|         |::::   ::
-  |         |  I      ::  ::    |         |   ::  ::
-  |         |  I      :: ::     +---------+    :: ::
-  |         |  I      :: ::                    :: ::
-  |         |  I      :: ::                    :: ::
-  |         |  I      :: ::       ______       :: ::
-  +---------+  I      :: ::      (______)      :: ::
-               I      :: ::      | /tmp |      :: ::
-               I      \/ ::    :>|      |      \/ ::
-  +-dump----+  I  +-dumper--+ :: +------+    +-taper/r-+    +-taper/w-+
-  |         |  I  |   si so | ::             | si so   |    |         |
-  |         |  I  |         | ::  ______     |         |    |         |
-  |         |  I  |mesgfd   | :: (______)    |         |    |         |
-  |       se|::::>|::::::::>|::  | hold |    |         |    |         |
-  |         |  I  |     errf|    | disk |    |      p2c|:::>|p2c      |
-  |         |  I  |         |    |      |    |      c2p|<:::|c2p      |
-  ____
-  |         |  I  |datafd   | ::>|      |::: |fd       |    |         |   /   \
-  |       so|::::>|::::::::>|::  +------+  :>|::::::::>SHDMEM::::::::>|::
-  >|tape|
-  |         |  I  |    outfd| ::          :: |         |    |   tapefd|   \ _ /
-  +---------+  I  +---------+  ::::::::::::  +---------+    +---------+
-               I
-
-
- server and amandad on client
-
-XXX - still to be done
-
- planner and driver
-
-planner interrogates all clients and generates a plan of which disks to backup
-and what dump level to do them at. The plan is plain text with one line per
-disk to be dumped. It is piped from planners stdout to drivers stdin. Plan
-lines come in two flavours:
-For total dumps: <host> <disk> <pri> <lev> <size> <time> <deg lev> <deg size>
-<deg time>
-For incremental dumps: <host> <disk> <pri> <lev> <size> <time>
-Where: <host> Host name of client (from disklist file) <disk> Name of disk
-(from disklist file) <pri> Priority of backup (pri from disklist and
-amanda.conf + days overdue for total) <lev> Dump level for dump (0 for total,
-1-9 for incremental) <size> Estimated size (in Kb after compression if
-requested) <time> Estimated time for backup (in seconds) <deg lev> <lev> to use
-if in degraded mode <deg size> <size> to use if in degraded mode <deg time>
-<time> to use if in degraded mode
-
- driver and dumper
-
-dumper talks via two pipes connected to each dumper's stdin and stdout. The
-commands and responses are plain text.
-driver can ask dumper to do a dump to a file on the holding disk: FILE-DUMP
-<handle> <filename> <host> <disk> <level> <dumpdate> <chunksize> <prog>
-<options> or directly to taper: PORT-DUMP <handle> <port> <host> <disk> <level>
-<dumpdate> <prog> <options> or exit at the end of the run: QUIT
-If the dump finishes correctly dumper replies with: DONE <handle> [<message>]
-If something goes wrong with the dump, dumper can request that the dump be
-retried at a later time with: TRY-AGAIN <handle> [<message>] or, for fatal
-errors, be abandoned with: FAILED <handle> [<message>]
-If the holding disk runs out of space, dumper will give: NO-ROOM <handle> and
-wait for driver to either fix the problem and say: CONTINUE or just say: ABORT
-in which case dumper kills the dump and replies with: ABORT-FINISHED <handle>
-If driver says something that dumper doesn't recognise it responds with: BAD-
-COMMAND <message>
-Where: <handle> Request ID <filename> Name of file (on holding disk) to write
-dump <port> Port (of taper) to send dump directly <host> Hostname of client
-<disk> Disk to backup <level> Dump level to do backup at <prog> Dump program to
-use <options> Options to pass to sendbackup <message> Error or status message
-*driver and taper
-driver talks via two pipes connected to taper's stdin and stdout. The commands
-and responses are plain text.
-driver initialises taper with: START-TAPER <datestamp> to which taper replies
-with: TAPER-OK or, for fatal errors, with: TAPER-ERROR [<message>]
-driver can ask taper to to copy a file from the holding disk to tape: FILE-
-WRITE <handle> <filename> <host> <disk> <level> or directly from a dumper:
-PORT-WRITE <handle> <host> <disk> <level> or exit at the end of the run: QUIT
-taper responds to the PORT-WRITE command with: PORT <port> which driver should
-then hand on to dumper in a PORT-DUMP command.
-taper responds to the QUIT command with: QUITING
-If the copy to tape finishes correctly taper replies with: DONE <handle>
-[<message>]
-If something goes wrong with the tape, taper can request that the dump be
-retried at a later time with: TRY-AGAIN <handle> [<message>] or, for fatal
-errors, be abandoned with: TAPE-ERROR <handle> [<message>]
-If driver says something that taper doesn't recognise it responds with: BAD-
-COMMAND <message>
-Where: <datestamp> Todays date as "yymmdd" <handle> Request ID <filename> Name
-of file (on holding disk) to write dump <port> Port (of taper) to send dump
-directly <host> Hostname of client <disk> Disk to backup <level> Dump level to
-do backup at <message> Error or status message
-
- taper(read) and taper(write)
-
-There are two parts to taper: the file reader and the tape writer.
-Communication between the two sides is via a bit of shared memory for data
-transfer and two pipes (one in each direction) for synchronisation.
-The shared memory area is made up of NBUFS (=20) buffers each of which contains
-a status word and a BUFFER_SIZE (=32*1024) byte data buffer.
-The sync pipes are used to transfer a simplistic command sequence:
-reader writer ------ ------
-Startup S<datestamp> ---> <--- S Start OK <--- E<messge> Error
-Open tape O<datestamp><hostname><diskname><level> ---> <--- O Opening
-Write buffer W<bufnum> ---> <--- R<bufnum> Buffer empty <--- E<message> Error
-<--- T<message> Error, try again E ack e ---> Protocol error X ---> <--- x X
-ack
-Close tape C ---> <--- C<label><filenum><stats> Closing
-Quit Q --->
-
-Note
-
-Refer to http://www.amanda.org/docs/internals.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                            Up                           Next
-Chapter 23. Amanda dumper API  Home  Chapter 25. Amanda Event API
-
diff --git a/docs/introduction.txt b/docs/introduction.txt
deleted file mode 100644 (file)
index 4596658..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-
-Part I. Installation
-Prev            Next
-
--------------------------------------------------------------------------------
-
-
-Part I. Installation
-
-
-
-Initial Installation
-
-This section of the Amanda-docs contains general info on how to install Amanda
-and how to configure its basic parts. Please read this!
-Table of Contents
-
-
-  1._Amanda_2.5.0_-_System-Specific_Installation_Notes
-
-
-        Solaris_2.6
-
-        Solaris
-
-        Trusted_Solaris
-
-        SunOS_4.x
-
-        Ultrix
-
-        HP/UX
-
-        Linux
-
-        Digital_Unix_4
-
-        Sinix_5.43_(Reliant_Unix)
-
-        IRIX_(all)
-
-        IRIX_6
-
-        IRIX_6.5.x
-
-        SCO
-
-        FreeBSD_3.0
-
-        FreeBSD_4.9
-
-        FreeBSD_5.1
-
-        AIX
-
-        Microsoft_Windows
-
-        Mac_OS_X
-
-
-  2._Amanda_Installation_Notes
-
-
-        Before_doing_anything
-
-        Compiling_the_Amanda_sources
-
-        Setting_up_your_Amanda_Configuration
-
-
-              Setting_up_the_Tape_Server_Host
-
-              Set_up_the_Backup_Client_Hosts
-
-
-
-  3._Excluding
-
-
-        Introduction
-
-        Please_Read
-
-        Before_We_Begin
-
-        Choosing_an_exclude_mechanism
-
-
-              Exclude_Mechanisms
-
-
-        Expression
-
-        Wildcard_Expansion
-
-        Troubleshooting
-
-
-              Broken_gnutar?
-
-              The_ps_command_is_your_friend.
-
-
-
-  4._Indexing_with_Amanda
-
-
-        Database_Format
-
-        Database_Browsing
-
-        File_Extraction
-
-        Protocol_Between_amindexd_and_amrecover
-
-        Installation_Notes
-
-        Permissions
-
-        Changes_from_amindex-1.0
-
-        Changes_from_amindex-0.3
-
-        Changes_from_amindex-0.2
-
-        Changes_from_amindex-0.1
-
-        Changes/additions_to_2.3.0
-
-        Known_Bugs
-
-
-  5._Backup_PC_hosts_using_Samba
-
-
-        Installation
-
-        Setup
-
-        Example
-
-        Bugs_and_notes
-
-
-  6._Restore
-
--------------------------------------------------------------------------------
-
-Prev                                                                  Next
-Attributions  Home  Chapter 1. Amanda 2.5.0 - System-Specific Installation
-                                                                     Notes
-
diff --git a/docs/ix01.txt b/docs/ix01.txt
deleted file mode 100644 (file)
index 8199c10..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-
-   Index
-Prev     
-
--------------------------------------------------------------------------------
-
-Index
-
-
-A
-
-
-
-  autoflush, the_multiple-dumps-question
-
-
-C
-
-
-
-  changerdev, Setup
-
-  changerfile, Setup
-
-  changerident, Notes_about_changer.conf
-
-
-D
-
-
-
-  DLE, Setup, the_DLE-question
-
-
-F
-
-
-
-  filemark, Setup
-
-
-M
-
-
-
-  Mac OS X, Mac_OS_X
-
-
-R
-
-
-
-  rawtapedev, Setup
-
-  runtapes, Schedule_Balancing
-
-
-S
-
-
-
-  speed, Setup
-
-
-T
-
-
-
-  tapecycle, Setup
-
-  tapedev, Notes_about_changer.conf, Setup
-
-  tapetype, Setup
-
-  tpchanger, Setup
-
-
-V
-
-
-
-  vtapes, Basics
-
--------------------------------------------------------------------------------
-
-Prev               
-amverifyrun  Home  
-
diff --git a/docs/kerberos.txt b/docs/kerberos.txt
deleted file mode 100644 (file)
index 748a916..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-
- Chapter 28. Using Kerberos with Amanda
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 28. Using Kerberos with Amanda
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Amanda_2.5.0_-_KERBEROS_v4_SUPPORT_NOTES
-
-
-        Configuration
-
-        Installation
-
-        conf_file
-
-
-  Amanda_2.5.0_-_KERBEROS_v5_SUPPORT_NOTES
-
-
-        Building
-
-        Installation
-
-        conf_file
-
-        Destination_Host_Permissions_file
-
-
-
- Amanda 2.5.0 - KERBEROS v4 SUPPORT NOTES
-
-
- Configuration
-
-The configure script defaults to:
-
-  #  define SERVER_HOST_PRINCIPLE "amanda"
-  #  define SERVER_HOST_INSTANCE  ""
-  #  define SERVER_HOST_KEY_FILE  "/.amanda"
-
-  #  define CLIENT_HOST_PRINCIPLE "rcmd"
-  #  define CLIENT_HOST_INSTANCE  HOSTNAME_INSTANCE
-  #  define CLIENT_HOST_KEY_FILE  KEYFILE
-
-  #  define TICKET_LIFETIME       128
-       
-
-You can override these with configure options if you so desire, with:
-
-       --with-server-principal=ARG    server host principal  [amanda]
-       --with-server-instance=ARG     server host instance   []
-       --with-server-keyfile=ARG      server host key file   [/.amanda]
-       --with-client-principal=ARG    client host principal  [rcmd]
-       --with-client-instance=ARG     client host instance
-  [HOSTNAME_INSTANCE]
-       --with-client-keyfile=ARG      client host key file   [KEYFILE]
-       --with-ticket-lifetime=ARG     ticket lifetime        [128]
-       
-
-The configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /
-usr/lib, and /opt/kerberos/lib for libkrb.a. (in that order) for the kerberos
-bits. If it finds them, kerberos support will be added in, if it doesn't, it
-won't. If the kerberos bits are found under some other hierarchy, you can
-specify this via the --with-krb4-security=DIR, where DIR is where the kerberos
-bits live. It'll look under the 'lib' directory under this hierarchy for
-libkrb.a.
-
- Installation
-
-The kerberized Amanda service uses a different port on the client hosts. The /
-etc/services line is:
-
-  kamanda      10081/udp
-       
-
-And the /etc/inetd.conf line is:
-
-  kamanda dgram udp wait root /usr/local/libexec/amanda/amandad amandad -
-  auth=krb4
-       
-
-Note that you're running this as root, rather than as your dump user. Amanda
-will set it's uid down to the dump user at times it doesn't need to read the
-srvtab file, and give up root permissions entirely before it goes off and runs
-dump. Alternately you can change your srvtab files to be readable by user
-amanda.
-
- conf file
-
-The following dumptype options apply to krb4:
-
-  auth "krb4"  # use krb4 auth for this host
-               # (you can mingle krb hosts & bsd .rhosts in one conf)
-  kencrypt     # encrypt this filesystem over the net using the krb4
-               # session key.  About 2x slower.  Good for those root
-               # partitions containing your keyfiles.  Don't want to
-               # give away the keys to an ethernet sniffer!
-               # This is currently always enabled.  There is no
-               # way to disable it.  This is a bug.
-       
-
-
- Amanda 2.5.0 - KERBEROS v5 SUPPORT NOTES
-
-
- Building
-
-You must specify --with-krb5-security to configure, otherwise there will be no
-attempt to look for kerberos binaries. You may specify a path that the system
-should look for the kerberos libraries, or leave it to the default.
-By default, when --with-krb5-security is specified with with no path, the
-configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/
-lib, and /opt/kerberos/lib for libkrb.a. (in that order) for the kerberos bits.
-If it finds them, kerberos support will be added in, if it doesn't, it won't.
-If the kerberos bits are found under some other hierarchy, you can specify this
-via the --with-krb5-security=DIR, where DIR is where the kerberos bits live.
-It'll look under the 'lib' directory under this hierarchy for libkrb.a.
-The krb5 driver script defaults to:
-
-  /*
-   * The lifetime of our tickets in minutes.
-   */
-  #define Amanda_TKT_LIFETIME     (12*60)
-
-  /*
-   * The name of the service in /etc/services.
-   */
-  #define Amanda_KRB5_SERVICE_NAME        "k5amanda"
-       
-
-You can currently only override these by editing the source.
-The principal and keytab file that the amanda uses are genearlly set in the
-amanda.conf file (see below). You can hardcode this in the source if you really
-want to and that's described in common-src/krb5-security.c
-
- Installation
-
-The kerberized Amanda service uses a different port on the client hosts. The /
-etc/services line is:
-
-  k5amanda      10082/tcp
-       
-
-And the /etc/inetd.conf line is:
-
-  k5amanda stream tcp nowait root /usr/local/libexec/amanda/amandad amandad -
-  auth=krb5
-       
-
-Note that you're running this as root, rather than as your dump user. Amanda
-will set it's uid down to the dump user at times it doesn't need to read the
-keytab file, and give up root permissions entirely before it goes off and runs
-dump. Alternately you can change your keytab files to be readable by user
-amanda. You should understand the security implications of this before changing
-the permissions on the keytab.
-
- conf file
-
-The following dumptype options apply to krb5:
-
-  auth "krb5"  # use krb5 auth for this host
-               # (you can mingle krb hosts & bsd .rhosts in one conf)
-       
-
-The following two configuration directives are required in the amanda.conf file
-for kerberos 5 dumps to work:
-
-  krb5keytab
-  krb5principal
-       
-
-For example:
-
-  krb5keytab   "/etc/krb5.keytab-amanda"
-  krb5principal        "amanda/saidin.omniscient.com"
-       
-
-The principal in the second option must be contained in the first. The keytab
-should be readable by the amanda user. (and definitely not world readable!)
-This is (obviously) on the server. In MIT's kadmin, the following:
-
-  addprinc -randkey amanda/saidin.omniscient.com
-  ktadd -k /etc/krb5.keytab-amanda amanda/saidin.omniscient.com
-       
-
-will do the trick. You will obviously want to change the principal name to
-reflect something appropriate for the conventions at your site.
-You must also configure each client to allow the amanda principal in for dumps.
-This is described in section 4.
-
- Destination Host Permissions file
-
-There are several ways to go about authorizing a server to connect to a client.
-The normal way is via a .k5amandausers file or a .k5login file in the client
-user's home directory. The determination of which file to use is based on the
-way you ran configure on Amanda. By default, Amanda will use .k5amandahosts,
-but if you configured with --without-amandahosts, Amanda will use .k5login.
-(similar to the default for .rhosts/.amandahosts-style security). The .k5login
-file syntax is a superset of the default krb5 .k5login. The routines to check
-it are implemented in amanda rather than using krb5_kuserok because the
-connections are actually gssapi based.
-This .k5amandahosts/.k5login is a hybrid of the .amandahosts and a .k5login
-file. You can just list principal names, as in a .k5login file and the
-principal will be permitted in from any host. If you do NOT specify a realm,
-then there is no attempt to validate the realm (this is only really a concern
-if you have cross-realm authentication set up with another realm or something
-else that allows you multiple realms in your kdc. If you do specify a realm,
-only that principal@realm will be permitted to connect.
-You may prepend this with a hostname and whitespace, and only that principal
-(with optional realm as above) will be permitted to access from that hostname.
-Here are examples of valid entries in the .k5amandahosts:
-
-  service/amanda
-  service/amanda@TEST.COM
-  dumpmaster.test.com service/amanda
-  dumpmaster.test.com service/amanda@TEST.COM
-       
-
-Rather than using a .k5amandahosts or .k5login file, the easiest way is to use
-a principal named after the destination user, (such as amanda@TEST.COM in our
-example) and not have either a .k5amandahosts or .k5login file in the
-destination user's home directory.
-
-Note
-
-There is no attempt to verify the realm in this case (only a concern if you
-have cross-realm authentication setup).
-
-Note
-
-Refer to http://www.amanda.org/docs/kerberos.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                           Up                        Next
-Chapter 27. Virtual Tape API  Home  Part VI. Historical files
-
diff --git a/docs/labelprinting.txt b/docs/labelprinting.txt
deleted file mode 100644 (file)
index 475a403..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-
-           Chapter 11. Printing of Labels
-Prev  Part II. About Tapes and Changers  Next
-
--------------------------------------------------------------------------------
-
-Chapter 11. Printing of Labels
-
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  The_New_Feature
-
-  Labels_provided
-
-  History
-
-  How_it_works
-
-
- The New Feature
-
-Amanda now has the ability to print postscript paper tape labels. The labels
-have what machines, partitions, and the level of the dump the tape has on it.
-This is achieved by adding the lbl-templ field to the tapetype definition.
-Since the labels are specific to the type of tape you have, that seemed to most
-logical place to add it.
-You can also specify an alternate "printer" definition to print the label to
-other than the system default printer.
-If you don't add this line to your tapetype definition, Amanda works as it
-always has.
-
- Labels provided
-
-The author has provided label templates for the following tape types. These are
-pretty generic labels, and should be easy to customize for other tape types.
-Others are encouraged to do so.
-
-* Exabyte 8mm tapes
-* DDS 4mm tapes
-* DLT tapes (in progress).
-
-
- History
-
-At the University of Colorado at Boulder, we used to use some dump scripts that
-printed out paper tape labels that went with the tape. When we started using
-Amanda for our dumps, my boss insisted we still generate them, in case we
-weren't able to access the Amanda database. The thought was that as long as we
-had an amrestore binary on a machine, we could just look at the label, grab the
-tapes, and do the restore.
-As a result of this we have had to hack this feature into every version of
-Amanda from 2.1.1 through 2.4.0-prerelease.
-Our hope in adding this feature is that others find it as useful as we have.
-
- How it works
-
-The majority of the changes are in reporter.c. Just as you might run the
-reporter by itself to see what the report will (or did) look like with a
-logfile. When the reporter prints out the report, the postscript label template
-is copied, and the successful machines, partitions, and dump levels are
-appended to this. The output either goes to /tmp/reporter.out.ps (when running
-in testing mode) or through a pipe to the printer (default printer, if an
-alternate "printer" is not specified).
-
-Note
-
-Refer to http://www.amanda.org/docs/labelprinting.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev                                                    Up               Next
-Chapter 10. RAIT (Redundant Array of Inexpensive Tape) Home  Part III. HOWTOs
-Support 
-
diff --git a/docs/links.txt b/docs/links.txt
deleted file mode 100644 (file)
index 2bd0698..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-    Chapter 37. Web Ressources
-Prev  Part VII. Appendixes  Next
-
--------------------------------------------------------------------------------
-
-Chapter 37. Web Ressources
-
-
-Stefan G. Weichinger
-
-Original text
-AMANDA Core Team
-<sgw@amanda.org>
-See some original Amanda-papers by James da Silva and Olafur Gundmundsson here:
-
-* The presentation of Amanda:
-  Postscript: http://www.amanda.org/docs/lisa-vii.ps
-  PDF: http://www.amanda.org/docs/lisa-vii.pdf
-* A document about the performance of Amanda:
-  Postscript: http://www.amanda.org/docs/usenix92.ps
-  PDF: http://www.amanda.org/docs/usenix92.pdf
-
-
-Note
-
-Refer to http://www.amanda.org/docs/links.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev          Up    Next
-amverifyrun  Home  Index
-
diff --git a/docs/manpages.txt b/docs/manpages.txt
deleted file mode 100644 (file)
index 392596e..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-
-Chapter 36. The Amanda Manual Pages.
-Prev  Part VII. Appendixes      Next
-
--------------------------------------------------------------------------------
-
-Chapter 36. The Amanda Manual Pages.
-
-Table of Contents
-
-
-  amadmin \14 administrative interface to control Amanda backups
-
-  amaespipe \14 wrapper program for aespipe
-
-  amanda \14 Advanced Maryland Automatic Network Disk Archiver
-
-  amanda.conf \14 Main configuration file for Amanda, the Advanced Maryland
-  Automatic Network Disk Archiver
-
-  amanda-client.conf \14 Client configuration file for Amanda, the Advanced
-  Maryland Automatic Network Disk Archiver
-
-  amcheck \14 run Amanda self-checks
-
-  amcheckdb \14 check Amanda database for tape consistency
-
-  amcleanup \14 run the Amanda cleanup process after a failure
-
-  amcrypt \14 reference crypt program for Amanda symmetric data encryption
-
-  amcrypt-ossl \14 crypt program for Amanda symmetric data encryption using
-  OpenSSL
-
-  amcrypt-ossl-asym \14 crypt program for Amanda asymmetric data encryption using
-  OpenSSL
-
-  amdd \14 Amanda version of dd
-
-  amdump \14 back up all disks in an Amanda configuration
-
-  amfetchdump \14 extract backup images from multiple Amanda tapes.
-
-  amflush \14 flush Amanda backup files from holding disk to tape
-
-  amgetconf \14 look up amanda.conf variables
-
-  amlabel \14 label an Amanda tape
-
-  ammt \14 Amanda version of mt
-
-  amoverview \14 display file systems processed by Amanda over time
-
-  amplot \14 visualize the behavior of Amanda
-
-  amrecover \14 Amanda index database browser
-
-  amreport \14 generate a formatted output of statistics for an Amanda run
-
-  amrestore \14 extract backup images from an Amanda tape
-
-  amrmtape \14 remove a tape from the Amanda database
-
-  amstatus \14 display the state of an Amanda run
-
-  amtape \14 user interface to Amanda tape changer controls
-
-  amtapetype \14 generate a tapetype definition.
-
-  amtoc \14 generate TOC (Table Of Contents) for an Amanda run
-
-  amverify \14 check an Amanda tape for errors
-
-  amverifyrun \14 check the tapes written by the last Amanda run
-
-This chapter contains the manual pages from the official Amanda distribution.
-
-Note
-
-Refer to http://www.amanda.org/docs/manpages.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                   Up      Next
-Part VII. Appendixes  Home  amadmin
-
diff --git a/docs/multitape.txt b/docs/multitape.txt
deleted file mode 100644 (file)
index eb77f6c..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-
-Chapter 32. Multitape support in Amanda 2.2
-Prev  Part VI. Historical files        Next
-
--------------------------------------------------------------------------------
-
-Chapter 32. Multitape support in Amanda 2.2
-
-
-James da Silva
-
-Original text
-AMANDA Core Team
-<jds@amanda.org>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Draft 1 - jds 3/29/94
-Table of Contents
-
-
-  Introduction
-
-  New_Planner_Algorithm
-
-
-        Time
-
-        Full_Backups
-
-        Schedule_Balancing
-
-        Overwrite_Detection
-
-
-  Taper_Algorithm
-
-
-        Choosing_a_tape
-
-        End_of_tape_handling
-
-        Tape_Format_Changes
-
-        Tapelist_File_Changes
-
-
-
- Introduction
-
-The goal of this enhancement is to make Amanda independent of the number of
-tapes used per run or even per dump cycle. Specifically, I would like Amanda to
-handle the following:
-
-* output of amdump run goes to more than one tape
-* a single dump file can straddle two tapes
-* more than one amdump run can be done in a single day
-* planner should not care how many runs per cycle occur
-
-And later:
-
-* multiple runs of amdump can go onto one tape (eg an append mode)
-* any dump files from a previous run that are on the holding disk are written
-  to tape in this run (eg eliminate amflush)
-* taper write to multiple tape drives simultaneously
-
-
- New Planner Algorithm
-
-
- Time
-
-Previously, planner marked time by the number of amdump runs, which it equated
-with number of tapes, and number of days. In Amanda 2.2, Amanda keeps track of
-the real passage of time, and doesn't generally care about the number of runs
-or tapes between any two events.
-While Amanda 2.2 doesn't care about spacing between runs, dump cycles are still
-in terms of days, to make things easy to understand for the user. So, time
-differences are rounded to the nearest 24 hours:
-days_diff(A,B) = (<B> - <A> + 86400/2) / 86400
-Where the times A and B are in seconds since the Unix epoch, and 86400 is the
-number of seconds per day. This rounds a 2.49 day difference down to 2 days,
-and a 2.5 day difference up to 3 days. No, Olafur, Unix time does not handle
-leap seconds. Give me a break. :-)
-
- Full Backups
-
-The first thing planner does is calculate when each filesystem is due for a
-full backup. This is trivial for normal backups:
-full_is_due = days_diff(<time of last full>, <curtime>) >= dumpcycle
-There is a complication for "skip-full" filesystems. Under 2.2, these will be
-skipped on any runs that occur on the day the full is due, but we have to do
-the right thing if multiple runs are done that day, and if no runs are done
-that day (in which case we should be doing an incremental). Also, the time of
-last full dump is a fiction maintained by the planner -- Amanda has no way to
-tell whether the full backup was actually done or when it was done:
-
-       if(skip-full) {
-               if(full_is_due)
-                       <time of last full> += dumpcycle;
-               if(days_diff(<time of last full>, <curtime>) == 0)
-                       skip the filesystem on this run;
-               else
-                       do an incremental dump of this filesystem;
-       }
-       
-
-
- Schedule Balancing
-
-The runtapes parameter tells planner how many tapes it should plan to use each
-run. It multiplies this by the tape length to get the size available for the
-run. (NOTE: later amend this size if appending to tapes, or if there are dumps
-on the holding disk waiting to be flushed). Other than the size calculation,
-planner doesn't really care how many tapes will be written to.
-The fundamental problem with attempting to balance the schedule is that we no
-longer know how many amdump runs will be done in a full cycle. The number may
-change from cycle to cycle if there are extenuating circumstances.
-So, planner must guess at how many runs will be done in one cycle, by looking
-at the information for the last cycle, or, if this is the first cycle, assuming
-one run for each day in the dump cycle.
-
- Overwrite Detection
-
-When can a tape be overwritten, considering that it might have old dumps on it?
-We want to be able to warn when full dumps are going to be overwritten, but
-given the possibility of old files on the tape, how can we know when the tape
-is no longer needed? I think we can get this when going through the info file,
-considering each full dump and what tape it is on. Make sure we correctly
-handle stale information.
-
- Taper Algorithm
-
-
- Choosing a tape
-
-taper must now handle writing to multiple tapes in one night, but choosing the
-tapes from the tape rack is done one at a time as needed, re-applying the same
-algorithm each time (see Amanda_Tape_Changer_Support).
-
- End of tape handling
-
-As in earlier versions of Amanda, taper itself does not try to restrict writing
-to the tape size given in the config file. It relied on planner having
-correctly estimated backup sizes and limiting itself to what would fit on one
-tape.
-Now, taper needs to switch to a new tape when the current tape has filled up.
-The tape is considered full when taper gets a write error. This will most
-likely occur in the middle of writing a (potentially large) backup file,
-perhaps even from a direct-to-tape socket, so there is no possibility of
-starting the backup file over again on the next tape, it must start from where
-it left off, rewriting the block that got the error on the next tape.
-To insure correct operation, the file header of the continued file should
-contain an indication that it is a continuation, and at what offset. amrestore
-of course needs to be aware of this scheme and handle it correctly, perhaps by
-double-buffering internally. XXX provide more alg details here, or just leave
-it with the general idea?
-
- Tape Format Changes
-
-We need to specify the sequence number of the tape in the run, in the tape
-header file. The file header block specifies whether it is a continuation file
-or not.
-
- Tapelist File Changes
-
-The lines in the tapelist file should contain the sequence number of the tape
-in its run, as well as the amount of data written on the tape, and perhaps
-whether or not the end of tape was reached.
-
-Note
-
-Refer to http://www.amanda.org/docs/multitape.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                            Up                                        Next
-Chapter 31. What once was new  Home  Chapter 33. Thoughts about a Strategy API
-
diff --git a/docs/portusage.txt b/docs/portusage.txt
deleted file mode 100644 (file)
index 45c9820..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-
-Chapter 22. How Amanda uses UDP and TCP ports
-Prev  Part V. Technical Background       Next
-
--------------------------------------------------------------------------------
-
-Chapter 22. How Amanda uses UDP and TCP ports
-
-
-John R. Jackson
-
-Original text
-AMANDA Core Team
-<jrj@purdue.edu>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  TCP_port_allocation
-
-  User_TCP_port_range_(--with-tcpportrange)_summary
-
-  UDP_port_allocation
-
-  User_UDP_port_range_(--with-udpportrange)_summary
-
-  Firewalls_and_NAT
-
-Amanda uses both UDP and TCP ports during its operation. The amandad service is
-listening (via inetd/xinetd) at a well known (fixed) port on each client for
-UDP connections. The amindexd and amidxtaped services are listening (also via
-inetd/xinetd) at well known ports on the tape server for TCP connections.
-When a process on the tape server wants to talk to a client, it creates a UDP
-socket and binds it to a port on its side, then sends the packet to the well
-known amandad service port on the client. Because security information is
-passed, the port bound on the connecting (tape server) side must be privileged
-(less than 1024). This "proves" to amandad whoever is connecting is running as
-root, and therefore is trustworthy (there are all sorts of issues with the
-validity of this "trust" that are beyond the scope of this document).
-A similar sequence of events happens when amrecover on a client wants to
-contact amindexd or amidxtaped on the tape server. The port that amrecover
-binds to its TCP socket must be privileged, which is one of the reasons it must
-be run as root.
-Amanda also uses TCP connections for transmitting the backup image, messages
-and (optionally) the index list from a client back to the dumper process on the
-tape server. A process called sendbackup is started by amandad on the client.
-It creates two (or three, if indexing is enabled) TCP sockets and sends their
-port numbers back to dumper in a UDP message. Then dumper creates and binds TCP
-sockets on its side and connects to the waiting sendbackup.
-Because sendbackup does not run as root on the client, it cannot allocate
-privileged TCP ports to listen on. The dumper process is setuid root and could
-bind privileged ports on its side (it currently does not), but because
-sendbackup does not care what port connects back to it (it assumes the only
-process that could have knowledge of the port numbers to use is dumper), it
-does not check the peer (connecting) port number.
-
- TCP port allocation
-
-When Amanda creates a TCP server socket to listen for incoming connections
-( sendbackup), it goes through the following bind steps:
-
-* try for the user TCP port range (--with-tcpportrange), if defined. If that
-  fails ...
-
-
-* try for a privileged port (512 .. 1023). If that fails ...
-
-
-* get any available port.
-
-In all cases, it will not use a port that has been assigned to other well-known
-services. This sequence is implemented in stream_server().
-When Amanda ( dumper) creates an unprivileged TCP client socket to connect to a
-server, it goes through the following bind steps:
-
-* try for the user TCP port range (--with-tcpportrange), if defined. If that
-  fails ...
-
-
-* get any available port.
-
-In all cases, it will not use a port that has been assigned to other well-known
-services. This sequence is implemented in stream_client().
-When Amanda ( amrecover) creates a privileged TCP client socket to connect to a
-server, it goes through the following bind step:
-
-* try for a privileged port (512 .. 1023). If that fails, the whole request is
-  aborted.
-
-This sequence is implemented in stream_client_privileged().
-The stream_server() routine is used in two ways:
-
-* taper to set up direct to tape communication with dumper on localhost.
-
-If a user TCP port range is defined, it needs to be unprivileged because taper
-is not running as root.
-
-* sendbackup to set up a transfer with its dumper.
-
-If a user TCP port range (--with-tcpportrange) is defined, it needs to be
-unprivileged because sendbackup is not running as root.
-A user TCP port range needs to be large enough for three ports (data, message
-and index) times the number of simultaneous backups the client may be asked to
-perform ("maxdumps" in amanda.conf).
-The stream_client() routine is used in two ways:
-
-* dumper to connect to taper for a direct to tape operation. Except for making
-  sure what is connecting is not (ftp) port 20 (a common attack entry point),
-  taper does not pay any attention to the source ( dumper) port number.
-
-
-* dumper to connect to sendbackup on a client. Again, except for port 20,
-  sendbackup does not care what port the request comes from.
-
-If a user TCP port range (--with-tcpportrange) is defined, it needs to be
-unprivileged because dumper is not running as root (at this point).
-A user TCP port range needs to be large enough for two ports (one to sendbackup
-on the client, and possibly one to taper) times the number of dumpers
-("inparallel" in amanda.conf).
-The stream_client_privileged() routine is used in one way:
-
-* amrecover to connect to amindexd and amidxtaped.
-
-Because security information is passed, amindexd/ amidxtaped (via security_ok()
-in security.c) insist the other end ( amrecover) be bound to a privileged port.
-
- User TCP port range (--with-tcpportrange) summary
-
-Pick the max of (2 * inparallel) and (3 * largest maxdumps). Allocate at least
-that many ports in the unprivileged (1024 or larger) range. Stay away from
-other well known ports (e.g. in your /etc/services file) or account for their
-potential use by making the portrange larger.
-
- UDP port allocation
-
-When Amanda creates a UDP socket, the same order of assignment as above is used
-by dgram_bind():
-
-* try for the user UDP port range (--with-udpportrange), if defined. If that
-  fails ...
-
-
-* try for a privileged port (512 .. 1023). If that fails ...
-
-
-* get any available port.
-
-In all cases, it will not use a port that has been assigned to other well-known
-services. The dgram_bind() routine is called from three places, amcheck,
-planner and dumper. In each case, a connection to amandad on a client is being
-set up. amandad, in turn, calls security_ok(), which insists the other end of
-the connection be a privileged port, so a user UDP port range (--with-
-udpportrange) must specify privileged port numbers.
-A user UDP port range must allow for one port for each client that might be
-contacted at a time. planner and amcheck use a single socket to contact all
-their clients, but there may be multiple dumpers (based on "inparallel" in
-amanda.conf) and each needs its own port.
-
- User UDP port range (--with-udpportrange) summary
-
-Allocate at least "inparallel" many ports in the privileged (1023 or smaller)
-range. Stay away from other well known ports (e.g. in your /etc/services file)
-or account for their potential use by making the portrange larger.
-
- Firewalls and NAT
-
-I'm not familiar with firewalls or NAT -- one of the benefits of working in a
-University environment :-). So the following is likely to be completely wrong,
-but I have tried to get the advice of folks who do really understand this
-stuff.
-Firewalls and Amanda should be pretty easy to set up. Just pick user UDP and
-TCP port ranges, build Amanda with them (--with-udpportrange and --with-
-tcpportrange) and let them through the firewall. You also need to let the well
-known Amanda ports through, just as you would ftp or telnet.
-NAT has other issues. If the Amanda client is "outside" NAT, there should not
-be a problem for backups. Sendbackup will set up the ports and tell dumper what
-they are. Then dumper will connect to them from "inside" and NAT should leave
-that alone, although it doesn't really matter since sendbackup does not care
-who connects to it (other than it not be ftp port 20).
-If the Amanda tape server is outside, NAT will have to be told how to translate
-the incoming connections from dumper to the client. To do that, the UDP and TCP
-port ranges will have to be known and only one client can be inside.
-The reverse is true for amrecover. If amrecover is run from inside NAT, there
-should not be a problem -- it's just like running ftp or telnet. But from the
-outside, NAT will have to know where the amindexd/amidxtaped services are and
-allow them through (much like ftp or telnet daemons). Since they are on known
-port numbers, the user TCP port range is not an issue.
-A user TCP port range is probably not important in the case of dumper and taper
-talking to each other since only the one machine (localhost) is involved and so
-it does not go through a firewall. But I could be wrong, especially if NAT is
-involved.
-The details of how you configure a specific firewall or NAT are beyond the
-scope of this document (although examples would be welcome). You need to read
-up on the documentation that comes with them.
-
-Note
-
-Refer to http://www.amanda.org/docs/portusage.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                           Up                            Next
-Part V. Technical Background  Home  Chapter 23. Amanda dumper API
-
diff --git a/docs/pr01.txt b/docs/pr01.txt
deleted file mode 100644 (file)
index 47fe6de..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-
-   Abstract
-Prev     Next
-
--------------------------------------------------------------------------------
-
-Abstract
-
-
-Note
-
-This is the Docbook/XML-version of the official Amanda documentation. Please
-refer to http://www.amanda.org/docs/AMANDA-docs.html for the latest versions of
-these documents. They are available as html, ps and pdf.
-This is the official documentation for Amanda 2.5.0. The release 2.5.0 brings
-various new features:
-
-* Communication security/authentication
-* Data security
-* Enhanced possibilities for Compression
-* Dump images spanning multiple media volumes
-* Auto tape labelling
-* Improved code quality
-
-Feel free to contact me with corrections, additions or updates. Thank you.
-Stefan G. Weichinger, for the AMANDA Core Team, March 2006.
-<sgw@amanda.org>
--------------------------------------------------------------------------------
-
-Prev                                     Next
-The Official AMANDA Documentation  Home      
-
diff --git a/docs/pr02.txt b/docs/pr02.txt
deleted file mode 100644 (file)
index df0c9cb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-Prev     Next
-
--------------------------------------------------------------------------------
-Conversion to Docbook/XML by Stefan G. Weichinger, member of the Amanda Core
-Team.
-XML-Buildtree by Jelmer R. Vernooij, member of the Samba-Team. Thanks, Jelmer
-... !
--------------------------------------------------------------------------------
-
-Prev                             Next
-Abstract  Home  Copyright Information
-
diff --git a/docs/pr03.txt b/docs/pr03.txt
deleted file mode 100644 (file)
index 803e0f9..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-Copyright Information
-Prev             Next
-
--------------------------------------------------------------------------------
-
-Copyright Information
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that the
-above copyright notice appear in all copies and that both that copyright notice
-and this permission notice appear in supporting documentation, and that the
-name of U.M. not be used in advertising or publicity pertaining to distribution
-of the software without specific, written prior permission. U.M. makes no
-representations about the suitability of this software for any purpose. It is
-provided "as is" without express or implied warranty.
-U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. BE
-LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION
-WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--------------------------------------------------------------------------------
-
-Prev                Next
-      Home  Attributions
-
diff --git a/docs/pr04.txt b/docs/pr04.txt
deleted file mode 100644 (file)
index 512eef6..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-
-Attributions
-Prev     Next
-
--------------------------------------------------------------------------------
-
-Attributions
-
-Amanda_2.5.0_-_System-Specific_Installation_Notes
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_Installation_Notes
-
-* James da Silva <jds@amanda.org> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion, Updates)
-
-Excluding
-
-* Andrew Hall (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Indexing_with_Amanda
-
-* Alan M. McIvor (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Backup_PC_hosts_using_Samba
-
-* Michael Zucchi <M.Zucchi@CIS.UniSA.Edu.Au> (Original text)
-* John R. Jackson <jrj@purdue.edu> (Updates)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Restore
-
-* Daniel Moore (Original text)
-* Alexandre Oliva <oliva@dcc.unicamp.br> (Substantial rewriting)
-* Murf (Corrections and additions)
-* Ralf Fassel (Corrections and additions)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_Tape_Changer_Support
-
-* James da Silva <jds@amanda.org> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-chg-scsi
-
-* Jason X (report real name to sgw@amanda.org) (Original version)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-RAIT_(Redundant_Array_of_Inexpensive_Tape)_Support
-
-* Marc Mengel (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Printing_of_Labels
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_on_Cygwin_HOWTO
-
-* Doug Kingston (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-How_to_use_the_Amanda_file-driver
-
-* Stefan G. Weichinger <sgw@amanda.org> (Original text;XML-conversion;Updates)
-
-AFS_HOWTO
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-How_to_use_a_wrapper
-
-* Bert de Ridder (Original text)
-* Paul Bijnens (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion; Updates)
-
-How_to_do_Amanda-server-side_gpg-encrypted_backups.
-
-* Stefan G. Weichinger <sgw@amanda.org> (Original text)
-
-How_to_use_different_auth_with_Amanda
-
-* Jean-Louis Martineau <martinea@iro.umontreal.ca> (Original text;XML-
-  conversion;Updates)
-
-Using_Amanda
-
-* John R. Jackson <jrj@purdue.edu> (Original text)
-* Gavin Henry <ghenry@suretecsystems.com> (XML-conversion)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion, Updates)
-
-Amanda_FAQ
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Collection_of_the_top_ten_Amanda_questions._And_answers.
-
-* Stefan G. Weichinger <sgw@amanda.org> (Original text; Conversion to Docbook/
-  XML)
-
-Amanda_WISHLIST
-
-* Jean-Louis Martineau <martinea@iro.umontreal.ca> (Additions and Updates)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion; Additions and Updates)
-
-How_Amanda_uses_UDP_and_TCP_ports
-
-* John R. Jackson <jrj@purdue.edu> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_dumper_API
-
-* Alexandre Oliva <oliva@dcc.unicamp.br> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_Internals
-
-* George Scott (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-Amanda_Event_API
-
-* Mike Grupenhoff <kashmir@munge.com> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Amanda_Security_API
-
-* Mike Grupenhoff <kashmir@munge.com> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Virtual_Tape_API
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-Using_Kerberos_with_Amanda
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Response_to_CPIO_Security_Notice_Issue_11:
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Upgrade_Issues
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-What_once_was_new
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion, Updates)
-
-Multitape_support_in_Amanda_2.2
-
-* James da Silva <jds@amanda.org> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion;Updates)
-
-Thoughts_about_a_Strategy_API
-
-* Alexandre Oliva <oliva@dcc.unicamp.br> (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-Y2K_Compliancy
-
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion)
-
-Usage_of_floppy_tape_drives_on_Linux
-
-* Albrecht Gebhardt (Original text)
-* Stefan G. Weichinger <sgw@amanda.org> (XML-conversion,Updates)
-
-Web_Ressources
-
-* Stefan G. Weichinger <sgw@amanda.org> (Original text)
-
--------------------------------------------------------------------------------
-
-Prev                                         Next
-Copyright Information  Home  Part I. Installation
-
diff --git a/docs/rait.txt b/docs/rait.txt
deleted file mode 100644 (file)
index c75be0c..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-
-Chapter 10. RAIT (Redundant Array of Inexpensive Tape) Support
-Prev  Part II. About Tapes and Changers                   Next
-
--------------------------------------------------------------------------------
-
-Chapter 10. RAIT (Redundant Array of Inexpensive Tape) Support
-
-
-Marc Mengel
-
-Original text<mengel@fnal.gov>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  What_is_a_RAIT?
-
-  Using_a_RAIT
-
-  Disaster_Recovery
-
-Currently it is only integrated with the chg-manual changer script;
-collaboration on integrating it with the other tape changers is needed.
-
- What is a RAIT?
-
-RAIT is an acronym for "Redundant Array of Inexpensive Tapes", where data is
-striped over several tape drives, with one drive writing an exclusive-or-sum of
-the others which can be used for error recovery. Any one of the data streams
-can be lost, and the data can still be recovered.
-This means that a 3-drive RAIT set will write 2 "data" streams and one "parity"
-stream, and give you twice the capacity, twice the throughput, and the square
-of the failure rate (i.e. a 1/100 failure rate becomes 1/10,000, since a
-double-tape failure is required to lose data).
-Similarly, a 5-drive RAIT set will give you 4 times the capacity, 4 times the
-throughput (with sufficient bus bandwidth), and the square of the failure rate.
-This means you can back up partitions as large as four times your tape size
-with Amanda, with higher reliability and speed.
-
- Using a RAIT
-
-If you have several tape devices on your system [currently either 3 or 5 drive
-sets are supported] you tell Amanda to use them as a RAIT by listing them as a
-single tape device using /bin/csh curly-brace-and-comma notation, as in:
-
-       tapedev = "rait:/dev/rmt/tps0d{4,5,6}n"
-               
-
-which means that /dev/rmt/tps0d4n, /dev/rmt/tps0d5n, and /dev/rmt/tps0d6n are
-to be treated as a RAIT set. You can now mount three tapes, and label them with
-amlabel, etc.
-Also, you want to create a new tape-type entry, which lists an n-drive RAIT
-set, for this RAIT-set. So if you were using an entry like:
-
-       define tapetype EXB-8500 {
-           comment "Exabyte EXB-8500 drive on decent machine"
-           length 4200 mbytes
-           filemark 48 kbytes
-           speed 474 kbytes
-       }
-               
-
-You would want to make a new one like:
-
-
-       define tapetype EXB-8500x3 {
-           comment "Exabyte EXB-8500 3 drive stripe on decent machine"
-           length 8400 mbytes
-           filemark 200 kbytes
-           speed 948 kbytes
-       }
-               
-
-and change your tapetype entry to:
-
-       tapetype EXB-8500x3
-               
-
-to tell Amanda about the multiple drive set.
-
- Disaster Recovery
-
-To assist in disaster recovery (as well as changer scripts) the Amanda package
-now also includes amdd, which is a simple dd(1) replacement which supports
-(only) the "if=xxx", "of=xxx", "bs=nnn[kMb]" "skip=nnn" and "count=nnn"
-options, but which can read and write RAIT tapesets.
-Using amdd and your usual Amanda unpack instructions will suffice for disaster
-recovery from RAIT tape-sets.
-
-Note
-
-Refer to http://www.amanda.org/docs/rait.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                  Up                             Next
-Chapter 9. chg-scsi  Home  Chapter 11. Printing of Labels
-
diff --git a/docs/references.txt b/docs/references.txt
deleted file mode 100644 (file)
index cfe07af..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Part VII. References
-Prev            Next
-
--------------------------------------------------------------------------------
-
-
-References
-
-Table of Contents
-
-
-  34._Web_Ressources
-
-  35._The_AMANDA_Manual_Pages.
-
--------------------------------------------------------------------------------
-
-Prev                                        Up                         Next
-Chapter 33. Usage of floppy tape drives on Home  Chapter 34. Web Ressources
-Linux 
-
diff --git a/docs/restore.txt b/docs/restore.txt
deleted file mode 100644 (file)
index fc9a8d1..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-
-          Chapter 6. Restore
-Prev  Part I. Installation  Next
-
--------------------------------------------------------------------------------
-
-Chapter 6. Restore
-
-
-Daniel Moore
-
-Original text<dmoore@jeffco.k12.co.us>
-
-Alexandre Oliva
-
-Substantial rewriting
-AMANDA Core Team
-<oliva@dcc.unicamp.br>>
-
-Murf
-
-Corrections and additions<jam@philabs.research.philips.com>
-
-Ralf Fassel
-
-Corrections and additions<ralf@atg.venture.de>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-This document describes how to restore files backed up with Amanda either with
-or without Amanda tools.
-All these cases assume you're trying to restore a complete disk, that is,
-you've replaced the lost disk with a new one, or created a new filesystem on
-it. Tweaking with the arguments to restore (not amrestore), you will be able to
-restore individual files.
-Also, this text does not cover amrecover, a program that provides a text user
-interface similar to interactive restore (restore -i), but it allows you to
-select individual files to recover and automatically determines the tapes where
-they were stored. The backups must be performed with the `index' option enabled
-for this to work.
-I considered the following cases.
-The server machine (machine Aaron) runs solaris, the client machine (machine
-Barney) runs sunos.
-
-  1. Client machine fails, non-system critical.
-     Example: /home fails on Barney.
-     First, use amadmin to find the tapes most recently used to backup the
-     partition.
-
-       amadmin <config> info Barney '/home$'
-
-       Current info for Barney /home:
-         Stats: dump rates (kps), Full:   41.1,  33.1,  38.8
-                           Incremental:    9.5,   2.1,  24.7
-                 compressed size, Full:  63.1%, 54.0%, 52.9%
-                           Incremental:  43.7%, 15.5%, 47.8%
-         Dumps: lev datestmp  tape             file   origK   compK secs
-                 0  19971223  Barney01           16  329947  208032 5060
-                 1  19980108  Barney16            8    1977     864   91
-                 2  19971222  Barney06            7    1874     672   83
-                 3  19970926  Barney03           11   12273    3040  211
-
-     This tells us that we will need two tapes to do a full restore (Barney01,
-     Barney16). Note that, even if Barney06 and Barney03 are listed, they are
-     actually older than the full backup, so they should not be used to restore
-     any data.
-     Log into Barney. Cd to the /home directory. Insert the tape with the level
-     0 dump on it into the tape drive of Aaron.
-     Become super-user in the client host and run (replace <amanda> with the
-     username under which amanda runs):
-
-       rsh -n -l <amanda> Aaron amrestore -p /dev/rmt/0cn Barney '/home\$' |
-       restore -ivbf 2 -
-
-     This requires client root to have login access to <amanda>@Aaron, with a
-     .rhosts entry (.amandahosts won't do). If you use ssh, you may be able to
-     type a password in order to be authenticated. Another alternative is to
-     start the operation in the server, and rsh to the client. You should be
-     the amanda user or root in the tape server and run:
-
-       amrestore -p /dev/rmt/0cn Barney '/home$' |
-       rsh Barney -l root /usr/etc/restore -ivbf 2 -
-
-     If you don't want to use rsh at all, you may run:
-
-       amrestore /dev/rmt/0cn Barney '/home$'
-
-     This should create a file whose name contains the hostname, directory
-     name, dump level and dump date of the backup. Now you have to move this
-     file to the client somehow: you may use NFS, rcp, ftp, floppy disks :-),
-     whatever. Suppose you rename that file to `home.0'. Then, on the client,
-     you should become root and run:
-
-       restore -ivbf 2 home.0
-
-     Repeat one of these steps, incrementing the level of the dump, until there
-     are no more available backups.
-  2. Client machine fails, system critical disk.
-     Example: / fails on Barney.
-     First of all, boot off the CD, and reinstall the system critical
-     partition, restoring it to vendor supplied state. Then, go through all of
-     Scenario 1.
-  3. Server machine fails, non-system critical, non-Amanda disk.
-     Proceed just as described in Scenario 1. However, you won't have to go
-     through the rsh process, because you can just use amrestore to replace the
-     lost data directly.
-  4. Server machine fails, system critical, non-Amanda disk.
-     Example: / on Aaron
-     First of all, boot off the CD, and reinstall the system critical
-     partition, restoring it to vendor supplied state.
-     Then, follow steps in Scenario 3.
-  5. Server machine fails, non-system critical, Amanda disk, with db.
-     Example: /opt on Aaron
-     If the disk that contains the Amanda database is toast, then you need to
-     rebuild the database. The easiest way to do it is to take the text file
-     that you had mailed to you via the 'amadmin export' command, and import
-     via the 'amadmin import' command. Then you should be able to follow the
-     steps outlined in Scenario 4.
-     Note that Amanda does not mail the exported database automatically; you
-     may add this to the crontab entry that runs amanda.
-     Maybe it's a good idea to print out the text files as well and store the
-     last 2 dumpcycles worth of paper (the disc text files might have got
-     toasted as well). From the paper you still are able to reconstruct where
-     your discs are.
-  6. Server machine fails, non-system critical, Amanda disk, with binaries.
-     Example: /usr/local on Aaron
-     This is where things get hairy. If the disk with the amanda binaries on it
-     is toast, you have three options.
-
-       i. reinstall the Amanda binaries from another tape, on which you have
-          conveniently backed up the binaries within the last couple of weeks
-          (not using Amanda).
-      ii. recompile Amanda, making sure not to overwrite your db files.
-     iii. use dd to read Amanda formatted tapes. This is the option I am going
-          to explore most fully, because this seems the most likely to occur.
-
-            a. Find out the device name used by Amanda, by looking in
-               amanda.conf. Turns out to be /dev/rmt/0cn for this system.
-               If amanda.conf isn't at hand: this must be a non-rewinding tape
-               device specifier (which I believe the trailing `n' stands for).
-            b. Look over the copy of the output of 'amadmin <config> export',
-               and find out which tapes /usr/local was backed up on.
-            c. Grab the tapes that /opt was backed up on, and stick the level 0
-               into the drive. cd to /usr/local.
-            d. Skip the first record, which is just the tape header, by using
-               the appropriate tape command.
-
-                 mt -f /dev/rmt/0cn fsf 1
-
-            e. Now you want to start looking for /usr/local on this tape.
-
-                 dd if=/dev/rmt/0cn bs=32k skip=1 | gzip -d | /usr/sbin/
-                 ufsrestore -ivf -
-
-               This command gives us an interactive restore of this record,
-               including telling us what partition, what host, and what level
-               the backup was. The gzip -d portion of the pipe can be omitted
-               if there was no compression.
-            f. If you don't find /usr/local on the first try, quit ufsrestore,
-               and move forward one record.
-
-                 mt -f /dev/rmt/0cn fsf 1
-
-               and try the dd/restore command shown above. Do this until you
-               find /opt on the disk.
-               Another possibility: quick and dirty tape index in case you
-               don't know which partition /usr/local was on: (from
-               <ralf@atg.venture.de>)
-
-                 #!/bin/sh
-                 TAPEDEV=/dev/nrtape
-                 while mt -f $TAPEDEV fsf 1 ; do
-                   dd if=$TAPEDEV bs=32k count=1 | head -1
-                   sleep 1
-                 done
-
-               Example output:
-
-                 Amanda: FILE 19971220 uri /root-sun4 lev 1 comp .gz program
-                 DUMP
-                 Amanda: FILE 19971220 uri /misc lev 1 comp .gz program DUMP
-                 Amanda: FILE 19971220 uri / lev 1 comp .gz program DUMP
-
-            g. Restore the Amanda binaries (what else do you need??), and then
-               bail out of ufsrestore. You can use amrestore, as in Scenario 3.
-
-
-
-
-Note
-
-Refer to http://www.amanda.org/docs/restore.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                     Up                                Next
-Chapter 5. Backup PC hosts using Samba  Home  Part II. About Tapes and Changers
-
diff --git a/docs/samba.txt b/docs/samba.txt
deleted file mode 100644 (file)
index 403f6f2..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-
-Chapter 5. Backup PC hosts using Samba
-Prev  Part I. Installation        Next
-
--------------------------------------------------------------------------------
-
-Chapter 5. Backup PC hosts using Samba
-
-
-Michael Zucchi
-
-Original text
-School of Computer and Information Science University of South Australia
-<M.Zucchi@CIS.UniSA.Edu.Au>
-
-John R. Jackson
-
-Updates
-AMANDA Core Team
-<jrj@purdue.edu>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Installation
-
-  Setup
-
-  Example
-
-  Bugs_and_notes
-
-
- Installation
-
-Amanda is able to back up Microsoft Windows shared disks by using Samba, a
-package that implements a SMB client and server for Unix:
-http://www.samba.org
-
-Note
-
-This is old stuff and will be (re)moved soon:
-Releases from 1.9.18p5 up to 1.9.18p10 logged information in the tar files
-produced, making them unusable! If you really must use a release prior to Samba
-2.0.6, a patch that fixes the problem is available in the Amanda patches page:
-http://www.amanda.org/patches/
-Amanda no longer supports Samba releases prior to 1.9.18. If you're using Samba
-from 1.9.18 through 1.9.18p3, make sure you don't set a low logging/debugging
-level in smb.conf. This flag may prevent estimate sizes from printing correctly
-and Amanda will report an estimate failure.
-This problem may also occur if you have large (>2GB) shares with Samba prior to
-2.0.4. In this case, apply samba2-largefs.patch from the Amanda patches page
-(http://www.amanda.org/patches/).
-After building and installing Samba, Amanda must be configured with support for
-smbclient. Amanda will automatically find smbclient if it is in your PATH when
-you run configure, or you may add the following argument:
-
-  --with-smbclient=/full/path/to/smbclient
-
-
- Setup
-
-Once Amanda and Samba are installed, the only difference between a Unix client/
-disk and PC client/share is in how the backup disks are specified in the file
-disklist. For each PC share, the entry lists the 'samba server' host (where the
-patched Samba software is installed) and the disk field is the share name. The
-remaining fields are like any other DLE.
-A user must be created on the PC with full access rights (read/write) to the
-share. Amanda, via the Samba server, will connect to the PC via this user. If
-the user does not have full access, incremental backups will not work and the
-whole share will be backed up every time (the archive bits are never reset).
-The file /etc/amandapass must be created by hand. It contains share name to
-user name, password and workgroup mapping. Each line consists of two or three
-fields, separated by whitespace:
-
-* Share name followed by optional directory.
-  You have to use forward slashes (/), not backslashes (\). This must match the
-  disklist entry exactly (case sensitive). This may be asterisk (*) to match
-  all remaining shares for this Samba server. The first match in the file is
-  used, so specific entries must be listed first. The directory is appended to
-  the share name as full MS network path. Like //thepc/c$/mydir. No blanks are
-  allowed in directory!
-* User name and password.
-  Separated by a percent sign (%). See the description of the -U option in the
-  manpage of smbclient. No whitespace is allowed in either the user name or
-  password.
-* Workgroup (optional).
-
-This file must be owned by the Amanda-user, and disallow world access
-privileges. Blank lines are ignored. A "#" on a line at the start of a field
-(including start of line) causes the rest of the line to be ignored.
-
- Example
-
-The Amanda client software and (patched) Samba is installed on host "pcserver".
-A share to be backed up called "backupc" is on PC "thepc". The share will be
-accessed via PC user "bozo" and password "f00bar" and does not require a
-workgroup.
-The entry in the file disklist is:
-
-  pcserver     //thepc/backupc         nocomp-user-gnutar
-
-  ^ samba installed unix host
-                  ^ pc host and share name
-                                       ^ dumptype must include the tar option
-
-In /etc/amandapass on the machine 'pcserver':
-
-  //thepc/backupc              bozo%f00bar
-
-If smbclient requires a workgroup specification (-W), you may add it as a third
-argument in the line in the file /etc/amandapass :
-
-  //thepc/backupc              bozo%f00bar     NTGROUP
-
-This will cause smbclient to be invoked with -W NTGROUP.
-An example dumptype in amanda.conf would be:
-
-  define dumptype nocomp-user-gnutar {
-      program "GNUTAR"
-      comment "user partitions dumped with tar and no compression"
-      options no-compress
-      priority medium
-  }
-
-Essentially, the entry in disklist is a 'pseudo-disk' which contains all the
-relevant information needed by smbclient to backup the disk, but in a way that
-is compatible to Amanda.
-amcheck does a quick check to see if smbclient exists and tries to connect to
-the PC clients. It also checks for the existence and permissions of /etc/
-amandapass.
-
- Bugs and notes
-
-Samba will not back up open files (such as PAGEFILE.SYS and registry files) nor
-Access Control List data. Furthermore, at restore time, smbclient is unable to
-overwrite read-only files. Hence, Amanda+Samba is not a perfect solution for
-backing up (restoring, actually) system disks.
-Samba does not use the Windows Backup API, so configuring the Amanda backup
-user as a member of group backup on the Windows host is useless. You will
-probably have to configure it as an Administrator, and make sure it can read
-and change permission of all files in the share.
-It seems impossible to detect when a per-user based login fails, e.g. the
-username doesn't have sufficient access. It connects but cannot see any files
-(e.g. backups do nothing). The selfcheck code isn't particularly robust in this
-area either, so you may get no warnings when a disk isn't being backed up. Just
-check to see that level 0 dumps are bigger than 64K, otherwise it means the
-backup was empty.
-The estimate and totals are probably a bit off since tar pads to the nearest
-512 bytes after each file (I think). Not sure how much of a problem this is.
-smbclient only supports excluding a single file from the command line, not a
-file of patterns like GNU tar. So "exclude" is supported from a dumptype but
-not "exclude list".
-
-Note
-
-Also the new option "exclude append" is not yet supported with smbclient.
-
-Note
-
-Since Samba-3.0.2a smbclient supports multiple exclusion-patterns. It is one of
-the "Ongoing Projects" to make use of this in Amanda. Refer to http://
-www.amanda.org/ongoing.php for details.
-The size estimate calculation does not use the same method as the dump, so it
-may be inaccurate. It also does not support any type of exclusion ("exclude" is
-ignored). Things are done this way because doing a simulated dump to /dev/null,
-like other dump programs, would take forever with current implementations of
-Samba.
-If you compile with support for smbclient, GNU-tar support is automatically
-enabled. If you aren't using the GNU-tar part, you may get warnings about the
-availability of /usr/local/bin/gtar (or whatever it was compiled with). These
-may safely be ignored, unless you enable index generation for those
-filesystems.
-
-Note
-
-Refer to http://www.amanda.org/docs/samba.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                              Up                 Next
-Chapter 4. Indexing with Amanda  Home  Chapter 6. Restore
-
diff --git a/docs/security-api.txt b/docs/security-api.txt
deleted file mode 100644 (file)
index e0c4a83..0000000
+++ /dev/null
@@ -1,447 +0,0 @@
-
-      Chapter 26. Amanda Security API
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 26. Amanda Security API
-
-
-Mike Grupenhoff
-
-Original text
-AMANDA Core Team
-<kashmir@munge.com>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  The_Problem
-
-  The_API
-
-
-        protocol_packet_transmission_functions
-
-        stream_functions
-
-
-  Data_Types
-
-
-        security_driver_t
-
-        security_handle_t
-
-        security_stream_t
-
-        security_status_t
-
-
-  SECURITY_DRIVERS
-
-
-        name
-
-        connect
-
-        accept
-
-        close
-
-        sendpkt
-
-        recvpkt
-
-        recvpkt_cancel
-
-        stream_server
-
-        stream_accept
-
-        stream_client
-
-        stream_close
-
-        stream_auth
-
-        stream_id
-
-        stream_write
-
-        stream_read
-
-        stream_read_cancel
-
-
-
- Introduction
-
-This is a document of the API for defining and utilizing multiple security and
-transport mechanisms for the Amanda network protocol.
-The goal of this API is to allow several different forms of communication and
-authentication to exist between the Amanda server and its clients.
-
- The Problem
-
-There exist many potential ways that a user might wish to grant access to the
-Amanda daemon. The two currently supported are BSD (reserved port) and Kerberos
-IV security. The current implementation of these two methods is not very
-general, and adding additional methods requires a large amount of code to be
-modified.
-Additionally, the current methods require the protocol and dump transport to be
-transmitted across the network using a pre-defined method. The Amanda protocol
-currently must be sent using udp datagrams to a well-known port, and the dumps
-are transported using tcp connections between ports negotiated via the
-protocol.
-
- The API
-
-The security API was designed to be a layer in between the core logic of Amanda
-and the transport and authentication of the protocol and dumps.
-The component server and client programs now deal with abstract concepts
-instead of concrete udp and tcp handles.
-The prefix "security_" is reserved for use as the namespace of this API.
-
- protocol packet transmission functions
-
-These functions exist for transmitting pkt_t's between the client and server.
-These functions operate on security_handle_t objects. These objects are
-described later.
-
- security_getdriver
-
-const security_driver_t *security_getdriver(const char *drivername);
-Given a security type ("KRB4", "BSD", "SSH", etc), returns a pointer to that
-type's security_driver_t (section 4.1), or NULL if no driver exists.
-
- security_connect
-
-void security_connect(const security_driver_t *h, const char *hostname, char *
-(*conf_fn)(char *arg, void *arg), void (*fn)(void *arg, security_handle_t *h,
-security_status_t s), void *arg);
-Given a security driver, and a hostname, calls back with a security_handle_t
-(section 4.2) that can be used to communicate with that host. The status arg to
-the callback is reflects the success of the request. Error messages can be had
-via security_geterror().
-This is expected to be the Amanda server's interface for setting up connections
-to clients.
-conf_fn is used to determine configuration information. If NULL, no
-configuration information is available.
-
- security_accept
-
-void security_accept(const security_driver_t *h, int in, int out, void
-(*callback)(security_handle_t *, pkt_t *));
-Given a security driver, an input file descriptor, and an output file
-descriptor, and a callback, when new connections are detected on the given file
-descriptors, the function is called with a newly created security handle and
-the initial packet received.
-This is expected to be the Amanda daemon's interface for setting up incoming
-connections from the Amanda server. The file descriptors are typically 0 and 1
-(stdin/stdout).
-This function uses the event interface, and only works properly when event_loop
-() is called later in the program.
-
- security_close
-
-void security_close(security_handle_t *h);
-Closes a connection created by a security_connect() or security_accept().
-
- security_sendpkt
-
-int security_sendpkt(security_handle_t *h, const pkt_t *pkt);
-Transmits a pkt_t over a security handle. Returns 0 on success, or negative on
-error. A descriptive error message can be obtained via security_geterror().
-
- security_recvpkt
-
-int security_recvpkt(security_handle_t *h, void (*callback)(void *arg, pkt_t
-*pkt, security_status_t), void *arg, int timeout);
-Requests that when incoming packets arrive for this handle, the given function
-is called with the given argument, the received packet, and the status of the
-reception.
-If a packet does not arrive within the number of seconds specified in the
-'timeout' argument, RECV_TIMEOUT is passed in the status argument of the
-timeout.
-On receive error, the callback's status argument will be set to RECV_ERROR. An
-error message can be retrieved via security_geterror().
-On successful reception, RECV_OK will be passed in the status argument, and the
-pkt argument will point to a valid packet.
-This function uses the event interface. Callbacks will only be generated when
-event_loop() is called.
-
- security_recvpkt_cancel
-
-int security_recvpkt_cancel(security_handle_t *h);
-Cancels a previous recvpkt request for this handle.
-
- security_geterror
-
-const char *security_geterror(security_handle_t *h);
-Returns a descriptive error message for the last error condition on this
-handle.
-
- security_seterror
-
-void security_seterror(security_handle_t *h, const char *msg, ...);
-Sets the string that security_geterror() returns.
-
- security_handleinit
-
-void security_handleinit(security_handle_t *, const security_driver_t *);
-Initializes a security_handle_t. This is meant to be called only by security
-drivers to initialize the common part of a newly allocated security_handle_t.
-
- stream functions
-
-These functions exist for transmitting random data over a stream-like
-connection.
-These functions operate on security_stream_t objects, which are described
-later.
-
- security_stream_server
-
-security_stream_t *security_stream_server(security_handle_t *h);
-Creates the server end of a security stream, and will receive a connection from
-the host on the other end of the security handle passed.
-Returns a security_stream_t on success, and NULL on error. Error messages can
-be obtained by calling security_geterror() on the security handle associated
-with this stream.
-
- security_stream_accept
-
-int security_stream_accept(security_stream_t *);
-Given a security stream created by security_stream_server, blocks until a
-connection is made from the remote end.
-Returns 0 on success, and -1 on error. Error messages can be obtained by
-calling security_stream_geterror().
-
- security_stream_client
-
-security_stream_t *security_stream_client(security_handle_t *h, int id);
-Creates the client end of a security stream, and connects it to the machine on
-the other end of the security handle. The 'id' argument identifies which stream
-on the other end to connect to.
-Returns a security_stream_t on success, and NULL on error. Error messages can
-be obtained by calling security_geterror() on the security handle associated
-with this stream.
-
- security_stream_close
-
-void security_stream_close(security_stream_t *s);
-Closes a security stream and frees up resources associated with it.
-
- security_stream_auth
-
-int security_stream_auth(security_stream_t *s);
-Authenticate a connected security stream.
-Returns 0 on success, and -1 on error. Error messages can be obtained by
-calling security_stream_geterror().
-
- security_stream_id
-
-int security_stream_id(security_stream_t *s);
-Returns an identifier which can be used to connect to this security stream with
-security_stream_client().
-Typical usage would be for one end of a connection to create a stream with
-security_stream_server(), and then transmit the id for that stream to the other
-side. The other side will then connect to that id with security_stream_client
-().
-
- security_stream_write
-
-int security_stream_write(security_stream_t *s, const void *buf, size_t
-bufsize);
-Writes a chunk of data to the security stream. Returns 0 on success, or
-negative on error. Error messages can be obtained by calling
-security_stream_geterror().
-
- security_stream_read
-
-void security_stream_read(security_stream_t *s, void (*callback)(void *arg,
-void *buf, int bufsize), void *arg);
-Requests that when data is ready to be read on this stream, the given function
-is called with the given arg, a buffer full of data, and the size of that
-buffer.
-On error, the bufsize will be negative. An error message can be retrieved by
-calling security_stream_geterror().
-This function uses the event interface. Callbacks will only be generated while
-in event_loop().
-
- security_stream_read_cancel
-
-void security_stream_read_cancel(security_stream_t *s);
-Cancels a previous read request.
-
- security_stream_geterror
-
-const char *security_stream_geterror(security_stream_t *h);
-Returns a descriptive error message for the last error condition on this
-stream.
-
- security_stream_seterror
-
-void security_stream_seterror(security_stream_t *h, const char *msg, ...);
-Sets the string that security_stream_geterror() returns.
-
- Data Types
-
-All visible data types are meant to be opaque to the caller. At no time should
-a caller have to access a member of any data type directly. The API should
-always be used instead.
-
- security_driver_t
-
-This is a static object containing function vectors that implement the API for
-a particular security type.
-
- security_handle_t
-
-This is an object that describes a protocol connection to a remote server.
-There is one security_handle_t per request, and there can be many to the same
-remote host.
-
- security_stream_t
-
-This is an object that describes a data connection to a remote host. It is
-always associated and derived from a security_handle_t. Arbitrary data can be
-passed over a security stream.
-
- security_status_t
-
-This is an enumerated type that is passed to the callback of security_recvpkt
-and security_connect. The possible values it can have are:
-S_OK - the pkt_t was received fine S_TIMEOUT - no pkt_t was received within the
-time specified in the timeout argument to security_recvpkt(). S_ERROR - an
-error occurred during reception. Call security_geterror() for more information.
-
- SECURITY DRIVERS
-
-Each security type is defined by a struct of function vectors. These methods
-implement the details of this security type.
-This section will document each element of security_driver_t.
-
- name
-
-const char *name;
-This is the name of the driver. This is used by security_getdriver() to
-associate a name with a driver type.
-
- connect
-
-void (*connect)(const char *hostname, void (*fn)(void *, security_handle_t *,
-security_status_t), void *);
-This is the implementation of security_connect(). It actually sets up the
-connection, and then returns a structure describing the connection. The first
-element of this structure MUST be a security_handle_t, because it will be cast
-to that after it is passed up to the caller.
-The first argument is the host to connect to. The second argument is a function
-to call when a connection is made. The third argument is passed to the
-callback.
-The callback takes three arguments. The first is the caller supplied void
-pointer. The second is a newly allocated security handle. The third is a
-security_status_t flag indicating the success or failure of the operation.
-
- accept
-
-void (*accept)(int in, int out, void (*callback)(security_handle_t *handle,
-pkt_t *pkt));
-This is the implementation of security_accept(). It is passed the input and
-output file descriptors and a callback. The callback takes a security handle
-argument and also an initial packet received for that handle.
-
- close
-
-void (*close)(void *handle);
-The implementation of security_close().
-
- sendpkt
-
-int (*sendpkt)(void *handle, pkt_t *pkt);
-The implementation of security_sendpkt(). Security information is usually added
-by the driver before transmission.
-
- recvpkt
-
-void (*recvpkt)(void *handle, void (*callback)(void *arg, pkt_t *pkt,
-security_status_t), void *arg);
-The implementation of security_recvpkt(). It will typically be layered onto the
-event interface somehow. It can assume that a caller will eventually call
-event_loop().
-
- recvpkt_cancel
-
-void (*recvpkt_cancel)(void *handle);
-The implementation of security_recvpkt_cancel(). Drivers should allow this to
-be run even if no recvpkt was scheduled, or if one was previously cancelled.
-
- stream_server
-
-void *(*stream_server)(void *handle);
-Implementation of security_stream_server(). This function returns a object
-describing the stream. The first member of this object MUST be a
-security_stream_t, because it will be cast to that.
-
- stream_accept
-
-int (*stream_accept)(void *stream);
-After calling stream_server, stream_accept must be called on the stream before
-it is fully connected.
-
- stream_client
-
-void *(*stream_client)(void *handle, int id);
-Implementation of security_stream_client(). The id argument is something
-returned by security_stream_id(). Again, the handle is referenced counted.
-This function returns a object describing the stream. The first member of this
-object MUST be a security_stream_t, because it will be cast to that.
-
- stream_close
-
-void (*stream_close)(void *stream);
-Close and free up resources for an open stream.
-
- stream_auth
-
-int (*stream_auth)(void *stream);
-Authenticate a connected stream.
-
- stream_id
-
-int (*stream_id)(void *stream);
-Return a unique id for this stream. This is to be used by stream_client() to
-connect to this stream.
-
- stream_write
-
-int (*stream_write)(void *stream, const void *buf, size_t bufsize);
-Implementation of security_stream_write.
-
- stream_read
-
-void (*stream_read)(void *stream, void (*callback)(void *arg, void *buf, int
-bufsize), void *arg);
-Implementation of security_stream_read.
-
- stream_read_cancel
-
-void (*stream_read_cancel)(void *stream);
-Implementation of security_stream_read_cancel.
-
-Note
-
-Refer to http://www.amanda.org/docs/security-api.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev                           Up                           Next
-Chapter 25. Amanda Event API  Home  Chapter 27. Virtual Tape API
-
diff --git a/docs/security.txt b/docs/security.txt
deleted file mode 100644 (file)
index a252a9d..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-
-Chapter 29. Response to CPIO Security Notice Issue 11:
-Prev  Part VI. Historical files                   Next
-
--------------------------------------------------------------------------------
-
-Chapter 29. Response to CPIO Security Notice Issue 11:
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Affected_Versions
-
-  Workaround
-
-  Acknowledgements
-
-The Amanda development team confirms the existence of the amrecover security
-hole in recent versions of Amanda. We have made a new release, Amanda 2.4.0b5,
-that fixes the amrecover problem and other potential security holes, and is the
-product of a security audit conducted in conjunction with the OpenBSD effort.
-The new version is available at:
-ftp://ftp.amanda.org/pub/amanda/amanda-2.4.0b5.tar.gz
-Here's some more information about the amrecover problem to supplement the
-information given in the CPIO Security Notice:
-
- Affected Versions
-
-The Amanda 2.3.0.x interim releases that introduced amrecover, and the 2.4.0
-beta releases by the Amanda team are vulnerable.
-Amanda 2.3.0 and earlier UMD releases are not affected by this particular bug,
-as amrecover was not part of those releases. However, earlier releases do have
-potential security problems and other bugs, so the Amanda Team recommends
-upgrading to the new release as soon as practicable.
-
- Workaround
-
-At an active site running Amanda 2.3.0.x or 2.4.0 beta, amrecover/ amindexd can
-be disabled by:
-
-* removing amandaidx and amidxtape from /etc/inetd.conf
-
-
-* restarting /etc/inetd.conf (kill -HUP should do)
-
-This will avoid this particular vulnerability while continuing to run backups.
-However, other vulnerabilities might exist, so the Amanda Team recommends
-upgrading to the new release as soon as practicable.
-
- Acknowledgements
-
-This release (2.4.0) has addressed a number of security concerns with the
-assistance of Theo de Raadt, Ejovi Nuwere and David Sacerdote of the OpenBSD
-project. Thanks guys! Any problems that remain are our own fault, of course.
-The Amanda Team would also like to thank the many other people who have
-contributed suggestions, patches, and new subsystems for Amanda. We're grateful
-for any contribution that helps us achieve and sustain critical mass for
-improving Amanda.
-
-Note
-
-Refer to http://www.amanda.org/docs/security.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                        Up                         Next
-Part VI. Historical files  Home  Chapter 30. Upgrade Issues
-
diff --git a/docs/strategy-api.txt b/docs/strategy-api.txt
deleted file mode 100644 (file)
index a7b4668..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-
-Chapter 33. Thoughts about a Strategy API
-Prev  Part VI. Historical files      Next
-
--------------------------------------------------------------------------------
-
-Chapter 33. Thoughts about a Strategy API
-
-
-Alexandre Oliva
-
-Original text
-AMANDA Core Team
-<oliva@dcc.unicamp.br>>
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-
-  Subject: STRATEGY API (was: Re: spelunking)
-  From: Alexandre Oliva <oliva@dcc.unicamp.br>
-  Date: 03 Oct 1998 02:44:47 -300
-
-  Doug Hughes <Doug.Hughes@Eng.Auburn.EDU> writes:
-
-  > I'm going to (try to) modify the amanda stuff such that there is a new
-  > parameter called dumplevel available in dumptype. That way I can fix
-  > the dump level at whatever I want (5 or 9 when I need to), without
-  > having to worry about whether it's going to try and skip a 0 and miss
-  > a dump, or try to do a 1, or whatever.
-
-  Now that you mention that, it comes to my mind that the current
-  mechanism to define backup strategies is too limited, and we could try
-  to improve it just like we are going to do with the DUMPER API.
-
-  We could define a STRATEGY API, that planner would use to:
-
-  1) define a set levels and/or dates for which estimates should be requested
-
-  2) select a subset of the estimate results that planner can choose
-
-  and driver would run to inform that a backup has succeeded, after
-  having updated the database.
-
-  I haven't fully analysed the implications of this choice, but it looks
-  quite feasible and very useful.  Opinions?  Requests of clarification?
-  Random flames? :-)
-
-  Anyone willing to pursue this issue?
-
-  --
-  Alexandre Oliva
-
-
-Note
-
-Refer to http://www.amanda.org/docs/strategy-api.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev                                          Up                         Next
-Chapter 32. Multitape support in Amanda 2.2  Home  Chapter 34. Y2K Compliancy
-
diff --git a/docs/survey.txt b/docs/survey.txt
deleted file mode 100644 (file)
index 042c956..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-
-     Chapter 20. AMANDA Survey Results
-Prev  Part IV. Various Information  Next
-
--------------------------------------------------------------------------------
-
-Chapter 20. AMANDA Survey Results
-
-
-Jon LaBadie
-
-Original text
-AMANDA Core Team
-<jon@jgcomp.com>
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/survey.html for the current version of this
-document.
-
-Note
-
-This chapter still needs much more formatting, there are many tables and lists,
-that need to get added. Volunteers welcome. sgw, April, 2005.
-
-Introduction
-
-AMANDA (Advanced Maryland Automatic Network Disk Archiver) is a backup system
-freely available available in source form. For more information about AMANDA
-visit the website http://www.amanda.org.
-Readers of the amanda-users mailing list (approximately 1100 subscribers) were
-asked in April of 2003 to describe their use of the backup system by filling
-out a survey questionnaire that was posted to the mailing list weekly. Seventy
-two (72) surveys were submitted during the month-long collection period.
-In several postings that follow, I will report summaries of the collected data.
-In some cases I've included comments (Surveyor's Notes) of my own reaction to
-the data.
-Later, I plan to recast these results in the form of questions and answers to
-add to the FOM (FAQ-O-Matic) at amanda.org. Should you have any thoughts on
-this please let me know via the list or personal email.
-Jon LaBadie
-<jon@jgcomp.com>
-
-Note
-
-[Surveyor's Note] While the number of submitted surveys neither surprised me,
-nor disappointed me, what did greatly disappoint me personally was this fact:
-Of the twenty five (25) individuals most active on the list (based on number of
-postings for 12 months), only seven (7) bothered to respond to the survey.
-
-Organizations
-
-What follows is a summarization of the responses describing the organizations
-using AMANDA.
- _____________________________________________________________________________
-|Types_of_organizations_using_AMANDA|___|_____________________________________|
-|Category___________________________|Num|Type_________________________________|
-|University_Department______________|20_|_____________________________________|
-|Research_Organizations_____________|10_|medical,_scientific,_engineering,____|
-|___________________________________|___|oceanography,_statistical,_behavioral|
-|Internet_Service_Providers_________|5__|_____________________________________|
-|Data Processing Services           |11 |software, graphics, integration,     |
-|___________________________________|___|consulting___________________________|
-|Manufacturers (DP)                 |5  |computers, electronics,              |
-|___________________________________|___|semiconductors_______________________|
-|Manufacturers_(non-DP)_____________|4__|rubber,_chemical,_turbine,_video_____|
-|Government_Related_________________|3__|federal,_local,_public_defender______|
-|Service Organizations              |4  |publishing, power utility, forestry, |
-|___________________________________|___|money_management_____________________|
-|Small_Office/Home_Office___________|6__|_____________________________________|
-|Others                             |3  |natural history museum, education    |
-|___________________________________|___|charity,_national_opera_and_ballet.__|
-
-
-Note
-
-[Surveyor's Note] The `Categories' were my grouping, they were not on the
-survey. I expected more in the SOHO category.
-
-Note
-
-[Surveyor's Note] Extent of AMANDA usage was asked on the survey. Few indicated
-that their entire firm based their backups on AMANDA, and then only relatively
-small companies (like JG Computing :). Thus the category is `University
-Department' not `University'. Similarly, AMANDA is used by a groups within
-organizations like the chemical manufacturer or computer manufacturer or
-federal government noted above, not the entire entity. But AMANDA may have
-helped produce the tires you are riding on, the workstation you are typing on,
-or to collect the taxes you pay :))
- _________________________________________________
-|Location_of_organizations_using_AMANDA___________|
-|1_Belgium|1_Japan_______________|2_Poland________|
-|1_Canada_|1_Mexico______________|2_Switzerland___|
-|1_Estonia|1_Norway______________|3_Sweden________|
-|1_Finland|1_Portugal____________|5_Germany_______|
-|1_France_|1_United_Arab_Emirates|5_United_Kingdom|
-|1_Italy__|2_The_Netherlands_____|45_United_States|
-
-
-Note
-
-[Surveyor's Note] The totals are greater than number of submitted surveys as
-some respondents described multi-national installations.
-
-Note
-
-[Surveyor's Note] Americans must be procrastinators. For a while, the number of
-non-US submitted surveys exceeded the ones from the US.
- _________________________________________
-|Length_of_AMANDA_usage_at_organization|__|
-|0_-_1_years___________________________|25|
-|1_-_2_years___________________________|8_|
-|2_-_3_years___________________________|13|
-|3_-_4_years___________________________|10|
-|4_-_5_years___________________________|8_|
-|5_-_6_years___________________________|2_|
-|7_-_8_years___________________________|2_|
-|8_-_9_years___________________________|2_|
-|9+_years______________________________|1_|
-|10%_of_responders_>_5_years_use_______|__|
-|33%_of_responders_>_3_years_use_______|__|
-|50%_of_responders_>_2_years_use_______|__|
-|33%_of_responders_<_1_year_use________|__|
-
-Mean and Median are ~29 months (2.5 years)
-
-Note
-
-[Surveyor's Note] Some really long time users of AMANDA. It must do the job.
-
-Servers and Clients
-
-
-AMANDA servers
-
- _________
-|Number|__|
-|1_____|53|
-|2_____|11|
-|3_____|5_|
-|5_____|1_|
-|6_____|1_|
-|7_____|1_|
-
-Table 20.1. Operating Systems Running on AMANDA Server Hosts
- _____________________________________
-|FreeBSD:_______|Total_10,_including__|
-|2______________|4-STABLE_____________|
-|1______________|4.7__________________|
-|1______________|4x___________________|
-|HP-UX:_________|Total_2,_including___|
-|1______________|10.20________________|
-|1______________|11.00________________|
-|Irix:__________|Total_2,_including___|
-|1______________|6.5__________________|
-|SCO_Openserver:|Total_1,_including___|
-|1______________|5.0.6________________|
-|Solaris:_______|Total_14,_including__|
-|5______________|8____________________|
-|1______________|8_x86________________|
-|3______________|9____________________|
-|Tru64:_________|Total_4,_including___|
-|2______________|5.1__________________|
-|Linux:_________|Total_48,_including__|
-|13_____________|Debian_Total_________|
-|1______________|2.4__________________|
-|2______________|3.0__________________|
-|3______________|Woody________________|
-|14_____________|RedHat_Total_________|
-|1______________|6.2__________________|
-|2______________|7.1__________________|
-|1______________|7.2__________________|
-|6______________|7.3__________________|
-|3______________|8.0__________________|
-|1______________|8.0_with_RHNet_kernel|
-|1______________|Slackware_Total______|
-|1______________|7____________________|
-|3______________|SuSE_Total___________|
-|2______________|8.1__________________|
-
-
-AMANDA Versions Run on Server Hosts
-
-2.4.1: Total 2, including
-1 2.4.1p1
-2.4.2: Total 33, including
-1 2.4.2p1
-28 2.4.2p2
-2.4.3: Total 21, including
-1 2.4.3b2
-1 2.4.3b3
-2 2.4.3b4
-2.4.4: Total 21, including
-2 2.4.4-20030415
-1 2.4.4-20030426
-[Surveyor's Note] The percentage of older versions surprised me.
-Shouldn't have as I just upgraded 2 months ago. If it works why fix it?
-
-AMANDA CLIENTS
-
-
-Number of AMANDA Clients
-
-client num.
-hosts sites
-14
-25
-36
-46
-57
-a6-1012
-b11-2013
-21-3012
-31-505
-61-704
-
-Operating Systems Run on AMANDA Clients
-
-(mentions, not number of hosts)
-AIX, total 4, including Linux (all variants), 86 total including
-1 4 Debian, 17 total
-1 2.2
-Darwin, total 1 1 2.4
-2 3.0
-FreeBSD total 17, including 1 potato
-1 2.2.5 2 sarge
-1 3.2 1 sid
-1 3.3 1 stable
-1 3.4 2 woody
-2 4-STABLE Mandrake, 1 total
-1 4.1 1 8
-1 4.7 RedHat, 26 total
-1 5.0 1 5.0
-1 6.0
-HP-UX, 8 total, including 2 6.2
-1 10 1 6.2 Alpha
-2 10.20 2 6.2 Sparc
-3 11 3 7.1
-2 7.2
-Irix, 8 total, including 4 7.3
-3 6.5 5 8.0
-1 6.5 MIPS 1 9
-Slackware, 3 total
-MacOS X, 6 total, including 2 7.0
-1 10.1 PowerPC 1 8.1
-1 10.2 PowerPC SuSe, 4 total
-2 8.1
-NetBSD, 1 total, including Yellowdog, 1 total
-1 1.6 1 2.3 PowerPC
-OpenBSD, 1 total, including Tru64, 8 total, including
-1 3.2 1 4.0 Alpha
-1 5.1
-Snap, 1 total
-Windows, 22 total, including
-Solaris, 39 total, including 1 95
-2 2.5 2 98
-2 2.6 4 NT
-5 7 1 NT 4 server
-11 8 7 2000
-4 9 3 XP
-3 8 x86
-1 9 x86
-SunOS, 1 total, including
-1 SunOS 4.1.4
-
-AMANDA Versions of Run on Client Hosts
-
-2.4.1, 4 total, including
-3 2.4.1p1
-2.4.2, 42 total, including
-1 2.4.2p1
-33 2.4.2p2
-2.4.3, 30 total, including
-1 2.4.3b2
-1 2.4.3b3
-1 2.4.3b4
-2.4.4, 25 total, including
-2 2.4.4-20030415
-1 2.4.4-20030426
-1 2.4.4b1
-
-Installation Properties
-
-
-Total Disk Capacity of Clients
-
-smallest: 20 GB
-largest: 5000 GB
-13 20 to 100 GB
-22 101 to 200 GB
-16 201 to 500 GB
-12 501 to 1000 GB
-5 1001 to 2000 GB
-6 2001 to 5000 GB
-
-Total Data Currently Stored on Clients Disks
-
-smallest: 3 GB
-largest: 4000 GB
-22 3 to 50 GB
-14 51 to 100 GB
-15 101 to 200 GB
-10 201 to 500 GB
-7 501 to 1000 GB
-5 1001 to 4000 GB
-
-Average Size of a Single Backup
-
-smallest: 0.3 GB
-largest: 700 GB
-22 0.3 to 10 GB
-11 11 to 20 GB
-22 21 to 50 GB
-13 51 to 100 GB
-8 101 to 200 GB
-1 350 GB
-1 700 GB
-
-Backup Program Used
-
-72 use gnutar or some tar variant including:
-3 hfstar
-1 nttar
-1 smbtar
-50 use dump or some dump variant including:
-1 e2fsdump
-2 ext2dump
-12 ufsdump
-2 vdump
-1 vfsdump
-2 vxdump
-5 xfsdump
-
-Dumpcycle
-
-5 0 days
-3 1 days
-1 2 days
-6 3 days
-5 5 days
-34 7 days
-17 8 days - 2 weeks
-10 15 days - 4 weeks
-5 30 days - 75 days
-1 4 months
-1 6 months
-1 1 year
-1 1000 days
-
-Frequency of Backups
-
-6 1/week
-4 2/week
-4 3/week
-5 4/week
-36 5/week
-6 6/week
-31 7/week
-2 1/month
-
-Type of Compression Used
-
-1 gpg
-15 none
-17 hw
-31 sw - server
-46 sw - client
-
-Installed Hardware
-
-
-Brand and Model of Tape Drive Used at AMANDA Installations
-
-The number of mentions of each brand is shown
-followed by specific models where reported.
-3 Archive, including: 2 Qualstar TLS-4200
-Python 04106
-Python 06408 10 Quantum, including:
-DLT-VS80
-5 Compaq, including: DLT-4000
-AIT-2 DLT-7000
-DLT-90 DLT-8000
-MSL5126-S2
-SDLT320 10 Seagate, including:
-DAT
-1 Dell DLT-IV 12/24G
-20/40G
-5 Ecrix, including: CTL-96/4586N
-VXA-1 DDS4
-DDS3 Scorpion-24/STD124000N
-5 Exabyte, including: 13 Sony, including:
-8500 AIT-1
-Eliant 820 AIT-2
-VXA-2 AIT-3
-DLT-IV
-15 HP, including: DLT-9000
-A4845A SDX-500C
-C1533A Sony SDX-700C
-C1557
-C6280-7000 3 Sun, including:
-DDS-4 DDS3
-DLT vs80 7000
-ESL9595 Python
-SureStor DAT-24
-SureStor DAT-8 7 Tandberg, including:
-Surestore Ultrium 230e DLT vs80
-Ultrium 1 SDLT 220
-SDLT-320
-1 IBM DDS4 SLR5
-SLR7
-1 Mammoth
-2 Wang, including:
-3 None, backup to disk only DAT 3400DX
-2 Overland Data, including:
-Loaderexpress DLT8000
-
-Native Tape Capacity of the Above Drives
-
-7 4 GB 8 35 GB
-1 7 GB 13 40 GB
-2 10 GB 8 50 GB
-11 12 GB 1 60 GB
-1 15 GB 1 80 GB
-1 17 GB 7 100 GB
-10 20 GB 1 110 GB
-1 22 GB 3 160 GB
-4 25 GB 1 500 GB
-2 30 GB
-
-Preferred Brand of Tape
-
-2 Compaq
-1 Dell
-4 Exabyte
-3 Fujifilm
-5 HP
-1 Imation
-2 Maxell
-2 Quantum
-11 Sony
-1 Verbatim
-16 No Preference
-
-Tape Format
-
-1 4mm 1 EXA
-4 8mm 3 LTO
-2 AIT 1 Mammoth
-1 AIT-1 4 sDLT
-7 AIT-2 1 sDLT320
-3 AIT-3 1 SLR
-8 DDS-2 1 SLR25
-12 DDS-3 1 SLR7
-6 DDS-4 1 Travan-20
-15 DLT 1 VXA
-1 DLT-80 1 VXA V-23
-7 DLT-IV 1 VXA-2
-
-Tape Changers/Libraries Used at AMANDA Installations
-
-[Surveyor's Note] A total of 28 of 72 respondents reported having using
-tape changer or library. Several of those reported having more than one.
-Surprisingly, the 28 respondents reported 26 distinct models of changer/
-library.
-The table below shows the models reported by 28 respondents. Where multiple
-reports for the same model existed, only one entry is show. Where the
-multiple reports showed different configurations (eg. 1 drive vs 2 drive),
-only the larger configuration is shown.
-BRAND MODEL # of # of total
-drives tapes capacity
-ADIC ?? 1 4 200 GB
-ADIC FastStor DLT 1 7 245 GB
-Compaq MSL5126 1 25 4000 GB
-Compaq SSL2020 2 20 1000 GB
-Dell Powervault 122T 1 8 320 GB
-Hewlett-Packard A4845A 5 588 20000 GB
-Hewlett-Packard C1557A 1 6 72 GB
-Hewlett-Packard ESL9595 2 595 70000 GB
-Hewlett-Packard MSL5026S2 2 26 4160 GB
-Hewlett-Packard SureStore 6x40 1 6 120 GB
-Hewlett-Packard SureStore 6x24 1 6 72 GB
-Overland Data LXB 4120 1 10 150 GB
-Overland Data Library Pro 1 19 1900 GB
-Overland Data LoaderXpress 1 15 525 GB
-Qualstar 6220 2 20 700 GB
-Qualstar TLS-4200 2 20 2000 GB
-Quantum DLT7000 2560 1 8 320 GB
-Segate CTL-96/4586N 1 4 14 GB
-Sony TSL-9000 1 8 96 GB
-SpectraLogic Bullfrog 10000 3 40 10000 GB
-SpectraLogic Treefrog 2000 1 15 750 GB
-StorageTek Timberwolf 9730 2 30 1000 GB
-Straightline Harrier/830 2 30 1500 GB
-Sun L20 2 20 2000 GB
-Sun L40 2 40 1600 GB
-Sun Storedge L9 1 9 360 GB
-
-Special Feature Usage
-
-What follows is a summarization of the responses describing the
-use of two special features of recent versions of AMANDA, the
-"file:driver" to use a hard disk drive as a backup device and
-RAIT (Redundant Array of 'Inexpensive' Tapedrives) to allow
-mirroring or striping of backups across multiple drives.
-
-The file:driver
-
-Do you use the <file:driver>?
-53 no
-11 yes
-5 what is the <file:driver>
-If not, do you expect to?
-32 no
-14 yes
-8 maybe
-
-RAIT
-
-Do you use RAIT?
-68 no
-0 yes
-If not, do you expect to?
-40 no
-8 yes
-3 maybe
-[Surveyor's Note] I was mildly surprised, and amused, by the 5 "what is the
-<file:driver> responses. And considering those responses, but the lack of
-similar responses to the RAIT question.
-[Surveyor's Note] No respondent uses RAIT! Disappointing. I wonder if any
-site is currently using this feature.
-
-Non UNIX Clients
-
-What follows is a summarization of the responses describing the
-various methods to backup 'non-unix' clients, mostly PC's running
-versions of Windows.
-
-PC's Backed Up Using SAMBA Connections to AMANDA Clients
-
-A total of 22 survey respondents (of 72) report
-they use amanda and samba to backup PC clients.
-10 have 1 PC client
-10 have 2 - 5 PC clients
-1 has 15 PC clients
-1 has 40 PC clients
-[Surveyor's Note] From these results it seems to me that amanda/samba
-is seldom a first choice for backing up PC's. Instead it seems to be
-used when a site has an existing amanda installation and would like
-to implement some form of PC backup.
-The respondents mentioned the following Operating Systems
-were being run on the PC clients. The number is the number
-of mentions, not number of PC's.
-1 Windows 95 2 Windows 2000 Server
-1 Windows 98 5 Windows XP
-3 Windows NT 1 Windows XP Pro
-2 Windows NT 4 1 Snap Server
-9 Windows 2000
-[Surveyor's Note] Of interest to users running Lotus Domino:
-One respondent reported using "The Open File Manager"
-from http://www.stbernard.com to create online backups of
-their Lotus Domino database files which then could be
-backed up to their amanda host using samba.
-
-PC's Backed Up Using Cygwin/AMANDA Client Software
-
-A total of 4 survey respondents (of 72) report
-they use a cygwin/amanda client to backup PC clients.
-2 have 1 PC client
-1 has 3 PC clients
-1 has 15 PC clients
-The only PC operating systems mentioned were
-Windows 2000 and Windows 2000 Server.
-
-PC's Backed Up by AMANDA Using Other Techniques
-
-A variety of techniques, other than samba or cygwin,
-were described by respondents to backup PC's
-1. Two respondents installed an NFS server on Windows 2000
-and then NFS mounted the PC disks on the amanda host
-and backed them up as local file systems.
-2. Similarly, two respondents mounted PC shares of Windows 95,
-Windows NT, and Windows 2000 on the amanda host using 'smbmount'
-and backed them up as local 'smbfs' file systems.
-3. Several respondents reported they first backed up their PC's
-(Windows 98, Windows 2000, Windows XP, Windows 2000 Server)
-to disk files on the PC's and then backed that file up using
-amanda; presumably using samba or some file transfer technique.
-One mentioned that the backup stream was sent directly to a
-Linux host and backed up there as a local file.
-The backup programs the respondents mentioned included:
-'Windows backup program'
-'BackupPC', a Linux opensource program
-'Win2000 Backup Tool'
-'Backup Exec'
-4. One respondent noted their firewall was a PC running linux.
-That system was mirrored using rsync and the mirror was backed up.
-
-Other Backup Techniques Mentioned
-
-Five respondents described backing up systems using "non-traditional"
-methods. These methods were used to backup systems running either
-MacOS or Windows. They included:
-1. MacOS 9, mounted (NFS?) onto a Linux host and backing up the mounts as
-local filesystems.
-2. Backing up 37 MacOS 8 and MacOS 9 systems using the program Retrospect.
-The output of Retrospect was transferred to a Linux host using ftp and
-preserved with amanda.
-3. Build a native amanda client on MacOS X and use hfstar instead of gnutar.
-4. Backup 6 Windows XP hosts using a native windows amanda client.
-5. Backup 12 Windows 2000 Server hosts using a native windows amanda client.
-This respondent also noted their intention to switch to a cygwin/amanda
-client in the near future.
--------------------------------------------------------------------------------
-
-Prev                          Up                           Next
-Chapter 19. AMANDA WISHLIST  Home  Part V. Technical Background
-
diff --git a/docs/systemnotes.txt b/docs/systemnotes.txt
deleted file mode 100644 (file)
index c70aa5c..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-
-Chapter 1. Amanda 2.5.0 - System-Specific Installation Notes
-Prev  Part I. Installation                              Next
-
--------------------------------------------------------------------------------
-
-Chapter 1. Amanda 2.5.0 - System-Specific Installation Notes
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Solaris_2.6
-
-  Solaris
-
-  Trusted_Solaris
-
-  SunOS_4.x
-
-  Ultrix
-
-  HP/UX
-
-  Linux
-
-  Digital_Unix_4
-
-  Sinix_5.43_(Reliant_Unix)
-
-  IRIX_(all)
-
-  IRIX_6
-
-  IRIX_6.5.x
-
-  SCO
-
-  FreeBSD_3.0
-
-  FreeBSD_4.9
-
-  FreeBSD_5.1
-
-  AIX
-
-  Microsoft_Windows
-
-  Mac_OS_X
-
-Please read the notes that correspond to the architectures you are installing
-for. If you find additional gotchas, or anything incorrect in these notes,
-please send your updates to mailto://amanda-hackers@amanda.org after checking
-that they are not known/fixed problems in the Amanda patches page: http://
-www.amanda.org/patches/.
-
- Solaris 2.6
-
-You may have compilation errors on statfs.c if you're running, on a Solaris 2.6
-host, a gcc that was not build on a Solaris 2.6 host. This happens because gcc
-stores fixed copies of some Solaris header files on an internal directory. You
-must rebuild gcc if you get this kind of trouble. Note, however, that gcc
-2.7.2.3 does not support Solaris 2.6, you should upgrade to 2.8.0 or higher, or
-egcs.
-
- Solaris
-
-You may get errors running make: Assure that you use the BSD-version of make,
-usually /usr/ccs/bin/make. Add /usr/ccs/bin to the path before running
-configure.
-
- Trusted Solaris
-
-According to Julian Stevens <julian.stevens@baedsl.co.uk>, the format of inetd
-on Trusted Solaris 1.2 is a bit different. Just before the user name, you
-should insert the word `untrusted':
-
-  amanda dgram udp wait untrusted amuser /usr/local/libexec/amandad amandad
-
-The patch-system script is *NOT* aware of this detail; you must fix it
-yourself.
-
- SunOS 4.x
-
-A bug in GNU-tar 1.12 causes it to miscalculate (in fact, to misreport) the
-size of filesystems. A patch for GNU-tar is available in the patches directory.
-
- Ultrix
-
-The Ultrix dump program contains an explicit check that it is being run by
-root. This defeats the usual practice of a non-root "operator" userid for
-dumps. For this reason, the rundump program (a setuid-root wrapper for dump) is
-enabled by default. If you find rundump is not necessary for you, just run
-
-  configure --without-rundump
-
-The Ultrix restore program will fail if it is not connected to a tty. Since the
-restore program is invoked in the clients in order to create index files, and
-it the client is not connected to a tty, index creation will fail. Using GNU-
-tar instead of DUMP is an option. Thanks to Edwin Wiles
-<ewiles@mclean.sterling.com> for the investigation. Another alternative
-proposed by Martyn Johnson <Martyn.Johnson@cl.cam.ac.uk> is to use a modified
-restore program: use a binary program editor and replace `/dev/tty' with `/dev/
-nul', for instance, and link /dev/nul to /dev/null. Note that the chosen file
-name must be exactly 8 bytes long, otherwise you'll break the restore program.
-A nice one-liner perl script by Martyn Johnson will do the trick (make sure you
-preserve a copy of the original restore program, it will be rewritten by
-running this script!):
-
-  perl -pi -e 'BEGIN { $/ = "/dev/tty" } s-$/-/dev/nul-' restore
-
-The Ultrix C compiler seems to be too broken to compile Amanda. You are likely
-to need gcc or egcs.
-
- HP/UX
-
-You may run into an internal /bin/sh limit when running the configure script.
-The error message is:
-
-  ./configure: sh internal 2K buffer overflow
-
-Using /bin/posix/sh usually works around the problem. Another solution is to
-install GNU bash and use it instead of /bin/sh.
-If `configure' complains about not finding `lex', you'll have to get `flex'
-installed. Look for its URL in Amanda_Installation_Notes.
-If you use logical volumes, you may refer to mountpoints or full device
-pathnames instead of device names in the disk list file.
-According to Stan Brown <stanb@awod.com>, amverify won't work with HP/UX's
-stock mt. The work-around is to install GNU cpio, that contains an
-implementation of mt, and edit amverify so that MT points to GNU mt and MTOPT
-is `-f', or reconfigure and rebuild amanda from scratch, making sure it finds
-GNU mt before the stock mt in the PATH.
-If you have vxfs filesystems to back up, Amanda will pick vxdump automatically.
-GNU-tar 1.12 will incorrectly report the size of backups. There's a patch in
-the patches directory that fixes this problem.
-The use of `amhpfixdevs' is deprecated, since you can list mount-points or full
-device names in the disklist. The script may be removed in future releases of
-Amanda.
-Sometimes you may get the error message `Link severed' from an HP/UX client.
-This is just a cute name the developers of HP/UX found for `Network error'.
-Reported by Michael Brehl <mbr@condor.de>
-
- Linux
-
-Linux hosts intended to back up efs partitions with dump should install the
-dump package, as it is not installed by default on most Linux distributions. It
-is possible to find compiled versions of dump on most Linux sites and CD-ROMs.
-Note, however, that DUMP for Linux has been quite unreliable, sometimes being
-unable to perform backups, producing weird error messages such as `master/slave
-protocol botched', and sometimes creating unrestorable dump images, especially
-of active filesystems. The first problem can sometimes be fixed by cleaning up
-outdated entries in /etc/dumpdates, but your best bet is probably GNU-tar.
-Make sure the user that runs configure has permission to run the dump program,
-otherwise configure may misdetect an ability of dump to accept a -E (for
-estimates) switch.
-GNU-tar 1.11.8, distributed with some Linux versions, will cause index failures
-(Index returned -1). Upgrading to GNU-tar 1.12 fixes this problem. This is not
-a Linux-specific problem, but it is quite common in this platform.
-Amanda now supports the ftape driver version 3.04d. It adjusts the blocksize
-automatically to 32k and supports QIC volume tables. More details can be found
-in the file ZFTAPE in this directory.
-Some releases of dump for Linux, such as the one distributed with Debian 2.0,
-have modified dump so that it stores dumpdates in /var/lib. If this is your
-case, you should create a link to it in /etc. Suggested by David Wolfskill
-<dhw@whistle.com>
-
- Digital Unix 4
-
-According to Michael Galloway <mgx@spruce.lsd.ornl.gov>, the stock DUX4 dump is
-broken. There is a patch available at ftp://ftp.service.digital.com/public/
-dunix/v4.0b/duv40bas00005-19970926.README
-When both dump and vdump are available, Amanda will use vdump for backing up
-advfs filesystems only, and dump will be used for the rest. If you'd rather
-back up all filesystems with vdump, #undef DUMP in config/config.h after
-running configure.
-Unfortunately, the output of `dump -E' incorrectly matches a line of output
-from SAMBA, which gets Amanda's estimate process confused. client-src/
-sendsize.c will refuse to compile if both HAVE_DUMP_ESTIMATE and SAMBA_CLIENT
-are defined in config/config.h. Amanda will work correctly if you undefine
-HAVE_DUMP_ESTIMATE in config/config.h; if you prefer to have incorrect
-estimates for SAMBA backups, follow the instructions in client-src/sendsize.c
-on removing the compile-time error.
-According to Oren Laadan <orenl@cs.huji.ac.il>, DEC compiler version "DEC C
-V5.2-033 on Digital UNIX V4.0 (Rev. 564)" (obtained with "cc -V") does not
-build Amanda properly, in particular, taper.c. Using gcc is OK.
-
- Sinix 5.43 (Reliant Unix)
-
-The use of `amsinixfixdevs' is deprecated, since you can list mount-points or
-full device names in the disklist. The script may be removed in future releases
-of Amanda.
-Sinix port originally by Michael Schmitz <mschmitz@iname.com>.
-
- IRIX (all)
-
-When setting the tape device name in either amanda.conf or one of the changer
-configuration files, make sure you specify the "variable" device name, which
-has a 'v' on the end. If not, IRIX will write 4KByte blocks instead of the
-32KByte blocks Amanda tells it to. This apparantly works OK unless you take the
-tape to a non-IRIX system, where amrestore will complain about a short (4096)
-read.
-If you do end up in this situation, the dd command to use to pipe into your
-system restore program is:
-
-  dd if=/dev/whatever bs=4k skip=8 | ...
-
-Jean-Francois Malouin <Jean-Francois.Malouin@bic.mni.mcgill.ca> reports that,
-if you are going to use an IRIX host as the tape server, you *must* patch your
-system with *all* kernel and scsi rollup patches, otherwise you may end up with
-useless tapes, due to tape rewinding after short periods of inactivity. See
-http://www-viz.tamu.edu/~sgi-faq/ for more details.
-Some unpatched version of xfsdump are reported as not printing estimates. This
-causes estimates to take much longer than they had to, because backups are
-always performed twice. According to Mike Acar <mike@kentinfoworks.com>, patch
-2333 for IRIX 5.3 and 6.1 will fix this problem.
-
- IRIX 6
-
-Seems like SGI make program is a bit broken, in a way that causes it to rebuild
-some files if doesn't have to if you happen to run make again. Using GNU make
-fixes this problem.
-If you have xfs filesystems to back up, Amanda will pick xfsdump automatically.
-
- IRIX 6.5.x
-
-Luc Lalonde <Luc.Lalonde@polymtl.ca> contributed the following notes:
-If you use a jukebox, you must set the ownership of the robot-changer device to
-the Amanda operator:group in /etc/ioperms. Here's my configuration:
-
-  /etc/ioperms: /dev/scsi/sc8d6l0 0600 amanda backup
-
-Otherwise the ownership:group is changed to "root:sys" after each reboot. When
-you do upgrades, check the file /var/sysgen/master.d/scsi to see if it has
-changed. Otherwise your jukebox could be rendered unuseable. In particular,
-check if it has been replaced by a new version and renamed to "./scsi.O/.".
-If you use the Amanda package provided by freeware.sgi.com, you are not
-affected by the first question since at compile time the Amanda operator is
-"root:sys".
-
- SCO
-
-Jens Krause <jens@transcom.de> has reported some problems with GNU-tar 1.12 on
-SCO Release 5. Although the `sparse' files patch was applied, GNU-tar would
-consistently crash. GNUtar had to be built linked with malloc-libraries, and
-the `--sparse' switches had to be removed from client-src/sendbackup-gnutar.c
-and client-src/sendsize.c.
-
- FreeBSD 3.0
-
-chg-scsi was not updated to support the new camlib.h-dependent chio.h, so chg-
-scsi will be automatically disabled if camlib.h is found. You may use chg-chio
-instead.
-
- FreeBSD 4.9
-
-Sep. 28th, 2004: Jason Miller <jwm@interlinc.net> reported problems with
-setting up the Amanda-client on FreeBSD 4.9. He wrote:
-Due to the need for read permissions for Amanda-client the default user and
-group for this on FreeBSD 4.9 is "operator:operator" which I found a write up
-on that as well. Just a note the port wanted to install it with these user
-permissions by default and I initially changed them to match my Redhat 9.0
-install. So just doing a
-make distclean uninstall install Amanda_SERVER=servername
-fixed that for me. Then I just followed the below instructions and everything
-was good to go.
-Refer to this link for more details: http://www.freebsd.org/cgi/query-
-pr.cgi?pr=59302.
-
- FreeBSD 5.1
-
-Nicolas Ecarnot <nicolas.ecarnot@accim.com> discovered that for FreeBSD 5.1
-(maybe earlier, and surely further), you have to set the net.inet.udp.maxdgram
-TCP/IP variable to 65535. The default is 9216, and this is a problem when
-trying to backup a large number of clients as indicated by errors in during
-amcheck or the estimate phase.
-You can just run the command:
-sysctl net.inet.udp.maxdgram=63535
-but this won't last until the next reboot.
-To make it permanent, just add this line:
-
-  net.inet.udp.maxdgram=65535
-
-in the file /etc/sysctl.conf.
-
- AIX
-
-sendsize is reported to coredump on AIX 4.3.3, this is a linking problem, try
-configuring Amanda with the option "--disable-shared".
-
- Microsoft Windows
-
-Although Amanda won't run standalone on MS-Windows hosts, it is possible to use
-it to back up their disks, by using SAMBA. Please read Backup_PC_hosts_using
-Samba for more information.
-SAMBA may be unable to back up some files due to file locking restrictions.
-Particularly, paging and registry files usually present problems. Backing up
-page files is pointless, but registry files are quite important to back up. It
-is possible to create regular files that contain registry information by using
-the Regback utility, from the Windows NT Resource Kit. Unfortunately, it is not
-part of the Windows NT standard distribution, you have to purchase it
-separately. Thanks to Ernie Oporto <ernie_oporto@mentorg.com> for the tip.
-
- Mac OS X
-
-For notes on how to setup Amanda under Apple's OS X, please refer to http://
-web.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes, written by Steven
-Karel<karel@brandeis.edu>. Thanks to Jose L.Hales-Garcia <jose@stat.ucla.edu>
-for the tip.
-
-Note
-
-Refer to http://www.amanda.org/docs/systemnotes.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                   Up                                   Next
-Part I. Installation  Home  Chapter 2. Amanda Installation Notes
-
diff --git a/docs/tapechangers.txt b/docs/tapechangers.txt
deleted file mode 100644 (file)
index 1780462..0000000
+++ /dev/null
@@ -1,676 +0,0 @@
-
-     Chapter 8. Amanda Tape Changer Support
-Prev  Part II. About Tapes and Changers  Next
-
--------------------------------------------------------------------------------
-
-Chapter 8. Amanda Tape Changer Support
-
-
-James da Silva
-
-Original text
-AMANDA Core Team
-<jds@amanda.org>
-
-Stefan G. Weichinger
-
-XML-conversion;Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Introduction
-
-  Specifying_a_tape_changer_in_amanda.conf
-
-  Device-specific_tapechanger_script
-
-  Slot_names_and_the_"current"_slot
-
-  Operator_interface
-
-  How_amdump_interacts_with_the_tape_changer
-
-  Builtin_tape-changers
-
-
-        chg-multi_(formerly_chg-generic)
-
-        chg-manual_(formerly_no-changer)
-
-        chg-mtx_(formerly_hp-changer)
-
-        chg-zd-mtx
-
-        chg-scsi-chio_(formerly_seagate-changer,_then_chg-chio)
-
-        chg-scsi_(new_interface,_try_to_drive_a_robot_with_direct_scsi
-        commands)
-
-        chg-chio
-
-        chg-chs
-
-        chg-rth
-
-        chg-juke
-
-        chg-rait
-
-        chg-disk
-
-        chg-iomega
-
-        chg-null
-
-
-
- Introduction
-
-This document outlines the tape changer support design of Amanda 2.2 and
-beyond. It defines a small interface for changer software to follow so that
-Amanda can remain device-independent but still support the widest range of tape
-software and hardware possible.
-The interface is a bit simplistic and has only had complications added when
-there is a body of field experience.
-
- Specifying a tape changer in amanda.conf
-
-All device-specifics are hidden by a glue program that the rest of Amanda calls
-to interact with the tape changer.
-The name of this changer program is given by the "tpchanger" variable in the
-file amanda.conf. Example entry:
-
-  tpchanger "chg-multi"           # use multi-unit tape changer emulator
-       
-
-The tapedev parameter is ignored if a tpchanger program is specified, unless
-the changer program itself reads tapedev from amanda.conf. The chg-multi
-changer doesn't, as it reads all its configuration arguments from its own
-configuration file, specified as changerfile.
-If the tpchanger program does not begin with a '/', Amanda expects it to reside
-in libexecdir, and possibly have the version suffix appended depending on how
-Amanda was configured.
-Two other amanda.conf parameters are available for changer use, however their
-definition is left entirely up to the changer script itself. They are
-changerfile and changerdev. Typically changerfile will point to the
-configuration file specific to the changer, or be a base name of several
-related changer files. The changerdev variable may point to the /dev entry used
-to access the changer device.
-See the documentation with the specific changer you're interested in to see
-exaclty how these variables are used (if at all).
-
- Device-specific tapechanger script
-
-The tape changer script/program is always from the directory with amanda.conf.
-It is never passed the configuration name it is running on behalf of, but since
-amgetconf works without a name from the current directory, that should be
-sufficient.
-The script/program must support the following commands:
-
-* <tpchanger> -slot <slot-specifier>
-
-If changer is loaded, unloads the current slot (if different than "slot-
-specifier") and puts that tape away, then loads the requested slot. See the
-next section for the list of valid slot requests.
-Outputs to stdout the slot name and name of the device file to access the tape
-on success, or a slot name and error text.
-Returns 0 on success.
-Returns 1 on positioning error (eg at bottom of gravity stacker or slot empty).
-Returns 2 any other fatal error. The slot name may be invalid, but must be
-present. Error message goes to stdout in place of device name.
-Examples:
-
-               % chg-multi -slot 0
-               0 /dev/nrst8                    # exitcode returned is 0
-
-               % chg-multi -slot 1
-               1 slot 1 is empty               # exitcode returned is 1
-
-               % chg-multi -slot bogus-slot
-               <none> no slot `bogus-slot'     # exitcode returned is 2
-
-
-* <tpchanger> -info
-
-Outputs to stdout three or more fields:
-The current slot string (required)
-The number of slots (required)
-Flag indicating whether the changer can go backwards
-(0 if it can't, 1 if it can). (required)
-Flag indicating whether the changer is searchable
-(optional). Shows whether the changer supports the -search and -label commands
-and is able to load a tape given only the Amanda label string (0 or omitted if
-it can't, 1 if it can). (optional)
-Examples:
-
-               % chg-multi -info
-               0 10 1                          # exitcode returned is 0
-
-               % chg-zd-mtx -info
-               0 10 1 1
-
-
-* <tpchanger> -reset
-
-Resets the changer to known state and loads the first slot.
-Output and error handling are the same as
-"<tpchanger> -slot first"
-In the case of a gravity stacker that must be reset by hand, this could be run
-(via " amtape <conf> reset") to inform the software the stacker is positioned
-back at the top.
-Examples:
-
-               % chg-multi -reset
-               0 /dev/nrst8                    # exitcode returned is 0
-
-               % chg-multi -reset
-               0 slot 0 is empty               # exitcode returned is 1
-
-               % chg-multi -reset
-               0 tape-changer not responding   # exitcode returned is 2
-
-
-* <tpchanger> -eject
-
-Unloads the current slot (if loaded) and puts that tape away.
-Output and error handling are the same as the -slot command.
-Note that a tape may or may not be loaded when this command completes,
-depending on the hardware.
-Examples:
-
-               % chg-multi -eject
-               0 /dev/nrst8                    # exitcode returned is 0
-
-               % chg-multi -eject
-               0 drive was not loaded          # exitcode returned is 1
-
-The tape changer program MAY support the following commands:
-
-* <tpchanger> -search <labelstr>
-
-Loads an Amanda tape by name (labelstr).
-Output and error handling are the same as the -slot command.
-taper, amcheck and amtape will use this command if the changer reports it is
-searchable.
-Example:
-
-               % chg-zd-mtx -search DailySet005
-               5 /dev/nrst8                    # exitcode returned is 0
-
--<tpchanger> -label <labelstr> Associates the Amanda label <labelstr> with the
-barcode of the currently loaded (in the tape drive) tape.
-Outputs to stdout the current slot and tape device. amlabel will use this
-command if your changer is searchable to build up the barcode database.
-Example:
-
-               % chg-zd-mtx -label DailySet006
-               6 /dev/nrst8                    # exitcode returned is 0
-
-For all the commands:
-An exit code of 0 implies that the operation was completely successful, and the
-output may be parsed by the Amanda code as described above.
-For non-zero exit codes, the first field is still the slot name, but the actual
-error messages are not fixed. They are just displayed and/or logged as-is by
-the calling Amanda program.
-An exit code of 1 implies the operation failed in a benign way, for example an
-empty slot or an attempt to go backwards in a gravity stacker. The calling
-Amanda program will print the error message if appropriate and continue,
-perhaps requesting a different slot be loaded.
-Any other exit code is considered fatal and will cause Amanda to stop
-attempting to talk to the tape changer.
-
- Slot names and the "current" slot
-
-Some tape changers, such as carousels and gravity stackers, have a hardware
-notion of current position. Others have no current position when no tape is
-loaded: all tapes are in their slots and the changer arm is docked away from
-the slots.
-Nevertheless, Amanda requires tape-changer scripts to maintain the notion of a
-"current" position. This is for performance reasons: as tapes tend to be loaded
-into the rack in order, and Amanda uses them in order, the next tape to use can
-be found much quicker if the position of the current one is remembered. As an
-example, the chg-multi script maintains the current position in a chg-
-multi.state file (or any other file specified in a `statefile' line in the
-changer configuration file).
-Amanda does not care how slots are available or how they are named. They could
-be numbered 0 to N-1, numbered 1 to N, or even designated by letter, A .. Z.
-The only requirement is that the names do not contain whitespace and that the
-names "current", "next", "prev", "first", "last" and "advance" retain their
-meaning as follows:
-current The position of the last loaded tape, as described above
-next The position after current, wrapping from the last slot to the first.
-prev The position before current, wrapping from the first slot to the last.
-first The first slot in the tape rack.
-last The last slot in the tape rack.
-advance The same as "next" except the next tape may not be loaded if the
-changer supports advancing to the next slot without putting that tape in the
-drive.
-The current position must be updated even if there is a positioning error (such
-as "empty slot"). This allows amanda to step through the entire tape rack by
-issuing successive "slot next" positioning commands.
-
- Operator interface
-
-The amtape program is the main operator interface to Amanda's tape changer
-support. The commands supported include:
-amtape <conf> slot <slot-specifier> Load the tape from the specified slot into
-the drive
-amtape <conf> eject Send an eject command to the tape-changer. Effect is
-changer specific.
-amtape <conf> reset Send a reset command to the tape-changer. Effect is changer
-specific.
-amtape <conf> show Go through the entire tape rack, showing the labels of all
-amanda tapes encountered.
-amtape <conf> label <label> Find and load the tape with the specified label
-amtape <conf> taper Perform taper's scan algorithm (see below), loading the
-tape which would be picked for the next amdump run.
-amtape <conf> clean If a cleaning tape is defined by the changer, load it in
-the drive and put it away when done.
-amtape <conf> device Output the current tape device name.
-amtape <conf> current Display the contents of the current slot.
-amtape <conf> update Scan the entire tape rack and update the barcode database.
-See the amtape(8) man page for more details.
-In addition to amtape, amlabel has been modified to allow optionally specifying
-a slot:
-amlabel <conf> <label> [slot <slot-specifier>]
-amcheck looks for the next tape in the rack the same way the taper does. If
-multiple tapes are used in one night, amcheck attempts to find all the needed
-tapes in turn if the tape-changer is random access. On a one-way gravity
-stacker, amcheck only finds the first tape, since finding the subsequent ones
-would put the first one out of reach of that night's amdump run.
-amrestore and amrecover do not yet include any tape changer support directly,
-as amrestore knows nothing about the amanda.conf files or server-side
-databases. This is a deliberate decision to keep amrestore independent, so it
-can be run from any host with a tape drive, even if the original tape server
-host is down. To use amrestore in a tape-changer environment, use amtape to
-find the right tape, then run amrestore giving the resulting tape device name.
-
- How amdump interacts with the tape changer
-
-Amanda does not require a particular tape label for a run. Any label that
-matches the labelstr regex and is determined to be "inactive" according to the
-tapelist database, may be written to. However, there is a preferred 'next'
-tape, the one that is next in the cycle implied by the current tapelist.
-amdump uses two algorithms, depending on whether the tape changer can go
-backwards in the rack or not. If multiple tapes are needed in a single run,
-this algorithm is repeated in turn whenever a new tape is required.
-Normal tape changers (those that can go backwards):
-With a full-access tape changer, amdump searches the entire rack for the
-preferred tape label. This tape will usually be found at the current or next
-position, but might be located anywhere. If the tape is found, it is used. If
-it is not found, the first tape encountered that matches the labelstr and is
-not active is picked.
-Gravity stackers (anything that can not go backwards):
-To avoid going all the way to the bottom of the stacker only to find that the
-preferred tape isn't present and nothing can be done, Amanda picks the first
-tape (starting at the current position) that matches the labelstr and is not
-active, regardless of whether it is the preferred tape.
-
- Builtin tape-changers
-
-
- chg-multi (formerly chg-generic)
-
-This tape changer script supports several common configurations:
-
-* Using multiple tape drives in a single host to emulate a tape changer. This
-  can also be used with a single physical drive to write several tapes in an
-  Amanda run.
-
-
-* Using a gravity stacker or a real changer configured to sequentially load the
-  next tape when the current one is ejected. Also supports a changer which
-  cycles to the first tape after loading the last one.
-
-
-* Using a changer accessed through several "virtual" tape devices which
-  determine which slot actually gets loaded in the tape drive.
-
-The advantage of this changer script is that you do not need to get into the
-complexity of dealing with a real changer interface. All the action goes
-through the tape device interface with standard mt commands, which eases many
-portability issues. Many common tape jukeboxes can be configured in a
-sequential or cycle mode.
-chg-multi ignores `tapedev' and `changerdev' because `changerfile' may specify
-several tape devices to be used. A sample configuration file may be found in
-example/chg-multi.conf.
-
- chg-manual (formerly no-changer)
-
-This is a poor man's tape changer that requires the backup operator to change
-tapes manually. It expects `tapedev' in amanda.conf to point to a valid tape
-device, and stores some status data in files whose names start with the
-`changerfile'. `changerdev' is ignored.
-
- chg-mtx (formerly hp-changer)
-
-An mtx-based tape changer script. `changerdev' must specify the tape device
-controlled by the mtx program, and `tapedev' must point to the no-rewind tape
-device to be used. More than likely, both `changerdev' and `tapedev' will
-reference the same device file. `changerfile' must specify a prefix for status
-files maintained by this script. It will maintain files named `changerfile'/
-changer-clean and `changerfile'/changer-access. You may have to edit the script
-to specify which slot contains a cleaning tape (cleanslot).
-The mtx program must support commands such as `-s', `-l' and `-u'. If the one
-you've got requires `status', `load' and `unload', you should use chg-zd-mtx
-instead (see below).
-
- chg-zd-mtx
-
-Based on chg-mtx, but modified in order to support the Zubkoff/Dandelion
-version of mtx. Eric DOUTRELEAU <Eric.Doutreleau@int-evry.fr>, who contributed
-this script, reported that it works on a Solaris/sparc box with a HP 1557A
-stacker.
-In addition to the `changerfile'-clean and the `changerfile'-access files, it
-maintains a `changerfile'-slot file that indicates the currently loaded slot.
-There are lots of comments at the start of the script describing how to set it
-up.
-
- chg-scsi-chio (formerly seagate-changer, then chg-chio)
-
-A C program that relies on scsi tape-changer interfaces. It may either use the
-tape changer interface specified in chio.h (Gerd Knor's SCSI media changer
-driver, a Linux kernel loadable module), or it may use built-in tape changer
-interfaces available on HPUX, Solaris 2.5, IRIX and possibly others, but only
-the chio and HPUX interfaces are currently implemented . `tapedev' specifies
-the tape device to be used; `changer_dev' is the device used to talk to the
-kernel module (for chio, usually /dev/ch0), and `changerfile' specifies a
-filename in which the current slot number will be stored.
-Now there is another way, to get the chg-scsi a little bit more flexible. If
-you use only one digit in the `tapedev' parameter, the chg-scsi expects that
-changerfile points to a real configuration file, not only a counting file. In
-this configuration file you may specify that the tapedrive needs an eject
-command and an optional waittime, necessary after inserting the tape into the
-drive. You are also able to configure a range of slots which should be used by
-your configuration. The idea behind this is, that you don't want Amanda to
-cycle all the tapes if Amanda searches exactly one tape. If you have a library
-which supports more than one drive you can also specify which drive to use. For
-each configuration (there should be at least one) you have to specify a file,
-where Amanda remembers which tape is actually in the drive. For future use
-there is also some stuff for cleaning the drives.
-In amanda.conf:
-
-  tapedev "x"       with x between 0 and 9, selects the configuration to use
-  changerfile "filename"            specifies the changer configuration file
-       
-
-In the changer-config-file the following could be set:
-
-  number_configs x
-  #    x between 0 and 9       number of configurations defined. This should be the
-  first parameter in the config-file.
-  eject        x
-  #    x 0 or 1                1 means that the drives need an eject command, before the robot
-  can handle the tape.
-  sleep        x
-  #    x between 0 and MAX_INT specifies the seconds to wait before the drive
-  could be used after inserting a tape. 5 should be OK.
-  cleanmax x   
-  #    x some positive int     How many cleanings does a cleaning tape survive
-  changerdev  <device>
-  #                            The device for the robot
-       
-
-And then there come some configuration sections, separated by the word `config`
-followed by the ordinal of that configuration (0 to 9). In each configuration
-section you should specify:
-
-  drivenum x           x between 0 and the number of drives in the library
-  This one specifies the drive to
-  use with this configuration
-  dev  <device>                                The device for the tapedrive
-  startuse    x                x between 0 and maximum slotnumber of your library
-  Starting here we may use the tapes
-  enduse        x              x between start and maximum slotnumber
-  This is the last tape we may use
-  in this configuration. If we reach
-  this one the next will be start..
-  statfile <filename>                          Here we remember the last used
-  slot for this configuration
-  cleancart    x       x between 0 and maximum slotnumber
-  In this slot we find the
-  cleaning tape
-  cleanfile <filename>                         Here we will remember how
-  often we used the cleaning tape
-  usagecount <filename>                                This points to a file which is
-  deleted after cleaning the drive
-  e.g. the usagetime of the drive
-       
-
-Comments begin with an '#' until end of line. Allowed separators are TAB and
-SPACE.
-
- chg-scsi (new interface, try to drive a robot with direct scsi commands)
-
-The config and the syntax is the same as for chg-scsi-chio. New is the config
-type
-emubarcode 1
-With this option and the option labelfile chg-scsi will try to create an
-inventory. With this inventory it should be possible to use the search feature
-for loading tapes.
-debuglevel x:y
-This option will set the debug level and select for which part debug messages
-should be sent to the debug file. In case of problems you should set it to 9:0
-havebarcode 1
-This will force the program to read the barcodes, and don not try to figure out
-if there is an barcode reader available.
-scsitapedev <devicename>
-This device is used to control the tape, read status infos etc.
-tapestatus <filename>
-If this option is given on every eject/move the log pages of the tape device
-will be dumped in this file. There are 2 log pages were you can see how many
-read/write errors (corrected) are processed by the tape
-labelfile <filename>
-This file is used for the mapping from barcode labels to Amanda volume labels.
-It is used if the changer has a barcode reader. To initialize run amtape show,
-this will add the mapping for the tapes in the magazine.
-eject > 1
-Use the mtio ioctl to eject the tape, use only if the standard (1) does not
-work, and send the debug output (/tmp/amanda/chg-scsi.debug) to th@ant.han.de
-changerident <ident>
-With this it is possible to specify which internal driver to use for
-controlling/error handling of the robot
-tapeident <ident>
-Some as above but for the tape.
-New command line option: -status
-[all|types|robot|sense|ModeSenseRobot|ModeSenseTape|fd]
-<all> will show the result form all options. <types> will list the known driver
-types. <robot> will show the status of all elements (tape/robot/slots..)
-<sense> will show the result from a request sense <ModeSenseRobot> will show
-the sense page from the robot <ModeSenseTape> will show the sense page from the
-tape <fd> will show the devices which are open, and some info about it.
-At the moment changer with tape and robot on the same SCSI id ( but on
-different luns) will run on the following platforms:
-- HP_UX 10.20 - IRIX 6.x - Solaris - Linux - AIX - FreeBSD 3.0/4.0
-Tape and robot on different IDs run native on - Linux - HP-UX 10.20 - Irix 6.x
-- FreeBSD
-Tape and robot on different IDs with special modules run on: Solaris with sst
-kernel module, which is not any longer needed in solaris 2.8. See in the
-contrib/sst directory The configuration on solaris 2.8 with the sgen driver is
-done by creating the file /kernel/drv/sgen.conf
-This file should contain at the beginning the following device-type-config-
-list="changer","sequential"
-This will force the driver to attach only to the devices with type either
-changer (the robot) and sequential (the tape). Next you must tell the driver on
-which id it should check for devices (tape on id 5, robot on id 6 in this
-example),
-name="sgen" class="scsi" target=5 lun=0; name="sgen" class="scsi" target=6
-lun=0;
-This will create the 2 device files /dev/scsi/sequential/c0t5d0 (scsitapedev
-option in chg-scsi.conf) /dev/scsi/changer/c0t6d0 (changer option in chg-
-scsi.conf)
-So the complete sgen.conf looks like: device-type-config-
-list="changer","sequential name="sgen" class="scsi" target=5 lun=0; name="sgen"
-class="scsi" target=6 lun=0;
-For HP you have to create the special device files for the pass throu
-interface. Check if the ctl driver is installed. Example:
-
-  # lsdev -C ctl
-      Character     Block       Driver          Class
-        203          -1         sctl            ctl
-
-Next check on which bus your drives are connected. (ioscan) with the Character
-device num form the lsdev and the card instance from ioscan create the special
-file. Example:
-
-  mknod /dev/scsi/1 c 203 0x001000
-                            ||||
-                            ||| LUN of device
-                            ||SCSI ID of the device
-                            2 digit instance number from ioscan
-
-On FreeBSD 4.0 the syntax for the device files has changed. Now you have to
-tell chg-scsi the bus:target:lun combination. If you for example on your scsi
-bus 0 target 3 an robot the syntax is changerdev 0:3:0 To get this info you can
-use the camcontrol command, <camcontrl devlist> will give you a list of known
-devices. Don't specify dev and scsitapedev in your chg-scsi.conf !!, this will
-not work.
-On Linux you need either sg (generic scsi) as module or it must be compiled
-into the kernel. If the sg driver doses not work try to use the ioctl
-interface. For that you have to undef the LINUX_CHG define in changer-src/scsi-
-linux.c Also you have to change the NORMAL_TIMEOUT in /usr/src/linux/drivers/
-scsi/scsi_ioctl.c from (10 * HZ) to (5 * 60 * HZ). On linux it does not run if
-you are using an aha1542 SCSI controller. The driver can not handle the
-extended request sense.
-On IRIX you find the SCSI pass through interfaces for every device in /dev/
-scsi.
-chg-scsi has been tested/run with the following devices: Exabyte 10h and eliant
-tape HP-Surestore 1200e and C1553A tape BreeceHill Q2.15 (EXB-120) and DLT7000
-tape Powerstor L200 and DLT7000 ARCHIVE Python 28849-XXX TANDBERG TDS 1420 ADIC
-VLS DLT Library
-It is now possible with a changer that has barcode reader to load tapes faster.
-Also amdump will find tapes faster. Every time a tape is labeled the
-information in the labelfile will be updated. To initialize the label mapping
-you can also do an amtape config show. This will put the mapping for all tapes
-in the magazine into the mapping file.
-For all problems please contact th@ant.han.de. Please include in your mail the
-debug file. (/tmp/amanda/chg-scsi.debug)
-
-chg-chio
-
-(new perl script that replaces the original chg-chio written in C) This script
-is based on the FreeBSD version of chio, a program to communicate with the
-jukebox. This script has for the moment only been test with FreeBSD and is
-likely not to work on any other system. Let me know if this is the case and
-send me the output of the chio program for your version of chio. It does not
-restrict the number of tapes, except that if there is only one tape in the
-juke, it is supposed to be in max_slot and not in slot 1. [This is the first
-version of the changer script and I would appreciate all comments on it, at
-nick.hibma@jrc.it. It has been tested only with FreeBSD 2.2.5 and the
-accompanying chio program.]
-
-chg-chs
-
-(formerly chs-changer) A tape changer script very similar to chg-multi, that
-uses the `chs' program to change tapes. As in chg-multi, `tapedev' is ignored.
-`changerfile' names its configuration file, similar to chg-multi.conf.
-`changerdev' will be passed to CHS in a -f command-line switch, unless it is
-set to an empty string or "/dev/null" (watch out for default values!)
-
-chg-rth
-
-(formerly rth-changer) A perl5 script that controls an HPc1553 tape drive via a
-Peripheral Vision Inc. SCSI control subsystem that interprets commands sent on
-the SCSI bus. It expects `tapedev' to specify the tape device to be used.
-`changerfile' and `changerdev' are ignored.
-
-chg-juke
-
-A shell script that uses the Fermilab "juke" software (see http://www.fnal.gov/
-fermitools, the "juke" link) to control tape chagners. It supports mounting
-multiple tapes for RAIT tapedrive sets, both multiple jukeboxes, or one jukebox
-with multiple tape drives, or combinations. 'juke' must be configured to know
-tape drives by the same name Amanda calls them. It uses 'changerfile' to track
-Amanda's current tape state, 'tapedev' must be the tape drive (or RAIT set)
-name, and 'changerdev' is the juke software's name for the changer, or a csh-
-glob that expands to several jukebox names (i.e. "changer{a,b,c}").
-
-chg-rait
-
-A shell script that runs other changers in tandem, and returns a rait:
-{dev1,dev2,...} tape device based on the results of each other changer. So if
-you wanted to have 2 stackers striped with no parity, and you have chg-mtx
-support for your stackers, you would use the follwing changerfile:
-
-
-     nchangers=3
-     tpchanger_1="chg-mtx"
-     changerdev_1="/dev/mtx1"
-     changerfile_1="/some/file1"
-     tapedev_1="/some/dev"
-     tpchanger_2="chg-mtx"
-     changerdev_2="/dev/mtx2"
-     changerfile_2="/some/file2"
-     tapedev_2="/some/dev"
-     tpchanger_3="chg-null"
-     changerdev_3="/dev/null"
-     changerfile_3="/some/file3"
-     tapedev_3="/some/dev"
-
-The third uses the null changer. The tapedev_n entries are only needed if the
-changerfile in question uses them.
-
-chg-disk
-
-Clone of the chg-zd-mtx, but modified to be applied on local directories
-instead of tapes. This changer emulates a robotic that uses virtual tapes
-instead of real ones, where the virtual tapes are real directories on a hard
-disk.
-The directory tree should be:
-
-  slot_root_dir -|
-                 |- info
-                 |- data -> slot1/
-                 |- slot1/
-                 |- slot2/
-                 |- ...
-                 |- slotn/
-
-Where "slot_root_dir" is the tapedev "file:xxx" parameter and "n" the tapecycle
-parameter.
-Please refer to How_to_use_the_Amanda_file-driver for details of usage.
-
-chg-iomega
-
-This changer script is designed for IOMEGA or JAZZ disks of various sizes as
-well as any other removable disk media. This is a PURELY MANUAL changer. It
-requests insertion of disk media via messages on /dev/tty. So it cannot be used
-via crontab. Make sure you comply with any of the following. - Add statements
-
-          tpchanger "chg-iomega"
-          tapedev "file:<mount_point_of_removable_disk>"
-          (e.g. tapedev "file:/mnt/iomega" )
-          tapetype IOMEGA
-
-
-          define tapetype IOMEGA {
-              comment "IOMega 250 MB floppys"
-              length 250 mbytes
-              filemark 100 kbytes
-              speed 1 mbytes
-          }
-
-to your amanda.conf. - Add entry to /etc/fstab to specify mount point of
-removable disk and make this disk mountable by any user. - Format all disks,
-add a "data" sub directory and label all disks by using amlabel. - Be aware
-that as of version 2.4.4p1, Amanda can't handle backups that are larger than
-the size of the removable disk media. So make sure /etc/amanda/<backup_set>/
-disklist specifies chunks smaller than the disk size.
-
-chg-null
-
-A trivial changer which loads/unloads on a null: device. Useful with chg-rait
-to throw away a parity stripe by puttin on a null jukebox, or for testing.
-
-Note
-
-Refer to http://www.amanda.org/docs/tapechangers.html for the current version
-of this document.
--------------------------------------------------------------------------------
-
-Prev                   Up                  Next
-Chapter 7. Tapetypes  Home  Chapter 9. chg-scsi
-
diff --git a/docs/tapesnchangers.txt b/docs/tapesnchangers.txt
deleted file mode 100644 (file)
index a7addeb..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-
-Part II. About Tapes and Changers
-Prev                         Next
-
--------------------------------------------------------------------------------
-
-
-Part II. About Tapes and Changers
-
-
-
-Tape-Drives and Tape-Changers
-
-Amanda is able to use a wide range of Tape-Drives and Tape-Changers. This
-section contains information on the concept of the tapetypes as well as
-information on how to make use of your tape-changer by using the appropriate
-changer-scripts.
-Table of Contents
-
-
-  7._Tapetypes
-
-  8._Amanda_Tape_Changer_Support
-
-
-        Introduction
-
-        Specifying_a_tape_changer_in_amanda.conf
-
-        Device-specific_tapechanger_script
-
-        Slot_names_and_the_"current"_slot
-
-        Operator_interface
-
-        How_amdump_interacts_with_the_tape_changer
-
-        Builtin_tape-changers
-
-
-              chg-multi_(formerly_chg-generic)
-
-              chg-manual_(formerly_no-changer)
-
-              chg-mtx_(formerly_hp-changer)
-
-              chg-zd-mtx
-
-              chg-scsi-chio_(formerly_seagate-changer,_then_chg-chio)
-
-              chg-scsi_(new_interface,_try_to_drive_a_robot_with_direct_scsi
-              commands)
-
-              chg-chio
-
-              chg-chs
-
-              chg-rth
-
-              chg-juke
-
-              chg-rait
-
-              chg-disk
-
-              chg-iomega
-
-              chg-null
-
-
-
-  9._chg-scsi
-
-
-        Command_line_options
-
-        Notes_about_changer.conf
-
-        Amanda's_actual_usage_of_chg-scsi
-
-        Configuration_notes
-
-        Hacking_notes
-
-
-  10._RAIT_(Redundant_Array_of_Inexpensive_Tape)_Support
-
-
-        What_is_a_RAIT?
-
-        Using_a_RAIT
-
-        Disaster_Recovery
-
-
-  11._Printing_of_Labels
-
-
-        The_New_Feature
-
-        Labels_provided
-
-        History
-
-        How_it_works
-
-
--------------------------------------------------------------------------------
-
-Prev                                      Next
-Chapter 6. Restore  Home  Chapter 7. Tapetypes
-
diff --git a/docs/tapetypes.txt b/docs/tapetypes.txt
deleted file mode 100644 (file)
index ab4c482..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-
-                  Chapter 7. Tapetypes
-Prev  Part II. About Tapes and Changers  Next
-
--------------------------------------------------------------------------------
-
-Chapter 7. Tapetypes
-
-You may find tapetype-definitions in the example amanda.conf, in the
-mailinglist-archives of the amanda-users-mailinglist at http://
-marc.theaimsgroup.com/?l=amanda-users or in the Amanda-FAQ-O-Matic at http://
-www.amanda.org/fom-serve/cache/1.html. They inform Amanda how much it is
-supposed to be able to store in a tape (length), how much space is wasted at
-the end of a dump image with the EOF mark (filemark) and how fast the tape unit
-is (speed).
-The most inportant parameter is length, since Amanda may decide to delay a
-backup if length is too small, but, if it is too large, Amanda may end up
-leaving dumps in the holding disk or having to abort some dump.
-Filemark is important if you have many disks, particularly with small
-incremental backups. The space wasted by so many filemarks may add up and
-considerably modify the available tape space.
-The speed is currently unused.
-If none of the sample tapetype entries match your needs, you may search the
-mailing list archives or look up the on-line list of tapetype entries. Just
-follow the links from http://www.amanda.org.
-Amanda provides the amtapetype utility to calculate the size of a tape, to
-generate a "tapetype" entry for your amanda.conf.
-Specifying the appropriate tape device, but beware that it may take many hours
-to run (it fills the tape twice ...). Make sure you do not use hardware
-compression, even if you plan to use hardware compression in the future.
-amtapetype writes random data to tape, and random data will expand instead of
-compressing, therefore you'll get an estimate that's smaller than expected.
-
-Note
-
-Please note that amtapetype in releases up to snapshot 20040915 expects to be
-given a tape that can be overwritten without causing harm.
-It does NOT warn you if the tape contains a label or data. amtapetype will
-OVERWRITE the tape so be cautious. You have been warned.
-Snapshot 20040915 introduces a warning and the flag -o to overwrite a labelled
-tape.
-
-Note
-
-Refer to http://www.amanda.org/docs/tapetypes.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                Up                                     Next
-Part II. About Tapes and Changers  Home  Chapter 8. Amanda Tape Changer Support
-
diff --git a/docs/technical.txt b/docs/technical.txt
deleted file mode 100644 (file)
index c9aeea1..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-
-Part V. Technical Background
-Prev                    Next
-
--------------------------------------------------------------------------------
-
-
-Part V. Technical Background
-
-
-
-How Amanda really works ...
-
-This section contains some papers which describe the technical concepts behind
-Amanda. You find descriptions of the various APIs as well as a basic draft of
-the internals of Amanda.
-Table of Contents
-
-
-  22._How_Amanda_uses_UDP_and_TCP_ports
-
-
-        TCP_port_allocation
-
-        User_TCP_port_range_(--with-tcpportrange)_summary
-
-        UDP_port_allocation
-
-        User_UDP_port_range_(--with-udpportrange)_summary
-
-        Firewalls_and_NAT
-
-
-  23._Amanda_dumper_API
-
-
-        Introduction
-
-        The_Problem
-
-        Overview_of_the_API
-
-
-              The_`support'_command
-
-
-        The_`selfcheck'_command
-
-        The_`estimate'_and_`estimate-parse'_commands
-
-        The_`backup'_and_`backup-parse'_commands
-
-        The_`index-from-output'_and_`index-from-image'_commands
-
-        The_`restore'_command
-
-        The_`print-command'_command
-
-        Conclusion
-
-
-  24._Amanda_Internals
-
-
-        Protocols
-
-        server_and_amandad_on_client
-
-        planner_and_driver
-
-        driver_and_dumper
-
-        taper(read)_and_taper(write)
-
-
-  25._Amanda_Event_API
-
-
-        Introduction
-
-        The_API
-
-
-              event_register
-
-              event_release
-
-              event_loop
-
-              event_wait
-
-              event_wakeup
-
-
-        Data_types
-
-
-              event_handle_t
-
-              event_id_t
-
-              event_type_t
-
-              event_fn_t
-
-
-        Event_Types
-
-
-              EV_READFD
-
-              EV_WRITEFD
-
-              EV_SIG
-
-              EV_TIME
-
-              EV_WAIT
-
-
-
-  26._Amanda_Security_API
-
-
-        Introduction
-
-        The_Problem
-
-        The_API
-
-
-              protocol_packet_transmission_functions
-
-              stream_functions
-
-
-        Data_Types
-
-
-              security_driver_t
-
-              security_handle_t
-
-              security_stream_t
-
-              security_status_t
-
-
-        SECURITY_DRIVERS
-
-
-              name
-
-              connect
-
-              accept
-
-              close
-
-              sendpkt
-
-              recvpkt
-
-              recvpkt_cancel
-
-              stream_server
-
-              stream_accept
-
-              stream_client
-
-              stream_close
-
-              stream_auth
-
-              stream_id
-
-              stream_write
-
-              stream_read
-
-              stream_read_cancel
-
-
-
-  27._Virtual_Tape_API
-
-  28._Using_Kerberos_with_Amanda
-
-
-        Amanda_2.5.0_-_KERBEROS_v4_SUPPORT_NOTES
-
-
-              Configuration
-
-              Installation
-
-              conf_file
-
-
-        Amanda_2.5.0_-_KERBEROS_v5_SUPPORT_NOTES
-
-
-              Building
-
-              Installation
-
-              conf_file
-
-              Destination_Host_Permissions_file
-
-
-
--------------------------------------------------------------------------------
-
-Prev                                                                  Next
-Chapter 21. Amanda WISHLIST  Home  Chapter 22. How Amanda uses UDP and TCP
-                                                                     ports
-
diff --git a/docs/topten.txt b/docs/topten.txt
deleted file mode 100644 (file)
index 8671494..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-
-Chapter 20. Collection of the top ten Amanda questions. And answers.
-Prev  Part IV. Various Information                              Next
-
--------------------------------------------------------------------------------
-
-Chapter 20. Collection of the top ten Amanda questions. And answers.
-
-
-Stefan G. Weichinger
-
-Original text; Conversion to Docbook/XML
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Reason_for_starting_this_list.
-
-  the_DLE-question
-
-  the_localhost-question
-
-  the_friday-tape-question
-
-  the_multiple-dumps-question
-
-  the_mailing-list-question
-
-  the_distro-question
-
-  the_index-question
-
-  the_tapetype-questions
-
-  the_size-question
-
-  the_GUI-question
-
-  the_holding-disk_question
-
-  ...
-
-
- Reason for starting this list.
-
-Jon LaBadie once wrote to me:
-" I think a good "what is Amanda", "how is it different", "can I use it in my
-setup", "why is it so different" kinda document is needed to stop the constant
-"how do I put 10 dumps on one tape", or "how do I make Amanda do full backups
-on saturday and incrementals ..." queries off the list :)) "
-Stefan G. Weichinger
-
- the DLE-question
-
-A posting from the amanda-users mailing-list (mailto://amanda-users@amanda.org)
-asked:
-"What, please, is a "DLE"? May it mean: Down Loadable Entity ??? Stupid. Do
-Less Errors ??? Stupid again. Hmmmm ..."
-People consulting the amanda-users-mailinglist for the first time often get
-confused by the use of the abbreviation DLE.
-It has become very common for regular mailinglist-participants to use the
-abbreviation DLE, which means in its long form
-DiskList Entry
-A DLE refers to one entry in the disklist of an Amanda-configuration. General
-usage was to describe them as partitions, or file systems. But in fact they do
-not have to be either. They can be directory trees, or multiple trees, or trees
-with some branches cut off. So the more generic term DLE was coined.
-
- the localhost-question
-
-People get something like:
-
-  >Amanda Backup Client Hosts Check
-  >--------------------------------
-  >ERROR: localhost: [access as amanda not allowed from
-  >amanda@localhost.localdomain] amandahostsauth failed
-
-and ask "Why?"
-SHORT ANSWER:
-DO NOT USE "localhost" as host entry in your disklist entries (aka DLEs). Use
-the FQDN (Fully Qualified Domain Name) instead.
-In Amanda-releases newer than 2004-03-22 there is a WARNING issued when you use
-something like "localhost" or localhost.localdomain.net in your disklist.
-Example (applies to Linux, syntax may be different on other systems):
-
-  $ hostname --fqdn
-  oops1.oops.co.at
-
-  $ cat disklist
-  oops1.oops.co.at /root root-tar # do it like this
-  localhost        /root root-tar # DON'T DO IT LIKE THIS
-
-GOOD ANSWER (provided by John R. Jackson):
-There are (at least) two things going on here and they should have their own
-question/answer.
-Completely independent of the "localhost" vs. FQDN issue are the people who get
-this message because of any number of problems. Let me reword the error and
-then give some typical goofs:
-
-  ERROR: some.amanda.client: access as amanda not allowed from
-  amanda@some.amanda.server
-  amandahostsauth failed
-
-(error message reformatted here ...)
-The first thing to understand is how to read this message. When it says "access
-as amanda ..." it is telling you the client side ( amandad) is running as user
-"amanda". The "... from amanda@some.amanda.server" part tells you the server
-trying to connect is "some.amanda.server" and the Amanda command (e.g. amcheck
-or amdump) is running as user "amanda".
-The user names are typically the same on both client and server, but some
-situations use different names and it is important to understand which is
-which. For instance, amrecover connects as root ("... from
-root@some.amanda.server") regardless of what the usual Amanda user is.
-Potential problems:
-
-* "some.server" is not spelled exactly that way in ~amanda/.amandahosts. A
-  typical error is to not use a fully qualified name (although simple typos
-  happen as well). For instance, this line:
-
-
-  some amanda
-
-does not match "some.amanda.server" even though both names may be equivalent.
-When Amanda looks up the host name in .amandahosts, it uses the exact name it
-lists in the message. It does not try to look up abbreviations.
-The only exception to this is that the lookup is case insensitive.
-
-* The user name listed in ~amanda/.amandahosts is not the one trying to connect
-  from the server. In particular, watch out for the "root" case listed above
-  for amrecover. The Amanda server typically needs lines like this in its
-  .amandahosts file:
-
-
-  some.amanda.client   root
-
-
-* There are permission problems on the client preventing user "amanda" from
-  reading its own .amandahosts file. Make sure the file itself is readable to
-  the user "amanda" and all the parent directories down to it can be traversed.
-  A simple test is:
-
-
-  su - amanda -c "cat ~amanda/.amandahosts"
-
-Now, back to the localhost issue. This:
-Do NOT USE "localhost" as host entry in your disklist entries (aka DLEs). Use
-the FQDN (Fully Qualified Domain Name) instead.
-is not really an answer, more of a command :-).
-There are a couple of reasons to NOT use "localhost". First is amrecover will
-not work as expected. When it connects to the server (even though they are the
-same machine), the server will look for the matching DLE's using the real host
-name, not "localhost". The sethost command inside amrecover can "fix" this, but
-why not just set it up right in the first place?
-Another reason to not use "localhost" is because it helps with future changes.
-As the Amanda configuration grows, it's not at all unusual to take a server and
-make it a client of a new, larger, server. But now "localhost" does not point
-to the same machine it used to. If the FQDN of the machine had been used all
-along, this upgrade would have been much easier.
-There is also no performance reason (any more) to use "localhost" instead of
-the FQDN. Modern OS network stacks know to shortstop packets destined for the
-local machine and never let them hit the wire. Yes, I'm old enough to remember
-when they didn't :-).
-
- the friday-tape-question
-
-"How do I make Amanda do full backups on Saturday and incrementals ... ?"
-"My backup screwed up on tuesday and now it keeps asking for the tuesday tape
-even though it is wednesday!"
-ANSWER:
-The short answer is: You can't.
-The longer answer is: You can. But you should not.
-The reason: Amanda is designed to schedule your backups. Let "her" do it.
-When you want to make the best use of Amanda, you have to let go the classic
-schedule where one used to have one tape dedicated to each day of the week, and
-one for the friday.
-The main difference in concept is this:
-In the classic backup scheme you said:
-"I want to have incremental backups from Mo-Th and a full backup on Fr."
-Using Amanda you say:
-"I want to have at least one full backup in 5 days."
-So you don't have to specify exactly WHEN the full backup should happen. You
-just tell Amanda some goals it should reach and let it work out the details.
-There are several advantages in this:
-Imagine that you have your classic backup-schedule running fine. Everything is
-calculated and designed well, so your tape gets filled well each night.
-Now one user generates an unforeseen huge amount of data. For example, he
-duplicates one big data-directory by mistake.
-So the size of the directory raises within one day, maybe for multiple GBs.
-Would your classic backup-scheme catch that? Or would it run out of tape,
-simply because it was not calculated to have that filesystem with that size?
-Amanda would try to catch it (and most of the time succeed ...).
-As there is the estimate-phase before actually dumping something, Amanda can
-look at the DLEs and determine the actual size at the time. It also determines
-the size of an incremental backup so it can test for the Plan B to just run a
-level-1 if it does not work out to do a level-0 for that DLE.
-If the size of the DLE is much bigger than it has been the run before, Amanda
-still tries to meet your goals. It just reschedules stuff, combining full and
-incremental backups to meet the goals as good as possible.
-So you can think of it as some algorithm which lets Amanda adapt to your data.
-If you set the goals in a reasonable way, Amanda will just do the rest.
-
- the multiple-dumps-question
-
-"How do I put 10 dumps on one tape?"
-ANSWER (provided by Jon LaBadie):
-Use another backup scheduler.
-This question is most often asked by individual computer users as a cost
-consideration.
-Amanda was developed at the University of Maryland Computing Center for use in
-moderately sized computer centers. That it can be used by users of small
-computers is a testament to its designers and maintainers.
-While it may seem cost effective to put as many dumps as possible on a single
-tape, in a computing center that would be considered a very risky decision. The
-loss of, or damage to, a single tape would be the loss of many days worth of
-dumps. That is too much to chance.
-Thus, Amanda was designed to never overwrite a non-Amanda tape, nor an Amanda
-tape from a different configuration, nor an Amanda tape from the current
-configuration that is still "active", i.e. has backups on the tape more recent
-than the dumpcycle length.
-If you still feel you want Amanda to put multiple dumps on a single tape, there
-is a crude way to accomplish your goal.
-But first ask yourself, "If my data is worth so little that I can not afford a
-few more tapes, why am I backing it up?"
-
-Note
-
-Most of the time it won't be YOU paying for the tapes as you may be working for
-some company. If your boss tries to force you into doing this multiple-dumps-
-on-one-tape thing, be sure to point him at this risk. Business people tend to
-understand the price-difference between some tapes and a major data-loss.
-Stefan G. Weichinger
-A common way to put multiple dumps on a single tape is to let them accumulate
-on the holding disk and use the amflush command when you want to put them on
-tape. I.e. if you want a weeks' worth of backups on a single tape, leave the
-tape out for a week. Then stick it in and run amflush.
-(Better make sure you have sufficient disk space on your holding disk.)
-Note, a slight variant of this is to have the parameter autoflush in
-amanda.conf set to "yes". (Users of older Amanda-releases should check out if
-their version already supports that parameter.)
-Then after several dumps have collected in the holding disk, put the tape in
-before that day's amdump is scheduled. amdump will both flush the holding disk
-to tape and add the regularly scheduled dump.
-
- the mailing-list-question
-
-"How do i get off this damn mailing list?"
-ANSWER:
-Frequent users of the Amanda-users-mailing-list get mails like containing
-"unsubscribe"
-as people are trying desperately to get off the list.
-Everyone that subscribes to Amanda-users gets a mail in which the following is
-contained:
->Welcome to the amanda-users mailing list!
->Please save this message for future reference. Thank you.
->If you ever want to remove yourself from this mailing list, >you can send mail
-to <Majordomo@amanda.org> with the following >command in the body of your email
-message:
-> unsubscribe amanda-users
-Did you see that? You have to send your mail to <Majordomo@amanda.org>, and NOT
-to <amanda-users@amanda.org> !
-
- the distro-question
-
-"Where can i get binary distributions of Amanda?"
-ANSWER:
-It is well known that various distributions of Linux contain precompiled
-packages of Amanda-servers and -clients.
-Due to the design of the Amanda source code, in which MANY features can be
-configured at compile-time, it is heavily and heartily recommended to take the
-effort and roll your own special flavour.
-Thinking about these things before actually doing backups with Amanda will help
-you in many ways. And you get the benefits of compiling your own paths/devices/
-configurations right into your Amanda-binaries. You also get the benefit of a
-much more improved understanding of the way Amanda does backups.
-
- the index-question
-
-"Why does amrecover say there are no index files?"
-ANSWER:
-It is very likely that Amanda is right about that. Check your dumptypes and
-make sure they include the line:
-
-  index yes
-
-If this is the case and you still get that message, recheck the installation of
-your amindexd-binary.
-Is the line in your (x)inetd-configuration pointing to the proper binary? Is
-this line active (= uncommented)? Did (x)inetd reread that configuration since
-that line was edited?
-
- the tapetype-questions
-
-" amtapetype has been running for 9 days, is this normal?"
-"Will Amanda work with my frozboz tape drive/library?"
-"Which device is my changer?"
-" amtapetype is broken, it says my 200GB tape only holds 65GB."
-"My file marks are HUGE, 1.3MB (on a 200GB tape, i.e. about 0.05% of the total
-capacity, or expressed another way, maybe 2 mm of a 125000 mm tape ...)"
-ANSWER:
-It is crucial to tell Amanda the truth about the tape-device(s) you want to
-use. Given the wrong values, Amanda can't calculate proper dumpsizes, free
-tape-space or make valuable use of compression.
-Before you consider running amtapetype, think twice. Twice.
-As tapedrives tend to be produced by not-so-small companies and as those not-
-so-small companies tend to produce more than one unit to maximize profits, it
-is very likely that someone else has the same device you have or at least one
-that uses the same technology.
-Many people have already run amtapetype to determine the proper values to fill
-in their amanda.conf-files. Browse the example amanda.conf in your Amanda-
-tarball for various tapetypes. Browse the Amanda-FAQ on http://www.amanda.org.
-Chances are high that you find just your device described.
-As in every other topic discussed in internet mailing lists, please try finding
-an answer there before asking on the Amanda-users list.
-If your device is so exotic that even the Amanda-users can't help you, you
-still have your copy of amtapetype.
-Before you start running it, note this:
-
-* DISABLE hardware compression on your drive.
-
-A common mistake is to have hw-compression enabled. amtapetype uses random data
-to test for the size and speed of your drive. Random data is pretty bad at
-getting compressed. In fact it gets even bigger so the results given back are
-useless. Disable it even if you are planning to use your drive with enabled hw-
-compression.
-
-* Expect it running long.
-
-As you can read in the man page, amtapetype writes the full tape twice, which
-can be a lot of data for modern drives (approaching a TByte). It also writes
-tape marks every 10 MBytes (by default) which forces the drive to flush its
-internal buffers and slows the process down. You can shorten this by giving
-amtapetype a better estimate of the expected capacity:
-$ amtapetype -e 100g -f /dev/nst0
-This "prepares" amtapetype to expect a tape with 100 GB capacity.
-If amtapetype really runs for 9 days, you can be pretty sure there is something
-wrong with your approach.
-And for the filemark-size: Just read the question again.
-
- the size-question
-
-"How do I back up a partition that won't fit on a tape?"
-aka
-"Can Amanda span one file over multiple tapes?"
-ANSWER:
-There are two basic rules when it comes to these things:
-
-* Amanda supports using more than one tape in a single run of amdump
-* Amanda does not support splitting a dump image across tapes
-
-The first rule lets you make use of two or more tapes for a single amdump when
-using a tapechanger-robot or a tape-library. You could even use multiple tapes
-with the chg-manual-script, waiting patiently for one tape to be filled, then
-change tapes manually.
-No matter how many tapes you can put in your robot or how long you can stay
-awake to change tapes you can NOT split the backup image of one of your
-disklist entries (aka DLEs) across multiple tapes. No way.
-So you may ask the first question listed above. As the size of harddisk- drives
-grows steadily it is not uncommon to have multiple hundreds of gigabytes of
-harddrive capacity in one system. Compared to the size of your maybe not-so-
-shiny-anymore tapedrive this seems (and maybe is) huge.
-What to do?
-Don't split your dump image (it can't be done), split your DLEs.
-You have to use GNU-tar in your dumptypes for this.
-Try to redefine your disklist as in the following example:
-
-  fatboy  /bigmama_BIGDIR  /bigmama {     # a big subdirectory
-  comp-user-tar
-  include "./bigdir"
-  }
-  fatboy  /bigmama_FILES01 /bigmama {     # all files beginning with...
-  nocomp-user-tar
-  include "./file[01]*"
-  }
-  fatboy  /bigmama_FILES23 /bigmama {
-  nocomp-user-tar
-  include "./file[23]*"
-  }
-  ...
-  fatboy  /bigmama_REST /bigmama {        # Catch-all
-  nocomp-user-tar
-  exclude "./file[0-9]*"
-  exclude append "./bigdir"
-  }
-
-(example taken from a mail by Paul Bijnens on the Amanda-users-list)
-The trick is to form several chunks of data of which each fits on tape. In the
-example above the chunks are formed by regular expressions matching files named
-like file00, file123 and file9999. You have to look at your DLEs to find the
-patterns describing your chunks.
-As this technique forms data-chunks that fit on your tape it also helps Amanda
-to schedule your backups more flexible. Having more and smaller DLEs, the
-planner has more variations to possibly schedule your backups, so this will
-help getting nice output from amadmin <conf> balance, too.
-
-Note
-
-DLE-spanning might be supported by Amanda in a future release.
-
- the GUI-question
-
-"Is anyone working on a GUI for Amanda?"
-ANSWER:
-Actually there are people working on GUIs for Amanda. Aside from that the
-question really is: "Does anyone need a GUI for Amanda?"
-Given the fact that backups tend to be run at night while people tend to sleep,
-who would need a fancy GUI showing 3D-backup-diagrams via X11? The only part of
-backups where GUIs maybe could add some comfort is recovery for unexperienced
-users.
-
- the holding-disk question
-
-"Why does it say "Some dumps may have been left in the holding disk." and there
-is nothing in the holding disk?"
-ANSWER:
-The third word in the message. Some dumps MAY have been left.
-
- ...
-
-Please feel free to suggest additions and corrections. Write to the amanda-
-users-mailinglist at mailto://amanda-users@amanda.org.
-
-Note
-
-Refer to http://www.amanda.org/docs/topten.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                     Up                          Next
-Chapter 19. Amanda FAQ  Home  Chapter 21. Amanda WISHLIST
-
diff --git a/docs/upgrade.txt b/docs/upgrade.txt
deleted file mode 100644 (file)
index 5fee16c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-
-        Chapter 30. Upgrade Issues
-Prev  Part VI. Historical files  Next
-
--------------------------------------------------------------------------------
-
-Chapter 30. Upgrade Issues
-
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-Amanda 2.4.0 has introduced a major incompatibility in the Amanda protocol.
-This means that pre-2.4.0 clients won't interoperate with a 2.4.0 server, nor
-will 2.4.0 clients interoperate with pre-2.4.0 servers. You have to upgrade
-them all at the same time.
-To ease the upgrade process Amanda has, from release 2.4.0 on, a configure flag
-(--with-testing) that will cause Amanda to use alternate service names (Amanda-
-test) instead of the standard ones. This allows you to keep using your old
-version of Amanda while you test the new one.
-Depending upon the version of Amanda you are upgrading from, Amanda may use a
-different database library to store the backup information, and the new Amanda
-may not be able to read the old Amanda database files. In this case, you will
-want to do something like the following:
-Before the upgrade (using the old version of amadmin):
-
-       # cd /var/AMANDA/CONFIG
-       # amadmin CONFIG export > zzz
-       # mkdir backup
-       # mv curinfo* backup
-       
-
-and after the upgrade (using the new version of amadmin):
-
-       # cd /var/AMANDA/CONFIG
-       # amadmin CONFIG import < zzz
-       
-
-and a month :-) after you are happy with the new version:
-
-       # cd /var/AMANDA/CONFIG
-       # rm -rf backup
-       
-
-After 2.4.0, the structure of the directory holding the index files was changed
-to have three levels instead of being flat. This greatly reduces the number of
-files in a given directory, which was a problem for some systems.
-The new layout is:
-[indexdir]/hostname/filesystem/YYYYMMDD_L.gz
-where hostname and filesystem are "sanitized" versions of the names from
-disklist, i.e. '/' characters are converted to '_' and so on. This new naming
-convention matches the one used for the text formatted database.
-A script is available to convert the flat directory structure to the new
-layout:
-http://www.amanda.org/2.4-conv/msg00428.html
-
-Note
-
-Refer to http://www.amanda.org/docs/upgrade.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                   Up                            Next
-Chapter 29. Response to CPIO Security Home  Chapter 31. What once was new
-Notice Issue 11: 
-
diff --git a/docs/using.txt b/docs/using.txt
deleted file mode 100644 (file)
index 05f7b7c..0000000
+++ /dev/null
@@ -1,1989 +0,0 @@
-
-            Chapter 18. Using Amanda
-Prev  Part IV. Various Information  Next
-
--------------------------------------------------------------------------------
-
-Chapter 18. Using Amanda
-
-
-John R. Jackson
-
-Original text
-AMANDA Core Team
-<jrj@purdue.edu>
-
-Gavin Henry
-
-XML-conversion
-Suretec Systems Ltd.
-<ghenry@suretecsystems.com>
-
-Stefan G. Weichinger
-
-XML-conversion, Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  An_Introduction
-
-  Amanda_Features
-
-  Future_Capabilities_of_Amanda
-
-  Amanda_Resources
-
-  Installing_Amanda
-
-
-        Install_Related_Packages
-
-        Perform_Preliminary_Setup
-
-        Configure_the_Amanda_Build
-
-        Build_and_Install_Amanda
-
-        Configuring_Amanda
-
-        Decide_on_a_Tape_Server
-
-        Decide_Which_Tape_Devices_to_Use
-
-        Decide_Whether_to_Use_Compression
-
-        Decide_Where_the_Holding_Space_Will_Be
-
-        Compute_Your_Dump_Cycle
-
-        Copy_and_Edit_the_Default_Configuration_File
-
-        Configure_the_Holding_Disk
-
-        Configure_Tape_Devices_and_Label_Tapes
-
-        Configure_Backup_Clients
-
-        Test_and_Debug_Setup
-
-
-  Operating_Amanda
-
-
-        Run_amdump
-
-        Read_Amanda's_Reports
-
-        Monitor_Tape_and_Holding_Disk_Status
-
-        Adding_Tapes_at_a_Particular_Position_in_the_Cycle
-
-        Miscellanous_Operational_Notes
-
-
-  Advanced_Amanda_Configuration
-
-
-        Adjust_the_Backup_Cycle
-
-        Adjust_Parallelism
-
-        Monitor_for_Possible_Improvements
-
-        Excluding_Files
-
-
-  Restoring_with_Amanda
-
-
-        Configuring_and_Using_amrecover
-
-        Using_amrestore
-
-        Restoring_Without_Amanda
-
-
-
-An Introduction
-
-
-Note
-
-This chapter was written by John R. Jackson with input from Alexandre Oliva. It
-is part of the O'Reilly book "Unix Backup & Recovery" by W. Curtis Preston and
-has been provided online at http://www.backupcentral.com/amanda.html since the
-first edition of this book.
-During the Docbook-conversion of the Amanda-docs we asked for permission to
-include this chapter in the Official Amanda documentation and W. Curtis Preston
-allowed to us to include the now converted version. There will be some updates
-to this chapter in the next few months to reflect various changes and
-enhancements.
-You can find online versions of this chapter at http://www.amanda.org/docs/
-using.html and at http://www.backupcentral.com/amanda.html.
-Amanda, the Advanced Maryland Automated Network Disk Archiver, is a public
-domain utility developed at the University of Maryland. It is as advanced as a
-free backup utility gets, and has quite a large user community. Amanda allows
-you to set up a single master backup server to back up multiple hosts to a
-single backup drive. (It also works with a number of stackers.) Amanda uses
-native dump and/or GNU-tar, and can back up a large number of workstations
-running multiple versions of Unix. Recent versions can also use SAMBA to back
-up Microsoft Windows (95/98/NT/2000)-based hosts. More information about Amanda
-can be found at http://www.amanda.org
-Amanda was written primarily by James da Silva at the Department of Computer
-Science of the University of Maryland around 1992. The goal was to be able to
-back up large numbers of client workstations to a single backup server machine.
-Amanda was driven by the introduction of large capacity tape drives, such as
-ExaByte 8mm and DAT 4mm. With these drives, and the increased number of
-personal workstations, it no longer made sense to back up individual machines
-to separate media. Coordinating access and providing tape hardware was
-prohibitive in effort and cost. A typical solution to this problem reaches out
-to each client from the tape host and dumps areas one by one across the
-network. But this usually cannot feed the tape drive fast enough to keep it in
-streaming mode, causing a severe performance penalty.
-
-Note
-
-Since Amanda is optimized to take advantage of tape drives, we will use the
-word tape throughout this section. However, that doesn't mean that you couldn\19t
-use it with an optical or CD-R drive.
-The Amanda approach is to use a "holding disk" on the tape server machine, do
-several dumps in parallel into files in the holding disk, and have an
-independent process take data out of the holding disk. Because most dumps are
-small partials, even a modest amount of holding disk space can provide an
-almost optimal flow of dump images onto tape.
-Amanda also has a unique approach to scheduling dumps. A "dump cycle" is
-defined for each area to control the maximum time between full dumps. Amanda
-takes that information, statistics about past dump performance, and estimates
-on the size of dumps for this run to decide which backup level to do. This gets
-away from the traditional static "it's Friday so do a full dump of /usr on
-client A" approach and frees Amanda to balance the dumps so the total run time
-is roughly constant from day to day.
-Amanda is freely-available software maintained by the Amanda Users Group. Based
-on membership of Amanda-related mailing lists, there are probably well over
-1500 sites using it. This chapter is based on Amanda version 2.4.2. Updated
-versions of this section will be available with the Amanda source code.
-
-Amanda Features
-
-Amanda is designed to handle large numbers of clients and data, yet is
-reasonably simple to install and maintain. It scales well, so small
-configurations, even a single host, are possible. The code is portable to a
-large number of Unix platforms. It calls standard backup software, such as
-vendor provided dump or GNU-tar, to perform actual client dumping. There is
-also support for backing up Windows-based hosts via SAMBA. There is no
-Macintosh support yet.
-Amanda provides its own network protocols on top of TCP and UDP. It does not,
-for instance, use rsh or rdump/rmt. Each client backup program is instructed to
-write to standard output, which Amanda collects and transmits to the tape
-server host. This allows Amanda to insert compression and encryption and also
-gather a catalogue of the image for recovery. Multiple clients are typically
-backed up in parallel to files in one or more holding disk areas. A separate
-tape writing process strives to keep the tape device streaming at maximum
-throughput. Amanda can run direct to tape without holding disks, but with
-reduced performance.
-Amanda supports using more than one tape in a single run, but does not yet
-split a dump image across tapes. This also means it does not support dump
-images larger than a single tape. Amanda currently starts a new tape for each
-run and does not provide a mechanism to append a new run to the same tape as a
-previous run, which might be an issue for small configurations.
-Amanda supports a wide range of tape storage devices. It uses basic operations
-through the normal operating system I/O subsystem and a simple definition of
-characteristics. New devices are usually trivial to add. Several tape changers,
-stackers, and robots are supported to provide truly hands-off operation. The
-changer interface is external to Amanda and well-documented, so unsupported
-changers can be added without a lot of effort.
-Either the client or tape server may do software compression, or hardware
-compression may be used. On the client side, software compression reduces
-network traffic. On the server side, it reduces client CPU load. Software
-compression may be selected on an image-by-image basis. If Kerberos is
-available, clients may use it for authentication and dump images may be
-encrypted. Without Kerberos, .amandahosts authentication (similar to .rhosts)
-is used, or Amanda may be configured to use .rhosts (although rsh/rlogin/rexec
-are not themselves used). Amanda works well with security tools like TCP
-Wrappers (ftp://info.cert.org/pub/network_tools) and firewalls.
-Since standard software is used for generating dump images and software
-compression, only normal Unix tools such as mt, dd, and gunzip/uncompress are
-needed to recover a dump image from tape if Amanda is not available. When
-Amanda software is available, it locates which tapes are needed and finds
-images on the tapes.
-Amanda is meant to run unattended, such as from a nightly cron job. Client
-hosts that are down or hung are noted and bypassed. Tape errors cause Amanda to
-fall back to ?degraded? mode where backups are still performed but only to the
-holding disks. They may be flushed to tape by hand after the problem is
-resolved.
-Amanda has configuration options for controlling almost all aspects of the
-backup operation and provides several scheduling methods. A typical
-configuration does periodic full dumps with partial dumps in between. There is
-also support for:
-
-* Periodic archival backup, such as taking full dumps to a vault away from the
-  primary site.
-* Incremental-only backups where full dumps are done outside of Amanda, such as
-  very active areas that must be taken offline, or no full dumps at all for
-  areas that can easily be recovered from vendor media.
-* Always doing full dumps, such as database areas that change completely
-  between each run or critical areas that are easier to deal with during an
-  emergency if they are a single-restore operation.
-
-It's easy to support multiple configurations on the same tape server machine,
-such as a periodic archival configuration along side a normal daily
-configuration. Multiple configurations can run simultaneously on the same tape
-server if there are multiple tape drives.
-Scheduling of full dumps is typically left up to Amanda. They are scattered
-throughout the dump cycle to balance the amount of data backed up each run.
-It's important to keep logs of where backup images are for each area (which
-Amanda does for you), since they are not on a specific, predictable, tape
-(e.g., the Friday tape will not always have a full dump of /usr for client A).
-The partial backup level is also left to Amanda. History information about
-previous levels is kept and the backup level automatically increases when
-sufficient dump size savings will be realized.
-Amanda uses a simple tape management system and protects itself from
-overwriting tapes that still have valid dump images and from tapes not
-allocated to the configuration. Images may be overwritten when a client is down
-for an extended period or if not enough tapes are allocated, but only after
-Amanda has issued several warnings. Amanda can also be told to not reuse
-specific tapes.
-A validation program may be used before each run to note potential problems
-during normal working hours when they are easier to correct. An activity report
-is sent via e-mail after each run. Amanda can also send a report to a printer
-and even generate sticky tape labels.
-There is no graphical interface. For administration, there is usually only a
-single simple text file to edit, so this is not much of an issue. For security
-reasons, Amanda does not support user controlled file recovery. There is an
-ftp-like restore utility for administrators to make searching online dump
-catalogues easier when recovering individual files.
-
-Future Capabilities of Amanda
-
-In addition to the usual enhancements and fixes constantly being added by the
-Amanda Core Development Team, three main changes are in various stages of
-development.
-
-* A new internal security framework will make it easier for developers to add
-  other security methods, such as SSH (ftp://ftp.cs.hut.fi/pub/ssh/) and SSL
-  (Secure Socket Layer).
-* Another major project is a redesign of how Amanda runs the client dump
-  program. This is currently hardcoded for a vendor dump program, GNU-tar or
-  SAMBA tar. The new mechanism will allow arbitrary programs such as cpio,
-  star, and possibly other backup systems. It will also add optional pre-dump
-  and post-dump steps that can be used for locking and unlocking, and snapshots
-  of rapidly changing data such as databases or the Windows registry.
-* The third major project is a redesign of the output subsystem to support non-
-  tape media such as CD-ROM, local files, remote files via tools like rcp and
-  ftp, remote tapes, etc. It will also be able to split dump images across
-  media, handle multiple simultaneous media of different types such as writing
-  to multiple tapes or a tape and a CD-ROM, and handle writing copies of images
-  to multiple media such as a tape to keep on site and a CD-ROM or duplicate
-  tape for archiving.
-* In addition, the output format will be enhanced to include a file-1 and a
-  file-n. The idea is to put site-defined emergency recovery tools in file-1
-  (the first file on the output) that can be retrieved easily with standard
-  non-Amanda programs like tar, then use those tools to retrieve the rest of
-  the data. The file-n area is the last file on the output and can contain
-  items such as the Amanda database, which would be complete and up to date by
-  the time file-n is written.
-
-
-Amanda Resources
-
-Amanda may be obtained via the web page http://www.amanda.org or with anonymous
-ftp at ftp://ftp.amanda.org/pub/amanda.A typical release is a gzip compressed
-tar file with a name like amanda-2.4.1.tar.gz, which means it is major version
-2.4 and minor version 1. There are occasional patch releases that have a name
-like amanda-2.4.1p1.tar.gz (release 2.4.1 plus patch set 1). Beta test pre-
-releases have a names like amanda-2.5.0b3.tar.gz (third beta test pre-release
-of 2.5.0).
-Some operating system distributions provide pre-compiled versions of Amanda,
-but because Amanda hardcodes some values into the programs, they may not match
-the configuration. Work is being done to move these values to run-time
-configuration files, but for now Amanda should be built from source.
-The Amanda web page contains useful information about patches not yet part of a
-release, how to subscribe to related mailing lists, and pointers to mailing
-list archives. Subscribe to at least amanda-announce to get new release
-announcements or amanda-users to get announcements plus see problems and
-resolutions from other Amanda users. The amanda-users mailing list is a
-particularly good resource for help with initial setup as well as problems.
-When posting to it, be sure to include the following information:
-
-* Amanda version
-* OS version on the server and client(s)
-* Exact symptoms seen, such as error messages, relevant sections of e-mail
-  reports, debugging and log files
-* Anything unusual or recent changes to the environment
-* A valid return e-mail address
-
-Finally, the docs directory in the release contains several files with helpful
-information, such as a FAQ.
-
-Installing Amanda
-
-After downloading and unpacking the Amanda release, read the README, docs/
-INSTALL, and docs/SYSTEM.NOTES files. They contain important and up-to-date
-information about how to set up Amanda.
-
-Install Related Packages
-
-Several other packages may be required to complete an Amanda install. Before
-continuing, you should locate and install packages your environment will need.
-In particular, consider the following:
-
-
-  GNU-tar 1.12 or later \14 www.gnu.org
-      The GNU version of the standard tar program with enhancements to do
-      partial backups and omit selected files. It is one of the client backup
-      programs Amanda knows how to use.
-
-  Samba 1.9.18p10 or later \14 www.samba.org
-      SAMBA is an implementation of the System Message Block (SMB) protocol
-      used by Windows-based systems for file access. It contains a tool,
-      smbclient, that Amanda can use to back them up.
-
-  Perl 5.004 or later \14 www.perl.org
-      Perl is a scripting programming language oriented toward systems
-      programming and text manipulation. It is used for a few optional Amanda
-      reporting tools and by some tape changers.
-
-  GNU readline 2.2.1 or later \14 www.gnu.org
-      The GNU readline library may be incorporated into interactive programs to
-      provide command-line history and editing. It is built into the Amanda
-      amrecover restoration tool, if available.
-
-  GNU awk 3.0.3 or later \14 www.gnu.org
-      The GNU version of the awk programming language contains a common version
-      across platforms and some additional features. It is used for the
-      optional Amanda amplot statistics tool.
-
-  Gnuplot 3.5 or later \14 ftp://ftp.dartmouth.edu/pub/gnuplot/
-      This gnuplot library (which has nothing to do with the GNU tools, see the
-      accompanying README) is a graph plotting package. It is used for the
-      optional Amanda amplot statistics tool.
-
-Be sure to look in the Amanda patches directory and the patches section on the
-web page for updates to these packages. SAMBA versions before 2.0.3, in
-particular, must have patches applied to make them work properly with Amanda.
-Without the patches, backups appear to work but the resulting images are
-corrupt.
-When Amanda is configured, locations of additional software used on the
-clients, such as GNU-tar and SAMBA, get built into the Amanda programs, so
-additional software must be installed in the same place on the Amanda build
-machine and all the clients.
-
-Perform Preliminary Setup
-
-A typical Amanda configuration runs as a user other than root, such as backup
-or amanda, given just enough permissions to do backups. Often, direct login as
-the user is disallowed. To use the vendor dump program instead of GNU-tar, the
-Amanda user must be in a group with read access to the raw disk devices.
-Membership in this group should be tightly controlled since it opens up every
-file on the client for viewing.
-There are two ways to link Amanda and the raw device group membership. Either
-put the Amanda user in the group that currently owns the raw devices, as the
-primary group or as a secondary, or pick a new group for Amanda and change the
-group ownership of the devices. Amanda (actually, the vendor dump program)
-needs only read access, so turn off group write permission. Turn off all
-"world" access.
-To use GNU-tar, Amanda runs it under a setuid-root program that grants the
-needed permissions. The GNU version of tar must be used with Amanda. Vendor
-supplied versions (unless they originated from GNU and are at least version
-1.12) do not work because Amanda depends on additional features.
-
-Configure the Amanda Build
-
-Use the Amanda user and group for the --with-user and --with-group options to
-./configure. For instance, to use amanda for the user and backup as the group:
-./configure --with-user=amanda --with-group=backup ...
-No other options are required for ./configure, but all the possibilities may be
-seen with ./configure --help. Don't get carried away changing options. The
-defaults are usually suitable and some require experience with Amanda to fully
-understand. Leave --with-debugging enabled so debug log files are created on
-the clients. They take very little space but are often necessary for tracking
-down problems.
-The normal build creates both tape server and client software. The tape server
-host is often backed up by Amanda and needs the client parts. However, the
-clients usually do not need the tape server parts. A little disk space and
-build time may be saved by adding --without-server to the ./configure arguments
-when building for them.
-The default security mechanism uses a file formatted just like .rhosts but
-called .amandahosts. This keeps Amanda operations separate from normal rsh/rcp
-work that might use the same user. It is not recommended, but .rhosts and
-hosts.equiv may be used by adding --without-amandahosts to the ./configure
-arguments.
-The TCP ports used for data transfer may be restricted with --with-portrange to
-use Amanda between hosts separated by a firewall. A typical entry would be: ./
-configure --with-portrange=50000,50100 ... This does not affect the initial UDP
-requests made from the tape server to the clients. The amanda UDP port
-(typically 10080) must be allowed through the firewall.
-If more than just a few ./configure options are used, they may be put in /usr/
-local/share/config.site or /usr/local/etc/config.site to keep them the same
-from build to build. An example is in example/config.site.
-
-Build and Install Amanda
-
-After ./configure is done, run make to build Amanda, then make install to
-install it. The make install step must be done as root because some Amanda
-programs require system privileges. Unless the base location is changed, Amanda
-installs into these areas:
-
-
-  /usr/local/sbin
-      Programs administrators run.
-
-  /usr/local/lib
-      Libraries.
-
-  /usr/local/libexec
-      Private programs only Amanda uses.
-
-  /usr/local/man
-      Documentation.
-
-Now is a good time to read the main Amanda man page. It provides an overview of
-Amanda, a description of each program, and detailed configuration information.
-The following programs must be setuid-root (which make install as root does).
-The first group (amcheck,dumper, and planner) run on the tape server machine
-and need a privileged network port for secure communication with the clients.
-The others are utility routines optionally used on the clients, depending on
-the dump program used and operating system type.
-
-
-  sbin/amcheck
-      Amanda sanity checker program
-
-  libexec/dumper
-      Client communication program
-
-  libexec/planner
-      Estimate gathering program
-
-  libexec/killpgrp
-      Used to kill vendor dump programs that run as root
-
-  libexec/rundump
-      Setuid wrapper for systems that need to run the vendor dump program as
-      root
-
-  libexec/runtar
-      Setuid wrapper to run GNU-tar as root
-
-All these programs are installed with world access disabled and group access
-set to the Amanda group from --with-group. Be sure all members of that group
-are trustworthy since rundump and runtar in particular give access to every
-file on the system. If Amanda software is made available via NFS, be sure the
-mount options allow setuid programs. Also, if GNU-tar is used, root needs write
-access to /usr/local/var/amanda/gnutar-lists (or the --with-gnutar-list value
-to ./configure) to store information about each partial level.
-If the build has trouble or Amanda needs to be rebuilt, especially with
-different ./configure options, the following sequence makes sure everything is
-cleaned up from the previous build: make distclean ./configure ... make make
-install (as root) Problems with the ./configure step can sometimes be diagnosed
-by looking at the config.log file. It contains detailed output of tests ./
-configure runs. Note that it is normal for many of the tests to "fail" as part
-of ./configure determining how to access various features on the system.
-A common problem when using the GNU C compiler is not re-installing it after
-the underlying operating system version changes. Gcc is particularly sensitive
-to system header files and must be re-installed or have its fixincludes step
-rerun (see the gcc release installation notes) if the operating system is
-upgraded. Running gcc --verbose shows where gcc gets its information, and
-contains an indication of the operating system version expected.
-Amanda needs changes to the network services and inetd configuration files. The
-client-src/patch-system script should be able to set up systems in most cases.
-It does not currently handle systems that deliver service entries via YP/NIS.
-If the script does not work, add the following entries to the services file
-(e.g., /etc/services) or YP/NIS map: Amanda 10080/udp Amandaidx 10082/tcp
-Amidxtape 10083/tcp
-Each client needs an entry in the inetd configuration file (e.g., /etc/
-inetd.conf) like this, substituting the Amanda user for Amanda and the full
-path to the Amanda libexec directory for PATH: amanda dgram udp wait Amanda /
-PATH/libexec/amandad amandad
-The amanda service is used by all Amanda controlling programs to perform
-functions on the clients.
-The tape server host needs entries like these if the amrecover tool is to be
-used: amandaidx stream tcp nowait Amanda /PATH/libexec/amindexd amindexd
-amidxtape stream tcp nowait Amanda /PATH/libexec/amidxtaped amidxtaped
-The amandaidx service provides access to the catalogues, while amidxtape
-provides remote access to a tape device. After every inetd configuration file
-change, send a HUP signal to the inetd process and check the system logs for
-errors.
-
-Configuring Amanda
-
-Once installed, Amanda must be configured to your environment.
-
-Decide on a Tape Server
-
-The first thing to decide is what machine will be the Amanda tape server.
-Amanda can be CPU-intensive if configured to do server compression, and almost
-certainly network and I/O-intensive. It does not typically use much real
-memory. It needs direct access to a tape device that supports media with enough
-capacity to handle the expected load.
-To get a rough idea of the backup sizes, take total disk usage (not capacity),
-Usage, and divide it by how often full dumps will be done, Runs. Pick an
-estimated run-to-run change rate, Change. Each Amanda run, on average, does a
-full dump of Usage/Runs. Another Usage/Runs*Change is done of areas that got a
-full dump the previous run, Usage/Runs*Change* is done of areas that got a full
-dump two runs ago, and so on.
-For example, with 100 GB of space in use, a full dump every seven runs (e.g.,
-days) and estimated run-to-run changes (new or altered files) of 5 percent:
-
-         100 GBytes / 7              = 14.3 GB
-         100 GBytes / 7 * 5%         =  0.7 GB
-         100 GBytes / 7 * 5% * 2     =  1.4 GB
-         100 GBytes / 7 * 5% * 3     =  2.1 GB
-         100 GBytes / 7 * 5% * 4     =  2.9 GB
-         100 GBytes / 7 * 5% * 5     =  3.6 GB
-         100 GBytes / 7 * 5% * 6     =  4.3 GB
-                                     = 29.3 GB
-       
-
-If 50 percent compression is expected, the actual amount of tape capacity
-needed for each run, which might be on more than one tape, would be 14.7 GB.
-This is very simplistic, and could be improved with greater knowledge of actual
-usage, but should be close enough to start with. It also gives an estimate of
-how long each run will take by dividing expected capacity by drive speed.
-
-Decide Which Tape Devices to Use
-
-Unix operating systems typically incorporate device characteristics into the
-file name used to access a tape device. The two to be concerned with are
-"rewind" and "compression." Amanda must be configured with the non-rewinding
-tape device, so called because when the device is opened and closed it stays at
-the same position and does not automatically rewind. This is typically a name
-with an n in it, such as /dev/rmt/0n or /dev/nst0. On AIX, it is a name with a
-.1 or .5 suffix.
-Put the Amanda user in the group that currently owns the tape device, either as
-the primary group or as a secondary, or pick a new group for Amanda and change
-the group ownership of the device. Amanda needs both read and write access.
-Turn off all "world" access.
-
-Decide Whether to Use Compression
-
-Dump images may optionally be compressed on the client, the tape server, or the
-tape device hardware. Software compression allows Amanda to track usage and
-make better estimates of image sizes, but hardware compression is more
-efficient of CPU resources. Turn off hardware compression when using software
-compression on the client or server. See the operating system documentation for
-how hardware compression is controlled; on many systems it is done via the
-device file name just like the non-rewinding flag. AIX uses the chdev command.
-
-Decide Where the Holding Space Will Be
-
-If at all possible, allocate some holding disk space for Amanda on the tape
-server. Holding disk space can significantly reduce backup time by allowing
-several dumps to be done at once while the tape is being written. Also, for
-streaming tape devices, Amanda keeps the device going at speed, and that may
-increase capacity. Amanda may be configured to limit disk use to a specific
-value so it can share with other applications, but a better approach is to
-allocate one or more inexpensive disks entirely to Amanda.
-Ideally, there should be enough holding disk space for the two largest backup
-images simultaneously, so one image can be coming into the holding disk while
-the other is being written to tape. If that is not practical, any amount that
-holds at least a few of the smaller images helps. The Amanda report for each
-run shows the size of the dump image after software compression (if enabled).
-That, in addition to the amplot and amstatus tools, may be used to tune the
-space allocated.
-
-Compute Your Dump Cycle
-
- Decide how often Amanda should do full dumps. This is the "dump cycle." Short
-periods make restores easier because there are fewer partials, but use more
-tape and time. Longer periods let Amanda spread the load better but may require
-more steps during a restore.
-Large amounts of data to back up or small capacity tape devices also affect the
-dump cycle. Choose a period long enough that Amanda can do a full dump of every
-area during the dump cycle and still have room in each run for the partials.
-Typical dump cycles are one or two weeks. Remember that the dump cycle is an
-upper limit on how often full dumps are done, not a strict value. Amanda runs
-them more often and at various times during the cycle as it balances the backup
-load. It violates the limit only if a dump fails repeatedly, and issues
-warnings in the e-mail report if that is about to happen.
-By default, Amanda assumes it is run every day. If that is not the case, set
-"runs per cycle" (described below) to a different value. For instance, a dump
-cycle of seven days and runs per cycle of five would be used if runs are done
-only on weekdays.
-Normally, Amanda uses one tape per run. With a tape changer (even the chg-
-manual one), the number of tapes per run may be set higher for extra capacity.
-This is an upper limit on the number of tapes. Amanda uses only as much tape as
-it needs. Amanda does not yet do overflow from one tape to another. If it hits
-end of tape (or any other error) while writing an image, that tape is
-unmounted, the next one is loaded, and the image starts over from the
-beginning. This sequence continues if the image cannot fit on a tape.
-Runs per cycle and tapes per run determine the minimum number of tapes needed,
-called the "tape cycle." To ensure the current run is not overwriting the last
-full dump, one more run should be included. For instance, a dump cycle of two
-weeks, with default runs per cycle of 14 (every day) and default tapes per run
-of one, needs at least 15 tapes (14+1 runs * one tape/run). Using two tapes per
-run needs 30 tapes (14+1 runs * two tapes/run). Doing backups just on weekdays
-with a dump cycle of two weeks, runs per cycle of 10, and two tapes per run
-needs 22 tapes (10+1 runs * two tapes/run).
-More tapes than the minimum should be allocated to handle error situations.
-Allocating at least two times the minimum allows the previous full dump to be
-used if the most recent full dump cannot be read. Allocating more tapes than
-needed also goes back further in time to recover lost files. Amanda does not
-have a limit on the number of tapes in the tape cycle.
-
-Copy and Edit the Default Configuration File
-
-Pick a name for the configuration (the name Daily will be used for the rest of
-this section). Create a directory on the tape server machine to hold the
-configuration files, typically /usr/local/etc/amanda/Daily. Access to this
-directory (or perhaps its parent) should be restricted to the Amanda group or
-even just the Amanda user.
-Each tape assigned to a configuration needs a unique label. For this example,
-we'll use the configuration name, a dash, and a three-digit suffix, Daily-000
-through Daily-999. Do not use blanks, tabs, slashes (/), shell wildcards, or
-non-printable characters.
-Amanda limits network usage so backups do not take all the capacity. This limit
-is imposed when Amanda is deciding whether to perform a dump by estimating the
-throughput and adding that to dumps that are already running. If the value
-exceeds the bandwidth allocated to Amanda, the dump is deferred until enough
-others complete. Once a dump starts, Amanda lets underlying network components
-do any throttling.
-Copy the template example/amanda.conf file to the configuration directory and
-edit it. Full documentation is in the amanda man page. There are many
-parameters, but probably only a few need to be changed. Start with the
-following (some of which are described later):
-
-
-  org
-      This string will be in the Subject line of Amanda e-mail reports.
-
-  mailto
-      Target address for Amanda e-mail reports.
-
-  dumpuser
-      Same as --with-user from ./configure.
-
-  dumpcycle
-      The dump cycle.
-
-  runspercycle
-      The runs per cycle.
-
-  tapecycle
-      The tape cycle.
-
-  runtapes
-      Number of tapes to use per run.
-
-  tapedev
-      The no-rewind tape device if a changer is not being used, or if the
-      manual changer is being used.
-
-  tapetype
-      Type of tape media.
-
-  netusage
-      Network bandwidth allocated to Amanda.
-
-  labelstr
-      A regular expression (grep pattern) used to make sure each tape is
-      allocated to this Amanda configuration. Our example might use Daily-[0-9]
-      [0-9][0-9].
-
-The following parameters probably do not need to be changed, but look at their
-values to know where Amanda expects to find things:
-
-
-  infofile
-      Location of Amanda history database. Older versions of Amanda used this
-      as the base name of a database file. Newer versions use this as a
-      directory name.
-
-  logdir
-      Directory where Amanda logs are stored.
-
-  indexdir
-      Location of optional Amanda catalogue database.
-
-
-Configure the Holding Disk
-
-Define each holding disk in an amanda.conf holdingdisk section. If partitions
-are dedicated to Amanda, set the use value to a small negative number, such as
--10 MB. This tells Amanda to use all but that amount of space. If space is
-shared with other applications, set the value to the amount Amanda may use,
-create the directory and set the permissions so only the Amanda user can access
-it.
-Set a chunksize value for each holding disk. Positive numbers split dumps in
-the holding disk into chunks no larger than the chunksize value. Negative
-numbers are no longer supported. Even though the images are split in the
-holding disk, they are written to tape as a single image. At the moment, all
-chunks for a given image go to the same holding disk.
-Older operating systems that do not support individual files larger than 2GB
-need a chunk size slightly smaller, such as 2000 MB, so the holding disk can
-still be used for very large dump images. Systems that support individual files
-larger than 2 GB should have a very large value, such as 2000 GBytes.
-
-Configure Tape Devices and Label Tapes
-
-Amanda needs to know some characteristics of the tape media. This is set in a
-tapetype section. The example amanda.conf, web page, and amanda-users mailing
-list archives have entries for most common media. Currently, all tapes should
-have the same characteristics. For instance, do not use both 60-meter and 90-
-meter DAT tapes since Amanda must be told the smaller value, and larger tapes
-may be underutilized.
-If the media type is not listed and there are no references to it in the
-mailing list archives, go to the tape-src directory, make tapetype, mount a
-scratch tape in the drive and run ./tapetype NAME DEV where NAME is a text name
-for the media and DEV is the no-rewind tape device with hardware compression
-disabled. This program rewinds the tape, writes random data until it fills the
-tape, rewinds, and then writes random data and tape marks until it fills the
-tape again. This can take a very long time (hours or days). When finished, it
-generates a new tapetype section to standard output suitable for adding to the
-amanda.conf file. Post the results to the amanda-users mailing list so others
-may benefit from your effort.
-When using hardware compression, change the length value based on the estimated
-compression rate. This typically means multiplying by something between 1.5 and
-2.0.
-The length and filemark values are used by Amanda only to plan the backup
-schedule. Once dumps start, Amanda ignores the values and writes until it gets
-an error. It does not stop writing just because it reaches the tapetype length.
-Amanda does not currently use the tapetype speed parameter.
-Once the tapetype definition is in amanda.conf, set the tapetype parameter to
-reference it.
-Without special hardware to mount tapes, such as a robot or stacker, either set
-the tapedev parameter to the no-rewind device name or set up the Amanda chg-
-manual changer. The manual changer script prompts for tape mounts as needed.
-The prompts normally go to the terminal of the person running Amanda, but the
-changer may be configured to send requests via e-mail or to some other system
-logging mechanism.
-To configure the manual changer, set tapedev to the no-rewind tape device and
-set tpchanger to chg-manual. To send tape mount prompts someplace other than
-the terminal, which is necessary if Amanda is run from a cron job, see the
-request shell function comments in changer-src/chg-manual.sh.in.
-Another common tape changer is chg-multi. This script can drive stackers that
-advance to the next tape when the drive is unloaded or it can use multiple tape
-drives on the tape sever machine to emulate a changer. The chg-multi script has
-a configuration file and a state file. Put the path to the configuration file
-in the amanda.conf changerfile parameter. There is a sample in example/chg-
-multi.conf. It has the following keyword/value pairs separated by whitespace:
-
-
-  firstslot
-      Number of the first slot in the device.
-
-  lastslot
-      Number of the last slot in the device.
-
-  gravity
-      Set to 1 if the device is gravity fed and cannot go backwards, otherwise
-      set to 0.
-
-  needeject
-      Set to 1 if the tape needs to be ejected to advance to a new tape,
-      otherwise set to 0.
-
-  multieject
-      Set to 1 if sending multiple ejects causes the changer to advance through
-      the tapes, otherwise set to 0. If set to 1, gravity must also be set to 1
-      because the script currently does not handle carousels that wrap back
-      around to the first tape after the last one. Also, needeject must be set
-      to 0.
-
-  ejectdelay
-      Set to a number of seconds of extra delay after ejecting a tape if it
-      takes a while before the next tape is ready.
-
-  statefile
-      Set to the path to a file chg-multi builds and maintains with the current
-      state of the changer.
-
-  slot
-      Repeat as needed to define all the slots and corresponding tape devices.
-      The first field after slot is the slot number. The next field is the no-
-      rewind tape device name. For changers that have a single tape device,
-      repeat the device name for each slot. To emulate a changer by using
-      multiple tape devices, list a different no-rewind tape device for each
-      slot.
-
-chg-multi may also be used as a framework to write a new changer. Look for XXX
-comments in the script and insert calls to commands appropriate for the device.
-Make any source changes to the changer-src/chg-multi.sh.in file. That file is
-processed by ./configure to generate chg-multi.sh, which turns into chg-multi
-with make. If chg-multi.sh or chg-multi is altered, the changes will be lost
-the next time Amanda is rebuilt.
-A third popular changer is chg-scsi. It can drive devices that have their own
-SCSI interface. An operating system kernel module may need to be installed to
-control such devices, like sst for Solaris, which is released with Amanda, or
-chio, available for various systems. As with chg-multi, set the amanda.conf
-changerfile parameter to the changer configuration file path. There is a sample
-in example/chg-scsi.conf. The initial section has parameters common to the
-entire changer:
-
-
-  number_configs
-      Set to the number of tape drives connected to this changer. The default
-      is 1.
-
-  eject
-      Set to 1 if tape drives need an explicit eject command before advancing
-      to the next tape, otherwise set to 0.
-
-  sleep
-      Set to the number of seconds to wait for a tape drive to become ready.
-
-  changerdev
-      Set to the device path of the changer. This may be set in the amanda.conf
-      file instead of here if preferred. Following the common parameters is a
-      section for each tape device:
-
-  config
-      Set to the configuration number, starting with 0.
-
-  drivenum
-      Set to the tape drive number, usually the same as the configuration
-      number.
-
-  dev
-      Set to the no-rewind device name of the tape drive.
-
-  startuse
-      Set to the number of the first slot served by this drive.
-
-  enduse
-      Set to the number of the last slot served by this drive.
-
-  statfile
-      Set to the path to a file chg-scsi will build and maintain with the
-      current state of this drive.
-
-Test any changer setup with the amtape command. Make sure it can load a
-specific tape with the slot NNN suboption, eject the current tape with eject
-and advance to the next slot with slot next.
-Tapes must be pre-labeled with amlabel so Amanda can verify the tape is one it
-should use. Run amlabel as the Amanda user, not root. For instance:
-
-       
-           # su amanda -c "amlabel Daily Daily-123 slot 123"
-       
-       
-
-
-Configure Backup Clients
-
-After tapes are labeled, pick the first client, often the tape server host
-itself, and the filesystems or directories to back up. For each area to back
-up, choose either the vendor dump program or GNU-tar. Vendor dump programs tend
-to be more efficient and do not disturb files being dumped, but are usually not
-portable between different operating systems. GNU-tar is portable and has some
-additional features, like the ability to exclude patterns of files, but alters
-the last access time for every file backed up and may not be as efficient. GNU-
-tar may also deal with active filesystems better than vendor dump programs, and
-is able to handle very large filesystems by breaking them up by subdirectories.
-Choose the type of compression for each area, if any. Consider turning off
-compression of critical areas needed to bring a machine back from the dead in
-case the decompression program is not available. Client compression spreads the
-load to multiple machines and reduces network traffic, but may not be
-appropriate for slow or busy clients. Server compression increases the load on
-the tape server machine, possibly by several times since multiple dumps are
-done at once. For either, if GNU GNU-zip is used, compression may be set to
-fast for faster but less aggressive compression or best for slower but more
-aggressive compression. Set compression to none to disable software compression
-or use hardware compression.
-Pick or alter an existing dumptype that matches the desired options, or create
-a new one. Each dumptype should reference the global dumptype. It is used to
-set options for all other dumptypes. For instance, to use the indexing
-facility, enable it in the global dumptype and all other dumptypes will inherit
-that value.
-The indexing facility generates a compressed catalogue of each dump image.
-These are useful for finding lost files and are the basis of the amrecover
-program. Long dump cycles or areas with many or very active files can cause the
-catalogues to use a lot of disk space. Amanda automatically removes catalogues
-for images that are no longer on tape.
-Create a file named disklist in the same directory as amanda.conf and either
-copy the file from example/disklist or start a new one. Make sure it is
-readable by the Amanda user. Each line in disklist defines an area to be backed
-up. The first field is the client host name (fully qualified names are
-recommended), the second is the area to be backed up on the client and the
-third is the dumptype. The area may be entered as a disk name, (sd0a), a device
-name, (/dev/rsd0)a, or a logical name, (/usr). Logical names make it easier to
-remember what is being backed up and to deal with disk reconfiguration.
-To set up a Windows client, set the host name to the name of the Unix machine
-running SAMBA and the area to the Windows share name, such as //some-pc/C$.
-Note that Unix-style forward slashes are used instead of Windows-style backward
-slashes.
-Enable Amanda access to the client from the tape server host (even if the
-client is the tape server host itself) by editing .amandahosts (or .rhosts,
-depending on what was set with ./configure) in the Amanda user home directory
-on the client. Enter the fully qualified tape server host name and Amanda user,
-separated by a blank or tab. Make sure the file is owned by the Amanda user and
-does not allow access to anyone other than the owner (e.g. mode 0600 or 0400).
-For Windows clients, put the share password in /etc/amandapass on the SAMBA
-host. The first field is the Windows share name, the second is the clear text
-password and the optional third field is the domain.
-
-Note
-
-This info isn't correct anymore. Please refer to Backup_PC_hosts_using_Samba
-for details on this file.
-Because this file contains clear text passwords, it should be carefully
-protected, owned by the Amanda user and only allow user access. By default,
-Amanda uses SAMBA user backup. This can be changed with --with-samba-user to ./
-configure.
-
-Test and Debug Setup
-
-Test the setup with amcheck. As with all Amanda commands, run it as the Amanda
-user, not root:
-
-       
-           # su amanda -c "amcheck Daily"
-       
-       
-
-Many errors reported by amcheck are described in docs/FAQ or the amcheck man
-page. The most common error reported to the Amanda mailing lists is selfcheck
-request timed out, meaning amcheck was not able to talk to amandad on the
-client. In addition to the ideas in docs/FAQ, here are some other things to
-try:
-
-* Are the Amanda services listed properly in /etc/services or a YP/NIS map? The
-  C program in Figure 4-1 uses the same system call as Amanda to look up
-  entries:
-
-Example 18.1. A C Program to Check the Amanda Service Numbers
-
-       
-           #include <stdio.h>
-           #include <string.h>
-           #include <netdb.h>
-
-           main (
-               int argc,
-               char **argv)
-           {
-               char *pn;
-               char *service;
-               char *protocol = "tcp";
-               struct servent *s;
-               
-               if ((pn = strrchr (*argv, '/')) == NULL) {
-                   pn = *argv;
-               } else {
-                   pn++;
-               } if (argc < 2) {
-                     fprintf (stderr, "usage: %s service [protocol]\n", pn);
-                     return 1;
-               }
-               service = *++argv;
-               if (argc > 2) {
-               protocol = *++argv;
-               }
-               if ((s = getservbyname (service, protocol)) == NULL) {
-                   fprintf (stderr, "%s: %s/%s lookup failed\n", pn,
-                     service, protocol);
-                   return 1;
-               }
-               printf ("%s/%s: %d\n", service, protocol,
-                 (int) ntohs (s->s_port));
-               return 0;
-           }
-       
-       
-
-
-Run it on both the tape server and client and make sure the port numbers match:
-
-       
-           $ cc check-service.c -lnsl -lsocket (Solaris)
-           $ a.out amanda udp
-             amanda/udp: 10080
-           $ a.out amandaidx
-             amandaidx/tcp: 10082
-           $ a.out amidxtape
-             amidxtape/tcp: 10083
-       
-       
-
-
-* Is there a line in the inetd configuration file on the client to start
-  amandad?
-* Was inetd sent a HUP signal after the configuration file was changed?
-* Are there system log messages from inetd about amanda or amandad? For
-  instance, inetd complains if it cannot look up the Amanda services.
-* Is /tmp/amanda/amandad/debug being updated?
-* Is the access time on the amandad executable (ls -lu) being updated? If not,
-  inetd is probably not able to run it, possibly because of an error in the
-  inetd configuration file or a permission problem.
-* Run the amandad program by hand as the Amanda user on the client. It should
-  sit for about 30 seconds, then terminate. Enter the full path exactly as it
-  was given to inetd, perhaps by using copy/paste.
-
-Do not proceed until amcheck is happy with the configuration.
-For initial testing, set the record option to no in the global dumptype, but
-remember to set it back to yes when Amanda goes into normal production. This
-parameter controls whether the dump program on the client updates its own
-database, such as /etc/dumpdates for vendor dump.
-To forget about an individual test run, use amrmtape to remove references to
-the tapes used, then use amlabel to relabel them. To completely start over,
-remove the files or directories named in the infofile and indexdir parameters,
-the tapelist file named in the tapelist parameter, all amdump.* files in the
-configuration directory and all log.* files in the directory named by the
-logdir parameter. These files contain history information Amanda needs between
-runs and also what is needed to find particular dump images for restores and
-should be protected when Amanda goes into production.
-
-Operating Amanda
-
-Once configured, you will need to setup the automated use of Amanda.
-
-Run amdump
-
-The amdump script controls a normal Amanda backup run. However, it's common to
-do site-specific things as well with a wrapper shell script around amdump.
-amdump is meant to run unattended from cron. See the operating system
-documentation for how to set up a cron task. Be sure it runs as the Amanda
-user, not root or the installer.
-The amdump script does the following:
-
-* If a file named hold is in the configuration directory, amdump pauses until
-  it goes away. This may be created and removed by hand to temporarily delay
-  Amanda runs without having to change the cron task.
-* If it looks like another copy of amdump is running, or a previous run
-  aborted, amdump logs an error and terminates. If an earlier run aborted,
-  amcleanup must be run. An amcleanup step should be added to the tape server
-  system boot sequence to handle crashes. No backups can be performed after an
-  abort or crash until amcleanup is run.
-* The Amanda planner program decides what areas to back up and at what level.
-  It does this by connecting to each client and getting estimated sizes of a
-  full dump, the same partial level that was done on the previous run and
-  possibly the next partial level. All clients are done in parallel, but it can
-  take a while to gather all this information.
-* The schedule is then passed to the driver program that controls actual
-  dumping. It, in turn, starts up several dumper processes (based on the
-  inparallel amanda.conf parameter) and a single taper process. The taper
-  process splits into two parts, a reader and a writer, to keep streaming tape
-  drives busy.
-* driver commands dumpers to start backups, telling each its client, area,
-  options such as compression and whether the result should go to the holding
-  disk or direct to tape. Each dumper connects to amandad on the client and
-  sends a request describing the dump program to run and options such as
-  whether to do compression or indexing. The image comes back to the dumper who
-  writes it, possibly via the server compression program, into the holding disk
-  or directly to a taper connection. If enabled, dumper also collects catalogue
-  information generated on the client and compresses it into the indexdir area.
-  The driver also commands taper to write files from the holding disk to tape
-  or to prepare to receive an image directly from a dumper.
-* After backups are done, amreport is run to generate the e-mail report. It
-  also renames the log file for the run to a unique log.YYYYMMDD.N name.
-* Old amdump.NN debug log files are rolled so only enough to match the tape
-  cycle are retained.
-* The amtrmidx program is run to remove old catalogues if indexing has been
-  used.
-
-There are several ways to determine which tapes Amanda will need for a run. One
-is to look at the Amanda e-mail report from the previous run. The tapes used
-during that run and those expected for the next run are listed. Another is to
-run amcheck during normal working hours. In addition to showing which tapes are
-needed, it makes sure things are set up properly so problems can be fixed
-before the real Amanda run. A third is to use the tape suboption of amadmin.
-Without a tape changer, Amanda expects the first tape to be mounted in the
-drive when it starts. Automated tape changers should be able to locate the
-tapes. The chg-manual changer prompts for the tapes.
-
-Read Amanda's Reports
-
-An Amanda report has several sections:
-
-       
-
-
-           These dumps were to tape Daily-009, Daily-010
-           Tonight's dumps should go onto 2 tapes: Daily-011, Daily-012.
-       
-
-       
-This shows which tapes were used during the run and which tapes are needed
-next.
-
-       
-           FAILURE AND STRANGE DUMP SUMMARY:
-             gurgi.cc.p /var lev 0 FAILED [Request to gurgi.cc.purdue.edu timed
-  out.]
-             gurgi.cc.p / lev 0 FAILED [Request to gurgi.cc.purdue.edu timed out.]
-             pete.cc.pu /var/mail lev 0 FAILED ["data write: Broken pipe"]
-             samba.cc.p //nt-test.cc.purdue.edu/F$ lev 1 STRANGE
-             mace.cc.pu /master lev 0 FAILED [dumps too big, but cannot incremental
-  dump new
-             disk]
-       
-       
-
-Problems found during the run are summarized in this section. In this example:
-
-* gurgi.cc.purdue.edu was down, so all its backups failed.
-* The /var/mail problem on pete.cc.purdue.edu and F$ problem on nt-
-  test.cc.purdue.edu are detailed later.
-* The /master area on mace.cc.purdue.edu is new to Amanda so a full dump is
-  required, but it would not fit in the available tape space for this run.
-
-
-       
-           STATISTICS:
-                                        Total            Full         Daily
-                                        --------        --------      --------
-             Dump Time (hrs:min)         5:03            3:23          0:33   (0:14
-  start, 0:53 idle)
-             Output Size (meg)        20434.4         17960.0        2474.4
-             Original Size (meg)      20434.4         17960.0        2474.4
-             Avg Compressed Size (%)      --              --            --
-             Tape Used (%)              137.4           120.0          17.4
-  (level:#disks ...)
-             Filesystems Dumped            90              21            69    (1:
-  64 2:2 3:3)
-             Avg Dump Rate (k/s)       1036.5          1304.3         416.2
-             Avg Tp Write Rate (k/s)   1477.6          1511.2        1271.9
-       
-       
-
-This summarizes the entire run. It took just over five hours, almost 3.5 hours
-writing full dumps and about half an hour for partials. It took 14 minutes to
-get started, mostly in the planner step getting the estimates, and taper was
-idle almost one hour waiting on dumps to come into the holding disk.
-In this example, hardware compression was used so Avg Compressed Size is not
-applicable and Output Size written to tape matches Original Size from the
-clients. About 137% of the length of the tape as defined in the tapetype was
-used (remember that two tapes were written), 120% for full dumps and 17% for
-partials. The Rate lines give the dump speed from client to tape server and
-tape writing speed, all in KBytes per second. The Filesystems Dumped line says
-90 areas were processed, 21 full dumps and 69 partials. Of the partials, 64
-were level 1, two were level 2 and three were level 3.
-
-       
-           FAILED AND STRANGE DUMP DETAILS:
-       
-                /-- pete.cc.pu /var/mail lev 0 FAILED ["data write: Broken
-  pipe"]
-             sendbackup: start [pete.cc.purdue.edu:/var/mail level 0]
-             sendbackup: info BACKUP=/usr/sbin/ufsdump
-             sendbackup: info RECOVER_CMD=/usr/sbin/ufsrestore -f... -
-             sendbackup: info end
-             | DUMP: Writing 32 Kilobyte records
-             | DUMP: Date of this level 0 dump: Sat Jan 02 02:03:22 1999
-             | DUMP: Date of last level 0 dump: the epoch
-             | DUMP: Dumping /dev/md/rdsk/d5 (pete.cc.purdue.edu:/var/mail) to
-  standard output.
-             | DUMP: Mapping (Pass I) [regular files]
-             | DUMP: Mapping (Pass II) [directories]
-             | DUMP: Estimated 13057170 blocks (6375.57MB) on 0.09 tapes.
-             | DUMP: Dumping (Pass III) [directories]
-             | DUMP: Dumping (Pass IV) [regular files]
-             | DUMP: 13.99% done, finished in 1:02
-             | DUMP: 27.82% done, finished in 0:52
-             | DUMP: 41.22% done, finished in 0:42
-       
-             /-- samba.cc.p //nt-test.cc.purdue.edu/F$ lev 1 STRANGE
-             sendbackup: start [samba.cc.purdue.edu://nt-test/F$ level 1]
-             sendbackup: info BACKUP=/usr/local/bin/smbclient
-             sendbackup: info RECOVER_CMD=/usr/local/bin/smbclient -f... -
-             sendbackup: info end
-             ? Can't load /usr/local/samba-2.0.2/lib/smb.conf - run testparm to
-  debug it
-             | session request to NT-TEST.CC.PURD failed
-             |                 directory \top\
-             |                 directory \top\Division\
-             |        238 (    2.7 kb/s) \top\Division\contract.txt
-             |      19456 ( 169.6 kb/s)  \top\Division\stuff.doc
-           ...
-       
-       
-
-Failures and unexpected results are detailed here. The dump of /var/mail would
-not fit on the first tape so was aborted and rerun on the next tape, as
-described further in the next section.
-The dump of F$ on nt-test.cc.purdue.edu failed due to a problem with the SAMBA
-configuration file. It's marked STRANGE because the line with a question mark
-does not match any of the regular expressions built into Amanda. When dumping
-Windows clients via SAMBA, it's normal to get errors about busy files, such as
-PAGEFILE.SYS and the registry. Other arrangements should be made to get these
-safely backed up, such as a periodic task on the PC that creates a copy that
-will not be busy at the time Amanda runs.
-
-       
-           NOTES:
-             planner: Adding new disk j.cc.purdue.edu:/var.
-             planner: Adding new disk mace.cc.purdue.edu:/master.
-             planner: Last full dump of mace.cc.purdue.edu:/src on tape Daily-012
-  overwritten
-                      in 2 runs.
-             planner: Full dump of loader.cc.purdue.edu:/var promoted from 2 days
-  ahead.
-             planner: Incremental of sage.cc.purdue.edu:/var bumped to level 2.
-             taper: tape Daily-009 kb 19567680 fm 90 writing file: short write
-             taper: retrying pete.cc.purdue.edu:/var/mail.0 on new tape: [writing
-  file: short
-                    write]
-             driver: pete.cc.purdue.edu /var/mail 0 [dump to tape failed, will try
-  again]
-             taper: tape Daily-010 kb 6201216 fm 1 [OK]
-       
-       
-
-Informational notes about the run are listed here. The messages from planner
-say:
-
-* There are new disklist entries for j.cc.purdue.edu and mace.cc.purdue.edu.
-* Tape Daily-012 is due to be overwritten in two more runs and contains the
-  most recent full dump of /src from mace.cc.purdue.edu, so the tape cycle may
-  not be large enough.
-* The next scheduled full dump of /var on loader.cc.purdue.edu was moved up two
-  days to improve the load balance.
-* The partial dump of /var on sage.cc.purdue.edu was bumped from level 1 to
-  level 2 because the higher level was estimated to save enough space to make
-  it worthwhile.
-
-The rest of the notes say taper was not able to write as much data as it
-wanted, probably because of hitting end of tape. Up to that point, it had
-written 19567680 KBytes in 90 files on tape Daily-009. Another attempt at the
-full dump of /var/mail from pete.cc.purdue.edu was made on the next tape
-(Daily-010) and it succeeded, writing 6201216 KBytes in one file.
-
-       
-           DUMP SUMMARY:
-       
-                                            DUMPER STATS                   TAPER
-  STATS
-        HOSTNAME  DISK           L   ORIG-KB   OUT-KB COMP%   MMM:SS   KB/
-  s  MMM:SS   KB/s
-        --------------------------- --------------------------------------- ---
-  -----------
-        boiler.cc /              1      2624     2624   --      0:13  200.1
-  0:02 1076.0
-        boiler.cc /home/boiler/a 1       192      192   --      0:07   26.7
-  0:02  118.5
-        boiler.cc /usr           1       992      992   --      0:41   24.2
-  0:02  514.7
-        boiler.cc /usr/local     1       288      288   --      0:09   31.2
-  0:04   86.3
-        boiler.cc /var           1       425     4256   --      0:21  205.9
-  0:04 1104.3
-        egbert.cc /              1     41952    41952   --      1:26  487.3
-  0:37 1149.4
-        egbert.cc /opt           1       224      224   --      0:06   37.5
-  0:02  136.0
-        egbert.cc -laris/install 1        64       64   --      0:11    5.8
-  0:02   49.5
-        gurgi.cc. /              0    FAILED ----------------------------------
-  -----------
-        gurgi.cc. /var           0    FAILED ----------------------------------
-  -----------
-        pete.cc.p /              1     13408    13408   --      0:41  328.2
-  0:08 1600.5
-        pete.cc.p /opt           1      3936     3936   --      1:04   61.2
-  0:03 1382.6
-        pete.cc.p /usr           1      1952     1952   --      0:29   67.0
-  0:03  584.3
-        pete.cc.p /var           1    300768   300768   --      2:33 1963.8
-  2:50 1768.8
-        pete.cc.p /var/mail      0   6201184  6201184   --     73:45 1401.3
-  73:47 1400.8
-
-       ...
-       (brought to you by Amanda version 2.4.1p1)
-       
-       
-
-This section (which has been abbreviated) reports each area dumped showing
-client, area, backup level, sizes, time to dump and time to write to tape.
-Entries are in alphabetic order by client and then by area. This is not the
-same as the tape order. Tape order can be determined with the find or info
-suboption of the amadmin command, amtoc can generate a tape table of contents
-after a run, or amreport can generate a printed listing. By default, client
-names are truncated on the right, area names on the left, to keep the report
-width under 80 character. This typically leaves the unique portions of both.
-Two log files are created during an Amanda run. One is named amdump.NN, where
-NN is a sequence number (1 is most recent, 2 is next most recent, etc), and is
-in the same directory as amanda.conf. The file contains detailed step by step
-information about the run and is used for statistics by amplot and amstatus,
-and for debugging. The other file is named log.YYYYMMDD.N where YYYYMMDD is the
-date of the Amanda run and N is a sequence number in case more than one run is
-made on the same day (0 for the first run, 1 for the second, etc). This file is
-in the directory specified by the logdir amanda.conf parameter. It contains a
-summary of the run and is the basis for the e-mail report. In fact, amreport
-may be run by hand and given an old file to regenerate a report.
-Old amdump.NN files are removed by the amdump script. Old log.YYYYMMDD.N files
-are not automatically removed and should be cleared out periodically by hand.
-Keeping a full tape cycle is a good idea. If the tape cycle is 40 and Amanda is
-run once a day, the following command would do the job:
-
-       
-           #find log.????????.* -mtime +40 -print | xargs rm
-       
-       
-
-If --with-pid-debug-files was used on ./configure, clients accumulate debug
-files in /tmp/amanda (or whatever --with-debug was set to) and should be
-cleaned out periodically. Without this option, client debug files have fixed
-names and are reused from run to run.
-
-Monitor Tape and Holding Disk Status
-
-While amdump is running, amstatus can track how far along it is. amstatus may
-also be used afterward to generate statistics on how many dumpers were used,
-what held things up and so on.
-When a tape error happens on the last tape allowed in a run (as set by
-runtapes), Amanda continues to do backups into the holding disks. This is
-called degraded mode. By default, full dumps are not done and any that were
-scheduled have a partial done instead. A portion of the holding disk area may
-be allocated to do full dumps during degraded mode by reducing the value of the
-parameter reserve in amanda.conf below 100%.
-A tape server crash may also leave images in the holding disks. Run amflush, as
-the Amanda user, to flush images in the holding disk to the next tape after
-correcting any problems. It goes through the same tape request mechanism as
-amdump. If more than one set of dumps are in the holding disk area, amflush
-prompts to choose one to write or to write them all. amflush generates an e-
-mail report just like amdump.
-Operating systems vary in how they report end of tape to programs. A no space
-or short write error probably means end of tape. For I/O error, look at the
-report to see how much was written. If it is close to the expected tape
-capacity, it probably means end of tape, otherwise it means a real tape error
-happened and the tape may need to be replaced the next time through the tape
-cycle.
-To swap out a partially bad tape, wait until it is about to be used again so
-any valid images can still be retrieved. Then swap the tapes, run amrmtape on
-the old tape and run amlabel on the replacement so it has a proper Amanda
-label.
-If a tape is marked to not be reused with the no-reuse suboption of amadmin,
-such as one that has been removed or is failing, Amanda may want a freshly
-labeled tape on the next run to get the number of tapes back up to the full
-tape cycle.
-If a tape goes completely bad, use amrmtape to make Amanda forget about it. As
-with marking a tape no-reuse, this may reduce the number of tapes Amanda has in
-use below the tape cycle and it may request a newly labeled tape on the next
-run.
-
-Adding Tapes at a Particular Position in the Cycle
-
-
-* Run amlabel on the new tapes.
-* Edit the tapelist file by hand and move the new tapes before the tape to be
-  used just ahead of them. For instance, move Daily-100 before Daily-099.
-* Set the date stamp on the new tapes to the same as the previous tape, e.g.
-  make them the same for Daily-099 and Daily-100.
-* Update the tapecycle amanda.conf parameter if new tapes are being added.
-
-These steps let Amanda know about all tapes, including those that do not have
-data yet. When the cycle gets to the last old tape (Daily-099), the next tape
-used will be the first new one (Daily-100). A new option is planned for amlabel
-to do these steps automatically.
-
-Miscellanous Operational Notes
-
-Multiple amdump runs may be made in the same day, although catalogues are
-currently stored without a timestamp so amrecover may not show all restore
-possibilities. To redo a few areas that failed during the normal run, edit the
-disklist file by hand to comment out all the other entries, run amdump, then
-restore the disklist file.
-Use the force suboption of amadmin to schedule a full dump of an area on the
-next run. Run this as the Amanda user, not root. Amanda automatically detects
-new disklist entries and schedules an initial full dump. But for areas that go
-through a major change, such as an operating system upgrade or full restore,
-force Amanda to do a full dump to get things back into sync.
-Amanda does not automatically notice new client areas, so keep the disklist in
-sync by hand. Amanda usually notices areas that are removed and reports an
-error as a reminder to remove the entry from the disklist. Use the delete
-suboption of amadmin (as the Amanda user) to make Amanda completely forget
-about an area, but wait until the information is not needed for restores. This
-does not remove the entry from the disklist file \14 that must be done by hand.
-Non\14Amanda backups may still be done with Amanda installed, but do not let the
-client dump program update its database. For vendor dump programs, this usually
-means not using the u flag, or saving and restoring /etc/dumpdates. For GNU-tar
-it means the --listed-incremental flag (if used) should not point to the same
-file Amanda uses.
-As with all backup systems, verify the resulting tapes, if not each one then at
-least periodically or by random sample. The amverify script does a reasonably
-good job of making sure tapes are readable and images are valid. For GNU-tar
-images, the test is very good. For vendor dump images of the same operating
-system type as the tape server machine, the test is OK but does not really
-check the whole image due to the limited way the catalogue option works. For
-vendor dump images from other operating systems, amverify can tell if the image
-is readable from tape but not whether it is valid.
-Tape drives are notorious for being able to read only what they wrote, so run
-amverify on another machine with a different drive, if possible, so an
-alternate is available if the primary drive fails. Make a copy of the Amanda
-configuration directory on the other machine to be able to run amverify. This
-copy is also a good way to have a backup of the Amanda configuration and
-database in case the tape server machine needs to be recovered.
-
-Advanced Amanda Configuration
-
-Once you have Amanda running for a while, you may choose to do some additional
-advanced configuration.
-
-Adjust the Backup Cycle
-
-Several dumptype parameters control the backup level Amanda picks for a run:
-
-
-  dumpcycle
-      Maximum days between full dumps.
-
-  strategy nofull
-      Never schedule (or run) a full dump.
-
-  strategy incronly
-      Only schedule non-full dumps.
-
-Note that dumpcycle is both a general amanda.conf parameter and a specific
-dumptype parameter. The value in a specific dumptype takes precedence. To
-handle areas that change significantly between each run and should get a full
-dump each time (such as the mail spool on a busy e-mail server or a database
-area), create a dumptype based on another dumptype with attributes changed as
-desired (client dump program, compression, etc) and set dumpcycle in the new
-dumptype to 0:
-
-       
-
-
-           define mail-spool {
-               comp-user-tar
-               dumpcycle 0
-           }
-       
-
-       
-To run full dumps by hand outside of Amanda (perhaps they are too large for the
-normal tape capacity, or need special processing), create a new dumptype and
-set strategy to incronly:
-
-       
-           define full-too-big {
-               comp-user-tar
-               strategy incronly
-           }
-       
-       
-
-Tell Amanda when a full dump of the area has been done with the force suboption
-of amadmin. Take care to do full dumps often enough that the tape cycle does
-not wrap around and overwrite the last good non-full backups.
-To never do full dumps (such as an area easily regenerated from vendor media),
-create a new dumptype and set strategy to nofull:
-
-       
-           define man-pages {
-               comp-user-tar
-               strategy nofull
-           }
-       
-       
-
-Only level 1 backups of such areas are done, so wrapping around the tape cycle
-is not a problem.
-To do periodic archival full dumps, create a new Amanda configuration with its
-own set of tapes but the same disklist as the normal configuration (e.g.
-symlink them together). Copy amanda.conf, setting all dumpcycle values to 0 and
-record to no, e.g. in the global dumptype. If a changer is used, set runtapes
-very high so tape capacity is not a planning restriction. Disable the normal
-Amanda run, or set the hold file as described in "Operating Amanda", so Amanda
-does not try to process the same client from two configurations at the same
-time.
-
-Adjust Parallelism
-
-Amanda starts several dumper processes and keeps as many as possible running at
-once. The following options control their activity:
-
-
-  inparallel
-      Total number of dumpers.
-
-  maxdumps
-      Maximum dumpers for a single client.
-
-The default maxdumps is one, meaning only one dumper is assigned to a client at
-a time. If a client can support the load, increase maxdumps so more than one
-dump on that client is running at once. Note that maxdumps is both a general
-amanda.conf parameter and a specific dumptype parameter. The value in a
-specific dumptype takes precedence.
-Field four of the disklist file is a "spindle number". Areas with the same non-
-negative spindle number are not backed up at the same time if maxdumps is
-greater than one. This prevents thrashing on an individual physical disk. Set
-spindle number to -1 (which is the default) for independent areas that can be
-done in conjunction with any other area, such as a whole physical disk. If the
-tape server has multiple network connections, an amanda.conf interface section
-may be set up for each one and clients allocated to a particular interface with
-field five of the disklist. Individual interfaces take precedence over the
-general netusage bandwidth limit and follow the same guidelines described above
-in "Configuring Amanda": the limit is imposed when deciding whether to start a
-dump, but once a dump starts, Amanda lets underlying network components do any
-throttling.
-Individual Amanda interface definitions do not control which physical
-connection is used. That is left up to the operating system network software.
-While it's common to give an Amanda interface definition the same name as a
-physical connection, e.g. le0, it might be better to use logical names such as
-back-door-atm to avoid confusion.
-The starttime dumptype parameter delays a backup some amount of time after
-Amanda is started. The value is entered as HHMM, so 230, for instance, would
-wait 2.5 hours. This may be used to delay backups of some areas until they are
-known to be idle.
-
-Monitor for Possible Improvements
-
-amstatus may be used to get a summary of dumper activity:
-
-       
-       # su amanda -c "amstatus Daily --file amdump.1 --summary"
-       ...
-        dumper0  busy  :  5:52:01  ( 98.03%)
-        dumper1  busy  :  0:23:09  (  6.45%)
-        dumper2  busy  :  0:13:27  (  3.75%)
-        dumper3  busy  :  0:16:13  (  4.52%)
-        dumper4  busy  :  0:06:40  (  1.86%)
-        dumper5  busy  :  0:03:39  (  1.02%)
-          taper  busy  :  3:54:20  ( 65.26%)
-          0 dumpers busy  :  0:03:21  (  0.93%)            file-too-large:  0:03:21
-  (100.00%)
-       1 dumper  busy  :  4:03:22  ( 67.78%)         no-diskspace:  3:40:55
-  (    90.77%)
-                                                   file-too-large:  0:21:13  ( 
-  8.72%)
-                                                     no-bandwidth:  0:01:13  (  0.50%)
-       2 dumpers busy  :  0:17:33  (  4.89%)         no-bandwidth:  0:17:33
-  (100.00%)
-       3 dumpers busy  :  0:07:42  (  2.14%)         no-bandwidth:  0:07:42
-  (100.00%)
-       4 dumpers busy  :  0:02:05  (  0.58%)         no-bandwidth:  0:02:05
-  (100.00%)
-       5 dumpers busy  :  0:00:40  (  0.19%)         no-bandwidth:  0:00:40
-  (100.00%)
-       6 dumpers busy  :  0:03:33  (  0.99%)             not-idle:  0:01:53
-  (    53.10%)
-                                                       no-dumpers:  0:01:40
-  ( 46.90%)
-       
-       
-
-This says:
-
-* dumper 0 was busy almost all the time.
-* dumper 1 (and above) were not used very much.
-* taper was busy about 2/3 of the total run time.
-* All dumpers were idle less than 1% of the total runtime.
-* One dumper was busy 67.78% of the total run time and the reason two dumpers
-  were not started when one was busy was not enough holding disk space (no-
-  diskspace) 90.77% of that time, the next image to dump was too large to fit
-  in the holding disk at all (file-too-large) 8.72% of that time and network
-  bandwidth was exhausted (no-bandwidth) 0.50% of that time
-
-This configuration would benefit from additional holding disk space, which
-would allow more dumpers to run at once and probably keep taper busy more of
-the time.
-Other common status indicators are:
-
-
-  not-idle
-      Everything is running that can be.
-
-  no-dumpers
-      All dumpers are busy and there are other dumps that could be started.
-
-  client-constrained
-      The maximum number of dumpers for remaining clients are already running,
-      or all spindles are already in use.
-
-  start-wait
-      All remaining dumps are delayed until a specific time of day.
-
-If the tape server machine has multiple tape drives, more than one Amanda
-configuration may run at the same time. Clients and holding disks should be
-assigned to only one configuration, however.
-Amanda waits a fixed amount of time for a client to respond with dump size
-estimates. The default is five minutes per area on the client. For instance, if
-a client has four areas to back up (entries in disklist), Amanda waits at most
-20 minutes for the estimates. During dumping, Amanda aborts a dump if the
-client stops sending data for 30 minutes. Various conditions, such as slow
-clients, which dump program is used and characteristics of the area, may cause
-timeouts. The values may be changed with the amanda.conf etimeout parameter for
-estimates and dtimeout for data. Positive etimeout values are multiplied by the
-number of areas. The absolute value of a negative number is used for the whole
-client regardless of the number of areas.
-
-Excluding Files
-
-GNU-tar can exclude items from the dump image based on file name patterns
-controlled by the dumptype exclude parameter. A single pattern may be put on
-the exclude line itself or multiple patterns may be put in a file on the
-client. The dumptype exclude line in that case includes a list keyword and the
-path to the file.
-Exclusion entries are shell-style wildcard expressions except * matches through
-any number of / characters. If a matched item is a directory, it and all its
-contents are omitted. For instance:
-
-
-  ./usr
-      Omit the usr directory at the top level of the area and everything under
-      it.
-
-  core
-      Omit all items named core.
-
-  */core*
-      Omit all items starting with core, e.g. core, core19970114, corespondent,
-      or corexx/somefile (probably not a good idea).
-
-  */test*.c
-      Omit all items starting with test and ending with .c, e.g. test.c,
-      testing.c or testdir/pgm/main.c (probably not a good idea).
-
-  *.o
-      Omit all items ending with .o.
-
-  */OLD/*
-      Omit all items within directories named OLD, including subdirectories and
-      their contents, but dump the OLD directory entry itself.
-
-
-Restoring with Amanda
-
-Remember that no one cares if you can back up ?only if you can restore.
-
-Configuring and Using amrecover
-
-One way to restore items with Amanda is with amrecover on the client. Before
-amrecover can work, Amanda must run with the dumptype index parameter set to
-yes and the amindexd and amidxtaped services must be installed and enabled to
-inetd, usually on the tape server machine (the default build sequence installs
-them). Also, add the client to .amandahosts (or .rhosts) for the Amanda user on
-the server machine. Since amrecover must run as root on the client, the entry
-must list root as the remote user, not the Amanda user. amrecover should not be
-made setuid-root because it would open up catalogues of the entire system to
-everyone.
-For this example, user jj has requested two files, both named molecule.dat, in
-subdirectories named work/sample-21 and work/sample-22 and said they want the
-versions last modified on the 13th of January. Become root on the client, cd to
-the area and start amrecover:
-
-       
-         $ su
-         Password:
-         # cd ~jj
-         # amrecover Daily
-         AMRECOVER Version 2.4.1p1.
-         Contacting server on amanda.cc.purdue.edu ...
-         220 amanda Amanda index server (2.4.1p1) ready.
-         200 Access OK
-         Setting restore date to       today (1999-01-18)
-         200 Working date set to 1999-01-18.
-         200 Config set to Daily.
-         200 Dump host set to pete.cc.purdue.edu.
-         $CWD '/home/pete/u66/jj' is on disk '/home/pete/u66' mounted at '/home/
-  pete/u66'.
-         200 Disk set to /home/pete/u66.
-         amrecover>
-       
-       
-
-At this point, a command line interface allows browsing the image catalogues.
-Move around with the cd command, see what is available with ls, change date
-with setdate, add files and directories to the extraction list with add and so
-on. The extract command starts actual recovery:
-
-       
-             amrecover> setdate ---14
-             200 Working date set to 1999-01-14.
-             amrecover> cd work/sample-21
-             /home/pete/u66/jj/work/sample-21
-             amrecover> add molecule.dat
-             Added /jj/work/sample-21/molecule.dat
-             amrecover> cd ../sample-22
-             /home/pete/u66/jj/work/sample-22
-             amrecover> add molecule.dat
-             Added /jj/work/sample-22/molecule.dat
-             amrecover> extract
-             Extracting files using tape drive /dev/rmt/0mn on host
-  amanda.cc.purdue.edu.
-             The following tapes are needed: Daily-034
-
-             Restoring files into directory /home/pete/u66
-             Continue? [Y/n]: y
-
-             Load tape Daily-034 now
-             Continue? [Y/n]: y
-             Warning: ./jj: File exists
-             Warning: ./work: File exists
-             Warning: ./work/sample-21: File exists
-             Warning: ./work/sample-22: File exists
-             set owner/mode for '.'? [yn] n
-             amrecover> quit
-       
-       
-
-amrecover finds which tapes contain the images, prompts through mounting them
-in the proper order, searches the tape for the image, optionally decompresses
-it, brings it across the network to the client and pipes it into the
-appropriate restore program with the arguments needed to extract the requested
-items. amrecover does not know how to run every client restore program. See the
-amrecover manpage for current information. amrecover should not be used to do
-full filesystem recovery with vendor restore tools, but does work with GNU-tar.
-Vendor tools should be run with the r flag for a full recovery and amrecover is
-oriented toward extracting individual items with the x flag. Full filesystem
-recovery with vendor restore should be done with amrestore. amrecover (actually
-the amidxtaped server) does not know about tape changers, so mount the tapes by
-hand or use amtape if a changer is available.
-
-Using amrestore
-
-The amrestore command retrieves whole images from tape. First, find which tapes
-have the desired images. The find suboption of amadmin generates output like
-this (abbreviated):
-
-       
-           # su amanda -c "amadmin Daily find pete u66"
-           Scanning /amanda...
-
-           date       host                 disk              lv tape or file   file
-  status
-           ...
-           1999-01-12 pete.cc.purdue.edu   /home/pete/u66    1  Daily-032        14
-  OK
-           1999-01-13 pete.cc.purdue.edu   /home/pete/u66    1  Daily-033        26
-  OK
-           1999-01-14 pete.cc.purdue.edu   /home/pete/u66    1  Daily-034        40
-  OK
-           1999-01-15 pete.cc.purdue.edu   /home/pete/u66    1  Daily-000        34
-  OK
-           1999-01-16 pete.cc.purdue.edu   /home/pete/u66    1  Daily-001        31
-  OK
-           1999-01-17 pete.cc.purdue.edu   /home/pete/u66    0  Daily-002        50
-  OK
-           1999-01-18 pete.cc.purdue.edu   /home/pete/u66    1  Daily-003        20
-  OK
-       
-       
-
-The Scanning /amanda... message says amadmin looked in the holding disk (/
-amanda) for any images left there. It then lists all tapes or files in the
-holding disk that contain the requested area.
-The info suboption to amadmin shows tapes with the most recent images:
-
-       
-           # su amanda -c "amadmin Daily info pete u66"
-           Current info for pete.cc.purdue.edu /home/pete/u66:
-           Stats: dump rates (kps), Full:  652.0, 648.0, 631.0
-                             Incremental:  106.0, 258.0, 235.0
-                   compressed size, Full: -100.0%,-100.0%,-100.0%
-                             Incremental: -100.0%,-100.0%,-100.0%
-           Dumps: lev datestmp  tape             file   origK   compK secs
-                   0  19990117  Daily-002          50  582239  582272  892
-                   1  19990118  Daily-003          20    3263    3296   31
-                   2  19981214  Daily-032          21    7039    7072   37
-       
-       
-
-Old information may appear, such as 19981214 (14-Dec-1998) in this example.
-While it's true this was the last level 2 dump of this area, it is of little
-interest because at least one full and level 1 dump have been done since then.
-The compressed size values here may be ignored because this particular
-configuration uses hardware compression so no software compression data are
-available.
-A third way to know what tape has an image is to generate a tape table of
-contents with amtoc after each Amanda run:
-
-       
-           #  partition                        lvl  size[Kb]  method
-           0  Daily-002                          -         -  19990117
-           1  boiler.cc.purdue.edu:/usr/local    1        31  normal
-           2  egbert.cc.purdue.edu:/opt          1       127  normal
-           3  boiler.cc.purdue.edu:/usr          1        95  normal
-          ...
-          50 pete.cc.purdue.edu:/home/pete/u66   0    582239  normal
-          ...
-       
-       
-
-A printed report similar to the amtoc output may be automatically generated by
-amreport for each run with the lbl-templ tapetype parameter in amanda.conf
-using the example/3hole.ps template.
-The find and info suboptions to amadmin need the Amanda log files and database.
-These are not usually large amounts of information and a copy should be pushed
-after each amdump run to an alternate machine that also has the Amanda tape
-server software installed so they are available if the primary tape server
-machine dies. Tools like rdist (ftp://usc.edu/pub/rdist/) or rsync (ftp://
-samba.anu.edu.au/pub/rsync/) are useful.
-If Amanda was built using --with-db=text (the default), the database is stored
-in a set of text files under the directory listed in the infofile amanda.conf
-parameter. Here is the file that matches the above info amadmin output:
-
-       
-           # cd /usr/local/etc/amanda/Daily/curinfo
-           # cat pete.cc.purdue.edu/_home_pete_u66/info
-           version: 0
-           command: 0
-           full-rate: 652.000000 648.000000 631.000000
-           full-comp:
-           incr-rate: 106.000000 258.000000 235.000000
-           incr-comp:
-           stats: 0 582239 582272 892 916549924 50 Daily-002
-           stats: 1 3263 3296 31 916637269 20 Daily-003
-           stats: 2 7039 7072 37 913614357 21 Daily-032
-           //
-       
-       
-
-The first field of each stats line is the dump level. The last field is the VSN
-and the field just before it is the tape file number. The field with the large
-number just before that is a Unix epoch time value, which may be converted to
-text with this Perl script:
-
-       
-           $ cat epoch.pl
-           #!/usr/local/bin/perl
-           use warnings;
-           use strict;
-           require 'ctime.pl';
-           foreach (@ARGV) {
-             s/,//;
-             if (m/[a-fA-FxX]/) {
-               unless (m/^0[xX]/) {
-                 $_ = '0x' . $_;
-               }
-               $_ = oct;
-             }
-             print &ctime ($_);
-           }
-           exit (0);
-           $ epoch.pl 916549924
-           Sun Jan 17 0:12:04 US/East-Indiana 1999
-       
-       
-
-Prepositioning the tape to the image with mt fsf may significantly reduce the
-time needed to do a restore. Some media contain an index for very fast file
-searching compared to the one file at a time scanning done by amrestore. Each
-tape location method listed above also shows the tape file. Use that number
-with mt fsf after a rewind to position to a particular image.
-amrestore takes client, area and date stamp patterns as optional arguments to
-search for matching images. Each argument is a grep-style regular expression,
-so multiple images may match. This also means an image may need a specific
-pattern. For instance:
-
-       
-           # amrestore $TAPE pete /
-       
-       
-
-finds not just the root area for the pete client, but images for any client
-with pete someplace in the hostname and a slash anywhere in the area name.
-Assuming only one client matches pete, the following gets just the root area:
-
-       
-           # amrestore $TAPE pete '^/$'
-       
-       
-
-The up arrow (caret) at the beginning says the pattern must start with this
-string. The dollar sign at the end says it must end there. The quote marks
-around the pattern protect the special characters from shell expansion.
-Without flags, amrestore finds every matching image, uncompresses it if needed
-and creates a disk file in the current working directory with a name made up of
-the client, area and dump level. These images may be used directly by the
-client restore program.
-amrestore may be used to generate a tape table of contents by giving it a host
-pattern that cannot match:
-
-       
-           # mt rewind
-           # amrestore $TAPE no.such.host
-       
-       
-
-As it searches in vain for no.such.host it reports images that are skipped:
-
-       
-           amrestore: 0: skipping start of tape: date 19990117 label Daily-002
-           amrestore: 1: skipping boiler.cc.purdue.edu._.19990117.1
-           amrestore: 2: skipping egbert.cc.purdue.edu._opt.19990117.1
-           amrestore: 3: skipping boiler.cc.purdue.edu._.19990117.1
-           ...
-       
-       
-
-For large images, the p flag writes the first match to standard output, which
-may then be piped into the client restore program. This flag is also useful for
-moving an image across the network. For instance, here is one way to restore a
-file directly from the tape server (amanda.cc.purdue.edu) while logged in to
-the client:
-
-       
-           # rsh -n amanda.cc.purdue.edu amrestore -p $TAPE pete
-       ?'^/$? ' \ | gtar xf - ./the-file
-       
-       
-
-Tell vendor restore programs to use a small blocking factor to handle the
-arbitrary size chunks of data available through a pipeline:
-
-       
-           # rsh -n amanda.cc.purdue.edu amrestore -p $TAPE pete u66 \ |
-           ufsrestore -ivbf 2 -
-       
-       
-
-
-Restoring Without Amanda
-
-The Amanda tape format is deliberately simple and restoring data can be done
-without any Amanda tools if necessary. The first tape file is a volume label
-with the tape VSN and date it was written. It is not in ANSI VOL1 format, but
-is plain text. Each file after that contains one image using 32 KByte blocks.
-The first block is an Amanda header with client, area and options used to
-create the image. As with the volume label, the header is not in ANSI format,
-but is plain text. The image follows, starting at the next tape block, until
-end of file.
-To retrieve an image with standard Unix utilities if amrestore is not
-available, position the tape to the image, then use dd to read it:
-
-       
-           # mt rewind
-           # mt fsf NN
-           # dd if=$TAPE bs=32k skip=1 of=dump_image
-       
-       
-
-The skip=1 option tells dd to skip over the Amanda file header. Without the of=
-option, dd writes the image to standard output, which can be piped to the
-decompression program, if needed, and then to the client restore program.
-Since the image header is text, it may be viewed with:
-
-       
-           # mt rewind
-           # mt fsf NN
-           # dd if=$TAPE bs=32k count=1
-       
-       
-
-In addition to describing the image, it contains text showing the commands
-needed to do a restore. Here's a typical entry for the root filesystem on
-pete.cc.purdue.edu. It is a level 1 dump done without compression using the
-vendor ufsdump program:
-
-       
-       
-             Amanda: FILE 19981206 pete.cc.purdue.edu / lev 1
-             comp N program /usr/sbin/ufsdump
-       
-       
-       
-
-To restore, position the tape at start of file and run:
-
-       
-           # dd if=$TAPE bs=32k skip=1 | /usr/sbin/ufsrestore -f... -
-       
-       
-
-As with any backup system, test these procedures while in normal production so
-the principles and techniques are familiar when disaster strikes.
-
-Note
-
-Refer to http://www.amanda.org/docs/using.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                           Up                     Next
-Part IV. Various Information  Home  Chapter 19. Amanda FAQ
-
diff --git a/docs/various.txt b/docs/various.txt
deleted file mode 100644 (file)
index 72ade71..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-
-Part IV. Various Information
-Prev                    Next
-
--------------------------------------------------------------------------------
-
-
-Part IV. Various Information
-
-
-
-Additional information about Amanda
-
-Here you find various other documents like the Amanda FAQ, the Top Ten
-Questions and the Amanda-Wishlist. You can also find the last Amanda-Survey in
-here (although it still needs formatting ... sorry, Jon ...). The latest
-addition is the "famous" Amanda-chapter by John R. Jackson.
-Table of Contents
-
-
-  18._Using_Amanda
-
-
-        An_Introduction
-
-        Amanda_Features
-
-        Future_Capabilities_of_Amanda
-
-        Amanda_Resources
-
-        Installing_Amanda
-
-
-              Install_Related_Packages
-
-              Perform_Preliminary_Setup
-
-              Configure_the_Amanda_Build
-
-              Build_and_Install_Amanda
-
-              Configuring_Amanda
-
-              Decide_on_a_Tape_Server
-
-              Decide_Which_Tape_Devices_to_Use
-
-              Decide_Whether_to_Use_Compression
-
-              Decide_Where_the_Holding_Space_Will_Be
-
-              Compute_Your_Dump_Cycle
-
-              Copy_and_Edit_the_Default_Configuration_File
-
-              Configure_the_Holding_Disk
-
-              Configure_Tape_Devices_and_Label_Tapes
-
-              Configure_Backup_Clients
-
-              Test_and_Debug_Setup
-
-
-        Operating_Amanda
-
-
-              Run_amdump
-
-              Read_Amanda's_Reports
-
-              Monitor_Tape_and_Holding_Disk_Status
-
-              Adding_Tapes_at_a_Particular_Position_in_the_Cycle
-
-              Miscellanous_Operational_Notes
-
-
-        Advanced_Amanda_Configuration
-
-
-              Adjust_the_Backup_Cycle
-
-              Adjust_Parallelism
-
-              Monitor_for_Possible_Improvements
-
-              Excluding_Files
-
-
-        Restoring_with_Amanda
-
-
-              Configuring_and_Using_amrecover
-
-              Using_amrestore
-
-              Restoring_Without_Amanda
-
-
-
-  19._Amanda_FAQ
-
-  20._Collection_of_the_top_ten_Amanda_questions._And_answers.
-
-
-        Reason_for_starting_this_list.
-
-        the_DLE-question
-
-        the_localhost-question
-
-        the_friday-tape-question
-
-        the_multiple-dumps-question
-
-        the_mailing-list-question
-
-        the_distro-question
-
-        the_index-question
-
-        the_tapetype-questions
-
-        the_size-question
-
-        the_GUI-question
-
-        the_holding-disk_question
-
-        ...
-
-
-  21._Amanda_WISHLIST
-
--------------------------------------------------------------------------------
-
-Prev                                                                 Next
-Chapter 17. How to use different auth with Home  Chapter 18. Using Amanda
-Amanda 
-
diff --git a/docs/vtape-api.txt b/docs/vtape-api.txt
deleted file mode 100644 (file)
index cef7c29..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-
-         Chapter 27. Virtual Tape API
-Prev  Part V. Technical Background  Next
-
--------------------------------------------------------------------------------
-
-Chapter 27. Virtual Tape API
-
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-The upper level Amanda code (including some of the other tape_xxx routines)
-calls the following routines which implement a virtual tape table:
-
-* int tape_access(filename, mode) Acts like access(2) on possibly virtual
-  devices
-* int tape_open(filename, mode) Acts like open(2) on possibly virtual devices
-* int tape_stat(filename, buf) Acts like stat(2) on possibly virtual devices
-* int tapefd_close(tapefd) Acts like close(2) on possibly virtual devices
-* int tapefd_fsf(tapefd, count) Forward skips the (possibly virtual) device.
-* int tapefd_read(tapefd, buffer, count) Reads a block from the (possibly
-  virtual) device.
-* int tapefd_rewind(tapefd) Reads a block from a (possibly virtual) device.
-* void tapefd_resetofs(tapefd) Uses lseek() tricks to reset the write/read
-  offset counter on a virtual tape device.
-* int tapefd_unload(tapefd) Unloads the media from a (possibly virtual) device.
-* int tapefd_status(tapefd) pr- ints status of the (possibly virtual) device to
-  standard output.
-* int tapefd_weof(tapefd, count) writes a filemark/moves to the next file on a
-  device for writing.
-* int tapefd_write(tapefd, buffer, count) writes a block of data to a (possibly
-  virtual) device.
-
-For a tape type xxx, the following routines must be provided, and entered -
-into the table "vtable" in tape-src/tapeio.c:
-
-* int xxx_tape_access(filename, mode)
-* int xxx_tape_open(filename, mode)
-* int xxx_tape_stat(filename, buf)
-* int xxx_tapefd_close(xxx_tapefd)
-* int xxx_tapefd_fsf(xxx_tapefd, count)
-* int xxx_tapefd_read(xxx_tapefd, buffer, count)
-* int xxx_tapefd_rewind(xxx_tapefd)
-* void xxx_tapefd_resetofs(xxx_tapefd)
-* int xxx_tapefd_unload(xxx_tapefd)
-* int xxx_tapefd_status(xxx_tapefd)
-* int xxx_tapefd_weof(xxx_tapefd, count)
-* int xxx_tapefd_write(xxx_tapefd, buffer, count)
-
-Along with a prefix string which will identify the type. The initial vtape
-layer has two types "plain" and "rait" (Redundant Array of Inexpensive Tapes)
-but we hope to add a "rmt" (remote tape client), and possibly "dvd" types soon.
-
-Note
-
-Refer to http://www.amanda.org/docs/vtape-api.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                              Up                                     Next
-Chapter 26. Amanda Security API  Home  Chapter 28. Using Kerberos with Amanda
-
diff --git a/docs/whatwasnew.txt b/docs/whatwasnew.txt
deleted file mode 100644 (file)
index e3c4f71..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-
-      Chapter 31. What once was new
-Prev  Part VI. Historical files  Next
-
--------------------------------------------------------------------------------
-
-Chapter 31. What once was new
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion, Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  What's_new_in_Amanda_2.3
-
-
-        Indexing_backups_for_easier_restore
-
-        Samba_Support
-
-        GnuTar_Support
-
-        Multiple_backups_in_parallel_from_one_client_host
-
-        Multiple_tapes_in_one_run
-
-        Bottleneck_determination
-
-        2_Gb_limit_removed
-
-        amadmin_import/export
-
-
-  What's_new_in_Amanda_2.2
-
-
-        Client_side_setup_has_changed
-
-        Version_suffixes_on_executables
-
-        Kerberos
-
-        Multiple_holding_disks
-
-        Remote_self-checks
-
-        mmap_support
-
-        gzip_support
-
-        Mount_point_names_in_disklist
-
-        Initial_tape-changer_support_included
-
-        Generic_tape_changer_wrapper_script
-
-        New_command_amtape
-
-        Changer_support_added_to_command_amlabel
-
-        Tape_changer_support_improved
-
-        A_few_words_about_multi-tape_runs
-
-        Big_planner_changes
-
-        Level-0_dumps_allowed_with_no_tape
-
-
-
- What's new in Amanda 2.3
-
-This document contains notes on new features in Amanda 2.3 that may not yet be
-fully documented elsewhere.
-
- Indexing backups for easier restore
-
-Read more about this in the file named Indexing_with_Amanda.
-
- Samba Support
-
-Read more about this in the file named Backup_PC_hosts_using_Samba.
-
- GnuTar Support
-
-Amanda now supports dumps made via GnuTAR. To use this, set your dumptypes set
-the program name to "GNUTAR":
-
-  dumptype tar-client {
-  ....
-  program "GNUTAR"
-  }
-       
-
-Since Gnu TAR does not maintain a dumpdates file itself, nor give an estimate
-of backup size, those need to be done within Amanda. Amanda maintains an /etc/
-amandates file to track the backup dates analogously to how dump does it.
-NOTE: if your /etc directory is not writable by your dumpuser, you'll have to
-create the empty file initially by hand, and make it writable by your dumpuser
-ala /etc/dumpdates.
-NOTE: Since tar traverses the directory hierarchy and reads files as a regular
-user would, it must run as root. The two new Amanda programs calcsize and
-runtar therefore must be installed setuid root. I've made them as simple as
-possible to to avoid potential security holes.
-
- Multiple backups in parallel from one client host
-
-A new "maxdumps" parameter for the conf file gives the default value for the
-amount of parallelism per client:
-
-  maxdumps 2 # default max num. dumps to do in parallel per client
-       
-
-If this default parameter is not specified, the default for the default :-0 is
-1. Then, you can override the parameter per client through the dumptype, eg:
-
-  dumptype fast-client {
-  ....
-  maxdumps 4
-  }
-       
-
-If the "maxdumps" parameter isn't given in the dumptypes, the default is used.
-The idea is that maxdumps is set roughly proportional to the speed of the
-client host. You probably wont get much benefit from setting it very high, but
-all but the slowest hosts should be able to handle a maxdumps of at least 2.
-Amanda doesn't really have any per-host parameters, just per-disk, so the per-
-client-host maxdumps is taken from the last disk listed for that host.
-Just to make things more complicated, I've added the ability to specify a
-"spindle number" for each filesystem in the disklist file. For example:
-
-          wiggum /        fast-comp-user  0
-          wiggum /usr     fast-comp-user  0
-          wiggum /larry   fast-comp-user  1
-          wiggum /curly   fast-comp-user  1
-          wiggum /moe     fast-comp-user  1
-          wiggum /itchy   fast-comp-user  2
-          wiggum /scratchy fast-comp-user 3
-       
-
-The spindle number represents the disk number, eg every filesystem on sd0 can
-get a spindle number of 0, everything on sd1 gets spindle 1, etc (but there's
-no enforced requirement that there be a match with the underlying hardware
-situation). Now, even with a high maxdumps, Amanda will refrain from scheduling
-two disks on the same spindle at the same time, which would just slow them both
-down by adding a lot of seeks.
-The default spindle if you don't specify one is -1, which is defined to be a
-spindle that doesn't interfere with itself. That is if you don't specify any
-spindle numbers, any and all filesystems on the host can be scheduled
-concurrently up to the maxdumps.
-Just to be clear, there's no relation between spindle numbers and maxdumps:
-number the spindles by the disks that you have, even if that's more than
-maxdumps.
-Also, I'm not sure that putting spindle numbers everywhere is of much value:
-their purpose is to prevent multiple big dumps from being run at the same time
-on two partitions on the same disk, on the theory that the extra seeking
-between the partitions would cause the dumps to run slower than they would if
-they ran sequentially. But, given the client-side compression and network
-output that must occur between blocks read from the disk, there may be enough
-slack time at the disk to support the seeks and have a little parallelism left
-over to do some good.
-
- Multiple tapes in one run
-
-I've rewritten the taper - it now supports one run spanning multiple tapes if
-you have a tape-changer. The necessary changes in support of this have also
-been made to driver and reporter - planner already had support. There are a
-couple other places that should probably be updated, like amcheck. Dumps are
-not split across tapes - when taper runs into the end of a tape, it loads the
-next tape and tells driver to try sending the dump again.
-If you are feeling brave, set "runtapes" to something other than 1.
-The new taper also keeps the tape open the entire time it is writing the files
-out - no more having amchecks or other accesses/rewinds in the middle of the
-run screw you royally if they hit when the tape is closed for writing a
-filemark.
-
- Bottleneck determination
-
-I've made some experimental changes to driver to determine what the bottleneck
-is at any time. Since Amanda tries to do many things at once, it's hard to
-pinpoint a single bottleneck, but I "think" I've got it down well enough to say
-something useful. For now it just outputs the current bottleneck as part of its
-"driver: state" line in the debug output, but once I'm comfortable with its
-conclusions, I'll output it to the log file and have the reporter generate a
-nice table. The current choices are:
-
-* not-idle - if there were dumps to do, they got done
-* no-dumpers - there were dumps to do but no dumpers free
-* no-hold - there were dumps to do and dumpers free but the dumps
-* couldn't go to the holding disks (no-hold conf flag)
-* no-diskspace - no diskspace on holding disks
-* no-bandwidth - ran out of bandwidth
-* client-constrained - couldn't start any dumps because the clients were busy
-
-
- 2 Gb limit removed
-
-I've fixed the 2-gig limits by representing sizes in Kbytes instead of bytes
-everywhere. This gives us a new 2 TB dump-file size limit (on 32bit machines),
-which should last us a couple more years. This seemed preferable to me than
-going to long-long or some other non-portable type for the size.
-
- amadmin import/export
-
-amadmin now has "import" and "export" commands, to convert the curinfo database
-to/from text format, for: moving an Amanda server to a different arch,
-compressing the database after deleting lots of hosts, or editing one or all
-entries in batch form or via a script.
-
- What's new in Amanda 2.2
-
-
-Note
-
-Here's the old 2.2.x stuff from this file. I'm pretty sure most of this is in
-the mainline documentation already.
-This document contains notes on new features in Amanda 2.2 that may not yet be
-fully documented elsewhere.
-
- Client side setup has changed
-
-The new /etc/services lines are:
-
-  amanda       10080/udp               # bsd security Amanda daemon
-  kamanda      10081/udp               # krb4 security Amanda daemon
-
-The new /etc/inetd.conf lines are:
-
-  amanda  dgram udp wait /usr/local/libexec/amanda/amandad amandad
-  kamanda dgram udp wait /usr/local/libexec/amanda/amandad amandad -krb4
-
-(you don't need the vanilla Amanda lines if you are using kerberos for
-everything, and vice-versa)
-
- Version suffixes on executables
-
-The new USE_VERSION_SUFFIXES define in options.h controls whether to install
-the Amanda executables with the version number attached to the name, eg
-"amdump-2.2.1". I recommend that you leave this defined, since this allows
-multiple versions to co-exist - particularly important while Amanda 2.2 is
-under development. You can always symlink the names without the version suffix
-to the version you want to be your "production" version.
-
- Kerberos
-
-Read the comments in Using_Kerberos_with_Amanda for how to configure the
-kerberos version. With KRB4_SECURITY defined, there are two new dumptype
-options:
-
-*
-    krb4-auth  # use krb4 auth for this host
-               # (you can mingle krb hosts & bsd .rhosts in one conf)
-       
-
-*
-    kencrypt   # encrypt this filesystem over the net using the krb4
-               # session key.  About 2x slower.  Good for those root
-               # partitions containing your keyfiles.  Don't want to
-               # give away the keys to an ethernet sniffer!
-       
-
-
-
- Multiple holding disks
-
-You can have more than one holding disk for those really big installations.
-Just add extra diskdir and disksize lines to your amanda.conf:
-
-Note
-
-sgw: This is OLD syntax now ...
-
-       diskdir "/Amanda2/Amanda/work"  # where the holding disk is
-       disksize 880 MB                 # how much space can we use on it
-
-       diskdir "/dumps/Amanda/work"    # a second holding disk!
-       disksize 1500 MB
-       
-
-Amanda will load-balance between the two disks as long as there is space.
-Amanda now also actually stats files to get a more accurate view of available
-and used disk space while running.
-
- Remote self-checks
-
-amcheck will now cause self-checks to run on the client hosts, quickly
-detecting which hosts are up and communicating, which have permissions
-problems, etc. This is amazingly fast for what it does: here it checks more
-than 130 hosts in less than a minute. My favorite gee-whiz new feature! The new
--s and -c options control whether server-only or client-only checks are done.
-
- mmap support
-
-System V shared memory primitives are no longer required on the server side, if
-your system has a version of mmap() that will allocate anonymous memory. BSD
-4.4 systems (and OSF/1) have an explicitly anonymous mmap() type, but others
-(like SunOS) support the trick of mmap'ing /dev/zero for the same effect.
-Amanda should work with both varieties.
-Defined HAVE_SYSVSHM or HAVE_MMAP (or both) in config.h. If you have both,
-SYSVSHM is selected (simply because this code in Amanda is more mature, not
-because the sysv stuff is better).
-
- gzip support
-
-This was most requested feature #1; I've finally slipped it in. Define
-HAVE_GZIP in options.h. See options.h-vanilla for details. There are two new
-amanda.conf dumptype options "compress-fast" and "compress-best". The default
-is "compress-fast". With gzip, compress-fast seems to always do better than the
-old lzw compress (in particular it will never expand the file), and runs faster
-too. Gzip's compress-best does very good compression, but is about twice as
-slow as the old lzw compress, so you don't want to use it for filesystems that
-take a long time to full-dump anyway.
-
- Mount point names in disklist
-
-Most requested feature #2: You can specify mount names in the disklist instead
-of dev names. The rule is, if the filesystem name starts with a slash, it is a
-mount point name, if it doesn't, it is a dev name, and has DEVDIR prepended.
-For example:
-
-       obelix  sd0a            # dev-name: /dev/sd0a
-       obelix  /obelix         # mount name: /obelix, aka /dev/sd0g
-       
-
-
- Initial tape-changer support included
-
-A new amanda.conf parameter, tpchanger, controls whether Amanda communicates
-with a tape changer program to load tapes rather than just opening the tapedev
-itself. The tpchanger parameter is a string which specifies the name of a
-program that follows the API specified in Amanda_Tape_Changer_Support. Read
-that for more information.
-
- Generic tape changer wrapper script
-
-An initial tape-changer glue script, chg-generic.sh, implements the Amanda
-changer API using an array of tape devices to simulate a tape changer, with the
-device names specified via a conf file. This script can be quickly customized
-by inserting calls tape-changer-specific programs at appropriate places, making
-support for new changers painless. If you know what command to execute to get
-your changer to put a particular tape in the drive, you can get Amanda to
-support your changer.
-The generic script works as-is for sites that want to cascade between two or
-more tape drives hooked directly up to the tape server host. It also should
-work as-is with tape-changer drivers that use separate device names to specify
-the slot to be loaded, wheres simply opening the slot device causes the tape
-from that slot to be loaded.
-chg-generic has its own small conf file. See example/chg-generic.conf for a
-documented sample.
-
- New command amtape
-
-amtape is the user front-end to the Amanda tape changer support facilities. The
-operators can use amtape to load tapes for restores, position the changer, see
-what Amanda tapes are loaded in the tape rack, and see which tape would be
-picked by taper for the next amdump run.
-No man page yet, but running amtape with no arguments gives a detailed usage
-statement. See Amanda_Tape_Changer_Support for more info.
-
-Note
-
-sgw: The manpage exists now.
-
- Changer support added to command amlabel
-
-The amlabel command now takes an optional slot argument for labeling particular
-tapes in the tape rack. See Amanda_Tape_Changer_Support for more info.
-
- Tape changer support improved
-
-The specs in Amanda_Tape_Changer_Support have been updated, and the code
-changed to match. The major difference is that Amanda no longer assumes slots
-in the tape rack are numbered from 0 to N-1. They can be numbered or labeled in
-any manner that suits your tape-changer, Amanda doesn't care what the actual
-slot names are. Also added "first" and "last" slot specifiers, and an -eject
-command.
-The chg-generic.sh tape changer script now has new "firstslot", "lastslot", and
-"needeject" parameters for the chg-generic.conf file. It now keeps track of
-whether the current slot is loaded into the drive, so that it can issue an
-explicit eject command for those tape changers that need one. See example/chg-
-generic.conf for more info.
-
- A few words about multi-tape runs
-
-I'm still holding back on support for multiple tapes in one run. I'm not yet
-completely happy with how Amanda should handle splitting dumps across tapes (eg
-when end-of-tape is encountered in the middle of a long dump). For example,
-this creates issues for amrestore, which currently doesn't know about
-configurations or tape changers --- on purpose, so that you can do restores on
-any machine with a tape drive, not just the server, and so that you can recover
-with no online databases present.
-However, because the current snapshot DOES support tape changers, and multiple
-runs in one day, some of the benefit of multi-tape runs can be had by simply
-running Amanda several times in a row. Eg, to fill three tapes per night, you
-can put
-
-  amdump <conf>; amdump <conf>; amdump <conf>
-
-in you crontab. On the down side, this will generate three reports instead of
-one, will do more incremental dumps than necessary, and will run slower. Not
-very satisfying, but if you need to fill more than one tape per day NOW, it
-should work.
-
- Big planner changes
-
-The support for writing to multiple tapes in one run is almost finished now.
-See Multitape_support_in_Amanda_2.2 for an outline of the design. The planner
-support for this is included in this snapshot, but the taper part is not.
-There is a new amanda.conf variable "runtapes" which specifies the number of
-tapes to use on each amdump run. For now this should stay at 1, the default.
-Also, the old "mincycle" and "maxcycle" amanda.conf variables are deprecated,
-but still work for now. "maxcycle" was never used, and "mincycle" is now called
-"dumpcycle".
-There are two visible differences in the new planner: First, planner now thinks
-in real-time, rather than by the number of tapes as before. That is, a
-filesystem is due for a full backup once every <dumpcycle> days, regardless of
-how many times Amanda is run in that interval. As a consequence, you need to
-make sure the dumpcycle variable marks real time instead of the number of days.
-For example, previously "mincycle 10" worked for a two week cycle if you ran
-amdump only on weekdays (for 10 runs in a cycle). Now a two week cycle must be
-specified as "dumpcycle 14" or "dumpcycle 2 weeks". The "2 weeks" specifier
-works with both the old and new versions of planner, because previously "weeks"
-multiplied by 5, and now it multiplies by 7.
-Second, planner now warns about impending overwrites of full backups. If a
-filesystem's last full backup is on a tape that is due to be overwritten in the
-next 5 runs, planner will give you a heads-up about it, so that you can restore
-the filesystem somewhere, or switch that tape out of rotation (substitute a new
-tape with the same label). This situation often occurs after a hardware failure
-brings a machine or disk down for some days.
-
- Level-0 dumps allowed with no tape
-
-If there is no tape present (or the tape drive fails during dumping), Amanda
-switches to degraded mode. In degraded mode, level-0 dumps are not allowed.
-This can be a pain for unattended sites over the weekend (especially when there
-is a large holding disk that can hold any necessary dumps). Amanda now supports
-a new configuration file directive, "reserve". This tells Amanda to reserve
-that percentage of total holding disk space for degraded mode dumps. Example:
-your total holding disk space adds up to 8.4GB. If you specify a reserve of 50,
-4.2GB (50%) of the holding disk space will be allowed to be used for regular
-dumps, but if that limit is hit, Amanda will switch to degraded dumps. For
-backward compatibility, if no 'reserve' keyword is present, 100 will be assumed
-(e.g. never do full dumps if degraded mode is in effect).
-
-Note
-
-This percentage applies from run to run, so, as in the previous example, when
-Amanda runs the next day, if there is 3.8GB left on the holding disk, 1.9GB
-will be reserved for degraded mode dumps (e.g. the percentage keeps sliding).
-
-Note
-
-Refer to http://www.amanda.org/docs/whatwasnew.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                         Up                                          Next
-Chapter 30. Upgrade Issues  Home  Chapter 32. Multitape support in Amanda 2.2
-
diff --git a/docs/wishlist.txt b/docs/wishlist.txt
deleted file mode 100644 (file)
index 924fece..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-
-         Chapter 21. Amanda WISHLIST
-Prev  Part IV. Various Information  Next
-
--------------------------------------------------------------------------------
-
-Chapter 21. Amanda WISHLIST
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Jean-Louis Martineau
-
-Additions and Updates
-AMANDA Core Team
-<martinea@iro.umontreal.ca>
-
-Stefan G. Weichinger
-
-XML-conversion; Additions and Updates
-AMANDA Core Team
-<sgw@amanda.org>
-This is a major update.
-These are items that we are planning to address, OR which we would like to see
-happen sometime in the future.
-They appear in random order.
-Of course, we aren't promising to deliver anything.
-This document can be found at http://www.amanda.org/docs/wishlist.html.
-You may find more up-to-date information at http://www.amanda.org/ongoing.php.
-If you have any ideas about any of the following, please send an e-mail note to
-mailto://amanda-users@amanda.org or mailto://amanda-hackers@amanda.org.
-Jean-Louis Martineau, Stefan G. Weichinger,
-Amanda Core Team
-Oct. 2004.
-
-* Samba: Ports to non-Unix platforms, specifically Macs and PCs. The hooks are
-  in the Amanda protocol to support non-dump backup programs, but no-one has
-  volunteered to implement the client side. sgw: Mac OS X is able to run the
-  client, so only the PC is left, and I suggest that we should go the SAMBA-
-  way, I think. Samba is working well, is documented and developed further, so
-  I think this will be a stable path to go and support. And people don't need
-  to compile/install anything on their Win-boxes, just add a user and shares
-  ... opinions welcome.
-
-
-* Samba: Samba should be treated as a different backup program, not as GNUTAR,
-  because it cannot handle dump-style incrementals.
-
-
-* Samba: multiple exclusion-patterns. Since Samba 3.0.3 smbclient supports the
-  usage of multiple exclude-patterns. This would enable Amanda to exclude more
-  than one pattern per SMB-share, allowing to exclude pagefile.sys AND the
-  registry-files, for example.
-
-
-* Instead of hard-coding the interface with tape devices in Amanda, there
-  should be a higher level interface that allowed different storage devices to
-  be used. Amanda should also be able to retain backups in disk, even after
-  they are taped, for faster restore of recently backed up data. It should also
-  be possible to store a single backup in multiple tapes, for redundancy.
-
-
-* We need a better protocol between the driver and dumpers. setup terminated
-  (to not start to dump on the same host at the same time). driver should ask
-  periodicaly if the dumper is still alive (in case the dumper hang).
-
-
-* retry failed backups in a single run. If backup fails because of active
-  filesystems or lack of memory, Amanda could throw the failed backup away and
-  run it again, instead of trying it again in the next run only.
-
-
-* Support for client-initiated backups might be interesting, but the server
-  would have to keep listening for clients backup requests for a configurable
-  period of time. This could be used to back up secure hosts, for instance.
-
-
-* Backups to remote tape devices (i.e., not in the main Amanda server), as well
-  as to remote filesystems should be supported.
-
-
-* multi-tape : Amanda should be able to write to many tape at the same time.
-  Need some criteria to select which dump should go on which tape? By level,
-  host name, ???
-
-
-* A way to tell if some dump must be done before/after some other. (eg. DLE X
-  must be started after DLE Y is started/dumped/taped).
-
-
-* Write to tape and holding disk in parallel (For dump to tape), the dump to
-  tape could be started first, while doing some dump to holding disk.
-
-
-* Keep files on holding disk after taped, that will permit faster recovery
-  because they will be from holding disk, these dump will be erase when the
-  same is needed for newer dump.
-
-
-* Append to tape
-
-
-* chg-disk
-  This script writes to disks which can be accessed in a parallel way (contrary
-  to the serial access to tapes). This could enable Amanda to do writes and
-  reads to several vtapes in parallel (e.g. doing an amrestore while the
-  regular amdump is running).
-  It would be helpful to have a script which generates the needed directory-
-  structure for a given chg-disk configuration. This script should test for
-  valid settings (using amgetconf to get the values out of amanda.conf), create
-  the necessary slot-directories and label the new vtapes by using amlabel.
-  (there are drafts available already)
-
-
-* amrecover should be able to set and "rewind" the correct vtape. Currently it
-  is necessary to do this manually in another tty.
-
-
-* It should be possible to re-generate databases and indexes from tapes.
-
-
-* Amanda could append meta-data like databases and indexes to tape, so that
-  each tape contains its own current indexes and everything to rebuild the
-  server-config.
-
-
-* Amanda should install man-pages for installed programs only.
-
-
-* It should be possible to configure whether amidxtaped should decompress the
-  dump stream or not (so amrecover could decompress it locally).
-
-
-* amstatus:
-  It should read degraded schedule and write which are delayed.
-  It should print number of byte written to tape for the current flush.
-  The taper should write a file with a byte count for the current files (every
-  GB) and amstatus could read it.
-  It could report the expected time before the dump finishes.
-
-
-* amverify/ amverifyrun:
-  It should look at the log file and compare the result.
-
-
-* amrecover:
-  should cd, add, remove, ... with a path with glob or regex (cd o*/linux)
-  find [file] # where is that file in the current DLE? (I don't know the path)
-  when [file] # when was this file dumped?
-  parsing accept '\': cd HP890\ Color
-  our own completion
-
-
-* amkill:
-  A new script to kill all process on client and server
-
-
-* Enhance the protocol between client-server to allow white-space and any
-  character in DLE/exclude/include.
-
-
-* More tools in amadmin. The administrator should be able to look at the
-  database in various ways. Adding / deleting / moving disks and hosts should
-  be done through amadmin instead of editing the disklist directly. This will
-  allow Amanda to do some sanity checks for the operators, to make sure
-  permissions are set up right, etc.
-  Suggested by Chris Jones <cjones@honors.montana.edu>.
-
-
-* You should be able to force full dumps for nights other than tonight. Rather
-  than one command at a time on the command line, amadmin could be a little
-  shell with a help facility (ala ckermit or gnuplot, if you've seen those).
-
-
-* A tape-verify pass after the Amanda run (we already have one, but it doesn't
-  work with dump as well as it does with GNU tar). Perhaps taper could
-  calculate a CRC for each file and store that in the database, to be checked
-  by the verifier.
-
-
-* More sophisticated tape management. Should Amanda track tapes globally,
-  counting the number of times tapes were used, and recommending retirement for
-  tapes at the appropriate time?
-
-
-* Automatically notice that external dumps have been done. Sendsize could also
-  notice if a filesystem was dumped externally from Amanda. Right now the
-  planner assumes that the incrementals it is doing are relative to the full
-  dumps it is doing. If someone does a full dump of one of its filesystems (and
-  writes /etc/dumpdates) outside of Amanda, data could be lost. Sun's Backup-
-  Copilot handles this well. We should too.
-
-
-* What if we made the "length" in a tapetype definition always be the "no
-  compression" value? Then change the dumptype "compress" option to accept
-  "hardware" as another type (ala "client" and "server") and let planner do its
-  normal thing with that information (including "comprate", which at the
-  current default of 50% is the usual first guess for hardware compression).
-  This would make setting the tape length value less confusing, and make the
-  amtapetype program easier to run. You could even get more accurate planning
-  than what is currently available by setting the comprate to what you know the
-  data is like on a dumptype by dumptype basis. Suggested by John R. Jackson
-  <jrj@gandalf.cc.purdue.edu>.
-
-
-* The way to specify the schedule should be redesigned, all those strategy
-  (standard, nofull, noinc, incronly, force-full) and options (skip-full, skip-
-  incr) are confusing.
-  We should have two options, one for full dump and one for incrementals.
-  full [AUTOMATIC | SKIP | NOTIFY | FORCE | FIXED]
-  incr [NONE | BUMP | NOBUMP]
-  with the following values:
-  AUTOMATIC: follow Amanda scheduling (allow promoted and delayed)
-  SKIP : full dump are done externally on an fixed schedule, dump nothing when
-  a full is due (like skip-full).
-  NOTIFY : full dumps are done externally, but are notified with the NOTIFY
-  command ( amadmin <conf> notify <host> <disk>).
-  FORCE : full dumps are done only with the FORCE_FULL command.
-  FIXED : do full dumps on a fixed schedule (like skip-incr).
-  NONE : don't do incremental dumps.
-  BUMP : allow incremental dumps to bump.
-  NOBUMP : do not allow incremental dumps to bump.
-
-
-* Remove all compiled options that can be moved to a (the?) configuration file.
-  (eg. GNU tar path, if configure can't find it, Amanda should be able to use
-  GNU tar if the path is specified on a client config file) Many people would
-  like this, it would maybe also bring us closer to the possibility of working
-  and usable rpms?
-
-
-* Documentation:
-  There is pretty much going on with the Amanda-docs. The docs have been
-  converted to Docbook/XML and form the new module xml-docs in the Amanda-CVS-
-  repository.
-  The FAQ-O-Matic could be replaced by a Wiki. Suggested by Harlan Stenn
-  <Harlan.Stenn@pfcs.com>.
-  The xml-docs need more formatting and reviewing.
-  The tapetypes from the FOM should go into the XML-docs.
-  The docs would benefit from adding some illustrations.
-
-The WISHLIST should get shortened.
-
-Note
-
-Refer to http://www.amanda.org/docs/wishlist.html for the current version of
-this document.
--------------------------------------------------------------------------------
-
-Prev                                          Up                           Next
-Chapter 20. Collection of the top ten Amanda Home  Part V. Technical Background
-questions. And answers. 
-
diff --git a/docs/y2k.txt b/docs/y2k.txt
deleted file mode 100644 (file)
index 65a8e1b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-        Chapter 34. Y2K Compliancy
-Prev  Part VI. Historical files  Next
-
--------------------------------------------------------------------------------
-
-Chapter 34. Y2K Compliancy
-
-
-Amanda Core Team
-
-Original text
-AMANDA Core Team
-
-Stefan G. Weichinger
-
-XML-conversion
-AMANDA Core Team
-<sgw@amanda.org>
-The Amanda developers believe Amanda is Y2K-compliant, as long as the
-underlying operating system and C library are. The only date manipulations
-performed by Amanda use C-language time manipulation functions and/or strings
-where years are represented with the century-included notation.
-
-Note
-
-Refer to http://www.amanda.org/docs/y2k.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                                   Up                               Next
-Chapter 33. Thoughts about a Strategy Home  Chapter 35. Usage of floppy tape
-API                                                          drives on Linux
-
diff --git a/docs/zftape.txt b/docs/zftape.txt
deleted file mode 100644 (file)
index 7d84ce6..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-
-Chapter 35. Usage of floppy tape drives on Linux
-Prev  Part VI. Historical files             Next
-
--------------------------------------------------------------------------------
-
-Chapter 35. Usage of floppy tape drives on Linux
-
-
-Albrecht Gebhardt
-
-Original text<albrecht.gebhardt@uni-klu.ac.at>
-
-Stefan G. Weichinger
-
-XML-conversion,Updates
-AMANDA Core Team
-<sgw@amanda.org>
-Amanda now supports the ftape driver version 3.04d (see http://www-
-math.math.rwth-aachen.de/~LBFM/claus/ftape ). It adjusts the blocksize
-automatically to 32k and supports QIC volume tables.
-It uses only one open() call for writing backups to one tape, so the "busy"-
-lamp of the drive will be on all the time. (With normal Amanda code it would be
-off in pauses between two files written to tape.)
-For volume table support you have to get libvtblc first (available at ftp://
-pc02-stat.sci.uni-klu.ac.at/pub/Linux/libvtblc.) This library contains the
-functions and subroutines from the vtblc utility, distributed with ftape.
-(Maybe this library will be part of a future ftape package).
-You have to set the raw tape device for volume table operations, usually /dev/
-rawft0, either via configure --with-ftape-rawdevice= or with rawtapedev in
-amanda.conf (configure checks for /dev/rawft[0-3], to get a guess for this
-value). Dont forget to make this device read/writeable for your backup user.
-For compilation you need the header files from ftape 3.04d in your include
-tree.
-The volumetable of a tape "amlabeled" TEST-VOL2 with 4 backups on it would look
-like (listed with vtblc utility from ftape):
-
-  prompt: vtblc
-
-   Nr  Id          Label                   Date           Start      End
-  Space
-
-    0 VTBL TEST-VOL2               23:08:06 03/15/98        3        4    0.00
-  %
-    1 VTBL gamma //beta/C 0        00:00:00 03/15/98        5      374    0.68
-  %
-    2 VTBL gamma sda2 0            00:00:00 03/15/98      375     1029    1.21
-  %
-    3 VTBL alpha sda2 0            00:00:00 03/15/98     1030     1906    1.62
-  %
-    4 VTBL alpha sda6 0            00:00:00 03/15/98     1907     8092   11.45
-  %
-    5 VTBL Amanda Tape End         01:45:15 03/16/98     8093     8094    0.00
-  %
-
-With lvtblc, currently available with the libvtblc library, you can list the
-complete label strings (44 characters, not only the first 22 characters as with
-vtblc):
-
-
-  prompt: lvtblc -l
-
-   Nr  Id          Label                                         Date
-
-    0 VTBL TEST-VOL2                                     23:08:06 03/15/98
-    1 VTBL gamma //beta/C 0                              00:00:00 03/15/98
-    2 VTBL gamma sda2 0                                  00:00:00 03/15/98
-    3 VTBL alpha sda2 0                                  00:00:00 03/15/98
-    4 VTBL alpha sda6 0                                  00:00:00 03/15/98
-    5 VTBL Amanda Tape End                               01:45:15 03/16/98
-
-Note on datestamps: volume 0 (Amanda label): reflects the time of starting the
-backup volume i (backup files): Amanda datestamps of the backup files last
-volume (end marker) : reflects the time of finishing the backup
-I tested this on a Linux machine (P90 / 96Mb RAM / 256 Mb swap) with two other
-clients (Linux / WfW) using
-
-* Linux Kernel 2.0.33,
-* ftape 3.04d,
-* Amanda 2.4.0b6p4
-
-with an internal Iomega Ditto 3200 (TR-3) drive attached to an Iomega Ditto
-Dash controller (at 2000 Kbps). My tapetype follows:
-
-  define tapetype DITTO-TR3 {
-      comment "Iomega DITTO 3200 Travan 3 tape drives"
-      length 1500 mbytes          #
-      filemark 29 kbytes          # ???
-      speed 256 kbytes            # = 2000 Kbit/s ?
-  }
-       
-
-
-Note
-
-Filemarks are not written to the tape (they are written to the header segment
-and use there 128 byte), so their size could even be 0. But a tape segment
-takes at least 29 kb (+3 kb ecc-code = 32 kb), so in the worst case an eof will
-waste 29 kb.
-
-Note
-
-Refer to http://www.amanda.org/docs/zftape.html for the current version of this
-document.
--------------------------------------------------------------------------------
-
-Prev                         Up                   Next
-Chapter 34. Y2K Compliancy  Home  Part VII. Appendixes
-
index 442c87609264261ddbfe93af88d75f7b885d8f50..ed1aef94addb3020690ab3e1b25628d536bee826 100644 (file)
@@ -1,33 +1,27 @@
 # Makefile for Amanda wrapper programs.
 
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src
 
-dumper_SCRIPTS =       amgtar generic-dumper
-dumperdir =            @DUMPER_DIR@
-
-SUFFIXES =             .sh .pl
-
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c -w -W -T $@ || rm $@
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+SCRIPTS_PERL = \
+           amgtar
 
-DISTCLEANFILES = $(dumper_SCRIPTS)
+SCRIPTS_INCLUDE = \
+           generic-dumper
+EXTRA_DIST += generic-dumper.pl
 
-# these are used for testing only:
+CHECK_PERL = $(SCRIPTS_PERL) $(SCRIPTS_INCLUDE)
 
-install-data-hook:
-       @list="$(dumper_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(dumperdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+dumperdir = $(DUMPER_DIR)
+dumper_SCRIPTS = $(SCRIPTS_PERL)
+dumper_DATA = $(SCRIPTS_INCLUDE)
 
+INSTALLPERMS_data = dest=$(dumperdir) chown=amanda $(dumper_SCRIPTS)
index 3b657070effd10bffaabc4adc2675f710eb1d249..50353aaf100c7daad2d44312428716baecd1cbfc 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda wrapper programs.
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
+
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -39,67 +159,145 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-subdir = dumper-src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/amgtar.pl.in $(srcdir)/generic-dumper.pl.in
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+subdir = dumper-src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = amgtar.pl generic-dumper.pl
-am__installdirs = "$(DESTDIR)$(dumperdir)"
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(dumperdir)" "$(DESTDIR)$(dumperdir)"
 dumperSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(dumper_SCRIPTS)
 SOURCES =
 DIST_SOURCES =
+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 = `echo $$p | sed -e 's|^.*/||'`;
+dumperDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dumper_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -107,14 +305,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -125,20 +328,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -152,60 +354,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -215,10 +526,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -229,24 +554,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -258,59 +617,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -319,37 +665,72 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = generic-dumper.pl
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src
 
-dumper_SCRIPTS = amgtar generic-dumper
-dumperdir = @DUMPER_DIR@
-SUFFIXES = .sh .pl
-DISTCLEANFILES = $(dumper_SCRIPTS)
-all: all-am
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+SCRIPTS_PERL = \
+           amgtar
+
+SCRIPTS_INCLUDE = \
+           generic-dumper
+
+CHECK_PERL = $(SCRIPTS_PERL) $(SCRIPTS_INCLUDE)
+dumperdir = $(DUMPER_DIR)
+dumper_SCRIPTS = $(SCRIPTS_PERL)
+dumper_DATA = $(SCRIPTS_INCLUDE)
+INSTALLPERMS_data = dest=$(dumperdir) chown=amanda $(dumper_SCRIPTS)
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sh .pl
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+.SUFFIXES: 
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -378,13 +759,9 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-amgtar.pl: $(top_builddir)/config.status $(srcdir)/amgtar.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-generic-dumper.pl: $(top_builddir)/config.status $(srcdir)/generic-dumper.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 install-dumperSCRIPTS: $(dumper_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(dumperdir)" || $(mkdir_p) "$(DESTDIR)$(dumperdir)"
+       test -z "$(dumperdir)" || $(MKDIR_P) "$(DESTDIR)$(dumperdir)"
        @list='$(dumper_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
@@ -407,10 +784,23 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
+install-dumperDATA: $(dumper_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(dumperdir)" || $(MKDIR_P) "$(DESTDIR)$(dumperdir)"
+       @list='$(dumper_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dumperDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(dumperdir)/$$f'"; \
+         $(dumperDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dumperdir)/$$f"; \
+       done
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+uninstall-dumperDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dumper_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(dumperdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(dumperdir)/$$f"; \
+       done
 tags: TAGS
 TAGS:
 
@@ -419,22 +809,21 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -445,14 +834,20 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
-all-am: Makefile $(SCRIPTS)
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(SCRIPTS) $(DATA)
 installdirs:
-       for dir in "$(DESTDIR)$(dumperdir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(dumperdir)" "$(DESTDIR)$(dumperdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -467,8 +862,10 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -477,13 +874,17 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -495,16 +896,26 @@ info: info-am
 
 info-am:
 
-install-data-am: install-dumperSCRIPTS
+install-data-am: install-dumperDATA install-dumperSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
+install-dvi: install-dvi-am
+
 install-exec-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+install-html: install-html-am
 
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -523,40 +934,154 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-dumperSCRIPTS uninstall-info-am
+uninstall-am: uninstall-dumperDATA uninstall-dumperSCRIPTS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
 
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       distclean distclean-generic distclean-libtool distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-data-hook \
-       install-dumperSCRIPTS install-exec install-exec-am \
-       install-info install-info-am install-man install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
+.PHONY: all all-am check check-am check-local clean clean-generic \
+       clean-libtool dist-hook 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-hook install-dumperDATA install-dumperSCRIPTS \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-exec-hook install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-generic \
        mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-       uninstall-dumperSCRIPTS uninstall-info-am
+       uninstall-dumperDATA uninstall-dumperSCRIPTS
 
 
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c -w -W -T $@ || rm $@
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
 
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
 
-# these are used for testing only:
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
 
-install-data-hook:
-       @list="$(dumper_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(dumperdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 # 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/dumper-src/amgtar.pl b/dumper-src/amgtar.pl
new file mode 100644 (file)
index 0000000..8fe9024
--- /dev/null
@@ -0,0 +1,326 @@
+#!@PERL@ -T
+#
+
+# Run perl.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+       & eval 'exec @PERL@ -S $0 $argv:q'
+               if 0;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$debug=1;
+push(@INC, ".", "@DUMPER_DIR@");
+
+use File::Copy;
+use IPC::Open3;
+use Sys::Hostname;
+
+
+open(DEBUG,">>@AMANDA_DBGDIR@/amgtar.$$.debug") if ($debug==1);
+
+$prefix='@prefix@';
+$prefix = $prefix;
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;
+$amlibexecdir="@amlibexecdir@";
+$amlibexecdir=$amlibexecdir;
+
+$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
+$suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+   $suf='-@VERSION@';
+}
+
+$myhost = hostname;
+$myhost =~ s/\..*$//;
+$runtar="${amlibexecdir}/runtar${suf}";
+$gnulist = '@GNUTAR_LISTED_INCREMENTAL_DIR@';
+$gnutar = '@GNUTAR@';
+
+
+
+$max_level    = 9;
+$index_line   = 1;
+$index_xml    = 0;
+$message_line = 1;
+$message_xml  = 0;
+$record       = 1;
+$include_file = 1;
+$include_list = 1;
+$exclude_file = 1;
+$exclude_list = 1;
+$collection   = 0;
+
+#$user_support  = "";
+#$group_support = "";
+
+#$user_selfcheck  = "";
+#$group_selfcheck = "";
+
+#$user_estimate  = "";
+#$group_estimate = "";
+
+#$user_estimate_parse  = "";
+#$group_estimate_parse = "";
+
+$user_backup  = "root";
+#$group_backup = "";
+
+#$user_backup_parse  = "";
+#$group_backup_parse = "";
+
+#$user_index_from_output  = "";
+#$group_index_from_output = "";
+
+#$user_index_from_image  = "";
+#$group_index_from_image = "";
+
+#$user_restore  = "";
+#$group_restore = "";
+
+#$user_print_command  = "";
+#$group_print_command = "";
+
+$user_default  = "amanda";
+$group_default = "amanda";
+
+
+sub command_support {
+   my($config, $host, $disk, $device, $level) = @_;
+   print "CONFIG YES\n";
+   print DEBUG "STDOUT: CONFIG YES\n" if ($debug == 1);
+   print "HOST YES\n";
+   print DEBUG "STDOUT: HOST YES\n" if ($debug == 1);
+   print "DISK YES\n";
+   print DEBUG "STDOUT: DISK YES\n" if ($debug == 1);
+   print "MAX-LEVEL 9\n";
+   print DEBUG "STDOUT: MAX-LEVEL 9\n" if ($debug == 1);
+   print "INDEX-LINE YES\n";
+   print DEBUG "STDOUT: INDEX-LINE YES\n" if ($debug == 1);
+   print "INDEX-XML NO\n";
+   print DEBUG "STDOUT: INDEX-XML NO\n" if ($debug == 1);
+   print "MESSAGE-LINE YES\n";
+   print DEBUG "STDOUT: MESSAGE-LINE YES\n" if ($debug == 1);
+   print "MESSAGE-XML NO\n";
+   print DEBUG "STDOUT: MESSAGE-XML NO\n" if ($debug == 1);
+   print "RECORD YES\n";
+   print DEBUG "STDOUT: RECORD YES\n" if ($debug == 1);
+   print "INCLUDE-FILE YES\n";
+   print "INCLUDE-LIST YES\n";
+   print "EXCLUDE-FILE YES\n";
+   print "EXCLUDE-LIST YES\n";
+   print "COLLECTION NO\n";
+}
+
+sub command_selfcheck {
+   my($config, $host, $disk, $device, $level) = @_;
+   print DEBUG "STDOUT: OK $disk\n" if ($debug == 1);
+   print DEBUG "STDOUT: OK $device\n" if ($debug == 1);
+   print "OK $disk\n";
+   print "OK $device\n";
+   #check binary
+   #check statefile
+   #check amdevice
+   #check property include/exclude
+}
+
+sub command_estimate {
+   my($config, $host, $disk, $device, $level) = @_;
+   my($listdir) = "$host$disk";
+   $listdir     =~ s/\//_/g;
+   if($level == 0) {
+      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+      close(GNULIST) || die();
+   }
+   else {
+      my($prev_level) = $level - 1;
+      if (-f "${gnulist}/${listdir}_${prev_level}") {
+        copy("${gnulist}/${listdir}_${prev_level}", "${gnulist}/${listdir}_${level}.new");
+      } else {
+        open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+        close(GNULIST) || die();
+       #print "ERROR file ${gnulist}/${listdir}_${level}.new doesn't exist\n";
+      }
+   }
+   command_estimate_opt_direct($config, $host, $disk, $device, $level, $listdir);
+}
+
+
+sub command_estimate_opt_direct {
+   my($config, $host, $disk, $device, $level, $listdir) = @_;
+   my($size) = -1;
+   my(@cmd) = ($runtar, $config, $gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
+   #my(@cmd) = ($gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+   open3(\*WTRFH, '>&STDOUT', \*ESTIMATE, @cmd);
+
+   $size = parse_estimate(ESTIMATE);
+   close(ESTIMATE);
+   output_size($size);
+   unlink "${gnulist}/${listdir}_${level}.new";
+   exit 0;
+}
+
+sub parse_estimate {
+   my($fh) = @_;
+   my($size) = -1;
+   while(<$fh>) {
+print DEBUG "READ 2: $_" if ($debug == 1);
+      if ($_ =~ /^Total bytes written: (\d*)/) {
+         $size = $1;
+         last;
+      }
+   }
+   return $size;
+}
+
+sub output_size {
+   my($size) = @_;
+   if($size == -1) {
+      print DEBUG "STDOUT A: -1 -1\n" if ($debug == 1);
+      print "-1 -1\n";
+      exit 2;
+   }
+   else {
+      my($ksize) = int $size / (1024);
+      $ksize=32 if ($ksize<32);
+      print DEBUG "STDOUT B: $ksize 1\n" if ($debug == 1);
+      print "$ksize 1\n";
+   }
+}
+
+sub command_backup {
+   my($config, $host, $disk, $device, $level) = @_;
+   my($listdir) = "$host$disk";
+   my($verbose) = "";
+   $listdir     =~ s/\//_/g;
+
+print DEBUG "config =" . $config . "\n" if ($debug == 1);
+print DEBUG "host   =" . $host   . "\n" if ($debug == 1);
+print DEBUG "disk   =" . $disk   . "\n" if ($debug == 1);
+print DEBUG "device =" . $device . "\n" if ($debug == 1);
+print DEBUG "level  =" . $level  . "\n" if ($debug == 1);
+
+   if($level == 0) {
+      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+      close(GNULIST) || die();
+   }
+   else {
+      my($prev_level) = $level - 1;
+      copy("${gnulist}/${listdir}_${prev_level}", 
+           "${gnulist}/${listdir}_${level}.new");
+   }
+
+   if(defined($opt_index)) {
+      $verbose = "--verbose";
+   }
+   my(@cmd) = ($runtar, $config, $gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
+   #my(@cmd) = ($gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
+
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+
+   open3(\*WTRFH, '>&STDOUT', \*INDEX, @cmd) || die();
+
+   if(defined($opt_index)) {
+      open(INDEXOUT, '>&=3') || die();
+      parse_backup(INDEX, STDERR, INDEXOUT);
+      close(INDEXOUT);
+   }
+   else {
+      parse_backup(INDEX, STDERR, undef);
+   }
+   close(INDEX);
+   close(WTRFH);
+
+   if(defined($opt_record)) {
+      rename "${gnulist}/${listdir}_${level}.new", 
+             "${gnulist}/${listdir}_${level}";
+   }
+   else {
+      unlink "${gnulist}/${listdir}_${level}.new";
+   }
+   exit 0;
+}
+
+sub parse_backup {
+   my($fhin, $fhout, $indexout) = @_;
+   my($size) = -1;
+   while(<$fhin>) {
+print DEBUG "READ 3: $_" if ($debug == 1);
+      if ( /^\.\//) {
+         if(defined($indexout)) {
+           if(defined($opt_index)) {
+               s/^\.//;
+print DEBUG "INDEXOUT: $_" if ($debug == 1);
+               print $indexout $_;
+           }
+         }
+      }
+      else {
+            if (/^Total bytes written: (\d*)/) {
+               $size = $1;
+              $ksize = int ($size / 1024);
+            }
+            elsif(defined($fhout)) {
+               next if /: Directory is new$/;
+print DEBUG "FHOUT 2: $_" if ($debug == 1);
+               print $fhout $_;
+            }
+      }
+   }
+   if(defined($fhout)) {
+      if ($size == -1) {
+print DEBUG "FHOUT 4: $command -1 -1\n" if ($debug == 1);
+         print $fhout "$command -1 -1\n";
+      }
+      else {
+         my($ksize) = int ($size/1024);
+print DEBUG "FHOUT 5: sendbackup: size $ksize\n" if ($debug == 1);
+         print $fhout "sendbackup: size $ksize\n";
+print DEBUG "FHOUT 5: sendbackup: end\n" if ($debug == 1);
+              print $fhout "sendbackup: end\n";
+      }
+   }
+}
+
+sub command_index_from_output {
+   index_from_output(STDIN, STDOUT);
+   exit 0;
+}
+
+sub index_from_output {
+   my($fhin, $fhout) = @_;
+   my($size) = -1;
+   while(<$fhin>) {
+print DEBUG "READ 4: $_" if ($debug == 1);
+      next if /^Total bytes written:/;
+      next if !/^\.\//;
+      s/^\.//;
+print DEBUG "FHOUT 6: $_" if ($debug == 1);
+      print $fhout $_;
+   }
+}
+
+sub command_index_from_image {
+   my($config, $host, $disk, $device, $level) = @_;
+   open(INDEX, "$gnutar --list --file - |") || die();
+   index_from_output(INDEX, STDOUT);
+}
+
+sub command_restore {
+   my($config, $host, $disk, $device, $level) = @_;
+
+#   $ARGV[0] = undef;   
+   my(@cmd) = ($gnutar, "--numeric-owner", "-xpGvf", "-");
+   for($i=1;defined $ARGV[$i]; $i++) {
+      push @cmd, $ARGV[$i];
+   }
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+   exec @cmd;
+}
+
+sub command_print_command {
+}
+
+require "generic-dumper"
diff --git a/dumper-src/amgtar.pl.in b/dumper-src/amgtar.pl.in
deleted file mode 100644 (file)
index d315e14..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-#!@PERL@ -T
-#
-
-# Run perl.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$debug=1;
-push(@INC, ".", "@DUMPER_DIR@");
-
-use File::Copy;
-use IPC::Open3;
-use Sys::Hostname;
-
-
-open(DEBUG,">>@AMANDA_DBGDIR@/amgtar.$$.debug") if ($debug==1);
-
-$prefix='@prefix@';
-$prefix = $prefix;
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;
-$libexecdir="@libexecdir@";
-$libexecdir=$libexecdir;
-
-$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
-$suf = '';
-if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
-   $suf='-@VERSION@';
-}
-
-$myhost = hostname;
-$myhost =~ s/\..*$//;
-$runtar="${libexecdir}/runtar${suf}";
-$gnulist = '@GNUTAR_LISTED_INCREMENTAL_DIR@';
-$gnutar = '@GNUTAR@';
-
-
-
-$max_level    = 9;
-$index_line   = 1;
-$index_xml    = 0;
-$message_line = 1;
-$message_xml  = 0;
-$record       = 1;
-$include_file = 1;
-$include_list = 1;
-$exclude_file = 1;
-$exclude_list = 1;
-$collection   = 0;
-
-#$user_support  = "";
-#$group_support = "";
-
-#$user_selfcheck  = "";
-#$group_selfcheck = "";
-
-#$user_estimate  = "";
-#$group_estimate = "";
-
-#$user_estimate_parse  = "";
-#$group_estimate_parse = "";
-
-$user_backup  = "root";
-#$group_backup = "";
-
-#$user_backup_parse  = "";
-#$group_backup_parse = "";
-
-#$user_index_from_output  = "";
-#$group_index_from_output = "";
-
-#$user_index_from_image  = "";
-#$group_index_from_image = "";
-
-#$user_restore  = "";
-#$group_restore = "";
-
-#$user_print_command  = "";
-#$group_print_command = "";
-
-$user_default  = "amanda";
-$group_default = "amanda";
-
-
-sub command_support {
-   my($config, $host, $disk, $device, $level) = @_;
-   print "CONFIG YES\n";
-   print DEBUG "STDOUT: CONFIG YES\n" if ($debug == 1);
-   print "HOST YES\n";
-   print DEBUG "STDOUT: HOST YES\n" if ($debug == 1);
-   print "DISK YES\n";
-   print DEBUG "STDOUT: DISK YES\n" if ($debug == 1);
-   print "MAX-LEVEL 9\n";
-   print DEBUG "STDOUT: MAX-LEVEL 9\n" if ($debug == 1);
-   print "INDEX-LINE YES\n";
-   print DEBUG "STDOUT: INDEX-LINE YES\n" if ($debug == 1);
-   print "INDEX-XML NO\n";
-   print DEBUG "STDOUT: INDEX-XML NO\n" if ($debug == 1);
-   print "MESSAGE-LINE YES\n";
-   print DEBUG "STDOUT: MESSAGE-LINE YES\n" if ($debug == 1);
-   print "MESSAGE-XML NO\n";
-   print DEBUG "STDOUT: MESSAGE-XML NO\n" if ($debug == 1);
-   print "RECORD YES\n";
-   print DEBUG "STDOUT: RECORD YES\n" if ($debug == 1);
-   print "INCLUDE-FILE YES\n";
-   print "INCLUDE-LIST YES\n";
-   print "EXCLUDE-FILE YES\n";
-   print "EXCLUDE-LIST YES\n";
-   print "COLLECTION NO\n";
-}
-
-sub command_selfcheck {
-   my($config, $host, $disk, $device, $level) = @_;
-   print DEBUG "STDOUT: OK $disk\n" if ($debug == 1);
-   print DEBUG "STDOUT: OK $device\n" if ($debug == 1);
-   print "OK $disk\n";
-   print "OK $device\n";
-   #check binary
-   #check statefile
-   #check amdevice
-   #check property include/exclude
-}
-
-sub command_estimate {
-   my($config, $host, $disk, $device, $level) = @_;
-   my($listdir) = "$host$disk";
-   $listdir     =~ s/\//_/g;
-   if($level == 0) {
-      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
-      close(GNULIST) || die();
-   }
-   else {
-      my($prev_level) = $level - 1;
-      if (-f "${gnulist}/${listdir}_${prev_level}") {
-        copy("${gnulist}/${listdir}_${prev_level}", "${gnulist}/${listdir}_${level}.new");
-      } else {
-        open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
-        close(GNULIST) || die();
-       #print "ERROR file ${gnulist}/${listdir}_${level}.new doesn't exist\n";
-      }
-   }
-   command_estimate_opt_direct($config, $host, $disk, $device, $level, $listdir);
-}
-
-
-sub command_estimate_opt_direct {
-   my($config, $host, $disk, $device, $level, $listdir) = @_;
-   my($size) = -1;
-   my(@cmd) = ($runtar, $config, $gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
-   #my(@cmd) = ($gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
-   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
-   open3(\*WTRFH, '>&STDOUT', \*ESTIMATE, @cmd);
-
-   $size = parse_estimate(ESTIMATE);
-   close(ESTIMATE);
-   output_size($size);
-   unlink "${gnulist}/${listdir}_${level}.new";
-   exit 0;
-}
-
-sub parse_estimate {
-   my($fh) = @_;
-   my($size) = -1;
-   while(<$fh>) {
-print DEBUG "READ 2: $_" if ($debug == 1);
-      if ($_ =~ /^Total bytes written: (\d*)/) {
-         $size = $1;
-         last;
-      }
-   }
-   return $size;
-}
-
-sub output_size {
-   my($size) = @_;
-   if($size == -1) {
-      print DEBUG "STDOUT A: -1 -1\n" if ($debug == 1);
-      print "-1 -1\n";
-      exit 2;
-   }
-   else {
-      my($ksize) = int $size / (1024);
-      $ksize=32 if ($ksize<32);
-      print DEBUG "STDOUT B: $ksize 1\n" if ($debug == 1);
-      print "$ksize 1\n";
-   }
-}
-
-sub command_backup {
-   my($config, $host, $disk, $device, $level) = @_;
-   my($listdir) = "$host$disk";
-   my($verbose) = "";
-   $listdir     =~ s/\//_/g;
-
-print DEBUG "config =" . $config . "\n" if ($debug == 1);
-print DEBUG "host   =" . $host   . "\n" if ($debug == 1);
-print DEBUG "disk   =" . $disk   . "\n" if ($debug == 1);
-print DEBUG "device =" . $device . "\n" if ($debug == 1);
-print DEBUG "level  =" . $level  . "\n" if ($debug == 1);
-
-   if($level == 0) {
-      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
-      close(GNULIST) || die();
-   }
-   else {
-      my($prev_level) = $level - 1;
-      copy("${gnulist}/${listdir}_${prev_level}", 
-           "${gnulist}/${listdir}_${level}.new");
-   }
-
-   if(defined($opt_index)) {
-      $verbose = "--verbose";
-   }
-   my(@cmd) = ($runtar, $config, $gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
-   #my(@cmd) = ($gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
-
-   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
-
-   open3(\*WTRFH, '>&STDOUT', \*INDEX, @cmd) || die();
-
-   if(defined($opt_index)) {
-      open(INDEXOUT, '>&=3') || die();
-      parse_backup(INDEX, STDERR, INDEXOUT);
-      close(INDEXOUT);
-   }
-   else {
-      parse_backup(INDEX, STDERR, undef);
-   }
-   close(INDEX);
-   close(WTRFH);
-
-   if(defined($opt_record)) {
-      rename "${gnulist}/${listdir}_${level}.new", 
-             "${gnulist}/${listdir}_${level}";
-   }
-   else {
-      unlink "${gnulist}/${listdir}_${level}.new";
-   }
-   exit 0;
-}
-
-sub parse_backup {
-   my($fhin, $fhout, $indexout) = @_;
-   my($size) = -1;
-   while(<$fhin>) {
-print DEBUG "READ 3: $_" if ($debug == 1);
-      if ( /^\.\//) {
-         if(defined($indexout)) {
-           if(defined($opt_index)) {
-               s/^\.//;
-print DEBUG "INDEXOUT: $_" if ($debug == 1);
-               print $indexout $_;
-           }
-         }
-      }
-      else {
-            if (/^Total bytes written: (\d*)/) {
-               $size = $1;
-              $ksize = int ($size / 1024);
-            }
-            elsif(defined($fhout)) {
-               next if /: Directory is new$/;
-print DEBUG "FHOUT 2: $_" if ($debug == 1);
-               print $fhout $_;
-            }
-      }
-   }
-   if(defined($fhout)) {
-      if ($size == -1) {
-print DEBUG "FHOUT 4: $command -1 -1\n" if ($debug == 1);
-         print $fhout "$command -1 -1\n";
-      }
-      else {
-         my($ksize) = int ($size/1024);
-print DEBUG "FHOUT 5: sendbackup: size $ksize\n" if ($debug == 1);
-         print $fhout "sendbackup: size $ksize\n";
-print DEBUG "FHOUT 5: sendbackup: end\n" if ($debug == 1);
-              print $fhout "sendbackup: end\n";
-      }
-   }
-}
-
-sub command_index_from_output {
-   index_from_output(STDIN, STDOUT);
-   exit 0;
-}
-
-sub index_from_output {
-   my($fhin, $fhout) = @_;
-   my($size) = -1;
-   while(<$fhin>) {
-print DEBUG "READ 4: $_" if ($debug == 1);
-      next if /^Total bytes written:/;
-      next if !/^\.\//;
-      s/^\.//;
-print DEBUG "FHOUT 6: $_" if ($debug == 1);
-      print $fhout $_;
-   }
-}
-
-sub command_index_from_image {
-   my($config, $host, $disk, $device, $level) = @_;
-   open(INDEX, "$gnutar --list --file - |") || die();
-   index_from_output(INDEX, STDOUT);
-}
-
-sub command_restore {
-   my($config, $host, $disk, $device, $level) = @_;
-
-#   $ARGV[0] = undef;   
-   my(@cmd) = ($gnutar, "--numeric-owner", "-xpGvf", "-");
-   for($i=1;defined $ARGV[$i]; $i++) {
-      push @cmd, $ARGV[$i];
-   }
-   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
-   exec @cmd;
-}
-
-sub command_print_command {
-}
-
-require "generic-dumper"
diff --git a/dumper-src/generic-dumper.pl b/dumper-src/generic-dumper.pl
new file mode 100644 (file)
index 0000000..f1fc6d3
--- /dev/null
@@ -0,0 +1,273 @@
+require "newgetopt.pl";
+use Text::ParseWords;
+
+print DEBUG "FHOUT 6: ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[7]=" . $ARGV[7] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[8]=" . $ARGV[8] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[9]=" . $ARGV[9] . "\n" if ($debug == 1);
+
+$result = &NGetOpt ("config=s", "host=s", "disk=s", "device=s", "level=s", "index=s", "message=s", "collection", "record");
+$result = $result;
+
+print DEBUG "FHOUT 6: config    =" . $opt_config . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: disk      =" . $opt_disk   . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: host      =" . $opt_host   . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: device    =" . $opt_device . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: level     =" . $opt_level  . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: index     =" . $opt_index  . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: message   =" . $opt_message. "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: collection=" . $opt_collection. "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: record    =" . $opt_record . "\n" if ($debug == 1);
+
+print DEBUG "FHOUT 6: A-ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
+
+if (defined $opt_config) {
+  $opt_config =~ /^([\_\.A-Za-z0-9]*)$/;
+  $opt_config = $1;
+}
+
+if (defined $opt_host) {
+  $opt_host =~ /^([\_\.A-Za-z0-9]*)$/;
+  $opt_host = $1;
+}
+
+if (defined $opt_disk) {
+  $opt_disk =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
+  $opt_disk = $1;
+}
+
+if (defined $opt_device) {
+  $opt_device =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
+  $opt_device = $1;
+}
+
+if (defined $opt_level) {
+  $opt_level =~ /^(\d)$/;
+  $opt_level = $1;
+}
+
+# Read tool property
+
+$command = $ARGV[0];
+
+%property = ();
+while($property_line = <STDIN>) {
+  chomp $property_line;
+  ($prop_name, $prop_value) = shellwords($property_line);
+  push @{$property{$prop_name}}, $prop_value;
+  print DEBUG "$prop_name = $prop_value\n" if ($debug == 1);
+}
+
+if ($debug == 1) {
+  foreach $prop_name (keys(%property)) {
+    print DEBUG "PROPERTY: $prop_name\n";
+    print DEBUG "    VALUE: ", join(',',@{$property{$prop_name}}) , "\n";
+  }
+}
+
+sub wrapper_support();
+sub wrapper_selfcheck();
+sub wrapper_estimate();
+sub wrapper_backup();
+sub wrapper_restore();
+
+if ($command eq "support") {
+   wrapper_support();
+}
+elsif ($command eq "selfcheck") {
+   wrapper_selfcheck();
+}
+elsif ($command eq "estimate") {
+   wrapper_estimate();
+}
+elsif ($command eq "backup") {
+   wrapper_backup();
+}
+elsif ($command eq "restore") {
+   wrapper_restore();
+}
+else {
+   printf STDERR "Unknown command `$command'.\n";
+   exit 1;
+}
+
+
+sub wrapper_support() {
+   if(defined(&command_support)) {
+      command_support($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+      exit 0;
+   }
+   print "LEVEL 0-", $max_level , "\n" if defined($max_level);
+   print "INDEX-LINE YES\n"   if defined($index_line)   && $index_line   == 1;
+   print "INDEX-XML NO\n"     if defined($index_xml)    && $index_xml    == 1;
+   print "MESSAGE-LINE YES\n" if defined($message_line) && $message_line == 1;
+   print "MESSAGE-XML NO\n"   if defined($message_xml)  && $message_xml  == 1;
+   print "RECORD YES\n"       if defined($record)       && $record       == 1;
+   print "INCLUDE-FILE NO\n"  if defined($include_file) && $include_file == 1;
+   print "INCLUDE-LIST NO\n"  if defined($include_list) && $include_list == 1;
+   print "EXCLUDE-FILE NO\n"  if defined($exclude_file) && $exclude_file == 1;
+   print "EXCLUDE-LIST NO\n"  if defined($exclude_list) && $exclude_list == 1;
+   print "COLLECTION NO\n"    if defined($collection)   && $collection   == 1;
+   exit 1;
+}
+
+sub wrapper_selfcheck() {
+   if(defined(&command_selfcheck)) {
+      command_selfcheck($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+      exit 1;
+   }
+}
+
+sub wrapper_estimate() {
+   if(defined(&command_estimate)) {
+      command_estimate($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   } else {
+      exit 1;
+   }
+}
+
+sub wrapper_estimate_parse() {
+   if(defined(&command_estimate_parse)) {
+      command_estimate_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+      printf STDERR "`estimate-parse' is not supported.\n";
+      exit 1;
+   }
+}
+
+sub wrapper_backup() {
+   if(defined(&command_backup)) {
+      command_backup($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   } else {
+print DEBUG "wrapper_backup: !defined(command_backup)\n" if ($debug == 1);
+      exit 1;
+   }
+}
+
+sub wrapper_backup_parse() {
+   if(defined(&command_backup_parse)) {
+      command_backup_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+      printf STDERR "`backup-parse' is not supported.\n";
+      exit 1;
+   }
+}
+
+sub wrapper_index_from_output() {
+   if(defined(&command_index_from_output)) {
+      command_index_from_output($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+      printf STDERR "`index-from-output' is not supported.\n";
+      exit 1;
+   }
+}
+
+sub wrapper_index_from_image() {
+   if(defined(&command_index_from_image)) {
+      command_index_from_image($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+      printf STDERR "command `index-from-image' is not supported.\n";
+      exit 1;
+   }
+}
+
+sub wrapper_restore() {
+   if(defined(&command_restore)) {
+      command_restore($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   }
+   else {
+     printf STDERR "`restore' is not supported.\n";
+     exit 1;
+   }
+}
+
+sub parse_options() {
+   my($no_option) = @_;
+   my($options, @options, $option, $name, $option_name, $value);
+
+   while($no_option <= $#ARGV) {
+      $options = $ARGV[${no_option}];
+      @options = split (/;/,$options);
+      foreach $option (@options) {
+         if( $option =~ /=/ ) {
+            ($name,$value) = split(/=/,$option);
+         }
+         else {
+            $name  = $option;
+            $value = 1;
+         }
+         $option_name = "option_$name";
+         $option_name =~ s/\-/\_/g;
+        $$option_name = $value;
+      }
+      $no_option++;
+   }
+}
+
+sub check_file {
+   my($filename, $mode) = @_;
+
+   stat($filename);
+
+   if($mode eq "e") {
+      if( -e _ ) {
+         print "OK $filename exists\n";
+      }
+      else {
+         print "ERROR [can not find $filename]\n";
+      }
+   }
+   elsif($mode eq "x") {
+      if( -x _ ) {
+         print "OK $filename executable\n";
+      }
+      else {
+         print "ERROR [can not execute $filename]\n";
+      }
+   }
+   elsif($mode eq "r") {
+      if( -r _ ) {
+         print "OK $filename readable\n";
+      }
+      else {
+         print "ERROR [can not read $filename]\n";
+      }
+   }
+   elsif($mode eq "w") {
+      if( -w _ ) {
+         print "OK $filename writable\n";
+      }
+      else {
+         print "ERROR [can not write $filename]\n";
+      }
+   }
+   else {
+      print "ERROR [check_file: unknow mode $mode]\n";
+   }
+}
+
+sub check_dir {
+}
+
+sub check_suid {
+}
+
+1;
diff --git a/dumper-src/generic-dumper.pl.in b/dumper-src/generic-dumper.pl.in
deleted file mode 100644 (file)
index f1fc6d3..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-require "newgetopt.pl";
-use Text::ParseWords;
-
-print DEBUG "FHOUT 6: ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[7]=" . $ARGV[7] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[8]=" . $ARGV[8] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: ARGV[9]=" . $ARGV[9] . "\n" if ($debug == 1);
-
-$result = &NGetOpt ("config=s", "host=s", "disk=s", "device=s", "level=s", "index=s", "message=s", "collection", "record");
-$result = $result;
-
-print DEBUG "FHOUT 6: config    =" . $opt_config . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: disk      =" . $opt_disk   . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: host      =" . $opt_host   . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: device    =" . $opt_device . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: level     =" . $opt_level  . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: index     =" . $opt_index  . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: message   =" . $opt_message. "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: collection=" . $opt_collection. "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: record    =" . $opt_record . "\n" if ($debug == 1);
-
-print DEBUG "FHOUT 6: A-ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
-print DEBUG "FHOUT 6: A-ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
-
-if (defined $opt_config) {
-  $opt_config =~ /^([\_\.A-Za-z0-9]*)$/;
-  $opt_config = $1;
-}
-
-if (defined $opt_host) {
-  $opt_host =~ /^([\_\.A-Za-z0-9]*)$/;
-  $opt_host = $1;
-}
-
-if (defined $opt_disk) {
-  $opt_disk =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
-  $opt_disk = $1;
-}
-
-if (defined $opt_device) {
-  $opt_device =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
-  $opt_device = $1;
-}
-
-if (defined $opt_level) {
-  $opt_level =~ /^(\d)$/;
-  $opt_level = $1;
-}
-
-# Read tool property
-
-$command = $ARGV[0];
-
-%property = ();
-while($property_line = <STDIN>) {
-  chomp $property_line;
-  ($prop_name, $prop_value) = shellwords($property_line);
-  push @{$property{$prop_name}}, $prop_value;
-  print DEBUG "$prop_name = $prop_value\n" if ($debug == 1);
-}
-
-if ($debug == 1) {
-  foreach $prop_name (keys(%property)) {
-    print DEBUG "PROPERTY: $prop_name\n";
-    print DEBUG "    VALUE: ", join(',',@{$property{$prop_name}}) , "\n";
-  }
-}
-
-sub wrapper_support();
-sub wrapper_selfcheck();
-sub wrapper_estimate();
-sub wrapper_backup();
-sub wrapper_restore();
-
-if ($command eq "support") {
-   wrapper_support();
-}
-elsif ($command eq "selfcheck") {
-   wrapper_selfcheck();
-}
-elsif ($command eq "estimate") {
-   wrapper_estimate();
-}
-elsif ($command eq "backup") {
-   wrapper_backup();
-}
-elsif ($command eq "restore") {
-   wrapper_restore();
-}
-else {
-   printf STDERR "Unknown command `$command'.\n";
-   exit 1;
-}
-
-
-sub wrapper_support() {
-   if(defined(&command_support)) {
-      command_support($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-      exit 0;
-   }
-   print "LEVEL 0-", $max_level , "\n" if defined($max_level);
-   print "INDEX-LINE YES\n"   if defined($index_line)   && $index_line   == 1;
-   print "INDEX-XML NO\n"     if defined($index_xml)    && $index_xml    == 1;
-   print "MESSAGE-LINE YES\n" if defined($message_line) && $message_line == 1;
-   print "MESSAGE-XML NO\n"   if defined($message_xml)  && $message_xml  == 1;
-   print "RECORD YES\n"       if defined($record)       && $record       == 1;
-   print "INCLUDE-FILE NO\n"  if defined($include_file) && $include_file == 1;
-   print "INCLUDE-LIST NO\n"  if defined($include_list) && $include_list == 1;
-   print "EXCLUDE-FILE NO\n"  if defined($exclude_file) && $exclude_file == 1;
-   print "EXCLUDE-LIST NO\n"  if defined($exclude_list) && $exclude_list == 1;
-   print "COLLECTION NO\n"    if defined($collection)   && $collection   == 1;
-   exit 1;
-}
-
-sub wrapper_selfcheck() {
-   if(defined(&command_selfcheck)) {
-      command_selfcheck($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-      exit 1;
-   }
-}
-
-sub wrapper_estimate() {
-   if(defined(&command_estimate)) {
-      command_estimate($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   } else {
-      exit 1;
-   }
-}
-
-sub wrapper_estimate_parse() {
-   if(defined(&command_estimate_parse)) {
-      command_estimate_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-      printf STDERR "`estimate-parse' is not supported.\n";
-      exit 1;
-   }
-}
-
-sub wrapper_backup() {
-   if(defined(&command_backup)) {
-      command_backup($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   } else {
-print DEBUG "wrapper_backup: !defined(command_backup)\n" if ($debug == 1);
-      exit 1;
-   }
-}
-
-sub wrapper_backup_parse() {
-   if(defined(&command_backup_parse)) {
-      command_backup_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-      printf STDERR "`backup-parse' is not supported.\n";
-      exit 1;
-   }
-}
-
-sub wrapper_index_from_output() {
-   if(defined(&command_index_from_output)) {
-      command_index_from_output($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-      printf STDERR "`index-from-output' is not supported.\n";
-      exit 1;
-   }
-}
-
-sub wrapper_index_from_image() {
-   if(defined(&command_index_from_image)) {
-      command_index_from_image($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-      printf STDERR "command `index-from-image' is not supported.\n";
-      exit 1;
-   }
-}
-
-sub wrapper_restore() {
-   if(defined(&command_restore)) {
-      command_restore($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
-   }
-   else {
-     printf STDERR "`restore' is not supported.\n";
-     exit 1;
-   }
-}
-
-sub parse_options() {
-   my($no_option) = @_;
-   my($options, @options, $option, $name, $option_name, $value);
-
-   while($no_option <= $#ARGV) {
-      $options = $ARGV[${no_option}];
-      @options = split (/;/,$options);
-      foreach $option (@options) {
-         if( $option =~ /=/ ) {
-            ($name,$value) = split(/=/,$option);
-         }
-         else {
-            $name  = $option;
-            $value = 1;
-         }
-         $option_name = "option_$name";
-         $option_name =~ s/\-/\_/g;
-        $$option_name = $value;
-      }
-      $no_option++;
-   }
-}
-
-sub check_file {
-   my($filename, $mode) = @_;
-
-   stat($filename);
-
-   if($mode eq "e") {
-      if( -e _ ) {
-         print "OK $filename exists\n";
-      }
-      else {
-         print "ERROR [can not find $filename]\n";
-      }
-   }
-   elsif($mode eq "x") {
-      if( -x _ ) {
-         print "OK $filename executable\n";
-      }
-      else {
-         print "ERROR [can not execute $filename]\n";
-      }
-   }
-   elsif($mode eq "r") {
-      if( -r _ ) {
-         print "OK $filename readable\n";
-      }
-      else {
-         print "ERROR [can not read $filename]\n";
-      }
-   }
-   elsif($mode eq "w") {
-      if( -w _ ) {
-         print "OK $filename writable\n";
-      }
-      else {
-         print "ERROR [can not write $filename]\n";
-      }
-   }
-   else {
-      print "ERROR [check_file: unknow mode $mode]\n";
-   }
-}
-
-sub check_dir {
-}
-
-sub check_suid {
-}
-
-1;
diff --git a/example/DLT-A4.ps b/example/DLT-A4.ps
new file mode 100644 (file)
index 0000000..fed0893
--- /dev/null
@@ -0,0 +1,263 @@
+%!
+%%BoundingBox: 0 0 595 842
+%%Title: AMANDA ExaLabel
+%%Pages: 1
+%%EndComments
+
+%%%%
+%%%% This is a template file used by AMANDA to create PostScript tape
+%%%% labels for each dump.  This file is set up for DAT 4mm tapes,
+%%%% but you can edit it to work with anything.
+%%%%
+%%%% NOTE: this is quick-hack for DAT TAPES; it is simply a scaled 
+%%%% version of the Exabyte version.
+%%%%
+
+%
+% The label is made up of 6 parts:  statistics, tape name, date,
+% header, filesystem list, and the logo.  Geometrically, the label 
+% looks like this:
+%
+%   +------------------------+
+%   |statistics              |   <- section 'A'
+%   +----+-------------------+
+%   |logo|     TAPE_NAME     |   <- section 'B'  (logo) <- section 'F'
+%   |    | version      date |   <- section 'C'
+%   +----+--+--------+-------+
+%   | h   fs   l | h  fs   l |   <- section 'D'
+%   +-------+--------+-------+
+%   |            |           |   <- section 'E'
+%   |            |           |
+%   v            v           v
+%
+% Sections D and E, which hold the bulk of the information are 
+% cut into columns.
+%
+
+% Quick-hack for DAT tapes
+%
+
+72 25.4 div dup scale              %% scale to millimeters
+
+% section 'A' font, start position, and line separation
+%
+/StatFont              { /Courier findfont 4.5 scalefont setfont } def
+/StatPos               { 30 255 } def
+/StatSep               { 4 } def
+
+% section 'B' font and position (text centered around this point)
+%
+/TitleFont             { /Helvetica-Bold findfont 10 scalefont setfont } def
+/TitlePos              { 115 230 } def
+
+% section 'C' font, position of the date (left justified) and the version
+%
+/DateFont              { /Palatino-Bold findfont 5 scalefont setfont } def
+/DatePos               { 190 222 } def
+/VersFont              { /Palatino-Bold findfont 5 scalefont setfont } def
+/VersPos               { 43 222 } def
+
+% section 'D' font, and field positions (x coord is relative to each column)
+%
+
+/HeadingFont           { /Palatino-Bold findfont 5 scalefont setfont } def
+/HeadingHostPos                { 1 212 } def
+/HeadingFsPos          { 17 212 } def
+/HeadingLvlPos         { 57 212 } def
+
+% section 'E' font, and line separation
+%
+/HostFont              { /Courier findfont 2.6 scalefont setfont } def
+/HostSep               { 2.5 } def
+
+
+% the following rectangles separate the regions
+%
+/StatBox               { 200 260 15 240 } def
+/TitleBox              { 200 240 15 220 } def
+/LogoBox               { 35 240 15 220 } def
+/HeadingBox            { 200 220 15 210 } def
+/HostBox               { 200 210 15 0 } def
+% Punckmark marks center of page height to aid punching holes for ring binder
+/PunchMark             { 13 130 15 130 } def
+
+% number of columns for section 'E,' column width, position of first 
+% entry in first column, y coordinate of top and bottom of dividing lines
+%
+/NumColumns            { 3 } def
+/ColumnWidth           { 60 } def
+/ColumnBasePos         { 16 200 } def
+/TopColDivLine         { 201 } def
+/BotColDivLine         { 2 } def
+
+% 5
+
+%%%%
+%%%% END OF USER-CONFIGURABLE OPTIONS
+%%%%
+%%%% the rest of this file contains the internal functions that are used
+%%%% by genlabel to draw the label
+%%%%
+
+
+%
+% Initial Setup... draws everything that is the same for all labels
+%
+
+% function to draw a box
+%
+/box {
+       /ury exch def
+       /urx exch def
+       /lly exch def
+       /llx exch def
+
+       llx lly moveto
+       llx ury lineto
+       urx ury lineto
+       urx lly lineto
+       closepath
+} def
+
+
+% move the origin up a bit
+%
+0 19 translate
+
+% draw all of the boxes
+%
+0 setgray 
+.3 setlinewidth                                        % thick lines
+StatBox box stroke
+TitleBox box stroke
+LogoBox box stroke
+HeadingBox box stroke
+HostBox box stroke
+% and the PunchMark to aid puching ring binder holes
+PunchMark box stroke
+
+% draw the column dividers
+%
+0.2 setlinewidth                               % thin lines
+/i 1 def
+{
+       NumColumns i sub 0 le { exit } if       % no lines if this last col.
+       /xoff ColumnBasePos pop                 % get x base position
+          i ColumnWidth mul add def            % offset for this column
+       xoff TopColDivLine moveto 
+       xoff BotColDivLine lineto stroke        
+       /i i 1 add def
+} loop
+
+
+% draw the heading names
+%
+/i 0 def
+HeadingFont
+{
+       NumColumns i sub 0 le { exit } if
+       /xoff ColumnBasePos pop
+         i ColumnWidth mul add def
+       HeadingHostPos exch xoff add exch moveto
+         (Host) show
+       HeadingFsPos exch xoff add exch moveto
+         (Fs) show
+       HeadingLvlPos exch xoff add exch moveto
+         (*) show
+       /i i 1 add def
+} loop
+
+
+%
+% the following functions draw strings for each kind of information
+%
+
+/CurrStatY StatPos exch pop def
+ColumnBasePos /CurrColumnY exch def
+  /CurrColumnX exch def
+
+
+% DrawStat draws the string on the top of the stack in the next position
+% in section 'A'
+%
+/DrawStat {
+       StatFont
+       StatPos pop CurrStatY moveto
+       show
+       /CurrStatY CurrStatY StatSep sub def
+} def
+
+
+% DrawTitle draws the string on the top of the stack in section 'B'
+%
+/DrawTitle {
+       TitleFont
+       TitlePos moveto
+       dup stringwidth pop 2 div neg 0 rmoveto
+       show
+} def
+
+
+% DrawDate draws the string on the top of the stack in section 'C'
+%
+/DrawDate {
+       DateFont
+       DatePos moveto
+       dup stringwidth pop neg 0 rmoveto
+       show
+} def
+
+
+% DrawVers draws the string on the top of the stack in section 'C'
+%
+/DrawVers {
+       VersFont
+       VersPos moveto
+       show
+} def
+
+
+/StripDomain {
+
+(.) search {
+  3 1 roll pop pop
+} if
+
+} def
+
+/TrimFs {
+
+dup length 25 gt {
+  dup (*                         ) dup 4 2 roll length 24 sub 24 getinterval 1 exch putinterval
+} if
+
+} def
+
+
+% DrawHost expects five strings to be on the stack; right now it
+% uses only the first three.  The strings are Host Name, Partition Name,
+% Dump Level, Tape File Number, and Output Size.
+% 
+/DrawHost {
+       HostFont
+       pop pop pop                     % discard sizes and fileno
+       CurrColumnX HeadingLvlPos pop add CurrColumnY moveto
+       show
+       CurrColumnX HeadingFsPos pop add CurrColumnY moveto
+       TrimFs
+       show
+       CurrColumnX HeadingHostPos pop add CurrColumnY moveto
+       StripDomain
+       show
+       /CurrColumnY CurrColumnY HostSep sub def
+       CurrColumnY BotColDivLine lt {
+               /CurrColumnY ColumnBasePos exch pop def
+               /CurrColumnX CurrColumnX ColumnWidth add def
+       } if
+} def
+
+
+%%%%
+%%%% END OF TEMPLATE FILE
+%%%% 
+
index e22862bac033dfea481160d1471ae078a4a874e2..824aead04655caa0ad704e9ab8383fcdd563761e 100644 (file)
@@ -1,10 +1,43 @@
 # Makefile for sample configuration files
 
-noinst_DATA = amanda.conf \
-               amanda-client.conf
+include $(top_srcdir)/config/automake/installperms.am
 
-EXTRA_DIST =   chg-multi.conf chg-scsi.conf config.site disklist \
-               DLT.ps EXB-8500.ps HP-DAT.ps 8.5x11.ps 3hole.ps DIN-A4.ps \
+amanda_dir     = $(localstatedir)/lib/amanda
+templatedir   = $(amanda_dir)/template.d
+exampledir    = $(amanda_dir)/example
+lbltempldir   = $(amanda_dir)/example/label-templates
+
+EXTRA_DIST =   chg-multi.conf \
+               chg-scsi.conf \
+               config.site \
+               disklist \
                chg-mcutil.conf
 
+dist_template_DATA = template.d/advanced.conf \
+               template.d/amanda-harddisk.conf \
+               template.d/amanda-single-tape.conf \
+               template.d/amanda-tape-changer.conf \
+               template.d/amanda-S3.conf \
+               template.d/dumptypes \
+               template.d/tapetypes \
+               template.d/README   \
+               template.d/chg-manual.conf   
+
+dist_example_DATA = amanda.conf \
+              amanda-client.conf \
+              inetd.conf.amandaclient \
+              xinetd.amandaclient \
+              xinetd.amandaserver 
+
+dist_lbltempl_DATA = DLT.ps \
+                EXB-8500.ps \
+                HP-DAT.ps \
+                8.5x11.ps \
+                3hole.ps \
+               DLT-A4.ps \
+                DIN-A4.ps 
 
+INSTALLPERMS_data = chown=amanda \
+       dest=$(templatedir) $(dist_template_DATA) \
+       dest=$(exampledir) $(dist_example_DATA) \
+       dest=$(libtempldir) $(dist_libtempl_DATA) 
index 1144b74f426a7990b59c3bee84d07a8329766c8b..70c041d008d520c41a0aa80bf6a6f6b9febf03fd 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for sample configuration files
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -39,66 +74,147 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(dist_example_DATA) $(dist_lbltempl_DATA) \
+       $(dist_template_DATA) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/amanda-client.conf.in \
+       $(srcdir)/amanda.conf.in $(srcdir)/chg-mcutil.conf.in \
+       $(top_srcdir)/config/automake/installperms.am
 subdir = example
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/amanda-client.conf.in $(srcdir)/amanda.conf.in \
-       $(srcdir)/chg-mcutil.conf.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = amanda.conf chg-mcutil.conf amanda-client.conf
+CONFIG_CLEAN_FILES = amanda-client.conf amanda.conf chg-mcutil.conf
 SOURCES =
 DIST_SOURCES =
-DATA = $(noinst_DATA)
+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 = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(lbltempldir)" \
+       "$(DESTDIR)$(templatedir)"
+dist_exampleDATA_INSTALL = $(INSTALL_DATA)
+dist_lbltemplDATA_INSTALL = $(INSTALL_DATA)
+dist_templateDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_example_DATA) $(dist_lbltempl_DATA) \
+       $(dist_template_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -106,14 +222,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -124,20 +245,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -151,60 +271,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -214,10 +443,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -228,24 +471,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -257,59 +534,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -318,36 +582,79 @@ 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@
 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@
-noinst_DATA = amanda.conf \
-               amanda-client.conf
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 
-EXTRA_DIST = chg-multi.conf chg-scsi.conf config.site disklist \
-               DLT.ps EXB-8500.ps HP-DAT.ps 8.5x11.ps 3hole.ps DIN-A4.ps \
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
+amanda_dir = $(localstatedir)/lib/amanda
+templatedir = $(amanda_dir)/template.d
+exampledir = $(amanda_dir)/example
+lbltempldir = $(amanda_dir)/example/label-templates
+EXTRA_DIST = chg-multi.conf \
+               chg-scsi.conf \
+               config.site \
+               disklist \
                chg-mcutil.conf
 
+dist_template_DATA = template.d/advanced.conf \
+               template.d/amanda-harddisk.conf \
+               template.d/amanda-single-tape.conf \
+               template.d/amanda-tape-changer.conf \
+               template.d/amanda-S3.conf \
+               template.d/dumptypes \
+               template.d/tapetypes \
+               template.d/README   \
+               template.d/chg-manual.conf   
+
+dist_example_DATA = amanda.conf \
+              amanda-client.conf \
+              inetd.conf.amandaclient \
+              xinetd.amandaclient \
+              xinetd.amandaserver 
+
+dist_lbltempl_DATA = DLT.ps \
+                EXB-8500.ps \
+                HP-DAT.ps \
+                8.5x11.ps \
+                3hole.ps \
+               DLT-A4.ps \
+                DIN-A4.ps 
+
+INSTALLPERMS_data = chown=amanda \
+       dest=$(templatedir) $(dist_template_DATA) \
+       dest=$(exampledir) $(dist_example_DATA) \
+       dest=$(libtempldir) $(dist_libtempl_DATA) 
+
 all: all-am
 
 .SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -376,22 +683,69 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+amanda-client.conf: $(top_builddir)/config.status $(srcdir)/amanda-client.conf.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 amanda.conf: $(top_builddir)/config.status $(srcdir)/amanda.conf.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 chg-mcutil.conf: $(top_builddir)/config.status $(srcdir)/chg-mcutil.conf.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amanda-client.conf: $(top_builddir)/config.status $(srcdir)/amanda-client.conf.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
        -rm -f *.lo
 
 clean-libtool:
        -rm -rf .libs _libs
+install-dist_exampleDATA: $(dist_example_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
+       @list='$(dist_example_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dist_exampleDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(exampledir)/$$f'"; \
+         $(dist_exampleDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(exampledir)/$$f"; \
+       done
+
+uninstall-dist_exampleDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_example_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(exampledir)/$$f'"; \
+         rm -f "$(DESTDIR)$(exampledir)/$$f"; \
+       done
+install-dist_lbltemplDATA: $(dist_lbltempl_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(lbltempldir)" || $(MKDIR_P) "$(DESTDIR)$(lbltempldir)"
+       @list='$(dist_lbltempl_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dist_lbltemplDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(lbltempldir)/$$f'"; \
+         $(dist_lbltemplDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(lbltempldir)/$$f"; \
+       done
+
+uninstall-dist_lbltemplDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_lbltempl_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(lbltempldir)/$$f'"; \
+         rm -f "$(DESTDIR)$(lbltempldir)/$$f"; \
+       done
+install-dist_templateDATA: $(dist_template_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(templatedir)" || $(MKDIR_P) "$(DESTDIR)$(templatedir)"
+       @list='$(dist_template_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dist_templateDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(templatedir)/$$f'"; \
+         $(dist_templateDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(templatedir)/$$f"; \
+       done
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
+uninstall-dist_templateDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_template_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(templatedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(templatedir)/$$f"; \
+       done
 tags: TAGS
 TAGS:
 
@@ -400,22 +754,21 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -430,6 +783,9 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(DATA)
 installdirs:
+       for dir in "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(lbltempldir)" "$(DESTDIR)$(templatedir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
 install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
@@ -454,13 +810,15 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -472,14 +830,27 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-dist_exampleDATA install-dist_lbltemplDATA \
+       install-dist_templateDATA
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
 install-exec-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+install-html: install-html-am
 
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -498,18 +869,73 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am: uninstall-dist_exampleDATA uninstall-dist_lbltemplDATA \
+       uninstall-dist_templateDATA
+
+.MAKE: install-am install-data-am install-exec-am install-strip
 
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
        distclean distclean-generic distclean-libtool distdir dvi \
        dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-exec install-exec-am \
-       install-info install-info-am install-man install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic \
-       mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-       uninstall-info-am
-
+       install-data install-data-am install-data-hook \
+       install-dist_exampleDATA install-dist_lbltemplDATA \
+       install-dist_templateDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-exec-hook install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       uninstall uninstall-am uninstall-dist_exampleDATA \
+       uninstall-dist_lbltemplDATA uninstall-dist_templateDATA
+
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
 # 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/example/amanda-client.conf b/example/amanda-client.conf
new file mode 100644 (file)
index 0000000..2179acb
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# amanda.conf - sample Amanda client configuration file.
+#
+# This file normally goes in /etc/amanda/amanda-client.conf.
+#
+
+conf "DailySet1"               # your config name
+
+index_server "kdc.localdomain" # your amindexd server
+tape_server  "kdc.localdomain" # your amidxtaped server
+#tapedev      "tape:/dev/YOUR-TAPE-DEVICE-HERE"        # your tape device
+                       # if not set, Use configure or ask server.
+                       # if set to empty string "", ask server
+                       # amrecover will use the changer if set to the value
+                       # of 'amrecover_changer' in the server amanda.conf.
+
+#   auth       - authentication scheme to use between server and client.
+#                Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
+#                "rsh" and "ssh".  
+#                Default: [auth "bsdtcp"]
+auth "bsdtcp"
+
+ssh_keys ""                    # your ssh keys file if you use ssh auth
+
index c4cb9b9bcb36d623e14f7e35ab69cded4d268362..10e859d269146ebf65c88479e24896109eb463cd 100644 (file)
@@ -1,13 +1,3 @@
-###  !!! WARNING !!!  !!! WARNING !!!  !!! WARNING !!!  !!! WARNING !!!  ###
-###                                                                      ###
-###  This file is not meant to be installed "as is", and in fact, it     ###
-###  WILL NOT WORK!  You must go through it and make changes appropriate ###
-###  to your own situation.  See the documentation in this file, in the  ###
-###  "man amanda" man page, in the "docs" directory and at the Amanda    ###
-###  web page (www.amanda.org).                                          ###
-###                                                                      ###
-###  !!! WARNING !!!  !!! WARNING !!!  !!! WARNING !!!  !!! WARNING !!!  ###
-
 #
 # amanda.conf - sample Amanda client configuration file.
 #
@@ -18,17 +8,17 @@ conf "@DEFAULT_CONFIG@"              # your config name
 
 index_server "@DEFAULT_SERVER@"        # your amindexd server
 tape_server  "@DEFAULT_TAPE_SERVER@"   # your amidxtaped server
-tapedev      "@EXAMPLE_TAPEDEV@"       # your tape device
+#tapedev      "@EXAMPLE_TAPEDEV@"      # your tape device
+                       # if not set, Use configure or ask server.
+                       # if set to empty string "", ask server
+                       # amrecover will use the changer if set to the value
+                       # of 'amrecover_changer' in the server amanda.conf.
 
 #   auth       - authentication scheme to use between server and client.
-#                Valid values are "bsd", "krb4", "krb5" and "ssh".  
-#                Default: [auth "bsd"]
-auth "bsd"
+#                Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
+#                "rsh" and "ssh".  
+#                Default: [auth "bsdtcp"]
+auth "bsdtcp"
 
 ssh_keys ""                    # your ssh keys file if you use ssh auth
 
-# You may include other amanda configuration files, so you can share
-# dumptypes, tapetypes and interface definitions among several
-# configurations.
-
-#includefile "@CONFIG_DIR@/amanda-client.conf.main"
diff --git a/example/amanda.conf b/example/amanda.conf
new file mode 100644 (file)
index 0000000..61316b5
--- /dev/null
@@ -0,0 +1,732 @@
+# amanda.conf - sample Amanda configuration file. See amanda.conf(5) for 
+# details
+
+org     "DailySet1"    # your organization name for reports
+mailto          "martinea"     # space separated list of operators at your site
+dumpuser "martinea"    # the user to run dumps under
+
+inparallel 4           # maximum dumpers that will run in parallel (max 63)
+                       # this maximum can be increased at compile-time,
+                       # modifying MAX_DUMPERS in server-src/driverio.h
+dumporder "sssS"       # specify the priority order of each dumper
+                       #   s -> smallest size
+                       #   S -> biggest size
+                       #   t -> smallest time
+                       #   T -> biggest time
+                       #   b -> smallest bandwitdh
+                       #   B -> biggest bandwitdh
+                       # try "BTBTBTBTBTBT" if you are not holding
+                       # disk constrained
+
+taperalgo first                # The algorithm used to choose which dump image to send
+                       # to the taper.
+                       # Possible values: 
+                       # [first|firstfit|largest|largestfit|smallest|last]
+                       # Default: first. 
+                       # first         First in - first out.
+                       # firstfit      The first dump image that will fit 
+                        #               on the current tape.
+                       # largest       The largest dump image.
+                       # largestfit    The largest dump image that will fit 
+                        #               on the current tape.
+                       # smallest      The smallest dump image.
+                       # last          Last in - first out.
+
+displayunit "k"                # Possible values: "k|m|g|t"
+                       # Default: k. 
+                       # The unit used to print many numbers.
+                       # k=kilo, m=mega, g=giga, t=tera
+                       
+netusage  8000 Kbps    # maximum net bandwidth for Amanda, in KB per sec
+
+dumpcycle 4 weeks      # the number of days in the normal dump cycle
+runspercycle 20         # the number of amdump runs in dumpcycle days
+                       # (4 weeks * 5 amdump runs per week -- just weekdays)
+tapecycle 25 tapes     # the number of tapes in rotation
+                       # 4 weeks (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+
+bumpsize 20 Mb         # minimum savings (threshold) to bump level 1 -> 2
+bumppercent 20         # minimum savings (threshold) to bump level 1 -> 2
+bumpdays 1             # minimum days at each level
+bumpmult 4             # threshold = bumpsize * bumpmult^(level-1)
+
+etimeout 300           # number of seconds per filesystem for estimates.
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+device_output_buffer_size 1280k
+                        # amount of buffer space to use when writing to devices
+
+# By default, Amanda can only track at most one run per calendar day. When
+# the usetimestamps option is enabled, however, Amanda can track as many
+# runs as you care to make.
+# WARNING: This option is not backward-compatible. Do not enable it if you
+#          intend to downgrade your server installation to Amanda community 
+#          edition 2.5
+usetimestamps yes
+
+# flush-threshold-dumped, flush-threshold-scheduled, taperflush, and autoflush
+# are used to control tape utilization. See the amanda.conf (5) manpage for
+# details on how they work. Taping will not start until all criteria are
+# satisfied. Here are some examples:
+#
+# You want to fill tapes completely even in the case of failed dumps, and
+# don't care if some dumps are left on the holding disk after a run:
+# flush-threshold-dumped       100 # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush                   100
+# autoflush                    yes
+#
+# You want to improve tape performance by waiting for a complete tape of data
+# before writing anything. However, all dumps will be flushed; none will
+# be left on the holding disk.
+# flush-threshold-dumped       100 # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush   0
+#
+# You don't want to use a new tape for every run, but want to start writing
+# to tape as soon as possible:
+# flush-threshold-dumped       0   # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush   100
+# autoflush     yes
+# maxdumpsize   100k # amount of data to dump each run; see above.
+#
+# You want to keep the most recent dumps on holding disk, for faster recovery.
+# Older dumps will be rotated to tape during each run.
+# flush-threshold-dumped       300 # (or more)
+# flush-threshold-scheduled    300 # (or more)
+# taperflush   300
+# autoflush     yes
+#
+# Defaults:
+# (no restrictions; flush to tape immediately; don't flush old dumps.)
+flush-threshold-dumped 0
+flush-threshold-scheduled 0
+taperflush 0
+autoflush no
+
+# Specify tape device and/or tape changer.  If you don't have a tape
+# changer, and you don't want to use more than one tape per run of
+# amdump, just comment out the definition of tpchanger.
+
+# Some tape changers require tapedev to be defined; others will use
+# their own tape device selection mechanism.  Some use a separate tape
+# changer device (changerdev), others will simply ignore this
+# parameter.  Some rely on a configuration file (changerfile) to
+# obtain more information about tape devices, number of slots, etc;
+# others just need to store some data in files, whose names will start
+# with changerfile.  
+
+# At most one changerfile entry must be defined; select the most
+# appropriate one for your configuration.  If you select man-changer,
+# keep the first one; if you decide not to use a tape changer, you may
+# comment them all out.
+
+runtapes 1                     # number of tapes to be used in a single run of amdump
+tpchanger "chg-manual"         # the tape-changer glue script
+tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE"      # the no-rewind tape device to be used
+
+#changerfile "/etc/amanda/DailySet1/changer"
+#changerfile "/etc/amanda/DailySet1/changer-status"
+changerfile "/etc/amanda/DailySet1/changer.conf"
+changerdev "/dev/null"
+
+# If you want Amanda to automatically label any non-Amanda tapes it
+# encounters, uncomment the line below. Note that this will ERASE any
+# non-Amanda tapes you may have, and may also ERASE any near-failing tapes.
+# Use with caution.
+## label_new_tapes "DailySet1-%%%"
+
+maxdumpsize -1         # Maximum number of bytes the planner will schedule
+                       # for a run (default: runtapes * tape_length).
+tapetype HP-DAT                # what kind of tape it is (see tapetypes below)
+labelstr "^DailySet1-[0-9][0-9]*$"     # label constraint regex: all tapes must match
+
+amrecover_do_fsf yes           # amrecover will call amrestore with the
+                               # -f flag for faster positioning of the tape.
+amrecover_check_label yes      # amrecover will call amrestore with the
+                               # -l flag to check the label.
+amrecover_changer "changer"    # amrecover will use the changer if you restore
+    # from this device. It could be a string like 'changer' and amrecover will use your
+    # changer if you set your tape to 'changer' with 'setdevice changer' or via 
+    # 'tapedev "changer"' in amanda-client.conf
+
+# Specify holding disks.  These are used as a temporary staging area for
+# dumps before they are written to tape and are recommended for most sites.
+# The advantages include: tape drive is more likely to operate in streaming
+# mode (which reduces tape and drive wear, reduces total dump time); multiple
+# dumps can be done in parallel (which can dramatically reduce total dump time.
+# The main disadvantage is that dumps on the holding disk need to be flushed
+# (with amflush) to tape after an operating system crash or a tape failure.
+# If no holding disks are specified then all dumps will be written directly
+# to tape.  If a dump is too big to fit on the holding disk than it will be
+# written directly to tape.  If more than one holding disk is specified then
+# they will all be used based on activity and available space.
+
+holdingdisk hd1 {
+    comment "main holding disk"
+    directory "/dumps/amanda"  # where the holding disk is
+    use -100 Mb                        # how much space can we use on it
+                               # a non-positive value means:
+                               # use all space but that value
+    chunksize 1Gb      # size of chunk if you want big dump to be
+                       # dumped on multiple files on holding disks
+                       #  N Kb/Mb/Gb split images in chunks of size N
+                       #             The maximum value should be
+                       #             (MAX_FILE_SIZE - 1Mb)
+                       #  0          same as INT_MAX bytes
+    }
+#holdingdisk hd2 {
+#    directory "/dumps2/amanda"
+#    use 1000 Mb
+#    }
+#holdingdisk hd3 {
+#    directory "/mnt/disk4"
+#    use 1000 Mb
+#    }
+
+
+# If amanda cannot find a tape on which to store backups, it will run
+# as many backups as it can to the holding disks.  In order to save
+# space for unattended backups, by default, amanda will only perform
+# incremental backups in this case, i.e., it will reserve 100% of the
+# holding disk space for the so-called degraded mode backups.
+# However, if you specify a different value for the `reserve'
+# parameter, amanda will not degrade backups if they will fit in the
+# non-reserved portion of the holding disk.
+
+# reserve 30 # percent
+# This means save at least 30% of the holding disk space for degraded
+# mode backups.  
+
+# The format for a ColumnSpec is a ',' seperated list of triples.
+# Each triple consists of
+#   + the name of the column (as in ColumnNameStrings)
+#   + prefix before the column
+#   + the width of the column, if set to -1 it will be recalculated
+#     to the maximum length of a line to print.
+# Example:
+#      "Disk=1:17,HostName=1:10,OutKB=1:7"
+# or
+#      "Disk=1:-1,HostName=1:10,OutKB=1:7"
+#        
+# You need only specify those colums that should be changed from
+# the default. If nothing is specified in the configfile, the
+# above compiled in values will be in effect, resulting in an
+# output as it was all the time.
+# The names of the colums are:
+# HostName, Disk, Level, OrigKB, OutKB, Compress, DumpTime, DumpRate,
+# TapeTime and TapeRate.
+#                                                      ElB, 1999-02-24.
+# columnspec "Disk=1:18,HostName=0:10,OutKB=1:7"
+
+
+# Amanda needs a few Mb of diskspace for the log and debug files,
+# as well as a database.  This stuff can grow large, so the conf directory
+# isn't usually appropriate.  Some sites use /usr/local/var and some /usr/adm.
+# Create an amanda directory under there.  You need a separate infofile and
+# logdir for each configuration, so create subdirectories for each conf and
+# put the files there.  Specify the locations below.
+
+# Note that, although the keyword below is infofile, it is only so for
+# historic reasons, since now it is supposed to be a directory (unless
+# you have selected some database format other than the `text' default)
+infofile "/etc/amanda/DailySet1/curinfo"       # database DIRECTORY
+logdir   "/etc/amanda/DailySet1"               # log directory
+indexdir "/etc/amanda/DailySet1/index"         # index directory
+#tapelist "/etc/amanda/DailySet1/tapelist"     # list of used tapes
+# tapelist is stored, by default, in the directory that contains amanda.conf
+
+# tapetypes
+
+# Define the type of tape you use here, and use it in "tapetype"
+# above.  Some typical types of tapes are included here.  The tapetype
+# tells amanda how many MB will fit on the tape, how big the filemarks
+# are, and how fast the tape device is.
+
+# A filemark is the amount of wasted space every time a tape section
+# ends.  If you run `make tapetype' in tape-src, you'll get a program
+# that generates tapetype entries, but it is slow as hell, use it only
+# if you really must and, if you do, make sure you post the data to
+# the amanda mailing list, so that others can use what you found out
+# by searching the archives.
+
+# For completeness Amanda should calculate the inter-record gaps too,
+# but it doesn't.  For EXABYTE and DAT tapes this is ok.  Anyone using
+# 9 tracks for amanda and need IRG calculations?  Drop me a note if
+# so.
+
+# If you want amanda to print postscript paper tape labels
+# add a line after the comment in the tapetype of the form
+#    lbl-templ "/path/to/postscript/template/label.ps"
+
+# if you want the label to go to a printer other than the default
+# for your system, you can also add a line above for a different
+# printer. (i usually add that line after the dumpuser specification)
+
+# dumpuser "operator"     # the user to run dumps under
+# printer "mypostscript"  # printer to print paper label on
+
+# here is an example of my definition for an EXB-8500
+
+# define tapetype EXB-8500 {
+# ...
+#     lbl-templ "/etc/amanda/config/lbl.exabyte.ps"
+# }
+
+
+define tapetype QIC-60 {
+    comment "Archive Viper"
+    length 60 mbytes
+    filemark 100 kbytes                # don't know a better value
+    speed 100 kbytes           # dito
+}
+
+define tapetype DEC-DLT2000 {
+    comment "DEC Differential Digital Linear Tape 2000"
+    length 15000 mbytes
+    filemark 8 kbytes
+    speed 1250 kbytes
+}
+
+# goluboff@butch.Colorado.EDU
+# in amanda-users (Thu Dec 26 01:55:38 MEZ 1996)
+define tapetype DLT {
+    comment "DLT tape drives"
+    length 20000 mbytes                # 20 Gig tapes
+    filemark 2000 kbytes       # I don't know what this means
+    speed 1536 kbytes          # 1.5 Mb/s
+}
+
+define tapetype SURESTORE-1200E {
+    comment "HP AutoLoader"
+    length 3900 mbytes
+    filemark 100 kbytes
+    speed 500 kbytes
+}
+
+define tapetype EXB-8500 {
+    comment "Exabyte EXB-8500 drive on decent machine"
+    length 4200 mbytes
+    filemark 48 kbytes
+    speed 474 kbytes                   
+}
+
+define tapetype EXB-8200 {
+    comment "Exabyte EXB-8200 drive on decent machine"
+    length 2200 mbytes
+    filemark 2130 kbytes
+    speed 240 kbytes                   
+}
+
+define tapetype HP-DAT {
+    comment "DAT tape drives"
+    # data provided by Rob Browning <rlb@cs.utexas.edu>
+    length 1930 mbytes
+    filemark 111 kbytes
+    speed 468 kbytes
+}
+
+define tapetype DAT {
+    comment "DAT tape drives"
+    length 1000 mbytes         # these numbers are not accurate
+    filemark 100 kbytes                # but you get the idea
+    speed 100 kbytes
+}
+
+define tapetype MIMSY-MEGATAPE {
+    comment "Megatape (Exabyte based) drive through Emulex on Vax 8600"
+    length 2200 mbytes
+    filemark 2130 kbytes
+    speed 170 kbytes           # limited by the Emulex bus interface, ugh
+}
+
+define tapetype SEAGATE-ULTRIUM-LTO {
+     comment "SEAGATE ULTRIUM 06242 LTO, compression off"
+     length 99584 mbytes
+     filemark 0 kbytes
+     speed 11288 kps
+}
+
+# dumptypes
+#
+# These are referred to by the disklist file.  The dumptype specifies
+# certain parameters for dumping including:
+#   auth       - authentication scheme to use between server and client.
+#                Valid values are "bsd", "krb4", "krb5" and "ssh".  
+#                Default: [auth bsd]
+#   comment    - just a comment string
+#   comprate   - set default compression rate.  Should be followed by one or
+#                two numbers, optionally separated by a comma.  The 1st is
+#                the full compression rate; the 2nd is the incremental rate.
+#                If the second is omitted, it is assumed equal to the first.
+#                The numbers represent the amount of the original file the
+#                compressed file is expected to take up.
+#                Default: [comprate 0.50, 0.50]
+#   compress   - specify compression of the backed up data.  Valid values are:
+#                "none"        - don't compress the dump output.
+#                "client best" - compress on the client using the best (and
+#                                probably slowest) algorithm.
+#                "client fast" - compress on the client using fast algorithm.
+#                "client custom" - compress using your custom client compression program.
+#                                  use client_custom_compress "PROG" to specify
+#                                  the custom compression program.
+#                                  PROG must not contain white space.
+#                "server best" - compress on the tape host using the best (and
+#                                probably slowest) algorithm.
+#                "server fast" - compress on the tape host using a fast
+#                                algorithm.  This may be useful when a fast
+#                                tape host is backing up slow clients.
+#                "server custom" - compress using your server custom compression program.
+#                                  use server_custom_compress "PROG" to specify
+#                                  the custom compression program.
+#                                  PROG must not contain white space.
+#                Default: [compress client fast]
+#   dumpcycle  - set the number of days in the dump cycle, ie, set how often a
+#                full dump should be performed.  Default: from DUMPCYCLE above
+#   estimate      Determine the way AMANDA does it's estimate. 
+#                "client"      - Use the same program as the dumping program,
+#                              this is the most accurate way to do estimates, 
+#                              but it can take a long time.
+#                "calcsize"    - Use a faster program to do estimates, but the
+#                              result is less accurate.
+#                "server"      - Use only statistics from the previous run to 
+#                              give an estimate, 
+#                              it takes only a few seconds but the result is not 
+#                              accurate if your disk usage changes from day to day.
+#                Default: [client]
+#   encrypt  - specify encryption of the backed up data. Valid values are:
+#                "none"   - don't encrypt the dump output.
+#                "client" - encrypt on the client using the program specified by 
+#                            client_encrypt "PROG".
+#                           Use client_decrypt_option to specify the decrypt- 
+#                            parameter, default is "-d".
+#                            PROG and decrypt-parameter must not contain white space.     
+#                "server" - encrypt on the server using the program specified by 
+#                            server_encrypt "PROG".
+#                            Use server_decrypt_option to specify the decrypt- 
+#                            parameter, default is "-d".
+#                            PROG and decrypt-parameter must not contain white space.
+#                 Default: [none]
+#   exclude    - specify files and directories to be excluded from the dump.
+#                Useful with gnutar only; silently ignored by dump and samba.
+#                Valid values are:
+#                "pattern"       - a shell glob pattern defining which files
+#                                  to exclude.
+#                                  gnutar gets --exclude="pattern"
+#                list "filename" - a file (on the client!) containing patterns
+#                                  re's (1 per line) defining which files to
+#                                  exclude.
+#                                  gnutar gets --exclude-from="filename"
+#                Note that the `full pathname' of a file within its
+#                filesystem starts with `./', because of the way amanda runs
+#                gnutar: `tar -C $mountpoint -cf - --lots-of-options .' (note
+#                the final dot!)  Thus, if you're backing up `/usr' with a
+#                diskfile entry like ``host /usr gnutar-root', but you don't
+#                want to backup /usr/tmp, your exclude list should contain
+#                the pattern `./tmp', as this is relative to the `/usr' above.
+#                Please refer to the man-page of gnutar for more information.
+#                If a relative pathname is specified as the exclude list,
+#                it is searched from within the directory that is
+#                going to be backed up.
+#                Default: include all files
+#   holdingdisk        - should the holding disk be used for this dump.  Useful for
+#                dumping the holding disk itself.  Default: [holdingdisk auto]
+#                "never"    - Never use the holding disk.
+#                "auto"     - Use the holding disk if possible.
+#                "required" - Always use the holding disk.
+#   ignore     - do not back this filesystem up.  Useful for sharing a single
+#                disklist in several configurations.
+#   index      - keep an index of the files backed up.  Default: [index no]
+#   kencrypt   - encrypt the data stream between the client and server.
+#                Default: [kencrypt no]
+#   maxdumps   - max number of concurrent dumps to run on the client.
+#                Default: [maxdumps 1]
+#   maxpromoteday - max number of day for a promotion, set it 0 if you don't
+#                want promotion, set it to 1 or 2 if your disk get
+#                overpromoted.
+#                Default: [10000]
+#   priority   - priority level of the dump.  Valid levels are "low", "medium"
+#                or "high".  These are really only used when Amanda has no
+#                tape to write to because of some error.  In that "degraded
+#                mode", as many incrementals as will fit on the holding disk
+#                are done, higher priority first, to insure the important
+#                disks are at least dumped.  Default: [priority medium]
+#   program    - specify the dump system to use.  Valid values are "DUMP",
+#                 or "GNUTAR".  Default: [program "DUMP"].
+#   record     - record the backup in the time-stamp-database of the backup
+#                program (e.g. /etc/dumpdates for DUMP or
+#                @GNUTAR_LISTED_INCREMENTAL_DIRX@ for GNUTAR.).
+#                Default: [record yes]
+#   skip-full  - skip the disk when a level 0 is due, to allow full backups
+#                outside Amanda, eg when the machine is in single-user mode.
+#   skip-incr  - skip the disk when the level 0 is NOT due.  This is used in
+#                archive configurations, where only full dumps are done and
+#                the tapes saved.
+#   starttime  - delay the start of the dump?  Default: no delay
+#   strategy   - set the dump strategy.  Valid strategies are currently:
+#                "standard" - the standard one.
+#                "nofull"   - do level 1 dumps every time.  This can be used,
+#                             for example, for small root filesystems that
+#                             only change slightly relative to a site-wide
+#                             prototype.  Amanda then backs up just the
+#                             changes.
+#                "noinc"    - do level 0 dumps every time.
+#                "skip"     - skip all dumps.  Useful for sharing a single
+#                             disklist in several configurations.
+#                "incronly" - do only incremental dumps. This is similar
+#                              to strategy 'nofull', but will increase
+#                              the dump level as usual. Full dumps will
+#                              only be performed when an 'amadmin force' 
+#                              has been issued 
+#                Default: [strategy standard]
+# tape_splitsize - (optional) split dump file into pieces of a specified size.
+#                This allows dumps to be spread across multiple tapes, and can
+#                potentially make more efficient use of tape space.  Note that
+#                if this value is too large (more than half the size of the
+#                average dump being split), substantial tape space can be
+#                wasted.  If too small, large dumps will be split into
+#                innumerable tiny dumpfiles, adding to restoration complexity.
+#                A good rule of thumb, usually, is 1/10 of the size of your
+#                tape.  Default: [disabled]
+# split_diskbuffer - (optional) When dumping a split dump  in  PORT-WRITE
+#                 mode (usually meaning "no holding disk"), buffer the split
+#                chunks to a file in the directory specified by this option.
+#                Default: [none]
+# fallback_splitsize - (optional) When dumping a split dump  in  PORT-WRITE
+#                 mode, if no split_diskbuffer is specified (or if we somehow
+#                 fail to use our split_diskbuffer), we must buffer split
+#                 chunks in memory.  This specifies the maximum size split
+#                 chunks can be in this scenario, and thus the maximum amount
+#                 of memory consumed for in-memory splitting.  Default: [10m]
+#
+# Note that you may specify previously defined dumptypes as a shorthand way of
+# defining parameters.
+
+define dumptype global {
+    comment "Global definitions"
+    # This is quite useful for setting global parameters, so you don't have
+    # to type them everywhere.  All dumptype definitions in this sample file
+    # do include these definitions, either directly or indirectly.
+    # There's nothing special about the name `global'; if you create any
+    # dumptype that does not contain the word `global' or the name of any
+    # other dumptype that contains it, these definitions won't apply.
+    # Note that these definitions may be overridden in other
+    # dumptypes, if the redefinitions appear *after* the `global'
+    # dumptype name.
+    # You may want to use this for globally enabling or disabling
+    # indexing, recording, etc.  Some examples:
+    # index yes
+    # record no
+    # split_diskbuffer "/raid/amanda"
+    # fallback_splitsize 64m
+}
+
+define dumptype always-full {
+    global
+    comment "Full dump of this filesystem always"
+    compress none
+    priority high
+    dumpcycle 0
+}
+
+# Dumptypes for gnutar
+define dumptype root-tar {
+    global
+    program "GNUTAR"
+    comment "root partitions dumped with tar"
+    compress none
+    index
+#   exclude list "/etc/amanda/exclude.gtar"
+    priority low
+}
+
+define dumptype user-tar {
+    root-tar
+    comment "user partitions dumped with tar"
+    priority medium
+}
+
+define dumptype user-tar-span {
+    root-tar
+    tape_splitsize 3 Gb
+    comment "tape-spanning user partitions dumped with tar"
+    priority medium
+}
+
+define dumptype high-tar {
+    root-tar
+    comment "partitions dumped with tar"
+    priority high
+}
+
+define dumptype comp-root-tar {
+    root-tar
+    comment "Root partitions with compression"
+    compress client fast
+}
+
+define dumptype comp-user-tar {
+    user-tar
+    compress client fast
+}
+
+define dumptype comp-user-tar-span {
+    user-tar-span
+    compress client fast
+}
+
+define dumptype holding-disk {
+    global
+    comment "The master-host holding disk itself"
+    holdingdisk never # do not use the holding disk
+    priority medium
+}
+
+define dumptype comp-user {
+    global
+    comment "Non-root partitions on reasonably fast machines"
+    compress client fast
+    priority medium
+}
+
+define dumptype comp-user-span {
+    global
+    tape_splitsize 5 Gb
+    comment "Tape-spanning non-root partitions on reasonably fast machines"
+    compress client fast
+    priority medium
+}
+
+define dumptype nocomp-user {
+    comp-user
+    comment "Non-root partitions on slow machines"
+    compress none
+}
+
+define dumptype nocomp-user-span {
+    comp-user-span
+    comment "Tape-spanning non-root partitions on slow machines"
+    compress none
+}
+
+define dumptype comp-root {
+    global
+    comment "Root partitions with compression"
+    compress client fast
+    priority low
+}
+
+define dumptype nocomp-root {
+    comp-root
+    comment "Root partitions without compression"
+    compress none
+}
+
+define dumptype comp-high {
+    global
+    comment "very important partitions on fast machines"
+    compress client best
+    priority high
+}
+
+define dumptype nocomp-high {
+    comp-high
+    comment "very important partitions on slow machines"
+    compress none
+}
+
+define dumptype nocomp-test {
+    global
+    comment "test dump without compression, no /etc/dumpdates recording"
+    compress none
+    record no
+    priority medium
+}
+
+define dumptype comp-test {
+    nocomp-test
+    comment "test dump with compression, no /etc/dumpdates recording"
+    compress client fast
+}
+
+define dumptype custom-compress {
+   global
+   program "GNUTAR"
+   comment "custom client compression dumped with tar"
+   compress client custom
+   client_custom_compress "/usr/bin/bzip2"
+}
+
+define dumptype server-encrypt-fast {
+   global
+   program "GNUTAR"
+   comment "fast client compression and server symmetric encryption"
+   compress client fast
+   encrypt server
+   server_encrypt "/usr/sbin/amcrypt"
+   server_decrypt_option "-d"
+}
+
+define dumptype client-encrypt-nocomp {
+   global
+   program "GNUTAR"
+   comment "no compression and client symmetric encryption"
+   compress none
+   encrypt client
+   client_encrypt "/usr/sbin/amcrypt"
+   client_decrypt_option "-d"
+}
+
+
+# To use gpg public-key encryption, gpg does compress with zlib by default.
+# Thus, no need to specify compress
+
+#define dumptype gpg-encrypt {
+#    global
+#    program "GNUTAR"
+#    comment "server public-key encryption, dumped with tar"
+#    compress none
+#    encrypt server
+#    server_encrypt "/usr/sbin/amgpgcrypt"
+#    server_decrypt_option "-d"
+#}
+
+
+# network interfaces
+#
+# These are referred to by the disklist file.  They define the attributes
+# of the network interface that the remote machine is accessed through.
+# Notes: - netusage above defines the attributes that are used when the
+#          disklist entry doesn't specify otherwise.
+#        - the values below are only samples.
+#        - specifying an interface does not force the traffic to pass
+#          through that interface.  Your OS routing tables do that.  This
+#          is just a mechanism to stop Amanda trashing your network.
+# Attributes are:
+#      use             - bandwidth above which amanda won't start
+#                        backups using this interface.  Note that if
+#                        a single backup will take more than that,
+#                        amanda won't try to make it run slower!
+
+define interface local {
+    comment "a local disk"
+    use 8000 kbps
+}
+
+#define interface le0 {
+#    comment "10 Mbps ethernet"
+#    use 400 kbps
+#}
+
+# You may include other amanda configuration files, so you can share
+# dumptypes, tapetypes and interface definitions among several
+# configurations.
+
+#includefile "/etc/amanda/amanda.conf.main"
index 1cd99783b94e371480e1f7894aaedf87e0c30644..5e9df2bc155be3b35bd79221d8b694360461d6a4 100644 (file)
@@ -37,7 +37,7 @@ displayunit "k"               # Possible values: "k|m|g|t"
                        # The unit used to print many numbers.
                        # k=kilo, m=mega, g=giga, t=tera
                        
-netusage  600 Kbps     # maximum net bandwidth for Amanda, in KB per sec
+netusage  8000 Kbps    # maximum net bandwidth for Amanda, in KB per sec
 
 dumpcycle 4 weeks      # the number of days in the normal dump cycle
 runspercycle 20         # the number of amdump runs in dumpcycle days
@@ -59,8 +59,8 @@ dtimeout 1800         # number of idle seconds before a dump is aborted.
 ctimeout 30            # maximum number of seconds that amcheck waits
                        # for each client host
  
-tapebufs 20             # A positive integer telling taper how many 
-                        # 32k buffers to allocate.  The default is 20 (640k).
+device_output_buffer_size 1280k
+                        # amount of buffer space to use when writing to devices
 
 # By default, Amanda can only track at most one run per calendar day. When
 # the usetimestamps option is enabled, however, Amanda can track as many
@@ -70,6 +70,46 @@ tapebufs 20             # A positive integer telling taper how many
 #          edition 2.5
 usetimestamps yes
 
+# flush-threshold-dumped, flush-threshold-scheduled, taperflush, and autoflush
+# are used to control tape utilization. See the amanda.conf (5) manpage for
+# details on how they work. Taping will not start until all criteria are
+# satisfied. Here are some examples:
+#
+# You want to fill tapes completely even in the case of failed dumps, and
+# don't care if some dumps are left on the holding disk after a run:
+# flush-threshold-dumped       100 # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush                   100
+# autoflush                    yes
+#
+# You want to improve tape performance by waiting for a complete tape of data
+# before writing anything. However, all dumps will be flushed; none will
+# be left on the holding disk.
+# flush-threshold-dumped       100 # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush   0
+#
+# You don't want to use a new tape for every run, but want to start writing
+# to tape as soon as possible:
+# flush-threshold-dumped       0   # (or more)
+# flush-threshold-scheduled    100 # (or more)
+# taperflush   100
+# autoflush     yes
+# maxdumpsize   100k # amount of data to dump each run; see above.
+#
+# You want to keep the most recent dumps on holding disk, for faster recovery.
+# Older dumps will be rotated to tape during each run.
+# flush-threshold-dumped       300 # (or more)
+# flush-threshold-scheduled    300 # (or more)
+# taperflush   300
+# autoflush     yes
+#
+# Defaults:
+# (no restrictions; flush to tape immediately; don't flush old dumps.)
+flush-threshold-dumped 0
+flush-threshold-scheduled 0
+taperflush 0
+autoflush no
 
 # Specify tape device and/or tape changer.  If you don't have a tape
 # changer, and you don't want to use more than one tape per run of
@@ -91,7 +131,7 @@ usetimestamps yes
 runtapes 1                     # number of tapes to be used in a single run of amdump
 tpchanger "chg-manual"         # the tape-changer glue script
 tapedev "@EXAMPLE_TAPEDEV@"    # the no-rewind tape device to be used
-rawtapedev "@DEFAULT_RAW_TAPE_DEVICE@" # the raw device to be used (ftape only)
+
 #changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer"
 #changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer-status"
 changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf"
@@ -112,11 +152,10 @@ amrecover_do_fsf yes              # amrecover will call amrestore with the
                                # -f flag for faster positioning of the tape.
 amrecover_check_label yes      # amrecover will call amrestore with the
                                # -l flag to check the label.
-amrecover_changer "@EXAMPLE_TAPEDEV@"  # amrecover will use the changer if you restore
-                               # from this device.
-                               # It could be a string like 'changer' and
-                               # amrecover will use your changer if you
-                               # set your tape with 'settape changer'
+amrecover_changer "changer"    # amrecover will use the changer if you restore
+    # from this device. It could be a string like 'changer' and amrecover will use your
+    # changer if you set your tape to 'changer' with 'setdevice changer' or via 
+    # 'tapedev "changer"' in amanda-client.conf
 
 # Specify holding disks.  These are used as a temporary staging area for
 # dumps before they are written to tape and are recommended for most sites.
@@ -166,10 +205,6 @@ holdingdisk hd1 {
 # This means save at least 30% of the holding disk space for degraded
 # mode backups.  
 
-autoflush no #
-# if autoflush is set to yes, then amdump will schedule all dump on
-# holding disks to be flush to tape during the run.
-
 # The format for a ColumnSpec is a ',' seperated list of triples.
 # Each triple consists of
 #   + the name of the column (as in ColumnNameStrings)
@@ -312,6 +347,12 @@ define tapetype MIMSY-MEGATAPE {
     speed 170 kbytes           # limited by the Emulex bus interface, ugh
 }
 
+define tapetype SEAGATE-ULTRIUM-LTO {
+     comment "SEAGATE ULTRIUM 06242 LTO, compression off"
+     length 99584 mbytes
+     filemark 0 kbytes
+     speed 11288 kps
+}
 
 # dumptypes
 #
@@ -676,13 +717,13 @@ define dumptype client-encrypt-nocomp {
 
 define interface local {
     comment "a local disk"
-    use 1000 kbps
+    use 8000 kbps
 }
 
-define interface le0 {
-    comment "10 Mbps ethernet"
-    use 400 kbps
-}
+#define interface le0 {
+#    comment "10 Mbps ethernet"
+#    use 400 kbps
+#}
 
 # You may include other amanda configuration files, so you can share
 # dumptypes, tapetypes and interface definitions among several
index bf1acfa2c6646f6e3817a2f0164105382e0ea27b..e58ba16f92489c83c076dbbde9805851e427842c 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 mcutil mcutil          #location of the mcutil program
-tape /dev/null # use ntape for norewind
+tape tape:/dev/YOUR-TAPE-DEVICE-HERE   # use ntape for norewind
                        # {a|m|h|c} suffixes should NOT 
                        # be tape device since they all
                        # implement hardware compression
@@ -40,11 +40,11 @@ use_cleaning 0              # 0 for yes ; 1 for no
 cleanslot 7            # slot containing the cleaning disk
 cleansleep 300         # How long to wait before the cleaning tape finishes (default: 5 min)
 cleanme 45             # number of days before messages popup to clean tape drive
-cleanfile /home/martinea/etc/amanda/changer/times_cleaned
-lastfile /home/martinea/etc/amanda/changer/last_cleaned
+cleanfile /etc/amanda/changer/times_cleaned
+lastfile /etc/amanda/changer/last_cleaned
 
 # Names a status file where the current 'changer' state is stored.
-currentslot /home/martinea/etc/amanda/changer/currentslot
+currentslot /etc/amanda/changer/currentslot
 
 # Where to log changer debugging info
 logfile /tmp/amanda/changer.debug
index 2ead4d8498411abef23e1c1a7e331245789c372a..134a4d23c76cc054fe909320edd502c6eb6dcf6d 100644 (file)
 # DEFAULT_TAPE_DEVICE=/dev/nrst0
 
 
-# DEFAULT_RAW_TAPE_DEVICE  --with-ftape-rawdevice=RAW_TAPE_DEVICE
-#           Default: /dev/rawft[0-3]
-#           This sets the default raw tape device for use with the Linux 
-#           floppy tape driver ftape (version 3.04d).
-#           The configure script will search for the lowest numbered
-#           /dev/rawft[0-3] device. If no device is found, /dev/null is used.
-#
-#           This device is needed for QIC volume table operations with 
-#           floppy tapes.
-# DEFAULT_RAW_TAPE_DEVICE=/dev/rawft0
-
-
 # DEFAULT_CHANGER_DEVICE --with-changer-device=CHANGER_DEVICE
 #                      Default: /dev/ch0 or /dev/null
 #                      This sets the default tape changer device.
diff --git a/example/inetd.conf.amandaclient b/example/inetd.conf.amandaclient
new file mode 100644 (file)
index 0000000..d103b6d
--- /dev/null
@@ -0,0 +1,2 @@
+#amanda stream tcp nowait amandabackup /usr/lib/amanda/amandad -auth=bsdtcp amdump
+amanda stream tcp nowait amandabackup /usr/lib/amanda/amandad amandad -auth=bsdtcp amdump
diff --git a/example/template.d/README b/example/template.d/README
new file mode 100644 (file)
index 0000000..162f5d1
--- /dev/null
@@ -0,0 +1,38 @@
+README for template.d directory
+-------------------------------
+
+This directory contains seven files that are used by amserverconfig.
+
+amanda-harddisk.conf:          contains common parameters for a typical Amanda configuration using
+                               virtual tapes.
+
+amanda-single-tape.conf:       contains common parameters for a typical Amanda configuration using
+                               one tape.
+
+amanda-tape-changer.conf:      contains common parameters for a typical Amanda configuration using
+                               tape changer.
+
+advanced.conf:                 contains advanced Amanda parameters that are not usually changed by a site.
+
+dumptypes:                     contains Amanda dumptype definitions.
+
+tapetypes:                     contains Amanda tapetype definitions.
+
+README:                                this file.
+
+
+amserverconfig will create a Amanda configuration in the following directory structure:
+
+/etc/amanda/template.d:
+dumptypes
+tapetypes
+
+/etc/amanda/$config_name:
+amanda.conf    [ it's a copy of amanda-harddisk.conf, amanda-single-tape.conf or amanda-tape-changer.conf ] 
+advanced.conf
+
+
+See amserverconfig(8) or amaddclient(8) for detail.
+
+
+
diff --git a/example/template.d/advanced.conf b/example/template.d/advanced.conf
new file mode 100644 (file)
index 0000000..6036089
--- /dev/null
@@ -0,0 +1,160 @@
+dumpuser "martinea"    # the user to run dumps under
+inparallel 4           # maximum dumpers that will run in parallel (max 63)
+                       # this maximum can be increased at compile-time,
+                       # modifying MAX_DUMPERS in server-src/driverio.h
+
+dumporder "sssS"       # specify the priority order of each dumper
+                       #   s -> smallest size
+                       #   S -> biggest size
+                       #   t -> smallest time
+                       #   T -> biggest time
+                       #   b -> smallest bandwidth
+                       #   B -> biggest bandwitdh
+                       # try "BTBTBTBTBTBT" if you are not holding
+                       # disk constrained
+
+taperalgo first                # The algorithm used to choose which dump image to send
+                       # to the taper.
+
+                       # Possible values: [first|firstfit|largest|largestfit|smallest|last]
+                       # Default: first. 
+
+                       # first         First in - first out.
+                       # firstfit      The first dump image that will fit on the current tape.
+                       # largest       The largest dump image.
+                       # largestfit    The largest dump image that will fit on the current tape.
+                       # smallest      The smallest dump image.
+                       # last          Last in - first out.
+displayunit "m"                # Possible values: "k|m|g|t"
+                       # Default: k. 
+                       # The unit used to print many numbers.
+                       # k=kilo, m=mega, g=giga, t=tera
+netusage  8000 Kbps    # maximum net bandwidth for Amanda, in KB per sec
+
+bumpsize 20 Mb         # minimum savings (threshold) to bump level 1 -> 2
+bumppercent 20         # minimum savings (threshold) to bump level 1 -> 2
+bumpdays 1             # minimum days at each level
+
+# By default, Amanda can only track at most one run per calendar day. When
+# the usetimestamps option is enabled, however, Amanda can track as many
+# runs as you care to make.
+# WARNING: This option is not backward-compatible. Do not enable it if you
+#          intend to downgrade your server installation to any version
+#          earlier than Amanda 2.5.1
+usetimestamps yes
+
+device_output_buffer_size 1280k
+                        # amount of buffer space to use when writing to devices
+
+# If you want Amanda to automatically label any non-Amanda tapes it
+# encounters, uncomment the line below. Note that this will ERASE any
+# non-Amanda tapes you may have, and may also ERASE any near-failing tapes.
+# Use with caution.
+## label_new_tapes "DailySet1-%%%"
+                       
+maxdumpsize -1         # Maximum number of bytes the planner will schedule
+                       # for a run (default: runtapes * tape_length).
+amrecover_do_fsf yes           # amrecover will call amrestore with the
+                               # -f flag for faster positioning of the tape.
+amrecover_check_label yes      # amrecover will call amrestore with the
+                               # -l flag to check the label.
+bumpmult 4             # threshold = bumpsize * bumpmult^(level-1)
+
+
+
+amrecover_changer "changer"    # amrecover will use the changer if you restore
+    # from this device. It could be a string like 'changer' and amrecover will use your
+    # changer if you set your tape to 'changer' with 'setdevice changer' or via 
+    # 'tapedev "changer"' in amanda-client.conf
+
+
+
+
+# If amanda cannot find a tape on which to store backups, it will run
+# as many backups as it can to the holding disks.  In order to save
+# space for unattended backups, by default, amanda will only perform
+# incremental backups in this case, i.e., it will reserve 100% of the
+# holding disk space for the so-called degraded mode backups.
+# However, if you specify a different value for the `reserve'
+# parameter, amanda will not degrade backups if they will fit in the
+# non-reserved portion of the holding disk.
+
+# reserve 30 # percent
+# This means save at least 30% of the holding disk space for degraded
+# mode backups.  
+
+autoflush no 
+# if autoflush is set to yes, then amdump will schedule all dump on
+# holding disks to be flush to tape during the run.
+
+# Amanda needs a few Mb of diskspace for the log and debug files,
+# as well as a database.  This stuff can grow large, so the conf directory
+# isn't usually appropriate.  Some sites use /usr/local/var and some /usr/adm.
+# Create an amanda directory under there.  You need a separate infofile and
+# logdir for each configuration, so create subdirectories for each conf and
+# put the files there.  Specify the locations below.
+
+# Note that, although the keyword below is infofile, it is only so for
+# historic reasons, since now it is supposed to be a directory (unless
+# you have selected some database format other than the `text' default)
+infofile "/etc/amanda/DailySet1/curinfo"      # database DIRECTORY
+logdir   "/etc/amanda/DailySet1"              # log directory
+indexdir "/etc/amanda/DailySet1/index"        # index directory
+#tapelist "@CONFIG_DIR/DailySet1/tapelist"     # list of used tapes
+# tapelist is stored, by default, in the directory that contains amanda.conf
+
+# Specify holding disks.  These are used as a temporary staging area for
+# dumps before they are written to tape and are recommended for most sites.
+# The advantages include: tape drive is more likely to operate in streaming
+# mode (which reduces tape and drive wear, reduces total dump time); multiple
+# dumps can be done in parallel (which can dramatically reduce total dump time.
+# The main disadvantage is that dumps on the holding disk need to be flushed
+# (with amflush) to tape after an operating system crash or a tape failure.
+# If no holding disks are specified then all dumps will be written directly
+# to tape.  If a dump is too big to fit on the holding disk than it will be
+# written directly to tape.  If more than one holding disk is specified then
+# they will all be used based on activity and available space.
+
+#holdingdisk hd1 {
+#    comment "main holding disk"
+#    directory "/dumps/amanda" # where the holding disk is
+#    use -100 Mb               # how much space can we use on it
+#                      # a non-positive value means:
+#                      #        use all space but that value
+#    chunksize 1Gb     # size of chunk if you want big dump to be
+#                      # dumped on multiple files on holding disks
+#                      #  N Kb/Mb/Gb split images in chunks of size N
+#                      #             The maximum value should be
+#                      #             (MAX_FILE_SIZE - 1Mb)
+#                      #  0          same as INT_MAX bytes
+#    }
+#holdingdisk hd2 {
+#    directory "/dumps2/amanda"
+#    use 1000 Mb
+#    }
+
+# network interfaces
+#
+# These are referred to by the disklist file.  They define the attributes
+# of the network interface that the remote machine is accessed through.
+# Notes: - netusage above defines the attributes t
+#          disklist entry doesn't specify otherwise.
+#        - the values below are only samples.
+#        - specifying an interface does not force the traffic to pass
+#          through that interface.  Your OS routing tables do that.  This
+#          is just a mechanism to stop Amanda trashing your network.
+# Attributes are:
+#      use             - bandwidth above which amanda won't start
+#                        backups using this interface.  Note that if
+#                        a single backup will take more than that,
+#                        amanda won't try to make it run slower!
+
+define interface local {
+    comment "a local disk"
+    use 8000 kbps
+}
+
+#define interface le0 {
+#    comment "10 Mbps ethernet"
+#    use 400 kbps
+#}
diff --git a/example/template.d/advanced.conf.in b/example/template.d/advanced.conf.in
new file mode 100644 (file)
index 0000000..19b963e
--- /dev/null
@@ -0,0 +1,160 @@
+dumpuser "@CLIENT_LOGIN@"      # the user to run dumps under
+inparallel 4           # maximum dumpers that will run in parallel (max 63)
+                       # this maximum can be increased at compile-time,
+                       # modifying MAX_DUMPERS in server-src/driverio.h
+
+dumporder "sssS"       # specify the priority order of each dumper
+                       #   s -> smallest size
+                       #   S -> biggest size
+                       #   t -> smallest time
+                       #   T -> biggest time
+                       #   b -> smallest bandwidth
+                       #   B -> biggest bandwitdh
+                       # try "BTBTBTBTBTBT" if you are not holding
+                       # disk constrained
+
+taperalgo first                # The algorithm used to choose which dump image to send
+                       # to the taper.
+
+                       # Possible values: [first|firstfit|largest|largestfit|smallest|last]
+                       # Default: first. 
+
+                       # first         First in - first out.
+                       # firstfit      The first dump image that will fit on the current tape.
+                       # largest       The largest dump image.
+                       # largestfit    The largest dump image that will fit on the current tape.
+                       # smallest      The smallest dump image.
+                       # last          Last in - first out.
+displayunit "m"                # Possible values: "k|m|g|t"
+                       # Default: k. 
+                       # The unit used to print many numbers.
+                       # k=kilo, m=mega, g=giga, t=tera
+netusage  8000 Kbps    # maximum net bandwidth for Amanda, in KB per sec
+
+bumpsize 20 Mb         # minimum savings (threshold) to bump level 1 -> 2
+bumppercent 20         # minimum savings (threshold) to bump level 1 -> 2
+bumpdays 1             # minimum days at each level
+
+# By default, Amanda can only track at most one run per calendar day. When
+# the usetimestamps option is enabled, however, Amanda can track as many
+# runs as you care to make.
+# WARNING: This option is not backward-compatible. Do not enable it if you
+#          intend to downgrade your server installation to any version
+#          earlier than Amanda 2.5.1
+usetimestamps yes
+
+device_output_buffer_size 1280k
+                        # amount of buffer space to use when writing to devices
+
+# If you want Amanda to automatically label any non-Amanda tapes it
+# encounters, uncomment the line below. Note that this will ERASE any
+# non-Amanda tapes you may have, and may also ERASE any near-failing tapes.
+# Use with caution.
+## label_new_tapes "DailySet1-%%%"
+                       
+maxdumpsize -1         # Maximum number of bytes the planner will schedule
+                       # for a run (default: runtapes * tape_length).
+amrecover_do_fsf yes           # amrecover will call amrestore with the
+                               # -f flag for faster positioning of the tape.
+amrecover_check_label yes      # amrecover will call amrestore with the
+                               # -l flag to check the label.
+bumpmult 4             # threshold = bumpsize * bumpmult^(level-1)
+
+
+
+amrecover_changer "changer"    # amrecover will use the changer if you restore
+    # from this device. It could be a string like 'changer' and amrecover will use your
+    # changer if you set your tape to 'changer' with 'setdevice changer' or via 
+    # 'tapedev "changer"' in amanda-client.conf
+
+
+
+
+# If amanda cannot find a tape on which to store backups, it will run
+# as many backups as it can to the holding disks.  In order to save
+# space for unattended backups, by default, amanda will only perform
+# incremental backups in this case, i.e., it will reserve 100% of the
+# holding disk space for the so-called degraded mode backups.
+# However, if you specify a different value for the `reserve'
+# parameter, amanda will not degrade backups if they will fit in the
+# non-reserved portion of the holding disk.
+
+# reserve 30 # percent
+# This means save at least 30% of the holding disk space for degraded
+# mode backups.  
+
+autoflush no 
+# if autoflush is set to yes, then amdump will schedule all dump on
+# holding disks to be flush to tape during the run.
+
+# Amanda needs a few Mb of diskspace for the log and debug files,
+# as well as a database.  This stuff can grow large, so the conf directory
+# isn't usually appropriate.  Some sites use /usr/local/var and some /usr/adm.
+# Create an amanda directory under there.  You need a separate infofile and
+# logdir for each configuration, so create subdirectories for each conf and
+# put the files there.  Specify the locations below.
+
+# Note that, although the keyword below is infofile, it is only so for
+# historic reasons, since now it is supposed to be a directory (unless
+# you have selected some database format other than the `text' default)
+infofile "@CONFIG_DIR@/@DEFAULT_CONFIG@/curinfo"      # database DIRECTORY
+logdir   "@CONFIG_DIR@/@DEFAULT_CONFIG@"              # log directory
+indexdir "@CONFIG_DIR@/@DEFAULT_CONFIG@/index"        # index directory
+#tapelist "@CONFIG_DIR/DailySet1/tapelist"     # list of used tapes
+# tapelist is stored, by default, in the directory that contains amanda.conf
+
+# Specify holding disks.  These are used as a temporary staging area for
+# dumps before they are written to tape and are recommended for most sites.
+# The advantages include: tape drive is more likely to operate in streaming
+# mode (which reduces tape and drive wear, reduces total dump time); multiple
+# dumps can be done in parallel (which can dramatically reduce total dump time.
+# The main disadvantage is that dumps on the holding disk need to be flushed
+# (with amflush) to tape after an operating system crash or a tape failure.
+# If no holding disks are specified then all dumps will be written directly
+# to tape.  If a dump is too big to fit on the holding disk than it will be
+# written directly to tape.  If more than one holding disk is specified then
+# they will all be used based on activity and available space.
+
+#holdingdisk hd1 {
+#    comment "main holding disk"
+#    directory "/dumps/amanda" # where the holding disk is
+#    use -100 Mb               # how much space can we use on it
+#                      # a non-positive value means:
+#                      #        use all space but that value
+#    chunksize 1Gb     # size of chunk if you want big dump to be
+#                      # dumped on multiple files on holding disks
+#                      #  N Kb/Mb/Gb split images in chunks of size N
+#                      #             The maximum value should be
+#                      #             (MAX_FILE_SIZE - 1Mb)
+#                      #  0          same as INT_MAX bytes
+#    }
+#holdingdisk hd2 {
+#    directory "/dumps2/amanda"
+#    use 1000 Mb
+#    }
+
+# network interfaces
+#
+# These are referred to by the disklist file.  They define the attributes
+# of the network interface that the remote machine is accessed through.
+# Notes: - netusage above defines the attributes t
+#          disklist entry doesn't specify otherwise.
+#        - the values below are only samples.
+#        - specifying an interface does not force the traffic to pass
+#          through that interface.  Your OS routing tables do that.  This
+#          is just a mechanism to stop Amanda trashing your network.
+# Attributes are:
+#      use             - bandwidth above which amanda won't start
+#                        backups using this interface.  Note that if
+#                        a single backup will take more than that,
+#                        amanda won't try to make it run slower!
+
+define interface local {
+    comment "a local disk"
+    use 8000 kbps
+}
+
+#define interface le0 {
+#    comment "10 Mbps ethernet"
+#    use 400 kbps
+#}
diff --git a/example/template.d/amanda-S3.conf b/example/template.d/amanda-S3.conf
new file mode 100644 (file)
index 0000000..70297b0
--- /dev/null
@@ -0,0 +1,54 @@
+org "DailySet1"        # your organization name for reports
+mailto "martinea"      # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-multi"  # the tape-changer glue script
+tapedev "S3:"          # the no-rewind tape device to be used
+changerfile "/etc/amanda/DailySet1/changer.conf" 
+#changerdev "/dev/sg1"
+tapetype HARDDISK      # what kind of tape it is (see tapetypes below)
+
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/DailySet1"
+    use 1000 Mb
+    }
+
+label_new_tapes "DailySet1-%%%%"       # Enable auto labeling 
+labelstr "^DailySet1-[0-9][0-9]*$"     # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+define tapetype HARDDISK {
+    comment "Virtual Tapes"
+    length 5000 mbytes
+}
+
+
+includefile "./advanced.conf"
+includefile "/etc/amanda/template.d/dumptypes"
+includefile "/etc/amanda/template.d/tapetypes"
+
diff --git a/example/template.d/amanda-S3.conf.in b/example/template.d/amanda-S3.conf.in
new file mode 100644 (file)
index 0000000..96592d6
--- /dev/null
@@ -0,0 +1,54 @@
+org "@DEFAULT_CONFIG@" # your organization name for reports
+mailto "@CLIENT_LOGIN@"        # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-multi"  # the tape-changer glue script
+tapedev "S3:"          # the no-rewind tape device to be used
+changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf" 
+#changerdev "/dev/sg1"
+tapetype HARDDISK      # what kind of tape it is (see tapetypes below)
+
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@"
+    use 1000 Mb
+    }
+
+label_new_tapes "@DEFAULT_CONFIG@-%%%%"        # Enable auto labeling 
+labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"      # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+define tapetype HARDDISK {
+    comment "Virtual Tapes"
+    length 5000 mbytes
+}
+
+
+includefile "./advanced.conf"
+includefile "@CONFIG_DIR@/template.d/dumptypes"
+includefile "@CONFIG_DIR@/template.d/tapetypes"
+
diff --git a/example/template.d/amanda-harddisk.conf b/example/template.d/amanda-harddisk.conf
new file mode 100644 (file)
index 0000000..395a836
--- /dev/null
@@ -0,0 +1,44 @@
+org "DailySet1"         # your organization name for reports
+mailto "martinea"        # space separated list of operators at your site
+dumpcycle 1 week               # the number of days in the normal dump cycle
+runspercycle 5                 # the number of amdump runs in dumpcycle days
+                               # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes             # the number of tapes in rotation
+                               # 1 week (dumpcycle) times 5 tapes per week (just
+                               # the weekdays) plus a few to handle errors that
+                               # need amflush and so we do not overwrite the full
+                               # backups performed at the beginning of the previous
+                               # cycle
+runtapes 1                     # number of tapes to be used in a single run of amdump
+tpchanger "chg-disk"           # the tape-changer glue script
+tapedev "file://var/lib/amanda/vtapes/DailySet1" # the no-rewind tape device to be used
+changerfile "/etc/amanda/DailySet1/changer.conf"
+changerdev "/dev/null"
+tapetype HARDDISK               # what kind of tape it is 
+labelstr "^DailySet1-[0-9][0-9]*$"    # label constraint regex: all tapes must match
+dtimeout 1800                          # number of idle seconds before a dump is aborted.
+ctimeout 30                            # maximum number of seconds that amcheck waits
+                                       # for each client host
+etimeout 300                           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+       global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+define tapetype HARDDISK {
+    comment "Virtual Tapes"
+    length 5000 mbytes
+}
+
+includefile "./advanced.conf"
+includefile "/etc/amanda/template.d/dumptypes"
+includefile "/etc/amanda/template.d/tapetypes"
diff --git a/example/template.d/amanda-harddisk.conf.in b/example/template.d/amanda-harddisk.conf.in
new file mode 100644 (file)
index 0000000..e1c920b
--- /dev/null
@@ -0,0 +1,44 @@
+org "@DEFAULT_CONFIG@"         # your organization name for reports
+mailto "@CLIENT_LOGIN@"        # space separated list of operators at your site
+dumpcycle 1 week               # the number of days in the normal dump cycle
+runspercycle 5                 # the number of amdump runs in dumpcycle days
+                               # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes             # the number of tapes in rotation
+                               # 1 week (dumpcycle) times 5 tapes per week (just
+                               # the weekdays) plus a few to handle errors that
+                               # need amflush and so we do not overwrite the full
+                               # backups performed at the beginning of the previous
+                               # cycle
+runtapes 1                     # number of tapes to be used in a single run of amdump
+tpchanger "chg-disk"           # the tape-changer glue script
+tapedev "file://var/lib/amanda/vtapes/@DEFAULT_CONFIG@" # the no-rewind tape device to be used
+changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf"
+changerdev "/dev/null"
+tapetype HARDDISK               # what kind of tape it is 
+labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"    # label constraint regex: all tapes must match
+dtimeout 1800                          # number of idle seconds before a dump is aborted.
+ctimeout 30                            # maximum number of seconds that amcheck waits
+                                       # for each client host
+etimeout 300                           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+       global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+define tapetype HARDDISK {
+    comment "Virtual Tapes"
+    length 5000 mbytes
+}
+
+includefile "./advanced.conf"
+includefile "@CONFIG_DIR@/template.d/dumptypes"
+includefile "@CONFIG_DIR@/template.d/tapetypes"
diff --git a/example/template.d/amanda-single-tape.conf b/example/template.d/amanda-single-tape.conf
new file mode 100644 (file)
index 0000000..8cd47c9
--- /dev/null
@@ -0,0 +1,47 @@
+org "DailySet1"        # your organization name for reports
+mailto "martinea"      # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-manual" # the tape-changer glue script
+tapedev "tape:/dev/nst0"       # the no-rewind tape device to be used
+changerfile "/etc/amanda/DailySet1/chg-manual.conf"
+changerdev "/dev/null"
+tapetype HP-DAT                        # what kind of tape it is (see tapetypes below)
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/DailySet1"
+    use 1000 Mb
+    }
+
+labelstr "^DailySet1-[0-9][0-9]*$"     # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+includefile "./advanced.conf"
+includefile "/etc/amanda/template.d/dumptypes"
+includefile "/etc/amanda/template.d/tapetypes"
diff --git a/example/template.d/amanda-single-tape.conf.in b/example/template.d/amanda-single-tape.conf.in
new file mode 100644 (file)
index 0000000..6012305
--- /dev/null
@@ -0,0 +1,47 @@
+org "@DEFAULT_CONFIG@" # your organization name for reports
+mailto "@CLIENT_LOGIN@"        # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-manual" # the tape-changer glue script
+tapedev "tape:/dev/nst0"       # the no-rewind tape device to be used
+changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/chg-manual.conf"
+changerdev "/dev/null"
+tapetype HP-DAT                        # what kind of tape it is (see tapetypes below)
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@"
+    use 1000 Mb
+    }
+
+labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"      # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+includefile "./advanced.conf"
+includefile "@CONFIG_DIR@/template.d/dumptypes"
+includefile "@CONFIG_DIR@/template.d/tapetypes"
diff --git a/example/template.d/amanda-tape-changer.conf b/example/template.d/amanda-tape-changer.conf
new file mode 100644 (file)
index 0000000..382259f
--- /dev/null
@@ -0,0 +1,47 @@
+org "DailySet1"        # your organization name for reports
+mailto "martinea"      # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-zd-mtx" # the tape-changer glue script
+tapedev "tape:/dev/nst0"       # the no-rewind tape device to be used
+changerfile "/etc/amanda/DailySet1/changer.conf" 
+changerdev "/dev/sg1"
+tapetype HP-DAT                        # what kind of tape it is (see tapetypes below)
+
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/DailySet1"
+    use 1000 Mb
+    }
+
+labelstr "^DailySet1-[0-9][0-9]*$"     # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+includefile "./advanced.conf"
+includefile "/etc/amanda/template.d/dumptypes"
+includefile "/etc/amanda/template.d/tapetypes"
+
diff --git a/example/template.d/amanda-tape-changer.conf.in b/example/template.d/amanda-tape-changer.conf.in
new file mode 100644 (file)
index 0000000..f46e729
--- /dev/null
@@ -0,0 +1,47 @@
+org "@DEFAULT_CONFIG@" # your organization name for reports
+mailto "@CLIENT_LOGIN@"        # space separated list of operators at your site
+dumpcycle 1 week       # the number of days in the normal dump cycle
+runspercycle 5          # the number of amdump runs in dumpcycle days
+                       # (1 week * 5 amdump runs per week -- just weekdays)
+tapecycle 10 tapes     # the number of tapes in rotation
+                       # 1 week (dumpcycle) times 5 tapes per week (just
+                       # the weekdays) plus a few to handle errors that
+                       # need amflush and so we do not overwrite the full
+                       # backups performed at the beginning of the previous
+                       # cycle
+runtapes 1             # number of tapes to be used in a single run of amdump
+tpchanger "chg-zd-mtx" # the tape-changer glue script
+tapedev "tape:/dev/nst0"       # the no-rewind tape device to be used
+changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf" 
+changerdev "/dev/sg1"
+tapetype HP-DAT                        # what kind of tape it is (see tapetypes below)
+
+holdingdisk hd2 {
+    directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@"
+    use 1000 Mb
+    }
+
+labelstr "^@DEFAULT_CONFIG@-[0-9][0-9]*$"      # label constraint regex: all tapes must match
+
+dtimeout 1800          # number of idle seconds before a dump is aborted.
+ctimeout 30            # maximum number of seconds that amcheck waits
+                       # for each client host
+etimeout 300           # number of seconds per filesystem for estimates.
+
+define dumptype global {
+        comment "Global definitions"
+        auth "bsdtcp"
+}
+
+define dumptype gui-base {
+        global
+        program "GNUTAR"
+        comment "gui base dumptype dumped with tar"
+        compress none
+        index yes
+}
+
+includefile "./advanced.conf"
+includefile "@CONFIG_DIR@/template.d/dumptypes"
+includefile "@CONFIG_DIR@/template.d/tapetypes"
+
diff --git a/example/template.d/chg-manual.conf b/example/template.d/chg-manual.conf
new file mode 100644 (file)
index 0000000..4fb86f2
--- /dev/null
@@ -0,0 +1,10 @@
+#
+#configuration used by chg-manual
+#
+resend_mail=3600        # every hour
+timeout_mail=43200      # 12 hours
+#request="tty"          # Use the tty to ask the user to change tape.
+                        # Can't be use by cron
+#request="email"        # Send an email to ask the user to change tape.
+request="tty_email"    # Send request through tty if it exists. 
+                       # Otherwise, it will send an email.
diff --git a/example/template.d/dumptypes b/example/template.d/dumptypes
new file mode 100644 (file)
index 0000000..d0f2ae8
--- /dev/null
@@ -0,0 +1,422 @@
+# dumptypes
+#
+# These are referred to by the disklist file.  The dumptype specifies
+# certain parameters for dumping including:
+#   auth       - authentication scheme to use between server and client.
+#                Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
+#                "rsh" and "ssh" 
+#                 Default: [auth bsd]
+#   comment    - just a comment string
+#   comprate   - set default compression rate.  Should be followed by one or
+#                two numbers, optionally separated by a comma.  The 1st is
+#                the full compression rate; the 2nd is the incremental rate.
+#                If the second is omitted, it is assumed equal to the first.
+#                The numbers represent the amount of the original file the
+#                compressed file is expected to take up.
+#                Default: [comprate 0.50, 0.50]
+#   compress   - specify compression of the backed up data.  Valid values are:
+#                "none"        - don't compress the dump output.
+#                "client best" - compress on the client using the best (and
+#                                probably slowest) algorithm.
+#                "client fast" - compress on the client using fast algorithm.
+#                 "client custom" - compress using your custom client compression program.
+#                                   use client_custom_compress "PROG" to specify
+#                                   the custom compression program.
+#                                   PROG must not contain white space.
+#                "server best" - compress on the tape host using the best (and
+#                                probably slowest) algorithm.
+#                "server fast" - compress on the tape host using a fast
+#                                algorithm.  This may be useful when a fast
+#                                tape host is backing up slow clients.
+#                 "server custom" - compress using your server custom compression program.
+#                                   use server_custom_compress "PROG" to specify
+#                                   the custom compression program.
+#                                   PROG must not contain white space.
+#                Default: [compress client fast]
+#   dumpcycle  - set the number of days in the dump cycle, ie, set how often a
+#                full dump should be performed.  Default: from DUMPCYCLE variable
+#   estimate      Determine the way AMANDA does it's estimate. 
+#                "client"      - Use the same program as the dumping program,
+#                              this is the most accurate way to do estimates, 
+#                              but it can take a long time.
+#                "calcsize"    - Use a faster program to do estimates, but the
+#                              result is less accurate.
+#                "server"      - Use only statistics from the previous run to 
+#                              give an estimate, 
+#                              it takes only a few seconds but the result is not 
+#                              accurate if your disk usage changes from day to day.
+#                Default: [client]
+#   encrypt  - specify encryption of the backed up data. Valid values are:
+#                 "none"   - don't encrypt the dump output.
+#                 "client" - encrypt on the client using the program specified by
+#                            client_encrypt "PROG".
+#                            Use client_decrypt_option to specify the decrypt-
+#                            parameter, default is "-d".
+#                            PROG and decrypt-parameter must not contain white space.
+#                 "server" - encrypt on the server using the program specified by
+#                            server_encrypt "PROG".
+#                            Use server_decrypt_option to specify the decrypt-
+#                            parameter, default is "-d".
+#                            PROG and decrypt-parameter must not contain white space.
+#                 Default: [none]
+#   exclude    - specify files and directories to be excluded from the dump.
+#                Useful with gnutar only; silently ignored by dump and samba.
+#                Valid values are:
+#                "pattern"       - a shell glob pattern defining which files
+#                                  to exclude.
+#                                  gnutar gets --exclude="pattern"
+#                list "filename" - a file (on the client!) containing patterns
+#                                  re's (1 per line) defining which files to
+#                                  exclude.
+#                                  gnutar gets --exclude-from="filename"
+#                Note that the `full pathname' of a file within its
+#                filesystem starts with `./', because of the way amanda runs
+#                gnutar: `tar -C $mountpoint -cf - --lots-of-options .' (note
+#                the final dot!)  Thus, if you're backing up `/usr' with a
+#                diskfile entry like ``host /usr gnutar-root', but you don't
+#                want to backup /usr/tmp, your exclude list should contain
+#                the pattern `./tmp', as this is relative to the `/usr' above.
+#                Please refer to the man-page of gnutar for more information.
+#                If a relative pathname is specified as the exclude list,
+#                it is searched from within the directory that is
+#                going to be backed up.
+#                Default: include all files
+#   holdingdisk        - should the holding disk be used for this dump.  Useful for
+#                dumping the holding disk itself.  Default: [holdingdisk auto]
+#                "never"    - Never use the holding disk.
+#                "auto"     - Use the holding disk if possible.
+#                "required" - Always use the holding disk.
+#   ignore     - do not back this filesystem up.  Useful for sharing a single
+#                disklist in several configurations.
+#   index      - keep an index of the files backed up.  Default: [index no]
+#   kencrypt   - encrypt the data stream between the client and server.
+#                Default: [kencrypt no]
+#   maxdumps   - max number of concurrent dumps to run on the client.
+#                Default: [maxdumps 1]
+#   maxpromoteday - max number of day for a promotion, set it 0 if you don't
+#                want promotion, set it to 1 or 2 if your disk get
+#                overpromoted.
+#                Default: [10000]
+#   priority   - priority level of the dump.  Valid levels are "low", "medium"
+#                or "high".  These are really only used when Amanda has no
+#                tape to write to because of some error.  In that "degraded
+#                mode", as many incrementals as will fit on the holding disk
+#                are done, higher priority first, to insure the important
+#                disks are at least dumped.  Default: [priority medium]
+#   program    - specify the dump system to use.  Valid values are "DUMP" 
+#                "STAR" and "GNUTAR".  Default: [program "DUMP"].
+#   record     - record the backup in the time-stamp-database of the backup
+#                program (e.g. /etc/dumpdates for DUMP or
+#                /var/lib/amanda/gnutar-lists for GNUTAR.).
+#                Default: [record yes]
+#   skip-full  - skip the disk when a level 0 is due, to allow full backups
+#                outside Amanda, eg when the machine is in single-user mode.
+#   skip-incr  - skip the disk when the level 0 is NOT due.  This is used in
+#                archive configurations, where only full dumps are done and
+#                the tapes saved.
+#   starttime  - delay the start of the dump?  Default: no delay
+#   strategy   - set the dump strategy.  Valid strategies are currently:
+#                "standard" - the standard one.
+#                "nofull"   - do level 1 dumps every time.  This can be used,
+#                             for example, for small root filesystems that
+#                             only change slightly relative to a site-wide
+#                             prototype.  Amanda then backs up just the
+#                             changes.
+#                "noinc"    - do level 0 dumps every time.
+#                "skip"     - skip all dumps.  Useful for sharing a single
+#                             disklist in several configurations.
+#                "incronly" - do only incremental dumps. This is similar
+#                              to strategy 'nofull', but will increase
+#                              the dump level as usual. Full dumps will
+#                              only be performed when an 'amadmin force' 
+#                              has been issued 
+#                Default: [strategy standard]
+# tape_splitsize - (optional) split dump file into pieces of a specified size.
+#                This allows dumps to be spread across multiple tapes, and can
+#                potentially make more efficient use of tape space.  Note that
+#                if this value is too large (more than half the size of the
+#                average dump being split), substantial tape space can be
+#                wasted.  If too small, large dumps will be split into
+#                innumerable tiny dumpfiles, adding to restoration complexity.
+#                A good rule of thumb, usually, is 1/10 of the size of your
+#                tape.  Default: [disabled]
+# split_diskbuffer - (optional) When dumping a split dump  in  PORT-WRITE
+#                 mode (usually meaning "no holding disk"), buffer the split
+#                chunks to a file in the directory specified by this option.
+#                Default: [none]
+# fallback_splitsize - (optional) When dumping a split dump  in  PORT-WRITE
+#                 mode, if no split_diskbuffer is specified (or if we somehow
+#                 fail to use our split_diskbuffer), we must buffer split
+#                 chunks in memory.  This specifies the maximum size split
+#                 chunks can be in this scenario, and thus the maximum amount
+#                 of memory consumed for in-memory splitting.  Default: [10m]
+#
+#
+# Note that you may specify previously defined dumptypes as a shorthand way
+# of defining parameters.
+
+# dumptype global defined in $config/amanda.conf
+
+define dumptype always-full {
+    global
+    comment "Full dump of this filesystem always"
+    compress none
+    priority high
+    dumpcycle 0
+}
+
+# Dumptypes for star
+define dumptype root-star {
+    global
+    program "STAR"
+    comment "root partitions dumped with star"
+    compress none
+    index
+#    exclude list "/var/lib/amanda/exclude.star"
+    priority low
+}
+
+define dumptype user-star {
+    root-star
+    comment "user partitions dumped with star"
+    priority medium
+}
+
+define dumptype user-star-span {
+    root-star
+    tape_splitsize 3 Gb
+    comment "tape-spanning user partitions dumped with star"
+    priority medium
+}
+
+define dumptype high-star {
+    root-star
+    comment "partitions dumped with star"
+    priority high
+}
+
+define dumptype comp-root-star {
+    root-star
+    comment "Root partitions with compression"
+    compress client fast
+}
+
+define dumptype comp-user-star {
+    user-star
+    compress client fast
+}
+
+define dumptype comp-user-star-span {
+    user-star-span
+    compress client fast
+}
+
+# Dumptypes for gnutar
+
+define dumptype root-tar {
+    global
+    program "GNUTAR"
+    comment "root partitions dumped with tar"
+    compress none 
+    index
+    priority low
+}
+
+
+define dumptype user-tar {
+    root-tar
+    comment "user partitions dumped with tar"
+    priority medium
+}
+
+
+define dumptype user-tar-span {
+    root-tar
+    tape_splitsize 3 Gb
+    comment "tape-spanning user partitions dumped with tar"
+    priority medium
+}
+
+
+define dumptype high-tar {
+    root-tar
+    comment "partitions dumped with tar"
+    priority high
+}
+
+define dumptype comp-root-tar {
+    root-tar
+    comment "Root partitions with compression dumped with tar"
+    compress client fast
+}
+
+define dumptype comp-user-tar {
+    user-tar
+    compress client fast
+}
+
+define dumptype comp-user-tar-span {
+    user-tar-span
+    compress client fast
+}
+
+
+define dumptype holding-disk {
+    global
+    comment "The master-host holding disk itself"
+    holdingdisk never # do not use the holding disk
+    priority medium
+}
+
+define dumptype comp-user {
+    global
+    comment "Non-root partitions on reasonably fast machines"
+    compress client fast
+    priority medium
+}
+
+define dumptype comp-user-span {
+    global
+    tape_splitsize 5 Gb
+    comment "Tape-spanning non-root partitions on reasonably fast machines"
+    compress client fast
+    priority medium
+}
+
+
+define dumptype nocomp-user {
+    comp-user
+    comment "Non-root partitions on slow machines"
+    compress none
+}
+
+define dumptype nocomp-user-span {
+    comp-user-span
+    comment "Tape-spanning non-root partitions on slow machines"
+    compress none
+}
+
+
+define dumptype comp-root {
+    global
+    comment "Root partitions with compression"
+    compress client fast
+    priority low
+}
+
+define dumptype nocomp-root {
+    comp-root
+    comment "Root partitions without compression"
+    compress none
+}
+
+define dumptype comp-high {
+    global
+    comment "very important partitions on fast machines"
+    compress client best
+    priority high
+}
+
+define dumptype nocomp-high {
+    comp-high
+    comment "very important partitions on slow machines"
+    compress none
+}
+
+define dumptype nocomp-test {
+    global
+    comment "test dump without compression, no /etc/dumpdates recording"
+    compress none
+    record no
+    priority medium
+}
+
+define dumptype comp-test {
+    nocomp-test
+    comment "test dump with compression, no /etc/dumpdates recording"
+    compress client fast
+}
+
+define dumptype nocomp-ssh {
+   root-tar
+   comment "ssh authorization and dumped with tar"
+   auth "ssh"
+   ssh_keys "/var/lib/amanda/.ssh/id_rsa_amdump"
+   compress none
+}
+   
+
+define dumptype custom-compress {
+   root-tar
+   comment "custom client compression, dumped with tar"
+   compress client custom
+   client_custom_compress "/usr/bin/bzip2"
+}
+
+# amcrypt requires aespipe and uuencode
+define dumptype encrypt-fast {
+   root-tar
+   comment "fast client compression and server symmetric encryption, dumped with tar"
+   compress client fast
+   encrypt server
+   server_encrypt "/usr/sbin/amcrypt"
+   server_decrypt_option "-d"
+}
+
+
+# amcryptsimple use gpg symmetric encryption. gpg does compress with zlib by default.
+# Thus, specify compress none.
+define dumptype encrypt-simple-nocomp {
+   root-tar
+   comment "client simple symmetric encryption, dumped with tar"
+   compress none
+   encrypt client
+   client_encrypt "/usr/sbin/amcryptsimple"
+   client_decrypt_option "-d"
+}
+
+# To use gpg public-key encryption, gpg does compress with zlib by default.
+# Thus, specify compress none.
+
+define dumptype gpg-encrypt-nocomp {
+   root-tar
+   comment "server public-key encryption, dumped with tar"
+   compress none
+   encrypt server
+   server_encrypt "/usr/sbin/amgpgcrypt"
+   server_decrypt_option "-d"
+}
+
+# The following dumptypes are for ZMC
+# dumptype gui-base defined in $config/amanda.conf
+
+define dumptype gui-default {
+   gui-base
+   comment "gui default dumptype"
+   compress none
+   encrypt none
+}
+
+define dumptype gui-compress {
+   gui-base
+   comment "gui dumptype with compression"
+   compress client fast
+   encrypt none
+}
+
+define dumptype gui-encrypt {
+   gui-base
+   comment "gui dumptype with encryption"
+   compress none
+   encrypt server
+   server_encrypt "/usr/sbin/amcryptsimple"
+}
+
+define dumptype gui-encrypt-compress {
+   gui-base
+   comment "gui dumptype with compression and encryption"
+   compress client fast
+   encrypt server 
+   server_encrypt "/usr/sbin/amcryptsimple"
+}
+
diff --git a/example/template.d/tapetypes b/example/template.d/tapetypes
new file mode 100644 (file)
index 0000000..effaeed
--- /dev/null
@@ -0,0 +1,308 @@
+# tapetypes
+
+# Define the type of tape you use here, and use it in "tapetype"
+# above.  Some typical types of tapes are included here.  The tapetype
+# tells amanda how many MB will fit on the tape, how big the filemarks
+# are, and how fast the tape device is.
+
+# A filemark is the amount of wasted space every time a tape section
+# ends.  If you run `make tapetype' in tape-src, you'll get a program
+# that generates tapetype entries, but it is slow as hell, use it only
+# if you really must and, if you do, make sure you post the data to
+# the amanda mailing list, so that others can use what you found out
+# by searching the archives.
+
+# For completeness Amanda should calculate the inter-record gaps too,
+# but it doesn't.  For EXABYTE and DAT tapes this is ok.  Anyone using
+# 9 tracks for amanda and need IRG calculations?  Drop me a note if
+# so.
+
+# If you want amanda to print postscript paper tape labels
+# add a line after the comment in the tapetype of the form
+#    lbl-templ "/path/to/postscript/template/label.ps"
+
+# if you want the label to go to a printer other than the default
+# for your system, you can also add a line above for a different
+# printer. (i usually add that line after the dumpuser specification)
+
+# dumpuser "operator"     # the user to run dumps under
+# printer "mypostscript"  # printer to print paper label on
+
+# here is an example of my definition for an EXB-8500
+
+# define tapetype EXB-8500 {
+# ...
+#     lbl-templ "/usr/local/amanda/config/lbl.exabyte.ps"
+# }
+
+# HARDDISK defintion in amanda.conf
+
+define tapetype DLT-S4 {
+   comment "just produced by tapetype prog, compression off"
+   length 772096 mbytes
+   filemark 0 kbytes
+   speed 33596 kps
+}
+
+define tapetype DLT8000 {
+    comment "Quantum DLT8000 created by tapetype"
+    length 38130 mbytes
+    filemark 29 kbytes
+    speed 5627 kps
+}
+
+define tapetype QUANTUM-DLT4000 {
+    comment "Quantum DLT4000, compression off"
+    length 19534 mbytes
+    filemark 4 kbytes
+    speed 1096 kps
+}
+
+
+define tapetype SDLT600 {
+    comment "Quantum SDLT600 with 10MB/s"
+    length 306789 mbytes
+    filemark 0 kbytes
+    speed 8247 kps
+}
+
+
+define tapetype SDLT320 {
+     comment "HP Super DLTtape I, data cartridge, C7980A, compression on"
+     length 139776 mbytes
+     filemark 0 kbytes
+     speed 13980 kps
+}
+
+define tapetype SDLT220NOCOMP {
+  comment "Quantum SDLT 220, compression off"
+  length 109539 mbytes
+  filemark 0 kbytes
+  speed 10351 kps
+}
+
+define tapetype Quantum-DLT-V4 {
+     comment "Quantum-DLT-V4 on Adaptec 29160"
+     length 157284 mbytes
+     filemark 0 kbytes
+     speed 9936 kps
+}
+
+define tapetype AIT1{
+     comment "Sony AIT-1 with 170m tapes"
+     length 21568 mbytes
+     filemark 0 kbytes
+     speed 2699 kps
+} 
+
+define tapetype AIT1-35 {
+     comment "Sony AIT1 cartridge 35/70 Gbyte, compression off"
+     length 33400 mbytes    # rounded down
+     filemark 500 kbytes
+     speed 2890 kps
+}
+
+define tapetype LTO {
+   comment "Dell PowerVault 122T, Seagate Ultrium, IBM 3581-H17, compression off"
+   length 101376 mbytes
+   filemark 0 kbytes
+   speed 13872 kps
+}
+
+define tapetype QUANTUM-LTO2 {
+   comment " Quantum LTO-2 HH, compression off"
+   length 186368 mbytes
+   filemark 0 kbytes
+   speed 2781 kps
+}
+
+define tapetype LTO2 {
+   comment "HP Ultrium 448, hardware compression off"
+   length 193024 mbytes
+   filemark 0 kbytes
+   speed 20355 kps
+}
+
+define tapetype DELL-LTO3-400 {
+     comment "Dell PV124T LTO3, compression off"
+     length 402432 mbytes
+     filemark 0 kbytes
+     speed 71189 kps
+}
+
+define tapetype DELL-LTO2-200 {
+     comment "Dell PV132T LTO2, hardware compression"
+     length 201216 mbytes
+     filemark 0 kbytes
+     speed 31343 kps
+}
+
+define tapetype IBM-ULTRIUM-3582 {
+     comment "IBM Ultrium 3582, compression on"
+     length 199168 mbytes
+     filemark 0 kbytes
+     speed 30760 kps
+}
+
+define tapetype LTO3-400 {
+     comment "LTO Ultrium 3 400/800, compression off"
+     length 402432 mbytes
+     filemark 0 kbytes
+     speed 71702 kps
+}
+
+define tapetype HP-ULTRIUM-960 {
+     comment "HP Ultrium 960, compression off"
+     length 386048 mbytes
+     filemark 0 kbytes
+     speed 67629 kps
+}
+
+define tapetype SEAGATE-ULTRIUM-LTO {
+     comment "SEAGATE ULTRIUM 06242 LTO, compression off"
+     length 99584 mbytes
+     filemark 0 kbytes
+     speed 11288 kps
+}
+
+define tapetype QS3LTO-3 {
+     comment "Quantum Super Loader 3 LTO-3 16 tape library"
+     length 448369 mbytes
+     filemark 6403 kbytes
+     speed 37739 kps
+}
+
+define tapetype DDS90 {
+     comment "DDS tapes drives - 90 meter tapes"
+     length 1900000 kbytes # rounded down
+     filemark 111 kbytes
+     speed 380 kps
+}
+
+define tapetype DDS120 {
+     comment "DDS tape drives - 120 meter tapes"
+     length 3850000  # rounded down
+     filemark 111 kbytes
+     speed 380 kps
+}
+
+define tapetype IBM-DAT-72 {
+   comment "DDS5, compression on"
+   length 30227 mbytes
+   filemark 0 kbytes
+   speed 2559 kps
+}
+
+define tapetype HP-DAT-72 {
+   comment "DDS5, /dev/rmt/0ln, HP C7438A Rev V309, compression on"
+   length 30227 mbytes
+   filemark 0 kbytes
+   speed 2551 kps
+}
+
+define tapetype DLT1 {
+   comment "HP DLT1, DLT IV Tape C5141F, compression on"
+   length 34818 mbytes
+   filemark 32 kbytes
+   speed 2879 kps
+}
+
+define tapetype ARCvault24 {
+   comment "Overland ARCvault, compression off"
+   length 386048 mbytes
+   filemark 0 kbytes
+   speed 38246 kps
+}
+
+define tapetype QIC-60 {
+    comment "Archive Viper"
+    length 60 mbytes
+    filemark 100 kbytes         
+    speed 100 kbytes            
+}
+
+define tapetype CD650 {
+    comment "CD-R 650MB sized vtape"
+    length 681984000 bytes
+    filemark 4 Kbytes
+}
+
+
+define tapetype CD700 {
+    comment "CD-R 700MB sized vtape"
+    length 737280000 bytes
+    filemark 4 Kbytes
+}
+
+define tapetype DVD47 {
+    comment "A 4.7 Gbyte DVD-sized vtape"
+    length 4482 mbytes
+    filemark 4 kbytes
+}
+
+define tapetype DVD85 {
+     comment "A 8.5 GB DVD double layer"
+     length 8100 mbytes   # approximately - exact value not found
+     filemark 4 kbytes
+}
+
+
+define tapetype DEC-DLT2000 {
+    comment "DEC Differential Digital Linear Tape 2000"
+    length 15000 mbytes
+    filemark 8 kbytes
+    speed 1250 kbytes
+}
+
+# goluboff@butch.Colorado.EDU
+# in amanda-users (Thu Dec 26 01:55:38 MEZ 1996)
+define tapetype DLT {
+    comment "DLT tape drives"
+    length 20000 mbytes                # 20 Gig tapes
+    filemark 2000 kbytes       
+    speed 1536 kbytes          
+}
+
+define tapetype SURESTORE-1200E {
+    comment "HP AutoLoader"
+    length 3900 mbytes
+    filemark 100 kbytes
+    speed 500 kbytes
+}
+
+define tapetype EXB-8500 {
+    comment "Exabyte EXB-8500 drive on decent machine"
+    length 4200 mbytes
+    filemark 48 kbytes
+    speed 474 kbytes                   
+}
+
+define tapetype EXB-8200 {
+    comment "Exabyte EXB-8200 drive on decent machine"
+    length 2200 mbytes
+    filemark 2130 kbytes
+    speed 240 kbytes                   
+}
+
+define tapetype HP-DAT {
+    comment "DAT tape drives"
+    # data provided by Rob Browning <rlb@cs.utexas.edu>
+    length 1930 mbytes
+    filemark 111 kbytes
+    speed 468 kbytes
+}
+
+define tapetype DAT {
+    comment "DAT tape drives"
+    length 1000 mbytes         # these numbers are not accurate
+    filemark 100 kbytes                # but you get the idea
+    speed 100 kbytes
+}
+
+define tapetype MIMSY-MEGATAPE {
+    comment "Megatape (Exabyte based) drive through Emulex on Vax 8600"
+    length 2200 mbytes
+    filemark 2130 kbytes
+    speed 170 kbytes           # limited by the Emulex bus interface, ugh
+}
+
diff --git a/example/xinetd.amandaclient b/example/xinetd.amandaclient
new file mode 100644 (file)
index 0000000..7747b0f
--- /dev/null
@@ -0,0 +1,19 @@
+# default: on
+#
+# description: The Amanda backup client should be enabled for systems
+#              which will be backed up by an Amanda backup server.
+
+service amanda
+{
+       disable         = no
+       flags           = IPv4
+        flags          = IPv6
+       socket_type     = stream
+       protocol        = tcp
+       wait            = no
+       user            = amandabackup
+       group           = disk
+       groups          = yes
+       server          = /usr/libexec/amanda/amandad 
+       server_args     = -auth=bsdtcp amdump
+}
diff --git a/example/xinetd.amandaserver b/example/xinetd.amandaserver
new file mode 100644 (file)
index 0000000..8279d4e
--- /dev/null
@@ -0,0 +1,19 @@
+# default: on
+#
+# description: Amanda services for Amanda server and client.
+#              
+
+service amanda
+{
+        disable         = no
+       flags           = IPv4
+        flags          = IPv6
+        socket_type     = stream
+        protocol        = tcp
+        wait            = no
+        user            = amandabackup
+        group           = disk
+        groups          = yes
+        server          = /usr/libexec/amanda/amandad
+        server_args     = -auth=bsdtcp amdump amindexd amidxtaped
+}
index b83d0f28600576a3c2ebe978063b88656d1f6550..78cdadfdc373e0ef2dbc5a8a35b20dff052f595d 100644 (file)
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -27,7 +27,7 @@ MAINTAINERCLEANFILES =
 
 AM_CPPFLAGS =
 if GCC_COMPILER
-  AM_CFLAGS += -Wno-error
+  AM_CFLAGS = -Wno-error -Wno-sign-compare
 endif
 
 noinst_LTLIBRARIES += libgnu.la
@@ -38,6 +38,15 @@ libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
 EXTRA_libgnu_la_SOURCES =
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 
+## begin gnulib module absolute-header
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
+
+## end   gnulib module absolute-header
+
 ## begin gnulib module alloca-opt
 
 BUILT_SOURCES += $(ALLOCA_H)
@@ -62,7 +71,7 @@ BUILT_SOURCES += $(ARPA_INET_H)
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
 arpa/inet.h:
-       test -d arpa || mkdir arpa
+       @MKDIR_P@ arpa
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#include <sys/socket.h>'; \
@@ -73,6 +82,53 @@ MOSTLYCLEANDIRS += arpa
 
 ## end   gnulib module arpa_inet
 
+## begin gnulib module base64
+
+libgnu_la_SOURCES += base64.h base64.c
+
+## end   gnulib module base64
+
+## begin gnulib module float
+
+BUILT_SOURCES += $(FLOAT_H)
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+float.h: float_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+             < $(srcdir)/float_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += float.h float.h-t
+
+EXTRA_DIST += float_.h
+
+## end   gnulib module float
+
+## begin gnulib module fsusage
+
+
+EXTRA_DIST += fsusage.c fsusage.h
+
+EXTRA_libgnu_la_SOURCES += fsusage.c
+
+## end   gnulib module fsusage
+
+## begin gnulib module full-read
+
+libgnu_la_SOURCES += full-read.h full-read.c
+
+## end   gnulib module full-read
+
+## begin gnulib module full-write
+
+libgnu_la_SOURCES += full-write.h full-write.c
+
+## end   gnulib module full-write
+
 ## begin gnulib module getaddrinfo
 
 
@@ -88,6 +144,22 @@ libgnu_la_SOURCES += gettext.h
 
 ## end   gnulib module gettext-h
 
+## begin gnulib module gettimeofday
+
+
+EXTRA_DIST += gettimeofday.c
+
+EXTRA_libgnu_la_SOURCES += gettimeofday.c
+
+## end   gnulib module gettimeofday
+
+## begin gnulib module havelib
+
+
+EXTRA_DIST += $(top_srcdir)/config/config.rpath
+
+## end   gnulib module havelib
+
 ## begin gnulib module inet_ntop
 
 
@@ -97,12 +169,40 @@ EXTRA_libgnu_la_SOURCES += inet_ntop.c
 
 ## end   gnulib module inet_ntop
 
+## begin gnulib module link-warning
+
+LINK_WARNING_H=$(top_srcdir)/config/link-warning.h
+
+EXTRA_DIST += $(top_srcdir)/config/link-warning.h
+
+## end   gnulib module link-warning
+
 ## begin gnulib module lock
 
 libgnu_la_SOURCES += lock.h lock.c
 
+EXTRA_DIST += $(top_srcdir)/config/config.rpath
+
 ## end   gnulib module lock
 
+## begin gnulib module malloc-posix
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_la_SOURCES += malloc.c
+
+## end   gnulib module malloc-posix
+
+## begin gnulib module mkdtemp
+
+
+EXTRA_DIST += mkdtemp.c
+
+EXTRA_libgnu_la_SOURCES += mkdtemp.c
+
+## end   gnulib module mkdtemp
+
 ## begin gnulib module netinet_in
 
 BUILT_SOURCES += $(NETINET_IN_H)
@@ -110,17 +210,49 @@ BUILT_SOURCES += $(NETINET_IN_H)
 # We need the following in order to create <netinet/in.h> when the system
 # doesn't have one.
 netinet/in.h:
-       test -d netinet || mkdir netinet
+       @MKDIR_P@ netinet
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         echo '#include <sys/socket.h>'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+             -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+             < $(srcdir)/netinet_in_.h; \
        } > $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
 MOSTLYCLEANDIRS += netinet
 
+EXTRA_DIST += netinet_in_.h
+
 ## end   gnulib module netinet_in
 
+## begin gnulib module physmem
+
+
+EXTRA_DIST += physmem.c physmem.h
+
+EXTRA_libgnu_la_SOURCES += physmem.c
+
+## end   gnulib module physmem
+
+## begin gnulib module safe-read
+
+
+EXTRA_DIST += safe-read.c safe-read.h
+
+EXTRA_libgnu_la_SOURCES += safe-read.c
+
+## end   gnulib module safe-read
+
+## begin gnulib module safe-write
+
+
+EXTRA_DIST += safe-write.c safe-write.h
+
+EXTRA_libgnu_la_SOURCES += safe-write.c
+
+## end   gnulib module safe-write
+
 ## begin gnulib module size_max
 
 libgnu_la_SOURCES += size_max.h
@@ -130,7 +262,7 @@ libgnu_la_SOURCES += size_max.h
 ## begin gnulib module snprintf
 
 
-EXTRA_DIST += snprintf.c snprintf.h
+EXTRA_DIST += snprintf.c
 
 EXTRA_libgnu_la_SOURCES += snprintf.c
 
@@ -154,6 +286,136 @@ EXTRA_DIST += stdbool_.h
 
 ## end   gnulib module stdbool
 
+## begin gnulib module stdint
+
+BUILT_SOURCES += $(STDINT_H)
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+stdint.h: stdint_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+             -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+             -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+             -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+             -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+             -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+             -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+             -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+             -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+             -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+             -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+             -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+             -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+             -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+             < $(srcdir)/stdint_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += stdint.h stdint.h-t
+
+EXTRA_DIST += stdint_.h
+
+## end   gnulib module stdint
+
+## begin gnulib module stdio
+
+BUILT_SOURCES += stdio.h
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+             -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
+             -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
+             -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
+             -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
+             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
+             -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
+             -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+             -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+             -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             < $(srcdir)/stdio_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t
+
+EXTRA_DIST += stdio_.h
+
+## end   gnulib module stdio
+
+## begin gnulib module stdlib
+
+BUILT_SOURCES += stdlib.h
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
+             -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+             -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
+             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             < $(srcdir)/stdlib_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+
+EXTRA_DIST += stdlib_.h
+
+## end   gnulib module stdlib
+
 ## begin gnulib module strdup
 
 
@@ -172,12 +434,41 @@ BUILT_SOURCES += string.h
 string.h: string_.h
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
+             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
+             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
+             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
+             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
+             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
+             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
+             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
+             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
+             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
+             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
+             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
+             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
+             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
+             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
+             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
+             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
+             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
+             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
+             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
+             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
+             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
+             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
+             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
+             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
+             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
              -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
              -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
              -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
              -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
              -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
@@ -186,10 +477,9 @@ string.h: string_.h
              -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
              -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
              -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-             -e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
-             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/string_.h; \
        } > $@-t
        mv $@-t $@
@@ -205,28 +495,157 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
-sys/socket.h: socket_.h
+sys/socket.h: sys_socket_.h
        @MKDIR_P@ sys
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/socket_.h; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             < $(srcdir)/sys_socket_.h; \
        } > $@-t
        mv -f $@-t $@
 MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
 MOSTLYCLEANDIRS += sys
 
-EXTRA_DIST += socket_.h
+EXTRA_DIST += sys_socket_.h
 
 ## end   gnulib module sys_socket
 
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += $(SYS_STAT_H)
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat_.h
+       @MKDIR_P@ sys
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+             -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \
+             -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+             -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \
+             < $(srcdir)/sys_stat_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_stat_.h
+
+## end   gnulib module sys_stat
+
+## begin gnulib module sys_time
+
+BUILT_SOURCES += $(SYS_TIME_H)
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time_.h
+       @MKDIR_P@ sys
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             < $(srcdir)/sys_time_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+
+EXTRA_DIST += sys_time_.h
+
+## end   gnulib module sys_time
+
+## begin gnulib module tempname
+
+
+EXTRA_DIST += tempname.c tempname.h
+
+EXTRA_libgnu_la_SOURCES += tempname.c
+
+## end   gnulib module tempname
+
+## begin gnulib module unistd
+
+BUILT_SOURCES += unistd.h
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
+             -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+             -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+             -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
+             -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
+             -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
+             -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
+             -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+             -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+             -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+             -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+             -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+             -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+             -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+             -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+             -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+             < $(srcdir)/unistd_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+EXTRA_DIST += unistd_.h
+
+## end   gnulib module unistd
+
 ## begin gnulib module vasnprintf
 
 
-EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
+EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
 
 EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
 
 ## end   gnulib module vasnprintf
 
+## begin gnulib module wchar
+
+BUILT_SOURCES += $(WCHAR_H)
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+             -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+             -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
+             -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+             -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+           < $(srcdir)/wchar_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += wchar.h wchar.h-t
+
+EXTRA_DIST += wchar_.h
+
+## end   gnulib module wchar
+
 ## begin gnulib module xsize
 
 libgnu_la_SOURCES += xsize.h
@@ -239,7 +658,8 @@ mostlyclean-local: mostlyclean-generic
          if test -n "$$dir" && test -d $$dir; then \
            echo "rmdir $$dir"; rmdir $$dir; \
          fi; \
-       done
+       done; \
+       :
 
 # Make sure regenerate/* are in the distribution tarball
 EXTRA_DIST += regenerate/getaddrinfo-cygwin.patch regenerate/no-error.patch regenerate/regenerate
index 2157892d7516dd9860f234f2d929c007fa45650f..04c9381405371ea511cf4f790e7b78522f2cfe53 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility
 
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -50,48 +46,115 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-@GCC_COMPILER_TRUE@am__append_1 = -Wno-error
 subdir = gnulib
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -100,34 +163,37 @@ CONFIG_CLEAN_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
-am_libgnu_la_OBJECTS = lock.lo
+am_libgnu_la_OBJECTS = base64.lo full-read.lo full-write.lo lock.lo
 libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+libgnu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
 DIST_SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -135,14 +201,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@ $(am__append_1)
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -153,20 +224,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -180,60 +250,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -243,10 +422,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -257,24 +450,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -286,59 +513,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -347,55 +561,84 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = 1.5 gnits
 noinst_HEADERS = 
 noinst_LIBRARIES = 
 noinst_LTLIBRARIES = libgnu.la
 
 # Make sure regenerate/* are in the distribution tarball
-EXTRA_DIST = alloca_.h gai_strerror.c getaddrinfo.c getaddrinfo.h \
-       inet_ntop.c inet_ntop.h snprintf.c snprintf.h stdbool_.h \
-       strdup.c string_.h socket_.h asnprintf.c printf-args.c \
-       printf-args.h printf-parse.c printf-parse.h vasnprintf.c \
-       vasnprintf.h regenerate/getaddrinfo-cygwin.patch \
+EXTRA_DIST = alloca_.h float_.h fsusage.c fsusage.h gai_strerror.c \
+       getaddrinfo.c getaddrinfo.h gettimeofday.c \
+       $(top_srcdir)/config/config.rpath inet_ntop.c inet_ntop.h \
+       $(top_srcdir)/config/link-warning.h \
+       $(top_srcdir)/config/config.rpath malloc.c mkdtemp.c \
+       netinet_in_.h physmem.c physmem.h safe-read.c safe-read.h \
+       safe-write.c safe-write.h snprintf.c stdbool_.h stdint_.h \
+       stdio_.h stdlib_.h strdup.c string_.h sys_socket_.h \
+       sys_stat_.h sys_time_.h tempname.c tempname.h unistd_.h \
+       asnprintf.c float+.h printf-args.c printf-args.h \
+       printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \
+       wchar_.h regenerate/getaddrinfo-cygwin.patch \
        regenerate/no-error.patch regenerate/regenerate
-BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) $(NETINET_IN_H) \
-       $(STDBOOL_H) string.h $(SYS_SOCKET_H)
+BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) $(FLOAT_H) $(NETINET_IN_H) \
+       $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h string.h \
+       $(SYS_SOCKET_H) $(SYS_STAT_H) $(SYS_TIME_H) unistd.h \
+       $(WCHAR_H)
 SUFFIXES = 
 MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
-       arpa/inet.h-t netinet/in.h netinet/in.h-t stdbool.h \
-       stdbool.h-t string.h string.h-t sys/socket.h sys/socket.h-t
-MOSTLYCLEANDIRS = arpa netinet sys
+       arpa/inet.h-t float.h float.h-t netinet/in.h netinet/in.h-t \
+       stdbool.h stdbool.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
+       stdlib.h stdlib.h-t string.h string.h-t sys/socket.h \
+       sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
+       unistd.h unistd.h-t wchar.h wchar.h-t
+MOSTLYCLEANDIRS = arpa netinet sys sys
 CLEANFILES = 
 DISTCLEANFILES = 
 MAINTAINERCLEANFILES = 
 AM_CPPFLAGS = 
-libgnu_la_SOURCES = gettext.h lock.h lock.c size_max.h xsize.h
+@GCC_COMPILER_TRUE@AM_CFLAGS = -Wno-error -Wno-sign-compare
+libgnu_la_SOURCES = base64.h base64.c full-read.h full-read.c \
+       full-write.h full-write.c gettext.h lock.h lock.c size_max.h \
+       xsize.h
 libgnu_la_LIBADD = $(gl_LTLIBOBJS)
 libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
-EXTRA_libgnu_la_SOURCES = gai_strerror.c getaddrinfo.c inet_ntop.c \
-       snprintf.c strdup.c asnprintf.c printf-args.c printf-parse.c \
-       vasnprintf.c
+EXTRA_libgnu_la_SOURCES = fsusage.c gai_strerror.c getaddrinfo.c \
+       gettimeofday.c inet_ntop.c malloc.c mkdtemp.c physmem.c \
+       safe-read.c safe-write.c snprintf.c strdup.c tempname.c \
+       asnprintf.c printf-args.c printf-parse.c vasnprintf.c
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
+LINK_WARNING_H = $(top_srcdir)/config/link-warning.h
 all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
@@ -443,7 +686,7 @@ clean-noinstLTLIBRARIES:
          rm -f "$${dir}/so_locations"; \
        done
 libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) 
-       $(LINK)  $(libgnu_la_LDFLAGS) $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS)
+       $(libgnu_la_LINK)  $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -452,33 +695,44 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-read.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-write.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gai_strerror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdtemp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physmem.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-read.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safe-write.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Plo@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -489,10 +743,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -542,23 +792,21 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-       $(mkdir_p) $(distdir)/regenerate
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -613,7 +861,7 @@ distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -627,12 +875,20 @@ info-am:
 
 install-data-am:
 
+install-dvi: install-dvi-am
+
 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
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -653,19 +909,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
        ctags distclean distclean-compile distclean-generic \
        distclean-libtool distclean-tags distdir dvi dvi-am html \
        html-am info info-am install install-am install-data \
-       install-data-am install-exec install-exec-am install-info \
-       install-info-am install-man install-strip installcheck \
+       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 mostlyclean-local pdf \
-       pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
+       pdf-am ps ps-am tags uninstall uninstall-am
 
 
 # We need the following in order to create <alloca.h> when the system
@@ -679,20 +939,34 @@ alloca.h: alloca_.h
 # We need the following in order to create <arpa/inet.h> when the system
 # doesn't have one.
 arpa/inet.h:
-       test -d arpa || mkdir arpa
+       @MKDIR_P@ arpa
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#include <sys/socket.h>'; \
        } > $@-t
        mv $@-t $@
 
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+float.h: float_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+             < $(srcdir)/float_.h; \
+       } > $@-t
+       mv $@-t $@
+
 # We need the following in order to create <netinet/in.h> when the system
 # doesn't have one.
 netinet/in.h:
-       test -d netinet || mkdir netinet
+       @MKDIR_P@ netinet
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         echo '#include <sys/socket.h>'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+             -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+             < $(srcdir)/netinet_in_.h; \
        } > $@-t
        mv $@-t $@
 
@@ -705,17 +979,149 @@ stdbool.h: stdbool_.h
        } > $@-t
        mv $@-t $@
 
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+stdint.h: stdint_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+             -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+             -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+             -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+             -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+             -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+             -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+             -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+             -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+             -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+             -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+             -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+             -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+             -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+             -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+             < $(srcdir)/stdint_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+             -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
+             -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
+             -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
+             -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
+             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
+             -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
+             -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+             -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+             -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+             -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+             -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+             -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+             -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+             -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+             -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+             -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+             -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+             -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+             -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+             -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+             -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+             -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+             -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             < $(srcdir)/stdio_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
+             -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
+             -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+             -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
+             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             < $(srcdir)/stdlib_.h; \
+       } > $@-t
+       mv $@-t $@
+
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
 string.h: string_.h
        rm -f $@-t $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
+             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
+             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
+             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
+             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
+             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
+             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
+             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
+             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
+             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
+             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
+             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
+             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
+             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
+             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
+             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
+             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
+             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
+             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
+             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
+             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
+             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
+             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
+             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
+             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
+             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
              -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
              -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
              -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
              -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
              -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
@@ -724,29 +1130,112 @@ string.h: string_.h
              -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
              -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
              -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-             -e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
-             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/string_.h; \
        } > $@-t
        mv $@-t $@
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
-sys/socket.h: socket_.h
+sys/socket.h: sys_socket_.h
        @MKDIR_P@ sys
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/socket_.h; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             < $(srcdir)/sys_socket_.h; \
        } > $@-t
        mv -f $@-t $@
 
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat_.h
+       @MKDIR_P@ sys
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+             -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \
+             -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+             -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \
+             < $(srcdir)/sys_stat_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time_.h
+       @MKDIR_P@ sys
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             < $(srcdir)/sys_time_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+             -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
+             -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+             -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+             -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
+             -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
+             -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
+             -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
+             -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+             -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+             -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+             -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+             -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+             -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+             -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+             -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+             -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+             < $(srcdir)/unistd_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+             -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+             -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+             -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
+             -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+             -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+           < $(srcdir)/wchar_.h; \
+       } > $@-t
+       mv $@-t $@
+
 mostlyclean-local: mostlyclean-generic
        @for dir in '' $(MOSTLYCLEANDIRS); do \
          if test -n "$$dir" && test -d $$dir; then \
            echo "rmdir $$dir"; rmdir $$dir; \
          fi; \
-       done
+       done; \
+       :
 # 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 dd0b3e98f5465978e7822b6e920e1a3be5279b88..af274b9e75387b61c3b588bafa3f7c327a999e78 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2007 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -20,8 +20,8 @@
 
 /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
    means there is a real alloca function.  */
-#ifndef _GNULIB_ALLOCA_H
-# define _GNULIB_ALLOCA_H
+#ifndef _GL_ALLOCA_H
+#define _GL_ALLOCA_H
 
 /* alloca (N) returns a pointer to N bytes of memory
    allocated on the stack, which will last until the function returns.
@@ -51,4 +51,4 @@ void *alloca (size_t);
 # endif
 #endif
 
-#endif /* _GNULIB_ALLOCA_H */
+#endif /* _GL_ALLOCA_H */
diff --git a/gnulib/base64.c b/gnulib/base64.c
new file mode 100644 (file)
index 0000000..f237cd6
--- /dev/null
@@ -0,0 +1,425 @@
+/* base64.c -- Encode binary data using printable characters.
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Simon Josefsson.  Partially adapted from GNU MailUtils
+ * (mailbox/filter_trans.c, as of 2004-11-28).  Improved by review
+ * from Paul Eggert, Bruno Haible, and Stepan Kasal.
+ *
+ * See also RFC 3548 <http://www.ietf.org/rfc/rfc3548.txt>.
+ *
+ * Be careful with error checking.  Here is how you would typically
+ * use these functions:
+ *
+ * bool ok = base64_decode_alloc (in, inlen, &out, &outlen);
+ * if (!ok)
+ *   FAIL: input was not valid base64
+ * if (out == NULL)
+ *   FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN
+ *
+ * size_t outlen = base64_encode_alloc (in, inlen, &out);
+ * if (out == NULL && outlen == 0 && inlen != 0)
+ *   FAIL: input too long
+ * if (out == NULL)
+ *   FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN.
+ *
+ */
+
+#include <config.h>
+
+/* Get prototype. */
+#include "base64.h"
+
+/* Get malloc. */
+#include <stdlib.h>
+
+/* Get UCHAR_MAX. */
+#include <limits.h>
+
+/* C89 compliant way to cast 'char' to 'unsigned char'. */
+static inline unsigned char
+to_uchar (char ch)
+{
+  return ch;
+}
+
+/* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
+   If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
+   possible.  If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
+   terminate the output buffer. */
+void
+base64_encode (const char *restrict in, size_t inlen,
+              char *restrict out, size_t outlen)
+{
+  static const char b64str[64] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+  while (inlen && outlen)
+    {
+      *out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
+      if (!--outlen)
+       break;
+      *out++ = b64str[((to_uchar (in[0]) << 4)
+                      + (--inlen ? to_uchar (in[1]) >> 4 : 0))
+                     & 0x3f];
+      if (!--outlen)
+       break;
+      *out++ =
+       (inlen
+        ? b64str[((to_uchar (in[1]) << 2)
+                  + (--inlen ? to_uchar (in[2]) >> 6 : 0))
+                 & 0x3f]
+        : '=');
+      if (!--outlen)
+       break;
+      *out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
+      if (!--outlen)
+       break;
+      if (inlen)
+       inlen--;
+      if (inlen)
+       in += 3;
+    }
+
+  if (outlen)
+    *out = '\0';
+}
+
+/* Allocate a buffer and store zero terminated base64 encoded data
+   from array IN of size INLEN, returning BASE64_LENGTH(INLEN), i.e.,
+   the length of the encoded data, excluding the terminating zero.  On
+   return, the OUT variable will hold a pointer to newly allocated
+   memory that must be deallocated by the caller.  If output string
+   length would overflow, 0 is returned and OUT is set to NULL.  If
+   memory allocation failed, OUT is set to NULL, and the return value
+   indicates length of the requested memory block, i.e.,
+   BASE64_LENGTH(inlen) + 1. */
+size_t
+base64_encode_alloc (const char *in, size_t inlen, char **out)
+{
+  size_t outlen = 1 + BASE64_LENGTH (inlen);
+
+  /* Check for overflow in outlen computation.
+   *
+   * If there is no overflow, outlen >= inlen.
+   *
+   * If the operation (inlen + 2) overflows then it yields at most +1, so
+   * outlen is 0.
+   *
+   * If the multiplication overflows, we lose at least half of the
+   * correct value, so the result is < ((inlen + 2) / 3) * 2, which is
+   * less than (inlen + 2) * 0.66667, which is less than inlen as soon as
+   * (inlen > 4).
+   */
+  if (inlen > outlen)
+    {
+      *out = NULL;
+      return 0;
+    }
+
+  *out = malloc (outlen);
+  if (!*out)
+    return outlen;
+
+  base64_encode (in, inlen, *out, outlen);
+
+  return outlen - 1;
+}
+
+/* With this approach this file works independent of the charset used
+   (think EBCDIC).  However, it does assume that the characters in the
+   Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255.  POSIX
+   1003.1-2001 require that char and unsigned char are 8-bit
+   quantities, though, taking care of that problem.  But this may be a
+   potential problem on non-POSIX C99 platforms.
+
+   IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
+   as the formal parameter rather than "x".  */
+#define B64(_)                                 \
+  ((_) == 'A' ? 0                              \
+   : (_) == 'B' ? 1                            \
+   : (_) == 'C' ? 2                            \
+   : (_) == 'D' ? 3                            \
+   : (_) == 'E' ? 4                            \
+   : (_) == 'F' ? 5                            \
+   : (_) == 'G' ? 6                            \
+   : (_) == 'H' ? 7                            \
+   : (_) == 'I' ? 8                            \
+   : (_) == 'J' ? 9                            \
+   : (_) == 'K' ? 10                           \
+   : (_) == 'L' ? 11                           \
+   : (_) == 'M' ? 12                           \
+   : (_) == 'N' ? 13                           \
+   : (_) == 'O' ? 14                           \
+   : (_) == 'P' ? 15                           \
+   : (_) == 'Q' ? 16                           \
+   : (_) == 'R' ? 17                           \
+   : (_) == 'S' ? 18                           \
+   : (_) == 'T' ? 19                           \
+   : (_) == 'U' ? 20                           \
+   : (_) == 'V' ? 21                           \
+   : (_) == 'W' ? 22                           \
+   : (_) == 'X' ? 23                           \
+   : (_) == 'Y' ? 24                           \
+   : (_) == 'Z' ? 25                           \
+   : (_) == 'a' ? 26                           \
+   : (_) == 'b' ? 27                           \
+   : (_) == 'c' ? 28                           \
+   : (_) == 'd' ? 29                           \
+   : (_) == 'e' ? 30                           \
+   : (_) == 'f' ? 31                           \
+   : (_) == 'g' ? 32                           \
+   : (_) == 'h' ? 33                           \
+   : (_) == 'i' ? 34                           \
+   : (_) == 'j' ? 35                           \
+   : (_) == 'k' ? 36                           \
+   : (_) == 'l' ? 37                           \
+   : (_) == 'm' ? 38                           \
+   : (_) == 'n' ? 39                           \
+   : (_) == 'o' ? 40                           \
+   : (_) == 'p' ? 41                           \
+   : (_) == 'q' ? 42                           \
+   : (_) == 'r' ? 43                           \
+   : (_) == 's' ? 44                           \
+   : (_) == 't' ? 45                           \
+   : (_) == 'u' ? 46                           \
+   : (_) == 'v' ? 47                           \
+   : (_) == 'w' ? 48                           \
+   : (_) == 'x' ? 49                           \
+   : (_) == 'y' ? 50                           \
+   : (_) == 'z' ? 51                           \
+   : (_) == '0' ? 52                           \
+   : (_) == '1' ? 53                           \
+   : (_) == '2' ? 54                           \
+   : (_) == '3' ? 55                           \
+   : (_) == '4' ? 56                           \
+   : (_) == '5' ? 57                           \
+   : (_) == '6' ? 58                           \
+   : (_) == '7' ? 59                           \
+   : (_) == '8' ? 60                           \
+   : (_) == '9' ? 61                           \
+   : (_) == '+' ? 62                           \
+   : (_) == '/' ? 63                           \
+   : -1)
+
+static const signed char b64[0x100] = {
+  B64 (0), B64 (1), B64 (2), B64 (3),
+  B64 (4), B64 (5), B64 (6), B64 (7),
+  B64 (8), B64 (9), B64 (10), B64 (11),
+  B64 (12), B64 (13), B64 (14), B64 (15),
+  B64 (16), B64 (17), B64 (18), B64 (19),
+  B64 (20), B64 (21), B64 (22), B64 (23),
+  B64 (24), B64 (25), B64 (26), B64 (27),
+  B64 (28), B64 (29), B64 (30), B64 (31),
+  B64 (32), B64 (33), B64 (34), B64 (35),
+  B64 (36), B64 (37), B64 (38), B64 (39),
+  B64 (40), B64 (41), B64 (42), B64 (43),
+  B64 (44), B64 (45), B64 (46), B64 (47),
+  B64 (48), B64 (49), B64 (50), B64 (51),
+  B64 (52), B64 (53), B64 (54), B64 (55),
+  B64 (56), B64 (57), B64 (58), B64 (59),
+  B64 (60), B64 (61), B64 (62), B64 (63),
+  B64 (64), B64 (65), B64 (66), B64 (67),
+  B64 (68), B64 (69), B64 (70), B64 (71),
+  B64 (72), B64 (73), B64 (74), B64 (75),
+  B64 (76), B64 (77), B64 (78), B64 (79),
+  B64 (80), B64 (81), B64 (82), B64 (83),
+  B64 (84), B64 (85), B64 (86), B64 (87),
+  B64 (88), B64 (89), B64 (90), B64 (91),
+  B64 (92), B64 (93), B64 (94), B64 (95),
+  B64 (96), B64 (97), B64 (98), B64 (99),
+  B64 (100), B64 (101), B64 (102), B64 (103),
+  B64 (104), B64 (105), B64 (106), B64 (107),
+  B64 (108), B64 (109), B64 (110), B64 (111),
+  B64 (112), B64 (113), B64 (114), B64 (115),
+  B64 (116), B64 (117), B64 (118), B64 (119),
+  B64 (120), B64 (121), B64 (122), B64 (123),
+  B64 (124), B64 (125), B64 (126), B64 (127),
+  B64 (128), B64 (129), B64 (130), B64 (131),
+  B64 (132), B64 (133), B64 (134), B64 (135),
+  B64 (136), B64 (137), B64 (138), B64 (139),
+  B64 (140), B64 (141), B64 (142), B64 (143),
+  B64 (144), B64 (145), B64 (146), B64 (147),
+  B64 (148), B64 (149), B64 (150), B64 (151),
+  B64 (152), B64 (153), B64 (154), B64 (155),
+  B64 (156), B64 (157), B64 (158), B64 (159),
+  B64 (160), B64 (161), B64 (162), B64 (163),
+  B64 (164), B64 (165), B64 (166), B64 (167),
+  B64 (168), B64 (169), B64 (170), B64 (171),
+  B64 (172), B64 (173), B64 (174), B64 (175),
+  B64 (176), B64 (177), B64 (178), B64 (179),
+  B64 (180), B64 (181), B64 (182), B64 (183),
+  B64 (184), B64 (185), B64 (186), B64 (187),
+  B64 (188), B64 (189), B64 (190), B64 (191),
+  B64 (192), B64 (193), B64 (194), B64 (195),
+  B64 (196), B64 (197), B64 (198), B64 (199),
+  B64 (200), B64 (201), B64 (202), B64 (203),
+  B64 (204), B64 (205), B64 (206), B64 (207),
+  B64 (208), B64 (209), B64 (210), B64 (211),
+  B64 (212), B64 (213), B64 (214), B64 (215),
+  B64 (216), B64 (217), B64 (218), B64 (219),
+  B64 (220), B64 (221), B64 (222), B64 (223),
+  B64 (224), B64 (225), B64 (226), B64 (227),
+  B64 (228), B64 (229), B64 (230), B64 (231),
+  B64 (232), B64 (233), B64 (234), B64 (235),
+  B64 (236), B64 (237), B64 (238), B64 (239),
+  B64 (240), B64 (241), B64 (242), B64 (243),
+  B64 (244), B64 (245), B64 (246), B64 (247),
+  B64 (248), B64 (249), B64 (250), B64 (251),
+  B64 (252), B64 (253), B64 (254), B64 (255)
+};
+
+#if UCHAR_MAX == 255
+# define uchar_in_range(c) true
+#else
+# define uchar_in_range(c) ((c) <= 255)
+#endif
+
+/* Return true if CH is a character from the Base64 alphabet, and
+   false otherwise.  Note that '=' is padding and not considered to be
+   part of the alphabet.  */
+bool
+isbase64 (char ch)
+{
+  return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)];
+}
+
+/* Decode base64 encoded input array IN of length INLEN to output
+   array OUT that can hold *OUTLEN bytes.  Return true if decoding was
+   successful, i.e. if the input was valid base64 data, false
+   otherwise.  If *OUTLEN is too small, as many bytes as possible will
+   be written to OUT.  On return, *OUTLEN holds the length of decoded
+   bytes in OUT.  Note that as soon as any non-alphabet characters are
+   encountered, decoding is stopped and false is returned.  This means
+   that, when applicable, you must remove any line terminators that is
+   part of the data stream before calling this function.  */
+bool
+base64_decode (const char *restrict in, size_t inlen,
+              char *restrict out, size_t *outlen)
+{
+  size_t outleft = *outlen;
+
+  while (inlen >= 2)
+    {
+      if (!isbase64 (in[0]) || !isbase64 (in[1]))
+       break;
+
+      if (outleft)
+       {
+         *out++ = ((b64[to_uchar (in[0])] << 2)
+                   | (b64[to_uchar (in[1])] >> 4));
+         outleft--;
+       }
+
+      if (inlen == 2)
+       break;
+
+      if (in[2] == '=')
+       {
+         if (inlen != 4)
+           break;
+
+         if (in[3] != '=')
+           break;
+
+       }
+      else
+       {
+         if (!isbase64 (in[2]))
+           break;
+
+         if (outleft)
+           {
+             *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
+                       | (b64[to_uchar (in[2])] >> 2));
+             outleft--;
+           }
+
+         if (inlen == 3)
+           break;
+
+         if (in[3] == '=')
+           {
+             if (inlen != 4)
+               break;
+           }
+         else
+           {
+             if (!isbase64 (in[3]))
+               break;
+
+             if (outleft)
+               {
+                 *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
+                           | b64[to_uchar (in[3])]);
+                 outleft--;
+               }
+           }
+       }
+
+      in += 4;
+      inlen -= 4;
+    }
+
+  *outlen -= outleft;
+
+  if (inlen != 0)
+    return false;
+
+  return true;
+}
+
+/* Allocate an output buffer in *OUT, and decode the base64 encoded
+   data stored in IN of size INLEN to the *OUT buffer.  On return, the
+   size of the decoded data is stored in *OUTLEN.  OUTLEN may be NULL,
+   if the caller is not interested in the decoded length.  *OUT may be
+   NULL to indicate an out of memory error, in which case *OUTLEN
+   contains the size of the memory block needed.  The function returns
+   true on successful decoding and memory allocation errors.  (Use the
+   *OUT and *OUTLEN parameters to differentiate between successful
+   decoding and memory error.)  The function returns false if the
+   input was invalid, in which case *OUT is NULL and *OUTLEN is
+   undefined. */
+bool
+base64_decode_alloc (const char *in, size_t inlen, char **out,
+                    size_t *outlen)
+{
+  /* This may allocate a few bytes too much, depending on input,
+     but it's not worth the extra CPU time to compute the exact amount.
+     The exact amount is 3 * inlen / 4, minus 1 if the input ends
+     with "=" and minus another 1 if the input ends with "==".
+     Dividing before multiplying avoids the possibility of overflow.  */
+  size_t needlen = 3 * (inlen / 4) + 2;
+
+  *out = malloc (needlen);
+  if (!*out)
+    return true;
+
+  if (!base64_decode (in, inlen, *out, &needlen))
+    {
+      free (*out);
+      *out = NULL;
+      return false;
+    }
+
+  if (outlen)
+    *outlen = needlen;
+
+  return true;
+}
diff --git a/gnulib/base64.h b/gnulib/base64.h
new file mode 100644 (file)
index 0000000..6bb9a97
--- /dev/null
@@ -0,0 +1,45 @@
+/* base64.h -- Encode binary data using printable characters.
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef BASE64_H
+# define BASE64_H
+
+/* Get size_t. */
+# include <stddef.h>
+
+/* Get bool. */
+# include <stdbool.h>
+
+/* This uses that the expression (n+(k-1))/k means the smallest
+   integer >= n/k, i.e., the ceiling of n/k.  */
+# define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
+
+extern bool isbase64 (char ch);
+
+extern void base64_encode (const char *restrict in, size_t inlen,
+                          char *restrict out, size_t outlen);
+
+extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);
+
+extern bool base64_decode (const char *restrict in, size_t inlen,
+                          char *restrict out, size_t *outlen);
+
+extern bool base64_decode_alloc (const char *in, size_t inlen,
+                                char **out, size_t *outlen);
+
+#endif /* BASE64_H */
diff --git a/gnulib/float+.h b/gnulib/float+.h
new file mode 100644 (file)
index 0000000..4de25a9
--- /dev/null
@@ -0,0 +1,148 @@
+/* Supplemental information about the floating-point formats.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _FLOATPLUS_H
+#define _FLOATPLUS_H
+
+#include <float.h>
+#include <limits.h>
+
+/* Number of bits in the mantissa of a floating-point number, including the
+   "hidden bit".  */
+#if FLT_RADIX == 2
+# define FLT_MANT_BIT FLT_MANT_DIG
+# define DBL_MANT_BIT DBL_MANT_DIG
+# define LDBL_MANT_BIT LDBL_MANT_DIG
+#elif FLT_RADIX == 4
+# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
+#elif FLT_RADIX == 16
+# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
+#endif
+
+/* Bit mask that can be used to mask the exponent, as an unsigned number.  */
+#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
+#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
+
+/* Number of bits used for the exponent of a floating-point number, including
+   the exponent's sign.  */
+#define FLT_EXP_BIT \
+  (FLT_EXP_MASK < 0x100 ? 8 : \
+   FLT_EXP_MASK < 0x200 ? 9 : \
+   FLT_EXP_MASK < 0x400 ? 10 : \
+   FLT_EXP_MASK < 0x800 ? 11 : \
+   FLT_EXP_MASK < 0x1000 ? 12 : \
+   FLT_EXP_MASK < 0x2000 ? 13 : \
+   FLT_EXP_MASK < 0x4000 ? 14 : \
+   FLT_EXP_MASK < 0x8000 ? 15 : \
+   FLT_EXP_MASK < 0x10000 ? 16 : \
+   FLT_EXP_MASK < 0x20000 ? 17 : \
+   FLT_EXP_MASK < 0x40000 ? 18 : \
+   FLT_EXP_MASK < 0x80000 ? 19 : \
+   FLT_EXP_MASK < 0x100000 ? 20 : \
+   FLT_EXP_MASK < 0x200000 ? 21 : \
+   FLT_EXP_MASK < 0x400000 ? 22 : \
+   FLT_EXP_MASK < 0x800000 ? 23 : \
+   FLT_EXP_MASK < 0x1000000 ? 24 : \
+   FLT_EXP_MASK < 0x2000000 ? 25 : \
+   FLT_EXP_MASK < 0x4000000 ? 26 : \
+   FLT_EXP_MASK < 0x8000000 ? 27 : \
+   FLT_EXP_MASK < 0x10000000 ? 28 : \
+   FLT_EXP_MASK < 0x20000000 ? 29 : \
+   FLT_EXP_MASK < 0x40000000 ? 30 : \
+   FLT_EXP_MASK <= 0x7fffffff ? 31 : \
+   32)
+#define DBL_EXP_BIT \
+  (DBL_EXP_MASK < 0x100 ? 8 : \
+   DBL_EXP_MASK < 0x200 ? 9 : \
+   DBL_EXP_MASK < 0x400 ? 10 : \
+   DBL_EXP_MASK < 0x800 ? 11 : \
+   DBL_EXP_MASK < 0x1000 ? 12 : \
+   DBL_EXP_MASK < 0x2000 ? 13 : \
+   DBL_EXP_MASK < 0x4000 ? 14 : \
+   DBL_EXP_MASK < 0x8000 ? 15 : \
+   DBL_EXP_MASK < 0x10000 ? 16 : \
+   DBL_EXP_MASK < 0x20000 ? 17 : \
+   DBL_EXP_MASK < 0x40000 ? 18 : \
+   DBL_EXP_MASK < 0x80000 ? 19 : \
+   DBL_EXP_MASK < 0x100000 ? 20 : \
+   DBL_EXP_MASK < 0x200000 ? 21 : \
+   DBL_EXP_MASK < 0x400000 ? 22 : \
+   DBL_EXP_MASK < 0x800000 ? 23 : \
+   DBL_EXP_MASK < 0x1000000 ? 24 : \
+   DBL_EXP_MASK < 0x2000000 ? 25 : \
+   DBL_EXP_MASK < 0x4000000 ? 26 : \
+   DBL_EXP_MASK < 0x8000000 ? 27 : \
+   DBL_EXP_MASK < 0x10000000 ? 28 : \
+   DBL_EXP_MASK < 0x20000000 ? 29 : \
+   DBL_EXP_MASK < 0x40000000 ? 30 : \
+   DBL_EXP_MASK <= 0x7fffffff ? 31 : \
+   32)
+#define LDBL_EXP_BIT \
+  (LDBL_EXP_MASK < 0x100 ? 8 : \
+   LDBL_EXP_MASK < 0x200 ? 9 : \
+   LDBL_EXP_MASK < 0x400 ? 10 : \
+   LDBL_EXP_MASK < 0x800 ? 11 : \
+   LDBL_EXP_MASK < 0x1000 ? 12 : \
+   LDBL_EXP_MASK < 0x2000 ? 13 : \
+   LDBL_EXP_MASK < 0x4000 ? 14 : \
+   LDBL_EXP_MASK < 0x8000 ? 15 : \
+   LDBL_EXP_MASK < 0x10000 ? 16 : \
+   LDBL_EXP_MASK < 0x20000 ? 17 : \
+   LDBL_EXP_MASK < 0x40000 ? 18 : \
+   LDBL_EXP_MASK < 0x80000 ? 19 : \
+   LDBL_EXP_MASK < 0x100000 ? 20 : \
+   LDBL_EXP_MASK < 0x200000 ? 21 : \
+   LDBL_EXP_MASK < 0x400000 ? 22 : \
+   LDBL_EXP_MASK < 0x800000 ? 23 : \
+   LDBL_EXP_MASK < 0x1000000 ? 24 : \
+   LDBL_EXP_MASK < 0x2000000 ? 25 : \
+   LDBL_EXP_MASK < 0x4000000 ? 26 : \
+   LDBL_EXP_MASK < 0x8000000 ? 27 : \
+   LDBL_EXP_MASK < 0x10000000 ? 28 : \
+   LDBL_EXP_MASK < 0x20000000 ? 29 : \
+   LDBL_EXP_MASK < 0x40000000 ? 30 : \
+   LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
+   32)
+
+/* Number of bits used for a floating-point number: the mantissa (not
+   counting the "hidden bit", since it may or may not be explicit), the
+   exponent, and the sign.  */
+#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
+#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
+#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
+
+/* Number of bytes used for a floating-point number.
+   This can be smaller than the 'sizeof'.  For example, on i386 systems,
+   'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
+   LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
+   sizeof (long double) = 12 or = 16.  */
+#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+
+/* Verify that SIZEOF_FLT <= sizeof (float) etc.  */
+typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
+typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
+typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
+
+#endif /* _FLOATPLUS_H */
diff --git a/gnulib/float_.h b/gnulib/float_.h
new file mode 100644 (file)
index 0000000..d61d630
--- /dev/null
@@ -0,0 +1,59 @@
+/* A correct <float.h>.
+
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_FLOAT_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
+
+#ifndef _GL_FLOAT_H
+#define _GL_FLOAT_H
+
+/* 'long double' properties.  */
+#if defined __i386__ && defined __BEOS__
+/* Number of mantissa units, in base FLT_RADIX.  */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG   64
+/* Number of decimal digits that is sufficient for representing a number.  */
+# undef LDBL_DIG
+# define LDBL_DIG        18
+/* x-1 where x is the smallest representable number > 1.  */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON    1.0842021724855044340E-19L
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number.  */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number.  */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP    16384
+/* Minimum positive normalized number.  */
+# undef LDBL_MIN
+# define LDBL_MIN        3.3621031431120935063E-4932L
+/* Maximum representable finite number.  */
+# undef LDBL_MAX
+# define LDBL_MAX        1.1897314953572317650E+4932L
+/* Minimum e such that 10^e is in the range of normalized numbers.  */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers.  */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+#endif /* _GL_FLOAT_H */
+#endif /* _GL_FLOAT_H */
diff --git a/gnulib/fsusage.c b/gnulib/fsusage.c
new file mode 100644 (file)
index 0000000..337bf53
--- /dev/null
@@ -0,0 +1,264 @@
+/* fsusage.c -- return space usage of mounted file systems
+
+   Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+#include "fsusage.h"
+
+#include <limits.h>
+#include <sys/types.h>
+
+#if STAT_STATVFS               /* POSIX 1003.1-2001 (and later) with XSI */
+# include <sys/statvfs.h>
+#else
+/* Don't include backward-compatibility files unless they're needed.
+   Eventually we'd like to remove all this cruft.  */
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/stat.h>
+# if HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+# endif
+# if HAVE_SYS_MOUNT_H
+#  include <sys/mount.h>
+# endif
+# if HAVE_SYS_VFS_H
+#  include <sys/vfs.h>
+# endif
+# if HAVE_SYS_FS_S5PARAM_H     /* Fujitsu UXP/V */
+#  include <sys/fs/s5param.h>
+# endif
+# if defined HAVE_SYS_FILSYS_H && !defined _CRAY
+#  include <sys/filsys.h>      /* SVR2 */
+# endif
+# if HAVE_SYS_STATFS_H
+#  include <sys/statfs.h>
+# endif
+# if HAVE_DUSTAT_H             /* AIX PS/2 */
+#  include <sys/dustat.h>
+# endif
+# include "full-read.h"
+#endif
+
+/* The results of open() in this file are not used with fchdir,
+   therefore save some unnecessary work in fchdir.c.  */
+#undef open
+#undef close
+
+/* Many space usage primitives use all 1 bits to denote a value that is
+   not applicable or unknown.  Propagate this information by returning
+   a uintmax_t value that is all 1 bits if X is all 1 bits, even if X
+   is unsigned and narrower than uintmax_t.  */
+#define PROPAGATE_ALL_ONES(x) \
+  ((sizeof (x) < sizeof (uintmax_t) \
+    && (~ (x) == (sizeof (x) < sizeof (int) \
+                 ? - (1 << (sizeof (x) * CHAR_BIT)) \
+                 : 0))) \
+   ? UINTMAX_MAX : (uintmax_t) (x))
+
+/* Extract the top bit of X as an uintmax_t value.  */
+#define EXTRACT_TOP_BIT(x) ((x) \
+                           & ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
+
+/* If a value is negative, many space usage primitives store it into an
+   integer variable by assignment, even if the variable's type is unsigned.
+   So, if a space usage variable X's top bit is set, convert X to the
+   uintmax_t value V such that (- (uintmax_t) V) is the negative of
+   the original value.  If X's top bit is clear, just yield X.
+   Use PROPAGATE_TOP_BIT if the original value might be negative;
+   otherwise, use PROPAGATE_ALL_ONES.  */
+#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
+
+/* Fill in the fields of FSP with information about space usage for
+   the file system on which FILE resides.
+   DISK is the device on which FILE is mounted, for space-getting
+   methods that need to know it.
+   Return 0 if successful, -1 if not.  When returning -1, ensure that
+   ERRNO is either a system error value, or zero if DISK is NULL
+   on a system that requires a non-NULL value.  */
+int
+get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
+{
+#if defined STAT_STATVFS               /* POSIX */
+
+  struct statvfs fsd;
+
+  if (statvfs (file, &fsd) < 0)
+    return -1;
+
+  /* f_frsize isn't guaranteed to be supported.  */
+  fsp->fsu_blocksize = (fsd.f_frsize
+                       ? PROPAGATE_ALL_ONES (fsd.f_frsize)
+                       : PROPAGATE_ALL_ONES (fsd.f_bsize));
+
+#elif defined STAT_STATFS2_FS_DATA     /* Ultrix */
+
+  struct fs_data fsd;
+
+  if (statfs (file, &fsd) != 1)
+    return -1;
+
+  fsp->fsu_blocksize = 1024;
+  fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot);
+  fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree);
+  fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen);
+  fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0;
+  fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
+  fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
+
+#elif defined STAT_READ_FILSYS         /* SVR2 */
+# ifndef SUPERBOFF
+#  define SUPERBOFF (SUPERB * 512)
+# endif
+
+  struct filsys fsd;
+  int fd;
+
+  if (! disk)
+    {
+      errno = 0;
+      return -1;
+    }
+
+  fd = open (disk, O_RDONLY);
+  if (fd < 0)
+    return -1;
+  lseek (fd, (off_t) SUPERBOFF, 0);
+  if (full_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd)
+    {
+      close (fd);
+      return -1;
+    }
+  close (fd);
+
+  fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512);
+  fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize);
+  fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree);
+  fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
+  fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
+  fsp->fsu_files = (fsd.s_isize == -1
+                   ? UINTMAX_MAX
+                   : (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
+  fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode);
+
+#elif defined STAT_STATFS3_OSF1
+
+  struct statfs fsd;
+
+  if (statfs (file, &fsd, sizeof (struct statfs)) != 0)
+    return -1;
+
+  fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
+
+#elif defined STAT_STATFS2_BSIZE       /* 4.3BSD, SunOS 4, HP-UX, AIX */
+
+  struct statfs fsd;
+
+  if (statfs (file, &fsd) < 0)
+    return -1;
+
+  fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
+
+# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
+
+  /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
+     struct statfs are truncated to 2GB.  These conditions detect that
+     truncation, presumably without botching the 4.1.1 case, in which
+     the values are not truncated.  The correct counts are stored in
+     undocumented spare fields.  */
+  if (fsd.f_blocks == 0x7fffffff / fsd.f_bsize && fsd.f_spare[0] > 0)
+    {
+      fsd.f_blocks = fsd.f_spare[0];
+      fsd.f_bfree = fsd.f_spare[1];
+      fsd.f_bavail = fsd.f_spare[2];
+    }
+# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
+
+#elif defined STAT_STATFS2_FSIZE       /* 4.4BSD */
+
+  struct statfs fsd;
+
+  if (statfs (file, &fsd) < 0)
+    return -1;
+
+  fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
+
+#elif defined STAT_STATFS4             /* SVR3, Dynix, Irix, AIX */
+
+# if !_AIX && !defined _SEQUENT_ && !defined DOLPHIN
+#  define f_bavail f_bfree
+# endif
+
+  struct statfs fsd;
+
+  if (statfs (file, &fsd, sizeof fsd, 0) < 0)
+    return -1;
+
+  /* Empirically, the block counts on most SVR3 and SVR3-derived
+     systems seem to always be in terms of 512-byte blocks,
+     no matter what value f_bsize has.  */
+# if _AIX || defined _CRAY
+   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
+# else
+   fsp->fsu_blocksize = 512;
+# endif
+
+#endif
+
+#if (defined STAT_STATVFS \
+     || (!defined STAT_STATFS2_FS_DATA && !defined STAT_READ_FILSYS))
+
+  fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
+  fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);
+  fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.f_bavail);
+  fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0;
+  fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.f_files);
+  fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
+
+#endif
+
+  return 0;
+}
+
+#if defined _AIX && defined _I386
+/* AIX PS/2 does not supply statfs.  */
+
+int
+statfs (char *file, struct statfs *fsb)
+{
+  struct stat stats;
+  struct dustat fsd;
+
+  if (stat (file, &stats) != 0)
+    return -1;
+  if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd)))
+    return -1;
+  fsb->f_type   = 0;
+  fsb->f_bsize  = fsd.du_bsize;
+  fsb->f_blocks = fsd.du_fsize - fsd.du_isize;
+  fsb->f_bfree  = fsd.du_tfree;
+  fsb->f_bavail = fsd.du_tfree;
+  fsb->f_files  = (fsd.du_isize - 2) * fsd.du_inopb;
+  fsb->f_ffree  = fsd.du_tinode;
+  fsb->f_fsid.val[0] = fsd.du_site;
+  fsb->f_fsid.val[1] = fsd.du_pckno;
+  return 0;
+}
+
+#endif /* _AIX && _I386 */
diff --git a/gnulib/fsusage.h b/gnulib/fsusage.h
new file mode 100644 (file)
index 0000000..7fa9f8d
--- /dev/null
@@ -0,0 +1,41 @@
+/* fsusage.h -- declarations for file system space usage info
+
+   Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005, 2006 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Space usage statistics for a file system.  Blocks are 512-byte. */
+
+#if !defined FSUSAGE_H_
+# define FSUSAGE_H_
+
+# include <stdint.h>
+# include <stdbool.h>
+
+struct fs_usage
+{
+  uintmax_t fsu_blocksize;     /* Size of a block.  */
+  uintmax_t fsu_blocks;                /* Total blocks. */
+  uintmax_t fsu_bfree;         /* Free blocks available to superuser. */
+  uintmax_t fsu_bavail;                /* Free blocks available to non-superuser. */
+  bool fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0.  */
+  uintmax_t fsu_files;         /* Total file nodes. */
+  uintmax_t fsu_ffree;         /* Free file nodes. */
+};
+
+int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
+
+#endif
diff --git a/gnulib/full-read.c b/gnulib/full-read.c
new file mode 100644 (file)
index 0000000..8c3472a
--- /dev/null
@@ -0,0 +1,19 @@
+/* An interface to read that retries after partial reads and interrupts.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#define FULL_READ
+#include "full-write.c"
diff --git a/gnulib/full-read.h b/gnulib/full-read.h
new file mode 100644 (file)
index 0000000..05d83a7
--- /dev/null
@@ -0,0 +1,24 @@
+/* An interface to read() that reads all it is asked to read.
+
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, read to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <stddef.h>
+
+/* Read COUNT bytes at BUF to descriptor FD, retrying if interrupted
+   or if partial reads occur.  Return the number of bytes successfully
+   read, setting errno if that is less than COUNT.  errno = 0 means EOF.  */
+extern size_t full_read (int fd, void *buf, size_t count);
diff --git a/gnulib/full-write.c b/gnulib/full-write.c
new file mode 100644 (file)
index 0000000..cc16872
--- /dev/null
@@ -0,0 +1,81 @@
+/* An interface to read and write that retries (if necessary) until complete.
+
+   Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004, 2005, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#ifdef FULL_READ
+# include "full-read.h"
+#else
+# include "full-write.h"
+#endif
+
+#include <errno.h>
+
+#ifdef FULL_READ
+# include "safe-read.h"
+# define safe_rw safe_read
+# define full_rw full_read
+# undef const
+# define const /* empty */
+#else
+# include "safe-write.h"
+# define safe_rw safe_write
+# define full_rw full_write
+#endif
+
+#ifdef FULL_READ
+/* Set errno to zero upon EOF.  */
+# define ZERO_BYTE_TRANSFER_ERRNO 0
+#else
+/* Some buggy drivers return 0 when one tries to write beyond
+   a device's end.  (Example: Linux 1.2.13 on /dev/fd0.)
+   Set errno to ENOSPC so they get a sensible diagnostic.  */
+# define ZERO_BYTE_TRANSFER_ERRNO ENOSPC
+#endif
+
+/* Write(read) COUNT bytes at BUF to(from) descriptor FD, retrying if
+   interrupted or if a partial write(read) occurs.  Return the number
+   of bytes transferred.
+   When writing, set errno if fewer than COUNT bytes are written.
+   When reading, if fewer than COUNT bytes are read, you must examine
+   errno to distinguish failure from EOF (errno == 0).  */
+size_t
+full_rw (int fd, const void *buf, size_t count)
+{
+  size_t total = 0;
+  const char *ptr = (const char *) buf;
+
+  while (count > 0)
+    {
+      size_t n_rw = safe_rw (fd, ptr, count);
+      if (n_rw == (size_t) -1)
+       break;
+      if (n_rw == 0)
+       {
+         errno = ZERO_BYTE_TRANSFER_ERRNO;
+         break;
+       }
+      total += n_rw;
+      ptr += n_rw;
+      count -= n_rw;
+    }
+
+  return total;
+}
diff --git a/gnulib/full-write.h b/gnulib/full-write.h
new file mode 100644 (file)
index 0000000..d20d2fe
--- /dev/null
@@ -0,0 +1,35 @@
+/* An interface to write() that writes all it is asked to write.
+
+   Copyright (C) 2002-2003 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <stddef.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Write COUNT bytes at BUF to descriptor FD, retrying if interrupted
+   or if partial writes occur.  Return the number of bytes successfully
+   written, setting errno if that is less than COUNT.  */
+extern size_t full_write (int fd, const void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
index 1b6100d90ec5a0bb6ba4563d06a47dc7748e8d0f..55462c43f9c3a2ff68b4fb667326810dcbc64957 100644 (file)
@@ -31,6 +31,9 @@
 /* Get memcpy, strdup. */
 #include <string.h>
 
+/* Get snprintf. */
+#include <stdio.h>
+
 #include <stdbool.h>
 
 #include "gettext.h"
@@ -38,7 +41,6 @@
 #define N_(String) String
 
 #include "inet_ntop.h"
-#include "snprintf.h"
 
 extern int h_errno;
 
@@ -181,13 +183,11 @@ getaddrinfo (const char *restrict nodename,
     {
       struct servent *se = NULL;
       const char *proto =
-       (hints && (hints->ai_socktype == SOCK_DGRAM)) ? "udp" : "tcp";
+       (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
 
-      if ((hints == NULL) || !(hints->ai_flags & AI_NUMERICSERV))
-        {
-         /* FIXME: Use getservbyname_r if available. */
-         se = getservbyname (servname, proto);
-        }
+      if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
+       /* FIXME: Use getservbyname_r if available. */
+       se = getservbyname (servname, proto);
 
       if (!se)
        {
diff --git a/gnulib/gettimeofday.c b/gnulib/gettimeofday.c
new file mode 100644 (file)
index 0000000..bd5576c
--- /dev/null
@@ -0,0 +1,142 @@
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
+
+   Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sys/time.h>
+
+#include <time.h>
+
+#if HAVE_SYS_TIMEB_H
+# include <sys/timeb.h>
+#endif
+
+#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME
+
+/* Work around the bug in some systems whereby gettimeofday clobbers
+   the static buffer that localtime uses for its return value.  The
+   gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
+   this problem.  The tzset replacement is necessary for at least
+   Solaris 2.5, 2.5.1, and 2.6.  */
+
+static struct tm tm_zero_buffer;
+static struct tm *localtime_buffer_addr = &tm_zero_buffer;
+
+/* This is a wrapper for localtime.  It is used only on systems for which
+   gettimeofday clobbers the static buffer used for localtime's result.
+
+   On the first call, record the address of the static buffer that
+   localtime uses for its result.  */
+
+struct tm *
+localtime (time_t const *timep)
+{
+#undef localtime
+  extern struct tm *localtime (time_t const *);
+  struct tm *tm = localtime (timep);
+
+  if (localtime_buffer_addr == &tm_zero_buffer)
+    localtime_buffer_addr = tm;
+
+  return tm;
+}
+
+/* Same as above, since gmtime and localtime use the same buffer.  */
+struct tm *
+gmtime (time_t const *timep)
+{
+#undef gmtime
+  extern struct tm *gmtime (time_t const *);
+  struct tm *tm = gmtime (timep);
+
+  if (localtime_buffer_addr == &tm_zero_buffer)
+    localtime_buffer_addr = tm;
+
+  return tm;
+}
+
+#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
+
+#if TZSET_CLOBBERS_LOCALTIME
+/* This is a wrapper for tzset, for systems on which tzset may clobber
+   the static buffer used for localtime's result.  */
+void
+tzset (void)
+{
+#undef tzset
+  extern void tzset (void);
+
+  /* Save and restore the contents of the buffer used for localtime's
+     result around the call to tzset.  */
+  struct tm save = *localtime_buffer_addr;
+  tzset ();
+  *localtime_buffer_addr = save;
+}
+#endif
+
+/* This is a wrapper for gettimeofday.  It is used only on systems
+   that lack this function, or whose implementation of this function
+   causes problems.  */
+
+int
+rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
+{
+#undef gettimeofday
+#if HAVE_GETTIMEOFDAY
+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
+  /* Save and restore the contents of the buffer used for localtime's
+     result around the call to gettimeofday.  */
+  struct tm save = *localtime_buffer_addr;
+# endif
+
+  int result = gettimeofday (tv, tz);
+
+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
+  *localtime_buffer_addr = save;
+# endif
+
+  return result;
+
+#else
+
+# if HAVE__FTIME
+
+  struct _timeb timebuf;
+  _ftime (&timebuf);
+  tv->tv_sec = timebuf.time;
+  tv->tv_usec = timebuf.millitm * 1000;
+
+# else
+
+#  if !defined OK_TO_USE_1S_CLOCK
+#   error "Only 1-second nominal clock resolution found.  Is that intended?" \
+          "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
+#  endif
+  tv->tv_sec = time (NULL);
+  tv->tv_usec = 0;
+
+# endif
+
+  return 0;
+
+#endif
+}
diff --git a/gnulib/malloc.c b/gnulib/malloc.c
new file mode 100644 (file)
index 0000000..eba131d
--- /dev/null
@@ -0,0 +1,57 @@
+/* malloc() function that is glibc compatible.
+
+   Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
+#ifdef malloc
+# define NEED_MALLOC_GNU
+# undef malloc
+#endif
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+
+/* Call the system's malloc below.  */
+#undef malloc
+
+/* Allocate an N-byte block of memory from the heap.
+   If N is zero, allocate a 1-byte block.  */
+
+void *
+rpl_malloc (size_t n)
+{
+  void *result;
+
+#ifdef NEED_MALLOC_GNU
+  if (n == 0)
+    n = 1;
+#endif
+
+  result = malloc (n);
+
+#if !HAVE_MALLOC_POSIX
+  if (result == NULL)
+    errno = ENOMEM;
+#endif
+
+  return result;
+}
diff --git a/gnulib/mkdtemp.c b/gnulib/mkdtemp.c
new file mode 100644 (file)
index 0000000..36b6c75
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (C) 1999, 2001-2003, 2006-2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Extracted from misc/mkdtemp.c.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include "tempname.h"
+
+/* Generate a unique temporary directory from TEMPLATE.
+   The last six characters of TEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the filename unique.
+   The directory is created, mode 700, and its name is returned.
+   (This function comes from OpenBSD.) */
+char *
+mkdtemp (char *template)
+{
+  if (gen_tempname (template, GT_DIR))
+    return NULL;
+  else
+    return template;
+}
diff --git a/gnulib/netinet_in_.h b/gnulib/netinet_in_.h
new file mode 100644 (file)
index 0000000..aa00e45
--- /dev/null
@@ -0,0 +1,43 @@
+/* Substitute for <netinet/in.h>.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_NETINET_IN_H
+
+#if @HAVE_NETINET_IN_H@
+
+/* On many platforms, <netinet/in.h> assumes prior inclusion of
+   <sys/types.h>.  */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
+
+#endif
+
+#ifndef _GL_NETINET_IN_H
+#define _GL_NETINET_IN_H
+
+#if !@HAVE_NETINET_IN_H@
+
+/* A platform that lacks <netinet/in.h>.  */
+
+# include <sys/socket.h>
+
+#endif
+
+#endif /* _GL_NETINET_IN_H */
+#endif /* _GL_NETINET_IN_H */
diff --git a/gnulib/physmem.c b/gnulib/physmem.c
new file mode 100644 (file)
index 0000000..844817b
--- /dev/null
@@ -0,0 +1,305 @@
+/* Calculate the size of physical memory.
+
+   Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "physmem.h"
+
+#include <unistd.h>
+
+#if HAVE_SYS_PSTAT_H
+# include <sys/pstat.h>
+#endif
+
+#if HAVE_SYS_SYSMP_H
+# include <sys/sysmp.h>
+#endif
+
+#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
+# include <sys/sysinfo.h>
+# include <machine/hal_sysinfo.h>
+#endif
+
+#if HAVE_SYS_TABLE_H
+# include <sys/table.h>
+#endif
+
+#include <sys/types.h>
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#if HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+#endif
+
+#if HAVE_SYS_SYSTEMCFG_H
+# include <sys/systemcfg.h>
+#endif
+
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/*  MEMORYSTATUSEX is missing from older windows headers, so define
+    a local replacement.  */
+typedef struct
+{
+  DWORD dwLength;
+  DWORD dwMemoryLoad;
+  DWORDLONG ullTotalPhys;
+  DWORDLONG ullAvailPhys;
+  DWORDLONG ullTotalPageFile;
+  DWORDLONG ullAvailPageFile;
+  DWORDLONG ullTotalVirtual;
+  DWORDLONG ullAvailVirtual;
+  DWORDLONG ullAvailExtendedVirtual;
+} lMEMORYSTATUSEX;
+typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
+#endif
+
+#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
+
+/* Return the total amount of physical memory.  */
+double
+physmem_total (void)
+{
+#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
+  { /* This works on linux-gnu, solaris2 and cygwin.  */
+    double pages = sysconf (_SC_PHYS_PAGES);
+    double pagesize = sysconf (_SC_PAGESIZE);
+    if (0 <= pages && 0 <= pagesize)
+      return pages * pagesize;
+  }
+#endif
+
+#if HAVE_PSTAT_GETSTATIC
+  { /* This works on hpux11.  */
+    struct pst_static pss;
+    if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
+      {
+       double pages = pss.physical_memory;
+       double pagesize = pss.page_size;
+       if (0 <= pages && 0 <= pagesize)
+         return pages * pagesize;
+      }
+  }
+#endif
+
+#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
+  { /* This works on irix6. */
+    struct rminfo realmem;
+    if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
+      {
+       double pagesize = sysconf (_SC_PAGESIZE);
+       double pages = realmem.physmem;
+       if (0 <= pages && 0 <= pagesize)
+         return pages * pagesize;
+      }
+  }
+#endif
+
+#if HAVE_GETSYSINFO && defined GSI_PHYSMEM
+  { /* This works on Tru64 UNIX V4/5.  */
+    int physmem;
+
+    if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
+                   NULL, NULL, NULL) == 1)
+      {
+       double kbytes = physmem;
+
+       if (0 <= kbytes)
+         return kbytes * 1024.0;
+      }
+  }
+#endif
+
+#if HAVE_SYSCTL && defined HW_PHYSMEM
+  { /* This works on *bsd and darwin.  */
+    unsigned int physmem;
+    size_t len = sizeof physmem;
+    static int mib[2] = { CTL_HW, HW_PHYSMEM };
+
+    if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
+       && len == sizeof (physmem))
+      return (double) physmem;
+  }
+#endif
+
+#if HAVE__SYSTEM_CONFIGURATION
+  /* This works on AIX.  */
+  return _system_configuration.physmem;
+#endif
+
+#if defined _WIN32
+  { /* this works on windows */
+    PFN_MS_EX pfnex;
+    HMODULE h = GetModuleHandle ("kernel32.dll");
+
+    if (!h)
+      return 0.0;
+
+    /*  Use GlobalMemoryStatusEx if available.  */
+    if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
+      {
+       lMEMORYSTATUSEX lms_ex;
+       lms_ex.dwLength = sizeof lms_ex;
+       if (!pfnex (&lms_ex))
+         return 0.0;
+       return (double) lms_ex.ullTotalPhys;
+      }
+
+    /*  Fall back to GlobalMemoryStatus which is always available.
+        but returns wrong results for physical memory > 4GB.  */
+    else
+      {
+       MEMORYSTATUS ms;
+       GlobalMemoryStatus (&ms);
+       return (double) ms.dwTotalPhys;
+      }
+  }
+#endif
+
+  /* Guess 64 MB.  It's probably an older host, so guess small.  */
+  return 64 * 1024 * 1024;
+}
+
+/* Return the amount of physical memory available.  */
+double
+physmem_available (void)
+{
+#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
+  { /* This works on linux-gnu, solaris2 and cygwin.  */
+    double pages = sysconf (_SC_AVPHYS_PAGES);
+    double pagesize = sysconf (_SC_PAGESIZE);
+    if (0 <= pages && 0 <= pagesize)
+      return pages * pagesize;
+  }
+#endif
+
+#if HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC
+  { /* This works on hpux11.  */
+    struct pst_static pss;
+    struct pst_dynamic psd;
+    if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
+       && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
+      {
+       double pages = psd.psd_free;
+       double pagesize = pss.page_size;
+       if (0 <= pages && 0 <= pagesize)
+         return pages * pagesize;
+      }
+  }
+#endif
+
+#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
+  { /* This works on irix6. */
+    struct rminfo realmem;
+    if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
+      {
+       double pagesize = sysconf (_SC_PAGESIZE);
+       double pages = realmem.availrmem;
+       if (0 <= pages && 0 <= pagesize)
+         return pages * pagesize;
+      }
+  }
+#endif
+
+#if HAVE_TABLE && defined TBL_VMSTATS
+  { /* This works on Tru64 UNIX V4/5.  */
+    struct tbl_vmstats vmstats;
+
+    if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
+      {
+       double pages = vmstats.free_count;
+       double pagesize = vmstats.pagesize;
+
+       if (0 <= pages && 0 <= pagesize)
+         return pages * pagesize;
+      }
+  }
+#endif
+
+#if HAVE_SYSCTL && defined HW_USERMEM
+  { /* This works on *bsd and darwin.  */
+    unsigned int usermem;
+    size_t len = sizeof usermem;
+    static int mib[2] = { CTL_HW, HW_USERMEM };
+
+    if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
+       && len == sizeof (usermem))
+      return (double) usermem;
+  }
+#endif
+
+#if defined _WIN32
+  { /* this works on windows */
+    PFN_MS_EX pfnex;
+    HMODULE h = GetModuleHandle ("kernel32.dll");
+
+    if (!h)
+      return 0.0;
+
+    /*  Use GlobalMemoryStatusEx if available.  */
+    if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
+      {
+       lMEMORYSTATUSEX lms_ex;
+       lms_ex.dwLength = sizeof lms_ex;
+       if (!pfnex (&lms_ex))
+         return 0.0;
+       return (double) lms_ex.ullAvailPhys;
+      }
+
+    /*  Fall back to GlobalMemoryStatus which is always available.
+        but returns wrong results for physical memory > 4GB  */
+    else
+      {
+       MEMORYSTATUS ms;
+       GlobalMemoryStatus (&ms);
+       return (double) ms.dwAvailPhys;
+      }
+  }
+#endif
+
+  /* Guess 25% of physical memory.  */
+  return physmem_total () / 4;
+}
+
+
+#if DEBUG
+
+# include <stdio.h>
+# include <stdlib.h>
+
+int
+main (void)
+{
+  printf ("%12.f %12.f\n", physmem_total (), physmem_available ());
+  exit (0);
+}
+
+#endif /* DEBUG */
+
+/*
+Local Variables:
+compile-command: "gcc -DDEBUG -g -O -Wall -W physmem.c"
+End:
+*/
diff --git a/gnulib/physmem.h b/gnulib/physmem.h
new file mode 100644 (file)
index 0000000..931aede
--- /dev/null
@@ -0,0 +1,27 @@
+/* Calculate the size of physical memory.
+
+   Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef PHYSMEM_H_
+# define PHYSMEM_H_ 1
+
+double physmem_total (void);
+double physmem_available (void);
+
+#endif /* PHYSMEM_H_ */
index 2259d53e5ed1b6cd1c857a8fb58b563cdbd7f307..497891466239c9078089c1d9c813d14e8ae86a01 100644 (file)
    with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include <config.h>
+/* This file can be parametrized with the following macros:
+     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
+     PRINTF_FETCHARGS   Name of the function to be defined.
+     STATIC             Set to 'static' to declare the function static.  */
+
+#ifndef PRINTF_FETCHARGS
+# include <config.h>
+#endif
 
 /* Specification.  */
-#include "printf-args.h"
+#ifndef PRINTF_FETCHARGS
+# include "printf-args.h"
+#endif
 
 #ifdef STATIC
 STATIC
 #endif
 int
-printf_fetchargs (va_list args, arguments *a)
+PRINTF_FETCHARGS (va_list args, arguments *a)
 {
   size_t i;
   argument *ap;
@@ -67,11 +76,9 @@ printf_fetchargs (va_list args, arguments *a)
       case TYPE_DOUBLE:
        ap->a.a_double = va_arg (args, double);
        break;
-#if HAVE_LONG_DOUBLE
       case TYPE_LONGDOUBLE:
        ap->a.a_longdouble = va_arg (args, long double);
        break;
-#endif
       case TYPE_CHAR:
        ap->a.a_char = va_arg (args, int);
        break;
@@ -132,6 +139,45 @@ printf_fetchargs (va_list args, arguments *a)
       case TYPE_COUNT_LONGLONGINT_POINTER:
        ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
        break;
+#endif
+#if ENABLE_UNISTDIO
+      /* The unistdio extensions.  */
+      case TYPE_U8_STRING:
+       ap->a.a_u8_string = va_arg (args, const uint8_t *);
+       /* A null pointer is an invalid argument for "%U", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_u8_string == NULL)
+         {
+           static const uint8_t u8_null_string[] =
+             { '(', 'N', 'U', 'L', 'L', ')', 0 };
+           ap->a.a_u8_string = u8_null_string;
+         }
+       break;
+      case TYPE_U16_STRING:
+       ap->a.a_u16_string = va_arg (args, const uint16_t *);
+       /* A null pointer is an invalid argument for "%lU", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_u16_string == NULL)
+         {
+           static const uint16_t u16_null_string[] =
+             { '(', 'N', 'U', 'L', 'L', ')', 0 };
+           ap->a.a_u16_string = u16_null_string;
+         }
+       break;
+      case TYPE_U32_STRING:
+       ap->a.a_u32_string = va_arg (args, const uint32_t *);
+       /* A null pointer is an invalid argument for "%llU", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_u32_string == NULL)
+         {
+           static const uint32_t u32_null_string[] =
+             { '(', 'N', 'U', 'L', 'L', ')', 0 };
+           ap->a.a_u32_string = u32_null_string;
+         }
+       break;
 #endif
       default:
        /* Unknown type.  */
index 74a18d9bf342426fac0d39e7d45ce94d1516d6a6..6f75e2aea40ab226dafd173c0c2cd0278e93e5f8 100644 (file)
 #ifndef _PRINTF_ARGS_H
 #define _PRINTF_ARGS_H
 
+/* This file can be parametrized with the following macros:
+     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
+     PRINTF_FETCHARGS   Name of the function to be declared.
+     STATIC             Set to 'static' to declare the function static.  */
+
+/* Default parameters.  */
+#ifndef PRINTF_FETCHARGS
+# define PRINTF_FETCHARGS printf_fetchargs
+#endif
+
 /* Get size_t.  */
 #include <stddef.h>
 
@@ -52,9 +62,7 @@ typedef enum
   TYPE_ULONGLONGINT,
 #endif
   TYPE_DOUBLE,
-#if HAVE_LONG_DOUBLE
   TYPE_LONGDOUBLE,
-#endif
   TYPE_CHAR,
 #if HAVE_WINT_T
   TYPE_WIDE_CHAR,
@@ -71,6 +79,12 @@ typedef enum
 #if HAVE_LONG_LONG_INT
 , TYPE_COUNT_LONGLONGINT_POINTER
 #endif
+#if ENABLE_UNISTDIO
+  /* The unistdio extensions.  */
+, TYPE_U8_STRING
+, TYPE_U16_STRING
+, TYPE_U32_STRING
+#endif
 } arg_type;
 
 /* Polymorphic argument */
@@ -93,9 +107,7 @@ typedef struct
 #endif
     float                      a_float;
     double                     a_double;
-#if HAVE_LONG_DOUBLE
     long double                        a_longdouble;
-#endif
     int                                a_char;
 #if HAVE_WINT_T
     wint_t                     a_wide_char;
@@ -111,6 +123,12 @@ typedef struct
     long int *                 a_count_longint_pointer;
 #if HAVE_LONG_LONG_INT
     long long int *            a_count_longlongint_pointer;
+#endif
+#if ENABLE_UNISTDIO
+    /* The unistdio extensions.  */
+    const uint8_t *            a_u8_string;
+    const uint16_t *           a_u16_string;
+    const uint32_t *           a_u32_string;
 #endif
   }
   a;
@@ -131,6 +149,6 @@ STATIC
 #else
 extern
 #endif
-int printf_fetchargs (va_list args, arguments *a);
+int PRINTF_FETCHARGS (va_list args, arguments *a);
 
 #endif /* _PRINTF_ARGS_H */
index f5cdb6e5b51173dc1448d5639e908ef1888c14c5..2e679809779bf325d6b193e7c403e0d30773a672 100644 (file)
    with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#include <config.h>
+/* This file can be parametrized with the following macros:
+     CHAR_T             The element type of the format string.
+     CHAR_T_ONLY_ASCII  Set to 1 to enable verification that all characters
+                        in the format string are ASCII.
+     DIRECTIVE          Structure denoting a format directive.
+                        Depends on CHAR_T.
+     DIRECTIVES         Structure denoting the set of format directives of a
+                        format string.  Depends on CHAR_T.
+     PRINTF_PARSE       Function that parses a format string.
+                        Depends on CHAR_T.
+     STATIC             Set to 'static' to declare the function static.
+     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.  */
+
+#ifndef PRINTF_PARSE
+# include <config.h>
+#endif
 
 /* Specification.  */
-#if WIDE_CHAR_VERSION
-# include "wprintf-parse.h"
-#else
+#ifndef PRINTF_PARSE
 # include "printf-parse.h"
 #endif
 
+/* Default parameters.  */
+#ifndef PRINTF_PARSE
+# define PRINTF_PARSE printf_parse
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+#endif
+
 /* Get size_t, NULL.  */
 #include <stddef.h>
 
 /* Get intmax_t.  */
-#if HAVE_STDINT_H_WITH_UINTMAX
+#ifdef IN_LIBINTL
+# if HAVE_STDINT_H_WITH_UINTMAX
+#  include <stdint.h>
+# endif
+# if HAVE_INTTYPES_H_WITH_UINTMAX
+#  include <inttypes.h>
+# endif
+#else
 # include <stdint.h>
 #endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-# include <inttypes.h>
-#endif
 
 /* malloc(), realloc(), free().  */
 #include <stdlib.h>
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#if WIDE_CHAR_VERSION
-# define PRINTF_PARSE wprintf_parse
-# define CHAR_T wchar_t
-# define DIRECTIVE wchar_t_directive
-# define DIRECTIVES wchar_t_directives
-#else
-# define PRINTF_PARSE printf_parse
-# define CHAR_T char
-# define DIRECTIVE char_directive
-# define DIRECTIVES char_directives
+#if CHAR_T_ONLY_ASCII
+/* c_isascii().  */
+# include "c-ctype.h"
 #endif
 
 #ifdef STATIC
@@ -115,7 +133,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
       if (c == '%')
        {
          size_t arg_index = ARG_NONE;
-         DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
+         DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
 
          /* Initialize the next directive.  */
          dp->dir_start = cp - 1;
@@ -326,7 +344,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                      flags += 8;
                      cp++;
                    }
-#if HAVE_INTMAX_T
                  else if (*cp == 'j')
                    {
                      if (sizeof (intmax_t) > sizeof (long))
@@ -341,7 +358,6 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                        }
                      cp++;
                    }
-#endif
                  else if (*cp == 'z' || *cp == 'Z')
                    {
                      /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
@@ -419,12 +435,10 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                  break;
                case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
                case 'a': case 'A':
-#if HAVE_LONG_DOUBLE
                  if (flags >= 16 || (flags & 4))
                    type = TYPE_LONGDOUBLE;
                  else
-#endif
-                 type = TYPE_DOUBLE;
+                   type = TYPE_DOUBLE;
                  break;
                case 'c':
                  if (flags >= 8)
@@ -479,6 +493,17 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                  else
                    type = TYPE_COUNT_INT_POINTER;
                  break;
+#if ENABLE_UNISTDIO
+               /* The unistdio extensions.  */
+               case 'U':
+                 if (flags >= 16)
+                   type = TYPE_U32_STRING;
+                 else if (flags >= 8)
+                   type = TYPE_U16_STRING;
+                 else
+                   type = TYPE_U8_STRING;
+                 break;
+#endif
                case '%':
                  type = TYPE_NONE;
                  break;
@@ -522,6 +547,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
              d->dir = memory;
            }
        }
+#if CHAR_T_ONLY_ASCII
+      else if (!c_isascii (c))
+       {
+         /* Non-ASCII character.  Not supported.  */
+         goto error;
+       }
+#endif
     }
   d->dir[d->count].dir_start = cp;
 
@@ -537,7 +569,8 @@ error:
   return -1;
 }
 
+#undef PRINTF_PARSE
 #undef DIRECTIVES
 #undef DIRECTIVE
+#undef CHAR_T_ONLY_ASCII
 #undef CHAR_T
-#undef PRINTF_PARSE
index 82a0d37cd7e1f72dd278066a60d3fc63a57efdc5..de7fc49b6fbc17d79196cdd59b6eac099ba63624 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #ifndef _PRINTF_PARSE_H
 #define _PRINTF_PARSE_H
 
+/* This file can be parametrized with the following macros:
+     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
+     STATIC             Set to 'static' to declare the function static.  */
+
 #include "printf-args.h"
 
 
@@ -32,6 +36,9 @@
 /* arg_index value indicating that no argument is consumed.  */
 #define ARG_NONE       (~(size_t)0)
 
+/* xxx_directive: A parsed directive.
+   xxx_directives: A parsed format string.  */
+
 /* A parsed directive.  */
 typedef struct
 {
@@ -44,7 +51,7 @@ typedef struct
   const char* precision_start;
   const char* precision_end;
   size_t precision_arg_index;
-  char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
+  char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
   size_t arg_index;
 }
 char_directive;
@@ -59,16 +66,114 @@ typedef struct
 }
 char_directives;
 
+#if ENABLE_UNISTDIO
+
+/* A parsed directive.  */
+typedef struct
+{
+  const uint8_t* dir_start;
+  const uint8_t* dir_end;
+  int flags;
+  const uint8_t* width_start;
+  const uint8_t* width_end;
+  size_t width_arg_index;
+  const uint8_t* precision_start;
+  const uint8_t* precision_end;
+  size_t precision_arg_index;
+  uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+  size_t arg_index;
+}
+u8_directive;
+
+/* A parsed format string.  */
+typedef struct
+{
+  size_t count;
+  u8_directive *dir;
+  size_t max_width_length;
+  size_t max_precision_length;
+}
+u8_directives;
+
+/* A parsed directive.  */
+typedef struct
+{
+  const uint16_t* dir_start;
+  const uint16_t* dir_end;
+  int flags;
+  const uint16_t* width_start;
+  const uint16_t* width_end;
+  size_t width_arg_index;
+  const uint16_t* precision_start;
+  const uint16_t* precision_end;
+  size_t precision_arg_index;
+  uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+  size_t arg_index;
+}
+u16_directive;
+
+/* A parsed format string.  */
+typedef struct
+{
+  size_t count;
+  u16_directive *dir;
+  size_t max_width_length;
+  size_t max_precision_length;
+}
+u16_directives;
+
+/* A parsed directive.  */
+typedef struct
+{
+  const uint32_t* dir_start;
+  const uint32_t* dir_end;
+  int flags;
+  const uint32_t* width_start;
+  const uint32_t* width_end;
+  size_t width_arg_index;
+  const uint32_t* precision_start;
+  const uint32_t* precision_end;
+  size_t precision_arg_index;
+  uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+  size_t arg_index;
+}
+u32_directive;
+
+/* A parsed format string.  */
+typedef struct
+{
+  size_t count;
+  u32_directive *dir;
+  size_t max_width_length;
+  size_t max_precision_length;
+}
+u32_directives;
+
+#endif
+
 
 /* Parses the format string.  Fills in the number N of directives, and fills
    in directives[0], ..., directives[N-1], and sets directives[N].dir_start
    to the end of the format string.  Also fills in the arg_type fields of the
    arguments and the needed count of arguments.  */
-#ifdef STATIC
-STATIC
+#if ENABLE_UNISTDIO
+extern int
+       ulc_printf_parse (const char *format, char_directives *d, arguments *a);
+extern int
+       u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
+extern int
+       u16_printf_parse (const uint16_t *format, u16_directives *d,
+                        arguments *a);
+extern int
+       u32_printf_parse (const uint32_t *format, u32_directives *d,
+                        arguments *a);
 #else
+# ifdef STATIC
+STATIC
+# else
 extern
-#endif
+# endif
 int printf_parse (const char *format, char_directives *d, arguments *a);
+#endif
 
 #endif /* _PRINTF_PARSE_H */
index 7a384ccf2be8643a9e8f5e873bd422076a7fb403..0971d4769d4e78bbf0135f1ec07226a5273b2de7 100644 (file)
@@ -1,15 +1,15 @@
---- gnulib/getaddrinfo.c       2007-03-06 13:17:25.733225500 -0600
-+++ gnulib/getaddrinfo.c       2007-03-06 13:17:32.345638750 -0600
-@@ -40,6 +40,8 @@
+--- gnulib/getaddrinfo.c.orig  2007-10-25 16:46:34.728843739 -0500
++++ gnulib/getaddrinfo.c       2007-10-25 16:47:17.395395249 -0500
+@@ -42,6 +42,8 @@
  #include "inet_ntop.h"
- #include "snprintf.h"
  
 +extern int h_errno;
 +
  /* BeOS has AF_INET, but not PF_INET.  */
  #ifndef PF_INET
  # define PF_INET AF_INET
-@@ -147,25 +149,29 @@
+@@ -149,25 +151,29 @@
      return getaddrinfo_ptr (nodename, servname, hints, res);
  #endif
  
  #else
        nodename = "0.0.0.0";
  #endif
-@@ -175,11 +181,13 @@
-     {
-       struct servent *se = NULL;
-       const char *proto =
--      (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
-+      (hints && (hints->ai_socktype == SOCK_DGRAM)) ? "udp" : "tcp";
--      if (!(hints->ai_flags & AI_NUMERICSERV))
--      /* FIXME: Use getservbyname_r if available. */
--      se = getservbyname (servname, proto);
-+      if ((hints == NULL) || !(hints->ai_flags & AI_NUMERICSERV))
-+        {
-+        /* FIXME: Use getservbyname_r if available. */
-+        se = getservbyname (servname, proto);
-+        }
-       if (!se)
-       {
-@@ -196,7 +204,7 @@
+@@ -198,7 +204,7 @@
      }
  
    /* FIXME: Use gethostbyname_r if available. */
@@ -73,7 +55,7 @@
    if (!he || he->h_addr_list[0] == NULL)
      return EAI_NONAME;
  
-@@ -277,7 +285,7 @@
+@@ -279,7 +285,7 @@
        return EAI_NODATA;
      }
  
@@ -82,7 +64,7 @@
      {
        const char *cn;
        if (he->h_name)
-@@ -341,9 +349,7 @@
+@@ -343,9 +349,7 @@
  #endif
  
    /* FIXME: Support other flags. */
@@ -93,7 +75,7 @@
      return EAI_BADFLAGS;
  
    if (sa == NULL || salen < sizeof (sa->sa_family))
-@@ -367,34 +373,89 @@
+@@ -369,34 +373,89 @@
        return EAI_FAMILY;
      }
  
index 411d948a0dd5c7d537805e7e84f0b9a542e245f6..a12e7d2ec2ec58ebbf11c39bfb68e80bae1afc5e 100644 (file)
@@ -7,7 +7,7 @@ Index: gnulib/Makefile.am
  
  AM_CPPFLAGS =
 +if GCC_COMPILER
-+  AM_CFLAGS += -Wno-error
++  AM_CFLAGS = -Wno-error -Wno-sign-compare
 +endif
  
  noinst_LTLIBRARIES += libgnu.la
old mode 100644 (file)
new mode 100755 (executable)
index 0265ca2..a32ab34
@@ -1,7 +1,7 @@
 #! /bin/bash
 
 # Gnulib files in zmanda repo are from gnulib CVS updated with:
-#   cvs update -D '2007-01-31 13:12:51 -0600'
+#   cvs update -D '2007-10-25 17:00:00 -0600'
 
 # get to the project root
 cd `dirname $0`/../..
@@ -36,24 +36,19 @@ shopt -u nullglob
 ## Add your modules here, then see below if you need to patch them. ##
 ######################################################################
 
-GNULIB_MODULES="getaddrinfo lock visibility"
+GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage mkdtemp"
 
 ######################################################################
 ## End modules                                                      ##
 ######################################################################
 
-# check out a brand new gnulib directory and gnulib.m4i
+# create a brand new gnulib directory
 
 "${GNULIB_TOOL}" --import \
         --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
         --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
         ${GNULIB_MODULES} || exit 1
 
-for filename in config/gnulib/*.m4
- do
-    echo "m4_include([$filename])"
-done > config/gnulib.m4i || exit 1
-
 ########################## DEVELOPERS! ###############################
 ## Add your patch commands here, or use sed invoacations, etc.      ##
 ## Please comment heavily!                                          ##
diff --git a/gnulib/safe-read.c b/gnulib/safe-read.c
new file mode 100644 (file)
index 0000000..b7bf1d5
--- /dev/null
@@ -0,0 +1,78 @@
+/* An interface to read and write that retries after interrupts.
+
+   Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005, 2006 Free
+   Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#ifdef SAFE_WRITE
+# include "safe-write.h"
+#else
+# include "safe-read.h"
+#endif
+
+/* Get ssize_t.  */
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <errno.h>
+
+#ifdef EINTR
+# define IS_EINTR(x) ((x) == EINTR)
+#else
+# define IS_EINTR(x) 0
+#endif
+
+#include <limits.h>
+
+#ifdef SAFE_WRITE
+# define safe_rw safe_write
+# define rw write
+#else
+# define safe_rw safe_read
+# define rw read
+# undef const
+# define const /* empty */
+#endif
+
+/* Read(write) up to COUNT bytes at BUF from(to) descriptor FD, retrying if
+   interrupted.  Return the actual number of bytes read(written), zero for EOF,
+   or SAFE_READ_ERROR(SAFE_WRITE_ERROR) upon error.  */
+size_t
+safe_rw (int fd, void const *buf, size_t count)
+{
+  /* Work around a bug in Tru64 5.1.  Attempting to read more than
+     INT_MAX bytes fails with errno == EINVAL.  See
+     <http://lists.gnu.org/archive/html/bug-gnu-utils/2002-04/msg00010.html>.
+     When decreasing COUNT, keep it block-aligned.  */
+  enum { BUGGY_READ_MAXIMUM = INT_MAX & ~8191 };
+
+  for (;;)
+    {
+      ssize_t result = rw (fd, buf, count);
+
+      if (0 <= result)
+       return result;
+      else if (IS_EINTR (errno))
+       continue;
+      else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count)
+       count = BUGGY_READ_MAXIMUM;
+      else
+       return result;
+    }
+}
diff --git a/gnulib/safe-read.h b/gnulib/safe-read.h
new file mode 100644 (file)
index 0000000..3451955
--- /dev/null
@@ -0,0 +1,35 @@
+/* An interface to read() that retries after interrupts.
+   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define SAFE_READ_ERROR ((size_t) -1)
+
+/* Read up to COUNT bytes at BUF from descriptor FD, retrying if interrupted.
+   Return the actual number of bytes read, zero for EOF, or SAFE_READ_ERROR
+   upon error.  */
+extern size_t safe_read (int fd, void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gnulib/safe-write.c b/gnulib/safe-write.c
new file mode 100644 (file)
index 0000000..4c375a6
--- /dev/null
@@ -0,0 +1,19 @@
+/* An interface to write that retries after interrupts.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#define SAFE_WRITE
+#include "safe-read.c"
diff --git a/gnulib/safe-write.h b/gnulib/safe-write.h
new file mode 100644 (file)
index 0000000..c194636
--- /dev/null
@@ -0,0 +1,25 @@
+/* An interface to write() that retries after interrupts.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <stddef.h>
+
+#define SAFE_WRITE_ERROR ((size_t) -1)
+
+/* Write up to COUNT bytes at BUF to descriptor FD, retrying if interrupted.
+   Return the actual number of bytes written, zero for EOF, or SAFE_WRITE_ERROR
+   upon error.  */
+extern size_t safe_write (int fd, const void *buf, size_t count);
index db1ca9af1e7c2ab4e9f0a55073f5345dfe76084a..7314c83a3e11e81a35881cca16e224fc3c4719fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,8 @@
 
 #include <config.h>
 
-#include "snprintf.h"
+/* Specification.  */
+#include <stdio.h>
 
 #include <errno.h>
 #include <limits.h>
@@ -37,7 +38,7 @@
    additional length SIZE limit how much is written into STR.  Returns
    string length of formatted string (which may be larger than SIZE).
    STR may be NULL, in which case nothing will be written.  On error,
-   return a negative value. */
+   return a negative value.  */
 int
 snprintf (char *str, size_t size, const char *format, ...)
 {
diff --git a/gnulib/snprintf.h b/gnulib/snprintf.h
deleted file mode 100644 (file)
index 5032b9e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 2004 Free Software Foundation, Inc.
-   Written by Simon Josefsson.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 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, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-#ifndef SNPRINTF_H
-#define SNPRINTF_H
-
-/* Get snprintf declaration, if available.  */
-#include <stdio.h>
-
-#if defined HAVE_DECL_SNPRINTF && !HAVE_DECL_SNPRINTF
-int snprintf (char *str, size_t size, const char *format, ...);
-#endif
-
-#endif /* SNPRINTF_H */
diff --git a/gnulib/socket_.h b/gnulib/socket_.h
deleted file mode 100644 (file)
index 8b28b5e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Provide a sys/socket header file for systems lacking it (read: MinGW).
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-   Written by Simon Josefsson.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 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, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-#ifndef _SYS_SOCKET_H
-#define _SYS_SOCKET_H
-
-/* This file is supposed to be used on platforms that lack
-   sys/socket.h.  It is intended to provide definitions and prototypes
-   needed by an application.
-
-   Currently only MinGW is supported.  See the gnulib manual regarding
-   Windows sockets.  MinGW has the header files winsock2.h and
-   ws2tcpip.h that declare the sys/socket.h definitions we need.  Note
-   that you can influence which definitions you get by setting the
-   WINVER symbol before including these two files.  For example,
-   getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
-   symbol is set indiriectly through WINVER).  You can set this by
-   adding AC_DEFINE(WINVER, 0x0501) to configure.ac.  Note that your
-   code may not run on older Windows releases then.  My Windows 2000
-   box was not able to run the code, for example.  The situation is
-   slightly confusing because:
-   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
-   suggests that getaddrinfo should be available on all Windows
-   releases. */
-
-
-#if HAVE_WINSOCK2_H
-# include <winsock2.h>
-#endif
-#if HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-#endif
-
-/* For shutdown(). */
-#if !defined SHUT_RD && defined SD_RECEIVE
-# define SHUT_RD SD_RECEIVE
-#endif
-#if !defined SHUT_WR && defined SD_SEND
-# define SHUT_WR SD_SEND
-#endif
-#if !defined SHUT_RDWR && defined SD_BOTH
-# define SHUT_RDWR SD_BOTH
-#endif
-
-#if defined _WIN32 || defined __WIN32__
-# define ENOTSOCK                WSAENOTSOCK
-# define EADDRINUSE              WSAEADDRINUSE
-# define ENETRESET               WSAENETRESET
-# define ECONNABORTED            WSAECONNABORTED
-# define ECONNRESET              WSAECONNRESET
-# define ENOTCONN                WSAENOTCONN
-# define ESHUTDOWN               WSAESHUTDOWN
-#endif
-
-#endif /* _SYS_SOCKET_H */
index efa80ba921ed759564a462bdfca2bf91871b0c48..150a0102e1de452e33a65da2f3771d202e7f010b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +15,8 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _STDBOOL_H
-#define _STDBOOL_H
+#ifndef _GL_STDBOOL_H
+#define _GL_STDBOOL_H
 
 /* ISO C 99 <stdbool.h> for platforms that lack it.  */
 
@@ -41,6 +41,9 @@
 
        - You cannot assume that _Bool is a typedef; it might be a macro.
 
+       - Bit-fields of type 'bool' are not supported.  Portable code
+         should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
+
        - In C99, casts and automatic conversions to '_Bool' or 'bool' are
          performed in such a way that every nonzero value gets converted
          to 'true', and zero gets converted to 'false'.  This doesn't work
@@ -112,4 +115,4 @@ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
 #define true 1
 #define __bool_true_false_are_defined 1
 
-#endif /* _STDBOOL_H */
+#endif /* _GL_STDBOOL_H */
diff --git a/gnulib/stdint_.h b/gnulib/stdint_.h
new file mode 100644 (file)
index 0000000..121118c
--- /dev/null
@@ -0,0 +1,508 @@
+/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc.
+   Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
+   This file is part of gnulib.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/*
+ * ISO C 99 <stdint.h> for platforms that lack it.
+ * <http://www.opengroup.org/susv3xbd/stdint.h.html>
+ */
+
+#ifndef _GL_STDINT_H
+
+/* Get those types that are already defined in other system include
+   files, so that we can "#define int8_t signed char" below without
+   worrying about a later system include file containing a "typedef
+   signed char int8_t;" that will get messed up by our macro.  Our
+   macros should all be consistent with the system versions, except
+   for the "fast" types and macros, which we recommend against using
+   in public interfaces due to compiler differences.  */
+
+#if @HAVE_STDINT_H@
+# if defined __sgi && ! defined __c99
+   /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
+      with "This header file is to be used only for c99 mode compilations"
+      diagnostics.  */
+#  define __STDINT_H__
+# endif
+  /* Other systems may have an incomplete or buggy <stdint.h>.
+     Include it before <inttypes.h>, since any "#include <stdint.h>"
+     in <inttypes.h> would reinclude us, skipping our contents because
+     _GL_STDINT_H is defined.
+     The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#endif
+
+#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+#define _GL_STDINT_H
+
+/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
+   IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
+   AIX 5.2 <sys/types.h> isn't needed and causes troubles.
+   MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+   relies on the system <stdint.h> definitions, so include
+   <sys/types.h> after @NEXT_STDINT_H@.  */
+#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+# include <sys/types.h>
+#endif
+
+/* Get LONG_MIN, LONG_MAX, ULONG_MAX.  */
+#include <limits.h>
+
+#if @HAVE_INTTYPES_H@
+  /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
+     int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
+     <inttypes.h> also defines intptr_t and uintptr_t.  */
+# define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# include <inttypes.h>
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#elif @HAVE_SYS_INTTYPES_H@
+  /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
+     the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
+# include <sys/inttypes.h>
+#endif
+
+#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+  /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
+     int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
+     included by <sys/types.h>.  */
+# include <sys/bitypes.h>
+#endif
+
+#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
+/* Get WCHAR_MIN, WCHAR_MAX.  */
+# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+#  include <wchar.h>
+# endif
+
+#endif
+
+/* Minimum and maximum values for a integer type under the usual assumption.
+   Return an unspecified value if BITS == 0, adding a check to pacify
+   picky compilers.  */
+
+#define _STDINT_MIN(signed, bits, zero) \
+  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
+
+#define _STDINT_MAX(signed, bits, zero) \
+  ((signed) \
+   ? ~ _STDINT_MIN (signed, bits, zero) \
+   : ((((zero) + 1) << ((bits) ? (bits) - 1 : 0)) - 1) * 2 + 1)
+
+/* 7.18.1.1. Exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits.  */
+
+#undef int8_t
+#undef uint8_t
+#define int8_t signed char
+#define uint8_t unsigned char
+
+#undef int16_t
+#undef uint16_t
+#define int16_t short int
+#define uint16_t unsigned short int
+
+#undef int32_t
+#undef uint32_t
+#define int32_t int
+#define uint32_t unsigned int
+
+/* Do not undefine int64_t if gnulib is not being used with 64-bit
+   types, since otherwise it breaks platforms like Tandem/NSK.  */
+#if LONG_MAX >> 31 >> 31 == 1
+# undef int64_t
+# define int64_t long int
+# define GL_INT64_T
+#elif defined _MSC_VER
+# undef int64_t
+# define int64_t __int64
+# define GL_INT64_T
+#elif @HAVE_LONG_LONG_INT@
+# undef int64_t
+# define int64_t long long int
+# define GL_INT64_T
+#endif
+
+#if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# undef uint64_t
+# define uint64_t unsigned long int
+# define GL_UINT64_T
+#elif defined _MSC_VER
+# undef uint64_t
+# define uint64_t unsigned __int64
+# define GL_UINT64_T
+#elif @HAVE_UNSIGNED_LONG_LONG_INT@
+# undef uint64_t
+# define uint64_t unsigned long long int
+# define GL_UINT64_T
+#endif
+
+/* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
+#define _UINT8_T
+#define _UINT32_T
+#define _UINT64_T
+
+
+/* 7.18.1.2. Minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+   are the same as the corresponding N_t types.  */
+
+#undef int_least8_t
+#undef uint_least8_t
+#undef int_least16_t
+#undef uint_least16_t
+#undef int_least32_t
+#undef uint_least32_t
+#undef int_least64_t
+#undef uint_least64_t
+#define int_least8_t int8_t
+#define uint_least8_t uint8_t
+#define int_least16_t int16_t
+#define uint_least16_t uint16_t
+#define int_least32_t int32_t
+#define uint_least32_t uint32_t
+#ifdef GL_INT64_T
+# define int_least64_t int64_t
+#endif
+#ifdef GL_UINT64_T
+# define uint_least64_t uint64_t
+#endif
+
+/* 7.18.1.3. Fastest minimum-width integer types */
+
+/* Note: Other <stdint.h> substitutes may define these types differently.
+   It is not recommended to use these types in public header files. */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+   are taken from the same list of types.  Assume that 'long int'
+   is fast enough for all narrower integers.  */
+
+#undef int_fast8_t
+#undef uint_fast8_t
+#undef int_fast16_t
+#undef uint_fast16_t
+#undef int_fast32_t
+#undef uint_fast32_t
+#undef int_fast64_t
+#undef uint_fast64_t
+#define int_fast8_t long int
+#define uint_fast8_t unsigned int_fast8_t
+#define int_fast16_t long int
+#define uint_fast16_t unsigned int_fast16_t
+#define int_fast32_t long int
+#define uint_fast32_t unsigned int_fast32_t
+#ifdef GL_INT64_T
+# define int_fast64_t int64_t
+#endif
+#ifdef GL_UINT64_T
+# define uint_fast64_t uint64_t
+#endif
+
+/* 7.18.1.4. Integer types capable of holding object pointers */
+
+#undef intptr_t
+#undef uintptr_t
+#define intptr_t long int
+#define uintptr_t unsigned long int
+
+/* 7.18.1.5. Greatest-width integer types */
+
+/* Note: These types are compiler dependent. It may be unwise to use them in
+   public header files. */
+
+#undef intmax_t
+#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# define intmax_t long long int
+#elif defined GL_INT64_T
+# define intmax_t int64_t
+#else
+# define intmax_t long int
+#endif
+
+#undef uintmax_t
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define uintmax_t unsigned long long int
+#elif defined GL_UINT64_T
+# define uintmax_t uint64_t
+#else
+# define uintmax_t unsigned long int
+#endif
+
+/* 7.18.2. Limits of specified-width integer types */
+
+#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
+
+/* 7.18.2.1. Limits of exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits.  */
+
+#undef INT8_MIN
+#undef INT8_MAX
+#undef UINT8_MAX
+#define INT8_MIN  (~ INT8_MAX)
+#define INT8_MAX  127
+#define UINT8_MAX  255
+
+#undef INT16_MIN
+#undef INT16_MAX
+#undef UINT16_MAX
+#define INT16_MIN  (~ INT16_MAX)
+#define INT16_MAX  32767
+#define UINT16_MAX  65535
+
+#undef INT32_MIN
+#undef INT32_MAX
+#undef UINT32_MAX
+#define INT32_MIN  (~ INT32_MAX)
+#define INT32_MAX  2147483647
+#define UINT32_MAX  4294967295U
+
+#undef INT64_MIN
+#undef INT64_MAX
+#ifdef GL_INT64_T
+/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
+   evaluates the latter incorrectly in preprocessor expressions.  */
+# define INT64_MIN  (- INTMAX_C (1) << 63)
+# define INT64_MAX  INTMAX_C (9223372036854775807)
+#endif
+
+#undef UINT64_MAX
+#ifdef GL_UINT64_T
+# define UINT64_MAX  UINTMAX_C (18446744073709551615)
+#endif
+
+/* 7.18.2.2. Limits of minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+   are the same as the corresponding N_t types.  */
+
+#undef INT_LEAST8_MIN
+#undef INT_LEAST8_MAX
+#undef UINT_LEAST8_MAX
+#define INT_LEAST8_MIN  INT8_MIN
+#define INT_LEAST8_MAX  INT8_MAX
+#define UINT_LEAST8_MAX  UINT8_MAX
+
+#undef INT_LEAST16_MIN
+#undef INT_LEAST16_MAX
+#undef UINT_LEAST16_MAX
+#define INT_LEAST16_MIN  INT16_MIN
+#define INT_LEAST16_MAX  INT16_MAX
+#define UINT_LEAST16_MAX  UINT16_MAX
+
+#undef INT_LEAST32_MIN
+#undef INT_LEAST32_MAX
+#undef UINT_LEAST32_MAX
+#define INT_LEAST32_MIN  INT32_MIN
+#define INT_LEAST32_MAX  INT32_MAX
+#define UINT_LEAST32_MAX  UINT32_MAX
+
+#undef INT_LEAST64_MIN
+#undef INT_LEAST64_MAX
+#ifdef GL_INT64_T
+# define INT_LEAST64_MIN  INT64_MIN
+# define INT_LEAST64_MAX  INT64_MAX
+#endif
+
+#undef UINT_LEAST64_MAX
+#ifdef GL_UINT64_T
+# define UINT_LEAST64_MAX  UINT64_MAX
+#endif
+
+/* 7.18.2.3. Limits of fastest minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+   are taken from the same list of types.  */
+
+#undef INT_FAST8_MIN
+#undef INT_FAST8_MAX
+#undef UINT_FAST8_MAX
+#define INT_FAST8_MIN  LONG_MIN
+#define INT_FAST8_MAX  LONG_MAX
+#define UINT_FAST8_MAX  ULONG_MAX
+
+#undef INT_FAST16_MIN
+#undef INT_FAST16_MAX
+#undef UINT_FAST16_MAX
+#define INT_FAST16_MIN  LONG_MIN
+#define INT_FAST16_MAX  LONG_MAX
+#define UINT_FAST16_MAX  ULONG_MAX
+
+#undef INT_FAST32_MIN
+#undef INT_FAST32_MAX
+#undef UINT_FAST32_MAX
+#define INT_FAST32_MIN  LONG_MIN
+#define INT_FAST32_MAX  LONG_MAX
+#define UINT_FAST32_MAX  ULONG_MAX
+
+#undef INT_FAST64_MIN
+#undef INT_FAST64_MAX
+#ifdef GL_INT64_T
+# define INT_FAST64_MIN  INT64_MIN
+# define INT_FAST64_MAX  INT64_MAX
+#endif
+
+#undef UINT_FAST64_MAX
+#ifdef GL_UINT64_T
+# define UINT_FAST64_MAX  UINT64_MAX
+#endif
+
+/* 7.18.2.4. Limits of integer types capable of holding object pointers */
+
+#undef INTPTR_MIN
+#undef INTPTR_MAX
+#undef UINTPTR_MAX
+#define INTPTR_MIN  LONG_MIN
+#define INTPTR_MAX  LONG_MAX
+#define UINTPTR_MAX  ULONG_MAX
+
+/* 7.18.2.5. Limits of greatest-width integer types */
+
+#undef INTMAX_MIN
+#undef INTMAX_MAX
+#ifdef INT64_MAX
+# define INTMAX_MIN  INT64_MIN
+# define INTMAX_MAX  INT64_MAX
+#else
+# define INTMAX_MIN  INT32_MIN
+# define INTMAX_MAX  INT32_MAX
+#endif
+
+#undef UINTMAX_MAX
+#ifdef UINT64_MAX
+# define UINTMAX_MAX  UINT64_MAX
+#else
+# define UINTMAX_MAX  UINT32_MAX
+#endif
+
+/* 7.18.3. Limits of other integer types */
+
+/* ptrdiff_t limits */
+#undef PTRDIFF_MIN
+#undef PTRDIFF_MAX
+#define PTRDIFF_MIN  \
+   _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+#define PTRDIFF_MAX  \
+   _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+
+/* sig_atomic_t limits */
+#undef SIG_ATOMIC_MIN
+#undef SIG_ATOMIC_MAX
+#define SIG_ATOMIC_MIN  \
+   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
+               0@SIG_ATOMIC_T_SUFFIX@)
+#define SIG_ATOMIC_MAX  \
+   _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
+               0@SIG_ATOMIC_T_SUFFIX@)
+
+
+/* size_t limit */
+#undef SIZE_MAX
+#define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+
+/* wchar_t limits */
+#undef WCHAR_MIN
+#undef WCHAR_MAX
+#define WCHAR_MIN  \
+   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+#define WCHAR_MAX  \
+   _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+
+/* wint_t limits */
+#undef WINT_MIN
+#undef WINT_MAX
+#define WINT_MIN  \
+   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#define WINT_MAX  \
+   _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+
+#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
+
+/* 7.18.4. Macros for integer constants */
+
+#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
+
+/* 7.18.4.1. Macros for minimum-width integer constants */
+/* According to ISO C 99 Technical Corrigendum 1 */
+
+/* Here we assume a standard architecture where the hardware integer
+   types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */
+
+#undef INT8_C
+#undef UINT8_C
+#define INT8_C(x) x
+#define UINT8_C(x) x
+
+#undef INT16_C
+#undef UINT16_C
+#define INT16_C(x) x
+#define UINT16_C(x) x
+
+#undef INT32_C
+#undef UINT32_C
+#define INT32_C(x) x
+#define UINT32_C(x) x ## U
+
+#undef INT64_C
+#undef UINT64_C
+#if LONG_MAX >> 31 >> 31 == 1
+# define INT64_C(x) x##L
+#elif defined _MSC_VER
+# define INT64_C(x) x##i64
+#elif @HAVE_LONG_LONG_INT@
+# define INT64_C(x) x##LL
+#endif
+#if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# define UINT64_C(x) x##UL
+#elif defined _MSC_VER
+# define UINT64_C(x) x##ui64
+#elif @HAVE_UNSIGNED_LONG_LONG_INT@
+# define UINT64_C(x) x##ULL
+#endif
+
+/* 7.18.4.2. Macros for greatest-width integer constants */
+
+#undef INTMAX_C
+#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# define INTMAX_C(x)   x##LL
+#elif defined GL_INT64_T
+# define INTMAX_C(x)   INT64_C(x)
+#else
+# define INTMAX_C(x)   x##L
+#endif
+
+#undef UINTMAX_C
+#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# define UINTMAX_C(x)  x##ULL
+#elif defined GL_UINT64_T
+# define UINTMAX_C(x)  UINT64_C(x)
+#else
+# define UINTMAX_C(x)  x##UL
+#endif
+
+#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
+
+#endif /* _GL_STDINT_H */
+#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
diff --git a/gnulib/stdio_.h b/gnulib/stdio_.h
new file mode 100644 (file)
index 0000000..76d9856
--- /dev/null
@@ -0,0 +1,353 @@
+/* A GNU-like <stdio.h>.
+
+   Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#if defined __need_FILE || defined __need___FILE
+/* Special invocation convention inside glibc header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _GL_STDIO_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#ifndef _GL_STDIO_H
+#define _GL_STDIO_H
+
+#include <stdarg.h>
+#include <stddef.h>
+
+#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
+  || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
+  || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
+  || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
+/* Get off_t and ssize_t.  */
+# include <sys/types.h>
+#endif
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+#  define __attribute__(Spec) /* empty */
+# endif
+/* The __-protected variants of `format' and `printf' attributes
+   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#  define __format__ format
+#  define __printf__ printf
+# endif
+#endif
+
+
+/* The definition of GL_LINK_WARNING is copied here.  */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if @GNULIB_FPRINTF_POSIX@
+# if @REPLACE_FPRINTF@
+#  define fprintf rpl_fprintf
+extern int fprintf (FILE *fp, const char *format, ...)
+       __attribute__ ((__format__ (__printf__, 2, 3)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fprintf
+# define fprintf \
+    (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
+                      "use gnulib module fprintf-posix for portable " \
+                      "POSIX compliance"), \
+     fprintf)
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@
+# if @REPLACE_VFPRINTF@
+#  define vfprintf rpl_vfprintf
+extern int vfprintf (FILE *fp, const char *format, va_list args)
+       __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vfprintf
+# define vfprintf(s,f,a) \
+    (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
+                      "use gnulib module vfprintf-posix for portable " \
+                      "POSIX compliance"), \
+     vfprintf (s, f, a))
+#endif
+
+#if @GNULIB_PRINTF_POSIX@
+# if @REPLACE_PRINTF@
+/* Don't break __attribute__((format(printf,M,N))).  */
+#  define printf __printf__
+extern int printf (const char *format, ...)
+       __attribute__ ((__format__ (__printf__, 1, 2)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef printf
+# define printf \
+    (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
+                      "use gnulib module printf-posix for portable " \
+                      "POSIX compliance"), \
+     printf)
+/* Don't break __attribute__((format(printf,M,N))).  */
+# define format(kind,m,n) format (__##kind##__, m, n)
+# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
+# define ____printf____ __printf__
+# define ____scanf____ __scanf__
+# define ____strftime____ __strftime__
+# define ____strfmon____ __strfmon__
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@
+# if @REPLACE_VPRINTF@
+#  define vprintf rpl_vprintf
+extern int vprintf (const char *format, va_list args)
+       __attribute__ ((__format__ (__printf__, 1, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vprintf
+# define vprintf(f,a) \
+    (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
+                      "use gnulib module vprintf-posix for portable " \
+                      "POSIX compliance"), \
+     vprintf (f, a))
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+#  define snprintf rpl_snprintf
+# endif
+# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
+extern int snprintf (char *str, size_t size, const char *format, ...)
+       __attribute__ ((__format__ (__printf__, 3, 4)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# define snprintf \
+    (GL_LINK_WARNING ("snprintf is unportable - " \
+                      "use gnulib module snprintf for portability"), \
+     snprintf)
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+#  define vsnprintf rpl_vsnprintf
+# endif
+# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
+extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
+       __attribute__ ((__format__ (__printf__, 3, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsnprintf
+# define vsnprintf(b,s,f,a) \
+    (GL_LINK_WARNING ("vsnprintf is unportable - " \
+                      "use gnulib module vsnprintf for portability"), \
+     vsnprintf (b, s, f, a))
+#endif
+
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+#  define sprintf rpl_sprintf
+extern int sprintf (char *str, const char *format, ...)
+       __attribute__ ((__format__ (__printf__, 2, 3)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+# define sprintf \
+    (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
+                      "use gnulib module sprintf-posix for portable " \
+                      "POSIX compliance"), \
+     sprintf)
+#endif
+
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+#  define vsprintf rpl_vsprintf
+extern int vsprintf (char *str, const char *format, va_list args)
+       __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+# define vsprintf(b,f,a) \
+    (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
+                      "use gnulib module vsprintf-posix for portable " \
+                      "POSIX compliance"), \
+     vsprintf (b, f, a))
+#endif
+
+#if @GNULIB_VASPRINTF@
+# if @REPLACE_VASPRINTF@
+#  define asprintf rpl_asprintf
+#  define vasprintf rpl_vasprintf
+# endif
+# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
+  /* Write formatted output to a string dynamically allocated with malloc().
+     If the memory allocation succeeds, store the address of the string in
+     *RESULT and return the number of resulting bytes, excluding the trailing
+     NUL.  Upon memory allocation error, or some other error, return -1.  */
+  extern int asprintf (char **result, const char *format, ...)
+    __attribute__ ((__format__ (__printf__, 2, 3)));
+  extern int vasprintf (char **result, const char *format, va_list args)
+    __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#endif
+
+#if @GNULIB_FSEEKO@
+# if @REPLACE_FSEEKO@
+/* Provide fseek, fseeko functions that are aware of a preceding
+   fflush(), and which detect pipes.  */
+#  define fseeko rpl_fseeko
+extern int fseeko (FILE *fp, off_t offset, int whence);
+#  define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fseeko
+# define fseeko(f,o,w) \
+   (GL_LINK_WARNING ("fseeko is unportable - " \
+                     "use gnulib module fseeko for portability"), \
+    fseeko (f, o, w))
+#endif
+
+#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
+extern int rpl_fseek (FILE *fp, long offset, int whence);
+# undef fseek
+# if defined GNULIB_POSIXCHECK
+#  define fseek(f,o,w) \
+     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use fseeko function for handling of large files"), \
+      rpl_fseek (f, o, w))
+# else
+#  define fseek rpl_fseek
+# endif
+#elif defined GNULIB_POSIXCHECK
+# ifndef fseek
+#  define fseek(f,o,w) \
+     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use fseeko function for handling of large files"), \
+      fseek (f, o, w))
+# endif
+#endif
+
+#if @GNULIB_FTELLO@
+# if @REPLACE_FTELLO@
+#  define ftello rpl_ftello
+extern off_t ftello (FILE *fp);
+#  define ftell(fp) ftello (fp)
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ftello
+# define ftello(f) \
+   (GL_LINK_WARNING ("ftello is unportable - " \
+                     "use gnulib module ftello for portability"), \
+    ftello (f))
+#endif
+
+#if @GNULIB_FTELL@ && @REPLACE_FTELL@
+extern long rpl_ftell (FILE *fp);
+# undef ftell
+# if GNULIB_POSIXCHECK
+#  define ftell(f) \
+     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use ftello function for handling of large files"), \
+      rpl_ftell (f))
+# else
+#  define ftell rpl_ftell
+# endif
+#elif defined GNULIB_POSIXCHECK
+# ifndef ftell
+#  define ftell(f) \
+     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use ftello function for handling of large files"), \
+      ftell (f))
+# endif
+#endif
+
+#if @GNULIB_FFLUSH@
+# if @REPLACE_FFLUSH@
+#  define fflush rpl_fflush
+  /* Flush all pending data on STREAM according to POSIX rules.  Both
+     output and seekable input streams are supported.
+     Note! LOSS OF DATA can occur if fflush is applied on an input stream
+     that is _not_seekable_ or on an update stream that is _not_seekable_
+     and in which the most recent operation was input.  Seekability can
+     be tested with lseek(fileno(fp),0,SEEK_CUR).  */
+  extern int fflush (FILE *gl_stream);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fflush
+# define fflush(f) \
+   (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
+                     "use gnulib module fflush for portable " \
+                     "POSIX compliance"), \
+    fflush (f))
+#endif
+
+#if @GNULIB_GETDELIM@
+# if !@HAVE_DECL_GETDELIM@
+  /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
+     NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
+     NULL), pointing to *N characters of space.  It is realloc'ed as
+     necessary.  Returns the number of characters read (not including
+     the null terminator), or -1 on error or EOF.  */
+  extern ssize_t getdelim (char **, size_t *, int delim, FILE *);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getdelim
+# define getdelim(l, s, d, f)                                      \
+  (GL_LINK_WARNING ("getdelim is unportable - "                            \
+                   "use gnulib module getdelim for portability"),  \
+   getdelim (l, s, d, f))
+#endif
+
+#if @GNULIB_GETLINE@
+# if @REPLACE_GETLINE@
+#  undef getline
+#  define getline rpl_getline
+# endif
+# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
+  /* Read up to (and including) a newline from FP into *LINEPTR (and
+     NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
+     NULL), pointing to *N characters of space.  It is realloc'ed as
+     necessary.  Returns the number of characters read (not including
+     the null terminator), or -1 on error or EOF.  */
+  extern ssize_t getline (char **, size_t *, FILE *);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getline
+# define getline(l, s, f)                                              \
+  (GL_LINK_WARNING ("getline is unportable - "                         \
+                   "use gnulib module getline for portability"),       \
+   getline (l, s, f))
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_STDIO_H */
+#endif /* _GL_STDIO_H */
+#endif
diff --git a/gnulib/stdlib_.h b/gnulib/stdlib_.h
new file mode 100644 (file)
index 0000000..a4946e6
--- /dev/null
@@ -0,0 +1,177 @@
+/* A GNU-like <stdlib.h>.
+
+   Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#if defined __need_malloc_and_calloc
+/* Special invocation convention inside glibc header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _GL_STDLIB_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#ifndef _GL_STDLIB_H
+#define _GL_STDLIB_H
+
+
+/* The definition of GL_LINK_WARNING is copied here.  */
+
+
+/* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
+   with proper operation of xargs.  */
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#elif EXIT_FAILURE != 1
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if @GNULIB_MALLOC_POSIX@
+# if !@HAVE_MALLOC_POSIX@
+#  undef malloc
+#  define malloc rpl_malloc
+extern void * malloc (size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef malloc
+# define malloc(s) \
+    (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
+                      "use gnulib module malloc-posix for portability"), \
+     malloc (s))
+#endif
+
+
+#if @GNULIB_REALLOC_POSIX@
+# if !@HAVE_REALLOC_POSIX@
+#  undef realloc
+#  define realloc rpl_realloc
+extern void * realloc (void *ptr, size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef realloc
+# define realloc(p,s) \
+    (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
+                      "use gnulib module realloc-posix for portability"), \
+     realloc (p, s))
+#endif
+
+
+#if @GNULIB_CALLOC_POSIX@
+# if !@HAVE_CALLOC_POSIX@
+#  undef calloc
+#  define calloc rpl_calloc
+extern void * calloc (size_t nmemb, size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef calloc
+# define calloc(n,s) \
+    (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
+                      "use gnulib module calloc-posix for portability"), \
+     calloc (n, s))
+#endif
+
+
+#if @GNULIB_GETSUBOPT@
+/* Assuming *OPTIONP is a comma separated list of elements of the form
+   "token" or "token=value", getsubopt parses the first of these elements.
+   If the first element refers to a "token" that is member of the given
+   NULL-terminated array of tokens:
+     - It replaces the comma with a NUL byte, updates *OPTIONP to point past
+       the first option and the comma, sets *VALUEP to the value of the
+       element (or NULL if it doesn't contain an "=" sign),
+     - It returns the index of the "token" in the given array of tokens.
+   Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
+   For more details see the POSIX:2001 specification.
+   http://www.opengroup.org/susv3xsh/getsubopt.html */
+# if !@HAVE_GETSUBOPT@
+extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getsubopt
+# define getsubopt(o,t,v) \
+    (GL_LINK_WARNING ("getsubopt is unportable - " \
+                      "use gnulib module getsubopt for portability"), \
+     getsubopt (o, t, v))
+#endif
+
+
+#if @GNULIB_MKDTEMP@
+# if !@HAVE_MKDTEMP@
+/* Create a unique temporary directory from TEMPLATE.
+   The last six characters of TEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the directory name unique.
+   Returns TEMPLATE, or a null pointer if it cannot get a unique name.
+   The directory is created mode 700.  */
+extern char * mkdtemp (char * /*template*/);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkdtemp
+# define mkdtemp(t) \
+    (GL_LINK_WARNING ("mkdtemp is unportable - " \
+                      "use gnulib module mkdtemp for portability"), \
+     mkdtemp (t))
+#endif
+
+
+#if @GNULIB_MKSTEMP@
+# if @REPLACE_MKSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+   The last six characters of TEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   The file is then created, ensuring it didn't exist before.
+   The file is created read-write (mask at least 0600 & ~umask), but it may be
+   world-readable and world-writable (mask 0666 & ~umask), depending on the
+   implementation.
+   Returns the open file descriptor if successful, otherwise -1 and errno
+   set.  */
+#  define mkstemp rpl_mkstemp
+extern int mkstemp (char * /*template*/);
+# else
+/* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+#  include <unistd.h>
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemp
+# define mkstemp(t) \
+    (GL_LINK_WARNING ("mkstemp is unportable - " \
+                      "use gnulib module mkstemp for portability"), \
+     mkstemp (t))
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_STDLIB_H */
+#endif /* _GL_STDLIB_H */
+#endif
index 94d991cf06ec2c06bb205f799fb147d6f5602751..bfb22b0ebc40948d16d92c036ba05cadce39f204 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+#ifndef _GL_STRING_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
 #ifndef _GL_STRING_H
 #define _GL_STRING_H
 
-#include @ABSOLUTE_STRING_H@
+
+/* The definition of GL_LINK_WARNING is copied here.  */
+
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* Return the first occurrence of NEEDLE in HAYSTACK.  */
-#if ! @HAVE_DECL_MEMMEM@
+#if @GNULIB_MEMMEM@
+# if ! @HAVE_DECL_MEMMEM@
 extern void *memmem (void const *__haystack, size_t __haystack_len,
                     void const *__needle, size_t __needle_len);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memmem
+# define memmem(a,al,b,bl) \
+    (GL_LINK_WARNING ("memmem is unportable - " \
+                      "use gnulib module memmem for portability"), \
+     memmem (a, al, b, bl))
 #endif
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
-#if ! @HAVE_MEMPCPY@
+#if @GNULIB_MEMPCPY@
+# if ! @HAVE_MEMPCPY@
 extern void *mempcpy (void *restrict __dest, void const *restrict __src,
                      size_t __n);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mempcpy
+# define mempcpy(a,b,n) \
+    (GL_LINK_WARNING ("mempcpy is unportable - " \
+                      "use gnulib module mempcpy for portability"), \
+     mempcpy (a, b, n))
 #endif
 
 /* Search backwards through a block for a byte (specified as an int).  */
-#if ! @HAVE_DECL_MEMRCHR@
+#if @GNULIB_MEMRCHR@
+# if ! @HAVE_DECL_MEMRCHR@
 extern void *memrchr (void const *, int, size_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memrchr
+# define memrchr(a,b,c) \
+    (GL_LINK_WARNING ("memrchr is unportable - " \
+                      "use gnulib module memrchr for portability"), \
+     memrchr (a, b, c))
 #endif
 
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
-#if ! @HAVE_STPCPY@
+#if @GNULIB_STPCPY@
+# if ! @HAVE_STPCPY@
 extern char *stpcpy (char *restrict __dst, char const *restrict __src);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef stpcpy
+# define stpcpy(a,b) \
+    (GL_LINK_WARNING ("stpcpy is unportable - " \
+                      "use gnulib module stpcpy for portability"), \
+     stpcpy (a, b))
 #endif
 
 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
    last non-NUL byte written into DST.  */
-#if ! @HAVE_STPNCPY@
-# define stpncpy gnu_stpncpy
+#if @GNULIB_STPNCPY@
+# if ! @HAVE_STPNCPY@
+#  define stpncpy gnu_stpncpy
 extern char *stpncpy (char *restrict __dst, char const *restrict __src,
                      size_t __n);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef stpncpy
+# define stpncpy(a,b,n) \
+    (GL_LINK_WARNING ("stpncpy is unportable - " \
+                      "use gnulib module stpncpy for portability"), \
+     stpncpy (a, b, n))
 #endif
 
 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
    greater than zero if S1 is lexicographically less than, equal to or greater
    than S2.
-   Note: This function may, in multibyte locales, return 0 for strings of
-   different lengths!
-   No known system has a strcasecmp() function that works correctly in
-   multibyte locales.  Therefore use our version always, if the
-   strcase module is available.  */
-#if @REPLACE_STRCASECMP@
-# define strcasecmp rpl_strcasecmp
-extern int strcasecmp (char const *__s1, char const *__s2);
+   Note: This function does not work in multibyte locales.  */
+#if ! @HAVE_STRCASECMP@
+extern int strcasecmp (char const *s1, char const *s2);
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strcasecmp() does not work with multibyte strings:
+   POSIX says that it operates on "strings", and "string" in POSIX is defined
+   as a sequence of bytes, not of characters.   */
+# undef strcasecmp
+# define strcasecmp(a,b) \
+    (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \
+                      "in multibyte locales - " \
+                      "use mbscasecmp if you care about " \
+                      "internationalization, or use c_strcasecmp (from " \
+                      "gnulib module c-strcase) if you want a locale " \
+                      "independent function"), \
+     strcasecmp (a, b))
 #endif
 
 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
@@ -74,38 +130,150 @@ extern int strcasecmp (char const *__s1, char const *__s2);
    lexicographically less than, equal to or greater than S2.
    Note: This function cannot work correctly in multibyte locales.  */
 #if ! @HAVE_DECL_STRNCASECMP@
-extern int strncasecmp (char const *__s1, char const *__s2, size_t __n);
+extern int strncasecmp (char const *s1, char const *s2, size_t n);
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strncasecmp() does not work with multibyte strings:
+   POSIX says that it operates on "strings", and "string" in POSIX is defined
+   as a sequence of bytes, not of characters.  */
+# undef strncasecmp
+# define strncasecmp(a,b,n) \
+    (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \
+                      "strings in multibyte locales - " \
+                      "use mbsncasecmp or mbspcasecmp if you care about " \
+                      "internationalization, or use c_strncasecmp (from " \
+                      "gnulib module c-strcase) if you want a locale " \
+                      "independent function"), \
+     strncasecmp (a, b, n))
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strchr() does not work with multibyte strings if the locale encoding is
+   GB18030 and the character to be searched is a digit.  */
+# undef strchr
+# define strchr(s,c) \
+    (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \
+                      "in some multibyte locales - " \
+                      "use mbschr if you care about internationalization"), \
+     strchr (s, c))
 #endif
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
-#if ! @HAVE_STRCHRNUL@
+#if @GNULIB_STRCHRNUL@
+# if ! @HAVE_STRCHRNUL@
 extern char *strchrnul (char const *__s, int __c_in);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strchrnul
+# define strchrnul(a,b) \
+    (GL_LINK_WARNING ("strchrnul is unportable - " \
+                      "use gnulib module strchrnul for portability"), \
+     strchrnul (a, b))
 #endif
 
 /* Duplicate S, returning an identical malloc'd string.  */
-#if ! @HAVE_DECL_STRDUP@ && ! defined strdup
+#if @GNULIB_STRDUP@
+# if ! @HAVE_DECL_STRDUP@ && ! defined strdup
 extern char *strdup (char const *__s);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strdup
+# define strdup(a) \
+    (GL_LINK_WARNING ("strdup is unportable - " \
+                      "use gnulib module strdup for portability"), \
+     strdup (a))
 #endif
 
 /* Return a newly allocated copy of at most N bytes of STRING.  */
-#if ! @HAVE_STRNDUP@
-# undef strndup
-# define strndup rpl_strndup
-# if ! @HAVE_DECL_STRNDUP@
+#if @GNULIB_STRNDUP@
+# if ! @HAVE_STRNDUP@
+#  undef strndup
+#  define strndup rpl_strndup
+# endif
+# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
 extern char *strndup (char const *__string, size_t __n);
 # endif
+#elif defined GNULIB_POSIXCHECK
+# undef strndup
+# define strndup(a,n) \
+    (GL_LINK_WARNING ("strndup is unportable - " \
+                      "use gnulib module strndup for portability"), \
+     strndup (a, n))
 #endif
 
 /* Find the length (number of bytes) of STRING, but scan at most
    MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
    return MAXLEN.  */
-#if ! @HAVE_DECL_STRNLEN@
+#if @GNULIB_STRNLEN@
+# if ! @HAVE_DECL_STRNLEN@
 extern size_t strnlen (char const *__string, size_t __maxlen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strnlen
+# define strnlen(a,n) \
+    (GL_LINK_WARNING ("strnlen is unportable - " \
+                      "use gnulib module strnlen for portability"), \
+     strnlen (a, n))
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strcspn() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it does not work with multibyte strings if the
+   locale encoding is GB18030 and one of the characters to be searched is a
+   digit.  */
+# undef strcspn
+# define strcspn(s,a) \
+    (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \
+                      "in multibyte locales - " \
+                      "use mbscspn if you care about internationalization"), \
+     strcspn (s, a))
 #endif
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
-#if ! @HAVE_STRPBRK@
+#if @GNULIB_STRPBRK@
+# if ! @HAVE_STRPBRK@
 extern char *strpbrk (char const *__s, char const *__accept);
+# endif
+# if defined GNULIB_POSIXCHECK
+/* strpbrk() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it does not work with multibyte strings if the
+   locale encoding is GB18030 and one of the characters to be searched is a
+   digit.  */
+#  undef strpbrk
+#  define strpbrk(s,a) \
+     (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \
+                       "in multibyte locales - " \
+                       "use mbspbrk if you care about internationalization"), \
+      strpbrk (s, a))
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strpbrk
+# define strpbrk(s,a) \
+    (GL_LINK_WARNING ("strpbrk is unportable - " \
+                      "use gnulib module strpbrk for portability"), \
+     strpbrk (s, a))
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strspn() assumes the second argument is a list of single-byte characters.
+   Even in this simple case, it cannot work with multibyte strings.  */
+# undef strspn
+# define strspn(s,a) \
+    (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \
+                      "in multibyte locales - " \
+                      "use mbsspn if you care about internationalization"), \
+     strspn (s, a))
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strrchr() does not work with multibyte strings if the locale encoding is
+   GB18030 and the character to be searched is a digit.  */
+# undef strrchr
+# define strrchr(s,c) \
+    (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \
+                      "in some multibyte locales - " \
+                      "use mbsrchr if you care about internationalization"), \
+     strrchr (s, c))
 #endif
 
 /* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
@@ -124,29 +292,57 @@ extern char *strpbrk (char const *__s, char const *__accept);
            characters are ASCII characters < 0x30.
 
    See also strtok_r().  */
-#if ! @HAVE_STRSEP@
+#if @GNULIB_STRSEP@
+# if ! @HAVE_STRSEP@
 extern char *strsep (char **restrict __stringp, char const *restrict __delim);
+# endif
+# if defined GNULIB_POSIXCHECK
+#  undef strsep
+#  define strsep(s,d) \
+     (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \
+                       "in multibyte locales - " \
+                       "use mbssep if you care about internationalization"), \
+      strsep (s, d))
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsep
+# define strsep(s,d) \
+    (GL_LINK_WARNING ("strsep is unportable - " \
+                      "use gnulib module strsep for portability"), \
+     strsep (s, d))
 #endif
 
-/* Find the first occurrence of NEEDLE in HAYSTACK.
-   No known system has a strstr() function that works correctly in
-   multibyte locales.  Therefore use our version always, if the strstr
-   module is available.  */
-#if @REPLACE_STRSTR@
+#if defined GNULIB_POSIXCHECK
+/* strstr() does not work with multibyte strings if the locale encoding is
+   different from UTF-8:
+   POSIX says that it operates on "strings", and "string" in POSIX is defined
+   as a sequence of bytes, not of characters.  */
 # undef strstr
-# define strstr rpl_strstr
-extern char *strstr (char const *__haystack, char const *__needle);
+# define strstr(a,b) \
+    (GL_LINK_WARNING ("strstr cannot work correctly on character strings " \
+                      "in most multibyte locales - " \
+                      "use mbsstr if you care about internationalization"), \
+     strstr (a, b))
 #endif
 
 /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
-   comparison.
-   Note: This function may, in multibyte locales, return success even if
-   strlen (haystack) < strlen (needle) !  */
-#if @REPLACE_STRCASESTR@
-# undef strcasestr
-# define strcasestr rpl_strcasestr
+   comparison.  */
+#if ! @HAVE_STRCASESTR@
 extern char *strcasestr (const char *haystack, const char *needle);
 #endif
+#if defined GNULIB_POSIXCHECK
+/* strcasestr() does not work with multibyte strings:
+   It is a glibc extension, and glibc implements it only for unibyte
+   locales.  */
+# undef strcasestr
+# define strcasestr(a,b) \
+    (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \
+                      "in multibyte locales - " \
+                      "use mbscasestr if you care about " \
+                      "internationalization, or use c-strcasestr if you want " \
+                      "a locale independent function"), \
+     strcasestr (a, b))
+#endif
 
 /* Parse S into tokens separated by characters in DELIM.
    If S is NULL, the saved pointer in SAVE_PTR is used as
@@ -170,13 +366,183 @@ extern char *strcasestr (const char *haystack, const char *needle);
            characters are ASCII characters < 0x30.
 
    See also strsep().  */
-#if ! @HAVE_DECL_STRTOK_R@
-extern char *strtok_r (char *restrict __s, char const *restrict __sep,
-                      char **restrict __lasts);
+#if @GNULIB_STRTOK_R@
+# if ! @HAVE_DECL_STRTOK_R@
+extern char *strtok_r (char *restrict s, char const *restrict delim,
+                      char **restrict save_ptr);
+# endif
+# if defined GNULIB_POSIXCHECK
+#  undef strtok_r
+#  define strtok_r(s,d,p) \
+     (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \
+                       "in multibyte locales - " \
+                       "use mbstok_r if you care about internationalization"), \
+      strtok_r (s, d, p))
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtok_r
+# define strtok_r(s,d,p) \
+    (GL_LINK_WARNING ("strtok_r is unportable - " \
+                      "use gnulib module strtok_r for portability"), \
+     strtok_r (s, d, p))
+#endif
+
+
+/* The following functions are not specified by POSIX.  They are gnulib
+   extensions.  */
+
+#if @GNULIB_MBSLEN@
+/* Return the number of multibyte characters in the character string STRING.
+   This considers multibyte characters, unlike strlen, which counts bytes.  */
+extern size_t mbslen (const char *string);
+#endif
+
+#if @GNULIB_MBSNLEN@
+/* Return the number of multibyte characters in the character string starting
+   at STRING and ending at STRING + LEN.  */
+extern size_t mbsnlen (const char *string, size_t len);
+#endif
+
+#if @GNULIB_MBSCHR@
+/* Locate the first single-byte character C in the character string STRING,
+   and return a pointer to it.  Return NULL if C is not found in STRING.
+   Unlike strchr(), this function works correctly in multibyte locales with
+   encodings such as GB18030.  */
+# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+extern char * mbschr (const char *string, int c);
+#endif
+
+#if @GNULIB_MBSRCHR@
+/* Locate the last single-byte character C in the character string STRING,
+   and return a pointer to it.  Return NULL if C is not found in STRING.
+   Unlike strrchr(), this function works correctly in multibyte locales with
+   encodings such as GB18030.  */
+# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
+extern char * mbsrchr (const char *string, int c);
+#endif
+
+#if @GNULIB_MBSSTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+   string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
+   Unlike strstr(), this function works correctly in multibyte locales with
+   encodings different from UTF-8.  */
+extern char * mbsstr (const char *haystack, const char *needle);
+#endif
+
+#if @GNULIB_MBSCASECMP@
+/* Compare the character strings S1 and S2, ignoring case, returning less than,
+   equal to or greater than zero if S1 is lexicographically less than, equal to
+   or greater than S2.
+   Note: This function may, in multibyte locales, return 0 for strings of
+   different lengths!
+   Unlike strcasecmp(), this function works correctly in multibyte locales.  */
+extern int mbscasecmp (const char *s1, const char *s2);
 #endif
 
+#if @GNULIB_MBSNCASECMP@
+/* Compare the initial segment of the character string S1 consisting of at most
+   N characters with the initial segment of the character string S2 consisting
+   of at most N characters, ignoring case, returning less than, equal to or
+   greater than zero if the initial segment of S1 is lexicographically less
+   than, equal to or greater than the initial segment of S2.
+   Note: This function may, in multibyte locales, return 0 for initial segments
+   of different lengths!
+   Unlike strncasecmp(), this function works correctly in multibyte locales.
+   But beware that N is not a byte count but a character count!  */
+extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
+#endif
+
+#if @GNULIB_MBSPCASECMP@
+/* Compare the initial segment of the character string STRING consisting of
+   at most mbslen (PREFIX) characters with the character string PREFIX,
+   ignoring case, returning less than, equal to or greater than zero if this
+   initial segment is lexicographically less than, equal to or greater than
+   PREFIX.
+   Note: This function may, in multibyte locales, return 0 if STRING is of
+   smaller length than PREFIX!
+   Unlike strncasecmp(), this function works correctly in multibyte
+   locales.  */
+extern char * mbspcasecmp (const char *string, const char *prefix);
+#endif
+
+#if @GNULIB_MBSCASESTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+   string HAYSTACK, using case-insensitive comparison.
+   Note: This function may, in multibyte locales, return success even if
+   strlen (haystack) < strlen (needle) !
+   Unlike strcasestr(), this function works correctly in multibyte locales.  */
+extern char * mbscasestr (const char *haystack, const char *needle);
+#endif
+
+#if @GNULIB_MBSCSPN@
+/* Find the first occurrence in the character string STRING of any character
+   in the character string ACCEPT.  Return the number of bytes from the
+   beginning of the string to this occurrence, or to the end of the string
+   if none exists.
+   Unlike strcspn(), this function works correctly in multibyte locales.  */
+extern size_t mbscspn (const char *string, const char *accept);
+#endif
+
+#if @GNULIB_MBSPBRK@
+/* Find the first occurrence in the character string STRING of any character
+   in the character string ACCEPT.  Return the pointer to it, or NULL if none
+   exists.
+   Unlike strpbrk(), this function works correctly in multibyte locales.  */
+# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+extern char * mbspbrk (const char *string, const char *accept);
+#endif
+
+#if @GNULIB_MBSSPN@
+/* Find the first occurrence in the character string STRING of any character
+   not in the character string REJECT.  Return the number of bytes from the
+   beginning of the string to this occurrence, or to the end of the string
+   if none exists.
+   Unlike strspn(), this function works correctly in multibyte locales.  */
+extern size_t mbsspn (const char *string, const char *reject);
+#endif
+
+#if @GNULIB_MBSSEP@
+/* Search the next delimiter (multibyte character listed in the character
+   string DELIM) starting at the character string *STRINGP.
+   If one is found, overwrite it with a NUL, and advance *STRINGP to point
+   to the next multibyte character after it.  Otherwise, set *STRINGP to NULL.
+   If *STRINGP was already NULL, nothing happens.
+   Return the old value of *STRINGP.
+
+   This is a variant of mbstok_r() that supports empty fields.
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+
+   See also mbstok_r().  */
+extern char * mbssep (char **stringp, const char *delim);
+#endif
+
+#if @GNULIB_MBSTOK_R@
+/* Parse the character string STRING into tokens separated by characters in
+   the character string DELIM.
+   If STRING is NULL, the saved pointer in SAVE_PTR is used as
+   the next starting point.  For example:
+       char s[] = "-abc-=-def";
+       char *sp;
+       x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+       x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+       x = mbstok_r(NULL, "=", &sp);   // x = NULL
+               // s = "abc\0-def\0"
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+
+   See also mbssep().  */
+extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
+#endif
+
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif
+#endif /* _GL_STRING_H */
+#endif /* _GL_STRING_H */
diff --git a/gnulib/sys_socket_.h b/gnulib/sys_socket_.h
new file mode 100644 (file)
index 0000000..c25b6ab
--- /dev/null
@@ -0,0 +1,91 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW).
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* This file is supposed to be used on platforms that lack <sys/socket.h>
+   and on platforms where <sys/socket.h> cannot be included standalone.
+   It is intended to provide definitions and prototypes needed by an
+   application.  */
+
+#ifndef _GL_SYS_SOCKET_H
+
+#if @HAVE_SYS_SOCKET_H@
+
+/* On many platforms, <sys/socket.h> assumes prior inclusion of
+   <sys/types.h>.  */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#endif
+
+#ifndef _GL_SYS_SOCKET_H
+#define _GL_SYS_SOCKET_H
+
+#if !@HAVE_SYS_SOCKET_H@
+
+/* A platform that lacks <sys/socket.h>.
+
+   Currently only MinGW is supported.  See the gnulib manual regarding
+   Windows sockets.  MinGW has the header files winsock2.h and
+   ws2tcpip.h that declare the sys/socket.h definitions we need.  Note
+   that you can influence which definitions you get by setting the
+   WINVER symbol before including these two files.  For example,
+   getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
+   symbol is set indiriectly through WINVER).  You can set this by
+   adding AC_DEFINE(WINVER, 0x0501) to configure.ac.  Note that your
+   code may not run on older Windows releases then.  My Windows 2000
+   box was not able to run the code, for example.  The situation is
+   slightly confusing because:
+   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
+   suggests that getaddrinfo should be available on all Windows
+   releases. */
+
+
+# if @HAVE_WINSOCK2_H@
+#  include <winsock2.h>
+# endif
+# if @HAVE_WS2TCPIP_H@
+#  include <ws2tcpip.h>
+# endif
+
+/* For shutdown(). */
+# if !defined SHUT_RD && defined SD_RECEIVE
+#  define SHUT_RD SD_RECEIVE
+# endif
+# if !defined SHUT_WR && defined SD_SEND
+#  define SHUT_WR SD_SEND
+# endif
+# if !defined SHUT_RDWR && defined SD_BOTH
+#  define SHUT_RDWR SD_BOTH
+# endif
+
+# if defined _WIN32 || defined __WIN32__
+#  define ENOTSOCK                WSAENOTSOCK
+#  define EADDRINUSE              WSAEADDRINUSE
+#  define ENETRESET               WSAENETRESET
+#  define ECONNABORTED            WSAECONNABORTED
+#  define ECONNRESET              WSAECONNRESET
+#  define ENOTCONN                WSAENOTCONN
+#  define ESHUTDOWN               WSAESHUTDOWN
+# endif
+
+#endif /* HAVE_SYS_SOCKET_H */
+
+#endif /* _GL_SYS_SOCKET_H */
+#endif /* _GL_SYS_SOCKET_H */
diff --git a/gnulib/sys_stat_.h b/gnulib/sys_stat_.h
new file mode 100644 (file)
index 0000000..2e411cd
--- /dev/null
@@ -0,0 +1,280 @@
+/* Provide a more complete sys/stat header file.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
+
+/* This file is supposed to be used on platforms where <sys/stat.h> is
+   incomplete.  It is intended to provide definitions and prototypes
+   needed by an application.  Start with what the system provides.  */
+
+#ifndef _GL_SYS_STAT_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+#ifndef _GL_SYS_STAT_H
+#define _GL_SYS_STAT_H
+
+#ifndef S_IFMT
+# define S_IFMT 0170000
+#endif
+
+#if STAT_MACROS_BROKEN
+# undef S_ISBLK
+# undef S_ISCHR
+# undef S_ISDIR
+# undef S_ISFIFO
+# undef S_ISLNK
+# undef S_ISNAM
+# undef S_ISMPB
+# undef S_ISMPC
+# undef S_ISNWK
+# undef S_ISREG
+# undef S_ISSOCK
+#endif
+
+#ifndef S_ISBLK
+# ifdef S_IFBLK
+#  define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+#  define S_ISBLK(m) 0
+# endif
+#endif
+
+#ifndef S_ISCHR
+# ifdef S_IFCHR
+#  define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# else
+#  define S_ISCHR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDIR
+# ifdef S_IFDIR
+#  define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# else
+#  define S_ISDIR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDOOR /* Solaris 2.5 and up */
+# define S_ISDOOR(m) 0
+#endif
+
+#ifndef S_ISFIFO
+# ifdef S_IFIFO
+#  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+#  define S_ISFIFO(m) 0
+# endif
+#endif
+
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+#  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+#  define S_ISLNK(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPB /* V7 */
+# ifdef S_IFMPB
+#  define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+#  define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# else
+#  define S_ISMPB(m) 0
+#  define S_ISMPC(m) 0
+# endif
+#endif
+
+#ifndef S_ISNAM /* Xenix */
+# ifdef S_IFNAM
+#  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
+# else
+#  define S_ISNAM(m) 0
+# endif
+#endif
+
+#ifndef S_ISNWK /* HP/UX */
+# ifdef S_IFNWK
+#  define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# else
+#  define S_ISNWK(m) 0
+# endif
+#endif
+
+#ifndef S_ISPORT /* Solaris 10 and up */
+# define S_ISPORT(m) 0
+#endif
+
+#ifndef S_ISREG
+# ifdef S_IFREG
+#  define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+#  define S_ISREG(m) 0
+# endif
+#endif
+
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+#  define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+#  define S_ISSOCK(m) 0
+# endif
+#endif
+
+
+#ifndef S_TYPEISMQ
+# define S_TYPEISMQ(p) 0
+#endif
+
+#ifndef S_TYPEISTMO
+# define S_TYPEISTMO(p) 0
+#endif
+
+
+#ifndef S_TYPEISSEM
+# ifdef S_INSEM
+#  define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
+# else
+#  define S_TYPEISSEM(p) 0
+# endif
+#endif
+
+#ifndef S_TYPEISSHM
+# ifdef S_INSHD
+#  define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
+# else
+#  define S_TYPEISSHM(p) 0
+# endif
+#endif
+
+/* high performance ("contiguous data") */
+#ifndef S_ISCTG
+# define S_ISCTG(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with data  */
+#ifndef S_ISOFD
+# define S_ISOFD(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with no data  */
+#ifndef S_ISOFL
+# define S_ISOFL(p) 0
+#endif
+
+/* 4.4BSD whiteout */
+#ifndef S_ISWHT
+# define S_ISWHT(m) 0
+#endif
+
+/* If any of the following are undefined,
+   define them to their de facto standard values.  */
+#if !S_ISUID
+# define S_ISUID 04000
+#endif
+#if !S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* S_ISVTX is a common extension to POSIX.  */
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
+#if !S_IRUSR && S_IREAD
+# define S_IRUSR S_IREAD
+#endif
+#if !S_IRUSR
+# define S_IRUSR 00400
+#endif
+#if !S_IRGRP
+# define S_IRGRP (S_IRUSR >> 3)
+#endif
+#if !S_IROTH
+# define S_IROTH (S_IRUSR >> 6)
+#endif
+
+#if !S_IWUSR && S_IWRITE
+# define S_IWUSR S_IWRITE
+#endif
+#if !S_IWUSR
+# define S_IWUSR 00200
+#endif
+#if !S_IWGRP
+# define S_IWGRP (S_IWUSR >> 3)
+#endif
+#if !S_IWOTH
+# define S_IWOTH (S_IWUSR >> 6)
+#endif
+
+#if !S_IXUSR && S_IEXEC
+# define S_IXUSR S_IEXEC
+#endif
+#if !S_IXUSR
+# define S_IXUSR 00100
+#endif
+#if !S_IXGRP
+# define S_IXGRP (S_IXUSR >> 3)
+#endif
+#if !S_IXOTH
+# define S_IXOTH (S_IXUSR >> 6)
+#endif
+
+#if !S_IRWXU
+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#endif
+#if !S_IRWXG
+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#if !S_IRWXO
+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#endif
+
+/* S_IXUGO is a common extension to POSIX.  */
+#if !S_IXUGO
+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
+
+#ifndef S_IRWXUGO
+# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
+#endif
+
+/* mingw does not support symlinks, therefore it does not have lstat.  But
+   without links, stat does just fine.  */
+#if ! @HAVE_LSTAT@
+# define lstat stat
+#endif
+
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+   Additionally, it declares _mkdir (and depending on compile flags, an
+   alias mkdir), only in the nonstandard io.h.  */
+#if ! @HAVE_DECL_MKDIR@ && @HAVE_IO_H@
+# include <io.h>
+
+static inline int
+rpl_mkdir (char const *name, mode_t mode)
+{
+  return _mkdir (name);
+}
+
+# define mkdir rpl_mkdir
+#endif
+
+#endif /* _GL_SYS_STAT_H */
+#endif /* _GL_SYS_STAT_H */
diff --git a/gnulib/sys_time_.h b/gnulib/sys_time_.h
new file mode 100644 (file)
index 0000000..296d20d
--- /dev/null
@@ -0,0 +1,52 @@
+/* Provide a more complete sys/time.h.
+
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Paul Eggert.  */
+
+#if defined _GL_SYS_TIME_H
+
+/* Simply delegate to the system's header, without adding anything.  */
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# endif
+
+#else
+
+# define _GL_SYS_TIME_H
+
+# if @HAVE_SYS_TIME_H@
+#  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+# else
+#  include <time.h>
+# endif
+
+# if ! @HAVE_STRUCT_TIMEVAL@
+struct timeval
+{
+  time_t tv_sec;
+  long int tv_usec;
+};
+# endif
+
+# if @REPLACE_GETTIMEOFDAY@
+#  undef gettimeofday
+#  define gettimeofday rpl_gettimeofday
+int gettimeofday (struct timeval *restrict, void *restrict);
+# endif
+
+#endif /* _GL_SYS_TIME_H */
diff --git a/gnulib/tempname.c b/gnulib/tempname.c
new file mode 100644 (file)
index 0000000..e213600
--- /dev/null
@@ -0,0 +1,315 @@
+/* tempname.c - generate the name of a temporary file.
+
+   Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation,
+   Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Extracted from glibc sysdeps/posix/tempname.c.  See also tmpdir.c.  */
+
+#if !_LIBC
+# include <config.h>
+# include "tempname.h"
+#endif
+
+#include <sys/types.h>
+#include <assert.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#include <stdio.h>
+#ifndef P_tmpdir
+# define P_tmpdir "/tmp"
+#endif
+#ifndef TMP_MAX
+# define TMP_MAX 238328
+#endif
+#ifndef __GT_FILE
+# define __GT_FILE     0
+# define __GT_BIGFILE  1
+# define __GT_DIR      2
+# define __GT_NOCREATE 3
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <fcntl.h>
+#include <sys/time.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <sys/stat.h>
+
+#if _LIBC
+# define struct_stat64 struct stat64
+# define small_open __open
+# define large_open __open64
+#else
+# define struct_stat64 struct stat
+# define small_open open
+# define large_open open
+# define __gen_tempname gen_tempname
+# define __getpid getpid
+# define __gettimeofday gettimeofday
+# define __mkdir mkdir
+# define __lxstat64(version, file, buf) lstat (file, buf)
+# define __xstat64(version, file, buf) stat (file, buf)
+#endif
+
+#if ! (HAVE___SECURE_GETENV || _LIBC)
+# define __secure_getenv getenv
+#endif
+
+#ifdef _LIBC
+# include <hp-timing.h>
+# if HP_TIMING_AVAIL
+#  define RANDOM_BITS(Var) \
+  if (__builtin_expect (value == UINT64_C (0), 0))                           \
+    {                                                                        \
+      /* If this is the first time this function is used initialize          \
+        the variable we accumulate the value in to some somewhat             \
+        random value.  If we'd not do this programs at startup time          \
+        might have a reduced set of possible names, at least on slow         \
+        machines.  */                                                        \
+      struct timeval tv;                                                     \
+      __gettimeofday (&tv, NULL);                                            \
+      value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;                     \
+    }                                                                        \
+  HP_TIMING_NOW (Var)
+# endif
+#endif
+
+/* Use the widest available unsigned type if uint64_t is not
+   available.  The algorithm below extracts a number less than 62**6
+   (approximately 2**35.725) from uint64_t, so ancient hosts where
+   uintmax_t is only 32 bits lose about 3.725 bits of randomness,
+   which is better than not having mkstemp at all.  */
+#if !defined UINT64_MAX && !defined uint64_t
+# define uint64_t uintmax_t
+#endif
+
+#if _LIBC
+/* Return nonzero if DIR is an existent directory.  */
+static int
+direxists (const char *dir)
+{
+  struct_stat64 buf;
+  return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+}
+
+/* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
+   non-null and exists, uses it; otherwise uses the first of $TMPDIR,
+   P_tmpdir, /tmp that exists.  Copies into TMPL a template suitable
+   for use with mk[s]temp.  Will fail (-1) if DIR is non-null and
+   doesn't exist, none of the searched dirs exists, or there's not
+   enough space in TMPL. */
+int
+__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+              int try_tmpdir)
+{
+  const char *d;
+  size_t dlen, plen;
+
+  if (!pfx || !pfx[0])
+    {
+      pfx = "file";
+      plen = 4;
+    }
+  else
+    {
+      plen = strlen (pfx);
+      if (plen > 5)
+       plen = 5;
+    }
+
+  if (try_tmpdir)
+    {
+      d = __secure_getenv ("TMPDIR");
+      if (d != NULL && direxists (d))
+       dir = d;
+      else if (dir != NULL && direxists (dir))
+       /* nothing */ ;
+      else
+       dir = NULL;
+    }
+  if (dir == NULL)
+    {
+      if (direxists (P_tmpdir))
+       dir = P_tmpdir;
+      else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+       dir = "/tmp";
+      else
+       {
+         __set_errno (ENOENT);
+         return -1;
+       }
+    }
+
+  dlen = strlen (dir);
+  while (dlen > 1 && dir[dlen - 1] == '/')
+    dlen--;                    /* remove trailing slashes */
+
+  /* check we have room for "${dir}/${pfx}XXXXXX\0" */
+  if (tmpl_len < dlen + 1 + plen + 6 + 1)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+  return 0;
+}
+#endif /* _LIBC */
+
+/* These are the characters used in temporary file names.  */
+static const char letters[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+/* Generate a temporary file name based on TMPL.  TMPL must match the
+   rules for mk[s]temp (i.e. end in "XXXXXX").  The name constructed
+   does not exist at the time of the call to __gen_tempname.  TMPL is
+   overwritten with the result.
+
+   KIND may be one of:
+   __GT_NOCREATE:      simply verify that the name does not exist
+                       at the time of the call.
+   __GT_FILE:          create the file using open(O_CREAT|O_EXCL)
+                       and return a read-write fd.  The file is mode 0600.
+   __GT_BIGFILE:       same as __GT_FILE but use open64().
+   __GT_DIR:           create a directory, which will be mode 0700.
+
+   We use a clever algorithm to get hard-to-predict names. */
+int
+__gen_tempname (char *tmpl, int kind)
+{
+  int len;
+  char *XXXXXX;
+  static uint64_t value;
+  uint64_t random_time_bits;
+  unsigned int count;
+  int fd = -1;
+  int save_errno = errno;
+  struct_stat64 st;
+
+  /* A lower bound on the number of temporary files to attempt to
+     generate.  The maximum total number of temporary file names that
+     can exist for a given template is 62**6.  It should never be
+     necessary to try all these combinations.  Instead if a reasonable
+     number of names is tried (we define reasonable as 62**3) fail to
+     give the system administrator the chance to remove the problems.  */
+#define ATTEMPTS_MIN (62 * 62 * 62)
+
+  /* The number of times to attempt to generate a temporary file.  To
+     conform to POSIX, this must be no smaller than TMP_MAX.  */
+#if ATTEMPTS_MIN < TMP_MAX
+  unsigned int attempts = TMP_MAX;
+#else
+  unsigned int attempts = ATTEMPTS_MIN;
+#endif
+
+  len = strlen (tmpl);
+  if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  /* This is where the Xs start.  */
+  XXXXXX = &tmpl[len - 6];
+
+  /* Get some more or less random data.  */
+#ifdef RANDOM_BITS
+  RANDOM_BITS (random_time_bits);
+#else
+  {
+    struct timeval tv;
+    __gettimeofday (&tv, NULL);
+    random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
+  }
+#endif
+  value += random_time_bits ^ __getpid ();
+
+  for (count = 0; count < attempts; value += 7777, ++count)
+    {
+      uint64_t v = value;
+
+      /* Fill in the random bits.  */
+      XXXXXX[0] = letters[v % 62];
+      v /= 62;
+      XXXXXX[1] = letters[v % 62];
+      v /= 62;
+      XXXXXX[2] = letters[v % 62];
+      v /= 62;
+      XXXXXX[3] = letters[v % 62];
+      v /= 62;
+      XXXXXX[4] = letters[v % 62];
+      v /= 62;
+      XXXXXX[5] = letters[v % 62];
+
+      switch (kind)
+       {
+       case __GT_FILE:
+         fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         break;
+
+       case __GT_BIGFILE:
+         fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+         break;
+
+       case __GT_DIR:
+         fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+         break;
+
+       case __GT_NOCREATE:
+         /* This case is backward from the other three.  __gen_tempname
+            succeeds if __xstat fails because the name does not exist.
+            Note the continue to bypass the common logic at the bottom
+            of the loop.  */
+         if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+           {
+             if (errno == ENOENT)
+               {
+                 __set_errno (save_errno);
+                 return 0;
+               }
+             else
+               /* Give up now. */
+               return -1;
+           }
+         continue;
+
+       default:
+         assert (! "invalid KIND in __gen_tempname");
+       }
+
+      if (fd >= 0)
+       {
+         __set_errno (save_errno);
+         return fd;
+       }
+      else if (errno != EEXIST)
+       return -1;
+    }
+
+  /* We got out of the loop because we ran out of combinations to try.  */
+  __set_errno (EEXIST);
+  return -1;
+}
diff --git a/gnulib/tempname.h b/gnulib/tempname.h
new file mode 100644 (file)
index 0000000..c51fa69
--- /dev/null
@@ -0,0 +1,40 @@
+/* Create a temporary file or directory.
+
+   Copyright (C) 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* header written by Eric Blake */
+
+/* In gnulib, always prefer large files.  GT_FILE maps to
+   __GT_BIGFILE, not __GT_FILE, for a reason.  */
+#define GT_FILE                1
+#define GT_DIR         2
+#define GT_NOCREATE    3
+
+/* Generate a temporary file name based on TMPL.  TMPL must match the
+   rules for mk[s]temp (i.e. end in "XXXXXX").  The name constructed
+   does not exist at the time of the call to gen_tempname.  TMPL is
+   overwritten with the result.
+
+   KIND may be one of:
+   GT_NOCREATE:                simply verify that the name does not exist
+                       at the time of the call.
+   GT_FILE:            create a large file using open(O_CREAT|O_EXCL)
+                       and return a read-write fd.  The file is mode 0600.
+   GT_DIR:             create a directory, which will be mode 0700.
+
+   We use a clever algorithm to get hard-to-predict names. */
+extern int gen_tempname (char *tmpl, int kind);
diff --git a/gnulib/unistd_.h b/gnulib/unistd_.h
new file mode 100644 (file)
index 0000000..07c4877
--- /dev/null
@@ -0,0 +1,262 @@
+/* Substitute for and wrapper around <unistd.h>.
+   Copyright (C) 2004-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_UNISTD_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_UNISTD_H@
+# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+#endif
+
+#ifndef _GL_UNISTD_H
+#define _GL_UNISTD_H
+
+/* mingw doesn't define the SEEK_* macros in <unistd.h>.  */
+#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
+# include <stdio.h>
+#endif
+
+/* mingw fails to declare _exit in <unistd.h>.  */
+#include <stdlib.h>
+
+/* The definition of GL_LINK_WARNING is copied here.  */
+
+
+/* Declare overridden functions.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if @GNULIB_CHOWN@
+# if @REPLACE_CHOWN@
+#  ifndef REPLACE_CHOWN
+#   define REPLACE_CHOWN 1
+#  endif
+#  if REPLACE_CHOWN
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+   to GID (if GID is not -1).  Follow symbolic links.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/chown.html>.  */
+#   define chown rpl_chown
+extern int chown (const char *file, uid_t uid, gid_t gid);
+#  endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef chown
+# define chown(f,u,g) \
+    (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
+                      "doesn't treat a uid or gid of -1 on some systems - " \
+                      "use gnulib module chown for portability"), \
+     chown (f, u, g))
+#endif
+
+
+#if @GNULIB_DUP2@
+# if !@HAVE_DUP2@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
+   NEWFD = OLDFD, otherwise close NEWFD first if it is open.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/dup2.html>.  */
+extern int dup2 (int oldfd, int newfd);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef dup2
+# define dup2(o,n) \
+    (GL_LINK_WARNING ("dup2 is unportable - " \
+                      "use gnulib module dup2 for portability"), \
+     dup2 (o, n))
+#endif
+
+
+#if @GNULIB_FCHDIR@
+# if @REPLACE_FCHDIR@
+
+/* Change the process' current working directory to the directory on which
+   the given file descriptor is open.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
+extern int fchdir (int /*fd*/);
+
+#  define close rpl_close
+extern int close (int);
+#  define dup rpl_dup
+extern int dup (int);
+#  define dup2 rpl_dup2
+extern int dup2 (int, int);
+
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fchdir
+# define fchdir(f) \
+    (GL_LINK_WARNING ("fchdir is unportable - " \
+                      "use gnulib module fchdir for portability"), \
+     fchdir (f))
+#endif
+
+
+#if @GNULIB_FTRUNCATE@
+# if !@HAVE_FTRUNCATE@
+/* Change the size of the file to which FD is opened to become equal to LENGTH.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
+extern int ftruncate (int fd, off_t length);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ftruncate
+# define ftruncate(f,l) \
+    (GL_LINK_WARNING ("ftruncate is unportable - " \
+                      "use gnulib module ftruncate for portability"), \
+     ftruncate (f, l))
+#endif
+
+
+#if @GNULIB_GETCWD@
+/* Include the headers that might declare getcwd so that they will not
+   cause confusion if included after this file.  */
+# include <stdlib.h>
+# if @REPLACE_GETCWD@
+/* Get the name of the current working directory, and put it in SIZE bytes
+   of BUF.
+   Return BUF if successful, or NULL if the directory couldn't be determined
+   or SIZE was too small.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/getcwd.html>.
+   Additionally, the gnulib module 'getcwd' guarantees the following GNU
+   extension: If BUF is NULL, an array is allocated with 'malloc'; the array
+   is SIZE bytes long, unless SIZE == 0, in which case it is as big as
+   necessary.  */
+#  define getcwd rpl_getcwd
+extern char * getcwd (char *buf, size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getcwd
+# define getcwd(b,s) \
+    (GL_LINK_WARNING ("getcwd is unportable - " \
+                      "use gnulib module getcwd for portability"), \
+     getcwd (b, s))
+#endif
+
+
+#if @GNULIB_GETLOGIN_R@
+/* Copies the user's login name to NAME.
+   The array pointed to by NAME has room for SIZE bytes.
+
+   Returns 0 if successful.  Upon error, an error number is returned, or -1 in
+   the case that the login name cannot be found but no specific error is
+   provided (this case is hopefully rare but is left open by the POSIX spec).
+
+   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+ */
+# if !@HAVE_DECL_GETLOGIN_R@
+#  include <stddef.h>
+extern int getlogin_r (char *name, size_t size);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin_r
+# define getlogin_r(n,s) \
+    (GL_LINK_WARNING ("getlogin_r is unportable - " \
+                      "use gnulib module getlogin_r for portability"), \
+     getlogin_r (n, s))
+#endif
+
+
+#if @GNULIB_LCHOWN@
+# if @REPLACE_LCHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+   to GID (if GID is not -1).  Do not follow symbolic links.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/lchown.html>.  */
+#  define lchown rpl_lchown
+extern int lchown (char const *file, uid_t owner, gid_t group);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lchown
+# define lchown(f,u,g) \
+    (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
+                      "systems - use gnulib module lchown for portability"), \
+     lchown (f, u, g))
+#endif
+
+
+#if @GNULIB_LSEEK@
+# if @REPLACE_LSEEK@
+/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
+   Return the new offset if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/lseek.html>.  */
+#  define lseek rpl_lseek
+   extern off_t lseek (int fd, off_t offset, int whence);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lseek
+# define lseek(f,o,w) \
+    (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
+                      "systems - use gnulib module lseek for portability"), \
+     lseek (f, o, w))
+#endif
+
+
+#if @GNULIB_READLINK@
+/* Read the contents of the symbolic link FILE and place the first BUFSIZE
+   bytes of it into BUF.  Return the number of bytes placed into BUF if
+   successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/readlink.html>.  */
+# if !@HAVE_READLINK@
+#  include <stddef.h>
+extern int readlink (const char *file, char *buf, size_t bufsize);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef readlink
+# define readlink(f,b,s) \
+    (GL_LINK_WARNING ("readlink is unportable - " \
+                      "use gnulib module readlink for portability"), \
+     readlink (f, b, s))
+#endif
+
+
+#if @GNULIB_SLEEP@
+/* Pause the execution of the current thread for N seconds.
+   Returns the number of seconds left to sleep.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
+# if !@HAVE_SLEEP@
+extern unsigned int sleep (unsigned int n);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sleep
+# define sleep(n) \
+    (GL_LINK_WARNING ("sleep is unportable - " \
+                      "use gnulib module sleep for portability"), \
+     sleep (n))
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _GL_UNISTD_H */
+#endif /* _GL_UNISTD_H */
index 67406ae860c92ae5129973cd622e153cb9476c2c..f56382334919f19824971ece142a18194e211fba 100644 (file)
    with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
+/* This file can be parametrized with the following macros:
+     VASNPRINTF         The name of the function being defined.
+     FCHAR_T            The element type of the format string.
+     DCHAR_T            The element type of the destination (result) string.
+     FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
+                        in the format string are ASCII. MUST be set if
+                        FCHAR_T and DCHAR_T are not the same type.
+     DIRECTIVE          Structure denoting a format directive.
+                        Depends on FCHAR_T.
+     DIRECTIVES         Structure denoting the set of format directives of a
+                        format string.  Depends on FCHAR_T.
+     PRINTF_PARSE       Function that parses a format string.
+                        Depends on FCHAR_T.
+     DCHAR_CPY          memcpy like function for DCHAR_T[] arrays.
+     DCHAR_SET          memset like function for DCHAR_T[] arrays.
+     DCHAR_MBSNLEN      mbsnlen like function for DCHAR_T[] arrays.
+     SNPRINTF           The system's snprintf (or similar) function.
+                        This may be either snprintf or swprintf.
+     TCHAR_T            The element type of the argument and result string
+                        of the said SNPRINTF function.  This may be either
+                        char or wchar_t.  The code exploits that
+                        sizeof (TCHAR_T) | sizeof (DCHAR_T) and
+                        alignof (TCHAR_T) <= alignof (DCHAR_T).
+     DCHAR_IS_TCHAR     Set to 1 if DCHAR_T and TCHAR_T are the same type.
+     DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
+     DCHAR_IS_UINT8_T   Set to 1 if DCHAR_T is uint8_t.
+     DCHAR_IS_UINT16_T  Set to 1 if DCHAR_T is uint16_t.
+     DCHAR_IS_UINT32_T  Set to 1 if DCHAR_T is uint32_t.  */
+
 /* Tell glibc's <stdio.h> to provide a prototype for snprintf().
    This must come before <config.h> because <config.h> may include
    <features.h>, and once <features.h> has been included, it's too late.  */
 # define _GNU_SOURCE    1
 #endif
 
-#include <config.h>
+#ifndef VASNPRINTF
+# include <config.h>
+#endif
 #ifndef IN_LIBINTL
 # include <alloca.h>
 #endif
 
 /* Specification.  */
-#if WIDE_CHAR_VERSION
-# include "vasnwprintf.h"
-#else
-# include "vasnprintf.h"
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+#  include "vasnwprintf.h"
+# else
+#  include "vasnprintf.h"
+# endif
 #endif
 
+#include <locale.h>    /* localeconv() */
 #include <stdio.h>     /* snprintf(), sprintf() */
 #include <stdlib.h>    /* abort(), malloc(), realloc(), free() */
 #include <string.h>    /* memcpy(), strlen() */
 #include <errno.h>     /* errno */
 #include <limits.h>    /* CHAR_BIT */
 #include <float.h>     /* DBL_MAX_EXP, LDBL_MAX_EXP */
-#if WIDE_CHAR_VERSION
-# include "wprintf-parse.h"
-#else
-# include "printf-parse.h"
+#if HAVE_NL_LANGINFO
+# include <langinfo.h>
+#endif
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+#  include "wprintf-parse.h"
+# else
+#  include "printf-parse.h"
+# endif
 #endif
 
 /* Checked size_t computations.  */
 #include "xsize.h"
 
+#if NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
+# include <math.h>
+# include "float+.h"
+# include "fpucw.h"
+#endif
+
+#if NEED_PRINTF_INFINITE_DOUBLE && !defined IN_LIBINTL
+# include <math.h>
+# include "isnan.h"
+#endif
+
+#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL
+# include <math.h>
+# include "isnanl-nolibm.h"
+# include "fpucw.h"
+#endif
+
+#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL
+# include <math.h>
+# include "isnan.h"
+# include "printf-frexp.h"
+# include "isnanl-nolibm.h"
+# include "printf-frexpl.h"
+# include "fpucw.h"
+#endif
+
+/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
+#ifndef EOVERFLOW
+# define EOVERFLOW E2BIG
+#endif
+
 #if HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
@@ -72,12 +142,32 @@ local_wcslen (const wchar_t *s)
 # endif
 #endif
 
+/* Default parameters.  */
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+#  define VASNPRINTF vasnwprintf
+#  define FCHAR_T wchar_t
+#  define DCHAR_T wchar_t
+#  define TCHAR_T wchar_t
+#  define DCHAR_IS_TCHAR 1
+#  define DIRECTIVE wchar_t_directive
+#  define DIRECTIVES wchar_t_directives
+#  define PRINTF_PARSE wprintf_parse
+#  define DCHAR_CPY wmemcpy
+# else
+#  define VASNPRINTF vasnprintf
+#  define FCHAR_T char
+#  define DCHAR_T char
+#  define TCHAR_T char
+#  define DCHAR_IS_TCHAR 1
+#  define DIRECTIVE char_directive
+#  define DIRECTIVES char_directives
+#  define PRINTF_PARSE printf_parse
+#  define DCHAR_CPY memcpy
+# endif
+#endif
 #if WIDE_CHAR_VERSION
-# define VASNPRINTF vasnwprintf
-# define CHAR_T wchar_t
-# define DIRECTIVE wchar_t_directive
-# define DIRECTIVES wchar_t_directives
-# define PRINTF_PARSE wprintf_parse
+  /* TCHAR_T is wchar_t.  */
 # define USE_SNPRINTF 1
 # if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
@@ -88,23 +178,1019 @@ local_wcslen (const wchar_t *s)
 #  define SNPRINTF swprintf
 # endif
 #else
-# define VASNPRINTF vasnprintf
-# define CHAR_T char
-# define DIRECTIVE char_directive
-# define DIRECTIVES char_directives
-# define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
+  /* TCHAR_T is char.  */
+# /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+     But don't use it on BeOS, since BeOS snprintf produces no output if the
+     size argument is >= 0x3000000.  */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__
+#  define USE_SNPRINTF 1
+# else
+#  define USE_SNPRINTF 0
+# endif
 # if HAVE_DECL__SNPRINTF
    /* Windows.  */
 #  define SNPRINTF _snprintf
 # else
    /* Unix.  */
 #  define SNPRINTF snprintf
+   /* Here we need to call the native snprintf, not rpl_snprintf.  */
+#  undef snprintf
+# endif
+#endif
+/* Here we need to call the native sprintf, not rpl_sprintf.  */
+#undef sprintf
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+/* Determine the decimal-point character according to the current locale.  */
+# ifndef decimal_point_char_defined
+#  define decimal_point_char_defined 1
+static char
+decimal_point_char ()
+{
+  const char *point;
+  /* Determine it in a multithread-safe way.  We know nl_langinfo is
+     multithread-safe on glibc systems, but is not required to be multithread-
+     safe by POSIX.  sprintf(), however, is multithread-safe.  localeconv()
+     is rarely multithread-safe.  */
+#  if HAVE_NL_LANGINFO && __GLIBC__
+  point = nl_langinfo (RADIXCHAR);
+#  elif 1
+  char pointbuf[5];
+  sprintf (pointbuf, "%#.0f", 1.0);
+  point = &pointbuf[1];
+#  else
+  point = localeconv () -> decimal_point;
+#  endif
+  /* The decimal point is always a single byte: either '.' or ','.  */
+  return (point[0] != '\0' ? point[0] : '.');
+}
+# endif
+#endif
+
+#if NEED_PRINTF_INFINITE_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm.  */
+static int
+is_infinite_or_zero (double x)
+{
+  return isnan (x) || x + x == x;
+}
+
+#endif
+
+#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x), but does not require libm.  */
+static int
+is_infinitel (long double x)
+{
+  return isnanl (x) || (x + x == x && x != 0.0L);
+}
+
+#endif
+
+#if NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
+
+/* Converting 'long double' to decimal without rare rounding bugs requires
+   real bignums.  We use the naming conventions of GNU gmp, but vastly simpler
+   (and slower) algorithms.  */
+
+typedef unsigned int mp_limb_t;
+# define GMP_LIMB_BITS 32
+typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1];
+
+typedef unsigned long long mp_twolimb_t;
+# define GMP_TWOLIMB_BITS 64
+typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1];
+
+/* Representation of a bignum >= 0.  */
+typedef struct
+{
+  size_t nlimbs;
+  mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc().  */
+} mpn_t;
+
+/* Compute the product of two bignums >= 0.
+   Return the allocated memory in case of success, NULL in case of memory
+   allocation failure.  */
+static void *
+multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
+{
+  const mp_limb_t *p1;
+  const mp_limb_t *p2;
+  size_t len1;
+  size_t len2;
+
+  if (src1.nlimbs <= src2.nlimbs)
+    {
+      len1 = src1.nlimbs;
+      p1 = src1.limbs;
+      len2 = src2.nlimbs;
+      p2 = src2.limbs;
+    }
+  else
+    {
+      len1 = src2.nlimbs;
+      p1 = src2.limbs;
+      len2 = src1.nlimbs;
+      p2 = src1.limbs;
+    }
+  /* Now 0 <= len1 <= len2.  */
+  if (len1 == 0)
+    {
+      /* src1 or src2 is zero.  */
+      dest->nlimbs = 0;
+      dest->limbs = (mp_limb_t *) malloc (1);
+    }
+  else
+    {
+      /* Here 1 <= len1 <= len2.  */
+      size_t dlen;
+      mp_limb_t *dp;
+      size_t k, i, j;
+
+      dlen = len1 + len2;
+      dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
+      if (dp == NULL)
+       return NULL;
+      for (k = len2; k > 0; )
+       dp[--k] = 0;
+      for (i = 0; i < len1; i++)
+       {
+         mp_limb_t digit1 = p1[i];
+         mp_twolimb_t carry = 0;
+         for (j = 0; j < len2; j++)
+           {
+             mp_limb_t digit2 = p2[j];
+             carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+             carry += dp[i + j];
+             dp[i + j] = (mp_limb_t) carry;
+             carry = carry >> GMP_LIMB_BITS;
+           }
+         dp[i + len2] = (mp_limb_t) carry;
+       }
+      /* Normalise.  */
+      while (dlen > 0 && dp[dlen - 1] == 0)
+       dlen--;
+      dest->nlimbs = dlen;
+      dest->limbs = dp;
+    }
+  return dest->limbs;
+}
+
+/* Compute the quotient of a bignum a >= 0 and a bignum b > 0.
+   a is written as  a = q * b + r  with 0 <= r < b.  q is the quotient, r
+   the remainder.
+   Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
+   q is incremented.
+   Return the allocated memory in case of success, NULL in case of memory
+   allocation failure.  */
+static void *
+divide (mpn_t a, mpn_t b, mpn_t *q)
+{
+  /* Algorithm:
+     First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]]
+     with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS).
+     If m<n, then q:=0 and r:=a.
+     If m>=n=1, perform a single-precision division:
+       r:=0, j:=m,
+       while j>0 do
+         {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j =
+               = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta}
+         j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j].
+       Normalise [q[m-1],...,q[0]], yields q.
+     If m>=n>1, perform a multiple-precision division:
+       We have a/b < beta^(m-n+1).
+       s:=intDsize-1-(hightest bit in b[n-1]), 0<=s<intDsize.
+       Shift a and b left by s bits, copying them. r:=a.
+       r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
+       For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
+         Compute q* :
+           q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]).
+           In case of overflow (q* >= beta) set q* := beta-1.
+           Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2]
+           and c3 := b[n-2] * q*.
+           {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow
+            occurred.  Furthermore 0 <= c3 < beta^2.
+            If there was overflow and
+            r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2,
+            the next test can be skipped.}
+           While c3 > c2, {Here 0 <= c2 < c3 < beta^2}
+             Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2].
+           If q* > 0:
+             Put r := r - b * q* * beta^j. In detail:
+               [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]].
+               hence: u:=0, for i:=0 to n-1 do
+                              u := u + q* * b[i],
+                              r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry),
+                              u:=u div beta (+ 1, if carry in subtraction)
+                      r[n+j]:=r[n+j]-u.
+               {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1
+                               < q* + 1 <= beta,
+                the carry u does not overflow.}
+             If a negative carry occurs, put q* := q* - 1
+               and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]].
+         Set q[j] := q*.
+       Normalise [q[m-n],..,q[0]]; this yields the quotient q.
+       Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the
+       rest r.
+       The room for q[j] can be allocated at the memory location of r[n+j].
+     Finally, round-to-even:
+       Shift r left by 1 bit.
+       If r > b or if r = b and q[0] is odd, q := q+1.
+   */
+  const mp_limb_t *a_ptr = a.limbs;
+  size_t a_len = a.nlimbs;
+  const mp_limb_t *b_ptr = b.limbs;
+  size_t b_len = b.nlimbs;
+  mp_limb_t *roomptr;
+  mp_limb_t *tmp_roomptr = NULL;
+  mp_limb_t *q_ptr;
+  size_t q_len;
+  mp_limb_t *r_ptr;
+  size_t r_len;
+
+  /* Allocate room for a_len+2 digits.
+     (Need a_len+1 digits for the real division and 1 more digit for the
+     final rounding of q.)  */
+  roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
+  if (roomptr == NULL)
+    return NULL;
+
+  /* Normalise a.  */
+  while (a_len > 0 && a_ptr[a_len - 1] == 0)
+    a_len--;
+
+  /* Normalise b.  */
+  for (;;)
+    {
+      if (b_len == 0)
+       /* Division by zero.  */
+       abort ();
+      if (b_ptr[b_len - 1] == 0)
+       b_len--;
+      else
+       break;
+    }
+
+  /* Here m = a_len >= 0 and n = b_len > 0.  */
+
+  if (a_len < b_len)
+    {
+      /* m<n: trivial case.  q=0, r := copy of a.  */
+      r_ptr = roomptr;
+      r_len = a_len;
+      memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+      q_ptr = roomptr + a_len;
+      q_len = 0;
+    }
+  else if (b_len == 1)
+    {
+      /* n=1: single precision division.
+        beta^(m-1) <= a < beta^m  ==>  beta^(m-2) <= a/b < beta^m  */
+      r_ptr = roomptr;
+      q_ptr = roomptr + 1;
+      {
+       mp_limb_t den = b_ptr[0];
+       mp_limb_t remainder = 0;
+       const mp_limb_t *sourceptr = a_ptr + a_len;
+       mp_limb_t *destptr = q_ptr + a_len;
+       size_t count;
+       for (count = a_len; count > 0; count--)
+         {
+           mp_twolimb_t num =
+             ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
+           *--destptr = num / den;
+           remainder = num % den;
+         }
+       /* Normalise and store r.  */
+       if (remainder > 0)
+         {
+           r_ptr[0] = remainder;
+           r_len = 1;
+         }
+       else
+         r_len = 0;
+       /* Normalise q.  */
+       q_len = a_len;
+       if (q_ptr[q_len - 1] == 0)
+         q_len--;
+      }
+    }
+  else
+    {
+      /* n>1: multiple precision division.
+        beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n  ==>
+        beta^(m-n-1) <= a/b < beta^(m-n+1).  */
+      /* Determine s.  */
+      size_t s;
+      {
+       mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
+       s = 31;
+       if (msd >= 0x10000)
+         {
+           msd = msd >> 16;
+           s -= 16;
+         }
+       if (msd >= 0x100)
+         {
+           msd = msd >> 8;
+           s -= 8;
+         }
+       if (msd >= 0x10)
+         {
+           msd = msd >> 4;
+           s -= 4;
+         }
+       if (msd >= 0x4)
+         {
+           msd = msd >> 2;
+           s -= 2;
+         }
+       if (msd >= 0x2)
+         {
+           msd = msd >> 1;
+           s -= 1;
+         }
+      }
+      /* 0 <= s < GMP_LIMB_BITS.
+        Copy b, shifting it left by s bits.  */
+      if (s > 0)
+       {
+         tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
+         if (tmp_roomptr == NULL)
+           {
+             free (roomptr);
+             return NULL;
+           }
+         {
+           const mp_limb_t *sourceptr = b_ptr;
+           mp_limb_t *destptr = tmp_roomptr;
+           mp_twolimb_t accu = 0;
+           size_t count;
+           for (count = b_len; count > 0; count--)
+             {
+               accu += (mp_twolimb_t) *sourceptr++ << s;
+               *destptr++ = (mp_limb_t) accu;
+               accu = accu >> GMP_LIMB_BITS;
+             }
+           /* accu must be zero, since that was how s was determined.  */
+           if (accu != 0)
+             abort ();
+         }
+         b_ptr = tmp_roomptr;
+       }
+      /* Copy a, shifting it left by s bits, yields r.
+        Memory layout:
+        At the beginning: r = roomptr[0..a_len],
+        at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len]  */
+      r_ptr = roomptr;
+      if (s == 0)
+       {
+         memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+         r_ptr[a_len] = 0;
+       }
+      else
+       {
+         const mp_limb_t *sourceptr = a_ptr;
+         mp_limb_t *destptr = r_ptr;
+         mp_twolimb_t accu = 0;
+         size_t count;
+         for (count = a_len; count > 0; count--)
+           {
+             accu += (mp_twolimb_t) *sourceptr++ << s;
+             *destptr++ = (mp_limb_t) accu;
+             accu = accu >> GMP_LIMB_BITS;
+           }
+         *destptr++ = (mp_limb_t) accu;
+       }
+      q_ptr = roomptr + b_len;
+      q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
+      {
+       size_t j = a_len - b_len; /* m-n */
+       mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
+       mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
+       mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
+         ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
+       /* Division loop, traversed m-n+1 times.
+          j counts down, b is unchanged, beta/2 <= b[n-1] < beta.  */
+       for (;;)
+         {
+           mp_limb_t q_star;
+           mp_limb_t c1;
+           if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
+             {
+               /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow.  */
+               mp_twolimb_t num =
+                 ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
+                 | r_ptr[j + b_len - 1];
+               q_star = num / b_msd;
+               c1 = num % b_msd;
+             }
+           else
+             {
+               /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1].  */
+               q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
+               /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
+                  <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
+                  <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
+                       {<= beta !}.
+                  If yes, jump directly to the subtraction loop.
+                  (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
+                   <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
+               if (r_ptr[j + b_len] > b_msd
+                   || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
+                 /* r[j+n] >= b[n-1]+1 or
+                    r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
+                    carry.  */
+                 goto subtract;
+             }
+           /* q_star = q*,
+              c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta).  */
+           {
+             mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
+               ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
+             mp_twolimb_t c3 = /* b[n-2] * q* */
+               (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
+             /* While c2 < c3, increase c2 and decrease c3.
+                Consider c3-c2.  While it is > 0, decrease it by
+                b[n-1]*beta+b[n-2].  Because of b[n-1]*beta+b[n-2] >= beta^2/2
+                this can happen only twice.  */
+             if (c3 > c2)
+               {
+                 q_star = q_star - 1; /* q* := q* - 1 */
+                 if (c3 - c2 > b_msdd)
+                   q_star = q_star - 1; /* q* := q* - 1 */
+               }
+           }
+           if (q_star > 0)
+             subtract:
+             {
+               /* Subtract r := r - b * q* * beta^j.  */
+               mp_limb_t cr;
+               {
+                 const mp_limb_t *sourceptr = b_ptr;
+                 mp_limb_t *destptr = r_ptr + j;
+                 mp_twolimb_t carry = 0;
+                 size_t count;
+                 for (count = b_len; count > 0; count--)
+                   {
+                     /* Here 0 <= carry <= q*.  */
+                     carry =
+                       carry
+                       + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
+                       + (mp_limb_t) ~(*destptr);
+                     /* Here 0 <= carry <= beta*q* + beta-1.  */
+                     *destptr++ = ~(mp_limb_t) carry;
+                     carry = carry >> GMP_LIMB_BITS; /* <= q* */
+                   }
+                 cr = (mp_limb_t) carry;
+               }
+               /* Subtract cr from r_ptr[j + b_len], then forget about
+                  r_ptr[j + b_len].  */
+               if (cr > r_ptr[j + b_len])
+                 {
+                   /* Subtraction gave a carry.  */
+                   q_star = q_star - 1; /* q* := q* - 1 */
+                   /* Add b back.  */
+                   {
+                     const mp_limb_t *sourceptr = b_ptr;
+                     mp_limb_t *destptr = r_ptr + j;
+                     mp_limb_t carry = 0;
+                     size_t count;
+                     for (count = b_len; count > 0; count--)
+                       {
+                         mp_limb_t source1 = *sourceptr++;
+                         mp_limb_t source2 = *destptr;
+                         *destptr++ = source1 + source2 + carry;
+                         carry =
+                           (carry
+                            ? source1 >= (mp_limb_t) ~source2
+                            : source1 > (mp_limb_t) ~source2);
+                       }
+                   }
+                   /* Forget about the carry and about r[j+n].  */
+                 }
+             }
+           /* q* is determined.  Store it as q[j].  */
+           q_ptr[j] = q_star;
+           if (j == 0)
+             break;
+           j--;
+         }
+      }
+      r_len = b_len;
+      /* Normalise q.  */
+      if (q_ptr[q_len - 1] == 0)
+       q_len--;
+# if 0 /* Not needed here, since we need r only to compare it with b/2, and
+         b is shifted left by s bits.  */
+      /* Shift r right by s bits.  */
+      if (s > 0)
+       {
+         mp_limb_t ptr = r_ptr + r_len;
+         mp_twolimb_t accu = 0;
+         size_t count;
+         for (count = r_len; count > 0; count--)
+           {
+             accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
+             accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
+             *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
+           }
+       }
+# endif
+      /* Normalise r.  */
+      while (r_len > 0 && r_ptr[r_len - 1] == 0)
+       r_len--;
+    }
+  /* Compare r << 1 with b.  */
+  if (r_len > b_len)
+    goto increment_q;
+  {
+    size_t i;
+    for (i = b_len;;)
+      {
+       mp_limb_t r_i =
+         (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
+         | (i < r_len ? r_ptr[i] << 1 : 0);
+       mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
+       if (r_i > b_i)
+         goto increment_q;
+       if (r_i < b_i)
+         goto keep_q;
+       if (i == 0)
+         break;
+       i--;
+      }
+  }
+  if (q_len > 0 && ((q_ptr[0] & 1) != 0))
+    /* q is odd.  */
+    increment_q:
+    {
+      size_t i;
+      for (i = 0; i < q_len; i++)
+       if (++(q_ptr[i]) != 0)
+         goto keep_q;
+      q_ptr[q_len++] = 1;
+    }
+  keep_q:
+  if (tmp_roomptr != NULL)
+    free (tmp_roomptr);
+  q->limbs = q_ptr;
+  q->nlimbs = q_len;
+  return roomptr;
+}
+
+/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
+   representation.
+   Destroys the contents of a.
+   Return the allocated memory - containing the decimal digits in low-to-high
+   order, terminated with a NUL character - in case of success, NULL in case
+   of memory allocation failure.  */
+static char *
+convert_to_decimal (mpn_t a, size_t extra_zeroes)
+{
+  mp_limb_t *a_ptr = a.limbs;
+  size_t a_len = a.nlimbs;
+  /* 0.03345 is slightly larger than log(2)/(9*log(10)).  */
+  size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
+  char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
+  if (c_ptr != NULL)
+    {
+      char *d_ptr = c_ptr;
+      for (; extra_zeroes > 0; extra_zeroes--)
+       *d_ptr++ = '0';
+      while (a_len > 0)
+       {
+         /* Divide a by 10^9, in-place.  */
+         mp_limb_t remainder = 0;
+         mp_limb_t *ptr = a_ptr + a_len;
+         size_t count;
+         for (count = a_len; count > 0; count--)
+           {
+             mp_twolimb_t num =
+               ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
+             *ptr = num / 1000000000;
+             remainder = num % 1000000000;
+           }
+         /* Store the remainder as 9 decimal digits.  */
+         for (count = 9; count > 0; count--)
+           {
+             *d_ptr++ = '0' + (remainder % 10);
+             remainder = remainder / 10;
+           }
+         /* Normalize a.  */
+         if (a_ptr[a_len - 1] == 0)
+           a_len--;
+       }
+      /* Remove leading zeroes.  */
+      while (d_ptr > c_ptr && d_ptr[-1] == '0')
+       d_ptr--;
+      /* But keep at least one zero.  */
+      if (d_ptr == c_ptr)
+       *d_ptr++ = '0';
+      /* Terminate the string.  */
+      *d_ptr = '\0';
+    }
+  return c_ptr;
+}
+
+/* Assuming x is finite and >= 0:
+   write x as x = 2^e * m, where m is a bignum.
+   Return the allocated memory in case of success, NULL in case of memory
+   allocation failure.  */
+static void *
+decode_long_double (long double x, int *ep, mpn_t *mp)
+{
+  mpn_t m;
+  int exp;
+  long double y;
+  size_t i;
+
+  /* Allocate memory for result.  */
+  m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+  m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
+  if (m.limbs == NULL)
+    return NULL;
+  /* Split into exponential part and mantissa.  */
+  y = frexpl (x, &exp);
+  if (!(y >= 0.0L && y < 1.0L))
+    abort ();
+  /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the
+     latter is an integer.  */
+  /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs.
+     I'm not sure whether it's safe to cast a 'long double' value between
+     2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
+     'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
+     doesn't matter).  */
+# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0
+#  if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
+    {
+      mp_limb_t hi, lo;
+      y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2));
+      hi = (int) y;
+      y -= hi;
+      if (!(y >= 0.0L && y < 1.0L))
+       abort ();
+      y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+      lo = (int) y;
+      y -= lo;
+      if (!(y >= 0.0L && y < 1.0L))
+       abort ();
+      m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+    }
+#  else
+    {
+      mp_limb_t d;
+      y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS);
+      d = (int) y;
+      y -= d;
+      if (!(y >= 0.0L && y < 1.0L))
+       abort ();
+      m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
+    }
+#  endif
 # endif
+  for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
+    {
+      mp_limb_t hi, lo;
+      y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+      hi = (int) y;
+      y -= hi;
+      if (!(y >= 0.0L && y < 1.0L))
+       abort ();
+      y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+      lo = (int) y;
+      y -= lo;
+      if (!(y >= 0.0L && y < 1.0L))
+       abort ();
+      m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+    }
+  if (!(y == 0.0L))
+    abort ();
+  /* Normalise.  */
+  while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
+    m.nlimbs--;
+  *mp = m;
+  *ep = exp - LDBL_MANT_BIT;
+  return m.limbs;
+}
+
+/* Assuming x is finite and >= 0, and n is an integer:
+   Returns the decimal representation of round (x * 10^n).
+   Return the allocated memory - containing the decimal digits in low-to-high
+   order, terminated with a NUL character - in case of success, NULL in case
+   of memory allocation failure.  */
+static char *
+scale10_round_decimal_long_double (long double x, int n)
+{
+  int e;
+  mpn_t m;
+  void *memory = decode_long_double (x, &e, &m);
+  int s;
+  size_t extra_zeroes;
+  unsigned int abs_n;
+  unsigned int abs_s;
+  mp_limb_t *pow5_ptr;
+  size_t pow5_len;
+  unsigned int s_limbs;
+  unsigned int s_bits;
+  mpn_t pow5;
+  mpn_t z;
+  void *z_memory;
+  char *digits;
+
+  if (memory == NULL)
+    return NULL;
+  /* x = 2^e * m, hence
+     y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
+       = round (2^s * 5^n * m).  */
+  s = e + n;
+  extra_zeroes = 0;
+  /* Factor out a common power of 10 if possible.  */
+  if (s > 0 && n > 0)
+    {
+      extra_zeroes = (s < n ? s : n);
+      s -= extra_zeroes;
+      n -= extra_zeroes;
+    }
+  /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes.
+     Before converting to decimal, we need to compute
+     z = round (2^s * 5^n * m).  */
+  /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same
+     sign.  2.322 is slightly larger than log(5)/log(2).  */
+  abs_n = (n >= 0 ? n : -n);
+  abs_s = (s >= 0 ? s : -s);
+  pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
+                                   + abs_s / GMP_LIMB_BITS + 1)
+                                  * sizeof (mp_limb_t));
+  if (pow5_ptr == NULL)
+    {
+      free (memory);
+      return NULL;
+    }
+  /* Initialize with 1.  */
+  pow5_ptr[0] = 1;
+  pow5_len = 1;
+  /* Multiply with 5^|n|.  */
+  if (abs_n > 0)
+    {
+      static mp_limb_t const small_pow5[13 + 1] =
+       {
+         1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
+         48828125, 244140625, 1220703125
+       };
+      unsigned int n13;
+      for (n13 = 0; n13 <= abs_n; n13 += 13)
+       {
+         mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
+         size_t j;
+         mp_twolimb_t carry = 0;
+         for (j = 0; j < pow5_len; j++)
+           {
+             mp_limb_t digit2 = pow5_ptr[j];
+             carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+             pow5_ptr[j] = (mp_limb_t) carry;
+             carry = carry >> GMP_LIMB_BITS;
+           }
+         if (carry > 0)
+           pow5_ptr[pow5_len++] = (mp_limb_t) carry;
+       }
+    }
+  s_limbs = abs_s / GMP_LIMB_BITS;
+  s_bits = abs_s % GMP_LIMB_BITS;
+  if (n >= 0 ? s >= 0 : s <= 0)
+    {
+      /* Multiply with 2^|s|.  */
+      if (s_bits > 0)
+       {
+         mp_limb_t *ptr = pow5_ptr;
+         mp_twolimb_t accu = 0;
+         size_t count;
+         for (count = pow5_len; count > 0; count--)
+           {
+             accu += (mp_twolimb_t) *ptr << s_bits;
+             *ptr++ = (mp_limb_t) accu;
+             accu = accu >> GMP_LIMB_BITS;
+           }
+         if (accu > 0)
+           {
+             *ptr = (mp_limb_t) accu;
+             pow5_len++;
+           }
+       }
+      if (s_limbs > 0)
+       {
+         size_t count;
+         for (count = pow5_len; count > 0;)
+           {
+             count--;
+             pow5_ptr[s_limbs + count] = pow5_ptr[count];
+           }
+         for (count = s_limbs; count > 0;)
+           {
+             count--;
+             pow5_ptr[count] = 0;
+           }
+         pow5_len += s_limbs;
+       }
+      pow5.limbs = pow5_ptr;
+      pow5.nlimbs = pow5_len;
+      if (n >= 0)
+       {
+         /* Multiply m with pow5.  No division needed.  */
+         z_memory = multiply (m, pow5, &z);
+       }
+      else
+       {
+         /* Divide m by pow5 and round.  */
+         z_memory = divide (m, pow5, &z);
+       }
+    }
+  else
+    {
+      pow5.limbs = pow5_ptr;
+      pow5.nlimbs = pow5_len;
+      if (n >= 0)
+       {
+         /* n >= 0, s < 0.
+            Multiply m with pow5, then divide by 2^|s|.  */
+         mpn_t numerator;
+         mpn_t denominator;
+         void *tmp_memory;
+         tmp_memory = multiply (m, pow5, &numerator);
+         if (tmp_memory == NULL)
+           {
+             free (pow5_ptr);
+             free (memory);
+             return NULL;
+           }
+         /* Construct 2^|s|.  */
+         {
+           mp_limb_t *ptr = pow5_ptr + pow5_len;
+           size_t i;
+           for (i = 0; i < s_limbs; i++)
+             ptr[i] = 0;
+           ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
+           denominator.limbs = ptr;
+           denominator.nlimbs = s_limbs + 1;
+         }
+         z_memory = divide (numerator, denominator, &z);
+         free (tmp_memory);
+       }
+      else
+       {
+         /* n < 0, s > 0.
+            Multiply m with 2^s, then divide by pow5.  */
+         mpn_t numerator;
+         mp_limb_t *num_ptr;
+         num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
+                                         * sizeof (mp_limb_t));
+         if (num_ptr == NULL)
+           {
+             free (pow5_ptr);
+             free (memory);
+             return NULL;
+           }
+         {
+           mp_limb_t *destptr = num_ptr;
+           {
+             size_t i;
+             for (i = 0; i < s_limbs; i++)
+               *destptr++ = 0;
+           }
+           if (s_bits > 0)
+             {
+               const mp_limb_t *sourceptr = m.limbs;
+               mp_twolimb_t accu = 0;
+               size_t count;
+               for (count = m.nlimbs; count > 0; count--)
+                 {
+                   accu += (mp_twolimb_t) *sourceptr++ << s;
+                   *destptr++ = (mp_limb_t) accu;
+                   accu = accu >> GMP_LIMB_BITS;
+                 }
+               if (accu > 0)
+                 *destptr++ = (mp_limb_t) accu;
+             }
+           else
+             {
+               const mp_limb_t *sourceptr = m.limbs;
+               size_t count;
+               for (count = m.nlimbs; count > 0; count--)
+                 *destptr++ = *sourceptr++;
+             }
+           numerator.limbs = num_ptr;
+           numerator.nlimbs = destptr - num_ptr;
+         }
+         z_memory = divide (numerator, pow5, &z);
+         free (num_ptr);
+       }
+    }
+  free (pow5_ptr);
+  free (memory);
+
+  /* Here y = round (x * 10^n) = z * 10^extra_zeroes.  */
+
+  if (z_memory == NULL)
+    return NULL;
+  digits = convert_to_decimal (z, extra_zeroes);
+  free (z_memory);
+  return digits;
+}
+
+/* Assuming x is finite and > 0:
+   Return an approximation for n with 10^n <= x < 10^(n+1).
+   The approximation is usually the right n, but may be off by 1 sometimes.  */
+static int
+floorlog10l (long double x)
+{
+  int exp;
+  long double y;
+  double z;
+  double l;
+
+  /* Split into exponential part and mantissa.  */
+  y = frexpl (x, &exp);
+  if (!(y >= 0.0L && y < 1.0L))
+    abort ();
+  if (y == 0.0L)
+    return INT_MIN;
+  if (y < 0.5L)
+    {
+      while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
+       {
+         y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+         exp -= GMP_LIMB_BITS;
+       }
+      if (y < (1.0L / (1 << 16)))
+       {
+         y *= 1.0L * (1 << 16);
+         exp -= 16;
+       }
+      if (y < (1.0L / (1 << 8)))
+       {
+         y *= 1.0L * (1 << 8);
+         exp -= 8;
+       }
+      if (y < (1.0L / (1 << 4)))
+       {
+         y *= 1.0L * (1 << 4);
+         exp -= 4;
+       }
+      if (y < (1.0L / (1 << 2)))
+       {
+         y *= 1.0L * (1 << 2);
+         exp -= 2;
+       }
+      if (y < (1.0L / (1 << 1)))
+       {
+         y *= 1.0L * (1 << 1);
+         exp -= 1;
+       }
+    }
+  if (!(y >= 0.5L && y < 1.0L))
+    abort ();
+  /* Compute an approximation for l = log2(x) = exp + log2(y).  */
+  l = exp;
+  z = y;
+  if (z < 0.70710678118654752444)
+    {
+      z *= 1.4142135623730950488;
+      l -= 0.5;
+    }
+  if (z < 0.8408964152537145431)
+    {
+      z *= 1.1892071150027210667;
+      l -= 0.25;
+    }
+  if (z < 0.91700404320467123175)
+    {
+      z *= 1.0905077326652576592;
+      l -= 0.125;
+    }
+  if (z < 0.9576032806985736469)
+    {
+      z *= 1.0442737824274138403;
+      l -= 0.0625;
+    }
+  /* Now 0.95 <= z <= 1.01.  */
+  z = 1 - z;
+  /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ...
+     Four terms are enough to get an approximation with error < 10^-7.  */
+  l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+  /* Finally multiply with log(2)/log(10), yields an approximation for
+     log10(x).  */
+  l *= 0.30102999566398119523;
+  /* Round down to the next integer.  */
+  return (int) l + (l < 0 ? -1 : 0);
+}
+
 #endif
 
-CHAR_T *
-VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
+DCHAR_T *
+VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+           const FCHAR_T *format, va_list args)
 {
   DIRECTIVES d;
   arguments a;
@@ -120,7 +1206,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
   if (a.arg)                                                           \
     free (a.arg);
 
-  if (printf_fetchargs (args, &a) < 0)
+  if (PRINTF_FETCHARGS (args, &a) < 0)
     {
       CLEANUP ();
       errno = EINVAL;
@@ -129,13 +1215,13 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
 
   {
     size_t buf_neededlength;
-    CHAR_T *buf;
-    CHAR_T *buf_malloced;
-    const CHAR_T *cp;
+    TCHAR_T *buf;
+    TCHAR_T *buf_malloced;
+    const FCHAR_T *cp;
     size_t i;
     DIRECTIVE *dp;
     /* Output string accumulator.  */
-    CHAR_T *result;
+    DCHAR_T *result;
     size_t allocated;
     size_t length;
 
@@ -144,158 +1230,1812 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
     buf_neededlength =
       xsum4 (7, d.max_width_length, d.max_precision_length, 6);
 #if HAVE_ALLOCA
-    if (buf_neededlength < 4000 / sizeof (CHAR_T))
+    if (buf_neededlength < 4000 / sizeof (TCHAR_T))
       {
-       buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
+       buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
        buf_malloced = NULL;
       }
     else
 #endif
       {
-       size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
+       size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
        if (size_overflow_p (buf_memsize))
          goto out_of_memory_1;
-       buf = (CHAR_T *) malloc (buf_memsize);
+       buf = (TCHAR_T *) malloc (buf_memsize);
        if (buf == NULL)
          goto out_of_memory_1;
        buf_malloced = buf;
       }
 
-    if (resultbuf != NULL)
-      {
-       result = resultbuf;
-       allocated = *lengthp;
-      }
-    else
-      {
-       result = NULL;
-       allocated = 0;
-      }
-    length = 0;
-    /* Invariants:
-       result is either == resultbuf or == NULL or malloc-allocated.
-       If length > 0, then result != NULL.  */
+    if (resultbuf != NULL)
+      {
+       result = resultbuf;
+       allocated = *lengthp;
+      }
+    else
+      {
+       result = NULL;
+       allocated = 0;
+      }
+    length = 0;
+    /* Invariants:
+       result is either == resultbuf or == NULL or malloc-allocated.
+       If length > 0, then result != NULL.  */
+
+    /* Ensures that allocated >= needed.  Aborts through a jump to
+       out_of_memory if needed is SIZE_MAX or otherwise too big.  */
+#define ENSURE_ALLOCATION(needed) \
+    if ((needed) > allocated)                                               \
+      {                                                                             \
+       size_t memory_size;                                                  \
+       DCHAR_T *memory;                                                     \
+                                                                            \
+       allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
+       if ((needed) > allocated)                                            \
+         allocated = (needed);                                              \
+       memory_size = xtimes (allocated, sizeof (DCHAR_T));                  \
+       if (size_overflow_p (memory_size))                                   \
+         goto out_of_memory;                                                \
+       if (result == resultbuf || result == NULL)                           \
+         memory = (DCHAR_T *) malloc (memory_size);                         \
+       else                                                                 \
+         memory = (DCHAR_T *) realloc (result, memory_size);                \
+       if (memory == NULL)                                                  \
+         goto out_of_memory;                                                \
+       if (result == resultbuf && length > 0)                               \
+         DCHAR_CPY (memory, result, length);                                \
+       result = memory;                                                     \
+      }
+
+    for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+      {
+       if (cp != dp->dir_start)
+         {
+           size_t n = dp->dir_start - cp;
+           size_t augmented_length = xsum (length, n);
+
+           ENSURE_ALLOCATION (augmented_length);
+           /* This copies a piece of FCHAR_T[] into a DCHAR_T[].  Here we
+              need that the format string contains only ASCII characters
+              if FCHAR_T and DCHAR_T are not the same type.  */
+           if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
+             {
+               DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
+               length = augmented_length;
+             }
+           else
+             {
+               do
+                 result[length++] = (unsigned char) *cp++;
+               while (--n > 0);
+             }
+         }
+       if (i == d.count)
+         break;
+
+       /* Execute a single directive.  */
+       if (dp->conversion == '%')
+         {
+           size_t augmented_length;
+
+           if (!(dp->arg_index == ARG_NONE))
+             abort ();
+           augmented_length = xsum (length, 1);
+           ENSURE_ALLOCATION (augmented_length);
+           result[length] = '%';
+           length = augmented_length;
+         }
+       else
+         {
+           if (!(dp->arg_index != ARG_NONE))
+             abort ();
+
+           if (dp->conversion == 'n')
+             {
+               switch (a.arg[dp->arg_index].type)
+                 {
+                 case TYPE_COUNT_SCHAR_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+                   break;
+                 case TYPE_COUNT_SHORT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+                   break;
+                 case TYPE_COUNT_INT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+                   break;
+                 case TYPE_COUNT_LONGINT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+                   break;
+#if HAVE_LONG_LONG_INT
+                 case TYPE_COUNT_LONGLONGINT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+                   break;
+#endif
+                 default:
+                   abort ();
+                 }
+             }
+#if ENABLE_UNISTDIO
+           /* The unistdio extensions.  */
+           else if (dp->conversion == 'U')
+             {
+               arg_type type = a.arg[dp->arg_index].type;
+               int flags = dp->flags;
+               int has_width;
+               size_t width;
+               int has_precision;
+               size_t precision;
+
+               has_width = 0;
+               width = 0;
+               if (dp->width_start != dp->width_end)
+                 {
+                   if (dp->width_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->width_arg_index].a.a_int;
+                       if (arg < 0)
+                         {
+                           /* "A negative field width is taken as a '-' flag
+                               followed by a positive field width."  */
+                           flags |= FLAG_LEFT;
+                           width = (unsigned int) (-arg);
+                         }
+                       else
+                         width = arg;
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->width_start;
+
+                       do
+                         width = xsum (xtimes (width, 10), *digitp++ - '0');
+                       while (digitp != dp->width_end);
+                     }
+                   has_width = 1;
+                 }
+
+               has_precision = 0;
+               precision = 0;
+               if (dp->precision_start != dp->precision_end)
+                 {
+                   if (dp->precision_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->precision_arg_index].a.a_int;
+                       /* "A negative precision is taken as if the precision
+                           were omitted."  */
+                       if (arg >= 0)
+                         {
+                           precision = arg;
+                           has_precision = 1;
+                         }
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->precision_start + 1;
+
+                       precision = 0;
+                       while (digitp != dp->precision_end)
+                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                       has_precision = 1;
+                     }
+                 }
+
+               switch (type)
+                 {
+                 case TYPE_U8_STRING:
+                   {
+                     const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
+                     const uint8_t *arg_end;
+                     size_t characters;
+
+                     if (has_precision)
+                       {
+                         /* Use only PRECISION characters, from the left.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (; precision > 0; precision--)
+                           {
+                             int count = u8_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else if (has_width)
+                       {
+                         /* Use the entire string, and count the number of
+                            characters.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (;;)
+                           {
+                             int count = u8_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else
+                       {
+                         /* Use the entire string.  */
+                         arg_end = arg + u8_strlen (arg);
+                         /* The number of characters doesn't matter.  */
+                         characters = 0;
+                       }
+
+                     if (has_width && width > characters
+                         && !(dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+
+# if DCHAR_IS_UINT8_T
+                     {
+                       size_t n = arg_end - arg;
+                       ENSURE_ALLOCATION (xsum (length, n));
+                       DCHAR_CPY (result + length, arg, n);
+                       length += n;
+                     }
+# else
+                     { /* Convert.  */
+                       DCHAR_T *converted = result + length;
+                       size_t converted_len = allocated - length;
+#  if DCHAR_IS_TCHAR
+                       /* Convert from UTF-8 to locale encoding.  */
+                       if (u8_conv_to_encoding (locale_charset (),
+                                                iconveh_question_mark,
+                                                arg, arg_end - arg, NULL,
+                                                &converted, &converted_len)
+                           < 0)
+#  else
+                       /* Convert from UTF-8 to UTF-16/UTF-32.  */
+                       converted =
+                         U8_TO_DCHAR (arg, arg_end - arg,
+                                      converted, &converted_len);
+                       if (converted == NULL)
+#  endif
+                         {
+                           int saved_errno = errno;
+                           if (!(result == resultbuf || result == NULL))
+                             free (result);
+                           if (buf_malloced != NULL)
+                             free (buf_malloced);
+                           CLEANUP ();
+                           errno = saved_errno;
+                           return NULL;
+                         }
+                       if (converted != result + length)
+                         {
+                           ENSURE_ALLOCATION (xsum (length, converted_len));
+                           DCHAR_CPY (result + length, converted, converted_len);
+                           free (converted);
+                         }
+                       length += converted_len;
+                     }
+# endif
+
+                     if (has_width && width > characters
+                         && (dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+                   }
+                   break;
+
+                 case TYPE_U16_STRING:
+                   {
+                     const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
+                     const uint16_t *arg_end;
+                     size_t characters;
+
+                     if (has_precision)
+                       {
+                         /* Use only PRECISION characters, from the left.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (; precision > 0; precision--)
+                           {
+                             int count = u16_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else if (has_width)
+                       {
+                         /* Use the entire string, and count the number of
+                            characters.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (;;)
+                           {
+                             int count = u16_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else
+                       {
+                         /* Use the entire string.  */
+                         arg_end = arg + u16_strlen (arg);
+                         /* The number of characters doesn't matter.  */
+                         characters = 0;
+                       }
+
+                     if (has_width && width > characters
+                         && !(dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+
+# if DCHAR_IS_UINT16_T
+                     {
+                       size_t n = arg_end - arg;
+                       ENSURE_ALLOCATION (xsum (length, n));
+                       DCHAR_CPY (result + length, arg, n);
+                       length += n;
+                     }
+# else
+                     { /* Convert.  */
+                       DCHAR_T *converted = result + length;
+                       size_t converted_len = allocated - length;
+#  if DCHAR_IS_TCHAR
+                       /* Convert from UTF-16 to locale encoding.  */
+                       if (u16_conv_to_encoding (locale_charset (),
+                                                 iconveh_question_mark,
+                                                 arg, arg_end - arg, NULL,
+                                                 &converted, &converted_len)
+                           < 0)
+#  else
+                       /* Convert from UTF-16 to UTF-8/UTF-32.  */
+                       converted =
+                         U16_TO_DCHAR (arg, arg_end - arg,
+                                       converted, &converted_len);
+                       if (converted == NULL)
+#  endif
+                         {
+                           int saved_errno = errno;
+                           if (!(result == resultbuf || result == NULL))
+                             free (result);
+                           if (buf_malloced != NULL)
+                             free (buf_malloced);
+                           CLEANUP ();
+                           errno = saved_errno;
+                           return NULL;
+                         }
+                       if (converted != result + length)
+                         {
+                           ENSURE_ALLOCATION (xsum (length, converted_len));
+                           DCHAR_CPY (result + length, converted, converted_len);
+                           free (converted);
+                         }
+                       length += converted_len;
+                     }
+# endif
+
+                     if (has_width && width > characters
+                         && (dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+                   }
+                   break;
+
+                 case TYPE_U32_STRING:
+                   {
+                     const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
+                     const uint32_t *arg_end;
+                     size_t characters;
+
+                     if (has_precision)
+                       {
+                         /* Use only PRECISION characters, from the left.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (; precision > 0; precision--)
+                           {
+                             int count = u32_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else if (has_width)
+                       {
+                         /* Use the entire string, and count the number of
+                            characters.  */
+                         arg_end = arg;
+                         characters = 0;
+                         for (;;)
+                           {
+                             int count = u32_strmblen (arg_end);
+                             if (count == 0)
+                               break;
+                             if (count < 0)
+                               {
+                                 if (!(result == resultbuf || result == NULL))
+                                   free (result);
+                                 if (buf_malloced != NULL)
+                                   free (buf_malloced);
+                                 CLEANUP ();
+                                 errno = EILSEQ;
+                                 return NULL;
+                               }
+                             arg_end += count;
+                             characters++;
+                           }
+                       }
+                     else
+                       {
+                         /* Use the entire string.  */
+                         arg_end = arg + u32_strlen (arg);
+                         /* The number of characters doesn't matter.  */
+                         characters = 0;
+                       }
+
+                     if (has_width && width > characters
+                         && !(dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+
+# if DCHAR_IS_UINT32_T
+                     {
+                       size_t n = arg_end - arg;
+                       ENSURE_ALLOCATION (xsum (length, n));
+                       DCHAR_CPY (result + length, arg, n);
+                       length += n;
+                     }
+# else
+                     { /* Convert.  */
+                       DCHAR_T *converted = result + length;
+                       size_t converted_len = allocated - length;
+#  if DCHAR_IS_TCHAR
+                       /* Convert from UTF-32 to locale encoding.  */
+                       if (u32_conv_to_encoding (locale_charset (),
+                                                 iconveh_question_mark,
+                                                 arg, arg_end - arg, NULL,
+                                                 &converted, &converted_len)
+                           < 0)
+#  else
+                       /* Convert from UTF-32 to UTF-8/UTF-16.  */
+                       converted =
+                         U32_TO_DCHAR (arg, arg_end - arg,
+                                       converted, &converted_len);
+                       if (converted == NULL)
+#  endif
+                         {
+                           int saved_errno = errno;
+                           if (!(result == resultbuf || result == NULL))
+                             free (result);
+                           if (buf_malloced != NULL)
+                             free (buf_malloced);
+                           CLEANUP ();
+                           errno = saved_errno;
+                           return NULL;
+                         }
+                       if (converted != result + length)
+                         {
+                           ENSURE_ALLOCATION (xsum (length, converted_len));
+                           DCHAR_CPY (result + length, converted, converted_len);
+                           free (converted);
+                         }
+                       length += converted_len;
+                     }
+# endif
+
+                     if (has_width && width > characters
+                         && (dp->flags & FLAG_LEFT))
+                       {
+                         size_t n = width - characters;
+                         ENSURE_ALLOCATION (xsum (length, n));
+                         DCHAR_SET (result + length, ' ', n);
+                         length += n;
+                       }
+                   }
+                   break;
+
+                 default:
+                   abort ();
+                 }
+             }
+#endif
+#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL
+           else if (dp->conversion == 'a' || dp->conversion == 'A')
+             {
+               arg_type type = a.arg[dp->arg_index].type;
+               int flags = dp->flags;
+               int has_width;
+               size_t width;
+               int has_precision;
+               size_t precision;
+               size_t tmp_length;
+               DCHAR_T tmpbuf[700];
+               DCHAR_T *tmp;
+               DCHAR_T *pad_ptr;
+               DCHAR_T *p;
+
+               has_width = 0;
+               width = 0;
+               if (dp->width_start != dp->width_end)
+                 {
+                   if (dp->width_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->width_arg_index].a.a_int;
+                       if (arg < 0)
+                         {
+                           /* "A negative field width is taken as a '-' flag
+                               followed by a positive field width."  */
+                           flags |= FLAG_LEFT;
+                           width = (unsigned int) (-arg);
+                         }
+                       else
+                         width = arg;
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->width_start;
+
+                       do
+                         width = xsum (xtimes (width, 10), *digitp++ - '0');
+                       while (digitp != dp->width_end);
+                     }
+                   has_width = 1;
+                 }
+
+               has_precision = 0;
+               precision = 0;
+               if (dp->precision_start != dp->precision_end)
+                 {
+                   if (dp->precision_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->precision_arg_index].a.a_int;
+                       /* "A negative precision is taken as if the precision
+                           were omitted."  */
+                       if (arg >= 0)
+                         {
+                           precision = arg;
+                           has_precision = 1;
+                         }
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->precision_start + 1;
+
+                       precision = 0;
+                       while (digitp != dp->precision_end)
+                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                       has_precision = 1;
+                     }
+                 }
+
+               /* Allocate a temporary buffer of sufficient size.  */
+               if (type == TYPE_LONGDOUBLE)
+                 tmp_length =
+                   (unsigned int) ((LDBL_DIG + 1)
+                                   * 0.831 /* decimal -> hexadecimal */
+                                  )
+                   + 1; /* turn floor into ceil */
+               else
+                 tmp_length =
+                   (unsigned int) ((DBL_DIG + 1)
+                                   * 0.831 /* decimal -> hexadecimal */
+                                  )
+                   + 1; /* turn floor into ceil */
+               if (tmp_length < precision)
+                 tmp_length = precision;
+               /* Account for sign, decimal point etc. */
+               tmp_length = xsum (tmp_length, 12);
+
+               if (tmp_length < width)
+                 tmp_length = width;
+
+               tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+               if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+                 tmp = tmpbuf;
+               else
+                 {
+                   size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+                   if (size_overflow_p (tmp_memsize))
+                     /* Overflow, would lead to out of memory.  */
+                     goto out_of_memory;
+                   tmp = (DCHAR_T *) malloc (tmp_memsize);
+                   if (tmp == NULL)
+                     /* Out of memory.  */
+                     goto out_of_memory;
+                 }
+
+               pad_ptr = NULL;
+               p = tmp;
+               if (type == TYPE_LONGDOUBLE)
+                 {
+                   long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+                   if (isnanl (arg))
+                     {
+                       if (dp->conversion == 'A')
+                         {
+                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                         }
+                       else
+                         {
+                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                         }
+                     }
+                   else
+                     {
+                       int sign = 0;
+                       DECL_LONG_DOUBLE_ROUNDING
+
+                       BEGIN_LONG_DOUBLE_ROUNDING ();
+
+                       if (signbit (arg)) /* arg < 0.0L or negative zero */
+                         {
+                           sign = -1;
+                           arg = -arg;
+                         }
+
+                       if (sign < 0)
+                         *p++ = '-';
+                       else if (flags & FLAG_SHOWSIGN)
+                         *p++ = '+';
+                       else if (flags & FLAG_SPACE)
+                         *p++ = ' ';
+
+                       if (arg > 0.0L && arg + arg == arg)
+                         {
+                           if (dp->conversion == 'A')
+                             {
+                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                             }
+                           else
+                             {
+                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                             }
+                         }
+                       else
+                         {
+                           int exponent;
+                           long double mantissa;
+
+                           if (arg > 0.0L)
+                             mantissa = printf_frexpl (arg, &exponent);
+                           else
+                             {
+                               exponent = 0;
+                               mantissa = 0.0L;
+                             }
+
+                           if (has_precision
+                               && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
+                             {
+                               /* Round the mantissa.  */
+                               long double tail = mantissa;
+                               size_t q;
+
+                               for (q = precision; ; q--)
+                                 {
+                                   int digit = (int) tail;
+                                   tail -= digit;
+                                   if (q == 0)
+                                     {
+                                       if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
+                                         tail = 1 - tail;
+                                       else
+                                         tail = - tail;
+                                       break;
+                                     }
+                                   tail *= 16.0L;
+                                 }
+                               if (tail != 0.0L)
+                                 for (q = precision; q > 0; q--)
+                                   tail *= 0.0625L;
+                               mantissa += tail;
+                             }
+
+                           *p++ = '0';
+                           *p++ = dp->conversion - 'A' + 'X';
+                           pad_ptr = p;
+                           {
+                             int digit;
+
+                             digit = (int) mantissa;
+                             mantissa -= digit;
+                             *p++ = '0' + digit;
+                             if ((flags & FLAG_ALT)
+                                 || mantissa > 0.0L || precision > 0)
+                               {
+                                 *p++ = decimal_point_char ();
+                                 /* This loop terminates because we assume
+                                    that FLT_RADIX is a power of 2.  */
+                                 while (mantissa > 0.0L)
+                                   {
+                                     mantissa *= 16.0L;
+                                     digit = (int) mantissa;
+                                     mantissa -= digit;
+                                     *p++ = digit
+                                            + (digit < 10
+                                               ? '0'
+                                               : dp->conversion - 10);
+                                     if (precision > 0)
+                                       precision--;
+                                   }
+                                 while (precision > 0)
+                                   {
+                                     *p++ = '0';
+                                     precision--;
+                                   }
+                               }
+                             }
+                             *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+                             {
+                               static const wchar_t decimal_format[] =
+                                 { '%', '+', 'd', '\0' };
+                               SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                             }
+                             while (*p != '\0')
+                               p++;
+# else
+                             if (sizeof (DCHAR_T) == 1)
+                               {
+                                 sprintf ((char *) p, "%+d", exponent);
+                                 while (*p != '\0')
+                                   p++;
+                               }
+                             else
+                               {
+                                 char expbuf[6 + 1];
+                                 const char *ep;
+                                 sprintf (expbuf, "%+d", exponent);
+                                 for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                   p++;
+                               }
+# endif
+                         }
+
+                       END_LONG_DOUBLE_ROUNDING ();
+                     }
+                 }
+               else
+                 {
+                   double arg = a.arg[dp->arg_index].a.a_double;
+
+                   if (isnan (arg))
+                     {
+                       if (dp->conversion == 'A')
+                         {
+                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                         }
+                       else
+                         {
+                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                         }
+                     }
+                   else
+                     {
+                       int sign = 0;
+
+                       if (signbit (arg)) /* arg < 0.0 or negative zero */
+                         {
+                           sign = -1;
+                           arg = -arg;
+                         }
+
+                       if (sign < 0)
+                         *p++ = '-';
+                       else if (flags & FLAG_SHOWSIGN)
+                         *p++ = '+';
+                       else if (flags & FLAG_SPACE)
+                         *p++ = ' ';
+
+                       if (arg > 0.0 && arg + arg == arg)
+                         {
+                           if (dp->conversion == 'A')
+                             {
+                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                             }
+                           else
+                             {
+                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                             }
+                         }
+                       else
+                         {
+                           int exponent;
+                           double mantissa;
+
+                           if (arg > 0.0)
+                             mantissa = printf_frexp (arg, &exponent);
+                           else
+                             {
+                               exponent = 0;
+                               mantissa = 0.0;
+                             }
+
+                           if (has_precision
+                               && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
+                             {
+                               /* Round the mantissa.  */
+                               double tail = mantissa;
+                               size_t q;
+
+                               for (q = precision; ; q--)
+                                 {
+                                   int digit = (int) tail;
+                                   tail -= digit;
+                                   if (q == 0)
+                                     {
+                                       if (digit & 1 ? tail >= 0.5 : tail > 0.5)
+                                         tail = 1 - tail;
+                                       else
+                                         tail = - tail;
+                                       break;
+                                     }
+                                   tail *= 16.0;
+                                 }
+                               if (tail != 0.0)
+                                 for (q = precision; q > 0; q--)
+                                   tail *= 0.0625;
+                               mantissa += tail;
+                             }
+
+                           *p++ = '0';
+                           *p++ = dp->conversion - 'A' + 'X';
+                           pad_ptr = p;
+                           {
+                             int digit;
+
+                             digit = (int) mantissa;
+                             mantissa -= digit;
+                             *p++ = '0' + digit;
+                             if ((flags & FLAG_ALT)
+                                 || mantissa > 0.0 || precision > 0)
+                               {
+                                 *p++ = decimal_point_char ();
+                                 /* This loop terminates because we assume
+                                    that FLT_RADIX is a power of 2.  */
+                                 while (mantissa > 0.0)
+                                   {
+                                     mantissa *= 16.0;
+                                     digit = (int) mantissa;
+                                     mantissa -= digit;
+                                     *p++ = digit
+                                            + (digit < 10
+                                               ? '0'
+                                               : dp->conversion - 10);
+                                     if (precision > 0)
+                                       precision--;
+                                   }
+                                 while (precision > 0)
+                                   {
+                                     *p++ = '0';
+                                     precision--;
+                                   }
+                               }
+                             }
+                             *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+                             {
+                               static const wchar_t decimal_format[] =
+                                 { '%', '+', 'd', '\0' };
+                               SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                             }
+                             while (*p != '\0')
+                               p++;
+# else
+                             if (sizeof (DCHAR_T) == 1)
+                               {
+                                 sprintf ((char *) p, "%+d", exponent);
+                                 while (*p != '\0')
+                                   p++;
+                               }
+                             else
+                               {
+                                 char expbuf[6 + 1];
+                                 const char *ep;
+                                 sprintf (expbuf, "%+d", exponent);
+                                 for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                   p++;
+                               }
+# endif
+                         }
+                     }
+                 }
+               /* The generated string now extends from tmp to p, with the
+                  zero padding insertion point being at pad_ptr.  */
+               if (has_width && p - tmp < width)
+                 {
+                   size_t pad = width - (p - tmp);
+                   DCHAR_T *end = p + pad;
+
+                   if (flags & FLAG_LEFT)
+                     {
+                       /* Pad with spaces on the right.  */
+                       for (; pad > 0; pad--)
+                         *p++ = ' ';
+                     }
+                   else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                     {
+                       /* Pad with zeroes.  */
+                       DCHAR_T *q = end;
+
+                       while (p > pad_ptr)
+                         *--q = *--p;
+                       for (; pad > 0; pad--)
+                         *p++ = '0';
+                     }
+                   else
+                     {
+                       /* Pad with spaces on the left.  */
+                       DCHAR_T *q = end;
+
+                       while (p > tmp)
+                         *--q = *--p;
+                       for (; pad > 0; pad--)
+                         *p++ = ' ';
+                     }
+
+                   p = end;
+                 }
+
+               {
+                 size_t count = p - tmp;
+
+                 if (count >= tmp_length)
+                   /* tmp_length was incorrectly calculated - fix the
+                      code above!  */
+                   abort ();
+
+                 /* Make room for the result.  */
+                 if (count >= allocated - length)
+                   {
+                     size_t n = xsum (length, count);
+
+                     ENSURE_ALLOCATION (n);
+                   }
+
+                 /* Append the result.  */
+                 memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+                 if (tmp != tmpbuf)
+                   free (tmp);
+                 length += count;
+               }
+             }
+#endif
+#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+           else if ((dp->conversion == 'f' || dp->conversion == 'F'
+                     || dp->conversion == 'e' || dp->conversion == 'E'
+                     || dp->conversion == 'g' || dp->conversion == 'G'
+                     || dp->conversion == 'a' || dp->conversion == 'A')
+                    && (0
+# if NEED_PRINTF_INFINITE_DOUBLE
+                        || (a.arg[dp->arg_index].type == TYPE_DOUBLE
+                            /* The systems (mingw) which produce wrong output
+                               for Inf, -Inf, and NaN also do so for -0.0.
+                               Therefore we treat this case here as well.  */
+                            && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
+# endif
+# if NEED_PRINTF_LONG_DOUBLE
+                        || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
+                        || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+                            /* Some systems produce wrong output for Inf,
+                               -Inf, and NaN.  */
+                            && is_infinitel (a.arg[dp->arg_index].a.a_longdouble))
+# endif
+                       ))
+             {
+# if NEED_PRINTF_INFINITE_DOUBLE && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
+               arg_type type = a.arg[dp->arg_index].type;
+# endif
+               int flags = dp->flags;
+               int has_width;
+               size_t width;
+               int has_precision;
+               size_t precision;
+               size_t tmp_length;
+               DCHAR_T tmpbuf[700];
+               DCHAR_T *tmp;
+               DCHAR_T *pad_ptr;
+               DCHAR_T *p;
+
+               has_width = 0;
+               width = 0;
+               if (dp->width_start != dp->width_end)
+                 {
+                   if (dp->width_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->width_arg_index].a.a_int;
+                       if (arg < 0)
+                         {
+                           /* "A negative field width is taken as a '-' flag
+                               followed by a positive field width."  */
+                           flags |= FLAG_LEFT;
+                           width = (unsigned int) (-arg);
+                         }
+                       else
+                         width = arg;
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->width_start;
+
+                       do
+                         width = xsum (xtimes (width, 10), *digitp++ - '0');
+                       while (digitp != dp->width_end);
+                     }
+                   has_width = 1;
+                 }
+
+               has_precision = 0;
+               precision = 0;
+               if (dp->precision_start != dp->precision_end)
+                 {
+                   if (dp->precision_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->precision_arg_index].a.a_int;
+                       /* "A negative precision is taken as if the precision
+                           were omitted."  */
+                       if (arg >= 0)
+                         {
+                           precision = arg;
+                           has_precision = 1;
+                         }
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->precision_start + 1;
+
+                       precision = 0;
+                       while (digitp != dp->precision_end)
+                         precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                       has_precision = 1;
+                     }
+                 }
+
+               /* POSIX specifies the default precision to be 6 for %f, %F,
+                  %e, %E, but not for %g, %G.  Implementations appear to use
+                  the same default precision also for %g, %G.  */
+               if (!has_precision)
+                 precision = 6;
+
+               /* Allocate a temporary buffer of sufficient size.  */
+# if NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
+               tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
+# elif NEED_PRINTF_LONG_DOUBLE
+               tmp_length = LDBL_DIG + 1;
+# else
+               tmp_length = 0;
+# endif
+               if (tmp_length < precision)
+                 tmp_length = precision;
+# if NEED_PRINTF_LONG_DOUBLE
+#  if NEED_PRINTF_INFINITE_DOUBLE
+               if (type == TYPE_LONGDOUBLE)
+#  endif
+                 if (dp->conversion == 'f' || dp->conversion == 'F')
+                   {
+                     long double arg = a.arg[dp->arg_index].a.a_longdouble;
+                     if (!(isnanl (arg) || arg + arg == arg))
+                       {
+                         /* arg is finite and nonzero.  */
+                         int exponent = floorlog10l (arg < 0 ? -arg : arg);
+                         if (exponent >= 0 && tmp_length < exponent + precision)
+                           tmp_length = exponent + precision;
+                       }
+                   }
+# endif
+               /* Account for sign, decimal point etc. */
+               tmp_length = xsum (tmp_length, 12);
+
+               if (tmp_length < width)
+                 tmp_length = width;
+
+               tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+               if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+                 tmp = tmpbuf;
+               else
+                 {
+                   size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+                   if (size_overflow_p (tmp_memsize))
+                     /* Overflow, would lead to out of memory.  */
+                     goto out_of_memory;
+                   tmp = (DCHAR_T *) malloc (tmp_memsize);
+                   if (tmp == NULL)
+                     /* Out of memory.  */
+                     goto out_of_memory;
+                 }
+
+               pad_ptr = NULL;
+               p = tmp;
+
+# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
+#  if NEED_PRINTF_INFINITE_DOUBLE
+               if (type == TYPE_LONGDOUBLE)
+#  endif
+                 {
+                   long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+                   if (isnanl (arg))
+                     {
+                       if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                         {
+                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                         }
+                       else
+                         {
+                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                         }
+                     }
+                   else
+                     {
+                       int sign = 0;
+                       DECL_LONG_DOUBLE_ROUNDING
+
+                       BEGIN_LONG_DOUBLE_ROUNDING ();
+
+                       if (signbit (arg)) /* arg < 0.0L or negative zero */
+                         {
+                           sign = -1;
+                           arg = -arg;
+                         }
+
+                       if (sign < 0)
+                         *p++ = '-';
+                       else if (flags & FLAG_SHOWSIGN)
+                         *p++ = '+';
+                       else if (flags & FLAG_SPACE)
+                         *p++ = ' ';
+
+                       if (arg > 0.0L && arg + arg == arg)
+                         {
+                           if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                             {
+                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                             }
+                           else
+                             {
+                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                             }
+                         }
+                       else
+                         {
+#  if NEED_PRINTF_LONG_DOUBLE
+                           pad_ptr = p;
+
+                           if (dp->conversion == 'f' || dp->conversion == 'F')
+                             {
+                               char *digits;
+                               size_t ndigits;
+
+                               digits =
+                                 scale10_round_decimal_long_double (arg, precision);
+                               if (digits == NULL)
+                                 {
+                                   END_LONG_DOUBLE_ROUNDING ();
+                                   goto out_of_memory;
+                                 }
+                               ndigits = strlen (digits);
+
+                               if (ndigits > precision)
+                                 do
+                                   {
+                                     --ndigits;
+                                     *p++ = digits[ndigits];
+                                   }
+                                 while (ndigits > precision);
+                               else
+                                 *p++ = '0';
+                               /* Here ndigits <= precision.  */
+                               if ((flags & FLAG_ALT) || precision > 0)
+                                 {
+                                   *p++ = decimal_point_char ();
+                                   for (; precision > ndigits; precision--)
+                                     *p++ = '0';
+                                   while (ndigits > 0)
+                                     {
+                                       --ndigits;
+                                       *p++ = digits[ndigits];
+                                     }
+                                 }
+
+                               free (digits);
+                             }
+                           else if (dp->conversion == 'e' || dp->conversion == 'E')
+                             {
+                               int exponent;
+
+                               if (arg == 0.0L)
+                                 {
+                                   exponent = 0;
+                                   *p++ = '0';
+                                   if ((flags & FLAG_ALT) || precision > 0)
+                                     {
+                                       *p++ = decimal_point_char ();
+                                       for (; precision > 0; precision--)
+                                         *p++ = '0';
+                                     }
+                                 }
+                               else
+                                 {
+                                   /* arg > 0.0L.  */
+                                   int adjusted;
+                                   char *digits;
+                                   size_t ndigits;
+
+                                   exponent = floorlog10l (arg);
+                                   adjusted = 0;
+                                   for (;;)
+                                     {
+                                       digits =
+                                         scale10_round_decimal_long_double (arg,
+                                                                            (int)precision - exponent);
+                                       if (digits == NULL)
+                                         {
+                                           END_LONG_DOUBLE_ROUNDING ();
+                                           goto out_of_memory;
+                                         }
+                                       ndigits = strlen (digits);
+
+                                       if (ndigits == precision + 1)
+                                         break;
+                                       if (ndigits < precision
+                                           || ndigits > precision + 2)
+                                         /* The exponent was not guessed
+                                            precisely enough.  */
+                                         abort ();
+                                       if (adjusted)
+                                         /* None of two values of exponent is
+                                            the right one.  Prevent an endless
+                                            loop.  */
+                                         abort ();
+                                       free (digits);
+                                       if (ndigits == precision)
+                                         exponent -= 1;
+                                       else
+                                         exponent += 1;
+                                       adjusted = 1;
+                                     }
+
+                                   /* Here ndigits = precision+1.  */
+                                   *p++ = digits[--ndigits];
+                                   if ((flags & FLAG_ALT) || precision > 0)
+                                     {
+                                       *p++ = decimal_point_char ();
+                                       while (ndigits > 0)
+                                         {
+                                           --ndigits;
+                                           *p++ = digits[ndigits];
+                                         }
+                                     }
+
+                                   free (digits);
+                                 }
+
+                               *p++ = dp->conversion; /* 'e' or 'E' */
+#   if WIDE_CHAR_VERSION
+                               {
+                                 static const wchar_t decimal_format[] =
+                                   { '%', '+', '.', '2', 'd', '\0' };
+                                 SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                               }
+                               while (*p != '\0')
+                                 p++;
+#   else
+                               if (sizeof (DCHAR_T) == 1)
+                                 {
+                                   sprintf ((char *) p, "%+.2d", exponent);
+                                   while (*p != '\0')
+                                     p++;
+                                 }
+                               else
+                                 {
+                                   char expbuf[6 + 1];
+                                   const char *ep;
+                                   sprintf (expbuf, "%+.2d", exponent);
+                                   for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                     p++;
+                                 }
+#   endif
+                             }
+                           else if (dp->conversion == 'g' || dp->conversion == 'G')
+                             {
+                               if (precision == 0)
+                                 precision = 1;
+                               /* precision >= 1.  */
+
+                               if (arg == 0.0L)
+                                 /* The exponent is 0, >= -4, < precision.
+                                    Use fixed-point notation.  */
+                                 {
+                                   size_t ndigits = precision;
+                                   /* Number of trailing zeroes that have to be
+                                      dropped.  */
+                                   size_t nzeroes =
+                                     (flags & FLAG_ALT ? 0 : precision - 1);
+
+                                   --ndigits;
+                                   *p++ = '0';
+                                   if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                     {
+                                       *p++ = decimal_point_char ();
+                                       while (ndigits > nzeroes)
+                                         {
+                                           --ndigits;
+                                           *p++ = '0';
+                                         }
+                                     }
+                                 }
+                               else
+                                 {
+                                   /* arg > 0.0L.  */
+                                   int exponent;
+                                   int adjusted;
+                                   char *digits;
+                                   size_t ndigits;
+                                   size_t nzeroes;
+
+                                   exponent = floorlog10l (arg);
+                                   adjusted = 0;
+                                   for (;;)
+                                     {
+                                       digits =
+                                         scale10_round_decimal_long_double (arg,
+                                                                            (int)(precision - 1) - exponent);
+                                       if (digits == NULL)
+                                         {
+                                           END_LONG_DOUBLE_ROUNDING ();
+                                           goto out_of_memory;
+                                         }
+                                       ndigits = strlen (digits);
+
+                                       if (ndigits == precision)
+                                         break;
+                                       if (ndigits < precision - 1
+                                           || ndigits > precision + 1)
+                                         /* The exponent was not guessed
+                                            precisely enough.  */
+                                         abort ();
+                                       if (adjusted)
+                                         /* None of two values of exponent is
+                                            the right one.  Prevent an endless
+                                            loop.  */
+                                         abort ();
+                                       free (digits);
+                                       if (ndigits < precision)
+                                         exponent -= 1;
+                                       else
+                                         exponent += 1;
+                                       adjusted = 1;
+                                     }
+                                   /* Here ndigits = precision.  */
+
+                                   /* Determine the number of trailing zeroes
+                                      that have to be dropped.  */
+                                   nzeroes = 0;
+                                   if ((flags & FLAG_ALT) == 0)
+                                     while (nzeroes < ndigits
+                                            && digits[nzeroes] == '0')
+                                       nzeroes++;
+
+                                   /* The exponent is now determined.  */
+                                   if (exponent >= -4
+                                       && exponent < (long)precision)
+                                     {
+                                       /* Fixed-point notation:
+                                          max(exponent,0)+1 digits, then the
+                                          decimal point, then the remaining
+                                          digits without trailing zeroes.  */
+                                       if (exponent >= 0)
+                                         {
+                                           size_t count = exponent + 1;
+                                           /* Note: count <= precision = ndigits.  */
+                                           for (; count > 0; count--)
+                                             *p++ = digits[--ndigits];
+                                           if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                             {
+                                               *p++ = decimal_point_char ();
+                                               while (ndigits > nzeroes)
+                                                 {
+                                                   --ndigits;
+                                                   *p++ = digits[ndigits];
+                                                 }
+                                             }
+                                         }
+                                       else
+                                         {
+                                           size_t count = -exponent - 1;
+                                           *p++ = '0';
+                                           *p++ = decimal_point_char ();
+                                           for (; count > 0; count--)
+                                             *p++ = '0';
+                                           while (ndigits > nzeroes)
+                                             {
+                                               --ndigits;
+                                               *p++ = digits[ndigits];
+                                             }
+                                         }
+                                     }
+                                   else
+                                     {
+                                       /* Exponential notation.  */
+                                       *p++ = digits[--ndigits];
+                                       if ((flags & FLAG_ALT) || ndigits > nzeroes)
+                                         {
+                                           *p++ = decimal_point_char ();
+                                           while (ndigits > nzeroes)
+                                             {
+                                               --ndigits;
+                                               *p++ = digits[ndigits];
+                                             }
+                                         }
+                                       *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+#   if WIDE_CHAR_VERSION
+                                       {
+                                         static const wchar_t decimal_format[] =
+                                           { '%', '+', '.', '2', 'd', '\0' };
+                                         SNPRINTF (p, 6 + 1, decimal_format, exponent);
+                                       }
+                                       while (*p != '\0')
+                                         p++;
+#   else
+                                       if (sizeof (DCHAR_T) == 1)
+                                         {
+                                           sprintf ((char *) p, "%+.2d", exponent);
+                                           while (*p != '\0')
+                                             p++;
+                                         }
+                                       else
+                                         {
+                                           char expbuf[6 + 1];
+                                           const char *ep;
+                                           sprintf (expbuf, "%+.2d", exponent);
+                                           for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+                                             p++;
+                                         }
+#   endif
+                                     }
+
+                                   free (digits);
+                                 }
+                             }
+                           else
+                             abort ();
+#  else
+                           /* arg is finite.  */
+                           abort ();
+#  endif
+                         }
+
+                       END_LONG_DOUBLE_ROUNDING ();
+                     }
+                 }
+#  if NEED_PRINTF_INFINITE_DOUBLE
+               else
+#  endif
+# endif
+# if NEED_PRINTF_INFINITE_DOUBLE
+                 {
+                   /* Simpler than above: handle only NaN, Infinity, zero.  */
+                   double arg = a.arg[dp->arg_index].a.a_double;
+
+                   if (isnan (arg))
+                     {
+                       if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                         {
+                           *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+                         }
+                       else
+                         {
+                           *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+                         }
+                     }
+                   else
+                     {
+                       int sign = 0;
+
+                       if (signbit (arg)) /* arg < 0.0L or negative zero */
+                         {
+                           sign = -1;
+                           arg = -arg;
+                         }
+
+                       if (sign < 0)
+                         *p++ = '-';
+                       else if (flags & FLAG_SHOWSIGN)
+                         *p++ = '+';
+                       else if (flags & FLAG_SPACE)
+                         *p++ = ' ';
+
+                       if (arg > 0.0 && arg + arg == arg)
+                         {
+                           if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+                             {
+                               *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+                             }
+                           else
+                             {
+                               *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+                             }
+                         }
+                       else
+                         {
+                           if (!(arg == 0.0))
+                             abort ();
+
+                           pad_ptr = p;
+
+                           if (dp->conversion == 'f' || dp->conversion == 'F')
+                             {
+                               *p++ = '0';
+                               if ((flags & FLAG_ALT) || precision > 0)
+                                 {
+                                   *p++ = decimal_point_char ();
+                                   for (; precision > 0; precision--)
+                                     *p++ = '0';
+                                 }
+                             }
+                           else if (dp->conversion == 'e' || dp->conversion == 'E')
+                             {
+                               *p++ = '0';
+                               if ((flags & FLAG_ALT) || precision > 0)
+                                 {
+                                   *p++ = decimal_point_char ();
+                                   for (; precision > 0; precision--)
+                                     *p++ = '0';
+                                 }
+                               *p++ = dp->conversion; /* 'e' or 'E' */
+                               *p++ = '+';
+                               /* Produce the same number of exponent digits as
+                                  the native printf implementation.  */
+#  if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+                               *p++ = '0';
+#  endif
+                               *p++ = '0';
+                               *p++ = '0';
+                             }
+                           else if (dp->conversion == 'g' || dp->conversion == 'G')
+                             {
+                               *p++ = '0';
+                               if (flags & FLAG_ALT)
+                                 {
+                                   size_t ndigits =
+                                     (precision > 0 ? precision - 1 : 0);
+                                   *p++ = decimal_point_char ();
+                                   for (; ndigits > 0; --ndigits)
+                                     *p++ = '0';
+                                 }
+                             }
+                           else
+                             abort ();
+                         }
+                     }
+                 }
+# endif
+
+               /* The generated string now extends from tmp to p, with the
+                  zero padding insertion point being at pad_ptr.  */
+               if (has_width && p - tmp < width)
+                 {
+                   size_t pad = width - (p - tmp);
+                   DCHAR_T *end = p + pad;
 
-    /* Ensures that allocated >= needed.  Aborts through a jump to
-       out_of_memory if needed is SIZE_MAX or otherwise too big.  */
-#define ENSURE_ALLOCATION(needed) \
-    if ((needed) > allocated)                                               \
-      {                                                                             \
-       size_t memory_size;                                                  \
-       CHAR_T *memory;                                                      \
-                                                                            \
-       allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
-       if ((needed) > allocated)                                            \
-         allocated = (needed);                                              \
-       memory_size = xtimes (allocated, sizeof (CHAR_T));                   \
-       if (size_overflow_p (memory_size))                                   \
-         goto out_of_memory;                                                \
-       if (result == resultbuf || result == NULL)                           \
-         memory = (CHAR_T *) malloc (memory_size);                          \
-       else                                                                 \
-         memory = (CHAR_T *) realloc (result, memory_size);                 \
-       if (memory == NULL)                                                  \
-         goto out_of_memory;                                                \
-       if (result == resultbuf && length > 0)                               \
-         memcpy (memory, result, length * sizeof (CHAR_T));                 \
-       result = memory;                                                     \
-      }
+                   if (flags & FLAG_LEFT)
+                     {
+                       /* Pad with spaces on the right.  */
+                       for (; pad > 0; pad--)
+                         *p++ = ' ';
+                     }
+                   else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                     {
+                       /* Pad with zeroes.  */
+                       DCHAR_T *q = end;
 
-    for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
-      {
-       if (cp != dp->dir_start)
-         {
-           size_t n = dp->dir_start - cp;
-           size_t augmented_length = xsum (length, n);
+                       while (p > pad_ptr)
+                         *--q = *--p;
+                       for (; pad > 0; pad--)
+                         *p++ = '0';
+                     }
+                   else
+                     {
+                       /* Pad with spaces on the left.  */
+                       DCHAR_T *q = end;
 
-           ENSURE_ALLOCATION (augmented_length);
-           memcpy (result + length, cp, n * sizeof (CHAR_T));
-           length = augmented_length;
-         }
-       if (i == d.count)
-         break;
+                       while (p > tmp)
+                         *--q = *--p;
+                       for (; pad > 0; pad--)
+                         *p++ = ' ';
+                     }
 
-       /* Execute a single directive.  */
-       if (dp->conversion == '%')
-         {
-           size_t augmented_length;
+                   p = end;
+                 }
 
-           if (!(dp->arg_index == ARG_NONE))
-             abort ();
-           augmented_length = xsum (length, 1);
-           ENSURE_ALLOCATION (augmented_length);
-           result[length] = '%';
-           length = augmented_length;
-         }
-       else
-         {
-           if (!(dp->arg_index != ARG_NONE))
-             abort ();
+               {
+                 size_t count = p - tmp;
 
-           if (dp->conversion == 'n')
-             {
-               switch (a.arg[dp->arg_index].type)
-                 {
-                 case TYPE_COUNT_SCHAR_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
-                   break;
-                 case TYPE_COUNT_SHORT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_short_pointer = length;
-                   break;
-                 case TYPE_COUNT_INT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_int_pointer = length;
-                   break;
-                 case TYPE_COUNT_LONGINT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
-                   break;
-#if HAVE_LONG_LONG_INT
-                 case TYPE_COUNT_LONGLONGINT_POINTER:
-                   *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
-                   break;
-#endif
-                 default:
+                 if (count >= tmp_length)
+                   /* tmp_length was incorrectly calculated - fix the
+                      code above!  */
                    abort ();
-                 }
+
+                 /* Make room for the result.  */
+                 if (count >= allocated - length)
+                   {
+                     size_t n = xsum (length, count);
+
+                     ENSURE_ALLOCATION (n);
+                   }
+
+                 /* Append the result.  */
+                 memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+                 if (tmp != tmpbuf)
+                   free (tmp);
+                 length += count;
+               }
              }
+#endif
            else
              {
                arg_type type = a.arg[dp->arg_index].type;
-               CHAR_T *p;
+               int flags = dp->flags;
+#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO
+               int has_width;
+               size_t width;
+#endif
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO
+               int pad_ourselves;
+#else
+#              define pad_ourselves 0
+#endif
+               TCHAR_T *fbp;
                unsigned int prefix_count;
                int prefixes[2];
 #if !USE_SNPRINTF
                size_t tmp_length;
-               CHAR_T tmpbuf[700];
-               CHAR_T *tmp;
+               TCHAR_T tmpbuf[700];
+               TCHAR_T *tmp;
+#endif
+
+#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO
+               has_width = 0;
+               width = 0;
+               if (dp->width_start != dp->width_end)
+                 {
+                   if (dp->width_arg_index != ARG_NONE)
+                     {
+                       int arg;
+
+                       if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                         abort ();
+                       arg = a.arg[dp->width_arg_index].a.a_int;
+                       if (arg < 0)
+                         {
+                           /* "A negative field width is taken as a '-' flag
+                               followed by a positive field width."  */
+                           flags |= FLAG_LEFT;
+                           width = (unsigned int) (-arg);
+                         }
+                       else
+                         width = arg;
+                     }
+                   else
+                     {
+                       const FCHAR_T *digitp = dp->width_start;
+
+                       do
+                         width = xsum (xtimes (width, 10), *digitp++ - '0');
+                       while (digitp != dp->width_end);
+                     }
+                   has_width = 1;
+                 }
+#endif
 
+#if !USE_SNPRINTF
                /* Allocate a temporary buffer of sufficient size for calling
                   sprintf.  */
                {
-                 size_t width;
                  size_t precision;
 
-                 width = 0;
-                 if (dp->width_start != dp->width_end)
-                   {
-                     if (dp->width_arg_index != ARG_NONE)
-                       {
-                         int arg;
-
-                         if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-                           abort ();
-                         arg = a.arg[dp->width_arg_index].a.a_int;
-                         width = (arg < 0 ? (unsigned int) (-arg) : arg);
-                       }
-                     else
-                       {
-                         const CHAR_T *digitp = dp->width_start;
-
-                         do
-                           width = xsum (xtimes (width, 10), *digitp++ - '0');
-                         while (digitp != dp->width_end);
-                       }
-                   }
-
                  precision = 6;
                  if (dp->precision_start != dp->precision_end)
                    {
@@ -310,7 +3050,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                        }
                      else
                        {
-                         const CHAR_T *digitp = dp->precision_start + 1;
+                         const FCHAR_T *digitp = dp->precision_start + 1;
 
                          precision = 0;
                          while (digitp != dp->precision_end)
@@ -408,7 +3148,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                      break;
 
                    case 'f': case 'F':
-# if HAVE_LONG_DOUBLE
                      if (type == TYPE_LONGDOUBLE)
                        tmp_length =
                          (unsigned int) (LDBL_MAX_EXP
@@ -418,7 +3157,6 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                          + 1 /* turn floor into ceil */
                          + 10; /* sign, decimal point etc. */
                      else
-# endif
                        tmp_length =
                          (unsigned int) (DBL_MAX_EXP
                                          * 0.30103 /* binary -> decimal */
@@ -430,12 +3168,30 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                      break;
 
                    case 'e': case 'E': case 'g': case 'G':
-                   case 'a': case 'A':
                      tmp_length =
                        12; /* sign, decimal point, exponent etc. */
                      tmp_length = xsum (tmp_length, precision);
                      break;
 
+                   case 'a': case 'A':
+                     if (type == TYPE_LONGDOUBLE)
+                       tmp_length =
+                         (unsigned int) (LDBL_DIG
+                                         * 0.831 /* decimal -> hexadecimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+                       tmp_length =
+                         (unsigned int) (DBL_DIG
+                                         * 0.831 /* decimal -> hexadecimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     if (tmp_length < precision)
+                       tmp_length = precision;
+                     /* Account for sign, decimal point etc. */
+                     tmp_length = xsum (tmp_length, 12);
+                     break;
+
                    case 'c':
 # if HAVE_WINT_T && !WIDE_CHAR_VERSION
                      if (type == TYPE_WIDE_CHAR)
@@ -474,55 +3230,121 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                      abort ();
                    }
 
+# if ENABLE_UNISTDIO
+                 /* Padding considers the number of characters, therefore the
+                    number of elements after padding may be
+                      > max (tmp_length, width)
+                    but is certainly
+                      <= tmp_length + width.  */
+                 tmp_length = xsum (tmp_length, width);
+# else
+                 /* Padding considers the number of elements, says POSIX.  */
                  if (tmp_length < width)
                    tmp_length = width;
+# endif
 
                  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
                }
 
-               if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
+               if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
                  tmp = tmpbuf;
                else
                  {
-                   size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
+                   size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
 
                    if (size_overflow_p (tmp_memsize))
                      /* Overflow, would lead to out of memory.  */
                      goto out_of_memory;
-                   tmp = (CHAR_T *) malloc (tmp_memsize);
+                   tmp = (TCHAR_T *) malloc (tmp_memsize);
                    if (tmp == NULL)
                      /* Out of memory.  */
                      goto out_of_memory;
                  }
 #endif
 
+               /* Decide whether to perform the padding ourselves.  */
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO
+               switch (dp->conversion)
+                 {
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+                    to perform the padding after this conversion.  Functions
+                    with unistdio extensions perform the padding based on
+                    character count rather than element count.  */
+                 case 'c': case 's':
+# endif
+# if NEED_PRINTF_FLAG_ZERO
+                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+                 case 'a': case 'A':
+# endif
+                   pad_ourselves = 1;
+                   break;
+                 default:
+                   pad_ourselves = 0;
+                   break;
+                 }
+#endif
+
                /* Construct the format string for calling snprintf or
                   sprintf.  */
-               p = buf;
-               *p++ = '%';
-               if (dp->flags & FLAG_GROUP)
-                 *p++ = '\'';
-               if (dp->flags & FLAG_LEFT)
-                 *p++ = '-';
-               if (dp->flags & FLAG_SHOWSIGN)
-                 *p++ = '+';
-               if (dp->flags & FLAG_SPACE)
-                 *p++ = ' ';
-               if (dp->flags & FLAG_ALT)
-                 *p++ = '#';
-               if (dp->flags & FLAG_ZERO)
-                 *p++ = '0';
-               if (dp->width_start != dp->width_end)
+               fbp = buf;
+               *fbp++ = '%';
+#if NEED_PRINTF_FLAG_GROUPING
+               /* The underlying implementation doesn't support the ' flag.
+                  Produce no grouping characters in this case; this is
+                  acceptable because the grouping is locale dependent.  */
+#else
+               if (flags & FLAG_GROUP)
+                 *fbp++ = '\'';
+#endif
+               if (flags & FLAG_LEFT)
+                 *fbp++ = '-';
+               if (flags & FLAG_SHOWSIGN)
+                 *fbp++ = '+';
+               if (flags & FLAG_SPACE)
+                 *fbp++ = ' ';
+               if (flags & FLAG_ALT)
+                 *fbp++ = '#';
+               if (!pad_ourselves)
                  {
-                   size_t n = dp->width_end - dp->width_start;
-                   memcpy (p, dp->width_start, n * sizeof (CHAR_T));
-                   p += n;
+                   if (flags & FLAG_ZERO)
+                     *fbp++ = '0';
+                   if (dp->width_start != dp->width_end)
+                     {
+                       size_t n = dp->width_end - dp->width_start;
+                       /* The width specification is known to consist only
+                          of standard ASCII characters.  */
+                       if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+                         {
+                           memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
+                           fbp += n;
+                         }
+                       else
+                         {
+                           const FCHAR_T *mp = dp->width_start;
+                           do
+                             *fbp++ = (unsigned char) *mp++;
+                           while (--n > 0);
+                         }
+                     }
                  }
                if (dp->precision_start != dp->precision_end)
                  {
                    size_t n = dp->precision_end - dp->precision_start;
-                   memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
-                   p += n;
+                   /* The precision specification is known to consist only
+                      of standard ASCII characters.  */
+                   if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+                     {
+                       memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
+                       fbp += n;
+                     }
+                   else
+                     {
+                       const FCHAR_T *mp = dp->precision_start;
+                       do
+                         *fbp++ = (unsigned char) *mp++;
+                       while (--n > 0);
+                     }
                  }
 
                switch (type)
@@ -530,8 +3352,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
 #if HAVE_LONG_LONG_INT
                  case TYPE_LONGLONGINT:
                  case TYPE_ULONGLONGINT:
-                   *p++ = 'l';
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+                   *fbp++ = 'I';
+                   *fbp++ = '6';
+                   *fbp++ = '4';
+                   break;
+# else
+                   *fbp++ = 'l';
                    /*FALLTHROUGH*/
+# endif
 #endif
                  case TYPE_LONGINT:
                  case TYPE_ULONGINT:
@@ -541,28 +3370,31 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
 #if HAVE_WCHAR_T
                  case TYPE_WIDE_STRING:
 #endif
-                   *p++ = 'l';
+                   *fbp++ = 'l';
                    break;
-#if HAVE_LONG_DOUBLE
                  case TYPE_LONGDOUBLE:
-                   *p++ = 'L';
+                   *fbp++ = 'L';
                    break;
-#endif
                  default:
                    break;
                  }
-               *p = dp->conversion;
+#if NEED_PRINTF_DIRECTIVE_F
+               if (dp->conversion == 'F')
+                 *fbp = 'f';
+               else
+#endif
+                 *fbp = dp->conversion;
 #if USE_SNPRINTF
-               p[1] = '%';
-               p[2] = 'n';
-               p[3] = '\0';
+               fbp[1] = '%';
+               fbp[2] = 'n';
+               fbp[3] = '\0';
 #else
-               p[1] = '\0';
+               fbp[1] = '\0';
 #endif
 
                /* Construct the arguments for calling snprintf or sprintf.  */
                prefix_count = 0;
-               if (dp->width_arg_index != ARG_NONE)
+               if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
                  {
                    if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
                      abort ();
@@ -576,36 +3408,46 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                  }
 
 #if USE_SNPRINTF
+               /* The SNPRINTF result is appended after result[0..length].
+                  The latter is an array of DCHAR_T; SNPRINTF appends an
+                  array of TCHAR_T to it.  This is possible because
+                  sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
+                  alignof (TCHAR_T) <= alignof (DCHAR_T).  */
+# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
                /* Prepare checking whether snprintf returns the count
                   via %n.  */
                ENSURE_ALLOCATION (xsum (length, 1));
-               result[length] = '\0';
+               *(TCHAR_T *) (result + length) = '\0';
 #endif
 
                for (;;)
                  {
-                   size_t maxlen;
-                   int count;
-                   int retcount;
-
-                   maxlen = allocated - length;
-                   count = -1;
-                   retcount = 0;
+                   int count = -1;
 
 #if USE_SNPRINTF
+                   int retcount = 0;
+                   size_t maxlen = allocated - length;
+                   /* SNPRINTF can fail if its second argument is
+                      > INT_MAX.  */
+                   if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
+                     goto overflow;
+                   maxlen = maxlen * TCHARS_PER_DCHAR;
 # define SNPRINTF_BUF(arg) \
                    switch (prefix_count)                                   \
                      {                                                     \
                      case 0:                                               \
-                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                            maxlen, buf,                   \
                                             arg, &count);                  \
                        break;                                              \
                      case 1:                                               \
-                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                            maxlen, buf,                   \
                                             prefixes[0], arg, &count);     \
                        break;                                              \
                      case 2:                                               \
-                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                       retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+                                            maxlen, buf,                   \
                                             prefixes[0], prefixes[1], arg, \
                                             &count);                       \
                        break;                                              \
@@ -701,14 +3543,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                          SNPRINTF_BUF (arg);
                        }
                        break;
-#if HAVE_LONG_DOUBLE
                      case TYPE_LONGDOUBLE:
                        {
                          long double arg = a.arg[dp->arg_index].a.a_longdouble;
                          SNPRINTF_BUF (arg);
                        }
                        break;
-#endif
                      case TYPE_CHAR:
                        {
                          int arg = a.arg[dp->arg_index].a.a_char;
@@ -756,7 +3596,8 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                      {
                        /* Verify that snprintf() has NUL-terminated its
                           result.  */
-                       if (count < maxlen && result[length + count] != '\0')
+                       if (count < maxlen
+                           && ((TCHAR_T *) (result + length)) [count] != '\0')
                          abort ();
                        /* Portability hack.  */
                        if (retcount > count)
@@ -766,11 +3607,11 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                      {
                        /* snprintf() doesn't understand the '%n'
                           directive.  */
-                       if (p[1] != '\0')
+                       if (fbp[1] != '\0')
                          {
                            /* Don't use the '%n' directive; instead, look
                               at the snprintf() return value.  */
-                           p[1] = '\0';
+                           fbp[1] = '\0';
                            continue;
                          }
                        else
@@ -806,37 +3647,261 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
                        return NULL;
                      }
 
-#if !USE_SNPRINTF
+#if USE_SNPRINTF
+                   /* Handle overflow of the allocated buffer.  */
+                   if (count >= maxlen)
+                     {
+                       /* Need at least count * sizeof (TCHAR_T) bytes.  But
+                          allocate proportionally, to avoid looping eternally
+                          if snprintf() reports a too small count.  */
+                       size_t n =
+                         xmax (xsum (length,
+                                     (count + TCHARS_PER_DCHAR - 1)
+                                     / TCHARS_PER_DCHAR),
+                               xtimes (allocated, 2));
+
+                       ENSURE_ALLOCATION (n);
+                       continue;
+                     }
+#endif
+
+#if !DCHAR_IS_TCHAR
+# if !USE_SNPRINTF
                    if (count >= tmp_length)
                      /* tmp_length was incorrectly calculated - fix the
                         code above!  */
                      abort ();
+# endif
+
+                   /* Convert from TCHAR_T[] to DCHAR_T[].  */
+                   if (dp->conversion == 'c' || dp->conversion == 's')
+                     {
+                       /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
+                          TYPE_WIDE_STRING.
+                          The result string is not certainly ASCII.  */
+                       const TCHAR_T *tmpsrc;
+                       DCHAR_T *tmpdst;
+                       size_t tmpdst_len;
+                       /* This code assumes that TCHAR_T is 'char'.  */
+                       typedef int TCHAR_T_verify
+                                   [2 * (sizeof (TCHAR_T) == 1) - 1];
+# if USE_SNPRINTF
+                       tmpsrc = (TCHAR_T *) (result + length);
+# else
+                       tmpsrc = tmp;
+# endif
+                       tmpdst = NULL;
+                       tmpdst_len = 0;
+                       if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                                     iconveh_question_mark,
+                                                     tmpsrc, count,
+                                                     NULL,
+                                                     &tmpdst, &tmpdst_len)
+                           < 0)
+                         {
+                           int saved_errno = errno;
+                           if (!(result == resultbuf || result == NULL))
+                             free (result);
+                           if (buf_malloced != NULL)
+                             free (buf_malloced);
+                           CLEANUP ();
+                           errno = saved_errno;
+                           return NULL;
+                         }
+                       ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+                       DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+                       free (tmpdst);
+                       count = tmpdst_len;
+                     }
+                   else
+                     {
+                       /* The result string is ASCII.
+                          Simple 1:1 conversion.  */
+# if USE_SNPRINTF
+                       /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
+                          no-op conversion, in-place on the array starting
+                          at (result + length).  */
+                       if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
+# endif
+                         {
+                           const TCHAR_T *tmpsrc;
+                           DCHAR_T *tmpdst;
+                           size_t n;
+
+# if USE_SNPRINTF
+                           if (result == resultbuf)
+                             {
+                               tmpsrc = (TCHAR_T *) (result + length);
+                               /* ENSURE_ALLOCATION will not move tmpsrc
+                                  (because it's part of resultbuf).  */
+                               ENSURE_ALLOCATION (xsum (length, count));
+                             }
+                           else
+                             {
+                               /* ENSURE_ALLOCATION will move the array
+                                  (because it uses realloc().  */
+                               ENSURE_ALLOCATION (xsum (length, count));
+                               tmpsrc = (TCHAR_T *) (result + length);
+                             }
+# else
+                           tmpsrc = tmp;
+                           ENSURE_ALLOCATION (xsum (length, count));
+# endif
+                           tmpdst = result + length;
+                           /* Copy backwards, because of overlapping.  */
+                           tmpsrc += count;
+                           tmpdst += count;
+                           for (n = count; n > 0; n--)
+                             *--tmpdst = (unsigned char) *--tmpsrc;
+                         }
+                     }
 #endif
 
+#if DCHAR_IS_TCHAR && !USE_SNPRINTF
                    /* Make room for the result.  */
-                   if (count >= maxlen)
+                   if (count > allocated - length)
                      {
-                       /* Need at least count bytes.  But allocate
-                          proportionally, to avoid looping eternally if
-                          snprintf() reports a too small count.  */
+                       /* Need at least count elements.  But allocate
+                          proportionally.  */
                        size_t n =
                          xmax (xsum (length, count), xtimes (allocated, 2));
 
                        ENSURE_ALLOCATION (n);
-#if USE_SNPRINTF
-                       continue;
+                     }
 #endif
+
+                   /* Here count <= allocated - length.  */
+
+                   /* Perform padding.  */
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO
+                   if (pad_ourselves && has_width)
+                     {
+                       size_t w;
+# if ENABLE_UNISTDIO
+                       /* Outside POSIX, it's preferrable to compare the width
+                          against the number of _characters_ of the converted
+                          value.  */
+                       w = DCHAR_MBSNLEN (result + length, count);
+# else
+                       /* The width is compared against the number of _bytes_
+                          of the converted value, says POSIX.  */
+                       w = count;
+# endif
+                       if (w < width)
+                         {
+                           size_t pad = width - w;
+# if USE_SNPRINTF
+                           /* Make room for the result.  */
+                           if (xsum (count, pad) > allocated - length)
+                             {
+                               /* Need at least count + pad elements.  But
+                                  allocate proportionally.  */
+                               size_t n =
+                                 xmax (xsum3 (length, count, pad),
+                                       xtimes (allocated, 2));
+
+                               length += count;
+                               ENSURE_ALLOCATION (n);
+                               length -= count;
+                             }
+                           /* Here count + pad <= allocated - length.  */
+# endif
+                           {
+# if !DCHAR_IS_TCHAR || USE_SNPRINTF
+                             DCHAR_T * const rp = result + length;
+# else
+                             DCHAR_T * const rp = tmp;
+# endif
+                             DCHAR_T *p = rp + count;
+                             DCHAR_T *end = p + pad;
+# if NEED_PRINTF_FLAG_ZERO
+                             DCHAR_T *pad_ptr;
+#  if !DCHAR_IS_TCHAR
+                             if (dp->conversion == 'c'
+                                 || dp->conversion == 's')
+                               /* No zero-padding for string directives.  */
+                               pad_ptr = NULL;
+                             else
+#  endif
+                               {
+                                 pad_ptr = (*rp == '-' ? rp + 1 : rp);
+                                 /* No zero-padding of "inf" and "nan".  */
+                                 if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
+                                     || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
+                                   pad_ptr = NULL;
+                               }
+# endif
+                             /* The generated string now extends from rp to p,
+                                with the zero padding insertion point being at
+                                pad_ptr.  */
+
+                             count = count + pad; /* = end - rp */
+
+                             if (flags & FLAG_LEFT)
+                               {
+                                 /* Pad with spaces on the right.  */
+                                 for (; pad > 0; pad--)
+                                   *p++ = ' ';
+                               }
+# if NEED_PRINTF_FLAG_ZERO
+                             else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+                               {
+                                 /* Pad with zeroes.  */
+                                 DCHAR_T *q = end;
+
+                                 while (p > pad_ptr)
+                                   *--q = *--p;
+                                 for (; pad > 0; pad--)
+                                   *p++ = '0';
+                               }
+# endif
+                             else
+                               {
+                                 /* Pad with spaces on the left.  */
+                                 DCHAR_T *q = end;
+
+                                 while (p > rp)
+                                   *--q = *--p;
+                                 for (; pad > 0; pad--)
+                                   *p++ = ' ';
+                               }
+                           }
+                         }
                      }
+#endif
 
-#if USE_SNPRINTF
+#if DCHAR_IS_TCHAR && !USE_SNPRINTF
+                   if (count >= tmp_length)
+                     /* tmp_length was incorrectly calculated - fix the
+                        code above!  */
+                     abort ();
+#endif
+
+                   /* Here still count <= allocated - length.  */
+
+#if !DCHAR_IS_TCHAR || USE_SNPRINTF
                    /* The snprintf() result did fit.  */
 #else
                    /* Append the sprintf() result.  */
-                   memcpy (result + length, tmp, count * sizeof (CHAR_T));
+                   memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+#endif
+#if !USE_SNPRINTF
                    if (tmp != tmpbuf)
                      free (tmp);
 #endif
 
+#if NEED_PRINTF_DIRECTIVE_F
+                   if (dp->conversion == 'F')
+                     {
+                       /* Convert the %f result to upper case for %F.  */
+                       DCHAR_T *rp = result + length;
+                       size_t rc;
+                       for (rc = count; rc > 0; rc--, rp++)
+                         if (*rp >= 'a' && *rp <= 'z')
+                           *rp = *rp - 'a' + 'A';
+                     }
+#endif
+
                    length += count;
                    break;
                  }
@@ -851,9 +3916,9 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
     if (result != resultbuf && length + 1 < allocated)
       {
        /* Shrink the allocated memory if possible.  */
-       CHAR_T *memory;
+       DCHAR_T *memory;
 
-       memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
+       memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
        if (memory != NULL)
          result = memory;
       }
@@ -868,6 +3933,15 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
        not have this limitation.  */
     return result;
 
+  overflow:
+    if (!(result == resultbuf || result == NULL))
+      free (result);
+    if (buf_malloced != NULL)
+      free (buf_malloced);
+    CLEANUP ();
+    errno = EOVERFLOW;
+    return NULL;
+
   out_of_memory:
     if (!(result == resultbuf || result == NULL))
       free (result);
@@ -880,10 +3954,13 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar
   }
 }
 
+#undef TCHARS_PER_DCHAR
 #undef SNPRINTF
 #undef USE_SNPRINTF
 #undef PRINTF_PARSE
 #undef DIRECTIVES
 #undef DIRECTIVE
-#undef CHAR_T
+#undef TCHAR_T
+#undef DCHAR_T
+#undef FCHAR_T
 #undef VASNPRINTF
index 894008caec140cbc7bc82c2783f3dbb2c52ae8ea..7a0c01f4bfa327d6f0b3f8cdb0e6faeb4184c83c 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
 # endif
 #endif
 
-#ifdef __cplusplus
+#ifdef __cplusplus
 extern "C" {
 #endif
 
@@ -65,12 +65,16 @@ extern "C" {
                 free (output);
             }
   */
+#if REPLACE_VASNPRINTF
+# define asnprintf rpl_asnprintf
+# define vasnprintf rpl_vasnprintf
+#endif
 extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
        __attribute__ ((__format__ (__printf__, 3, 4)));
 extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
        __attribute__ ((__format__ (__printf__, 3, 0)));
 
-#ifdef __cplusplus
+#ifdef __cplusplus
 }
 #endif
 
diff --git a/gnulib/wchar_.h b/gnulib/wchar_.h
new file mode 100644 (file)
index 0000000..924a338
--- /dev/null
@@ -0,0 +1,82 @@
+/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
+
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software; you can 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, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Eric Blake.  */
+
+/*
+ * ISO C 99 <wchar.h> for platforms that have issues.
+ * <http://www.opengroup.org/susv3xbd/wchar.h.html>
+ *
+ * For now, this just ensures proper prerequisite inclusion order and
+ * the declaration of wcwidth().
+ */
+
+#ifndef _GL_WCHAR_H
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+
+/* Include the original <wchar.h> if it exists.
+   Some builds of uClibc lack it.  */
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_WCHAR_H@
+# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
+#endif
+
+#ifndef _GL_WCHAR_H
+#define _GL_WCHAR_H
+
+/* The definition of GL_LINK_WARNING is copied here.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return the number of screen columns needed for WC.  */
+#if @GNULIB_WCWIDTH@
+# if @REPLACE_WCWIDTH@
+#  undef wcwidth
+#  define wcwidth rpl_wcwidth
+extern int wcwidth (wchar_t);
+# else
+#  if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
+/* wcwidth exists but is not declared.  */
+extern int wcwidth (int /* actually wchar_t */);
+#  endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcwidth
+# define wcwidth(w) \
+    (GL_LINK_WARNING ("wcwidth is unportable - " \
+                      "use gnulib module wcwidth for portability"), \
+     wcwidth (w))
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_WCHAR_H */
+#endif /* _GL_WCHAR_H */
diff --git a/installcheck/Amanda_Changer.pl b/installcheck/Amanda_Changer.pl
new file mode 100644 (file)
index 0000000..d525fd6
--- /dev/null
@@ -0,0 +1,227 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw(no_plan);
+use Amconfig;
+use File::Path;
+use strict;
+
+use lib "@amperldir@";
+use Amanda::Paths;
+use Amanda::Device;
+use Amanda::Debug;
+use Amanda::Config qw( :init :getconf config_dir_relative );
+use Amanda::Changer;
+
+# set up debugging so debug output doesn't interfere with test results
+Amanda::Debug::dbopen("installcheck");
+
+my $changer_filename = "$AMANDA_TMPDIR/chg-test";
+
+sub setup_changer {
+    my ($changer_script) = @_;
+
+    open my $chg_test, ">", $changer_filename or die("Could not create test changer");
+    
+    $changer_script =~ s/\$AMANDA_TMPDIR/$AMANDA_TMPDIR/g;
+
+    print $chg_test "#! /bin/sh\n";
+    print $chg_test $changer_script;
+
+    close $chg_test;
+    chmod 0755, $changer_filename;
+}
+
+# set up and load a simple config with a tpchanger
+my $testconf = Amconfig->new();
+$testconf->add_param('tpchanger', "\"$changer_filename\"");
+$testconf->write();
+config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF') or die("Could not load test config");
+
+# some variables we'll need
+my ($error, $slot, $device);
+
+# OK, let's get started with some simple stuff
+setup_changer <<'EOC';
+case "${1}" in
+    -slot)
+        case "${2}" in
+            1) echo "1 fake:1"; exit 0;;
+            2) echo "<ignored> slot 2 is empty"; exit 1;;
+            3) echo "<error> oh noes!"; exit 2;;
+            4) echo "1"; exit 0;; # test missing 'device' portion
+        esac;;
+    -reset) echo "reset ignored";;
+    -eject) echo "eject ignored";;
+    -clean) echo "clean ignored";;
+    -label)
+        case "${2}" in
+            foo?bar) echo "1 ok"; exit 0;;
+            *) echo "<error> bad label"; exit 1;;
+        esac;;
+    -info) echo "7 10 1 1"; exit 0;;
+    -search) 
+        case "${2}" in
+            TAPE?01) echo "5 fakedev"; exit 0;;
+            *) echo "<error> not found"; exit 2;;
+        esac;;
+esac
+EOC
+
+is_deeply([ Amanda::Changer::loadslot(1) ], [0, "1", "fake:1"],
+    "A successful loadslot() returns the right stuff");
+
+($error, $slot, $device) = Amanda::Changer::loadslot(2);
+is($error, "slot 2 is empty", "A loadslot() with a benign error returns the right stuff");
+
+eval { Amanda::Changer::loadslot(3); };
+like($@, qr/.*oh noes!.*/, "A loadslot() with a serious error croaks");
+
+is_deeply([ Amanda::Changer::loadslot(4) ], [0, "1", undef],
+    "a response without a device string returns undef");
+
+is_deeply([ Amanda::Changer::reset() ], [ 0, "reset" ],
+    "reset() calls tapechanger -reset");
+is_deeply([ Amanda::Changer::eject() ], [ 0, "eject" ],
+    "eject() calls tapechanger -eject");
+is_deeply([ Amanda::Changer::clean() ], [ 0, "clean" ],
+    "clean() calls tapechanger -clean");
+
+is_deeply([ Amanda::Changer::label("foo bar") ], [ 0 ],
+    "label('foo bar') calls tapechanger -label 'foo bar' (note spaces)");
+
+is_deeply([ Amanda::Changer::query() ], [ 0, 7, 10, 1, 1 ],
+    "query() returns the correct values for a 4-value changer script");
+
+is_deeply([ Amanda::Changer::find("TAPE 01") ], [ 0, "5", "fakedev" ],
+    "find on a searchable changer invokes -search");
+
+eval { Amanda::Changer::find("TAPE 02") };
+ok($@, "A searchable changer croaks when the label can't be found");
+
+# Now a simple changer that returns three values for -info
+setup_changer <<'EOC';
+case "${1}" in
+    -info) echo "11 13 0"; exit 0;;
+esac
+EOC
+
+is_deeply([ Amanda::Changer::query() ], [ 0, 11, 13, 0, 0 ],
+    "query() returns the correct values for a 4-value changer script");
+
+# set up 5 vtapes
+for (my $i = 0; $i < 5; $i++) {
+    my $vtapedir = "$AMANDA_TMPDIR/chg-test-tapes/$i/data";
+    if (-e $vtapedir) {
+        rmtree($vtapedir) 
+            or die("Could not remove '$vtapedir'");
+    }
+    mkpath($vtapedir)
+        or die("Could not create '$vtapedir'");
+}
+
+# label three of them (slot 2 is empty; slot 4 is unlabeled)
+for (my $i = 0; $i < 5; $i++) {
+    next if $i == 2 || $i == 4;
+    my $dev = Amanda::Device->new("file:$AMANDA_TMPDIR/chg-test-tapes/$i")
+        or die("Could not open device");
+    $dev->start($Amanda::Device::ACCESS_WRITE, "TAPE$i", "19780615010203") 
+        or die("Could not write label");
+    $dev->finish();
+}
+
+# And finally a "stateful" changer that can support "scan" and "find"
+setup_changer <<'EOC';
+STATEFILE="$AMANDA_TMPDIR/chg-test-state"
+SLOT=0
+[ -f "$STATEFILE" ] && . "$STATEFILE"
+
+case "${1}" in
+    -slot)
+        case "${2}" in
+            current) ;;
+            0|1|2|3|4|5) SLOT="${2}";;
+            next|advance) SLOT=`expr $SLOT + 1`;;
+            prev) SLOT=`expr $SLOT - 1`;;
+            first) SLOT=0;;
+            last) SLOT=4;;
+        esac
+
+        # normalize 0 <= $SLOT  < 5
+        while [ "$SLOT" -ge 5 ]; do SLOT=`expr $SLOT - 5`; done
+        while [ "$SLOT" -lt 0 ]; do SLOT=`expr $SLOT + 5`; done
+
+        # signal an empty slot for slot 2
+        if [ "$SLOT" = 2 ]; then
+            echo "$SLOT slot $SLOT is empty"
+            EXIT=1
+        else
+            echo "$SLOT" "file:$AMANDA_TMPDIR/chg-test-tapes/$SLOT"
+        fi
+        ;;
+    -info) echo "$SLOT 5 1 0";;
+esac
+
+echo SLOT=$SLOT > $STATEFILE
+exit $EXIT
+EOC
+
+($error, $slot, $device) = Amanda::Changer::loadslot(0);
+if ($error) { die("Error loading slot 0: $error"); }
+is_deeply([ Amanda::Changer::find("TAPE3") ], [0, "3", "file:$AMANDA_TMPDIR/chg-test-tapes/3"],
+    "Finds a tape after skipping an empty slot");
+
+($error, $slot, $device) = Amanda::Changer::loadslot(3);
+if ($error) { die("Error loading slot 3: $error"); }
+is_deeply([ Amanda::Changer::find("TAPE1") ], [0, "1", "file:$AMANDA_TMPDIR/chg-test-tapes/1"],
+    "Finds a tape after skipping an unlabeled but filled slot");
+
+my @scanresults;
+sub cb {
+    fail("called too many times") if (!@scanresults);
+    my $expected = shift @scanresults;
+    my $descr = pop @$expected;
+    my $done = pop @$expected;
+    is_deeply([ @_ ], $expected, $descr);
+    return 1;
+}
+
+# scan the whole changer
+($error, $slot, $device) = Amanda::Changer::loadslot(0);
+if ($error) { die("Error loading slot 0: $error"); }
+@scanresults = (
+    [ "0", "file:$AMANDA_TMPDIR/chg-test-tapes/0", 0, 0, "scan starts with slot 0" ],
+    [ "1", "file:$AMANDA_TMPDIR/chg-test-tapes/1", 0, 0, "next in slot 1" ],
+    [ undef, undef, "slot 2 is empty",                0, "slot 2 is empty" ],
+    [ "3", "file:$AMANDA_TMPDIR/chg-test-tapes/3", 0, 0, "next in slot 3" ],
+    [ "4", "file:$AMANDA_TMPDIR/chg-test-tapes/4", 0, 0, "next in slot 4" ],
+);
+Amanda::Changer::scan(\&cb);
+
+# make sure it stops when "done"
+($error, $slot, $device) = Amanda::Changer::loadslot(0);
+if ($error) { die("Error loading slot 0: $error"); }
+@scanresults = (
+    [ "0", "file:$AMANDA_TMPDIR/chg-test-tapes/0", 0, 1, "scan starts with slot 0" ],
+);
+Amanda::Changer::scan(\&cb);
+
+# cleanup
+unlink("$AMANDA_TMPDIR/chg-test");
+unlink("$AMANDA_TMPDIR/chg-test-state");
+rmtree("$AMANDA_TMPDIR/chg-test-tapes");
diff --git a/installcheck/Amanda_Cmdline.pl b/installcheck/Amanda_Cmdline.pl
new file mode 100644 (file)
index 0000000..399101a
--- /dev/null
@@ -0,0 +1,106 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw( no_plan );
+
+use lib "@amperldir@";
+use Amanda::Paths;
+use Amanda::Cmdline;
+
+# convert a dumpspec_t object to an array, for easy is_deeply() comparisons
+sub ds2av {
+    my ($ds) = @_;
+    return (
+       $ds->{'host'},
+       $ds->{'disk'},
+       $ds->{'datestamp'},
+       $ds->{'level'},
+    );
+}
+
+# test dumpspec_t objects
+
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", "l")) ],
+         [ "h", "di", "ds", "l" ],
+         "dumpspec_t constructor returns a valid dumpspec");
+
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", "ds", undef)) ],
+         [ "h", "di", "ds", undef ],
+         "dumpspec_t constructor returns a valid dumpspec with only 3 args");
+
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", "di", undef, undef)) ],
+         [ "h", "di", undef, undef ],
+         "dumpspec_t constructor returns a valid dumpspec with only 2 args");
+
+is_deeply([ ds2av(Amanda::Cmdline::dumpspec_t->new("h", undef, undef, undef)) ],
+         [ "h", undef, undef, undef ],
+         "dumpspec_t constructor returns a valid dumpspec with only 1 arg");
+
+# TODO: test parse_dumpspecs
+my @specs;
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "h2", "d2"], 0);
+is(@specs, 2, "parse of four elements with no flags yields 2 specs");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", undef, undef ], "..second spec is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "h2", "d2", "ds2" ], $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
+is(@specs, 2, "parse of six elements with CMDLINE_PARSE_DATESTAMP yields 2 specs");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", undef ], "..second spec is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "lv1", "h2", "d2", "ds2", "lv2" ],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 2, "parse of eight elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields 2 specs");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1" ], "..first spec is correct");
+is_deeply([ ds2av($specs[1]) ], [ "h2", "d2", "ds2", "lv2" ], "..second spec is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1", "lv1" ],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 1, "parse of four elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", "lv1" ], "..which is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1", "ds1" ],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 1, "parse of three elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", "ds1", undef ], "..which is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1", "d1" ],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 1, "parse of two elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
+is_deeply([ ds2av($specs[0]) ], [ "h1", "d1", undef, undef ], "..which is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs(["h1" ],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 1, "parse of one element with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields one spec");
+is_deeply([ ds2av($specs[0]) ], [ "h1", undef, undef, undef ], "..which is correct");
+
+@specs = Amanda::Cmdline::parse_dumpspecs([],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL);
+is(@specs, 0, "parse of no elements with CMDLINE_PARSE_DATESTAMP and CMDLINE_PARSE_LEVEL yields no specs");
+
+@specs = Amanda::Cmdline::parse_dumpspecs([],
+               $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP | $Amanda::Cmdline::CMDLINE_PARSE_LEVEL
+               | $Amanda::Cmdline::CMDLINE_EMPTY_TO_WILDCARD);
+is(@specs, 1, "parse of no elements with CMDLINE_EMPTY_TO_WILDCARD yields one spec");
+
+# test format_dumpspec_components
+
+is(Amanda::Cmdline::format_dumpspec_components("h", "di", "ds", "l"),
+   "h di ds l",
+   "format_dumpspec_components works ok");
diff --git a/installcheck/Amanda_Config.pl b/installcheck/Amanda_Config.pl
new file mode 100644 (file)
index 0000000..8a21935
--- /dev/null
@@ -0,0 +1,361 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw(no_plan);
+use Amconfig;
+use strict;
+
+use lib "@amperldir@";
+use Amanda::Paths;
+use Amanda::Config qw( :init :getconf );
+
+my $testconf;
+
+##
+# Try starting with no configuration at all
+ok(config_init(0, ''), "Initialize with no configuration");
+
+##
+# Parse up a basic configuration
+
+# invent "large" values for CONFTYPE_AM64 and CONFTYPE_SIZE
+my $am64_num = '171801575472'; # 0xA000B000C000 / 1024
+my $size_t_num = '2147483647'; # 0x7fffffff
+
+$testconf = Amconfig->new();
+$testconf->add_param('reserve', '75');
+$testconf->add_param('autoflush', 'yes');
+$testconf->add_param('tapedev', '"/dev/foo"');
+$testconf->add_param('bumpsize', $am64_num);
+$testconf->add_param('bumpmult', '1.4');
+$testconf->add_param('reserved-udp-port', '100,200');
+$testconf->add_param('device_output_buffer_size', $size_t_num);
+$testconf->add_param('taperalgo', 'last');
+$testconf->add_param('device_property', '"foo" "bar"');
+$testconf->add_param('device_property', '"blue" "car"');
+$testconf->add_param('displayunit', '"m"');
+$testconf->add_param('debug_auth', '1');
+$testconf->add_tapetype('mytapetype', [
+    'comment' => '"mine"',
+    'length' => '128 M',
+]);
+$testconf->add_dumptype('mydumptype', [
+    'comment' => '"mine"',
+    'priority' => 'high',  # == 2
+    'bumpsize' => $am64_num,
+    'bumpmult' => 1.75,
+    'starttime' => 1829,
+    'holdingdisk' => 'required',
+    'compress' => 'client best',
+    'encrypt' => 'server',
+    'strategy' => 'incronly',
+    'comprate' => '0.25,0.75',
+    'exclude list' => '"foo" "bar"',
+    'exclude list append' => '"true" "star"',
+    'exclude file' => '"foolist"',
+    'include list' => '"bing" "ting"',
+    'include list append' => '"string" "fling"',
+    'include file optional' => '"rhyme"',
+]);
+$testconf->add_interface('inyoface', [
+    'comment' => '"mine"',
+    'use' => '100',
+]);
+$testconf->add_interface('inherface', [
+    'comment' => '"empty"',
+]);
+$testconf->add_holdingdisk('hd1', [
+    'comment' => '"mine"',
+    'directory' => '"/mnt/hd1"',
+    'use' => '100M',
+    'chunksize' => '1024k',
+]);
+$testconf->add_holdingdisk('hd2', [
+    'comment' => '"empty"',
+]);
+$testconf->write();
+
+my $cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
+ok($cfg_ok, "Load test configuration");
+
+SKIP: {
+    skip "error loading config", unless $cfg_ok;
+
+    is(Amanda::Config::get_config_name(), "TESTCONF", 
+       "config_name set");
+    is(Amanda::Config::get_config_dir(), "$CONFIG_DIR/TESTCONF", 
+       "config_dir set");
+    is(Amanda::Config::get_config_filename(),
+       "$CONFIG_DIR/TESTCONF/amanda.conf", 
+       "config_filename set");
+}
+
+SKIP: { # global parameters
+    skip "error loading config", unless $cfg_ok;
+
+    is(getconf($CNF_RESERVE), 75,
+       "integer global confparm");
+    is(getconf($CNF_BUMPSIZE), $am64_num+0,
+       "am64 global confparm");
+    is(getconf($CNF_TAPEDEV), "/dev/foo",
+       "string global confparm");
+    is(getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE), $size_t_num+0,
+       "size global confparm");
+    ok(getconf($CNF_AUTOFLUSH),
+       "boolean global confparm");
+    is(getconf($CNF_TAPERALGO), $Amanda::Config::ALGO_LAST,
+       "taperalgo global confparam");
+    is_deeply([getconf($CNF_RESERVED_UDP_PORT)], [100,200],
+       "intrange global confparm");
+    is(getconf($CNF_DISPLAYUNIT), "M",
+       "displayunit is correctly uppercased");
+    is_deeply(getconf($CNF_DEVICE_PROPERTY),
+             { "foo" => "bar", "blue" => "car" },
+           "proplist global confparm");
+
+    ok(getconf_seen($CNF_TAPEDEV),
+       "'tapedev' parm was seen");
+    ok(!getconf_seen($CNF_NETUSAGE),
+       "'netusage' parm was not seen");
+}
+
+SKIP: { # derived values
+    skip "error loading config", unless $cfg_ok;
+
+    is(Amanda::Config::getconf_unit_divisor(), 1024, 
+       "correct unit divisor (from displayunit -> KB)");
+    ok($Amanda::Config::debug_auth, 
+       "debug_auth setting reflected in global variable");
+    ok(!$Amanda::Config::debug_amandad, 
+       "debug_amandad defaults to false");
+}
+
+SKIP: { # tapetypes
+    skip "error loading config", unless $cfg_ok;
+    my $ttyp = lookup_tapetype("mytapetype");
+    ok($ttyp, "found mytapetype");
+    is(tapetype_getconf($ttyp, $TAPETYPE_COMMENT), 'mine', 
+       "tapetype comment");
+    is(tapetype_getconf($ttyp, $TAPETYPE_LENGTH), 128 * 1024, 
+       "tapetype comment");
+
+    ok(tapetype_seen($ttyp, $TAPETYPE_COMMENT),
+       "tapetype comment was seen");
+    ok(!tapetype_seen($ttyp, $TAPETYPE_LBL_TEMPL),
+       "tapetype lbl_templ was not seen");
+
+    is_deeply([ sort(getconf_list("tapetype")) ],
+             [ sort("mytapetype", "TEST-TAPE") ],
+       "getconf_list lists all tapetypes");
+}
+
+SKIP: { # dumptypes
+    skip "error loading config", unless $cfg_ok;
+
+    my $dtyp = lookup_dumptype("mydumptype");
+    ok($dtyp, "found mydumptype");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_COMMENT), 'mine', 
+       "dumptype string");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_PRIORITY), 2, 
+       "dumptype priority");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), $am64_num+0,
+       "dumptype size");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPMULT), 1.75,
+       "dumptype real");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_STARTTIME), 1829,
+       "dumptype time");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_HOLDINGDISK), $HOLD_REQUIRED,
+       "dumptype holdingdisk");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_COMPRESS), $COMP_BEST,
+       "dumptype compress");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_ENCRYPT), $ENCRYPT_SERV_CUST,
+       "dumptype encrypt");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_STRATEGY), $DS_INCRONLY,
+       "dumptype strategy");
+    is_deeply([dumptype_getconf($dtyp, $DUMPTYPE_COMPRATE)], [0.25, 0.75],
+       "dumptype comprate");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_INCLUDE),
+       { 'file' => [ 'rhyme' ],
+         'list' => [ 'bing', 'ting', 'string', 'fling' ],
+         'optional' => 1 },
+       "dumptype include list");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE),
+       { 'file' => [ 'foolist' ],
+         'list' => [ 'foo', 'bar', 'true', 'star' ],
+         'optional' => 0 },
+       "dumptype exclude list");
+
+    ok(dumptype_seen($dtyp, $DUMPTYPE_EXCLUDE),
+       "'exclude' parm was seen");
+    ok(!dumptype_seen($dtyp, $DUMPTYPE_RECORD),
+       "'record' parm was not seen");
+
+    is_deeply([ sort(getconf_list("dumptype")) ],
+             [ sort(qw(
+               mydumptype
+               NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST
+               SRVCOMPRESS BSD-AUTH KRB4-AUTH NO-RECORD NO-HOLD
+               NO-FULL
+               )) ],
+       "getconf_list lists all dumptypes (including defaults)");
+}
+
+SKIP: { # interfaces
+    skip "error loading config" unless $cfg_ok;
+    my $iface = lookup_interface("inyoface");
+    ok($iface, "found inyoface");
+    is(interface_name($iface), "inyoface",
+       "interface knows its name");
+    is(interface_getconf($iface, $INTER_COMMENT), 'mine', 
+       "interface comment");
+    is(interface_getconf($iface, $INTER_MAXUSAGE), 100, 
+       "interface maxusage");
+
+    $iface = lookup_interface("inherface");
+    ok($iface, "found inherface");
+    ok(interface_seen($iface, $INTER_COMMENT),
+       "seen set for parameters that appeared");
+    ok(!interface_seen($iface, $INTER_MAXUSAGE),
+       "seen not set for parameters that did not appear");
+
+    is_deeply([ sort(getconf_list("interface")) ],
+             [ sort('inyoface', 'inherface', 'default') ],
+       "getconf_list lists all interfaces (in any order)");
+}
+
+SKIP: { # holdingdisks
+    skip "error loading config" unless $cfg_ok;
+    my $hdisk = lookup_holdingdisk("hd1");
+    ok($hdisk, "found hd1");
+    is(holdingdisk_name($hdisk), "hd1",
+       "hd1 knows its name");
+    is(holdingdisk_getconf($hdisk, $HOLDING_COMMENT), 'mine', 
+       "holdingdisk comment");
+    is(holdingdisk_getconf($hdisk, $HOLDING_DISKDIR), '/mnt/hd1',
+       "holdingdisk diskdir (directory)");
+    is(holdingdisk_getconf($hdisk, $HOLDING_DISKSIZE), 100*1024, 
+       "holdingdisk disksize (use)");
+    is(holdingdisk_getconf($hdisk, $HOLDING_CHUNKSIZE), 1024, 
+       "holdingdisk chunksize");
+
+    $hdisk = lookup_holdingdisk("hd2");
+    ok($hdisk, "found hd2");
+    ok(holdingdisk_seen($hdisk, $HOLDING_COMMENT),
+       "seen set for parameters that appeared");
+    ok(!holdingdisk_seen($hdisk, $HOLDING_CHUNKSIZE),
+       "seen not set for parameters that did not appear");
+
+    # only holdingdisks have this linked-list structure
+    # exposed
+    $hdisk = getconf_holdingdisks();
+    like(holdingdisk_name($hdisk), qr/hd[12]/,
+       "one disk is first in list of holdingdisks");
+    $hdisk = holdingdisk_next($hdisk);
+    like(holdingdisk_name($hdisk), qr/hd[12]/,
+       "another is second in list of holdingdisks");
+    ok(!holdingdisk_next($hdisk),
+       "no third holding disk");
+
+    is_deeply([ sort(getconf_list("holdingdisk")) ],
+             [ sort('hd1', 'hd2') ],
+       "getconf_list lists all holdingdisks (in any order)");
+}
+
+##
+# Test configuration dumping
+
+# (uses the config from the previous section)
+
+# fork a child and capture its stdout
+my $pid = open(my $kid, "-|");
+die "Can't fork: $!" unless defined($pid);
+if (!$pid) {
+    Amanda::Config::dump_configuration();
+    exit 1;
+}
+my $dump = join'', <$kid>;
+close $kid;
+
+my $fn = Amanda::Config::get_config_filename();
+like($dump, qr/AMANDA CONFIGURATION FROM FILE "$fn"/,
+    "config filename is included correctly");
+
+like($dump, qr/DEVICE_PROPERTY\s+"foo" "bar"\n/i,
+    "DEVICE_PROPERTY appears in dump output");
+
+like($dump, qr/AMRECOVER_CHECK_LABEL\s+(yes|no)/i,
+    "AMRECOVER_CHECK_LABEL has a trailing space");
+
+like($dump, qr/AMRECOVER_CHECK_LABEL\s+(yes|no)/i,
+    "AMRECOVER_CHECK_LABEL has a trailing space");
+
+like($dump, qr/EXCLUDE\s+LIST "foo" "bar" "true" "star"/i,
+    "EXCLUDE LIST is in the dump");
+like($dump, qr/EXCLUDE\s+FILE "foolist"/i,
+    "EXCLUDE FILE is in the dump");
+like($dump, qr/INCLUDE\s+LIST OPTIONAL "bing" "ting" "string" "fling"/i,
+    "INCLUDE LIST is in the dump");
+like($dump, qr/INCLUDE\s+FILE OPTIONAL "rhyme"/i,
+    "INCLUDE FILE is in the dump");
+
+##
+# Explore a quirk of exinclude parsing.  Only the last
+# exclude (or include) directive affects the 'optional' flag.
+# We may want to change this, but we should do so intentionally.
+# This is also tested by the 'amgetconf' installcheck.
+
+$testconf = Amconfig->new();
+$testconf->add_dumptype('mydumptype', [
+    'exclude list' => '"foo" "bar"',
+    'exclude list optional append' => '"true" "star"',
+    'exclude list append' => '"true" "star"',
+]);
+$testconf->write();
+
+$cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+SKIP: {
+    skip "error loading config", unless $cfg_ok;
+
+    my $dtyp = lookup_dumptype("mydumptype");
+    ok($dtyp, "found mydumptype");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE)->{'optional'}, 0,
+       "'optional' has no effect when not on the last occurrence");
+}
+
+$testconf = Amconfig->new();
+$testconf->add_dumptype('mydumptype', [
+    'exclude file' => '"foo" "bar"',
+    'exclude file optional append' => '"true" "star"',
+    'exclude list append' => '"true" "star"',
+]);
+$testconf->write();
+
+$cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+SKIP: {
+    skip "error loading config", unless $cfg_ok;
+
+    my $dtyp = lookup_dumptype("mydumptype");
+    ok($dtyp, "found mydumptype");
+    is(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE)->{'optional'}, 0,
+       "'optional' has no effect when not on the last occurrence of 'file'");
+}
+
+# TODO:
+# overwrites
+# inheritance
+# more init
diff --git a/installcheck/Amanda_Logfile.pl b/installcheck/Amanda_Logfile.pl
new file mode 100644 (file)
index 0000000..b6c6acd
--- /dev/null
@@ -0,0 +1,282 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw(no_plan);
+use File::Path;
+use Amconfig;
+use strict;
+
+use lib "@amperldir@";
+use Amanda::Paths;
+use Amanda::Tapefile;
+use Amanda::Logfile qw(:logtype_t :program_t open_logfile get_logline close_logfile);
+use Amanda::Config qw( :init :getconf config_dir_relative );
+
+# write a logfile and return the filename
+sub write_logfile {
+    my ($contents) = @_;
+    my $filename = "$AMANDA_TMPDIR/Amanda_Logfile_test.log";
+
+    if (!-e $AMANDA_TMPDIR) {
+       mkpath($AMANDA_TMPDIR);
+    }
+
+    open my $logfile, ">", $filename or die("Could not create temporary log file");
+    print $logfile $contents;
+    close $logfile;
+
+    return $filename;
+}
+
+####
+## RAW LOGFILE ACCESS
+
+my $logfile;
+my $logdata;
+
+##
+# Test out the constant functions
+
+is(logtype_t_to_string($L_MARKER), "L_MARKER", "logtype_t_to_string works");
+is(program_t_to_string($P_DRIVER), "P_DRIVER", "program_t_to_string works");
+
+##
+# Test a simple logfile
+
+$logdata = <<END;
+START planner date 20071026183200
+END
+
+$logfile = open_logfile(write_logfile($logdata));
+ok($logfile, "can open a simple logfile");
+is_deeply([ get_logline($logfile) ], 
+         [ $L_START, $P_PLANNER, "date 20071026183200" ],
+         "reads START line correctly");
+ok(!get_logline($logfile), "no second line");
+close_logfile($logfile);
+
+##
+# Test continuation lines
+
+$logdata = <<END;
+INFO chunker line1
+  line2
+END
+
+$logfile = open_logfile(write_logfile($logdata));
+ok($logfile, "can open a logfile containing conitinuation lines");
+is_deeply([ get_logline($logfile) ],
+         [ $L_INFO, $P_CHUNKER, "line1" ], 
+         "can read INFO line");
+is_deeply([ get_logline($logfile) ],
+         [ $L_CONT, $P_CHUNKER, "line2" ], 
+         "can read continuation line");
+ok(!get_logline($logfile), "no third line");
+close_logfile($logfile);
+
+##
+# Test skipping blank lines
+
+# (retain the two blank lines in the following:)
+$logdata = <<END;
+
+STATS taper foo
+
+END
+
+$logfile = open_logfile(write_logfile($logdata));
+ok($logfile, "can open a logfile containing blank lines");
+is_deeply([ get_logline($logfile) ], 
+         [ $L_STATS, $P_TAPER, "foo" ],
+         "reads non-blank line correctly");
+ok(!get_logline($logfile), "no second line");
+close_logfile($logfile);
+
+##
+# Test BOGUS values and short lines
+
+$logdata = <<END;
+SOMETHINGWEIRD somerandomprog bar
+MARKER amflush
+MARKER amflush put something in curstr
+PART
+END
+
+$logfile = open_logfile(write_logfile($logdata));
+ok($logfile, "can open a logfile containing bogus entries");
+is_deeply([ get_logline($logfile) ], 
+         [ $L_BOGUS, $P_UNKNOWN, "bar" ],
+         "can read line with bogus program and logtype");
+is_deeply([ get_logline($logfile) ], 
+         [ $L_MARKER, $P_AMFLUSH, "" ],
+         "can read line with an empty string");
+ok(get_logline($logfile), "can read third line (to fill in curstr with some text)");
+is_deeply([ get_logline($logfile) ], 
+         [ $L_PART, $P_UNKNOWN, "" ],
+         "can read a one-word line, with P_UNKNOWN");
+ok(!get_logline($logfile), "no next line");
+close_logfile($logfile);
+
+## HIGHER-LEVEL FUNCTIONS
+
+# a utility function for is_deeply checks, below.  Converts a hash to
+# an array, for more succinct comparisons
+sub res2arr {
+    my ($res) = @_;
+    return [
+       $res->{'timestamp'},
+       $res->{'hostname'},
+       $res->{'diskname'},
+       $res->{'level'},
+       $res->{'label'},
+       $res->{'filenum'},
+       $res->{'status'},
+       $res->{'partnum'}
+    ];
+}
+
+# set up a basic config
+my $testconf = Amconfig->new();
+$testconf->add_param("tapecycle", "20");
+$testconf->write();
+
+# load the config
+ok(config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"), "config_init is OK");
+my $tapelist = config_dir_relative("tapelist");
+
+# set up and read the tapelist
+open my $tlf, ">", $tapelist or die("Could not write tapelist");
+print $tlf "20071111010002 TESTCONF004 reuse\n";
+print $tlf "20071110010002 TESTCONF003 reuse\n";
+print $tlf "20071109010002 TESTCONF002 reuse\n";
+print $tlf "20071108010001 TESTCONF001 reuse\n";
+close $tlf;
+Amanda::Tapefile::read_tapelist($tapelist) == 0 or die("Could not read tapelist");
+
+# set up a number of logfiles in logdir.
+my $logf;
+my $logdir = $testconf->{'logdir'};
+
+# (an old log file that should be ignored)
+open $logf, ">", "$logdir/log.20071106010002.0" or die("Could not write logfile");
+print $logf "START taper datestamp 20071107010002 label TESTCONF017 tape 1\n";
+close $logf;
+
+# (a logfile with two tapes)
+open $logf, ">", "$logdir/log.20071106010002.0" or die("Could not write logfile");
+print $logf "START taper datestamp 20071106010002 label TESTCONF018 tape 1\n";
+print $logf "START taper datestamp 20071106010002 label TESTCONF019 tape 2\n";
+close $logf;
+
+open $logf, ">", "$logdir/log.20071108010001.0" or die("Could not write logfile");
+print $logf "START taper datestamp 20071108010001 label TESTCONF001 tape 1\n";
+close $logf;
+
+# a logfile with some detail, to run search_logfile against
+open $logf, ">", "$logdir/log.20071109010002.0" or die("Could not write logfile");
+print $logf <<EOF;
+START taper datestamp 20071109010002 label TESTCONF002 tape 1
+PART taper TESTCONF002 1 clihost /usr 20071109010002 1 0 [regular single part PART]
+DONE taper clihost /usr 20071109010002 1 0 [regular single part DONE]
+PART taper TESTCONF002 2 clihost "/my documents" 20071109010002 1 0 [diskname quoting]
+DONE taper clihost "/my documents" 20071109010002 1 0 [diskname quoting]
+PART taper TESTCONF002 3 thatbox /var 1 [regular 'old style' PART]
+DONE taper thatbox /var 1 [regular 'old style' DONE]
+PART taper TESTCONF002 4 clihost /home 20071109010002 1/5 0 [multi-part dump]
+PART taper TESTCONF002 5 clihost /home 20071109010002 2/5 0 [multi-part dump]
+PART taper TESTCONF002 6 clihost /home 20071109010002 3/5 0 [multi-part dump]
+PART taper TESTCONF002 7 clihost /home 20071109010002 4/5 0 [multi-part dump]
+PART taper TESTCONF002 8 clihost /home 20071109010002 5/5 0 [multi-part dump]
+DONE taper clihost /home 20071109010002 5 0 [multi-part dump]
+PART taper TESTCONF002 9 thatbox /u_lose 20071109010002 1/4 2 [multi-part failure]
+PART taper TESTCONF002 10 thatbox /u_lose 20071109010002 2/4 2 [multi-part failure]
+PART taper TESTCONF002 11 thatbox /u_lose 20071109010002 3/4 2 [multi-part failure]
+FAIL taper thatbox /u_lose 20071109010002 2 "Oh no!"
+DONE taper thatbox /u_lose 20071109010002 4 2 [multi-part failure]
+EOF
+close $logf;
+
+# "old-style amflush log"
+open $logf, ">", "$logdir/log.20071110010002.amflush" or die("Could not write logfile");
+print $logf "START taper datestamp 20071110010002 label TESTCONF003 tape 1\n";
+close $logf;
+
+# "old-style main log"
+open $logf, ">", "$logdir/log.20071111010002" or die("Could not write logfile");
+print $logf "START taper datestamp 20071111010002 label TESTCONF004 tape 1\n";
+close $logf;
+
+is_deeply([ Amanda::Logfile::find_log() ],
+         [ "log.20071111010002", "log.20071110010002.amflush",
+           "log.20071109010002.0", "log.20071108010001.0" ],
+         "find_log returns correct logfiles in the correct order");
+
+my @results;
+my @results_arr;
+
+@results = Amanda::Logfile::search_logfile("TESTCONF002", "20071109010002",
+                                          "$logdir/log.20071109010002.0", 1);
+is($#results+1, 11, "search_logfile returned 11 results");
+
+# sort by filenum so we can compare each to what it should be
+@results = sort { $a->{'filenum'} <=> $b->{'filenum'} } @results;
+
+# and convert the hashes to arrays for easy comparison
+@results_arr = map { res2arr($_) } @results;
+
+is_deeply(\@results_arr,
+       [ [ '20071109010002', 'clihost', '/usr',            0, 'TESTCONF002', 1,  'OK', '1'   ],
+         [ '20071109010002', 'clihost', '/my documents',   0, 'TESTCONF002', 2,  'OK', '1'   ],
+         [ '20071109010002', 'thatbox', '/var',            1, 'TESTCONF002', 3,  'OK', '--'  ],
+         [ '20071109010002', 'clihost', '/home',           0, 'TESTCONF002', 4,  'OK', '1/5' ],
+         [ '20071109010002', 'clihost', '/home',           0, 'TESTCONF002', 5,  'OK', '2/5' ],
+         [ '20071109010002', 'clihost', '/home',           0, 'TESTCONF002', 6,  'OK', '3/5' ],
+         [ '20071109010002', 'clihost', '/home',           0, 'TESTCONF002', 7,  'OK', '4/5' ],
+         [ '20071109010002', 'clihost', '/home',           0, 'TESTCONF002', 8,  'OK', '5/5' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 9,  '"Oh no!"', '1/4' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 10, '"Oh no!"', '2/4' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 11, '"Oh no!"', '3/4' ] ],
+         "results are correct");
+
+my @filtered;
+my @filtered_arr;
+
+@filtered = Amanda::Logfile::dumps_match([@results], "thatbox", undef, undef, undef, 0);
+is($#filtered+1, 4, "four results match 'thatbox'");
+@filtered = sort { $a->{'filenum'} <=> $b->{'filenum'} } @filtered;
+
+@filtered_arr = map { res2arr($_) } @filtered;
+
+is_deeply(\@filtered_arr,
+       [ [ '20071109010002', 'thatbox', '/var',      1, 'TESTCONF002', 3,  'OK',       '--' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 9,  '"Oh no!"', '1/4' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 10, '"Oh no!"', '2/4' ],
+         [ '20071109010002', 'thatbox', '/u_lose',   2, 'TESTCONF002', 11, '"Oh no!"', '3/4' ] ],
+         "results are  correct");
+
+@filtered = Amanda::Logfile::dumps_match([@results], "thatbox", "/var", undef, undef, 0);
+is($#filtered+1, 1, "only one result matches 'thatbox:/var'");
+
+@filtered = Amanda::Logfile::dumps_match([@results], undef, undef, "20071109010002", undef, 0);
+is($#filtered+1, 11, "all 11 results match '20071109010002'");
+
+@filtered = Amanda::Logfile::dumps_match([@results], undef, undef, "20071109010002", undef, 1);
+is($#filtered+1, 8, "of those, 8 results are 'OK'");
+
+@filtered = Amanda::Logfile::dumps_match([@results], undef, undef, undef, "2", 0);
+is($#filtered+1, 3, "3 results are at level 2");
diff --git a/installcheck/Amanda_Types.pl b/installcheck/Amanda_Types.pl
new file mode 100644 (file)
index 0000000..a301f80
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw(no_plan);
+use Amconfig;
+use strict;
+
+use lib "@amperldir@";
+use Amanda::Types;
+
+# Not much to test, but we can at least exercise the constructor and destructor,
+# and the SWIG getters and setters:
+ok(my $df = Amanda::Types::dumpfile_t->new(), "can create a dumpfile_t");
+is($df->{'datestamp'}, '', "newly created dumpfile_t has empty datestamp");
+ok($df->{'name'} = "myhost", "can write to a string in the header");
+is($df->{'name'}, "myhost", "..and get it back");
diff --git a/installcheck/Amconfig.pm.in b/installcheck/Amconfig.pm.in
new file mode 100644 (file)
index 0000000..c2b78fd
--- /dev/null
@@ -0,0 +1,302 @@
+# vim:ft=perl
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amconfig;
+use File::Path;
+use Carp;
+
+=head1 NAME
+
+Amconfig - set up amanda configurations for installcheck testing
+
+=head1 SYNOPSIS
+
+  use Amconfig;
+
+  my $testconf = Amconfig->new();
+  $testconf->add_param("runtapes", "5");
+  $testconf->add_subsec("tapetype", "DUCKTAPE", { length => "10G", filemark => "4096k" });
+  # ...
+  $testconf->write();
+
+The resulting configuration is always named "TESTCONF".  The basic
+configuration contains only a few parameters that are necessary just
+to run Amanda applications in the test environment.  It also contains
+a tapetype, C<TEST-TAPE>.
+
+Note that it's quite possible to produce an invalid configuration with this
+package (and, in fact, some of the tests do just that).
+
+=head2 VTAPES
+
+This module can set up a vtape configuration, replete with the proper
+vtape directories, using C<setup_vtape>.  The vtapes are created under
+the "TESTCONF" configuration directory, for ease of later deletion.  Do
+not store anything large in these vtapes!
+
+=head1 WARNING
+
+Using this module I<will> destroy any existing configuration named
+TESTDIR.  I<Please> do not use this on a production machine!
+
+=head1 FUNCTIONS
+
+=over
+
+=item C<new()>
+
+Create a new configuration object
+
+=cut
+
+sub new {
+    my $class = shift;
+
+    # An instance is a blessed hash containing parameters.  Start with
+    # some defaults to make sure things run.
+    my $infofile = '@CONFIG_DIR@/TESTCONF/curinfo';
+    my $logdir = '@CONFIG_DIR@/TESTCONF/log';
+    my $indexdir = '@CONFIG_DIR@/TESTCONF/index';
+
+    my $self = {
+       'infofile' => $infofile,
+       'logdir' => $logdir,
+       'indexdir' => $indexdir,
+
+       'vtapes' => [],
+
+       # Global params are stored as an arrayref, so that the same declaration
+       # can appear multiple times
+       'params' => [
+           'mailto' => '"nobody@invalidomain"',
+           'dumpuser' => '"' . (getpwuid($<))[0] . '"', # current username
+
+           # These dirs are under CONFIG_DIR just for ease of destruction.
+           # This is not a recommended layout!
+           'infofile' => "\"$infofile\"",
+           'logdir' => "\"$logdir\"",
+           'indexdir' => "\"$indexdir\"",
+
+           'tapetype' => '"TEST-TAPE"',
+       ],
+
+       # Subsections are stored as a hashref of arrayrefs, keyed by
+       # subsection name
+
+       'tapetypes' => {
+           'TEST-TAPE' => [
+               'length' => '50 mbytes',
+               'filemark' => '4 kbytes'
+           ],
+       },
+
+       'dumptypes' => { },
+
+       'interfaces' => { },
+
+       'holdingdisks' => { },
+
+       'dles' => [ ],
+    };
+    bless($self, $class);
+    return $self;
+}
+
+=item C<add_param($param, $value)>
+
+Add the given parameter to the configuration file, overriding any
+previous value.  Note that strings which should be quoted in the configuration
+file itself must be double-quoted here, e.g.,
+
+  $testconf->add_param('org' => '"MyOrganization"');
+
+=cut
+
+sub add_param {
+    my $self = shift;
+    my ($param, $value) = @_;
+
+    push @{$self->{'params'}}, $param, $value;
+}
+
+=item C<add_tapetype($name, $values_hashref)>
+=item C<add_dumptype($name, $values_hashref)>
+=item C<addholdingdisk($name, $values_hashref)>
+=item C<add_interface($name, $values_arrayref)>
+
+Add the given subsection to the configuration file, including all
+values in the arrayref.  The values should be specified as alternating
+key/value pairs.
+
+=cut
+
+sub add_tapetype {
+    my $self = shift;
+    my ($name, $values_arrayref) = @_;
+    $self->{'tapetypes'}{$name} = $values_arrayref;
+}
+
+sub add_dumptype {
+    my $self = shift;
+    my ($name, $values_arrayref) = @_;
+    $self->{'dumptypes'}{$name} = $values_arrayref;
+}
+
+sub add_holdingdisk {
+    my $self = shift;
+    my ($name, $values_arrayref) = @_;
+    $self->{'holdingdisks'}{$name} = $values_arrayref;
+}
+
+sub add_interface {
+    my $self = shift;
+    my ($name, $values_arrayref) = @_;
+    $self->{'interfaces'}{$name} = $values_arrayref;
+}
+
+=item C<add_dle($line)>
+
+Add a disklist entry; C<$line> is inserted verbatim into the disklist.
+
+=cut
+
+sub add_dle {
+    my $self = shift;
+    my ($line) = @_;
+    push @{$self->{'dles'}}, $line;
+}
+
+=item C<setup_vtape()>
+
+Set up to use a single vtape (no changer).  This creates the proper
+directory hierarchy and sets C<tapedev> to the relevant path.
+
+=cut
+
+sub setup_vtape {
+    my $self = shift;
+    my $tapepath = "@CONFIG_DIR@/TESTCONF/vtapes/tape1";
+    push @{$self->{'vtapes'}}, $tapepath;
+    
+    $self->add_param("tapedev", "\"file:$tapepath\"");
+}
+
+=item C<write()>
+
+Write out the accumulated configuration file, along with any other
+files necessary to run Amanda.
+
+=cut
+
+sub write {
+    my $self = shift;
+
+    my $testconf_dir = '@CONFIG_DIR@/TESTCONF';
+    if (-e $testconf_dir) {
+       rmtree($testconf_dir) or die("Could not remove '$testconf_dir'");
+    }
+    mkpath($testconf_dir);
+
+    # set up curinfo dir, etc.
+    mkpath($self->{'infofile'}) or die("Could not create infofile directory");
+    mkpath($self->{'logdir'}) or die("Could not create logdir directory");
+    mkpath($self->{'indexdir'}) or die("Could not create indexdir directory");
+
+    # create any vtapes
+    for my $vtape (@{$self->{'vtapes'}}) {
+       mkpath("$vtape/data") or die("Could not create vtape directory '$vtape/data'");
+    }
+
+    $self->_write_tapelist("$testconf_dir/tapelist");
+    $self->_write_disklist("$testconf_dir/disklist");
+    $self->_write_amanda_conf("$testconf_dir/amanda.conf");
+}
+
+sub _write_tapelist {
+    my $self = shift;
+    my ($filename) = @_;
+
+    # create an empty tapelist
+    open(my $tapelist, ">", $filename);
+    close($tapelist);
+}
+
+sub _write_disklist {
+    my $self = shift;
+    my ($filename) = @_;
+
+    # don't bother writing a disklist if there are no dle's
+    return unless $self->{'dles'};
+
+    open(my $disklist, ">", $filename);
+
+    for my $dle_line (@{$self->{'dles'}}) {
+       print $disklist "$dle_line\n";
+    }
+
+    close($disklist);
+}
+
+sub _write_amanda_conf {
+    my $self = shift;
+    my ($filename) = @_;
+
+    open my $amanda_conf, ">", $filename
+       or croak("Could not open '$filename'");
+
+    # write key/value pairs
+    my @params = @{$self->{'params'}};
+    while (@params) {
+       $param = shift @params;
+       $value = shift @params;
+       print $amanda_conf "$param $value\n";
+    }
+
+    # write out subsections
+    $self->_write_amanda_conf_subsection($amanda_conf, "tapetype", $self->{"tapetypes"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "dumptype", $self->{"dumptypes"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "interface", $self->{"interfaces"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "holdingdisk", $self->{"holdingdisks"});
+
+    close($amanda_conf);
+}
+
+sub _write_amanda_conf_subsection {
+    my $self = shift;
+    my ($amanda_conf, $subsec_type, $subsec_ref) = @_;
+
+    for my $subsec_name (keys %$subsec_ref) {
+       my @values = @{$subsec_ref->{$subsec_name}};
+       
+       if ($subsec_type eq "holdingdisk") {
+           print $amanda_conf "\nholdingdisk $subsec_name {\n";
+       } else {
+           print $amanda_conf "\ndefine $subsec_type $subsec_name {\n";
+       }
+
+       while (@values) {
+           $param = shift @values;
+           $value = shift @values;
+           print $amanda_conf "$param $value\n";
+       }
+       print $amanda_conf "}\n";
+    }
+}
+
+1;
diff --git a/installcheck/Makefile.am b/installcheck/Makefile.am
new file mode 100644 (file)
index 0000000..bb3e938
--- /dev/null
@@ -0,0 +1,59 @@
+# Note that this architecture assumes a full install -- not just server
+# or just client.  Neither is sufficiently test-able on its own.
+
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+
+# Add your tests here.
+
+common_tests = \
+       Amanda_Config \
+       Amanda_Types
+
+server_tests = \
+       Amanda_Changer \
+       Amanda_Cmdline \
+       Amanda_Logfile \
+       amcheckdump \
+       amdevcheck \
+       amgetconf
+
+tests = $(common_tests)
+if WANT_SERVER
+tests += $(server_tests)
+endif
+
+# Add any common files (that should not be run as tests) here:
+test_utils = Amconfig.pm
+
+SCRIPTS_PERL = $(common_tests) $(server_tests) $(test_utils)
+
+# we don't need to syntax check the test scripts..
+CHECK_PERL =
+
+.PHONY: clobber_my_config_is_ok
+clobber_my_config_is_ok:
+       @if test "$(CLOBBER_MY_CONFIG)" != "OK"; then \
+               echo ""; \
+               echo "'make installcheck' is a dangerous tool.  It will overwrite your"; \
+               echo "amanda-client.conf and amandates, and (if it"; \
+               echo "triggers an as-yet undetected bug) may do other unexpected things.  You are"; \
+               echo "strongly encouraged"; \
+               echo "  - not to run installchecks on a production install"; \
+               echo "  - not to run installchecks as root"; \
+               echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \
+               echo "test environment in which"; \
+               echo "potential damage is limited by your filesystem's permissions.  To actually run"; \
+               echo "the installchecks, invoke make"; \
+               echo "as follows:"; \
+               echo "  $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \
+               exit 1; \
+       fi
+
+installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
+       $(mkdir_p) $(AMANDA_TMPDIR)
+       $(PERL) -I$(srcdir) -I$(builddir) -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests)
+       rm -rf "$(CONFIG_DIR)/TESTCONF"
+       rm -rf "$(CONFIG_DIR)/amanda-client.conf"
+       rm -rf "$(DEFAULT_AMANDATES_FILE)"
+       rm -rf "$(GNUTAR_LISTED_INCREMENTAL_DIR)"
diff --git a/installcheck/Makefile.in b/installcheck/Makefile.in
new file mode 100644 (file)
index 0000000..c42c8d1
--- /dev/null
@@ -0,0 +1,958 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+
+# Note that this architecture assumes a full install -- not just server
+# or just client.  Neither is sufficiently test-able on its own.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+@WANT_SERVER_TRUE@am__append_1 = $(server_tests)
+subdir = installcheck
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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@
+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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = 
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# Add your tests here.
+common_tests = \
+       Amanda_Config \
+       Amanda_Types
+
+server_tests = \
+       Amanda_Changer \
+       Amanda_Cmdline \
+       Amanda_Logfile \
+       amcheckdump \
+       amdevcheck \
+       amgetconf
+
+tests = $(common_tests) $(am__append_1)
+
+# Add any common files (that should not be run as tests) here:
+test_utils = Amconfig.pm
+SCRIPTS_PERL = $(common_tests) $(server_tests) $(test_utils)
+
+# we don't need to syntax check the test scripts..
+CHECK_PERL = 
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: 
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  installcheck/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  installcheck/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile
+installdirs:
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) 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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+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
+
+installcheck-am: installcheck-local
+
+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 check-local clean clean-generic \
+       clean-libtool dist-hook 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 installcheck-local \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am uninstall uninstall-am
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+.PHONY: clobber_my_config_is_ok
+clobber_my_config_is_ok:
+       @if test "$(CLOBBER_MY_CONFIG)" != "OK"; then \
+               echo ""; \
+               echo "'make installcheck' is a dangerous tool.  It will overwrite your"; \
+               echo "amanda-client.conf and amandates, and (if it"; \
+               echo "triggers an as-yet undetected bug) may do other unexpected things.  You are"; \
+               echo "strongly encouraged"; \
+               echo "  - not to run installchecks on a production install"; \
+               echo "  - not to run installchecks as root"; \
+               echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \
+               echo "test environment in which"; \
+               echo "potential damage is limited by your filesystem's permissions.  To actually run"; \
+               echo "the installchecks, invoke make"; \
+               echo "as follows:"; \
+               echo "  $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \
+               exit 1; \
+       fi
+
+installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
+       $(mkdir_p) $(AMANDA_TMPDIR)
+       $(PERL) -I$(srcdir) -I$(builddir) -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests)
+       rm -rf "$(CONFIG_DIR)/TESTCONF"
+       rm -rf "$(CONFIG_DIR)/amanda-client.conf"
+       rm -rf "$(DEFAULT_AMANDATES_FILE)"
+       rm -rf "$(GNUTAR_LISTED_INCREMENTAL_DIR)"
+# 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/installcheck/amcheckdump.pl b/installcheck/amcheckdump.pl
new file mode 100644 (file)
index 0000000..ff6a150
--- /dev/null
@@ -0,0 +1,34 @@
+use Test::More qw( no_plan );
+
+use Amconfig;
+
+use lib "@amperldir@";
+use Amanda::Paths;
+
+sub amcheckdump {
+    my $cmd = "$sbindir/amcheckdump " . join(" ", @_) . " 2>&1";
+    my $result = `$cmd`;
+    chomp $result;
+    return $result;
+}
+
+my $testconf;
+
+##
+# First, try amgetconf out without a config
+
+like(amcheckdump(), qr/\AUSAGE:/i, 
+    "bare 'amcheckdump' gives usage message");
+like(amcheckdump("this-probably-doesnt-exist"), qr(could not open conf file)i, 
+    "error message when configuration parameter doesn't exist");
+
+##
+# Now use a config with a vtape
+
+# this is re-created for each test
+$testconf = Amconfig->new();
+$testconf->setup_vtape();
+$testconf->write();
+
+like(amcheckdump("TESTCONF"), qr(could not find)i,
+     "'amcheckdump' on a brand-new config finds no dumps.");
diff --git a/installcheck/amdevcheck.pl b/installcheck/amdevcheck.pl
new file mode 100644 (file)
index 0000000..895f73a
--- /dev/null
@@ -0,0 +1,67 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw( no_plan );
+
+use Amconfig;
+use lib "@amperldir@";
+use Amanda::Paths;
+
+sub amdevcheck {
+    my $cmd = "$sbindir/amdevcheck " . join(" ", @_) . " 2>&1";
+    my $result = `$cmd`;
+    chomp $result;
+    return $result;
+}
+
+my $testconf;
+
+##
+# First, try amgetconf out without a config
+
+like(amdevcheck(), qr(\AUsage: )i, 
+    "bare 'amdevcheck' gives usage message");
+like(amdevcheck("this-probably-doesnt-exist"), qr(could not open conf file)i, 
+    "error message when configuration parameter doesn't exist");
+
+##
+# Next, work against a basically empty config
+
+# this is re-created for each test
+$testconf = Amconfig->new();
+$testconf->add_param("tapedev", '"/dev/null"');
+$testconf->write();
+
+# test some defaults
+like(amdevcheck('TESTCONF'), qr{File /dev/null is not a tape device},
+    "uses tapedev by default");
+
+##
+# Now use a config with a vtape
+
+# this is re-created for each test
+$testconf = Amconfig->new();
+$testconf->setup_vtape();
+$testconf->write();
+
+is_deeply([ sort split "\n", amdevcheck('TESTCONF') ],
+         [ sort "VOLUME_UNLABELED", "VOLUME_ERROR", "DEVICE_ERROR" ],
+    "empty vtape described as VOLUME_UNLABELED, VOLUME_ERROR, DEVICE_ERROR");
+
+like(amdevcheck('TESTCONF', "/dev/null"), qr{File /dev/null is not a tape device},
+    "can override device on the command line");
diff --git a/installcheck/amgetconf.pl b/installcheck/amgetconf.pl
new file mode 100644 (file)
index 0000000..7678fea
--- /dev/null
@@ -0,0 +1,189 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+use Test::More qw(no_plan);
+
+use Amconfig;
+use lib "@amperldir@";
+use Amanda::Paths;
+
+# wrapper to call amgetconf and return the results
+sub amgetconf {
+    # open amgetconf and read from it
+    my $cmd = "$sbindir/amgetconf " . join(" ", @_) . " 2>&1";
+    my $result = `$cmd`;
+    chomp $result;
+    return $result;
+}
+
+# this is re-created for each test
+my $testconf;
+
+##
+# First, try amgetconf out without a config
+
+like(amgetconf(), qr(\AUsage: )i, 
+    "bare 'amgetconf' gives usage message");
+like(amgetconf("this-probably-doesnt-exist"), qr(could not open conf file)i, 
+    "error message when configuration parameter doesn't exist");
+
+##
+# Next, work against a basically empty config
+
+$testconf = Amconfig->new();
+$testconf->write();
+
+# test some defaults
+is(amgetconf('TESTCONF', "reserve"), "100", 
+    "reserve defaults to 100");
+is(amgetconf('TESTCONF', "tapelist"), "tapelist", 
+    "tapelist defaults to 'tapelist'");
+is(amgetconf('TESTCONF', "usetimestamps"), "yes", 
+    "usetimestamps defaults to 'yes'");
+
+# test a nonexistent parameter
+like(amgetconf('TESTCONF', "foos_per_bar"), qr/no such parameter/, 
+    "handles nonexistent parameters");
+
+# test build parameters (just the most common)
+is(amgetconf('TESTCONF', "build.bindir"), $bindir, "build.bindir is correct");
+is(amgetconf('TESTCONF', "build.sbindir"), $sbindir, "build.sbindir is correct");
+is(amgetconf('TESTCONF', "build.amlibexecdir"), $amlibexecdir, "build.amlibexecdir is correct");
+is(amgetconf('TESTCONF', "build.mandir"), $mandir, "build.mandir is correct");
+is(amgetconf('TESTCONF', "build.AMANDA_DBGDIR"), $AMANDA_DBGDIR, "build.AMANDA_DBGDIR is correct");
+is(amgetconf('TESTCONF', "build.AMANDA_TMPDIR"), $AMANDA_TMPDIR, "build.AMANDA_TMPDIR is correct");
+is(amgetconf('TESTCONF', "build.CONFIG_DIR"), $CONFIG_DIR, "build.CONFIG_DIR is correct");
+
+# dbopen, dbclose
+my $dbfile = amgetconf('TESTCONF', "dbopen.foo");
+like($dbfile, qr(^$AMANDA_DBGDIR/server/foo.[0-9]*.debug$),
+    "'amgetconf dbopen.foo' returns a proper debug filename");
+ok(-f $dbfile,
+    "'amgetconf dbopen.foo' creates the debug file");
+like(amgetconf('TESTCONF', "dbclose.foo"), qr/cannot parse/,
+    "dbclose without filename fails");
+is(amgetconf('TESTCONF', "dbclose.foo:$dbfile"), $dbfile, 
+    "'amgetconf dbclose.foo:<filename>' returns the debug filename");
+
+##
+# Test an invalid config file
+
+$testconf = Amconfig->new();
+$testconf->add_param("foos_per_bar", "10");
+$testconf->write();
+
+like(amgetconf('TESTCONF', "foos_per_bar"), qr/errors processing config file/, 
+    "gives error on invalid configuration");
+
+##
+# Now let's fill in some interesting values
+
+$testconf = Amconfig->new();
+$testconf->add_param("reserved-udp-port", '100,200');
+$testconf->add_param("printer", '"/dev/lp"');
+$testconf->add_param("reserve", '27');
+$testconf->write();
+
+is(amgetconf('TESTCONF', "reserved-udp-port"), "100,200", 
+    "correctly returns intrange parameters from the file");
+is(amgetconf('TESTCONF', "printer"), "/dev/lp", 
+    "correctly returns string parameters from the file");
+is(amgetconf('TESTCONF', "reserve"), "27", 
+    "correctly returns integer parameters from the file");
+is(amgetconf('TESTCONF', "rEsErVe"), "27", 
+    "is case-insensitive");
+
+##
+# device_property can appear multiple times
+
+$testconf = Amconfig->new();
+$testconf->add_param("device_property", '"power" "on"');
+$testconf->add_param("device_property", '"turbo" "engaged"');
+$testconf->write();
+
+is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'device_property')))],
+         [sort('"power" "on"', '"turbo" "engaged"')],
+    "device_property can have multiple values");
+
+##
+# Subsections
+
+$testconf = Amconfig->new();
+$testconf->add_tapetype("cassette", [ length => "32 k" ]);
+$testconf->add_tapetype("reel2reel", [ length => "1 M" ]);
+$testconf->add_tapetype("scotch", [ length => "500 bytes" ]); # (use a sharpie)
+$testconf->add_dumptype("testdump", [ comment => '"testdump-dumptype"' ]);
+$testconf->add_interface("testiface", [ use => '10' ]);
+$testconf->add_holdingdisk("hd17", [ chunksize => '128' ]);
+$testconf->write();
+
+is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'tapetype')))],
+         [sort("cassette", "reel2reel", "scotch", "TEST-TAPE")],
+       "--list returns correct set of tapetypes");
+is(amgetconf('TESTCONF', 'tapetype:scotch:length'), '500', 
+    "returns tapetype parameter correctly");
+
+ok(grep { $_ eq 'testdump' } split(/\n/, amgetconf('TESTCONF', '--list', 'dumptype')),
+       "--list returns a test dumptype among the default dumptypes");
+is(amgetconf('TESTCONF', 'dumptype:testdump:comment'), 'testdump-dumptype', 
+    "returns dumptype parameter correctly");
+
+is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'interface')))], 
+          [sort("testiface", "default")],
+       "--list returns correct set of interfaces");
+is(amgetconf('TESTCONF', 'interface:testiface:use'), '10', 
+    "returns interface parameter correctly");
+
+is_deeply([sort(split(/\n/, amgetconf('TESTCONF', '--list', 'holdingdisk')))], 
+         [sort("hd17")], 
+       "--list returns correct set of holdingdisks");
+is(amgetconf('TESTCONF', 'holdingdisk:hd17:chunksize'), '128',
+    "returns holdingdisk parameter correctly");
+
+# non-existent subsection types, names, and parameters
+like(amgetconf('TESTCONF', 'NOSUCHTYPE:testiface:comment'), qr/no such parameter/, 
+    "handles bad subsection type");
+like(amgetconf('TESTCONF', 'dumptype:NOSUCHDUMP:comment'), qr/no such parameter/, 
+    "handles bad dumptype namek");
+like(amgetconf('TESTCONF', 'dumptype:testdump:NOSUCHPARAM'), qr/no such parameter/, 
+    "handles bad dumptype parameter name");
+
+##
+# exclude lists are a bit funny, too
+
+$testconf = Amconfig->new();
+$testconf->add_dumptype("testdump", [
+    "exclude file optional" => '"f1"', # this optional will have no effect
+    "exclude file append" => '"f2"',
+    "exclude list" => '"l1"',
+    "exclude list append" => '"l2"',
+    "include file" => '"ifo"',
+    "include list optional" => '"ilo"',
+    ]);
+$testconf->write();
+
+is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:exclude')))],
+         [sort('FILE "f1" "f2"',
+               'LIST "l1" "l2"')],
+    "exclude files and lists displayed correctly; a non-final optional is ignored");
+
+is_deeply([sort(split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:include')))],
+         [sort('FILE OPTIONAL "ifo"',
+               'LIST OPTIONAL "ilo"')],
+    "a final 'OPTIONAL' makes the whole include/exclude optional")
+
index d0cd8a5e0ebab92f45a1aec40a3833fabdd789ce..1a74ac440dc4fe2c61f7385d1783e02b061232f1 100644 (file)
@@ -2,21 +2,19 @@
 
 transform =    s,x,x,;
 
-if WANT_AMPLOT
-AMPLOT_MAN8_PAGES = amplot.8
-endif
-
-COMMON_MAN8_PAGES = amanda.8
+AMPLOT_MAN_PAGES =  amplot.8
 
-COMMON_MAN5_PAGES = amanda.conf.5 \
+COMMON_MAN_PAGES =  amanda.8 \
+                   amanda.conf.5 \
                    amanda-client.conf.5
 
-#if WANT_SERVER
-SERVER_MAN8_PAGES = amadmin.8 \
+SERVER_MAN_PAGES =  amadmin.8 \
                    amcheck.8 \
                    amcheckdb.8 \
+                   amcheckdump.8 \
                    amcleanup.8 \
                    amdd.8 \
+                   amdevcheck.8 \
                    amdump.8 \
                    amflush.8 \
                    amgetconf.8 \
@@ -31,40 +29,42 @@ SERVER_MAN8_PAGES = amadmin.8 \
                    amtoc.8 \
                    amverify.8 \
                    amverifyrun.8 \
-                   amfetchdump.8 \
+                   amserverconfig.8 \
+                   amaddclient.8 \
+                   amcheckdump.8 \
                    amcrypt.8 \
                    amaespipe.8 \
+                   amgpgcrypt.8 \
+                   amcryptsimple.8  \
                    amcrypt-ossl.8 \
                    amcrypt-ossl-asym.8
-#endif
 
+RECOVER_MAN_PAGES =  amrecover.8
+
+RESTORE_MAN_PAGES =  amrestore.8 \
+                    amfetchdump.8
+
+ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \
+          $(COMMON_MAN_PAGES) \
+          $(COMMON_MAN_PAGES) \
+          $(SERVER_MAN_PAGES) \
+          $(RECOVER_MAN_PAGES) \
+          $(RESTORE_MAN_PAGES)
+
+WANTED_MAN_PAGES = $(COMMON_MAN_PAGES)
+if WANT_AMPLOT
+  WANTED_MAN_PAGES += $(AMPLOT_MAN_PAGES)
+endif
+if WANT_SERVER
+  WANTED_MAN_PAGES += $(SERVER_MAN_PAGES)
+endif
 if WANT_RECOVER
-RECOVER_MAN8_PAGES = amrecover.8
+  WANTED_MAN_PAGES += $(RECOVER_MAN_PAGES)
 endif
-
 if WANT_RESTORE
-RESTORE_MAN8_PAGES = amrestore.8
+  WANTED_MAN_PAGES += $(RESTORE_MAN_PAGES)
 endif
 
-man8_pages = $(COMMON_MAN8_PAGES) \
-           $(AMPLOT_MAN8_PAGES) \
-           $(SERVER_MAN8_PAGES) \
-           $(RECOVER_MAN8_PAGES) \
-           $(RESTORE_MAN8_PAGES)
-
-man5_pages = $(COMMON_MAN5_PAGES)
-
-ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
-          $(COMMON_MAN5_PAGES) \
-          $(COMMON_MAN8_PAGES) \
-          $(SERVER_MAN8_PAGES) \
-          $(RECOVER_MAN8_PAGES) \
-          $(RESTORE_MAN8_PAGES)
-
-# These lines are needed to force automake to set the $man<n>dir variables.
-man5_MANS =
-man8_MANS =
-
 SRCMANPAGEDIR  = $(srcdir)/xml-source
 
 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
@@ -87,64 +87,23 @@ xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
        $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
 
 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/1.72.0/manpages/docbook.xsl $<
+       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/$(XSLREL)/manpages/docbook.xsl $<
 
 else   !ENABLE_MANPAGE_BUILD
 
 %: $(SRCMANPAGEDIR)/%.xml
        @echo WARNING: Not building needed $@ because building manpages is disabled.
+       @echo 'DUMMY' > $@
+
 endif
 
-all: $(ALL_MAN_PAGES)
-
-# this is conditioned on ENABLE_MANPAGE_BUILD; it checks for the
-# existence of the file to be installed when building manpages is
-# not enabled.
-install-data-hook: $(ALL_MAN_PAGES)
-if     ENABLE_MANPAGE_BUILD
-       @list="$(man8_pages)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-               echo chown \"$(BINARY_OWNER)\" $$pa;    \
-               chown "$(BINARY_OWNER)" $$pa;           \
-               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-               chgrp "$(SETUID_GROUP)" $$pa;           \
-       done
-       @list="$(man5_pages)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-               echo chown \"$(BINARY_OWNER)\" $$pa;    \
-               chown "$(BINARY_OWNER)" $$pa;           \
-               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-               chgrp "$(SETUID_GROUP)" $$pa;           \
+# double-check that we don't ship dummy manpages
+dist-hook:
+       for f in $(WANTED_MAN_PAGES); do \
+               if sed -e 1q $(distdir)/$$f | $(GREP) '^DUMMY$$' >/dev/null 2>/dev/null; then \
+                       echo "$(distdir)/$$f is a dummy manpage; cannot create distribution"; \
+                       exit 1; \
+               fi; \
        done
-else   !ENABLE_MANPAGE_BUILD
-       @list="$(man8_pages)"; \
-       for p in $$list; do \
-           if test -e $$p; then \
-               pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-               echo chown \"$(BINARY_OWNER)\" $$pa;    \
-               chown "$(BINARY_OWNER)" $$pa;           \
-               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-               chgrp "$(SETUID_GROUP)" $$pa;           \
-           fi \
-       done
-       @list="$(man5_pages)"; \
-       for p in $$list; do \
-           if test -e $$p; then \
-               pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-               echo chown \"$(BINARY_OWNER)\" $$pa;    \
-               chown "$(BINARY_OWNER)" $$pa;           \
-               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-               chgrp "$(SETUID_GROUP)" $$pa;           \
-           fi \
-       done
-endif
+
+man_MANS = $(WANTED_MAN_PAGES)
index 4fcf3743bd3862c7d982e330ae1a2050a4dd3036..33edd41911ea6b1062d9f2a488311cafde4ce922 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 @SET_MAKE@
 
 # Makefile for amanda man-pages
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -37,46 +33,118 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+@WANT_AMPLOT_TRUE@am__append_1 = $(AMPLOT_MAN_PAGES)
+@WANT_SERVER_TRUE@am__append_2 = $(SERVER_MAN_PAGES)
+@WANT_RECOVER_TRUE@am__append_3 = $(RECOVER_MAN_PAGES)
+@WANT_RESTORE_TRUE@am__append_4 = $(RESTORE_MAN_PAGES)
 subdir = man
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -88,18 +156,17 @@ man5dir = $(mandir)/man5
 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"
 man8dir = $(mandir)/man8
 NROFF = nroff
-MANS = $(man5_MANS) $(man8_MANS)
+MANS = $(man_MANS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 transform = s,x,x,;
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -107,14 +174,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -125,20 +197,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -152,60 +223,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -215,10 +395,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -229,24 +423,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -258,59 +486,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -319,37 +534,44 @@ 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@
 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@
-@WANT_AMPLOT_TRUE@AMPLOT_MAN8_PAGES = amplot.8
-COMMON_MAN8_PAGES = amanda.8
-COMMON_MAN5_PAGES = amanda.conf.5 \
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AMPLOT_MAN_PAGES = amplot.8
+COMMON_MAN_PAGES = amanda.8 \
+                   amanda.conf.5 \
                    amanda-client.conf.5
 
-
-#if WANT_SERVER
-SERVER_MAN8_PAGES = amadmin.8 \
+SERVER_MAN_PAGES = amadmin.8 \
                    amcheck.8 \
                    amcheckdb.8 \
+                   amcheckdump.8 \
                    amcleanup.8 \
                    amdd.8 \
+                   amdevcheck.8 \
                    amdump.8 \
                    amflush.8 \
                    amgetconf.8 \
@@ -364,33 +586,29 @@ SERVER_MAN8_PAGES = amadmin.8 \
                    amtoc.8 \
                    amverify.8 \
                    amverifyrun.8 \
-                   amfetchdump.8 \
+                   amserverconfig.8 \
+                   amaddclient.8 \
+                   amcheckdump.8 \
                    amcrypt.8 \
                    amaespipe.8 \
+                   amgpgcrypt.8 \
+                   amcryptsimple.8  \
                    amcrypt-ossl.8 \
                    amcrypt-ossl-asym.8
 
-#endif
-@WANT_RECOVER_TRUE@RECOVER_MAN8_PAGES = amrecover.8
-@WANT_RESTORE_TRUE@RESTORE_MAN8_PAGES = amrestore.8
-man8_pages = $(COMMON_MAN8_PAGES) \
-           $(AMPLOT_MAN8_PAGES) \
-           $(SERVER_MAN8_PAGES) \
-           $(RECOVER_MAN8_PAGES) \
-           $(RESTORE_MAN8_PAGES)
-
-man5_pages = $(COMMON_MAN5_PAGES)
-ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
-          $(COMMON_MAN5_PAGES) \
-          $(COMMON_MAN8_PAGES) \
-          $(SERVER_MAN8_PAGES) \
-          $(RECOVER_MAN8_PAGES) \
-          $(RESTORE_MAN8_PAGES)
-
-
-# These lines are needed to force automake to set the $man<n>dir variables.
-man5_MANS = 
-man8_MANS = 
+RECOVER_MAN_PAGES = amrecover.8
+RESTORE_MAN_PAGES = amrestore.8 \
+                    amfetchdump.8
+
+ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \
+          $(COMMON_MAN_PAGES) \
+          $(COMMON_MAN_PAGES) \
+          $(SERVER_MAN_PAGES) \
+          $(RECOVER_MAN_PAGES) \
+          $(RESTORE_MAN_PAGES)
+
+WANTED_MAN_PAGES = $(COMMON_MAN_PAGES) $(am__append_1) $(am__append_2) \
+       $(am__append_3) $(am__append_4)
 SRCMANPAGEDIR = $(srcdir)/xml-source
 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
 EXTRA_XML = xslt/expand-sambadoc.xsl \
@@ -403,6 +621,7 @@ EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_XML)
 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
 MOSTLYCLEANFILES = $(GEN_XML)
 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
+man_MANS = $(WANTED_MAN_PAGES)
 all: all-am
 
 .SUFFIXES:
@@ -441,13 +660,9 @@ mostlyclean-libtool:
 
 clean-libtool:
        -rm -rf .libs _libs
-
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
 install-man5: $(man5_MANS) $(man_MANS)
        @$(NORMAL_INSTALL)
-       test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)"
+       test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
        @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
        l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
        for i in $$l2; do \
@@ -492,7 +707,7 @@ uninstall-man5:
        done
 install-man8: $(man8_MANS) $(man_MANS)
        @$(NORMAL_INSTALL)
-       test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
+       test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
        @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
        l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
        for i in $$l2; do \
@@ -543,23 +758,21 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
-       $(mkdir_p) $(distdir)/entities $(distdir)/xslt
-       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
-       list='$(DISTFILES)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -570,12 +783,15 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
 check: check-am
 all-am: Makefile $(MANS)
 installdirs:
        for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -609,7 +825,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
 
 distclean: distclean-am
        -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool
+distclean-am: clean-am distclean-generic
 
 dvi: dvi-am
 
@@ -622,15 +838,21 @@ info: info-am
 info-am:
 
 install-data-am: install-man
-       @$(NORMAL_INSTALL)
-       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
 install-exec-am:
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man: install-man5 install-man8
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -649,81 +871,44 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-man
+uninstall-am: uninstall-man
 
 uninstall-man: uninstall-man5 uninstall-man8
 
+.MAKE: install-am install-strip
+
 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
-       distclean distclean-generic distclean-libtool distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-data-hook install-exec \
-       install-exec-am install-info install-info-am install-man \
-       install-man5 install-man8 install-strip installcheck \
+       dist-hook 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-man5 install-man8 install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
        installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-generic \
        mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-       uninstall-info-am uninstall-man uninstall-man5 uninstall-man8
+       uninstall-man uninstall-man5 uninstall-man8
 
 
 @ENABLE_MANPAGE_BUILD_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
 @ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
 
 @ENABLE_MANPAGE_BUILD_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/1.72.0/manpages/docbook.xsl $<
+@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/$(XSLREL)/manpages/docbook.xsl $<
 
 @ENABLE_MANPAGE_BUILD_FALSE@%: $(SRCMANPAGEDIR)/%.xml
 @ENABLE_MANPAGE_BUILD_FALSE@   @echo WARNING: Not building needed $@ because building manpages is disabled.
-
-all: $(ALL_MAN_PAGES)
-
-# this is conditioned on ENABLE_MANPAGE_BUILD; it checks for the
-# existence of the file to be installed when building manpages is
-# not enabled.
-install-data-hook: $(ALL_MAN_PAGES)
-@ENABLE_MANPAGE_BUILD_TRUE@    @list="$(man8_pages)"; \
-@ENABLE_MANPAGE_BUILD_TRUE@    for p in $$list; do \
-@ENABLE_MANPAGE_BUILD_TRUE@            pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-@ENABLE_MANPAGE_BUILD_TRUE@            $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo chown \"$(BINARY_OWNER)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_TRUE@            chown "$(BINARY_OWNER)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_TRUE@            chgrp "$(SETUID_GROUP)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_TRUE@    done
-@ENABLE_MANPAGE_BUILD_TRUE@    @list="$(man5_pages)"; \
-@ENABLE_MANPAGE_BUILD_TRUE@    for p in $$list; do \
-@ENABLE_MANPAGE_BUILD_TRUE@            pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-@ENABLE_MANPAGE_BUILD_TRUE@            $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo chown \"$(BINARY_OWNER)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_TRUE@            chown "$(BINARY_OWNER)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_TRUE@            echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_TRUE@            chgrp "$(SETUID_GROUP)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_TRUE@    done
-@ENABLE_MANPAGE_BUILD_FALSE@   @list="$(man8_pages)"; \
-@ENABLE_MANPAGE_BUILD_FALSE@   for p in $$list; do \
-@ENABLE_MANPAGE_BUILD_FALSE@       if test -e $$p; then \
-@ENABLE_MANPAGE_BUILD_FALSE@           pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-@ENABLE_MANPAGE_BUILD_FALSE@           $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo chown \"$(BINARY_OWNER)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_FALSE@           chown "$(BINARY_OWNER)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_FALSE@           chgrp "$(SETUID_GROUP)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_FALSE@       fi \
-@ENABLE_MANPAGE_BUILD_FALSE@   done
-@ENABLE_MANPAGE_BUILD_FALSE@   @list="$(man5_pages)"; \
-@ENABLE_MANPAGE_BUILD_FALSE@   for p in $$list; do \
-@ENABLE_MANPAGE_BUILD_FALSE@       if test -e $$p; then \
-@ENABLE_MANPAGE_BUILD_FALSE@           pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-@ENABLE_MANPAGE_BUILD_FALSE@           $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo chown \"$(BINARY_OWNER)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_FALSE@           chown "$(BINARY_OWNER)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_FALSE@           echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
-@ENABLE_MANPAGE_BUILD_FALSE@           chgrp "$(SETUID_GROUP)" $$pa;           \
-@ENABLE_MANPAGE_BUILD_FALSE@       fi \
-@ENABLE_MANPAGE_BUILD_FALSE@   done
+@ENABLE_MANPAGE_BUILD_FALSE@   @echo 'DUMMY' > $@
+
+# double-check that we don't ship dummy manpages
+dist-hook:
+       for f in $(WANTED_MAN_PAGES); do \
+               if sed -e 1q $(distdir)/$$f | $(GREP) '^DUMMY$$' >/dev/null 2>/dev/null; then \
+                       echo "$(distdir)/$$f is a dummy manpage; cannot create distribution"; \
+                       exit 1; \
+               fi; \
+       done
 # 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/man/amaddclient.8 b/man/amaddclient.8
new file mode 100644 (file)
index 0000000..d38c61e
--- /dev/null
@@ -0,0 +1,212 @@
+.\"     Title: amaddclient
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMADDCLIENT" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amaddclient - program to add client to an existing Amanda configuration
+.SH "SYNOPSIS"
+.HP 12
+\fBamaddclient\fR \-\-config \fIconfig\fR ||
+ \-\-client \fIclient\ name\fR ||
+ \-\-diskdev \fIdirectory\ to\ backup\fR [\-\-m] [\-\-dumptype\ \fIstring\fR] [\-\-includefile\ \fIstring\fR] [\-\-includelist\ \fIstring\fR] [\-\-excludefile\ \fIstring\fR] [\-\-excludelist\ \fIstring\fR] [\-\-user\ \fIstring\fR] [\-\-auth\ \fIstring\fR] [\-\-gnutar_list_dir\ \fIstring\fR] [\-\-amandates\ \fIstring\fR] [\-\-no\-client\-update] [\-\-batch] [\-\-help]
+.SH "DESCRIPTION"
+.PP
+After Amanda rpms are successfully installed and
+\fBamserverconfig\fR
+is run,
+\fBamaddclient\fR
+will add client to the
+\fIAmanda\fR
+configuration\.
+\fBamaddclient\fR
+create or update
+\fIAmanda\fR
+disklist file and create or update /var/lib/amanda/\.amandahosts file on the server\.
+.PP
+If \-\-no\-client\-update is not specified,
+\fBamaddclient\fR
+will attempt to update or create /var/lib/amanda/\.amandahost, amanda\-client\.conf and gnutar\-lists on the client\. (See
+ssh\-keygen(1)
+and
+ssh\-add(1)
+for detail\.)
+.PP
+
+\fBamaddclient\fR
+must be run by user amandabackup\.
+.PP
+\-\-config, \-\-client and \-\-diskdev must be specified\.
+.SH "OPTIONS"
+.PP
+.RS 4
+
+Options may be abbreviated, as long as the abbreviation is not ambiguous\. Option argument can either separated by \'=\' or a space\.
+Example: \-\-conf=v253, \-\-client client8\.zmanda\.com
+.RE
+.PP
+\fB\-\-config config\fR
+.RS 4
+\fIAmanda\fR
+configuration which this program will add the client to\.
+.RE
+.PP
+\fB\-\-client client\fR
+.RS 4
+The name of the client machine to add\. FQDN name recommended\.
+.RE
+.PP
+\fB\-\-diskdev diskdev\fR
+.RS 4
+Directory for this
+\fIAmanda\fR
+configuration to backup\.
+.RE
+.PP
+\fB\-\-m\fR
+.RS 4
+Modify existing entry in the disklist file\.
+.sp
+Note: if disklist file has been modified manually, this option might not work\.
+.RE
+.PP
+\fB\-\-dumptype dumptype\fR
+.RS 4
+dumptype to use\. Dumptype must be defined in /etc/amanda/template\.d/dumptypes or /etc/amanda/$config/amanda\.conf file\. Default: [user\-tar]
+.RE
+.PP
+\fB\-\-user string\fR
+.RS 4
+name of user using
+\fBamrecover\fR
+on the client, default is root\.
+.RE
+.PP
+\fB\-\-auth string\fR
+.RS 4
+authentication method to use when running
+\fBamrecover\fR
+from the client , default is bsdtcp\.
+.RE
+.PP
+\fB\-\-gnutar_list_dir string\fR
+.RS 4
+directory where gnutar keep its state file on the client\. Absolute path required\. Default is /var/lib/amanda/gnutar\-lists\. If \-\-no\-client\-update is not set, this program will attempt to create the directory on the client\.
+.RE
+.PP
+\fB\-\-amandates string\fR
+.RS 4
+file where amanda keep the date of each dumplevel on the client, default is /etc/amandates\.
+.RE
+.PP
+\fB\-\-batch\fR
+.RS 4
+Turn on batch mode when copying files to the client, default is off
+.RE
+.PP
+\fB\-\-no\-client\-update\fR
+.RS 4
+If this option is set,
+\fBamaddclient\fR
+will not attempt to update/create \.amandahosts, amanda\-client\.conf and gnutar\-lists file on the client\.
+.RE
+.PP
+\fB\-\-help\fR
+.RS 4
+Display usage\.
+.RE
+.PP
+.RS 4
+If any of the following four options are used,  \fBamaddclient\fR will extend the dumptype definition to an in\-line definition in the disklist file\. See \fBamanda\fR(8) DISKLIST FILE section for detail\.
+.RE
+.PP
+\fB\-\-includefile string\fR
+.RS 4
+string is a glob expression
+.RE
+.PP
+\fB\-\-includelist string\fR
+.RS 4
+string is a file name on the client containing glob expressions\. Specify either \-\-includefile or \-\-includelist\.
+.RE
+.PP
+\fB\-\-excludefile string\fR
+.RS 4
+string is a glob expression
+.RE
+.PP
+\fB\-\-excludelist string\fR
+.RS 4
+string is a file name on the client containing glob expressions\. Specify either \-\-excludefile or \-\-excludelist\.
+.RE
+.SH "FILES"
+.PP
+\fB/var/lib/amanda/template\.d\fR
+.RS 4
+Amanda configuration template files install location
+.RE
+.PP
+\fB/var/lib/amanda\fR
+.RS 4
+amandabackup home directory
+.RE
+.PP
+\fB/var/lib/amanda/\.amandahosts\fR
+.RS 4
+\fIAmanda\fR
+authentication file\.
+.RE
+.PP
+\fB/var/lib/amanda/gnutar\-lists\fR
+.RS 4
+A directory which contains backup timestamp and list of files backed up\.
+.RE
+.PP
+\fB/etc/amanda/$config\fR
+.RS 4
+\fIAmanda\fR
+configuration files location for $config(e\.g: DailySet1)\.
+.RE
+.PP
+\fB/etc/amanda/template\.d\fR
+.RS 4
+A directory contains dumptypes and tapetypes files used by all
+\fIAmanda\fR
+configurations\.
+.RE
+.PP
+\fB/etc/amandates\fR
+.RS 4
+\fIAmanda\fR
+file on the client\. It keeps track of structures of previous dumps\.
+.RE
+.PP
+\fB/tmp/amanda\fR
+.RS 4
+directory contains
+\fIAmanda\fR
+debug log files\.
+.RE
+.SH "RETURN VALUE"
+
+On success, zero is returned\.  On error, 1 is returned\.
+.SH "AUTHOR"
+.PP
+The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\.
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamanda.conf\fR(5),
+\fBamserverconfig\fR(8)
+\fBssh-keygen\fR(1)
+\fBssh-add\fR(1)
+\fBscp\fR(1)
+\fBhttp://wiki.zmanda.com\fR()
index 671439ef4734106b78b1c747951e76923247aea6..a4082f1cb5da0cf963805d7879138e0b7c4854c9 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amadmin
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMADMIN" "8" "06/06/2007" "" ""
+.TH "AMADMIN" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amadmin \- administrative interface to control Amanda backups
+amadmin - administrative interface to control Amanda backups
 .SH "SYNOPSIS"
 .HP 8
 \fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [\fB\-o\ \fR\fIconfigoption\fR]...
@@ -21,12 +21,12 @@ amadmin \- administrative interface to control Amanda backups
 performs various administrative tasks on the
 \fIconfig\fR
 \fIAmanda\fR
-configuration.
+configuration\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "COMMANDS"
 .PP
 Commands that take a
@@ -37,28 +37,28 @@ Commands that take a
 \fIdisklist\fR
 for that
 \fIhostname\fR
-if no disks are specified. Where
+if no disks are specified\. Where
 \fIhostname\fR
 is also marked as being optional, the command operates on all hosts and disks in the
-\fIdisklist\fR. Both
+\fIdisklist\fR\. Both
 \fIhostname\fR
 and
 \fIdisks\fR
 are special expressions; see the "HOST & DISK EXPRESSION" section of
 \fBamanda\fR(8)
-for a description.
+for a description\.
 .PP
 Commands that take one or more
 \fIdumpspec\fR
-parameters operate on the set of dumps specified by all of the expressions. See the "DUMP SPECIFICATIONS" section of
+parameters operate on the set of dumps specified by all of the expressions\. See the "DUMP SPECIFICATIONS" section of
 \fBamanda\fR(8)
-for a description.
+for a description\.
 .PP
 \fBversion\fR
 .RS 4
-Show the current version and some compile time and runtime parameters. The
+Show the current version and some compile time and runtime parameters\. The
 \fIconfig\fR
-parameter must be present but is ignored.
+parameter must be present but is ignored\.
 .RE
 .PP
 \fBforce\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
@@ -69,7 +69,7 @@ on
 \fIhostname\fR
 to bump to a new incremental level during the next
 \fIAmanda\fR
-run.
+run\.
 .RE
 .PP
 \fBforce\-no\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
@@ -80,7 +80,7 @@ on
 \fIhostname\fR
 to not bump to a new incremental level during the next
 \fIAmanda\fR
-run.
+run\.
 .RE
 .PP
 \fBunforce\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
@@ -89,7 +89,7 @@ Undo a previous
 \fBforce\-bump\fR
 or
 \fBforce\-no\-bump\fR
-command.
+command\.
 .RE
 .PP
 \fBforce\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
@@ -100,45 +100,45 @@ on
 \fIhostname\fR
 to do a full (level 0) backup during the next
 \fIAmanda\fR
-run.
+run\.
 .RE
 .PP
 \fBunforce\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
 .RS 4
 Undo a previous
 \fBforce\fR
-command.
+command\.
 .RE
 .PP
-\fBreuse\fR \fItapelabel\fR [ ... ]
+\fBreuse\fR \fItapelabel\fR [ \.\.\. ]
 .RS 4
-The tapes listed will be available for reuse at their point in the tape cycle.
+The tapes listed will be available for reuse at their point in the tape cycle\.
 .RE
 .PP
-\fBno\-reuse\fR \fItapelabel\fR [ ... ]
+\fBno\-reuse\fR \fItapelabel\fR [ \.\.\. ]
 .RS 4
-The tapes listed will not be reused when their turn comes up again in the tape cycle. Note that if this causes the number of reusable tapes to drop below the
-\fBamanda.conf\fR
+The tapes listed will not be reused when their turn comes up again in the tape cycle\. Note that if this causes the number of reusable tapes to drop below the
+\fBamanda\.conf\fR
 \fItapecycle\fR
 value,
 \fIAmanda\fR
-will request new tapes until the count is satisfied again.
+will request new tapes until the count is satisfied again\.
 .sp
 Tape marked
 \fIno\-reuse\fR
 are available for recovery, marking them
 \fIno\-reuse\fR
-is a security to be sure amanda will not overwrite them.
+is a security to be sure amanda will not overwrite them\.
 .RE
 .PP
 \fBdue\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
 .RS 4
-Show when the next full dump is due.
+Show when the next full dump is due\.
 .RE
 .PP
 \fBfind\fR [ \fB\-\-sort\fR \fIhkdlpb\fR ] [ \fIhostname\fR [ \fIdisks\fR ]* ]*
 .RS 4
-Display all backups currently on tape or in the holding disk. The tape label or holding disk filename, file number, and status are displayed.
+Display all backups currently on tape or in the holding disk\. The tape label or holding disk filename, file number, and status are displayed\.
 .sp
 The
 \fB\-\-sort\fR
@@ -155,18 +155,22 @@ option changes the sort order using the following flags:
 .fi
 .RE
 .sp
-An uppercase letter reverses the sort order for that key. The default sort order is
-\fBhkdlpb\fR.
+An uppercase letter reverses the sort order for that key\. The default sort order is
+\fBhkdlpb\fR\.
 .RE
 .PP
-\fBholding delete\fR \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ .. ] ] ]
+\fBholding delete\fR \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \.\. ] ] ]
 .RS 4
-Delete holding files matching the given specification. At least a hostname must be provided.
+Delete holding files matching the given specification\. At least a hostname must be provided\.
 .RE
 .PP
-\fBholding list\fR [\-l] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ .. ] ] ] ]
+\fBholding list\fR [\-l] [\-d] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \.\. ] ] ] ]
 .RS 4
-List holding files matching the given specification, or all holding files if no specification is provided. With '\-l', additional information (size and level) is provided.
+List holding files matching the given specification, or all holding files if no specification is provided\. With \'\-l\', additional information (size, level, and whether the dump is outdated) is provided\. With \'\-d\', only outdated dumps are shown\.
+.sp
+An outdated holding file is one which is not required for a restore of the
+\fImost recent\fR
+dump\. Note that outdated dumps may still be required for restores at earlier dates\. For example, assume that a DLE had a level 0 on Monday, level 1\'s Tuesday through Thursday, and a level 2 on Friday\. Then the files required for a restore of Fridays (the most recent) dump are those from Monday (level 0), Thursday (level 1), and Friday (level 2)\. Tuesday and Wednesday\'s files are outdated\.
 .RE
 .PP
 \fBdelete\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
@@ -177,36 +181,36 @@ on
 \fIhostname\fR
 from the
 \fIAmanda\fR
-database.
+database\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 If you do not also remove the disk from the
 \fIdisklist\fR
 file,
 \fIAmanda\fR
-will treat it as a new disk during the next run.
+will treat it as a new disk during the next run\.
 .RE
 .PP
 \fBtape\fR
 .RS 4
 Display the tape(s)
 \fIAmanda\fR
-expects to write to during the next run. See also
-\fBamcheck\fR(8).
+expects to write to during the next run\. See also
+\fBamcheck\fR(8)\.
 .RE
 .PP
 \fBbumpsize\fR
 .RS 4
-Display the current bump threshold parameters, calculated for all backup levels.
+Display the current bump threshold parameters, calculated for all backup levels\.
 .RE
 .PP
 \fBbalance\fR [ \fB\-\-days\fR \fI<num>\fR ]
 .RS 4
-Display the distribution of full backups throughout the dump schedule.
+Display the distribution of full backups throughout the dump schedule\.
 .RE
 .PP
 \fBexport\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
@@ -216,7 +220,7 @@ Convert records from the
 database to a text format that may be transmitted to another
 \fIAmanda\fR
 machine and
-\fBimport\fRed.
+\fBimport\fRed\.
 .RE
 .PP
 \fBimport\fR
@@ -224,7 +228,7 @@ machine and
 Convert
 \fBexport\fRed records read from standard input to a form
 \fIAmanda\fR
-uses and insert them into the database on this machine.
+uses and insert them into the database on this machine\.
 .RE
 .PP
 \fBdisklist\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
@@ -235,7 +239,7 @@ information for each of the
 \fIdisks\fR
 on
 \fIhostname\fR
-(or all hosts). Mostly used for debugging.
+(or all hosts)\. Mostly used for debugging\.
 .RE
 .PP
 \fBinfo\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
@@ -244,13 +248,13 @@ Display the database record for each of the
 \fIdisks\fR
 on
 \fIhostname\fR
-(or all hosts). Mostly used for debugging.
+(or all hosts)\. Mostly used for debugging\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLES"
 .PP
@@ -258,14 +262,14 @@ Request three specific file systems on
 \fImachine\-a\fR
 get a full level 0 backup during the next
 \fIAmanda\fR
-run.
+run\.
 .sp
 .RS 4
 .nf
 $ amadmin daily force machine\-a / /var /usr
-amadmin: machine\-a:/ is set to a forced level 0 tonight.
-amadmin: machine\-a:/var is set to a forced level 0 tonight.
-amadmin: machine\-a:/usr is set to a forced level 0 tonight.
+amadmin: machine\-a:/ is set to a forced level 0 tonight\.
+amadmin: machine\-a:/var is set to a forced level 0 tonight\.
+amadmin: machine\-a:/usr is set to a forced level 0 tonight\.
 .fi
 .RE
 .PP
@@ -273,15 +277,15 @@ Request all file systems on
 \fImachine\-b\fR
 get a full level 0 backup during the next
 \fIAmanda\fR
-run.
+run\.
 .sp
 .RS 4
 .nf
 $ amadmin daily force machine\-b
-amadmin: machine\-b:/ is set to a forced level 0 tonight.
-amadmin: machine\-b:/var is set to a forced level 0 tonight.
-amadmin: machine\-b:/usr is set to a forced level 0 tonight.
-amadmin: machine\-b:/home is set to a forced level 0 tonight.
+amadmin: machine\-b:/ is set to a forced level 0 tonight\.
+amadmin: machine\-b:/var is set to a forced level 0 tonight\.
+amadmin: machine\-b:/usr is set to a forced level 0 tonight\.
+amadmin: machine\-b:/home is set to a forced level 0 tonight\.
 .fi
 .RE
 .PP
@@ -290,25 +294,25 @@ Undo the previous
 request for
 \fI/home\fR
 on
-\fImachine\-b\fR. The other file systems will still get a full level 0 backup.
+\fImachine\-b\fR\. The other file systems will still get a full level 0 backup\.
 .sp
 .RS 4
 .nf
 $ amadmin daily unforce machine\-b /home
-amadmin: force command for machine\-b:/home cleared.
+amadmin: force command for machine\-b:/home cleared\.
 .fi
 .RE
 .PP
 Locate backup images of
 \fI/var\fR
 from
-\fImachine\-c\fR. The
+\fImachine\-c\fR\. The
 \fItape or file\fR
-column displays either a tape label or a filename depending on whether the image is on tape or is still in the holding disk. If the image is on tape, the
+column displays either a tape label or a filename depending on whether the image is on tape or is still in the holding disk\. If the image is on tape, the
 \fIfile\fR
-column tells you which file on the tape has the image (file number zero is a tape label). This column shows zero and is not meaningful if the image is still in the holding disk. The
+column tells you which file on the tape has the image (file number zero is a tape label)\. This column shows zero and is not meaningful if the image is still in the holding disk\. The
 \fIstatus\fR
-column tells you whether the backup was successful or had some type of error.
+column tells you whether the backup was successful or had some type of error\.
 .sp
 .RS 4
 .nf
@@ -316,7 +320,7 @@ $ amadmin daily find machine\-c /var
 date        host      disk lv tape or file                 file part  status
 2000\-11\-09  machine\-c /var  0 000110                       9   \-\-  OK
 2000\-11\-08  machine\-c /var  2 000109                       2   \-\-  OK
-2000\-11\-07  machine\-c /var  2 /amanda/20001107/machine\-c._var.2  0 OK
+2000\-11\-07  machine\-c /var  2 /amanda/20001107/machine\-c\._var\.2  0 OK
 2000\-11\-06  machine\-c /var  2 000107                       2   \-\-  OK
 2000\-11\-05  machine\-c /var  2 000106                       3   \-\-  OK
 2000\-11\-04  machine\-c /var  2 000105                       2   \-\-  OK
@@ -330,86 +334,86 @@ date        host      disk lv tape or file                 file part  status
 Forget about the
 \fI/workspace\fR
 disk on
-\fImachine\-d\fR. If you do not also remove the disk from the
+\fImachine\-d\fR\. If you do not also remove the disk from the
 \fIdisklist\fR
 file,
 \fIAmanda\fR
-will treat it as a new disk during the next run.
+will treat it as a new disk during the next run\.
 .sp
 .RS 4
 .nf
 $ amadmin daily delete machine\-d /workspace
-amadmin: machine\-d:/workspace deleted from database.
-amadmin: NOTE: you'll have to remove these from the disklist yourself.
+amadmin: machine\-d:/workspace deleted from database\.
+amadmin: NOTE: you\'ll have to remove these from the disklist yourself\.
 .fi
 .RE
 .PP
 Find the next tape
 \fIAmanda\fR
 will use (in this case,
-123456).
+123456)\.
 .sp
 .RS 4
 .nf
 $ amadmin daily tape
-The next \fIAmanda\fR run should go onto tape 123456 or a new tape.
+The next \fIAmanda\fR run should go onto tape 123456 or a new tape\.
 .fi
 .RE
 .PP
-Show how well full backups are balanced across the dump cycle. The
+Show how well full backups are balanced across the dump cycle\. The
 \fIdue\-date\fR
-column is the day the backups are due for a full backup.
+column is the day the backups are due for a full backup\.
 \fI#fs\fR
 shows the number of filesystems doing full backups that night, and
 \fIorig KB\fR
 and
 \fIout KB\fR
-show the estimated total size of the backups before and after any compression, respectively.
+show the estimated total size of the backups before and after any compression, respectively\.
 .PP
 The
 \fIbalance\fR
-column shows how far off that night's backups are from the average size (shown at the bottom of the balance column).
+column shows how far off that night\'s backups are from the average size (shown at the bottom of the balance column)\.
 \fIAmanda\fR
 tries to keep the backups within +/\- 5%, but since the amount of data on each filesystem is always changing, and
 \fIAmanda\fR
-will never delay backups just to rebalance the schedule, it is common for the schedule to fluctuate by larger percentages. In particular, in the case of a tape or backup failure, a bump will occur the following night, which will not be smoothed out until the next pass through the schedule.
+will never delay backups just to rebalance the schedule, it is common for the schedule to fluctuate by larger percentages\. In particular, in the case of a tape or backup failure, a bump will occur the following night, which will not be smoothed out until the next pass through the schedule\.
 .PP
 The last line also shows an estimate of how many
 \fIAmanda\fR
-runs will be made between full backups for a file system. In the example, a file system will probably have a full backup done every eight times
+runs will be made between full backups for a file system\. In the example, a file system will probably have a full backup done every eight times
 \fIAmanda\fR
-is run (e.g. every eight days).
+is run (e\.g\. every eight days)\.
 .sp
 .RS 4
 .nf
 $ amadmin daily balance
  due\-date  #fs   orig KB    out KB  balance
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-11/10 Mon   21    930389    768753    +5.1%
-11/11 Tue   29   1236272    733211    +0.2%
-11/12 Wed   31   1552381    735796    +0.6%
-11/13 Thu   23   1368447    684552    \-6.4%
-11/14 Fri   32   1065603    758155    +3.6%
-11/15 Sat   14   1300535    738430    +0.9%
-11/16 Sun   31   1362696    740365    +1.2%
-11/17 Mon   30   1427936    773397    +5.7%
-11/18 Tue   11   1059191    721786    \-1.3%
-11/19 Wed   19   1108737    661867    \-9.5%
+11/10 Mon   21    930389    768753    +5\.1%
+11/11 Tue   29   1236272    733211    +0\.2%
+11/12 Wed   31   1552381    735796    +0\.6%
+11/13 Thu   23   1368447    684552    \-6\.4%
+11/14 Fri   32   1065603    758155    +3\.6%
+11/15 Sat   14   1300535    738430    +0\.9%
+11/16 Sun   31   1362696    740365    +1\.2%
+11/17 Mon   30   1427936    773397    +5\.7%
+11/18 Tue   11   1059191    721786    \-1\.3%
+11/19 Wed   19   1108737    661867    \-9\.5%
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
 TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 .fi
 .RE
 .SH "FILES"
 .PP
-/usr/local/etc/amanda/\fIconfig\fR/amanda.conf
+/usr/local/etc/amanda/\fIconfig\fR/amanda\.conf
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
@@ -417,4 +421,5 @@ Stefan G. Weichinger,
 \fBamcheck\fR(8),
 \fBamdump\fR(8),
 \fBamrestore\fR(8),
-\fBamfetchdump\fR(8)
+\fBamfetchdump\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index ae0d536f188675056bcc08e48aebc0dc1773c235..a90c65c6f3461e16337e32a9f2be14167630f46f 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amaespipe
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMAESPIPE" "8" "06/06/2007" "" ""
+.TH "AMAESPIPE" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amaespipe \- wrapper program for aespipe
+amaespipe - wrapper program for aespipe
 .SH "SYNOPSIS"
 .HP 10
 \fBamaespipe\fR
@@ -24,12 +24,12 @@ requires
 \fBuuencode\fR
 and
 \fBgpg\fR
-to work. Aespipe is available from
-\fI\%http://loop\-aes.sourceforge.net\fR
+to work\. Aespipe is available from
+\fI\%http://loop-aes.sourceforge.net\fR
 .PP
 
 \fBamaespipe\fR
-will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin.
+will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\.
 .PP
 
 \fBamaespipe\fR
@@ -37,19 +37,20 @@ is called by
 \fBamcrypt\fR
 for
 \fIAmanda\fR
-data encryption.
+data encryption\.
 .PP
 
 \fBamaespipe\fR
-is based on aespipe's bzaespipe program. It calls aespipe to encrypt data using AES256 as the encryption and SHA256 as the hash function. GPG key should be stored in $AMANDA_HOME/.gnupg/am_key.gpg.
+is based on aespipe\'s bzaespipe program\. It calls aespipe to encrypt data using AES256 as the encryption and SHA256 as the hash function\. GPG key should be stored in $AMANDA_HOME/\.gnupg/am_key\.gpg\.
 \fBamaespipe\fR
-reads passphrase from file descriptor 3. During decryption,
+reads passphrase from file descriptor 3\. During decryption,
 \fBamaespipe\fR
-autodects encryption type and hash function from the encrypted image.
+autodects encryption type and hash function from the encrypted image\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBaespipe\fR(1),
 \fBamcrypt\fR(8),
-\fBgpg\fR(1)
+\fBgpg\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
index 51a72dce990da6068b95c9e15c57065f794405a9..f7ae21316235a29edaf0fe5fa8da4adefef74d50 100644 (file)
 .\"     Title: amanda-client.conf
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA\-CLIENT.CONF" "5" "06/06/2007" "" ""
+.TH "AMANDA\-CLIENT\.CONF" "5" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amanda\-client.conf \- Client configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver
+amanda-client.conf - Client configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver
 .SH "DESCRIPTION"
 .PP
-\fIamanda\-client.conf\fR
+\fIamanda\-client\.conf\fR
 is the client configuration file for
-\fIAmanda\fR. This manpage lists the relevant sections and parameters of this file for quick reference.
+\fIAmanda\fR\. This manpage lists the relevant sections and parameters of this file for quick reference\.
 .PP
 The files
-\fB<CONFIG_DIR>/amanda\-client.conf\fR
+\fB<CONFIG_DIR>/amanda\-client\.conf\fR
 and
-\fB<CONFIG_DIR>/<config>/amanda\-client.conf\fR
-are loaded.
+\fB<CONFIG_DIR>/<config>/amanda\-client\.conf\fR
+are loaded\.
 .SH "PARAMETERS"
 .PP
 There are a number of configuration parameters that control the behavior of the
 \fIAmanda\fR
-programs. All have default values, so you need not specify the parameter in
-\fBamanda\-client.conf\fR
-if the default is suitable.
+programs\. All have default values, so you need not specify the parameter in
+\fBamanda\-client\.conf\fR
+if the default is suitable\.
 .PP
-Lines starting with # are ignored, as are blank lines. Comments may be placed on a line with a directive by starting the comment with a #. The remainder of the line is ignored.
+Lines starting with # are ignored, as are blank lines\. Comments may be placed on a line with a directive by starting the comment with a #\. The remainder of the line is ignored\.
 .PP
-Keywords are case insensitive, i.e.
+Keywords are case insensitive, i\.e\.
 \fBauth\fR
 and
 \fBAuth\fR
-are treated the same.
+are treated the same\.
 .PP
 Integer arguments may have one of the following (case insensitive) suffixes, some of which have a multiplier effect:
 .SS "POSSIBLE SUFFIXES"
 .PP
 \fBb byte bytes\fR
 .RS 4
-Some number of bytes.
+Some number of bytes\.
 .RE
 .PP
 \fBbps\fR
 .RS 4
-Some number of bytes per second.
+Some number of bytes per second\.
 .RE
 .PP
 \fBk kb kbyte kbytes kilobyte kilobytes\fR
 .RS 4
-Some number of kilobytes (bytes*1024).
+Some number of kilobytes (bytes*1024)\.
 .RE
 .PP
 \fBkps kbps\fR
 .RS 4
-Some number of kilobytes per second (bytes*1024).
+Some number of kilobytes per second (bytes*1024)\.
 .RE
 .PP
 \fBm mb meg mbyte mbytes megabyte megabytes\fR
 .RS 4
-Some number of megabytes (bytes*1024*1024).
+Some number of megabytes (bytes*1024*1024)\.
 .RE
 .PP
 \fBmps mbps\fR
 .RS 4
-Some number of megabytes per second (bytes*1024*1024).
+Some number of megabytes per second (bytes*1024*1024)\.
 .RE
 .PP
 \fBg gb gbyte gbytes gigabyte gigabytes\fR
 .RS 4
-Some number of gigabytes (bytes*1024*1024*1024).
+Some number of gigabytes (bytes*1024*1024*1024)\.
 .RE
 .PP
 \fBtape tapes\fR
 .RS 4
-Some number of tapes.
+Some number of tapes\.
 .RE
 .PP
 \fBday days\fR
 .RS 4
-Some number of days.
+Some number of days\.
 .RE
 .PP
 \fBweek weeks\fR
 .RS 4
-Some number of weeks (days*7).
+Some number of weeks (days*7)\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 The value
 \fBinf\fR
-may be used in most places where an integer is expected to mean an infinite amount.
+may be used in most places where an integer is expected to mean an infinite amount\.
 .sp
 Boolean arguments may have any of the values
 \fBy\fR,
@@ -114,180 +114,182 @@ to indicate a true state, or
 \fBfalse\fR
 or
 \fBoff\fR
-to indicate a false state. If no argument is given,
+to indicate a false state\. If no argument is given,
 \fBtrue\fR
-is assumed.
+is assumed\.
 .RE
 .SS "PARAMETERS"
 .PP
 \fBconf\fR \fI string\fR
 .RS 4
 Default:
-\fISet by configure\fR. The conf use by amrecover.
+\fISet by configure\fR\. The conf use by amrecover\.
 .RE
 .PP
 \fBindex_server\fR \fI string\fR
 .RS 4
 Default:
-\fISet by configure\fR. The amindexd server amrecover will connect to.
+\fISet by configure\fR\. The amindexd server amrecover will connect to\.
 .RE
 .PP
 \fBtape_server\fR \fI string\fR
 .RS 4
 Default:
-\fISet by configure\fR. The amidxtaped server amrecover will connect to.
+\fISet by configure\fR\. The amidxtaped server amrecover will connect to\.
 .RE
 .PP
 \fBtapedev\fR \fI string\fR
 .RS 4
 Default:
-\fISet by configure\fR. The tapedev amrecover will use.
+\fISet by configure\fR\. The tapedev amrecover will use\.
 .RE
 .PP
 \fBauth\fR \fI string\fR
 .RS 4
 Default:
-\fIbsd\fR. Type of authorization to perform between tape server and backup client hosts.
+\fIbsd\fR\. Type of authorization to perform between tape server and backup client hosts\.
 .sp
-\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream.
+\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream\.
 .sp
-\fBbsdtcp\fR, bsd authorization but use only one tcp connection.
+\fBbsdtcp\fR, bsd authorization but use only one tcp connection\.
 .sp
-\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream.
+\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream\.
 .sp
 \fBkrb4\fR
-to use Kerberos\-IV authorization.
+to use Kerberos\-IV authorization\.
 .sp
 \fBkrb5\fR
-to use Kerberos\-V authorization.
+to use Kerberos\-V authorization\.
+.sp
+\fBlocal\fR, if the client is the server, it doesn\'t require authencation setup\.
 .sp
 \fBrsh\fR
-to use rsh authorization.
+to use rsh authorization\.
 .sp
 \fBssh\fR
-to use OpenSSH authorization.
+to use OpenSSH authorization\.
 .RE
 .PP
 \fBssh_keys\fR \fI string\fR
 .RS 4
 Default:
-\fINo default\fR. The key file the ssh auth will use, it must be the private key. If this parameter is not specified, then the deafult ssh key will be used.
+\fINo default\fR\. The key file the ssh auth will use, it must be the private key\. If this parameter is not specified, then the deafult ssh key will be used\.
 .RE
 .PP
 \fBgnutar_list_dir\fR \fI string\fR
 .RS 4
 Default from configure
-\fI\-\-with\-gnutar\-listdir=DIR\fR. The directory where gnutar keep its state file.
+\fI\-\-with\-gnutar\-listdir=DIR\fR\. The directory where gnutar keep its state file\.
 .RE
 .PP
 \fBamandates\fR \fI string\fR
 .RS 4
 Default:
-\fI/etc/amandates\fR. The file where amanda keep the last date of each dumplevel.
+\fI/etc/amandates\fR\. The file where amanda keep the last date of each dumplevel\.
 .RE
 .PP
 \fBconnect_tries\fR int
 .RS 4
 Default:
-\fI3\fR. How many times the server will try a connection.
+\fI3\fR\. How many times the server will try a connection\.
 .RE
 .PP
 \fBrep_tries\fR int
 .RS 4
 Default:
-\fI5\fR. How many times amandad will resend a REP packet if it doesn't get the ACK packet.
+\fI5\fR\. How many times amandad will resend a REP packet if it doesn\'t get the ACK packet\.
 .RE
 .PP
 \fBdebug_amandad\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the amandad process
+\fI0\fR\. Debug level of the amandad process
 .RE
 .PP
 \fBdebug_amidxtaped\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the amidxtaped process
+\fI0\fR\. Debug level of the amidxtaped process
 .RE
 .PP
 \fBdebug_amindexd\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the amindexd process
+\fI0\fR\. Debug level of the amindexd process
 .RE
 .PP
 \fBdebug_amrecover\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the amrecover process
+\fI0\fR\. Debug level of the amrecover process
 .RE
 .PP
 \fBdebug_auth\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the auth module
+\fI0\fR\. Debug level of the auth module
 .RE
 .PP
 \fBdebug_event\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the event module
+\fI0\fR\. Debug level of the event module
 .RE
 .PP
 \fBdebug_holding\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the holdingdisk module
+\fI0\fR\. Debug level of the holdingdisk module
 .RE
 .PP
 \fBdebug_protocol\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the protocol module
+\fI0\fR\. Debug level of the protocol module
 .RE
 .PP
 \fBdebug_selfcheck\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the selfcheck process
+\fI0\fR\. Debug level of the selfcheck process
 .RE
 .PP
 \fBdebug_sendsize\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the sendsize process
+\fI0\fR\. Debug level of the sendsize process
 .RE
 .PP
 \fBdebug_sendbackup\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the sendbackup process
+\fI0\fR\. Debug level of the sendbackup process
 .RE
 .PP
 \fBreserved\-udp\-port\fR int,int
 .RS 4
 Default: \-\-with\-udpportrange or
-\fI512,1023\fR. Reserved udp port that will be used (amrecover with bsd or bsdudp)
+\fI512,1023\fR\. Reserved udp port that will be used (amrecover with bsd or bsdudp)
 .RE
 .PP
 \fBreserved\-tcp\-port\fR int,int
 .RS 4
 Default: \-\-with\-low\-tcpportrange or
-\fI512,1023\fR. Reserved tcp port that will be used (amrecover with bsdtcp)
+\fI512,1023\fR\. Reserved tcp port that will be used (amrecover with bsdtcp)
 .RE
 .PP
 \fBunreserved\-tcp\-port\fR int,int
 .RS 4
 Default: \-\-with\-tcpportrange or
-\fI1025,65536\fR. Unreserved tcp port that will be used (bsd, bsdudp)
+\fI1025,65536\fR\. Unreserved tcp port that will be used (bsd, bsdudp)
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>: Original text
+<jds@amanda\.org>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion, major update, splitting
 .SH "SEE ALSO"
 .PP
@@ -296,3 +298,4 @@ Stefan G. Weichinger,
 \fBamanda.conf\fR(5),
 \fBamcrypt\fR(8),
 \fBaespipe\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
index f34b9a57af7abd1e8cfdf12407f1697c63511615..2bb579fa4cdcde2d3a152f7bacae05dacc9517c7 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amanda
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA" "8" "06/06/2007" "" ""
+.TH "AMANDA" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amanda \- Advanced Maryland Automatic Network Disk Archiver
+amanda - Advanced Maryland Automatic Network Disk Archiver
 .SH "SYNOPSIS"
 .HP 8
 \fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIoptions\fR]
@@ -97,82 +97,88 @@ amanda \- Advanced Maryland Automatic Network Disk Archiver
 \fBamtoc\fR [\fIoptions\fR] \fIlogfile\fR
 .br
 
-.HP 9
-\fBamverify\fR \fIconfig\fR
+.HP 12
+\fBamcheckdump\fR [\fIoptions\fR] \fIconfig\fR
+.br
+
+.HP 15
+\fBamserverconfig\fR [\fIoptions\fR] \fIconfig\fR
 .br
 
 .HP 12
-\fBamverifyrun\fR \fIconfig\fR
+\fBamaddclient\fR \fIconfig\fR [\fIoptions\fR]
+.br
+
 .SH "DESCRIPTION"
 .PP
 \fIAmanda\fR
-is the "Advanced Maryland Automatic Network Disk Archiver". This manual page gives an overview of the
+is the "Advanced Maryland Automatic Network Disk Archiver"\. This manual page gives an overview of the
 \fIAmanda\fR
-commands and configuration files for quick reference.
+commands and configuration files for quick reference\.
 .PP
 Here are all the
 \fIAmanda\fR
-commands. Each one has its own manual page. See them for all the gory details.
+commands\. Each one has its own manual page\. See them for all the gory details\.
 .PP
 \fBamdump\fR
 .RS 4
 Take care of automatic
 \fIAmanda\fR
-backups. This is normally executed by
+backups\. This is normally executed by
 \fBcron\fR
 on a computer called the
 \fItape server host\fR
 and requests backups of file systems located on
 \fIbackup\fR
-\fIclients\fR.
+\fIclients\fR\.
 \fBAmdump\fR
 backs up all disks in the
 \fIdisklist\fR
 file (discussed below) to tape or, if there is a problem, to a special
 \fIholding\fR
-\fIdisk\fR. After all backups are done,
+\fIdisk\fR\. After all backups are done,
 \fBamdump\fR
-sends mail reporting failures and successes.
+sends mail reporting failures and successes\.
 .RE
 .PP
 \fBamflush\fR
 .RS 4
-Flush backups from the holding disk to tape.
+Flush backups from the holding disk to tape\.
 \fBAmflush\fR
 is used after
 \fBamdump\fR
-has reported it could not write backups to tape for some reason. When this happens, backups stay in the holding disk. Run
+has reported it could not write backups to tape for some reason\. When this happens, backups stay in the holding disk\. Run
 \fBamflush\fR
-after the tape problem is corrected to write backups from the holding disk to tape.
+after the tape problem is corrected to write backups from the holding disk to tape\.
 .RE
 .PP
 \fBamcleanup\fR
 .RS 4
 Clean up after an interrupted
-\fBamdump\fR. This command is only needed if
+\fBamdump\fR\. This command is only needed if
 \fBamdump\fR
 was unable to complete for some reason, usually because the tape server host crashed while
 \fBamdump\fR
-was running.
+was running\.
 .RE
 .PP
 \fBamrecover\fR
 .RS 4
 Provides an interactive interface to browse the
 \fIAmanda\fR
-index files (backup image catalogues) and select which tapes to recover files from. It can also run
+index files (backup image catalogues) and select which tapes to recover files from\. It can also run
 \fBamrestore\fR
-and a restore program (e.g.
-\fBtar\fR) to actually recover the files.
+and a restore program (e\.g\.
+\fBtar\fR) to actually recover the files\.
 .RE
 .PP
 \fBamrestore\fR
 .RS 4
 Read an
 \fIAmanda\fR
-tape, searching for requested backups.
+tape, searching for requested backups\.
 \fBAmrestore\fR
-is suitable for everything from interactive restores of single files to a full restore of all partitions on a failed disk.
+is suitable for everything from interactive restores of single files to a full restore of all partitions on a failed disk\.
 .RE
 .PP
 \fBamfetchdump\fR
@@ -180,105 +186,119 @@ is suitable for everything from interactive restores of single files to a full r
 Performs
 \fIAmanda\fR
 tape restoration, similar to
-\fBamrestore\fR. Additional capabilities include "hands\-off" searching of multiple tapes, automatic retrieval of specific dump files based on dump logs, and assembly of tape\-spanning split dump files.
+\fBamrestore\fR\. Additional capabilities include "hands\-off" searching of multiple tapes, automatic retrieval of specific dump files based on dump logs, and assembly of tape\-spanning split dump files\.
 .RE
 .PP
 \fBamlabel\fR
 .RS 4
 Write an
 \fIAmanda\fR
-format label onto a tape. All
+format label onto a tape\. All
 \fIAmanda\fR
 tapes must be labeled with
-\fBamlabel\fR.
+\fBamlabel\fR\.
 \fBAmdump\fR
 and
 \fBamflush\fR
-will not write to an unlabeled tape (see TAPE MANAGEMENT below).
+will not write to an unlabeled tape (see TAPE MANAGEMENT below)\.
 .RE
 .PP
 \fBamcheck\fR
 .RS 4
-Verify the correct tape is mounted and all file systems on all backup client systems are ready to be backed up. Often run by
+Verify the correct tape is mounted and all file systems on all backup client systems are ready to be backed up\. Often run by
 \fBcron\fR
 before
 \fBamdump\fR
-to generate a mail warning that backups might fail unless corrective action is taken.
+to generate a mail warning that backups might fail unless corrective action is taken\.
 .RE
 .PP
 \fBamadmin\fR
 .RS 4
-Take care of administrative tasks like finding out which tapes are needed to restore a filesystem, forcing hosts to do full backups of selected disks and looking at schedule balance information.
+Take care of administrative tasks like finding out which tapes are needed to restore a filesystem, forcing hosts to do full backups of selected disks and looking at schedule balance information\.
 .RE
 .PP
 \fBamtape\fR
 .RS 4
-Take care of tape changer control operations like loading particular tapes, ejecting tapes and scanning the tape storage slots.
+Take care of tape changer control operations like loading particular tapes, ejecting tapes and scanning the tape storage slots\.
 .RE
 .PP
-\fBamverify\fR
+\fBamcheckdump\fR
 .RS 4
-Check
+Check the results of an
 \fIAmanda\fR
-backup tapes for errors.
+dump\.
+.RE
+.PP
+\fBamserverconfig\fR
+.RS 4
+Program to setup initial
+\fIAmanda\fR
+configuration\.
+.RE
+.PP
+\fBamaddclient\fR
+.RS 4
+Program to add client to an existing
+\fIAmanda\fR
+configuration\.
 .RE
 .PP
 \fBamrmtape\fR
 .RS 4
 Delete a tape from the
 \fIAmanda\fR
-databases.
+databases\.
 .RE
 .PP
 \fBamstatus\fR
 .RS 4
 Report the status of a running or completed
-\fBamdump\fR.
+\fBamdump\fR\.
 .RE
 .PP
 \fBamoverview\fR
 .RS 4
-Display a chart of hosts and file systems backed up every run.
+Display a chart of hosts and file systems backed up every run\.
 .RE
 .PP
 \fBamplot\fR
 .RS 4
 Generate utilization plots of
 \fIAmanda\fR
-runs for performance tuning.
+runs for performance tuning\.
 .RE
 .PP
 \fBamreport\fR
 .RS 4
 Generate an
 \fIAmanda\fR
-summary E\-mail report.
+summary E\-mail report\.
 .RE
 .PP
 \fBamtoc\fR
 .RS 4
 Generate table of content files for
 \fIAmanda\fR
-tapes.
+tapes\.
 .RE
 .PP
 \fBamcheckdb\fR
 .RS 4
 Verify every tape
 \fIAmanda\fR
-knows about is consistent in the database.
+knows about is consistent in the database\.
 .RE
 .PP
 \fBamgetconf\fR
 .RS 4
 Look up parameters in the
 \fIAmanda\fR
-configuration file.
+configuration file\.
 .RE
 .PP
 \fBamtapetype\fR
 .RS 4
-Generate a tapetype definition.
+Generate a tapetype definition\.
 .RE
 .PP
 \fBamaespipe\fR
@@ -293,89 +313,89 @@ Reference encryption program for Amanda symmetric data encryption
 .SH "CONFIGURATION"
 .PP
 There are three user\-editable files that control the behavior of
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .PP
 The first is
-\fBamanda.conf\fR, the main configuration file. It contains parameters to customize
+\fBamanda\.conf\fR, the main configuration file\. It contains parameters to customize
 \fIAmanda\fR
-for the site. Refer to the
+for the site\. Refer to the
 \fBamanda.conf\fR(5), manpage for details on
 \fIAmanda\fR
-configuration parameters.
+configuration parameters\.
 .PP
 Second is the
 \fIdisklist\fR
-file, which lists hosts and disk partitions to back up.
+file, which lists hosts and disk partitions to back up\.
 .PP
 Third is the
 \fItapelist\fR
-file, which lists tapes that are currently active. These files are described in more detail in the following sections.
+file, which lists tapes that are currently active\. These files are described in more detail in the following sections\.
 .PP
 All files are stored in individual configuration directories under
-\fI/usr/local/etc/amanda/\fR. A site will often have more than one configuration. For example, it might have a
+\fI/usr/local/etc/amanda/\fR\. A site will often have more than one configuration\. For example, it might have a
 \fInormal\fR
 configuration for everyday backups and an
 \fIarchive\fR
-configuration for infrequent full archival backups. The configuration files would be stored under directories
+configuration for infrequent full archival backups\. The configuration files would be stored under directories
 \fI/usr/local/etc/amanda/normal/\fR
 and
-\fI/usr/local/etc/amanda/archive/\fR, respectively. Part of the job of an
+\fI/usr/local/etc/amanda/archive/\fR, respectively\. Part of the job of an
 \fIAmanda\fR
-administrator is to create, populate and maintain these directories.
+administrator is to create, populate and maintain these directories\.
 .PP
 All log and database files generated by
 \fIAmanda\fR
-go in corresponding directories somewhere. The exact location is controlled by entries in
-\fBamanda.conf\fR. A typical location would be under
-\fI/var/adm/amanda\fR. For the above example, the files might go in
+go in corresponding directories somewhere\. The exact location is controlled by entries in
+\fBamanda\.conf\fR\. A typical location would be under
+\fI/var/adm/amanda\fR\. For the above example, the files might go in
 \fI/var/adm/amanda/normal/\fR
 and
-\fI/var/adm/amanda/archive/\fR.
+\fI/var/adm/amanda/archive/\fR\.
 .PP
 As log files are no longer needed (no longer contain relevant information),
 \fIAmanda\fR
-cycles them out in various ways, depending on the type of file.
+cycles them out in various ways, depending on the type of file\.
 .PP
 Detailed information about
 \fBamdump\fR
 runs are stored in files named
-\fBamdump.\fR\fINN\fR
+\fBamdump\.\fR\fINN\fR
 where
 \fINN\fR
-is a sequence number, with 1 being the most recent file.
+is a sequence number, with 1 being the most recent file\.
 \fBAmdump\fR
 rotates these files each run, keeping roughly the last
 \fBtapecycle\fR
-(see below) worth of them.
+(see below) worth of them\.
 .PP
 The file used by
 \fBamreport\fR
 to generate the mail summary is named
-\fBlog.\fR\fIYYYYMMDD.NN\fR
+\fBlog\.\fR\fIYYYYMMDD\.NN\fR
 where
 \fIYYYYMMDD\fR
 is the datestamp of the start of the
 \fBamdump\fR
 run and
 \fINN\fR
-is a sequence number started at 0. At the end of each
+is a sequence number started at 0\. At the end of each
 \fBamdump\fR
 run, log files for runs whose tapes have been reused are renamed into a subdirectory of the main log directory (see the
 \fBlogdir\fR
 parameter below) named
-\fBoldlog\fR. It is up to the
+\fBoldlog\fR\. It is up to the
 \fIAmanda\fR
-administrator to remove them from this directory when desired.
+administrator to remove them from this directory when desired\.
 .PP
 Index (backup image catalogue) files older than the full dump matching the oldest backup image for a given client and disk are removed by
 \fBamdump\fR
-at the end of each run.
+at the end of each run\.
 .SH "DISKLIST FILE"
 .PP
 The
 \fIdisklist\fR
 file determines which disks will be backed up by
-\fIAmanda\fR. The file usually contains one line per disk:
+\fIAmanda\fR\. The file usually contains one line per disk:
 .sp
 .RS 4
 .nf
@@ -385,58 +405,58 @@ file determines which disks will be backed up by
 .PP
 All pairs [
 \fIhostname diskname\fR
-] must be unique.
+] must be unique\.
 .PP
-Lines starting with # are ignored, as are blank lines. The fields have the following meanings:
+Lines starting with # are ignored, as are blank lines\. The fields have the following meanings:
 .PP
 \fIhostname\fR
 .RS 4
-The name of the host to be backed up. If
+The name of the host to be backed up\. If
 \fBdiskdevice\fR
 refers to a PC share, this is the host
 \fIAmanda\fR
 will run the Samba
 \fBsmbclient\fR
-program on to back up the share.
+program on to back up the share\.
 .RE
 .PP
 \fIdiskname\fR
 .RS 4
-The name of the disk (a label). In most case, you set your
+The name of the disk (a label)\. In most case, you set your
 \fBdiskname\fR
 to the
 \fBdiskdevice\fR
-and you don't set the
-\fBdiskdevice.\fR
+and you don\'t set the
+\fBdiskdevice\.\fR
 If you want multiple entries with the same
 \fBdiskdevice\fR, you must set a different
 \fBdiskname\fR
-for each entry. It's the
+for each entry\. It\'s the
 \fBdiskname\fR
 that you use on the commandline for any
 \fIAmanda\fR
-command. Look at the example/disklist file for example.
+command\. Look at the example/disklist file for example\.
 .RE
 .PP
 \fIdiskdevice\fR
 .RS 4
-Default: same as diskname. The name of the disk device to be backed up. It may be a full device name, a device name without the
+Default: same as diskname\. The name of the disk device to be backed up\. It may be a full device name, a device name without the
 \fI/dev/\fR
-prefix, e.g.
+prefix, e\.g\.
 \fIsd0a\fR, or a mount point such as
-\fI/usr\fR.
+\fI/usr\fR\.
 .sp
-It may also refer to a PC share by starting the name with two (forward) slashes, e.g.
-\fI//some\-pc/home\fR. In this case, the
+It may also refer to a PC share by starting the name with two (forward) slashes, e\.g\.
+\fI//some\-pc/home\fR\. In this case, the
 \fBprogram\fR
 option in the associated
 \fBdumptype\fR
 must be entered as
-\fBGNUTAR\fR. It is the combination of the double slash disk name and
+\fBGNUTAR\fR\. It is the combination of the double slash disk name and
 \fBprogram GNUTAR\fR
 in the
 \fBdumptype\fR
-that triggers the use of Samba.
+that triggers the use of Samba\.
 .RE
 .PP
 \fIdumptype\fR
@@ -444,26 +464,26 @@ that triggers the use of Samba.
 Refers to a
 \fBdumptype\fR
 defined in the
-\fBamanda.conf\fR
-file.
+\fBamanda\.conf\fR
+file\.
 \fIDumptype\fRs specify backup related parameters, such as whether to compress the backups, whether to record backup results in
-\fI/etc/dumpdates\fR, the disk's relative priority, etc.
+\fI/etc/dumpdates\fR, the disk\'s relative priority, etc\.
 .RE
 .PP
 \fIspindle\fR
 .RS 4
 Default:
-\fB\-1\fR. A number used to balance backup load on a host.
+\fB\-1\fR\. A number used to balance backup load on a host\.
 \fIAmanda\fR
-will not run multiple backups at the same time on the same spindle, unless the spindle number is \-1, which means there is no spindle restriction.
+will not run multiple backups at the same time on the same spindle, unless the spindle number is \-1, which means there is no spindle restriction\.
 .RE
 .PP
 \fIinterface\fR
 .RS 4
 Default:
-\fIlocal\fR. The name of a network interface definition in the
-\fBamanda.conf\fR
-file, used to balance network load.
+\fIlocal\fR\. The name of a network interface definition in the
+\fBamanda\.conf\fR
+file, used to balance network load\.
 .RE
 .PP
 Instead of naming a
@@ -472,13 +492,13 @@ Instead of naming a
 options within curly braces, one per line, just like a
 \fBdumptype\fR
 definition in
-\fBamanda.conf\fR. Since pre\-existing
+\fBamanda\.conf\fR\. Since pre\-existing
 \fBdumptype\fRs are valid option names, this syntax may be used to customize
-\fBdumptype\fRs for particular disks.
+\fBdumptype\fRs for particular disks\.
 .PP
 A line break
 \fBmust\fR
-follow the left curly bracket.
+follow the left curly bracket\.
 .PP
 For instance, if a
 \fBdumptype\fR
@@ -498,9 +518,9 @@ is used for most disks, but use of the holding disk needs to be disabled for the
 .PP
 The
 \fItapelist\fR
-file contains the list of tapes in active use. This file is maintained entirely by
+file contains the list of tapes in active use\. This file is maintained entirely by
 \fIAmanda\fR
-and should not be created or edited during normal operation. It contains lines of the form:
+and should not be created or edited during normal operation\. It contains lines of the form:
 .PP
 .RS 4
 .nf
@@ -521,16 +541,16 @@ tell
 whether the tape may be reused, etc (see the
 \fBreuse\fR
 options of
-\fBamadmin\fR).
+\fBamadmin\fR)\.
 .PP
 \fBAmdump\fR
 and
 \fBamflush\fR
-will refuse to write to an unlabeled tape, or to a labeled tape that is considered active. There must be more tapes in active rotation (see the
+will refuse to write to an unlabeled tape, or to a labeled tape that is considered active\. There must be more tapes in active rotation (see the
 \fBtapecycle\fR
 option) than there are runs in the backup cycle (see the
 \fBdumpcycle\fR
-option) to prevent overwriting a backup image that would be needed to do a full recovery.
+option) to prevent overwriting a backup image that would be needed to do a full recovery\.
 .SH "OUTPUT DRIVERS"
 .PP
 The normal value for the
@@ -540,10 +560,10 @@ parameter, or for what a tape changer returns, is a full path name to a non\-rew
 or
 \fI/dev/rmt/0mn\fR
 or
-\fI/dev/nst0.1\fR
-or whatever conventions the operating system uses.
+\fI/dev/nst0\.1\fR
+or whatever conventions the operating system uses\.
 \fIAmanda\fR
-provides additional application level drivers that support non\-traditional tape\-simulations or features. To access a specific output driver, set
+provides additional application level drivers that support non\-traditional tape\-simulations or features\. To access a specific output driver, set
 \fBtapedev\fR
 (or configure your changer to return) a string of the form
 \fIdriver\fR:\fIdriver\-info\fR
@@ -551,15 +571,15 @@ where
 \fIdriver\fR
 is one of the supported drivers and
 \fIdriver\-info\fR
-is optional additional information needed by the driver.
+is optional additional information needed by the driver\.
 .PP
 The supported drivers are:
 .PP
 \fItape\fR
 .RS 4
-This is the default driver. The
+This is the default driver\. The
 \fIdriver\-info\fR
-is the tape device name. Entering
+is the tape device name\. Entering
 .sp
 .RS 4
 .nf
@@ -581,7 +601,7 @@ tapedev tape:/dev/rmt/0mn
 This driver throws away anything written to it and returns EOF for any reads except a special case is made for reading a label, in which case a "fake" value is returned that
 \fIAmanda\fR
 checks for and allows through regardless of what you have set in
-\fBlabelstr\fR. The
+\fBlabelstr\fR\. The
 \fIdriver\-info\fR
 field is not used and may be left blank:
 .sp
@@ -596,17 +616,17 @@ The
 \fIlength\fR
 value from the associated
 \fBtapetype\fR
-is used to limit the amount of data written. When the limit is reached, the driver will simulate end of tape.
+is used to limit the amount of data written\. When the limit is reached, the driver will simulate end of tape\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 This driver should only be used for debugging and testing, and probably only with the
 \fBrecord\fR
 option set to
-\fIno\fR.
+\fIno\fR\.
 .RE
 .PP
 \fIrait\fR
@@ -614,11 +634,11 @@ option set to
 \fIR\fRedundant
 \fIA\fRrray of
 \fII\fRnexpensive (?)
-\fIT\fRapes. Reads and writes tapes mounted on multiple drives by spreading the data across N\-1 drives and using the last drive for a checksum. See docs/RAIT for more information.
+\fIT\fRapes\. Reads and writes tapes mounted on multiple drives by spreading the data across N\-1 drives and using the last drive for a checksum\. See docs/RAIT for more information\.
 .sp
 The
 \fIdriver\-info\fR
-field describes the devices to use. Curly braces indicate multiple replacements in the string. For instance:
+field describes the devices to use\. Curly braces indicate multiple replacements in the string\. For instance:
 .sp
 .sp
 .RS 4
@@ -636,49 +656,49 @@ would use the following devices:
 .PP
 \fIfile\fR
 .RS 4
-This driver emulates a tape device with a set of files in a directory. The
+This driver emulates a tape device with a set of files in a directory\. The
 \fIdriver\-info\fR
-field must be the name of an existing directory. The driver will test for a subdirectory of that named
+field must be the name of an existing directory\. The driver will test for a subdirectory of that named
 \fIdata\fR
 and return
 \fBoffline\fR
-until it is present. When present, the driver uses two files in the
+until it is present\. When present, the driver uses two files in the
 \fIdata\fR
-subdirectory for each tape file. One contains the actual data. The other contains record length information.
+subdirectory for each tape file\. One contains the actual data\. The other contains record length information\.
 .sp
 The driver uses a file named
 \fIstatus\fR
 in the
 \fBfile\fR
-device directory to hold driver status information, such as tape position. If not present, the driver will create it as though the device is rewound.
+device directory to hold driver status information, such as tape position\. If not present, the driver will create it as though the device is rewound\.
 .sp
 The
 \fIlength\fR
 value from the associated
 \fBtapetype\fR
-is used to limit the amount of data written. When the limit is reached, the driver will simulate end of tape.
+is used to limit the amount of data written\. When the limit is reached, the driver will simulate end of tape\.
 .sp
 One way to use this driver with a real device such as a CD\-writer is to create a directory for the
 \fBfile\fR
-device and one or more other directories for the actual data. Create a symlink named
+device and one or more other directories for the actual data\. Create a symlink named
 \fIdata\fR
 in the
 \fBfile\fR
-directory to one of the data directories. Set the
+directory to one of the data directories\. Set the
 \fBtapetype\fR
-length to whatever the medium will hold.
+length to whatever the medium will hold\.
 .sp
 When
 \fIAmanda\fR
 fills the
 \fBfile\fR
-device, remove the symlink and (optionally) create a new symlink to another data area. Use a CD writer software package to burn the image from the first data area.
+device, remove the symlink and (optionally) create a new symlink to another data area\. Use a CD writer software package to burn the image from the first data area\.
 .sp
 To read the CD, mount it and create the
 \fIdata\fR
 symlink in the
 \fBfile\fR
-device directory.
+device directory\.
 .RE
 .SH "AUTHORIZATION"
 .PP
@@ -686,37 +706,37 @@ device directory.
 processes on the tape server host run as the
 \fBdumpuser\fR
 user listed in
-\fBamanda.conf\fR. When they connect to a backup client, they do so with an
-\fIAmanda\fR\-specific protocol. They do not, for instance, use
+\fBamanda\.conf\fR\. When they connect to a backup client, they do so with an
+\fIAmanda\fR\-specific protocol\. They do not, for instance, use
 \fBrsh\fR
 or
 \fBssh\fR
-directly.
+directly\.
 .PP
 On the client side, the
 \fBamandad\fR
 daemon validates the connection using one of several methods, depending on how it was compiled and on options it is passed:
 .PP
-\&.rhosts
+\.rhosts
 .RS 4
 Even though
 \fIAmanda\fR
 does not use
 \fBrsh\fR, it can use
-\fB.rhosts\fR\-style authentication and a
-\fB.rhosts\fR
-file.
+\fB\.rhosts\fR\-style authentication and a
+\fB\.rhosts\fR
+file\.
 .RE
 .PP
-\&.amandahosts
+\.amandahosts
 .RS 4
 This is essentially the same as
-\fB.rhosts\fR
-authentication except a different file, with almost the same format, is used. This is the default mechanism built into
-\fIAmanda\fR.
+\fB\.rhosts\fR
+authentication except a different file, with almost the same format, is used\. This is the default mechanism built into
+\fIAmanda\fR\.
 .sp
 The format of the
-\fI.amandahosts\fR
+\fI\.amandahosts\fR
 file is:
 .sp
 \fIhostname\fR
@@ -729,11 +749,11 @@ file is:
 If
 \fIusername\fR
 is ommitted, it defaults to the user running
-\fBamandad\fR, i.e. the user listed in the
+\fBamandad\fR, i\.e\. the user listed in the
 \fBinetd\fR
 or
 \fBxinetd\fR
-configuration file.
+configuration file\.
 .sp
 The
 \fIservice\fR
@@ -744,7 +764,7 @@ is a list of the service the client is authorized to execute:
 \fBsendsize\fR,
 \fBsendbackup\fR,
 \fBamindexd\fR,
-\fBamidxtaped\fR.
+\fBamidxtaped\fR\.
 \fBamdump\fR
 is a shortcut for "noop selfcheck sendsize sendbackup"
 .RE
@@ -752,18 +772,18 @@ is a shortcut for "noop selfcheck sendsize sendbackup"
 Kerberos
 .RS 4
 \fIAmanda\fR
-may use the Kerberos authentication system. Further information is in the
+may use the Kerberos authentication system\. Further information is in the
 \fBdocs/KERBEROS\fR
 file that comes with an
 \fIAmanda\fR
-distribution.
+distribution\.
 .sp
 For Samba access,
 \fIAmanda\fR
 needs a file on the Samba server (which may or may not also be the tape server) named
 \fI/etc/amandapass\fR
-with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated. By default, the user used to connect to the PC is the same for all PC's and is compiled into
-\fIAmanda\fR. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password. For instance:
+with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated\. By default, the user used to connect to the PC is the same for all PC\'s and is compiled into
+\fIAmanda\fR\. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password\. For instance:
 .sp
 .RS 4
 .nf
@@ -771,20 +791,20 @@ with share names, (clear text) passwords and (optional) domain names, in that or
   //another\-pc/disk otheruser%otherpw
 .fi
 .RE
-With clear text passwords, this file should obviously be tightly protected. It only needs to be readable by the
-\fIAmanda\fR\-user on the Samba server.
+With clear text passwords, this file should obviously be tightly protected\. It only needs to be readable by the
+\fIAmanda\fR\-user on the Samba server\.
 .sp
 You can find further information in the
 \fBdocs/SAMBA\fR
 file that comes with an
 \fIAmanda\fR
-distribution.
+distribution\.
 .RE
 .SH "HOST & DISK EXPRESSION"
 .PP
-All host and disk arguments to programs are special expressions. The command applies to all disks that match your arguments. This section describes the matcher.
+All host and disk arguments to programs are special expressions\. The command applies to all disks that match your arguments\. This section describes the matcher\.
 .PP
-The matcher matches by word, each word is a glob expression, words are separated by the separator '.' for host and '/' for disk. You can anchor the expression at left with a '^'. You can anchor the expression at right with a '$'. The matcher is case insensitive for host but is case sensitive for disk. A match succeeds if all words in your expression match contiguous words in the host or disk.
+The matcher matches by word, each word is a glob expression, words are separated by the separator \'\.\' for host and \'/\' for disk\. You can anchor the expression at left with a \'^\'\. You can anchor the expression at right with a \'$\'\. The matcher is case insensitive for host but is case sensitive for disk\. A match succeeds if all words in your expression match contiguous words in the host or disk\.
 .TS
 tab(:);
 l l
@@ -795,7 +815,7 @@ l l
 l l
 l l.
 T{
-\&.
+\.
 T}:T{
 word separator for a host
 T}
@@ -830,7 +850,6 @@ T}:T{
 match zero or more characters including the separator
 T}
 .TE
-.sp
 .PP
 Some examples:
 .TS
@@ -862,130 +881,130 @@ T}:T{
 WILL NOT MATCH
 T}
 T{
-\ 
+hosta
 T}:T{
-ho.aina.org
+hosta
 T}:T{
-\ 
+hostb
 T}
 T{
-^hosta
+\ 
 T}:T{
-hosta
+hoSTA\.dOMAIna\.ORG
 T}:T{
-foo.hosta.org
+\ 
 T}
 T{
-sda*
+\ 
 T}:T{
-/dev/sda1
+foo\.hosta\.org
 T}:T{
 \ 
 T}
 T{
-\ 
+host
 T}:T{
-/dev/sda12
+host
 T}:T{
-\ 
+hosta
 T}
 T{
-/opt
+host?
 T}:T{
-opt (disk)
+hosta
 T}:T{
-opt (host)
+host
 T}
 T{
-\&.opt.
+\ 
 T}:T{
-opt (host)
+hostb
 T}:T{
-opt (disk)
+\ 
 T}
 T{
-/
+ho*na
 T}:T{
-/
+hoina
 T}:T{
-any other disk
+ho\.aina\.org
 T}
 T{
-/usr
+ho**na
 T}:T{
-/usr
+hoina
 T}:T{
 \ 
 T}
 T{
 \ 
 T}:T{
-/usr/opt
+ho\.aina\.org
 T}:T{
 \ 
 T}
 T{
-/usr$
+^hosta
 T}:T{
-/usr
+hosta
 T}:T{
-/usr/opt
+foo\.hosta\.org
 T}
 T{
-hosta
+sda*
 T}:T{
-hosta
+/dev/sda1
 T}:T{
-hostb
+\ 
 T}
 T{
 \ 
 T}:T{
-hoSTA.dOMAIna.ORG
+/dev/sda12
 T}:T{
 \ 
 T}
 T{
-\ 
+/opt
 T}:T{
-foo.hosta.org
+opt (disk)
 T}:T{
-\ 
+opt (host)
 T}
 T{
-host
+\.opt\.
 T}:T{
-host
+opt (host)
 T}:T{
-hosta
+opt (disk)
 T}
 T{
-host?
+/
 T}:T{
-hosta
+/
 T}:T{
-host
+any other disk
 T}
 T{
-\ 
+/usr
 T}:T{
-hostb
+/usr
 T}:T{
 \ 
 T}
 T{
-ho*na
+\ 
 T}:T{
-hoina
+/usr/opt
 T}:T{
-ho.aina.org
+\ 
 T}
 T{
-ho**na
+/usr$
 T}:T{
-hoina
+/usr
 T}:T{
-\ 
+/usr/opt
 T}
 .TE
 .sp
@@ -993,7 +1012,7 @@ T}
 .PP
 A
 \fIdatestamp\fR
-expression is a range expression where we only match the prefix. Leading ^ is removed. Trailing $ forces an exact match.
+expression is a range expression where we only match the prefix\. Leading ^ is removed\. Trailing $ forces an exact match\.
 .TS
 allbox tab(:);
 l l
@@ -1039,12 +1058,11 @@ T}:T{
 match only 200010
 T}
 .TE
-.sp
 .PP
 .SH "DUMP SPECIFICATIONS"
 .PP
-A dump specification selects one or more dumps. It has the form
-\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above. If a component is missing, it is treated as a wildcard. The characters ':', '@', and '\e' may be escaped within any component by preceding them with a '\e'.
+A dump specification selects one or more dumps\. It has the form
+\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above\. If a component is missing, it is treated as a wildcard\. The characters \':\', \'@\', and \'\e\' may be escaped within any component by preceding them with a \'\e\'\.
 .PP
 Some examples:
 .TS
@@ -1089,32 +1107,64 @@ T}
 .sp
 .SH "CONFIGURATION OVERRIDE"
 .PP
-Most command allow to overwrite any configuration parameter on the command line with the \-o option.
-.PP
-\-o NAME=value
-.PP
-eg. \-o runtapes=2
-.PP
-eg. \-o DUMPTYPE:no\-compress:compress="server fast"
+Most commands allow the override of specific configuration options on the command line, using the
+\-o
+option\. This option has the form
+\-o\fIname\fR=\fIvalue\fR\. An optional space is allowed after the
+\-o\. Each configuration option should be specified in a separate command\-line option\.
 .PP
-eg. \-o TAPETYPE:HP\-DAT:length=2000m
+For global options,
+\fIname\fR
+is simply the name of the option, e\.g\.,
+.sp
+.RS 4
+.nf
+amdump \-oruntapes=2
+.fi
+.RE
+.sp
+For options in a named section of the configuration,
+\fIname\fR
+has the form
+\fISECTION\fR:\fIsection_name\fR:\fIname\fR, where
+\fISECTION\fR
+is one of TAPETYPE, DUMPTYPE, HOLDINGDISK, or INTERFACE, and
+\fIsection_name\fR
+is the name of the tapetype, dumptype, holdingdisk, or interface\. Examples:
+.sp
+.RS 4
+.nf
+amdump \-o TAPETYPE:HP\-DAT:length=2000m
+amdump \-o DUMPTYPE:no\-compress:compress="server fast"
+amdump \-o HOLDINGDISK:hd1:use="\-100 mb"
+amdump \-o INTERFACE:local:use="2000 kbps"
+.fi
+.RE
 .PP
-eg. \-o INTERFACE:local:use="2000 kbps"
+Note that configuration overrides are not effective for tape changers, which supply a tapedev based on their own configuration\. In order to override
+\fItapedev\fR, you must also disable any changer:
+.sp
+.RS 4
+.nf
+amdump \-otapedev=/dev/nst1 \-otpchanger=\'\'
+.fi
+.RE
+.sp
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion, major update
 .SH "SEE ALSO"
 .PP
 
 \fBamadmin\fR(8),
 \fBamanda.conf\fR(5),
-\fBamanda\-client.conf\fR(5),
+\fBamanda-client.conf\fR(5),
 \fBamcheck\fR(8),
 \fBamcheckdb\fR(8),
 \fBamcleanup\fR(8),
@@ -1135,5 +1185,7 @@ Stefan G. Weichinger,
 \fBamtape\fR(8),
 \fBamtapetype\fR(8),
 \fBamtoc\fR(8),
-\fBamverify\fR(8),
-\fBamverifyrun\fR(8)
+\fBamcheckdump\fR(8),
+\fBamserverconfig\fR(8),
+\fBamaddclient\fR(8)
+\fBhttp://wiki.zmanda.com\fR()
index 2064aafeb67afa124df281e25ee420354a1fd55e..0c1bfcc573cdcfcdcacfa498edf3076827a4607e 100644 (file)
 .\"     Title: amanda.conf
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA.CONF" "5" "06/06/2007" "" ""
+.TH "AMANDA\.CONF" "5" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amanda.conf \- Main configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver
+amanda.conf - Main configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver
 .SH "DESCRIPTION"
 .PP
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 is the main configuration file for
-\fIAmanda\fR. This manpage lists the relevant sections and parameters of this file for quick reference.
+\fIAmanda\fR\. This manpage lists the relevant sections and parameters of this file for quick reference\.
 .PP
 The file
-\fB<CONFIG_DIR>/<config>/amanda.conf\fR
-is loaded.
+\fB<CONFIG_DIR>/<config>/amanda\.conf\fR
+is loaded\.
 .SH "PARAMETERS"
 .PP
 There are a number of configuration parameters that control the behavior of the
 \fIAmanda\fR
-programs. All have default values, so you need not specify the parameter in
-\fBamanda.conf\fR
-if the default is suitable.
+programs\. All have default values, so you need not specify the parameter in
+\fBamanda\.conf\fR
+if the default is suitable\.
 .PP
-Lines starting with # are ignored, as are blank lines. Comments may be placed on a line with a directive by starting the comment with a #. The remainder of the line is ignored.
+Lines starting with # are ignored, as are blank lines\. Comments may be placed on a line with a directive by starting the comment with a #\. The remainder of the line is ignored\.
 .PP
-Keywords are case insensitive, i.e.
+Keywords are case insensitive, i\.e\.
 \fBmailto\fR
 and
 \fBMailTo\fR
-are treated the same.
+are treated the same\.
 .PP
 Integer arguments may have one of the following (case insensitive) suffixes, some of which have a multiplier effect:
 .SS "POSSIBLE SUFFIXES"
 .PP
 \fBb byte bytes\fR
 .RS 4
-Some number of bytes.
+Some number of bytes\.
 .RE
 .PP
 \fBbps\fR
 .RS 4
-Some number of bytes per second.
+Some number of bytes per second\.
 .RE
 .PP
 \fBk kb kbyte kbytes kilobyte kilobytes\fR
 .RS 4
-Some number of kilobytes (bytes*1024).
+Some number of kilobytes (bytes*1024)\.
 .RE
 .PP
 \fBkps kbps\fR
 .RS 4
-Some number of kilobytes per second (bytes*1024).
+Some number of kilobytes per second (bytes*1024)\.
 .RE
 .PP
 \fBm mb meg mbyte mbytes megabyte megabytes\fR
 .RS 4
-Some number of megabytes (bytes*1024*1024).
+Some number of megabytes (bytes*1024*1024)\.
 .RE
 .PP
 \fBmps mbps\fR
 .RS 4
-Some number of megabytes per second (bytes*1024*1024).
+Some number of megabytes per second (bytes*1024*1024)\.
 .RE
 .PP
 \fBg gb gbyte gbytes gigabyte gigabytes\fR
 .RS 4
-Some number of gigabytes (bytes*1024*1024*1024).
+Some number of gigabytes (bytes*1024*1024*1024)\.
 .RE
 .PP
 \fBtape tapes\fR
 .RS 4
-Some number of tapes.
+Some number of tapes\.
 .RE
 .PP
 \fBday days\fR
 .RS 4
-Some number of days.
+Some number of days\.
 .RE
 .PP
 \fBweek weeks\fR
 .RS 4
-Some number of weeks (days*7).
+Some number of weeks (days*7)\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 The value
 \fBinf\fR
-may be used in most places where an integer is expected to mean an infinite amount.
+may be used in most places where an integer is expected to mean an infinite amount\.
 .sp
 Boolean arguments may have any of the values
 \fBy\fR,
@@ -112,138 +112,135 @@ to indicate a true state, or
 \fBfalse\fR
 or
 \fBoff\fR
-to indicate a false state. If no argument is given,
+to indicate a false state\. If no argument is given,
 \fBtrue\fR
-is assumed.
+is assumed\.
 .RE
 .SS "PARAMETERS"
 .PP
 \fBorg\fR \fI string\fR
 .RS 4
 Default:
-\fIdaily\fR. A descriptive name for the configuration. This string appears in the Subject line of mail reports. Each
+\fIdaily\fR\. A descriptive name for the configuration\. This string appears in the Subject line of mail reports\. Each
 \fIAmanda\fR
-configuration should have a different string to keep mail reports distinct.
+configuration should have a different string to keep mail reports distinct\.
 .RE
 .PP
 \fBmailto\fR \fI string\fR
 .RS 4
 Default:
-\fIoperators\fR. A space separated list of recipients for mail reports.
+\fIoperators\fR\. A space separated list of recipients for mail reports\.
 .RE
 .PP
 \fBdumpcycle\fR \fI int\fR
 .RS 4
 Default:
-\fI10 days\fR. The number of days in the backup cycle. Each disk will get a full backup at least this often. Setting this to zero tries to do a full backup each run.
+\fI10 days\fR\. The number of days in the backup cycle\. Each disk will get a full backup at least this often\. Setting this to zero tries to do a full backup each run\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 This parameter may also be set in a specific
 \fBdumptype\fR
-(see below). This value sets the default for all
+(see below)\. This value sets the default for all
 \fBdumptype\fRs so must appear in
-\fBamanda.conf\fR
+\fBamanda\.conf\fR
 before any
-\fBdumptype\fRs are defined.
+\fBdumptype\fRs are defined\.
 .RE
 .PP
 \fBrunspercycle\fR \fI int\fR
 .RS 4
 Default:
-\fIsame as dumpcycle\fR. The number of amdump runs in
+\fIsame as dumpcycle\fR\. The number of amdump runs in
 \fBdumpcycle\fR
-days. A value of 0 means the same value as
-\fBdumpcycle\fR. A value of \-1 means guess the number of runs from the
+days\. A value of 0 means the same value as
+\fBdumpcycle\fR\. A value of \-1 means guess the number of runs from the
 \fItapelist\fR
 file, which is the number of tapes used in the last
 \fBdumpcycle\fR
 days /
-\fBruntapes\fR.
+\fBruntapes\fR\.
 .RE
 .PP
 \fBtapecycle\fR \fI int\fR
 .RS 4
 Default:
-\fI15 tapes\fR. Typically tapes are used by
+\fI15 tapes\fR\. Typically tapes are used by
 \fIAmanda\fR
-in an ordered rotation. The
+in an ordered rotation\. The
 \fBtapecycle\fR
-parameter defines the size of that rotation. The number of tapes in rotation must be larger than the number of tapes required for a complete dump cycle (see the
+parameter defines the size of that rotation\. The number of tapes in rotation must be larger than the number of tapes required for a complete dump cycle (see the
 \fBdumpcycle\fR
-parameter).
+parameter)\.
 .sp
 This is calculated by multiplying the number of
 \fBamdump\fR
 runs per dump cycle (\fBrunspercycle\fR
 parameter) times the number of tapes used per run (\fBruntapes\fR
-parameter). Typically two to four times this calculated number of tapes are in rotation. While
+parameter)\. Typically two to four times this calculated number of tapes are in rotation\. While
 \fIAmanda\fR
-is always willing to use a new tape in its rotation, it refuses to reuse a tape until at least '\fBtapecycle\fR
-\-1' number of other tapes have been used.
+is always willing to use a new tape in its rotation, it refuses to reuse a tape until at least \'\fBtapecycle\fR
+\-1\' number of other tapes have been used\.
 .sp
 It is considered good administrative practice to set the
 \fBtapecycle\fR
-parameter slightly lower than the actual number of tapes in rotation. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order.
+parameter slightly lower than the actual number of tapes in rotation\. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order\.
 .RE
 .PP
 \fBusetimestamps\fR \fI bool\fR
 .RS 4
 Default:
-\fBNo\fR. By default, Amanda can only track at most one run per calendar day. When this option is enabled, however, Amanda can track as many runs as you care to make.
-.sp
-
-\fBWARNING\fR: This option is not backward\-compatible. Do not enable it if you intend to downgrade your server installation to Amanda community edition 2.5.0
+\fBYes\fR\. This option allows Amanda to track multiple runs per calendar day\. The only reason one might disable it is that Amanda versions before 2\.5\.1 can\'t read logfiles written when this option was enabled\.
 .RE
 .PP
 \fBlabel_new_tapes\fR \fI string\fR
 .RS 4
-Default: not set. When set, this directive will cause
+Default: not set\. When set, this directive will cause
 \fIAmanda\fR
 to automatically write an
 \fIAmanda\fR
-tape label to any blank tape she encounters. This option is DANGEROUS because when set,
+tape label to any blank tape she encounters\. This option is DANGEROUS because when set,
 \fIAmanda\fR
 will ERASE any non\-\fIAmanda\fR
-tapes you may have, and may also ERASE any near\-failing tapes. Use with caution.
+tapes you may have, and may also ERASE any near\-failing tapes\. Use with caution\.
 .sp
-When using this directive, specify the template for new tape labels. The template should contain some number of contiguous '%' characters, which will be replaced with a generated number. Be sure to specify enough '%' characters that you do not run out of tape labels. Example:
+When using this directive, specify the template for new tape labels\. The template should contain some number of contiguous \'%\' characters, which will be replaced with a generated number\. Be sure to specify enough \'%\' characters that you do not run out of tape labels\. Example:
 \fBlabel_new_tapes "DailySet1\-%%%"\fR
 .RE
 .PP
 \fBdumpuser\fR \fI string\fR
 .RS 4
 Default:
-\fIamanda\fR. The login name
+\fIamanda\fR\. The login name
 \fIAmanda\fR
-uses to run the backups. The backup client hosts must allow access from the tape server host as this user via
-\fB.rhosts\fR
+uses to run the backups\. The backup client hosts must allow access from the tape server host as this user via
+\fB\.rhosts\fR
 or
-\fB.amandahosts\fR, depending on how the
+\fB\.amandahosts\fR, depending on how the
 \fIAmanda\fR
-software was built.
+software was built\.
 .RE
 .PP
 \fBprinter\fR string
 .RS 4
-Printer to use when doing tape labels. See the
+Printer to use when doing tape labels\. See the
 \fBlbl\-templ\fR
 \fBtapetype\fR
-option.
+option\.
 .RE
 .PP
 \fBtapedev\fR string
 .RS 4
 Default:
-\fInull:\fR. The path name of the non\-rewinding tape device. Non\-rewinding tape device names often have an 'n' in the name, e.g.
-\fI/dev/rmt/0mn\fR, however this is operating system specific and you should consult that documentation for detailed naming information.
+\fInull:\fR\. The path name of the non\-rewinding tape device\. Non\-rewinding tape device names often have an \'n\' in the name, e\.g\.
+\fI/dev/rmt/0mn\fR, however this is operating system specific and you should consult that documentation for detailed naming information\.
 .sp
 If a tape changer is configured (see the
 \fBtpchanger\fR
-option), this option might not be used.
+option), this option might not be used\.
 .sp
 If the
 \fBnull\fR
@@ -251,129 +248,142 @@ output driver is selected (see the section OUTPUT DRIVERS in the
 \fBamanda\fR(8)
 manpage for more information), programs such as
 \fBamdump\fR
-will run normally but all images will be thrown away. This should only be used for debugging and testing, and probably only with the
+will run normally but all images will be thrown away\. This should only be used for debugging and testing, and probably only with the
 \fBrecord\fR
 option set to
-\fIno\fR.
+\fIno\fR\.
 .RE
 .PP
-\fBrawtapedev\fR string
+\fBdevice_property\fR string string
 .RS 4
-Default:
-\fInull:\fR. The path name of the raw tape device. This is only used if
-\fIAmanda\fR
-is compiled for Linux machines with floppy tapes and is needed for QIC volume table operations.
+These options can set various device properties, including block size, maximum volume usage, authentication information, hardware feature support, and more\.Specifics of how properties are used are device\-dependent, though some common properties are supported across multiple device drivers\.
+.sp
+Both strings are quoted; the first string contains the name of the property to set, and the second contains its value\. For example, to set a fixed block size of 128k, do:
+.sp
+.RS 4
+.nf
+device_property "BLOCK_SIZE" "131072"
+.fi
+.RE
+.sp
+The order in which device properties are set is as follows:
+.sp
+.RS 4
+\h'-04' 1.\h'+02'Tapetype parameters, including length, blocksize, readblocksize, file\-pad, are translated into device properties and set accordingly\.
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+02'Device properties from any device_property configuration directives are set, in the order they appear in the configuration file\.
+.RE
 .RE
 .PP
 \fBtpchanger\fR string
 .RS 4
 Default:
-\fInone\fR. The name of the tape changer. If a tape changer is not configured, this option is not used and should be commented out of the configuration file.
+\fInone\fR\. The name of the tape changer\. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\.
 .sp
-If a tape changer is configured, choose one of the changer scripts (e.g.
-\fBchg\-scsi\fR) and enter that here.
+If a tape changer is configured, choose one of the changer scripts (e\.g\.
+\fBchg\-scsi\fR) and enter that here\.
 .RE
 .PP
 \fBchangerdev\fR string
 .RS 4
 Default:
-\fI/dev/null\fR. A tape changer configuration parameter. Usage depends on the particular changer defined with the
+\fI/dev/null\fR\. A tape changer configuration parameter\. Usage depends on the particular changer defined with the
 \fBtpchanger\fR
-option.
+option\.
 .RE
 .PP
 \fBchangerfile\fR string
 .RS 4
 Default:
-\fI/usr/adm/amanda/log/changer\-status\fR. A tape changer configuration parameter. Usage depends on the particular changer defined with the
+\fI/usr/adm/amanda/log/changer\-status\fR\. A tape changer configuration parameter\. Usage depends on the particular changer defined with the
 \fBtpchanger\fR
-option.
+option\.
 .RE
 .PP
 \fBruntapes\fR int
 .RS 4
 Default:
-1. The maximum number of tapes used in a single run. If a tape changer is not configured, this option is not used and should be commented out of the configuration file.
+1\. The maximum number of tapes used in a single run\. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\.
 .sp
 If a tape changer is configured, this may be set larger than one to let
 \fIAmanda\fR
-write to more than one tape.
+write to more than one tape\.
 .sp
 Note that this is an upper bound on the number of tapes, and
 \fIAmanda\fR
-may use less.
+may use less\.
 .sp
 Also note that as of this release,
 \fIAmanda\fR
-does not support true tape overflow. When it reaches the end of one tape, the backup image
+does not support true tape overflow\. When it reaches the end of one tape, the backup image
 \fIAmanda\fR
-was processing starts over again on the next tape.
+was processing starts over again on the next tape\.
 .RE
 .PP
 \fBmaxdumpsize\fR int
 .RS 4
 Default:
-\fIruntapes\fR*\fItape_length\fR. Maximum number of bytes the planner will schedule for a run.
+\fIruntapes\fR*\fItape_length\fR\. Maximum number of bytes the planner will schedule for a run\.
 .RE
 .PP
 \fBtaperalgo\fR [first|firstfit|largest|largestfit|smallest|last]
 .RS 4
 Default:
-\fIfirst\fR. The algorithm used to choose which dump image to send to the taper.
-.RS 4
+\fIfirst\fR\. The algorithm used to choose which dump image to send to the taper\.
 .PP
 \fBfirst\fR
 .RS 4
-First in, first out.
+First in, first out\.
 .RE
 .PP
 \fBfirstfit\fR
 .RS 4
-The first dump image that will fit on the current tape.
+The first dump image that will fit on the current tape\.
 .RE
 .PP
 \fBlargest\fR
 .RS 4
-The largest dump image.
+The largest dump image\.
 .RE
 .PP
 \fBlargestfit\fR
 .RS 4
-The largest dump image that will fit on the current tape.
+The largest dump image that will fit on the current tape\.
 .RE
 .PP
 \fBsmallest\fR
 .RS 4
-The smallest dump image.
+The smallest dump image\.
 .RE
 .PP
 \fBlast\fR
 .RS 4
-Last in, first out.
-.RE
+Last in, first out\.
 .RE
 .RE
 .PP
 \fBlabelstr\fR \fI string\fR
 .RS 4
 Default:
-\fI.*\fR. The tape label constraint regular expression. All tape labels generated (see
-\fBamlabel\fR(8)) and used by this configuration must match the regular expression. If multiple configurations are run from the same tape server host, it is helpful to set their labels to different strings (for example, "DAILY[0\-9][0\-9]*" vs. "ARCHIVE[0\-9][0\-9]*") to avoid overwriting each other's tapes.
+\fI\.*\fR\. The tape label constraint regular expression\. All tape labels generated (see
+\fBamlabel\fR(8)) and used by this configuration must match the regular expression\. If multiple configurations are run from the same tape server host, it is helpful to set their labels to different strings (for example, "DAILY[0\-9][0\-9]*" vs\. "ARCHIVE[0\-9][0\-9]*") to avoid overwriting each other\'s tapes\.
 .RE
 .PP
 \fBtapetype\fR \fI string\fR
 .RS 4
 Default:
-\fIEXABYTE\fR. The type of tape drive associated with
+\fIEXABYTE\fR\. The type of tape drive associated with
 \fBtapedev\fR
 or
-\fBtpchanger\fR. This refers to one of the defined
+\fBtpchanger\fR\. This refers to one of the defined
 \fBtapetype\fRs in the config file (see below), which specify various tape parameters, like the
 \fBlength\fR,
 \fBfilemark\fR
 size, and
 \fBspeed\fR
-of the tape media and device.
+of the tape media and device\.
 .sp
 First character of a
 \fBtapetype\fR
@@ -383,74 +393,74 @@ string must be an alphabetic character
 \fBctimeout\fR int
 .RS 4
 Default:
-\fI30 seconds\fR. Maximum amount of time that
+\fI30 seconds\fR\. Maximum amount of time that
 \fBamcheck\fR
-will wait for each client host.
+will wait for each client host\.
 .RE
 .PP
 \fBdtimeout\fR int
 .RS 4
 Default:
-\fI1800 seconds\fR. Amount of idle time per disk on a given client that a
+\fI1800 seconds\fR\. Amount of idle time per disk on a given client that a
 \fBdumper\fR
 running from within
 \fBamdump\fR
-will wait before it fails with a data timeout error.
+will wait before it fails with a data timeout error\.
 .RE
 .PP
 \fBetimeout\fR int
 .RS 4
 Default:
-\fI300 seconds\fR. Amount of time per disk on a given client that the
+\fI300 seconds\fR\. Amount of time per estimate on a given client that the
 \fBplanner\fR
 step of
 \fBamdump\fR
-will wait to get the dump size estimates. For instance, with the default of 300 seconds and four disks on client A,
+will wait to get the dump size estimates (note: Amanda runs up to 3 estimates for each DLE)\. For instance, with the default of 300 seconds and four DLE\'s, each estimating level 0 and level 1 on client A,
 \fBplanner\fR
-will wait up to 20 minutes for that machine. A negative value will be interpreted as a total amount of time to wait per client instead of per disk.
+will wait up to 40 minutes for that machine\. A negative value will be interpreted as a total amount of time to wait per client instead of per disk\.
 .RE
 .PP
 \fBconnect_tries\fR int
 .RS 4
 Default:
-\fI3\fR. How many times the server will try a connection.
+\fI3\fR\. How many times the server will try a connection\.
 .RE
 .PP
 \fBreq_tries\fR int
 .RS 4
 Default:
-\fI3\fR. How many times the server will resend a REQ packet if it doesn't get the ACK packet.
+\fI3\fR\. How many times the server will resend a REQ packet if it doesn\'t get the ACK packet\.
 .RE
 .PP
 \fBnetusage\fR int
 .RS 4
 Default:
-\fI300 Kbps\fR. The maximum network bandwidth allocated to
-\fIAmanda\fR, in Kbytes per second. See also the
+\fI8000 Kbps\fR\. The maximum network bandwidth allocated to
+\fIAmanda\fR, in Kbytes per second\. See also the
 \fBinterface\fR
-section.
+section\.
 .RE
 .PP
 \fBinparallel\fR int
 .RS 4
 Default:
-10. The maximum number of backups that
+10\. The maximum number of backups that
 \fIAmanda\fR
-will attempt to run in parallel.
+will attempt to run in parallel\.
 \fIAmanda\fR
-will stay within the constraints of network bandwidth and holding disk space available, so it doesn't hurt to set this number a bit high. Some contention can occur with larger numbers of backups, but this effect is relatively small on most systems.
+will stay within the constraints of network bandwidth and holding disk space available, so it doesn\'t hurt to set this number a bit high\. Some contention can occur with larger numbers of backups, but this effect is relatively small on most systems\.
 .RE
 .PP
 \fBdisplayunit\fR "k|m|g|t"
 .RS 4
 Default:
-"k". The unit used to print many numbers, k=kilo, m=mega, g=giga, t=tera.
+"k"\. The unit used to print many numbers, k=kilo, m=mega, g=giga, t=tera\.
 .RE
 .PP
 \fBdumporder\fR string
 .RS 4
 Default:
-\fItttTTTTTTT\fR. The priority order of each dumper:
+\fItttTTTTTTT\fR\. The priority order of each dumper:
 .sp
 .RS 4
 .nf
@@ -467,181 +477,188 @@ B: largest bandwidth
 \fBmaxdumps\fR int
 .RS 4
 Default:
-1. The maximum number of backups from a single host that
+1\. The maximum number of backups from a single host that
 \fIAmanda\fR
-will attempt to run in parallel. See also the
+will attempt to run in parallel\. See also the
 \fBinparallel\fR
-option.
+option\.
 .sp
 Note that this parameter may also be set in a specific
 \fBdumptype\fR
-(see below). This value sets the default for all
+(see below)\. This value sets the default for all
 \fBdumptype\fRs so must appear in
-\fBamanda.conf\fR
+\fBamanda\.conf\fR
 before any
-\fBdumptype\fRs are defined.
+\fBdumptype\fRs are defined\.
 .RE
 .PP
 \fBbumpsize\fR int
 .RS 4
 Default:
-\fI10 Mbytes\fR. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size. If
+\fI10 Mbytes\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\. If
 \fIAmanda\fR
-determines that the next higher backup level will be this much smaller than the current level, it will do the next level. The value of this parameter is used only if the parameter
+determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. The value of this parameter is used only if the parameter
 \fIbumppercent\fR
-is set to 0.
+is set to 0\.
 .sp
-The global setting of this parameter can be overwritten inside of a dumptype\-definition.
+The global setting of this parameter can be overwritten inside of a dumptype\-definition\.
 .sp
 See also the options
 \fBbumppercent\fR,
 \fBbumpmult\fR
 and
-\fBbumpdays\fR.
+\fBbumpdays\fR\.
 .RE
 .PP
 \fBbumppercent\fR int
 .RS 4
 Default:
-\fI0 percent\fR. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0). If
+\fI0 percent\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\. If
 \fIAmanda\fR
-determines that the next higher backup level will be this much smaller than the current level, it will do the next level.
+determines that the next higher backup level will be this much smaller than the current level, it will do the next level\.
 .sp
 If this parameter is set to 0, the value of the parameter
 \fIbumpsize\fR
-is used to trigger bumping.
+is used to trigger bumping\.
 .sp
-The global setting of this parameter can be overwritten inside of a dumptype\-definition.
+The global setting of this parameter can be overwritten inside of a dumptype\-definition\.
 .sp
 See also the options
 \fBbumpsize\fR,
 \fBbumpmult\fR
 and
-\fBbumpdays\fR.
+\fBbumpdays\fR\.
 .RE
 .PP
 \fBbumpmult\fR \fI float\fR
 .RS 4
 Default:
-1.5. The bump size multiplier.
+1\.5\. The bump size multiplier\.
 \fIAmanda\fR
 multiplies
 \fBbumpsize\fR
-by this factor for each level. This prevents active filesystems from bumping too much by making it harder to bump to the next level. For example, with the default
+by this factor for each level\. This prevents active filesystems from bumping too much by making it harder to bump to the next level\. For example, with the default
 \fBbumpsize\fR
 and
 \fBbumpmult\fR
-set to 2.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on.
+set to 2\.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\.
 .sp
-The global setting of this parameter can be overwritten inside of a dumptype\-definition.
+The global setting of this parameter can be overwritten inside of a dumptype\-definition\.
 .RE
 .PP
 \fBbumpdays\fR \fI int\fR
 .RS 4
 Default:
-\fI2 days\fR. To insure redundancy in the dumps,
+\fI2 days\fR\. To insure redundancy in the dumps,
 \fIAmanda\fR
 keeps filesystems at the same incremental level for at least
 \fBbumpdays\fR
-days, even if the other bump threshold criteria are met.
+days, even if the other bump threshold criteria are met\.
 .sp
-The global setting of this parameter can be overwritten inside of a dumptype\-definition.
+The global setting of this parameter can be overwritten inside of a dumptype\-definition\.
 .RE
 .PP
 \fBdiskfile\fR \fI string\fR
 .RS 4
 Default:
-\fIdisklist\fR. The file name for the
+\fIdisklist\fR\. The file name for the
 \fIdisklist\fR
-file holding client hosts, disks and other client dumping information.
+file holding client hosts, disks and other client dumping information\.
 .RE
 .PP
 \fBinfofile\fR \fI string\fR
 .RS 4
 Default:
-\fI/usr/adm/amanda/curinfo\fR. The file or directory name for the historical information database. If
+\fI/usr/adm/amanda/curinfo\fR\. The file or directory name for the historical information database\. If
 \fIAmanda\fR
-was configured to use DBM databases, this is the base file name for them. If it was configured to use text formated databases (the default), this is the base directory and within here will be a directory per client, then a directory per disk, then a text file of data.
+was configured to use DBM databases, this is the base file name for them\. If it was configured to use text formated databases (the default), this is the base directory and within here will be a directory per client, then a directory per disk, then a text file of data\.
 .RE
 .PP
 \fBlogdir\fR \fI string\fR
 .RS 4
 Default:
-\fI/usr/adm/amanda\fR. The directory for the
+\fI/usr/adm/amanda\fR\. The directory for the
 \fBamdump\fR
 and
 \fBlog\fR
-files.
+files\.
 .RE
 .PP
 \fBindexdir\fR \fI string\fR
 .RS 4
 Default
-\fI/usr/adm/amanda/index\fR. The directory where index files (backup image catalogues) are stored. Index files are only generated for filesystems whose
+\fI/usr/adm/amanda/index\fR\. The directory where index files (backup image catalogues) are stored\. Index files are only generated for filesystems whose
 \fBdumptype\fR
 has the
 \fBindex\fR
-option enabled.
+option enabled\.
 .RE
 .PP
 \fBtapelist\fR \fI string\fR
 .RS 4
 Default:
-\fItapelist\fR. The file name for the active
+\fItapelist\fR\. The file name for the active
 \fItapelist\fR
-file.
+file\.
 \fIAmanda\fR
-maintains this file with information about the active set of tapes.
+maintains this file with information about the active set of tapes\.
+.RE
+.PP
+\fBdevice_output_buffer_size\fR \fI int\fR
+.RS 4
+Default:
+640k\. Controls the amount of memory used by
+\fIAmanda\fR
+to hold data as it is read from the network or disk before it is written to the output device\. Higher values may be useful on fast tape drives and optical media\.
 .RE
 .PP
 \fBtapebufs\fR \fI int\fR
 .RS 4
 Default:
-20. The number of buffers used by the
-\fBtaper\fR
-process run by
-\fBamdump\fR
-and
-\fBamflush\fR
-to hold data as it is read from the network or disk before it is written to tape. Each buffer is a little larger than 32 KBytes and is held in a shared memory region.
+20\. This option is deprecated; use the
+\fBdevice_output_buffer_size\fR
+directive instead\.
+\fBtapebufs\fR
+works the same way, but the number specified is multiplied by the device blocksize prior to use\.
 .RE
 .PP
 \fBreserve\fR \fI number\fR
 .RS 4
 Default:
-100. The part of holding\-disk space that should be reserved for incremental backups if no tape is available, expressed as a percentage of the available holding\-disk space (0\-100). By default, when there is no tape to write to, degraded mode (incremental) backups will be performed to the holding disk. If full backups should also be allowed in this case, the amount of holding disk space reserved for incrementals should be lowered.
+100\. The part of holding\-disk space that should be reserved for incremental backups if no tape is available, expressed as a percentage of the available holding\-disk space (0\-100)\. By default, when there is no tape to write to, degraded mode (incremental) backups will be performed to the holding disk\. If full backups should also be allowed in this case, the amount of holding disk space reserved for incrementals should be lowered\.
 .RE
 .PP
 \fBautoflush\fR \fI bool\fR
 .RS 4
 Default:
-\fIoff\fR. Whether an amdump run will flush the dumps from holding disk to tape.
+\fIoff\fR\. Whether an amdump run will flush the dumps from holding disk to tape\.
 .RE
 .PP
 \fBamrecover_do_fsf\fR \fI bool\fR
 .RS 4
 Default:
-\fIon\fR. Amrecover will call amrestore with the \-f flag for faster positioning of the tape.
+\fIon\fR\. Amrecover will call amrestore with the \-f flag for faster positioning of the tape\.
 .RE
 .PP
 \fBamrecover_check_label\fR \fI bool\fR
 .RS 4
 Default:
-\fIon\fR. Amrecover will call amrestore with the \-l flag to check the label.
+\fIon\fR\. Amrecover will call amrestore with the \-l flag to check the label\.
 .RE
 .PP
 \fBamrecover_changer\fR \fI string\fR
 .RS 4
-Default: ''. Amrecover will use the changer if you use 'settape <string>' and that string is the same as the amrecover_changer setting.
+Default: \'\'\. Amrecover will use the changer if you use \'settape <string>\' and that string is the same as the amrecover_changer setting\.
 .RE
 .PP
 \fBcolumnspec\fR \fI string\fR
 .RS 4
 Defines the width of columns
 \fBamreport\fR
-should use.
+should use\.
 \fIString\fR
-is a comma (',') separated list of triples. Each triple consists of three parts which are separated by a equal sign ('=') and a colon (':') (see the example). These three parts specify:
+is a comma (\',\') separated list of triples\. Each triple consists of three parts which are separated by a equal sign (\'=\') and a colon (\':\') (see the example)\. These three parts specify:
+.sp
 .RS 4
 \h'-04' 1.\h'+02'the name of the column, which may be:
 .sp
@@ -661,12 +678,14 @@ is a comma (',') separated list of triples. Each triple consists of three parts
 .fi
 .RE
 .RE
+.sp
 .RS 4
-\h'-04' 2.\h'+02'the amount of space to display before the column (used to get whitespace between columns).
+\h'-04' 2.\h'+02'the amount of space to display before the column (used to get whitespace between columns)\.
 .sp
 .RE
+.sp
 .RS 4
-\h'-04' 3.\h'+02'the width of the column itself. If set to a negative value, the width will be calculated on demand to fit the largest entry in this column.
+\h'-04' 3.\h'+02'the width of the column itself\. If set to a negative value, the width will be calculated on demand to fit the largest entry in this column\.
 .RE
 .IP "" 4
 Here is an example:
@@ -677,150 +696,232 @@ columnspec "Disk=1:18,HostName=0:10,OutKB=1:7"
 .fi
 .RE
 .sp
-The above will display the disk information in 18 characters and put one space before it. The hostname column will be 10 characters wide with no space to the left. The output KBytes column is seven characters wide with one space before it.
+The above will display the disk information in 18 characters and put one space before it\. The hostname column will be 10 characters wide with no space to the left\. The output KBytes column is seven characters wide with one space before it\.
 .RE
 .PP
 \fBincludefile\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. The name of an
+\fInone\fR\. The name of an
 \fIAmanda\fR
-configuration file to include within the current file. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations.
+configuration file to include within the current file\. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations\. Relative pathnames are relative to the configuration directory\.
 .RE
 .PP
 \fBdebug_auth\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the auth module
+\fI0\fR\. Debug level of the auth module
 .RE
 .PP
 \fBdebug_event\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the event module
+\fI0\fR\. Debug level of the event module
 .RE
 .PP
 \fBdebug_holding\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the holdingdisk module
+\fI0\fR\. Debug level of the holdingdisk module
 .RE
 .PP
 \fBdebug_protocol\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the protocol module
+\fI0\fR\. Debug level of the protocol module
 .RE
 .PP
 \fBdebug_planner\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the planner process
+\fI0\fR\. Debug level of the planner process
 .RE
 .PP
 \fBdebug_driver\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the driver process
+\fI0\fR\. Debug level of the driver process
 .RE
 .PP
 \fBdebug_dumper\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the dumper process
+\fI0\fR\. Debug level of the dumper process
 .RE
 .PP
 \fBdebug_chunker\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the chunker process
+\fI0\fR\. Debug level of the chunker process
 .RE
 .PP
 \fBdebug_taper\fR int
 .RS 4
 Default:
-\fI0\fR. Debug level of the taper process
+\fI0\fR\. Debug level of the taper process
+.RE
+.PP
+\fBflush\-threshold\-dumped\fR int
+.RS 4
+Default:
+\fI0\fR\.
+\fIAmanda\fR
+will not begin writing data to a new volume until the amount of data on the holding disk is at least this percentage of the volume size\. In other words,
+\fIAmanda\fR
+will not begin until the inequality
+h < t \(mu d
+is satisfied, where
+h
+is the amount of data on the holding disk,
+t
+is the capacity of a volume, and
+d
+is this parameter, expressed as a percentage\.
+.sp
+Needless to say, your holding disk must be big enough that this criterion could be satisfied\. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then
+\fIAmanda\fR
+will disregard the constraint specified by this setting and start a new volume anyway\. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\.
+.sp
+The value of this parameter may not exceed than that of the
+\fBflush\-threshold\-scheduled\fR
+parameter\.
+.RE
+.PP
+\fBflush\-threshold\-scheduled\fR int
+.RS 4
+Default:
+\fI0\fR\.
+\fIAmanda\fR
+will not begin writing data to a new volume until the sum of the amount of data on the holding disk and the estimated amount of data remaining to be dumped during this run is at least this percentage of the volume size\. In other words,
+\fIAmanda\fR
+will not begin until the inequality
+h + s < t \(mu d
+is satisfied, where
+h
+is the amount of data on the holding disk,
+s
+is the total amount of data scheduled for this run but not dumped yet,
+t
+is the capacity of a volume, and
+d
+is this parameter, expressed as a percentage\.
+.sp
+Needless to say, your holding disk must be big enough that this criterion could be satisfied\. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then
+\fIAmanda\fR
+will disregard the constraint specified by this setting and start a new volume anyway\. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\.
+.sp
+The value of this parameter may not be less than that of the
+\fBflush\-threshold\-dumped\fR
+or
+\fBtaperflush\fR
+parameters\.
+.RE
+.PP
+\fBtaperflush\fR int
+.RS 4
+Default:
+\fI0\fR\. At the end of a run,
+\fIAmanda\fR
+will start a new tape to flush remaining data if there is more data on the holding disk at the end of a run than this setting allows; the amount is specified as a percentage of the capacity of a single volume\. In other words, at the end of a run,
+\fIAmanda\fR
+will begin a new tape if the inequality
+h < t \(mu f
+is satisfied, where
+h
+is the amount of data remaining on the holding disk from this or previous runs,
+t
+is the capacity of a volume, and
+f
+is this parameter, expressed as a percentage\.
+.sp
+The value of this parameter may not exceed that of the
+\fBflush\-threshold\-scheduled\fR
+parameter\.;
+\fBautoflush\fR
+must be set to \'yes\' if
+\fBtaperflush\fR
+is greater than 0\.
 .RE
 .PP
 \fBreserved\-udp\-port\fR int,int
 .RS 4
 Default: \-\-with\-udpportrange or
-\fI512,1023\fR. Reserved udp port that will be used (bsd, bsdudp)
+\fI512,1023\fR\. Reserved udp port that will be used (bsd, bsdudp)\. Range is inclusive\.
 .RE
 .PP
 \fBreserved\-tcp\-port\fR int,int
 .RS 4
 Default: \-\-with\-low\-tcpportrange or
-\fI512,1023\fR. Reserved tcp port that will be used (bsdtcp)
+\fI512,1023\fR\. Reserved tcp port that will be used (bsdtcp)\. Range is inclusive\.
 .RE
 .PP
 \fBunreserved\-tcp\-port\fR int,int
 .RS 4
 Default: \-\-with\-tcpportrange or
-\fI1025,65536\fR. Unreserved tcp port that will be used (bsd, bsdudp)
+\fI1024,65535\fR\. Unreserved tcp port that will be used (bsd, bsdudp)\. Range is inclusive\.
 .RE
 .SH "HOLDINGDISK SECTION"
 .PP
 The
-\fBamanda.conf\fR
-file may define one or more holding disks used as buffers to hold backup images before they are written to tape. The syntax is:
+\fBamanda\.conf\fR
+file may define one or more holding disks used as buffers to hold backup images before they are written to tape\. The syntax is:
 .sp
 .RS 4
 .nf
 holdingdisk \fIname\fR {
     \fIholdingdisk\-option\fR \fIholdingdisk\-value\fR
-    ...
+    \.\.\.
 }
 .fi
 .RE
 .PP
 \fIName\fR
-is a logical name for this holding disk.
+is a logical name for this holding disk\.
 .PP
 The options and values are:
 .PP
 \fBcomment\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. A comment string describing this holding disk.
+\fInone\fR\. A comment string describing this holding disk\.
 .RE
 .PP
 \fBdirectory\fR \fI disk\fR
 .RS 4
 Default:
-\fI/dumps/amanda\fR. The path to this holding area.
+\fI/dumps/amanda\fR\. The path to this holding area\.
 .RE
 .PP
 \fBuse\fR \fI int\fR
 .RS 4
 Default:
-\fI0 Gb\fR. Amount of space that can be used in this holding disk area. If the value is zero, all available space on the file system is used. If the value is negative,
+\fI0 Gb\fR\. Amount of space that can be used in this holding disk area\. If the value is zero, all available space on the file system is used\. If the value is negative,
 \fIAmanda\fR
-will use all available space minus that value.
+will use all available space minus that value\.
 .RE
 .PP
 \fBchunksize\fR \fI int\fR
 .RS 4
 Default:
-\fI1 Gb\fR. Holding disk chunk size. Dumps larger than the specified size will be stored in multiple holding disk files. The size of each chunk will not exceed the specified value. However, even though dump images are split in the holding disk, they are concatenated as they are written to tape, so each dump image still corresponds to a single continuous tape section.
+\fI1 Gb\fR\. Holding disk chunk size\. Dumps larger than the specified size will be stored in multiple holding disk files\. The size of each chunk will not exceed the specified value\. However, even though dump images are split in the holding disk, they are concatenated as they are written to tape, so each dump image still corresponds to a single continuous tape section\.
 .sp
 If 0 is specified,
 \fIAmanda\fR
-will create holding disk chunks as large as ((INT_MAX/1024)\-64) Kbytes.
+will create holding disk chunks as large as ((INT_MAX/1024)\-64) Kbytes\.
 .sp
-Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk size is 64 Kbytes (but that would be really silly).
+Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk size is 64 Kbytes (but that would be really silly)\.
 .sp
-Operating systems that are limited to a maximum file size of 2 Gbytes actually cannot handle files that large. They must be at least one byte less than 2 Gbytes. Since
+Operating systems that are limited to a maximum file size of 2 Gbytes actually cannot handle files that large\. They must be at least one byte less than 2 Gbytes\. Since
 \fIAmanda\fR
-works with 32 Kbyte blocks, and to handle the final read at the end of the chunk, the chunk size should be at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size, e.g. 2047 Mbytes.
+works with 32 Kbyte blocks, and to handle the final read at the end of the chunk, the chunk size should be at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size, e\.g\. 2047 Mbytes\.
 .RE
 .SH "DUMPTYPE SECTION"
 .PP
 The
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 file may define multiple sets of backup options and refer to them by name from the
 \fIdisklist\fR
-file. For instance, one set of options might be defined for file systems that can benefit from high compression, another set that does not compress well, another set for file systems that should always get a full backup and so on.
+file\. For instance, one set of options might be defined for file systems that can benefit from high compression, another set that does not compress well, another set for file systems that should always get a full backup and so on\.
 .PP
 A set of backup options are entered in a
 \fBdumptype\fR
@@ -830,161 +931,162 @@ section, which looks like this:
 .nf
 define dumptype \fIname\fR {
     \fIdumptype\-option\fR \fIdumptype\-value\fR
-    ...
+    \.\.\.
 }
 .fi
 .RE
 .PP
 \fIName\fR
-is the name of this set of backup options. It is referenced from the
+is the name of this set of backup options\. It is referenced from the
 \fIdisklist\fR
-file.
+file\.
 .PP
 Some of the options in a
 \fBdumptype\fR
 section are the same as those in the main part of
-\fIamanda.conf\fR. The main option value is used to set the default for all
+\fIamanda\.conf\fR\. The main option value is used to set the default for all
 \fBdumptype\fR
-sections. For instance, setting
+sections\. For instance, setting
 \fBdumpcycle\fR
 to 50 in the main part of the config file causes all following
 \fBdumptype\fR
-sections to start with that value, but the value may be changed on a section by section basis. Changes to variables in the main part of the config file must be done before (earlier in the file) any
-\fBdumptype\fRs are defined.
+sections to start with that value, but the value may be changed on a section by section basis\. Changes to variables in the main part of the config file must be done before (earlier in the file) any
+\fBdumptype\fRs are defined\.
 .PP
 The dumptype options and values are:
 .PP
 \fBauth\fR \fI string\fR
 .RS 4
 Default:
-\fIbsd\fR. Type of authorization to perform between tape server and backup client hosts.
+\fIbsd\fR\. Type of authorization to perform between tape server and backup client hosts\.
 .sp
-\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream.
+\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream\.
 .sp
-\fBbsdtcp\fR, bsd authorization but use only one tcp connection.
+\fBbsdtcp\fR, bsd authorization but use only one tcp connection\.
 .sp
-\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream.
+\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream\.
 .sp
 \fBkrb4\fR
-to use Kerberos\-IV authorization.
+to use Kerberos\-IV authorization\.
 .sp
 \fBkrb5\fR
-to use Kerberos\-V authorization.
+to use Kerberos\-V authorization\.
+.sp
+\fBlocal\fR, if the client is the server, it doesn\'t require authencation setup\.
 .sp
 \fBrsh\fR
-to use rsh authorization.
+to use rsh authorization\.
 .sp
 \fBssh\fR
-to use OpenSSH authorization.
+to use OpenSSH authorization\.
 .RE
 .PP
 \fBamandad_path\fR \fI string\fR
 .RS 4
 Default:
-\fI$libexec/amandad\fR. Specify the amandad path of the client, only use with rsh/ssh authentification.
+\fI$libexec/amandad\fR\. Specify the amandad path of the client, only use with rsh/ssh authentification\.
 .RE
 .PP
 \fBclient_username\fR \fI string\fR
 .RS 4
 Default:
-\fICLIENT_LOGIN\fR. Specify the username to connect on the client, only use with rsh/ssh authentification.
+\fICLIENT_LOGIN\fR\. Specify the username to connect on the client, only use with rsh/ssh authentification\.
 .RE
 .PP
 \fBbumpsize\fR int
 .RS 4
 Default:
-\fI10 Mbytes\fR. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size. If
+\fI10 Mbytes\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\. If
 \fIAmanda\fR
-determines that the next higher backup level will be this much smaller than the current level, it will do the next level. The value of this parameter is used only if the parameter
+determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. The value of this parameter is used only if the parameter
 \fIbumppercent\fR
-is set to 0.
+is set to 0\.
 .sp
 See also the options
 \fBbumppercent\fR,
 \fBbumpmult\fR
 and
-\fBbumpdays\fR.
+\fBbumpdays\fR\.
 .RE
 .PP
 \fBbumppercent\fR int
 .RS 4
 Default:
-\fI0 percent\fR. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0). If
+\fI0 percent\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\. If
 \fIAmanda\fR
-determines that the next higher backup level will be this much smaller than the current level, it will do the next level.
+determines that the next higher backup level will be this much smaller than the current level, it will do the next level\.
 .sp
 If this parameter is set to 0, the value of the parameter
 \fIbumpsize\fR
-is used to trigger bumping.
+is used to trigger bumping\.
 .sp
 See also the options
 \fBbumpsize\fR,
 \fBbumpmult\fR
 and
-\fBbumpdays\fR.
+\fBbumpdays\fR\.
 .RE
 .PP
 \fBbumpmult\fR \fI float\fR
 .RS 4
 Default:
-1.5. The bump size multiplier.
+1\.5\. The bump size multiplier\.
 \fIAmanda\fR
 multiplies
 \fBbumpsize\fR
-by this factor for each level. This prevents active filesystems from bumping too much by making it harder to bump to the next level. For example, with the default
+by this factor for each level\. This prevents active filesystems from bumping too much by making it harder to bump to the next level\. For example, with the default
 \fBbumpsize\fR
 and
 \fBbumpmult\fR
-set to 2.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on.
+set to 2\.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\.
 .RE
 .PP
 \fBbumpdays\fR \fI int\fR
 .RS 4
 Default:
-\fI2 days\fR. To insure redundancy in the dumps,
+\fI2 days\fR\. To insure redundancy in the dumps,
 \fIAmanda\fR
 keeps filesystems at the same incremental level for at least
 \fBbumpdays\fR
-days, even if the other bump threshold criteria are met.
+days, even if the other bump threshold criteria are met\.
 .RE
 .PP
 \fBcomment\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. A comment string describing this set of backup options.
+\fInone\fR\. A comment string describing this set of backup options\.
 .RE
 .PP
 \fBcomprate\fR \fIfloat\fR [, \fIfloat\fR ]
 .RS 4
 Default:
-0.50,
-0.50. The expected full and incremental compression factor for dumps. It is only used if
+0\.50,
+0\.50\. The expected full and incremental compression factor for dumps\. It is only used if
 \fIAmanda\fR
-does not have any history information on compression rates for a filesystem, so should not usually need to be set. However, it may be useful for the first time a very large filesystem that compresses very little is backed up.
+does not have any history information on compression rates for a filesystem, so should not usually need to be set\. However, it may be useful for the first time a very large filesystem that compresses very little is backed up\.
 .RE
 .PP
 \fBcompress [client|server]\fR \fI string\fR
 .RS 4
 Default:
-\fIclient fast\fR. If
+\fIclient fast\fR\. If
 \fIAmanda\fR
-does compression of the backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape. Which place to do compression (if at all) depends on how well the dump image usually compresses, the speed and load on the client or server, network capacity, holding disk capacity, availability of tape hardware compression, etc.
+does compression of the backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\. Which place to do compression (if at all) depends on how well the dump image usually compresses, the speed and load on the client or server, network capacity, holding disk capacity, availability of tape hardware compression, etc\.
 .sp
 For either type of compression,
 \fIAmanda\fR
-also allows the selection of three styles of compression.
+also allows the selection of three styles of compression\.
 \fBBest\fR
-is the best compression available, often at the expense of CPU overhead.
+is the best compression available, often at the expense of CPU overhead\.
 \fBFast\fR
 is often not as good a compression as
-\fBbest\fR, but usually less CPU overhead. Or to specify
+\fBbest\fR, but usually less CPU overhead\. Or to specify
 \fBCustom\fR
-to use your own compression method. (See dumptype custom\-compress in example/amanda.conf for reference)
+to use your own compression method\. (See dumptype custom\-compress in example/amanda\.conf for reference)
 .sp
 So the
 \fBcompress\fR
 options line may be one of:
-.RS 4
 .PP
 compress none
 .RS 4
@@ -1004,7 +1106,7 @@ Specify
 \fIclient_custom_compress\fR
 "PROG"
 .sp
-PROG must not contain white space and it must accept \-d for uncompress.
+PROG must not contain white space and it must accept \-d for uncompress\.
 .RE
 .PP
 compress server fast
@@ -1021,32 +1123,30 @@ Specify
 \fIserver_custom_compress\fR
 "PROG"
 .sp
-PROG must not contain white space and it must accept \-d for uncompress.
+PROG must not contain white space and it must accept \-d for uncompress\.
 .RE
-.RE
-.IP "" 4
-Note that some tape devices do compression and this option has nothing to do with whether that is used. If hardware compression is used (usually via a particular tape device name or
+.sp
+Note that some tape devices do compression and this option has nothing to do with whether that is used\. If hardware compression is used (usually via a particular tape device name or
 \fBmt\fR
 option),
 \fIAmanda\fR
-(software) compression should be disabled.
+(software) compression should be disabled\.
 .RE
 .PP
 \fBdumpcycle\fR \fI int\fR
 .RS 4
 Default:
-\fI10 days\fR. The number of days in the backup cycle. Each disk using this set of options will get a full backup at least this of ten. Setting this to zero tries to do a full backup each run.
+\fI10 days\fR\. The number of days in the backup cycle\. Each disk using this set of options will get a full backup at least this of ten\. Setting this to zero tries to do a full backup each run\.
 .RE
 .PP
 \fBencrypt [none|client|server]\fR
 .RS 4
 Default:
-\fInone\fR. To encrypt backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape.
+\fInone\fR\. To encrypt backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\.
 .sp
 So the
 \fBencrypt\fR
 options line may be one of:
-.RS 4
 .PP
 encrypt none
 .RS 4
@@ -1056,91 +1156,88 @@ encrypt client
 .RS 4
 Specify client_encrypt "PROG"
 .sp
-PROG must not contain white space.
+PROG must not contain white space\.
 .sp
 Specify client_decrypt_option "decryption\-parameter" Default: "\-d"
 .sp
-decryption\-parameter must not contain white space.
+decryption\-parameter must not contain white space\.
 .sp
-(See dumptype server\-encrypt\-fast in example/amanda.conf for reference)
+(See dumptype server\-encrypt\-fast in example/amanda\.conf for reference)
 .RE
 .PP
 encrypt server
 .RS 4
 Specify server_encrypt "PROG"
 .sp
-PROG must not contain white space.
+PROG must not contain white space\.
 .sp
 Specify server_decrypt_option "decryption\-parameter" Default: "\-d"
 .sp
-decryption\-parameter must not contain white space.
+decryption\-parameter must not contain white space\.
 .sp
-(See dumptype client\-encrypt\-nocomp in example/amanda.conf for reference)
+(See dumptype client\-encrypt\-nocomp in example/amanda\.conf for reference)
 .RE
-.RE
-.IP "" 4
-Note that current logic assumes compression then encryption during backup(thus decrypt then uncompress during restore). So specifying client\-encryption AND server\-compression is not supported.
+.sp
+Note that current logic assumes compression then encryption during backup(thus decrypt then uncompress during restore)\. So specifying client\-encryption AND server\-compression is not supported\.
 \fIamcrypt\fR
 which is a wrapper of
 \fIaespipe\fR
-is provided as a reference symmetric encryption program.
+is provided as a reference symmetric encryption program\.
 .RE
 .PP
 \fBestimate\fR \fIclient|calcsize|server\fR
 .RS 4
 Default:
-\fIclient\fR. Determine the way
+\fIclient\fR\. Determine the way
 \fIAmanda\fR
-does it's estimate.
-.RS 4
+does it\'s estimate\.
 .PP
 client
 .RS 4
-Use the same program as the dumping program, this is the most accurate way to do estimates, but it can take a long time.
+Use the same program as the dumping program, this is the most accurate way to do estimates, but it can take a long time\.
 .RE
 .PP
 calcsize
 .RS 4
-Use a faster program to do estimates, but the result is less accurate.
+Use a faster program to do estimates, but the result is less accurate\.
 .RE
 .PP
 server
 .RS 4
-Use only statistics from the previous run to give an estimate, it takes only a few seconds but the result is not accurate if your disk usage changes from day to day.
-.RE
+Use only statistics from the previous run to give an estimate, it takes only a few seconds but the result is not accurate if your disk usage changes from day to day\.
 .RE
 .RE
 .PP
 \fBexclude\fR [ list|file ][[optional][ append ][ \fIstring\fR ]+]
 .RS 4
 Default:
-\fIfile\fR. There are two exclude lists,
+\fIfile\fR\. There are two exclude lists,
 \fBexclude file\fR
 and
-\fBexclude list.\fR
+\fBexclude list\.\fR
 With
 \fBexclude file\fR
 , the
 \fIstring\fR
 is a
 \fBGNU\-tar\fR
-exclude expression. With
+exclude expression\. With
 \fBexclude list\fR
 , the
 \fIstring\fR
 is a file name on the client containing
 \fBGNU\-tar\fR
-exclude expressions. The path to the specified exclude list file, if present (see description of 'optional' below), must be readable by the
+exclude expressions\. The path to the specified exclude list file, if present (see description of \'optional\' below), must be readable by the
 \fIAmanda\fR
-user.
+user\.
 .sp
 All exclude expressions are concatenated in one file and passed to
 \fBGNU\-tar\fR
 as an
 \fB\-\-exclude\-from\fR
-argument.
+argument\.
 .sp
-Exclude expressions must always be specified as relative to the head directory of the DLE.
+Exclude expressions must always be specified as relative to the head directory of the DLE\.
 .sp
 With the
 \fBappend\fR
@@ -1148,102 +1245,100 @@ keyword, the
 \fIstring\fR
 is appended to the current list, without it, the
 \fIstring\fR
-overwrites the list.
+overwrites the list\.
 .sp
 If
 \fBoptional\fR
 is specified for
-\fBexclude list\fR, then amcheck will not complain if the file doesn't exist or is not readable.
+\fBexclude list\fR, then amcheck will not complain if the file doesn\'t exist or is not readable\.
 .sp
 For
-\fBexclude list\fR, if the file name is relative, the disk name being backed up is prepended. So if this is entered:
+\fBexclude list\fR, if the file name is relative, the disk name being backed up is prepended\. So if this is entered:
 .sp
 .RS 4
 .nf
-    exclude list ".amanda.excludes"
+    exclude list "\.amanda\.excludes"
 .fi
 .RE
 the actual file used would be
-\fI/var/.amanda.excludes\fR
+\fI/var/\.amanda\.excludes\fR
 for a backup of
 \fI/var\fR,
-\fI/usr/local/.amanda.excludes\fR
+\fI/usr/local/\.amanda\.excludes\fR
 for a backup of
-\fI/usr/local\fR, and so on.
+\fI/usr/local\fR, and so on\.
 .RE
 .PP
 \fBholdingdisk\fR [ never|auto|required ]
 .RS 4
 Default:
-\fIauto\fR. Whether a holding disk should be used for these backups or whether they should go directly to tape. If the holding disk is a portion of another file system that
+\fIauto\fR\. Whether a holding disk should be used for these backups or whether they should go directly to tape\. If the holding disk is a portion of another file system that
 \fIAmanda\fR
 is backing up, that file system should refer to a dumptype with
 \fBholdingdisk\fR
 set to
 \fInever\fR
-to avoid backing up the holding disk into itself.
-.RS 4
+to avoid backing up the holding disk into itself\.
 .PP
 \fBnever\fR|no|false|off
 .RS 4
-Never use a holdingdisk, the dump will always go directly to tape. There will be no dump if you have a tape error.
+Never use a holdingdisk, the dump will always go directly to tape\. There will be no dump if you have a tape error\.
 .RE
 .PP
 \fBauto\fR|yes|true|on
 .RS 4
-Use the holding disk, unless there is a problem with the holding disk, the dump won't fit there or the medium doesn't require spooling (e.g., VFS device)
+Use the holding disk, unless there is a problem with the holding disk, the dump won\'t fit there or the medium doesn\'t require spooling (e\.g\., VFS device)
 .RE
 .PP
 \fBrequired\fR
 .RS 4
-Always dump to holdingdisk, never directly to tape. There will be no dump if it doesn't fit on holdingdisk
-.RE
+Always dump to holdingdisk, never directly to tape\. There will be no dump if it doesn\'t fit on holdingdisk
 .RE
 .RE
 .PP
 \fBignore\fR \fI boolean\fR
 .RS 4
 Default:
-\fIno\fR. Whether disks associated with this backup type should be backed up or not. This option is useful when the
+\fIno\fR\. Whether disks associated with this backup type should be backed up or not\. This option is useful when the
 \fIdisklist\fR
-file is shared among several configurations, some of which should not back up all the listed file systems.
+file is shared among several configurations, some of which should not back up all the listed file systems\.
 .RE
 .PP
 \fBinclude\fR [ list|file ][[optional][ append ][ \fIstring\fR ]+]
 .RS 4
 Default:
 \fIfile\fR
-".". There are two include lists,
+"\."\. There are two include lists,
 \fBinclude file\fR
 and
-\fBinclude list.\fR
+\fBinclude list\.\fR
 With
 \fBinclude file\fR
 , the
 \fIstring\fR
-is a glob expression. With
+is a glob expression\. With
 \fBinclude list\fR
 , the
 \fIstring\fR
-is a file name on the client containing glob expressions.
+is a file name on the client containing glob expressions\.
 .sp
 All include expressions are expanded by
 \fIAmanda\fR, concatenated in one file and passed to
 \fBGNU\-tar\fR
 as a
 \fB\-\-files\-from\fR
-argument. They must start with "./" and contain no other "/".
+argument\. They must start with "\./" and contain no other "/"\.
 .sp
-Include expressions must always be specified as relative to the head directory of the DLE.
+Include expressions must always be specified as relative to the head directory of the DLE\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 For globbing to work at all, even the limited single level, the top level directory of the DLE must be readable by the
 \fIAmanda\fR
-user.
+user\.
 
 With the
 \fBappend\fR
@@ -1251,166 +1346,164 @@ keyword, the
 \fIstring\fR
 is appended to the current list, without it, the
 \fIstring\fR
-overwrites the list.
+overwrites the list\.
 .sp
 If
 \fBoptional\fR
 is specified for
 \fBinclude list,\fR
-then amcheck will not complain if the file doesn't exist or is not readable.
+then amcheck will not complain if the file doesn\'t exist or is not readable\.
 .sp
 For
-\fBinclude list\fR, If the file name is relative, the disk name being backed up is prepended.
+\fBinclude list\fR, If the file name is relative, the disk name being backed up is prepended\.
 .RE
 .PP
 \fBindex\fR \fI boolean\fR
 .RS 4
 Default:
-\fIno\fR. Whether an index (catalogue) of the backup should be generated and saved in
-\fBindexdir\fR. These catalogues are used by the
+\fIno\fR\. Whether an index (catalogue) of the backup should be generated and saved in
+\fBindexdir\fR\. These catalogues are used by the
 \fBamrecover\fR
-utility.
+utility\.
 .RE
 .PP
 \fBkencrypt\fR \fI boolean\fR
 .RS 4
 Default:
-\fIno\fR. Whether the backup image should be encrypted by Kerberos as it is sent across the network from the backup client host to the tape server host.
+\fIno\fR\. Whether the backup image should be encrypted by Kerberos as it is sent across the network from the backup client host to the tape server host\.
 .RE
 .PP
 \fBmaxdumps\fR \fI int\fR
 .RS 4
 Default:
-1. The maximum number of backups from a single host that
+1\. The maximum number of backups from a single host that
 \fIAmanda\fR
-will attempt to run in parallel. See also the main section parameter
-\fBinparallel\fR.
+will attempt to run in parallel\. See also the main section parameter
+\fBinparallel\fR\.
 .RE
 .PP
 \fBmaxpromoteday\fR \fI int\fR
 .RS 4
 Default:
-10000. The maximum number of day for a promotion, set it 0 if you don't want promotion, set it to 1 or 2 if your disks get overpromoted.
+10000\. The maximum number of day for a promotion, set it 0 if you don\'t want promotion, set it to 1 or 2 if your disks get overpromoted\.
 .RE
 .PP
 \fBpriority\fR \fI string\fR
 .RS 4
 Default:
-\fImedium\fR. When there is no tape to write to,
+\fImedium\fR\. When there is no tape to write to,
 \fIAmanda\fR
-will do incremental backups in priority order to the holding disk. The priority may be high (2), medium (1), low (0) or a number of your choice.
+will do incremental backups in priority order to the holding disk\. The priority may be high (2), medium (1), low (0) or a number of your choice\.
 .RE
 .PP
 \fBprogram\fR \fI string\fR
 .RS 4
 Default:
-\fIDUMP\fR. The type of backup to perform. Valid values are
+\fIDUMP\fR\. The type of backup to perform\. Valid values are
 \fBDUMP\fR
 for the native operating system backup program, and
 \fBGNUTAR\fR
 to use
 \fBGNU\-tar\fR
-or to do PC backups using Samba.
+or to do PC backups using Samba\.
 .RE
 .PP
 \fBrecord\fR \fI boolean\fR
 .RS 4
 Default:
-\fIyes\fR. Whether to ask the backup program to update its database (e.g.
+\fIyes\fR\. Whether to ask the backup program to update its database (e\.g\.
 \fI/etc/dumpdates\fR
 for DUMP or
 \fI/usr/local/var/amanda/gnutar\-lists\fR
-for GNUTAR) of time stamps. This is normally enabled for daily backups and turned off for periodic archival runs.
+for GNUTAR) of time stamps\. This is normally enabled for daily backups and turned off for periodic archival runs\.
 .RE
 .PP
 \fBskip\-full\fR \fI boolean\fR
 .RS 4
 Default:
-\fIno\fR. If
+\fIno\fR\. If
 \fItrue\fR
 and
 \fBplanner\fR
-has scheduled a full backup, these disks will be skipped, and full backups should be run off\-line on these days. It was reported that
+has scheduled a full backup, these disks will be skipped, and full backups should be run off\-line on these days\. It was reported that
 \fIAmanda\fR
-only schedules level 1 incrementals in this configuration; this is probably a bug.
+only schedules level 1 incrementals in this configuration; this is probably a bug\.
 .RE
 .PP
 \fBskip\-incr\fR \fI boolean\fR
 .RS 4
 Default:
-\fIno\fR. If
+\fIno\fR\. If
 \fItrue\fR
 and
 \fBplanner\fR
-has scheduled an incremental backup, these disks will be skipped.
+has scheduled an incremental backup, these disks will be skipped\.
 .RE
 .PP
 \fBstarttime\fR \fI int\fR
 .RS 4
 Default:
-\fInone\fR. Backups will not start until after this time of day. The value should be hh*100+mm, e.g. 6:30PM (18:30) would be entered as
-1830.
+\fInone\fR\. Backups will not start until after this time of day\. The value should be hh*100+mm, e\.g\. 6:30PM (18:30) would be entered as
+1830\.
 .RE
 .PP
 \fBstrategy\fR \fI string\fR
 .RS 4
 Default:
-\fIstandard\fR. Strategy to use when planning what level of backup to run next. Values are:
-.RS 4
+\fIstandard\fR\. Strategy to use when planning what level of backup to run next\. Values are:
 .PP
 \fBstandard\fR
 .RS 4
 The standard
 \fIAmanda\fR
-schedule.
+schedule\.
 .RE
 .PP
 \fBnofull\fR
 .RS 4
-Never do full backups, only level 1 incrementals.
+Never do full backups, only level 1 incrementals\.
 .RE
 .PP
 \fBnoinc\fR
 .RS 4
-Never do incremental backups, only full dumps.
+Never do incremental backups, only full dumps\.
 .RE
 .PP
 \fBskip\fR
 .RS 4
 Never do backups (useful when sharing the
 \fIdisklist\fR
-file).
+file)\.
 .RE
 .PP
 \fBincronly\fR
 .RS 4
-Only do incremental dumps.
+Only do incremental dumps\.
 \fBamadmin force\fR
 should be used to tell
 \fIAmanda\fR
-that a full dump has been performed off\-line, so that it resets to level 1. It is similar to skip\-full, but with incronly full dumps may be scheduled manually. Unfortunately, it appears that
+that a full dump has been performed off\-line, so that it resets to level 1\. It is similar to skip\-full, but with incronly full dumps may be scheduled manually\. Unfortunately, it appears that
 \fIAmanda\fR
-will perform full backups with this configuration, which is probably a bug.
-.RE
+will perform full backups with this configuration, which is probably a bug\.
 .RE
 .RE
 .PP
 \fBtape_splitsize\fR \fI int\fR
 .RS 4
 Default:
-\fInone\fR. Split dump file on tape into pieces of a specified size. This allows dumps to be spread across multiple tapes, and can potentially make more efficient use of tape space. Note that if this value is too large (more than half the size of the average dump being split), substantial tape space can be wasted. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity. A good rule of thumb, usually, is 1/10 of the size of your tape.
+\fInone\fR\. Split dump file on tape into pieces of a specified size\. This allows dumps to be spread across multiple tapes, and can potentially make more efficient use of tape space\. Note that if this value is too large (more than half the size of the average dump being split), substantial tape space can be wasted\. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity\. A good rule of thumb, usually, is 1/10 of the size of your tape\.
 .RE
 .PP
 \fBsplit_diskbuffer\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. When dumping a split dump in PORT\-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option.
+\fInone\fR\. When dumping a split dump in PORT\-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option\.
 .RE
 .PP
 \fBfallback_splitsize\fR \fI int\fR
 .RS 4
 Default:
-\fI10M\fR. When dumping a split dump in PORT\-WRITE mode, if no split_diskbuffer is specified (or if we somehow fail to use our split_diskbuffer), we must buffer split chunks in memory. This specifies the maximum size split chunks can be in this scenario, and thus the maximum amount of memory consumed for in\-memory splitting. The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume.
+\fI10M\fR\. When dumping a split dump in PORT\-WRITE mode, if no split_diskbuffer is specified (or if we somehow fail to use our split_diskbuffer), we must buffer split chunks in memory\. This specifies the maximum size split chunks can be in this scenario, and thus the maximum amount of memory consumed for in\-memory splitting\. The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume\.
 .RE
 .PP
 The following
@@ -1457,7 +1550,7 @@ section, one or more other
 names may be entered, which make this
 \fBdumptype\fR
 inherit options from other previously defined
-\fBdumptype\fRs. For instance, two sections might be the same except for the
+\fBdumptype\fRs\. For instance, two sections might be the same except for the
 \fBrecord\fR
 option:
 .sp
@@ -1483,15 +1576,15 @@ provides a
 named
 \fIglobal\fR
 in the sample
-\fBamanda.conf\fR
+\fBamanda\.conf\fR
 file that all
-\fBdumptype\fRs should reference. This provides an easy place to make changes that will affect every
-\fBdumptype\fR.
+\fBdumptype\fRs should reference\. This provides an easy place to make changes that will affect every
+\fBdumptype\fR\.
 .SH "TAPETYPE SECTION"
 .PP
 The
-\fBamanda.conf\fR
-file may define multiple types of tape media and devices. The information is entered in a
+\fBamanda\.conf\fR
+file may define multiple types of tape media and devices\. The information is entered in a
 \fBtapetype\fR
 section, which looks like this in the config file:
 .sp
@@ -1499,93 +1592,93 @@ section, which looks like this in the config file:
 .nf
 define tapetype \fIname\fR {
     \fItapetype\-option\fR \fItapetype\-value\fR
-    ...
+    \.\.\.
 }
 .fi
 .RE
 .PP
 \fIName\fR
-is the name of this type of tape medium/device. It is referenced from the
+is the name of this type of tape medium/device\. It is referenced from the
 \fBtapetype\fR
-option in the main part of the config file.
+option in the main part of the config file\.
 .PP
 The tapetype options and values are:
 .PP
 \fBcomment\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. A comment string describing this set of tape information.
+\fInone\fR\. A comment string describing this set of tape information\.
 .RE
 .PP
 \fBfilemark\fR \fI int\fR
 .RS 4
 Default:
-\fI1 kbytes\fR. How large a file mark (tape mark) is, measured in kbytes. If the size is only known in some linear measurement (e.g. inches), convert it to kbytes using the device density.
+\fI1 kbytes\fR\. How large a file mark (tape mark) is, measured in kbytes\. If the size is only known in some linear measurement (e\.g\. inches), convert it to kbytes using the device density\.
 .RE
 .PP
 \fBlength\fR \fI int\fR
 .RS 4
 Default:
-\fI2000 kbytes\fR. How much data will fit on a tape.
+\fI2000 kbytes\fR\. How much data will fit on a tape\.
 .sp
 Note that this value is only used by
 \fIAmanda\fR
-to schedule which backups will be run. Once the backups start,
+to schedule which backups will be run\. Once the backups start,
 \fIAmanda\fR
 will continue to write to a tape until it gets an error, regardless of what value is entered for
 \fBlength\fR
 (but see the section OUTPUT DRIVERS in the
 \fBamanda\fR(8)
-manpage for exceptions).
+manpage for exceptions)\.
 .RE
 .PP
 \fBblocksize\fR \fI int\fR
 .RS 4
 Default:
-\fI32 kbytes\fR. How much data will be written in each tape record expressed in KiloBytes. The tape record size (= blocksize) can not be reduced below the default 32 KBytes. The parameter blocksize can only be raised if
+\fI32 kbytes\fR\. How much data will be written in each tape record expressed in KiloBytes\. The tape record size (= blocksize) can not be reduced below the default 32 KBytes\. The parameter blocksize can only be raised if
 \fIAmanda\fR
 was compiled with the configure option \-\-with\-maxtapeblocksize=N set with "N" greater than 32 during
-\fBconfigure\fR.
+\fBconfigure\fR\.
 .RE
 .PP
 \fBreadblocksize\fR \fI int\fR
 .RS 4
-Default: (\fIfrom configure \-\-with\-maxtapeblocksize\fR). How much data will be read in each tape record expressed in KiloBytes. Some hardware require a value not too large, and some require it to be equal to the blocksize. It is useful if you configured amanda with a big \-\-with\-maxtapeblocksize and your hardware don't work with a value that big.
+Default: (\fIfrom configure \-\-with\-maxtapeblocksize\fR)\. How much data will be read in each tape record expressed in KiloBytes\. Some hardware require a value not too large, and some require it to be equal to the blocksize\. It is useful if you configured amanda with a big \-\-with\-maxtapeblocksize and your hardware don\'t work with a value that big\.
 .RE
 .PP
 \fBfile\-pad\fR \fI boolean\fR
 .RS 4
 Default:
-\fItrue\fR. If true, every record, including the last one in the file, will have the same length. This matches the way
+\fItrue\fR\. If true, every record, including the last one in the file, will have the same length\. This matches the way
 \fIAmanda\fR
-wrote tapes prior to the availability of this parameter. It may also be useful on devices that only support a fixed blocksize.
+wrote tapes prior to the availability of this parameter\. It may also be useful on devices that only support a fixed blocksize\.
 .sp
 Note that the last record on the tape probably includes trailing null byte padding, which will be passed back to
 \fBgzip\fR,
 \fBcompress\fR
-or the restore program. Most programs just ignore this (although possibly with a warning).
+or the restore program\. Most programs just ignore this (although possibly with a warning)\.
 .sp
-If this parameter is false, the last record in a file may be shorter than the block size. The file will contain the same amount of data the dump program generated, without trailing null byte padding. When read, the same amount of data that was written will be returned.
+If this parameter is false, the last record in a file may be shorter than the block size\. The file will contain the same amount of data the dump program generated, without trailing null byte padding\. When read, the same amount of data that was written will be returned\.
 .RE
 .PP
 \fBspeed\fR \fI int\fR
 .RS 4
 Default:
-\fI200 bps\fR. How fast the drive will accept data, in bytes per second. This parameter is NOT currently used by
-\fIAmanda\fR.
+\fI200 bps\fR\. How fast the drive will accept data, in bytes per second\. This parameter is NOT currently used by
+\fIAmanda\fR\.
 .RE
 .PP
 \fBlbl\-templ\fR \fI string\fR
 .RS 4
 A PostScript template file used by
 \fBamreport\fR
-to generate labels. Several sample files are provided with the
+to generate labels\. Several sample files are provided with the
 \fIAmanda\fR
 sources in the
 \fIexample\fR
-directory. See the
+directory\. See the
 \fBamreport\fR(8)
-man page for more information.
+man page for more information\.
 .RE
 .PP
 In addition to options, another
@@ -1593,7 +1686,7 @@ In addition to options, another
 name may be entered, which makes this
 \fBtapetype\fR
 inherit options from another
-\fBtapetype\fR. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape. So they could be entered as:
+\fBtapetype\fR\. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape\. So they could be entered as:
 .sp
 .RS 4
 .nf
@@ -1614,8 +1707,8 @@ define tapetype DLT4000\-IV {
 .SH "INTERFACE SECTION"
 .PP
 The
-\fBamanda.conf\fR
-file may define multiple types of network interfaces. The information is entered in an
+\fBamanda\.conf\fR
+file may define multiple types of network interfaces\. The information is entered in an
 \fBinterface\fR
 section, which looks like this:
 .sp
@@ -1623,35 +1716,35 @@ section, which looks like this:
 .nf
 define interface \fIname\fR {
     \fIinterface\-option\fR \fIinterface\-value\fR
-    ...
+    \.\.\.
 }
 .fi
 .RE
 .PP
 \fIname\fR
-is the name of this type of network interface. It is referenced from the
+is the name of this type of network interface\. It is referenced from the
 \fIdisklist\fR
-file.
+file\.
 .PP
-Note that these sections define network interface characteristics, not the actual interface that will be used. Nor do they impose limits on the bandwidth that will actually be taken up by
-\fIAmanda\fR.
+Note that these sections define network interface characteristics, not the actual interface that will be used\. Nor do they impose limits on the bandwidth that will actually be taken up by
+\fIAmanda\fR\.
 \fIAmanda\fR
-computes the estimated bandwidth each file system backup will take based on the estimated size and time, then compares that plus any other running backups with the limit as another of the criteria when deciding whether to start the backup. Once a backup starts,
+computes the estimated bandwidth each file system backup will take based on the estimated size and time, then compares that plus any other running backups with the limit as another of the criteria when deciding whether to start the backup\. Once a backup starts,
 \fIAmanda\fR
-will use as much of the network as it can leaving throttling up to the operating system and network hardware.
+will use as much of the network as it can leaving throttling up to the operating system and network hardware\.
 .PP
 The interface options and values are:
 .PP
 \fBcomment\fR \fI string\fR
 .RS 4
 Default:
-\fInone\fR. A comment string describing this set of network information.
+\fInone\fR\. A comment string describing this set of network information\.
 .RE
 .PP
 \fBuse\fR \fI int\fR
 .RS 4
 Default:
-\fI300 Kbps\fR. The speed of the interface in Kbytes per second.
+\fI8000 Kbps\fR\. The speed of the interface in Kbytes per second\.
 .RE
 .PP
 In addition to options, another
@@ -1659,19 +1752,22 @@ In addition to options, another
 name may be entered, which makes this
 \fBinterface\fR
 inherit options from another
-\fBinterface\fR. At the moment, this is of little use.
+\fBinterface\fR\. At the moment, this is of little use\.
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>: Original text
+<jds@amanda\.org>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion, major update, splitting
 .SH "SEE ALSO"
 .PP
 
 \fBamanda\fR(8),
-\fBamanda\-client.conf\fR(5),
+\fBamanda-client.conf\fR(5),
 \fBamcrypt\fR(8),
 \fBaespipe\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
+.PP
+An updated version of this man page may be available at http://wiki\.zmanda\.com/index\.php/Amanda\.conf\.
index 5ed8abb908fe4eef7ce808ef4414f3ff1d004c6f..44bd6cf4cc91ce0eb47a36c947e8f783119ebbe2 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amcheck
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECK" "8" "06/06/2007" "" ""
+.TH "AMCHECK" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcheck \- run Amanda self\-checks
+amcheck - run Amanda self-checks
 .SH "SYNOPSIS"
 .HP 8
 \fBamcheck\fR [\-am] [\-w] [\-sclt] [\-M\ \fIaddress\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]...
@@ -22,71 +22,71 @@ runs a number of self\-checks on both the
 \fIAmanda\fR
 tape server host and the
 \fIAmanda\fR
-client hosts.
+client hosts\.
 .PP
 On the tape server host,
 \fBamcheck\fR
 can go through the same tape checking used at the start of the nightly
 \fBamdump\fR
-run to verify the correct tape for the next run is mounted.
+run to verify the correct tape for the next run is mounted\.
 .PP
 \fBAmcheck\fR
-can also do a self\-check on all client hosts to make sure each host is running and that permissions on filesystems to be backed up are correct.
+can also do a self\-check on all client hosts to make sure each host is running and that permissions on filesystems to be backed up are correct\.
 .PP
-You can specify many host/disk expressions, only disks that match an expression will be checked. All disks are checked if no expressions are given.
+You can specify many host/disk expressions, only disks that match an expression will be checked\. All disks are checked if no expressions are given\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-s\fR
 .RS 4
 Run the tape server local and tape checks (same as
-\fB\-lt\fR).
+\fB\-lt\fR)\.
 .RE
 .PP
 \fB\-c\fR
 .RS 4
-Run the client host checks. Multiple specific clients can be checked by specifying the client name.
+Run the client host checks\. Multiple specific clients can be checked by specifying the client name\.
 .RE
 .PP
 \fB\-l\fR
 .RS 4
-Run the local tests (e.g. permissions) on the server host.
+Run the local tests (e\.g\. permissions) on the server host\.
 .RE
 .PP
 \fB\-t\fR
 .RS 4
-Run the tape tests on the server host.
+Run the tape tests on the server host\.
 .RE
 .PP
 \fB\-w\fR
 .RS 4
 Enables a DESTRUCTIVE check for write\-protection on the tape (which would otherwise cause the subsequent
 \fBamdump\fR
-to fail). If the tape is writable, this check causes all data after the tape label to be erased. If the label_new_tapes option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer. The check enable the tape tests on the server host and is only made if the tape is otherwise correct.
+to fail)\. If the tape is writable, this check causes all data after the tape label to be erased\. If the label_new_tapes option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer\. The check enable the tape tests on the server host and is only made if the tape is otherwise correct\.
 .RE
 .PP
 \fB\-m\fR
 .RS 4
-Nothing is printed, but mail is sent if any errors are detected. The mail goes to the
+Nothing is printed, but mail is sent if any errors are detected\. The mail goes to the
 \fBmailto\fR
 address specified in the
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 file or the
 \fIaddress\fR
 value if
 \fB\-M\fR
-is set.
+is set\.
 .RE
 .PP
 \fB\-a\fR
 .RS 4
 Like
 \fB\-m\fR
-but the mail is always sent.
+but the mail is always sent\.
 .RE
 .PP
 \fB\-M\fR \fIaddress\fR
@@ -96,54 +96,54 @@ Mail the report to
 instead of the
 \fBmailto\fR
 value from
-\fIamanda.conf\fR. Implies
-\fB\-m\fR.
+\fIamanda\.conf\fR\. Implies
+\fB\-m\fR\.
 .RE
 .PP
 \fIhost\fR [\fIdisk\fR]*
 .RS 4
-Specify the host and disk on which the command will work.
+Specify the host and disk on which the command will work\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .PP
 The default is
-\fB\-cs\fR.
+\fB\-cs\fR\.
 .SH "EXAMPLES"
 .PP
-In this example, both the tape server and client tests are run. The results are displayed on standard output.
+In this example, both the tape server and client tests are run\. The results are displayed on standard output\.
 .sp
 .RS 4
 .nf
 % amcheck daily
 \fIAmanda\fR Tape Server Host Check
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-/amanda2/amanda/work: 911475 KB disk space available, that's plenty.
-NOTE: skipping tape\-writable test.
-Tape VOL10 label ok.
-Server check took 34.966 seconds.
+/amanda2/amanda/work: 911475 KB disk space available, that\'s plenty\.
+NOTE: skipping tape\-writable test\.
+Tape VOL10 label ok\.
+Server check took 34\.966 seconds\.
 
 \fIAmanda\fR Backup Client Hosts Check
 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-WARNING: northstar: selfcheck request timed out.  Host down?
-WARNING: drinkme: selfcheck request timed out.  Host down?
-WARNING: scruffy: selfcheck request timed out.  Host down?
-Client check: 136 hosts checked in 51.945 seconds, 3 problems found.
+WARNING: northstar: selfcheck request timed out\.  Host down?
+WARNING: drinkme: selfcheck request timed out\.  Host down?
+WARNING: scruffy: selfcheck request timed out\.  Host down?
+Client check: 136 hosts checked in 51\.945 seconds, 3 problems found\.
 
-(brought to you by \fIAmanda\fR 2.5.0) 
+(brought to you by \fIAmanda\fR 2\.5\.0) 
 .fi
 .RE
 .PP
 In this example, if the line
 \fBmailto csd\-amanda\fR
 is in
-\fIamanda.conf\fR, mail will be sent to
+\fIamanda\.conf\fR, mail will be sent to
 \fBcsd\-amanda\fR
-if the server check returns an error.
+if the server check returns an error\.
 .sp
 .RS 4
 .nf
@@ -155,13 +155,13 @@ if the server check returns an error.
 fatal slot \fIslot\fR: \fIerror message\fR
 .RS 4
 (error) The tape changer detected some kind of fatal error while trying to load slot
-\fIslot\fR.
+\fIslot\fR\.
 .RE
 .PP
 slot \fIslot\fR: \fIerror message\fR
 .RS 4
-(warning) The tape changer detected some kind of non\-fatal error (e.g. an empty slot was detected) while trying to load slot
-\fIslot\fR, or an error was detected trying to read the tape label.
+(warning) The tape changer detected some kind of non\-fatal error (e\.g\. an empty slot was detected) while trying to load slot
+\fIslot\fR, or an error was detected trying to read the tape label\.
 .RE
 .PP
 slot \fIslot\fR: date \fIYYYYMMDD\fR label \fIlabel\fR (\fIresult\fR)
@@ -171,15 +171,14 @@ slot \fIslot\fR: date \fIYYYYMMDD\fR label \fIlabel\fR (\fIresult\fR)
 in slot
 \fIslot\fR
 was loaded and found to have been last written on
-\fIYYYYMMDD\fR. If the tape is new, the date field will be an
-\fIX\fR. The
+\fIYYYYMMDD\fR\. If the tape is new, the date field will be an
+\fIX\fR\. The
 \fIresult\fR
 may be one of:
-.RS 4
 .PP
 exact label match
 .RS 4
-This is the expected tape.
+This is the expected tape\.
 .RE
 .PP
 no match
@@ -187,12 +186,12 @@ no match
 This label does not match the
 \fBlabelstr\fR
 pattern in
-\fIamanda.conf\fR. Tape scanning will continue.
+\fIamanda\.conf\fR\. Tape scanning will continue\.
 .RE
 .PP
 active tape
 .RS 4
-This tape is still active and cannot be overwritten. Tape scanning will continue.
+This tape is still active and cannot be overwritten\. Tape scanning will continue\.
 .RE
 .PP
 first labelstr match
@@ -200,7 +199,7 @@ first labelstr match
 This tape is the first one that matches the
 \fBlabelstr\fR
 pattern in
-\fIamanda.conf\fR. Tape scanning will continue if necessary.
+\fIamanda\.conf\fR\. Tape scanning will continue if necessary\.
 .RE
 .PP
 labelstr match
@@ -208,10 +207,9 @@ labelstr match
 This tape is the next one that matches the
 \fBlabelstr\fR
 pattern in
-\fIamanda.conf\fR. Tape scanning will continue.
-.RE
+\fIamanda\.conf\fR\. Tape scanning will continue\.
 .RE
-.IP "" 4
+.sp
 .RE
 .PP
 ERROR: cannot look up dump user \fIuser\fR
@@ -219,8 +217,8 @@ ERROR: cannot look up dump user \fIuser\fR
 (error) Dump user
 \fIuser\fR
 from
-\fIamanda.conf\fR
-could not be found in the system password information.
+\fIamanda\.conf\fR
+could not be found in the system password information\.
 .RE
 .PP
 ERROR: cannot look up my own uid (\fIuid\fR)
@@ -229,7 +227,7 @@ ERROR: cannot look up my own uid (\fIuid\fR)
 \fIuid\fR
 running
 \fBamcheck\fR
-could not be found in the system password information.
+could not be found in the system password information\.
 .RE
 .PP
 ERROR: running as user \fIrunuser\fR instead of \fIdumpuser\fR
@@ -239,9 +237,9 @@ ERROR: running as user \fIrunuser\fR instead of \fIdumpuser\fR
 should be run as the dump user
 \fIdumpuser\fR
 from
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 instead of
-\fIrunuser\fR.
+\fIrunuser\fR\.
 .RE
 .PP
 ERROR: program dir \fIdirectory\fR: not accessible
@@ -249,45 +247,44 @@ ERROR: program dir \fIdirectory\fR: not accessible
 (error) The directory
 \fIAmanda\fR
 expects to find its auxiliary programs in,
-\fIdirectory\fR, is not accessible.
+\fIdirectory\fR, is not accessible\.
 .RE
 .PP
 ERROR: program \fIprogram\fR: does not exist
 .RS 4
 (error) Program
 \fIprogram\fR
-needed on the tape server could not be found.
+needed on the tape server could not be found\.
 .RE
 .PP
 ERROR: program \fIprogram\fR: not a file
 .RS 4
 (error) Program
 \fIprogram\fR
-needed on the tape server exists but is not a file.
+needed on the tape server exists but is not a file\.
 .RE
 .PP
 ERROR: program \fIprogram\fR: not executable
 .RS 4
 (error) Program
 \fIprogram\fR
-needed on the tape server exists but is not executable.
+needed on the tape server exists but is not executable\.
 .RE
 .PP
 WARNING: program \fIprogram\fR: not setuid\-root
 .RS 4
 (warning) Program
 \fIprogram\fR
-needed on the tape server exists but should be owned by user "root" and setuid.
+needed on the tape server exists but should be owned by user "root" and setuid\.
 .RE
 .PP
 ERROR: \fIXXX\fR dir \fIdirectory\fR: not writable
 .RS 4
 (error) Directory
 \fIdirectory\fR
-is either not writable, i.e. the dump user will not be able to create or remove files, or cannot be accessed, perhaps because a parent directory does not allow search permission. The
+is either not writable, i\.e\. the dump user will not be able to create or remove files, or cannot be accessed, perhaps because a parent directory does not allow search permission\. The
 \fIXXX\fR
 may be:
-.RS 4
 .PP
 log
 .RS 4
@@ -296,7 +293,7 @@ for the
 log directory (see
 \fBlogdir\fR
 in
-\fBamanda.conf\fR)
+\fBamanda\.conf\fR)
 .RE
 .PP
 oldlog
@@ -304,7 +301,7 @@ oldlog
 for the directory that holds the old log files (see
 \fBlogdir\fR
 in
-\fBamanda.conf\fR)
+\fBamanda\.conf\fR)
 .RE
 .PP
 info
@@ -314,7 +311,7 @@ for an
 database information directory (see
 \fBcurinfo\fR
 in
-\fBamanda.conf\fR) or
+\fBamanda\.conf\fR) or
 .RE
 .PP
 index
@@ -324,7 +321,7 @@ for an
 index directory (see
 \fBindexdir\fR
 in
-\fBamanda.conf\fR)
+\fBamanda\.conf\fR)
 .RE
 .PP
 tapelist
@@ -334,20 +331,19 @@ for the
 tapelist directory (see
 \fBtapelist\fR
 in
-\fBamanda.conf\fR)
-.RE
+\fBamanda\.conf\fR)
 .RE
-.IP "" 4
+.sp
 .RE
 .PP
 NOTE: \fIXXX\fR dir \fIdirectory\fR: does not exist
 .RS 4
-(info) A database (info) or index directory does not exist or cannot be accessed. This might just mean this is a new client or disk, but if that is not the case, this should be treated as an error.
+(info) A database (info) or index directory does not exist or cannot be accessed\. This might just mean this is a new client or disk, but if that is not the case, this should be treated as an error\.
 .RE
 .PP
 NOTE: it will be created on the next run
 .RS 4
-(info) This indicates the info directory listed in the previous message will be created on the next run.
+(info) This indicates the info directory listed in the previous message will be created on the next run\.
 .RE
 .PP
 ERROR: \fIXXX\fR dir \fIname\fR: not a directory
@@ -356,14 +352,14 @@ ERROR: \fIXXX\fR dir \fIname\fR: not a directory
 \fBAmcheck\fR
 expected
 \fIname\fR
-to be a directory, but it is something else (e.g. file).
+to be a directory, but it is something else (e\.g\. file)\.
 .RE
 .PP
 WARNING: info file \fIfile\fR: does not exist
 .RS 4
 (warning) File
 \fIfile\fR
-does not exist in the text format database. Since the parent directories do exist, the file should already have been created.
+does not exist in the text format database\. Since the parent directories do exist, the file should already have been created\.
 .RE
 .PP
 ERROR: info file \fIname\fR: not a file
@@ -372,14 +368,14 @@ ERROR: info file \fIname\fR: not a file
 \fBAmcheck\fR
 expected
 \fIname\fR
-to be a file, but it is something else (e.g. file).
+to be a file, but it is something else (e\.g\. file)\.
 .RE
 .PP
 ERROR: info file \fIfile\fR: not readable
 .RS 4
 (error) The text format database file
 \fIfile\fR
-is not readable.
+is not readable\.
 .RE
 .PP
 ERROR: log file \fIfile\fR: not writable
@@ -391,7 +387,7 @@ ERROR: log file \fIfile\fR: not writable
 in
 \fBlogdir\fR
 from
-\fBamanda.conf\fR) is either not writable, or cannot be accessed, perhaps because a parent directory does not allow search permission.
+\fBamanda\.conf\fR) is either not writable, or cannot be accessed, perhaps because a parent directory does not allow search permission\.
 .RE
 .PP
 ERROR: tape list \fItapelist\fR: not writable
@@ -403,7 +399,7 @@ tape list file
 (see
 \fBtapelist\fR
 in
-\fBamanda.conf\fR) is not writable or was not found.
+\fBamanda\.conf\fR) is not writable or was not found\.
 .RE
 .PP
 ERROR: tape list \fItapelist\fR: parse error
@@ -415,7 +411,7 @@ tape list file
 (see
 \fBtapelist\fR
 in
-\fBamanda.conf\fR) could not be read or parsed.
+\fBamanda\.conf\fR) could not be read or parsed\.
 .RE
 .PP
 WARNING: tapedev is /dev/null, dumps will be thrown away
@@ -423,12 +419,12 @@ WARNING: tapedev is /dev/null, dumps will be thrown away
 (warning) The
 \fBtapedev\fR
 parameter in
-\fBamanda.conf\fR
+\fBamanda\.conf\fR
 is set to
 \fI/dev/null\fR
 and
 \fIAmanda\fR
-uses that when debugging to throw all the dump images away.
+uses that when debugging to throw all the dump images away\.
 .RE
 .PP
 WARNING: hold file \fIfile\fR exists
@@ -437,7 +433,7 @@ WARNING: hold file \fIfile\fR exists
 \fIfile\fR
 exists and will cause
 \fBamdump\fR
-to pause at the beginning until it is removed.
+to pause at the beginning until it is removed\.
 .RE
 .PP
 ERROR: holding disk \fIdisk\fR: statfs: \fIerror message\fR
@@ -446,16 +442,16 @@ ERROR: holding disk \fIdisk\fR: statfs: \fIerror message\fR
 \fIstatfs\fR
 system call on holding disk
 \fIdisk\fR
-(maybe because it does not exist).
+(maybe because it does not exist)\.
 .RE
 .PP
 ERROR: holding disk \fIdisk\fR: not writable
 .RS 4
 (error) Holding disk
-\fIdisk\fR, is not writable, probably because the caller does not have write permission or a parent directory does not allow search permission.
+\fIdisk\fR, is not writable, probably because the caller does not have write permission or a parent directory does not allow search permission\.
 .RE
 .PP
-WARNING: holding disk \fIdisk\fR: available space unknown \fIN\fR KB requested.
+WARNING: holding disk \fIdisk\fR: available space unknown \fIN\fR KB requested\.
 .RS 4
 (warning)
 \fBAmcheck\fR
@@ -463,37 +459,37 @@ could not determine the amount of available space on holding disk
 \fIdisk\fR
 to see if there were at least
 \fIN\fR
-KBytes available.
+KBytes available\.
 .RE
 .PP
-WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free (\fIR\fR KB requested).
+WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free (\fIR\fR KB requested)\.
 .RS 4
 (warning)
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 requested
 \fIR\fR
 KBytes of free space on holding disk
 \fIdisk\fR, but only
 \fIF\fR
-KBytes were available. 10 MBytes is subtracted for each backup process (see the
+KBytes were available\. 10 MBytes is subtracted for each backup process (see the
 \fBinparallel\fR
-\fIamanda.conf\fR
-option) to allow for unexpected overruns.
+\fIamanda\.conf\fR
+option) to allow for unexpected overruns\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 Even though this message is listed as a warning, it causes
 \fBamcheck\fR
-to exit with a non\-zero status.
+to exit with a non\-zero status\.
 .RE
 .PP
-Holding disk \fIdisk\fR: \fIN\fR KB disk space available, that's plenty.
+Holding disk \fIdisk\fR: \fIN\fR KB disk space available, that\'s plenty\.
 .RS 4
 (info) There was sufficient free space on holding disk
-\fIdisk\fR.
+\fIdisk\fR\.
 .RE
 .PP
 WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free, using nothing
@@ -503,7 +499,7 @@ WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free, using nothing
 has
 \fIF\fR
 KBytes of free space, but that is not enough for what is requested in
-\fIamanda.conf\fR.
+\fIamanda\.conf\fR\.
 .RE
 .PP
 Holding disk \fIdisk\fR: \fIF\fR KB disk space available, using \fIU\fR KB
@@ -516,78 +512,78 @@ KBytes of free space and
 \fIAmanda\fR
 will be using up to
 \fIU\fR
-Kbytes.
+Kbytes\.
 .RE
 .PP
-WARNING: if a tape changer is not available, runtapes must be set to 1.
+WARNING: if a tape changer is not available, runtapes must be set to 1\.
 .RS 4
 (warning) The
 \fBruntapes\fR
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 option must be set to 1 if the
 \fBtpchanger\fR
-\fIamanda.conf\fR
-option is not set.
+\fIamanda\.conf\fR
+option is not set\.
 .RE
 .PP
-ERROR: \fIerror message\fR.
+ERROR: \fIerror message\fR\.
 .RS 4
-(error) An error was detected while initializing the tape changer.
+(error) An error was detected while initializing the tape changer\.
 .RE
 .PP
-ERROR: \fItape device\fR: \fIerror message\fR.
+ERROR: \fItape device\fR: \fIerror message\fR\.
 .RS 4
-(error) An error was detected while processing the tape label.
+(error) An error was detected while processing the tape label\.
 .RE
 .PP
-ERROR: cannot overwrite active tape \fIlabel\fR.
+ERROR: cannot overwrite active tape \fIlabel\fR\.
 .RS 4
 (error) Tape
 \fIlabel\fR
-is still active and cannot be used.
+is still active and cannot be used\.
 .RE
 .PP
-ERROR: label \fIlabel\fR doesn't match labelstr \fIpattern\fR .
+ERROR: label \fIlabel\fR doesn\'t match labelstr \fIpattern\fR \.
 .RS 4
 (error) The label on tape
 \fIlabel\fR
 does not match the
 \fBlabelstr\fR
-\fIamanda.conf\fR
-option.
+\fIamanda\.conf\fR
+option\.
 .RE
 .PP
 (expecting a new tape)
 .RS 4
-(info) The tape is not OK and a new tape was expected.
+(info) The tape is not OK and a new tape was expected\.
 .RE
 .PP
 (expecting tape \fIlabel\fR or a new tape)
 .RS 4
 (info) The tape is not OK and either tape
 \fIlabel\fR
-or a new tape was expected.
+or a new tape was expected\.
 .RE
 .PP
-ERROR: tape \fIlabel\fR label ok, but is not writable.
+ERROR: tape \fIlabel\fR label ok, but is not writable\.
 .RS 4
 (error) Tape
 \fIlabel\fR
-is OK, but the write enable test failed.
+is OK, but the write enable test failed\.
 .RE
 .PP
-Tape \fIlabel\fR is writable.
+Tape \fIlabel\fR is writable\.
 .RS 4
 (info) Tape
 \fIlabel\fR
-is OK and the write enable test succeeded.
+is OK and the write enable test succeeded\.
 .RE
 .PP
-NOTE: skipping tape\-writable test.
+NOTE: skipping tape\-writable test\.
 .RS 4
 (info) The tape write test (see the
 \fB\-w\fR
-option) was not enabled.
+option) was not enabled\.
 .RE
 .PP
 WARNING: skipping tape test because amdump or amflush seem to be running, WARNING: if they are not, you must run amcleanup
@@ -598,54 +594,54 @@ like either
 \fBamdump\fR
 or
 \fBamflush\fR
-were running because a log file or amdump file exists. If they are not running, you probably need to run
+were running because a log file or amdump file exists\. If they are not running, you probably need to run
 \fBamcleanup\fR
-to clear up a previous failure. Otherwise, you need to wait until they complete before running
-\fBamcheck\fR.
+to clear up a previous failure\. Otherwise, you need to wait until they complete before running
+\fBamcheck\fR\.
 .RE
 .PP
 NOTE: skipping tape checks
 .RS 4
 (info) The tape tests are being skipped because you used the
 \fB\-t\fR
-command line option.
+command line option\.
 .RE
 .PP
 WARNING: \fIcompress\fR is not executable, server\-compression and indexing will not work
 .RS 4
 (warning) Compression program
 \fIcompress\fR
-is not executable, so compression on the tape server host and creating index files will not work.
+is not executable, so compression on the tape server host and creating index files will not work\.
 .RE
 .PP
-Tape \fIlabel\fR label ok.
+Tape \fIlabel\fR label ok\.
 .RS 4
 (info) Tape
 \fIlabel\fR
-is OK for the next run.
+is OK for the next run\.
 .RE
 .PP
-Server check took \fIS\fR seconds.
+Server check took \fIS\fR seconds\.
 .RS 4
-(info) Reports how long the tape server host checks took.
+(info) Reports how long the tape server host checks took\.
 .RE
 .PP
 ERROR: \fIhost\fR: could not resolve hostname
 .RS 4
 (error) Could not look up client hostname
-\fIhost\fR.
+\fIhost\fR\.
 .RE
 .PP
-Client check: \fIH\fR hosts checked in \fIS\fR seconds, \fIN\fR problems found.
+Client check: \fIH\fR hosts checked in \fIS\fR seconds, \fIN\fR problems found\.
 .RS 4
-(info) Reports the number of client hosts checked, how long it took and the number of errors detected.
+(info) Reports the number of client hosts checked, how long it took and the number of errors detected\.
 .RE
 .PP
-WARNING: \fIhost\fR: selfcheck request timed out. Host down?
+WARNING: \fIhost\fR: selfcheck request timed out\. Host down?
 .RS 4
 (warning) There was no response from
 \fIhost\fR
-when trying to do the client checks. The host might really be down or it might not be configured properly.
+when trying to do the client checks\. The host might really be down or it might not be configured properly\.
 .RE
 .PP
 ERROR: \fIhost\fR NAK: \fImessage\fR
@@ -654,7 +650,7 @@ ERROR: \fIhost\fR NAK: \fImessage\fR
 \fIHost\fR
 reported a negative acknowledgment error of
 \fImessage\fR
-to the status check request.
+to the status check request\.
 .RE
 .PP
 ERROR: \fIhost\fR NAK: [NAK parse failed]
@@ -662,18 +658,18 @@ ERROR: \fIhost\fR NAK: [NAK parse failed]
 (error)
 \fBAmcheck\fR
 could not parse the negative acknowledgment error from
-\fIhost\fR. There might be an
+\fIhost\fR\. There might be an
 \fIAmanda\fR
 version mismatch between the host running
 \fBamcheck\fR
 and
-\fIhost\fR.
+\fIhost\fR\.
 .RE
 .PP
 ERROR: \fIhost\fR [mutual\-authentication failed]
 .RS 4
 (error) Kerberos authentication failed while contacting
-\fIhost\fR.
+\fIhost\fR\.
 .RE
 .PP
 ERROR: \fIhost\fR: \fImessage\fR
@@ -681,18 +677,19 @@ ERROR: \fIhost\fR: \fImessage\fR
 (error) Error
 \fImessage\fR
 was reported by the status check on
-\fIhost\fR.
+\fIhost\fR\.
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamdump\fR(8)
+\fBamdump\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index c1b6fc3da8397b7c1cd436e8f3dc96b2f80e2a7f..ffeeff52634fdea55e6152eac9d37aa33f8a966c 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amcheckdb
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECKDB" "8" "06/06/2007" "" ""
+.TH "AMCHECKDB" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcheckdb \- check Amanda database for tape consistency
+amcheckdb - check Amanda database for tape consistency
 .SH "SYNOPSIS"
 .HP 10
 \fBamcheckdb\fR \fIconfig\fR
@@ -22,12 +22,12 @@ verifies that every tape mentioned in the
 \fIAmanda\fR
 database is still valid in the
 \fItapelist\fR
-file.
+file\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "EXAMPLE"
 .PP
 This shows a normal response:
@@ -35,7 +35,7 @@ This shows a normal response:
 .RS 4
 .nf
 # amcheckdb daily
-Ready.
+Ready\.
 .fi
 .RE
 .PP
@@ -49,18 +49,19 @@ file:
 .nf
 # amcheckdb daily
 Tape DMP014 missing in /usr/local/etc/amanda//daily/tapelist
-Ready.
+Ready\.
 .fi
 .RE
 .SH "AUTHOR"
 .PP
-Adrian T. Filipi\-Martin <atf3r@cs.virginia.edu>: Original text
+Adrian T\. Filipi\-Martin <atf3r@cs\.virginia\.edu>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamadmin\fR(8),
 \fBamrmtape\fR(8),
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/amcheckdump.8 b/man/amcheckdump.8
new file mode 100644 (file)
index 0000000..8d1c7da
--- /dev/null
@@ -0,0 +1,52 @@
+.\"     Title: amcheckdump
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMCHECKDUMP" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amcheckdump - check the results of an Amanda dump
+.SH "SYNOPSIS"
+.HP 12
+\fBamcheckdump\fR \fIconfig\fR [\-\-timestamp|\-t\ \fItimestamp\fR] [\-o\ \fIconfigoption\fR]...
+.SH "DESCRIPTION"
+.PP
+\fBAmcheckdump\fR
+verifies
+\fIAmanda\fR
+dump images by reading them from storage volume(s) and verifying that the images can be parsed by the appropriate application (if available)\. For example, a GNUTAR image is passed to GNU Tar for parsing, and any errors (e\.g\., corrupt or missing data) are noted\.
+.PP
+The application runs on the most recent dump or, if
+\fI\-\-timestamp\fR
+is specified, on the most recent dump with that timestamp\. Note that the verification is local to the
+\fIAmanda\fR
+server; if the dump application is not available, or is configured differently on the server than on the client, then the verification will most likely fail\.
+.PP
+If a changer is available, it is used to load the required tapes\. Otherwise, the application interactively requests the tapes\.
+.PP
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
+\fBamanda\fR(8)
+for information on the
+\-o
+option\.
+.SH "EXAMPLE"
+.PP
+.RS 4
+.nf
+# check the most recent dump
+amcheckdump MYCONFIG
+
+# check a specific dump from back in \'78
+amcheckdump MYCONFIG \-\-timestamp 19780615
+.fi
+.RE
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 4efa160fc00159774e1538e3e31bf1426cff1a49..429ba70d357afdaa1d7f1007ab82a6fa1cc31c2a 100644 (file)
@@ -1,20 +1,20 @@
 .\"     Title: amcleanup
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCLEANUP" "8" "06/06/2007" "" ""
+.TH "AMCLEANUP" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcleanup \- run the Amanda cleanup process after a failure
+amcleanup - run the Amanda cleanup process after a failure
 .SH "SYNOPSIS"
 .HP 10
-\fBamcleanup\fR \fIconfig\fR
+\fBamcleanup\fR [\fB\-k\fR] [\fB\-v\fR] \fIconfig\fR
 .SH "DESCRIPTION"
 .PP
 \fBAmcleanup\fR
@@ -22,29 +22,34 @@ generates the
 \fI\fIAmanda\fR\fR\fI Mail Report\fR
 and updates the
 \fIAmanda\fR
-databases after a system failure on a tape server host. This cleanup process is normally done automatically as part of the
+databases after a system failure on a tape server host\. This cleanup process is normally done automatically as part of the
 \fBamdump\fR
 program, but if
 \fBamdump\fR
 cannot complete for some reason (usually because of a tape server host crash),
 \fBamcleanup\fR
-must be run some time later (usually during system boot).
+must be run some time later (usually during system boot)\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-k\fR
 .RS 4
-Kill all Amanda processes.
+Kill all Amanda processes\.
+.RE
+.PP
+\fB\-v\fR
+.RS 4
+Generate verbose output\.
 .RE
 .SH "EXAMPLES"
 .PP
 This example runs the
 \fIAmanda\fR
-cleanup process by hand after a failure.
+cleanup process by hand after a failure\.
 .sp
 .RS 4
 .nf
@@ -52,10 +57,10 @@ cleanup process by hand after a failure.
 .fi
 .RE
 .PP
-Putting the following line in a system boot script (e.g.
-\fI/etc/rc.local\fR) runs the
+Putting the following line in a system boot script (e\.g\.
+\fI/etc/rc\.local\fR) runs the
 \fIAmanda\fR
-cleanup process as part of the reboot, eliminating the need to run it by hand.
+cleanup process as part of the reboot, eliminating the need to run it by hand\.
 .sp
 .RS 4
 .nf
@@ -69,18 +74,19 @@ exits normally with the message:
 .sp
 .RS 4
 .nf
-amcleanup: no unprocessed logfile to clean up.
+amcleanup: no unprocessed logfile to clean up\.
 .fi
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>: Original text
+<jds@amanda\.org>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamdump\fR(8)
+\fBamdump\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index ee8095522e72354ac58b2f6b1c4dd45362778511..fa95247c84199fbc99161d319daacf7d80c1b42f 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amcrypt-ossl-asym
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "06/06/2007" "" ""
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcrypt\-ossl\-asym \- crypt program for Amanda asymmetric data encryption using OpenSSL
+amcrypt-ossl-asym - crypt program for Amanda asymmetric data encryption using OpenSSL
 .SH "SYNOPSIS"
 .HP 18
 \fBamcrypt\-ossl\-asym\fR [\-d]
@@ -21,29 +21,29 @@ amcrypt\-ossl\-asym \- crypt program for Amanda asymmetric data encryption using
 \fBamcrypt\-ossl\-asym\fR
 uses
 \fBOpenSSL\fR
-to encrypt and decrypt data. OpenSSL is available from
-\fIwww.openssl.org\fR\&[1]. OpenSSL offers a wide variety of cipher choices (
+to encrypt and decrypt data\. OpenSSL is available from
+\fIwww\.openssl\.org\fR\&[1]\. OpenSSL offers a wide variety of cipher choices (
 \fBamcrypt\-ossl\-asym\fR
-defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms.
+defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\.
 .PP
 
 \fBamcrypt\-ossl\-asym\fR
-will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin.
+will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\.
 .SH "GENERATING PUBLIC AND PRIVATE KEYS"
 .PP
-RSA keys can be generated with the standard OpenSSL commands, e.g.:
+RSA keys can be generated with the standard OpenSSL commands, e\.g\.:
 .sp
 .RS 4
 .nf
 $ cd /var/lib/amanda
-$ openssl genrsa \-aes128 \-out backup\-privkey.pem 1024
+$ openssl genrsa \-aes128 \-out backup\-privkey\.pem 1024
 Generating RSA private key, 1024 bit long modulus
-[...]
-Enter pass phrase for backup\-privkey.pem: \fIENTER YOUR PASS PHRASE\fR
-Verifying \- Enter pass phrase for backup\-key.pem: \fIENTER YOUR PASS PHRASE\fR
+[\.\.\.]
+Enter pass phrase for backup\-privkey\.pem: \fIENTER YOUR PASS PHRASE\fR
+Verifying \- Enter pass phrase for backup\-key\.pem: \fIENTER YOUR PASS PHRASE\fR
 
-$ openssl rsa \-in backup\-privkey.pem \-pubout \-out backup\-pubkey.pem
-Enter pass phrase for backup\-privkey.pem: \fIENTER YOUR PASS PHRASE\fR
+$ openssl rsa \-in backup\-privkey\.pem \-pubout \-out backup\-pubkey\.pem
+Enter pass phrase for backup\-privkey\.pem: \fIENTER YOUR PASS PHRASE\fR
 Writing RSA key
 
 .fi
@@ -51,44 +51,44 @@ Writing RSA key
 .PP
 To generate a private key without a passphrase, omit the
 \fB\-aes128\fR
-option. See
+option\. See
 \fBopenssl_genrsa\fR(1)
-for more key generation options.
+for more key generation options\.
 .PP
-Note that it is always possible to generate the public key from the private key.
+Note that it is always possible to generate the public key from the private key\.
 .SH "KEY AND PASSPHRASE MANAGEMENT"
 .PP
 
 \fBamcrypt\-ossl\-asym\fR
 uses the
 \fIpublic key\fR
-to encrypt data. The security of the data does not depend on the confidentiality of the public key. The
+to encrypt data\. The security of the data does not depend on the confidentiality of the public key\. The
 \fIprivate key\fR
-is used to decrypt data, and must be protected. Encrypted backup data cannot be recovered without the private key. The private key may optionally be encrypted with a passphrase.
+is used to decrypt data, and must be protected\. Encrypted backup data cannot be recovered without the private key\. The private key may optionally be encrypted with a passphrase\.
 .PP
-While the public key must be online at all times to perorm backups, the private key and optional passphrase are only needed to restore data. It is recommended that the latter be stored offline all other times. For example, you could keep the private key on removable media, and copy it into place for a restore; or you could keep the private key online, encrypted with a passphrase that is present only for a restore.
+While the public key must be online at all times to perorm backups, the private key and optional passphrase are only needed to restore data\. It is recommended that the latter be stored offline all other times\. For example, you could keep the private key on removable media, and copy it into place for a restore; or you could keep the private key online, encrypted with a passphrase that is present only for a restore\.
 .PP
-OpenSSL's key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess. The Diceware method (see
-\fIwww.diceware.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember.
+OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see
+\fIwww\.diceware\.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember\.
 .SH "FILES"
 .PP
-/var/lib/amanda/backup\-privkey.pem
+/var/lib/amanda/backup\-privkey\.pem
 .RS 4
-File containing the RSA private key. It should not be readable by any user other than the
+File containing the RSA private key\. It should not be readable by any user other than the
 \fIAmanda\fR
-user.
+user\.
 .RE
 .PP
-/var/lib/amanda/backup\-pubkey.pem
+/var/lib/amanda/backup\-pubkey\.pem
 .RS 4
-File containing the RSA public key.
+File containing the RSA public key\.
 .RE
 .PP
-/var/lib/amanda/.am_passphrase
+/var/lib/amanda/\.am_passphrase
 .RS 4
-File containing the passphrase. It should not be readable by any user other than the
+File containing the passphrase\. It should not be readable by any user other than the
 \fIAmanda\fR
-user.
+user\.
 .RE
 .SH "SEE ALSO"
 .PP
@@ -96,8 +96,9 @@ user.
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBopenssl\fR(1),
-\fBamcrypt\-ossl\fR(8)
-.SH "REFERENCES"
+\fBamcrypt-ossl\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
+.SH "NOTES"
 .IP " 1." 4
 www.openssl.org
 .RS 4
index c172d979fa2dd0f08b770d8adac88144680a5c60..0e546898a4c11fa212c6a3744cc5ee41d0153547 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amcrypt-ossl
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL" "8" "06/06/2007" "" ""
+.TH "AMCRYPT\-OSSL" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcrypt\-ossl \- crypt program for Amanda symmetric data encryption using OpenSSL
+amcrypt-ossl - crypt program for Amanda symmetric data encryption using OpenSSL
 .SH "SYNOPSIS"
 .HP 13
 \fBamcrypt\-ossl\fR [\-d]
@@ -21,31 +21,31 @@ amcrypt\-ossl \- crypt program for Amanda symmetric data encryption using OpenSS
 \fBamcrypt\-ossl\fR
 uses
 \fBOpenSSL\fR
-to encrypt and decrypt data. OpenSSL is available from
-\fIwww.openssl.org\fR\&[1]. OpenSSL offers a wide variety of cipher choices (
+to encrypt and decrypt data\. OpenSSL is available from
+\fIwww\.openssl\.org\fR\&[1]\. OpenSSL offers a wide variety of cipher choices (
 \fBamcrypt\-ossl\fR
-defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms.
+defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\.
 .PP
 
 \fBamcrypt\-ossl\fR
-will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin.
+will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\.
 .SH "PASSPHRASE MANAGEMENT"
 .PP
 
 \fBamcrypt\-ossl\fR
-uses the same pass phrase to encrypt and decrypt data. It is very important to store and protect the pass phrase properly. Encrypted backup data can
+uses the same pass phrase to encrypt and decrypt data\. It is very important to store and protect the pass phrase properly\. Encrypted backup data can
 \fBonly\fR
-be recovered with the correct passphrase.
+be recovered with the correct passphrase\.
 .PP
-OpenSSL's key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess. The Diceware method (see
-\fIwww.diceware.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember.
+OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see
+\fIwww\.diceware\.com\fR\&[2]) can be used to create passphrases that are difficult to guess and easy to remember\.
 .SH "FILES"
 .PP
-/var/lib/amanda/.am_passphrase
+/var/lib/amanda/\.am_passphrase
 .RS 4
-File containing the pass phrase. It should not be readable by any user other than the
+File containing the pass phrase\. It should not be readable by any user other than the
 \fIAmanda\fR
-user.
+user\.
 .RE
 .SH "SEE ALSO"
 .PP
@@ -53,8 +53,9 @@ user.
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBopenssl\fR(1),
-\fBamcrypt\-ossl\-asym\fR(8)
-.SH "REFERENCES"
+\fBamcrypt-ossl-asym\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
+.SH "NOTES"
 .IP " 1." 4
 www.openssl.org
 .RS 4
index 07fab4ab5587493e1b645c1ee020193a01ea8b4f..41b351234bd13f91302a9faf5a599dac7954c33b 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amcrypt
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT" "8" "06/06/2007" "" ""
+.TH "AMCRYPT" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amcrypt \- reference crypt program for Amanda symmetric data encryption
+amcrypt - reference crypt program for Amanda symmetric data encryption
 .SH "SYNOPSIS"
 .HP 8
 \fBamcrypt\fR
@@ -24,12 +24,12 @@ requires
 \fBuuencode\fR
 and
 \fBgpg\fR
-to work. Aespipe is available from
-\fI\%http://loop\-aes.sourceforge.net\fR
+to work\. Aespipe is available from
+\fI\%http://loop-aes.sourceforge.net\fR
 .PP
 
 \fBamcrypt\fR
-will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin.
+will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\.
 .PP
 
 \fBamcrypt\fR
@@ -37,37 +37,38 @@ calls
 \fBamaespipe\fR
 and pass the
 \fBpassphrase\fR
-through file descriptor 3. The passphrase should be stored in ~amanda/.am_passphrase.
+through file descriptor 3\. The passphrase should be stored in ~amanda/\.am_passphrase\.
 .SH "HOW TO CREATE ENCRYPTION KEYS FOR AMCRYPT"
 .PP
-1. Create 65 random encryption keys and encrypt those keys using gpg. Reading from /dev/random may take indefinitely long if kernel's random entropy pool is empty. If that happens, do some other work on some other console (use keyboard, mouse and disks).
+1\. Create 65 random encryption keys and encrypt those keys using gpg\. Reading from /dev/random may take indefinitely long if kernel\'s random entropy pool is empty\. If that happens, do some other work on some other console (use keyboard, mouse and disks)\.
 .PP
-head \-c 2925 /dev/random | uuencode \-m \- | head \-n 66 | tail \-n 65 \e | gpg \-\-symmetric \-a > ~amanda/.gnupg/am_key.gpg
+head \-c 2925 /dev/random | uuencode \-m \- | head \-n 66 | tail \-n 65 \e | gpg \-\-symmetric \-a > ~amanda/\.gnupg/am_key\.gpg
 .PP
-This will ask for a passphrase. Remember this passphrase as you will need it in the next step.
+This will ask for a passphrase\. Remember this passphrase as you will need it in the next step\.
 .PP
-2. Store the passphrase inside the home\-directory of the AMANDA\-user and protect it with proper permissions:
+2\. Store the passphrase inside the home\-directory of the AMANDA\-user and protect it with proper permissions:
 .sp
 .RS 4
 .nf
-echo my_secret_passphrase > ~amanda/.am_passphrase
-chown amanda:disk ~amanda/.am_passphrase
-chmod 700 ~amanda/.am_passphrase
+echo my_secret_passphrase > ~amanda/\.am_passphrase
+chown amanda:disk ~amanda/\.am_passphrase
+chmod 700 ~amanda/\.am_passphrase
 .fi
 .RE
 .SH "KEY AND PASSPHRASE"
 .PP
 
 \fBamcrypt\fR
-uses the same key to encrypt and decrypt data.
+uses the same key to encrypt and decrypt data\.
 .PP
-It is very important to store and protect the key and the passphrase properly. Encrypted backup data can
+It is very important to store and protect the key and the passphrase properly\. Encrypted backup data can
 \fBonly\fR
-be recovered with the correct key and passphrase.
+be recovered with the correct key and passphrase\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBaespipe\fR(1),
 \fBamaespipe\fR(8),
-\fBgpg\fR(1)
+\fBgpg\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/amcryptsimple.8 b/man/amcryptsimple.8
new file mode 100644 (file)
index 0000000..492af4f
--- /dev/null
@@ -0,0 +1,66 @@
+.\"     Title: amcryptsimple
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMCRYPTSIMPLE" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amcryptsimple - reference simple crypt program for Amanda symmetric data encryption
+.SH "SYNOPSIS"
+.HP 14
+\fBamcryptsimple\fR  to be called by \fIAmanda\fR only 
+.SH "DESCRIPTION"
+.PP
+
+\fBamcryptsimple\fR
+calls
+\fBgpg\fR
+to perform symmetric data encryption on
+\fIAmanda\fR
+backup\.
+\fBamcryptsimple\fR
+will search for the gpg program in the following directories: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
+.PP
+
+\fBamcryptsimple\fR
+uses one passphrase to encrypt the
+\fIAmanda\fR
+data and uses the same passphrase to decrypt the
+\fIAmanda\fR
+backup data\.
+\fBamcryptsimple\fR
+uses AES256 as the symmetric cipher\.
+.SH "HOW TO CREATE PASSPHRASE"
+
+
+Store  the  passphrase  inside the home\-directory of the AMANDA\-user($amanda_user) and protect it with proper permissions:
+
+   echo my_secret_passphrase > ~$amanda_user/\.am_passphrase
+   chown $amanda_user:disk ~$amanda_user/\.am_passphrase
+   chmod 700 ~$amanda_user/\.am_passphrase
+.SH "NOTES"
+.PP
+Choose a good passphrase and protect it properly\. Backup data can only be restored with the passphrase\. There is no backdoor\.
+.PP
+If storing and securing passphrase in your environment presents challenges,
+\fIAmanda\fR
+provide public\-key data encryption through
+\fBamgpgcrypt\fR\. Public\-key encryption uses the public key to encrypt and uses the private key to decrypt\.
+.SH "AUTHOR"
+.PP
+The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\.
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamanda.conf\fR(5),
+\fBamcrypt\fR(8),
+\fBamgpgcrypt\fR(8),
+\fBamrestore\fR(8),
+\fBgpg\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
index cb058bcf93c4e3350d7e41d9590cadc8d9921839..14f25fd2a768bc5c570393bcb9c5c73de6254724 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amdd
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDD" "8" "06/06/2007" "" ""
+.TH "AMDD" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amdd \- Amanda version of dd
+amdd - Amanda version of dd
 .SH "SYNOPSIS"
 .HP 5
 \fBamdd\fR [\-d] [\fIif=input\fR] [\fIof=output\fR] [\fIbs=blocksize\fR] [\fIskip=count\fR] [\fIcount=count\fR]
@@ -21,35 +21,35 @@ amdd \- Amanda version of dd
 provides just enough of the standard UNIX
 \fBdd\fR
 command for the needs of
-\fIAmanda\fR. This is handy when doing a full restore and the standard
+\fIAmanda\fR\. This is handy when doing a full restore and the standard
 \fBdd\fR
-program has not yet been found.
+program has not yet been found\.
 .PP
 \fBAmdd\fR
 also provides access to the
 \fIAmanda\fR
-output drivers that support various tape simulations. This may be used for debugging or to convert from one format to another.
+output drivers that support various tape simulations\. This may be used for debugging or to convert from one format to another\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR. See the
+\fIAmanda\fR\. See the
 \fBOUTPUT DRIVERS\fR
 section of
 \fIamanda(8)\fR
 for more information on the
 \fIAmanda\fR
-output drivers.
+output drivers\.
 .SH "OPTIONS"
 .PP
 \fB\-d\fR
 .RS 4
-Turn on debugging output.
+Turn on debugging output\.
 .RE
 .PP
 \fB\-l\fR\fIlength\fR
 .RS 4
-Set the output length. If the output driver limits the output size, this controls when end of tape will be simulated.
+Set the output length\. If the output driver limits the output size, this controls when end of tape will be simulated\.
 .sp
 \fILength\fR
 may have a multiplier suffix:
@@ -61,26 +61,26 @@ b \-> 512 (Blocks)
 M \-> 1024*1024 (Megabytes)
 .fi
 .RE
-The default is no multiplier (bytes).
+The default is no multiplier (bytes)\.
 .RE
 .PP
 \fBif=\fR\fIinput\fR
 .RS 4
 Input to
-\fBdd\fR. Default is stdin.
+\fBdd\fR\. Default is stdin\.
 .RE
 .PP
 \fBof=\fR\fIoutput\fR
 .RS 4
 Where to send the output of
-\fBdd\fR. Default is stdout.
+\fBdd\fR\. Default is stdout\.
 .RE
 .PP
 \fBbs=\fR\fIblocksize\fR
 .RS 4
-Size of each record. Input records smaller than this will
+Size of each record\. Input records smaller than this will
 \fInot\fR
-be padded. Output records will be the same size as the corresponding input record. Default is 512 bytes.
+be padded\. Output records will be the same size as the corresponding input record\. Default is 512 bytes\.
 .sp
 \fIBlocksize\fR
 may have a multiplier suffix:
@@ -92,28 +92,30 @@ b \-> 512 (Blocks)
 M \-> 1024*1024 (Megabytes)
 .fi
 .RE
-The default is no multiplier (bytes).
+The default is no multiplier (bytes)\.
 .RE
 .PP
 \fBcount=\fR\fIcount\fR
 .RS 4
-Number of records to copy. Default is all records until end of file.
+Number of records to copy\. Default is all records until end of file\.
 .RE
 .PP
 \fBskip=\fR\fIcount\fR
 .RS 4
-Number of records to skip before copying input to output. Default is zero.
+Number of records to skip before copying input to output\. Default is zero\.
 .RE
 .SH "AUTHOR"
 .PP
 Marc Mengel
-<mengel@fnal.gov>, John R. Jackson
-<jrj@purdue.edu>
+<mengel@fnal\.gov>, John R\. Jackson
+<jrj@purdue\.edu>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
+
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/amdevcheck.8 b/man/amdevcheck.8
new file mode 100644 (file)
index 0000000..8e35f57
--- /dev/null
@@ -0,0 +1,69 @@
+.\"     Title: amdevcheck
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMDEVCHECK" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amdevcheck - Validate an Amanda device and volume.
+.SH "SYNOPSIS"
+.HP 11
+\fBamdevcheck\fR \fIconfig\fR [\fIdevice\ name\fR] [\-o\ \fIconfigoption\fR]...
+.SH "DESCRIPTION"
+.PP
+
+\fBAmdevcheck\fR
+provides a way to check that a particular
+\fIAmanda\fR
+device is accessible, whether or not it contains a volume, and whether or not that volume is labeled\. Some devices can\'t distinguish between all of these cases; a missing volume and an unlabeled volume might generate the same error code, for example\. In those cases, this tool reports all possible causes of the error\.
+.PP
+See the
+\fBamanda\fR(8)
+man page for more details about
+\fIAmanda\fR\. See the
+\fBOUTPUT DRIVERS\fR
+section of
+\fIamanda(8)\fR
+for more information on the
+\fIAmanda\fR
+output drivers\.
+.SH "OPTIONS"
+.PP
+\fIconfig\fR
+.RS 4
+
+\fIAmanda\fR
+configuration to use\. Note that
+\fBamdevcheck\fR
+ignores any tape changer configuration\.
+.RE
+.PP
+\fI device\fR
+.RS 4
+
+\fIAmanda\fR
+device to use\. This option overrides any tapedev configuration specified in the configuration file\.
+.RE
+.PP
+\fB\-o\fR \fIclientconfigoption\fR
+.RS 4
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
+\fBamanda\fR(8)\.
+.RE
+.SH "AUTHOR"
+.PP
+Ian Turner
+<ian@zmanda\.com>
+and others\. Authorship of this tool and its documentation was funded by Zmanda, Inc\.
+.SH "SEE ALSO"
+.PP
+
+\fBamanda\fR(8),
+\fBammt\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 52d075785b74442994432d017fd2ce758dc24f22..268a722fdd64ecfdea4ba85e6556d31a6918574d 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amdump
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDUMP" "8" "06/06/2007" "" ""
+.TH "AMDUMP" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amdump \- back up all disks in an Amanda configuration
+amdump - back up all disks in an Amanda configuration
 .SH "SYNOPSIS"
 .HP 7
 \fBamdump\fR \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]...
@@ -20,42 +20,42 @@ amdump \- back up all disks in an Amanda configuration
 \fBAmdump\fR
 switches to the appropriate
 \fIAmanda\fR
-configuration directory, e.g. /usr/local/etc/amanda/\fIconfig\fR, then attempts to back up every disk specified by the
-\fIamanda.conf\fR
-file.
+configuration directory, e\.g\. /usr/local/etc/amanda/\fIconfig\fR, then attempts to back up every disk specified by the
+\fIamanda\.conf\fR
+file\.
 \fBAmdump\fR
 is normally run by
-\fBcron\fR.
+\fBcron\fR\.
 .PP
-You can specify many host/disk expressions, only disks that match an expression will be dumped. All disks are dumped if no expressions are given.
+You can specify many host/disk expressions, only disks that match an expression will be dumped\. All disks are dumped if no expressions are given\.
 .PP
 If the file /usr/local/etc/amanda/\fIconfig\fR/hold exists,
 \fBamdump\fR
-will wait until it is removed before starting the backups. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose. While waiting,
+will wait until it is removed before starting the backups\. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose\. While waiting,
 \fBamdump\fR
-checks for the hold file every minute.
+checks for the hold file every minute\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fIhost\fR [\fIdisk\fR]*
 .RS 4
-Specify the host and disk on which the command will work.
+Specify the host and disk on which the command will work\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLE"
 .PP
-Here is a typical crontab entry. It runs
+Here is a typical crontab entry\. It runs
 \fBamdump\fR
-every weeknight at 1 a.m. as user
+every weeknight at 1 a\.m\. as user
 \fBbin\fR:
 .sp
 .RS 4
@@ -68,14 +68,14 @@ Please see the
 \fBcrontab\fR(5)
 or
 \fBcrontab\fR(1)
-manual page for the correct crontab format for your system.
+manual page for the correct crontab format for your system\.
 .SH "MESSAGES"
 .PP
 amdump: waiting for hold file to be removed
 .RS 4
 The "hold" file exists and
 \fBamdump\fR
-is waiting for it to be removed before starting backups.
+is waiting for it to be removed before starting backups\.
 .RE
 .PP
 amdump: amdump or amflush is already running, or you must run amcleanup
@@ -88,25 +88,27 @@ running, or the remains of a previous incomplete
 \fBamdump\fR
 or
 \fBamflush\fR
-run. This run is terminated. If the problem is caused by the remains of a previous run, you must execute
+run\. This run is terminated\. If the problem is caused by the remains of a previous run, you must execute
 \fBamcleanup\fR(8)
 and then rerun
-\fBamdump\fR.
+\fBamdump\fR\.
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
+
 \fBamanda\fR(8),
 \fBamcheck\fR(8),
 \fBamcleanup\fR(8),
 \fBamrestore\fR(8),
 \fBamflush\fR(8),
-\fBcron\fR(8)
+\fBcron\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index f83330c0d88a08f9ebd013f1db6a583592c47ac9..baa2ce2123ea6347c5966506e9bc2199eabcf87c 100644 (file)
@@ -1,24 +1,24 @@
 .\"     Title: amfetchdump
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFETCHDUMP" "8" "06/06/2007" "" ""
+.TH "AMFETCHDUMP" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amfetchdump \- extract backup images from multiple Amanda tapes.
+amfetchdump - extract backup images from multiple Amanda tapes.
 .SH "SYNOPSIS"
 .HP 12
-\fBamfetchdump\fR [\-pcClawns] [\-d\ \fIdevice\fR] [\-O\ \fIdirectory\fR] [\-i\ \fIlogfile\fR] [\-b\ \fIblocksize\fR] \fIconfig\fR \fIhostname\fR [\fIdisk\fR\ [\ \fIdate\fR\ [\ \fIlevel\fR\ [\ \fIhostname\fR\ [...]\ ]\ ]\ ]] [\-o\ \fIconfigoption\fR]...
+\fBamfetchdump\fR [\-pcClawns] [\-d\ \fIdevice\fR] [\-O\ \fIdirectory\fR] [\-b\ \fIblocksize\fR] \fIconfig\fR \fIhostname\fR [\fIdisk\fR\ [\ \fIdate\fR\ [\ \fIlevel\fR\ [\ \fIhostname\fR\ [\.\.\.]\ ]\ ]\ ]] [\-o\ \fIconfigoption\fR]...
 .SH "DESCRIPTION"
 .PP
 \fBAmfetchdump\fR
-pulls one or more matching dumps from tape or from the holding disk, handling the reassembly of multi\-tape split dump files as well as any tape autochanger operations.
+pulls one or more matching dumps from tape or from the holding disk, handling the reassembly of multi\-tape split dump files as well as any tape autochanger operations\.
 .PP
 It will automatically use the logs created by
 \fBamdump\fR(8)
@@ -26,7 +26,7 @@ to locate available dumps on tape, in the same way that the
 \fBfind\fR
 feature of
 \fBamadmin\fR(8)
-lists available dumps. If these logs are unavailable, it can search tape\-by\-tape to find what it needs, and can generate new logs to serve as an emergency tape inventory.
+lists available dumps\. If these logs are unavailable, it can search tape\-by\-tape to find what it needs, and can generate new logs to serve as an emergency tape inventory\.
 .PP
 The
 \fIhostname\fR,
@@ -36,111 +36,105 @@ The
 dump pattern\-matching works as in
 \fBamrestore\fR(8), with the added requirement that at minimum a
 \fIhostname\fR
-must be specified when not in inventory mode.
+must be specified when not in inventory mode\.
 .PP
 Unless
 \fB\-p\fR
 is used, backup images are extracted to files in the current directory named:
 .PP
-\fIhostname.diskname.datestamp.dumplevel\fR
+\fIhostname\.diskname\.datestamp\.dumplevel\fR
 .SH "OPTIONS"
 .PP
 \fB\-p\fR
 .RS 4
 Pipe exactly one complete dump file to
-\fIstdout\fR, instead of writing the file to disk. This will restore only the first matching dumpfile (where "first" is determined by the dump log search facility).
+\fIstdout\fR, instead of writing the file to disk\. This will restore only the first matching dumpfile (where "first" is determined by the dump log search facility)\.
 .RE
 .PP
 \fB\-d\fR \fIdevice\fR
 .RS 4
-Restore from this tape device instead of the default.
+Restore from this tape device instead of the default\.
 .RE
 .PP
 \fB\-O\fR \fIdirectory\fR
 .RS 4
-Output restored files to this directory, instead of to the current working directory.
+Output restored files to this directory, instead of to the current working directory\.
 .RE
 .PP
 \fB\-c\fR
 .RS 4
-Compress output, fastest method available.
+Compress output, fastest method available\.
 .RE
 .PP
 \fB\-C\fR
 .RS 4
-Compress output, smallest file size method available.
+Compress output, smallest file size method available\.
 .RE
 .PP
 \fB\-l\fR
 .RS 4
-Leave dumps in the compressed/uncompressed state in which they were found on tape. By default,
+Leave dumps in the compressed/uncompressed state in which they were found on tape\. By default,
 \fBamfetchdump\fR
-will automatically uncompress when restoring.
+will automatically uncompress when restoring\.
 .RE
 .PP
 \fB\-a\fR
 .RS 4
-Assume that all tapes are already available, via tape changer or otherwise, instead of prompting the operator to ensure that all tapes are loaded.
-.RE
-.PP
-\fB\-i\fR \fIfilename\fR
-.RS 4
-Generate an inventory of all dumps "seen" on the tapes we search, for later use as a log.
+Assume that all tapes are already available, via tape changer or otherwise, instead of prompting the operator to ensure that all tapes are loaded\.
 .RE
 .PP
 \fB\-w\fR
 .RS 4
-Wait to put split dumps together until all chunks have been restored. Normally,
+Wait to put split dumps together until all chunks have been restored\. Normally,
 \fBamfetchdump\fR
-will attempt to read pieces of a split file from tape in order, so that it can assemble them simply by appending each file to the first. This option disables the appending behavior, and instead restores each piece as an individual file and reassembles them only after all have been restored.
+will attempt to read pieces of a split file from tape in order, so that it can assemble them simply by appending each file to the first\. This option disables the appending behavior, and instead restores each piece as an individual file and reassembles them only after all have been restored\.
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
-This requires at least double the size of your dump in free disk space, in order to build the final assembled dumpfile.
+Note
+This requires at least double the size of your dump in free disk space, in order to build the final assembled dumpfile\.
 
-This behavior is implicitly invoked in circumstances where knowing the location of all dumps on tape in advance is not possible, such as when you are restoring without log files.
+This behavior is implicitly invoked in circumstances where knowing the location of all dumps on tape in advance is not possible, such as when you are restoring without log files\.
 .RE
 .PP
 \fB\-n\fR
 .RS 4
-Do not reassemble split dump files at all, just restore each piece as an individual file.
+Do not reassemble split dump files at all, just restore each piece as an individual file\.
 .RE
 .PP
 \fB\-s\fR
 .RS 4
-Do not fast\-forward straight to needed files on tape. This will slow down most restores substantially. Only use this option if your tape drive does not properly support the fast\-forward operation.
+Do not fast\-forward straight to needed files on tape\. This will slow down most restores substantially\. Only use this option if your tape drive does not properly support the fast\-forward operation\.
 .RE
 .PP
 \fB\-b\fR \fIblocksize\fR
 .RS 4
-Force a particular block size when reading from tapes. This value will usually be autodetected, and should not normally need to be set.
+Force a particular block size when reading from tapes\. This value will usually be autodetected, and should not normally need to be set\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLES"
 .PP
 All the examples here assume your configuration is called
-\fISetA\fR.
+\fISetA\fR\.
 .PP
-Here's a simple case, restoring all known dumps of the host vanya to the current working directory.
+Here\'s a simple case, restoring all known dumps of the host vanya to the current working directory\.
 .sp
 .RS 4
 .nf
 $ amfetchdump SetA vanya
 .fi
 .RE
-.sp
 .PP
-A more likely scenario involves restoring a particular dump from a particular date. We'll pipe this one to
+A more likely scenario involves restoring a particular dump from a particular date\. We\'ll pipe this one to
 \fBGNU\-tar\fR
-as well, to automatically extract the dump.
+as well, to automatically extract the dump\.
 .sp
 .RS 4
 .nf
@@ -148,51 +142,26 @@ $ amfetchdump \-p SetA vanya /home 20051020 | gtar \-xvpf \-
 .fi
 .RE
 .sp
-.PP
-In a situation where all of our dump logs have been wiped out, we could also use amfetchdump to inventory our tapes and recreate an imitation of those logs, which we'll send to
-\fIstdout\fR
-for casual perusal.
-
-.sp
-.RS 4
-.nf
-$ amfetchdump \-i \- SetA
-.fi
-.RE
-.sp
-
-.PP
-Note that you can specify a restore while in inventory mode, and
-\fBamfetchdump\fR
-will continue searching for more dumps from this host even after successfully restoring a dump, inventorying all the while. If your backup searcher has been trashed, this is a handy way to recover what you have.
-
-.sp
-.RS 4
-.nf
-$ amfetchdump \-i /var/amanda/log SetA backupserver
-.fi
-.RE
-.sp
-
 .SH "CAVEATS"
 .PP
 \fBAmfetchdump\fR
-is dependent on accessing your server's config, tape changer, and (normally) dump logs. As such, it's not necessarily the most useful tool when those have all been wiped out and you desperately need to pull things from your tape. Pains have been taken to make it as capable as possible, but for seriously minimialist restores, look to
+is dependent on accessing your server\'s config, tape changer, and (normally) dump logs\. As such, it\'s not necessarily the most useful tool when those have all been wiped out and you desperately need to pull things from your tape\. Pains have been taken to make it as capable as possible, but for seriously minimialist restores, look to
 \fBamrestore\fR(8)
 or
 \fBdd\fR(8)
-instead.
+instead\.
 .SH "AUTHOR"
 .PP
 John Stange,
-<building@nap.edu>, National Academies Press
+<building@nap\.edu>, National Academies Press
 .PP
 Ian Turner,
-<ian@zmanda.com>: XML\-conversion
+<ian@zmanda\.com>: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamadmin\fR(8),
 \fBamrestore\fR(8),
-\fBtar\fR(1)
-\fBrestore\fR(8)
+\fBtar\fR(1),
+\fBrestore\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index ba1b3e354fbf2267d3bd1cf86b5baf7dfdda3632..84bd19207c02d73a5a666c979ba2bb616cafc726 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amflush
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFLUSH" "8" "06/06/2007" "" ""
+.TH "AMFLUSH" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amflush \- flush Amanda backup files from holding disk to tape
+amflush - flush Amanda backup files from holding disk to tape
 .SH "SYNOPSIS"
 .HP 8
 \fBamflush\fR [\-b] [\-f] [\-s] [\-D\ \fIdatestamp\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]...
@@ -22,122 +22,124 @@ writes
 \fIAmanda\fR
 backups from the holding disks to tape, and updates the
 \fIAmanda\fR
-info database and tapelist accordingly. Backups may stay in a holding disk when something is wrong with the tape at the time
+info database and tapelist accordingly\. Backups may stay in a holding disk when something is wrong with the tape at the time
 \fBamdump\fR
-is run. When this happens, the problem must be corrected and
+is run\. When this happens, the problem must be corrected and
 \fBamflush\fR
-run by hand.
+run by hand\.
 .SH "OPTIONS"
 .PP
 \fB\-b\fR
 .RS 4
 Run
 \fBamflush\fR
-in batch mode. All datestamps are selected unless specified. The flush is started without confirmation.
+in batch mode\. All datestamps are selected unless specified\. The flush is started without confirmation\.
 .RE
 .PP
 \fB\-f\fR
 .RS 4
 Run
 \fBamflush\fR
-in foreground.
+in foreground\.
 \fBAmflush\fR
-normally detaches itself from the tty and runs as a background process. With the
+normally detaches itself from the tty and runs as a background process\. With the
 \fB\-f\fR
 option,
 \fBamflush\fR
-stays in the foreground. This is useful if
+stays in the foreground\. This is useful if
 \fBamflush\fR
-is run as part of another script that, for example, advances the tape after the flush is completed.
+is run as part of another script that, for example, advances the tape after the flush is completed\.
 .RE
 .PP
 \fB\-s\fR
 .RS 4
-Write log to stdout/stderr instead of the amflush log file. Requires the
+Write log to stdout/stderr instead of the amflush log file\. Requires the
 \fB\-f\fR
-option.
+option\.
 .RE
 .PP
 \fB\-D datestamp\fR
 .RS 4
 specify a datestamp expression you want to flush, see the "DATESTAMP EXPRESSION" section of
 \fBamanda\fR(8)
-for a description.
+for a description\.
 \fB\-D 20001225\-7\fR
-will flush all dumps from 25 december 2000 to 27 december 2000.
+will flush all dumps from 25 december 2000 to 27 december 2000\.
 .RE
 .PP
 \fIhost\fR [\fIdisk\fR]*
 .RS 4
-Specify the host and disk on which the command will work.
+Specify the host and disk on which the command will work\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .PP
-You can specify many host/disk expressions, only disks that match an expression will be flushed. All disks are flushed if no expressions are given. see the "HOST & DISK EXPRESSION" section of
+You can specify many host/disk expressions, only disks that match an expression will be flushed\. All disks are flushed if no expressions are given\. see the "HOST & DISK EXPRESSION" section of
 \fBamanda\fR(8)
-for a description.
+for a description\.
 .PP
 \fBAmflush\fR
 will look in the holding disks specified by the
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 file in /usr/local/etc/amanda/\fIconfig\fR
 for any non\-empty
 \fIAmanda\fR
-work directories. It then prompts you to select a directory or to process all of the directories. The work directories in the holding disks are named by the date at the time
+work directories\. It then prompts you to select a directory or to process all of the directories\. The work directories in the holding disks are named by the date at the time
 \fBamdump\fR
-was run, e.g.
-19910215.
+was run, e\.g\.
+19910215\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "EXAMPLE"
 .PP
 \fBAmflush\fR
 will search for holding areas associated with the
 \fIdaily\fR
-configuration. After you select which holding area to flush,
+configuration\. After you select which holding area to flush,
 \fBamflush\fR
 writes the data to tape, updates the databases and sends a mail report similar to
-\fBamdump\fR(8).
+\fBamdump\fR(8)\.
 .sp
 .RS 4
 .nf
 % amflush daily
-Scanning /amanda\-hold...
-  20001113: found \fIAmanda\fR directory.
-  20001114: found \fIAmanda\fR directory.
+Scanning /amanda\-hold\.\.\.
+  20001113: found \fIAmanda\fR directory\.
+  20001114: found \fIAmanda\fR directory\.
 
 Multiple \fIAmanda\fR directories, please pick one by letter:
-  A. 20001113
-  B. 20001114
-Select directories to flush [A..B]: [ALL] all
+  A\. 20001113
+  B\. 20001114
+Select directories to flush [A\.\.B]: [ALL] all
 
 Flushing dumps in 20001113, 20001114,
 today: 20001117
-to tape drive /dev/rmt/0mn.
-Expecting tape DMP014 or a new tape.  (The last dumps were to tape DMP013)
+to tape drive /dev/rmt/0mn\.
+Expecting tape DMP014 or a new tape\.  (The last dumps were to tape DMP013)
 Are you sure you want to do this? yes
-Running in background, you can log off now.
-You'll get mail when amflush is finished.
+Running in background, you can log off now\.
+You\'ll get mail when amflush is finished\.
 .fi
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
+
 \fBamanda\fR(8),
-\fBamdump\fR(8)
+\fBamdump\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index b2f6d9652db2d17657f187cee93212d231a5e9e6..c1c0121d5a791eb4b93db43ec5fcdddc2a0e7d1b 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amgetconf
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMGETCONF" "8" "06/06/2007" "" ""
+.TH "AMGETCONF" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amgetconf \- look up amanda.conf variables
+amgetconf - look up amanda.conf variables
 .SH "SYNOPSIS"
 .HP 10
 \fBamgetconf\fR [\fIconfig\fR] [\fI\-\-list\fR] \fIparameter\fR [\-o\ \fIconfigoption\fR]...
@@ -19,78 +19,75 @@ amgetconf \- look up amanda.conf variables
 .PP
 \fBAmgetconf\fR
 looks up parameters in
-\fIamanda.conf\fR, the
+\fIamanda\.conf\fR, the
 \fIAmanda\fR
-configuration file, or from the build and runtime environment, and returns their corresponding value.
+configuration file, or from the build and runtime environment, and returns their corresponding value\.
 .PP
 If
 \fIconfig\fR
 is not specified,
 \fBamgetconf\fR
 assumes it is being run from the configuration directory and that
-\fIamanda.conf\fR
-is present.
+\fIamanda\.conf\fR
+is present\.
 .PP
 If
 \fIparameter\fR
 begins with
-\fIbuild.\fR, the (case insensitive) string following the period is a build environment variable. Variables without a value (e.g.
+\fIbuild\.\fR, the (case insensitive) string following the period is a build environment variable\. Variables without a value (e\.g\.
 \fIXFSDUMP\fR
-on a system that does not support that type of file system) will not report an error and will return an empty string as the value. Flag variables (e.g.
+on a system that does not support that type of file system) will not report an error and will return an empty string as the value\. Flag variables (e\.g\.
 \fIUSE_AMANDAHOSTS\fR) will return
 1
-if the flag is set or an empty string if it is not.
+if the flag is set or an empty string if it is not\.
 .PP
 If
 \fIparameter\fR
 begins with
-\fIdbopen.\fR, the string following the period is a program name and an
+\fIdbopen\.\fR, the string following the period is a program name and an
 \fIAmanda\fR
-debug file will be created for the caller. The name of the file is returned.
+debug file will be created for the caller\. The name of the file is returned\.
 .PP
 If
 \fIparameter\fR
 begins with
-\fIdbclose.\fR, the string following the period is a program name previously used with
-\fIdbopen.\fR, followed by a colon (:) and the previously opened file name.
+\fIdbclose\.\fR, the string following the period is a program name previously used with
+\fIdbopen\.\fR, followed by a colon (:) and the previously opened file name\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-\-list\fR
 .RS 4
-The parameter must be 'tapetype', 'dumptype, 'holdingdisk' or 'interface'. It will output, one by line, the list of identifier for the parameter.
-.RS 4
+The parameter must be \'tapetype\', \'dumptype, \'holdingdisk\' or \'interface\'\. It will output, one by line, the list of identifier for the parameter\.
 .PP
 \-\-list tapetype
 .RS 4
-Output the list of tapetype, one by line.
+Output the list of tapetype, one by line\.
 .RE
 .PP
 \-\-list dumptype
 .RS 4
-Output the list of dumptype, one by line.
+Output the list of dumptype, one by line\.
 .RE
 .PP
 \-\-list holdingdisk
 .RS 4
-Output the list of holdingdisk, one by line.
+Output the list of holdingdisk, one by line\.
 .RE
 .PP
 \-\-list interface
 .RS 4
-Output the list of interface, one by line.
-.RE
+Output the list of interface, one by line\.
 .RE
 .RE
 .PP
 \fBparameter\fR
 .RS 4
 It could be one of the below format:
-.RS 4
 .PP
 runtapes
 .RS 4
@@ -112,12 +109,11 @@ HOLDINGDISK:hd1:use
 .RS 4
 .RE
 .RE
-.RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLE"
 .PP
@@ -129,7 +125,6 @@ Find out the path to the log file directory:
 /usr/local/etc/amanda//daily
 .fi
 .RE
-.sp
 .PP
 Find out the current tape type:
 .sp
@@ -139,25 +134,23 @@ Find out the current tape type:
 DLT4000\-IV
 .fi
 .RE
-.sp
 .PP
 Find out the default configuration directory:
 .sp
 .RS 4
 .nf
-% amgetconf daily build.CONFIG_DIR
+% amgetconf daily build\.CONFIG_DIR
 /usr/local/etc/amanda/
 .fi
 .RE
-.sp
 .PP
 Create, use and close a debug file in a script:
 .sp
 .RS 4
 .nf
-% set debug_file = `amgetconf daily dbopen.myscript`
+% set debug_file = `amgetconf daily dbopen\.myscript`
 % echo debug information >> $debug_file
-% amgetconf daily dbclose.myscript:$debug_file
+% amgetconf daily dbclose\.myscript:$debug_file
 .fi
 .RE
 .sp
@@ -167,10 +160,12 @@ amgetconf: no such parameter \fIparam\fR
 .RS 4
 Parameter
 \fIparam\fR
-is not a known keyword (e.g. not a valid
-\fIamanda.conf\fR
-keyword).
+is not a known keyword (e\.g\. not a valid
+\fIamanda\.conf\fR
+keyword)\.
 .RE
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
+
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/amgpgcrypt.8 b/man/amgpgcrypt.8
new file mode 100644 (file)
index 0000000..faafc64
--- /dev/null
@@ -0,0 +1,157 @@
+.\"     Title: amgpgcrypt
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMGPGCRYPT" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amgpgcrypt - reference crypt program for Amanda public-key data encryption
+.SH "SYNOPSIS"
+.HP 11
+\fBamgpgcrypt\fR  to be called by \fIAmanda\fR only 
+.SH "DESCRIPTION"
+.PP
+
+\fBamgpgcrypt\fR
+calls
+\fBgpg\fR
+to perform public\-key data encryption on
+\fIAmanda\fR
+backup\.
+\fBamgpgcrypt\fR
+will search for the gpg program in the following directories: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
+.PP
+
+\fBamgpgcrypt\fR
+sets GNUPGHOME to $AMANDA_HOME/\.gnupg where gpg will look for the gpg keys\.
+\fBamgpgcrypt\fR
+uses the public key to encrypt the
+\fIAmanda\fR
+data and uses the private key to decrypt the
+\fIAmanda\fR
+backup data\. Thus, passphrase is only required at the time of data restore\.
+.SH "KEY AND PASSPHRASE"
+.PP
+
+\fBamgpgcrypt\fR
+uses the private key to decrypt
+\fIAmanda\fR
+backup data\.
+
+It is very important to store, manage and  protect the key and the passphrase
+properly\. Encrypted backup data can \fBonly\fR be recovered with the correct key and
+passphrase\.
+.SH "HOW TO CREATE ENCRYPTION KEYS AND PASSPHRASE FOR AMGPGCRYPT"
+.PP
+Store the passphrase that you used in following "gpg \-\-gen\-key" command inside the home\-directory of the AMANDA\-user($amanda_user) and protect it with proper permissions:
+
+   echo my_secret_passphrase > ~$amanda_user/\.am_passphrase
+   chown $amanda_user:disk ~$amanda_user/\.am_passphrase
+   chmod 700 ~$amanda_user/\.am_passphrase
+.PP
+Run "gpg \-\-gen\-key"\. Below is an example:
+.sp
+.RS 4
+.nf
+$ gpg \-\-gen\-key
+gpg (GnuPG) 1\.2\.6; Copyright (C) 2004 Free Software Foundation, Inc\.
+This program comes with ABSOLUTELY NO WARRANTY\.
+This is free software, and you are welcome to redistribute it
+under certain conditions\. See the file COPYING for details\.
+
+Please select what kind of key you want:
+   (1) DSA and ElGamal (default)
+   (2) DSA (sign only)
+   (4) RSA (sign only)
+Your selection? 1
+DSA keypair will have 1024 bits\.
+About to generate a new ELG\-E keypair\.
+              minimum keysize is  768 bits
+              default keysize is 1024 bits
+    highest suggested keysize is 2048 bits
+What keysize do you want? (1024)
+Requested keysize is 1024 bits
+Please specify how long the key should be valid\.
+         0 = key does not expire
+      (n)  = key expires in n days
+      (n)w = key expires in n weeks
+      (n)m = key expires in n months
+      (n)y = key expires in n years
+Key is valid for? (0) 6m
+Key expires at Sun 06 Aug 2006 03:51:25 PM PDT
+Is this correct (y/n)? y
+
+You need a User\-ID to identify your key; the software constructs the user id
+from Real Name, Comment and Email Address in this form:
+    "Heinrich Heine (Der Dichter) (heinrichh@duesseldorf\.de)"
+
+Real name: amandabackup
+Email address:
+Comment: gpg keys for amandabackup
+You selected this USER\-ID:
+    "amandabackup (gpg keys for amandabackup)"
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
+You need a Passphrase to protect your secret key\.
+
+We need to generate a lot of random bytes\. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy\.
+
+We need to generate a lot of random bytes\. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy\.
+
+public and secret key created and signed\.
+key marked as ultimately trusted\.
+
+pub  1024D/4417A8CB 2006\-02\-07 amandabackup (gpg keys for amandabackup)
+     Key fingerprint = 139C 6369 44FC 7F1A 655C  E5E9 7EAA 515A 4417 A8CB
+sub  1024g/8C3A6A78 2006\-02\-07 [expires: 2006\-08\-06]
+
+.fi
+.RE
+.SH "FILES"
+.PP
+\fB$AMANDA_HOME/\.gnupg/pubring\.gpg\fR
+.RS 4
+The public key\.
+\fBamgpgcrypt\fR
+encrypt data with this public key along with the cipher algorithm\.
+.RE
+.PP
+\fB$AMANDA_HOME/\.gnupg/secring\.gpg\fR
+.RS 4
+The private/secret key\. It\'s only needed during amrecover/amrestore\. Store and protect it properly during other time\.
+.RE
+.PP
+\fB$AMANDA_HOME/\.am_passphrase\fR
+.RS 4
+The passphrase\. It\'s only needed during amrecover/amrestore\. Store and protect it properly during other time\.
+.RE
+.SH "BUGS"
+.PP
+\fIAmanda\fR
+has problem with gpg mdc(modification detection code) in the binary mode\.
+\fBamgpgcrypt\fR
+calls gpg with mdc disabled
+.SH "AUTHOR"
+.PP
+The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\.
+.SH "SEE ALSO"
+.PP
+
+\fBamanda\fR(8),
+\fBamanda.conf\fR(5),
+\fBamcrypt\fR(8),
+\fBamrestore\fR(8),
+\fBgpg\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
index 9fdfd0ecfc69323315d6341c37527119ad83327d..576897a2f9c6c8861bd0322f02ed5ce5e3fb0d1e 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amlabel
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMLABEL" "8" "06/06/2007" "" ""
+.TH "AMLABEL" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amlabel \- label an Amanda tape
+amlabel - label an Amanda tape
 .SH "SYNOPSIS"
 .HP 8
 \fBamlabel\fR [\-f] \fIconfig\fR \fIlabel\fR [slot\ \fIslot\fR] [\-o\ \fIconfigoption\fR]...
@@ -19,60 +19,60 @@ amlabel \- label an Amanda tape
 .PP
 All
 \fIAmanda\fR
-tapes must be pre\-labeled before they are used.
+tapes must be pre\-labeled before they are used\.
 \fIAmanda\fR
 verifies the label in
 \fBamdump\fR
 and
 \fBamflush\fR
-before writing to make sure the proper tape is loaded.
+before writing to make sure the proper tape is loaded\.
 .PP
 \fBAmlabel\fR
 writes an
 \fIAmanda\fR
 label on the tape in the device specified by the
-\fIamanda.conf\fR
-file in /usr/local/etc/amanda/\fIconfig\fR.
+\fIamanda\.conf\fR
+file in /usr/local/etc/amanda/\fIconfig\fR\.
 \fILabel\fR
 may be any string that does not contain whitespace and that matches the
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 \fBlabelstr\fR
-regular expression option. It is up to the system administrator to define a naming convention.
+regular expression option\. It is up to the system administrator to define a naming convention\.
 .PP
 \fBAmlabel\fR
 appends the new tape to the
 \fItapelist\fR
 file so it will be used by
 \fIAmanda\fR
-before it reuses any other tapes. When you
+before it reuses any other tapes\. When you
 \fBamlabel\fR
 multiple tapes, they will be used in the order you
 \fBamlabel\fR
-them.
+them\.
 .PP
 \fBAmlabel\fR
 will not write the label if the tape contains an active
 \fIAmanda\fR
-tape or if the label specified is on an active tape. The
+tape or if the label specified is on an active tape\. The
 \fB\-f\fR
-(force) flag bypasses these verifications.
+(force) flag bypasses these verifications\.
 .PP
 An optional
 \fIslot\fR
-may be specified after the tape label. If a tape changer is in use,
+may be specified after the tape label\. If a tape changer is in use,
 \fBamlabel\fR
-will label the tape in the specified slot instead of the currently loaded tape.
+will label the tape in the specified slot instead of the currently loaded tape\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLE"
 .PP
@@ -80,7 +80,7 @@ Write an
 \fIAmanda\fR
 label with the string "DMP000" on the tape loaded in the device named in the
 \fBtapedev\fR
-option in /usr/local/etc/amanda/daily/amanda.conf:
+option in /usr/local/etc/amanda/daily/amanda\.conf:
 .sp
 .RS 4
 .nf
@@ -97,7 +97,7 @@ Label the tape in slot 3 of the currently configured tape changer with the strin
 .RE
 .SH "MESSAGES"
 .PP
-label \fIlabel\fR doesn't match labelstr \fIstr\fR
+label \fIlabel\fR doesn\'t match labelstr \fIstr\fR
 .RS 4
 Label
 \fIlabel\fR
@@ -106,7 +106,7 @@ on the command line does not match the
 regular expression
 \fIstr\fR
 from
-\fIamanda.conf\fR.
+\fIamanda\.conf\fR\.
 .RE
 .PP
 label \fIlabel\fR already on a tape
@@ -115,7 +115,7 @@ Label
 \fIlabel\fR
 is already listed as an active
 \fIAmanda\fR
-tape.
+tape\.
 .RE
 .PP
 no tpchanger specified in \fIpath\fR , so slot command invalid
@@ -123,10 +123,10 @@ no tpchanger specified in \fIpath\fR , so slot command invalid
 The command line has the
 \fBslot\fR
 parameter but the
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 file in
 \fIpath\fR
-does not have a tape changer configured.
+does not have a tape changer configured\.
 .RE
 .PP
 reading label \fIlabel\fR, tape is in another amanda configuration
@@ -137,7 +137,7 @@ tape, but label does not match
 \fBlabelstr\fR
 for this configuration so it is probably part of a different
 \fIAmanda\fR
-configuration.
+configuration\.
 .RE
 .PP
 reading label \fIlabel\fR, tape is active
@@ -146,7 +146,7 @@ Tape
 \fIlabel\fR
 appears to already be part of this
 \fIAmanda\fR
-configuration and active, i.e. has valid data on it.
+configuration and active, i\.e\. has valid data on it\.
 .RE
 .PP
 no label found, are you sure \fItape\fR is non\-rewinding?
@@ -156,18 +156,19 @@ While checking that the label was written correctly,
 got an error that might be caused by mis\-configuring
 \fIAmanda\fR
 with a rewinding tape device name instead of a non\-rewinding device name for
-\fItape.\fR
+\fItape\.\fR
 .RE
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>: Original text
+<jds@amanda\.org>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
-\fBamdump\fR(8)
-\fBamflush\fR(8)
+\fBamanda\fR(8),
+\fBamdump\fR(8),
+\fBamflush\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index e56e038b017a09e651c8fcb23dc17f744125aba1..3b1d56f70c84aa28a543626541c2c962e67d3845 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: ammt
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMMT" "8" "06/06/2007" "" ""
+.TH "AMMT" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-ammt \- Amanda version of mt
+ammt - Amanda version of mt
 .SH "SYNOPSIS"
 .HP 5
 \fBammt\fR [\-d] [\-f | \-t | \fIdevice\fR] \fIcommand\fR [\fIcount\fR]
@@ -21,145 +21,143 @@ ammt \- Amanda version of mt
 provides just enough of the standard UNIX
 \fBmt\fR
 command for the needs of
-\fIAmanda\fR. This is handy when doing a full restore and the standard
+\fIAmanda\fR\. This is handy when doing a full restore and the standard
 \fBmt\fR
-program has not yet been found.
+program has not yet been found\.
 .PP
 \fBAmmt\fR
 also provides access to the
 \fIAmanda\fR
-output drivers that support various tape simulations.
+output drivers that support various tape simulations\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR. See the
+\fIAmanda\fR\. See the
 \fBOUTPUT DRIVERS\fR
 section of
 \fIamanda(8)\fR
 for more information on the
 \fIAmanda\fR
-output drivers.
+output drivers\.
 .SH "OPTIONS"
 .PP
 \fB\-d\fR
 .RS 4
-Turn on debugging output.
+Turn on debugging output\.
 .RE
 .PP
 \fB\-f\fR\fI device\fR
 .RS 4
 Access tape device
-\fIdevice\fR. If not specified, the
+\fIdevice\fR\. If not specified, the
 \fBTAPE\fR
-environment variable is used.
+environment variable is used\.
 .RE
 .PP
 \fB\-t\fR\fI device\fR
 .RS 4
 Same as
-\fB\-f\fR.
+\fB\-f\fR\.
 .RE
 .PP
 \fBcommand\fR\fI count\fR
 .RS 4
-Which command to issue, and an optional count of operations.
+Which command to issue, and an optional count of operations\.
 .RE
 .SH "COMMANDS"
 .PP
-Each command may be abbreviated to whatever length makes it unique.
+Each command may be abbreviated to whatever length makes it unique\.
 .PP
 \fBeof|weof\fR\fI count\fR
 .RS 4
 Write
 \fIcount\fR
-(default: 1) end of file marks (tapemarks).
+(default: 1) end of file marks (tapemarks)\.
 .RE
 .PP
 \fBfsf\fR\fI count\fR
 .RS 4
 Skip forward
 \fIcount\fR
-(default: 1) files.
+(default: 1) files\.
 .RE
 .PP
 \fBbsf\fR\fI count\fR
 .RS 4
 Skip backward
 \fIcount\fR
-(default: 1) files.
+(default: 1) files\.
 .RE
 .PP
 \fBasf\fR\fI count\fR
 .RS 4
 Position to file number
 \fIcount\fR
-(default: 0) where zero is beginning of tape. This is the same as a
+(default: 0) where zero is beginning of tape\. This is the same as a
 \fBrewind\fR
 followed by a
 \fBfsf\fR
-\fIcount\fR.
+\fIcount\fR\.
 .RE
 .PP
 \fBrewind\fR
 .RS 4
-Rewind to beginning of tape.
+Rewind to beginning of tape\.
 .RE
 .PP
 \fBoffline|rewoffl\fR
 .RS 4
-Rewind to beginning of tape and unload the tape from the drive.
+Rewind to beginning of tape and unload the tape from the drive\.
 .RE
 .PP
 \fBstatus\fR
 .RS 4
-Report status information about the drive. Which data reported, and what it means, depends on the underlying operating system, and may include:
-.RS 4
+Report status information about the drive\. Which data reported, and what it means, depends on the underlying operating system, and may include:
 .PP
 ONLINE
 .RS 4
-Indicates the drive is online and ready.
+Indicates the drive is online and ready\.
 .RE
 .PP
 OFFLINE
 .RS 4
-Indicates the drive is offline or not ready.
+Indicates the drive is offline or not ready\.
 .RE
 .PP
 BOT
 .RS 4
-Indicates the drive is at beginning of tape.
+Indicates the drive is at beginning of tape\.
 .RE
 .PP
 EOT
 .RS 4
-Indicates the drive is at end of tape.
+Indicates the drive is at end of tape\.
 .RE
 .PP
 PROTECTED
 .RS 4
-Indicates the tape is write protected.
+Indicates the tape is write protected\.
 .RE
 .PP
 ds
 .RS 4
-Device status.
+Device status\.
 .RE
 .PP
 er
 .RS 4
-Error register.
+Error register\.
 .RE
 .PP
 fileno
 .RS 4
-Current tape file number.
+Current tape file number\.
 .RE
 .PP
 blkno
 .RS 4
-Current tape block number file.
-.RE
+Current tape block number file\.
 .RE
 .RE
 .sp
@@ -167,18 +165,19 @@ Current tape block number file.
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 .PP
-Many systems only report good data when a tape is in the drive and ready.
+Many systems only report good data when a tape is in the drive and ready\.
 .SH "AUTHOR"
 .PP
 Marc Mengel
-<mengel@fnal.gov>, John R. Jackson
-<jrj@purdue.edu>: Original text
+<mengel@fnal\.gov>, John R\. Jackson
+<jrj@purdue\.edu>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 8696154fd0989c2e2b17060dca65d6f48c38f1a0..35000a3d941ee51f33f5b353664323ff7fefbbf6 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amoverview
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMOVERVIEW" "8" "06/06/2007" "" ""
+.TH "AMOVERVIEW" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amoverview \- display file systems processed by Amanda over time
+amoverview - display file systems processed by Amanda over time
 .SH "SYNOPSIS"
 .HP 11
 \fBamoverview\fR [[\-config\ ]\ \fIconfig\fR] [\-hostwidth\ \fIwidth\fR] [\-diskwidth\ \fIwidth\fR] [\-skipmissed] [\-last] [\-num0] [\-togo0] [\-verbose]
@@ -20,19 +20,19 @@ amoverview \- display file systems processed by Amanda over time
 \fBAmoverview\fR
 displays a chart showing hosts and file systems processed by
 \fIAmanda\fR
-along with the backup level performed each day.
+along with the backup level performed each day\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-config\fR \fIconfig\fR
 .RS 4
 Use configuration
 \fIconfig\fR
-instead of configuration daily.
+instead of configuration daily\.
 .RE
 .PP
 \fB\-hostwidth\fR \fIwidth\fR
@@ -41,7 +41,7 @@ Set
 \fBhost\fR
 field column width to
 \fIwidth\fR
-characters instead of 8.
+characters instead of 8\.
 .RE
 .PP
 \fB\-diskwidth\fR \fIwidth\fR
@@ -50,59 +50,59 @@ Set
 \fBdisk\fR
 field column width to
 \fIwidth\fR
-characters instead of 20.
+characters instead of 20\.
 .RE
 .PP
 \fB\-skipmissed\fR
 .RS 4
 Compacts the output by only printing stats for the days
 \fIAmanda\fR
-actually ran.
+actually ran\.
 .RE
 .PP
 \fB\-last\fR
 .RS 4
-Outputs the last status of each disk at the start. Useful for long tapecycles and/or sparse reports.
+Outputs the last status of each disk at the start\. Useful for long tapecycles and/or sparse reports\.
 .RE
 .PP
 \fB\-num0\fR
 .RS 4
-Outputs the number of level 0 dumps for each disk.
+Outputs the number of level 0 dumps for each disk\.
 .RE
 .PP
 \fB\-togo0\fR
 .RS 4
-Outputs the number of runs until the last level 0 dump is overwritten.
+Outputs the number of runs until the last level 0 dump is overwritten\.
 .RE
 .PP
 \fB\-verbose\fR
 .RS 4
 \fBAmoverview\fR
-can take a long while on large systems. This option reports intermediate steps while it is working.
+can take a long while on large systems\. This option reports intermediate steps while it is working\.
 .RE
 .SH "RESULTS"
 .PP
 \fBamoverview\fR
 is a summary of the output of "
 \fBamadmin <config> find\fR
-". When the last column of
+"\. When the last column of
 \fBamadmin find\fR
-contains anything other than "OK", amoverview translates this into "E" for that day.
+contains anything other than "OK", amoverview translates this into "E" for that day\.
 .PP
-A number indicates the level of backup and it succeeded. An "E" indicates an error for that day. You get an "E" for all errors, like failed to connect, datatimeout, computer crashed, etc, but also for failing to write to tape.
+A number indicates the level of backup and it succeeded\. An "E" indicates an error for that day\. You get an "E" for all errors, like failed to connect, datatimeout, computer crashed, etc, but also for failing to write to tape\.
 .PP
-You can have an "E" followed by a number if a filesystem ran into end\-of\-tape once (gives an "E", and later that day, you flush it to a second tape (a number: the level, indicating success). If the flush failed too, you get a double "EE" for that day.
+You can have an "E" followed by a number if a filesystem ran into end\-of\-tape once (gives an "E", and later that day, you flush it to a second tape (a number: the level, indicating success)\. If the flush failed too, you get a double "EE" for that day\.
 .PP
 You can also have a double code if you have two tapes in the changer and
 \fIAmanda\fR
-failed to write to tape the first time because it hit end of tape (resulting in "E0", for a full, "E1" for an incremental etc.) or twice with error ("EE"), and may a successful flush afterwards giving maybe "EE0". (Only the latest 2 characters are printed).
+failed to write to tape the first time because it hit end of tape (resulting in "E0", for a full, "E1" for an incremental etc\.) or twice with error ("EE"), and may a successful flush afterwards giving maybe "EE0"\. (Only the latest 2 characters are printed)\.
 .SH "EXAMPLE"
 .PP
 This shows the
 \fI/home\fR
 file system on
 \fIhost2\fR
-was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th.
+was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th\.
 .sp
 .RS 4
 .nf
@@ -121,4 +121,5 @@ host2    /var                  1  1  0  1  1  1
 .SH "SEE ALSO"
 .PP
 \fBamadmin\fR(8),
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index af605477ba474a7a80ac281937b62a75606b896e..9cefa751bca7a3f86c338bc9c9d867620f1cd467 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amplot
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMPLOT" "8" "06/06/2007" "" ""
+.TH "AMPLOT" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amplot \- visualize the behavior of Amanda
+amplot - visualize the behavior of Amanda
 .SH "SYNOPSIS"
 .HP 7
 \fBamplot\fR [\-b] [\-c] [\-e] [\-g] [\-l] [\-p] [\-t\ \fIT\fR] \fIamdump_files\fR
@@ -24,85 +24,85 @@ reads an
 \fBamdump\fR
 output file that
 \fIAmanda\fR
-generates each run (e.g.
-\fIamdump.1\fR) and translates the information into a picture format that may be used to determine how your installation is doing and if any parameters need to be changed.
+generates each run (e\.g\.
+\fIamdump\.1\fR) and translates the information into a picture format that may be used to determine how your installation is doing and if any parameters need to be changed\.
 \fBAmplot\fR
 also prints out
 \fBamdump\fR
-lines that it either does not understand or knows to be warning or error lines and a summary of the start, end and total time for each backup image.
+lines that it either does not understand or knows to be warning or error lines and a summary of the start, end and total time for each backup image\.
 .PP
 \fBAmplot\fR
 is a shell script that executes an
 \fBawk\fR
 program
-(\fIamplot.awk\fR) to scan the
+(\fIamplot\.awk\fR) to scan the
 \fBamdump\fR
-output file. It then executes a
+output file\. It then executes a
 \fBgnuplot\fR
 program
-(\fIamplot.g\fR) to generate the graph. The
+(\fIamplot\.g\fR) to generate the graph\. The
 \fBawk\fR
 program is written in an enhanced version of awk, such as GNU awk
 (\fIgawk\fR
-version 2.15 or later) or
-\fBnawk\fR.
+version 2\.15 or later) or
+\fBnawk\fR\.
 .PP
 During execution,
 \fBamplot\fR
 generates a few temporary files that
 \fBgnuplot\fR
-uses. These files are deleted at the end of execution.
+uses\. These files are deleted at the end of execution\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-b\fR
 .RS 4
 Generate b/w postscript file (need
-\fB\-p\fR).
+\fB\-p\fR)\.
 .RE
 .PP
 \fB\-c\fR
 .RS 4
 Compress
 \fIamdump_files\fR
-after plotting.
+after plotting\.
 .RE
 .PP
 \fB\-e\fR
 .RS 4
-Extend the X (time) axis if needed.
+Extend the X (time) axis if needed\.
 .RE
 .PP
 \fB\-g\fR
 .RS 4
 Direct
 \fIgnuplot\fR
-output directly to the X11 display (default).
+output directly to the X11 display (default)\.
 .RE
 .PP
 \fB\-p\fR
 .RS 4
 Direct postscript output to file
-\fIYYYYMMDD\fR\fI.ps\fR
+\fIYYYYMMDD\fR\fI\.ps\fR
 (opposite of
-\fB\-g\fR).
+\fB\-g\fR)\.
 .RE
 .PP
 \fB\-l\fR
 .RS 4
 Generate landscape oriented output (needs
-\fB\-p\fR).
+\fB\-p\fR)\.
 .RE
 .PP
 \fB\-t \fR\fIT\fR
 .RS 4
 Set the right edge of the plot to be
 \fIT\fR
-hours.
+hours\.
 .RE
 .PP
 The
@@ -111,43 +111,43 @@ may be in various compressed formats
 (\fIcompress\fR,
 \fBgzip\fR,
 \fBpact\fR,
-\fBcompact\fR).
+\fBcompact\fR)\.
 .SH "INTERPRETATION"
 .PP
-The figure is divided into a number of regions. There are titles on the top that show important statistical information about the configuration and from this execution of
-\fBamdump\fR. In the figure, the X axis is time, with 0 being the moment
+The figure is divided into a number of regions\. There are titles on the top that show important statistical information about the configuration and from this execution of
+\fBamdump\fR\. In the figure, the X axis is time, with 0 being the moment
 \fBamdump\fR
-was started. The Y axis is divided into 5 regions:
+was started\. The Y axis is divided into 5 regions:
 .PP
 \fIQUEUES:\fR
-How many backups have not been started, how many are waiting on space in the holding disk and how many have been transferred successfully to tape.
+How many backups have not been started, how many are waiting on space in the holding disk and how many have been transferred successfully to tape\.
 .PP
 \fI%BANDWIDTH:\fR
-Percentage of allowed network bandwidth in use.
+Percentage of allowed network bandwidth in use\.
 .PP
 \fIHOLDING DISK:\fR
-The higher line depicts space allocated on the holding disk to backups in progress and completed backups waiting to be written to tape. The lower line depicts the fraction of the holding disk containing completed backups waiting to be written to tape including the file currently being written to tape. The scale is percentage of the holding disk.
+The higher line depicts space allocated on the holding disk to backups in progress and completed backups waiting to be written to tape\. The lower line depicts the fraction of the holding disk containing completed backups waiting to be written to tape including the file currently being written to tape\. The scale is percentage of the holding disk\.
 .PP
 \fITAPE:\fR
-Tape drive usage.
+Tape drive usage\.
 .PP
 \fI%DUMPERS:\fR
-Percentage of active dumpers.
+Percentage of active dumpers\.
 .PP
 The idle period at the left of the graph is time
 \fBamdump\fR
-is asking the machines how much data they are going to dump. This process can take a while if hosts are down or it takes them a long time to generate estimates.
+is asking the machines how much data they are going to dump\. This process can take a while if hosts are down or it takes them a long time to generate estimates\.
 .SH "AUTHOR"
 .PP
 Olafur Gudmundsson
-<ogud@tis.com>, Trusted Information Systems, formerly at University of Maryland, College Park: Original text
+<ogud@tis\.com>, Trusted Information Systems, formerly at University of Maryland, College Park: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "BUGS"
 .PP
-Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about.
+Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
@@ -158,4 +158,5 @@ Reports lines it does not recognize, mainly error cases but some are legitimate
 \fBgnuplot\fR(1),
 \fBsh\fR(1),
 \fBcompress\fR(1),
-\fBgzip\fR(1)
+\fBgzip\fR(1),
+\fBhttp://wiki.zmanda.com\fR()
index 083fa495078615a637d0ced676695d4d643065ca..505aa872234b1ae70f3eae86266268f8bf3ee96f 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amrecover
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRECOVER" "8" "06/06/2007" "" ""
+.TH "AMRECOVER" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amrecover \- Amanda index database browser
+amrecover - Amanda index database browser
 .SH "SYNOPSIS"
 .HP 10
 \fBamrecover\fR [\-C\ \fIconfig\fR] [\-s\ \fIindex\-server\fR] [\-t\ \fItape\-server\fR] [\-d\ \fItape\-device\fR] [\-o\ \fIconfigoption\fR]...
@@ -20,80 +20,80 @@ amrecover \- Amanda index database browser
 \fBAmrecover\fR
 browses the database of
 \fIAmanda\fR
-index files to determine which tapes contain files to recover. Furthermore, it is able to recover files.
+index files to determine which tapes contain files to recover\. Furthermore, it is able to recover files\.
 .PP
 In order to restore files in place, you must invoke
 \fBamrecover\fR
 from the root of the backed up filesystem, or use
 \fBlcd\fR
-to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory. See the examples below for details.
+to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory\. See the examples below for details\.
 .PP
 Amrecover will read the
-\fBamanda\-client.conf\fR
+\fBamanda\-client\.conf\fR
 file and the
-\fIconfig\fR\fB/amanda\-client.conf\fR
-file.
+\fIconfig\fR\fB/amanda\-client\.conf\fR
+file\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .sp
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .br
-\fBNote\fR
+Note
 .PP
-The Default values are those set at compile\-time. Use
+The Default values are those set at compile\-time\. Use
 \fBamrestore\fR
-to recover client\-encrypted or client\-custom\-compressed tapes.
+to recover client\-encrypted or client\-custom\-compressed tapes\.
 .PP
 \fB[ \-C ] config\fR
 .RS 4
 \fIAmanda\fR
-configuration.
+configuration\.
 .RE
 .PP
 \fB\-s index\-server\fR
 .RS 4
-Host that runs the index daemon.
+Host that runs the index daemon\.
 .RE
 .PP
 \fB\-t tape\-server\fR
 .RS 4
-Host that runs the tape server daemon.
+Host that runs the tape server daemon\.
 .RE
 .PP
 \fB\-d tape\-device\fR
 .RS 4
-Tape device to use on the tape server host.
+Tape device to use on the tape server host\.
 .RE
 .PP
 \fB\-o\fR \fIclientconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "COMMANDS"
 .PP
 \fBAmrecover\fR
-connects to the index server and then presents a command line prompt. Usage is similar to an ftp client. The GNU readline library is used to provide command line history and editing if it was built in to
-\fBamrecover\fR.
+connects to the index server and then presents a command line prompt\. Usage is similar to an ftp client\. The GNU readline library is used to provide command line history and editing if it was built in to
+\fBamrecover\fR\.
 .PP
 The purpose of browsing the database is to build up a
 \fIrestore list\fR
-of files to be extracted from the backup system. The following commands are available:
+of files to be extracted from the backup system\. The following commands are available:
 .PP
 \fBsethost hostname\fR
 .RS 4
-Specifies which host to look at backup files for (default: the local host).
+Specifies which host to look at backup files for (default: the local host)\.
 .RE
 .PP
 \fBsetdate YYYY\-MM\-DD\-HH\-MM[\-SS] | YYYY\-MM\-DD\fR
 .RS 4
-Set the restore time (default: now). File listing commands only return information on backup images for this day, for the day before with the next lower dump level, and so on, until the most recent level 0 backup on or before the specified date is encountered.
+Set the restore time (default: now)\. File listing commands only return information on backup images for this day, for the day before with the next lower dump level, and so on, until the most recent level 0 backup on or before the specified date is encountered\.
 .sp
 For example, if:
 .sp
@@ -117,10 +117,9 @@ would yield files from the following days:
 .fi
 .RE
 .sp
-Only the most recent version of a file will be presented.
+Only the most recent version of a file will be presented\.
 .sp
 The following abbreviated date specifications are accepted:
-.RS 4
 .PP
 \fB\-\-MM\-DD\fR
 .RS 4
@@ -132,22 +131,21 @@ dates in the current year
 dates in the current month of the current year
 .RE
 .RE
-.RE
 .PP
 \fBsetdisk\fR \fIdiskname\fR [\fImountpoint\fR]
 .RS 4
 Specifies which disk to consider (default: the disk holding the working directory where
 \fBamrecover\fR
-is started). It can only be set after the host is set with
-\fBsethost\fR.
+is started)\. It can only be set after the host is set with
+\fBsethost\fR\.
 \fIDiskname\fR
 is the device name specified in the
-\fIamanda.conf\fR
+\fIamanda\.conf\fR
 or
 \fIdisklist\fR
-configuration file. The disk must be local to the host. If
+configuration file\. The disk must be local to the host\. If
 \fImountpoint\fR
-is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames.
+is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames\.
 .RE
 .PP
 \fBlisthost\fR [\fIdiskdevice\fR]
@@ -162,21 +160,19 @@ List all
 \fBdiskname\fR
 .RE
 .PP
-\fBsettape\fR [[\fIserver\fR]:][\fItapedev\fR|\fIdefault\fR]
+\fBsetdevice\fR [[\-h \fItape\-server\fR] \fItapedev\fR]
 .RS 4
-Specifies the host to use as the tape server, and which of its tape devices to use. If the server is omitted, but the colon is not, the server name reverts to the configure\-time default. If the tape device is omitted, it remains unchanged. To use the default tape device selected by the tape server, the word
-\fIdefault\fR
-must be specified. If no argument is specified, or the argument is an empty string, no changes occur, and the current settings are displayed.
+Specifies the host to use as the tape server, and which of its tape devices to use\. If the server is omitted, the server name reverts to the configure\-time default\. If the tape device is omitted, the default is used\.
 .sp
 If you want amrecover to use your changer, the
 \fItapedev\fR
-must be equal to the amrecover_changer setting on the server.
+must be equal to the amrecover_changer setting on the server\.
 .sp
-If you need to change the protocol (tape:, rait:, file:, null:) then you must specify the hostname.
+If you need to change the protocol (tape:, rait:, file:, null:) then you must specify the hostname\.
 .sp
 .RS 4
 .nf
-settape 192.168.0.10:file:/file1
+settape 192\.168\.0\.10:file:/file1
 .fi
 .RE
 You can change the tape device when amrecover ask you to load the tape:
@@ -187,59 +183,59 @@ Load tape DMP014 now
 Continue? [Y/n/t]: t
 Tape device: server2:/dev/nst2
 Continue? [Y/n/t]: Y
-Using tape /dev/nst2 from server server2.
+Using tape /dev/nst2 from server server2\.
 .fi
 .RE
 .RE
 .PP
 \fBsetmode\fR \fImode\fR
 .RS 4
-Set the extraction mode for Samba shares. If
+Set the extraction mode for Samba shares\. If
 \fImode\fR
 is
-\fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC. If
+\fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC\. If
 \fImode\fR
 is
-\fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted.
+\fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted\.
 .RE
 .PP
 \fBmode\fR
 .RS 4
-Displays the extracting mode for Samba shares.
+Displays the extracting mode for Samba shares\.
 .RE
 .PP
 \fBhistory\fR
 .RS 4
-Show the backup history of the current host and disk. Dates, levels, tapes and file position on tape of each backup are displayed.
+Show the backup history of the current host and disk\. Dates, levels, tapes and file position on tape of each backup are displayed\.
 .RE
 .PP
 \fBpwd\fR
 .RS 4
-Display the name of the current backup working directory.
+Display the name of the current backup working directory\.
 .RE
 .PP
 \fBcd\fR \fIdir\fR
 .RS 4
 Change the backup working directory to
-\fIdir.\fR
+\fIdir\.\fR
 If the mount point was specified with
-\fBsetdisk\fR, this can be a full pathname or it can be relative to the current backup working directory. If the mount point was not specified, paths are relative to the mount point if they start with "/", otherwise they are relative to the current backup working directory. The
+\fBsetdisk\fR, this can be a full pathname or it can be relative to the current backup working directory\. If the mount point was not specified, paths are relative to the mount point if they start with "/", otherwise they are relative to the current backup working directory\. The
 \fIdir\fR
-can be a shell style wildcards.
+can be a shell style wildcards\.
 .RE
 .PP
 \fBcdx\fR \fIdir\fR
 .RS 4
 Like the
 \fBcd\fR
-command but allow regular expression.
+command but allow regular expression\.
 .RE
 .PP
 \fBlpwd\fR
 .RS 4
 Display the
 \fBamrecover\fR
-working directory. Files will be restored under this directory, relative to the backed up filesystem.
+working directory\. Files will be restored under this directory, relative to the backed up filesystem\.
 .RE
 .PP
 \fBlcd\fR \fIpath\fR
@@ -247,116 +243,116 @@ working directory. Files will be restored under this directory, relative to the
 Change the
 \fBamrecover\fR
 working directory to
-\fIpath\fR.
+\fIpath\fR\.
 .RE
 .PP
 \fBls\fR
 .RS 4
-List the contents of the current backup working directory. See the description of the
+List the contents of the current backup working directory\. See the description of the
 \fBsetdate\fR
-command for how the view of the directory is built up. The backup date is shown for each file.
+command for how the view of the directory is built up\. The backup date is shown for each file\.
 .RE
 .PP
-\fBadd\fR \fIitem1 item2 ...\fR
+\fBadd\fR \fIitem1 item2 \.\.\.\fR
 .RS 4
-Add the specified files or directories to the restore list. Each item may have shell style wildcards.
+Add the specified files or directories to the restore list\. Each item may have shell style wildcards\.
 .RE
 .PP
-\fBaddx\fR \fIitem1 item2 ...\fR
+\fBaddx\fR \fIitem1 item2 \.\.\.\fR
 .RS 4
-Add the specified files or directories to the restore list. Each item may be a regular expression.
+Add the specified files or directories to the restore list\. Each item may be a regular expression\.
 .RE
 .PP
-\fBdelete\fR \fIitem1 item2 ...\fR
+\fBdelete\fR \fIitem1 item2 \.\.\.\fR
 .RS 4
-Delete the specified files or directories from the restore list. Each item may have shell style wildcards.
+Delete the specified files or directories from the restore list\. Each item may have shell style wildcards\.
 .RE
 .PP
-\fBdeletex\fR \fIitem1 item2 ...\fR
+\fBdeletex\fR \fIitem1 item2 \.\.\.\fR
 .RS 4
-Delete the specified files or directories from the restore list. Each item may be a regular expression.
+Delete the specified files or directories from the restore list\. Each item may be a regular expression\.
 .RE
 .PP
 \fBlist\fR \fIfile\fR
 .RS 4
-Display the contents of the restore list. If a file name is specified, the restore list is written to that file. This can be used to manually extract the files from the
+Display the contents of the restore list\. If a file name is specified, the restore list is written to that file\. This can be used to manually extract the files from the
 \fIAmanda\fR
 tapes with
-\fBamrestore\fR.
+\fBamrestore\fR\.
 .RE
 .PP
 \fBclear\fR
 .RS 4
-Clear the restore list.
+Clear the restore list\.
 .RE
 .PP
 \fBquit\fR
 .RS 4
-Close the connection to the index server and exit.
+Close the connection to the index server and exit\.
 .RE
 .PP
 \fBexit\fR
 .RS 4
-Close the connection to the index server and exit.
+Close the connection to the index server and exit\.
 .RE
 .PP
 \fBextract\fR
 .RS 4
-Start the extract sequence (see the examples below). Make sure the local working directory is the root of the backed up filesystem, or another directory that will behave like that. Use
+Start the extract sequence (see the examples below)\. Make sure the local working directory is the root of the backed up filesystem, or another directory that will behave like that\. Use
 \fBlpwd\fR
 to display the local working directory, and
 \fBlcd\fR
-to change it.
+to change it\.
 .RE
 .PP
 \fBhelp\fR
 .RS 4
-Display a brief list of these commands.
+Display a brief list of these commands\.
 .RE
 .SH "EXAMPLES"
 .PP
 The following shows the recovery of an old
 \fIsyslog\fR
-file.
+file\.
 .sp
 .RS 4
 .nf
 # cd /var/log
-# ls \-l syslog.7
-syslog.7: No such file or directory
+# ls \-l syslog\.7
+syslog\.7: No such file or directory
 # amrecover
-AMRECOVER Version 2.4.2. Contacting server on oops ...
-220 oops \fIAmanda\fR index server (2.4.2) ready.
+AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
+220 oops \fIAmanda\fR index server (2\.4\.2) ready\.
 Setting restore date to today (1997\-12\-09)
-200 Working date set to 1997\-12\-09.
-200 Config set to daily.
-200 Dump host set to this\-host.some.org.
-$CWD '/var/log' is on disk '/var' mounted at '/var'.
-200 Disk set to /var.
+200 Working date set to 1997\-12\-09\.
+200 Config set to daily\.
+200 Dump host set to this\-host\.some\.org\.
+$CWD \'/var/log\' is on disk \'/var\' mounted at \'/var\'\.
+200 Disk set to /var\.
 /var/log
 WARNING: not on root of selected filesystem, check man\-page!
 amrecover> ls
-1997\-12\-09 daemon.log
+1997\-12\-09 daemon\.log
 1997\-12\-09 syslog
 1997\-12\-08 authlog
-1997\-12\-08 sysidconfig.log
-1997\-12\-08 syslog.0
-1997\-12\-08 syslog.1
-1997\-12\-08 syslog.2
-1997\-12\-08 syslog.3
-1997\-12\-08 syslog.4
-1997\-12\-08 syslog.5
-1997\-12\-08 syslog.6
-1997\-12\-08 syslog.7
-amrecover> add syslog.7
-Added /log/syslog.7
+1997\-12\-08 sysidconfig\.log
+1997\-12\-08 syslog\.0
+1997\-12\-08 syslog\.1
+1997\-12\-08 syslog\.2
+1997\-12\-08 syslog\.3
+1997\-12\-08 syslog\.4
+1997\-12\-08 syslog\.5
+1997\-12\-08 syslog\.6
+1997\-12\-08 syslog\.7
+amrecover> add syslog\.7
+Added /log/syslog\.7
 amrecover> lpwd
 /var/log
-amrecover> lcd ..
+amrecover> lcd \.\.
 /var
 amrecover> extract
 
-Extracting files using tape drive /dev/nst0 on host 192.168.0.10
+Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
 
 The following tapes are needed: DMP014
 
@@ -365,44 +361,44 @@ Continue? [Y/n]: y
 
 Load tape DMP014 now
 Continue? [Y/n/t]: y
-set owner/mode for '.'? [yn] n
+set owner/mode for \'\.\'? [yn] n
 amrecover> quit
-200 Good bye.
-# ls \-l syslog.7
+200 Good bye\.
+# ls \-l syslog\.7
 total 26
-\-rw\-r\-\-r\-\-   1 root     other      12678 Oct 14 16:36 syslog.7
+\-rw\-r\-\-r\-\-   1 root     other      12678 Oct 14 16:36 syslog\.7
 .fi
 .RE
 .PP
 If you do not want to overwrite existing files, create a subdirectory to run
 \fBamrecover\fR
-from and then move the restored files afterward.
+from and then move the restored files afterward\.
 .sp
 .RS 4
 .nf
 # cd /var
-# (umask 077 ; mkdir .restore)
-# cd .restore
+# (umask 077 ; mkdir \.restore)
+# cd \.restore
 # amrecover
-AMRECOVER Version 2.4.2. Contacting server on oops ...
-\&...
+AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
+\.\.\.
 amrecover> cd log
 /var/log
 amrecover> ls
-\&...
-amrecover> add syslog.7
-Added /log/syslog.7
+\.\.\.
+amrecover> add syslog\.7
+Added /log/syslog\.7
 amrecover> lpwd
-/var/.restore
+/var/\.restore
 amrecover> extract
 
-Extracting files using tape drive /dev/nst0 on host 192.168.0.10
-\&...
+Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10
+\.\.\.
 amrecover> quit
-200 Good bye.
-# mv \-i log/syslog.7 ../log/syslog.7\-restored
-# cd ..
-# rm \-fr .restore
+200 Good bye\.
+# mv \-i log/syslog\.7 \.\./log/syslog\.7\-restored
+# cd \.\.
+# rm \-fr \.restore
 .fi
 .RE
 .PP
@@ -412,24 +408,24 @@ by hand instead of letting
 \fBamrecover\fR
 control it, use the
 \fBlist\fR
-command after browsing to display the needed tapes.
+command after browsing to display the needed tapes\.
 .sp
 .RS 4
 .nf
 # cd /var/log
 # amrecover
-AMRECOVER Version 2.4.2. Contacting server on oops ...
-\&...
+AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
+\.\.\.
 amrecover> ls
-\&...
-amrecover> add syslog syslog.6 syslog.7
+\.\.\.
+amrecover> add syslog syslog\.6 syslog\.7
 Added /log/syslog
-Added /log/syslog.6
-Added /log/syslog.7
+Added /log/syslog\.6
+Added /log/syslog\.7
 amrecover> list
 TAPE DMP014 LEVEL 0 DATE 1997\-12\-08
-        /log/syslog.7
-        /log/syslog.6
+        /log/syslog\.7
+        /log/syslog\.6
 TAPE DMP015 LEVEL 1 DATE 1997\-12\-09
         /log/syslog
 amrecover> quit 
@@ -438,18 +434,18 @@ amrecover> quit
 .PP
 The
 \fBhistory\fR
-command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape. All active tapes are listed, not just back to the most recent full dump.
+command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape\. All active tapes are listed, not just back to the most recent full dump\.
 .PP
-Tape file position zero is a label. The first backup image is in file position one.
+Tape file position zero is a label\. The first backup image is in file position one\.
 .sp
 .RS 4
 .nf
 # cd /var/log
 # amrecover
-AMRECOVER Version 2.4.2. Contacting server on oops ...
-\&...
+AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\.
+\.\.\.
 amrecover> history
-200\- Dump history for config "daily" host "this\-host.some.org" disk "/var"
+200\- Dump history for config "daily" host "this\-host\.some\.org" disk "/var"
 201\- 1997\-12\-09 1 DMP015 9
 201\- 1997\-12\-08 1 DMP014 11
 201\- 1997\-12\-07 0 DMP013 22
@@ -460,7 +456,7 @@ amrecover> history
 201\- 1997\-12\-02 1 DMP008 7
 201\- 1997\-12\-01 1 DMP007 9
 201\- 1997\-11\-30 1 DMP006 6
-\&...
+\.\.\.
 amrecover> quit 
 .fi
 .RE
@@ -471,28 +467,29 @@ The
 \fBls\fR
 and
 \fBlist\fR
-commands will use $PAGER to display the file lists. Defaults to
+commands will use $PAGER to display the file lists\. Defaults to
 \fImore\fR
-if PAGER is not set.
+if PAGER is not set\.
 .PP
 \fBAMANDA_SERVER\fR
-If set, $AMANDA_SERVER will be used as index\-server. The value will take precedence over the compiled default, but will be overridden by the \-s switch.
+If set, $AMANDA_SERVER will be used as index\-server\. The value will take precedence over the compiled default, but will be overridden by the \-s switch\.
 .PP
 \fBAMANDA_TAPE_SERVER\fR
-If set, $AMANDA_TAPE_SERVER will be used as tape\-server. The value will take precedence over the compiled default, but will be overridden by the \-t switch.
+If set, $AMANDA_TAPE_SERVER will be used as tape\-server\. The value will take precedence over the compiled default, but will be overridden by the \-t switch\.
 .SH "AUTHOR"
 .PP
-Alan M. McIvor
-<alan@kauri.auck.irl.cri.nz>
+Alan M\. McIvor
+<alan@kauri\.auck\.irl\.cri\.nz>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamanda\-client.conf\fR(5),
+\fBamanda-client.conf\fR(5),
 \fBamrestore\fR(8),
 \fBamfetchdump\fR(8),
-\fBreadline\fR(3)
+\fBreadline\fR(3),
+\fBhttp://wiki.zmanda.com\fR()
index f9b6380fbe240b1b84d633d0afcf41377922654a..41acffe83653fff8a294501603a1ce12119b907e 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amreport
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMREPORT" "8" "06/06/2007" "" ""
+.TH "AMREPORT" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amreport \- generate a formatted output of statistics for an Amanda run
+amreport - generate a formatted output of statistics for an Amanda run
 .SH "SYNOPSIS"
 .HP 9
 \fBamreport\fR [\fIconfig\fR] [\-i] [\-M\ \fIaddress\fR] [\-l\ \fIlogfile\fR] [\-f\ \fIoutputfile\fR] [\-p\ \fIpostscriptfile\fR] [\-o\ \fIconfigoption\fR]...
@@ -20,22 +20,22 @@ amreport \- generate a formatted output of statistics for an Amanda run
 \fBAmreport\fR
 generates a summary report of an
 \fBamanda\fR(8)
-backup run. If no configuration name is specified, amanda.conf is read from the current directory.
+backup run\. If no configuration name is specified, amanda\.conf is read from the current directory\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fIconfig\fR
 .RS 4
-Name of the configuration to process.
+Name of the configuration to process\.
 .RE
 .PP
 \fB\-i\fR
 .RS 4
-Don't email the report.
+Don\'t email the report\.
 .RE
 .PP
 \fB\-M\fR \fIaddress\fR
@@ -45,19 +45,19 @@ Mail the report to
 instead of the
 \fBmailto\fR
 value from
-\fIamanda.conf\fR.
+\fIamanda\.conf\fR\.
 .RE
 .PP
 \fB\-l\fR \fIlogfile\fR
 .RS 4
-Name of the log file to parse to generate the report. If a log file is not specified, it defaults to the file:
+Name of the log file to parse to generate the report\. If a log file is not specified, it defaults to the file:
 .RE
 .PP
 \fIlogdir\fR/log
 .PP
 where
 \fIlogdir\fR
-is the log directory defined in amanda.conf.
+is the log directory defined in amanda\.conf\.
 .PP
 \fB\-f\fR \fIoutputfile\fR
 .RS 4
@@ -65,10 +65,10 @@ Normally,
 \fBamreport\fR
 sends the report via e\-mail to the
 \fImailto\fR
-user as defined in the amanda.conf file. If
+user as defined in the amanda\.conf file\. If
 \fIoutputfile\fR
 is specified, then the report is put in
-\fIoutputfile\fR.
+\fIoutputfile\fR\.
 .RE
 .PP
 \fB\-p\fR \fIpostscriptfile\fR
@@ -77,36 +77,36 @@ Send the postscript output to the file
 \fIpostscriptfile\fR
 instead of to the
 \fBlpr\fR(1)
-command. This option has an effect only if the
+command\. This option has an effect only if the
 \fIlbl\-templ\fR
-directive is specified in amanda.conf.
+directive is specified in amanda\.conf\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "LABEL PRINTING"
 .PP
 \fIAmanda\fR
-can print postscript labels describing the contents of tape(s) written in a run. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3\-ring binder. Various label templates are provided to format data for different tape sizes.
+can print postscript labels describing the contents of tape(s) written in a run\. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3\-ring binder\. Various label templates are provided to format data for different tape sizes\.
 .PP
-The information printed varies slightly between label templates due to size constraints. Labels contain one line for each host/file\-system pair and may also contain the file number on the tape, the level of the dump, the original size of the dump and the size of the (possibly compressed) tape file.
+The information printed varies slightly between label templates due to size constraints\. Labels contain one line for each host/file\-system pair and may also contain the file number on the tape, the level of the dump, the original size of the dump and the size of the (possibly compressed) tape file\.
 .PP
 Add the
 \fIlbl\-templ\fR
-parameter to the tapetype definition in amanda.conf to enable labels. If you don't add this line to your tapetype definition,
+parameter to the tapetype definition in amanda\.conf to enable labels\. If you don\'t add this line to your tapetype definition,
 \fBamreport\fR
-will not print tape labels.
+will not print tape labels\.
 .PP
 You may use the
-\fIremap='I'>printer\fR
-keyword in amanda.conf to print to other than the system default printer.
+\fIremap=\'I\'>printer\fR
+keyword in amanda\.conf to print to other than the system default printer\.
 .SH "TEMPLATES"
 .PP
 \fIAmanda\fR
-provides label templates for the following tape types. These are pretty generic labels and should be easy to customize for other tape types or particular site needs.
+provides label templates for the following tape types\. These are pretty generic labels and should be easy to customize for other tape types or particular site needs\.
 .sp
 .RS 4
 .nf
@@ -116,10 +116,10 @@ provides label templates for the following tape types. These are pretty generic
 * 3\-ring binder
 .fi
 .RE
-.sp
 .PP
-The 3\-ring binder type is the most generic. It may be used to make a hardcopy log of the tapes.
+The 3\-ring binder type is the most generic\. It may be used to make a hardcopy log of the tapes\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamflush\fR(8)
+\fBamflush\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 6a92015353ca0c28517364f189b5e1250a2e5dd4..f1414f2c138730d83607bacb9eb4ce2d015c2843 100644 (file)
@@ -1,20 +1,20 @@
 .\"     Title: amrestore
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRESTORE" "8" "06/06/2007" "" ""
+.TH "AMRESTORE" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amrestore \- extract backup images from an Amanda tape
+amrestore - extract backup images from an Amanda tape
 .SH "SYNOPSIS"
 .HP 10
-\fBamrestore\fR [\-r | \-c | \-C] [\-b | \fIblocksize\fR] [\-f | \fIfileno\fR] [\-l | \fIlabel\fR] [\-p] [\-h] \fItapedevice\fR|\ \fIholdingfile\fR  [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR | ...]]]]]]
+\fBamrestore\fR [\-r | \-c | \-C] [\-b | \fIblocksize\fR] [\-f | \fIfileno\fR] [\-l | \fIlabel\fR] [\-p] [\-h] \fItapedevice\fR|\ \fIholdingfile\fR  [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR | \.\.\.]]]]]]
 .SH "DESCRIPTION"
 .PP
 \fBAmrestore\fR
@@ -27,70 +27,70 @@ that match
 \fIdiskname\fR
 and
 \fIdatestamp\fR
-patterns given on the command line. The tape or holding file must be in a format written by the
+patterns given on the command line\. The tape or holding file must be in a format written by the
 \fBamdump\fR
 or
 \fBamflush\fR
-program.
+program\.
 .PP
 If
 \fIdiskname\fR
 is not specified, all backups on the tape for the previous
 \fIhostname\fR
-are candidates. If
+are candidates\. If
 \fIdatestamp\fR
 is not specified, all backups on the tape for the previous
 \fIhostname\fR
 and
 \fIdiskname\fR
-are candidates. If no
+are candidates\. If no
 \fIhostname\fR,
 \fIdiskname\fR
 or
 \fIdatestamp\fR
-are specified, every backup on the tape is a candidate.
+are specified, every backup on the tape is a candidate\.
 .PP
 \fIHostname\fR
 and
 \fIdiskname\fR
 are special expressions described in the "HOST & DISK EXPRESSION" section of
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 \fIDatestamp\fR
 are special expression described in the "DATESTAMP EXPRESSION" section of
-\fBamanda\fR(8). For example, if
+\fBamanda\fR(8)\. For example, if
 \fIdiskname\fR
 is "rz[23]a", it would match disks
 \fBrz2a\fR
 and
-\fBrz3a\fR.
+\fBrz3a\fR\.
 .PP
 \fIDatestamp\fR
 is useful if
 \fBamflush\fR
-writes multiple backup runs to a single tape.
+writes multiple backup runs to a single tape\.
 .PP
 Unless
 \fB\-p\fR
 is used, candidate backup images are extracted to files in the current directory named:
 .PP
-\fIhostname.diskname.datestamp.dumplevel\fR
+\fIhostname\.diskname\.datestamp\.dumplevel\fR
 .PP
-Amrestore doesn't use a changer, it restore from the tape already loaded in the
-\fItapedevice.\fR
+Amrestore doesn\'t use a changer, it restore from the tape already loaded in the
+\fItapedevice\.\fR
 .SH "OPTIONS"
 .PP
 \fB\-b\fR
 .RS 4
-Set the blocksize used to read the tape or holding file. All holding files must be read with a blocksize of 32 KBytes.
+Set the blocksize used to read the tape or holding file\. All holding files must be read with a blocksize of 32 KBytes\.
 \fBAmrestore\fR
-should normally be able to determine the blocksize for tapes on its own and not need this parameter.
+should normally be able to determine the blocksize for tapes on its own and not need this parameter\.
 .RE
 .PP
-The default is 32 KBytes.
+The default is 32 KBytes\.
 .PP
 \fB\-f\fR
 .RS 4
-Do a rewind followed by a fsf <fileno> before trying to restore an image.
+Do a rewind followed by a fsf <fileno> before trying to restore an image\.
 .RE
 .PP
 \fB\-l\fR
@@ -101,108 +101,106 @@ Check if we restoring from the tape with the right
 .PP
 \fB\-p\fR
 .RS 4
-Pipe output. The first matching backup image is sent to standard output, which is normally a pipe to
+Pipe output\. The first matching backup image is sent to standard output, which is normally a pipe to
 \fBrestore\fR
 or
 \fBtar\fR, then
 \fBamrestore\fR
-quits. It may be run again to continue selecting backups to process. Make sure you specify the no\-rewind
+quits\. It may be run again to continue selecting backups to process\. Make sure you specify the no\-rewind
 \fItapedevice\fR
-when doing this.
+when doing this\.
 .RE
 .PP
 Note:
 \fBrestore\fR
-may report "short read" errors when reading from a pipe. Most versions of
+may report "short read" errors when reading from a pipe\. Most versions of
 \fBrestore\fR
-support a blocking factor option to let you set the read block size, and you should set it to 2. See the example below.
+support a blocking factor option to let you set the read block size, and you should set it to 2\. See the example below\.
 .PP
 \fB\-c\fR
 .RS 4
-Compress output using the fastest method the compression program provides.
+Compress output using the fastest method the compression program provides\.
 \fBAmrestore\fR
 normally writes output files in a format understood by
 \fBrestore\fR
 or
-\fBtar\fR, even if the backups on the tape are compressed. With the
+\fBtar\fR, even if the backups on the tape are compressed\. With the
 \fB\-c\fR
 or
 \fB\-C\fR
 option,
 \fBamrestore\fR
-writes all files in compressed format, even if the backups on the tape are not compressed. Output file names will have a
-\fB.Z\fR
+writes all files in compressed format, even if the backups on the tape are not compressed\. Output file names will have a
+\fB\.Z\fR
 or
-\fB.gz\fR
+\fB\.gz\fR
 extension depending on whether
 \fBcompress\fR
 or
 \fBgzip\fR
-is the preferred compression program. This option is useful when the current directory disk is small.
+is the preferred compression program\. This option is useful when the current directory disk is small\.
 .RE
 .PP
 \fB\-C\fR
 .RS 4
-Compress output using the best method the compression program provides (may be very CPU intensive). See the notes above about the
+Compress output using the best method the compression program provides (may be very CPU intensive)\. See the notes above about the
 \fB\-c\fR
-option.
+option\.
 .RE
 .PP
 \fB\-r\fR
 .RS 4
-Raw output. Backup images are output exactly as they are on the tape, including the
+Raw output\. Backup images are output exactly as they are on the tape, including the
 \fBamdump\fR
-headers. Output file names will have a
-\fB.RAW\fR
-extension. This option is only useful for debugging and other strange circumstances.
+headers\. Output file names will have a
+\fB\.RAW\fR
+extension\. This option is only useful for debugging and other strange circumstances\.
 .RE
 .PP
 \fB\-h\fR
 .RS 4
-Header output. The tape header block is output at the beginning of each file. This is like
+Header output\. The tape header block is output at the beginning of each file\. This is like
 \fB\-r\fR
 except
 \fB\-c\fR
 or
 \fB\-C\fR
-may also be used to compress the result.
+may also be used to compress the result\.
 \fBAmrecover\fR
-uses the header to determine the restore program to use.
+uses the header to determine the restore program to use\.
 .RE
 .PP
-If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize. This makes the resulting image usable as a holding file.
+If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize\. This makes the resulting image usable as a holding file\.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .SH "EXAMPLES"
 .PP
 The following does an interactive restore of disk
 \fIrz3g\fR
 from host
-\fIseine\fR, to restore particular files. Note the use of the
+\fIseine\fR, to restore particular files\. Note the use of the
 \fBb\fR
 option to
-\fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time. This helps keep it from complaining about short reads.
+\fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time\. This helps keep it from complaining about short reads\.
 .sp
 .RS 4
 .nf
 % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \-
 .fi
 .RE
-.sp
 .PP
 The next example extracts all backup images for host
-\fIseine\fR. This is the usual way to extract all data for a host after a disk crash.
+\fIseine\fR\. This is the usual way to extract all data for a host after a disk crash\.
 .sp
 .RS 4
 .nf
 % amrestore /dev/nrmt9 seine
 .fi
 .RE
-.sp
 .PP
 If the backup datestamp in the above example is
 19910125
@@ -216,11 +214,10 @@ on the tape, these files will be created in the current directory:
 .sp
 .RS 4
 .nf
-seine.rz1a.19910125.0
-seine.rz1g.19910125.0
+seine\.rz1a\.19910125\.0
+seine\.rz1g\.19910125\.0
 .fi
 .RE
-.sp
 .PP
 You may also use
 \fBamrestore\fR
@@ -228,10 +225,9 @@ to extract a backup image from a holding disk file that has not yet been flushed
 .sp
 .RS 4
 .nf
-% amrestore \-p /amanda/20001119/seine.rz1a.2 | restore \-ivbf 2 \-
+% amrestore \-p /amanda/20001119/seine\.rz1a\.2 | restore \-ivbf 2 \-
 .fi
 .RE
-.sp
 .PP
 \fBAmrestore\fR
 may be used to generate a listing of images on a tape:
@@ -242,28 +238,28 @@ may be used to generate a listing of images on a tape:
 % amrestore \-p /dev/nrmt9 no\-such\-host > /dev/null
 .fi
 .RE
-.sp
 .PP
 This asks
 \fBamrestore\fR
 to find images for host
-\fBno\-such\-host\fR. It will not find any entries that match, but along the way will report each image it skips.
+\fBno\-such\-host\fR\. It will not find any entries that match, but along the way will report each image it skips\.
 .SH "CAVEATS"
 .PP
 \fBGNU\-tar\fR
-must be used to restore files from backup images created with the GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images.
+must be used to restore files from backup images created with the GNUTAR dumptype\. Vendor tar programs sometimes fail to read GNU tar images\.
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>, University of Maryland, College Park: Original text
+<jds@amanda\.org>, University of Maryland, College Park: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamdump\fR(8),
 \fBamflush\fR(8),
-\fBtar\fR(1)
-\fBrestore\fR(8)
+\fBtar\fR(1),
+\fBrestore\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 7ed6110fe7928c56093e6a7a74cf8cc7567b5c58..b6c536180da5592bf895c71b8e4a81dc8d11da86 100644 (file)
@@ -1,29 +1,29 @@
 .\"     Title: amrmtape
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRMTAPE" "8" "06/06/2007" "" ""
+.TH "AMRMTAPE" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amrmtape \- remove a tape from the Amanda database
+amrmtape - remove a tape from the Amanda database
 .SH "SYNOPSIS"
 .HP 9
 \fBamrmtape\fR [\-n] [\-v] [\-q] [\-d] \fIconfig\fR \fIlabel\fR
 .SH "DESCRIPTION"
 .PP
 \fBAmrmtape\fR
-invalidates the contents of an existing backup tape in the configuration database. This is meant as a recovery mechanism when a good backup is damaged either by faulty hardware or user error, e.g. the tape is eaten by the drive or is overwritten.
+invalidates the contents of an existing backup tape in the configuration database\. This is meant as a recovery mechanism when a good backup is damaged either by faulty hardware or user error, e\.g\. the tape is eaten by the drive or is overwritten\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-n\fR
@@ -34,23 +34,23 @@ and database files with
 \fIlabel\fR
 removed, but leave them in
 \fI/tmp\fR
-and do not update the original copies.
+and do not update the original copies\.
 .RE
 .PP
 \fB\-v\fR
 .RS 4
-List backups of hosts and disks that are being discarded. Enabled by default.
+List backups of hosts and disks that are being discarded\. Enabled by default\.
 .RE
 .PP
 \fB\-q\fR
 .RS 4
 Opposite of
-\fB\-v\fR.
+\fB\-v\fR\.
 .RE
 .PP
 \fB\-d\fR
 .RS 4
-Run in debugging mode so all executed commands are shown.
+Run in debugging mode so all executed commands are shown\.
 .RE
 .SH "EXAMPLE"
 .PP
@@ -58,7 +58,7 @@ Remove tape labeled
 \fIDAILY034\fR
 from the
 \fIDailySet1\fR
-configuration.
+configuration\.
 .sp
 .RS 4
 .nf
@@ -67,13 +67,14 @@ configuration.
 .RE
 .SH "AUTHOR"
 .PP
-Adrian T. Filipi\-Martin
-<atf3r@cs.virginia.edu>: Original text
+Adrian T\. Filipi\-Martin
+<atf3r@cs\.virginia\.edu>: Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamadmin\fR(8),
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/amserverconfig.8 b/man/amserverconfig.8
new file mode 100644 (file)
index 0000000..a2285e3
--- /dev/null
@@ -0,0 +1,181 @@
+.\"     Title: amserverconfig
+.\"    Author: 
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
+.\"    Manual: 
+.\"    Source: 
+.\"
+.TH "AMSERVERCONFIG" "8" "03/31/2008" "" ""
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.SH "NAME"
+amserverconfig - program to setup initial Amanda configuration
+.SH "SYNOPSIS"
+.HP 15
+\fBamserverconfig\fR \fIconfig\fR [\-\-template\ \fItemplate\fR] [\-\-no\-vtape] [\-\-tapetype\ \fItapetype\fR] [\-\-tpchanger\ \fItpchanger\fR] [\-\-tapedev\ \fItapedev\fR] [\-\-changerfile\ \fIchangerfile\fR] [\-\-changerdev\ \fIchangerdev\fR] [\-\-labelstr\ \fIlabelstr\fR] [\-\-mailto\ \fImailto\fR] [\-\-dumpcycle\ \fIdumpcycle\fR] [\-\-runspercycle\ \fIrunspercycle\fR] [\-\-runtapes\ \fIruntapes\fR] [\-\-tapecycle\ \fItapecycle\fR] [\-\-help]
+.SH "DESCRIPTION"
+.PP
+After Amanda rpms are successfully installed,
+\fBamserverconfig\fR
+will setup initial
+\fIAmanda\fR
+configuration files\. It will create /var/lib/amanda/guntar\-lists directory if one does not exist\.
+\fBamserverconfig\fR
+does not change existing
+\fIAmanda\fR
+configurations\.
+\fBamserverconfig\fR
+must be run by user amandabackup\.
+.SH "OPTIONS"
+.PP
+Options may be abbreviated, as long as the abbreviation is not ambiguous\. Option argument can either separated by \'=\' or a space\. Example: \-\-templ=harddisk \-\-tapedev /dev/nst0
+.PP
+
+\fBamserverconfig\fR
+builds a new "config"
+\fIAmanda\fR
+configuration\. Customize the configuration with the options below\.
+.PP
+\fB\-\-template template\fR
+.RS 4
+build
+\fIAmanda\fR
+configuration with pre\-configured template files\. Currently,
+\fBharddisk\fR,
+\fBsingle\-tape\fR,
+\fBtape\-changer\fR
+and
+\fBS3\fR
+are the valid inputs for this option\. Pre\-configured template files can be found in /var/lib/amanda/template\.d\. This option may be combined with other options\.
+.sp
+If tape\-changer is chosen for this option, program mtx is required\.
+\fBamserverconfig\fR
+will search for mtx in the following directory: "/usr/sbin", "/usr/local/sbin", "/usr/local/bin", "/usr/bin", "/bin" and amandabackup\'s PATH\.
+.sp
+If harddisk is chosen and \-\-no\-vtape is not specified,
+\fBamserverconfig\fR
+will create and label virtual tape file://var/lib/amanda/vtapes/$config\.
+.RE
+.PP
+\fB\-\-no\-vtape\fR
+.RS 4
+Do not create virtual tapes in the harddisk template case\.
+.RE
+.PP
+\fB\-\-tapedev tapedev\fR
+.RS 4
+The path name of non\-rewinding tape device\. default [file://var/lib/amanda/vtapes/$config]
+.RE
+.PP
+\fB\-\-tpchanger tpchanger\fR
+.RS 4
+The name of the tape changer\. default [chg\-disk]
+.RE
+.PP
+\fB\-\-changerdev changerdev\fR
+.RS 4
+A tape changer configuration parameter\. default [/dev/null]
+.RE
+.PP
+\fB\-\-changerfile changerfile\fR
+.RS 4
+A tape changer configuration parameter\. default [/etc/amanda/$config/changer\.conf]
+.RE
+.PP
+\fB\-\-labelstr labelstr\fR
+.RS 4
+The tape label constraint regular expression\. default [^$config\-[0\-9][0\-9]*$]
+.sp
+If this option is used with \-\-template=harddisk, only alphanumeric string is supported\.
+.RE
+.PP
+\fB\-\-tapetype tapetype\fR
+.RS 4
+The type of tape drive associated with tapedev or tpchanger\. default [HARDDISK]
+.RE
+.PP
+\fB\-\-mailto mailto\fR
+.RS 4
+A space separated list of recipients for mail reports\. default [amandabackup]
+.RE
+.PP
+\fB\-\-dumpcycle dumpcycle\fR
+.RS 4
+The number of days in the backup cycle\. default [1week]
+.RE
+.PP
+\fB\-\-runspercycle runspercycle\fR
+.RS 4
+The number of days in the backup cycle\. default [5]
+.RE
+.PP
+\fB\-\-runtapes runtapes\fR
+.RS 4
+The maximum number of tapes used in a single run\. default [1]
+.RE
+.PP
+\fB\-\-tapecycle tapecycle\fR
+.RS 4
+The size of tape rotation\. default [25]
+.RE
+.PP
+\fB\-\-help\fR
+.RS 4
+Display usage\.
+.RE
+.SH "FILES"
+.PP
+\fB/var/lib/amanda/template\.d\fR
+.RS 4
+Amanda configuration template files install location
+.RE
+.PP
+\fB/var/lib/amanda\fR
+.RS 4
+amandabackup home directory
+.RE
+.PP
+\fB/var/lib/amanda/gnutar\-lists\fR
+.RS 4
+A directory which contains backup timestamp and list of files backed up\.
+.RE
+.PP
+\fB/etc/amanda/$config\fR
+.RS 4
+\fIAmanda\fR
+configuration files location for $config(e\.g: DailySet1)\.
+.RE
+.PP
+\fB/etc/amanda/template\.d\fR
+.RS 4
+A directory contains dumptypes and tapetypes files used by all
+\fIAmanda\fR
+configurations\.
+.RE
+.PP
+\fB/etc/amandates\fR
+.RS 4
+\fIAmanda\fR
+file on the client\. It keeps track of structures of previous dumps\.
+.RE
+.PP
+\fB/tmp/amanda\fR
+.RS 4
+directory contains
+\fIAmanda\fR
+debug log files\.
+.RE
+.SH "RETURN VALUE"
+
+On success, zero is returned\.  On error, 1 is returned\.
+.SH "AUTHOR"
+.PP
+The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\.
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamanda.conf\fR(5),
+\fBamaddclient\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 7e8fd20129101e03c3d78b57b5f3cb79812bdb6c..9cd0f4688971aac29794634e6937f05f268e9a66 100644 (file)
@@ -1,20 +1,20 @@
 .\"     Title: amstatus
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMSTATUS" "8" "06/06/2007" "" ""
+.TH "AMSTATUS" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amstatus \- display the state of an Amanda run
+amstatus - display the state of an Amanda run
 .SH "SYNOPSIS"
 .HP 9
-\fBamstatus\fR [\-\-config] \fIconfig\fR [\-\-file\ \fIamdumpfile\fR] [\-\-summary] [\-\-dumping] [\-\-waitdumping] [\-\-waittaper] [\-\-dumpingtape] [\-\-writingtape] [\-\-finished] [\-\-failed] [\-\-estimate] [\-\-gestimate] [\-\-stats]
+\fBamstatus\fR [\-\-config] \fIconfig\fR [\-\-file\ \fIamdumpfile\fR] [\-\-summary] [\-\-dumping] [\-\-waitdumping] [\-\-waittaper] [\-\-dumpingtape] [\-\-writingtape] [\-\-finished] [\-\-failed] [\-\-estimate] [\-\-gestimate] [\-\-stats] [\-\-locale\-independent\-date\-format]
 .SH "DESCRIPTION"
 .PP
 \fBAmstatus\fR
@@ -22,23 +22,23 @@ gives the current state of the
 \fIAmanda\fR
 run specified by the
 \fIconfig\fR
-configuration. If there is no active
+configuration\. If there is no active
 \fIAmanda\fR
-running, it summarizes the result of the last run. It may also be used to summarize the results of a previous run.
+running, it summarizes the result of the last run\. It may also be used to summarize the results of a previous run\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
-All options may be abbreviated to the shortest non\-ambiguous sub\-string. If no options are given, everything is displayed.
+All options may be abbreviated to the shortest non\-ambiguous sub\-string\. If no options are given, everything is displayed\.
 .PP
 \fB[\-\-config] config\fR
 .RS 4
 Specify the
 \fIAmanda\fR
-configuration you want to display the state for.
+configuration you want to display the state for\.
 .RE
 .PP
 \fB\-\-file amdumpfile\fR
@@ -47,62 +47,67 @@ Specify an alternate file instead of the
 \fIamdump\fR
 or
 \fIamflush\fR
-file.
+file\.
 .RE
 .PP
 \fB\-\-summary\fR
 .RS 4
-Display a summary of the state of the run.
+Display a summary of the state of the run\.
 .RE
 .PP
 \fB\-\-dumping\fR
 .RS 4
-Display all partitions that are dumping.
+Display all partitions that are dumping\.
 .RE
 .PP
 \fB\-\-waitdumping|wdumping\fR
 .RS 4
-Display all partitions that are waiting to be dumped.
+Display all partitions that are waiting to be dumped\.
 .RE
 .PP
 \fB\-\-waittaper|wtaper\fR
 .RS 4
-Display all partitions dumped that are waiting to be written to tape.
+Display all partitions dumped that are waiting to be written to tape\.
 .RE
 .PP
 \fB\-\-dumpingtape|dtape\fR
 .RS 4
-Display all partitions that are dumping directly to tape.
+Display all partitions that are dumping directly to tape\.
 .RE
 .PP
 \fB\-\-writingtape|wtape\fR
 .RS 4
-Display all partitions that are writing to tape.
+Display all partitions that are writing to tape\.
 .RE
 .PP
 \fB\-\-finished\fR
 .RS 4
-Display all partitions that are dumped and written to tape.
+Display all partitions that are dumped and written to tape\.
 .RE
 .PP
 \fB\-\-failed|error\fR
 .RS 4
-Display all partitions that failed.
+Display all partitions that failed\.
 .RE
 .PP
 \fB\-\-estimate\fR
 .RS 4
-Display all partitions whose estimate is finished. Works only during the estimate phase.
+Display all partitions whose estimate is finished\. Works only during the estimate phase\.
 .RE
 .PP
 \fB\-\-gestimate|gettingestimate\fR
 .RS 4
-Display all partitions whose estimate is not finished. Works only during the estimate phase.
+Display all partitions whose estimate is not finished\. Works only during the estimate phase\.
 .RE
 .PP
 \fB\-\-stats|statistics\fR
 .RS 4
-Display statistics about active\-time of taper and dumpers.
+Display statistics about active\-time of taper and dumpers\.
+.RE
+.PP
+\fB\-\-locale\-independent\-date\-format\fR
+.RS 4
+Output the date in a locale independent format\. The format is the same executing: date +\'%Y\-%m\-%d %H:%M:%S %Z\'
 .RE
 .SH "SEE ALSO"
 .PP
@@ -110,4 +115,5 @@ Display statistics about active\-time of taper and dumpers.
 \fBamcheck\fR(8),
 \fBamdump\fR(8),
 \fBamrestore\fR(8),
-\fBamadmin\fR(8)
+\fBamadmin\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 56e5c8a7aec767e7a00c819bd9d1ff19f536b811..a2dc2f7891aa7ba226fa901879429237d293cd68 100644 (file)
@@ -1,67 +1,67 @@
 .\"     Title: amtape
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPE" "8" "06/06/2007" "" ""
+.TH "AMTAPE" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amtape \- user interface to Amanda tape changer controls
+amtape - user interface to Amanda tape changer controls
 .SH "SYNOPSIS"
 .HP 7
 \fBamtape\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [\fB\-o\ \fR\fIconfigoption\fR]...
 .SH "DESCRIPTION"
 .PP
 \fBAmtape\fR
-performs tape changer control operations. It uses the underlying tape changer script defined by the
+performs tape changer control operations\. It uses the underlying tape changer script defined by the
 \fBtpchanger\fR
 option for a particular
 \fIAmanda\fR
 configuration as specified by the
 \fIconfig\fR
-argument.
+argument\.
 .PP
 Tape changers maintain a notion of the
 \fIcurrent\fR
 and
 \fInext\fR
-slot for each configuration. These may or may not correspond to an actual physical state of the device, but do tend to minimize searching through the tape storage slots. If the desired tape is in the current slot, it is likely the next tape needed is in the next slot rather than at some random position in the storage slots.
+slot for each configuration\. These may or may not correspond to an actual physical state of the device, but do tend to minimize searching through the tape storage slots\. If the desired tape is in the current slot, it is likely the next tape needed is in the next slot rather than at some random position in the storage slots\.
 .PP
 See the
 \fBamanda\fR(8)
 man page for more details about
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "COMMANDS"
 .PP
 \fBreset\fR
 .RS 4
-Reset the tape changer to a known state. The
+Reset the tape changer to a known state\. The
 \fIcurrent\fR
 slot is set to the
 \fIfirst\fR
-slot. Other device\-specific side effects may occur. Some gravity stackers need to be reset to the top position by hand. This command notifies
+slot\. Other device\-specific side effects may occur\. Some gravity stackers need to be reset to the top position by hand\. This command notifies
 \fIAmanda\fR
-the stacker is back in that position.
+the stacker is back in that position\.
 .RE
 .PP
 \fBeject\fR
 .RS 4
-If a tape is loaded in the drive, it is ejected and returned to the slot from which it was loaded.
+If a tape is loaded in the drive, it is ejected and returned to the slot from which it was loaded\.
 .RE
 .PP
 \fBclean\fR
 .RS 4
-If a cleaning tape is defined for the changer, it is used to clean the drive.
+If a cleaning tape is defined for the changer, it is used to clean the drive\.
 .RE
 .PP
 \fBshow\fR
 .RS 4
-Show the contents of all slots. This can be slow.
+Show the contents of all slots\. This can be slow\.
 .RE
 .PP
 \fBlabel\fR \fIlabel\fR
@@ -69,30 +69,30 @@ Show the contents of all slots. This can be slow.
 Search for and load the
 \fIAmanda\fR
 tape with label
-\fIlabel\fR.
+\fIlabel\fR\.
 .RE
 .PP
 \fBtaper\fR
 .RS 4
 Perform the
 \fBtaper\fR
-scan algorithm. Load the next tape in the configuration's tape sequence, or a fresh tape with a suitable label.
+scan algorithm\. Load the next tape in the configuration\'s tape sequence, or a fresh tape with a suitable label\.
 .RE
 .PP
 \fBdevice\fR
 .RS 4
 Display the name of the current tape device on
-\fIstdout\fR.
+\fIstdout\fR\.
 .RE
 .PP
 \fBcurrent\fR
 .RS 4
-Display the current slot.
+Display the current slot\.
 .RE
 .PP
 \fBupdate\fR
 .RS 4
-Update the changer label database, if it has one, to match the tapes now available.
+Update the changer label database, if it has one, to match the tapes now available\.
 .RE
 .PP
 \fBslot\fR \fIslot\fR
@@ -100,72 +100,73 @@ Update the changer label database, if it has one, to match the tapes now availab
 Eject any tape in the drive and put it away, then load the tape from slot
 \fIslot\fR
 and reset
-\fIcurrent\fR.
+\fIcurrent\fR\.
 .RE
 .PP
 \fBslot current\fR
 .RS 4
-Eject any tape in the drive and put it away, then load the tape from the current slot.
+Eject any tape in the drive and put it away, then load the tape from the current slot\.
 .RE
 .PP
 \fBslot prev\fR
 .RS 4
 Eject any tape in the drive and put it away, then load the tape from the previous slot and reset
-\fIcurrent\fR.
+\fIcurrent\fR\.
 .RE
 .PP
 \fBslot next\fR
 .RS 4
 Eject any tape in the drive and put it away, then load the tape from the next slot and reset
-\fIcurrent\fR.
+\fIcurrent\fR\.
 .RE
 .PP
 \fBslot first\fR
 .RS 4
 Eject any tape in the drive and put it away, then load the tape from the first slot and reset
-\fIcurrent\fR.
+\fIcurrent\fR\.
 .RE
 .PP
 \fBslot last\fR
 .RS 4
 Eject any tape in the drive and put it away, then load the tape from the last slot and reset
-\fIcurrent\fR.
+\fIcurrent\fR\.
 .RE
 .PP
 \fBslot advance\fR
 .RS 4
-Eject any tape in the drive and put it away. Advance
+Eject any tape in the drive and put it away\. Advance
 \fIcurrent\fR
-to the next tape, but do not load it.
+to the next tape, but do not load it\.
 .RE
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
-\fBamanda\fR(8).
+\fBamanda\fR(8)\.
 .RE
 .PP
 This is useful with non\-gravity stackers to unload the last tape used and set up
 \fIAmanda\fR
-for the next run. If you just use
-\fBeject\fR, the current tape will be mounted again in the next run, where it will be rejected as being still in use, ejected and the next tape requested. Using
+for the next run\. If you just use
+\fBeject\fR, the current tape will be mounted again in the next run, where it will be rejected as being still in use, ejected and the next tape requested\. Using
 \fBslot next\fR
 followed by
 \fBeject\fR
-does an unnecessary mount.
+does an unnecessary mount\.
 .PP
 Note: most changers optimize the
 \fBslot\fR
-commands to not eject the loaded tape if it is the one being requested.
+commands to not eject the loaded tape if it is the one being requested\.
 .SH "AUTHOR"
 .PP
 James da Silva,
-<jds@amanda.org>
+<jds@amanda\.org>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 0734bf1577814736ce13704a754844a1559d417e..c6a9ea772158443173b8c88610dd9440cf7b0fdd 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amtapetype
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPETYPE" "8" "06/06/2007" "" ""
+.TH "AMTAPETYPE" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amtapetype \- generate a tapetype definition.
+amtapetype - generate a tapetype definition.
 .SH "SYNOPSIS"
 .HP 11
 \fBamtapetype\fR [\-h] [\-c] [\-o] [\-b\ \fIblocksize\fR] \-e\ \fIestsize\fR [\-f\ \fItapedev\fR] [\-t\ \fItypename\fR]
@@ -19,24 +19,24 @@ amtapetype \- generate a tapetype definition.
 .PP
 \fBamtapetype\fR
 generates a tapetype entry for
-\fIAmanda\fR.
+\fIAmanda\fR\.
 .SH "OPTIONS"
 .PP
 \fB\-h\fR
 .RS 4
-Display an help message.
+Display an help message\.
 .RE
 .PP
 \fB\-c\fR
 .RS 4
-Run only the hardware compression detection heuristic test and stop. This takes a few minutes only.
+Run only the hardware compression detection heuristic test and stop\. This takes a few minutes only\.
 .RE
 .PP
 \fB\-o\fR
 .RS 4
-Overwrite the tape, even if it's an
+Overwrite the tape, even if it\'s an
 \fIAmanda\fR
-tape.
+tape\.
 .RE
 .PP
 \fB\-b\fR\fI blocksize\fR
@@ -51,7 +51,7 @@ estimated tape size (No default!)
 .PP
 \fB\-f\fR\fI tapedev\fR
 .RS 4
-tape device name (default: $TAPE) The device to perform the test.
+tape device name (default: $TAPE) The device to perform the test\.
 .RE
 .PP
 \fB\-t\fR\fI typename\fR
@@ -69,29 +69,30 @@ Generate a tapetype definition for your tape device:
 .RE
 .SH "NOTES"
 .PP
-Hardware compression is detected by measuring the writing speed difference of the tape drive when writing an amount of compressable and uncompresseable data. It does not rely on the status bits of the tape drive or the OS parameters. If your tape drive has very large buffers or is very fast, the program could fail to detect hardware compression status reliably.
+Hardware compression is detected by measuring the writing speed difference of the tape drive when writing an amount of compressable and uncompresseable data\. It does not rely on the status bits of the tape drive or the OS parameters\. If your tape drive has very large buffers or is very fast, the program could fail to detect hardware compression status reliably\.
 .PP
-During the first pass, it writes files that are estimated to be 1% of the expected tape capacity. It gets the expected capacity from the \-e command line flag, or defaults to 1 GByte. In a perfect world (which means there is zero chance of this happening with tapes :\-), there would be 100 files and 100 file marks.
+During the first pass, it writes files that are estimated to be 1% of the expected tape capacity\. It gets the expected capacity from the \-e command line flag, or defaults to 1 GByte\. In a perfect world (which means there is zero chance of this happening with tapes :\-), there would be 100 files and 100 file marks\.
 .PP
-During the second pass, the file size is cut in half. In that same fairyland world, this means 200 files and 200 file marks.
+During the second pass, the file size is cut in half\. In that same fairyland world, this means 200 files and 200 file marks\.
 .PP
-In both passes the total amount of data written is summed as well as the number of file marks written. At the end of the second pass, quoting from the code:
+In both passes the total amount of data written is summed as well as the number of file marks written\. At the end of the second pass, quoting from the code:
 .PP
-* Compute the size of a filemark as the difference in data written between pass 1 and pass 2 divided by the difference in number of file marks written between pass 1 and pass 2. ... *
+* Compute the size of a filemark as the difference in data written between pass 1 and pass 2 divided by the difference in number of file marks written between pass 1 and pass 2\. \.\.\. *
 .PP
-So if we wrote 1.0 GBytes on the first pass and 100 file marks, and 0.9 GBytes on the second pass with 200 file marks, those additional 100 file marks in the second pass took 0.1 GBytes and therefor a file mark is 0.001 GBytes (1 MByte).
+So if we wrote 1\.0 GBytes on the first pass and 100 file marks, and 0\.9 GBytes on the second pass with 200 file marks, those additional 100 file marks in the second pass took 0\.1 GBytes and therefor a file mark is 0\.001 GBytes (1 MByte)\.
 .PP
-Note that if the estimated capacity is wrong, the only thing that happens is a lot more (or less, but unlikely) files, and thus, file marks, get written. But the math still works out the same. The \-e flag is there to keep the number of file marks down because they can be slow (since they force the drive to flush all its buffers to physical media).
+Note that if the estimated capacity is wrong, the only thing that happens is a lot more (or less, but unlikely) files, and thus, file marks, get written\. But the math still works out the same\. The \-e flag is there to keep the number of file marks down because they can be slow (since they force the drive to flush all its buffers to physical media)\.
 .PP
-All sorts of things might happen to cause the amount of data written to vary enough to generate a big file mark size guess. A little more "shoe shining" because of the additional file marks (and flushes), dirt left on the heads from the first pass of a brand new tape, the temperature/humidity changed during the multi\-hour run, a different amount of data was written after the last file mark before EOT was reported, etc.
+All sorts of things might happen to cause the amount of data written to vary enough to generate a big file mark size guess\. A little more "shoe shining" because of the additional file marks (and flushes), dirt left on the heads from the first pass of a brand new tape, the temperature/humidity changed during the multi\-hour run, a different amount of data was written after the last file mark before EOT was reported, etc\.
 .PP
 Note that the file mark size might really be zero for whatever device this is, and it was just the measured capacity variation that caused
 \fBamtapetype\fR
-to think those extra file marks in pass 2 actually took up space.
+to think those extra file marks in pass 2 actually took up space\.
 .PP
 It also explains why
 \fBamtapetype\fR
-used to sometimes report a negative file mark size if the math happened to end up that way. When that happens now we just report it as zero.
+used to sometimes report a negative file mark size if the math happened to end up that way\. When that happens now we just report it as zero\.
 .SH "SEE ALSO"
 .PP
-\fBamanda\fR(8)
+\fBamanda\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 3d010f680a57e5b2ea854dcf583aa2fc805edb1b..ac81e4d3b4efd8fad6b1b20ecd939bb8260a7cdc 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amtoc
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTOC" "8" "06/06/2007" "" ""
+.TH "AMTOC" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amtoc \- generate TOC (Table Of Contents) for an Amanda run
+amtoc - generate TOC (Table Of Contents) for an Amanda run
 .SH "SYNOPSIS"
 .HP 6
 \fBamtoc\fR [\-a] [\-i] [\-t] [\-f\ \fIfile\fR] [\-s\ \fIsubs\fR] [\-w] [\-\-] \fIlogfile\fR
@@ -20,57 +20,57 @@ amtoc \- generate TOC (Table Of Contents) for an Amanda run
 \fIAmtoc\fR
 generates a table of contents for an
 \fIAmanda\fR
-run. It's a perl script (if you don't have perl, install it first!).
+run\. It\'s a perl script (if you don\'t have perl, install it first!)\.
 .SH "OPTIONS"
 .PP
 \fB\-a\fR
 .RS 4
 The output file name will be
-\fIlabel\-of\-the\-tape\fR.toc in the same directory as
-\fIlogfile\fR.
+\fIlabel\-of\-the\-tape\fR\.toc in the same directory as
+\fIlogfile\fR\.
 .RE
 .PP
 \fB\-i\fR
 .RS 4
 Display help about
-\fBamtoc\fR.
+\fBamtoc\fR\.
 .RE
 .PP
 \fB\-t\fR
 .RS 4
-Generate the output in tabular form.
+Generate the output in tabular form\.
 .RE
 .PP
 \fB\-f file\fR
 .RS 4
-Write the output to a file ('\-' for stdout).
+Write the output to a file (\'\-\' for stdout)\.
 .RE
 .PP
 \fB\-s subs\fR
 .RS 4
 Evaluate the output file name from
 \fIsubs\fR, with $_ set to
-\fIlabel\-of\-the\-tape\fR. The
+\fIlabel\-of\-the\-tape\fR\. The
 \fB\-a\fR
 option is equivalent to
 \fB\-s\fR
-\fI's/$_/.toc/'\fR.
+\fI\'s/$_/\.toc/\'\fR\.
 .RE
 .PP
 \fB\-w\fR
 .RS 4
-Separate tapes with form\-feeds and display blank lines before totals.
+Separate tapes with form\-feeds and display blank lines before totals\.
 .RE
 .PP
 \fB\-\-\fR
 .RS 4
 Marks the last option so the next parameter is the
-\fIlogfile\fR.
+\fIlogfile\fR\.
 .RE
 .PP
 \fBlogfile\fR
 .RS 4
-(use '\-' for stdin)
+(use \'\-\' for stdin)
 .RE
 .SH "OUTPUT FORMAT"
 .PP
@@ -82,7 +82,7 @@ The standard output has five fields separated by two spaces:
 0  daily\-05:  19991005  \-  \-
 1  cuisun15:/cuisun15/home  19991005  1  96
 2  cuinfs:/export/dentiste  19991005  1  96
-  ...
+  \.\.\.
 103  cuisg11:/  19991005  0  4139136
 103  total:  \-  \-  16716288
 
@@ -98,7 +98,7 @@ In tabular format (\-t), this would look like:
   0  daily\-05:                   19991005    \-         \-
   1  cuisun15:/cuisun15/home     19991005    1        96
   2  cuinfs:/export/dentiste     19991005    1        96
-  ...
+  \.\.\.
 103  cuisg11:/                   19991005    0   4139136
 103  total:                      \-           \-  16716288
 
@@ -115,26 +115,26 @@ in the
 .sp
 .RS 4
 .nf
-amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls \-1t $logdir/log.*.[0\-9] | head \-1` ; amtoc \-a $log
+amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls \-1t $logdir/log\.*\.[0\-9] | head \-1` ; amtoc \-a $log
 .fi
 .RE
-.sp
 .PP
-which will generate /usr/local/etc/amanda//daily/\fItape_label\fR.toc. You may also want to call
+which will generate /usr/local/etc/amanda//daily/\fItape_label\fR\.toc\. You may also want to call
 \fBamtoc\fR
 after an
-\fIamflush\fR.
+\fIamflush\fR\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamdump\fR(8),
 \fBamflush\fR(8),
-\fBamgetconf\fR(8), cron, perl
+\fBamgetconf\fR(8), cron, perl,
+\fBhttp://wiki.zmanda.com\fR()
 .SH "AUTHOR"
 .PP
 Nicolas Mayencourt
-<Nicolas.Mayencourt@cui.unige.ch>, University of Geneva/Switzerland : Original text
+<Nicolas\.Mayencourt@cui\.unige\.ch>, University of Geneva/Switzerland : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
index 59ca7cd9af49fb41f99ca903b504aad94c0419dd..0d0d049b0b01af0d10ec1d54674555fe4f34f1a2 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amverify
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFY" "8" "06/06/2007" "" ""
+.TH "AMVERIFY" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amverify \- check an Amanda tape for errors
+amverify - check an Amanda tape for errors
 .SH "SYNOPSIS"
 .HP 9
 \fBamverify\fR \fIconfig\fR [\fIslot\fR\ [\fIruntapes\fR]]
@@ -20,44 +20,45 @@ amverify \- check an Amanda tape for errors
 \fBAmverify\fR
 reads an Amanda format tape and makes sure each backup image can be processed by
 \fBamrestore\fR
-and, if possible, the appropriate restore program (e.g.
-\fBtar\fR).
+and, if possible, the appropriate restore program (e\.g\.
+\fBtar\fR)\.
 .PP
 \fBAmverify\fR
 runs
 \fBamrestore\fR
-on each file of the tape and pipes the output to a restore program (if available) with an option to create a catalogue of the backup. The catalogue itself is discarded. Only the success or failure of the operation itself is reported.
+on each file of the tape and pipes the output to a restore program (if available) with an option to create a catalogue of the backup\. The catalogue itself is discarded\. Only the success or failure of the operation itself is reported\.
 .PP
-If the backup image cannot be processed by the restore program, e.g. if it was written on a different operating system, the image is sent through
+If the backup image cannot be processed by the restore program, e\.g\. if it was written on a different operating system, the image is sent through
 \fBdd\fR
-to /dev/null. This still determines if the tape is readable, but does not do any internal consistency check on the image.
+to /dev/null\. This still determines if the tape is readable, but does not do any internal consistency check on the image\.
 .PP
 If
 \fIconfig\fR
 is set up to use a tape changer, the
 \fIslot\fR
-argument may be used to choose the first tape to process. Otherwise, the
+argument may be used to choose the first tape to process\. Otherwise, the
 \fBcurrent\fR
-slot is used.
+slot is used\.
 .PP
 The
 \fBruntapes\fR
-configuration parameter determines how many tapes are processed unless it is specified on the command line.
+configuration parameter determines how many tapes are processed unless it is specified on the command line\.
 .PP
 See the
 \fBamanda\fR(8)
-man page for more details about Amanda.
+man page for more details about Amanda\.
 .SH "AUTHOR"
 .PP
 Axel Zinser
-<fifi@icem.de>
+<fifi@icem\.de>
 : Original text
 .PP
-Stefan G. Weichinger,
-<sgw@amanda.org>, maintainer of the
+Stefan G\. Weichinger,
+<sgw@amanda\.org>, maintainer of the
 \fIAmanda\fR\-documentation: XML\-conversion
 .SH "SEE ALSO"
 .PP
 \fBamrestore\fR(8),
 \fBamanda\fR(8),
-\fBamverifyrun\fR(8)
+\fBamverifyrun\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
index 50bb981f2f3c7b378204ac038bdc9cba53b59244..b3fc9e6287c09bc16e319062f8d1709c93869f2f 100644 (file)
@@ -1,17 +1,17 @@
 .\"     Title: amverifyrun
 .\"    Author: 
-.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 06/06/2007
+.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
+.\"      Date: 03/31/2008
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFYRUN" "8" "06/06/2007" "" ""
+.TH "AMVERIFYRUN" "8" "03/31/2008" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-amverifyrun \- check the tapes written by the last Amanda run
+amverifyrun - check the tapes written by the last Amanda run
 .SH "SYNOPSIS"
 .HP 12
 \fBamverifyrun\fR \fIconfig\fR
@@ -20,10 +20,11 @@ amverifyrun \- check the tapes written by the last Amanda run
 \fBAmverifyrun\fR
 read the log from the last
 \fIAmanda\fR
-run to find the slot of the first tape used and the number of tapes used. It call
+run to find the slot of the first tape used and the number of tapes used\. It call
 \fBamverify\fR
-with these argument.
+with these argument\.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
-\fBamverify\fR(8)
+\fBamverify\fR(8),
+\fBhttp://wiki.zmanda.com\fR()
diff --git a/man/xml-source/amaddclient.8.xml b/man/xml-source/amaddclient.8.xml
new file mode 100644 (file)
index 0000000..03d9ef4
--- /dev/null
@@ -0,0 +1,286 @@
+
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amaddclient.8'>
+<refmeta>
+<refentrytitle>amaddclient</refentrytitle>
+<manvolnum>8</manvolnum>
+</refmeta>
+<refnamediv>
+<refname>amaddclient</refname>
+<refpurpose>program to add client to an existing &A; configuration</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amaddclient</command>  
+<arg choice='plain'>--config </arg>
+<arg choice='plain'><replaceable>config</replaceable></arg> ||
+<arg choice='plain'>--client </arg><arg
+    choice='plain'><replaceable>client name</replaceable></arg> ||
+<arg choice='plain'>--diskdev </arg><arg
+    choice='plain'><replaceable>directory to backup</replaceable></arg>
+<arg choice='opt'>--m </arg>
+<arg choice='opt'>--dumptype <replaceable>string</replaceable></arg>
+<arg choice='opt'>--includefile <replaceable>string</replaceable></arg>
+<arg choice='opt'>--includelist <replaceable>string</replaceable></arg>
+<arg choice='opt'>--excludefile <replaceable>string</replaceable></arg>
+<arg choice='opt'>--excludelist <replaceable>string</replaceable></arg>
+<arg choice='opt'>--user <replaceable>string</replaceable></arg>
+<arg choice='opt'>--auth <replaceable>string</replaceable></arg>
+<arg choice='opt'>--gnutar_list_dir <replaceable>string</replaceable></arg>
+<arg choice='opt'>--amandates <replaceable>string</replaceable></arg>
+<arg choice='opt'>--no-client-update </arg>
+<arg choice='opt'>--batch </arg>
+<arg choice='opt'>--help </arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>After Amanda rpms are successfully installed and
+&amserverconfig; is run,
+         &amaddclient; will add client to the  &A; configuration.
+&amaddclient; create or update &A; disklist file and create or update
+/var/lib/amanda/.amandahosts file on the server.</para>
+<para> If --no-client-update is not specified,
+&amaddclient; will attempt to update or create /var/lib/amanda/.amandahost,
+amanda-client.conf and gnutar-lists on
+the client.
+(See <refentrytitle>ssh-keygen</refentrytitle><manvolnum>1</manvolnum> and
+<refentrytitle>ssh-add</refentrytitle><manvolnum>1</manvolnum> for detail.)</para>
+<para>
+&amaddclient; must be run by user amandabackup.</para>
+<para> --config, --client and --diskdev must be specified.
+</para> 
+</refsect1>
+
+
+<refsect1><title>Options</title>
+<variablelist remap='TP'>
+ <varlistentry>
+Options may be abbreviated, as long as the abbreviation is not ambiguous. Option argument can either separated by '=' or a space.
+Example: --conf=v253, --client client8.zmanda.com
+</varlistentry>
+
+
+  <varlistentry>
+  <term><option>--config config</option></term>
+  <listitem>
+<para>&A; configuration which this program will add the client to.  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--client client</option></term>
+  <listitem>
+<para>The name of the client machine to add. FQDN name recommended. </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--diskdev diskdev</option></term>
+  <listitem>
+<para>Directory for this &A; configuration to backup.</para>
+  </listitem>
+  </varlistentry>
+
+
+  <varlistentry>
+  <term><option>--m</option></term>
+  <listitem>
+<para>Modify existing entry in the disklist file.</para>
+<para>Note: if disklist file has been modified manually, this option might not work.</para>
+  </listitem>
+  </varlistentry>
+
+
+  <varlistentry>
+  <term><option>--dumptype dumptype</option></term>
+  <listitem>
+<para>dumptype to use. Dumptype must be defined in
+/etc/amanda/template.d/dumptypes or /etc/amanda/$config/amanda.conf file.  Default: [user-tar]</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--user string</option></term>
+  <listitem>
+<para> name of user using &amrecover; on the client, default is root.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--auth string</option></term>
+  <listitem>
+<para> authentication method to use when running &amrecover; from the client , default is bsdtcp.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--gnutar_list_dir string</option></term>
+  <listitem>
+<para> directory where gnutar keep its state file on the client. Absolute path
+required. Default is /var/lib/amanda/gnutar-lists. If --no-client-update is not
+set, this program will attempt to create the directory on the client. </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--amandates string</option></term>
+  <listitem>
+<para> file where amanda keep the date of each dumplevel on the client, default is /etc/amandates.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--batch</option></term>
+  <listitem>
+<para>Turn on batch mode when copying files to the client, default is off</para>
+  </listitem>
+  </varlistentry>
+
+<varlistentry>
+  <term><option>--no-client-update</option></term>
+  <listitem>
+<para>If this option is set,  &amaddclient; will not attempt to update/create
+.amandahosts, amanda-client.conf and gnutar-lists file on the client.</para>
+  </listitem>
+  </varlistentry>
+
+
+  <varlistentry>
+  <term><option>--help</option></term>
+  <listitem>
+<para>Display usage. </para>
+  </listitem>
+  </varlistentry>
+
+<varlistentry> 
+If any of the following four options are used, &amaddclient; will extend the dumptype definition to an in-line definition in the disklist file. See <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry> DISKLIST FILE section for detail.
+</varlistentry>
+
+  <varlistentry>
+  <term><option>--includefile string</option></term>
+  <listitem>
+<para>string is a glob expression  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--includelist string</option></term>
+  <listitem>
+<para> string is a file name on the client containing glob expressions.
+Specify either --includefile or --includelist. </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--excludefile string</option></term>
+  <listitem>
+<para>string is a glob expression  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--excludelist string</option></term>
+  <listitem>
+<para> string is a file name on the client containing glob expressions.
+Specify either --excludefile or --excludelist. </para>
+  </listitem>
+  </varlistentry>
+
+
+
+</variablelist>
+</refsect1>
+
+<refsect1><title>Files</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>/var/lib/amanda/template.d</option></term>
+  <listitem>
+<para>Amanda configuration template files install location</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/var/lib/amanda</option></term>
+  <listitem>
+<para>amandabackup home directory</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/var/lib/amanda/.amandahosts</option></term>
+  <listitem>
+<para>&A; authentication file.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/var/lib/amanda/gnutar-lists</option></term>
+  <listitem>
+<para>A directory which contains backup timestamp and list of files backed up.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/etc/amanda/$config</option></term>
+  <listitem>
+<para>&A; configuration files location for $config(e.g: DailySet1).</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/etc/amanda/template.d</option></term>
+  <listitem>
+<para>A directory contains dumptypes and tapetypes files used by all &A; configurations.</para>
+  </listitem>
+  </varlistentry>
+
+
+ <varlistentry>
+ <term><option>/etc/amandates</option></term>
+  <listitem>
+<para>&A; file on the client. It keeps track of structures of previous dumps.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/tmp/amanda</option></term>
+  <listitem>
+<para>directory contains &A; debug log files.</para>
+  </listitem>
+  </varlistentry>
+
+</variablelist>
+</refsect1>        
+
+<refsect1><title>RETURN VALUE</title>
+On success, zero is returned.  On error, 1 is returned.
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+  <para>
+    The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). 
+  </para>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amserverconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+<citerefentry><refentrytitle>ssh-keygen</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+<citerefentry><refentrytitle>ssh-add</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+<citerefentry><refentrytitle>scp</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
+</refsect1>
+</refentry>
+
index b66f5af5735e13520f3e711f382af1a2631a485b..19002d2b3c7f7590c3439d1e130f2c27ab9ee2a5 100644 (file)
@@ -176,12 +176,22 @@ The default sort order is <emphasis remap='B'>hkdlpb</emphasis>.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><emphasis remap='B'>holding list</emphasis> [-l] [ <emphasis remap="I">hostname</emphasis> [ <emphasis remap="I">disk</emphasis> [ <emphasis remap="I">datestamp</emphasis> [ .. ] ] ] ]</term>
+  <term><emphasis remap='B'>holding list</emphasis> [-l] [-d] [ <emphasis remap="I">hostname</emphasis> [ <emphasis remap="I">disk</emphasis> [ <emphasis remap="I">datestamp</emphasis> [ .. ] ] ] ]</term>
   <listitem>
 
     <para>List holding files matching the given specification, or all holding
     files if no specification is provided.  With '-l', additional information
-    (size and level) is provided.</para>
+    (size, level, and whether the dump is outdated) is provided.  With '-d', only
+    outdated dumps are shown.</para>
+
+    <para>An outdated holding file is one which is not required for a
+    restore of the <emphasis>most recent</emphasis> dump.  Note that
+    outdated dumps may still be required for restores at earlier dates.
+    For example, assume that a DLE had a level 0 on Monday, level
+    1's Tuesday through Thursday, and a level 2 on Friday.  Then the
+    files required for a restore of Fridays (the most recent) dump
+    are those from Monday (level 0), Thursday (level 1), and Friday
+    (level 2).  Tuesday and Wednesday's files are outdated. </para>
 
   </listitem>
   </varlistentry>
@@ -429,6 +439,8 @@ TOTAL      241  12412187   7316312   731631  (estimated 8 runs per dumpcycle)
 <citerefentry><refentrytitle>amcheck</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
index 660f992a6a32f8d72eb934fa8e0bf6acd47e301f..ba1fadae53ac6eaa307440b309e6ce4381b9ed8b 100755 (executable)
@@ -45,7 +45,8 @@ the encrypted image.</para>
 <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
 </para>
 </refsect1>
 </refentry>
index 2cf5f381f3588b6f567fd39663591f7089872261..5ec5de6a75c862b615ff377f5ed730fa99b14c75 100644 (file)
@@ -196,6 +196,8 @@ tcp connection for all data stream.</para>
 authorization.</para>
 <para><emphasis remap='B'>krb5</emphasis> to use Kerberos-V
 authorization.</para>
+<para><emphasis remap='B'>local</emphasis>, if the client is the server, it 
+doesn't require authencation setup.</para>
 <para><emphasis remap='B'>rsh</emphasis> to use rsh
 authorization.</para>
 <para><emphasis remap='B'>ssh</emphasis> to use OpenSSH
@@ -390,6 +392,7 @@ Unreserved tcp port that will be used (bsd, bsdudp)</para>
 <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
 </para>
 </refsect1>
 </refentry>
index e65d913aaa7b78b9b46ba3c4edf8165c1ceef89d..677d3d8e92a15d6b8e6ad8c4d3e7d499f16d7c12 100644 (file)
 </cmdsynopsis>
 
 <cmdsynopsis>
-    <command>amverify</command>
+    <command>amcheckdump</command>
+    <arg choice='opt'><replaceable>options</replaceable></arg>
     <arg choice='plain'><replaceable>config</replaceable></arg>
     <sbr/>
 </cmdsynopsis>
 
 <cmdsynopsis>
-  <command>amverifyrun</command>    
+    <command>amserverconfig</command>
+    <arg choice='opt'><replaceable>options</replaceable></arg>
     <arg choice='plain'><replaceable>config</replaceable></arg>
+    <sbr/>
 </cmdsynopsis>
 
+<cmdsynopsis>
+    <command>amaddclient</command>
+    <arg choice='plain'><replaceable>config</replaceable></arg>
+    <arg choice='opt'><replaceable>options</replaceable></arg>
+    <sbr/>
+</cmdsynopsis>
 </refsynopsisdiv>
 
 
@@ -320,9 +329,21 @@ ejecting tapes and scanning the tape storage slots.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>amverify</emphasis></term>
+  <term><emphasis remap='B'>amcheckdump</emphasis></term>
+  <listitem>
+<para>Check the results of an &A; dump.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'>amserverconfig</emphasis></term>
   <listitem>
-<para>Check &A; backup tapes for errors.</para>
+<para>Program to setup initial &A; configuration.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'>amaddclient</emphasis></term>
+  <listitem>
+<para>Program to add client to an existing &A; configuration.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -1221,14 +1242,38 @@ escaped within any component by preceding them with a '\'.</para>
 </refsect1>
 
 <refsect1><title>CONFIGURATION OVERRIDE</title>
-<para>Most command allow to overwrite any configuration parameter on
-the command line with the -o option.</para>
-<para>-o NAME=value</para>
-<para>eg. -o runtapes=2</para>
-<para>eg. -o DUMPTYPE:no-compress:compress="server fast"</para>
-<para>eg. -o TAPETYPE:HP-DAT:length=2000m</para>
-<para>eg. -o INTERFACE:local:use="2000 kbps"</para>
+<para>Most commands allow the override of specific
+configuration options on the command line, using the <arg
+choice="plain">-o</arg> option.  This option has the form <arg
+choice="plain">-o</arg><replaceable>name</replaceable>=<replaceable>value</replaceable>.
+An optional space is allowed after the <arg choice="plain">-o</arg>.
+Each configuration option should be specified in a separate
+command-line option.</para>
+
+<para>For global options, <replaceable>name</replaceable> is simply the name of the option, e.g.,
+<programlisting>
+amdump -oruntapes=2
+</programlisting>
+For options in a named section of the configuration, <replaceable>name</replaceable> has the
+form <replaceable>SECTION</replaceable>:<replaceable>section_name</replaceable>:<replaceable>name</replaceable>,
+where <replaceable>SECTION</replaceable> is one of TAPETYPE, DUMPTYPE, HOLDINGDISK, or INTERFACE, and
+<replaceable>section_name</replaceable> is the name of the tapetype, dumptype, holdingdisk, or interface.
+Examples:
+<programlisting>
+amdump -o TAPETYPE:HP-DAT:length=2000m
+amdump -o DUMPTYPE:no-compress:compress="server fast"
+amdump -o HOLDINGDISK:hd1:use="-100 mb"
+amdump -o INTERFACE:local:use="2000 kbps"
+</programlisting>
+</para>
 
+<para>Note that configuration overrides are not effective for tape
+changers, which supply a tapedev based on their own configuration.  In order to
+override <emphasis remap="I">tapedev</emphasis>, you must also disable any changer:
+<programlisting>
+amdump -otapedev=/dev/nst1 -otpchanger=''
+</programlisting>
+</para>
 
 </refsect1>
 
@@ -1262,8 +1307,10 @@ the command line with the -o option.</para>
 <citerefentry><refentrytitle>amtape</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amtapetype</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amtoc</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amverify</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amverifyrun</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amcheckdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amserverconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amaddclient</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry></para>
 </refsect1>
 </refentry>
 
index 027a4ab18c0ff4647e7e80391137906154b171e6..f322c1ff3b3bfa604b45a1957632ec5e3bcec823 100644 (file)
@@ -232,15 +232,10 @@ with damaged or misplaced tapes or schedule adjustments that call for slight adj
   <term><emphasis remap='B'>usetimestamps</emphasis>
        <emphasis remap='I'> bool</emphasis></term>
     <listitem>
-      <para>Default: <emphasis remap='B'>No</emphasis>.
-By default, Amanda can only track at most one run per calendar day. When
-this option is enabled, however, Amanda can track as many runs as you care
-to make.
-      </para>
-      <para>
-<emphasis remap='B'>WARNING</emphasis>: This option is not backward-compatible.
-Do not enable it if you intend to downgrade your server installation to
-Amanda community edition 2.5.0
+      <para>Default: <emphasis remap='B'>Yes</emphasis>.
+This option allows Amanda to track multiple runs per calendar
+day. The only reason one might disable it is that Amanda versions before 2.5.1
+can't read logfiles written when this option was enabled.
       </para>
     </listitem>
   </varlistentry>
@@ -288,6 +283,7 @@ See the
 option.</para>
   </listitem>
   </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>tapedev</emphasis> string</term>
   <listitem>
@@ -323,15 +319,27 @@ option set to
   </varlistentry>
 
   <varlistentry>
-  <term><emphasis remap='B'>rawtapedev</emphasis> string</term>
+  <term><emphasis remap='B'>device_property</emphasis> string string</term>
   <listitem>
-<para>Default:
-<filename>null:</filename>.
-The path name of the raw tape device.
-This is only used if &A; is compiled for Linux machines with floppy tapes
-and is needed for QIC volume table operations.</para>
+<para>These options can set various device properties, including block size,
+maximum volume usage, authentication information, hardware feature support,
+and more.Specifics of how properties are used are device-dependent, though
+some common properties are supported across multiple device drivers.</para>
+
+<para> Both strings are quoted; the first string contains the name of
+the property to set, and the second contains its value. For example, to set
+a fixed block size of 128k, do:</para><programlisting>device_property "BLOCK_SIZE" "131072"</programlisting>
+<para></para>
+<para>The order in which device properties are set is as follows:
+<orderedlist><listitem><para>Tapetype parameters, including length, blocksize,
+readblocksize, file-pad, are translated into device properties and set
+accordingly.</para></listitem>
+<listitem><para>Device properties from any device_property configuration directives
+are set, in the order they appear in the configuration file.</para></listitem>
+</orderedlist></para>
   </listitem>
   </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>tpchanger</emphasis> string</term>
   <listitem>
@@ -507,15 +515,14 @@ will wait before it fails with a data timeout error.</para>
   <listitem>
 <para>Default:
 <emphasis remap='I'>300 seconds</emphasis>.
-Amount of time per disk on a given client that the
-<emphasis remap='B'>planner</emphasis>
-step of
-<command>amdump</command>
-will wait to get the dump size estimates.
-For instance, with the default of 300 seconds and four disks on client A, 
-<emphasis remap='B'>planner</emphasis>
-will wait up to 20 minutes for that machine.
-A negative value will be interpreted as a total amount of time to wait
+Amount of time per estimate on a given client that the
+<emphasis remap='B'>planner</emphasis> step of
+<command>amdump</command> will wait to get the dump size estimates
+(note: Amanda runs up to 3 estimates for each DLE).  For instance,
+with the default of 300 seconds and four DLE's, each estimating level
+0 and level 1 on client A, <emphasis remap='B'>planner</emphasis>
+will wait up to 40 minutes for that machine.  A negative value will
+be interpreted as a total amount of time to wait
 per client instead of per disk.</para>
   </listitem>
   </varlistentry>
@@ -542,7 +549,7 @@ How many times the server will resend a REQ packet if it doesn't get the ACK pac
   <term><emphasis remap='B'>netusage</emphasis> int</term>
   <listitem>
 <para>Default:
-<emphasis remap='I'>300 Kbps</emphasis>.
+<emphasis remap='I'>8000 Kbps</emphasis>.
 The maximum network bandwidth allocated to &A;, in Kbytes per second.
 See also the
 <emphasis remap='B'>interface</emphasis>
@@ -764,6 +771,17 @@ The file name for the active
 <emphasis remap='I'>tapelist</emphasis>
 file.
 &A; maintains this file with information about the active set of tapes.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'>device_output_buffer_size</emphasis> <emphasis remap='I'> int</emphasis></term>
+  <listitem>
+<para>Default:
+<literal>640k</literal>.
+Controls the amount of memory used by &A;
+to hold data as it is read from the network or disk before it is written to
+the output device. Higher values may be
+useful on fast tape drives and optical media.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -771,14 +789,11 @@ file.
   <listitem>
 <para>Default:
 <literal>20</literal>.
-The number of buffers used by the
-<emphasis remap='B'>taper</emphasis>
-process run by
-<command>amdump</command>
-and
-<emphasis remap='B'>amflush</emphasis>
-to hold data as it is read from the network or disk before it is written to tape.
-Each buffer is a little larger than 32 KBytes and is held in a shared memory region.</para>
+This option is deprecated; use
+the <emphasis remap='B'>device_output_buffer_size</emphasis> directive
+instead. <emphasis remap='B'>tapebufs</emphasis> works the same way,
+but the number specified is multiplied by the device blocksize prior
+to use.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -883,7 +898,9 @@ with one space before it.</para>
 <para>Default:
 <emphasis remap='I'>none</emphasis>.
 The name of an &A; configuration file to include within the current file.
-Useful for sharing dumptypes, tapetypes and interface definitions among several configurations.</para>
+Useful for sharing dumptypes, tapetypes and interface definitions among several configurations.
+Relative pathnames are relative to the configuration directory.
+</para>
   </listitem>
   </varlistentry>
 
@@ -968,12 +985,94 @@ Debug level of the taper process</para>
   </listitem>
   </varlistentry>
 
+  <varlistentry>
+  <term><emphasis remap='B'>flush-threshold-dumped</emphasis> int</term>
+  <listitem>
+<para>Default: <emphasis remap='I'>0</emphasis>.
+  &A; will not begin writing data to a new volume until the amount of
+  data on the holding disk is at least this percentage of the volume
+  size. In other words, &A; will not begin until the
+  inequality <inlineequation><mathphrase>h &lt; t &#215;
+  d</mathphrase></inlineequation> is satisfied,
+  where <mathphrase>h</mathphrase> is the amount of data on the
+  holding disk, <mathphrase>t</mathphrase> is the capacity of a
+  volume, and <mathphrase>d</mathphrase> is this parameter, expressed as a
+  percentage.</para>
+<para> Needless to say, your holding disk must be big enough
+  that this criterion could be satisfied. If the holding disk cannot
+  be used for a particular dump (because, for example, there is no
+  remaining holding space) then &A; will disregard the constraint
+  specified by this setting and start a new volume anyway. Once
+  writing to a volume has begun, this constraint is not applied unless
+  and until a new volume is needed.</para>
+<para> The value of this parameter may not exceed than that of
+  the <emphasis remap='B'>flush-threshold-scheduled</emphasis>
+  parameter.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>flush-threshold-scheduled</emphasis> int</term>
+  <listitem>
+<para>Default: <emphasis remap='I'>0</emphasis>.
+  &A; will not begin writing data to a new volume until the sum of the
+  amount of data on the holding disk and the estimated amount of data
+  remaining to be dumped during this run is at least this percentage
+  of the volume size. In other words, &A; will not begin until the
+  inequality <inlineequation><mathphrase>h + s &lt; t &#215;
+  d</mathphrase></inlineequation> is satisfied,
+  where <mathphrase>h</mathphrase> is the amount of data on the
+  holding disk, <mathphrase>s</mathphrase> is the total amount of
+  data scheduled for this run but not dumped
+  yet, <mathphrase>t</mathphrase> is the capacity of a volume,
+  and <mathphrase>d</mathphrase> is this parameter, expressed as a
+  percentage.</para>
+<para>  Needless to say, your holding disk must be big enough
+  that this criterion could be satisfied. If the holding disk cannot
+  be used for a particular dump (because, for example, there is no
+  remaining holding space) then &A; will disregard the constraint
+  specified by this setting and start a new volume anyway.  Once
+  writing to a volume has begun, this constraint is not applied unless
+  and until a new volume is needed.</para>
+<para> The value of this parameter may not be less than that of
+  the <emphasis remap='B'>flush-threshold-dumped</emphasis>
+  or <emphasis remap='B'>taperflush</emphasis> parameters.</para>
+  </listitem>
+  </varlistentry>
+
+<!-- the entity '#215' below is U+00D7 MULTIPLICATION SIGN; the 'times' entity
+     is not as portable as one might hope. -->
+  <varlistentry>
+  <term><emphasis remap='B'>taperflush</emphasis> int</term>
+  <listitem>
+<para>Default: <emphasis remap='I'>0</emphasis>.
+  At the end of a run, &A; will start a new tape to flush remaining
+  data if there is more data on the holding disk at the end of a run
+  than this setting allows; the amount is specified as a percentage of
+  the capacity of a single
+  volume. In other words, at the end of a run, &A; will begin
+  a new tape if the 
+  inequality <inlineequation><mathphrase>h &lt; t &#215;
+  f</mathphrase></inlineequation> is satisfied,
+  where <mathphrase>h</mathphrase> is the amount of data remaining on the
+  holding disk from this or previous runs, <mathphrase>t</mathphrase>
+  is the capacity of a volume,
+  and <mathphrase>f</mathphrase> is this parameter, expressed as a
+  percentage.</para>
+<para> The value of this parameter may not exceed that of
+  the <emphasis remap='B'>flush-threshold-scheduled</emphasis>
+  parameter.; <emphasis remap='B'>autoflush</emphasis> must be set to 'yes' if
+ <emphasis remap='B'>taperflush</emphasis> is greater than 0.</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>reserved-udp-port</emphasis> int,int</term>
   <listitem>
 <para>Default: --with-udpportrange or 
 <emphasis remap='I'>512,1023</emphasis>.
-Reserved udp port that will be used (bsd, bsdudp)</para>
+Reserved udp port that will be used (bsd, bsdudp).
+Range is inclusive.</para>
   </listitem>
   </varlistentry>
 
@@ -982,7 +1081,8 @@ Reserved udp port that will be used (bsd, bsdudp)</para>
   <listitem>
 <para>Default: --with-low-tcpportrange or 
 <emphasis remap='I'>512,1023</emphasis>.
-Reserved tcp port that will be used (bsdtcp)</para>
+Reserved tcp port that will be used (bsdtcp).
+Range is inclusive.</para>
   </listitem>
   </varlistentry>
 
@@ -990,8 +1090,9 @@ Reserved tcp port that will be used (bsdtcp)</para>
   <term><emphasis remap='B'>unreserved-tcp-port</emphasis> int,int</term>
   <listitem>
 <para>Default: --with-tcpportrange or 
-<emphasis remap='I'>1025,65536</emphasis>.
-Unreserved tcp port that will be used (bsd, bsdudp)</para>
+<emphasis remap='I'>1024,65535</emphasis>.
+Unreserved tcp port that will be used (bsd, bsdudp).
+Range is inclusive.</para>
   </listitem>
   </varlistentry>
 
@@ -1133,6 +1234,8 @@ tcp connection for all data stream.</para>
 authorization.</para>
 <para><emphasis remap='B'>krb5</emphasis> to use Kerberos-V
 authorization.</para>
+<para><emphasis remap='B'>local</emphasis>, if the client is the server, it 
+doesn't require authencation setup.</para>
 <para><emphasis remap='B'>rsh</emphasis> to use rsh
 authorization.</para>
 <para><emphasis remap='B'>ssh</emphasis> to use OpenSSH
@@ -2003,7 +2106,7 @@ A comment string describing this set of network information.</para>
   <term><emphasis remap='B'>use</emphasis> <emphasis remap='I'> int</emphasis></term>
   <listitem>
 <para>Default:
-<emphasis remap='I'>300 Kbps</emphasis>.
+<emphasis remap='I'>8000 Kbps</emphasis>.
 The speed of the interface in Kbytes per second.</para>
   </listitem>
   </varlistentry>
@@ -2029,6 +2132,11 @@ At the moment, this is of little use.</para>
 <citerefentry><refentrytitle>amanda-client.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
+
+<para>
+An updated version of this man page may be available at http://wiki.zmanda.com/index.php/Amanda.conf.
 </para>
 </refsect1>
 </refentry>
index 4001dfe5e53d493322001d242b2dbd939d213fef..a34e096f1db3e0504384f5a303daa8abdeca3cf4 100644 (file)
@@ -869,7 +869,9 @@ was reported by the status check on
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index a59a182a72dc513410111a9e7dd0c919b35a2657..b22ea3ee88d575211e31fcd13789982b71cfddde 100644 (file)
@@ -68,7 +68,9 @@ Ready.
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amrmtape</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
diff --git a/man/xml-source/amcheckdump.8.xml b/man/xml-source/amcheckdump.8.xml
new file mode 100644 (file)
index 0000000..48f091f
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amcheckdump.8'>
+<refmeta>
+<refentrytitle>amcheckdump</refentrytitle>
+<manvolnum>8</manvolnum>
+</refmeta>
+<refnamediv>
+<refname>amcheckdump</refname>
+<refpurpose>check the results of an &A; dump</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amcheckdump</command>    
+    <arg choice='plain'><replaceable>config</replaceable></arg>
+    <arg choice='opt'>--timestamp|-t <replaceable>timestamp</replaceable></arg>
+    <arg choice='plain' rep='repeat'><group><arg choice='plain'>-o </arg><replaceable>configoption</replaceable></group></arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+
+<para><emphasis remap='B'>Amcheckdump</emphasis> verifies &A; dump images by
+reading them from storage volume(s) and verifying that the images can be parsed
+by the appropriate application (if available).  For example, a GNUTAR
+image is passed to GNU Tar for parsing, and any errors
+(e.g., corrupt or missing data) are noted.</para>
+
+<para>The application runs on the most recent dump or, if <emphasis
+remap='I'>--timestamp</emphasis> is specified, on the most recent dump with
+that timestamp.  Note that the verification is local to the &A; server; if the
+dump application is not available, or is configured differently on the server
+than on the client, then the verification will most likely fail.</para>
+
+<para>If a changer is available, it is used to load the required
+tapes.  Otherwise, the application interactively requests the tapes.</para>
+
+<para>See the "<emphasis
+remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in
+<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+for information on the <literal>-o</literal> option.</para>
+</refsect1>
+
+<refsect1><title>EXAMPLE</title>
+<para><programlisting>
+# check the most recent dump
+amcheckdump MYCONFIG
+
+# check a specific dump from back in '78
+amcheckdump MYCONFIG --timestamp 19780615
+</programlisting></para>
+</refsect1>
+ <refsect1><title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,  
+ <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>          
+ </para>
+ </refsect1>                                                                          
+</refentry>
index 4d235cf07caf6136edc0c7e9c369040646b2062b..1ef49c0cbbc9f2b11737fcdda65ada709c162fbd 100644 (file)
@@ -22,6 +22,8 @@
 <refsynopsisdiv>
 <cmdsynopsis>
   <command>amcleanup</command>    
+    <arg choice='opt'><option>-k</option></arg>
+    <arg choice='opt'><option>-v</option></arg>
     <arg choice='plain'><replaceable>config</replaceable></arg>
 </cmdsynopsis>
 </refsynopsisdiv>
@@ -53,6 +55,12 @@ man page for more details about &A;.</para>
    <para>Kill all Amanda processes.</para>
   </listitem>
   </varlistentry>
+  <varlistentry>
+  <term><option>-v</option></term>
+  <listitem>
+   <para>Generate verbose output.</para>
+  </listitem>
+  </varlistentry>
 </variablelist>
 </refsect1>
 
@@ -89,7 +97,9 @@ amcleanup: no unprocessed logfile to clean up.
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 736fcd6055fd6da8a9212d1906883bc2faf8ce1f..673cdb8fa17c620f427a98221258da69afc7b24e 100644 (file)
@@ -145,7 +145,8 @@ Writing RSA key
     <citerefentry>
       <refentrytitle>amcrypt-ossl</refentrytitle>
       <manvolnum>8</manvolnum>
-    </citerefentry>
+    </citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
   </para>
 </refsect1>
 
index c6ced9edb93edafc4e89dbd3fae555301c6243c6..9594999ddfac260496f4e4631d13c5e790a66901 100644 (file)
@@ -86,7 +86,8 @@
     <citerefentry>
       <refentrytitle>amcrypt-ossl-asym</refentrytitle>
       <manvolnum>8</manvolnum>
-    </citerefentry>
+    </citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
   </para>
 </refsect1>
 
index 6dc88e67af45f2d88eabdb6a6a0c14979495a9c8..26f745647c25e183e84b176664135d8e41eb5b9a 100755 (executable)
@@ -70,7 +70,8 @@ passphrase.</para>
 <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>aespipe</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amaespipe</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
 </para>
 </refsect1>
 </refentry>
diff --git a/man/xml-source/amcryptsimple.8.xml b/man/xml-source/amcryptsimple.8.xml
new file mode 100644 (file)
index 0000000..d45f111
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amcryptsimple.8'>
+<refmeta>
+<refentrytitle>amcryptsimple</refentrytitle>
+<manvolnum>8</manvolnum>
+</refmeta>
+<refnamediv>
+<refname>amcryptsimple</refname>
+<refpurpose>reference simple crypt program for &A; symmetric data encryption</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amcryptsimple</command>  to be called by &A; only 
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>&amcryptsimple;
+calls <emphasis remap='B'>gpg</emphasis> to perform symmetric data encryption
+on &A; backup.
+&amcryptsimple; will search for the gpg program in the following directories:
+/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin</para>
+<para>&amcryptsimple; uses one passphrase to encrypt the &A; data
+and uses the same passphrase to decrypt the &A; backup data. &amcryptsimple; uses
+AES256 as the symmetric cipher.</para> 
+</refsect1>
+
+
+<refsect1><title>How to Create Passphrase</title>
+
+Store  the  passphrase  inside the home-directory of the AMANDA-user($amanda_user) and protect it with proper permissions:
+
+   echo my_secret_passphrase > ~$amanda_user/.am_passphrase
+   chown $amanda_user:disk ~$amanda_user/.am_passphrase
+   chmod 700 ~$amanda_user/.am_passphrase
+</refsect1>
+
+<refsect1><title>NOTES</title>
+<para>Choose a good passphrase and protect it properly. Backup data can only be
+restored with the passphrase. There is no backdoor.</para>
+<para>If storing and securing passphrase in your environment presents challenges,
+&A; provide public-key data encryption through &amgpgcrypt;. Public-key
+encryption uses the public key to encrypt and uses the private key to decrypt.</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+  <para>
+    The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). 
+  </para>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amgpgcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
+</refsect1>
+</refentry>
+
index a75c45125bbbf4d099cba875dbae9eb653780e16..eb415463c7d614f0062708c8caf95dc16400675a 100644 (file)
@@ -147,7 +147,10 @@ Default is zero.</para>
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para>
+  <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
diff --git a/man/xml-source/amdevcheck.8.xml b/man/xml-source/amdevcheck.8.xml
new file mode 100644 (file)
index 0000000..c47ca58
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amdevcheck.8'>
+
+  <refmeta>
+    <refentrytitle>amdevcheck</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </refmeta>
+  <refnamediv>
+    <refname>amdevcheck</refname>
+    <refpurpose>Validate an &A; device and volume.</refpurpose>
+  </refnamediv>
+  <!-- body begins here -->
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>amdevcheck</command>
+      <arg choice='plain'><replaceable>config</replaceable></arg>
+      <group choice='opt'>
+        <arg choice='plain'><replaceable>device name</replaceable></arg>
+      </group>
+      <arg choice='plain' rep='repeat'><group><arg choice='plain'>-o
+      </arg><replaceable>configoption</replaceable></group></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1><title>DESCRIPTION</title>
+    <para>
+      <emphasis remap='B'>Amdevcheck</emphasis> provides a way to check that a
+      particular &A; device is accessible, whether or not it contains a volume,
+      and whether or not that volume is labeled. Some devices can't distinguish
+      between all of these cases; a missing volume and an unlabeled volume might
+      generate the same error code, for example. In those cases, this tool
+      reports all possible causes of the error.
+    </para>
+    
+    <para>See the
+      <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+      man page for more details about &A;.
+      See the
+      <emphasis remap='B'>OUTPUT DRIVERS</emphasis>
+      section of
+      <emphasis remap='I'>amanda(8)</emphasis>
+      for more information on the &A; output drivers.
+  </para>
+  </refsect1>
+
+  <refsect1><title>OPTIONS</title>
+    <variablelist remap='TP'>
+      <varlistentry>
+        <term><replaceable>config</replaceable></term>
+        <listitem>
+          <para>
+            &A; configuration to use. Note that <command>amdevcheck</command>
+            ignores any tape changer configuration.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><replaceable> device</replaceable></term>
+        <listitem>
+          <para>
+            &A; device to use. This option overrides any tapedev configuration
+            specified in the configuration file.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><emphasis remap='B'>-o</emphasis> <replaceable>clientconfigoption</replaceable></term>
+        <listitem>
+          <para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
+            section in
+            <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+  <refsect1><title>AUTHOR</title>
+    <para>
+      Ian Turner <email>ian@zmanda.com</email> and others. Authorship of this
+      tool and its documentation was funded by Zmanda, Inc.
+    </para>
+  </refsect1>
+
+  <refsect1><title>SEE ALSO</title>
+    <para>
+      <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>ammt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+      <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+    </para>
+  </refsect1>
+</refentry>
index 740f58984fcfc1dd9ba414bd88176d424feb0491..2635c0656406c49705c7d1b7d029ff5718afb8e4 100644 (file)
@@ -129,12 +129,15 @@ and then rerun
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amcheck</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amcleanup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para>
+  <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amcheck</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amcleanup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 8e717222e7e9592a842c534ea11a8c003c91fb9e..e971eddfb354e8dbcd7a6d9ca37aafb4d97ff5d5 100644 (file)
@@ -24,7 +24,6 @@
     <arg choice='opt'>-pcClawns</arg>
     <arg choice='opt'>-d <replaceable>device</replaceable></arg>
     <arg choice='opt'>-O <replaceable>directory</replaceable></arg>
-    <arg choice='opt'>-i <replaceable>logfile</replaceable></arg>
     <arg choice='opt'>-b <replaceable>blocksize</replaceable></arg>
     <arg choice='plain'><replaceable>config</replaceable></arg>
     <arg choice='plain'><replaceable>hostname</replaceable></arg>
@@ -122,11 +121,6 @@ restoring.</para></listitem>
 <listitem><para>Assume that all tapes are already available, via tape changer or
 otherwise, instead of prompting the operator to ensure that all tapes
 are loaded.</para></listitem>
-  </varlistentry>
-  <varlistentry>
-    <term><option>-i</option> <replaceable>filename</replaceable></term>
-<listitem><para>Generate an inventory of all dumps &quot;seen&quot; on the
-tapes we search, for later use as a log.</para></listitem>
   </varlistentry>
   <varlistentry>
     <term><option>-w</option></term>
@@ -196,26 +190,6 @@ automatically extract the dump.</para>
 $ amfetchdump -p SetA vanya /home 20051020 | gtar -xvpf -
 </literallayout> <!-- .fi -->
 
-<para>In a situation where all of our dump logs have been wiped out,
-we could also use amfetchdump to inventory our tapes and recreate an
-imitation of those logs, which we'll send to <emphasis
-remap="I">stdout</emphasis> for casual perusal.
-<!-- .RS -->
-<literallayout remap='.nf'>
-$ amfetchdump -i - SetA
-</literallayout> <!-- .fi -->
-</para>
-
-<para>Note that you can specify a restore while in inventory mode, and
-<command>amfetchdump</command> will continue searching for more dumps
-from this host even after successfully restoring a dump, inventorying
-all the while. If your backup searcher has been trashed, this is a
-handy way to recover what you have.
-<!-- .RS -->
-<literallayout remap='.nf'>
-$ amfetchdump -i /var/amanda/log SetA backupserver
-</literallayout> <!-- .fi -->
-</para>
 </refsect1>
 
 <refsect1><title>CAVEATS</title>
@@ -240,8 +214,10 @@ instead.</para>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index aaa9ed1e6a1e1fd2ef661e521ae25f0f1b4eb68c..e52dc96acce7034b3494408d44cc6a53ab7bd180 100644 (file)
@@ -177,8 +177,11 @@ You'll get mail when amflush is finished.
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para>
+  <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 17755986117355299c2bd0d9f8d00acef65beea9..d0e668bd28068afc2168b6cc2e3c8c0e79f944cf 100644 (file)
@@ -207,7 +207,10 @@ keyword).
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para>
+  <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
diff --git a/man/xml-source/amgpgcrypt.8.xml b/man/xml-source/amgpgcrypt.8.xml
new file mode 100644 (file)
index 0000000..e8ee04b
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amgpgcrypt.8'>
+<refmeta>
+<refentrytitle>amgpgcrypt</refentrytitle>
+<manvolnum>8</manvolnum>
+</refmeta>
+<refnamediv>
+<refname>amgpgcrypt</refname>
+<refpurpose>reference crypt program for &A; public-key data encryption</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amgpgcrypt</command>  to be called by &A; only 
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>&amgpgcrypt;
+calls <emphasis remap='B'>gpg</emphasis> to perform public-key data encryption
+on &A; backup.
+&amgpgcrypt; will search for the gpg program in the following directories:
+/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin</para>
+<para>&amgpgcrypt; sets GNUPGHOME to $AMANDA_HOME/.gnupg where gpg will look for the
+gpg keys.
+&amgpgcrypt; uses the public key to encrypt the &A; data
+and uses the private key to decrypt the &A; backup data. Thus, passphrase is only
+required at the time of data restore.</para> 
+</refsect1>
+
+
+<refsect1><title>Key and Passphrase</title>
+<para>&amgpgcrypt; uses the  private key to decrypt &A; backup data.</para>
+It is very important to store, manage and  protect the key and the passphrase
+properly. Encrypted backup data can <emphasis remap='B'>only</emphasis> be recovered with the correct key and
+passphrase.
+</refsect1>
+
+
+
+<refsect1><title>How to create encryption keys and Passphrase for amgpgcrypt</title>
+
+<para>Store the  passphrase that you used in following "gpg --gen-key" command  inside the home-directory of the AMANDA-user($amanda_user) and protect it with proper permissions:</para>
+   echo my_secret_passphrase > ~$amanda_user/.am_passphrase
+   chown $amanda_user:disk ~$amanda_user/.am_passphrase
+   chmod 700 ~$amanda_user/.am_passphrase
+<para> Run "gpg --gen-key". Below is an example:</para>
+<programlisting>
+$ gpg --gen-key
+gpg (GnuPG) 1.2.6; Copyright (C) 2004 Free Software Foundation, Inc.
+This program comes with ABSOLUTELY NO WARRANTY.
+This is free software, and you are welcome to redistribute it
+under certain conditions. See the file COPYING for details.
+
+Please select what kind of key you want:
+   (1) DSA and ElGamal (default)
+   (2) DSA (sign only)
+   (4) RSA (sign only)
+Your selection? 1
+DSA keypair will have 1024 bits.
+About to generate a new ELG-E keypair.
+              minimum keysize is  768 bits
+              default keysize is 1024 bits
+    highest suggested keysize is 2048 bits
+What keysize do you want? (1024)
+Requested keysize is 1024 bits
+Please specify how long the key should be valid.
+         0 = key does not expire
+      (n)  = key expires in n days
+      (n)w = key expires in n weeks
+      (n)m = key expires in n months
+      (n)y = key expires in n years
+Key is valid for? (0) 6m
+Key expires at Sun 06 Aug 2006 03:51:25 PM PDT
+Is this correct (y/n)? y
+
+You need a User-ID to identify your key; the software constructs the user id
+from Real Name, Comment and Email Address in this form:
+    "Heinrich Heine (Der Dichter) (heinrichh@duesseldorf.de)"
+
+Real name: amandabackup
+Email address:
+Comment: gpg keys for amandabackup
+You selected this USER-ID:
+    "amandabackup (gpg keys for amandabackup)"
+
+Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
+You need a Passphrase to protect your secret key.
+
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+We need to generate a lot of random bytes. It is a good idea to perform
+some other action (type on the keyboard, move the mouse, utilize the
+disks) during the prime generation; this gives the random number
+generator a better chance to gain enough entropy.
+
+public and secret key created and signed.
+key marked as ultimately trusted.
+
+pub  1024D/4417A8CB 2006-02-07 amandabackup (gpg keys for amandabackup)
+     Key fingerprint = 139C 6369 44FC 7F1A 655C  E5E9 7EAA 515A 4417 A8CB
+sub  1024g/8C3A6A78 2006-02-07 [expires: 2006-08-06]
+
+</programlisting>
+</refsect1>
+
+
+<refsect1><title>Files</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>$AMANDA_HOME/.gnupg/pubring.gpg</option></term>
+  <listitem>
+<para>The public key. &amgpgcrypt; encrypt data with this public key along with the
+cipher algorithm.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>$AMANDA_HOME/.gnupg/secring.gpg</option></term>
+  <listitem>
+<para>The private/secret key. It's only needed during amrecover/amrestore. Store
+and protect it properly during other time.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>$AMANDA_HOME/.am_passphrase</option></term>
+  <listitem>
+<para>The passphrase. It's only needed during amrecover/amrestore. Store
+and protect it properly during other time.</para>
+  </listitem>
+  </varlistentry>
+
+
+</variablelist>
+</refsect1>
+
+
+<refsect1><title>BUGS</title>
+<para>&A; has problem with gpg mdc(modification detection code) in the binary
+mode. &amgpgcrypt; calls gpg with mdc disabled</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+  <para>
+    The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). 
+  </para>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+  <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amcrypt</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>gpg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
+</refsect1>
+</refentry>
+
index c36ee0e65fe2a67ef10be8d5267f2a448d1edd1e..9c07fe7055307792325f76c58c6a753e0d24e6d3 100644 (file)
@@ -184,9 +184,11 @@ instead of a non-rewinding device name for
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 5604cc73c07a7451f77f7734cd3e72152f63e3c6..bf19fb60370868ba8b71cb96e5d1ebc43528c13f 100644 (file)
@@ -218,7 +218,9 @@ and may include:</para>
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index e2b7a92824fc409c8b067b6207e05e6f53e99cc4..adb5a6cf135d1bd6f3d87c5a3757a4155ae68f0b 100644 (file)
@@ -175,7 +175,9 @@ host2    /var                  1  1  0  1  1  1
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index f37a30e88d97f7c6b4073b1b23512ce9174d9c9f..1ee92fcede8920b7e1d0967cccf0b9dfa56fe441 100644 (file)
@@ -209,7 +209,9 @@ legitimate lines the program needs to be taught about.</para>
 <citerefentry><refentrytitle>gnuplot</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>compress</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index db25f8e882fd8d97f73822b6e636ded8c49606e0..2ce85ed3579d8daae2cfd8d9e842616b047b2ca9 100644 (file)
@@ -203,20 +203,11 @@ mount point instead of full pathnames.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>settape</emphasis> [[<emphasis remap='I'>server</emphasis>]:][<emphasis remap='I'>tapedev</emphasis>|<emphasis remap='I'>default</emphasis>]</term>
-  <listitem>
-<para>Specifies the host to use as the tape server, and which of its tape
-devices to use.
-If the server is omitted, but the colon is not, the
-server name reverts to the configure-time
-default.
-If the tape device is omitted, it remains unchanged.
-To use the default tape device selected by the tape server, the word
-<emphasis remap='I'>default</emphasis>
-must be specified.
-If no argument is specified, or the argument is an
-empty string, no changes occur, and the current settings are
-displayed.</para>
+  <term><emphasis remap='B'>setdevice</emphasis> [[-h <emphasis remap='I'>tape-server</emphasis>] <emphasis remap='I'>tapedev</emphasis>]</term>
+  <listitem>
+<para>Specifies the host to use as the tape server, and which of its tape devices to use.
+If the server is omitted, the server name reverts to the configure-time default.
+If the tape device is omitted, the default is used.</para>
 
 <para>If you want amrecover to use your changer, the 
 <emphasis remap='I'>tapedev</emphasis>
@@ -598,7 +589,9 @@ but will be overridden by the -t switch.
 <citerefentry><refentrytitle>amanda-client.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amfetchdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>readline</refentrytitle><manvolnum>3</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>readline</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 70f7474cb08f5fd4601bffb115cc47df0e7e5670..2b67d453c8a70e0c18908f0cc51d0b1ee3d9102e 100644 (file)
@@ -181,7 +181,9 @@ It may be used to make a hardcopy log of the tapes.</para>
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index a63412e326aadb05343cbade0d5bf108911e9b2b..edae0d291356b6d0e81741baf5c42cf7a96cb389 100644 (file)
@@ -341,8 +341,10 @@ College Park: Original text</para>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 8cedae2dbe34683a0bde79bf00c2404cf8fad448..ff7bb13e81c8d6770035b8d7816510fcc6a76035 100644 (file)
@@ -100,7 +100,9 @@ configuration.</para>
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+  <citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
diff --git a/man/xml-source/amserverconfig.8.xml b/man/xml-source/amserverconfig.8.xml
new file mode 100644 (file)
index 0000000..239143a
--- /dev/null
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+[
+  <!-- entities files to use -->
+  <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amserverconfig.8'>
+<refmeta>
+<refentrytitle>amserverconfig</refentrytitle>
+<manvolnum>8</manvolnum>
+</refmeta>
+<refnamediv>
+<refname>amserverconfig</refname>
+<refpurpose>program to setup initial &A; configuration</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amserverconfig</command>  
+<arg choice='plain'><replaceable>config</replaceable></arg>
+<arg choice='opt'>--template <replaceable>template</replaceable></arg>
+<arg choice='opt'>--no-vtape </arg>
+<arg choice='opt'>--tapetype <replaceable>tapetype</replaceable></arg>
+<arg choice='opt'>--tpchanger <replaceable>tpchanger</replaceable></arg>
+<arg choice='opt'>--tapedev <replaceable>tapedev</replaceable></arg>
+<arg choice='opt'>--changerfile <replaceable>changerfile</replaceable></arg>
+<arg choice='opt'>--changerdev <replaceable>changerdev</replaceable></arg>
+<arg choice='opt'>--labelstr <replaceable>labelstr</replaceable></arg>
+<arg choice='opt'>--mailto <replaceable>mailto</replaceable></arg>
+<arg choice='opt'>--dumpcycle <replaceable>dumpcycle</replaceable></arg>
+<arg choice='opt'>--runspercycle <replaceable>runspercycle</replaceable></arg>
+<arg choice='opt'>--runtapes <replaceable>runtapes</replaceable></arg>
+<arg choice='opt'>--tapecycle <replaceable>tapecycle</replaceable></arg>
+<arg choice='opt'>--help </arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>After Amanda rpms are successfully installed,
+         &amserverconfig; will setup initial &A; configuration files.
+It will create /var/lib/amanda/guntar-lists directory if one does
+         not exist.
+&amserverconfig; does not change existing &A; configurations.
+&amserverconfig; must be run by user amandabackup.
+</para> 
+</refsect1>
+
+
+<refsect1><title>Options</title>
+<para>Options may be abbreviated, as long as the abbreviation is not ambiguous. Option argument can either separated by '=' or a space.
+Example:  --templ=harddisk --tapedev /dev/nst0</para>
+
+<para>&amserverconfig; builds a new "config" &A; configuration. Customize the configuration with the options below.</para>
+
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><option>--template template</option></term>
+  <listitem>
+<para>build &A; configuration with pre-configured template files. Currently,
+                <emphasis remap='B'>harddisk</emphasis>, <emphasis
+               remap='B'>single-tape</emphasis>, <emphasis remap='B'>tape-changer</emphasis> and <emphasis remap='B'>S3</emphasis> 
+               are the valid inputs for this option. Pre-configured template files can be found in 
+               /var/lib/amanda/template.d. This option may be combined with other options.
+               </para>
+<para>If tape-changer is chosen for this option, program mtx is required. &amserverconfig; will
+search for mtx in the following directory: "/usr/sbin", "/usr/local/sbin",
+"/usr/local/bin", "/usr/bin", "/bin" and amandabackup's PATH.
+</para>
+<para>
+If harddisk is chosen and --no-vtape is not specified, &amserverconfig; will create and label virtual tape
+file://var/lib/amanda/vtapes/$config.
+</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--no-vtape</option></term>
+  <listitem>
+<para>Do not create virtual tapes in the harddisk template case. </para>
+  </listitem>
+  </varlistentry>
+
+
+  <varlistentry>
+  <term><option>--tapedev tapedev</option></term>
+  <listitem>
+<para>The path name of non-rewinding tape device. 
+default [file://var/lib/amanda/vtapes/$config]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--tpchanger tpchanger</option></term>
+  <listitem>
+<para>The name of the tape changer. default [chg-disk]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--changerdev changerdev</option></term>
+  <listitem>
+<para>A tape changer configuration parameter. default [/dev/null]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--changerfile changerfile</option></term>
+  <listitem>
+<para>A tape changer configuration parameter. default [/etc/amanda/$config/changer.conf]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--labelstr labelstr</option></term>
+  <listitem>
+<para>The tape label constraint regular expression. default [^$config-[0-9][0-9]*$]  </para>
+<para>If this option is used with --template=harddisk, only alphanumeric string
+is supported.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--tapetype tapetype</option></term>
+  <listitem>
+<para>The type of tape drive associated with tapedev or  tpchanger. default [HARDDISK]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--mailto mailto</option></term>
+  <listitem>
+<para> A space separated list of recipients for mail reports. default [amandabackup]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--dumpcycle dumpcycle</option></term>
+  <listitem>
+<para>The number of days in the backup cycle. default [1week]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--runspercycle runspercycle</option></term>
+  <listitem>
+<para>The number of days in the backup cycle. default [5]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--runtapes runtapes</option></term>
+  <listitem>
+<para>The maximum number of tapes used in a single run. default [1]  </para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--tapecycle tapecycle</option></term>
+  <listitem>
+<para>The size of tape rotation. default [25]  </para>
+  </listitem>
+  </varlistentry>
+
+
+  <varlistentry>
+  <term><option>--help</option></term>
+  <listitem>
+<para>Display usage. </para>
+  </listitem>
+  </varlistentry>
+
+</variablelist>
+</refsect1>
+
+<refsect1><title>Files</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>/var/lib/amanda/template.d</option></term>
+  <listitem>
+<para>Amanda configuration template files install location</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/var/lib/amanda</option></term>
+  <listitem>
+<para>amandabackup home directory</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/var/lib/amanda/gnutar-lists</option></term>
+  <listitem>
+<para>A directory which contains backup timestamp and list of files backed up.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/etc/amanda/$config</option></term>
+  <listitem>
+<para>&A; configuration files location for $config(e.g: DailySet1).</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/etc/amanda/template.d</option></term>
+  <listitem>
+<para>A directory contains dumptypes and tapetypes files used by all &A; configurations.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/etc/amandates</option></term>
+  <listitem>
+<para>&A; file on the client. It keeps track of structures of previous dumps.</para>
+  </listitem>
+  </varlistentry>
+
+ <varlistentry>
+ <term><option>/tmp/amanda</option></term>
+  <listitem>
+<para>directory contains &A; debug log files.</para>
+  </listitem>
+  </varlistentry>
+
+</variablelist>
+</refsect1>
+
+<refsect1><title>RETURN VALUE</title>
+On success, zero is returned.  On error, 1 is returned.
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+  <para>
+    The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). 
+  </para>
+</refsect1>
+
+
+<refsect1><title>SEE ALSO</title>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>amaddclient</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
+</refsect1>
+</refentry>
+
index 010f599e1207402f53af095cc06f3036b0913e36..ea2e2751572ae7d46e28dccd9194ff7179941189 100644 (file)
@@ -37,6 +37,7 @@
     <arg choice='opt'>--estimate </arg>
     <arg choice='opt'>--gestimate </arg>
     <arg choice='opt'>--stats </arg>
+    <arg choice='opt'>--locale-independent-date-format </arg>
 </cmdsynopsis>
 </refsynopsisdiv>
 
@@ -142,6 +143,12 @@ Works only during the estimate phase.</para>
 <para>Display statistics about active-time of taper and dumpers.</para>
   </listitem>
   </varlistentry>
+  <varlistentry>
+  <term><option>--locale-independent-date-format</option></term>
+  <listitem>
+<para>Output the date in a locale independent format. The format is the same executing: date +'%Y-%m-%d %H:%M:%S %Z'</para>
+  </listitem>
+  </varlistentry>
 </variablelist>
 </refsect1>
 
@@ -150,7 +157,9 @@ Works only during the estimate phase.</para>
 <citerefentry><refentrytitle>amcheck</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amdump</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amadmin</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 497c824f9558b7dc65b8d0609dcd44ce48a8c4b9..c6c2d6078c7f9cc318bc2e1cd8440e22533c4ca3 100644 (file)
@@ -223,7 +223,9 @@ commands to not eject the loaded tape if it is the one being requested.</para>
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 4ee4aa8caa27f5cda56df78c2476934312905a77..be32b25a55c9aa6a3ba8b2a68ca660276c44f02c 100644 (file)
@@ -150,7 +150,9 @@ now we just report it as zero.</para>
 </refsect1>
 
 <refsect1><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 66b319660f04611ed9413631b39152ef78c74221..b53ec9d92d22c229497fc3dfbab9286aa0c5de31 100644 (file)
@@ -159,7 +159,9 @@ after an
 <citerefentry><refentrytitle>amflush</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amgetconf</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 cron,
-perl</para>
+perl,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 
 <refsect1><title>AUTHOR</title>
index 5667381c91c2153fe67441ee7bc8dca3559c1c83..723ec48d7671fd21446d156be4296cfdb3730660 100644 (file)
@@ -82,7 +82,9 @@ man page for more details about Amanda.</para>
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amrestore</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
 <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amverifyrun</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amverifyrun</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 69d23caa46342203c0c8ecefe4aac73621d30115..cd87d3e1705c48334fb44c05654c7d2dedf5d3eb 100644 (file)
@@ -38,7 +38,9 @@ with these argument.</para>
 
 <refsect1><title>SEE ALSO</title>
 <para><citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-<citerefentry><refentrytitle>amverify</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
+<citerefentry><refentrytitle>amverify</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>http://wiki.zmanda.com</refentrytitle></citerefentry>
+</para>
 </refsect1>
 </refentry>
 
index 766afd299b9c2dfe2a29e5801e2fc2609100b0ec..8a0472d4b3af50c8ed01d3d4eaa9fd02008d8883 100644 (file)
@@ -1,10 +1,16 @@
 # Makefile for Amanda file recovery programs.
 
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
 
@@ -12,10 +18,6 @@ LIB_EXTENSION = la
 
 sbin_PROGRAMS =                amoldrecover
 
-if WANT_RUNTIME_PSEUDO_RELOC
-AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
-endif
-
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
 # libraries, and because of the way libtool sets up the command line, we
@@ -25,8 +27,8 @@ endif
 
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
-       ../client-src/libamclient.$(LIB_EXTENSION) \
        $(READLINE_LIBS) \
+       ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
 
@@ -42,27 +44,19 @@ AM_YFLAGS =         -d
 
 # so that uscan.c is never generated before uparse.h
 # otherwise we might have makedepend problems
-$(srcdir)/uscan.c: $(srcdir)/uparse.h
+uscan.c: uparse.h
 
-uscan.$(OBJEXT): $(srcdir)/uscan.c
+# these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS)
+# since we don't want warnings for generated code
+uscan.$(OBJEXT): uscan.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-uparse.$(OBJEXT): $(srcdir)/uparse.c
+uparse.$(OBJEXT): uparse.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-               echo chmod o-rwx $$pa; \
-               chmod o-rwx $$pa; \
-       done
-
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS)
 
 lint:
        @ f="$(amoldrecover_CSRC)";                                             \
@@ -71,7 +65,7 @@ lint:
        (cd ../server-src; make listlibsrc);                                    \
        f="$$f "`cat ../server-src/listlibsrc.output`;                          \
        echo $(LINT) $$f;                                                       \
-       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
+       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\
        if [ $$? -ne 0 ]; then                                                  \
            exit 1;                                                             \
        fi;                                                                     \
index 448a2062ccb46c0c1010376db8c5bbb6a44abe7b..98ba6ad41a7e3b1971a212e7235d520ea1015f0c 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda file recovery programs.
 
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,48 +77,119 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am uparse.c uparse.h \
+       uscan.c
 sbin_PROGRAMS = amoldrecover$(EXEEXT)
 subdir = oldrecover-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in uparse.c uparse.h uscan.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -98,40 +206,43 @@ amoldrecover_OBJECTS = $(am_amoldrecover_OBJECTS)
 amoldrecover_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 amoldrecover_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
+       $(am__DEPENDENCIES_1) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
-       $(am__DEPENDENCIES_1) ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+YLWRAP = $(top_srcdir)/config/ylwrap
 YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
-       $(AM_YFLAGS)
+LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
 SOURCES = $(amoldrecover_SOURCES)
 DIST_SOURCES = $(amoldrecover_SOURCES)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -139,14 +250,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -157,20 +273,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -184,60 +299,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -247,10 +471,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -261,24 +499,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -290,59 +562,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -351,34 +610,46 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
 LIB_EXTENSION = la
-@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -388,8 +659,8 @@ LIB_EXTENSION = la
 ###
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
-       ../client-src/libamclient.$(LIB_EXTENSION) \
        $(READLINE_LIBS) \
+       ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION)
 
@@ -400,11 +671,14 @@ amoldrecover_CSRC = amrecover.c                                   \
 amoldrecover_SOURCES = $(amoldrecover_CSRC)    uparse.y        uscan.l
 noinst_HEADERS = amrecover.h uparse.h
 AM_YFLAGS = -d
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS)
+
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .l .lo .o .obj .y
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -435,7 +709,7 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
@@ -464,11 +738,11 @@ clean-sbinPROGRAMS:
 uparse.h: uparse.c
        @if test ! -f $@; then \
          rm -f uparse.c; \
-         $(MAKE) uparse.c; \
+         $(MAKE) $(AM_MAKEFLAGS) uparse.c; \
        else :; fi
 amoldrecover$(EXEEXT): $(amoldrecover_OBJECTS) $(amoldrecover_DEPENDENCIES) 
        @rm -f amoldrecover$(EXEEXT)
-       $(LINK) $(amoldrecover_LDFLAGS) $(amoldrecover_OBJECTS) $(amoldrecover_LDADD) $(LIBS)
+       $(LINK) $(amoldrecover_OBJECTS) $(amoldrecover_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -485,51 +759,31 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uscan.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
 .l.c:
-       $(LEXCOMPILE) $<
-       sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
-       rm -f $(LEX_OUTPUT_ROOT).c
+       $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
 
 .y.c:
-       $(YACCCOMPILE) $<
-       if test -f y.tab.h; then \
-         to=`echo "$*_H" | sed \
-                -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
-                -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
-         sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
-            y.tab.h >$*.ht; \
-         rm -f y.tab.h; \
-         if cmp -s $*.ht $*.h; then \
-           rm -f $*.ht ;\
-         else \
-           mv $*.ht $*.h; \
-         fi; \
-       fi
-       if test -f y.output; then \
-         mv y.output $*.output; \
-       fi
-       sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
-       rm -f y.tab.c
+       $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -537,10 +791,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -590,22 +840,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -621,7 +870,7 @@ check: check-am
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
        for dir in "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -650,6 +899,8 @@ maintainer-clean-generic:
        -rm -f uparse.c
        -rm -f uparse.h
        -rm -f uscan.c
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
@@ -659,7 +910,7 @@ distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -672,15 +923,25 @@ info: info-am
 info-am:
 
 install-data-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
 install-exec-am: install-sbinPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -701,44 +962,95 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS
+uninstall-am: uninstall-sbinPROGRAMS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libtool clean-sbinPROGRAMS ctags distclean \
        distclean-compile distclean-generic distclean-libtool \
        distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-exec \
-       install-exec-am install-exec-hook install-info install-info-am \
-       install-man 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 uninstall uninstall-am uninstall-info-am \
+       install install-am install-data install-data-am \
+       install-data-hook install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook 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 uninstall uninstall-am \
        uninstall-sbinPROGRAMS
 
 
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
+
 # so that uscan.c is never generated before uparse.h
 # otherwise we might have makedepend problems
-$(srcdir)/uscan.c: $(srcdir)/uparse.h
+uscan.c: uparse.h
 
-uscan.$(OBJEXT): $(srcdir)/uscan.c
+# these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS)
+# since we don't want warnings for generated code
+uscan.$(OBJEXT): uscan.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-uparse.$(OBJEXT): $(srcdir)/uparse.c
+uparse.$(OBJEXT): uparse.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-               echo chmod o-rwx $$pa; \
-               chmod o-rwx $$pa; \
-       done
-
 lint:
        @ f="$(amoldrecover_CSRC)";                                             \
        (cd ../common-src; make listlibsrc);                                    \
@@ -746,7 +1058,7 @@ lint:
        (cd ../server-src; make listlibsrc);                                    \
        f="$$f "`cat ../server-src/listlibsrc.output`;                          \
        echo $(LINT) $$f;                                                       \
-       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
+       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\
        if [ $$? -ne 0 ]; then                                                  \
            exit 1;                                                             \
        fi;                                                                     \
index 6b4aaff95872146aaa8d5f06a2d68211ebae7452..43d839d96616b61a3ac08b9df29fd8988bd30c6a 100644 (file)
@@ -46,7 +46,7 @@ int grab_reply(int show);
 void sigint_handler(int signum);
 int main(int argc, char **argv);
 
-#define USAGE "Usage: amoldrecover [[-C] <config>] [-s <index-server>] [-t <tape-server>] [-d <tape-device>]\n"
+#define USAGE _("Usage: amoldrecover [[-C] <config>] [-s <index-server>] [-t <tape-server>] [-d <tape-device>]\n")
 
 char *config = NULL;
 char *server_name = NULL;
@@ -86,11 +86,11 @@ get_line(void)
                fputc('\n', stderr);
            }
            if(save_errno != 0) {
-               fprintf(stderr, "%s: Error reading line from server: %s\n",
+               g_fprintf(stderr, _("%s: Error reading line from server: %s\n"),
                                get_pname(),
                                strerror(save_errno));
            } else {
-               fprintf(stderr, "%s: Unexpected end of file, check amindexd*debug on server %s\n",
+               g_fprintf(stderr, _("%s: Unexpected end of file, check amindexd*debug on server %s\n"),
                        get_pname(),
                        server_name);
            }
@@ -295,7 +295,7 @@ guess_disk (
        /*NOTREACHED*/
     }
     cwd_length = strlen(cwd);
-    dbprintf(("guess_disk: " SSIZE_T_FMT ": \"%s\"\n", cwd_length, cwd));
+    dbprintf(_("guess_disk: %zu: \"%s\"\n"), cwd_length, cwd);
 
     if (open_fstab() == 0) {
        return -1;
@@ -305,11 +305,11 @@ guess_disk (
     while (get_fstab_nextentry(&fsent))
     {
        current_length = fsent.mntdir ? strlen(fsent.mntdir) : (size_t)0;
-       dbprintf(("guess_disk: " SSIZE_T_FMT ": " SSIZE_T_FMT": \"%s\": \"%s\"\n",
+       dbprintf(_("guess_disk: %zu: %zu: \"%s\": \"%s\"\n"),
                  longest_match,
                  current_length,
-                 fsent.mntdir ? fsent.mntdir : "(mntdir null)",
-                 fsent.fsname ? fsent.fsname : "(fsname null)"));
+                 fsent.mntdir ? fsent.mntdir : _("(mntdir null)"),
+                 fsent.fsname ? fsent.fsname : _("(fsname null)"));
        if ((current_length > longest_match)
            && (current_length <= cwd_length)
            && (strncmp(fsent.mntdir, cwd, current_length) == 0))
@@ -325,9 +325,9 @@ guess_disk (
                fsname = newstralloc(fsname,fsent.fsname+strlen(DEV_PREFIX));
            }
            local_disk = is_local_fstype(&fsent);
-           dbprintf(("guess_disk: local_disk = %d, fsname = \"%s\"\n",
+           dbprintf(_("guess_disk: local_disk = %d, fsname = \"%s\"\n"),
                      local_disk,
-                     fsname));
+                     fsname);
        }
     }
     close_fstab();
@@ -347,7 +347,7 @@ guess_disk (
     /* have mount point now */
     /* disk name may be specified by mount point (logical name) or
        device name, have to determine */
-    printf("Trying disk %s ...\n", *mpt_guess);
+    g_printf(_("Trying disk %s ...\n"), *mpt_guess);
     disk_try = stralloc2("DISK ", *mpt_guess);         /* try logical name */
     if (exchange(disk_try) == -1)
        exit(1);
@@ -358,7 +358,7 @@ guess_disk (
        amfree(fsname);
        return 1;
     }
-    printf("Trying disk %s ...\n", fsname);
+    g_printf(_("Trying disk %s ...\n"), fsname);
     disk_try = stralloc2("DISK ", fsname);             /* try device name */
     if (exchange(disk_try) == -1)
        exit(1);
@@ -409,7 +409,15 @@ main(
     char *service_name;
     char *line = NULL;
     struct tm *tm;
-    char *conffile;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -420,17 +428,9 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
 
-#ifndef IGNORE_UID_CHECK
-    if (geteuid() != 0) {
-       erroutput_type |= ERR_SYSLOG;
-       error("amrecover must be run by root");
-       /*NOTREACHED*/
-    }
-#endif
-
     localhost = alloc(MAX_HOSTNAME_LENGTH+1);
     if (gethostname(localhost, MAX_HOSTNAME_LENGTH) != 0) {
-       error("cannot determine local host name\n");
+       error(_("cannot determine local host name\n"));
        /*NOTREACHED*/
     }
     localhost[MAX_HOSTNAME_LENGTH] = '\0';
@@ -439,6 +439,8 @@ main(
 
     dbrename(config, DBG_SUBDIR_CLIENT);
 
+    check_running_as(RUNNING_AS_ROOT);
+
     amfree(server_name);
     server_name = getenv("AMANDA_SERVER");
     if(!server_name) server_name = DEFAULT_SERVER;
@@ -449,12 +451,7 @@ main(
     if(!tape_server_name) tape_server_name = DEFAULT_TAPE_SERVER;
     tape_server_name = stralloc(tape_server_name);
 
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    config_init(CONFIG_INIT_CLIENT, NULL);
 
     if (argc > 1 && argv[1][0] != '-')
     {
@@ -498,13 +495,13 @@ main(
 
            case 'U':
            case '?':
-               (void)printf(USAGE);
+               (void)g_printf(USAGE);
                return 0;
        }
     }
     if (optind != argc)
     {
-       (void)fprintf(stderr, USAGE);
+       (void)g_fprintf(stderr, USAGE);
        exit(1);
     }
 
@@ -521,16 +518,16 @@ main(
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
     if (sigaction(SIGINT, &act, &oact) != 0) {
-       error("error setting signal handler: %s", strerror(errno));
+       error(_("error setting signal handler: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     service_name = stralloc2("amandaidx", SERVICE_SUFFIX);
 
-    printf("AMRECOVER Version %s. Contacting server on %s ...\n",
+    g_printf(_("AMRECOVER Version %s. Contacting server on %s ...\n"),
           version(), server_name);  
     if ((sp = getservbyname(service_name, "tcp")) == NULL) {
-       error("%s/tcp unknown protocol", service_name);
+       error(_("%s/tcp unknown protocol"), service_name);
        /*NOTREACHED*/
     }
     amfree(service_name);
@@ -541,25 +538,15 @@ main(
                                             &my_port,
                                             0);
     if (server_socket < 0) {
-       error("cannot connect to %s: %s", server_name, strerror(errno));
+       error(_("cannot connect to %s: %s"), server_name, strerror(errno));
        /*NOTREACHED*/
     }
     if (my_port >= IPPORT_RESERVED) {
         aclose(server_socket);
-       error("did not get a reserved port: %d", my_port);
+       error(_("did not get a reserved port: %d"), my_port);
        /*NOTREACHED*/
     }
 
-#if 0
-    /*
-     * We may need root privilege again later for a reserved port to
-     * the tape server, so we will drop down now but might have to
-     * come back later.
-     */
-    setegid(getgid());
-    seteuid(getuid());
-#endif
-
     /* get server's banner */
     if (grab_reply(1) == -1) {
         aclose(server_socket);
@@ -611,9 +598,9 @@ main(
     if (tm)
        strftime(dump_date, sizeof(dump_date), "%Y-%m-%d", tm);
     else
-       error("BAD DATE");
+       error(_("BAD DATE"));
 
-    printf("Setting restore date to today (%s)\n", dump_date);
+    g_printf(_("Setting restore date to today (%s)\n"), dump_date);
     line = stralloc2("DATE ", dump_date);
     if (converse(line) == -1) {
         aclose(server_socket);
@@ -641,20 +628,20 @@ main(
            {
                case 1:
                    /* okay, got a guess. Set disk accordingly */
-                   printf("$CWD '%s' is on disk '%s' mounted at '%s'.\n",
+                   g_printf(_("$CWD '%s' is on disk '%s' mounted at '%s'.\n"),
                           cwd, dn_guess, mpt_guess);
                    set_disk(dn_guess, mpt_guess);
                    set_directory(cwd);
                    if (server_happy() && strcmp(cwd, mpt_guess) != 0)
-                       printf("WARNING: not on root of selected filesystem, check man-page!\n");
+                       g_printf(_("WARNING: not on root of selected filesystem, check man-page!\n"));
                    amfree(dn_guess);
                    amfree(mpt_guess);
                    break;
 
                case 0:
-                   printf("$CWD '%s' is on a network mounted disk\n",
+                   g_printf(_("$CWD '%s' is on a network mounted disk\n"),
                           cwd);
-                   printf("so you must 'sethost' to the server\n");
+                   g_printf(_("so you must 'sethost' to the server\n"));
                    /* fake an unhappy server */
                    server_line[0] = '5';
                    break;
@@ -662,7 +649,7 @@ main(
                case 2:
                case -1:
                default:
-                   printf("Use the setdisk command to choose dump disk to recover\n");
+                   g_printf(_("Use the setdisk command to choose dump disk to recover\n"));
                    /* fake an unhappy server */
                    server_line[0] = '5';
                    break;
@@ -698,7 +685,7 @@ get_security(void)
     struct passwd *pwptr;
 
     if((pwptr = getpwuid(getuid())) == NULL) {
-       error("can't get login name for my uid %ld", (long)getuid());
+       error(_("can't get login name for my uid %ld"), (long)getuid());
        /*NOTREACHED*/
     }
     return stralloc2("SECURITY USER ", pwptr->pw_name);
index 2a15332542467451758063af10b632186495c6ba..2cb4f0ab6f5195d1c0617b528f89016ac3c84f4e 100644 (file)
@@ -97,9 +97,8 @@ add_dir_list_item(
 {
     DIR_ITEM *next;
 
-    dbprintf(("add_dir_list_item: Adding \"%s\" \"%d\" \"%s\" \""
-             OFF_T_FMT "\" \"%s\"\n",
-             date, level, tape, (OFF_T_FMT_TYPE)fileno, path));
+    dbprintf(_("add_dir_list_item: Adding \"%s\" \"%d\" \"%s\" \"%lld\" \"%s\"\n"),
+             date, level, tape, (long long)fileno, path);
 
     next = (DIR_ITEM *)alloc(sizeof(DIR_ITEM));
     memset(next, 0, sizeof(DIR_ITEM));
@@ -143,7 +142,7 @@ suck_dir_list_from_server(void)
     int ch;
 
     if (disk_path == NULL) {
-       printf("Directory must be set before getting listing\n");
+       g_printf(_("Directory must be set before getting listing\n"));
        return;
     } else if(strcmp(disk_path, "/") == 0) {
        disk_path_slash = stralloc(disk_path);
@@ -169,7 +168,7 @@ suck_dir_list_from_server(void)
     {
        amfree(disk_path_slash);
        l = reply_line();
-       printf("%s\n", l);
+       g_printf("%s\n", l);
        return;
     }
     disk_path_slash_dot = stralloc2(disk_path_slash, ".");
@@ -195,7 +194,7 @@ suck_dir_list_from_server(void)
        l = reply_line();
        if (!server_happy())
        {
-           printf("%s\n", l);
+           g_printf("%s\n", l);
            continue;
        }
        s = l;
@@ -207,7 +206,7 @@ suck_dir_list_from_server(void)
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing date field";
+           err = _("bad reply: missing date field");
            continue;
        }
        date = s - 1;
@@ -216,14 +215,14 @@ suck_dir_list_from_server(void)
 
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           err = "bad reply: cannot parse level field";
+           err = _("bad reply: cannot parse level field");
            continue;
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing tape field";
+           err = _("bad reply: missing tape field");
            continue;
        }
        tape = s - 1;
@@ -233,10 +232,10 @@ suck_dir_list_from_server(void)
        *tape_undo = '\0';
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
-           OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+           long long fileno_ = (long long)0;
            skip_whitespace(s, ch);
-           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-               err = "bad reply: cannot parse fileno field";
+           if(ch == '\0' || sscanf(s - 1, "%lld", &fileno_) != 1) {
+               err = _("bad reply: cannot parse fileno field");
                continue;
            }
            fileno = (off_t)fileno_;
@@ -248,7 +247,7 @@ suck_dir_list_from_server(void)
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing directory field";
+           err = _("bad reply: missing directory field");
            continue;
        }
        qdir = s - 1;
@@ -289,7 +288,7 @@ list_directory(void)
     char *quoted;
 
     if (disk_path == NULL) {
-       printf("Must select a disk before listing files; use the setdisk command.\n");
+       g_printf(_("Must select a disk before listing files; use the setdisk command.\n"));
        return;
     }
 
@@ -304,7 +303,7 @@ list_directory(void)
     pager_command = stralloc2(pager, " ; /bin/cat > /dev/null");
     if ((fp = popen(pager_command, "w")) == NULL)
     {
-       printf("Warning - can't pipe through %s\n", pager);
+       g_printf(_("Warning - can't pipe through %s\n"), pager);
        fp = stdout;
     }
     amfree(pager_command);
@@ -313,7 +312,7 @@ list_directory(void)
        i++;                            /* so disk_path != "/" */
     for (item = get_dir_list(); item != NULL; item=get_next_dir_item(item)) {
        quoted = quote_string(item->path + i);
-       fprintf(fp, "%s %s\n", item->date, quoted);
+       g_fprintf(fp, "%s %s\n", item->date, quoted);
        amfree(quoted);
     }
     apclose(fp);
index a952ac0d0a9e2ea78f4531ca0d096115fcb350fb..61c9a6aa695e2e6aa2f33785560ea9496d08713b 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "amanda.h"
+#include "conffile.h"
 #include "version.h"
 #include "amrecover.h"
 #include "fileheader.h"
@@ -169,7 +170,7 @@ read_buffer(
         nfound = select(datafd+1, &readset, NULL, NULL, &timeout);
         if(nfound < 0 ) {
             /* Select returned an error. */
-           fprintf(stderr,"select error: %s\n", strerror(errno));
+           g_fprintf(stderr,_("select error: %s\n"), strerror(errno));
             size = -1;
            break;
         }
@@ -178,8 +179,8 @@ read_buffer(
             /* Select timed out. */
             if (timeout_s != 0)  {
                 /* Not polling: a real read timeout */
-                fprintf(stderr,"timeout waiting for restore\n");
-                fprintf(stderr,"increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n");
+                g_fprintf(stderr,_("timeout waiting for restore\n"));
+                g_fprintf(stderr,_("increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n"));
             }
             errno = ETIMEDOUT;
             size = -1;
@@ -196,7 +197,7 @@ read_buffer(
                continue;
            }
            if (errno != EPIPE) {
-               fprintf(stderr, "read_buffer: read error - %s",
+               g_fprintf(stderr, _("read_buffer: read error - %s"),
                    strerror(errno));
                break;
            }
@@ -345,8 +346,8 @@ clean_tape_list(
            }
 
            if (remove_fn2) {
-               dbprintf(("removing path %s, it is included in %s\n",
-                         fn2->path, fn1->path));
+               dbprintf(_("removing path %s, it is included in %s\n"),
+                         fn2->path, fn1->path);
                ofn2 = fn2;
                fn2 = fn2->next;
                amfree(ofn2->path);
@@ -360,8 +361,8 @@ clean_tape_list(
 
        if(remove_fn1 != 0) {
            /* fn2->path is always valid */
-           /*@i@*/ dbprintf(("removing path %s, it is included in %s\n",
-           /*@i@*/           fn1->path, fn2->path));
+           /*@i@*/ dbprintf(_("removing path %s, it is included in %s\n"),
+           /*@i@*/           fn1->path, fn2->path);
            ofn1 = fn1;
            fn1 = fn1->next;
            amfree(ofn1->path);
@@ -535,9 +536,9 @@ add_glob(
     char *uqglob = unquote_string(glob);
 
     regex = glob_to_regex(uqglob);
-    dbprintf(("add_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("add_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("%s is not a valid shell wildcard pattern: ", glob);
+       g_printf(_("%s is not a valid shell wildcard pattern: "), glob);
        puts(s);
     } else {
         /*
@@ -565,7 +566,7 @@ add_regex(
     char *uqregex = unquote_string(regex);
 
     if ((s = validate_regexp(uqregex)) != NULL) {
-       printf("%s is not a valid regular expression: ", regex);
+       g_printf(_("%s is not a valid regular expression: "), regex);
        puts(s);
     } else {
         add_file(uqregex, regex);
@@ -594,12 +595,12 @@ void add_file(
     int dir_entries;
 
     if (disk_path == NULL) {
-       printf("Must select directory before adding files\n");
+       g_printf(_("Must select directory before adding files\n"));
        return;
     }
     memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */
 
-    dbprintf(("add_file: Looking for \"%s\"\n", regex));
+    dbprintf(_("add_file: Looking for \"%s\"\n"), regex);
 
     if(strcmp(regex, "/[/]*$") == 0) { /* "/" behave like "." */
        regex = "\\.[/]*$";
@@ -630,8 +631,8 @@ void add_file(
 
     path_on_disk_slash = stralloc2(path_on_disk, "/");
 
-    dbprintf(("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
-             regex, path_on_disk));
+    dbprintf(_("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"),
+             regex, path_on_disk);
 
     found_one = 0;
     dir_entries = 0;
@@ -639,7 +640,7 @@ void add_file(
     {
        dir_entries++;
        quoted = quote_string(ditem->path);
-       dbprintf(("add_file: Pondering ditem->path=%s\n", quoted));
+       dbprintf(_("add_file: Pondering ditem->path=%s\n"), quoted);
        amfree(quoted);
        if (match(path_on_disk, ditem->path)
            || match(path_on_disk_slash, ditem->path))
@@ -652,7 +653,7 @@ void add_file(
                ditem_path = newstralloc(ditem_path, ditem->path);
                clean_pathname(ditem_path);
 
-               cmd = stralloc2("ORLD ", ditem_path);
+               cmd = newstralloc2(cmd, "ORLD ", ditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
                    amfree(ditem_path);
@@ -674,7 +675,7 @@ void add_file(
                    amfree(path_on_disk);
                    amfree(path_on_disk_slash);
                    l = reply_line();
-                   printf("%s\n", l);
+                   g_printf(_("%s\n"), l);
                    return;
                }
                dir_undo = NULL;
@@ -705,14 +706,14 @@ void add_file(
 
                    s = l;
                    if(strncmp_const_skip(l, "201-", s, ch) != 0) {
-                       err = "bad reply: not 201-";
+                       err = _("bad reply: not 201-");
                        continue;
                    }
 
                    ch = *s++;
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing date field";
+                       err = _("bad reply: missing date field");
                        continue;
                    }
                     fp = s-1;
@@ -723,14 +724,14 @@ void add_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0' || sscanf(s - 1, "%d", &lditem.level) != 1) {
-                       err = "bad reply: cannot parse level field";
+                       err = _("bad reply: cannot parse level field");
                        continue;
                    }
                    skip_integer(s, ch);
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing tape field";
+                       err = _("bad reply: missing tape field");
                        continue;
                    }
                     fp = s-1;
@@ -740,11 +741,11 @@ void add_file(
                     s[-1] = (char)ch;
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
-                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+                       long long fileno_ = (long long)0;
                        skip_whitespace(s, ch);
                        if(ch == '\0' ||
-                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-                           err = "bad reply: cannot parse fileno field";
+                          sscanf(s - 1, "%lld", &fileno_) != 1) {
+                           err = _("bad reply: cannot parse fileno field");
                            continue;
                        }
                        lditem.fileno = (off_t)fileno_;
@@ -753,7 +754,7 @@ void add_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing directory field";
+                       err = _("bad reply: missing directory field");
                        continue;
                    }
                    dir = s - 1;
@@ -764,16 +765,16 @@ void add_file(
 
                    switch(add_extract_item(&lditem)) {
                    case -1:
-                       printf("System error\n");
-                       dbprintf(("add_file: (Failed) System error\n"));
+                       g_printf(_("System error\n"));
+                       dbprintf(_("add_file: (Failed) System error\n"));
                        break;
 
                    case  0:
                        quoted = quote_string(lditem.path);
-                       printf("Added dir %s at date %s\n",
+                       g_printf(_("Added dir %s at date %s\n"),
                               quoted, lditem.date);
-                       dbprintf(("add_file: (Successful) Added dir %s at date %s\n",
-                                 quoted, lditem.date));
+                       dbprintf(_("add_file: (Successful) Added dir %s at date %s\n"),
+                                 quoted, lditem.date);
                        amfree(quoted);
                        added=1;
                        break;
@@ -791,8 +792,8 @@ void add_file(
                        puts(cmd);
                } else if(added == 0) {
                    quoted = quote_string(ditem_path);
-                   printf("dir %s already added\n", quoted);
-                   dbprintf(("add_file: dir %s already added\n", quoted));
+                   g_printf(_("dir %s already added\n"), quoted);
+                   dbprintf(_("add_file: dir %s already added\n"), quoted);
                    amfree(quoted);
                }
            }
@@ -800,21 +801,21 @@ void add_file(
            {
                switch(add_extract_item(ditem)) {
                case -1:
-                   printf("System error\n");
-                   dbprintf(("add_file: (Failed) System error\n"));
+                   g_printf(_("System error\n"));
+                   dbprintf(_("add_file: (Failed) System error\n"));
                    break;
 
                case  0:
                    quoted = quote_string(ditem->path);
-                   printf("Added file %s\n", quoted);
-                   dbprintf(("add_file: (Successful) Added %s\n", quoted));
+                   g_printf(_("Added file %s\n"), quoted);
+                   dbprintf(_("add_file: (Successful) Added %s\n"), quoted);
                    amfree(quoted);
                    break;
 
                case  1:
                    quoted = quote_string(ditem->path);
-                   printf("File %s already added\n", quoted);
-                   dbprintf(("add_file: file %s already added\n", quoted));
+                   g_printf(_("File %s already added\n"), quoted);
+                   dbprintf(_("add_file: file %s already added\n"), quoted);
                    amfree(quoted);
                    break;
                }
@@ -829,9 +830,9 @@ void add_file(
 
     if(! found_one) {
        quoted = quote_string(path);
-       printf("File %s doesn't exist in directory\n", quoted);
-       dbprintf(("add_file: (Failed) File %s doesn't exist in directory\n",
-                 quoted));
+       g_printf(_("File %s doesn't exist in directory\n"), quoted);
+       dbprintf(_("add_file: (Failed) File %s doesn't exist in directory\n"),
+                 quoted);
        amfree(quoted);
     }
 }
@@ -847,9 +848,9 @@ delete_glob(
     char *uqglob = unquote_string(glob);
 
     regex = glob_to_regex(uqglob);
-    dbprintf(("delete_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("delete_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
+       g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob);
        puts(s);
     } else {
         /*
@@ -877,7 +878,7 @@ delete_regex(
     char *uqregex = unquote_string(regex);
 
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", regex);
+       g_printf(_("\"%s\" is not a valid regular expression: "), regex);
        puts(s);
     } else {
        delete_file(uqregex, uqregex);
@@ -911,12 +912,12 @@ delete_file(
     char *quoted;
 
     if (disk_path == NULL) {
-       printf("Must select directory before deleting files\n");
+       g_printf(_("Must select directory before deleting files\n"));
        return;
     }
     memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */
 
-    dbprintf(("delete_file: Looking for \"%s\"\n", path));
+    dbprintf(_("delete_file: Looking for \"%s\"\n"), path);
 
     if (strcmp(regex, "[^/]*[/]*$") == 0) {
        /* Looking for * find everything but single . */
@@ -949,13 +950,13 @@ delete_file(
 
     path_on_disk_slash = stralloc2(path_on_disk, "/");
 
-    dbprintf(("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
-             regex, path_on_disk));
+    dbprintf(_("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"),
+             regex, path_on_disk);
     found_one = 0;
     for (ditem=get_dir_list(); ditem!=NULL; ditem=get_next_dir_item(ditem))
     {
        quoted = quote_string(ditem->path);
-       dbprintf(("delete_file: Pondering ditem->path=%s\n", quoted));
+       dbprintf(_("delete_file: Pondering ditem->path=%s\n"), quoted);
        amfree(quoted);
        if (match(path_on_disk, ditem->path)
            || match(path_on_disk_slash, ditem->path))
@@ -968,7 +969,7 @@ delete_file(
                ditem_path = newstralloc(ditem_path, ditem->path);
                clean_pathname(ditem_path);
 
-               cmd = stralloc2("ORLD ", ditem_path);
+               cmd = newstralloc2(cmd, "ORLD ", ditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
                    amfree(ditem_path);
@@ -990,7 +991,7 @@ delete_file(
                    amfree(path_on_disk);
                    amfree(path_on_disk_slash);
                    l = reply_line();
-                   printf("%s\n", l);
+                   g_printf("%s\n", l);
                    return;
                }
                deleted=0;
@@ -1023,14 +1024,14 @@ delete_file(
 
                    s = l;
                    if(strncmp_const_skip(l, "201-", s, ch) != 0) {
-                       err = "bad reply: not 201-";
+                       err = _("bad reply: not 201-");
                        continue;
                    }
                    ch = *s++;
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing date field";
+                       err = _("bad reply: missing date field");
                        continue;
                    }
                    date = s - 1;
@@ -1039,14 +1040,14 @@ delete_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-                       err = "bad reply: cannot parse level field";
+                       err = _("bad reply: cannot parse level field");
                        continue;
                    }
                    skip_integer(s, ch);
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing tape field";
+                       err = _("bad reply: missing tape field");
                        continue;
                    }
                    tape = s - 1;
@@ -1056,11 +1057,11 @@ delete_file(
                    *tape_undo = '\0';
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
-                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+                       long long fileno_ = (long long)0;
                        skip_whitespace(s, ch);
                        if(ch == '\0' ||
-                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-                           err = "bad reply: cannot parse fileno field";
+                          sscanf(s - 1, "%lld", &fileno_) != 1) {
+                           err = _("bad reply: cannot parse fileno field");
                            continue;
                        }
                        fileno = (off_t)fileno_;
@@ -1069,7 +1070,7 @@ delete_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing directory field";
+                       err = _("bad reply: missing directory field");
                        continue;
                    }
                    skip_non_whitespace(s, ch);
@@ -1082,13 +1083,13 @@ delete_file(
                     lditem.tape = newstralloc(lditem.tape, tape);
                    switch(delete_extract_item(&lditem)) {
                    case -1:
-                       printf("System error\n");
-                       dbprintf(("delete_file: (Failed) System error\n"));
+                       g_printf(_("System error\n"));
+                       dbprintf(_("delete_file: (Failed) System error\n"));
                        break;
                    case  0:
-                       printf("Deleted dir %s at date %s\n", ditem_path, date);
-                       dbprintf(("delete_file: (Successful) Deleted dir %s at date %s\n",
-                                 ditem_path, date));
+                       g_printf(_("Deleted dir %s at date %s\n"), ditem_path, date);
+                       dbprintf(_("delete_file: (Successful) Deleted dir %s at date %s\n"),
+                                 ditem_path, date);
                        deleted=1;
                        break;
                    case  1:
@@ -1103,29 +1104,29 @@ delete_file(
                    if (cmd)
                        puts(cmd);
                } else if(deleted == 0) {
-                   printf("Warning - dir '%s' not on tape list\n",
+                   g_printf(_("Warning - dir '%s' not on tape list\n"),
                           ditem_path);
-                   dbprintf(("delete_file: dir '%s' not on tape list\n",
-                             ditem_path));
+                   dbprintf(_("delete_file: dir '%s' not on tape list\n"),
+                             ditem_path);
                }
            }
            else
            {
                switch(delete_extract_item(ditem)) {
                case -1:
-                   printf("System error\n");
-                   dbprintf(("delete_file: (Failed) System error\n"));
+                   g_printf(_("System error\n"));
+                   dbprintf(_("delete_file: (Failed) System error\n"));
                    break;
                case  0:
-                   printf("Deleted %s\n", ditem->path);
-                   dbprintf(("delete_file: (Successful) Deleted %s\n",
-                             ditem->path));
+                   g_printf(_("Deleted %s\n"), ditem->path);
+                   dbprintf(_("delete_file: (Successful) Deleted %s\n"),
+                             ditem->path);
                    break;
                case  1:
-                   printf("Warning - file '%s' not on tape list\n",
+                   g_printf(_("Warning - file '%s' not on tape list\n"),
                           ditem->path);
-                   dbprintf(("delete_file: file '%s' not on tape list\n",
-                             ditem->path));
+                   dbprintf(_("delete_file: file '%s' not on tape list\n"),
+                             ditem->path);
                    break;
                }
            }
@@ -1137,9 +1138,9 @@ delete_file(
     amfree(path_on_disk_slash);
 
     if(! found_one) {
-       printf("File %s doesn't exist in directory\n", path);
-       dbprintf(("delete_file: (Failed) File %s doesn't exist in directory\n",
-                 path));
+       g_printf(_("File %s doesn't exist in directory\n"), path);
+       dbprintf(_("delete_file: (Failed) File %s doesn't exist in directory\n"),
+                 path);
     }
 }
 
@@ -1169,7 +1170,7 @@ display_extract_list(
        pager_command = stralloc2(pager, " ; /bin/cat > /dev/null");
        if ((fp = popen(pager_command, "w")) == NULL)
        {
-           printf("Warning - can't pipe through %s\n", pager);
+           g_printf(_("Warning - can't pipe through %s\n"), pager);
            fp = stdout;
        }
        amfree(pager_command);
@@ -1179,7 +1180,7 @@ display_extract_list(
        uqfile = unquote_string(file);
        if ((fp = fopen(uqfile, "w")) == NULL)
        {
-           printf("Can't open file %s to print extract list into\n", file);
+           g_printf(_("Can't open file %s to print extract list into\n"), file);
            amfree(uqfile);
            return;
        }
@@ -1188,16 +1189,16 @@ display_extract_list(
 
     for (this = extract_list; this != NULL; this = this->next)
     {
-       fprintf(fp, "TAPE %s LEVEL %d DATE %s\n",
+       g_fprintf(fp, _("TAPE %s LEVEL %d DATE %s\n"),
                this->tape, this->level, this->date);
        for (that = this->files; that != NULL; that = that->next)
-           fprintf(fp, "\t%s\n", that->path);
+           g_fprintf(fp, "\t%s\n", that->path);
     }
 
     if (file == NULL) {
        apclose(fp);
     } else {
-       printf("Extract list written to file %s\n", file);
+       g_printf(_("Extract list written to file %s\n"), file);
        afclose(fp);
     }
 }
@@ -1229,15 +1230,15 @@ okay_to_continue(
     get_tape = 0;
     while (ret < 0) {
        if (get_tape) {
-           prompt = "New tape device [?]: ";
+           prompt = _("New tape device [?]: ");
        } else if (allow_tape && allow_skip) {
-           prompt = "Continue [?/Y/n/s/t]? ";
+           prompt = _("Continue [?/Y/n/s/t]? ");
        } else if (allow_tape && !allow_skip) {
-           prompt = "Continue [?/Y/n/t]? ";
+           prompt = _("Continue [?/Y/n/t]? ");
        } else if (allow_retry) {
-           prompt = "Continue [?/Y/n/r]? ";
+           prompt = _("Continue [?/Y/n/r]? ");
        } else {
-           prompt = "Continue [?/Y/n]? ";
+           prompt = _("Continue [?/Y/n]? ");
        }
        fputs(prompt, stdout);
        fflush(stdout); fflush(stderr);
@@ -1258,17 +1259,17 @@ okay_to_continue(
        }
        if (ch == '?') {
            if (get_tape) {
-               printf("Enter a new device ([host:]device) or \"default\"\n");
+               g_printf(_("Enter a new device ([host:]device) or \"default\"\n"));
            } else {
-               printf("Enter \"y\"es to continue, \"n\"o to stop");
+               g_printf(_("Enter \"y\"es to continue, \"n\"o to stop"));
                if(allow_skip) {
-                   printf(", \"s\"kip this tape");
+                   g_printf(_(", \"s\"kip this tape"));
                }
                if(allow_retry) {
-                   printf(" or \"r\"etry this tape");
+                   g_printf(_(" or \"r\"etry this tape"));
                }
                if (allow_tape) {
-                   printf(" or \"t\"ape to change tape drives");
+                   g_printf(_(" or \"t\"ape to change tape drives"));
                }
                putchar('\n');
            }
@@ -1302,7 +1303,7 @@ send_to_tape_server(
 
     if (fullwrite(tss, msg, strlen(msg)) < 0)
     {
-       error("Error writing to tape server");
+       error(_("Error writing to tape server"));
        /*NOTREACHED*/
     }
     amfree(msg);
@@ -1332,7 +1333,7 @@ extract_files_setup(
     /* get tape server details */
     if ((sp = getservbyname(service_name, "tcp")) == NULL)
     {
-       printf("%s/tcp unknown protocol - config error?\n", service_name);
+       g_printf(_("%s/tcp unknown protocol - config error?\n"), service_name);
        amfree(service_name);
        return -1;
     }
@@ -1347,12 +1348,12 @@ extract_files_setup(
                                                  0);
     if (tape_control_sock < 0)
     {
-       printf("cannot connect to %s: %s\n", tape_server_name, strerror(errno));
+       g_printf(_("cannot connect to %s: %s\n"), tape_server_name, strerror(errno));
        return -1;
     }
     if (my_port >= IPPORT_RESERVED) {
        aclose(tape_control_sock);
-       printf("did not get a reserved port: %u\n", (unsigned)my_port);
+       g_printf(_("did not get a reserved port: %u\n"), (unsigned)my_port);
        return -1;
     }
  
@@ -1431,7 +1432,7 @@ extract_files_setup(
        tt = newstralloc2(tt, "FEATURES=", our_feature_string);
        send_to_tape_server(tape_control_sock, tt);
        if (read(tape_control_sock, buffer, sizeof(buffer)) <= 0) {
-           error("Could not read features from control socket\n");
+           error(_("Could not read features from control socket\n"));
            /*NOTREACHED*/
        }
        tapesrv_features = am_string_to_feature(buffer);
@@ -1446,7 +1447,7 @@ extract_files_setup(
        am_has_feature(indexsrv_features, fe_amidxtaped_datestamp)) {
 
        if(am_has_feature(indexsrv_features, fe_amidxtaped_config)) {
-           tt = newstralloc2(tt, "CONFIG=", config);
+           tt = newstralloc2(tt, "CONFIG=", config_name);
            send_to_tape_server(tape_control_sock, tt);
        }
        if(am_has_feature(indexsrv_features, fe_amidxtaped_label) &&
@@ -1456,7 +1457,7 @@ extract_files_setup(
        }
        if(am_has_feature(indexsrv_features, fe_amidxtaped_fsf)) {
            char v_fsf[100];
-           snprintf(v_fsf, 99, OFF_T_FMT, (OFF_T_FMT_TYPE)fsf);
+           g_snprintf(v_fsf, 99, "%lld", (long long)fsf);
            tt = newstralloc2(tt, "FSF=",v_fsf);
            send_to_tape_server(tape_control_sock, tt);
        }
@@ -1490,8 +1491,8 @@ extract_files_setup(
        send_to_tape_server(tape_control_sock, disk_regex);
        send_to_tape_server(tape_control_sock, clean_datestamp);
 
-       dbprintf(("Started amidxtaped with arguments \"6 -h -p %s %s %s %s\"\n",
-                 dump_device_name, host_regex, disk_regex, clean_datestamp));
+       dbprintf(_("Started amidxtaped with arguments \"6 -h -p %s %s %s %s\"\n"),
+                 dump_device_name, host_regex, disk_regex, clean_datestamp);
     }
 
     /*
@@ -1508,7 +1509,7 @@ extract_files_setup(
         nread = read(tape_control_sock, buffer, sizeof(buffer));
 
        if (nread <= 0) {
-           error("Could not read from control socket: %s\n"
+           error(_("Could not read from control socket: %s\n")
                   strerror(errno));
            /*NOTREACHED*/
         }
@@ -1516,7 +1517,7 @@ extract_files_setup(
        buffer[nread] = '\0';
         if (sscanf(buffer, "CONNECT %hu\n",
                (unsigned short *)&data_port) != 1) {
-           error("Recieved invalid port number message from control socket: %s\n",
+           error(_("Recieved invalid port number message from control socket: %s\n"),
                   buffer);
            /*NOTREACHED*/
         }      
@@ -1528,7 +1529,7 @@ extract_files_setup(
                                                  &my_data_port,
                                                  0);
        if(tape_data_sock == -1){
-           error("Unable to make data connection to server: %s\n",
+           error(_("Unable to make data connection to server: %s\n"),
                      strerror(errno));
            /*NOTREACHED*/
        }
@@ -1565,16 +1566,17 @@ read_file_header(
 
     bytes_read = read_buffer(tapedev, buffer, buflen, READ_TIMEOUT);
     if(bytes_read < 0) {
-       error("error reading header (%s), check amidxtaped.*.debug on server",
+       error(_("error reading header (%s), check amidxtaped.*.debug on server"),
              strerror(errno));
        /*NOTREACHED*/
     }
 
     if((size_t)bytes_read < buflen) {
-       fprintf(stderr, "%s: short block %d byte%s\n",
-               get_pname(), (int)bytes_read, (bytes_read == 1) ? "" : "s");
+       g_fprintf(stderr, plural(_("%s: short block %d byte\n"),
+                              _("%s: short block %d bytes\n"), bytes_read),
+               get_pname(), (int)bytes_read);
        print_header(stdout, file);
-       error("Can't read file header");
+       error(_("Can't read file header"));
        /*NOTREACHED*/
     }
 
@@ -1618,7 +1620,7 @@ extract_files_child(
     /* make in_fd be our stdin */
     if (dup2(in_fd, STDIN_FILENO) == -1)
     {
-       error("dup2 failed in extract_files_child: %s", strerror(errno));
+       error(_("dup2 failed in extract_files_child: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -1628,7 +1630,7 @@ extract_files_child(
 
     if(file.type != F_DUMPFILE) {
        print_header(stdout, &file);
-       error("bad header");
+       error(_("bad header"));
        /*NOTREACHED*/
     }
 
@@ -1798,7 +1800,7 @@ extract_files_child(
     case IS_GNUTAR:
     case IS_SAMBA_TAR:
 #ifndef GNUTAR
-       fprintf(stderr, "warning: GNUTAR program not available.\n");
+       g_fprintf(stderr, _("warning: GNUTAR program not available.\n"));
        cmd = stralloc("tar");
 #else
        cmd = stralloc(GNUTAR);
@@ -1828,19 +1830,20 @@ extract_files_child(
        }
 #endif
        if (cmd == NULL) {
-           fprintf(stderr, "warning: restore program for %s not available.\n",
+           g_fprintf(stderr, _("warning: restore program for %s not available.\n"),
                    file.program);
            cmd = stralloc("restore");
        }
     }
     if (cmd) {
-        dbprintf(("Exec'ing %s with arguments:\n", cmd));
+        dbprintf(_("Exec'ing %s with arguments:\n"), cmd);
        for (i = 0; i < j; i++) {
            if( i == passwd_field)
-               dbprintf(("\tXXXXX\n"));
+               dbprintf("\tXXXXX\n");
            else
-               dbprintf(("\t%s\n", restore_args[i]));
+               dbprintf("\t%s\n", restore_args[i]);
        }
+       safe_fd(-1, 0);
         (void)execv(cmd, restore_args);
        /* only get here if exec failed */
        save_errno = errno;
@@ -1849,8 +1852,8 @@ extract_files_child(
        }
        amfree(restore_args);
        errno = save_errno;
-        perror("amrecover couldn't exec");
-        fprintf(stderr, " problem executing %s\n", cmd);
+        perror(_("amrecover couldn't exec"));
+        g_fprintf(stderr, _(" problem executing %s\n"), cmd);
        amfree(cmd);
     }
     exit(1);
@@ -1888,7 +1891,7 @@ writer_intermediary(
     }
 
     if(pipe(child_pipe) == -1) {
-       error("extract_list - error setting up pipe to extractor: %s\n",
+       error(_("extract_list - error setting up pipe to extractor: %s\n"),
            strerror(errno));
        /*NOTREACHED*/
     }
@@ -1904,7 +1907,7 @@ writer_intermediary(
 
     /* This is the parent */
     if (pid == -1) {
-       error("writer_intermediary - error forking child");
+       error(_("writer_intermediary - error forking child"));
        /*NOTREACHED*/
     }
 
@@ -1924,14 +1927,14 @@ writer_intermediary(
        nfound = select(max_fd, &selectset, NULL, NULL,
                        &timeout);
        if(nfound < 0) {
-           fprintf(stderr,"select error: %s\n", strerror(errno));
+           g_fprintf(stderr,_("select error: %s\n"), strerror(errno));
            break;
        }
         
        if (nfound == 0) { /* timeout */
-           fprintf(stderr, "timeout waiting %d seconds for restore\n",
+           g_fprintf(stderr, _("timeout waiting %d seconds for restore\n"),
                    READ_TIMEOUT);
-           fprintf(stderr, "increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n");
+           g_fprintf(stderr, _("increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n"));
            break;
        }
         
@@ -1941,7 +1944,7 @@ writer_intermediary(
             case -1:
                 if ((errno != EINTR) && (errno != EAGAIN)) {
                     if (errno != EPIPE) {
-                        fprintf(stderr,"writer ctl fd read error: %s",
+                        g_fprintf(stderr,_("writer ctl fd read error: %s"),
                                 strerror(errno));
                     }
                     FD_CLR(ctl_fd, &readset);
@@ -1961,7 +1964,7 @@ writer_intermediary(
                     int done = 0;
                     while (!done) {
                         char *input = NULL;
-                        printf("Please insert tape %s. Continue? [Y|n]: ",
+                        g_printf(_("Please insert tape %s. Continue? [Y|n]: "),
                                desired_tape);
                         fflush(stdout);
                         
@@ -1981,7 +1984,7 @@ writer_intermediary(
                         amfree(input);
                     }
                 } else {
-                    fprintf(stderr, "Strange message from tape server: %s", buffer);
+                    g_fprintf(stderr, _("Strange message from tape server: %s"), buffer);
                    break;
                 }    
              }
@@ -1995,7 +1998,7 @@ writer_intermediary(
             case -1:
                 if ((errno != EINTR) && (errno != EAGAIN)) {
                     if (errno != EPIPE) {
-                        fprintf(stderr,"writer data fd read error: %s",
+                        g_fprintf(stderr,_("writer data fd read error: %s"),
                                 strerror(errno));
                     }
                     FD_CLR(data_fd, &readset);
@@ -2013,11 +2016,11 @@ writer_intermediary(
                  */
                 if(fullwrite(child_pipe[1], buffer, (size_t)bytes_read) < 0) {
                     if(errno == EPIPE) {
-                        error("%s: pipe data reader has quit: %s\n",
-                              get_pname(), strerror(errno));
+                        error(_("pipe data reader has quit: %s\n"),
+                              strerror(errno));
                         /* NOTREACHED */
                     }
-                    error("Write error to extract child: %s\n",
+                    error(_("Write error to extract child: %s\n"),
                           strerror(errno));
                     /* NOTREACHED */
                 }
@@ -2032,7 +2035,7 @@ writer_intermediary(
     if(WEXITSTATUS(extractor_status) != 0){
        int ret = WEXITSTATUS(extractor_status);
         if(ret == 255) ret = -1;
-       error("Extractor child exited with status %d\n", ret);
+       error(_("Extractor child exited with status %d\n"), ret);
        /*NOTREACHED*/
     }
 
@@ -2072,7 +2075,7 @@ extract_files(void)
 
     if (!is_extract_list_nonempty())
     {
-       printf("Extract list empty - No files to extract!\n");
+       g_printf(_("Extract list empty - No files to extract!\n"));
        return;
     }
 
@@ -2090,7 +2093,7 @@ extract_files(void)
        l = reply_line();
        if (!server_happy())
        {
-           printf("%s\n", l);
+           g_printf("%s\n", l);
            exit(1);
        }
        /* skip reply number */
@@ -2099,7 +2102,7 @@ extract_files(void)
 
     if (strcmp(tape_device_name, "/dev/null") == 0)
     {
-       printf("amrecover: warning: using %s as the tape device will not work\n",
+       g_printf(_("amrecover: warning: using %s as the tape device will not work\n"),
               tape_device_name);
     }
 
@@ -2107,17 +2110,17 @@ extract_files(void)
     for (elist = first_tape_list(); elist != NULL; elist = next_tape_list(elist))
        if(elist->tape[0]!='/') {
            if(first) {
-               printf("\nExtracting files using tape drive %s on host %s.\n",
+               g_printf(_("\nExtracting files using tape drive %s on host %s.\n"),
                        tape_device_name, tape_server_name);
-               printf("The following tapes are needed:");
+               g_printf(_("The following tapes are needed:"));
                first=0;
            }
            else
-               printf("                               ");
+               g_printf("                               ");
            tlist = unmarshal_tapelist_str(elist->tape); 
            for( ; tlist != NULL; tlist = tlist->next)
-               printf(" %s", tlist->label);
-           printf("\n");
+               g_printf(" %s", tlist->label);
+           g_printf("\n");
            amfree(tlist);
        }
     first=1;
@@ -2125,52 +2128,52 @@ extract_files(void)
     {
        if(elist->tape[0]=='/') {
            if(first) {
-               printf("\nExtracting files from holding disk on host %s.\n",
+               g_printf(_("\nExtracting files from holding disk on host %s.\n"),
                        tape_server_name);
-               printf("The following files are needed:");
+               g_printf(_("The following files are needed:"));
                first=0;
            }
            else
-               printf("                               ");
+               g_printf("                               ");
            tlist = unmarshal_tapelist_str(elist->tape); 
            for( ; tlist != NULL; tlist = tlist->next)
-               printf(" %s", tlist->label);
-           printf("\n");
+               g_printf(" %s", tlist->label);
+           g_printf("\n");
            amfree(tlist);
        }
     }
-    printf("\n");
+    g_printf("\n");
 
     if (getcwd(buf, sizeof(buf)) == NULL) {
-       perror("extract_list: Current working directory unavailable");
+       perror(_("extract_list: Cannot determine current working directory"));
        exit(1);
     }
 
-    printf("Restoring files into directory %s\n", buf);
+    g_printf(_("Restoring files into directory %s\n"), buf);
 #ifdef SAMBA_CLIENT
     if (samba_extract_method == SAMBA_SMBCLIENT)
-      printf("(unless it is a Samba backup, that will go through to the SMB server)\n");
+      g_printf(_("(unless it is a Samba backup, that will go through to the SMB server)\n"));
 #endif
     if (!okay_to_continue(0,0,0))
        return;
-    printf("\n");
+    g_printf("\n");
 
     while ((elist = first_tape_list()) != NULL)
     {
        if(elist->tape[0]=='/') {
            dump_device_name = newstralloc(dump_device_name, elist->tape);
-           printf("Extracting from file ");
+           g_printf(_("Extracting from file "));
            tlist = unmarshal_tapelist_str(dump_device_name); 
            for( ; tlist != NULL; tlist = tlist->next)
-               printf(" %s", tlist->label);
-           printf("\n");
+               g_printf(" %s", tlist->label);
+           g_printf("\n");
            amfree(tlist);
        }
        else {
-           printf("Extracting files using tape drive %s on host %s.\n",
+           g_printf(_("Extracting files using tape drive %s on host %s.\n"),
                   tape_device_name, tape_server_name);
            tlist = unmarshal_tapelist_str(elist->tape); 
-           printf("Load tape %s now\n", tlist->label);
+           g_printf(_("Load tape %s now\n"), tlist->label);
            amfree(tlist);
            otc = okay_to_continue(1,1,0);
            if (otc == 0)
@@ -2186,7 +2189,7 @@ extract_files(void)
        /* connect to the tape handler daemon on the tape drive server */
        if ((tape_control_sock = extract_files_setup(elist->tape, elist->fileno)) == -1)
        {
-           fprintf(stderr, "amrecover - can't talk to tape server\n");
+           g_fprintf(stderr, _("amrecover - can't talk to tape server\n"));
            return;
        }
 
@@ -2201,7 +2204,7 @@ extract_files(void)
        /* this is the parent */
        if (pid == -1)
        {
-           perror("extract_list - error forking child");
+           perror(_("extract_list - error forking child"));
            aclose(tape_control_sock);
            exit(1);
        }
@@ -2212,7 +2215,7 @@ extract_files(void)
        /* wait for the child process to finish */
        if ((pid = waitpid(-1, &child_stat, 0)) == (pid_t)-1)
        {
-           perror("extract_list - error waiting for child");
+           perror(_("extract_list - error waiting for child"));
            exit(1);
        }
 
@@ -2226,13 +2229,13 @@ extract_files(void)
        }
        else
        {
-           fprintf(stderr, "extract list - unknown child terminated?\n");
+           g_fprintf(stderr, _("extract list - unknown child terminated?\n"));
            exit(1);
        }
        if ((WIFEXITED(child_stat) != 0) && (WEXITSTATUS(child_stat) != 0))
        {
-           fprintf(stderr,
-                   "extract_list - child returned non-zero status: %d\n",
+           g_fprintf(stderr,
+                   _("extract_list - child returned non-zero status: %d\n"),
                    WEXITSTATUS(child_stat));
            otc = okay_to_continue(0,0,1);
            if(otc == 0)
index 7bccd5e294e3f5f870cb741a3aeb83bb4670fef6..bdb35254f0d7841d7e6f651ce568f9499174670a 100644 (file)
 void
 help_list(void)
 {
-    printf("valid commands are:\n\n");
+    g_printf(_("valid commands are:\n\n"));
 
-    printf("add path1 ...     - add to extraction list (shell wildcards)\n");
-    printf("addx path1 ...    - add to extraction list (regular expressions)\n");
-    printf("cd directory      - change cwd on virtual file system (shell wildcards)\n");
-    printf("cdx directory     - change cwd on virtual file system (regular expressions)\n");
-    printf("clear             - clear extraction list\n");
-    printf("delete path1 ...  - delete from extraction list (shell wildcards)\n");
-    printf("deletex path1 ... - delete from extraction list (regular expressions)\n");
-    printf("extract           - extract selected files from tapes\n");
-    printf("exit\n");
-    printf("help\n");
-    printf("history           - show dump history of disk\n");
-    printf("list [filename]   - show extraction list, optionally writing to file\n");
-    printf("lcd directory     - change cwd on local file system\n");
-    printf("ls                - list directory on virtual file system\n");
-    printf("lpwd              - show cwd on local file system\n");
-    printf("mode              - show the method used to extract SMB shares\n");
-    printf("pwd               - show cwd on virtual file system\n");
-    printf("quit\n");
-    printf("listhost          - list hosts\n");
-    printf("listdisk [diskdevice]              - list disks\n");
-    printf("setdate {YYYY-MM-DD|--MM-DD|---DD} - set date of look\n");
-    printf("        {YYYY-MM-DD-HH-MM-SS}      - set date of look\n");
-    printf("setdisk diskname [mountpoint]      - select disk on dump host\n");
-    printf("sethost host                       - select dump host\n");
-    printf("settape [host:][device|default]    - select tape server and/or device\n");
-    printf("setmode smb|tar                 - select the method used to extract SMB shares\n");
-    printf("\n");
+    g_printf(_("add path1 ...     - add to extraction list (shell wildcards)\n"));
+    g_printf(_("addx path1 ...    - add to extraction list (regular expressions)\n"));
+    g_printf(_("cd directory      - change cwd on virtual file system (shell wildcards)\n"));
+    g_printf(_("cdx directory     - change cwd on virtual file system (regular expressions)\n"));
+    g_printf(_("clear             - clear extraction list\n"));
+    g_printf(_("delete path1 ...  - delete from extraction list (shell wildcards)\n"));
+    g_printf(_("deletex path1 ... - delete from extraction list (regular expressions)\n"));
+    g_printf(_("extract           - extract selected files from tapes\n"));
+    g_printf(_("exit\n"));
+    g_printf(_("help\n"));
+    g_printf(_("history           - show dump history of disk\n"));
+    g_printf(_("list [filename]   - show extraction list, optionally writing to file\n"));
+    g_printf(_("lcd directory     - change cwd on local file system\n"));
+    g_printf(_("ls                - list directory on virtual file system\n"));
+    g_printf(_("lpwd              - show cwd on local file system\n"));
+    g_printf(_("mode              - show the method used to extract SMB shares\n"));
+    g_printf(_("pwd               - show cwd on virtual file system\n"));
+    g_printf(_("quit\n"));
+    g_printf(_("listhost          - list hosts\n"));
+    g_printf(_("listdisk [diskdevice]              - list disks\n"));
+    g_printf(_("setdate {YYYY-MM-DD|--MM-DD|---DD} - set date of look\n"));
+    g_printf(_("        {YYYY-MM-DD-HH-MM-SS}      - set date of look\n"));
+    g_printf(_("setdisk diskname [mountpoint]      - select disk on dump host\n"));
+    g_printf(_("sethost host                       - select dump host\n"));
+    g_printf(_("settape [host:][device|default]    - select tape server and/or device\n"));
+    g_printf(_("setmode smb|tar                 - select the method used to extract SMB shares\n"));
+    g_printf(_("\n"));
 }
index 812e181c003742b5716328ca5722557c3e090cc7..a0c83babd339769127d9473b0e4313eb7a79cc98 100644 (file)
@@ -63,8 +63,8 @@ set_date(
        }
        else
        {
-           printf("No index records for cwd on new date\n");
-           printf("Setting cwd to mount point\n");
+           g_printf(_("No index records for cwd on new date\n"));
+           g_printf(_("Setting cwd to mount point\n"));
            disk_path = newstralloc(disk_path, "/");    /* fake it */
            clear_dir_list();
        }
@@ -86,7 +86,7 @@ set_host(
 
     if (is_extract_list_nonempty())
     {
-       printf("Must clear extract list before changing host\n");
+       g_printf(_("Must clear extract list before changing host\n"));
        return;
     }
 
@@ -105,7 +105,7 @@ set_host(
         */
        if ((hp = gethostbyname(uqhost)) != NULL) {
            host = hp->h_name;
-           printf("Trying host %s ...\n", host);
+           g_printf(_("Trying host %s ...\n"), host);
            cmd = newstralloc2(cmd, "HOST ", host);
            if (converse(cmd) == -1)
                exit(1);
@@ -117,7 +117,7 @@ set_host(
            {
                for (hostp = hp->h_aliases; (host = *hostp) != NULL; hostp++)
                {
-                   printf("Trying host %s ...\n", host);
+                   g_printf(_("Trying host %s ...\n"), host);
                    cmd = newstralloc2(cmd, "HOST ", host);
                    if (converse(cmd) == -1)
                        exit(1);
@@ -165,7 +165,7 @@ set_disk(
 
     if (is_extract_list_nonempty())
     {
-       printf("Must clear extract list before changing disk\n");
+       g_printf(_("Must clear extract list before changing disk\n"));
        return;
     }
 
@@ -173,7 +173,7 @@ set_disk(
     if (mtpt != NULL) {
        uqmtpt = unquote_string(mtpt);
        if (*mtpt != '/') {
-           printf("Mount point \"%s\" invalid - must start with /\n", uqmtpt);
+           g_printf(_("Mount point \"%s\" invalid - must start with /\n"), uqmtpt);
            amfree(uqmtpt);
            return;
        }
@@ -224,8 +224,8 @@ set_disk(
     }
     else
     {
-       printf("No index records for disk for specified date\n");
-       printf("If date correct, notify system administrator\n");
+       g_printf(_("No index records for disk for specified date\n"));
+       g_printf(_("If date correct, notify system administrator\n"));
        disk_path = newstralloc(disk_path, "/");        /* fake it */
        clear_dir_list();
     }
@@ -279,15 +279,15 @@ cd_glob(
     char *path_on_disk = NULL;
 
     if (disk_name == NULL) {
-       printf("Must select disk before changing directory\n");
+       g_printf(_("Must select disk before changing directory\n"));
        return;
     }
 
     uqglob = unquote_string(glob);
     regex = glob_to_regex(uqglob);
-    dbprintf(("cd_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("cd_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-        printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
+        g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob);
         puts(s);
        amfree(regex);
         return;
@@ -331,13 +331,13 @@ cd_regex(
     char *path_on_disk = NULL;
 
     if (disk_name == NULL) {
-       printf("Must select disk before changing directory\n");
+       g_printf(_("Must select disk before changing directory\n"));
        return;
     }
 
     uqregex = unquote_string(regex);
     if ((s = validate_regexp(uqregex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", uqregex);
+       g_printf(_("\"%s\" is not a valid regular expression: "), uqregex);
        amfree(uqregex);
        puts(s);
        return;
@@ -410,7 +410,7 @@ cd_dir(
        set_directory(dir);
     }
     else {
-       printf("Too many directory\n");
+       g_printf(_("Too many directory\n"));
     }
     amfree(dir);
 }
@@ -432,7 +432,7 @@ set_directory(
     }
 
     if (disk_name == NULL) {
-       printf("Must select disk before setting directory\n");
+       g_printf(_("Must select disk before setting directory\n"));
        return;
        /*NOTREACHED*/
     }
@@ -452,7 +452,7 @@ set_directory(
        {
            if (strncmp(mount_point, ldir, strlen(mount_point)) != 0)
            {
-               printf("Invalid directory - Can't cd outside mount point \"%s\"\n",
+               g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"),
                       mount_point);
                amfree(ldir);
                return;
@@ -488,7 +488,7 @@ set_directory(
        if (strcmp(dp, "..") == 0) {
            if (strcmp(new_dir, "/") == 0) {
                /* at top of disk */
-               printf("Invalid directory - Can't cd outside mount point \"%s\"\n",
+               g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"),
                       mount_point);
                /*@ignore@*/
                amfree(new_dir);
@@ -532,7 +532,7 @@ set_directory(
     }
     else
     {
-       printf("Invalid directory - %s\n", dir);
+       g_printf(_("Invalid directory - %s\n"), dir);
     }
 
     /*@ignore@*/
@@ -547,13 +547,13 @@ void
 show_directory(void)
 {
     if (mount_point == NULL || disk_path == NULL)
-        printf("Must select disk first\n");
+        g_printf(_("Must select disk first\n"));
     else if (strcmp(mount_point, "/") == 0)
-       printf("%s\n", disk_path);
+       g_printf("%s\n", disk_path);
     else if (strcmp(disk_path, "/") == 0)
-       printf("%s\n", mount_point);
+       g_printf("%s\n", mount_point);
     else
-       printf("%s%s\n", mount_point, disk_path);
+       g_printf("%s%s\n", mount_point, disk_path);
 }
 
 
@@ -596,14 +596,14 @@ set_tape(
     }
 
     if (tape_device_name)
-       printf ("Using tape \"%s\"", tape_device_name);
+       g_printf (_("Using tape \"%s\""), tape_device_name);
     else
-       printf ("Using default tape");
+       g_printf (_("Using default tape"));
 
     if (tape_server_name)
-       printf (" from server %s.\n", tape_server_name);
+       g_printf (_(" from server %s.\n"), tape_server_name);
     else
-       printf (".\nTape server unspecified, assumed to be %s.\n",
+       g_printf (_(".\nTape server unspecified, assumed to be %s.\n"),
                server_name);
 }
 
@@ -613,11 +613,11 @@ set_mode(
 {
 #ifdef SAMBA_CLIENT
   if (mode == SAMBA_SMBCLIENT) {
-    printf ("SAMBA dumps will be extracted using smbclient\n");
+    g_printf (_("SAMBA dumps will be extracted using smbclient\n"));
     samba_extract_method = SAMBA_SMBCLIENT;
   } else {
     if (mode == SAMBA_TAR) {
-      printf ("SAMBA dumps will be extracted as TAR dumps\n");
+      g_printf (_("SAMBA dumps will be extracted as TAR dumps\n"));
       samba_extract_method = SAMBA_TAR;
     }
   }
@@ -630,12 +630,12 @@ void
 show_mode(void) 
 {
 #ifdef SAMBA_CLIENT
-  printf ("SAMBA dumps are extracted ");
+  g_printf (_("SAMBA dumps are extracted "));
 
   if (samba_extract_method == SAMBA_TAR) {
-    printf (" as TAR dumps\n");
+    g_printf (_(" as TAR dumps\n"));
   } else {
-    printf ("using smbclient\n");
+    g_printf (_("using smbclient\n"));
   }
 #endif /* SAMBA_CLIENT */
 }
index e4dc87a8139c8daed4b745356aefe58a265cff46..0de18c5d911c3fd00a342adfcae3158df7bd2683 100644 (file)
@@ -1835,6 +1835,6 @@ void
 yyerror(
     char *     s)
 {
-  printf("%s\n", s);
+  g_printf("%s\n", s);
 }
 
index 3700981d2e089852066baf5cdedead60a5513f85..6166db2a30e1bb7005d2581b5a08d8c27f266ae8 100644 (file)
@@ -177,5 +177,5 @@ void
 yyerror(
     char *     s)
 {
-  printf("%s\n", s);
+  g_printf("%s\n", s);
 }
index 05358222352389ea95f2ab4d4201f9e891798f39..01f7936bb5d1f0591884c1555d7c49d5fda6b39a 100644 (file)
@@ -1,31 +1,92 @@
-/* A lexical scanner generated by flex*/
 
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#line 3 "uscan.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
 
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
 #include <stdio.h>
-#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
 
+/* end standard C headers. */
 
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
 #endif
 
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
 
-#ifdef __cplusplus
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
 
-#include <stdlib.h>
+#endif /* ! FLEXINT_H */
 
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
+#ifdef __cplusplus
 
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
 #if __STDC__
 
-#define YY_USE_PROTOS
 #define YY_USE_CONST
 
 #endif /* __STDC__ */
 #endif /* ! __cplusplus */
 
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
 #ifdef YY_USE_CONST
 #define yyconst const
 #else
 #define yyconst
 #endif
 
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
  * but we do it the disgusting crufty way forced on us by the ()-less
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
 /* Action number for EOF rule of a given start state. */
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart(yyin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
+#endif
 
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
 
 extern int yyleng;
+
 extern FILE *yyin, *yyout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- *     if ( condition_holds )
- *             yyless( 5 );
- *     else
- *             do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
        do \
                { \
                /* Undo effects of setting up yytext. */ \
-               *yy_cp = yy_hold_char; \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
                YY_RESTORE_YY_MORE_OFFSET \
-               yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* Some routines like yy_flex_realloc() are emitted as static but are
-   not called by all lexers. This generates warnings in some compilers,
-   notably GCC. Arrange to suppress these. */
-#ifdef __GNUC__
-#define YY_MAY_BE_UNUSED __attribute__((unused))
-#else
-#define YY_MAY_BE_UNUSED
-#endif
+#define unput(c) yyunput( c, (yytext_ptr)  )
 
 /* The following is because we cannot portably get our hands on size_t
  * (without autoconf's help, which isn't available because we want
  * flex-generated scanners to compile on their own).
  */
-typedef unsigned int yy_size_t;
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
 
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
        {
        FILE *yy_input_file;
@@ -186,12 +225,16 @@ struct yy_buffer_state
         */
        int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
        int yy_fill_buffer;
 
        int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
        /* When an EOF's been seen but there's still some text to process
@@ -205,28 +248,38 @@ struct yy_buffer_state
         * just pointing yyin at a new input file.
         */
 #define YY_BUFFER_EOF_PENDING 2
+
        };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
  */
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
 
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-
 static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-
-
 int yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;                /* whether we need to initialize */
+static int yy_init = 0;                /* whether we need to initialize */
 static int yy_start = 0;       /* start state number */
 
 /* Flag which is used to allow yywrap()'s to do buffer switches
@@ -234,66 +287,92 @@ static int yy_start = 0;  /* start state number */
  */
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
 
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
 
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
-static void yy_flex_free YY_PROTO(( void * ));
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
+
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
 
 #define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_is_interactive = is_interactive; \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }
 
 #define yy_set_bol(at_bol) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_at_bol = at_bol; \
+       if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
 
 typedef unsigned char YY_CHAR;
+
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
 typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
 extern char *yytext;
 #define yytext_ptr yytext
 
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-       yytext_ptr = yy_bp; \
-       yyleng = (int) (yy_cp - yy_bp); \
-       yy_hold_char = *yy_cp; \
+       (yytext_ptr) = yy_bp; \
+       yyleng = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
-       yy_c_buf_p = yy_cp;
+       (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 40
 #define YY_END_OF_BUFFER 41
-static yyconst short int yy_accept[131] =
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_accept[131] =
     {   0,
         0,    0,    0,    0,   41,   40,   39,   38,   34,   38,
        38,   22,   38,   38,   38,   38,   38,   38,   38,   38,
@@ -311,7 +390,7 @@ static yyconst short int yy_accept[131] =
         3,    6,    7,   38,    2,    1,   33,   38,   32,    0
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
         2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
@@ -343,14 +422,14 @@ static yyconst int yy_ec[256] =
         4,    4,    4,    4,    4
     } ;
 
-static yyconst int yy_meta[30] =
+static yyconst flex_int32_t yy_meta[30] =
     {   0,
         1,    1,    2,    3,    4,    3,    3,    3,    5,    3,
         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
         3,    3,    3,    3,    3,    3,    3,    3,    3
     } ;
 
-static yyconst short int yy_base[135] =
+static yyconst flex_int16_t yy_base[135] =
     {   0,
         0,    0,   25,   26,  161,  162,   30,    0,  162,  154,
        30,    0,  146,   25,  144,  129,   25,   28,  136,  128,
@@ -369,7 +448,7 @@ static yyconst short int yy_base[135] =
        76,   79,   84,   87
     } ;
 
-static yyconst short int yy_def[135] =
+static yyconst flex_int16_t yy_def[135] =
     {   0,
       130,    1,  131,  131,  130,  130,  130,  132,  130,  132,
       132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
@@ -388,7 +467,7 @@ static yyconst short int yy_def[135] =
       130,  130,  130,  130
     } ;
 
-static yyconst short int yy_nxt[192] =
+static yyconst flex_int16_t yy_nxt[192] =
     {   0,
         6,    7,    7,    8,    9,   10,   11,   12,    8,   13,
         8,   14,   15,   16,   17,    8,    8,   18,   19,    8,
@@ -414,7 +493,7 @@ static yyconst short int yy_nxt[192] =
 
     } ;
 
-static yyconst short int yy_chk[192] =
+static yyconst flex_int16_t yy_chk[192] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -443,6 +522,9 @@ static yyconst short int yy_chk[192] =
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
 
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
  */
@@ -452,7 +534,6 @@ static char *yy_last_accepting_cpos;
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
 #line 1 "uscan.l"
-#define INITIAL 0
 /*
  * amanda, the advanced maryland automatic network disk archiver
  * Copyright (c) 1991-2000 University of Maryland at College Park
@@ -509,11 +590,56 @@ extern void       yyerror(char *s);
 extern int     yyparse(void);
 static int     ll_parse_date(int type, char *text);
 int            process_line(char *line);
-#define quotedpath 1
 
 #line 62 "uscan.l"
 static char *string_buf = NULL;
-#line 517 "uscan.c"
+#line 597 "uscan.c"
+
+#define INITIAL 0
+#define quotedpath 1
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -521,65 +647,30 @@ static char *string_buf = NULL;
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int yywrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
-#endif
+extern int yywrap (void );
 #endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
 #endif
 
+    static void yyunput (int c,char *buf_ptr  );
+    
 #ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
 #endif
 
 #ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
 
+#ifdef __cplusplus
+static int yyinput (void );
 #else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
+static int input (void );
 #endif
 
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
 #endif
 
 /* Amount of stuff to slurp up with each read. */
@@ -588,7 +679,6 @@ YY_MALLOC_DECL
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
@@ -601,9 +691,10 @@ YY_MALLOC_DECL
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-       if ( yy_current_buffer->yy_is_interactive ) \
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
-               int c = '*', n; \
+               int c = '*'; \
+               size_t n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -613,9 +704,22 @@ YY_MALLOC_DECL
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
                result = n; \
                } \
-       else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-                 && ferror( yyin ) ) \
-               YY_FATAL_ERROR( "input in flex scanner failed" );
+       else \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }\
+\
+
 #endif
 
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -636,12 +740,18 @@ YY_MALLOC_DECL
 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
 
 /* Code executed at the beginning of each rule, after yytext and yyleng
  * have been set up.
@@ -658,12 +768,14 @@ YY_MALLOC_DECL
 #define YY_RULE_SETUP \
        YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-       {
+{
        register yy_state_type yy_current_state;
-       register char *yy_cp = NULL, *yy_bp = NULL;
+       register char *yy_cp, *yy_bp;
        register int yy_act;
-
+    
 #line 65 "uscan.l"
 
 
@@ -671,18 +783,18 @@ YY_DECL
     /* literal keyword tokens */
 
 
-#line 675 "uscan.c"
+#line 787 "uscan.c"
 
-       if ( yy_init )
+       if ( !(yy_init) )
                {
-               yy_init = 0;
+               (yy_init) = 1;
 
 #ifdef YY_USER_INIT
                YY_USER_INIT;
 #endif
 
-               if ( ! yy_start )
-                       yy_start = 1;   /* first start state */
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
 
                if ( ! yyin )
                        yyin = stdin;
@@ -690,34 +802,36 @@ YY_DECL
                if ( ! yyout )
                        yyout = stdout;
 
-               if ( ! yy_current_buffer )
-                       yy_current_buffer =
-                               yy_create_buffer( yyin, YY_BUF_SIZE );
+               if ( ! YY_CURRENT_BUFFER ) {
+                       yyensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               yy_create_buffer(yyin,YY_BUF_SIZE );
+               }
 
-               yy_load_buffer_state();
+               yy_load_buffer_state( );
                }
 
        while ( 1 )             /* loops until end-of-file is reached */
                {
-               yy_cp = yy_c_buf_p;
+               yy_cp = (yy_c_buf_p);
 
                /* Support of yytext. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
 
                /* yy_bp points to the position in yy_ch_buf of the start of
                 * the current run.
                 */
                yy_bp = yy_cp;
 
-               yy_current_state = yy_start;
+               yy_current_state = (yy_start);
 yy_match:
                do
                        {
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
                        if ( yy_accept[yy_current_state] )
                                {
-                               yy_last_accepting_state = yy_current_state;
-                               yy_last_accepting_cpos = yy_cp;
+                               (yy_last_accepting_state) = yy_current_state;
+                               (yy_last_accepting_cpos) = yy_cp;
                                }
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
@@ -734,24 +848,22 @@ yy_find_action:
                yy_act = yy_accept[yy_current_state];
                if ( yy_act == 0 )
                        { /* have to back up */
-                       yy_cp = yy_last_accepting_cpos;
-                       yy_current_state = yy_last_accepting_state;
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
                        yy_act = yy_accept[yy_current_state];
                        }
 
                YY_DO_BEFORE_ACTION;
 
-
 do_action:     /* This label is used only to access EOF actions. */
 
-
                switch ( yy_act )
        { /* beginning of action switch */
                        case 0: /* must back up */
                        /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = yy_hold_char;
-                       yy_cp = yy_last_accepting_cpos;
-                       yy_current_state = yy_last_accepting_state;
+                       *yy_cp = (yy_hold_char);
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
                        goto yy_find_action;
 
 case 1:
@@ -930,13 +1042,14 @@ YY_RULE_SETUP
 #line 114 "uscan.l"
 {
     if(string_buf != NULL) {
-       printf("ERROR:string_buf != NULL: %s\n",string_buf);
+       g_printf("ERROR:string_buf != NULL: %s\n",string_buf);
     }
     BEGIN(quotedpath);
     strappend(string_buf, yytext);
 }
        YY_BREAK
 case 35:
+/* rule 35 can match eol */
 YY_RULE_SETUP
 #line 122 "uscan.l"
 {
@@ -977,6 +1090,7 @@ YY_RULE_SETUP
     /* whitespace */
 
 case 39:
+/* rule 39 can match eol */
 YY_RULE_SETUP
 #line 152 "uscan.l"
 ;     /* whitespace */
@@ -995,7 +1109,7 @@ YY_RULE_SETUP
 #line 165 "uscan.l"
 ECHO;
        YY_BREAK
-#line 999 "uscan.c"
+#line 1113 "uscan.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(quotedpath):
        yyterminate();
@@ -1003,26 +1117,26 @@ case YY_STATE_EOF(quotedpath):
        case YY_END_OF_BUFFER:
                {
                /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
                YY_RESTORE_YY_MORE_OFFSET
 
-               if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
                        {
                        /* We're scanning a new file or input source.  It's
                         * possible that this happened because the user
                         * just pointed yyin at a new source and called
                         * yylex().  If so, then we have to assure
-                        * consistency between yy_current_buffer and our
+                        * consistency between YY_CURRENT_BUFFER and our
                         * globals.  Here is the right place to do so, because
                         * this is the first action (other than possibly a
                         * back-up) that will match for the new input source.
                         */
-                       yy_n_chars = yy_current_buffer->yy_n_chars;
-                       yy_current_buffer->yy_input_file = yyin;
-                       yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
                        }
 
                /* Note that here we test for yy_c_buf_p "<=" to the position
@@ -1032,13 +1146,13 @@ case YY_STATE_EOF(quotedpath):
                 * end-of-buffer state).  Contrast this with the test
                 * in input().
                 */
-               if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        { /* This was really a NUL. */
                        yy_state_type yy_next_state;
 
-                       yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
-                       yy_current_state = yy_get_previous_state();
+                       yy_current_state = yy_get_previous_state(  );
 
                        /* Okay, we're now positioned to make the NUL
                         * transition.  We couldn't have
@@ -1051,30 +1165,30 @@ case YY_STATE_EOF(quotedpath):
 
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-                       yy_bp = yytext_ptr + YY_MORE_ADJ;
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
                        if ( yy_next_state )
                                {
                                /* Consume the NUL. */
-                               yy_cp = ++yy_c_buf_p;
+                               yy_cp = ++(yy_c_buf_p);
                                yy_current_state = yy_next_state;
                                goto yy_match;
                                }
 
                        else
                                {
-                               yy_cp = yy_c_buf_p;
+                               yy_cp = (yy_c_buf_p);
                                goto yy_find_action;
                                }
                        }
 
-               else switch ( yy_get_next_buffer() )
+               else switch ( yy_get_next_buffer(  ) )
                        {
                        case EOB_ACT_END_OF_FILE:
                                {
-                               yy_did_buffer_switch_on_eof = 0;
+                               (yy_did_buffer_switch_on_eof) = 0;
 
-                               if ( yywrap() )
+                               if ( yywrap( ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
@@ -1085,7 +1199,7 @@ case YY_STATE_EOF(quotedpath):
                                         * YY_NULL, it'll still work - another
                                         * YY_NULL will get returned.
                                         */
-                                       yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
                                        yy_act = YY_STATE_EOF(YY_START);
                                        goto do_action;
@@ -1093,30 +1207,30 @@ case YY_STATE_EOF(quotedpath):
 
                                else
                                        {
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
                                        }
                                break;
                                }
 
                        case EOB_ACT_CONTINUE_SCAN:
-                               yy_c_buf_p =
-                                       yytext_ptr + yy_amount_of_matched_text;
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_match;
 
                        case EOB_ACT_LAST_MATCH:
-                               yy_c_buf_p =
-                               &yy_current_buffer->yy_ch_buf[yy_n_chars];
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_find_action;
                        }
                break;
@@ -1127,8 +1241,7 @@ case YY_STATE_EOF(quotedpath):
                        "fatal flex scanner internal error--no action found" );
        } /* end of action switch */
                } /* end of scanning one token */
-       } /* end of yylex */
-
+} /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -1137,21 +1250,20 @@ case YY_STATE_EOF(quotedpath):
  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  *     EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-       {
-       register char *dest = yy_current_buffer->yy_ch_buf;
-       register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       register char *source = (yytext_ptr);
        register int number_to_move, i;
        int ret_val;
 
-       if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
                YY_FATAL_ERROR(
                "fatal flex scanner internal error--end of buffer missed" );
 
-       if ( yy_current_buffer->yy_fill_buffer == 0 )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
                { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
                        {
                        /* We matched a single character, the EOB, so
                         * treat this as a final EOF.
@@ -1171,34 +1283,30 @@ static int yy_get_next_buffer()
        /* Try to read more data. */
 
        /* First move last chars to start of buffer. */
-       number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
        for ( i = 0; i < number_to_move; ++i )
                *(dest++) = *(source++);
 
-       if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
                /* don't do the read, it's not guaranteed to return an EOF,
                 * just force an EOF
                 */
-               yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
        else
                {
-               int num_to_read =
-                       yy_current_buffer->yy_buf_size - number_to_move - 1;
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
                        { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-                       YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
 
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = yy_current_buffer;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
                        int yy_c_buf_p_offset =
-                               (int) (yy_c_buf_p - b->yy_ch_buf);
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
 
                        if ( b->yy_is_our_buffer )
                                {
@@ -1211,8 +1319,7 @@ static int yy_get_next_buffer()
 
                                b->yy_ch_buf = (char *)
                                        /* Include room in for 2 EOB chars. */
-                                       yy_flex_realloc( (void *) b->yy_ch_buf,
-                                                        b->yy_buf_size + 2 );
+                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
                                }
                        else
                                /* Can't grow it, we don't own it. */
@@ -1222,35 +1329,35 @@ static int yy_get_next_buffer()
                                YY_FATAL_ERROR(
                                "fatal error - scanner input buffer overflow" );
 
-                       yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
 
-                       num_to_read = yy_current_buffer->yy_buf_size -
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
                                                number_to_move - 1;
-#endif
+
                        }
 
                if ( num_to_read > YY_READ_BUF_SIZE )
                        num_to_read = YY_READ_BUF_SIZE;
 
                /* Read in more data. */
-               YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-                       yy_n_chars, num_to_read );
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), num_to_read );
 
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       if ( yy_n_chars == 0 )
+       if ( (yy_n_chars) == 0 )
                {
                if ( number_to_move == YY_MORE_ADJ )
                        {
                        ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart( yyin );
+                       yyrestart(yyin  );
                        }
 
                else
                        {
                        ret_val = EOB_ACT_LAST_MATCH;
-                       yy_current_buffer->yy_buffer_status =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
                                YY_BUFFER_EOF_PENDING;
                        }
                }
@@ -1258,32 +1365,31 @@ static int yy_get_next_buffer()
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
-       yy_n_chars += number_to_move;
-       yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-       yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
-       yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
        return ret_val;
-       }
-
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-       {
+    static yy_state_type yy_get_previous_state (void)
+{
        register yy_state_type yy_current_state;
        register char *yy_cp;
+    
+       yy_current_state = (yy_start);
 
-       yy_current_state = yy_start;
-
-       for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
                {
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
                if ( yy_accept[yy_current_state] )
                        {
-                       yy_last_accepting_state = yy_current_state;
-                       yy_last_accepting_cpos = yy_cp;
+                       (yy_last_accepting_state) = yy_current_state;
+                       (yy_last_accepting_cpos) = yy_cp;
                        }
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
@@ -1295,30 +1401,23 @@ static yy_state_type yy_get_previous_state()
                }
 
        return yy_current_state;
-       }
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
  *     next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-       {
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
        register int yy_is_jam;
-       register char *yy_cp = yy_c_buf_p;
+       register char *yy_cp = (yy_c_buf_p);
 
        register YY_CHAR yy_c = 1;
        if ( yy_accept[yy_current_state] )
                {
-               yy_last_accepting_state = yy_current_state;
-               yy_last_accepting_cpos = yy_cp;
+               (yy_last_accepting_state) = yy_current_state;
+               (yy_last_accepting_cpos) = yy_cp;
                }
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
@@ -1330,81 +1429,73 @@ yy_state_type yy_current_state;
        yy_is_jam = (yy_current_state == 130);
 
        return yy_is_jam ? 0 : yy_current_state;
-       }
-
+}
 
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-       {
-       register char *yy_cp = yy_c_buf_p;
+    static void yyunput (int c, register char * yy_bp )
+{
+       register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
 
        /* undo effects of setting up yytext */
-       *yy_cp = yy_hold_char;
+       *yy_cp = (yy_hold_char);
 
-       if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               register int number_to_move = yy_n_chars + 2;
-               register char *dest = &yy_current_buffer->yy_ch_buf[
-                                       yy_current_buffer->yy_buf_size + 2];
+               register int number_to_move = (yy_n_chars) + 2;
+               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                register char *source =
-                               &yy_current_buffer->yy_ch_buf[number_to_move];
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
 
-               while ( source > yy_current_buffer->yy_ch_buf )
+               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
                        *--dest = *--source;
 
                yy_cp += (int) (dest - source);
                yy_bp += (int) (dest - source);
-               yy_current_buffer->yy_n_chars =
-                       yy_n_chars = yy_current_buffer->yy_buf_size;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
-               if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
                }
 
        *--yy_cp = (char) c;
 
-
-       yytext_ptr = yy_bp;
-       yy_hold_char = *yy_cp;
-       yy_c_buf_p = yy_cp;
-       }
-#endif /* ifndef YY_NO_UNPUT */
-
+       (yytext_ptr) = yy_bp;
+       (yy_hold_char) = *yy_cp;
+       (yy_c_buf_p) = yy_cp;
+}
 
 #ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
+    static int input  (void)
 #endif
-       {
-       int c;
 
-       *yy_c_buf_p = yy_hold_char;
+{
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
 
-       if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
                {
                /* yy_c_buf_p now points to the character we want to return.
                 * If this occurs *before* the EOB characters, then it's a
                 * valid NUL; if not, then we've hit the end of the buffer.
                 */
-               if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        /* This was really a NUL. */
-                       *yy_c_buf_p = '\0';
+                       *(yy_c_buf_p) = '\0';
 
                else
                        { /* need more input */
-                       int offset = yy_c_buf_p - yytext_ptr;
-                       ++yy_c_buf_p;
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
 
-                       switch ( yy_get_next_buffer() )
+                       switch ( yy_get_next_buffer(  ) )
                                {
                                case EOB_ACT_LAST_MATCH:
                                        /* This happens because yy_g_n_b()
@@ -1418,16 +1509,16 @@ static int input()
                                         */
 
                                        /* Reset buffer status. */
-                                       yyrestart( yyin );
+                                       yyrestart(yyin );
 
-                                       /* fall through */
+                                       /*FALLTHROUGH*/
 
                                case EOB_ACT_END_OF_FILE:
                                        {
-                                       if ( yywrap() )
+                                       if ( yywrap( ) )
                                                return EOF;
 
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
 #ifdef __cplusplus
                                        return yyinput();
@@ -1437,90 +1528,92 @@ static int input()
                                        }
 
                                case EOB_ACT_CONTINUE_SCAN:
-                                       yy_c_buf_p = yytext_ptr + offset;
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
                                        break;
                                }
                        }
                }
 
-       c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
-       *yy_c_buf_p = '\0';     /* preserve yytext */
-       yy_hold_char = *++yy_c_buf_p;
-
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve yytext */
+       (yy_hold_char) = *++(yy_c_buf_p);
 
        return c;
-       }
-#endif /* YY_NO_INPUT */
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-       {
-       if ( ! yy_current_buffer )
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
 
-       yy_init_buffer( yy_current_buffer, input_file );
-       yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
        }
 
+       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+       yy_load_buffer_state( );
+}
 
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-       {
-       if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              yypop_buffer_state();
+        *              yypush_buffer_state(new_buffer);
+     */
+       yyensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
                return;
 
-       if ( yy_current_buffer )
+       if ( YY_CURRENT_BUFFER )
                {
                /* Flush out information for old buffer. */
-               *yy_c_buf_p = yy_hold_char;
-               yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       yy_current_buffer = new_buffer;
-       yy_load_buffer_state();
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       yy_load_buffer_state( );
 
        /* We don't actually know whether we did this switch during
         * EOF (yywrap()) processing, but the only time this flag
         * is looked at is after yywrap() is called, so it's safe
         * to go ahead and always set it.
         */
-       yy_did_buffer_switch_on_eof = 1;
-       }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-       {
-       yy_n_chars = yy_current_buffer->yy_n_chars;
-       yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-       yyin = yy_current_buffer->yy_input_file;
-       yy_hold_char = *yy_c_buf_p;
-       }
+       (yy_did_buffer_switch_on_eof) = 1;
+}
 
+static void yy_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
 
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-       {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
        YY_BUFFER_STATE b;
-
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
@@ -1529,75 +1622,75 @@ int size;
        /* yy_ch_buf has to be 2 characters longer than the size given because
         * we need to put in 2 end-of-buffer characters.
         */
-       b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
        if ( ! b->yy_ch_buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
        b->yy_is_our_buffer = 1;
 
-       yy_init_buffer( b, file );
+       yy_init_buffer(b,file );
 
        return b;
-       }
-
+}
 
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-       {
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
        if ( ! b )
                return;
 
-       if ( b == yy_current_buffer )
-               yy_current_buffer = (YY_BUFFER_STATE) 0;
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
        if ( b->yy_is_our_buffer )
-               yy_flex_free( (void *) b->yy_ch_buf );
-
-       yy_flex_free( (void *) b );
-       }
+               yyfree((void *) b->yy_ch_buf  );
 
+       yyfree((void *) b  );
+}
 
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-       {
-       yy_flush_buffer( b );
+{
+       int oerrno = errno;
+    
+       yy_flush_buffer(b );
 
        b->yy_input_file = file;
        b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-       b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-       b->yy_is_interactive = 0;
-#else
-       b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-       }
-
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
 
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+       errno = oerrno;
+}
 
-       {
-       if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
+       if ( ! b )
                return;
 
        b->yy_n_chars = 0;
@@ -1614,29 +1707,121 @@ YY_BUFFER_STATE b;
        b->yy_at_bol = 1;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       if ( b == yy_current_buffer )
-               yy_load_buffer_state();
+       if ( b == YY_CURRENT_BUFFER )
+               yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       yyensure_buffer_stack();
+
+       /* This block is copied from yy_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from yy_switch_to_buffer. */
+       yy_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       yy_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               yy_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
        }
+}
 
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
 
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-       {
-       YY_BUFFER_STATE b;
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
 
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
+       YY_BUFFER_STATE b;
+    
        if ( size < 2 ||
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
             base[size-1] != YY_END_OF_BUFFER_CHAR )
                /* They forgot to leave room for the EOB's. */
                return 0;
 
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
@@ -1650,56 +1835,51 @@ yy_size_t size;
        b->yy_fill_buffer = 0;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       yy_switch_to_buffer( b );
+       yy_switch_to_buffer( );
 
        return b;
-       }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-       {
-       int len;
-       for ( len = 0; yy_str[len]; ++len )
-               ;
-
-       return yy_scan_bytes( yy_str, len );
-       }
-#endif
+}
 
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+       return yy_scan_bytes(yystr,strlen(yystr) );
+}
 
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-       {
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
        YY_BUFFER_STATE b;
        char *buf;
        yy_size_t n;
        int i;
-
+    
        /* Get memory for full buffer, including space for trailing EOB's. */
-       n = len + 2;
-       buf = (char *) yy_flex_alloc( n );
+       n = _yybytes_len + 2;
+       buf = (char *) yyalloc(n  );
        if ( ! buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
-       for ( i = 0; i < len; ++i )
-               buf[i] = bytes[i];
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
 
-       buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = yy_scan_buffer( buf, n );
+       b = yy_scan_buffer(buf,n );
        if ( ! b )
                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
@@ -1709,148 +1889,196 @@ int len;
        b->yy_is_our_buffer = 1;
 
        return b;
-       }
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
 #endif
 
+static void yy_fatal_error (yyconst char* msg )
+{
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+}
 
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-       {
-       if ( yy_start_stack_ptr >= yy_start_stack_depth )
-               {
-               yy_size_t new_size;
+/* Redefine yyless() so it works in section 3 code. */
 
-               yy_start_stack_depth += YY_START_STACK_INCR;
-               new_size = yy_start_stack_depth * sizeof( int );
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               yytext[yyleng] = (yy_hold_char); \
+               (yy_c_buf_p) = yytext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               yyleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
 
-               if ( ! yy_start_stack )
-                       yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Accessor  methods (get/set functions) to struct members. */
 
-               else
-                       yy_start_stack = (int *) yy_flex_realloc(
-                                       (void *) yy_start_stack, new_size );
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
 
-               if ( ! yy_start_stack )
-                       YY_FATAL_ERROR(
-                       "out of memory expanding start-condition stack" );
-               }
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
 
-       yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
 
-       BEGIN(new_state);
-       }
-#endif
+/** Get the length of the current token.
+ * 
+ */
+int yyget_leng  (void)
+{
+        return yyleng;
+}
 
+/** Get the current token.
+ * 
+ */
 
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-       {
-       if ( --yy_start_stack_ptr < 0 )
-               YY_FATAL_ERROR( "start-condition stack underflow" );
+char *yyget_text  (void)
+{
+        return yytext;
+}
 
-       BEGIN(yy_start_stack[yy_start_stack_ptr]);
-       }
-#endif
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
 
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
 
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-       {
-       return yy_start_stack[yy_start_stack_ptr - 1];
-       }
-#endif
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
 
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
 #else
-static void yy_fatal_error( msg )
-char msg[];
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
 #endif
-       {
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-       }
 
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
 
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               yy_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               yypop_buffer_state();
+       }
 
-/* Redefine yyless() so it works in section 3 code. */
+       /* Destroy the stack itself. */
+       yyfree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
 
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-               yytext[yyleng] = yy_hold_char; \
-               yy_c_buf_p = yytext + n; \
-               yy_hold_char = *yy_c_buf_p; \
-               *yy_c_buf_p = '\0'; \
-               yyleng = n; \
-               } \
-       while ( 0 )
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
 
+    return 0;
+}
 
-/* Internal utility routines. */
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-       {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
        register int i;
        for ( i = 0; i < n; ++i )
                s1[i] = s2[i];
-       }
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-       {
+static int yy_flex_strlen (yyconst char * s )
+{
        register int n;
        for ( n = 0; s[n]; ++n )
                ;
 
        return n;
-       }
+}
 #endif
 
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-       {
+void *yyalloc (yy_size_t  size )
+{
        return (void *) malloc( size );
-       }
+}
 
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-       {
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
        /* The cast to (char *) in the following accommodates both
         * implementations that use char* generic pointers, and those
         * that use void* generic pointers.  It works with the latter
@@ -1859,28 +2087,19 @@ yy_size_t size;
         * as though doing an assignment.
         */
        return (void *) realloc( (char *) ptr, size );
-       }
+}
 
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-       {
-       free( ptr );
-       }
+void yyfree (void * ptr )
+{
+       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
 
-#if YY_MAIN
-int main()
-       {
-       yylex();
-       return 0;
-       }
-#endif
 #line 165 "uscan.l"
 
 
+
 int
 process_line(
     char *     line)
@@ -1959,11 +2178,11 @@ ll_parse_date(
        yyerror("invalid second");
     } else if(type < 4) {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
        ret = DATE;
     } else {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
        ret = DATE;
     }
     return ret;
@@ -1974,3 +2193,4 @@ yywrap(void)
 {
   return 1;
 }
+
index 69674cee313a33abe2a40e2429b55bcc3a1f5ada..e5d7fddf306aca749fa061169461f97193c471d8 100644 (file)
@@ -113,7 +113,7 @@ mode    { return MODE; }
 
 \"                     {
     if(string_buf != NULL) {
-       printf("ERROR:string_buf != NULL: %s\n",string_buf);
+       g_printf("ERROR:string_buf != NULL: %s\n",string_buf);
     }
     BEGIN(quotedpath);
     strappend(string_buf, yytext);
@@ -242,11 +242,11 @@ ll_parse_date(
        yyerror("invalid second");
     } else if(type < 4) {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
        ret = DATE;
     } else {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
        ret = DATE;
     }
     return ret;
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
new file mode 100644 (file)
index 0000000..db33d59
--- /dev/null
@@ -0,0 +1,8 @@
+EXTRA_DIST = \
+       deb \
+       rpm \
+       Makefile.am \
+       README 
+
+dist-hook:
+       rm -rf `find ${distdir} -name .svn`
diff --git a/packaging/Makefile.in b/packaging/Makefile.in
new file mode 100644 (file)
index 0000000..7a4d4e9
--- /dev/null
@@ -0,0 +1,733 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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 = packaging
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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@
+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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+       deb \
+       rpm \
+       Makefile.am \
+       README 
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  packaging/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  packaging/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+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
+
+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 \
+       dist-hook distclean distclean-generic distclean-libtool \
+       distdir dvi dvi-am html html-am info info-am install \
+       install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       uninstall uninstall-am
+
+
+dist-hook:
+       rm -rf `find ${distdir} -name .svn`
+# 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/packaging/README b/packaging/README
new file mode 100644 (file)
index 0000000..ea5689b
--- /dev/null
@@ -0,0 +1,25 @@
+This directory contains scripts and data files necessary to build various binary
+(or source) installation packages.  These are the currently functional packages:
+       -Macintosh OS X >=10.4 .pkg files
+       -RPMs for various OSes that use them.  TODO: Wiki page with a full
+        list of RPM using distros and versions the .spec supports.
+       -Solaris .pkg files for 9,10
+Coming soon:
+       -ebuilds for Gentoo
+       -.deb Debian style packages for various OSes that use them.
+       -.msi packages for Windows XP and Server 2003 
+
+The Directory layout is as follows:
+packaging/
+       common/         # Common files which can be shared by all packages such
+                       # License.txt, README, or Copyrights.  So far, empty :-)
+       deb/            # Debian
+       macosx-pkg/     # Macintosh OSX 
+       msi/            # MicroSoft Installer for Windows
+       rpm/            # RPM
+       sun-pkg/        # Solaris .pkg 
+
+Each subdirectory (except common) has a shell script named buildpkg.  This script will 
+actually build the package with Zmanda's defaults for you.
+
+See http://wiki.zmanda.com/index.php/Installation for more information.
diff --git a/packaging/deb/amanda-backup-client.README.Debian b/packaging/deb/amanda-backup-client.README.Debian
new file mode 100644 (file)
index 0000000..5a73992
--- /dev/null
@@ -0,0 +1,2 @@
+Amanda Forums are located at: http://forums.zmanda.com/                                                                                            
+Amanda Documentation is available at: http://wiki.zmanda.com/
diff --git a/packaging/deb/amanda-backup-client.dirs b/packaging/deb/amanda-backup-client.dirs
new file mode 100644 (file)
index 0000000..3c201ad
--- /dev/null
@@ -0,0 +1,10 @@
+etc/amanda
+usr/lib/amanda
+usr/libexec/amanda
+usr/share/lintian/overrides
+usr/share/man/man5
+usr/share/man/man8
+var/lib/amanda
+var/lib/amanda/gnutar-lists
+var/lib/amanda/example
+var/log/amanda
diff --git a/packaging/deb/amanda-backup-client.install b/packaging/deb/amanda-backup-client.install
new file mode 100644 (file)
index 0000000..3e572ef
--- /dev/null
@@ -0,0 +1,19 @@
+usr/lib/amanda/*
+usr/lib/amanda/application/*
+usr/libexec/amanda/*
+usr/libexec/amanda/application/*
+usr/sbin/amaespipe
+usr/sbin/amcryp*
+usr/sbin/amgpgcrypt
+usr/sbin/amoldrecover
+usr/sbin/amrecover
+usr/share/man/man5/amanda.conf.5
+usr/share/man/man5/amanda-client.conf.5
+usr/share/man/man8/amanda.8
+usr/share/man/man8/amcheckdump.8
+usr/share/man/man8/amrecover.8
+var/lib/amanda/*
+var/lib/amanda/gnutar-lists/*
+var/lib/amanda/example/xinetd.amandaclient
+var/lib/amanda/example/amanda-client.conf
+var/log/amanda/*
diff --git a/packaging/deb/amanda-backup-client.lintian b/packaging/deb/amanda-backup-client.lintian
new file mode 100644 (file)
index 0000000..b7069a4
--- /dev/null
@@ -0,0 +1,20 @@
+amanda-backup-client: binary-or-shlib-defines-rpath usr/lib/amanda/*
+amanda-backup-client: binary-or-shlib-defines-rpath usr/libexec/amanda/*
+amanda-backup-client: binary-or-shlib-defines-rpath amoldrecover amrecover
+amanda-backup-client: binary-without-manpage amaespipe
+amanda-backup-client: binary-without-manpage amcryp*
+amanda-backup-client: binary-without-manpage amgpgcrypt
+amanda-backup-client: binary-without-manpage amoldrecover
+amanda-backup-client: file-in-unusual-dir usr/libexec/amanda/*
+amanda-backup-client: manpage-has-bad-whatis-entry
+amanda-backup-client: non-standard-dir-in-usr usr/libexec
+amanda-backup-client: non-standard-dir-in-var var/log/amanda
+amanda-backup-client: non-standard-dir-in-var var/amanda
+amanda-backup-client: non-standard-dir-perm var/lib/amanda/gnutar-lists
+amanda-backup-client: non-standard-dir-perm var/log/amanda 
+amanda-backup-client: package-name-doesnt-match-sonames
+amanda-backup-client: setuid-binary usr/libexec/amanda/calcsize 
+amanda-backup-client: setuid-binary usr/libexec/amanda/killgrp 
+amanda-backup-client: setuid-binary usr/libexec/amanda/planner 
+amanda-backup-client: setuid-binary usr/libexec/amanda/rundump 
+amanda-backup-client: setuid-binary usr/libexec/amanda/runtar
diff --git a/packaging/deb/amanda-backup-client.postinst b/packaging/deb/amanda-backup-client.postinst
new file mode 100755 (executable)
index 0000000..c91894e
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+SYSCONFDIR="/etc"
+LOCALSTATEDIR="/var"
+LOGDIR="${LOCALSTATEDIR}/log/amanda/"
+AMHOMEDIR="${LOCALSTATEDIR}/lib/amanda"
+amanda_user=amandabackup
+amanda_group=disk
+xinetd_reload="restart"
+
+
+# Installing xinetd config and make it active.
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+       if [ ! -f /etc/xinetd.d/amandaclient ] ; then
+               cp ${AMHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient || exit 1
+               echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." 
+               if [ "${xinetd_reload}" = "reload" ] ; then
+                       /usr/sbin/invoke-rc.d xinetd ${xinetd_reload} # don't exit yet...
+                       if [ $? -ne 0 ] ; then
+                               echo -n "reload failed.  Attempting restart..." 
+                               /usr/sbin/invoke-rc.d xinetd restart || exit 1
+                       fi
+               else
+                       /usr/sbin/invoke-rc.d xinetd ${xinetd_reload} || exit 1
+               fi
+       fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '${LOCALSTATEDIR}/amanda/amandates'." 
+if [ ! -f ${LOCALSTATEDIR}/amanda/amandates ] ; then
+       touch ${LOCALSTATEDIR}/amanda/amandates || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'." 
+chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1
+chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1
+if [ -x /sbin/restorecon ] ; then
+      /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates  || exit 1
+fi
+
+# Install .amandahosts to client
+echo "`date +'%b %e %Y %T'`: Checking '${AMHOMEDIR}/.amandahosts' file." 
+if [ ! -f ${AMHOMEDIR}/.amandahosts ] ; then
+       touch ${AMHOMEDIR}/.amandahosts || exit 1
+fi
+for host in localhost localhost.localdomain ; do
+               if [ -z "`grep \"^${host}[[:blank:]]\+${amanda_user}[[:blank:]]\+amdump\" ${AMHOMEDIR}/.amandahosts`" ] ; then
+                       echo "${host} ${amanda_user} amdump" >> "${AMHOMEDIR}/.amandahosts" || exit 1
+               fi
+done
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.amandahosts || exit 1
+chmod 0600 ${AMHOMEDIR}/.amandahosts || exit 1
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '${SYSCONFDIR}/amanda/amanda-client.conf' file." 
+if [ ! -f ${SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+       cp ${AMHOMEDIR}/example/amanda-client.conf ${SYSCONFDIR}/amanda/amanda-client.conf || exit 1
+fi
+chown ${amanda_user}:${amanda_group} ${SYSCONFDIR}/amanda/amanda-client.conf || exit 1
+chmod 0600 ${SYSCONFDIR}/amanda/amanda-client.conf || exit 1
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '${AMHOMEDIR}/.gnupg'." 
+if [ ! -d ${AMHOMEDIR}/.gnupg ] ; then
+       echo "`date +'%b %e %Y %T'`: '${AMHOMEDIR}/.gnupg' will be created." 
+       mkdir ${AMHOMEDIR}/.gnupg || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${AMHOMEDIR}/.gnupg'." 
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.gnupg || exit 1
+chmod 700 ${AMHOMEDIR}/.gnupg || exit 1
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="${AMHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+       if [ -f ${KEYDIR} ] ; then
+               echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.save'." 
+               mv ${KEYDIR} ${KEYDIR}.save || exit 1
+       fi
+       echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." 
+       mkdir ${KEYDIR} || exit 1
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+       echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" 
+       ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" 
+chown ${amanda_user}:${amanda_group} ${KEYDIR} || exit 1
+chmod 0750 ${KEYDIR} || exit 1
+chmod 0600 ${KEYDIR}/${KEYFILE}* || exit 1
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '${AMHOMEDIR}/.profile' and ensuring correct environment." 
+if [ ! -f ${AMHOMEDIR}/.profile ] ; then
+       touch ${AMHOMEDIR}/.profile || exit 1
+fi
+if [ -z "`grep PATH ${AMHOMEDIR}/.profile | grep '/usr/sbin'`" ] ; then
+       echo "export PATH=\"\$PATH:/usr/sbin/\"" >> "${AMHOMEDIR}/.profile" || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${AMHOMEDIR}/.profile'" 
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.profile || exit 1
+chmod 0640 ${AMHOMEDIR}/.profile || exit 1
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" 
diff --git a/packaging/deb/amanda-backup-client.postrm b/packaging/deb/amanda-backup-client.postrm
new file mode 100755 (executable)
index 0000000..74ecbb8
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+# Automatically added by dh_makeshlibs
+# End automatically added section
diff --git a/packaging/deb/amanda-backup-client.substvars b/packaging/deb/amanda-backup-client.substvars
new file mode 100644 (file)
index 0000000..751fe57
--- /dev/null
@@ -0,0 +1 @@
+shlibs:Depends=amanda-backup-server, libc6 (>= 2.3.2.ds1-21), libncurses5 (>= 5.4-1), libreadline5
diff --git a/packaging/deb/amanda-backup-server.README.Debian b/packaging/deb/amanda-backup-server.README.Debian
new file mode 100644 (file)
index 0000000..3149356
--- /dev/null
@@ -0,0 +1,2 @@
+Amanda Forums are located at: http://forums.zmanda.com/                                                                                            
+Amanda Documentation is available at: http://wiki.zmanda.com/  
diff --git a/packaging/deb/amanda-backup-server.dirs b/packaging/deb/amanda-backup-server.dirs
new file mode 100644 (file)
index 0000000..026cce1
--- /dev/null
@@ -0,0 +1,8 @@
+etc/amanda
+usr/share/lintian/overrides
+usr/share/man/man5
+usr/share/man/man8
+var/lib/amanda
+var/lib/amanda/gnutar-lists
+var/lib/amanda/example/label-templates
+var/log/amanda
diff --git a/packaging/deb/amanda-backup-server.install b/packaging/deb/amanda-backup-server.install
new file mode 100644 (file)
index 0000000..42e429d
--- /dev/null
@@ -0,0 +1,12 @@
+usr/lib/amanda/* 
+usr/lib/amanda/application/*
+usr/libexec/amanda/*
+usr/libexec/amanda/application/*
+usr/sbin/*
+usr/share/man/man5/*
+usr/share/man/man8/*
+var/lib/amanda/*
+var/lib/amanda/gnutar-lists/*
+var/lib/amanda/example/*
+var/lib/amanda/example/label-templates/*
+var/log/amanda/*
diff --git a/packaging/deb/amanda-backup-server.lintian b/packaging/deb/amanda-backup-server.lintian
new file mode 100644 (file)
index 0000000..a6d62ac
--- /dev/null
@@ -0,0 +1,16 @@
+amanda-backup-server: binary-or-shlib-defines-rpath usr/lib/amanda/*
+amanda-backup-server: binary-or-shlib-defines-rpath usr/libexec/amanda/*
+amanda-backup-server: binary-or-shlib-defines-rpath usr/sbin/am*
+amanda-backup-server: binary-without-manpage amoldrecover
+amanda-backup-server: manpage-has-bad-whatis-entry
+amanda-backup-server: file-in-unusual-dir usr/libexec/amanda/*
+amanda-backup-server: non-standard-dir-in-usr usr/libexec
+amanda-backup-server: non-standard-dir-perm var/lib/amanda/gnutar-lists
+amanda-backup-server: non-standard-dir-perm var/log/amanda 
+amanda-backup-server: package-name-doesnt-match-sonames
+amanda-backup-server: setuid-binary usr/libexec/amanda/calcsize 
+amanda-backup-server: setuid-binary usr/libexec/amanda/dumper 
+amanda-backup-server: setuid-binary usr/libexec/amanda/killgrp 
+amanda-backup-server: setuid-binary usr/libexec/amanda/planner 
+amanda-backup-server: setuid-binary usr/libexec/amanda/rundump 
+amanda-backup-server: setuid-binary usr/libexec/amanda/runtar
diff --git a/packaging/deb/amanda-backup-server.postinst b/packaging/deb/amanda-backup-server.postinst
new file mode 100755 (executable)
index 0000000..76954d0
--- /dev/null
@@ -0,0 +1,125 @@
+#!/bin/sh
+# Debian recommends this.  Script exits on simple command failure.
+# set -e
+LOGDIR="/var/log/amanda/"
+SYSCONFDIR="/etc"
+LOCALSTATEDIR="/var"
+AMHOMEDIR="${LOCALSTATEDIR}/lib/amanda"
+amanda_user=amandabackup
+amanda_group=disk
+xinetd_reload="restart"
+
+if [ -d /etc/xinetd.d ] ; then
+       if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+               cp ${AMHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver || exit 1
+               chmod 0644 /etc/xinetd.d/amandaserver || exit 1
+               if [ -f /etc/xinetd.d/amandaclient ] ; then
+                       rm /etc/xinetd.d/amandaclient || exit 1
+               fi
+               echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." 
+               if [ "${xinetd_reload}" = "reload" ] ; then
+                       /usr/sbin/invoke-rc.d xinetd ${xinetd_reload} # don't exit yet!
+                       if [ $? -ne 0 ] ; then
+                               echo -n "reload failed.  Attempting restart..." 
+                               /usr/sbin/invoke-rc.d xinetd restart || exit 1
+                       fi
+               else
+                       /usr/sbin/invoke-rc.d xinetd ${xinetd_reload} || exit 1
+               fi
+       fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '${LOCALSTATEDIR}/amanda/amandates'." 
+if [ ! -f ${LOCALSTATEDIR}/amanda/amandates ] ; then
+       touch ${LOCALSTATEDIR}/amanda/amandates || exit 1
+fi
+if [ ${ret_val} -eq 0 ]; then
+       echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'." 
+       chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1
+       chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1
+       if [ -x /sbin/restorecon ] ; then
+             /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates  || exit 1
+       fi
+fi
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '${AMHOMEDIR}/.gnupg'." 
+if [ ! -d ${AMHOMEDIR}/.gnupg ] ; then
+       echo "`date +'%b %e %Y %T'`: '${AMHOMEDIR}/.gnupg' will be created." 
+       mkdir ${AMHOMEDIR}/.gnupg || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${AMHOMEDIR}/.gnupg'." 
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.gnupg || exit 1
+chmod 700 ${AMHOMEDIR}/.gnupg || exit 1
+
+# Install .amandahosts to server
+echo "`date +'%b %e %Y %T'`: Checking '${AMHOMEDIR}/.amandahosts' file." 
+if [ ! -f ${AMHOMEDIR}/.amandahosts ] ; then
+       touch ${AMHOMEDIR}/.amandahosts || exit 1
+fi
+for host in localhost localhost.localdomain ; do
+       if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" ${AMHOMEDIR}/.amandahosts`" ] ; then
+               echo "${host}   root amindexd amidxtaped" >>${AMHOMEDIR}/.amandahosts || exit 1
+       fi
+       if [ -z "`grep \"^${host}[[:blank:]]\+${amanda_user}[[:blank:]]\+amdump\" ${AMHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host} ${amanda_user} amdump" >>${AMHOMEDIR}/.amandahosts || exit 1
+       fi
+done
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.amandahosts || exit 1
+chmod 0600 ${AMHOMEDIR}/.amandahosts || exit 1
+
+# SSH RSA key generation for amdump
+KEYDIR="${AMHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="${amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+       if [ -f ${KEYDIR} ] ; then
+               echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.save'." 
+               mv ${KEYDIR} ${KEYDIR}.save || exit 1
+       fi
+       echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." 
+       mkdir ${KEYDIR} || exit 1
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+       echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" 
+       ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" 
+chown ${amanda_user}:${amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* || exit 1
+chmod 0750 ${KEYDIR} || exit 1
+chmod 0600 ${KEYDIR}/${KEYFILE}* || exit 1
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="${AMHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+       if [ -f ${KEYDIR} ] ; then
+               echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.save'." 
+               mv ${KEYDIR} ${KEYDIR}.save || exit 1
+       fi
+       echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." 
+       mkdir ${KEYDIR} || exit 1
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+       echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" 
+       ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" 
+chown ${amanda_user}:${amanda_group} ${KEYDIR} || exit 1
+chmod 0750 ${KEYDIR} || exit 1
+chmod 0600 ${KEYDIR}/${KEYFILE}* || exit 1
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '${AMHOMEDIR}/.profile' and ensuring correct environment." 
+if [ ! -f ${AMHOMEDIR}/.profile ] ; then
+       touch ${AMHOMEDIR}/.profile || exit 1
+fi
+if [ -z "`grep PATH ${AMHOMEDIR}/.profile | grep '/usr/sbin'`" ] ; then
+       echo "export PATH=\"\$PATH:/usr/sbin/\"" >> "${AMHOMEDIR}/.profile" || exit 1
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${AMHOMEDIR}/.profile'" 
+chown ${amanda_user}:${amanda_group} ${AMHOMEDIR}/.profile || exit 1
+chmod 0640 ${AMHOMEDIR}/.profile || exit 1
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" 
diff --git a/packaging/deb/amanda-backup-server.postrm b/packaging/deb/amanda-backup-server.postrm
new file mode 100755 (executable)
index 0000000..74ecbb8
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+# Automatically added by dh_makeshlibs
+# End automatically added section
diff --git a/packaging/deb/amanda-backup-server.substvars b/packaging/deb/amanda-backup-server.substvars
new file mode 100644 (file)
index 0000000..c27ee0c
--- /dev/null
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.3.2.ds1-21), libncurses5 (>= 5.4-1), libreadline5
diff --git a/packaging/deb/buildpkg b/packaging/deb/buildpkg
new file mode 100755 (executable)
index 0000000..79d8721
--- /dev/null
@@ -0,0 +1,130 @@
+#! /bin/bash
+set -x
+#### Configure variables.  Feel free to change these, but be careful!
+SRCDIR=$(pwd)
+# You can pass your own temp directory as an environment variable.
+if [ -z $TMPDIR ]
+then
+    TMPDIR="/tmp/buildpkg.deb"
+fi
+# This prefix is prepended to all directories during "make install" 
+FAKEROOT="${TMPDIR}/froot"
+# Configure and Compilation directory.
+BUILDDIR="${TMPDIR}/build"
+# Config variables to mirror those in RPM .spec file
+amanda_user=amandabackup
+amanda_group=admin
+udpportrange="700,740"
+tcpportrange="11000,11040"
+low_tcpportrange="700,710"
+PREFIX="/usr"
+EPREFIX="${PREFIX}"
+BINDIR="${EPREFIX}/bin"
+SBINDIR="${EPREFIX}/sbin"
+LIBEXECDIR="${EPREFIX}/lib/amanda"
+DATADIR="${PREFIX}/share"
+SYSCONFDIR="/etc"
+LOCALSTATEDIR="/var"
+AMANDAHOMEDIR="${LOCALSTATEDIR}/lib/amanda"
+LIBDIR="${EPREFIX}/lib"
+INCLUDEDIR="${PREFIX}/include"
+INFODIR="${PREFIX}/info"
+MANDIR="${DATADIR}/man"
+LOGDIR="${LOCALSTATEDIR}/log/amanda"                  
+
+#### CHECKS
+
+if [ ! -f common-src/amanda.h ]
+then
+    echo "'buildpkg' must be run from the root of an otherwise unused amanda source directory." >&2
+    exit 1
+fi
+
+if [ ! -f configure ]
+then
+    echo "The source directory has not been autogen'd -- please download a source distribution tarball or run ./autogen."
+    echo "You will need autoconf, automake, and libtool to run autogen (but not to compile from a distribution tarball)."
+    exit 1
+fi
+
+if [ -z $AMVER ]
+then
+    AMVER=amanda-2.6.0
+fi
+
+if [ -z $AMTARBALL ]
+then
+    AMTARBALL=$AMVER.tar.gz
+fi
+
+#### Build functions
+
+do_build() {
+
+    echo "Running configure"
+    ./configure --quiet \
+        --prefix=${PREFIX} \
+        --bindir=${BINDIR} \
+        --sbindir=${SBINDIR} \
+        --mandir=${MANDIR} \
+        --libexecdir=${LIBEXECDIR} \
+        --sysconfdir=${SYSCONFDIR} \
+        --localstatedir=${LOCALSTATEDIR} \
+        --with-star=/bin/star \
+        --with-gnutar=/bin/tar \
+        --with-gnutar-listdir=${AMANDAHOMEDIR}/gnutar-lists \
+        --with-index-server=localhost \
+        --with-tape-server=localhost \
+        --with-user=${amanda_user} \
+        --with-group=${amanda_group} \
+        --with-owner=${amanda_user} \
+        --with-fqdn \
+        --with-bsd-security \
+        --with-bsdtcp-security \
+        --with-bsdudp-security \
+        --with-amandahosts \
+        --with-smbclient=/usr/bin/smbclient \
+        --with-ssh-security \
+        --with-udpportrange=${udpportrange} \
+        --with-tcpportrange=${tcpportrange} \
+        --with-low-tcpportrange=${low_tcpportrange} \
+        --with-debugging=${LOGDIR} \
+        --disable-installperms \
+        --enable-s3-device \
+        --with-assertions \
+       || exit 1
+
+}
+
+do_resources() {
+    # Setup directories and files as dpkg-buildpkg expects.
+    if [ -d debian ]; then
+        rm -rf debian
+    fi
+    cp -Rf packaging/deb debian
+    if [ -d $AMVER ]; then
+        rm -rf $AMVER
+    fi
+    mkdir $AMVER
+    cp -Rfp * $AMVER
+}
+
+do_package() {
+
+    echo "Building package"
+    cd $AMVER
+    # This assumes that you have loaded zmanda's GPG key into your keyring to
+    # sign the packages.
+    dpkg-buildpackage -rfakeroot -k3C5D1C92 -tc
+}
+
+
+do_all() {
+    do_build $1
+    do_resources $1
+    do_package $1
+}
+
+do_build
+do_resources
+do_package
diff --git a/packaging/deb/changelog b/packaging/deb/changelog
new file mode 100644 (file)
index 0000000..f6d8d84
--- /dev/null
@@ -0,0 +1,6 @@
+amanda (2.6.0-1) unstable; urgency=low
+
+  * Initial debian release: This package is based on Bdale Garbee's work as
+    the official debian maintainer for amanda.
+
+ -- Zmanda <support@zmanda.com>  Mon, 10 Mar 2008 1:00:09 -0600
diff --git a/packaging/deb/compat b/packaging/deb/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/packaging/deb/control b/packaging/deb/control
new file mode 100644 (file)
index 0000000..76afb65
--- /dev/null
@@ -0,0 +1,36 @@
+Source: amanda
+Section: utils
+Priority: optional
+Maintainer: Zmanda Inc <support@zmanda.com>
+Build-Depends: dump, gnuplot, libncurses5-dev, libreadline5-dev | libreadline-dev, libtool, flex, perl (>=5.6.0), smbclient, mailx, mtx
+Standards-Version: 3.6.1
+
+Package: amanda-backup-server
+Architecture: any
+Depends: xinetd, perl (>=5.6.0), mailx, gnuplot, tar (>=1.15), curl (>=7.10.0), libglib2.0-0 (>=2.2.0)
+Suggests: amanda-backup-client (= ${Source-Version})
+Description: Amanda Network Backup and Archiving software
+ .
+ Amanda is the leading Open-Source Backup and Archiving software.
+ .
+ This package contains the Amanda server.  The amanda-backup_server package 
+ should be installed on the Amanda server, i.e. the machine attached to backup 
+ media (such as a tape drive or disk drives) where backups will be written.  The 
+ amanda-backup_server package includes Amanda client.
+ .
+ Amanda Forums are located at: http://forums.zmanda.com/
+ Amanda Documentation is available at: http://wiki.zmanda.com/
+
+Package: amanda-backup-client
+Architecture: any
+Depends: xinetd, perl (>=5.6.0), libglib2.0-0 (>=2.2.0)
+Conflicts: amanda-backup-server (>=${Source-Version})
+Description: Amanda Network Backup and Archiving software
+ .
+ Amanda is the leading Open-Source Backup and Archiving software.
+ .
+ This package contains the Amanda client.  The amanda-backup_client package
+ needs to be installed on every system that is being backed up.
+ .
+ Amanda Forums are located at: http://forums.zmanda.com/
+ Amanda Documentation is available at: http://wiki.zmanda.com/
diff --git a/packaging/deb/copyright b/packaging/deb/copyright
new file mode 100644 (file)
index 0000000..51bf3d5
--- /dev/null
@@ -0,0 +1,26 @@
+
+Builder: Zmanda 
+Amanda copyright: http://wiki.zmanda.com/index.php/Amanda_Copyright
+
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991, 1996 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
diff --git a/packaging/deb/debian-binary b/packaging/deb/debian-binary
new file mode 100644 (file)
index 0000000..6ec12fe
--- /dev/null
@@ -0,0 +1 @@
+version: 2.0
diff --git a/packaging/deb/docs b/packaging/deb/docs
new file mode 100644 (file)
index 0000000..6f83607
--- /dev/null
@@ -0,0 +1,3 @@
+AUTHORS
+NEWS
+README
diff --git a/packaging/deb/postrm b/packaging/deb/postrm
new file mode 100755 (executable)
index 0000000..d9fde01
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+case "$1" in
+  purge)
+       if [ -d /etc/amanda ]; then
+               # remove /etc amanda if there are no files left
+               rmdir /etc/amanda 2> /dev/null || true
+       fi
+       if [ -d /var/log/amanda ]; then
+               rm -rf /var/log/amanda
+       fi
+       if [ -d /var/lib/amanda/gnutar-lists ]; then
+               rm -rf /var/lib/amanda/gnutar-lists
+       fi
+       if [ -d /var/lib/amanda ]; then
+               rm -rf /var/lib/amanda
+       fi
+       if which deluser >/dev/null 2>&1 ; then
+               for group in disk; do
+                       # only call deluser when amandabackup is in $group
+                       if getent group "$group" |
+                          awk -F: '{ print $4 }' |
+                          awk -F, '{ for (i=1; i <= NF; i++ ) print $i }' |
+                          grep '^amandabackup$' > /dev/null; then
+                               deluser "amandabackup$group" || true
+                       fi
+               done
+       fi
+  ;;
+  remove|upgrade|deconfigure)
+  ;;
+
+  failed-upgrade)
+  ;;
+
+  *)
+        echo "unknown argument --> $1" >&2
+        exit 0
+  ;;
+esac
diff --git a/packaging/deb/preinst b/packaging/deb/preinst
new file mode 100755 (executable)
index 0000000..7b58632
--- /dev/null
@@ -0,0 +1,127 @@
+#!/bin/sh 
+
+amanda_user=amandabackup
+amanda_group=disk
+
+TMPFILE=`mktemp /tmp/deb-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+       echo "Unable to mktemp!" 1>&2
+       exit 1
+fi
+LOGDIR="/var/log/amanda"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install Amanda" >${TMPFILE}
+
+# Check for the '${amanda_user}' user
+echo "`date +'%b %e %Y %T'`: Checking for ${amanda_user} user..." >>${TMPFILE}
+if [ "`id -u ${amanda_user} >/dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+       useradd -c "Amanda" -g ${amanda_group} -d /var/lib/amanda -s /bin/sh ${amanda_user}
+       # Lock the ${amanda_user} account until admin sets password
+       passwd -l ${amanda_user} >>/dev/null
+       PASSWD_EXIT=$?
+       if [ ${PASSWD_EXIT} -eq 0 ] ; then
+               echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  The ${amanda_user} user account has been successfully created." >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '${amanda_user}'" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  # passwd -u ${amanda_user}" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in /etc/amanda" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '${amanda_user}'" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  that /var/lib/amanda/.amandahosts on your client systems" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  '${amanda_user}'." >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+               PASSWD_OK=0
+       else
+               echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  The '${amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  user account '${amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!   # passwd ${amanda_user}" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+               PASSWD_OK=1
+       fi
+else
+       # log information about '${amanda_user}' user parameters
+       echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  user '${amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  HOME:           /var/lib/amanda" >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  Default group:  ${amanda_group} " >>${TMPFILE}
+       echo "`date +'%b %e %Y %T'`:  Verifying ${amanda_user} user parameters :" >>${TMPFILE}
+       
+
+        if [ "`id -gn ${amanda_user}`" != "${amanda_group} " ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user '${amanda_user}' is not part of the ${amanda_group}  group,Pl !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  make sure it is corrected before start using amanda  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user '${amanda_user}'" >>${TMPFILE}
+        fi
+
+       echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+       PASSWD_OK=0
+fi
+if [ -d /var/lib/amanda ] ; then
+       echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '/var/lib/amanda'... " >>${TMPFILE}
+       if [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[3]}'`" = "${amanda_user}" ] && \
+          [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[4]}'`" = "${amanda_group} " ] ; then
+               echo "correct." >>${TMPFILE}
+               VARLIB_OK=0
+       else
+               echo "incorrect!" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '/var/lib/amanda' is owned by" >>${TMPFILE}
+               echo "`date +'%b %e %Y %T'`:  the user '${amanda_user}' and group '${amanda_group} '." >>${TMPFILE}
+               VARLIB_OK=1
+       fi
+else
+       VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+if [ ! -e ${LOGDIR} ] ; then
+       # create log directory
+       mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+       chown ${amanda_user}:${amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+fi
+
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+       cat ${TMPFILE}
+       cat ${TMPFILE} >>${INSTALL_ERR}
+       echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installation." >&2
+       echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+       exit 1
+else
+       cat ${TMPFILE}
+       cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+       rm -f "${TMPFILE}"
+fi
+
diff --git a/packaging/deb/rules b/packaging/deb/rules
new file mode 100755 (executable)
index 0000000..4f78677
--- /dev/null
@@ -0,0 +1,192 @@
+#!/usr/bin/make -f
+# debian/rules for amanda using debhelper. GNU copyright 2008 by Dan Locks, 
+# based on work by Bdale Garbee.
+# requires automake 1.2d (from experimental tree)
+
+#      Warning - do *not* use -j on an SMP machine, or the build gets
+#              confused... some sort of race condition in the makefiles?
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+AMVER=2.6.0
+
+# These are variables that the user can override.  They get used in various
+# places during configure, build, and install.
+PREFIX=/usr
+BINDIR=$(PREFIX)/bin
+LIBDIR=$(PREFIX)/lib
+AMLIBDIR=$(LIBDIR)/amanda
+LIBEXECDIR=$(PREFIX)/libexec
+AMLIBEXECDIR=$(LIBEXECDIR)/amanda
+MANDIR=$(PREFIX)/share/man
+DOCDIR=$(PREFIX)/share/doc
+SYSCONFDIR=/etc
+LOCALSTATEDIR=/var
+AMHOMEDIR=$(LOCALSTATEDIR)/lib/amanda
+LOGDIR=$(LOCALSTATEDIR)/log/amanda
+AMANDAUSER=amandabackup
+AMANDAGROUP=disk
+WITHOUT_SERVER="False"
+WITHOUT_CLIENT="False"
+
+r=$(shell pwd)/debian/amanda-common
+server=$(shell pwd)/debian/amanda-backup-server
+client=$(shell pwd)/debian/amanda-backup-client
+
+log=$(shell pwd)/debian/dpkg.log
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+build: build-stamp 
+build-stamp: /sbin/dump /usr/bin/smbclient 
+       dh_testdir
+       ./configure \
+               MAKEFLAGS="-j1 " \
+               CFLAGS="-DIGNORE_TAR_ERRORS " \
+               MAILER=/usr/bin/mail \
+               --quiet \
+               --host=$(DEB_HOST_GNU_TYPE) \
+               --build=$(DEB_BUILD_GNU_TYPE) \
+               --prefix=$(PREFIX) \
+               --bindir=$(BINDIR) \
+               --mandir=$(MANDIR) \
+               --libexecdir=$(LIBEXECDIR) \
+               --enable-shared \
+               --sysconfdir=$(SYSCONFDIR) \
+               --localstatedir=$(LOCALSTATEDIR)\
+               --with-star=/bin/star \
+               --with-gnutar=/bin/tar \
+               --with-gnutar-listdir=$(AMHOMEDIR)/gnutar-lists \
+               --with-index-server=localhost \
+               --with-tape-server=localhost \
+               --with-user=$(AMANDAUSER) \
+               --with-group=$(AMANDAGROUP) \
+                --with-fqdn \
+               --with-bsd-security \
+                --with-bsdtcp-security \
+                --with-bsdudp-security \
+               --with-amandahosts \
+               --with-smbclient=$(BINDIR)/smbclient \
+               --with-debugging=$(LOGDIR) \
+               --with-tcpportrange=11000,11040 \
+               --with-udpportrange=700,740 \
+                --with-low-udpportrange=700,710 \
+               --with-ssh-security \
+               --with-assertions \
+               --enable-s3-device \
+               --disable-installperms
+       touch missing
+       make 
+       touch build-stamp
+
+clean:
+       dh_testdir >> $(log) 2>&1
+       dh_testroot >> $(log) 2>&1
+       -make clean
+       -make distclean
+       -rm -f build-stamp missing config/config.h common-src/genversion
+       -find . -type d -name .deps -exec rm -rf {} \;
+       -test -r /usr/share/misc/config.sub && \
+               cp -f /usr/share/misc/config.sub config/config.sub
+       -test -r /usr/share/misc/config.guess && \
+               cp -f /usr/share/misc/config.guess config/config.guess
+       dh_clean >> $(log) 2>&1
+
+# Build architecture-dependent files here.
+binary-arch: build
+       echo "---->dh_testdir: " >> $(log)
+       dh_testdir >> $(log) 2>&1
+       echo "---->dh_testroot: " >> $(log)
+       dh_testroot >> $(log) 2>&1
+       echo "---->dh_clean: " >> $(log)
+       dh_clean -k >> $(log) 2>&1
+       echo "---->dh_installdirs: " >> $(log)
+       dh_installdirs -v >> $(log) 2>&1
+       make install DESTDIR=$(r)
+       echo "---->dh_installdocs: " >> $(log)
+       dh_installdocs -v >> $(log) 2>&1
+       install -d $(r)/$(DOCDIR)/amanda-common/examples
+       cp -a example/* $(r)/$(DOCDIR)/amanda-common/examples
+       cp ChangeLog $(r)/$(DOCDIR)/amanda-common/changelog
+       echo "---->dh_installmenu: " >> $(log)
+       dh_installmenu -v >> $(log) 2>&1
+       echo "---->dh_installcron: " >> $(log)
+       dh_installcron >> $(log) 2>&1
+       echo "---->dh_installchangelogs: " >> $(log)
+       dh_installchangelogs -v >> $(log) 2>&1
+       echo "---->dh_installdebconf: " >> $(log)
+       dh_installdebconf -v >> $(log) 2>&1
+       echo `pwd` >> $(log)
+       echo "---->dh_install -v: " >> $(log)
+       dh_install -v --sourcedir=debian/amanda-common >> $(log) 2>&1
+       echo "---->dh_strip: " >> $(log)
+       dh_strip >> $(log) 2>&1
+       echo "---->dh_compress: " >> $(log)
+       dh_compress >> $(log) 2>&1
+       echo "---->dh_movefiles: " >> $(log)
+       dh_movefiles --sourcedir=debian/amanda-common >> $(log) 2>&1
+       echo "---->dh_fixperms: " >> $(log)
+       dh_fixperms -v >> $(log) 2>&1
+       # fix perms manually
+       chown -R $(AMANDAUSER):$(AMANDAGROUP) debian/*/var/lib/*
+       #chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
+       chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(LOGDIR)
+       #chmod -R u=rwX,g=rwX,o-rwx $(server)/$(LOGDIR)
+       chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(SYSCONFDIR)/amanda
+       #chmod -R u=rwX,g=rwX,o-rwx $(server)/$(SYSCONFDIR)/amanda
+       chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMHOMEDIR)/gnutar-lists
+       chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists
+       # .. setuid
+       chown root:disk \
+               $(client)/$(AMLIBEXECDIR)/killpgrp \
+               $(client)/$(AMLIBEXECDIR)/rundump \
+               $(client)/$(AMLIBEXECDIR)/runtar \
+               $(client)/$(AMLIBEXECDIR)/calcsize \
+               $(server)/$(AMLIBEXECDIR)/killpgrp \
+               $(server)/$(AMLIBEXECDIR)/rundump \
+               $(server)/$(AMLIBEXECDIR)/runtar \
+               $(server)/$(AMLIBEXECDIR)/calcsize \
+               $(server)/$(AMLIBEXECDIR)/dumper \
+               $(server)/$(AMLIBEXECDIR)/planner \
+               $(server)/usr/sbin/amcheck
+       chmod u=srwx,g=rx,o=r \
+               $(client)$(AMLIBEXECDIR)/killpgrp \
+               $(client)$(AMLIBEXECDIR)/rundump \
+               $(client)$(AMLIBEXECDIR)/runtar \
+               $(client)$(AMLIBEXECDIR)/calcsize \
+               $(server)$(AMLIBEXECDIR)/killpgrp \
+               $(server)$(AMLIBEXECDIR)/rundump \
+               $(server)$(AMLIBEXECDIR)/runtar \
+               $(server)$(AMLIBEXECDIR)/calcsize \
+               $(server)$(AMLIBEXECDIR)/dumper \
+               $(server)$(AMLIBEXECDIR)/planner \
+               $(server)/usr/sbin/amcheck
+       echo "Amanda version $(AMVER)" >  $(server)/$(AMHOMEDIR)/amanda-release 
+       echo "Amanda version $(AMVER)" >  $(client)/$(AMHOMEDIR)/amanda-release 
+       install -o root -g root -m 0644 debian/amanda-backup-client.lintian \
+               $(client)/usr/share/lintian/overrides/amanda-backup-client
+       #install -o root -g root -m 0644 debian/amanda-common.lintian \
+       #       $(r)/usr/share/lintian/overrides/amanda-common
+       install -o root -g root -m 0644 debian/amanda-backup-server.lintian \
+               $(server)/usr/share/lintian/overrides/amanda-backup-server
+       dh_makeshlibs  >> $(log) 2>&1
+       dh_installdeb >> $(log) 2>&1
+       dh_shlibdeps -l"debian/$(r)/usr/lib:debian/$(client)/usr/lib:debian/$(server)/usr/lib" >> $(log) 2>&1
+       # strip out the non-versioned amanda-common references, we need
+       # the versioned ones in the control file and dupes are ugly...
+       sed -e 's/amanda-common, //' < debian/amanda-backup-server.substvars > debian/blah
+       mv debian/blah debian/amanda-backup-server.substvars
+       sed -e 's/amanda-common, //' < debian/amanda-backup-client.substvars > debian/blah
+       mv debian/blah debian/amanda-backup-client.substvars
+       dh_gencontrol >> $(log) 2>&1
+       dh_md5sums  >> $(log) 2>&1
+       dh_builddeb  >> $(log) 2>&1
+
+source diff:                                                                  
+       @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-arch
+.PHONY: build clean binary-arch binary
diff --git a/packaging/deb/watch b/packaging/deb/watch
new file mode 100644 (file)
index 0000000..d1101ce
--- /dev/null
@@ -0,0 +1,2 @@
+# Compulsory line, this is a version 2 file
+version=2
diff --git a/packaging/rpm/amanda.spec b/packaging/rpm/amanda.spec
new file mode 100644 (file)
index 0000000..51b87b8
--- /dev/null
@@ -0,0 +1,1786 @@
+#
+#                  Copyright (C) 2005 Zmanda Incorporated.
+#                            All Rights Reserved.
+#
+#  This program is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License version 2 as published
+#  by the Free Software Foundation.
+# 
+#  This program is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+#  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#  for more details.
+# 
+#  You should have received a copy of the GNU General Public License along
+#  with this program; if not, write to the Free Software Foundation, Inc.,
+#  59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# 
+#  Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+#  Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+
+%define build_srpm 0
+%{?srpm_only: %define build_srpm 1}
+
+# Pkg-config sometimes needs its own path set, and we need to allow users to
+# override our guess during detection.  This macro takes care of that.
+# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is 
+# set then use the env var.
+%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}}
+
+%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}}
+
+# Define which Distribution we are building:
+# Try to detect the distribution we are building:
+%if %{_vendor} == redhat 
+    # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least
+    # fc3-7.  So RHEL and Fedora look at the same file.  The awk trickery here
+    # forces the field to be numeric so that the spec comparison works
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3
+        %define dist fedora
+        %define disttag fc
+        %define distver 3
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4
+        %define dist fedora
+        %define disttag fc
+        %define distver 4
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5
+        %define dist fedora
+        %define disttag fc
+        %define distver 5
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6
+        %define dist fedora
+        %define disttag fc
+        %define distver 6
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7
+        %define dist fedora
+        %define disttag fc
+        %define distver 7
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8
+        %define dist fedora
+        %define disttag fc
+        %define distver 8
+        # TODO: generalize this so that any platform can cross compile
+        %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686
+                # Do nothing if PKG_CONFIG_PATH was set by the user above.
+                %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig}
+        %endif
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3
+        %define dist redhat
+        %define disttag rhel
+        %define distver 3
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4
+        %define dist redhat
+        %define disttag rhel
+        %define distver 4
+    %endif
+    %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5
+        %define dist redhat
+        %define disttag rhel
+        %define distver 5
+    %endif
+%endif
+# Detect Suse variants.  Suse gives us some nice macros in their rpms
+%if %{_vendor} == "suse"
+    %if %{suse_version} == 910
+        %define dist SuSE
+        %define disttag sles
+        %define distver 9
+    %endif
+    %if %{suse_version} == 1010
+        %define dist SuSE
+        %define disttag sles
+        %define distver 10
+    %endif
+    %if %{suse_version} == 1000
+        %define dist SuSE
+        %define disttag suse
+        %define distver 10
+    %endif
+%endif
+
+# Set options per distribution
+%if %{dist} == redhat || %{dist} == fedora
+    %define rpm_group Applications/Archiving
+    %define xinetd_reload restart
+%endif
+%if %{dist} == SuSE
+    %define rpm_group Productivity/Archiving/Backup
+    %define xinetd_reload restart
+%endif
+
+%define packer %(%{__id_u} -n)
+
+# --- Definitions ---
+
+# Define amanda_version if it is not already defined.
+%{!?amanda_version: %define amanda_version 2.6.0}
+%{!?amanda_release: %define amanda_release 1}
+%define amanda_version_info "Amanda Community Edition - version %{amanda_version}"
+%define amanda_user amandabackup
+%define amanda_group disk
+%define udpportrange "700,740"
+%define tcpportrange "11000,11040"
+%define low_tcpportrange "700,710"
+
+Summary: The Amanda Backup and Archiving System
+Name: amanda
+Version: %{amanda_version}
+%define rpm_release %{amanda_release}.%{disttag}%{distver}
+%if %{build_srpm}
+%define rpm_release %{amanda_release}
+%endif
+Release: %{rpm_release}
+Source: %{name}-%{version}.tar.gz
+License: http://wiki.zmanda.com/index.php/Amanda_Copyright
+Vendor: Zmanda, Inc.
+Packager: www.zmanda.com
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot
+Group: %{rpm_group}
+# TODO - Need required versions for these:
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: binutils
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gcc
+BuildRequires: glibc >= 2.2.0
+BuildRequires: readline
+BuildRequires: curl >= 7.10.0
+Requires: /bin/awk
+Requires: /bin/date
+Requires: /usr/bin/id
+Requires: /sbin/ldconfig
+Requires: /bin/sh
+Requires: /usr/sbin/useradd
+Requires: /usr/sbin/usermod
+Requires: fileutils
+Requires: grep
+Requires: gnuplot
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: curl >= 7.10.0
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+%if  %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version}
+
+%package backup_client
+Summary: The Amanda Backup and Archiving Client
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+%if  %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Requires: xinetd
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+Provides: amanda-backup_client = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Conflicts: amanda-backup_server 
+
+%package backup_server
+Summary: The Amanda Backup and Archiving Server
+Group: %{rpm_group}
+Requires: /bin/awk
+Requires: fileutils
+Requires: grep
+Requires: libc.so.6
+Requires: libm.so.6
+Requires: libnsl.so.1
+%if  %{dist} == redhat || %{dist}== fedora
+Requires: libtermcap.so.2
+Requires: initscripts
+%endif
+Requires: xinetd
+Requires: perl >= 5.6.0
+Requires: tar >= 1.15
+Provides: amanda-backup_server = %{amanda_version}
+Provides: libamclient-%{version}.so = %{amanda_version}
+Provides: libamanda-%{version}.so = %{amanda_version}
+Provides: libamserver-%{version}.so = %{amanda_version}
+Provides: librestore-%{version}.so = %{amanda_version}
+Provides: libamtape-%{version}.so = %{amanda_version}
+Provides: libamdevice-%{version}.so = %{amanda_version}
+
+# --- Package descriptions ---
+
+%description
+Amanda is the leading Open-Source Backup and Archiving software.
+
+The amanda-backup_server package should be installed on the Amanda server, i.e. 
+the machine attached to backup media (such as a tape drive or disk 
+drives) where backups will be written. The amanda-backup_server package
+includes Amanda client.  The amanda-backup_client package needs 
+to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_server
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda server.  The amanda-backup_server package 
+should be installed on the Amanda server, i.e. the machine attached 
+to backup media (such as a tape drive or disk drives) where backups 
+will be written.  The amanda-backup_server package includes Amanda client.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+
+
+%description backup_client
+Amanda is the leading Open-Source Backup and Archiving software.
+
+This package contains the Amanda client.  The amanda-backup_client package  
+needs to be installed on every system that is being backed up.
+
+Amanda Forums is located at: http://forums.zmanda.com/
+Amanda Documentation is available at: http://wiki.zmanda.com/
+
+# --- Directory setup ---
+
+# Configure directories:
+%define PREFIX          /usr
+%define EPREFIX         %{PREFIX}
+%define BINDIR          %{EPREFIX}/bin
+%define SBINDIR         %{EPREFIX}/sbin
+%define LIBEXECDIR      %{EPREFIX}/libexec
+%define AMLIBEXECDIR    %{LIBEXECDIR}/amanda
+%define DATADIR         %{PREFIX}/share
+%define SYSCONFDIR      /etc
+%define LOCALSTATEDIR   /var
+%define AMANDAHOMEDIR   %{LOCALSTATEDIR}/lib/amanda
+%ifarch x86_64
+%define LIBDIR          %{EPREFIX}/lib64
+%else
+%define LIBDIR          %{EPREFIX}/lib
+%endif
+%define AMLIBDIR        %{LIBDIR}/amanda
+%define INCLUDEDIR      %{PREFIX}/include
+%define MANDIR          %{DATADIR}/man
+%define LOGDIR          /var/log/amanda
+%define PERLSITELIB     %(eval "`perl -V:installsitelib`"; echo $installsitelib)
+
+# Installation directories:
+%define ROOT_SBINDIR            %{buildroot}/%{SBINDIR}
+%define ROOT_LIBEXECDIR         %{buildroot}/%{LIBEXECDIR}
+%define ROOT_DATADIR            %{buildroot}/%{DATADIR}
+%define ROOT_LOCALSTATEDIR      %{buildroot}/%{LOCALSTATEDIR}
+%define ROOT_SYSCONFDIR         %{buildroot}/%{SYSCONFDIR}
+%define ROOT_AMANDAHOMEDIR      %{buildroot}/%{AMANDAHOMEDIR}
+%define ROOT_LIBDIR             %{buildroot}/%{LIBDIR}
+%define ROOT_MANDIR             %{buildroot}/%{MANDIR}
+%define ROOT_LOGDIR             %{buildroot}/%{LOGDIR}
+
+# --- Unpack ---
+
+%prep
+%setup -q
+# --- Configure and compile ---
+
+%build
+%define config_user %{amanda_user}
+%define config_group %{amanda_group}
+
+%if  %{disttag} == rhel && %{distver} == 3
+./configure \
+        CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
+        --quiet \
+        --prefix=%{PREFIX} \
+        --sysconfdir=%{SYSCONFDIR} \
+        --sharedstatedir=%{LOCALSTATEDIR} \
+        --localstatedir=%{LOCALSTATEDIR} \
+        --libdir=%{LIBDIR} \
+        --includedir=%{INCLUDEDIR} \
+        --with-gnuplot=/usr/bin/gnuplot \
+        --with-gnutar=/bin/tar \
+        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
+        --with-index-server=localhost \
+        --with-tape-server=localhost \
+        --with-user=%{config_user} \
+        --with-group=%{config_group} \
+        --with-owner=%{packer} \
+        --with-fqdn \
+        --with-bsd-security \
+        --with-bsdtcp-security \
+        --with-bsdudp-security \
+        --with-ssh-security \
+        --with-udpportrange=%{udpportrange} \
+        --with-tcpportrange=%{tcpportrange} \
+        --with-low-tcpportrange=%{low_tcpportrange} \
+        --with-debugging=%{LOGDIR} \
+        --with-assertions \
+        --disable-installperms \
+        --without-ipv6 
+%else
+# This confusing macro results in PKG_CONFIG_PATH=some/path if some/path
+# was set on the command line, or by the platform detection bits.
+./configure \
+        %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
+        CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \
+        --quiet \
+        --prefix=%{PREFIX} \
+        --sysconfdir=%{SYSCONFDIR} \
+        --sharedstatedir=%{LOCALSTATEDIR} \
+        --localstatedir=%{LOCALSTATEDIR} \
+        --libdir=%{LIBDIR} \
+        --includedir=%{INCLUDEDIR} \
+        --with-star=/usr/bin/star \
+        --with-gnuplot=/usr/bin/gnuplot \
+        --with-gnutar=/bin/tar \
+        --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \
+        --with-index-server=localhost \
+        --with-tape-server=localhost \
+        --with-user=%{config_user} \
+        --with-group=%{config_group} \
+        --with-owner=%{packer} \
+        --with-fqdn \
+        --with-bsd-security \
+        --with-bsdtcp-security \
+        --with-bsdudp-security \
+        --with-ssh-security \
+        --with-udpportrange=%{udpportrange} \
+        --with-tcpportrange=%{tcpportrange} \
+        --with-low-tcpportrange=%{low_tcpportrange} \
+        --with-debugging=%{LOGDIR} \
+        --with-assertions \
+        --disable-installperms
+%endif
+
+make
+
+# --- Install to buildroot ---
+
+%install
+if [ "%{buildroot}" != "/" ]; then
+        if [ -d "%{buildroot}" ] ; then
+                rm -rf %{buildroot}
+        fi
+else
+        echo "BuildRoot was somehow set to / !"
+        exit -1
+fi
+
+make -j1 DESTDIR=%{buildroot} install
+
+rm -rf %{ROOT_DATADIR}/amanda
+rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient
+mkdir %{buildroot}/{etc,var/log}
+mkdir %{ROOT_LOCALSTATEDIR}/amanda 
+mkdir %{ROOT_SYSCONFDIR}/amanda
+mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists
+mkdir %{ROOT_LOGDIR}
+
+echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release
+
+# --- Clean up buildroot ---
+
+%clean
+if [ "%{buildroot}" != "/" ]; then
+        if [ -d "%{buildroot}" ] ; then
+                rm -rf %{buildroot}
+        fi
+else
+        echo "BuildRoot was somehow set to / !"
+        exit -1
+fi
+
+# --- Pre/post (un)installation scripts ---
+
+%pre
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  make sure it is corrected before start using amanda  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+%post
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE}
+/sbin/ldconfig >>${TMPFILE} 2>&1
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+                if [ -f /etc/xinetd.d/amandaclient ] ; then
+                        rm /etc/xinetd.d/amandaclient
+                fi
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE} 1>&2
+                        cat ${TMPFILE} >>${INSTALL_ERR}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        if [ -x /sbin/restorecon ] ; then
+              /sbin/restorecon %{LOCALSTATEDIR}/amanda/amandates  >>${TMPFILE} 2>&1
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun
+/sbin/ldconfig
+%pre backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user}
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+%post backup_server
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaserver ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
+                chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1
+                if [ -f /etc/xinetd.d/amandaclient ] ; then
+                        rm /etc/xinetd.d/amandaclient
+                fi
+
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE} 1>&2
+                        cat ${TMPFILE} >>${INSTALL_ERR}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+        if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+        if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then
+                echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+        fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# install am_passphrase file to server
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then
+        echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE}
+        touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+        phrase=`echo "amandabackup" | md5sum | awk '{print $1}'`
+        echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase
+
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+        chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on server for amdump
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amdump"
+COMMENT="%{amanda_user}@server"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}" >>${TMPFILE} 2>&1
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_server
+/sbin/ldconfig
+%pre backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE}
+
+# Check for the 'amanda' user
+echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE}
+if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then
+        useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1
+        if [ %{dist} = "SuSE" ]; then
+                PASSWD_EXIT=$?
+        else
+                # Lock the amanda account until admin sets password
+                passwd -l %{amanda_user} >>/dev/null
+                PASSWD_EXIT=$?
+        fi
+        if [ ${PASSWD_EXIT} -eq 0 ] ; then
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  The '%{amanda_user}; user account has been successfully created." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Furthermore, the account has been automatically locked for you" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  for security purposes.  Once a password for the  '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  account has been set, the user can be unlocked by issuing" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the following command as root.:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  # passwd -u %{amanda_user}" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  If this is not a new installation of Amanda and you have" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  in those configurations.  Additionally, you should ensure" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  is properly configured to allow connections for the user" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  '%{amanda_user}'." >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+                PASSWD_OK=0
+        else
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  The '%{amanda_user}' user account for this system has been   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  created, however the user has no password set. For   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  security purposes this account  is normally locked   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  after creation.  Unfortunately,  when locking this   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  account an error occurred.  To ensure the security   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  of your system  you should set a password  for the   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  user account '%{amanda_user}' immediately!  To set  such a   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!  password, please issue the following command.:       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!   # passwd %{amanda_user}                                     !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!!                                                       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                PASSWD_OK=1
+        fi
+else
+        # log information about 'amanda' user parameters
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  The Amanda backup software is configured to operate as the" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user '%{amanda_user}'.  This user exists on your system and has not" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  been modified.  To ensure that Amanda functions properly," >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  please see that the following parameters are set for that" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  user.:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  SHELL:          /bin/sh" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  HOME:           %{AMANDAHOMEDIR}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Default group:  %{amanda_group}" >>${TMPFILE}
+        echo "`date +'%b %e %Y %T'`:  Verifying %{amanda_user} parameters :" >>${TMPFILE}
+
+        if [ "`id -gn %{amanda_user}`" != "disk" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' is not part of the disk group,Pl  !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! make sure it is corrected before start using Amanda   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified group name of user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' default shell should be set to    !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! /bin/sh, pl correct before start using Amanda         !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default shell for user 'amandabackup'" >>${TMPFILE}
+        fi
+
+        if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! user 'amandabackup' home directory should be set to   !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! %{AMANDAHOMEDIR} Pl correct before using Amanda       !!!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`:  Verified Default home directory for user amandabackup" >>${TMPFILE}
+        fi
+        echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+        PASSWD_OK=0
+fi
+if [ -d %{AMANDAHOMEDIR} ] ; then
+        echo -n "`date +'%b %e %Y %T'`:  Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE}
+        if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \
+           [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then
+                echo "correct." >>${TMPFILE}
+                VARLIB_OK=0
+        else
+                echo "incorrect!" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE}
+                echo "`date +'%b %e %Y %T'`:  the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE}
+                VARLIB_OK=1
+        fi
+else
+        VARLIB_OK=0
+fi
+echo "`date +'%b %e %Y %T'`:" >>${TMPFILE}
+
+if [ ! -e ${LOGDIR} ] ; then
+        # create log directory
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+elif [ ! -d ${LOGDIR} ] ; then
+        mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1
+        mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1
+        chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1
+        mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1
+fi
+if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+        echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2
+        echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+        exit 1
+else
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE}
+
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+%post backup_client
+TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX`
+if [ $? -ne 0 ]; then
+        echo "Unable to mktemp!" 1>&2
+        exit 1
+fi
+LOGDIR="%{LOGDIR}"
+INSTALL_LOG="${LOGDIR}/install.log"
+INSTALL_ERR="${LOGDIR}/install.err"
+
+echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE}
+/sbin/ldconfig
+echo "done." >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then
+        if [ ! -f /etc/xinetd.d/amandaclient ] ; then
+                cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
+
+                echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE}
+                if [ "%{xinetd_reload}" == "reload" ] ; then
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                        if [ ${ret_val} -ne 0 ] ; then
+                                echo -n "reload failed.  Attempting restart..." >>${TMPFILE}
+                                /etc/init.d/xinetd restart >>${TMPFILE} 2>&1
+                                ret_val=$?
+                        fi
+                else
+                        /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1
+                        ret_val=$?
+                fi
+                if [ ${ret_val} -eq 0 ] ; then
+                        echo "success." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                else
+                        echo "failed.  Please check your system logs." >>${TMPFILE}
+                        cat ${TMPFILE}
+                        cat ${TMPFILE} >>${INSTALL_LOG}
+                fi
+        fi
+fi
+
+echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE}
+ret_val=0
+if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then
+        touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+        chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# Install .amandahosts to client
+echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then
+        touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+fi
+for host in localhost localhost.localdomain ; do
+                if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then
+                        echo "${host}   %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts
+                fi
+done
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install amanda client configuration file
+echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE}
+if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then
+        cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+fi
+chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# Install .gnupg directory
+echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE}
+ret_val=0
+if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE}
+        mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE}
+        else
+                echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE}
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE}
+        chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+        ret_val=$?
+        if [ ${ret_val} -eq 0 ]; then
+                chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1
+                ret_val=$?
+        fi
+fi
+if [ ${ret_val} -eq 0 ]; then
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+else
+        echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE}
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_ERR}
+fi
+
+# SSH RSA key generation on client for amrecover
+KEYDIR="%{AMANDAHOMEDIR}/.ssh"
+KEYFILE="id_rsa_amrecover"
+COMMENT="root@client"
+if [ ! -d ${KEYDIR} ] ; then
+        if [ -f ${KEYDIR} ] ; then
+                echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file.  Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE}
+                mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1
+                cat ${TMPFILE}
+                cat ${TMPFILE} >>${INSTALL_LOG}
+        fi
+        echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE}
+        mkdir ${KEYDIR} >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then
+        echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE}
+        ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1
+        cat ${TMPFILE}
+        cat ${TMPFILE} >>${INSTALL_LOG}
+fi
+echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1
+chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+# environment variables (~amandabackup/.profile)
+echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE}
+if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then
+        touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+fi
+if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then
+        echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE}
+fi
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE}
+chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG}
+if [ -x /usr/bin/wget ]; then 
+        /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client 
+fi
+
+echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE}
+cat ${TMPFILE}
+cat ${TMPFILE} >>${INSTALL_LOG}
+
+if [ -f "${TMPFILE}" ]; then
+        rm -f "${TMPFILE}"
+fi
+
+echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'."
+%postun backup_client
+/sbin/ldconfig
+
+# --- Files to install ---
+
+%files backup_client
+%defattr(0755,%{amanda_user},%{amanda_group})
+%{SYSCONFDIR}/amanda
+%{AMANDAHOMEDIR}
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{AMLIBEXECDIR}/amanda-sh-lib.sh
+%{LOCALSTATEDIR}/amanda
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%defattr(0750,%{amanda_user},%{amanda_group})
+%{LOGDIR}
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcryp*
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%defattr(0644,%{amanda_user},%{amanda_group})
+%docdir %{MANDIR}
+%{MANDIR}/man5/amanda.conf.5.gz
+%{MANDIR}/man5/amanda-client.conf.5.gz
+%{MANDIR}/man8/amanda.8.gz
+%{MANDIR}/man8/amcheckdump.8.gz
+%{MANDIR}/man8/amrecover.8.gz
+%{AMLIBEXECDIR}/amcat.awk
+%{AMANDAHOMEDIR}/amanda-release
+%{AMANDAHOMEDIR}/example/xinetd.amandaclient
+%{AMANDAHOMEDIR}/example/amanda-client.conf
+
+%files backup_server
+%defattr(0755,%{amanda_user},%{amanda_group})
+%{SYSCONFDIR}/amanda
+%{AMLIBEXECDIR}
+%{AMLIBDIR}
+%{PERLSITELIB}/Amanda
+%{PERLSITELIB}/auto/Amanda
+%{AMANDAHOMEDIR}
+%{LOCALSTATEDIR}/amanda
+%{SBINDIR}/amaddclient
+%{SBINDIR}/amadmin
+%{SBINDIR}/amcheckdb
+%{SBINDIR}/amcheckdump
+%{SBINDIR}/amcleanup
+%{SBINDIR}/amdd
+%{SBINDIR}/amdevcheck
+%{SBINDIR}/amdump
+%{SBINDIR}/amfetchdump
+%{SBINDIR}/amflush
+%{SBINDIR}/amgetconf
+%{SBINDIR}/amlabel
+%{SBINDIR}/ammt
+%{SBINDIR}/amoverview
+%{SBINDIR}/amplot
+%{SBINDIR}/amreport
+%{SBINDIR}/amrestore
+%{SBINDIR}/amrmtape
+%{SBINDIR}/amserverconfig
+%{SBINDIR}/amstatus
+%{SBINDIR}/amtape
+%{SBINDIR}/amtapetype
+%{SBINDIR}/amtoc
+%{SBINDIR}/amverify
+%{SBINDIR}/amverifyrun
+%{AMLIBEXECDIR}/amanda-sh-lib.sh
+%defattr(4750,root,disk)
+%{AMLIBEXECDIR}/calcsize
+%{AMLIBEXECDIR}/killpgrp
+%{AMLIBEXECDIR}/rundump
+%{AMLIBEXECDIR}/runtar
+%{AMLIBEXECDIR}/dumper
+%{AMLIBEXECDIR}/planner
+%{SBINDIR}/amcheck
+%defattr(0750,%{amanda_user},%{amanda_group})
+%{LOGDIR}
+%{SBINDIR}/amaespipe
+%{SBINDIR}/amcrypt
+%{SBINDIR}/amcrypt-ossl
+%{SBINDIR}/amcrypt-ossl-asym
+%{SBINDIR}/amcryptsimple
+%{SBINDIR}/amgpgcrypt
+%{SBINDIR}/amoldrecover
+%{SBINDIR}/amrecover
+%defattr(0644,%{amanda_user},%{amanda_group})
+%{AMLIBEXECDIR}/amcat.awk
+%{AMLIBEXECDIR}/amplot.awk
+%{AMLIBEXECDIR}/amplot.g
+%{AMLIBEXECDIR}/amplot.gp
+%docdir %{MANDIR}
+%{MANDIR}/man5/amanda.conf.5.gz
+%{MANDIR}/man5/amanda-client.conf.5.gz
+%{MANDIR}/man8/amaddclient.8.gz
+%{MANDIR}/man8/amadmin.8.gz
+%{MANDIR}/man8/amanda.8.gz
+%{MANDIR}/man8/amcheck.8.gz
+%{MANDIR}/man8/amcheckdb.8.gz
+%{MANDIR}/man8/amcheckdump.8.gz
+%{MANDIR}/man8/amcleanup.8.gz
+%{MANDIR}/man8/amdd.8.gz
+%{MANDIR}/man8/amdump.8.gz
+%{MANDIR}/man8/amfetchdump.8.gz
+%{MANDIR}/man8/amflush.8.gz
+%{MANDIR}/man8/amgetconf.8.gz
+%{MANDIR}/man8/amlabel.8.gz
+%{MANDIR}/man8/ammt.8.gz
+%{MANDIR}/man8/amoverview.8.gz
+%{MANDIR}/man8/amplot.8.gz
+%{MANDIR}/man8/amrecover.8.gz
+%{MANDIR}/man8/amreport.8.gz
+%{MANDIR}/man8/amrestore.8.gz
+%{MANDIR}/man8/amrmtape.8.gz
+%{MANDIR}/man8/amserverconfig.8.gz
+%{MANDIR}/man8/amstatus.8.gz
+%{MANDIR}/man8/amtape.8.gz
+%{MANDIR}/man8/amtapetype.8.gz
+%{MANDIR}/man8/amtoc.8.gz
+%{MANDIR}/man8/amverify.8.gz
+%{MANDIR}/man8/amverifyrun.8.gz
+%{MANDIR}/man8/amcrypt.8.gz
+%{MANDIR}/man8/amcrypt-ossl.8.gz
+%{MANDIR}/man8/amcrypt-ossl-asym.8.gz
+%{MANDIR}/man8/amcryptsimple.8.gz
+%{MANDIR}/man8/amgpgcrypt.8.gz
+%{MANDIR}/man8/amaespipe.8.gz
+%{MANDIR}/man8/amdevcheck.8.gz
+%{AMANDAHOMEDIR}/amanda-release
+%{AMANDAHOMEDIR}/example/amanda-client.conf
+%{AMANDAHOMEDIR}/example/xinetd.amandaserver
+
+# --- ChangeLog
+
+%changelog
+* Tue Mar 11 2008 Dan Locks <dwlocks at zmanda dot com>
+- fixed many rpmlint complaints
+- added --quiet to configure statements
+- moved PERLSITELIB to definitions section
+* Wed Feb 13 2008 Dan Locks <dwlocks at zmanda dot com>
+- added an environment check for PKG_CONFIG_PATH
+- added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment 
+  var is used if provided)
+* Fri Feb 01 2008 Dan Locks <dwlocks at zmanda dot com>
+- Removed amplot executable and manpages from client installation
+- Added amcheckdump.8 manpage
+- Fixed %%{LOCALSTATEDIR}/amanda dir creation.
+* Wed Jan 23 2008  Dan Locks <dwlocks at zmanda dot com>
+- Change %%{SYSCONFDIR}/amanda/amandates to %%{LOCALSTATEDIR}/amanda/amandates,
+  and added %%{LOCALSTATEDIR}/amanda to the files lists.
+* Mon Jan 14 2008  Dan Locks <dwlocks at zmanda dot com>
+- Updates for perlified amanda, file location moves, gpg setup.
+* Tue Nov  13 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added SYSCONFDIR to client rpm
+- Set xinetd and amanda-client.conf configuration files as part of postinstall
+* Thu Nov  8 2007 Dan Locks <dwlocks at zmanda dot com>
+- Added Linux distribution detection
+* Wed Nov 7 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added amserverconfig, amaddclient, amgpgcrypt, amcryptsimple and libamdevice.
+- Added amanda configuration template files
+* Fri Sep 21 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Remove libamserver, libamtape from client rpm
+* Wed Sep 19 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added Fedora 7
+* Tue Jun 26 2007 Kevin Till <ktill at zmanda dot com>
+- set debug log to /var/log/amanda
+* Fri Jan 12 2007 Paddy Sreenivasan <paddy at zmanda dot com>
+- Added label templates
+* Thu Dec 07 2006 Paddy Sreenivasan <paddy at zmanda dot com>
+- Application API changes
+* Fri Jun 16 2006 Kevin Till <ktill at zmanda dot com>
+- make install will install necessary example files. 
+  No need to "cp"
+* Wed Jun 07 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added amoldrecover and amanda-client.conf man page.
+* Thu Jun 01 2006 Kevin Till <ktill at zmanda dot com> -
+- Added amcrypt-ossl, amcrypt-ossl-asym by Ben Slusky.
+* Thu May 18 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added SLES10, RHEL3 build options.
+* Tue May 09 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added amanda-release file to amandabackup home directory.
+- Installation message logging cleanup.
+* Thu Apr 27 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Removed dependency on tar version.
+- Moved log directory creation after backup user creation.
+* Wed Apr 19 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added informative message to note the location of pre- and post-
+- install script logs files.
+* Mon Apr 17 2006 Chris Lee <cmlee at zmanda dot com> -
+- Reworked installation message logging and reporting.
+* Fri Apr 14 2006 Chris Lee <cmlee at zmanda dot com> -
+- Changed behavior for creating required localhost entries in the
+- amandahosts file to check for these entries even when the file
+- already exists.
+* Wed Apr 12 2006 Chris Lee <cmlee at zmanda dot com> -
+- Removed pre-install check for "disk" group.  This group should exist
+- by default on almost all modern distributions.
+* Tue Apr 11 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added amandahosts entry for "localhost" without domain.
+* Fri Apr 07 2006 Chris Lee <cmlee at zmanda dot com> -
+- Changed default entries in .amandahosts to use "localdomain" instead
+- of "localnet".
+- Updated amanda_version and release.
+* Mon Apr 03 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added example amanda.conf to files.
+* Thu Mar 16 2006 Chris Lee <cmlee at zmanda dot com> -
+- Corrected an issue with pre-install scripts wrt bug #218.
+- Corrected an issue with post-install scripts and added testing .profile 
+- in amandabackup's home directory for setting environment variables wrt
+- bug #220.
+* Mon Mar 13 2006 Chris Lee <cmlee at zmanda dot com> -
+- Corrected a syntactical error with setting ownership of amandates file
+- wrt bug #216.
+* Wed Mar 08 2006 Chris Lee <cmlee at zmanda dot com> -
+- Added pre-install scripts to verify proper ownership of
+- amandabackup home directory.
+* Thu Feb 2 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Require xinetd. Require termcap and initscripts for Fedora and Redhat.
+* Mon Jan 09 2006 Chris Lee <cmlee at zmanda dot com> -
+- Pre/post install scripts updated:
+- o Resolved an issue where an empty amandates file was installed
+-   even if the file already existed on the system.
+- o If .amandahosts does not exist a default is now created.
+- The Amanda user account has been changed to 'amandabackup' for
+- additional security.
+* Tue Jan 03 2006 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Removed amandates from files list.
+* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected dependency for awk to "/bin/awk".
+* Thu Dec 29 2005 Kevin Till <ktill at zmanda dot com> -
+- add man pages for amcrypt and amaespipe
+* Thu Dec 29 2005 Chris Lee <cmlee at zmanda dot com> -
+- Updated dependancy info to depend on tar >= 1.15.
+- Included dependancies from top-level package in backup_client and
+- backup_server packages.
+- Reorganized files lists for readability (alphabetically).
+- Updated backup_client files list to include some missing files per
+- bug #129.
+- Updated pre- and post-install to handle potential issue when
+- /var/log/amanda exists and is a file rather than a directory.
+- Corrected permissions for /var/log/amanda in pre-install scripts
+- per bug #78 and 13 December change.
+* Thu Dec 22 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Added amaespipe and amcrypt
+- Added sles9 build definitions
+* Tue Dec 13 2005 Chris Lee <cmlee at zmanda dot com> -
+- Changed permissions for /var/log/amanda, removing set group id bit.
+- Added /etc/amandates to backup_client package.
+* Thu Dec 08 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected an issue with detection of existing 'amanda' user account.
+- Corrected ownership of setuid executables per Bug #66.
+- Moved the gnutar and noop files to the backup_client package (where
+- they sould be).
+- Removed amqde from files list.
+- Added logging features to pre- and post-install scripts.
+* Wed Dec 07 2005 Chris Lee <cmlee at zmanda dot com> -
+- Changed a number of directory and file permissions from amanda:root
+- to amanda:disk in response to Bug #57.
+* Fri Dec 02 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected SYSCONFDIR path definition.  Closes Bug #58.
+* Mon Nov 28 2005 Chris Lee <cmlee at zmanda dot com> -
+- Really fixed user creation preinstall scripts.
+* Wed Nov 23 2005 Paddy Sreenivasan <paddy at zmanda dot com> -
+- Updated package description.
+- Changed Group for packages.
+* Tue Nov 22 2005 Chris Lee <cmlee at zmanda dot com> -
+- Corrected dependancy packaging issue with amanda libraries.
+- Fixed creation of amanda user on systems which it does not exist.
+- Corrected Group definition for SuSE.
+- Updated descriptions to include amanda-libs package.
+- Updated release number to 2.
+* Tue Nov 08 2005 Chris Lee <cmlee at zmanda dot com> -
+- Permissions changes: now using user=amanda, group=disk
+* Sun Oct 30 2005 Chris Lee <cmlee at zmanda dot com> -
+- Parameters to configure options --with-user and --with-group changed
+- such that when test_build is set to '1' the username of the user who
+- runs rpmbuild is used for both values.  If test_build is set to '0'
+- then root is used for both values.
+- The release field was also changed to automatically reflect the
+- distribution and distribution release version for which the RPM was
+- built.
+* Tue Oct 18 2005 Chris Lee <cmlee at zmanda dot com> - 
+- Initial RPM SPEC file created.
+
diff --git a/packaging/rpm/amanda.spec.rej b/packaging/rpm/amanda.spec.rej
new file mode 100644 (file)
index 0000000..2b549e5
--- /dev/null
@@ -0,0 +1,16 @@
+***************
+*** 1514,1519 ****
+  %{AMLIBEXECDIR}
+  %{AMLIBEXECDIR}/application
+  %{AMLIBDIR}
+  %{LOCALSTATEDIR}/amanda
+  %defattr(4750,root,disk)
+  %{AMLIBEXECDIR}/calcsize
+--- 1517,1523 ----
+  %{AMLIBEXECDIR}
+  %{AMLIBEXECDIR}/application
+  %{AMLIBDIR}
++ %{PERLSITELIB}
+  %{LOCALSTATEDIR}/amanda
+  %defattr(4750,root,disk)
+  %{AMLIBEXECDIR}/calcsize
diff --git a/packaging/rpm/buildpkg b/packaging/rpm/buildpkg
new file mode 100755 (executable)
index 0000000..e76367c
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Buildpkg script for producing RPM packages. Does not require root access.
+
+# This is useful for debugging
+set -x
+# Buildbot exports some useful env variables.
+# Check for $AMVER.  I couldn't come up with a good way to detect it.
+if [ -z $AMVER ]; then
+    AMVER=amanda-2.6.0
+fi
+# Check for AMTARBALL variable.
+if [ -z $AMTARBALL ]; then 
+    AMTARBALL=$AMVER.tar.gz
+fi
+
+# Check for AMTARBALL file, if it's not there, create it.
+if [ ! -f ${AMTARBALL} ]; then
+    mkdir ${AMVER}
+    cp -Rfp * ${AMVER}/
+    tar -cf ${AMTARBALL} -z ${AMVER}
+    rm -rf ${AMVER}
+fi
+
+# Check for the packaging dirs.
+if [ -z $AMPKGDIR ]; then
+    AMPKGDIR=${PWD}
+fi
+if [ ! -d ${AMPKGDIR} ]; then
+    mkdir ${AMPKGDIR}
+fi
+cd ${AMPKGDIR}
+
+if [ -d rpm ]; then
+    rm -rf rpm
+fi
+mkdir rpm
+mkdir rpm/SOURCES
+mkdir rpm/SRPMS
+mkdir rpm/SPECS
+mkdir rpm/BUILD
+mkdir rpm/RPMS
+
+# Make a copy of the tarball with the name that rpmbuild expects
+cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz
+cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec
+# Rpmbuild requires absolute paths.  annoying.  If you need to change the 
+# default value of some rpm.spec variable, just pass extra --define options.
+# this is useful for changing %amanda_release or %amanda_version
+rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \
+             ${AMPKGDIR}/rpm/SPECS/amanda.spec 
diff --git a/perl/Amanda/Changer.pm b/perl/Amanda/Changer.pm
new file mode 100644 (file)
index 0000000..6b8b012
--- /dev/null
@@ -0,0 +1,347 @@
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Changer;
+
+use Carp;
+use POSIX ();
+use Exporter;
+@ISA = qw( Exporter );
+
+@EXPORT_OK = qw(
+    reset clean eject label
+    query loadslot find scan
+);
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Device qw( :constants );
+use Amanda::Config qw( :getconf );
+
+=head1 NAME
+
+Amanda::Changer -- interface to changer scripts
+
+=head1 SYNOPSIS
+
+  use Amanda::Changer;
+
+  my ($error, $slot) = Amanda::Changer::reset();
+
+  my ($nslots, $curslot, $backwards, $searchable) = Amanda::Changer::query();
+
+  my ($tpslot, $tpdevice) = Amanda::Changer::find("TAPE018");
+
+  sub slot_callback {
+    my ($slot, $device, $error) = @_;
+    if (!$error) print "Slot $slot: $device\n";
+    return 0;
+  }
+  Amanda::Changer::scan(\&slot_callback);
+
+=head1 API STATUS
+
+Stable
+
+=head1 FUNCTIONS
+
+All of these functions return an array of values, beginning with
+C<$error>, and containing any other results appropriate to the
+operation.
+
+The functions C<croak()> in the event of a serious error (problems
+running the changer script, or an exit status of 2 or higher).
+"Benign" errors, corresponding to an exit status of 1 or a slot named
+"<error>", result in the return of a single-element array containing
+the error message.  Error-handling for calls can be written
+
+C<$error> and C<$slot>.  The first is false unless a "benign"
+error, such as a positioning error, has occurred, in which case it
+contains the message from the changer script, and the other results
+are undefined.  C<$slot> is the first word returned from the changer
+script, and is usually a number, but occasionally a string such as
+"<none>".
+
+=over
+
+=item reset
+
+  my ($error, $slot) = reset();
+
+Resets the tape changer, if supported, by calling
+
+  $tpchanger -reset
+
+=item clean
+
+  my ($error, $slot) = clean();
+
+Triggers a cleaning cycle, if supported, by calling
+
+  $tpchanger -clean
+
+=item eject
+
+  my ($error, $slot) = eject();
+
+Ejects the tape in the current slot, if supported, by calling
+
+  $tpchanger -eject
+
+=item label
+
+  my ($error) = label($label);
+
+Inform the changer that the tape in the current slot is labeled C<$label>.  Calls
+
+  $tpchanger -label $label
+
+=item query
+
+  my ($error, $slot, $nslots, $backwards, $searchable) = query();
+
+Query the changer to determine the current slot (C<$slot>), the
+number of slots (C<$nslots>), whether it can move backward through tapes
+(C<$backwards>), and whether it is searchable (that is, has a barcode
+reader; C<$searchable>).  A changer which cannot move backward through
+tapes is also known as a gravity feeder.
+
+This function runs
+
+  $tpchanger -info
+
+=item loadslot
+
+  my ($error, $slot, $device) = loadslot($desired_slot);
+
+Load the tape in the given slot, returning its slot and device.
+C<$desired_slot> can be a numeric slot number or one of the symbolic
+names defined by the changer API, e.g., "next", "current", or "first".
+
+  $tpchanger -slot $slot
+
+=item find
+
+  my ($error, $tpslot, $tpdevice) = Amanda::Changer::find($label);
+
+Search the changer for a tape with the given label, returning with
+C<$tpslot = "<none>"> if the given label is not found.
+
+If the changer is searchable, this function calls
+
+  $tpchanger -search $label
+
+Otherwise it scans all slots in order, beginning with the current slot,
+until it finds one with a label equal to C<$label> or exhausts all
+slots.  Note that it is considered a fatal error if the label is not
+found.
+
+=item scan
+
+  my ($error) = Amanda::Changer::scan(\&slot_callback);
+
+Call C<slot_callback> for all slots, beginning with the current slot,
+until C<slot_callback> returns a nonzero value or all slots are
+exhausted.  C<slot_callback> gets three arguments: a slot number, a
+device name for that slot, and a boolean value which is true if the
+changer successfully loaded the slot.
+
+=cut
+
+sub reset {
+    my ($error, $slot, $rest) = run_tpchanger("-reset");
+    return ($error) if $error;
+
+    return (0, $slot);
+}
+
+sub clean {
+    my ($error, $slot, $rest) = run_tpchanger("-clean");
+    return ($error) if $error;
+
+    return (0, $slot);
+}
+
+sub eject {
+    my ($error, $slot, $rest) = run_tpchanger("-eject");
+    return ($error) if $error;
+
+    return (0, $slot);
+}
+
+sub label {
+    my ($label) = @_;
+
+    my ($error, $slot, $rest) = run_tpchanger("-label", $label);
+    return ($error) if $error;
+
+    return (0);
+}
+
+sub query {
+    my ($error, $slot, $rest) = run_tpchanger("-info");
+    return ($error) if $error;
+
+    # old, unsearchable changers don't return the third result, so it's optional in the regex
+    $rest =~ /(\d+) (\d+) ?(\d+)?/ or croak("Malformed response from changer -seek: $rest");
+
+    # return array: error, nslots, curslot, backwards, searchable
+    return (0, $slot, $1, $2, $3?1:0);
+}
+
+sub loadslot {
+    my ($desired_slot) = @_;
+
+    my ($error, $slot, $rest) = run_tpchanger("-slot", $desired_slot);
+    return ($error) if $error;
+
+    return (0, $slot, $rest);
+}
+
+sub find {
+    my ($label) = @_;
+
+    my ($error, $curslot, $nslots, $backwards, $searchable) = query();
+    return ($error) if $error;
+
+    if ($searchable) {
+        # search using the barcode reader, etc.
+        my ($error, $slot, $rest) = run_tpchanger("-search", $label);
+        return ($error) if $error;
+        return ($error, $slot, $rest);
+    } else {
+        # search manually, starting with "current"
+        my $slotstr = "current";
+        for (my $checked = 0; $checked < $nslots; $checked++) {
+            my ($error, $slot, $rest) = run_tpchanger("-slot", $slotstr);
+            $slotstr = "next";
+
+            # ignore "benign" errors
+            next if $error;
+
+            my $device = Amanda::Device->new($rest);
+            next if (!$device);
+            next if ($device->read_label() != $READ_LABEL_STATUS_SUCESS);
+
+            # we found it!
+            if ($device->{'volume_label'} eq $label) {
+                return (0, $slot, $rest);
+            }
+        }
+
+        croak("Label $label not found in any slot");
+    }
+}
+
+sub scan {
+    my ($slot_callback) = @_;
+
+    my ($error, $curslot, $nslots, $backwards, $searchable) = query();
+    return ($error) if $error;
+
+    my $slotstr = "current";
+    my $done = 0;
+    for (my $checked = 0; $checked < $nslots; $checked++) {
+        my ($error, $slot, $rest) = run_tpchanger("-slot", $slotstr);
+        $slotstr = "next";
+
+        if ($error) {
+            $done = $slot_callback->(undef, undef, $error);
+        } else {
+            $done = $slot_callback->($slot, $rest, 0);
+        }
+
+        last if $done;
+    }
+    
+    return (0);
+}
+
+# Internal-use function to actually invoke a changer script and parse 
+# its output.  If the script's exit status is neither 0 nor 1, or if an error
+# occurs running the script, then run_tpchanger croaks with the error message.
+#
+# @params @args: command-line arguments to follow the name of the changer
+# @returns: array ($error, $slot, $rest), where $error is an error message if
+#       a benign error occurred, or 0 if no error occurred
+sub run_tpchanger {
+    my @args = @_;
+
+    # get the tape changer and extend it to a full path
+    my $tapechanger = getconf($CNF_TPCHANGER);
+    if ($tapechanger !~ qr(^/)) {
+        $tapechanger = "$amlibexecdir/$tapechanger";
+    }
+
+    my $pid = open(my $child, "-|");
+    if (!defined($pid)) {
+        croak("Can't fork to run changer script: $!");
+    }
+
+    if (!$pid) {
+        # child
+
+        # cd into the config dir, if one exists
+        # TODO: construct a "fake" config dir including any "-o" overrides
+        my $config_dir = Amanda::Config::get_config_dir();
+        if ($config_dir) {
+            if (!chdir($config_dir)) {
+                print "<error> Could not chdir to '$config_dir'\n";
+                exit(2);
+            }
+        }
+
+        %ENV = Amanda::Util::safe_env();
+
+        exec { $tapechanger } $tapechanger, @args or
+            print "<error> Could not exec $tapechanger: $!\n";
+        exit 2;
+    }
+
+    # parent
+    my @child_output = <$child>;
+
+    # close the child and get its exit status
+    my $child_exit = 0;
+    if (!close($child)) {
+        if ($!) {
+            croak("Error running changer script: $!");
+        } else {
+            $child_exit = $?;
+        }
+    }
+
+    # parse the response
+    croak("Malformed output from changer script -- no output")
+        if (@child_output < 1);
+    croak("Malformed output from changer script -- too many lines")
+        if (@child_output > 1);
+    croak("Malformed output from changer script: '$child_output[0]'")
+        if ($child_output[0] !~ /\s*([^\s]+)\s+(.+)?/);
+    my ($slot, $rest) = ($1, $2);
+
+    if ($child_exit == 0) {
+        return (0, $slot, $rest);
+    } elsif (POSIX::WIFEXITED($child_exit) && POSIX::WEXITSTATUS($child_exit) == 1) {
+        return ($rest); # non-fatal error
+    } else {
+        croak("Fatal error from changer script: $rest");
+    }
+}
+
+1;
diff --git a/perl/Amanda/Cmdline.c b/perl/Amanda/Cmdline.c
new file mode 100644 (file)
index 0000000..1badc66
--- /dev/null
@@ -0,0 +1,2467 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_dumpspec_t swig_types[2]
+#define SWIGTYPE_p_float swig_types[3]
+#define SWIGTYPE_p_int swig_types[4]
+#define SWIGTYPE_p_p_char swig_types[5]
+#define SWIGTYPE_p_unsigned_char swig_types[6]
+static swig_type_info *swig_types[8];
+static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Cmdline
+
+#define SWIG_name   "Amanda::Cmdlinec::boot_Amanda__Cmdline"
+#define SWIG_prefix "Amanda::Cmdlinec::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include <glib.h>
+#include "cmdline.h"
+
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN dumpspec_t *new_dumpspec_t(char *host,char *disk,char *datestamp,char *level){
+           return dumpspec_new(host, disk, datestamp, level);
+       }
+SWIGINTERN void delete_dumpspec_t(dumpspec_t *self){
+           dumpspec_free(self);
+       }
+SWIGINTERN char *dumpspec_t_format(dumpspec_t *self){
+           return cmdline_format_dumpspec(self);
+       }
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Cmdline_var::
+class _wrap_Amanda::Cmdline_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_dumpspec_t_host_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_host_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_host_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->host);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpspec_t_disk_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_disk_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_disk_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->disk);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpspec_t_datestamp_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_datestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_datestamp_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->datestamp);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpspec_t_level_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_level_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_level_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->level);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_dumpspec_t) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    char *arg4 = (char *) 0 ;
+    dumpspec_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int res4 ;
+    char *buf4 = 0 ;
+    int alloc4 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_dumpspec_t" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_dumpspec_t" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_dumpspec_t" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_dumpspec_t" "', argument " "4"" of type '" "char *""'");
+    }
+    arg4 = (char *)(buf4);
+    result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_dumpspec_t) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_dumpspec_t(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_dumpspec_t" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    delete_dumpspec_t(arg1);
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpspec_t_format) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_format(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_format" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *)dumpspec_t_format(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    free((char*)result);
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_format_dumpspec_components) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    char *arg4 = (char *) 0 ;
+    char *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int res4 ;
+    char *buf4 = 0 ;
+    int alloc4 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: format_dumpspec_components(host,disk,datestamp,level);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "format_dumpspec_components" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "format_dumpspec_components" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "format_dumpspec_components" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "format_dumpspec_components" "', argument " "4"" of type '" "char *""'");
+    }
+    arg4 = (char *)(buf4);
+    result = (char *)cmdline_format_dumpspec_components(arg1,arg2,arg3,arg4);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_parse_dumpspecs) {
+  {
+    int arg1 ;
+    char **arg2 = (char **) 0 ;
+    int arg3 ;
+    GSList *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: parse_dumpspecs(argc,argv,flags);");
+    }
+    {
+      AV *av;
+      int i;
+      
+      if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) {
+        SWIG_exception(SWIG_TypeError, "Expected an arrayref");
+      }
+      av = (AV *)SvRV(ST(0));
+      
+      arg1 = av_len(av)+1; /* av_len(av) is like $#av */
+      arg2 = malloc(sizeof(char *) * arg1);
+      for (i = 0; i < arg1; i++) {
+        SV **elt = av_fetch(av, i, 0);
+        if (!elt || !SvPOK(*elt)) {
+          SWIG_exception(SWIG_TypeError, "Non-string in arrayref");
+        }
+        arg2[i] = SvPV_nolen(*elt); /* TODO: handle unicode here */
+      }
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg3 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg3 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg3 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg3 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (GSList *)cmdline_parse_dumpspecs(arg1,arg2,arg3);
+    {
+      if (result) {
+        GSList *iter;
+        EXTEND(SP, g_slist_length(result)); /* make room for return values */
+        
+        iter = result;
+        while (iter) {
+          /* Let SWIG take ownership of the object; we'll free the GSList momentarily */
+          ST(argvi) = SWIG_NewPointerObj(iter->data, SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW);
+          argvi++;
+          iter = iter->next;
+        }
+        
+        /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */
+        g_slist_free(result);
+      }
+    }
+    {
+      free(arg2);
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    {
+      free(arg2);
+    }
+    
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *|cmdline_parse_dumpspecs_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_dumpspec_t,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_p_char,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumpspec_t[] = {  {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_dumpspec_t,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_p_char,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Cmdlinec::dumpspec_t_host_get", _wrap_dumpspec_t_host_get},
+{"Amanda::Cmdlinec::dumpspec_t_disk_get", _wrap_dumpspec_t_disk_get},
+{"Amanda::Cmdlinec::dumpspec_t_datestamp_get", _wrap_dumpspec_t_datestamp_get},
+{"Amanda::Cmdlinec::dumpspec_t_level_get", _wrap_dumpspec_t_level_get},
+{"Amanda::Cmdlinec::new_dumpspec_t", _wrap_new_dumpspec_t},
+{"Amanda::Cmdlinec::delete_dumpspec_t", _wrap_delete_dumpspec_t},
+{"Amanda::Cmdlinec::dumpspec_t_format", _wrap_dumpspec_t_format},
+{"Amanda::Cmdlinec::format_dumpspec_components", _wrap_format_dumpspec_components},
+{"Amanda::Cmdlinec::parse_dumpspecs", _wrap_parse_dumpspecs},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  SWIG_TypeClientData(SWIGTYPE_p_dumpspec_t, (void*) "Amanda::Cmdline::dumpspec_t");
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_DATESTAMP", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_DATESTAMP)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_LEVEL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_LEVEL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_EMPTY_TO_WILDCARD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_EMPTY_TO_WILDCARD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Cmdline.pm b/perl/Amanda/Cmdline.pm
new file mode 100644 (file)
index 0000000..9f9bae0
--- /dev/null
@@ -0,0 +1,220 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Cmdline;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Cmdlinec;
+bootstrap Amanda::Cmdline;
+package Amanda::Cmdline;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Cmdline;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Cmdline;
+
+*format_dumpspec_components = *Amanda::Cmdlinec::format_dumpspec_components;
+*parse_dumpspecs = *Amanda::Cmdlinec::parse_dumpspecs;
+
+############# Class : Amanda::Cmdline::dumpspec_t ##############
+
+package Amanda::Cmdline::dumpspec_t;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( Amanda::Cmdline );
+%OWNER = ();
+%ITERATORS = ();
+*swig_host_get = *Amanda::Cmdlinec::dumpspec_t_host_get;
+*swig_host_set = *Amanda::Cmdlinec::dumpspec_t_host_set;
+*swig_disk_get = *Amanda::Cmdlinec::dumpspec_t_disk_get;
+*swig_disk_set = *Amanda::Cmdlinec::dumpspec_t_disk_set;
+*swig_datestamp_get = *Amanda::Cmdlinec::dumpspec_t_datestamp_get;
+*swig_datestamp_set = *Amanda::Cmdlinec::dumpspec_t_datestamp_set;
+*swig_level_get = *Amanda::Cmdlinec::dumpspec_t_level_get;
+*swig_level_set = *Amanda::Cmdlinec::dumpspec_t_level_set;
+sub new {
+    my $pkg = shift;
+    my $self = Amanda::Cmdlinec::new_dumpspec_t(@_);
+    bless $self, $pkg if defined($self);
+}
+
+sub DESTROY {
+    return unless $_[0]->isa('HASH');
+    my $self = tied(%{$_[0]});
+    return unless defined $self;
+    delete $ITERATORS{$self};
+    if (exists $OWNER{$self}) {
+        Amanda::Cmdlinec::delete_dumpspec_t($self);
+        delete $OWNER{$self};
+    }
+}
+
+*format = *Amanda::Cmdlinec::dumpspec_t_format;
+sub DISOWN {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    $OWNER{$ptr} = 1;
+}
+
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Cmdline;
+
+*CMDLINE_PARSE_DATESTAMP = *Amanda::Cmdlinec::CMDLINE_PARSE_DATESTAMP;
+*CMDLINE_PARSE_LEVEL = *Amanda::Cmdlinec::CMDLINE_PARSE_LEVEL;
+*CMDLINE_EMPTY_TO_WILDCARD = *Amanda::Cmdlinec::CMDLINE_EMPTY_TO_WILDCARD;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Cmdline - utilities for handling command lines
+
+=head1 SYNOPSIS
+
+  use Amanda::Cmdline;
+
+  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
+  print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
+
+  my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
+                           $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
+  
+=head1 API STATUS
+
+Will change.
+
+=head1 Amanda::Cmdline::dumpspec_t Objects
+
+=head2 Instance Variables
+
+=over
+
+=item C<$host>
+
+=item C<$disk>
+
+=item C<$datestamp>
+
+=item C<$level>
+
+=back
+
+=head2 Methods
+
+=over
+
+=item C<format()>
+
+Format the dumpspec as a string.
+
+=back
+
+=head1 Functions
+
+=over
+
+=item C<format_dumpspec_components($host, $disk, $datestamp, $level)>
+
+This function returns a string representing the formatted form of the given dumpspec.  This formatting
+is the same as performed by C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
+
+=item C<parse_dumpspecs(@cmdline, $flags)> 
+
+This function parses C<@cmdline> into a list of C<dumpspec_t> objects,
+according to C<$flags>, which is a logical combination of zero or
+more of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and
+C<$CMDLINE_PARSE_LEVEL> to recognize levels.
+
+=back
+
+=head1 SEE ALSO
+
+L<Amanda::Config> handles C<-o> options itself, through C<config_overwrites>.
+
+=cut
+
+push @EXPORT_OK, qw(cmdline_parse_dumpspecs_flags_to_strings);
+push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw(cmdline_parse_dumpspecs_flags_to_strings);
+
+my %_cmdline_parse_dumpspecs_flags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub cmdline_parse_dumpspecs_flags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_cmdline_parse_dumpspecs_flags_VALUES) {
+       my $v = $_cmdline_parse_dumpspecs_flags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($CMDLINE_PARSE_DATESTAMP);
+push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw($CMDLINE_PARSE_DATESTAMP);
+
+$_cmdline_parse_dumpspecs_flags_VALUES{"CMDLINE_PARSE_DATESTAMP"} = $CMDLINE_PARSE_DATESTAMP;
+
+push @EXPORT_OK, qw($CMDLINE_PARSE_LEVEL);
+push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw($CMDLINE_PARSE_LEVEL);
+
+$_cmdline_parse_dumpspecs_flags_VALUES{"CMDLINE_PARSE_LEVEL"} = $CMDLINE_PARSE_LEVEL;
+
+push @EXPORT_OK, qw($CMDLINE_EMPTY_TO_WILDCARD);
+push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw($CMDLINE_EMPTY_TO_WILDCARD);
+
+$_cmdline_parse_dumpspecs_flags_VALUES{"CMDLINE_EMPTY_TO_WILDCARD"} = $CMDLINE_EMPTY_TO_WILDCARD;
+1;
diff --git a/perl/Amanda/Cmdline.swg b/perl/Amanda/Cmdline.swg
new file mode 100644 (file)
index 0000000..0f878c1
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Cmdline"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include <glib.h>
+#include "cmdline.h"
+%}
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Cmdline - utilities for handling command lines
+
+=head1 SYNOPSIS
+
+  use Amanda::Cmdline;
+
+  my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
+  print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
+
+  my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
+                           $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
+  
+=head1 API STATUS
+
+Will change.
+
+=head1 Amanda::Cmdline::dumpspec_t Objects
+
+=head2 Instance Variables
+
+=over
+
+=item C<$host>
+
+=item C<$disk>
+
+=item C<$datestamp>
+
+=item C<$level>
+
+=back
+
+=head2 Methods
+
+=over
+
+=item C<format()>
+
+Format the dumpspec as a string.
+
+=back
+
+=head1 Functions
+
+=over
+
+=item C<format_dumpspec_components($host, $disk, $datestamp, $level)>
+
+This function returns a string representing the formatted form of the given dumpspec.  This formatting
+is the same as performed by C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
+
+=item C<parse_dumpspecs(@cmdline, $flags)> 
+
+This function parses C<@cmdline> into a list of C<dumpspec_t> objects,
+according to C<$flags>, which is a logical combination of zero or
+more of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and
+C<$CMDLINE_PARSE_LEVEL> to recognize levels.
+
+=back
+
+=head1 SEE ALSO
+
+L<Amanda::Config> handles C<-o> options itself, through C<config_overwrites>.
+
+=cut
+%}
+
+/* Add a few methods to make this type act like a class */
+typedef struct dumpspec_t {
+    %immutable;
+    char *host;
+    char *disk;
+    char *datestamp;
+    char *level;
+    %mutable;
+
+    %extend {
+       /* constructor */
+       dumpspec_t(char *host, char *disk, char *datestamp, char *level) {
+           return dumpspec_new(host, disk, datestamp, level);
+       }
+
+       ~dumpspec_t() {
+           dumpspec_free(self);
+       }
+
+       %newobject format;
+       char *format() {
+           return cmdline_format_dumpspec(self);
+       }
+    }
+} dumpspec_t;
+
+%rename(format_dumpspec_components) cmdline_format_dumpspec_components;
+char *cmdline_format_dumpspec_components(char *host, char *disk, char *datestamp, char *level);
+
+/* Typemap to convert the GSList that cmdline_parse_dumpspecs will
+ * return into an array of dumpspec_t's.  This uses some SWIG trickery
+ * to manage to convert the GSList itself to an array, while leaving the
+ * dumpspecs as C objects.
+ */
+%typemap(out) GSList * {
+    if ($1) {
+       GSList *iter;
+       EXTEND(SP, g_slist_length($1)); /* make room for return values */
+
+       iter = $1;
+       while (iter) {
+           /* Let SWIG take ownership of the object; we'll free the GSList momentarily */
+           $result = SWIG_NewPointerObj(iter->data, $descriptor(dumpspec_t*), SWIG_OWNER | SWIG_SHADOW);
+           argvi++;
+           iter = iter->next;
+       }
+
+       /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */
+       g_slist_free($1);
+    }
+}
+
+/* Typemap to convert a perl list of strings to the strv that 
+ * cmdline_parse_dumpspecs expects.
+ */
+%typemap(in, numinputs=1) (int argc, char **argv) {
+    AV *av;
+    int i;
+
+    if (!SvROK($input) || SvTYPE(SvRV($input)) != SVt_PVAV) {
+       SWIG_exception(SWIG_TypeError, "Expected an arrayref");
+    }
+    av = (AV *)SvRV($input);
+
+    $1 = av_len(av)+1; /* av_len(av) is like $#av */
+    $2 = malloc(sizeof(char *) * $1);
+    for (i = 0; i < $1; i++) {
+       SV **elt = av_fetch(av, i, 0);
+       if (!elt || !SvPOK(*elt)) {
+           SWIG_exception(SWIG_TypeError, "Non-string in arrayref");
+       }
+       $2[i] = SvPV_nolen(*elt); /* TODO: handle unicode here */
+    }
+}
+
+/* Free the space allocated by the previous typemap */
+%typemap(freearg) (int argc, char **argv) {
+    free($2);
+}
+
+amglue_add_flag_tag_fns(cmdline_parse_dumpspecs_flags);
+amglue_add_constant(CMDLINE_PARSE_DATESTAMP, cmdline_parse_dumpspecs_flags);
+amglue_add_constant(CMDLINE_PARSE_LEVEL, cmdline_parse_dumpspecs_flags);
+amglue_add_constant(CMDLINE_EMPTY_TO_WILDCARD, cmdline_parse_dumpspecs_flags);
+
+%rename(parse_dumpspecs) cmdline_parse_dumpspecs;
+GSList *cmdline_parse_dumpspecs(int argc, char **argv, int flags);
+
+/* TODO:
+ * convert AV back to GSList as input, convert resulting GSList into an AV of strings
+ * on output
+ */
+/* GSList * cmdline_match_holding(GSList *dumpspec_list); */
+
diff --git a/perl/Amanda/Config.c b/perl/Amanda/Config.c
new file mode 100644 (file)
index 0000000..dfd13c5
--- /dev/null
@@ -0,0 +1,5280 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_config_overwrites_t swig_types[1]
+#define SWIGTYPE_p_double swig_types[2]
+#define SWIGTYPE_p_dumptype_t swig_types[3]
+#define SWIGTYPE_p_float swig_types[4]
+#define SWIGTYPE_p_holdingdisk_t swig_types[5]
+#define SWIGTYPE_p_int swig_types[6]
+#define SWIGTYPE_p_interface_t swig_types[7]
+#define SWIGTYPE_p_p_char swig_types[8]
+#define SWIGTYPE_p_tapetype_t swig_types[9]
+#define SWIGTYPE_p_unsigned_char swig_types[10]
+static swig_type_info *swig_types[12];
+static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Config
+
+#define SWIG_name   "Amanda::Configc::boot_Amanda__Config"
+#define SWIG_prefix "Amanda::Configc::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "conffile.h"
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+    char *get_config_name(void) { return config_name; }
+    char *get_config_dir(void) { return config_dir; }
+    char *get_config_filename(void) { return config_filename; }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Config_var::
+class _wrap_Amanda::Config_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+SWIGCLASS_STATIC int _wrap_debug_amandad_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_amandad""' of type '""int""'");
+    }
+    debug_amandad = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amandad_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_amandad)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amidxtaped_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_amidxtaped""' of type '""int""'");
+    }
+    debug_amidxtaped = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amidxtaped_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_amidxtaped)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amindexd_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_amindexd""' of type '""int""'");
+    }
+    debug_amindexd = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amindexd_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_amindexd)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amrecover_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_amrecover""' of type '""int""'");
+    }
+    debug_amrecover = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_amrecover_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_amrecover)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_auth_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_auth""' of type '""int""'");
+    }
+    debug_auth = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_auth_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_auth)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_event_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_event""' of type '""int""'");
+    }
+    debug_event = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_event_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_event)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_holding_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_holding""' of type '""int""'");
+    }
+    debug_holding = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_holding_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_holding)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_protocol_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_protocol""' of type '""int""'");
+    }
+    debug_protocol = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_protocol_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_protocol)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_planner_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_planner""' of type '""int""'");
+    }
+    debug_planner = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_planner_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_planner)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_driver_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_driver""' of type '""int""'");
+    }
+    debug_driver = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_driver_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_driver)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_dumper_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_dumper""' of type '""int""'");
+    }
+    debug_dumper = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_dumper_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_dumper)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_chunker_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_chunker""' of type '""int""'");
+    }
+    debug_chunker = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_chunker_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_chunker)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_taper_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_taper""' of type '""int""'");
+    }
+    debug_taper = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_taper_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_taper)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_selfcheck_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_selfcheck""' of type '""int""'");
+    }
+    debug_selfcheck = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_selfcheck_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_selfcheck)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_sendsize_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_sendsize""' of type '""int""'");
+    }
+    debug_sendsize = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_sendsize_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_sendsize)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_sendbackup_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""debug_sendbackup""' of type '""int""'");
+    }
+    debug_sendbackup = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_debug_sendbackup_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(debug_sendbackup)))  ;
+  return 1;
+}
+
+
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_getconf) {
+  {
+    confparm_key arg1 ;
+    val_t *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: getconf(key);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (val_t *)getconf(arg1);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_getconf_seen) {
+  {
+    confparm_key arg1 ;
+    gboolean result;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: getconf_seen(key);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)getconf_seen(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_getconf_byname) {
+  {
+    char *arg1 = (char *) 0 ;
+    val_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: getconf_byname(key);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getconf_byname" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (val_t *)getconf_byname(arg1);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_getconf_list) {
+  {
+    char *arg1 = (char *) 0 ;
+    GSList *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: getconf_list(listname);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getconf_list" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (GSList *)getconf_list(arg1);
+    {
+      GSList *it = result;
+      
+      while (it) {
+        ST(argvi) = sv_2mortal(newSVpv(it->data, 0));
+        argvi++;
+        it = it->next;
+      }
+      
+      g_slist_free(result);
+    }
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_lookup_tapetype) {
+  {
+    char *arg1 = (char *) 0 ;
+    tapetype_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_tapetype(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_tapetype" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (tapetype_t *)lookup_tapetype(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_tapetype_t, 0 | 0); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_tapetype_getconf) {
+  {
+    tapetype_t *arg1 = (tapetype_t *) 0 ;
+    tapetype_key arg2 ;
+    val_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: tapetype_getconf(ttyp,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_tapetype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tapetype_getconf" "', argument " "1"" of type '" "tapetype_t *""'"); 
+    }
+    arg1 = (tapetype_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (val_t *)tapetype_getconf(arg1,arg2);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_tapetype_name) {
+  {
+    tapetype_t *arg1 = (tapetype_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: tapetype_name(ttyp);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_tapetype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tapetype_name" "', argument " "1"" of type '" "tapetype_t *""'"); 
+    }
+    arg1 = (tapetype_t *)(argp1);
+    result = (char *)tapetype_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_tapetype_seen) {
+  {
+    tapetype_t *arg1 = (tapetype_t *) 0 ;
+    tapetype_key arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: tapetype_seen(ttyp,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_tapetype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tapetype_seen" "', argument " "1"" of type '" "tapetype_t *""'"); 
+    }
+    arg1 = (tapetype_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)tapetype_seen(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_lookup_dumptype) {
+  {
+    char *arg1 = (char *) 0 ;
+    dumptype_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_dumptype(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_dumptype" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (dumptype_t *)lookup_dumptype(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumptype_t, 0 | 0); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumptype_getconf) {
+  {
+    dumptype_t *arg1 = (dumptype_t *) 0 ;
+    dumptype_key arg2 ;
+    val_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumptype_getconf(dtyp,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumptype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumptype_getconf" "', argument " "1"" of type '" "dumptype_t *""'"); 
+    }
+    arg1 = (dumptype_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (val_t *)dumptype_getconf(arg1,arg2);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumptype_name) {
+  {
+    dumptype_t *arg1 = (dumptype_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumptype_name(dtyp);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumptype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumptype_name" "', argument " "1"" of type '" "dumptype_t *""'"); 
+    }
+    arg1 = (dumptype_t *)(argp1);
+    result = (char *)dumptype_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumptype_seen) {
+  {
+    dumptype_t *arg1 = (dumptype_t *) 0 ;
+    dumptype_key arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumptype_seen(dtyp,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumptype_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumptype_seen" "', argument " "1"" of type '" "dumptype_t *""'"); 
+    }
+    arg1 = (dumptype_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)dumptype_seen(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_lookup_interface) {
+  {
+    char *arg1 = (char *) 0 ;
+    interface_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_interface(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_interface" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (interface_t *)lookup_interface(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_interface_t, 0 | 0); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_interface_getconf) {
+  {
+    interface_t *arg1 = (interface_t *) 0 ;
+    interface_key arg2 ;
+    val_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: interface_getconf(iface,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interface_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interface_getconf" "', argument " "1"" of type '" "interface_t *""'"); 
+    }
+    arg1 = (interface_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (val_t *)interface_getconf(arg1,arg2);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_interface_name) {
+  {
+    interface_t *arg1 = (interface_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: interface_name(iface);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interface_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interface_name" "', argument " "1"" of type '" "interface_t *""'"); 
+    }
+    arg1 = (interface_t *)(argp1);
+    result = (char *)interface_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_interface_seen) {
+  {
+    interface_t *arg1 = (interface_t *) 0 ;
+    interface_key arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: interface_seen(iface,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interface_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interface_seen" "', argument " "1"" of type '" "interface_t *""'"); 
+    }
+    arg1 = (interface_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)interface_seen(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_lookup_holdingdisk) {
+  {
+    char *arg1 = (char *) 0 ;
+    holdingdisk_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_holdingdisk(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_holdingdisk" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (holdingdisk_t *)lookup_holdingdisk(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_holdingdisk_t, 0 | 0); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_getconf_holdingdisks) {
+  {
+    holdingdisk_t *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: getconf_holdingdisks();");
+    }
+    result = (holdingdisk_t *)getconf_holdingdisks();
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_holdingdisk_t, 0 | 0); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_holdingdisk_next) {
+  {
+    holdingdisk_t *arg1 = (holdingdisk_t *) 0 ;
+    holdingdisk_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: holdingdisk_next(hdisk);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_holdingdisk_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "holdingdisk_next" "', argument " "1"" of type '" "holdingdisk_t *""'"); 
+    }
+    arg1 = (holdingdisk_t *)(argp1);
+    result = (holdingdisk_t *)holdingdisk_next(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_holdingdisk_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_holdingdisk_getconf) {
+  {
+    holdingdisk_t *arg1 = (holdingdisk_t *) 0 ;
+    holdingdisk_key arg2 ;
+    val_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: holdingdisk_getconf(hdisk,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_holdingdisk_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "holdingdisk_getconf" "', argument " "1"" of type '" "holdingdisk_t *""'"); 
+    }
+    arg1 = (holdingdisk_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (val_t *)holdingdisk_getconf(arg1,arg2);
+    {
+      switch (result->type) {
+        case CONFTYPE_RATE: {
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setnv(ST(argvi), val_t__rate(result)[1]);
+          argvi++;
+          break;
+        }
+        
+        case CONFTYPE_INTRANGE: {
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[0]);
+          argvi++;
+          
+          ST(argvi)= sv_newmortal();
+          sv_setiv(ST(argvi), val_t__intrange(result)[1]);
+          argvi++;
+          break;
+          break;
+        }
+        
+        case CONFTYPE_EXINCLUDE: {
+          /* exincludes are represented in perl as {
+                    *  'list' : [ 'list1', 'list2', ..],
+                    *  'file' : [ 'file1', 'file2', ..],
+                    *  'optional' : 1,
+                    * }
+                    */
+          exinclude_t *ei = &val_t__exinclude(result);
+          AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+          AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+          SV *optional = sv_newmortal();
+          HV *hv;
+          sle_t *iter;
+          
+          /* first set up each of the hash values */
+          
+          if (ei->sl_list) {
+            for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+              av_push(list_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          if(ei->sl_file) {
+            for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+              av_push(file_entries, newSVpv(iter->name, 0));
+            }
+          }
+          
+          sv_setiv(optional, ei->optional);
+          
+          /* now build the hash */
+          hv = (HV *)sv_2mortal((SV *)newHV());
+          
+          hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+          hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+          hv_store(hv, "optional", 8, optional, 0);
+          SvREFCNT_inc(optional);
+          
+          ST(argvi) = sv_2mortal(newRV((SV *)hv));
+          argvi++;
+          break;
+        }
+        
+      case CONFTYPE_PROPLIST:
+        ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_SIZE:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_AM64:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result)));
+        argvi++;
+        break;
+        
+        case CONFTYPE_BOOLEAN:     /* all same as INT.. */
+      case CONFTYPE_COMPRESS:
+      case CONFTYPE_ENCRYPT:
+      case CONFTYPE_ESTIMATE:
+      case CONFTYPE_STRATEGY:
+      case CONFTYPE_TAPERALGO:
+      case CONFTYPE_PRIORITY:
+      case CONFTYPE_HOLDING:
+      case CONFTYPE_INT:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_TIME:
+        ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result)));
+        argvi++;
+        break;
+        
+      case CONFTYPE_REAL:
+        ST(argvi) = sv_newmortal();
+        sv_setnv(ST(argvi), val_t__real(result));
+        argvi++;
+        break;
+        
+        case CONFTYPE_IDENT:       /* same as STRING */
+      case CONFTYPE_STR:
+        ST(argvi) = sv_newmortal();
+        sv_setpv(ST(argvi), val_t__str(result));
+        argvi++;
+        break;
+        
+        /* No match yet -> not one of the "complex" types */
+      default:
+        SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+        break;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_holdingdisk_name) {
+  {
+    holdingdisk_t *arg1 = (holdingdisk_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: holdingdisk_name(hdisk);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_holdingdisk_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "holdingdisk_name" "', argument " "1"" of type '" "holdingdisk_t *""'"); 
+    }
+    arg1 = (holdingdisk_t *)(argp1);
+    result = (char *)holdingdisk_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_holdingdisk_seen) {
+  {
+    holdingdisk_t *arg1 = (holdingdisk_t *) 0 ;
+    holdingdisk_key arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: holdingdisk_seen(hdisk,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_holdingdisk_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "holdingdisk_seen" "', argument " "1"" of type '" "holdingdisk_t *""'"); 
+    }
+    arg1 = (holdingdisk_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)holdingdisk_seen(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_getconf_unit_divisor) {
+  {
+    long result;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: getconf_unit_divisor();");
+    }
+    result = (long)getconf_unit_divisor();
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_config_overwrites) {
+  {
+    int arg1 ;
+    config_overwrites_t *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: new_config_overwrites(size_estimate);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (config_overwrites_t *)new_config_overwrites(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_config_overwrites_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_free_config_overwrites) {
+  {
+    config_overwrites_t *arg1 = (config_overwrites_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: free_config_overwrites(co);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_config_overwrites_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "free_config_overwrites" "', argument " "1"" of type '" "config_overwrites_t *""'"); 
+    }
+    arg1 = (config_overwrites_t *)(argp1);
+    free_config_overwrites(arg1);
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_add_config_overwrite) {
+  {
+    config_overwrites_t *arg1 = (config_overwrites_t *) 0 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: add_config_overwrite(co,key,value);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_config_overwrites_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "add_config_overwrite" "', argument " "1"" of type '" "config_overwrites_t *""'"); 
+    }
+    arg1 = (config_overwrites_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "add_config_overwrite" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "add_config_overwrite" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    add_config_overwrite(arg1,arg2,arg3);
+    
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_add_config_overwrite_opt) {
+  {
+    config_overwrites_t *arg1 = (config_overwrites_t *) 0 ;
+    char *arg2 = (char *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: add_config_overwrite_opt(co,optarg);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_config_overwrites_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "add_config_overwrite_opt" "', argument " "1"" of type '" "config_overwrites_t *""'"); 
+    }
+    arg1 = (config_overwrites_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "add_config_overwrite_opt" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    add_config_overwrite_opt(arg1,arg2);
+    
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_apply_config_overwrites) {
+  {
+    config_overwrites_t *arg1 = (config_overwrites_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: apply_config_overwrites(co);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_config_overwrites_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "apply_config_overwrites" "', argument " "1"" of type '" "config_overwrites_t *""'"); 
+    }
+    arg1 = (config_overwrites_t *)(argp1);
+    apply_config_overwrites(arg1);
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_config_init) {
+  {
+    config_init_flags arg1 ;
+    char *arg2 = (char *) 0 ;
+    gboolean result;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: config_init(flags,arg_config_name);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "config_init" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    result = (gboolean)config_init(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_config_uninit) {
+  {
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: config_uninit();");
+    }
+    config_uninit();
+    
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_config_options) {
+  {
+    int arg1 ;
+    char **result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: get_config_options(first);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (char **)get_config_options(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_config_name) {
+  {
+    char *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: get_config_name();");
+    }
+    result = (char *)get_config_name();
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_config_dir) {
+  {
+    char *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: get_config_dir();");
+    }
+    result = (char *)get_config_dir();
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_config_filename) {
+  {
+    char *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: get_config_filename();");
+    }
+    result = (char *)get_config_filename();
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dump_configuration) {
+  {
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: dump_configuration();");
+    }
+    dump_configuration();
+    
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_config_dir_relative) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: config_dir_relative(filename);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "config_dir_relative" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (char *)config_dir_relative(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_taperalgo2str) {
+  {
+    taperalgo_t arg1 ;
+    char *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: taperalgo2str(taperalgo);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (char *)taperalgo2str(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_multiplier) {
+  {
+    char *arg1 = (char *) 0 ;
+    gint64 result;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_multiplier(casestr);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_multiplier" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = find_multiplier(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_config_overwrites_t = {"_p_config_overwrites_t", "config_overwrites_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumptype_t = {"_p_dumptype_t", "dumptype_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_holdingdisk_t = {"_p_holdingdisk_t", "holdingdisk_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "strategy_t *|int *|comp_t *|dump_holdingdisk_t *|holdingdisk_key *|interface_key *|confparm_key *|dumptype_key *|tapetype_key *|encrypt_t *|taperalgo_t *|gboolean *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_interface_t = {"_p_interface_t", "interface_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_tapetype_t = {"_p_tapetype_t", "tapetype_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_config_overwrites_t,
+  &_swigt__p_double,
+  &_swigt__p_dumptype_t,
+  &_swigt__p_float,
+  &_swigt__p_holdingdisk_t,
+  &_swigt__p_int,
+  &_swigt__p_interface_t,
+  &_swigt__p_p_char,
+  &_swigt__p_tapetype_t,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_config_overwrites_t[] = {  {&_swigt__p_config_overwrites_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumptype_t[] = {  {&_swigt__p_dumptype_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_holdingdisk_t[] = {  {&_swigt__p_holdingdisk_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_interface_t[] = {  {&_swigt__p_interface_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_tapetype_t[] = {  {&_swigt__p_tapetype_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_config_overwrites_t,
+  _swigc__p_double,
+  _swigc__p_dumptype_t,
+  _swigc__p_float,
+  _swigc__p_holdingdisk_t,
+  _swigc__p_int,
+  _swigc__p_interface_t,
+  _swigc__p_p_char,
+  _swigc__p_tapetype_t,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+    { "Amanda::Configc::debug_amandad", MAGIC_CLASS _wrap_debug_amandad_set, MAGIC_CLASS _wrap_debug_amandad_get,0 },
+    { "Amanda::Configc::debug_amidxtaped", MAGIC_CLASS _wrap_debug_amidxtaped_set, MAGIC_CLASS _wrap_debug_amidxtaped_get,0 },
+    { "Amanda::Configc::debug_amindexd", MAGIC_CLASS _wrap_debug_amindexd_set, MAGIC_CLASS _wrap_debug_amindexd_get,0 },
+    { "Amanda::Configc::debug_amrecover", MAGIC_CLASS _wrap_debug_amrecover_set, MAGIC_CLASS _wrap_debug_amrecover_get,0 },
+    { "Amanda::Configc::debug_auth", MAGIC_CLASS _wrap_debug_auth_set, MAGIC_CLASS _wrap_debug_auth_get,0 },
+    { "Amanda::Configc::debug_event", MAGIC_CLASS _wrap_debug_event_set, MAGIC_CLASS _wrap_debug_event_get,0 },
+    { "Amanda::Configc::debug_holding", MAGIC_CLASS _wrap_debug_holding_set, MAGIC_CLASS _wrap_debug_holding_get,0 },
+    { "Amanda::Configc::debug_protocol", MAGIC_CLASS _wrap_debug_protocol_set, MAGIC_CLASS _wrap_debug_protocol_get,0 },
+    { "Amanda::Configc::debug_planner", MAGIC_CLASS _wrap_debug_planner_set, MAGIC_CLASS _wrap_debug_planner_get,0 },
+    { "Amanda::Configc::debug_driver", MAGIC_CLASS _wrap_debug_driver_set, MAGIC_CLASS _wrap_debug_driver_get,0 },
+    { "Amanda::Configc::debug_dumper", MAGIC_CLASS _wrap_debug_dumper_set, MAGIC_CLASS _wrap_debug_dumper_get,0 },
+    { "Amanda::Configc::debug_chunker", MAGIC_CLASS _wrap_debug_chunker_set, MAGIC_CLASS _wrap_debug_chunker_get,0 },
+    { "Amanda::Configc::debug_taper", MAGIC_CLASS _wrap_debug_taper_set, MAGIC_CLASS _wrap_debug_taper_get,0 },
+    { "Amanda::Configc::debug_selfcheck", MAGIC_CLASS _wrap_debug_selfcheck_set, MAGIC_CLASS _wrap_debug_selfcheck_get,0 },
+    { "Amanda::Configc::debug_sendsize", MAGIC_CLASS _wrap_debug_sendsize_set, MAGIC_CLASS _wrap_debug_sendsize_get,0 },
+    { "Amanda::Configc::debug_sendbackup", MAGIC_CLASS _wrap_debug_sendbackup_set, MAGIC_CLASS _wrap_debug_sendbackup_get,0 },
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Configc::getconf", _wrap_getconf},
+{"Amanda::Configc::getconf_seen", _wrap_getconf_seen},
+{"Amanda::Configc::getconf_byname", _wrap_getconf_byname},
+{"Amanda::Configc::getconf_list", _wrap_getconf_list},
+{"Amanda::Configc::lookup_tapetype", _wrap_lookup_tapetype},
+{"Amanda::Configc::tapetype_getconf", _wrap_tapetype_getconf},
+{"Amanda::Configc::tapetype_name", _wrap_tapetype_name},
+{"Amanda::Configc::tapetype_seen", _wrap_tapetype_seen},
+{"Amanda::Configc::lookup_dumptype", _wrap_lookup_dumptype},
+{"Amanda::Configc::dumptype_getconf", _wrap_dumptype_getconf},
+{"Amanda::Configc::dumptype_name", _wrap_dumptype_name},
+{"Amanda::Configc::dumptype_seen", _wrap_dumptype_seen},
+{"Amanda::Configc::lookup_interface", _wrap_lookup_interface},
+{"Amanda::Configc::interface_getconf", _wrap_interface_getconf},
+{"Amanda::Configc::interface_name", _wrap_interface_name},
+{"Amanda::Configc::interface_seen", _wrap_interface_seen},
+{"Amanda::Configc::lookup_holdingdisk", _wrap_lookup_holdingdisk},
+{"Amanda::Configc::getconf_holdingdisks", _wrap_getconf_holdingdisks},
+{"Amanda::Configc::holdingdisk_next", _wrap_holdingdisk_next},
+{"Amanda::Configc::holdingdisk_getconf", _wrap_holdingdisk_getconf},
+{"Amanda::Configc::holdingdisk_name", _wrap_holdingdisk_name},
+{"Amanda::Configc::holdingdisk_seen", _wrap_holdingdisk_seen},
+{"Amanda::Configc::getconf_unit_divisor", _wrap_getconf_unit_divisor},
+{"Amanda::Configc::new_config_overwrites", _wrap_new_config_overwrites},
+{"Amanda::Configc::free_config_overwrites", _wrap_free_config_overwrites},
+{"Amanda::Configc::add_config_overwrite", _wrap_add_config_overwrite},
+{"Amanda::Configc::add_config_overwrite_opt", _wrap_add_config_overwrite_opt},
+{"Amanda::Configc::apply_config_overwrites", _wrap_apply_config_overwrites},
+{"Amanda::Configc::config_init", _wrap_config_init},
+{"Amanda::Configc::config_uninit", _wrap_config_uninit},
+{"Amanda::Configc::get_config_options", _wrap_get_config_options},
+{"Amanda::Configc::get_config_name", _wrap_get_config_name},
+{"Amanda::Configc::get_config_dir", _wrap_get_config_dir},
+{"Amanda::Configc::get_config_filename", _wrap_get_config_filename},
+{"Amanda::Configc::dump_configuration", _wrap_dump_configuration},
+{"Amanda::Configc::config_dir_relative", _wrap_config_dir_relative},
+{"Amanda::Configc::taperalgo2str", _wrap_taperalgo2str},
+{"Amanda::Configc::find_multiplier", _wrap_find_multiplier},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_ORG", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_ORG)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CONF", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CONF)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEX_SERVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INDEX_SERVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPE_SERVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPE_SERVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AUTH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_SSH_KEYS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_SSH_KEYS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDAD_PATH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMANDAD_PATH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CLIENT_USERNAME", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CLIENT_USERNAME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_GNUTAR_LIST_DIR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_GNUTAR_LIST_DIR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDATES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMANDATES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_MAILTO", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_MAILTO)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPUSER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPUSER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEDEV", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPEDEV)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_PROPERTY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEVICE_PROPERTY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERDEV", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CHANGERDEV)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CHANGERFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_LABELSTR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_LABELSTR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPELIST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPELIST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DISKFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DISKFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_INFOFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INFOFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_LOGDIR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_LOGDIR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEXDIR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INDEXDIR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPETYPE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPETYPE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPCYCLE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPCYCLE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNSPERCYCLE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RUNSPERCYCLE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPECYCLE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPECYCLE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_NETUSAGE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_NETUSAGE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_INPARALLEL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INPARALLEL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPORDER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPORDER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPPERCENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPPERCENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPMULT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPMULT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPDAYS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPDAYS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TPCHANGER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TPCHANGER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNTAPES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RUNTAPES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_MAXDUMPS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_ETIMEOUT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_ETIMEOUT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DTIMEOUT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DTIMEOUT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CTIMEOUT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CTIMEOUT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEBUFS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPEBUFS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_OUTPUT_BUFFER_SIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEVICE_OUTPUT_BUFFER_SIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_PRINTER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_PRINTER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTOFLUSH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AUTOFLUSH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_MAXDUMPSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_COLUMNSPEC", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_COLUMNSPEC)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_DO_FSF", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_DO_FSF)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHECK_LABEL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_CHECK_LABEL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHANGER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_CHANGER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERALGO", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPERALGO)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_DUMPED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_FLUSH_THRESHOLD_DUMPED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_SCHEDULED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_FLUSH_THRESHOLD_SCHEDULED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERFLUSH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPERFLUSH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DISPLAYUNIT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DISPLAYUNIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5KEYTAB", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_KRB5KEYTAB)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5PRINCIPAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_KRB5PRINCIPAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_LABEL_NEW_TAPES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_LABEL_NEW_TAPES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_USETIMESTAMPS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_USETIMESTAMPS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_REP_TRIES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_REP_TRIES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_CONNECT_TRIES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_CONNECT_TRIES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_REQ_TRIES", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_REQ_TRIES)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMANDAD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMANDAD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMIDXTAPED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMIDXTAPED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMINDEXD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMINDEXD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMRECOVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMRECOVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AUTH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AUTH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_EVENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_EVENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_HOLDING", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_HOLDING)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PROTOCOL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_PROTOCOL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PLANNER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_PLANNER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DRIVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_DRIVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DUMPER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_DUMPER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_CHUNKER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_CHUNKER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_TAPER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_TAPER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SELFCHECK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SELFCHECK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SENDSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDBACKUP", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SENDBACKUP)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_UDP_PORT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVED_UDP_PORT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_TCP_PORT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVED_TCP_PORT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_UNRESERVED_TCP_PORT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_UNRESERVED_TCP_PORT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_COMMENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LBL_TEMPL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_LBL_TEMPL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_BLOCKSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_BLOCKSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_READBLOCKSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_READBLOCKSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LENGTH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_LENGTH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILEMARK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_FILEMARK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_SPEED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_SPEED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILE_PAD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_FILE_PAD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMMENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PROGRAM", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PROGRAM)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRVCOMPPROG", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRVCOMPPROG)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNTCOMPPROG", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNTCOMPPROG)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_ENCRYPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRV_ENCRYPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_ENCRYPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNT_ENCRYPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_AMANDAD_PATH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_AMANDAD_PATH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLIENT_USERNAME", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLIENT_USERNAME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SSH_KEYS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SSH_KEYS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SECURITY_DRIVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SECURITY_DRIVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_EXCLUDE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_EXCLUDE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INCLUDE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_INCLUDE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PRIORITY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PRIORITY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_DUMPCYCLE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_DUMPCYCLE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXDUMPS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_MAXDUMPS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXPROMOTEDAY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_MAXPROMOTEDAY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPPERCENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPPERCENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPDAYS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPDAYS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPMULT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPMULT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STARTTIME", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_STARTTIME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STRATEGY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_STRATEGY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ESTIMATE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_ESTIMATE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRESS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMPRESS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ENCRYPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_ENCRYPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_DECRYPT_OPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRV_DECRYPT_OPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_DECRYPT_OPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNT_DECRYPT_OPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRATE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMPRATE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_TAPE_SPLITSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_TAPE_SPLITSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_FALLBACK_SPLITSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_FALLBACK_SPLITSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SPLIT_DISKBUFFER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SPLIT_DISKBUFFER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_RECORD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_RECORD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_INCR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SKIP_INCR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_FULL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SKIP_FULL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_HOLDINGDISK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_HOLDINGDISK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_KENCRYPT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_KENCRYPT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_IGNORE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_IGNORE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INDEX", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_INDEX)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "INTER_COMMENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTER_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "INTER_MAXUSAGE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTER_MAXUSAGE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLDING_COMMENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLDING_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKDIR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLDING_DISKDIR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLDING_DISKSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLDING_CHUNKSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLDING_CHUNKSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLD_NEVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLD_NEVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLD_AUTO", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLD_AUTO)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "HOLD_REQUIRED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLD_REQUIRED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_NONE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_NONE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_FAST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_FAST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_BEST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_BEST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_CUST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_CUST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_FAST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_FAST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_BEST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_BEST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_CUST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_CUST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_NONE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_NONE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_CUST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_CUST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_SERV_CUST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_SERV_CUST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_SKIP", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_SKIP)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_STANDARD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_STANDARD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_NOFULL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_NOFULL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_NOINC", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_NOINC)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_4", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_4)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_5", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_5)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_HANOI", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_HANOI)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DS_INCRONLY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DS_INCRONLY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ES_CLIENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ES_CLIENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ES_SERVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ES_SERVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ES_CALCSIZE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ES_CALCSIZE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_FIRST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRSTFIT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_FIRSTFIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGEST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_LARGEST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGESTFIT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_LARGESTFIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_SMALLEST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_SMALLEST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ALGO_LAST", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ALGO_LAST)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_EXPLICIT_NAME", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_EXPLICIT_NAME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_USE_CWD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_USE_CWD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_CLIENT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_CLIENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_OVERLAY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_OVERLAY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_FATAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_FATAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Config.pm b/perl/Amanda/Config.pm
new file mode 100644 (file)
index 0000000..c428b5a
--- /dev/null
@@ -0,0 +1,1655 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Config;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Configc;
+bootstrap Amanda::Config;
+package Amanda::Config;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Config;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Config;
+
+*getconf = *Amanda::Configc::getconf;
+*getconf_seen = *Amanda::Configc::getconf_seen;
+*getconf_byname = *Amanda::Configc::getconf_byname;
+*getconf_list = *Amanda::Configc::getconf_list;
+*lookup_tapetype = *Amanda::Configc::lookup_tapetype;
+*tapetype_getconf = *Amanda::Configc::tapetype_getconf;
+*tapetype_name = *Amanda::Configc::tapetype_name;
+*tapetype_seen = *Amanda::Configc::tapetype_seen;
+*lookup_dumptype = *Amanda::Configc::lookup_dumptype;
+*dumptype_getconf = *Amanda::Configc::dumptype_getconf;
+*dumptype_name = *Amanda::Configc::dumptype_name;
+*dumptype_seen = *Amanda::Configc::dumptype_seen;
+*lookup_interface = *Amanda::Configc::lookup_interface;
+*interface_getconf = *Amanda::Configc::interface_getconf;
+*interface_name = *Amanda::Configc::interface_name;
+*interface_seen = *Amanda::Configc::interface_seen;
+*lookup_holdingdisk = *Amanda::Configc::lookup_holdingdisk;
+*getconf_holdingdisks = *Amanda::Configc::getconf_holdingdisks;
+*holdingdisk_next = *Amanda::Configc::holdingdisk_next;
+*holdingdisk_getconf = *Amanda::Configc::holdingdisk_getconf;
+*holdingdisk_name = *Amanda::Configc::holdingdisk_name;
+*holdingdisk_seen = *Amanda::Configc::holdingdisk_seen;
+*getconf_unit_divisor = *Amanda::Configc::getconf_unit_divisor;
+*new_config_overwrites = *Amanda::Configc::new_config_overwrites;
+*free_config_overwrites = *Amanda::Configc::free_config_overwrites;
+*add_config_overwrite = *Amanda::Configc::add_config_overwrite;
+*add_config_overwrite_opt = *Amanda::Configc::add_config_overwrite_opt;
+*apply_config_overwrites = *Amanda::Configc::apply_config_overwrites;
+*config_init = *Amanda::Configc::config_init;
+*config_uninit = *Amanda::Configc::config_uninit;
+*get_config_options = *Amanda::Configc::get_config_options;
+*get_config_name = *Amanda::Configc::get_config_name;
+*get_config_dir = *Amanda::Configc::get_config_dir;
+*get_config_filename = *Amanda::Configc::get_config_filename;
+*dump_configuration = *Amanda::Configc::dump_configuration;
+*config_dir_relative = *Amanda::Configc::config_dir_relative;
+*taperalgo2str = *Amanda::Configc::taperalgo2str;
+*find_multiplier = *Amanda::Configc::find_multiplier;
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Config;
+
+*CNF_ORG = *Amanda::Configc::CNF_ORG;
+*CNF_CONF = *Amanda::Configc::CNF_CONF;
+*CNF_INDEX_SERVER = *Amanda::Configc::CNF_INDEX_SERVER;
+*CNF_TAPE_SERVER = *Amanda::Configc::CNF_TAPE_SERVER;
+*CNF_AUTH = *Amanda::Configc::CNF_AUTH;
+*CNF_SSH_KEYS = *Amanda::Configc::CNF_SSH_KEYS;
+*CNF_AMANDAD_PATH = *Amanda::Configc::CNF_AMANDAD_PATH;
+*CNF_CLIENT_USERNAME = *Amanda::Configc::CNF_CLIENT_USERNAME;
+*CNF_GNUTAR_LIST_DIR = *Amanda::Configc::CNF_GNUTAR_LIST_DIR;
+*CNF_AMANDATES = *Amanda::Configc::CNF_AMANDATES;
+*CNF_MAILTO = *Amanda::Configc::CNF_MAILTO;
+*CNF_DUMPUSER = *Amanda::Configc::CNF_DUMPUSER;
+*CNF_TAPEDEV = *Amanda::Configc::CNF_TAPEDEV;
+*CNF_DEVICE_PROPERTY = *Amanda::Configc::CNF_DEVICE_PROPERTY;
+*CNF_CHANGERDEV = *Amanda::Configc::CNF_CHANGERDEV;
+*CNF_CHANGERFILE = *Amanda::Configc::CNF_CHANGERFILE;
+*CNF_LABELSTR = *Amanda::Configc::CNF_LABELSTR;
+*CNF_TAPELIST = *Amanda::Configc::CNF_TAPELIST;
+*CNF_DISKFILE = *Amanda::Configc::CNF_DISKFILE;
+*CNF_INFOFILE = *Amanda::Configc::CNF_INFOFILE;
+*CNF_LOGDIR = *Amanda::Configc::CNF_LOGDIR;
+*CNF_INDEXDIR = *Amanda::Configc::CNF_INDEXDIR;
+*CNF_TAPETYPE = *Amanda::Configc::CNF_TAPETYPE;
+*CNF_DUMPCYCLE = *Amanda::Configc::CNF_DUMPCYCLE;
+*CNF_RUNSPERCYCLE = *Amanda::Configc::CNF_RUNSPERCYCLE;
+*CNF_TAPECYCLE = *Amanda::Configc::CNF_TAPECYCLE;
+*CNF_NETUSAGE = *Amanda::Configc::CNF_NETUSAGE;
+*CNF_INPARALLEL = *Amanda::Configc::CNF_INPARALLEL;
+*CNF_DUMPORDER = *Amanda::Configc::CNF_DUMPORDER;
+*CNF_BUMPPERCENT = *Amanda::Configc::CNF_BUMPPERCENT;
+*CNF_BUMPSIZE = *Amanda::Configc::CNF_BUMPSIZE;
+*CNF_BUMPMULT = *Amanda::Configc::CNF_BUMPMULT;
+*CNF_BUMPDAYS = *Amanda::Configc::CNF_BUMPDAYS;
+*CNF_TPCHANGER = *Amanda::Configc::CNF_TPCHANGER;
+*CNF_RUNTAPES = *Amanda::Configc::CNF_RUNTAPES;
+*CNF_MAXDUMPS = *Amanda::Configc::CNF_MAXDUMPS;
+*CNF_ETIMEOUT = *Amanda::Configc::CNF_ETIMEOUT;
+*CNF_DTIMEOUT = *Amanda::Configc::CNF_DTIMEOUT;
+*CNF_CTIMEOUT = *Amanda::Configc::CNF_CTIMEOUT;
+*CNF_TAPEBUFS = *Amanda::Configc::CNF_TAPEBUFS;
+*CNF_DEVICE_OUTPUT_BUFFER_SIZE = *Amanda::Configc::CNF_DEVICE_OUTPUT_BUFFER_SIZE;
+*CNF_PRINTER = *Amanda::Configc::CNF_PRINTER;
+*CNF_AUTOFLUSH = *Amanda::Configc::CNF_AUTOFLUSH;
+*CNF_RESERVE = *Amanda::Configc::CNF_RESERVE;
+*CNF_MAXDUMPSIZE = *Amanda::Configc::CNF_MAXDUMPSIZE;
+*CNF_COLUMNSPEC = *Amanda::Configc::CNF_COLUMNSPEC;
+*CNF_AMRECOVER_DO_FSF = *Amanda::Configc::CNF_AMRECOVER_DO_FSF;
+*CNF_AMRECOVER_CHECK_LABEL = *Amanda::Configc::CNF_AMRECOVER_CHECK_LABEL;
+*CNF_AMRECOVER_CHANGER = *Amanda::Configc::CNF_AMRECOVER_CHANGER;
+*CNF_TAPERALGO = *Amanda::Configc::CNF_TAPERALGO;
+*CNF_FLUSH_THRESHOLD_DUMPED = *Amanda::Configc::CNF_FLUSH_THRESHOLD_DUMPED;
+*CNF_FLUSH_THRESHOLD_SCHEDULED = *Amanda::Configc::CNF_FLUSH_THRESHOLD_SCHEDULED;
+*CNF_TAPERFLUSH = *Amanda::Configc::CNF_TAPERFLUSH;
+*CNF_DISPLAYUNIT = *Amanda::Configc::CNF_DISPLAYUNIT;
+*CNF_KRB5KEYTAB = *Amanda::Configc::CNF_KRB5KEYTAB;
+*CNF_KRB5PRINCIPAL = *Amanda::Configc::CNF_KRB5PRINCIPAL;
+*CNF_LABEL_NEW_TAPES = *Amanda::Configc::CNF_LABEL_NEW_TAPES;
+*CNF_USETIMESTAMPS = *Amanda::Configc::CNF_USETIMESTAMPS;
+*CNF_REP_TRIES = *Amanda::Configc::CNF_REP_TRIES;
+*CNF_CONNECT_TRIES = *Amanda::Configc::CNF_CONNECT_TRIES;
+*CNF_REQ_TRIES = *Amanda::Configc::CNF_REQ_TRIES;
+*CNF_DEBUG_AMANDAD = *Amanda::Configc::CNF_DEBUG_AMANDAD;
+*CNF_DEBUG_AMIDXTAPED = *Amanda::Configc::CNF_DEBUG_AMIDXTAPED;
+*CNF_DEBUG_AMINDEXD = *Amanda::Configc::CNF_DEBUG_AMINDEXD;
+*CNF_DEBUG_AMRECOVER = *Amanda::Configc::CNF_DEBUG_AMRECOVER;
+*CNF_DEBUG_AUTH = *Amanda::Configc::CNF_DEBUG_AUTH;
+*CNF_DEBUG_EVENT = *Amanda::Configc::CNF_DEBUG_EVENT;
+*CNF_DEBUG_HOLDING = *Amanda::Configc::CNF_DEBUG_HOLDING;
+*CNF_DEBUG_PROTOCOL = *Amanda::Configc::CNF_DEBUG_PROTOCOL;
+*CNF_DEBUG_PLANNER = *Amanda::Configc::CNF_DEBUG_PLANNER;
+*CNF_DEBUG_DRIVER = *Amanda::Configc::CNF_DEBUG_DRIVER;
+*CNF_DEBUG_DUMPER = *Amanda::Configc::CNF_DEBUG_DUMPER;
+*CNF_DEBUG_CHUNKER = *Amanda::Configc::CNF_DEBUG_CHUNKER;
+*CNF_DEBUG_TAPER = *Amanda::Configc::CNF_DEBUG_TAPER;
+*CNF_DEBUG_SELFCHECK = *Amanda::Configc::CNF_DEBUG_SELFCHECK;
+*CNF_DEBUG_SENDSIZE = *Amanda::Configc::CNF_DEBUG_SENDSIZE;
+*CNF_DEBUG_SENDBACKUP = *Amanda::Configc::CNF_DEBUG_SENDBACKUP;
+*CNF_RESERVED_UDP_PORT = *Amanda::Configc::CNF_RESERVED_UDP_PORT;
+*CNF_RESERVED_TCP_PORT = *Amanda::Configc::CNF_RESERVED_TCP_PORT;
+*CNF_UNRESERVED_TCP_PORT = *Amanda::Configc::CNF_UNRESERVED_TCP_PORT;
+*TAPETYPE_COMMENT = *Amanda::Configc::TAPETYPE_COMMENT;
+*TAPETYPE_LBL_TEMPL = *Amanda::Configc::TAPETYPE_LBL_TEMPL;
+*TAPETYPE_BLOCKSIZE = *Amanda::Configc::TAPETYPE_BLOCKSIZE;
+*TAPETYPE_READBLOCKSIZE = *Amanda::Configc::TAPETYPE_READBLOCKSIZE;
+*TAPETYPE_LENGTH = *Amanda::Configc::TAPETYPE_LENGTH;
+*TAPETYPE_FILEMARK = *Amanda::Configc::TAPETYPE_FILEMARK;
+*TAPETYPE_SPEED = *Amanda::Configc::TAPETYPE_SPEED;
+*TAPETYPE_FILE_PAD = *Amanda::Configc::TAPETYPE_FILE_PAD;
+*DUMPTYPE_COMMENT = *Amanda::Configc::DUMPTYPE_COMMENT;
+*DUMPTYPE_PROGRAM = *Amanda::Configc::DUMPTYPE_PROGRAM;
+*DUMPTYPE_SRVCOMPPROG = *Amanda::Configc::DUMPTYPE_SRVCOMPPROG;
+*DUMPTYPE_CLNTCOMPPROG = *Amanda::Configc::DUMPTYPE_CLNTCOMPPROG;
+*DUMPTYPE_SRV_ENCRYPT = *Amanda::Configc::DUMPTYPE_SRV_ENCRYPT;
+*DUMPTYPE_CLNT_ENCRYPT = *Amanda::Configc::DUMPTYPE_CLNT_ENCRYPT;
+*DUMPTYPE_AMANDAD_PATH = *Amanda::Configc::DUMPTYPE_AMANDAD_PATH;
+*DUMPTYPE_CLIENT_USERNAME = *Amanda::Configc::DUMPTYPE_CLIENT_USERNAME;
+*DUMPTYPE_SSH_KEYS = *Amanda::Configc::DUMPTYPE_SSH_KEYS;
+*DUMPTYPE_SECURITY_DRIVER = *Amanda::Configc::DUMPTYPE_SECURITY_DRIVER;
+*DUMPTYPE_EXCLUDE = *Amanda::Configc::DUMPTYPE_EXCLUDE;
+*DUMPTYPE_INCLUDE = *Amanda::Configc::DUMPTYPE_INCLUDE;
+*DUMPTYPE_PRIORITY = *Amanda::Configc::DUMPTYPE_PRIORITY;
+*DUMPTYPE_DUMPCYCLE = *Amanda::Configc::DUMPTYPE_DUMPCYCLE;
+*DUMPTYPE_MAXDUMPS = *Amanda::Configc::DUMPTYPE_MAXDUMPS;
+*DUMPTYPE_MAXPROMOTEDAY = *Amanda::Configc::DUMPTYPE_MAXPROMOTEDAY;
+*DUMPTYPE_BUMPPERCENT = *Amanda::Configc::DUMPTYPE_BUMPPERCENT;
+*DUMPTYPE_BUMPSIZE = *Amanda::Configc::DUMPTYPE_BUMPSIZE;
+*DUMPTYPE_BUMPDAYS = *Amanda::Configc::DUMPTYPE_BUMPDAYS;
+*DUMPTYPE_BUMPMULT = *Amanda::Configc::DUMPTYPE_BUMPMULT;
+*DUMPTYPE_STARTTIME = *Amanda::Configc::DUMPTYPE_STARTTIME;
+*DUMPTYPE_STRATEGY = *Amanda::Configc::DUMPTYPE_STRATEGY;
+*DUMPTYPE_ESTIMATE = *Amanda::Configc::DUMPTYPE_ESTIMATE;
+*DUMPTYPE_COMPRESS = *Amanda::Configc::DUMPTYPE_COMPRESS;
+*DUMPTYPE_ENCRYPT = *Amanda::Configc::DUMPTYPE_ENCRYPT;
+*DUMPTYPE_SRV_DECRYPT_OPT = *Amanda::Configc::DUMPTYPE_SRV_DECRYPT_OPT;
+*DUMPTYPE_CLNT_DECRYPT_OPT = *Amanda::Configc::DUMPTYPE_CLNT_DECRYPT_OPT;
+*DUMPTYPE_COMPRATE = *Amanda::Configc::DUMPTYPE_COMPRATE;
+*DUMPTYPE_TAPE_SPLITSIZE = *Amanda::Configc::DUMPTYPE_TAPE_SPLITSIZE;
+*DUMPTYPE_FALLBACK_SPLITSIZE = *Amanda::Configc::DUMPTYPE_FALLBACK_SPLITSIZE;
+*DUMPTYPE_SPLIT_DISKBUFFER = *Amanda::Configc::DUMPTYPE_SPLIT_DISKBUFFER;
+*DUMPTYPE_RECORD = *Amanda::Configc::DUMPTYPE_RECORD;
+*DUMPTYPE_SKIP_INCR = *Amanda::Configc::DUMPTYPE_SKIP_INCR;
+*DUMPTYPE_SKIP_FULL = *Amanda::Configc::DUMPTYPE_SKIP_FULL;
+*DUMPTYPE_HOLDINGDISK = *Amanda::Configc::DUMPTYPE_HOLDINGDISK;
+*DUMPTYPE_KENCRYPT = *Amanda::Configc::DUMPTYPE_KENCRYPT;
+*DUMPTYPE_IGNORE = *Amanda::Configc::DUMPTYPE_IGNORE;
+*DUMPTYPE_INDEX = *Amanda::Configc::DUMPTYPE_INDEX;
+*INTER_COMMENT = *Amanda::Configc::INTER_COMMENT;
+*INTER_MAXUSAGE = *Amanda::Configc::INTER_MAXUSAGE;
+*HOLDING_COMMENT = *Amanda::Configc::HOLDING_COMMENT;
+*HOLDING_DISKDIR = *Amanda::Configc::HOLDING_DISKDIR;
+*HOLDING_DISKSIZE = *Amanda::Configc::HOLDING_DISKSIZE;
+*HOLDING_CHUNKSIZE = *Amanda::Configc::HOLDING_CHUNKSIZE;
+*HOLD_NEVER = *Amanda::Configc::HOLD_NEVER;
+*HOLD_AUTO = *Amanda::Configc::HOLD_AUTO;
+*HOLD_REQUIRED = *Amanda::Configc::HOLD_REQUIRED;
+*COMP_NONE = *Amanda::Configc::COMP_NONE;
+*COMP_FAST = *Amanda::Configc::COMP_FAST;
+*COMP_BEST = *Amanda::Configc::COMP_BEST;
+*COMP_CUST = *Amanda::Configc::COMP_CUST;
+*COMP_SERVER_FAST = *Amanda::Configc::COMP_SERVER_FAST;
+*COMP_SERVER_BEST = *Amanda::Configc::COMP_SERVER_BEST;
+*COMP_SERVER_CUST = *Amanda::Configc::COMP_SERVER_CUST;
+*ENCRYPT_NONE = *Amanda::Configc::ENCRYPT_NONE;
+*ENCRYPT_CUST = *Amanda::Configc::ENCRYPT_CUST;
+*ENCRYPT_SERV_CUST = *Amanda::Configc::ENCRYPT_SERV_CUST;
+*DS_SKIP = *Amanda::Configc::DS_SKIP;
+*DS_STANDARD = *Amanda::Configc::DS_STANDARD;
+*DS_NOFULL = *Amanda::Configc::DS_NOFULL;
+*DS_NOINC = *Amanda::Configc::DS_NOINC;
+*DS_4 = *Amanda::Configc::DS_4;
+*DS_5 = *Amanda::Configc::DS_5;
+*DS_HANOI = *Amanda::Configc::DS_HANOI;
+*DS_INCRONLY = *Amanda::Configc::DS_INCRONLY;
+*ES_CLIENT = *Amanda::Configc::ES_CLIENT;
+*ES_SERVER = *Amanda::Configc::ES_SERVER;
+*ES_CALCSIZE = *Amanda::Configc::ES_CALCSIZE;
+*ALGO_FIRST = *Amanda::Configc::ALGO_FIRST;
+*ALGO_FIRSTFIT = *Amanda::Configc::ALGO_FIRSTFIT;
+*ALGO_LARGEST = *Amanda::Configc::ALGO_LARGEST;
+*ALGO_LARGESTFIT = *Amanda::Configc::ALGO_LARGESTFIT;
+*ALGO_SMALLEST = *Amanda::Configc::ALGO_SMALLEST;
+*ALGO_LAST = *Amanda::Configc::ALGO_LAST;
+*debug_amandad = *Amanda::Configc::debug_amandad;
+*debug_amidxtaped = *Amanda::Configc::debug_amidxtaped;
+*debug_amindexd = *Amanda::Configc::debug_amindexd;
+*debug_amrecover = *Amanda::Configc::debug_amrecover;
+*debug_auth = *Amanda::Configc::debug_auth;
+*debug_event = *Amanda::Configc::debug_event;
+*debug_holding = *Amanda::Configc::debug_holding;
+*debug_protocol = *Amanda::Configc::debug_protocol;
+*debug_planner = *Amanda::Configc::debug_planner;
+*debug_driver = *Amanda::Configc::debug_driver;
+*debug_dumper = *Amanda::Configc::debug_dumper;
+*debug_chunker = *Amanda::Configc::debug_chunker;
+*debug_taper = *Amanda::Configc::debug_taper;
+*debug_selfcheck = *Amanda::Configc::debug_selfcheck;
+*debug_sendsize = *Amanda::Configc::debug_sendsize;
+*debug_sendbackup = *Amanda::Configc::debug_sendbackup;
+*CONFIG_INIT_EXPLICIT_NAME = *Amanda::Configc::CONFIG_INIT_EXPLICIT_NAME;
+*CONFIG_INIT_USE_CWD = *Amanda::Configc::CONFIG_INIT_USE_CWD;
+*CONFIG_INIT_CLIENT = *Amanda::Configc::CONFIG_INIT_CLIENT;
+*CONFIG_INIT_OVERLAY = *Amanda::Configc::CONFIG_INIT_OVERLAY;
+*CONFIG_INIT_FATAL = *Amanda::Configc::CONFIG_INIT_FATAL;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Config - access to Amanda configuration parameters
+
+=head1 SYNOPSIS
+
+  use Amanda::Config qw( :init :getconf );
+
+  config_init($CONFIG_INIT_EXPLICIT_NAME, $ARGV[1])
+    or die("errors processing config file " . $Amanda::Config::get_config_filename());
+
+  print "tape device is ", getconf($CNF_TAPEDEV), "\n";
+
+This API closely parallels the C API.  See L<conffile.h> for details
+on the functions and constants available here.
+
+=head1 API STATUS
+
+Stable
+
+=head1 INITIALIZATION
+
+The Amanda configuration is treated as a global state for the
+application.  It is not possible to load two configurations
+simultaneously.
+
+All initialization-related symbols can be imported with the tag
+C<:init>.
+
+=head2 LOADING CONFIGURATION
+
+The Amanda configuration is loaded with the aptly named
+C<config_init($flags, $name)>.  Because of the great variety in
+invocation method among Amanda applications, this function has a number
+of flags that affect its behavior.  These flags can be OR'd together.
+
+=over
+
+=item If C<CONFIG_INIT_EXPLICIT_NAME> is given, then the C<$name>
+parameter can contain the name of a configuration to load.
+
+=item If C<CONFIG_INIT_USE_CWD> is given, and if the current directory
+contains C<amanda.conf>, then that file is loaded.
+
+=item If C<CONFIG_INIT_CLIENT> is given, then a client configuration
+is loaded.
+
+=item If C<CONFIG_INIT_OVERLAY> is given, then any existing
+configuration is not reset.
+
+=item If C<CONFIG_INIT_FATAL> is given, then any errors are considered
+fatal, and C<config_init> does not return.
+
+=back
+
+See C<conffile.h> for more detailed information on these flags and
+their interactions.
+
+C<config_uninit()> reverses the effects of C<config_init>.  It is
+not often used.
+
+Once the configuration is loaded, the configuration name
+(e.g., "DailySet1"), directory (C</etc/amanda/DailySet1>),
+and filename (C</etc/amanda/DailySet1/amanda.conf>) are
+available from C<get_config_name()>, C<get_config_dir()>, and
+C<get_config_filename()>, respectively.
+
+=head2 CONFIG OVERWRITES
+
+Most Amanda applications accept the command-line option C<-o>
+to "overwrite" configuration values in C<amanda.conf>.  In Perl
+applications, these options should be parsed with L<Getopt::Long>, with
+the action being a call to C<add_config_overwrite_opt>.  For example:
+
+  my $config_overwrites = new_config_overwrites($#ARGV+1);
+    GetOptions(
+       # ...
+       'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); },
+    ) or usage();
+  my $cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME | $CONFIG_INIT_USE_CWD, $config_name);
+  apply_config_overwrites($config_overwrites);
+
+C<new_config_overwrites($size_estimate)> creates a new
+overwrites object, using the given size as an estimate of
+the number of items it will contain (C<$#ARGC/2> is a good
+estimate).  Individual configuration options are then added via
+C<add_config_overwrite($co, $key, $value)> (which takes a key/value
+pair) or C<add_config_overwrite_opt($co, $optarg)>, which parses a
+string following C<-o> on the command line.
+
+Once the overwrites are gathered, they are applied with
+C<apply_config_overwrites($co)>, which applies the overwrites to the
+active configuration.  No further operations can be performed on the
+overwrites object after C<apply_config_overwrites> has been called.
+
+The utility function C<get_config_options()> returns a list of
+command-line arguments to represent any overwrites that were used
+to generate the current configuration.  (TODO: this function isn't
+available yet)
+
+=head1 PARAMETER ACCESS
+
+Amanda configurations consist of "global" parameters and several
+sets of "subsections" -- one set for dumptypes, one for tapetypes,
+and so on.
+
+All of the global parameters are represented by a constant beginning
+with C<$CNF_>, e.g., C<$CNF_LABELSTR>.  The function C<getconf($cnf)>
+returns the value of parameter C<$cnf>, in whatever format is
+appropriate for the parameter.  C<getconf_seen($cnf)> returns a true
+value if C<$cnf> was seen in the configuration file.  If it was not
+seen, then it will have its default value.
+
+Some parameters have enumerated types.  The values for those
+enumerations are available from this module with the same name as
+in C<conffile.h>.  For example, C<$CNF_TAPERALGO> will yield a value
+from the enumeration C<taperalgo_t>, the constants for which all
+begin with C<$ALGO_>.  See C<conffile.h> for the details.
+
+Each subsection type has the following functions:
+
+=over
+
+=item C<lookup_TYP($subsec_name)>, which returns an opaque object
+(C<$ss>) representing the subsection, or C<undef> if no subsection
+with that name exists;
+
+=item C<TYP_name($ss)>, returning the name of the subsection;
+
+=item C<TYP_getconf($ss, $cnf)>, which fetches a parameter value from
+C<$ss>; and
+
+=item C<TYP_seen($ss, $cnf)>, which returns a true value if <$cnf>
+was seen in the subsection.
+
+=back
+
+The subsections are:
+
+=over
+
+=item C<tapetype>, with constants beginning with C<$TAPETYPE_>,
+
+=item C<dumptype>, with constants beginning with C<$DUMPTYPE_>,
+
+=item C<interface>, with constants beginning with C<$INTER_>, and
+
+=item C<holdingdisk>, with constants beginning with C<$HOLDING_>.
+
+=back
+
+See C<conffile.h> for the names of the constants themselves.
+
+Parameter values are available by name from C<getconf_byname($name)>.
+This function implements the C<TYP:NAME:PARAM> syntax advertised by
+C<amgetconf> to access values in subsections.  C<getconf_list($typ)>
+returns a list of the names of all subsections of the given type.
+
+The C<$CNF_DISPLAYUNIT> implies a certain divisor to convert from
+kilobytes to the desired unit.  This divisor is available from
+C<getconf_unit_divisor()>.  Note carefully that it is a I<divisor>
+for a value in I<kilobytes>!
+
+Finally, various subsections of Amanda enable verbose debugging via
+configuration parameters.  The status of each parameter is available
+a similarly-named variable, e.g., C<$debug_auth>.
+
+All parameter access functions and constants can be imported with
+the tag C<:getconf>.
+
+=head1 MISCELLANEOUS
+
+These functions defy categorization.
+
+The function C<config_dir_relative> will interpret a path relative to
+the current configuration directory.  Absolute paths are passed through
+unchanged, while relative paths are converted to absolute paths.
+
+C<dump_configuration()> dumps the current configuration, in a format
+suitable for re-evaluation for this module, to standard output.
+This function may be revised to return a string.
+
+Several parts of Amanda need to convert unit modifier value like
+"gbytes" to a multiplier.  The function C<find_multiplier($str)>
+returns the unit multiplier for such a string.  For example, "mbytes"
+is converted to 1048576 (1024*1024).
+
+=cut
+
+push @EXPORT_OK, qw(confparm_key_to_string);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw(confparm_key_to_string);
+
+my %_confparm_key_VALUES;
+#Convert an enum value to a single string
+sub confparm_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_confparm_key_VALUES) {
+       my $v = $_confparm_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($CNF_ORG);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_ORG);
+
+$_confparm_key_VALUES{"CNF_ORG"} = $CNF_ORG;
+
+push @EXPORT_OK, qw($CNF_CONF);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CONF);
+
+$_confparm_key_VALUES{"CNF_CONF"} = $CNF_CONF;
+
+push @EXPORT_OK, qw($CNF_INDEX_SERVER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INDEX_SERVER);
+
+$_confparm_key_VALUES{"CNF_INDEX_SERVER"} = $CNF_INDEX_SERVER;
+
+push @EXPORT_OK, qw($CNF_TAPE_SERVER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPE_SERVER);
+
+$_confparm_key_VALUES{"CNF_TAPE_SERVER"} = $CNF_TAPE_SERVER;
+
+push @EXPORT_OK, qw($CNF_AUTH);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AUTH);
+
+$_confparm_key_VALUES{"CNF_AUTH"} = $CNF_AUTH;
+
+push @EXPORT_OK, qw($CNF_SSH_KEYS);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_SSH_KEYS);
+
+$_confparm_key_VALUES{"CNF_SSH_KEYS"} = $CNF_SSH_KEYS;
+
+push @EXPORT_OK, qw($CNF_AMANDAD_PATH);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMANDAD_PATH);
+
+$_confparm_key_VALUES{"CNF_AMANDAD_PATH"} = $CNF_AMANDAD_PATH;
+
+push @EXPORT_OK, qw($CNF_CLIENT_USERNAME);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CLIENT_USERNAME);
+
+$_confparm_key_VALUES{"CNF_CLIENT_USERNAME"} = $CNF_CLIENT_USERNAME;
+
+push @EXPORT_OK, qw($CNF_GNUTAR_LIST_DIR);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_GNUTAR_LIST_DIR);
+
+$_confparm_key_VALUES{"CNF_GNUTAR_LIST_DIR"} = $CNF_GNUTAR_LIST_DIR;
+
+push @EXPORT_OK, qw($CNF_AMANDATES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMANDATES);
+
+$_confparm_key_VALUES{"CNF_AMANDATES"} = $CNF_AMANDATES;
+
+push @EXPORT_OK, qw($CNF_MAILTO);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAILTO);
+
+$_confparm_key_VALUES{"CNF_MAILTO"} = $CNF_MAILTO;
+
+push @EXPORT_OK, qw($CNF_DUMPUSER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPUSER);
+
+$_confparm_key_VALUES{"CNF_DUMPUSER"} = $CNF_DUMPUSER;
+
+push @EXPORT_OK, qw($CNF_TAPEDEV);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPEDEV);
+
+$_confparm_key_VALUES{"CNF_TAPEDEV"} = $CNF_TAPEDEV;
+
+push @EXPORT_OK, qw($CNF_DEVICE_PROPERTY);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEVICE_PROPERTY);
+
+$_confparm_key_VALUES{"CNF_DEVICE_PROPERTY"} = $CNF_DEVICE_PROPERTY;
+
+push @EXPORT_OK, qw($CNF_CHANGERDEV);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CHANGERDEV);
+
+$_confparm_key_VALUES{"CNF_CHANGERDEV"} = $CNF_CHANGERDEV;
+
+push @EXPORT_OK, qw($CNF_CHANGERFILE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CHANGERFILE);
+
+$_confparm_key_VALUES{"CNF_CHANGERFILE"} = $CNF_CHANGERFILE;
+
+push @EXPORT_OK, qw($CNF_LABELSTR);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LABELSTR);
+
+$_confparm_key_VALUES{"CNF_LABELSTR"} = $CNF_LABELSTR;
+
+push @EXPORT_OK, qw($CNF_TAPELIST);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPELIST);
+
+$_confparm_key_VALUES{"CNF_TAPELIST"} = $CNF_TAPELIST;
+
+push @EXPORT_OK, qw($CNF_DISKFILE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DISKFILE);
+
+$_confparm_key_VALUES{"CNF_DISKFILE"} = $CNF_DISKFILE;
+
+push @EXPORT_OK, qw($CNF_INFOFILE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INFOFILE);
+
+$_confparm_key_VALUES{"CNF_INFOFILE"} = $CNF_INFOFILE;
+
+push @EXPORT_OK, qw($CNF_LOGDIR);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LOGDIR);
+
+$_confparm_key_VALUES{"CNF_LOGDIR"} = $CNF_LOGDIR;
+
+push @EXPORT_OK, qw($CNF_INDEXDIR);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INDEXDIR);
+
+$_confparm_key_VALUES{"CNF_INDEXDIR"} = $CNF_INDEXDIR;
+
+push @EXPORT_OK, qw($CNF_TAPETYPE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPETYPE);
+
+$_confparm_key_VALUES{"CNF_TAPETYPE"} = $CNF_TAPETYPE;
+
+push @EXPORT_OK, qw($CNF_DUMPCYCLE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPCYCLE);
+
+$_confparm_key_VALUES{"CNF_DUMPCYCLE"} = $CNF_DUMPCYCLE;
+
+push @EXPORT_OK, qw($CNF_RUNSPERCYCLE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RUNSPERCYCLE);
+
+$_confparm_key_VALUES{"CNF_RUNSPERCYCLE"} = $CNF_RUNSPERCYCLE;
+
+push @EXPORT_OK, qw($CNF_TAPECYCLE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPECYCLE);
+
+$_confparm_key_VALUES{"CNF_TAPECYCLE"} = $CNF_TAPECYCLE;
+
+push @EXPORT_OK, qw($CNF_NETUSAGE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_NETUSAGE);
+
+$_confparm_key_VALUES{"CNF_NETUSAGE"} = $CNF_NETUSAGE;
+
+push @EXPORT_OK, qw($CNF_INPARALLEL);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_INPARALLEL);
+
+$_confparm_key_VALUES{"CNF_INPARALLEL"} = $CNF_INPARALLEL;
+
+push @EXPORT_OK, qw($CNF_DUMPORDER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DUMPORDER);
+
+$_confparm_key_VALUES{"CNF_DUMPORDER"} = $CNF_DUMPORDER;
+
+push @EXPORT_OK, qw($CNF_BUMPPERCENT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPPERCENT);
+
+$_confparm_key_VALUES{"CNF_BUMPPERCENT"} = $CNF_BUMPPERCENT;
+
+push @EXPORT_OK, qw($CNF_BUMPSIZE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPSIZE);
+
+$_confparm_key_VALUES{"CNF_BUMPSIZE"} = $CNF_BUMPSIZE;
+
+push @EXPORT_OK, qw($CNF_BUMPMULT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPMULT);
+
+$_confparm_key_VALUES{"CNF_BUMPMULT"} = $CNF_BUMPMULT;
+
+push @EXPORT_OK, qw($CNF_BUMPDAYS);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_BUMPDAYS);
+
+$_confparm_key_VALUES{"CNF_BUMPDAYS"} = $CNF_BUMPDAYS;
+
+push @EXPORT_OK, qw($CNF_TPCHANGER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TPCHANGER);
+
+$_confparm_key_VALUES{"CNF_TPCHANGER"} = $CNF_TPCHANGER;
+
+push @EXPORT_OK, qw($CNF_RUNTAPES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RUNTAPES);
+
+$_confparm_key_VALUES{"CNF_RUNTAPES"} = $CNF_RUNTAPES;
+
+push @EXPORT_OK, qw($CNF_MAXDUMPS);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAXDUMPS);
+
+$_confparm_key_VALUES{"CNF_MAXDUMPS"} = $CNF_MAXDUMPS;
+
+push @EXPORT_OK, qw($CNF_ETIMEOUT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_ETIMEOUT);
+
+$_confparm_key_VALUES{"CNF_ETIMEOUT"} = $CNF_ETIMEOUT;
+
+push @EXPORT_OK, qw($CNF_DTIMEOUT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DTIMEOUT);
+
+$_confparm_key_VALUES{"CNF_DTIMEOUT"} = $CNF_DTIMEOUT;
+
+push @EXPORT_OK, qw($CNF_CTIMEOUT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CTIMEOUT);
+
+$_confparm_key_VALUES{"CNF_CTIMEOUT"} = $CNF_CTIMEOUT;
+
+push @EXPORT_OK, qw($CNF_TAPEBUFS);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPEBUFS);
+
+$_confparm_key_VALUES{"CNF_TAPEBUFS"} = $CNF_TAPEBUFS;
+
+push @EXPORT_OK, qw($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
+
+$_confparm_key_VALUES{"CNF_DEVICE_OUTPUT_BUFFER_SIZE"} = $CNF_DEVICE_OUTPUT_BUFFER_SIZE;
+
+push @EXPORT_OK, qw($CNF_PRINTER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_PRINTER);
+
+$_confparm_key_VALUES{"CNF_PRINTER"} = $CNF_PRINTER;
+
+push @EXPORT_OK, qw($CNF_AUTOFLUSH);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AUTOFLUSH);
+
+$_confparm_key_VALUES{"CNF_AUTOFLUSH"} = $CNF_AUTOFLUSH;
+
+push @EXPORT_OK, qw($CNF_RESERVE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVE);
+
+$_confparm_key_VALUES{"CNF_RESERVE"} = $CNF_RESERVE;
+
+push @EXPORT_OK, qw($CNF_MAXDUMPSIZE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAXDUMPSIZE);
+
+$_confparm_key_VALUES{"CNF_MAXDUMPSIZE"} = $CNF_MAXDUMPSIZE;
+
+push @EXPORT_OK, qw($CNF_COLUMNSPEC);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_COLUMNSPEC);
+
+$_confparm_key_VALUES{"CNF_COLUMNSPEC"} = $CNF_COLUMNSPEC;
+
+push @EXPORT_OK, qw($CNF_AMRECOVER_DO_FSF);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_DO_FSF);
+
+$_confparm_key_VALUES{"CNF_AMRECOVER_DO_FSF"} = $CNF_AMRECOVER_DO_FSF;
+
+push @EXPORT_OK, qw($CNF_AMRECOVER_CHECK_LABEL);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_CHECK_LABEL);
+
+$_confparm_key_VALUES{"CNF_AMRECOVER_CHECK_LABEL"} = $CNF_AMRECOVER_CHECK_LABEL;
+
+push @EXPORT_OK, qw($CNF_AMRECOVER_CHANGER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMRECOVER_CHANGER);
+
+$_confparm_key_VALUES{"CNF_AMRECOVER_CHANGER"} = $CNF_AMRECOVER_CHANGER;
+
+push @EXPORT_OK, qw($CNF_TAPERALGO);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPERALGO);
+
+$_confparm_key_VALUES{"CNF_TAPERALGO"} = $CNF_TAPERALGO;
+
+push @EXPORT_OK, qw($CNF_FLUSH_THRESHOLD_DUMPED);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_FLUSH_THRESHOLD_DUMPED);
+
+$_confparm_key_VALUES{"CNF_FLUSH_THRESHOLD_DUMPED"} = $CNF_FLUSH_THRESHOLD_DUMPED;
+
+push @EXPORT_OK, qw($CNF_FLUSH_THRESHOLD_SCHEDULED);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_FLUSH_THRESHOLD_SCHEDULED);
+
+$_confparm_key_VALUES{"CNF_FLUSH_THRESHOLD_SCHEDULED"} = $CNF_FLUSH_THRESHOLD_SCHEDULED;
+
+push @EXPORT_OK, qw($CNF_TAPERFLUSH);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_TAPERFLUSH);
+
+$_confparm_key_VALUES{"CNF_TAPERFLUSH"} = $CNF_TAPERFLUSH;
+
+push @EXPORT_OK, qw($CNF_DISPLAYUNIT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DISPLAYUNIT);
+
+$_confparm_key_VALUES{"CNF_DISPLAYUNIT"} = $CNF_DISPLAYUNIT;
+
+push @EXPORT_OK, qw($CNF_KRB5KEYTAB);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_KRB5KEYTAB);
+
+$_confparm_key_VALUES{"CNF_KRB5KEYTAB"} = $CNF_KRB5KEYTAB;
+
+push @EXPORT_OK, qw($CNF_KRB5PRINCIPAL);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_KRB5PRINCIPAL);
+
+$_confparm_key_VALUES{"CNF_KRB5PRINCIPAL"} = $CNF_KRB5PRINCIPAL;
+
+push @EXPORT_OK, qw($CNF_LABEL_NEW_TAPES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_LABEL_NEW_TAPES);
+
+$_confparm_key_VALUES{"CNF_LABEL_NEW_TAPES"} = $CNF_LABEL_NEW_TAPES;
+
+push @EXPORT_OK, qw($CNF_USETIMESTAMPS);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_USETIMESTAMPS);
+
+$_confparm_key_VALUES{"CNF_USETIMESTAMPS"} = $CNF_USETIMESTAMPS;
+
+push @EXPORT_OK, qw($CNF_REP_TRIES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_REP_TRIES);
+
+$_confparm_key_VALUES{"CNF_REP_TRIES"} = $CNF_REP_TRIES;
+
+push @EXPORT_OK, qw($CNF_CONNECT_TRIES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CONNECT_TRIES);
+
+$_confparm_key_VALUES{"CNF_CONNECT_TRIES"} = $CNF_CONNECT_TRIES;
+
+push @EXPORT_OK, qw($CNF_REQ_TRIES);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_REQ_TRIES);
+
+$_confparm_key_VALUES{"CNF_REQ_TRIES"} = $CNF_REQ_TRIES;
+
+push @EXPORT_OK, qw($CNF_DEBUG_AMANDAD);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMANDAD);
+
+$_confparm_key_VALUES{"CNF_DEBUG_AMANDAD"} = $CNF_DEBUG_AMANDAD;
+
+push @EXPORT_OK, qw($CNF_DEBUG_AMIDXTAPED);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMIDXTAPED);
+
+$_confparm_key_VALUES{"CNF_DEBUG_AMIDXTAPED"} = $CNF_DEBUG_AMIDXTAPED;
+
+push @EXPORT_OK, qw($CNF_DEBUG_AMINDEXD);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMINDEXD);
+
+$_confparm_key_VALUES{"CNF_DEBUG_AMINDEXD"} = $CNF_DEBUG_AMINDEXD;
+
+push @EXPORT_OK, qw($CNF_DEBUG_AMRECOVER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AMRECOVER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_AMRECOVER"} = $CNF_DEBUG_AMRECOVER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_AUTH);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_AUTH);
+
+$_confparm_key_VALUES{"CNF_DEBUG_AUTH"} = $CNF_DEBUG_AUTH;
+
+push @EXPORT_OK, qw($CNF_DEBUG_EVENT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_EVENT);
+
+$_confparm_key_VALUES{"CNF_DEBUG_EVENT"} = $CNF_DEBUG_EVENT;
+
+push @EXPORT_OK, qw($CNF_DEBUG_HOLDING);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_HOLDING);
+
+$_confparm_key_VALUES{"CNF_DEBUG_HOLDING"} = $CNF_DEBUG_HOLDING;
+
+push @EXPORT_OK, qw($CNF_DEBUG_PROTOCOL);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_PROTOCOL);
+
+$_confparm_key_VALUES{"CNF_DEBUG_PROTOCOL"} = $CNF_DEBUG_PROTOCOL;
+
+push @EXPORT_OK, qw($CNF_DEBUG_PLANNER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_PLANNER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_PLANNER"} = $CNF_DEBUG_PLANNER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_DRIVER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_DRIVER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_DRIVER"} = $CNF_DEBUG_DRIVER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_DUMPER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_DUMPER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_DUMPER"} = $CNF_DEBUG_DUMPER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_CHUNKER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_CHUNKER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_CHUNKER"} = $CNF_DEBUG_CHUNKER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_TAPER);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_TAPER);
+
+$_confparm_key_VALUES{"CNF_DEBUG_TAPER"} = $CNF_DEBUG_TAPER;
+
+push @EXPORT_OK, qw($CNF_DEBUG_SELFCHECK);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SELFCHECK);
+
+$_confparm_key_VALUES{"CNF_DEBUG_SELFCHECK"} = $CNF_DEBUG_SELFCHECK;
+
+push @EXPORT_OK, qw($CNF_DEBUG_SENDSIZE);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SENDSIZE);
+
+$_confparm_key_VALUES{"CNF_DEBUG_SENDSIZE"} = $CNF_DEBUG_SENDSIZE;
+
+push @EXPORT_OK, qw($CNF_DEBUG_SENDBACKUP);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEBUG_SENDBACKUP);
+
+$_confparm_key_VALUES{"CNF_DEBUG_SENDBACKUP"} = $CNF_DEBUG_SENDBACKUP;
+
+push @EXPORT_OK, qw($CNF_RESERVED_UDP_PORT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVED_UDP_PORT);
+
+$_confparm_key_VALUES{"CNF_RESERVED_UDP_PORT"} = $CNF_RESERVED_UDP_PORT;
+
+push @EXPORT_OK, qw($CNF_RESERVED_TCP_PORT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_RESERVED_TCP_PORT);
+
+$_confparm_key_VALUES{"CNF_RESERVED_TCP_PORT"} = $CNF_RESERVED_TCP_PORT;
+
+push @EXPORT_OK, qw($CNF_UNRESERVED_TCP_PORT);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_UNRESERVED_TCP_PORT);
+
+$_confparm_key_VALUES{"CNF_UNRESERVED_TCP_PORT"} = $CNF_UNRESERVED_TCP_PORT;
+
+#copy symbols in confparm_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"confparm_key"}};
+
+push @EXPORT_OK, qw(tapetype_key_to_string);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw(tapetype_key_to_string);
+
+my %_tapetype_key_VALUES;
+#Convert an enum value to a single string
+sub tapetype_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_tapetype_key_VALUES) {
+       my $v = $_tapetype_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($TAPETYPE_COMMENT);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_COMMENT);
+
+$_tapetype_key_VALUES{"TAPETYPE_COMMENT"} = $TAPETYPE_COMMENT;
+
+push @EXPORT_OK, qw($TAPETYPE_LBL_TEMPL);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_LBL_TEMPL);
+
+$_tapetype_key_VALUES{"TAPETYPE_LBL_TEMPL"} = $TAPETYPE_LBL_TEMPL;
+
+push @EXPORT_OK, qw($TAPETYPE_BLOCKSIZE);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_BLOCKSIZE);
+
+$_tapetype_key_VALUES{"TAPETYPE_BLOCKSIZE"} = $TAPETYPE_BLOCKSIZE;
+
+push @EXPORT_OK, qw($TAPETYPE_READBLOCKSIZE);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_READBLOCKSIZE);
+
+$_tapetype_key_VALUES{"TAPETYPE_READBLOCKSIZE"} = $TAPETYPE_READBLOCKSIZE;
+
+push @EXPORT_OK, qw($TAPETYPE_LENGTH);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_LENGTH);
+
+$_tapetype_key_VALUES{"TAPETYPE_LENGTH"} = $TAPETYPE_LENGTH;
+
+push @EXPORT_OK, qw($TAPETYPE_FILEMARK);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_FILEMARK);
+
+$_tapetype_key_VALUES{"TAPETYPE_FILEMARK"} = $TAPETYPE_FILEMARK;
+
+push @EXPORT_OK, qw($TAPETYPE_SPEED);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_SPEED);
+
+$_tapetype_key_VALUES{"TAPETYPE_SPEED"} = $TAPETYPE_SPEED;
+
+push @EXPORT_OK, qw($TAPETYPE_FILE_PAD);
+push @{$EXPORT_TAGS{"tapetype_key"}}, qw($TAPETYPE_FILE_PAD);
+
+$_tapetype_key_VALUES{"TAPETYPE_FILE_PAD"} = $TAPETYPE_FILE_PAD;
+
+#copy symbols in tapetype_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"tapetype_key"}};
+
+push @EXPORT_OK, qw(dumptype_key_to_string);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw(dumptype_key_to_string);
+
+my %_dumptype_key_VALUES;
+#Convert an enum value to a single string
+sub dumptype_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_dumptype_key_VALUES) {
+       my $v = $_dumptype_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($DUMPTYPE_COMMENT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMMENT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_COMMENT"} = $DUMPTYPE_COMMENT;
+
+push @EXPORT_OK, qw($DUMPTYPE_PROGRAM);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PROGRAM);
+
+$_dumptype_key_VALUES{"DUMPTYPE_PROGRAM"} = $DUMPTYPE_PROGRAM;
+
+push @EXPORT_OK, qw($DUMPTYPE_SRVCOMPPROG);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRVCOMPPROG);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SRVCOMPPROG"} = $DUMPTYPE_SRVCOMPPROG;
+
+push @EXPORT_OK, qw($DUMPTYPE_CLNTCOMPPROG);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNTCOMPPROG);
+
+$_dumptype_key_VALUES{"DUMPTYPE_CLNTCOMPPROG"} = $DUMPTYPE_CLNTCOMPPROG;
+
+push @EXPORT_OK, qw($DUMPTYPE_SRV_ENCRYPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRV_ENCRYPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SRV_ENCRYPT"} = $DUMPTYPE_SRV_ENCRYPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_CLNT_ENCRYPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNT_ENCRYPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_CLNT_ENCRYPT"} = $DUMPTYPE_CLNT_ENCRYPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_AMANDAD_PATH);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_AMANDAD_PATH);
+
+$_dumptype_key_VALUES{"DUMPTYPE_AMANDAD_PATH"} = $DUMPTYPE_AMANDAD_PATH;
+
+push @EXPORT_OK, qw($DUMPTYPE_CLIENT_USERNAME);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLIENT_USERNAME);
+
+$_dumptype_key_VALUES{"DUMPTYPE_CLIENT_USERNAME"} = $DUMPTYPE_CLIENT_USERNAME;
+
+push @EXPORT_OK, qw($DUMPTYPE_SSH_KEYS);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SSH_KEYS);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SSH_KEYS"} = $DUMPTYPE_SSH_KEYS;
+
+push @EXPORT_OK, qw($DUMPTYPE_SECURITY_DRIVER);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SECURITY_DRIVER);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SECURITY_DRIVER"} = $DUMPTYPE_SECURITY_DRIVER;
+
+push @EXPORT_OK, qw($DUMPTYPE_EXCLUDE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_EXCLUDE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_EXCLUDE"} = $DUMPTYPE_EXCLUDE;
+
+push @EXPORT_OK, qw($DUMPTYPE_INCLUDE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_INCLUDE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_INCLUDE"} = $DUMPTYPE_INCLUDE;
+
+push @EXPORT_OK, qw($DUMPTYPE_PRIORITY);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PRIORITY);
+
+$_dumptype_key_VALUES{"DUMPTYPE_PRIORITY"} = $DUMPTYPE_PRIORITY;
+
+push @EXPORT_OK, qw($DUMPTYPE_DUMPCYCLE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_DUMPCYCLE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_DUMPCYCLE"} = $DUMPTYPE_DUMPCYCLE;
+
+push @EXPORT_OK, qw($DUMPTYPE_MAXDUMPS);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_MAXDUMPS);
+
+$_dumptype_key_VALUES{"DUMPTYPE_MAXDUMPS"} = $DUMPTYPE_MAXDUMPS;
+
+push @EXPORT_OK, qw($DUMPTYPE_MAXPROMOTEDAY);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_MAXPROMOTEDAY);
+
+$_dumptype_key_VALUES{"DUMPTYPE_MAXPROMOTEDAY"} = $DUMPTYPE_MAXPROMOTEDAY;
+
+push @EXPORT_OK, qw($DUMPTYPE_BUMPPERCENT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPPERCENT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_BUMPPERCENT"} = $DUMPTYPE_BUMPPERCENT;
+
+push @EXPORT_OK, qw($DUMPTYPE_BUMPSIZE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPSIZE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_BUMPSIZE"} = $DUMPTYPE_BUMPSIZE;
+
+push @EXPORT_OK, qw($DUMPTYPE_BUMPDAYS);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPDAYS);
+
+$_dumptype_key_VALUES{"DUMPTYPE_BUMPDAYS"} = $DUMPTYPE_BUMPDAYS;
+
+push @EXPORT_OK, qw($DUMPTYPE_BUMPMULT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_BUMPMULT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_BUMPMULT"} = $DUMPTYPE_BUMPMULT;
+
+push @EXPORT_OK, qw($DUMPTYPE_STARTTIME);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_STARTTIME);
+
+$_dumptype_key_VALUES{"DUMPTYPE_STARTTIME"} = $DUMPTYPE_STARTTIME;
+
+push @EXPORT_OK, qw($DUMPTYPE_STRATEGY);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_STRATEGY);
+
+$_dumptype_key_VALUES{"DUMPTYPE_STRATEGY"} = $DUMPTYPE_STRATEGY;
+
+push @EXPORT_OK, qw($DUMPTYPE_ESTIMATE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_ESTIMATE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_ESTIMATE"} = $DUMPTYPE_ESTIMATE;
+
+push @EXPORT_OK, qw($DUMPTYPE_COMPRESS);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMPRESS);
+
+$_dumptype_key_VALUES{"DUMPTYPE_COMPRESS"} = $DUMPTYPE_COMPRESS;
+
+push @EXPORT_OK, qw($DUMPTYPE_ENCRYPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_ENCRYPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_ENCRYPT"} = $DUMPTYPE_ENCRYPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_SRV_DECRYPT_OPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SRV_DECRYPT_OPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SRV_DECRYPT_OPT"} = $DUMPTYPE_SRV_DECRYPT_OPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_CLNT_DECRYPT_OPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_CLNT_DECRYPT_OPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_CLNT_DECRYPT_OPT"} = $DUMPTYPE_CLNT_DECRYPT_OPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_COMPRATE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_COMPRATE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_COMPRATE"} = $DUMPTYPE_COMPRATE;
+
+push @EXPORT_OK, qw($DUMPTYPE_TAPE_SPLITSIZE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_TAPE_SPLITSIZE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_TAPE_SPLITSIZE"} = $DUMPTYPE_TAPE_SPLITSIZE;
+
+push @EXPORT_OK, qw($DUMPTYPE_FALLBACK_SPLITSIZE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_FALLBACK_SPLITSIZE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_FALLBACK_SPLITSIZE"} = $DUMPTYPE_FALLBACK_SPLITSIZE;
+
+push @EXPORT_OK, qw($DUMPTYPE_SPLIT_DISKBUFFER);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SPLIT_DISKBUFFER);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SPLIT_DISKBUFFER"} = $DUMPTYPE_SPLIT_DISKBUFFER;
+
+push @EXPORT_OK, qw($DUMPTYPE_RECORD);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_RECORD);
+
+$_dumptype_key_VALUES{"DUMPTYPE_RECORD"} = $DUMPTYPE_RECORD;
+
+push @EXPORT_OK, qw($DUMPTYPE_SKIP_INCR);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SKIP_INCR);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SKIP_INCR"} = $DUMPTYPE_SKIP_INCR;
+
+push @EXPORT_OK, qw($DUMPTYPE_SKIP_FULL);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_SKIP_FULL);
+
+$_dumptype_key_VALUES{"DUMPTYPE_SKIP_FULL"} = $DUMPTYPE_SKIP_FULL;
+
+push @EXPORT_OK, qw($DUMPTYPE_HOLDINGDISK);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_HOLDINGDISK);
+
+$_dumptype_key_VALUES{"DUMPTYPE_HOLDINGDISK"} = $DUMPTYPE_HOLDINGDISK;
+
+push @EXPORT_OK, qw($DUMPTYPE_KENCRYPT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_KENCRYPT);
+
+$_dumptype_key_VALUES{"DUMPTYPE_KENCRYPT"} = $DUMPTYPE_KENCRYPT;
+
+push @EXPORT_OK, qw($DUMPTYPE_IGNORE);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_IGNORE);
+
+$_dumptype_key_VALUES{"DUMPTYPE_IGNORE"} = $DUMPTYPE_IGNORE;
+
+push @EXPORT_OK, qw($DUMPTYPE_INDEX);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_INDEX);
+
+$_dumptype_key_VALUES{"DUMPTYPE_INDEX"} = $DUMPTYPE_INDEX;
+
+#copy symbols in dumptype_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"dumptype_key"}};
+
+push @EXPORT_OK, qw(interface_key_to_string);
+push @{$EXPORT_TAGS{"interface_key"}}, qw(interface_key_to_string);
+
+my %_interface_key_VALUES;
+#Convert an enum value to a single string
+sub interface_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_interface_key_VALUES) {
+       my $v = $_interface_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($INTER_COMMENT);
+push @{$EXPORT_TAGS{"interface_key"}}, qw($INTER_COMMENT);
+
+$_interface_key_VALUES{"INTER_COMMENT"} = $INTER_COMMENT;
+
+push @EXPORT_OK, qw($INTER_MAXUSAGE);
+push @{$EXPORT_TAGS{"interface_key"}}, qw($INTER_MAXUSAGE);
+
+$_interface_key_VALUES{"INTER_MAXUSAGE"} = $INTER_MAXUSAGE;
+
+#copy symbols in interface_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"interface_key"}};
+
+push @EXPORT_OK, qw(holdingdisk_key_to_string);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw(holdingdisk_key_to_string);
+
+my %_holdingdisk_key_VALUES;
+#Convert an enum value to a single string
+sub holdingdisk_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_holdingdisk_key_VALUES) {
+       my $v = $_holdingdisk_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($HOLDING_COMMENT);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_COMMENT);
+
+$_holdingdisk_key_VALUES{"HOLDING_COMMENT"} = $HOLDING_COMMENT;
+
+push @EXPORT_OK, qw($HOLDING_DISKDIR);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_DISKDIR);
+
+$_holdingdisk_key_VALUES{"HOLDING_DISKDIR"} = $HOLDING_DISKDIR;
+
+push @EXPORT_OK, qw($HOLDING_DISKSIZE);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_DISKSIZE);
+
+$_holdingdisk_key_VALUES{"HOLDING_DISKSIZE"} = $HOLDING_DISKSIZE;
+
+push @EXPORT_OK, qw($HOLDING_CHUNKSIZE);
+push @{$EXPORT_TAGS{"holdingdisk_key"}}, qw($HOLDING_CHUNKSIZE);
+
+$_holdingdisk_key_VALUES{"HOLDING_CHUNKSIZE"} = $HOLDING_CHUNKSIZE;
+
+#copy symbols in holdingdisk_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"holdingdisk_key"}};
+
+push @EXPORT_OK, qw(dump_holdingdisk_t_to_string);
+push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw(dump_holdingdisk_t_to_string);
+
+my %_dump_holdingdisk_t_VALUES;
+#Convert an enum value to a single string
+sub dump_holdingdisk_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_dump_holdingdisk_t_VALUES) {
+       my $v = $_dump_holdingdisk_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($HOLD_NEVER);
+push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw($HOLD_NEVER);
+
+$_dump_holdingdisk_t_VALUES{"HOLD_NEVER"} = $HOLD_NEVER;
+
+push @EXPORT_OK, qw($HOLD_AUTO);
+push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw($HOLD_AUTO);
+
+$_dump_holdingdisk_t_VALUES{"HOLD_AUTO"} = $HOLD_AUTO;
+
+push @EXPORT_OK, qw($HOLD_REQUIRED);
+push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw($HOLD_REQUIRED);
+
+$_dump_holdingdisk_t_VALUES{"HOLD_REQUIRED"} = $HOLD_REQUIRED;
+
+#copy symbols in dump_holdingdisk_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"dump_holdingdisk_t"}};
+
+push @EXPORT_OK, qw(comp_t_to_string);
+push @{$EXPORT_TAGS{"comp_t"}}, qw(comp_t_to_string);
+
+my %_comp_t_VALUES;
+#Convert an enum value to a single string
+sub comp_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_comp_t_VALUES) {
+       my $v = $_comp_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($COMP_NONE);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_NONE);
+
+$_comp_t_VALUES{"COMP_NONE"} = $COMP_NONE;
+
+push @EXPORT_OK, qw($COMP_FAST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_FAST);
+
+$_comp_t_VALUES{"COMP_FAST"} = $COMP_FAST;
+
+push @EXPORT_OK, qw($COMP_BEST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_BEST);
+
+$_comp_t_VALUES{"COMP_BEST"} = $COMP_BEST;
+
+push @EXPORT_OK, qw($COMP_CUST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_CUST);
+
+$_comp_t_VALUES{"COMP_CUST"} = $COMP_CUST;
+
+push @EXPORT_OK, qw($COMP_SERVER_FAST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_SERVER_FAST);
+
+$_comp_t_VALUES{"COMP_SERVER_FAST"} = $COMP_SERVER_FAST;
+
+push @EXPORT_OK, qw($COMP_SERVER_BEST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_SERVER_BEST);
+
+$_comp_t_VALUES{"COMP_SERVER_BEST"} = $COMP_SERVER_BEST;
+
+push @EXPORT_OK, qw($COMP_SERVER_CUST);
+push @{$EXPORT_TAGS{"comp_t"}}, qw($COMP_SERVER_CUST);
+
+$_comp_t_VALUES{"COMP_SERVER_CUST"} = $COMP_SERVER_CUST;
+
+#copy symbols in comp_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"comp_t"}};
+
+push @EXPORT_OK, qw(encrypt_t_to_string);
+push @{$EXPORT_TAGS{"encrypt_t"}}, qw(encrypt_t_to_string);
+
+my %_encrypt_t_VALUES;
+#Convert an enum value to a single string
+sub encrypt_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_encrypt_t_VALUES) {
+       my $v = $_encrypt_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($ENCRYPT_NONE);
+push @{$EXPORT_TAGS{"encrypt_t"}}, qw($ENCRYPT_NONE);
+
+$_encrypt_t_VALUES{"ENCRYPT_NONE"} = $ENCRYPT_NONE;
+
+push @EXPORT_OK, qw($ENCRYPT_CUST);
+push @{$EXPORT_TAGS{"encrypt_t"}}, qw($ENCRYPT_CUST);
+
+$_encrypt_t_VALUES{"ENCRYPT_CUST"} = $ENCRYPT_CUST;
+
+push @EXPORT_OK, qw($ENCRYPT_SERV_CUST);
+push @{$EXPORT_TAGS{"encrypt_t"}}, qw($ENCRYPT_SERV_CUST);
+
+$_encrypt_t_VALUES{"ENCRYPT_SERV_CUST"} = $ENCRYPT_SERV_CUST;
+
+#copy symbols in encrypt_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"encrypt_t"}};
+
+push @EXPORT_OK, qw(strategy_t_to_string);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw(strategy_t_to_string);
+
+my %_strategy_t_VALUES;
+#Convert an enum value to a single string
+sub strategy_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_strategy_t_VALUES) {
+       my $v = $_strategy_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($DS_SKIP);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_SKIP);
+
+$_strategy_t_VALUES{"DS_SKIP"} = $DS_SKIP;
+
+push @EXPORT_OK, qw($DS_STANDARD);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_STANDARD);
+
+$_strategy_t_VALUES{"DS_STANDARD"} = $DS_STANDARD;
+
+push @EXPORT_OK, qw($DS_NOFULL);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_NOFULL);
+
+$_strategy_t_VALUES{"DS_NOFULL"} = $DS_NOFULL;
+
+push @EXPORT_OK, qw($DS_NOINC);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_NOINC);
+
+$_strategy_t_VALUES{"DS_NOINC"} = $DS_NOINC;
+
+push @EXPORT_OK, qw($DS_4);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_4);
+
+$_strategy_t_VALUES{"DS_4"} = $DS_4;
+
+push @EXPORT_OK, qw($DS_5);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_5);
+
+$_strategy_t_VALUES{"DS_5"} = $DS_5;
+
+push @EXPORT_OK, qw($DS_HANOI);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_HANOI);
+
+$_strategy_t_VALUES{"DS_HANOI"} = $DS_HANOI;
+
+push @EXPORT_OK, qw($DS_INCRONLY);
+push @{$EXPORT_TAGS{"strategy_t"}}, qw($DS_INCRONLY);
+
+$_strategy_t_VALUES{"DS_INCRONLY"} = $DS_INCRONLY;
+
+#copy symbols in strategy_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"strategy_t"}};
+
+push @EXPORT_OK, qw(estimate_t_to_string);
+push @{$EXPORT_TAGS{"estimate_t"}}, qw(estimate_t_to_string);
+
+my %_estimate_t_VALUES;
+#Convert an enum value to a single string
+sub estimate_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_estimate_t_VALUES) {
+       my $v = $_estimate_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($ES_CLIENT);
+push @{$EXPORT_TAGS{"estimate_t"}}, qw($ES_CLIENT);
+
+$_estimate_t_VALUES{"ES_CLIENT"} = $ES_CLIENT;
+
+push @EXPORT_OK, qw($ES_SERVER);
+push @{$EXPORT_TAGS{"estimate_t"}}, qw($ES_SERVER);
+
+$_estimate_t_VALUES{"ES_SERVER"} = $ES_SERVER;
+
+push @EXPORT_OK, qw($ES_CALCSIZE);
+push @{$EXPORT_TAGS{"estimate_t"}}, qw($ES_CALCSIZE);
+
+$_estimate_t_VALUES{"ES_CALCSIZE"} = $ES_CALCSIZE;
+
+#copy symbols in estimate_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"estimate_t"}};
+
+push @EXPORT_OK, qw(taperalgo_t_to_string);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw(taperalgo_t_to_string);
+
+my %_taperalgo_t_VALUES;
+#Convert an enum value to a single string
+sub taperalgo_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_taperalgo_t_VALUES) {
+       my $v = $_taperalgo_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($ALGO_FIRST);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_FIRST);
+
+$_taperalgo_t_VALUES{"ALGO_FIRST"} = $ALGO_FIRST;
+
+push @EXPORT_OK, qw($ALGO_FIRSTFIT);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_FIRSTFIT);
+
+$_taperalgo_t_VALUES{"ALGO_FIRSTFIT"} = $ALGO_FIRSTFIT;
+
+push @EXPORT_OK, qw($ALGO_LARGEST);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_LARGEST);
+
+$_taperalgo_t_VALUES{"ALGO_LARGEST"} = $ALGO_LARGEST;
+
+push @EXPORT_OK, qw($ALGO_LARGESTFIT);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_LARGESTFIT);
+
+$_taperalgo_t_VALUES{"ALGO_LARGESTFIT"} = $ALGO_LARGESTFIT;
+
+push @EXPORT_OK, qw($ALGO_SMALLEST);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_SMALLEST);
+
+$_taperalgo_t_VALUES{"ALGO_SMALLEST"} = $ALGO_SMALLEST;
+
+push @EXPORT_OK, qw($ALGO_LAST);
+push @{$EXPORT_TAGS{"taperalgo_t"}}, qw($ALGO_LAST);
+
+$_taperalgo_t_VALUES{"ALGO_LAST"} = $ALGO_LAST;
+
+#copy symbols in taperalgo_t to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"taperalgo_t"}};
+
+push @EXPORT_OK, qw(getconf getconf_seen 
+    getconf_byname getconf_list);
+push @{$EXPORT_TAGS{"getconf"}}, qw(getconf getconf_seen 
+    getconf_byname getconf_list);
+
+push @EXPORT_OK, qw(lookup_tapetype tapetype_getconf tapetype_name
+    tapetype_seen tapetype_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_tapetype tapetype_getconf tapetype_name
+    tapetype_seen tapetype_seen);
+
+push @EXPORT_OK, qw(lookup_dumptype dumptype_getconf dumptype_name
+    dumptype_seen dumptype_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_dumptype dumptype_getconf dumptype_name
+    dumptype_seen dumptype_seen);
+
+push @EXPORT_OK, qw(lookup_interface interface_getconf interface_name
+    interface_seen interface_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_interface interface_getconf interface_name
+    interface_seen interface_seen);
+
+push @EXPORT_OK, qw(lookup_holdingdisk holdingdisk_getconf holdingdisk_name
+    getconf_holdingdisks holdingdisk_next
+    holdingdisk_seen holdingdisk_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_holdingdisk holdingdisk_getconf holdingdisk_name
+    getconf_holdingdisks holdingdisk_next
+    holdingdisk_seen holdingdisk_seen);
+
+push @EXPORT_OK, qw(getconf_unit_divisor
+
+    $debug_amandad $debug_amidxtaped $debug_amindexd $debug_amrecover
+    $debug_auth $debug_event $debug_holding $debug_protocol
+    $debug_planner $debug_driver $debug_dumper $debug_chunker
+    $debug_taper $debug_selfcheck $debug_sendsize $debug_sendbackup);
+push @{$EXPORT_TAGS{"getconf"}}, qw(getconf_unit_divisor
+
+    $debug_amandad $debug_amidxtaped $debug_amindexd $debug_amrecover
+    $debug_auth $debug_event $debug_holding $debug_protocol
+    $debug_planner $debug_driver $debug_dumper $debug_chunker
+    $debug_taper $debug_selfcheck $debug_sendsize $debug_sendbackup);
+
+push @EXPORT_OK, qw(new_config_overwrites free_config_overwrites add_config_overwrite
+    add_config_overwrite_opt apply_config_overwrites);
+push @{$EXPORT_TAGS{"init"}}, qw(new_config_overwrites free_config_overwrites add_config_overwrite
+    add_config_overwrite_opt apply_config_overwrites);
+
+push @EXPORT_OK, qw(config_init_flags_to_strings);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw(config_init_flags_to_strings);
+
+my %_config_init_flags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub config_init_flags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_config_init_flags_VALUES) {
+       my $v = $_config_init_flags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($CONFIG_INIT_EXPLICIT_NAME);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_EXPLICIT_NAME);
+
+$_config_init_flags_VALUES{"CONFIG_INIT_EXPLICIT_NAME"} = $CONFIG_INIT_EXPLICIT_NAME;
+
+push @EXPORT_OK, qw($CONFIG_INIT_USE_CWD);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_USE_CWD);
+
+$_config_init_flags_VALUES{"CONFIG_INIT_USE_CWD"} = $CONFIG_INIT_USE_CWD;
+
+push @EXPORT_OK, qw($CONFIG_INIT_CLIENT);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_CLIENT);
+
+$_config_init_flags_VALUES{"CONFIG_INIT_CLIENT"} = $CONFIG_INIT_CLIENT;
+
+push @EXPORT_OK, qw($CONFIG_INIT_OVERLAY);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_OVERLAY);
+
+$_config_init_flags_VALUES{"CONFIG_INIT_OVERLAY"} = $CONFIG_INIT_OVERLAY;
+
+push @EXPORT_OK, qw($CONFIG_INIT_FATAL);
+push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_FATAL);
+
+$_config_init_flags_VALUES{"CONFIG_INIT_FATAL"} = $CONFIG_INIT_FATAL;
+
+#copy symbols in config_init_flags to init
+push @{$EXPORT_TAGS{"init"}},  @{$EXPORT_TAGS{"config_init_flags"}};
+
+push @EXPORT_OK, qw(config_init config_uninit get_config_options);
+push @{$EXPORT_TAGS{"init"}}, qw(config_init config_uninit get_config_options);
+
+push @EXPORT_OK, qw(get_config_name 
+    get_config_dir 
+    get_config_filename);
+push @{$EXPORT_TAGS{"init"}}, qw(get_config_name 
+    get_config_dir 
+    get_config_filename);
+
+push @EXPORT_OK, qw(dump_configuration config_dir_relative taperalgo2str find_multiplier);
+1;
diff --git a/perl/Amanda/Config.swg b/perl/Amanda/Config.swg
new file mode 100644 (file)
index 0000000..6573f1b
--- /dev/null
@@ -0,0 +1,717 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Config"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include "conffile.h"
+%}
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Config - access to Amanda configuration parameters
+
+=head1 SYNOPSIS
+
+  use Amanda::Config qw( :init :getconf );
+
+  config_init($CONFIG_INIT_EXPLICIT_NAME, $ARGV[1])
+    or die("errors processing config file " . $Amanda::Config::get_config_filename());
+
+  print "tape device is ", getconf($CNF_TAPEDEV), "\n";
+
+This API closely parallels the C API.  See L<conffile.h> for details
+on the functions and constants available here.
+
+=head1 API STATUS
+
+Stable
+
+=head1 INITIALIZATION
+
+The Amanda configuration is treated as a global state for the
+application.  It is not possible to load two configurations
+simultaneously.
+
+All initialization-related symbols can be imported with the tag
+C<:init>.
+
+=head2 LOADING CONFIGURATION
+
+The Amanda configuration is loaded with the aptly named
+C<config_init($flags, $name)>.  Because of the great variety in
+invocation method among Amanda applications, this function has a number
+of flags that affect its behavior.  These flags can be OR'd together.
+
+=over
+
+=item If C<CONFIG_INIT_EXPLICIT_NAME> is given, then the C<$name>
+parameter can contain the name of a configuration to load.
+
+=item If C<CONFIG_INIT_USE_CWD> is given, and if the current directory
+contains C<amanda.conf>, then that file is loaded.
+
+=item If C<CONFIG_INIT_CLIENT> is given, then a client configuration
+is loaded.
+
+=item If C<CONFIG_INIT_OVERLAY> is given, then any existing
+configuration is not reset.
+
+=item If C<CONFIG_INIT_FATAL> is given, then any errors are considered
+fatal, and C<config_init> does not return.
+
+=back
+
+See C<conffile.h> for more detailed information on these flags and
+their interactions.
+
+C<config_uninit()> reverses the effects of C<config_init>.  It is
+not often used.
+
+Once the configuration is loaded, the configuration name
+(e.g., "DailySet1"), directory (C</etc/amanda/DailySet1>),
+and filename (C</etc/amanda/DailySet1/amanda.conf>) are
+available from C<get_config_name()>, C<get_config_dir()>, and
+C<get_config_filename()>, respectively.
+
+=head2 CONFIG OVERWRITES
+
+Most Amanda applications accept the command-line option C<-o>
+to "overwrite" configuration values in C<amanda.conf>.  In Perl
+applications, these options should be parsed with L<Getopt::Long>, with
+the action being a call to C<add_config_overwrite_opt>.  For example:
+
+  my $config_overwrites = new_config_overwrites($#ARGV+1);
+    GetOptions(
+       # ...
+       'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); },
+    ) or usage();
+  my $cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME | $CONFIG_INIT_USE_CWD, $config_name);
+  apply_config_overwrites($config_overwrites);
+
+C<new_config_overwrites($size_estimate)> creates a new
+overwrites object, using the given size as an estimate of
+the number of items it will contain (C<$#ARGC/2> is a good
+estimate).  Individual configuration options are then added via
+C<add_config_overwrite($co, $key, $value)> (which takes a key/value
+pair) or C<add_config_overwrite_opt($co, $optarg)>, which parses a
+string following C<-o> on the command line.
+
+Once the overwrites are gathered, they are applied with
+C<apply_config_overwrites($co)>, which applies the overwrites to the
+active configuration.  No further operations can be performed on the
+overwrites object after C<apply_config_overwrites> has been called.
+
+The utility function C<get_config_options()> returns a list of
+command-line arguments to represent any overwrites that were used
+to generate the current configuration.  (TODO: this function isn't
+available yet)
+
+=head1 PARAMETER ACCESS
+
+Amanda configurations consist of "global" parameters and several
+sets of "subsections" -- one set for dumptypes, one for tapetypes,
+and so on.
+
+All of the global parameters are represented by a constant beginning
+with C<$CNF_>, e.g., C<$CNF_LABELSTR>.  The function C<getconf($cnf)>
+returns the value of parameter C<$cnf>, in whatever format is
+appropriate for the parameter.  C<getconf_seen($cnf)> returns a true
+value if C<$cnf> was seen in the configuration file.  If it was not
+seen, then it will have its default value.
+
+Some parameters have enumerated types.  The values for those
+enumerations are available from this module with the same name as
+in C<conffile.h>.  For example, C<$CNF_TAPERALGO> will yield a value
+from the enumeration C<taperalgo_t>, the constants for which all
+begin with C<$ALGO_>.  See C<conffile.h> for the details.
+
+Each subsection type has the following functions:
+
+=over
+
+=item C<lookup_TYP($subsec_name)>, which returns an opaque object
+(C<$ss>) representing the subsection, or C<undef> if no subsection
+with that name exists;
+
+=item C<TYP_name($ss)>, returning the name of the subsection;
+
+=item C<TYP_getconf($ss, $cnf)>, which fetches a parameter value from
+C<$ss>; and
+
+=item C<TYP_seen($ss, $cnf)>, which returns a true value if <$cnf>
+was seen in the subsection.
+
+=back
+
+The subsections are:
+
+=over
+
+=item C<tapetype>, with constants beginning with C<$TAPETYPE_>,
+
+=item C<dumptype>, with constants beginning with C<$DUMPTYPE_>,
+
+=item C<interface>, with constants beginning with C<$INTER_>, and
+
+=item C<holdingdisk>, with constants beginning with C<$HOLDING_>.
+
+=back
+
+See C<conffile.h> for the names of the constants themselves.
+
+Parameter values are available by name from C<getconf_byname($name)>.
+This function implements the C<TYP:NAME:PARAM> syntax advertised by
+C<amgetconf> to access values in subsections.  C<getconf_list($typ)>
+returns a list of the names of all subsections of the given type.
+
+The C<$CNF_DISPLAYUNIT> implies a certain divisor to convert from
+kilobytes to the desired unit.  This divisor is available from
+C<getconf_unit_divisor()>.  Note carefully that it is a I<divisor>
+for a value in I<kilobytes>!
+
+Finally, various subsections of Amanda enable verbose debugging via
+configuration parameters.  The status of each parameter is available
+a similarly-named variable, e.g., C<$debug_auth>.
+
+All parameter access functions and constants can be imported with
+the tag C<:getconf>.
+
+=head1 MISCELLANEOUS
+
+These functions defy categorization.
+
+The function C<config_dir_relative> will interpret a path relative to
+the current configuration directory.  Absolute paths are passed through
+unchanged, while relative paths are converted to absolute paths.
+
+C<dump_configuration()> dumps the current configuration, in a format
+suitable for re-evaluation for this module, to standard output.
+This function may be revised to return a string.
+
+Several parts of Amanda need to convert unit modifier value like
+"gbytes" to a multiplier.  The function C<find_multiplier($str)>
+returns the unit multiplier for such a string.  For example, "mbytes"
+is converted to 1048576 (1024*1024).
+
+=cut
+%}
+
+/*
+ * Parameter access
+*/
+
+/* All of the CNF_ flags from conffile.h */
+
+amglue_add_enum_tag_fns(confparm_key);
+amglue_add_constant(CNF_ORG, confparm_key);
+amglue_add_constant(CNF_CONF, confparm_key);
+amglue_add_constant(CNF_INDEX_SERVER, confparm_key);
+amglue_add_constant(CNF_TAPE_SERVER, confparm_key);
+amglue_add_constant(CNF_AUTH, confparm_key);
+amglue_add_constant(CNF_SSH_KEYS, confparm_key);
+amglue_add_constant(CNF_AMANDAD_PATH, confparm_key);
+amglue_add_constant(CNF_CLIENT_USERNAME, confparm_key);
+amglue_add_constant(CNF_GNUTAR_LIST_DIR, confparm_key);
+amglue_add_constant(CNF_AMANDATES, confparm_key);
+amglue_add_constant(CNF_MAILTO, confparm_key);
+amglue_add_constant(CNF_DUMPUSER, confparm_key);
+amglue_add_constant(CNF_TAPEDEV, confparm_key);
+amglue_add_constant(CNF_DEVICE_PROPERTY, confparm_key);
+amglue_add_constant(CNF_CHANGERDEV, confparm_key);
+amglue_add_constant(CNF_CHANGERFILE, confparm_key);
+amglue_add_constant(CNF_LABELSTR, confparm_key);
+amglue_add_constant(CNF_TAPELIST, confparm_key);
+amglue_add_constant(CNF_DISKFILE, confparm_key);
+amglue_add_constant(CNF_INFOFILE, confparm_key);
+amglue_add_constant(CNF_LOGDIR, confparm_key);
+amglue_add_constant(CNF_INDEXDIR, confparm_key);
+amglue_add_constant(CNF_TAPETYPE, confparm_key);
+amglue_add_constant(CNF_DUMPCYCLE, confparm_key);
+amglue_add_constant(CNF_RUNSPERCYCLE, confparm_key);
+amglue_add_constant(CNF_TAPECYCLE, confparm_key);
+amglue_add_constant(CNF_NETUSAGE, confparm_key);
+amglue_add_constant(CNF_INPARALLEL, confparm_key);
+amglue_add_constant(CNF_DUMPORDER, confparm_key);
+amglue_add_constant(CNF_BUMPPERCENT, confparm_key);
+amglue_add_constant(CNF_BUMPSIZE, confparm_key);
+amglue_add_constant(CNF_BUMPMULT, confparm_key);
+amglue_add_constant(CNF_BUMPDAYS, confparm_key);
+amglue_add_constant(CNF_TPCHANGER, confparm_key);
+amglue_add_constant(CNF_RUNTAPES, confparm_key);
+amglue_add_constant(CNF_MAXDUMPS, confparm_key);
+amglue_add_constant(CNF_ETIMEOUT, confparm_key);
+amglue_add_constant(CNF_DTIMEOUT, confparm_key);
+amglue_add_constant(CNF_CTIMEOUT, confparm_key);
+amglue_add_constant(CNF_TAPEBUFS, confparm_key);
+amglue_add_constant(CNF_DEVICE_OUTPUT_BUFFER_SIZE, confparm_key);
+amglue_add_constant(CNF_PRINTER, confparm_key);
+amglue_add_constant(CNF_AUTOFLUSH, confparm_key);
+amglue_add_constant(CNF_RESERVE, confparm_key);
+amglue_add_constant(CNF_MAXDUMPSIZE, confparm_key);
+amglue_add_constant(CNF_COLUMNSPEC, confparm_key);
+amglue_add_constant(CNF_AMRECOVER_DO_FSF, confparm_key);
+amglue_add_constant(CNF_AMRECOVER_CHECK_LABEL, confparm_key);
+amglue_add_constant(CNF_AMRECOVER_CHANGER, confparm_key);
+amglue_add_constant(CNF_TAPERALGO, confparm_key);
+amglue_add_constant(CNF_FLUSH_THRESHOLD_DUMPED, confparm_key);
+amglue_add_constant(CNF_FLUSH_THRESHOLD_SCHEDULED, confparm_key);
+amglue_add_constant(CNF_TAPERFLUSH, confparm_key);
+amglue_add_constant(CNF_DISPLAYUNIT, confparm_key);
+amglue_add_constant(CNF_KRB5KEYTAB, confparm_key);
+amglue_add_constant(CNF_KRB5PRINCIPAL, confparm_key);
+amglue_add_constant(CNF_LABEL_NEW_TAPES, confparm_key);
+amglue_add_constant(CNF_USETIMESTAMPS, confparm_key);
+amglue_add_constant(CNF_REP_TRIES, confparm_key);
+amglue_add_constant(CNF_CONNECT_TRIES, confparm_key);
+amglue_add_constant(CNF_REQ_TRIES, confparm_key);
+amglue_add_constant(CNF_DEBUG_AMANDAD, confparm_key);
+amglue_add_constant(CNF_DEBUG_AMIDXTAPED, confparm_key);
+amglue_add_constant(CNF_DEBUG_AMINDEXD, confparm_key);
+amglue_add_constant(CNF_DEBUG_AMRECOVER, confparm_key);
+amglue_add_constant(CNF_DEBUG_AUTH, confparm_key);
+amglue_add_constant(CNF_DEBUG_EVENT, confparm_key);
+amglue_add_constant(CNF_DEBUG_HOLDING, confparm_key);
+amglue_add_constant(CNF_DEBUG_PROTOCOL, confparm_key);
+amglue_add_constant(CNF_DEBUG_PLANNER, confparm_key);
+amglue_add_constant(CNF_DEBUG_DRIVER, confparm_key);
+amglue_add_constant(CNF_DEBUG_DUMPER, confparm_key);
+amglue_add_constant(CNF_DEBUG_CHUNKER, confparm_key);
+amglue_add_constant(CNF_DEBUG_TAPER, confparm_key);
+amglue_add_constant(CNF_DEBUG_SELFCHECK, confparm_key);
+amglue_add_constant(CNF_DEBUG_SENDSIZE, confparm_key);
+amglue_add_constant(CNF_DEBUG_SENDBACKUP, confparm_key);
+amglue_add_constant(CNF_RESERVED_UDP_PORT, confparm_key);
+amglue_add_constant(CNF_RESERVED_TCP_PORT, confparm_key);
+amglue_add_constant(CNF_UNRESERVED_TCP_PORT, confparm_key);
+amglue_copy_to_tag(confparm_key, getconf);
+
+amglue_add_enum_tag_fns(tapetype_key);
+amglue_add_constant(TAPETYPE_COMMENT, tapetype_key);
+amglue_add_constant(TAPETYPE_LBL_TEMPL, tapetype_key);
+amglue_add_constant(TAPETYPE_BLOCKSIZE, tapetype_key);
+amglue_add_constant(TAPETYPE_READBLOCKSIZE, tapetype_key);
+amglue_add_constant(TAPETYPE_LENGTH, tapetype_key);
+amglue_add_constant(TAPETYPE_FILEMARK, tapetype_key);
+amglue_add_constant(TAPETYPE_SPEED, tapetype_key);
+amglue_add_constant(TAPETYPE_FILE_PAD, tapetype_key);
+amglue_copy_to_tag(tapetype_key, getconf);
+
+amglue_add_enum_tag_fns(dumptype_key);
+amglue_add_constant(DUMPTYPE_COMMENT, dumptype_key);
+amglue_add_constant(DUMPTYPE_PROGRAM, dumptype_key);
+amglue_add_constant(DUMPTYPE_SRVCOMPPROG, dumptype_key);
+amglue_add_constant(DUMPTYPE_CLNTCOMPPROG, dumptype_key);
+amglue_add_constant(DUMPTYPE_SRV_ENCRYPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_CLNT_ENCRYPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_AMANDAD_PATH, dumptype_key);
+amglue_add_constant(DUMPTYPE_CLIENT_USERNAME, dumptype_key);
+amglue_add_constant(DUMPTYPE_SSH_KEYS, dumptype_key);
+amglue_add_constant(DUMPTYPE_SECURITY_DRIVER, dumptype_key);
+amglue_add_constant(DUMPTYPE_EXCLUDE, dumptype_key);
+amglue_add_constant(DUMPTYPE_INCLUDE, dumptype_key);
+amglue_add_constant(DUMPTYPE_PRIORITY, dumptype_key);
+amglue_add_constant(DUMPTYPE_DUMPCYCLE, dumptype_key);
+amglue_add_constant(DUMPTYPE_MAXDUMPS, dumptype_key);
+amglue_add_constant(DUMPTYPE_MAXPROMOTEDAY, dumptype_key);
+amglue_add_constant(DUMPTYPE_BUMPPERCENT, dumptype_key);
+amglue_add_constant(DUMPTYPE_BUMPSIZE, dumptype_key);
+amglue_add_constant(DUMPTYPE_BUMPDAYS, dumptype_key);
+amglue_add_constant(DUMPTYPE_BUMPMULT, dumptype_key);
+amglue_add_constant(DUMPTYPE_STARTTIME, dumptype_key);
+amglue_add_constant(DUMPTYPE_STRATEGY, dumptype_key);
+amglue_add_constant(DUMPTYPE_ESTIMATE, dumptype_key);
+amglue_add_constant(DUMPTYPE_COMPRESS, dumptype_key);
+amglue_add_constant(DUMPTYPE_ENCRYPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_SRV_DECRYPT_OPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_CLNT_DECRYPT_OPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_COMPRATE, dumptype_key);
+amglue_add_constant(DUMPTYPE_TAPE_SPLITSIZE, dumptype_key);
+amglue_add_constant(DUMPTYPE_FALLBACK_SPLITSIZE, dumptype_key);
+amglue_add_constant(DUMPTYPE_SPLIT_DISKBUFFER, dumptype_key);
+amglue_add_constant(DUMPTYPE_RECORD, dumptype_key);
+amglue_add_constant(DUMPTYPE_SKIP_INCR, dumptype_key);
+amglue_add_constant(DUMPTYPE_SKIP_FULL, dumptype_key);
+amglue_add_constant(DUMPTYPE_HOLDINGDISK, dumptype_key);
+amglue_add_constant(DUMPTYPE_KENCRYPT, dumptype_key);
+amglue_add_constant(DUMPTYPE_IGNORE, dumptype_key);
+amglue_add_constant(DUMPTYPE_INDEX, dumptype_key);
+amglue_copy_to_tag(dumptype_key, getconf);
+
+amglue_add_enum_tag_fns(interface_key);
+amglue_add_constant(INTER_COMMENT, interface_key);
+amglue_add_constant(INTER_MAXUSAGE, interface_key);
+amglue_copy_to_tag(interface_key, getconf);
+
+amglue_add_enum_tag_fns(holdingdisk_key);
+amglue_add_constant(HOLDING_COMMENT, holdingdisk_key);
+amglue_add_constant(HOLDING_DISKDIR, holdingdisk_key);
+amglue_add_constant(HOLDING_DISKSIZE, holdingdisk_key);
+amglue_add_constant(HOLDING_CHUNKSIZE, holdingdisk_key);
+amglue_copy_to_tag(holdingdisk_key, getconf);
+
+/*
+ * Various enumerated conftypes
+ */
+
+amglue_add_enum_tag_fns(dump_holdingdisk_t);
+amglue_add_constant(HOLD_NEVER, dump_holdingdisk_t);
+amglue_add_constant(HOLD_AUTO, dump_holdingdisk_t);
+amglue_add_constant(HOLD_REQUIRED, dump_holdingdisk_t);
+amglue_copy_to_tag(dump_holdingdisk_t, getconf);
+
+amglue_add_enum_tag_fns(comp_t);
+amglue_add_constant(COMP_NONE, comp_t);
+amglue_add_constant(COMP_FAST, comp_t);
+amglue_add_constant(COMP_BEST, comp_t);
+amglue_add_constant(COMP_CUST, comp_t);
+amglue_add_constant(COMP_SERVER_FAST, comp_t);
+amglue_add_constant(COMP_SERVER_BEST, comp_t);
+amglue_add_constant(COMP_SERVER_CUST, comp_t);
+amglue_copy_to_tag(comp_t, getconf);
+
+amglue_add_enum_tag_fns(encrypt_t);
+amglue_add_constant(ENCRYPT_NONE, encrypt_t);
+amglue_add_constant(ENCRYPT_CUST, encrypt_t);
+amglue_add_constant(ENCRYPT_SERV_CUST, encrypt_t);
+amglue_copy_to_tag(encrypt_t, getconf);
+
+amglue_add_enum_tag_fns(strategy_t);
+amglue_add_constant(DS_SKIP, strategy_t);
+amglue_add_constant(DS_STANDARD, strategy_t);
+amglue_add_constant(DS_NOFULL, strategy_t);
+amglue_add_constant(DS_NOINC, strategy_t);
+amglue_add_constant(DS_4, strategy_t);
+amglue_add_constant(DS_5, strategy_t);
+amglue_add_constant(DS_HANOI, strategy_t);
+amglue_add_constant(DS_INCRONLY, strategy_t);
+amglue_copy_to_tag(strategy_t, getconf);
+
+amglue_add_enum_tag_fns(estimate_t);
+amglue_add_constant(ES_CLIENT, estimate_t);
+amglue_add_constant(ES_SERVER, estimate_t);
+amglue_add_constant(ES_CALCSIZE, estimate_t);
+amglue_copy_to_tag(estimate_t, getconf);
+
+amglue_add_enum_tag_fns(taperalgo_t);
+amglue_add_constant(ALGO_FIRST, taperalgo_t);
+amglue_add_constant(ALGO_FIRSTFIT, taperalgo_t);
+amglue_add_constant(ALGO_LARGEST, taperalgo_t);
+amglue_add_constant(ALGO_LARGESTFIT, taperalgo_t);
+amglue_add_constant(ALGO_SMALLEST, taperalgo_t);
+amglue_add_constant(ALGO_LAST, taperalgo_t);
+amglue_copy_to_tag(taperalgo_t, getconf);
+
+/*
+ * val_t typemaps
+ */
+
+/* Typemap to convert a val_t, the union in which config values are
+ * stored, to a Perl value of the appropriate type.  This converts:
+ *  - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_AM64,
+ *    CONFTYPE_BOOLEAN -> IV
+ *  - CONFTYPE_REAL -> NV
+ *  - CONFTYPE_STR, CONFTYPE_IDENT -> PV
+ *  - CONFTYPE_TIME -> IV (epoch timestamp)
+ *  - CONFTYPE_COMPRESS, CONFTYPE_ENCRYPT, CONFTYPE_ESTIMATE, CONFTYPE_STRATEGY,
+ *    CONFTYPE_TAPERALGO, CONFTYPE_PRIORITY, CONFTYPE_HOLDING -> IV (enums)
+ *  - CONFTYPE_RATE -> list of two NVs
+ *  - CONFTYPE_INTRANGE -> list of two IVs
+ *  - CONFTYPE_EXINCLUDE -> hashref with keys 'list' (listref), 'file' (listref), 
+ *    and 'optional' (int)
+ *  - CONFTYPE_PROPLIST -> hashref
+ */
+%typemap (out) val_t * {
+    switch ($1->type) {
+       case CONFTYPE_RATE: {
+           $result= sv_newmortal();
+           sv_setnv($result, val_t__rate($1)[0]);
+           argvi++;
+
+           $result= sv_newmortal();
+           sv_setnv($result, val_t__rate($1)[1]);
+           argvi++;
+           break;
+       }
+
+       case CONFTYPE_INTRANGE: {
+           $result= sv_newmortal();
+           sv_setiv($result, val_t__intrange($1)[0]);
+           argvi++;
+
+           $result= sv_newmortal();
+           sv_setiv($result, val_t__intrange($1)[1]);
+           argvi++;
+           break;
+           break;
+       }
+
+       case CONFTYPE_EXINCLUDE: {
+           /* exincludes are represented in perl as {
+            *  'list' : [ 'list1', 'list2', ..],
+            *  'file' : [ 'file1', 'file2', ..],
+            *  'optional' : 1,
+            * }
+            */
+           exinclude_t *ei = &val_t__exinclude($1);
+           AV *list_entries = (AV *)sv_2mortal((SV *)newAV());
+           AV *file_entries = (AV *)sv_2mortal((SV *)newAV());
+           SV *optional = sv_newmortal();
+           HV *hv;
+           sle_t *iter;
+
+           /* first set up each of the hash values */
+
+           if (ei->sl_list) {
+               for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) {
+                   av_push(list_entries, newSVpv(iter->name, 0));
+               }
+           }
+
+           if(ei->sl_file) {
+               for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) {
+                   av_push(file_entries, newSVpv(iter->name, 0));
+               }
+           }
+
+           sv_setiv(optional, ei->optional);
+
+           /* now build the hash */
+           hv = (HV *)sv_2mortal((SV *)newHV());
+           
+           hv_store(hv, "file", 4, newRV((SV *)file_entries), 0);
+           hv_store(hv, "list", 4, newRV((SV *)list_entries), 0);
+           hv_store(hv, "optional", 8, optional, 0);
+           SvREFCNT_inc(optional);
+
+           $result = sv_2mortal(newRV((SV *)hv));
+           argvi++;
+           break;
+       }
+
+       case CONFTYPE_PROPLIST:
+           $result = sv_2mortal(g_hash_table_to_hashref(val_t__proplist($1)));
+           argvi++;
+           break;
+
+       case CONFTYPE_SIZE:
+           $result = sv_2mortal(amglue_newSVi64(val_t__size($1)));
+           argvi++;
+           break;
+
+       case CONFTYPE_AM64:
+           $result = sv_2mortal(amglue_newSVi64(val_t__am64($1)));
+           argvi++;
+           break;
+
+       case CONFTYPE_BOOLEAN:      /* all same as INT.. */
+       case CONFTYPE_COMPRESS:
+       case CONFTYPE_ENCRYPT:
+       case CONFTYPE_ESTIMATE:
+       case CONFTYPE_STRATEGY:
+       case CONFTYPE_TAPERALGO:
+       case CONFTYPE_PRIORITY:
+       case CONFTYPE_HOLDING:
+       case CONFTYPE_INT:
+           $result = sv_2mortal(amglue_newSVi64(val_t__int($1)));
+           argvi++;
+           break;
+
+       case CONFTYPE_TIME:
+           $result = sv_2mortal(amglue_newSVi64(val_t__time($1)));
+           argvi++;
+           break;
+
+       case CONFTYPE_REAL:
+           $result = sv_newmortal();
+           sv_setnv($result, val_t__real($1));
+           argvi++;
+           break;
+
+       case CONFTYPE_IDENT:        /* same as STRING */
+       case CONFTYPE_STR:
+           $result = sv_newmortal();
+           sv_setpv($result, val_t__str($1));
+           argvi++;
+           break;
+
+       /* No match yet -> not one of the "complex" types */
+       default:
+           SWIG_exception(SWIG_TypeError, "Unknown val_t conftype");
+           break;
+    }
+}
+
+/* Typemap for the return value of getconf_list; this assumes that
+ * the GSList contains strings, and that it should be freed; both
+ * are true for getconf_list.
+ */
+%typemap (out) GSList * {
+    GSList *it = $1;
+
+    while (it) {
+       $result = sv_2mortal(newSVpv(it->data, 0));
+       argvi++;
+       it = it->next;
+    }
+
+    g_slist_free($1);
+}
+
+val_t *getconf(confparm_key key);
+gboolean getconf_seen(confparm_key key);
+val_t *getconf_byname(char *key);
+GSList *getconf_list(char *listname);
+amglue_export_tag(getconf,
+    getconf getconf_seen 
+    getconf_byname getconf_list
+);
+
+tapetype_t *lookup_tapetype(char *identifier);
+val_t *tapetype_getconf(tapetype_t *ttyp, tapetype_key key);
+char *tapetype_name(tapetype_t *ttyp);
+gboolean tapetype_seen(tapetype_t *ttyp, tapetype_key key);
+amglue_export_tag(getconf,
+    lookup_tapetype tapetype_getconf tapetype_name
+    tapetype_seen tapetype_seen
+);
+
+dumptype_t *lookup_dumptype(char *identifier);
+val_t *dumptype_getconf(dumptype_t *dtyp, dumptype_key key);
+char *dumptype_name(dumptype_t *dtyp);
+gboolean dumptype_seen(dumptype_t *dtyp, dumptype_key key);
+amglue_export_tag(getconf,
+    lookup_dumptype dumptype_getconf dumptype_name
+    dumptype_seen dumptype_seen
+);
+
+interface_t *lookup_interface(char *identifier);
+val_t *interface_getconf(interface_t *iface, interface_key key);
+char *interface_name(interface_t *iface);
+gboolean interface_seen(interface_t *iface, interface_key key);
+amglue_export_tag(getconf,
+    lookup_interface interface_getconf interface_name
+    interface_seen interface_seen
+);
+
+holdingdisk_t *lookup_holdingdisk(char *identifier);
+holdingdisk_t *getconf_holdingdisks(void);
+holdingdisk_t *holdingdisk_next(holdingdisk_t *hdisk);
+val_t *holdingdisk_getconf(holdingdisk_t *hdisk, holdingdisk_key key);
+char *holdingdisk_name(holdingdisk_t *hdisk);
+gboolean holdingdisk_seen(holdingdisk_t *hdisk, holdingdisk_key key);
+amglue_export_tag(getconf,
+    lookup_holdingdisk holdingdisk_getconf holdingdisk_name
+    getconf_holdingdisks holdingdisk_next
+    holdingdisk_seen holdingdisk_seen
+);
+
+long int getconf_unit_divisor(void);
+
+extern int debug_amandad;
+extern int debug_amidxtaped;
+extern int debug_amindexd;
+extern int debug_amrecover;
+extern int debug_auth;
+extern int debug_event;
+extern int debug_holding;
+extern int debug_protocol;
+extern int debug_planner;
+extern int debug_driver;
+extern int debug_dumper;
+extern int debug_chunker;
+extern int debug_taper;
+extern int debug_selfcheck;
+extern int debug_sendsize;
+extern int debug_sendbackup;
+amglue_export_tag(getconf,
+    getconf_unit_divisor
+
+    $debug_amandad $debug_amidxtaped $debug_amindexd $debug_amrecover
+    $debug_auth $debug_event $debug_holding $debug_protocol
+    $debug_planner $debug_driver $debug_dumper $debug_chunker
+    $debug_taper $debug_selfcheck $debug_sendsize $debug_sendbackup
+);
+
+/*
+ * Initialization
+ */
+
+config_overwrites_t *new_config_overwrites(int size_estimate);
+void free_config_overwrites(config_overwrites_t *co);
+void add_config_overwrite(config_overwrites_t *co,
+                        char *key,
+                        char *value);
+void add_config_overwrite_opt(config_overwrites_t *co,
+                             char *optarg);
+void apply_config_overwrites(config_overwrites_t *co);
+amglue_export_tag(init,
+    new_config_overwrites free_config_overwrites add_config_overwrite
+    add_config_overwrite_opt apply_config_overwrites
+);
+
+
+
+
+amglue_add_flag_tag_fns(config_init_flags);
+amglue_add_constant(CONFIG_INIT_EXPLICIT_NAME, config_init_flags);
+amglue_add_constant(CONFIG_INIT_USE_CWD, config_init_flags);
+amglue_add_constant(CONFIG_INIT_CLIENT, config_init_flags);
+amglue_add_constant(CONFIG_INIT_OVERLAY, config_init_flags);
+amglue_add_constant(CONFIG_INIT_FATAL, config_init_flags);
+amglue_copy_to_tag(config_init_flags, init);
+
+gboolean config_init(config_init_flags flags,
+                    char *arg_config_name);
+void config_uninit(void);
+char **get_config_options(int first);
+amglue_export_tag(init,
+    config_init config_uninit get_config_options
+);
+
+/* These are accessor functions, because SWIG's wrapping of global string
+ * variables is no so good -- the resulting strings can't be passed to other
+ * functions expecting char * arguments.  */
+%inline %{
+    char *get_config_name(void) { return config_name; }
+    char *get_config_dir(void) { return config_dir; }
+    char *get_config_filename(void) { return config_filename; }
+%}
+amglue_export_tag(init,
+    get_config_name 
+    get_config_dir 
+    get_config_filename
+);
+
+/*
+ * Miscellaneous
+ */
+
+void dump_configuration(void);
+char *config_dir_relative(char *filename);
+char *taperalgo2str(taperalgo_t taperalgo);
+gint64 find_multiplier(char * casestr);
+amglue_export_ok(
+    dump_configuration config_dir_relative taperalgo2str find_multiplier
+);
+
diff --git a/perl/Amanda/Debug.c b/perl/Amanda/Debug.c
new file mode 100644 (file)
index 0000000..b3ff7ae
--- /dev/null
@@ -0,0 +1,2482 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_float swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_unsigned_char swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Debug
+
+#define SWIG_name   "Amanda::Debugc::boot_Amanda__Debug"
+#define SWIG_prefix "Amanda::Debugc::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include <glib.h>
+#include "debug.h"
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+void error__(char *msg) { g_error("%s", msg); }
+void critical(char *msg) { g_critical("%s", msg); }
+void warning(char *msg) { g_warning("%s", msg); }
+void message(char *msg) { g_message("%s", msg); }
+void info(char *msg) { g_info("%s", msg); }
+void debug(char *msg) { g_debug("%s", msg); }
+
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Debug_var::
+class _wrap_Amanda::Debug_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+SWIGCLASS_STATIC int _wrap_erroutput_type_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""erroutput_type""' of type '""erroutput_type_t""'");
+    }
+    erroutput_type = (erroutput_type_t)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_erroutput_type_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(erroutput_type)))  ;
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_error_exit_status_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  {
+    int val;
+    int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(sv, &val);
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""error_exit_status""' of type '""int""'");
+    }
+    error_exit_status = (int)(val);
+  }
+fail:
+  return 1;
+}
+
+
+SWIGCLASS_STATIC int _wrap_error_exit_status_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
+  MAGIC_PPERL
+  sv_setsv(sv,SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(error_exit_status)))  ;
+  return 1;
+}
+
+
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_dbopen) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dbopen(subdir);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dbopen" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    dbopen(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dbreopen) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dbreopen(file,notation);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dbreopen" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dbreopen" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    dbreopen(arg1,arg2);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dbrename) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dbrename(config,subdir);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dbrename" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dbrename" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    dbrename(arg1,arg2);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dbclose) {
+  {
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: dbclose();");
+    }
+    dbclose();
+    
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_error) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: error(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "error" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    error__(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_critical) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: critical(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "critical" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    critical(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_warning) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: warning(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "warning" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    warning(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_message) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: message(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "message" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    message(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_info) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: info(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "info" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    info(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_debug) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: debug(msg);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "debug" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    debug(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dbfd) {
+  {
+    int result;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: dbfd();");
+    }
+    result = (int)dbfd();
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dbfn) {
+  {
+    char *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: dbfn();");
+    }
+    result = (char *)dbfn();
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_debug_dup_stderr_to_debug) {
+  {
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: debug_dup_stderr_to_debug();");
+    }
+    debug_dup_stderr_to_debug();
+    
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|erroutput_type_t *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+    { "Amanda::Debugc::erroutput_type", MAGIC_CLASS _wrap_erroutput_type_set, MAGIC_CLASS _wrap_erroutput_type_get,0 },
+    { "Amanda::Debugc::error_exit_status", MAGIC_CLASS _wrap_error_exit_status_set, MAGIC_CLASS _wrap_error_exit_status_get,0 },
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Debugc::dbopen", _wrap_dbopen},
+{"Amanda::Debugc::dbreopen", _wrap_dbreopen},
+{"Amanda::Debugc::dbrename", _wrap_dbrename},
+{"Amanda::Debugc::dbclose", _wrap_dbclose},
+{"Amanda::Debugc::error", _wrap_error},
+{"Amanda::Debugc::critical", _wrap_critical},
+{"Amanda::Debugc::warning", _wrap_warning},
+{"Amanda::Debugc::message", _wrap_message},
+{"Amanda::Debugc::info", _wrap_info},
+{"Amanda::Debugc::debug", _wrap_debug},
+{"Amanda::Debugc::dbfd", _wrap_dbfd},
+{"Amanda::Debugc::dbfn", _wrap_dbfn},
+{"Amanda::Debugc::debug_dup_stderr_to_debug", _wrap_debug_dup_stderr_to_debug},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ERR_INTERACTIVE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ERR_INTERACTIVE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ERR_SYSLOG", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ERR_SYSLOG)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ERR_AMANDALOG", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ERR_AMANDALOG)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Debug.pm b/perl/Amanda/Debug.pm
new file mode 100644 (file)
index 0000000..ad6795f
--- /dev/null
@@ -0,0 +1,208 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Debug;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Debugc;
+bootstrap Amanda::Debug;
+package Amanda::Debug;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Debug;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Debug;
+
+*dbopen = *Amanda::Debugc::dbopen;
+*dbreopen = *Amanda::Debugc::dbreopen;
+*dbrename = *Amanda::Debugc::dbrename;
+*dbclose = *Amanda::Debugc::dbclose;
+*error = *Amanda::Debugc::error;
+*critical = *Amanda::Debugc::critical;
+*warning = *Amanda::Debugc::warning;
+*message = *Amanda::Debugc::message;
+*info = *Amanda::Debugc::info;
+*debug = *Amanda::Debugc::debug;
+*dbfd = *Amanda::Debugc::dbfd;
+*dbfn = *Amanda::Debugc::dbfn;
+*debug_dup_stderr_to_debug = *Amanda::Debugc::debug_dup_stderr_to_debug;
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Debug;
+
+*ERR_INTERACTIVE = *Amanda::Debugc::ERR_INTERACTIVE;
+*ERR_SYSLOG = *Amanda::Debugc::ERR_SYSLOG;
+*ERR_AMANDALOG = *Amanda::Debugc::ERR_AMANDALOG;
+*erroutput_type = *Amanda::Debugc::erroutput_type;
+*error_exit_status = *Amanda::Debugc::error_exit_status;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Debug - support for debugging Amanda applications
+
+=head1 SYNOPSIS
+
+  use Amanda::Debug qw( :init :logging );
+
+  # (note: dbopen and such are usually handled by 
+  #  Amanda::Util::setup_applicaton)
+  dbopen("server");
+
+  debug("this is a debug message");
+
+See C<debug.h> for a more in-depth description of the functionality of
+this module.
+
+=head1 API STATUS
+
+Stable
+
+=head1 DEBUG LOGGING
+
+Several debug logging messages, each taking a single string, are
+available:
+
+=over
+
+=item C<error> - also aborts the program to produce a core dump
+
+=item C<critical> - exits the program with C<$error_exit_status>
+
+=item C<warning>
+
+=item C<message>
+
+=item C<info>
+
+=item C<debug>
+
+=back
+
+ALl of the debug logging functions are available via the export tag
+C<:logging>.
+
+=head1 ADVANCED USAGE
+
+Most applications should use L<Amanda::Util>'s C<setup_application>
+to initialize the debug libraries.  The initialization functions
+available from this module are thus considered "advanced", and the
+reader is advised to consult the C header, C<debug.h>, for details.
+
+Briefly, the functions C<dbopen> and C<dbrename> are used to
+open a debug file whose pathname includes all of the relevant
+information. C<dbclose> and C<dbreopen> are used to close that debug
+file before transferring control to another process.
+
+The variable C<$erroutput_type> can take on any combination
+of the flags C<$ERROUTPUT_INTERACTIVE>, C<$ERROUTPUT_SYSLOG>
+and C<$ERROUTPUT_AMANDALOG>.  C<$ERROUTPUT_INTERACTIVE>
+causes messages from C<error> and C<critical> to be sent
+to stderr. C<$ERROUTPUT_SYSLOG> sends it to syslog, and
+C<$ERROUTPUT_AMANDALOG> sends it to the current trace log (see
+L<Amanda::Logfile>).
+
+C<$error_exit_status> is the exit status with which C<critical>
+will exit.
+
+All of the initialization functions and variables are available via
+the export tag C<:init>.
+
+The current debug file's integer file descriptor (I<not> a Perl
+filehandle) is available from C<dbfd()>.  Likewise, C<dbfn()> returns
+the filename of the current debug file.
+
+C<debug_dup_stderr_to_debug()> redirects, at the file-descriptor level,
+C<STDERR> into the debug file.  This is useful when running external
+applications which may produce error output.
+
+=cut
+
+push @EXPORT_OK, qw(dbopen dbreopen dbrename dbclose
+    $erroutput_type $error_exit_status);
+push @{$EXPORT_TAGS{"init"}}, qw(dbopen dbreopen dbrename dbclose
+    $erroutput_type $error_exit_status);
+
+push @EXPORT_OK, qw(erroutput_type_t_to_strings);
+push @{$EXPORT_TAGS{"erroutput_type_t"}}, qw(erroutput_type_t_to_strings);
+
+my %_erroutput_type_t_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub erroutput_type_t_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_erroutput_type_t_VALUES) {
+       my $v = $_erroutput_type_t_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($ERR_INTERACTIVE);
+push @{$EXPORT_TAGS{"erroutput_type_t"}}, qw($ERR_INTERACTIVE);
+
+$_erroutput_type_t_VALUES{"INTERACTIVE"} = $ERR_INTERACTIVE;
+
+push @EXPORT_OK, qw($ERR_SYSLOG);
+push @{$EXPORT_TAGS{"erroutput_type_t"}}, qw($ERR_SYSLOG);
+
+$_erroutput_type_t_VALUES{"SYSLOG"} = $ERR_SYSLOG;
+
+push @EXPORT_OK, qw($ERR_AMANDALOG);
+push @{$EXPORT_TAGS{"erroutput_type_t"}}, qw($ERR_AMANDALOG);
+
+$_erroutput_type_t_VALUES{"AMANDALOG"} = $ERR_AMANDALOG;
+
+push @EXPORT_OK, qw(error critical warning message info debug);
+push @{$EXPORT_TAGS{"logging"}}, qw(error critical warning message info debug);
+1;
diff --git a/perl/Amanda/Debug.swg b/perl/Amanda/Debug.swg
new file mode 100644 (file)
index 0000000..e1285d6
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Debug"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include <glib.h>
+#include "debug.h"
+%}
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Debug - support for debugging Amanda applications
+
+=head1 SYNOPSIS
+
+  use Amanda::Debug qw( :init :logging );
+
+  # (note: dbopen and such are usually handled by 
+  #  Amanda::Util::setup_applicaton)
+  dbopen("server");
+
+  debug("this is a debug message");
+
+See C<debug.h> for a more in-depth description of the functionality of
+this module.
+
+=head1 API STATUS
+
+Stable
+
+=head1 DEBUG LOGGING
+
+Several debug logging messages, each taking a single string, are
+available:
+
+=over
+
+=item C<error> - also aborts the program to produce a core dump
+
+=item C<critical> - exits the program with C<$error_exit_status>
+
+=item C<warning>
+
+=item C<message>
+
+=item C<info>
+
+=item C<debug>
+
+=back
+
+ALl of the debug logging functions are available via the export tag
+C<:logging>.
+
+=head1 ADVANCED USAGE
+
+Most applications should use L<Amanda::Util>'s C<setup_application>
+to initialize the debug libraries.  The initialization functions
+available from this module are thus considered "advanced", and the
+reader is advised to consult the C header, C<debug.h>, for details.
+
+Briefly, the functions C<dbopen> and C<dbrename> are used to
+open a debug file whose pathname includes all of the relevant
+information. C<dbclose> and C<dbreopen> are used to close that debug
+file before transferring control to another process.
+
+The variable C<$erroutput_type> can take on any combination
+of the flags C<$ERROUTPUT_INTERACTIVE>, C<$ERROUTPUT_SYSLOG>
+and C<$ERROUTPUT_AMANDALOG>.  C<$ERROUTPUT_INTERACTIVE>
+causes messages from C<error> and C<critical> to be sent
+to stderr. C<$ERROUTPUT_SYSLOG> sends it to syslog, and
+C<$ERROUTPUT_AMANDALOG> sends it to the current trace log (see
+L<Amanda::Logfile>).
+
+C<$error_exit_status> is the exit status with which C<critical>
+will exit.
+
+All of the initialization functions and variables are available via
+the export tag C<:init>.
+
+The current debug file's integer file descriptor (I<not> a Perl
+filehandle) is available from C<dbfd()>.  Likewise, C<dbfn()> returns
+the filename of the current debug file.
+
+C<debug_dup_stderr_to_debug()> redirects, at the file-descriptor level,
+C<STDERR> into the debug file.  This is useful when running external
+applications which may produce error output.
+
+=cut
+%}
+
+/*
+ * Initialization
+ */
+
+amglue_export_tag(init,
+    dbopen dbreopen dbrename dbclose
+    $erroutput_type $error_exit_status
+);
+
+void   dbopen(char *subdir);
+void   dbreopen(char *file, char *notation);
+void   dbrename(char *config, char *subdir);
+void   dbclose(void);
+
+amglue_add_flag_tag_fns(erroutput_type_t);
+amglue_add_constant_short(ERR_INTERACTIVE, INTERACTIVE, erroutput_type_t);
+amglue_add_constant_short(ERR_SYSLOG, SYSLOG, erroutput_type_t);
+amglue_add_constant_short(ERR_AMANDALOG, AMANDALOG, erroutput_type_t);
+amglue_copy_tag_to(erroutput_type_t, init);
+
+erroutput_type_t erroutput_type;
+int error_exit_status;
+
+/*
+ * Logging
+ */
+
+amglue_export_tag(logging,
+    error critical warning message info debug
+);
+
+%rename(error) error__; /* error() is a macro defined in debug.h .. just avoid that */
+%inline %{
+void error__(char *msg) { g_error("%s", msg); }
+void critical(char *msg) { g_critical("%s", msg); }
+void warning(char *msg) { g_warning("%s", msg); }
+void message(char *msg) { g_message("%s", msg); }
+void info(char *msg) { g_info("%s", msg); }
+void debug(char *msg) { g_debug("%s", msg); }
+%}
+
+/*
+ * Advanced
+ */
+
+int    dbfd(void);
+char * dbfn(void);
+void debug_dup_stderr_to_debug(void);
diff --git a/perl/Amanda/Device.c b/perl/Amanda/Device.c
new file mode 100644 (file)
index 0000000..0b41118
--- /dev/null
@@ -0,0 +1,3861 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_Device swig_types[0]
+#define SWIGTYPE_p_DevicePropertyBase swig_types[1]
+#define SWIGTYPE_p_GValue swig_types[2]
+#define SWIGTYPE_p_a_STRMAX__char swig_types[3]
+#define SWIGTYPE_p_char swig_types[4]
+#define SWIGTYPE_p_double swig_types[5]
+#define SWIGTYPE_p_dumpfile_t swig_types[6]
+#define SWIGTYPE_p_float swig_types[7]
+#define SWIGTYPE_p_guint swig_types[8]
+#define SWIGTYPE_p_guint64 swig_types[9]
+#define SWIGTYPE_p_int swig_types[10]
+#define SWIGTYPE_p_unsigned_char swig_types[11]
+static swig_type_info *swig_types[13];
+static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Device
+
+#define SWIG_name   "Amanda::Devicec::boot_Amanda__Device"
+#define SWIG_prefix "Amanda::Devicec::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "device.h"
+#include "property.h"
+#include "fileheader.h"
+
+
+
+/* Utility functions for typemaps, below */
+
+static SV *
+set_sv_from_gvalue(GValue *value)
+{
+    GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
+    SV *sv = NULL;
+
+    /* complex reference types */
+    switch (fundamental) {
+       case G_TYPE_LONG:
+           sv = sv_2mortal(amglue_newSVi64(g_value_get_long(value)));
+           break;
+
+       case G_TYPE_ULONG:
+           sv = sv_2mortal(amglue_newSVu64(g_value_get_ulong(value)));
+           break;
+
+       case G_TYPE_INT64:
+           sv = sv_2mortal(amglue_newSVi64(g_value_get_int64(value)));
+           break;
+
+       case G_TYPE_UINT64:
+           sv = sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
+           break;
+
+       case G_TYPE_BOXED: {
+           GType boxed_type = G_VALUE_TYPE(value);
+           QualifiedSize qs;
+           HV *hv;
+
+           if (boxed_type == QUALIFIED_SIZE_TYPE) {
+               qs = *(QualifiedSize*)(g_value_get_boxed(value));
+               
+               /* build a hash */
+               hv = (HV *)sv_2mortal((SV *)newHV());
+               hv_store(hv, "accuracy", 8, newSViv(qs.accuracy), 0);
+               hv_store(hv, "bytes", 5, amglue_newSVi64(qs.bytes), 0);
+
+               sv = newRV((SV *)hv);
+               return newRV((SV *)hv);
+           } else {
+               warn("Unsupported boxed property type #%d", boxed_type);
+
+               sv = sv_newmortal();
+               sv_setsv(sv, &PL_sv_undef);
+               return sv;
+           }
+       }
+    }
+
+    /* simple types that can be constructed with sv_set*v */
+    sv = sv_newmortal();
+    switch (fundamental) {
+       case G_TYPE_CHAR:
+           sv_setiv(sv, g_value_get_char(value));
+           break;
+
+       case G_TYPE_UCHAR:
+           sv_setuv(sv, g_value_get_uchar(value));
+           break;
+
+       case G_TYPE_BOOLEAN:
+           sv_setiv(sv, g_value_get_boolean(value));
+           break;
+
+       case G_TYPE_INT:
+           sv_setiv(sv, g_value_get_int(value));
+           break;
+
+       case G_TYPE_UINT:
+           sv_setuv(sv, g_value_get_uint(value));
+           break;
+
+       case G_TYPE_FLOAT:
+           sv_setnv(sv, g_value_get_float(value));
+           break;
+
+       case G_TYPE_DOUBLE:
+           sv_setnv(sv, g_value_get_double(value));
+           break;
+
+       case G_TYPE_STRING:
+           sv_setpv(sv, g_value_get_string(value));
+           break;
+
+       case G_TYPE_ENUM:
+           sv_setiv(sv, g_value_get_enum(value));
+           break;
+
+       case G_TYPE_FLAGS:
+           sv_setiv(sv, g_value_get_flags(value));
+           break;
+
+       /* Unsupported */
+       default:
+       case G_TYPE_POINTER:
+       case G_TYPE_INTERFACE:
+       case G_TYPE_OBJECT:
+       case G_TYPE_PARAM:
+           warn("Unsupported fundamental property type #%d", fundamental);
+           sv_setsv(sv, &PL_sv_undef);
+           break;
+    }
+
+    return sv;
+}
+
+static gboolean
+set_gvalue_from_sv(SV *sv, GValue *value)
+{
+    GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
+    switch (fundamental) {
+       case G_TYPE_CHAR:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_char(value, SvIV(sv));
+           break;
+
+       case G_TYPE_UCHAR:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_uchar(value, SvUV(sv));
+           break;
+
+       case G_TYPE_BOOLEAN:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_boolean(value, SvIV(sv));
+           break;
+
+       case G_TYPE_INT:
+           g_value_set_int(value, amglue_SvI32(sv));
+           break;
+
+       case G_TYPE_UINT:
+           g_value_set_uint(value, amglue_SvU32(sv));
+           break;
+
+       case G_TYPE_LONG:
+           g_value_set_int64(value, amglue_SvI64(sv));
+           break;
+
+       case G_TYPE_ULONG:
+           g_value_set_uint64(value, amglue_SvU64(sv));
+           break;
+
+       case G_TYPE_INT64:
+           g_value_set_int64(value, amglue_SvI64(sv));
+           break;
+
+       case G_TYPE_UINT64:
+           g_value_set_uint64(value, amglue_SvU64(sv));
+           break;
+
+       case G_TYPE_FLOAT:
+           if (!SvNOK(sv)) return FALSE;
+           g_value_set_float(value, SvNV(sv));
+           break;
+
+       case G_TYPE_DOUBLE:
+           if (!SvNOK(sv)) return FALSE;
+           g_value_set_double(value, SvNV(sv));
+           break;
+
+       case G_TYPE_STRING:
+           if (!SvPOK(sv)) return FALSE;
+           g_value_set_string(value, SvPV_nolen(sv));
+           break;
+
+       case G_TYPE_ENUM: 
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_enum(value, SvIV(sv));
+           break;
+
+       case G_TYPE_FLAGS:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_flags(value, SvIV(sv));
+           break;
+
+       /* Unsupported */
+       default:
+       case G_TYPE_POINTER:
+       case G_TYPE_INTERFACE:
+       case G_TYPE_BOXED: /* note: *getting* boxed values is supported */
+       case G_TYPE_OBJECT:
+       case G_TYPE_PARAM:
+           return FALSE;
+    }
+
+    return TRUE;
+}
+
+
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN Device *new_Device(char *device_name){
+           return device_open(device_name);
+       }
+SWIGINTERN void delete_Device(Device *self){
+           g_object_unref(self);
+       }
+SWIGINTERN ReadLabelStatusFlags Device_read_label(Device *self){
+           return device_read_label(self);
+       }
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+SWIGINTERN gboolean Device_start(Device *self,DeviceAccessMode mode,char *label,char *timestamp){
+           return device_start(self, mode, label, timestamp);
+       }
+SWIGINTERN gboolean Device_finish(Device *self){
+           return device_finish(self);
+       }
+SWIGINTERN gboolean Device_start_file(Device *self,dumpfile_t const *jobInfo){
+           return device_start_file(self, jobInfo);
+       }
+SWIGINTERN guint Device_write_min_size(Device *self){
+           return device_write_min_size(self);
+       }
+SWIGINTERN guint Device_write_max_size(Device *self){
+           return device_write_max_size(self);
+       }
+SWIGINTERN guint Device_read_max_size(Device *self){
+           return device_read_max_size(self);
+       }
+SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data,gboolean short_block){
+           return device_write_block(self, size, data, short_block);
+       }
+SWIGINTERN gboolean Device_write_from_fd(Device *self,int fd){
+           return device_write_from_fd(self, fd);
+       }
+SWIGINTERN gboolean Device_finish_file(Device *self){
+           return device_finish_file(self);
+       }
+SWIGINTERN dumpfile_t *Device_seek_file(Device *self,guint file){
+           return device_seek_file(self, file);
+       }
+SWIGINTERN gboolean Device_seek_block(Device *self,guint64 block){
+           return device_seek_block(self, block);
+       }
+SWIGINTERN int Device_read_block(Device *self,gpointer buffer,int *size){
+           return device_read_block(self, buffer, size);
+       }
+SWIGINTERN gboolean Device_read_to_fd(Device *self,int fd){
+           return device_read_to_fd(self, fd);
+       }
+SWIGINTERN DeviceProperty const *Device_property_list(Device *self){
+           return device_property_get_list(self);
+       }
+SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,gboolean *val_found){
+           *val_found = device_property_get(self, pbase->ID, out_val);
+       }
+SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){
+           GValue gval;
+           memset(&gval, 0, sizeof(gval));
+           g_value_init(&gval, pbase->type);
+           if (!set_gvalue_from_sv(sv, &gval))
+               goto fail;
+
+           if (!device_property_set(self, pbase->ID, &gval))
+               goto fail;
+
+           g_value_unset(&gval);
+           return TRUE;
+       fail:
+           g_value_unset(&gval);
+           return FALSE;
+       }
+SWIGINTERN gboolean Device_recycle_file(Device *self,guint filenum){
+           return device_recycle_file(self, filenum);
+       }
+SWIGINTERN void Device_set_startup_properties_from_config(Device *self){
+           device_set_startup_properties_from_config(self);
+       }
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Device_var::
+class _wrap_Amanda::Device_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_Device_file_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_file_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_file_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (int) ((arg1)->file);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_block_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint64 result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_block_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result =  ((arg1)->block);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_in_file_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_in_file_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_in_file_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (gboolean) ((arg1)->in_file);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_device_name_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_device_name_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_device_name_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (char *) ((arg1)->device_name);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_access_mode_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    DeviceAccessMode result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_access_mode_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_access_mode_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (DeviceAccessMode) ((arg1)->access_mode);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_is_eof_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_is_eof_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eof_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (gboolean) ((arg1)->is_eof);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_volume_label_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_volume_label_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_label_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (char *) ((arg1)->volume_label);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_volume_time_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_volume_time_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_time_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (char *) ((arg1)->volume_time);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_Device) {
+  {
+    char *arg1 = (char *) 0 ;
+    Device *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: new_Device(device_name);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Device" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (Device *)new_Device(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_Device) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_Device(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Device" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    delete_Device(arg1);
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_read_label) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    ReadLabelStatusFlags result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_read_label(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_label" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (ReadLabelStatusFlags)Device_read_label(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_start) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    DeviceAccessMode arg2 ;
+    char *arg3 = (char *) 0 ;
+    char *arg4 = (char *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int res4 ;
+    char *buf4 = 0 ;
+    int alloc4 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: Device_start(self,mode,label,timestamp);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_start" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_start" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Device_start" "', argument " "4"" of type '" "char *""'");
+    }
+    arg4 = (char *)(buf4);
+    result = (gboolean)Device_start(arg1,arg2,arg3,arg4);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    XSRETURN(argvi);
+  fail:
+    
+    
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_finish) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_finish(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (gboolean)Device_finish(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_start_file) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    dumpfile_t *arg2 = (dumpfile_t *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_start_file(self,jobInfo);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_start_file" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_start_file" "', argument " "2"" of type '" "dumpfile_t const *""'"); 
+    }
+    arg2 = (dumpfile_t *)(argp2);
+    result = (gboolean)Device_start_file(arg1,(dumpfile_t const *)arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_write_min_size) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_write_min_size(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_min_size" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = Device_write_min_size(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_write_max_size) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_write_max_size(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_max_size" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = Device_write_max_size(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_read_max_size) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_read_max_size(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_max_size" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = Device_read_max_size(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_write_block) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint arg2 ;
+    gpointer arg3 = (gpointer) 0 ;
+    gboolean arg4 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res3 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: Device_write_block(self,size,data,short_block);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_block" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(guint) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(guint) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(guint) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(guint) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
+      }
+    }
+    res3 = SWIG_ConvertPtr(ST(2),SWIG_as_voidptrptr(&arg3), 0, 0);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_write_block" "', argument " "3"" of type '" "gpointer""'"); 
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg4 = amglue_SvI8(ST(3));
+      } else if (sizeof(signed int) == 2) {
+        arg4 = amglue_SvI16(ST(3));
+      } else if (sizeof(signed int) == 4) {
+        arg4 = amglue_SvI32(ST(3));
+      } else if (sizeof(signed int) == 8) {
+        arg4 = amglue_SvI64(ST(3));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)Device_write_block(arg1,arg2,arg3,arg4);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_write_from_fd) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    int arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_write_from_fd(self,fd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_fd" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)Device_write_from_fd(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_finish_file) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_finish_file(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (gboolean)Device_finish_file(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_seek_file) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint arg2 ;
+    dumpfile_t *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_seek_file(self,file);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(guint) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(guint) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(guint) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(guint) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
+      }
+    }
+    result = (dumpfile_t *)Device_seek_file(arg1,arg2);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_seek_block) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint64 arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_seek_block(self,block);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      arg2 = amglue_SvU64(ST(1));
+    }
+    result = (gboolean)Device_seek_block(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_read_block) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    gpointer arg2 = (gpointer) 0 ;
+    int *arg3 = (int *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int res2 ;
+    void *argp3 = 0 ;
+    int res3 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: Device_read_block(self,buffer,size);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'"); 
+    }
+    res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 |  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'"); 
+    }
+    arg3 = (int *)(argp3);
+    result = (int)Device_read_block(arg1,arg2,arg3);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_read_to_fd) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    int arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_read_to_fd(self,fd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_fd" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)Device_read_to_fd(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_property_list) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    DeviceProperty *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_property_list(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_list" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    result = (DeviceProperty *)Device_property_list(arg1);
+    {
+      int i = 0;
+      int len = 0;
+      
+      /* Count the DeviceProperties */
+      while (result[len].base) len++;
+      EXTEND(SP, len); /* make room for return values */
+      
+      /* Note that we set ST(argvi) several times. the nature of
+            * SWIG's wrapping is such that incrementing argvi points
+            * ST(argvi) to the next location in perl's argument stack.
+                   */
+      
+      for (i = 0; i < len ; i++) {
+        ST(argvi) = sv_newmortal(); 
+        sv_setpv(ST(argvi), result[i].base->name); 
+        argvi++;
+      }; 
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_property_get) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ;
+    GValue *arg3 = (GValue *) 0 ;
+    gboolean *arg4 = (gboolean *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    GValue val3 ;
+    gboolean found3 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    {
+      memset(&val3, 0, sizeof(val3));
+      arg3 = &val3;
+      arg4 = &found3;
+    }
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_property_get(self,pbase,val_found);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_get" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      char *pname = NULL;
+      
+      if (SvPOK(ST(1)))
+      pname = SvPV_nolen(ST(1));
+      
+      if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+      if (!pname || !arg2) {
+        SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
+      }
+    }
+    Device_property_get(arg1,arg2,arg3,arg4);
+    
+    {
+      /* if the result is valid */
+      if (*arg4) {
+        /* move data from arg3 to ST(argvi), somehow */
+        ST(argvi) = set_sv_from_gvalue(arg3);
+        
+        /* free any memory for the GValue */
+        g_value_unset(arg3);
+      } else {
+        /* silently return 'undef', the sentinel for "undefined" */
+        ST(argvi) = sv_newmortal();
+        sv_setsv(ST(argvi), &PL_sv_undef);
+      }
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_property_set) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ;
+    SV *arg3 = (SV *) 0 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: Device_property_set(self,pbase,sv);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      char *pname = NULL;
+      
+      if (SvPOK(ST(1)))
+      pname = SvPV_nolen(ST(1));
+      
+      if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+      if (!pname || !arg2) {
+        SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
+      }
+    }
+    arg3 = ST(2);
+    result = (gboolean)Device_property_set(arg1,arg2,arg3);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_recycle_file) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    guint arg2 ;
+    gboolean result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: Device_recycle_file(self,filenum);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_recycle_file" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    {
+      if (sizeof(guint) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(guint) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(guint) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(guint) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
+      }
+    }
+    result = (gboolean)Device_recycle_file(arg1,arg2);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_Device_set_startup_properties_from_config) {
+  {
+    Device *arg1 = (Device *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: Device_set_startup_properties_from_config(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_set_startup_properties_from_config" "', argument " "1"" of type '" "Device *""'"); 
+    }
+    arg1 = (Device *)(argp1);
+    Device_set_startup_properties_from_config(arg1);
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_IS_WRITABLE_ACCESS_MODE) {
+  {
+    DeviceAccessMode arg1 ;
+    gboolean result;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: IS_WRITABLE_ACCESS_MODE(mode);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)IS_WRITABLE_ACCESS_MODE(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_feature_support_flags_is_valid) {
+  {
+    FeatureSupportFlags arg1 ;
+    gboolean result;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: feature_support_flags_is_valid(FeatureSupportFlags);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (gboolean)feature_support_flags_is_valid(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_Device = {"_p_Device", "struct Device *|Device *", 0, 0, (void*)"Amanda::Device::Device", 0};
+static swig_type_info _swigt__p_DevicePropertyBase = {"_p_DevicePropertyBase", "DevicePropertyBase *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_GValue = {"_p_GValue", "GValue *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_a_STRMAX__char = {"_p_a_STRMAX__char", "char (*)[STRMAX]|string_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Types::dumpfile_t", 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_guint = {"_p_guint", "guint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|ConcurrencyParadigm *|filetype_t *|SizeAccuracy *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|FeatureSupportFlags *|ReadLabelStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_Device,
+  &_swigt__p_DevicePropertyBase,
+  &_swigt__p_GValue,
+  &_swigt__p_a_STRMAX__char,
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_dumpfile_t,
+  &_swigt__p_float,
+  &_swigt__p_guint,
+  &_swigt__p_guint64,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_Device[] = {  {&_swigt__p_Device, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_DevicePropertyBase[] = {  {&_swigt__p_DevicePropertyBase, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GValue[] = {  {&_swigt__p_GValue, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_a_STRMAX__char[] = {  {&_swigt__p_a_STRMAX__char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_guint[] = {  {&_swigt__p_guint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_guint64[] = {  {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_Device,
+  _swigc__p_DevicePropertyBase,
+  _swigc__p_GValue,
+  _swigc__p_a_STRMAX__char,
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_dumpfile_t,
+  _swigc__p_float,
+  _swigc__p_guint,
+  _swigc__p_guint64,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Devicec::Device_file_get", _wrap_Device_file_get},
+{"Amanda::Devicec::Device_block_get", _wrap_Device_block_get},
+{"Amanda::Devicec::Device_in_file_get", _wrap_Device_in_file_get},
+{"Amanda::Devicec::Device_device_name_get", _wrap_Device_device_name_get},
+{"Amanda::Devicec::Device_access_mode_get", _wrap_Device_access_mode_get},
+{"Amanda::Devicec::Device_is_eof_get", _wrap_Device_is_eof_get},
+{"Amanda::Devicec::Device_volume_label_get", _wrap_Device_volume_label_get},
+{"Amanda::Devicec::Device_volume_time_get", _wrap_Device_volume_time_get},
+{"Amanda::Devicec::new_Device", _wrap_new_Device},
+{"Amanda::Devicec::delete_Device", _wrap_delete_Device},
+{"Amanda::Devicec::Device_read_label", _wrap_Device_read_label},
+{"Amanda::Devicec::Device_start", _wrap_Device_start},
+{"Amanda::Devicec::Device_finish", _wrap_Device_finish},
+{"Amanda::Devicec::Device_start_file", _wrap_Device_start_file},
+{"Amanda::Devicec::Device_write_min_size", _wrap_Device_write_min_size},
+{"Amanda::Devicec::Device_write_max_size", _wrap_Device_write_max_size},
+{"Amanda::Devicec::Device_read_max_size", _wrap_Device_read_max_size},
+{"Amanda::Devicec::Device_write_block", _wrap_Device_write_block},
+{"Amanda::Devicec::Device_write_from_fd", _wrap_Device_write_from_fd},
+{"Amanda::Devicec::Device_finish_file", _wrap_Device_finish_file},
+{"Amanda::Devicec::Device_seek_file", _wrap_Device_seek_file},
+{"Amanda::Devicec::Device_seek_block", _wrap_Device_seek_block},
+{"Amanda::Devicec::Device_read_block", _wrap_Device_read_block},
+{"Amanda::Devicec::Device_read_to_fd", _wrap_Device_read_to_fd},
+{"Amanda::Devicec::Device_property_list", _wrap_Device_property_list},
+{"Amanda::Devicec::Device_property_get", _wrap_Device_property_get},
+{"Amanda::Devicec::Device_property_set", _wrap_Device_property_set},
+{"Amanda::Devicec::Device_recycle_file", _wrap_Device_recycle_file},
+{"Amanda::Devicec::Device_set_startup_properties_from_config", _wrap_Device_set_startup_properties_from_config},
+{"Amanda::Devicec::IS_WRITABLE_ACCESS_MODE", _wrap_IS_WRITABLE_ACCESS_MODE},
+{"Amanda::Devicec::feature_support_flags_is_valid", _wrap_feature_support_flags_is_valid},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  
+  /* Initialize the Device API on load */
+  device_api_init();
+  
+  SWIG_TypeClientData(SWIGTYPE_p_Device, (void*) "Amanda::Device::Device");
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_NULL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ACCESS_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ACCESS_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "ACCESS_APPEND", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_APPEND)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_SUCCESS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_SUCCESS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_DEVICE_MISSING", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_DEVICE_MISSING)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_DEVICE_ERROR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_DEVICE_ERROR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_MISSING", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_MISSING)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_UNLABELED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_UNLABELED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_ERROR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_ERROR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_FLAGS_MAX", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_FLAGS_MAX)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BEFORE_START", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BEFORE_START)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MAX", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MAX)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_SHIFT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_SHIFT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BEFORE_START", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BEFORE_START)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BEFORE_START", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BEFORE_START)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_EXCLUSIVE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_EXCLUSIVE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_SHARED_READ", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_SHARED_READ)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_RANDOM_ACCESS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_RANDOM_ACCESS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_NONE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_NONE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_DESIRED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_DESIRED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_REQUIRED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_REQUIRED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_ONLY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_ONLY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WORM", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WORM)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_WRITE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_WRITE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WRITE_ONLY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WRITE_ONLY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_UNKNOWN", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_UNKNOWN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_ESTIMATE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_ESTIMATE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_REAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_REAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_STATUS_ENABLED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_STATUS_ENABLED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_STATUS_DISABLED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_STATUS_DISABLED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SURETY_BAD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SURETY_BAD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SURETY_GOOD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SURETY_GOOD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_DEFAULT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_DEFAULT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_DETECTED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_DETECTED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_USER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_USER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_MAX", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_MAX)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_STATUS_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_STATUS_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_SURETY_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_SURETY_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_SOURCE_MASK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_SOURCE_MASK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Device.pm b/perl/Amanda/Device.pm
new file mode 100644 (file)
index 0000000..e0ffa81
--- /dev/null
@@ -0,0 +1,826 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Device;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+require Amanda::Types;
+package Amanda::Devicec;
+bootstrap Amanda::Device;
+package Amanda::Device;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Device;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Device;
+
+*IS_WRITABLE_ACCESS_MODE = *Amanda::Devicec::IS_WRITABLE_ACCESS_MODE;
+*feature_support_flags_is_valid = *Amanda::Devicec::feature_support_flags_is_valid;
+
+############# Class : Amanda::Device::Device ##############
+
+package Amanda::Device::Device;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( Amanda::Device );
+%OWNER = ();
+%ITERATORS = ();
+*swig_file_get = *Amanda::Devicec::Device_file_get;
+*swig_file_set = *Amanda::Devicec::Device_file_set;
+*swig_block_get = *Amanda::Devicec::Device_block_get;
+*swig_block_set = *Amanda::Devicec::Device_block_set;
+*swig_in_file_get = *Amanda::Devicec::Device_in_file_get;
+*swig_in_file_set = *Amanda::Devicec::Device_in_file_set;
+*swig_device_name_get = *Amanda::Devicec::Device_device_name_get;
+*swig_device_name_set = *Amanda::Devicec::Device_device_name_set;
+*swig_access_mode_get = *Amanda::Devicec::Device_access_mode_get;
+*swig_access_mode_set = *Amanda::Devicec::Device_access_mode_set;
+*swig_is_eof_get = *Amanda::Devicec::Device_is_eof_get;
+*swig_is_eof_set = *Amanda::Devicec::Device_is_eof_set;
+*swig_volume_label_get = *Amanda::Devicec::Device_volume_label_get;
+*swig_volume_label_set = *Amanda::Devicec::Device_volume_label_set;
+*swig_volume_time_get = *Amanda::Devicec::Device_volume_time_get;
+*swig_volume_time_set = *Amanda::Devicec::Device_volume_time_set;
+sub new {
+    my $pkg = shift;
+    my $self = Amanda::Devicec::new_Device(@_);
+    bless $self, $pkg if defined($self);
+}
+
+sub DESTROY {
+    return unless $_[0]->isa('HASH');
+    my $self = tied(%{$_[0]});
+    return unless defined $self;
+    delete $ITERATORS{$self};
+    if (exists $OWNER{$self}) {
+        Amanda::Devicec::delete_Device($self);
+        delete $OWNER{$self};
+    }
+}
+
+*read_label = *Amanda::Devicec::Device_read_label;
+*start = *Amanda::Devicec::Device_start;
+*finish = *Amanda::Devicec::Device_finish;
+*start_file = *Amanda::Devicec::Device_start_file;
+*write_min_size = *Amanda::Devicec::Device_write_min_size;
+*write_max_size = *Amanda::Devicec::Device_write_max_size;
+*read_max_size = *Amanda::Devicec::Device_read_max_size;
+*write_block = *Amanda::Devicec::Device_write_block;
+*write_from_fd = *Amanda::Devicec::Device_write_from_fd;
+*finish_file = *Amanda::Devicec::Device_finish_file;
+*seek_file = *Amanda::Devicec::Device_seek_file;
+*seek_block = *Amanda::Devicec::Device_seek_block;
+*read_block = *Amanda::Devicec::Device_read_block;
+*read_to_fd = *Amanda::Devicec::Device_read_to_fd;
+*property_list = *Amanda::Devicec::Device_property_list;
+*property_get = *Amanda::Devicec::Device_property_get;
+*property_set = *Amanda::Devicec::Device_property_set;
+*recycle_file = *Amanda::Devicec::Device_recycle_file;
+*set_startup_properties_from_config = *Amanda::Devicec::Device_set_startup_properties_from_config;
+sub DISOWN {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    $OWNER{$ptr} = 1;
+}
+
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Device;
+
+*ACCESS_NULL = *Amanda::Devicec::ACCESS_NULL;
+*ACCESS_READ = *Amanda::Devicec::ACCESS_READ;
+*ACCESS_WRITE = *Amanda::Devicec::ACCESS_WRITE;
+*ACCESS_APPEND = *Amanda::Devicec::ACCESS_APPEND;
+*READ_LABEL_STATUS_SUCCESS = *Amanda::Devicec::READ_LABEL_STATUS_SUCCESS;
+*READ_LABEL_STATUS_DEVICE_MISSING = *Amanda::Devicec::READ_LABEL_STATUS_DEVICE_MISSING;
+*READ_LABEL_STATUS_DEVICE_ERROR = *Amanda::Devicec::READ_LABEL_STATUS_DEVICE_ERROR;
+*READ_LABEL_STATUS_VOLUME_MISSING = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_MISSING;
+*READ_LABEL_STATUS_VOLUME_UNLABELED = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_UNLABELED;
+*READ_LABEL_STATUS_VOLUME_ERROR = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_ERROR;
+*READ_LABEL_STATUS_FLAGS_MAX = *Amanda::Devicec::READ_LABEL_STATUS_FLAGS_MAX;
+*PROPERTY_PHASE_BEFORE_START = *Amanda::Devicec::PROPERTY_PHASE_BEFORE_START;
+*PROPERTY_PHASE_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_BETWEEN_FILE_WRITE;
+*PROPERTY_PHASE_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_INSIDE_FILE_WRITE;
+*PROPERTY_PHASE_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_PHASE_BETWEEN_FILE_READ;
+*PROPERTY_PHASE_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_PHASE_INSIDE_FILE_READ;
+*PROPERTY_PHASE_MAX = *Amanda::Devicec::PROPERTY_PHASE_MAX;
+*PROPERTY_PHASE_MASK = *Amanda::Devicec::PROPERTY_PHASE_MASK;
+*PROPERTY_PHASE_SHIFT = *Amanda::Devicec::PROPERTY_PHASE_SHIFT;
+*PROPERTY_ACCESS_GET_BEFORE_START = *Amanda::Devicec::PROPERTY_ACCESS_GET_BEFORE_START;
+*PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE;
+*PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE;
+*PROPERTY_ACCESS_GET_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_GET_BETWEEN_FILE_READ;
+*PROPERTY_ACCESS_GET_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_GET_INSIDE_FILE_READ;
+*PROPERTY_ACCESS_SET_BEFORE_START = *Amanda::Devicec::PROPERTY_ACCESS_SET_BEFORE_START;
+*PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE;
+*PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE;
+*PROPERTY_ACCESS_SET_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_SET_BETWEEN_FILE_READ;
+*PROPERTY_ACCESS_SET_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_SET_INSIDE_FILE_READ;
+*PROPERTY_ACCESS_GET_MASK = *Amanda::Devicec::PROPERTY_ACCESS_GET_MASK;
+*PROPERTY_ACCESS_SET_MASK = *Amanda::Devicec::PROPERTY_ACCESS_SET_MASK;
+*CONCURRENCY_PARADIGM_EXCLUSIVE = *Amanda::Devicec::CONCURRENCY_PARADIGM_EXCLUSIVE;
+*CONCURRENCY_PARADIGM_SHARED_READ = *Amanda::Devicec::CONCURRENCY_PARADIGM_SHARED_READ;
+*CONCURRENCY_PARADIGM_RANDOM_ACCESS = *Amanda::Devicec::CONCURRENCY_PARADIGM_RANDOM_ACCESS;
+*STREAMING_REQUIREMENT_NONE = *Amanda::Devicec::STREAMING_REQUIREMENT_NONE;
+*STREAMING_REQUIREMENT_DESIRED = *Amanda::Devicec::STREAMING_REQUIREMENT_DESIRED;
+*STREAMING_REQUIREMENT_REQUIRED = *Amanda::Devicec::STREAMING_REQUIREMENT_REQUIRED;
+*MEDIA_ACCESS_MODE_READ_ONLY = *Amanda::Devicec::MEDIA_ACCESS_MODE_READ_ONLY;
+*MEDIA_ACCESS_MODE_WORM = *Amanda::Devicec::MEDIA_ACCESS_MODE_WORM;
+*MEDIA_ACCESS_MODE_READ_WRITE = *Amanda::Devicec::MEDIA_ACCESS_MODE_READ_WRITE;
+*MEDIA_ACCESS_MODE_WRITE_ONLY = *Amanda::Devicec::MEDIA_ACCESS_MODE_WRITE_ONLY;
+*SIZE_ACCURACY_UNKNOWN = *Amanda::Devicec::SIZE_ACCURACY_UNKNOWN;
+*SIZE_ACCURACY_ESTIMATE = *Amanda::Devicec::SIZE_ACCURACY_ESTIMATE;
+*SIZE_ACCURACY_REAL = *Amanda::Devicec::SIZE_ACCURACY_REAL;
+*FEATURE_STATUS_ENABLED = *Amanda::Devicec::FEATURE_STATUS_ENABLED;
+*FEATURE_STATUS_DISABLED = *Amanda::Devicec::FEATURE_STATUS_DISABLED;
+*FEATURE_SURETY_BAD = *Amanda::Devicec::FEATURE_SURETY_BAD;
+*FEATURE_SURETY_GOOD = *Amanda::Devicec::FEATURE_SURETY_GOOD;
+*FEATURE_SOURCE_DEFAULT = *Amanda::Devicec::FEATURE_SOURCE_DEFAULT;
+*FEATURE_SOURCE_DETECTED = *Amanda::Devicec::FEATURE_SOURCE_DETECTED;
+*FEATURE_SOURCE_USER = *Amanda::Devicec::FEATURE_SOURCE_USER;
+*FEATURE_SUPPORT_FLAGS_MAX = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_MAX;
+*FEATURE_SUPPORT_FLAGS_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_MASK;
+*FEATURE_SUPPORT_FLAGS_STATUS_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_STATUS_MASK;
+*FEATURE_SUPPORT_FLAGS_SURETY_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_SURETY_MASK;
+*FEATURE_SUPPORT_FLAGS_SOURCE_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_SOURCE_MASK;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Device - interact with Amanda data-storage devices
+
+=head1 SYNOPSIS
+
+  use Amanda::Device qw( :constants );
+
+  my $dev = Amanda::Device->new($device_name);
+  $dev->set_startup_properties_from_config();
+  if ($dev->read_label() == $READ_LABEL_STATUS_SUCCESS) {
+      print "Label on $device_name is '$dev->volume_label'\n";
+  }
+  
+See L<http://wiki.zmanda.com/index.php/Device_API> for details on how Devices are used.
+
+=head1 API STATUS
+
+Stable
+
+=head1 Amanda::Device Objects
+
+=head2 Instance Variables
+
+=over
+
+=item C<$file>
+
+=item C<$block>
+
+=item C<$in_file>
+
+=item C<$device_name>
+
+=item C<$access_mode>
+
+=item C<$is_eof>
+
+=item C<$volume_label>
+
+=item C<$volume_time>
+
+=back
+
+=head2 Methods
+
+See the wiki for descriptions of these functions
+
+=over
+
+=item C<read_label()>
+
+=item C<start($mode, $label, $timestamp)>
+
+=item C<finish()>
+
+=item C<start_file($jobinfo)>
+
+where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes)
+
+=item C<write_min_size()>
+
+=item C<write_max_size()>
+
+=item C<read_max_size()>
+
+=item C<write_block($size, $data, $short_block)>
+
+Note that Perl code is not expected to handle on-device data, so there
+is currently no way to provide data to this function from Perl.  This may
+change in future revisions.
+
+=item C<write_from_fd($fd)>
+
+where C<$fd> is an integer file descriptor, not a filehandle
+
+=item C<finish_file()>
+
+=item C<seek_file($file)>
+
+=item C<seek_block($block)>
+
+=item C<read_block($size)>
+
+=item C<read_to_fd($fd)>
+
+where C<$fd> is an integer file descriptor, not a filehandle
+
+Note that Perl code is not expected to handle on-device data, so there
+is currently no way to access the data this function returns.  This may
+change in future revisions.
+
+=item C<property_list()>
+
+returns a list of property names.
+
+=item C<property_get($property_name)>
+
+returns the property as the appropriate Perl type.
+
+=item C<property_set($property_name, $value)>
+
+where $value is of an appropriate type for the given property
+
+=item C<recycle_file($filenum)>
+
+=item C<set_startup_properties_from_config()>
+
+=back
+
+=head1 CONSTANTS
+
+This module defines a large number of constants.  Again, consult the
+wiki or C<device.h> for the details on their meaning.  These constants
+are available from the package namespace (e.g.,
+C<Amanda::Device::ACCESS_WRITE>), of imported with the C<:constant>
+import tag.
+
+=cut
+
+push @EXPORT_OK, qw(DeviceAccessMode_to_strings);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw(DeviceAccessMode_to_strings);
+
+my %_DeviceAccessMode_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub DeviceAccessMode_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_DeviceAccessMode_VALUES) {
+       my $v = $_DeviceAccessMode_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($ACCESS_NULL);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_NULL);
+
+$_DeviceAccessMode_VALUES{"NULL"} = $ACCESS_NULL;
+
+push @EXPORT_OK, qw($ACCESS_READ);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_READ);
+
+$_DeviceAccessMode_VALUES{"READ"} = $ACCESS_READ;
+
+push @EXPORT_OK, qw($ACCESS_WRITE);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_WRITE);
+
+$_DeviceAccessMode_VALUES{"WRITE"} = $ACCESS_WRITE;
+
+push @EXPORT_OK, qw($ACCESS_APPEND);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_APPEND);
+
+$_DeviceAccessMode_VALUES{"APPEND"} = $ACCESS_APPEND;
+
+push @EXPORT_OK, qw(IS_WRITABLE_ACCESS_MODE);
+push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw(IS_WRITABLE_ACCESS_MODE);
+
+#copy symbols in DeviceAccessMode to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"DeviceAccessMode"}};
+
+push @EXPORT_OK, qw(ReadLabelStatusFlags_to_strings);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw(ReadLabelStatusFlags_to_strings);
+
+my %_ReadLabelStatusFlags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub ReadLabelStatusFlags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_ReadLabelStatusFlags_VALUES) {
+       my $v = $_ReadLabelStatusFlags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_SUCCESS);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_SUCCESS);
+
+$_ReadLabelStatusFlags_VALUES{"SUCCESS"} = $READ_LABEL_STATUS_SUCCESS;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_DEVICE_MISSING);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_DEVICE_MISSING);
+
+$_ReadLabelStatusFlags_VALUES{"DEVICE_MISSING"} = $READ_LABEL_STATUS_DEVICE_MISSING;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_DEVICE_ERROR);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_DEVICE_ERROR);
+
+$_ReadLabelStatusFlags_VALUES{"DEVICE_ERROR"} = $READ_LABEL_STATUS_DEVICE_ERROR;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_MISSING);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_MISSING);
+
+$_ReadLabelStatusFlags_VALUES{"VOLUME_MISSING"} = $READ_LABEL_STATUS_VOLUME_MISSING;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_UNLABELED);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_UNLABELED);
+
+$_ReadLabelStatusFlags_VALUES{"VOLUME_UNLABELED"} = $READ_LABEL_STATUS_VOLUME_UNLABELED;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_ERROR);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_ERROR);
+
+$_ReadLabelStatusFlags_VALUES{"VOLUME_ERROR"} = $READ_LABEL_STATUS_VOLUME_ERROR;
+
+push @EXPORT_OK, qw($READ_LABEL_STATUS_FLAGS_MAX);
+push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_FLAGS_MAX);
+
+#copy symbols in ReadLabelStatusFlags to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"ReadLabelStatusFlags"}};
+
+push @EXPORT_OK, qw(PropertyPhaseFlags_to_strings);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw(PropertyPhaseFlags_to_strings);
+
+my %_PropertyPhaseFlags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub PropertyPhaseFlags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_PropertyPhaseFlags_VALUES) {
+       my $v = $_PropertyPhaseFlags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_BEFORE_START);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BEFORE_START);
+
+$_PropertyPhaseFlags_VALUES{"BEFORE_START"} = $PROPERTY_PHASE_BEFORE_START;
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_BETWEEN_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BETWEEN_FILE_WRITE);
+
+$_PropertyPhaseFlags_VALUES{"BETWEEN_FILE_WRITE"} = $PROPERTY_PHASE_BETWEEN_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_INSIDE_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_INSIDE_FILE_WRITE);
+
+$_PropertyPhaseFlags_VALUES{"INSIDE_FILE_WRITE"} = $PROPERTY_PHASE_INSIDE_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_BETWEEN_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BETWEEN_FILE_READ);
+
+$_PropertyPhaseFlags_VALUES{"BETWEEN_FILE_READ"} = $PROPERTY_PHASE_BETWEEN_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_INSIDE_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_INSIDE_FILE_READ);
+
+$_PropertyPhaseFlags_VALUES{"INSIDE_FILE_READ"} = $PROPERTY_PHASE_INSIDE_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_MAX);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_MAX);
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_MASK);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_MASK);
+
+push @EXPORT_OK, qw($PROPERTY_PHASE_SHIFT);
+push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_SHIFT);
+
+#copy symbols in PropertyPhaseFlags to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"PropertyPhaseFlags"}};
+
+push @EXPORT_OK, qw(PropertyAccessFlags_to_strings);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw(PropertyAccessFlags_to_strings);
+
+my %_PropertyAccessFlags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub PropertyAccessFlags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_PropertyAccessFlags_VALUES) {
+       my $v = $_PropertyAccessFlags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BEFORE_START);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BEFORE_START);
+
+$_PropertyAccessFlags_VALUES{"GET_BEFORE_START"} = $PROPERTY_ACCESS_GET_BEFORE_START;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE);
+
+$_PropertyAccessFlags_VALUES{"GET_BETWEEN_FILE_WRITE"} = $PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE);
+
+$_PropertyAccessFlags_VALUES{"GET_INSIDE_FILE_WRITE"} = $PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_READ);
+
+$_PropertyAccessFlags_VALUES{"GET_BETWEEN_FILE_READ"} = $PROPERTY_ACCESS_GET_BETWEEN_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_READ);
+
+$_PropertyAccessFlags_VALUES{"GET_INSIDE_FILE_READ"} = $PROPERTY_ACCESS_GET_INSIDE_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BEFORE_START);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BEFORE_START);
+
+$_PropertyAccessFlags_VALUES{"SET_BEFORE_START"} = $PROPERTY_ACCESS_SET_BEFORE_START;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE);
+
+$_PropertyAccessFlags_VALUES{"SET_BETWEEN_FILE_WRITE"} = $PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE);
+
+$_PropertyAccessFlags_VALUES{"SET_INSIDE_FILE_WRITE"} = $PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_READ);
+
+$_PropertyAccessFlags_VALUES{"SET_BETWEEN_FILE_READ"} = $PROPERTY_ACCESS_SET_BETWEEN_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_READ);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_READ);
+
+$_PropertyAccessFlags_VALUES{"SET_INSIDE_FILE_READ"} = $PROPERTY_ACCESS_SET_INSIDE_FILE_READ;
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_MASK);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_MASK);
+
+push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_MASK);
+push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_MASK);
+
+#copy symbols in PropertyAccessFlags to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"PropertyAccessFlags"}};
+
+push @EXPORT_OK, qw(ConcurrencyParadigm_to_string);
+push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw(ConcurrencyParadigm_to_string);
+
+my %_ConcurrencyParadigm_VALUES;
+#Convert an enum value to a single string
+sub ConcurrencyParadigm_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_ConcurrencyParadigm_VALUES) {
+       my $v = $_ConcurrencyParadigm_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_EXCLUSIVE);
+push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_EXCLUSIVE);
+
+$_ConcurrencyParadigm_VALUES{"EXCLUSIVE"} = $CONCURRENCY_PARADIGM_EXCLUSIVE;
+
+push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_SHARED_READ);
+push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_SHARED_READ);
+
+$_ConcurrencyParadigm_VALUES{"SHARED_READ"} = $CONCURRENCY_PARADIGM_SHARED_READ;
+
+push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_RANDOM_ACCESS);
+push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_RANDOM_ACCESS);
+
+$_ConcurrencyParadigm_VALUES{"RANDOM_ACCESS"} = $CONCURRENCY_PARADIGM_RANDOM_ACCESS;
+
+#copy symbols in ConcurrencyParadigm to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"ConcurrencyParadigm"}};
+
+push @EXPORT_OK, qw(StreamingRequirement_to_string);
+push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw(StreamingRequirement_to_string);
+
+my %_StreamingRequirement_VALUES;
+#Convert an enum value to a single string
+sub StreamingRequirement_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_StreamingRequirement_VALUES) {
+       my $v = $_StreamingRequirement_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($STREAMING_REQUIREMENT_NONE);
+push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_NONE);
+
+$_StreamingRequirement_VALUES{"NONE"} = $STREAMING_REQUIREMENT_NONE;
+
+push @EXPORT_OK, qw($STREAMING_REQUIREMENT_DESIRED);
+push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_DESIRED);
+
+$_StreamingRequirement_VALUES{"DESIRED"} = $STREAMING_REQUIREMENT_DESIRED;
+
+push @EXPORT_OK, qw($STREAMING_REQUIREMENT_REQUIRED);
+push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_REQUIRED);
+
+$_StreamingRequirement_VALUES{"REQUIRED"} = $STREAMING_REQUIREMENT_REQUIRED;
+
+#copy symbols in StreamingRequirement to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"StreamingRequirement"}};
+
+push @EXPORT_OK, qw(MediaAccessMode_to_string);
+push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw(MediaAccessMode_to_string);
+
+my %_MediaAccessMode_VALUES;
+#Convert an enum value to a single string
+sub MediaAccessMode_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_MediaAccessMode_VALUES) {
+       my $v = $_MediaAccessMode_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_READ_ONLY);
+push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_READ_ONLY);
+
+$_MediaAccessMode_VALUES{"READ_ONLY"} = $MEDIA_ACCESS_MODE_READ_ONLY;
+
+push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_WORM);
+push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_WORM);
+
+$_MediaAccessMode_VALUES{"WORM"} = $MEDIA_ACCESS_MODE_WORM;
+
+push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_READ_WRITE);
+push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_READ_WRITE);
+
+$_MediaAccessMode_VALUES{"READ_WRITE"} = $MEDIA_ACCESS_MODE_READ_WRITE;
+
+push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_WRITE_ONLY);
+push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_WRITE_ONLY);
+
+$_MediaAccessMode_VALUES{"WRITE_ONLY"} = $MEDIA_ACCESS_MODE_WRITE_ONLY;
+
+#copy symbols in MediaAccessMode to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"MediaAccessMode"}};
+
+push @EXPORT_OK, qw(SizeAccuracy_to_string);
+push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw(SizeAccuracy_to_string);
+
+my %_SizeAccuracy_VALUES;
+#Convert an enum value to a single string
+sub SizeAccuracy_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_SizeAccuracy_VALUES) {
+       my $v = $_SizeAccuracy_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($SIZE_ACCURACY_UNKNOWN);
+push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_UNKNOWN);
+
+$_SizeAccuracy_VALUES{"UNKNOWN"} = $SIZE_ACCURACY_UNKNOWN;
+
+push @EXPORT_OK, qw($SIZE_ACCURACY_ESTIMATE);
+push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_ESTIMATE);
+
+$_SizeAccuracy_VALUES{"ESTIMATE"} = $SIZE_ACCURACY_ESTIMATE;
+
+push @EXPORT_OK, qw($SIZE_ACCURACY_REAL);
+push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_REAL);
+
+$_SizeAccuracy_VALUES{"REAL"} = $SIZE_ACCURACY_REAL;
+
+#copy symbols in SizeAccuracy to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"SizeAccuracy"}};
+
+push @EXPORT_OK, qw(FeatureSupportFlags_to_strings);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw(FeatureSupportFlags_to_strings);
+
+my %_FeatureSupportFlags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub FeatureSupportFlags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_FeatureSupportFlags_VALUES) {
+       my $v = $_FeatureSupportFlags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($FEATURE_STATUS_ENABLED);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_STATUS_ENABLED);
+
+$_FeatureSupportFlags_VALUES{"STATUS_ENABLED"} = $FEATURE_STATUS_ENABLED;
+
+push @EXPORT_OK, qw($FEATURE_STATUS_DISABLED);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_STATUS_DISABLED);
+
+$_FeatureSupportFlags_VALUES{"STATUS_DISABLED"} = $FEATURE_STATUS_DISABLED;
+
+push @EXPORT_OK, qw($FEATURE_SURETY_BAD);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SURETY_BAD);
+
+$_FeatureSupportFlags_VALUES{"SURETY_BAD"} = $FEATURE_SURETY_BAD;
+
+push @EXPORT_OK, qw($FEATURE_SURETY_GOOD);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SURETY_GOOD);
+
+$_FeatureSupportFlags_VALUES{"SURETY_GOOD"} = $FEATURE_SURETY_GOOD;
+
+push @EXPORT_OK, qw($FEATURE_SOURCE_DEFAULT);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_DEFAULT);
+
+$_FeatureSupportFlags_VALUES{"SOURCE_DEFAULT"} = $FEATURE_SOURCE_DEFAULT;
+
+push @EXPORT_OK, qw($FEATURE_SOURCE_DETECTED);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_DETECTED);
+
+$_FeatureSupportFlags_VALUES{"SOURCE_DETECTED"} = $FEATURE_SOURCE_DETECTED;
+
+push @EXPORT_OK, qw($FEATURE_SOURCE_USER);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_USER);
+
+$_FeatureSupportFlags_VALUES{"SOURCE_USER"} = $FEATURE_SOURCE_USER;
+
+push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_MAX);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_MAX);
+
+push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_MASK);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_MASK);
+
+push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_STATUS_MASK);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_STATUS_MASK);
+
+push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_SURETY_MASK);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_SURETY_MASK);
+
+push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_SOURCE_MASK);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_SOURCE_MASK);
+
+push @EXPORT_OK, qw(feature_support_flags_is_valid);
+push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw(feature_support_flags_is_valid);
+
+#copy symbols in FeatureSupportFlags to constants
+push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"FeatureSupportFlags"}};
+
+
+# SWIG produces a sub-package for the Device "class", in this case named 
+# Amanda::Device::Device.  For user convenience, we allow Amanda::Device->new(..) to
+# do the same thing.  This is a wrapper function, and not just a typeglob assignment,
+# because we want to get the right blessing.
+sub new {
+    my $pkg = shift;
+    Amanda::Device::Device->new(@_);
+}
+1;
diff --git a/perl/Amanda/Device.swg b/perl/Amanda/Device.swg
new file mode 100644 (file)
index 0000000..c8e2a51
--- /dev/null
@@ -0,0 +1,671 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Device"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include "device.h"
+#include "property.h"
+#include "fileheader.h"
+%}
+
+/* import dumptype_t, among others */
+%import "Amanda/Types.swg";
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Device - interact with Amanda data-storage devices
+
+=head1 SYNOPSIS
+
+  use Amanda::Device qw( :constants );
+
+  my $dev = Amanda::Device->new($device_name);
+  $dev->set_startup_properties_from_config();
+  if ($dev->read_label() == $READ_LABEL_STATUS_SUCCESS) {
+      print "Label on $device_name is '$dev->volume_label'\n";
+  }
+  
+See L<http://wiki.zmanda.com/index.php/Device_API> for details on how Devices are used.
+
+=head1 API STATUS
+
+Stable
+
+=head1 Amanda::Device Objects
+
+=head2 Instance Variables
+
+=over
+
+=item C<$file>
+
+=item C<$block>
+
+=item C<$in_file>
+
+=item C<$device_name>
+
+=item C<$access_mode>
+
+=item C<$is_eof>
+
+=item C<$volume_label>
+
+=item C<$volume_time>
+
+=back
+
+=head2 Methods
+
+See the wiki for descriptions of these functions
+
+=over
+
+=item C<read_label()>
+
+=item C<start($mode, $label, $timestamp)>
+
+=item C<finish()>
+
+=item C<start_file($jobinfo)>
+
+where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Datatypes)
+
+=item C<write_min_size()>
+
+=item C<write_max_size()>
+
+=item C<read_max_size()>
+
+=item C<write_block($size, $data, $short_block)>
+
+Note that Perl code is not expected to handle on-device data, so there
+is currently no way to provide data to this function from Perl.  This may
+change in future revisions.
+
+=item C<write_from_fd($fd)>
+
+where C<$fd> is an integer file descriptor, not a filehandle
+
+=item C<finish_file()>
+
+=item C<seek_file($file)>
+
+=item C<seek_block($block)>
+
+=item C<read_block($size)>
+
+=item C<read_to_fd($fd)>
+
+where C<$fd> is an integer file descriptor, not a filehandle
+
+Note that Perl code is not expected to handle on-device data, so there
+is currently no way to access the data this function returns.  This may
+change in future revisions.
+
+=item C<property_list()>
+
+returns a list of property names.
+
+=item C<property_get($property_name)>
+
+returns the property as the appropriate Perl type.
+
+=item C<property_set($property_name, $value)>
+
+where $value is of an appropriate type for the given property
+
+=item C<recycle_file($filenum)>
+
+=item C<set_startup_properties_from_config()>
+
+=back
+
+=head1 CONSTANTS
+
+This module defines a large number of constants.  Again, consult the
+wiki or C<device.h> for the details on their meaning.  These constants
+are available from the package namespace (e.g.,
+C<Amanda::Device::ACCESS_WRITE>), of imported with the C<:constant>
+import tag.
+
+=cut
+%}
+
+%init %{
+    /* Initialize the Device API on load */
+    device_api_init();
+%}
+
+%{
+
+/* Utility functions for typemaps, below */
+
+static SV *
+set_sv_from_gvalue(GValue *value)
+{
+    GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
+    SV *sv = NULL;
+
+    /* complex reference types */
+    switch (fundamental) {
+       case G_TYPE_LONG:
+           sv = sv_2mortal(amglue_newSVi64(g_value_get_long(value)));
+           break;
+
+       case G_TYPE_ULONG:
+           sv = sv_2mortal(amglue_newSVu64(g_value_get_ulong(value)));
+           break;
+
+       case G_TYPE_INT64:
+           sv = sv_2mortal(amglue_newSVi64(g_value_get_int64(value)));
+           break;
+
+       case G_TYPE_UINT64:
+           sv = sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
+           break;
+
+       case G_TYPE_BOXED: {
+           GType boxed_type = G_VALUE_TYPE(value);
+           QualifiedSize qs;
+           HV *hv;
+
+           if (boxed_type == QUALIFIED_SIZE_TYPE) {
+               qs = *(QualifiedSize*)(g_value_get_boxed(value));
+               
+               /* build a hash */
+               hv = (HV *)sv_2mortal((SV *)newHV());
+               hv_store(hv, "accuracy", 8, newSViv(qs.accuracy), 0);
+               hv_store(hv, "bytes", 5, amglue_newSVi64(qs.bytes), 0);
+
+               sv = newRV((SV *)hv);
+               return newRV((SV *)hv);
+           } else {
+               warn("Unsupported boxed property type #%d", boxed_type);
+
+               sv = sv_newmortal();
+               sv_setsv(sv, &PL_sv_undef);
+               return sv;
+           }
+       }
+    }
+
+    /* simple types that can be constructed with sv_set*v */
+    sv = sv_newmortal();
+    switch (fundamental) {
+       case G_TYPE_CHAR:
+           sv_setiv(sv, g_value_get_char(value));
+           break;
+
+       case G_TYPE_UCHAR:
+           sv_setuv(sv, g_value_get_uchar(value));
+           break;
+
+       case G_TYPE_BOOLEAN:
+           sv_setiv(sv, g_value_get_boolean(value));
+           break;
+
+       case G_TYPE_INT:
+           sv_setiv(sv, g_value_get_int(value));
+           break;
+
+       case G_TYPE_UINT:
+           sv_setuv(sv, g_value_get_uint(value));
+           break;
+
+       case G_TYPE_FLOAT:
+           sv_setnv(sv, g_value_get_float(value));
+           break;
+
+       case G_TYPE_DOUBLE:
+           sv_setnv(sv, g_value_get_double(value));
+           break;
+
+       case G_TYPE_STRING:
+           sv_setpv(sv, g_value_get_string(value));
+           break;
+
+       case G_TYPE_ENUM:
+           sv_setiv(sv, g_value_get_enum(value));
+           break;
+
+       case G_TYPE_FLAGS:
+           sv_setiv(sv, g_value_get_flags(value));
+           break;
+
+       /* Unsupported */
+       default:
+       case G_TYPE_POINTER:
+       case G_TYPE_INTERFACE:
+       case G_TYPE_OBJECT:
+       case G_TYPE_PARAM:
+           warn("Unsupported fundamental property type #%d", fundamental);
+           sv_setsv(sv, &PL_sv_undef);
+           break;
+    }
+
+    return sv;
+}
+
+static gboolean
+set_gvalue_from_sv(SV *sv, GValue *value)
+{
+    GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
+    switch (fundamental) {
+       case G_TYPE_CHAR:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_char(value, SvIV(sv));
+           break;
+
+       case G_TYPE_UCHAR:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_uchar(value, SvUV(sv));
+           break;
+
+       case G_TYPE_BOOLEAN:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_boolean(value, SvIV(sv));
+           break;
+
+       case G_TYPE_INT:
+           g_value_set_int(value, amglue_SvI32(sv));
+           break;
+
+       case G_TYPE_UINT:
+           g_value_set_uint(value, amglue_SvU32(sv));
+           break;
+
+       case G_TYPE_LONG:
+           g_value_set_int64(value, amglue_SvI64(sv));
+           break;
+
+       case G_TYPE_ULONG:
+           g_value_set_uint64(value, amglue_SvU64(sv));
+           break;
+
+       case G_TYPE_INT64:
+           g_value_set_int64(value, amglue_SvI64(sv));
+           break;
+
+       case G_TYPE_UINT64:
+           g_value_set_uint64(value, amglue_SvU64(sv));
+           break;
+
+       case G_TYPE_FLOAT:
+           if (!SvNOK(sv)) return FALSE;
+           g_value_set_float(value, SvNV(sv));
+           break;
+
+       case G_TYPE_DOUBLE:
+           if (!SvNOK(sv)) return FALSE;
+           g_value_set_double(value, SvNV(sv));
+           break;
+
+       case G_TYPE_STRING:
+           if (!SvPOK(sv)) return FALSE;
+           g_value_set_string(value, SvPV_nolen(sv));
+           break;
+
+       case G_TYPE_ENUM: 
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_enum(value, SvIV(sv));
+           break;
+
+       case G_TYPE_FLAGS:
+           if (!SvIOK(sv)) return FALSE;
+           g_value_set_flags(value, SvIV(sv));
+           break;
+
+       /* Unsupported */
+       default:
+       case G_TYPE_POINTER:
+       case G_TYPE_INTERFACE:
+       case G_TYPE_BOXED: /* note: *getting* boxed values is supported */
+       case G_TYPE_OBJECT:
+       case G_TYPE_PARAM:
+           return FALSE;
+    }
+
+    return TRUE;
+}
+
+%}
+
+/*
+ * Device struct, %extend-ed into a Perl class
+ */
+
+typedef struct Device {
+    /* Instance variables -- all readonly */
+    %immutable;
+    int file;
+    guint64 block;
+    gboolean in_file;
+    char * device_name;
+    DeviceAccessMode access_mode;
+    gboolean is_eof;
+    char * volume_label;
+    char * volume_time;
+    %mutable;
+
+    /* methods */
+    %extend {
+       /* constructor */
+       Device(char *device_name) {
+           return device_open(device_name);
+       }
+
+       ~Device() {
+           g_object_unref(self);
+       }
+
+       ReadLabelStatusFlags
+       read_label() {
+           return device_read_label(self);
+       }
+
+       gboolean
+       start(DeviceAccessMode mode, char *label, char *timestamp) {
+           return device_start(self, mode, label, timestamp);
+       }
+
+       gboolean
+       finish() {
+           return device_finish(self);
+       }
+
+       gboolean
+       start_file(const dumpfile_t *jobInfo) {
+           return device_start_file(self, jobInfo);
+       }
+
+       guint
+       write_min_size() {
+           return device_write_min_size(self);
+       }
+
+       guint
+       write_max_size() {
+           return device_write_max_size(self);
+       }
+
+       guint
+       read_max_size() {
+           return device_read_max_size(self);
+       }
+
+       gboolean
+       write_block(guint size, gpointer data, gboolean short_block) {
+           return device_write_block(self, size, data, short_block);
+       }
+
+       gboolean
+       write_from_fd(int fd) {
+           return device_write_from_fd(self, fd);
+       }
+
+       gboolean
+       finish_file() {
+           return device_finish_file(self);
+       }
+
+       dumpfile_t*
+       seek_file(guint file) {
+           return device_seek_file(self, file);
+       }
+
+       gboolean
+       seek_block(guint64 block) {
+           return device_seek_block(self, block);
+       }
+
+       int
+       read_block(gpointer buffer, int *size) {
+           return device_read_block(self, buffer, size);
+       }
+
+       gboolean read_to_fd(int fd) {
+           return device_read_to_fd(self, fd);
+       }
+
+       %typemap(out) const DeviceProperty * {
+           int i = 0;
+           int len = 0;
+
+           /* Count the DeviceProperties */
+           while ($1[len].base) len++;
+           EXTEND(SP, len); /* make room for return values */
+
+           /* Note that we set $result several times. the nature of
+            * SWIG's wrapping is such that incrementing argvi points
+            * $result to the next location in perl's argument stack.
+             */
+
+           for (i = 0; i < len ; i++) { 
+               $result = sv_newmortal(); 
+               sv_setpv($result, $1[i].base->name); 
+               argvi++;
+           }; 
+       }
+       const DeviceProperty * property_list(void) {
+           return device_property_get_list(self);
+       }
+
+       %typemap(out) const DeviceProperty *; /* remove typemap */
+
+       /* A typemap to convert a property name to a DevicePropertyBase. */
+       %typemap(in) DevicePropertyBase * {
+           char *pname = NULL;
+
+           if (SvPOK($input))
+               pname = SvPV_nolen($input);
+
+           if (pname) $1 = (DevicePropertyBase *)device_property_get_by_name(pname);
+           if (!pname || !$1) {
+               SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
+           }
+       }
+
+       /* A typemap to convert the GValue in property_get to a return value.  The
+        * (in) typemap sets up storage for the parameters, while the (argout) converts
+        * them to a perl SV. */
+       %typemap(in,numinputs=0) (GValue *out_val, gboolean *val_found)
+                           (GValue val, gboolean found) {
+           memset(&val, 0, sizeof(val));
+           $1 = &val;
+           $2 = &found;
+       }
+       %typemap(argout) (GValue *out_val, gboolean *val_found) {
+           /* if the result is valid */
+           if (*$2) {
+               /* move data from $1 to $result, somehow */
+               $result = set_sv_from_gvalue($1);
+
+               /* free any memory for the GValue */
+               g_value_unset($1);
+           } else {
+               /* silently return 'undef', the sentinel for "undefined" */
+               $result = sv_newmortal();
+               sv_setsv($result, &PL_sv_undef);
+           }
+           argvi++;
+       }
+
+       void
+       property_get(DevicePropertyBase *pbase, GValue *out_val, gboolean *val_found) {
+           *val_found = device_property_get(self, pbase->ID, out_val);
+       }
+
+       /* delete typemaps */
+       %typemap(in) (GValue *out_val, gboolean *val_found);
+       %typemap(argout) (GValue *out_val, gboolean *val_found);
+
+       /* We cheat a little bit here and just pass the native Perl type in to
+        * the function.  This is the easiest way to make sure we know the property
+        * information (in particular, its type) before trying to convert the SV.  */
+       %typemap(in) SV *sv "$1 = $input;"
+
+       gboolean
+       property_set(DevicePropertyBase *pbase, SV *sv) {
+           GValue gval;
+           memset(&gval, 0, sizeof(gval));
+           g_value_init(&gval, pbase->type);
+           if (!set_gvalue_from_sv(sv, &gval))
+               goto fail;
+
+           if (!device_property_set(self, pbase->ID, &gval))
+               goto fail;
+
+           g_value_unset(&gval);
+           return TRUE;
+       fail:
+           g_value_unset(&gval);
+           return FALSE;
+       }
+
+       gboolean recycle_file(guint filenum) {
+           return device_recycle_file(self, filenum);
+       }
+       
+       void set_startup_properties_from_config(void) {
+           device_set_startup_properties_from_config(self);
+       }
+    };
+} Device;
+
+/*
+ * Constants
+ */
+
+amglue_add_flag_tag_fns(DeviceAccessMode);
+amglue_add_constant_short(ACCESS_NULL, "NULL", DeviceAccessMode);
+amglue_add_constant_short(ACCESS_READ, "READ", DeviceAccessMode);
+amglue_add_constant_short(ACCESS_WRITE, "WRITE", DeviceAccessMode);
+amglue_add_constant_short(ACCESS_APPEND, "APPEND", DeviceAccessMode);
+
+/* (this is really a macro, but SWIG will Do The Right Thing */
+gboolean IS_WRITABLE_ACCESS_MODE(DeviceAccessMode mode);
+amglue_export_tag(DeviceAccessMode, IS_WRITABLE_ACCESS_MODE);
+amglue_copy_to_tag(DeviceAccessMode, constants);
+
+amglue_add_flag_tag_fns(ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_SUCCESS, "SUCCESS", ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_DEVICE_MISSING, "DEVICE_MISSING", ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_DEVICE_ERROR, "DEVICE_ERROR", ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_MISSING, "VOLUME_MISSING", ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_UNLABELED, "VOLUME_UNLABELED", ReadLabelStatusFlags);
+amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_ERROR, "VOLUME_ERROR", ReadLabelStatusFlags);
+amglue_add_constant_noshort(READ_LABEL_STATUS_FLAGS_MAX, ReadLabelStatusFlags);
+amglue_copy_to_tag(ReadLabelStatusFlags, constants);
+
+amglue_add_flag_tag_fns(PropertyPhaseFlags);
+amglue_add_constant_short(PROPERTY_PHASE_BEFORE_START, "BEFORE_START", PropertyPhaseFlags);
+amglue_add_constant_short(PROPERTY_PHASE_BETWEEN_FILE_WRITE, "BETWEEN_FILE_WRITE", PropertyPhaseFlags);
+amglue_add_constant_short(PROPERTY_PHASE_INSIDE_FILE_WRITE, "INSIDE_FILE_WRITE", PropertyPhaseFlags);
+amglue_add_constant_short(PROPERTY_PHASE_BETWEEN_FILE_READ, "BETWEEN_FILE_READ", PropertyPhaseFlags);
+amglue_add_constant_short(PROPERTY_PHASE_INSIDE_FILE_READ, "INSIDE_FILE_READ", PropertyPhaseFlags);
+amglue_add_constant_noshort(PROPERTY_PHASE_MAX, PropertyPhaseFlags);
+amglue_add_constant_noshort(PROPERTY_PHASE_MASK, PropertyPhaseFlags);
+amglue_add_constant_noshort(PROPERTY_PHASE_SHIFT, PropertyPhaseFlags);
+amglue_copy_to_tag(PropertyPhaseFlags, constants);
+
+amglue_add_flag_tag_fns(PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_GET_BEFORE_START, 
+                   "GET_BEFORE_START", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE, 
+                   "GET_BETWEEN_FILE_WRITE", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE, 
+                   "GET_INSIDE_FILE_WRITE", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_GET_BETWEEN_FILE_READ, 
+                   "GET_BETWEEN_FILE_READ", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_GET_INSIDE_FILE_READ, 
+                   "GET_INSIDE_FILE_READ", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_SET_BEFORE_START, 
+                   "SET_BEFORE_START", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE, 
+                   "SET_BETWEEN_FILE_WRITE", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE, 
+                   "SET_INSIDE_FILE_WRITE", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_SET_BETWEEN_FILE_READ, 
+                   "SET_BETWEEN_FILE_READ", PropertyAccessFlags);
+amglue_add_constant_short(PROPERTY_ACCESS_SET_INSIDE_FILE_READ, 
+                   "SET_INSIDE_FILE_READ", PropertyAccessFlags);
+amglue_add_constant_noshort(PROPERTY_ACCESS_GET_MASK, PropertyAccessFlags);
+amglue_add_constant_noshort(PROPERTY_ACCESS_SET_MASK, PropertyAccessFlags);
+amglue_copy_to_tag(PropertyAccessFlags, constants);
+
+amglue_add_enum_tag_fns(ConcurrencyParadigm);
+amglue_add_constant_short(CONCURRENCY_PARADIGM_EXCLUSIVE, "EXCLUSIVE", ConcurrencyParadigm);
+amglue_add_constant_short(CONCURRENCY_PARADIGM_SHARED_READ, "SHARED_READ", ConcurrencyParadigm);
+amglue_add_constant_short(CONCURRENCY_PARADIGM_RANDOM_ACCESS, "RANDOM_ACCESS", ConcurrencyParadigm);
+amglue_copy_to_tag(ConcurrencyParadigm, constants);
+
+amglue_add_enum_tag_fns(StreamingRequirement);
+amglue_add_constant_short(STREAMING_REQUIREMENT_NONE, "NONE", StreamingRequirement);
+amglue_add_constant_short(STREAMING_REQUIREMENT_DESIRED, "DESIRED", StreamingRequirement);
+amglue_add_constant_short(STREAMING_REQUIREMENT_REQUIRED, "REQUIRED", StreamingRequirement);
+amglue_copy_to_tag(StreamingRequirement, constants);
+
+amglue_add_enum_tag_fns(MediaAccessMode);
+amglue_add_constant_short(MEDIA_ACCESS_MODE_READ_ONLY, "READ_ONLY", MediaAccessMode);
+amglue_add_constant_short(MEDIA_ACCESS_MODE_WORM, "WORM", MediaAccessMode);
+amglue_add_constant_short(MEDIA_ACCESS_MODE_READ_WRITE, "READ_WRITE", MediaAccessMode);
+amglue_add_constant_short(MEDIA_ACCESS_MODE_WRITE_ONLY, "WRITE_ONLY", MediaAccessMode);
+amglue_copy_to_tag(MediaAccessMode, constants);
+
+amglue_add_enum_tag_fns(SizeAccuracy);
+amglue_add_constant_short(SIZE_ACCURACY_UNKNOWN, "UNKNOWN", SizeAccuracy);
+amglue_add_constant_short(SIZE_ACCURACY_ESTIMATE, "ESTIMATE", SizeAccuracy);
+amglue_add_constant_short(SIZE_ACCURACY_REAL, "REAL", SizeAccuracy);
+amglue_copy_to_tag(SizeAccuracy, constants);
+
+amglue_add_flag_tag_fns(FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_STATUS_ENABLED, "STATUS_ENABLED", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_STATUS_DISABLED, "STATUS_DISABLED", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_SURETY_BAD, "SURETY_BAD", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_SURETY_GOOD, "SURETY_GOOD", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_SOURCE_DEFAULT, "SOURCE_DEFAULT", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_SOURCE_DETECTED, "SOURCE_DETECTED", FeatureSupportFlags);
+amglue_add_constant_short(FEATURE_SOURCE_USER, "SOURCE_USER", FeatureSupportFlags);
+amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_MAX, FeatureSupportFlags);
+amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_MASK, FeatureSupportFlags);
+amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_STATUS_MASK, FeatureSupportFlags);
+amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_SURETY_MASK, FeatureSupportFlags);
+amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_SOURCE_MASK, FeatureSupportFlags);
+
+gboolean feature_support_flags_is_valid(FeatureSupportFlags);
+amglue_export_tag(FeatureSupportFlags, feature_support_flags_is_valid);
+amglue_copy_to_tag(FeatureSupportFlags, constants);
+
+%perlcode %{
+
+# SWIG produces a sub-package for the Device "class", in this case named 
+# Amanda::Device::Device.  For user convenience, we allow Amanda::Device->new(..) to
+# do the same thing.  This is a wrapper function, and not just a typeglob assignment,
+# because we want to get the right blessing.
+sub new {
+    my $pkg = shift;
+    Amanda::Device::Device->new(@_);
+}
+%}
diff --git a/perl/Amanda/Logfile.c b/perl/Amanda/Logfile.c
new file mode 100644 (file)
index 0000000..7f9743a
--- /dev/null
@@ -0,0 +1,2902 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_FILE swig_types[0]
+#define SWIGTYPE_p_char swig_types[1]
+#define SWIGTYPE_p_double swig_types[2]
+#define SWIGTYPE_p_find_result_t swig_types[3]
+#define SWIGTYPE_p_float swig_types[4]
+#define SWIGTYPE_p_int swig_types[5]
+#define SWIGTYPE_p_unsigned_char swig_types[6]
+static swig_type_info *swig_types[8];
+static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Logfile
+
+#define SWIG_name   "Amanda::Logfilec::boot_Amanda__Logfile"
+#define SWIG_prefix "Amanda::Logfilec::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include <glib.h>
+#include "logfile.h"
+#include "find.h"
+#include "diskfile.h" /* for the gross hack, below */
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+/* open_ and close_logfile are both simple wrappers around fopen/fclose. */
+typedef FILE loghandle;
+
+loghandle *open_logfile(char *filename) {
+    return fopen(filename, "r");
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+void close_logfile(loghandle *logfile) {
+    if (logfile) fclose(logfile);
+}
+
+
+typedef int LOGLINE_RETURN;
+
+SWIGINTERN void delete_find_result_t(find_result_t *self){
+           find_result_t *selfp = self;
+           free_find_result(&selfp);
+       }
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+find_result_t *search_logfile_wrap(char *label, char *datestamp, 
+                                  char *logfile, int add_missing_disks) {
+    find_result_t *rv = NULL;
+
+    /* We use a static variable to collect any unrecognized disks */
+    static disklist_t unrecognized_disks = { NULL, NULL };
+
+    search_logfile(&rv, label, datestamp, logfile, 
+       add_missing_disks? &unrecognized_disks : NULL);
+
+    return rv;
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Logfile_var::
+class _wrap_Amanda::Logfile_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_open_logfile) {
+  {
+    char *arg1 = (char *) 0 ;
+    loghandle *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: open_logfile(filename);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_logfile" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (loghandle *)open_logfile(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FILE, 0 | 0); argvi++ ;
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_close_logfile) {
+  {
+    loghandle *arg1 = (loghandle *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: close_logfile(logfile);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_FILE, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "close_logfile" "', argument " "1"" of type '" "loghandle *""'"); 
+    }
+    arg1 = (loghandle *)(argp1);
+    close_logfile(arg1);
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_logline) {
+  {
+    FILE *arg1 = (FILE *) 0 ;
+    LOGLINE_RETURN result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: get_logline(logfile);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_FILE, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_logline" "', argument " "1"" of type '" "FILE *""'"); 
+    }
+    arg1 = (FILE *)(argp1);
+    result = get_logline(arg1);
+    {
+      if (result != 0) {
+        EXTEND(SP, 3);
+        ST(argvi) = sv_2mortal(newSViv(curlog));
+        argvi++;
+        ST(argvi) = sv_2mortal(newSViv(curprog));
+        argvi++;
+        ST(argvi) = sv_2mortal(newSVpv(curstr, 0));
+        argvi++;
+      }
+      /* otherwise (end of logfile) return an empty list */
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_find_result_t) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_find_result_t(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_find_result_t" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    delete_find_result_t(arg1);
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_timestamp_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_timestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_timestamp_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->timestamp);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_hostname_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_hostname_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_hostname_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->hostname);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_diskname_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_diskname_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_diskname_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->diskname);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_level_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_level_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_level_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (int) ((arg1)->level);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_label_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_label_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_label_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->label);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_filenum_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    off_t result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_filenum_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_filenum_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result =  ((arg1)->filenum);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_status_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_status_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_status_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->status);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_result_t_partnum_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_partnum_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_partnum_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result = (char *) ((arg1)->partnum);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_find_result_t) {
+  {
+    find_result_t *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: new_find_result_t();");
+    }
+    result = (find_result_t *)(find_result_t *) calloc(1, sizeof(find_result_t));
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_find_log) {
+  {
+    char **result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: find_log();");
+    }
+    result = (char **)find_log();
+    {
+      char **iter;
+      int len, i;
+      
+      /* measure the length of the array and make sure perl has enough room */
+      for (len=0, iter=result; *iter; iter++) len++;
+      EXTEND(SP, len);
+      
+      /* now copy it to the perl stack */
+      for (i=0, iter=result; *iter; iter++, i++) {
+        ST(argvi) = sv_2mortal(newSVpv(*iter, 0));
+        argvi++;
+      }
+    }
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_search_logfile) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    int arg4 ;
+    find_result_t *result = 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 4) || (items > 4)) {
+      SWIG_croak("Usage: search_logfile(label,datestamp,logfile,add_missing_disks);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "search_logfile" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "search_logfile" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "search_logfile" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    {
+      if (sizeof(signed int) == 1) {
+        arg4 = amglue_SvI8(ST(3));
+      } else if (sizeof(signed int) == 2) {
+        arg4 = amglue_SvI16(ST(3));
+      } else if (sizeof(signed int) == 4) {
+        arg4 = amglue_SvI32(ST(3));
+      } else if (sizeof(signed int) == 8) {
+        arg4 = amglue_SvI64(ST(3));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (find_result_t *)search_logfile_wrap(arg1,arg2,arg3,arg4);
+    {
+      find_result_t *iter;
+      int len;
+      
+      /* measure the list and make room on the perl stack */
+      for (len=0, iter=result; iter; iter=iter->next) len++;
+      EXTEND(SP, len);
+      
+      iter = result;
+      while (iter) {
+        find_result_t *next;
+        /* Let SWIG take ownership of the object */
+        ST(argvi) = SWIG_NewPointerObj(iter, SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW);
+        argvi++;
+        
+        /* null out the 'next' field */
+        next = iter->next;
+        iter->next = NULL;
+        iter = next;
+      }
+    }
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumps_match) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    char *arg2 = (char *) 0 ;
+    char *arg3 = (char *) 0 ;
+    char *arg4 = (char *) 0 ;
+    char *arg5 = (char *) 0 ;
+    int arg6 ;
+    find_result_t *result = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int res3 ;
+    char *buf3 = 0 ;
+    int alloc3 = 0 ;
+    int res4 ;
+    char *buf4 = 0 ;
+    int alloc4 = 0 ;
+    int res5 ;
+    char *buf5 = 0 ;
+    int alloc5 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 6) || (items > 6)) {
+      SWIG_croak("Usage: dumps_match(output_find,hostname,diskname,datestamp,level,ok);");
+    }
+    {
+      AV *av;
+      I32 len, i;
+      find_result_t *head = NULL, *tail = NULL;
+      
+      if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) {
+        SWIG_exception(SWIG_TypeError, "expected an arrayref of find_result_t's");
+      }
+      
+      av = (AV *)SvRV(ST(0));
+      len = av_len(av) + 1;
+      
+      for (i = 0; i < len; i++) {
+        SV **val = av_fetch(av, i, 0);
+        find_result_t *r;
+        
+        if (!val || SWIG_ConvertPtr(*val, (void **)&r, SWIGTYPE_p_find_result_t, 0) == -1) {
+          SWIG_exception(SWIG_TypeError, "array member is not a find_result_t");
+        }
+        
+        if (!head) {
+          head = tail = r;
+        } else {
+          tail->next = r;
+          tail = r;
+        }
+        
+        tail->next = NULL;
+      }
+      
+      /* point to the head of that list */
+      arg1 = head;
+    }
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumps_match" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "dumps_match" "', argument " "3"" of type '" "char *""'");
+    }
+    arg3 = (char *)(buf3);
+    res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "dumps_match" "', argument " "4"" of type '" "char *""'");
+    }
+    arg4 = (char *)(buf4);
+    res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
+    if (!SWIG_IsOK(res5)) {
+      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "dumps_match" "', argument " "5"" of type '" "char *""'");
+    }
+    arg5 = (char *)(buf5);
+    {
+      if (sizeof(signed int) == 1) {
+        arg6 = amglue_SvI8(ST(5));
+      } else if (sizeof(signed int) == 2) {
+        arg6 = amglue_SvI16(ST(5));
+      } else if (sizeof(signed int) == 4) {
+        arg6 = amglue_SvI32(ST(5));
+      } else if (sizeof(signed int) == 8) {
+        arg6 = amglue_SvI64(ST(5));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    result = (find_result_t *)dumps_match(arg1,arg2,arg3,arg4,arg5,arg6);
+    {
+      find_result_t *iter;
+      int len;
+      
+      /* measure the list and make room on the perl stack */
+      for (len=0, iter=result; iter; iter=iter->next) len++;
+      EXTEND(SP, len);
+      
+      iter = result;
+      while (iter) {
+        find_result_t *next;
+        /* Let SWIG take ownership of the object */
+        ST(argvi) = SWIG_NewPointerObj(iter, SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW);
+        argvi++;
+        
+        /* null out the 'next' field */
+        next = iter->next;
+        iter->next = NULL;
+        iter = next;
+      }
+    }
+    {
+      find_result_t *iter = arg1, *next;
+      
+      /* undo all the links we added earlier */
+      while (iter) {
+        next = iter->next;
+        iter->next = NULL;
+        iter = next;
+      }
+    }
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+    
+    XSRETURN(argvi);
+  fail:
+    {
+      find_result_t *iter = arg1, *next;
+      
+      /* undo all the links we added earlier */
+      while (iter) {
+        next = iter->next;
+        iter->next = NULL;
+        iter = next;
+      }
+    }
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+    if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+    
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *|loghandle *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_find_result_t = {"_p_find_result_t", "find_result_t *", 0, 0, (void*)"Amanda::Logfile::find_result_t", 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|logtype_t *|program_t *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_FILE,
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_find_result_t,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_FILE[] = {  {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_find_result_t[] = {  {&_swigt__p_find_result_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_FILE,
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_find_result_t,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Logfilec::open_logfile", _wrap_open_logfile},
+{"Amanda::Logfilec::close_logfile", _wrap_close_logfile},
+{"Amanda::Logfilec::get_logline", _wrap_get_logline},
+{"Amanda::Logfilec::delete_find_result_t", _wrap_delete_find_result_t},
+{"Amanda::Logfilec::find_result_t_timestamp_get", _wrap_find_result_t_timestamp_get},
+{"Amanda::Logfilec::find_result_t_hostname_get", _wrap_find_result_t_hostname_get},
+{"Amanda::Logfilec::find_result_t_diskname_get", _wrap_find_result_t_diskname_get},
+{"Amanda::Logfilec::find_result_t_level_get", _wrap_find_result_t_level_get},
+{"Amanda::Logfilec::find_result_t_label_get", _wrap_find_result_t_label_get},
+{"Amanda::Logfilec::find_result_t_filenum_get", _wrap_find_result_t_filenum_get},
+{"Amanda::Logfilec::find_result_t_status_get", _wrap_find_result_t_status_get},
+{"Amanda::Logfilec::find_result_t_partnum_get", _wrap_find_result_t_partnum_get},
+{"Amanda::Logfilec::new_find_result_t", _wrap_new_find_result_t},
+{"Amanda::Logfilec::find_log", _wrap_find_log},
+{"Amanda::Logfilec::search_logfile", _wrap_search_logfile},
+{"Amanda::Logfilec::dumps_match", _wrap_dumps_match},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_BOGUS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_BOGUS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_FATAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_FATAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_ERROR", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_ERROR)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_WARNING", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_WARNING)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_INFO", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_INFO)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_SUMMARY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_SUMMARY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_START", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_START)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_FINISH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_FINISH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_DISK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_DISK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_DONE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_DONE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_PART", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_PART)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_PARTPARTIAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_PARTPARTIAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_SUCCESS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_SUCCESS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_PARTIAL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_PARTIAL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_FAIL", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_FAIL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_STRANGE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_STRANGE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_CHUNK", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_CHUNK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_CHUNKSUCCESS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_CHUNKSUCCESS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_STATS", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_STATS)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_MARKER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_MARKER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "L_CONT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(L_CONT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_UNKNOWN", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_UNKNOWN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_PLANNER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_PLANNER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_DRIVER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_DRIVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_REPORTER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_REPORTER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_DUMPER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_DUMPER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_CHUNKER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_CHUNKER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_TAPER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_TAPER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "P_AMFLUSH", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(P_AMFLUSH)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  SWIG_TypeClientData(SWIGTYPE_p_find_result_t, (void*) "Amanda::Logfile::find_result_t");
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Logfile.pm b/perl/Amanda/Logfile.pm
new file mode 100644 (file)
index 0000000..8f03f24
--- /dev/null
@@ -0,0 +1,461 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Logfile;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Logfilec;
+bootstrap Amanda::Logfile;
+package Amanda::Logfile;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Logfile;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Logfile;
+
+*open_logfile = *Amanda::Logfilec::open_logfile;
+*close_logfile = *Amanda::Logfilec::close_logfile;
+*get_logline = *Amanda::Logfilec::get_logline;
+*find_log = *Amanda::Logfilec::find_log;
+*search_logfile = *Amanda::Logfilec::search_logfile;
+*dumps_match = *Amanda::Logfilec::dumps_match;
+
+############# Class : Amanda::Logfile::find_result_t ##############
+
+package Amanda::Logfile::find_result_t;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( Amanda::Logfile );
+%OWNER = ();
+%ITERATORS = ();
+sub DESTROY {
+    return unless $_[0]->isa('HASH');
+    my $self = tied(%{$_[0]});
+    return unless defined $self;
+    delete $ITERATORS{$self};
+    if (exists $OWNER{$self}) {
+        Amanda::Logfilec::delete_find_result_t($self);
+        delete $OWNER{$self};
+    }
+}
+
+*swig_timestamp_get = *Amanda::Logfilec::find_result_t_timestamp_get;
+*swig_timestamp_set = *Amanda::Logfilec::find_result_t_timestamp_set;
+*swig_hostname_get = *Amanda::Logfilec::find_result_t_hostname_get;
+*swig_hostname_set = *Amanda::Logfilec::find_result_t_hostname_set;
+*swig_diskname_get = *Amanda::Logfilec::find_result_t_diskname_get;
+*swig_diskname_set = *Amanda::Logfilec::find_result_t_diskname_set;
+*swig_level_get = *Amanda::Logfilec::find_result_t_level_get;
+*swig_level_set = *Amanda::Logfilec::find_result_t_level_set;
+*swig_label_get = *Amanda::Logfilec::find_result_t_label_get;
+*swig_label_set = *Amanda::Logfilec::find_result_t_label_set;
+*swig_filenum_get = *Amanda::Logfilec::find_result_t_filenum_get;
+*swig_filenum_set = *Amanda::Logfilec::find_result_t_filenum_set;
+*swig_status_get = *Amanda::Logfilec::find_result_t_status_get;
+*swig_status_set = *Amanda::Logfilec::find_result_t_status_set;
+*swig_partnum_get = *Amanda::Logfilec::find_result_t_partnum_get;
+*swig_partnum_set = *Amanda::Logfilec::find_result_t_partnum_set;
+sub new {
+    my $pkg = shift;
+    my $self = Amanda::Logfilec::new_find_result_t(@_);
+    bless $self, $pkg if defined($self);
+}
+
+sub DISOWN {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    $OWNER{$ptr} = 1;
+}
+
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Logfile;
+
+*L_BOGUS = *Amanda::Logfilec::L_BOGUS;
+*L_FATAL = *Amanda::Logfilec::L_FATAL;
+*L_ERROR = *Amanda::Logfilec::L_ERROR;
+*L_WARNING = *Amanda::Logfilec::L_WARNING;
+*L_INFO = *Amanda::Logfilec::L_INFO;
+*L_SUMMARY = *Amanda::Logfilec::L_SUMMARY;
+*L_START = *Amanda::Logfilec::L_START;
+*L_FINISH = *Amanda::Logfilec::L_FINISH;
+*L_DISK = *Amanda::Logfilec::L_DISK;
+*L_DONE = *Amanda::Logfilec::L_DONE;
+*L_PART = *Amanda::Logfilec::L_PART;
+*L_PARTPARTIAL = *Amanda::Logfilec::L_PARTPARTIAL;
+*L_SUCCESS = *Amanda::Logfilec::L_SUCCESS;
+*L_PARTIAL = *Amanda::Logfilec::L_PARTIAL;
+*L_FAIL = *Amanda::Logfilec::L_FAIL;
+*L_STRANGE = *Amanda::Logfilec::L_STRANGE;
+*L_CHUNK = *Amanda::Logfilec::L_CHUNK;
+*L_CHUNKSUCCESS = *Amanda::Logfilec::L_CHUNKSUCCESS;
+*L_STATS = *Amanda::Logfilec::L_STATS;
+*L_MARKER = *Amanda::Logfilec::L_MARKER;
+*L_CONT = *Amanda::Logfilec::L_CONT;
+*P_UNKNOWN = *Amanda::Logfilec::P_UNKNOWN;
+*P_PLANNER = *Amanda::Logfilec::P_PLANNER;
+*P_DRIVER = *Amanda::Logfilec::P_DRIVER;
+*P_REPORTER = *Amanda::Logfilec::P_REPORTER;
+*P_DUMPER = *Amanda::Logfilec::P_DUMPER;
+*P_CHUNKER = *Amanda::Logfilec::P_CHUNKER;
+*P_TAPER = *Amanda::Logfilec::P_TAPER;
+*P_AMFLUSH = *Amanda::Logfilec::P_AMFLUSH;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Logfile - manage Amanda trace logs
+
+=head1 SYNOPSIS
+
+  use Amanda::Logfile qw(:logtype_t); # XXX change
+  use Amanda::Config qw( :getconf config_dir_relative );
+
+  for my $logfile (Amanda::Logfile::find_log()) {
+    $logfile = config_dir_relative(getconf($CNF_LOGDIR)) . "/" . $logfile;
+
+    my $hdl = Amanda::Logfile::open_logfile($logfile);
+    while (my ($type, $prog, $str) = Amanda::Logfile::get_logline($hdl)) {
+      if ($type == $L_INFO) {
+        my $pname = Amanda::Logfile::program_t_to_string($prog);
+        print "Found info line from $pname: $str\n";
+      }
+    }
+    Amanda::Logfile::close_logfile($log);
+
+    my @dumps = Amanda::Logfile::search_logfile("TapeLabel-001", "19780615", $logfile);
+
+    my @matching = Amanda::Logfile::dumps_match([@dumps], "myhost", "/usr", undef, undef, 0);
+    for my $dump (@matching) {
+      print "$dump->{'label'}:$dump->{'filenum'} = $dump->{'hostname'}:$dump->{'disk'}\n";
+    }
+  }
+
+=head1 API STATUS
+
+Stabilizing
+
+=head1 RAW LOGFILE ACCESS
+
+This section corresponds to the C C<logfile> module. 
+
+Raw access to logfiles is accomplished by opening a logfile and
+fetching log lines one by one via the C<get_logline> function.
+
+A log line is represented by a list C<($type, $prog, $string)>
+where C<$type> is one of the C<L_*> constants (available in export
+tag C<logtype_t>), C<$prog> is one of the C<P_*> constants (available
+in export tag C<program_t>), and C<$str> is the remainder of the line.
+
+Both families of constants can be converted to symbolic names with
+C<logtype_t_to_string> and C<program_t_to_string>, respectively.
+
+=head2 FUNCTIONS
+
+=over
+
+=item C<open_logfile($filename)>
+
+Opens a logfile for reading, returning an opaque log file handle.
+
+=item C<close_logfile($handle)>
+
+Closes a log file handle.
+
+=item C<get_logline($handle)>
+
+Return a list as described above representing the next log line in
+C<$handle>, or nothing at the end of the logfile. 
+
+=back
+
+All of these functions can be imported by name if desired.
+
+=head1 Amanda::Find::find_result_t objects
+
+These objects contain information about dumps, as read from logfiles.
+Instance variables are:
+
+=over
+
+=item C<$timestamp>
+
+=item C<$hostname>
+
+=item C<$diskname>
+
+=item C<$level>
+
+=item C<$label>
+
+=item C<$filenum>
+
+=item C<$status>
+
+=item C<$partnum>
+
+=back
+
+=head1 HIGHER-LEVEL FUNCTIONS
+
+Functions in this section extract information from logfiles.
+
+=over
+
+=item C<find_log()>
+
+Return a list of logfiles for active tapes.  The tapelist must be loaded before
+this function is called (see L<Amanda::Tapelist>).
+
+=item C<search_logfile($label, $datestamp, $logfile, $add_missing_disks)>
+
+Return all results in C<$logfile> matching C<$label> and C<$datestamp>.
+If C<$add_missing_disks> is true, then any disks in the logfile
+not present in the disklist are added to the disklist; otherwise,
+such dumps are skipped.
+
+=item C<dumps_match([@results], $hostname, $diskname, $datestamp, $level, $ok)>
+
+Return a filtered version of C<@results> containing only results that match the 
+given expressions.  If C<$ok> is true, don't match partial results.  Note that
+C<$level> is given as a string, since it is a match expression.
+
+All of these functions can be imported by name.
+
+=cut
+
+push @EXPORT_OK, qw(open_logfile get_logline close_logfile);
+
+push @EXPORT_OK, qw(logtype_t_to_string);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw(logtype_t_to_string);
+
+my %_logtype_t_VALUES;
+#Convert an enum value to a single string
+sub logtype_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_logtype_t_VALUES) {
+       my $v = $_logtype_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($L_BOGUS);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_BOGUS);
+
+$_logtype_t_VALUES{"L_BOGUS"} = $L_BOGUS;
+
+push @EXPORT_OK, qw($L_FATAL);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_FATAL);
+
+$_logtype_t_VALUES{"L_FATAL"} = $L_FATAL;
+
+push @EXPORT_OK, qw($L_ERROR);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_ERROR);
+
+$_logtype_t_VALUES{"L_ERROR"} = $L_ERROR;
+
+push @EXPORT_OK, qw($L_WARNING);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_WARNING);
+
+$_logtype_t_VALUES{"L_WARNING"} = $L_WARNING;
+
+push @EXPORT_OK, qw($L_INFO);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_INFO);
+
+$_logtype_t_VALUES{"L_INFO"} = $L_INFO;
+
+push @EXPORT_OK, qw($L_SUMMARY);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_SUMMARY);
+
+$_logtype_t_VALUES{"L_SUMMARY"} = $L_SUMMARY;
+
+push @EXPORT_OK, qw($L_START);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_START);
+
+$_logtype_t_VALUES{"L_START"} = $L_START;
+
+push @EXPORT_OK, qw($L_FINISH);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_FINISH);
+
+$_logtype_t_VALUES{"L_FINISH"} = $L_FINISH;
+
+push @EXPORT_OK, qw($L_DISK);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_DISK);
+
+$_logtype_t_VALUES{"L_DISK"} = $L_DISK;
+
+push @EXPORT_OK, qw($L_DONE);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_DONE);
+
+$_logtype_t_VALUES{"L_DONE"} = $L_DONE;
+
+push @EXPORT_OK, qw($L_PART);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_PART);
+
+$_logtype_t_VALUES{"L_PART"} = $L_PART;
+
+push @EXPORT_OK, qw($L_PARTPARTIAL);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_PARTPARTIAL);
+
+$_logtype_t_VALUES{"L_PARTPARTIAL"} = $L_PARTPARTIAL;
+
+push @EXPORT_OK, qw($L_SUCCESS);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_SUCCESS);
+
+$_logtype_t_VALUES{"L_SUCCESS"} = $L_SUCCESS;
+
+push @EXPORT_OK, qw($L_PARTIAL);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_PARTIAL);
+
+$_logtype_t_VALUES{"L_PARTIAL"} = $L_PARTIAL;
+
+push @EXPORT_OK, qw($L_FAIL);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_FAIL);
+
+$_logtype_t_VALUES{"L_FAIL"} = $L_FAIL;
+
+push @EXPORT_OK, qw($L_STRANGE);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_STRANGE);
+
+$_logtype_t_VALUES{"L_STRANGE"} = $L_STRANGE;
+
+push @EXPORT_OK, qw($L_CHUNK);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_CHUNK);
+
+$_logtype_t_VALUES{"L_CHUNK"} = $L_CHUNK;
+
+push @EXPORT_OK, qw($L_CHUNKSUCCESS);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_CHUNKSUCCESS);
+
+$_logtype_t_VALUES{"L_CHUNKSUCCESS"} = $L_CHUNKSUCCESS;
+
+push @EXPORT_OK, qw($L_STATS);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_STATS);
+
+$_logtype_t_VALUES{"L_STATS"} = $L_STATS;
+
+push @EXPORT_OK, qw($L_MARKER);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_MARKER);
+
+$_logtype_t_VALUES{"L_MARKER"} = $L_MARKER;
+
+push @EXPORT_OK, qw($L_CONT);
+push @{$EXPORT_TAGS{"logtype_t"}}, qw($L_CONT);
+
+$_logtype_t_VALUES{"L_CONT"} = $L_CONT;
+
+push @EXPORT_OK, qw(program_t_to_string);
+push @{$EXPORT_TAGS{"program_t"}}, qw(program_t_to_string);
+
+my %_program_t_VALUES;
+#Convert an enum value to a single string
+sub program_t_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_program_t_VALUES) {
+       my $v = $_program_t_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw($P_UNKNOWN);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_UNKNOWN);
+
+$_program_t_VALUES{"P_UNKNOWN"} = $P_UNKNOWN;
+
+push @EXPORT_OK, qw($P_PLANNER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_PLANNER);
+
+$_program_t_VALUES{"P_PLANNER"} = $P_PLANNER;
+
+push @EXPORT_OK, qw($P_DRIVER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_DRIVER);
+
+$_program_t_VALUES{"P_DRIVER"} = $P_DRIVER;
+
+push @EXPORT_OK, qw($P_REPORTER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_REPORTER);
+
+$_program_t_VALUES{"P_REPORTER"} = $P_REPORTER;
+
+push @EXPORT_OK, qw($P_DUMPER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_DUMPER);
+
+$_program_t_VALUES{"P_DUMPER"} = $P_DUMPER;
+
+push @EXPORT_OK, qw($P_CHUNKER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_CHUNKER);
+
+$_program_t_VALUES{"P_CHUNKER"} = $P_CHUNKER;
+
+push @EXPORT_OK, qw($P_TAPER);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_TAPER);
+
+$_program_t_VALUES{"P_TAPER"} = $P_TAPER;
+
+push @EXPORT_OK, qw($P_AMFLUSH);
+push @{$EXPORT_TAGS{"program_t"}}, qw($P_AMFLUSH);
+
+$_program_t_VALUES{"P_AMFLUSH"} = $P_AMFLUSH;
+
+push @EXPORT_OK, qw(find_log search_logfile dumps_match);
+1;
diff --git a/perl/Amanda/Logfile.swg b/perl/Amanda/Logfile.swg
new file mode 100644 (file)
index 0000000..ea621e4
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Logfile"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include <glib.h>
+#include "logfile.h"
+#include "find.h"
+#include "diskfile.h" /* for the gross hack, below */
+%}
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Logfile - manage Amanda trace logs
+
+=head1 SYNOPSIS
+
+  use Amanda::Logfile qw(:logtype_t); # XXX change
+  use Amanda::Config qw( :getconf config_dir_relative );
+
+  for my $logfile (Amanda::Logfile::find_log()) {
+    $logfile = config_dir_relative(getconf($CNF_LOGDIR)) . "/" . $logfile;
+
+    my $hdl = Amanda::Logfile::open_logfile($logfile);
+    while (my ($type, $prog, $str) = Amanda::Logfile::get_logline($hdl)) {
+      if ($type == $L_INFO) {
+        my $pname = Amanda::Logfile::program_t_to_string($prog);
+        print "Found info line from $pname: $str\n";
+      }
+    }
+    Amanda::Logfile::close_logfile($log);
+
+    my @dumps = Amanda::Logfile::search_logfile("TapeLabel-001", "19780615", $logfile);
+
+    my @matching = Amanda::Logfile::dumps_match([@dumps], "myhost", "/usr", undef, undef, 0);
+    for my $dump (@matching) {
+      print "$dump->{'label'}:$dump->{'filenum'} = $dump->{'hostname'}:$dump->{'disk'}\n";
+    }
+  }
+
+=head1 API STATUS
+
+Stabilizing
+
+=head1 RAW LOGFILE ACCESS
+
+This section corresponds to the C C<logfile> module. 
+
+Raw access to logfiles is accomplished by opening a logfile and
+fetching log lines one by one via the C<get_logline> function.
+
+A log line is represented by a list C<($type, $prog, $string)>
+where C<$type> is one of the C<L_*> constants (available in export
+tag C<logtype_t>), C<$prog> is one of the C<P_*> constants (available
+in export tag C<program_t>), and C<$str> is the remainder of the line.
+
+Both families of constants can be converted to symbolic names with
+C<logtype_t_to_string> and C<program_t_to_string>, respectively.
+
+=head2 FUNCTIONS
+
+=over
+
+=item C<open_logfile($filename)>
+
+Opens a logfile for reading, returning an opaque log file handle.
+
+=item C<close_logfile($handle)>
+
+Closes a log file handle.
+
+=item C<get_logline($handle)>
+
+Return a list as described above representing the next log line in
+C<$handle>, or nothing at the end of the logfile. 
+
+=back
+
+All of these functions can be imported by name if desired.
+
+=head1 Amanda::Find::find_result_t objects
+
+These objects contain information about dumps, as read from logfiles.
+Instance variables are:
+
+=over
+
+=item C<$timestamp>
+
+=item C<$hostname>
+
+=item C<$diskname>
+
+=item C<$level>
+
+=item C<$label>
+
+=item C<$filenum>
+
+=item C<$status>
+
+=item C<$partnum>
+
+=back
+
+=head1 HIGHER-LEVEL FUNCTIONS
+
+Functions in this section extract information from logfiles.
+
+=over
+
+=item C<find_log()>
+
+Return a list of logfiles for active tapes.  The tapelist must be loaded before
+this function is called (see L<Amanda::Tapelist>).
+
+=item C<search_logfile($label, $datestamp, $logfile, $add_missing_disks)>
+
+Return all results in C<$logfile> matching C<$label> and C<$datestamp>.
+If C<$add_missing_disks> is true, then any disks in the logfile
+not present in the disklist are added to the disklist; otherwise,
+such dumps are skipped.
+
+=item C<dumps_match([@results], $hostname, $diskname, $datestamp, $level, $ok)>
+
+Return a filtered version of C<@results> containing only results that match the 
+given expressions.  If C<$ok> is true, don't match partial results.  Note that
+C<$level> is given as a string, since it is a match expression.
+
+All of these functions can be imported by name.
+
+=cut
+%}
+
+amglue_export_ok(
+    open_logfile get_logline close_logfile
+);
+
+
+amglue_add_enum_tag_fns(logtype_t);
+amglue_add_constant(L_BOGUS, logtype_t);
+amglue_add_constant(L_FATAL, logtype_t);
+amglue_add_constant(L_ERROR, logtype_t);
+amglue_add_constant(L_WARNING, logtype_t);
+amglue_add_constant(L_INFO, logtype_t);
+amglue_add_constant(L_SUMMARY, logtype_t);
+amglue_add_constant(L_START, logtype_t);
+amglue_add_constant(L_FINISH, logtype_t);
+amglue_add_constant(L_DISK, logtype_t);
+amglue_add_constant(L_DONE, logtype_t);
+amglue_add_constant(L_PART, logtype_t);
+amglue_add_constant(L_PARTPARTIAL, logtype_t);
+amglue_add_constant(L_SUCCESS, logtype_t);
+amglue_add_constant(L_PARTIAL, logtype_t);
+amglue_add_constant(L_FAIL, logtype_t);
+amglue_add_constant(L_STRANGE, logtype_t);
+amglue_add_constant(L_CHUNK, logtype_t);
+amglue_add_constant(L_CHUNKSUCCESS, logtype_t);
+amglue_add_constant(L_STATS, logtype_t);
+amglue_add_constant(L_MARKER, logtype_t);
+amglue_add_constant(L_CONT, logtype_t);
+
+amglue_add_enum_tag_fns(program_t);
+amglue_add_constant(P_UNKNOWN, program_t);
+amglue_add_constant(P_PLANNER, program_t);
+amglue_add_constant(P_DRIVER, program_t);
+amglue_add_constant(P_REPORTER, program_t);
+amglue_add_constant(P_DUMPER, program_t);
+amglue_add_constant(P_CHUNKER, program_t);
+amglue_add_constant(P_TAPER, program_t);
+amglue_add_constant(P_AMFLUSH, program_t);
+
+/* TODO: support for writing logfiles is omitted for the moment. */
+
+%inline %{
+/* open_ and close_logfile are both simple wrappers around fopen/fclose. */
+typedef FILE loghandle;
+
+loghandle *open_logfile(char *filename) {
+    return fopen(filename, "r");
+}
+%}
+
+%inline %{
+void close_logfile(loghandle *logfile) {
+    if (logfile) fclose(logfile);
+}
+%}
+
+/* We fake the return type of get_logline, and use a typemap to
+ * slurp curstr, curprog, and curlog into a return value.  */
+%{
+typedef int LOGLINE_RETURN;
+%}
+%typemap(out) LOGLINE_RETURN {
+    if ($1 != 0) {
+       EXTEND(SP, 3);
+       $result = sv_2mortal(newSViv(curlog));
+       argvi++;
+       $result = sv_2mortal(newSViv(curprog));
+       argvi++;
+       $result = sv_2mortal(newSVpv(curstr, 0));
+       argvi++;
+    }
+    /* otherwise (end of logfile) return an empty list */
+}
+LOGLINE_RETURN get_logline(FILE *logfile);
+
+typedef struct {
+    %extend {
+       /* destructor */
+       ~find_result_t() {
+           find_result_t *selfp = self;
+           free_find_result(&selfp);
+       }
+    }
+
+    %immutable;
+    char *timestamp;
+    char *hostname;
+    char *diskname;
+    int level;
+    char *label;
+    off_t filenum;
+    char *status;
+    char *partnum;
+    %mutable;
+} find_result_t;
+
+/* This typemap is used in a few functions.  It converts a linked list of find_result_t's
+ * into an array of same, de-linking the list in the process.  This gives ownership of the
+ * objects to perl, which is consistent with the C interface to this module.
+ */
+%typemap(out) find_result_t * {
+    find_result_t *iter;
+    int len;
+
+    /* measure the list and make room on the perl stack */
+    for (len=0, iter=$1; iter; iter=iter->next) len++;
+    EXTEND(SP, len);
+
+    iter = $1;
+    while (iter) {
+       find_result_t *next;
+       /* Let SWIG take ownership of the object */
+       $result = SWIG_NewPointerObj(iter, $descriptor(find_result_t *), SWIG_OWNER | SWIG_SHADOW);
+       argvi++;
+
+       /* null out the 'next' field */
+       next = iter->next;
+       iter->next = NULL;
+       iter = next;
+    }
+}
+
+/* Similarly, on input we link an array full of find_result_t's.  The list is then
+ * unlinked on return.  Note that the array is supplied as an arrayref (since it's 
+ * usually the first argument).
+ */
+%typemap(in) find_result_t * {
+    AV *av;
+    I32 len, i;
+    find_result_t *head = NULL, *tail = NULL;
+
+    if (!SvROK($input) || SvTYPE(SvRV($input)) != SVt_PVAV) {
+       SWIG_exception(SWIG_TypeError, "expected an arrayref of find_result_t's");
+    }
+
+    av = (AV *)SvRV($input);
+    len = av_len(av) + 1;
+
+    for (i = 0; i < len; i++) {
+       SV **val = av_fetch(av, i, 0);
+       find_result_t *r;
+
+       if (!val || SWIG_ConvertPtr(*val, (void **)&r, $descriptor(find_result_t *), 0) == -1) {
+           SWIG_exception(SWIG_TypeError, "array member is not a find_result_t");
+       }
+
+       if (!head) {
+           head = tail = r;
+       } else {
+           tail->next = r;
+           tail = r;
+       }
+
+       tail->next = NULL;
+    }
+
+    /* point to the head of that list */
+    $1 = head;
+}
+
+%typemap(freearg) find_result_t * {
+    find_result_t *iter = $1, *next;
+
+    /* undo all the links we added earlier */
+    while (iter) {
+       next = iter->next;
+       iter->next = NULL;
+       iter = next;
+    }
+}
+
+%typemap(out) char ** {
+    char **iter;
+    int len, i;
+    
+    /* measure the length of the array and make sure perl has enough room */
+    for (len=0, iter=$1; *iter; iter++) len++;
+    EXTEND(SP, len);
+
+    /* now copy it to the perl stack */
+    for (i=0, iter=$1; *iter; iter++, i++) {
+       $result = sv_2mortal(newSVpv(*iter, 0));
+       argvi++;
+    }
+}
+
+amglue_export_ok(
+    find_log search_logfile dumps_match
+);
+
+char **find_log(void);
+
+%rename(search_logfile) search_logfile_wrap;
+%inline %{
+find_result_t *search_logfile_wrap(char *label, char *datestamp, 
+                                  char *logfile, int add_missing_disks) {
+    find_result_t *rv = NULL;
+
+    /* We use a static variable to collect any unrecognized disks */
+    static disklist_t unrecognized_disks = { NULL, NULL };
+
+    search_logfile(&rv, label, datestamp, logfile, 
+       add_missing_disks? &unrecognized_disks : NULL);
+
+    return rv;
+}
+%}
+
+find_result_t *dumps_match(find_result_t *output_find, char *hostname,
+                          char *diskname, char *datestamp, char *level, int ok);
diff --git a/perl/Amanda/Paths.pm.in b/perl/Amanda/Paths.pm.in
new file mode 100644 (file)
index 0000000..501bffa
--- /dev/null
@@ -0,0 +1,81 @@
+# vim:ft=perl
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Paths;
+
+=head1 NAME
+
+Amanda::Paths - perl access to build-time configuration values
+
+=head1 SYNOPSIS
+
+  use Amanda::Paths;
+
+  my $filename = "$amlibexecdir/foo/bar";
+
+This package is a means of getting all of the necessary variables provided
+by configure into Perl scripts, without a bunch of boilerplate, and without
+requiring config.status substitution for every .pm file.
+
+All of the variables in @EXPORT will be automatically imported into
+your module's namespace.  See the source, rather than the perldoc,
+to find out what variables are available.
+
+=cut
+
+use Exporter;
+@ISA = qw( Exporter );
+
+@EXPORT = qw(
+    $prefix
+    $exec_prefix
+    $bindir
+    $sbindir
+    $libexecdir
+    $amlibexecdir
+    $mandir
+    $datarootdir
+
+    $AMANDA_TMPDIR
+    $CONFIG_DIR
+    $AMANDA_DBGDIR
+);
+
+# the 'warnings' pragma doesn't recognized exported variables as "used", and generates warnings
+# for variables only used once.  We turn it off for this module.
+no warnings;
+
+## basic filesystem layout
+
+# these need to go in order, due to the way autoconf sets these dirs up
+$prefix = "@prefix@";
+$exec_prefix = "@exec_prefix@";
+$bindir = "@bindir@";
+$sbindir = "@sbindir@";
+$libexecdir = "@libexecdir@";
+$amlibexecdir = "@amlibexecdir@";
+$mandir = "@mandir@";
+# (config.status worries if it doesn't see this:)
+$datarootdir = "@datarootdir@";
+
+## amanda configuration directories
+
+$AMANDA_TMPDIR = "@AMANDA_TMPDIR@";
+$CONFIG_DIR = "@CONFIG_DIR@";
+$AMANDA_DBGDIR = "@AMANDA_DBGDIR@";
diff --git a/perl/Amanda/Tapefile.c b/perl/Amanda/Tapefile.c
new file mode 100644 (file)
index 0000000..9f5c2fb
--- /dev/null
@@ -0,0 +1,1922 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_float swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_unsigned_char swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Tapefile
+
+#define SWIG_name   "Amanda::Tapefilec::boot_Amanda__Tapefile"
+#define SWIG_prefix "Amanda::Tapefilec::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include <glib.h>
+#include "tapefile.h"
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Tapefile_var::
+class _wrap_Amanda::Tapefile_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_read_tapelist) {
+  {
+    char *arg1 = (char *) 0 ;
+    int result;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: read_tapelist(tapefile);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_tapelist" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (int)read_tapelist(arg1);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Tapefilec::read_tapelist", _wrap_read_tapelist},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Tapefile.pm b/perl/Amanda/Tapefile.pm
new file mode 100644 (file)
index 0000000..612ed55
--- /dev/null
@@ -0,0 +1,61 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Tapefile;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Tapefilec;
+bootstrap Amanda::Tapefile;
+package Amanda::Tapefile;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Tapefile;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Tapefile;
+
+*read_tapelist = *Amanda::Tapefilec::read_tapelist;
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Tapefile;
+
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+1;
diff --git a/perl/Amanda/Tapefile.swg b/perl/Amanda/Tapefile.swg
new file mode 100644 (file)
index 0000000..32b5c30
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Tapefile"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include <glib.h>
+#include "tapefile.h"
+%}
+
+/* This is just a hack to get Amanda::Logfile working! */
+
+int read_tapelist(char *tapefile);
diff --git a/perl/Amanda/Types.c b/perl/Amanda/Types.c
new file mode 100644 (file)
index 0000000..975e350
--- /dev/null
@@ -0,0 +1,4266 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_a_STRMAX__char swig_types[0]
+#define SWIGTYPE_p_char swig_types[1]
+#define SWIGTYPE_p_double swig_types[2]
+#define SWIGTYPE_p_dumpfile_t swig_types[3]
+#define SWIGTYPE_p_float swig_types[4]
+#define SWIGTYPE_p_int swig_types[5]
+#define SWIGTYPE_p_unsigned_char swig_types[6]
+static swig_type_info *swig_types[8];
+static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Types
+
+#define SWIG_name   "Amanda::Typesc::boot_Amanda__Types"
+#define SWIG_prefix "Amanda::Typesc::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "fileheader.h"
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharArray(SV * obj, char *val, size_t size)
+{ 
+  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
+  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
+  if (SWIG_IsOK(res)) {
+    if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
+    if (csize <= size) {
+      if (val) {
+       if (csize) memcpy(val, cptr, csize*sizeof(char));
+       if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
+      }
+      if (alloc == SWIG_NEWOBJ) {
+       free((char*)cptr);
+       res = SWIG_DelNewMask(res);
+      }      
+      return res;
+    }
+    if (alloc == SWIG_NEWOBJ) free((char*)cptr);
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  SV *obj = sv_newmortal();
+  if (carray) {
+    sv_setpvn(obj, carray, size);
+  } else {
+    sv_setsv(obj, &PL_sv_undef);
+  }
+  return obj;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
+{
+  if (SvUOK(obj)) {
+    if (val) *val = SvUV(obj);
+    return SWIG_OK;
+  } else  if (SvIOK(obj)) {
+    long v = SvIV(obj);
+    if (v >= 0) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      return SWIG_OverflowError;
+    }
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      unsigned long v;
+      errno = 0;
+      v = strtoul(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+       if (val) *val = (unsigned long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
+{
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = (size_t)(v);
+  return res;
+}
+
+SWIGINTERN dumpfile_t *new_dumpfile_t(){
+           dumpfile_t *df = malloc(sizeof(*df));
+           fh_init(df);
+           return df;
+       }
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Types_var::
+class _wrap_Amanda::Types_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_dumpfile_t_type_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    filetype_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_type_set(self,type);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_type_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->type = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_type_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    filetype_t result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_type_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_type_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (filetype_t) ((arg1)->type);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_datestamp_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_datestamp_set(self,datestamp);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_datestamp_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_datestamp_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->datestamp, arg2, STRMAX);
+      if (arg1->datestamp[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_datestamp_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_datestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_datestamp_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->datestamp);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_dumplevel_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_dumplevel_set(self,dumplevel);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_dumplevel_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->dumplevel = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_dumplevel_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_dumplevel_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_dumplevel_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->dumplevel);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_compressed_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_compressed_set(self,compressed);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_compressed_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->compressed = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_compressed_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_compressed_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_compressed_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->compressed);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypted_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_encrypted_set(self,encrypted);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypted_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->encrypted = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypted_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_encrypted_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypted_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->encrypted);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_comp_suffix_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_comp_suffix_set(self,comp_suffix);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_comp_suffix_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_comp_suffix_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->comp_suffix, arg2, STRMAX);
+      if (arg1->comp_suffix[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_comp_suffix_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_comp_suffix_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_comp_suffix_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->comp_suffix);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypt_suffix_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_encrypt_suffix_set(self,encrypt_suffix);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypt_suffix_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_encrypt_suffix_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->encrypt_suffix, arg2, STRMAX);
+      if (arg1->encrypt_suffix[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypt_suffix_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_encrypt_suffix_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypt_suffix_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->encrypt_suffix);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_name_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_name_set(self,name);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_name_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_name_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->name, arg2, STRMAX);
+      if (arg1->name[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_name_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_name_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_name_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->name);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_disk_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_disk_set(self,disk);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_disk_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_disk_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->disk, arg2, STRMAX);
+      if (arg1->disk[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_disk_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_disk_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_disk_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->disk);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_program_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_program_set(self,program);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_program_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_program_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->program, arg2, STRMAX);
+      if (arg1->program[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_program_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_program_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_program_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->program);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_dumper_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_dumper_set(self,dumper);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_dumper_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_dumper_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->dumper, arg2, STRMAX);
+      if (arg1->dumper[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_dumper_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_dumper_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_dumper_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->dumper);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srvcompprog_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_srvcompprog_set(self,srvcompprog);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srvcompprog_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_srvcompprog_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->srvcompprog, arg2, STRMAX);
+      if (arg1->srvcompprog[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srvcompprog_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_srvcompprog_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srvcompprog_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->srvcompprog);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clntcompprog_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_clntcompprog_set(self,clntcompprog);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clntcompprog_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_clntcompprog_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->clntcompprog, arg2, STRMAX);
+      if (arg1->clntcompprog[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clntcompprog_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_clntcompprog_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clntcompprog_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->clntcompprog);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srv_encrypt_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_srv_encrypt_set(self,srv_encrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srv_encrypt_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_srv_encrypt_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->srv_encrypt, arg2, STRMAX);
+      if (arg1->srv_encrypt[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srv_encrypt_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_srv_encrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srv_encrypt_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->srv_encrypt);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clnt_encrypt_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_clnt_encrypt_set(self,clnt_encrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clnt_encrypt_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_clnt_encrypt_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->clnt_encrypt, arg2, STRMAX);
+      if (arg1->clnt_encrypt[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clnt_encrypt_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_clnt_encrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clnt_encrypt_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->clnt_encrypt);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_recover_cmd_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_recover_cmd_set(self,recover_cmd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_recover_cmd_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_recover_cmd_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->recover_cmd, arg2, STRMAX);
+      if (arg1->recover_cmd[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_recover_cmd_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_recover_cmd_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_recover_cmd_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->recover_cmd);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_uncompress_cmd_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_uncompress_cmd_set(self,uncompress_cmd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_uncompress_cmd_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_uncompress_cmd_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->uncompress_cmd, arg2, STRMAX);
+      if (arg1->uncompress_cmd[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_uncompress_cmd_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_uncompress_cmd_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_uncompress_cmd_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->uncompress_cmd);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypt_cmd_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_encrypt_cmd_set(self,encrypt_cmd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypt_cmd_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_encrypt_cmd_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->encrypt_cmd, arg2, STRMAX);
+      if (arg1->encrypt_cmd[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_encrypt_cmd_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_encrypt_cmd_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_encrypt_cmd_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->encrypt_cmd);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_decrypt_cmd_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_decrypt_cmd_set(self,decrypt_cmd);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_decrypt_cmd_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_decrypt_cmd_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->decrypt_cmd, arg2, STRMAX);
+      if (arg1->decrypt_cmd[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_decrypt_cmd_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_decrypt_cmd_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_decrypt_cmd_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->decrypt_cmd);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srv_decrypt_opt_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_srv_decrypt_opt_set(self,srv_decrypt_opt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srv_decrypt_opt_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_srv_decrypt_opt_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->srv_decrypt_opt, arg2, STRMAX);
+      if (arg1->srv_decrypt_opt[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_srv_decrypt_opt_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_srv_decrypt_opt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_srv_decrypt_opt_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->srv_decrypt_opt);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clnt_decrypt_opt_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_clnt_decrypt_opt_set(self,clnt_decrypt_opt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clnt_decrypt_opt_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_clnt_decrypt_opt_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->clnt_decrypt_opt, arg2, STRMAX);
+      if (arg1->clnt_decrypt_opt[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_clnt_decrypt_opt_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_clnt_decrypt_opt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_clnt_decrypt_opt_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->clnt_decrypt_opt);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_cont_filename_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    char temp2[STRMAX] ;
+    int res2 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_cont_filename_set(self,cont_filename);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_cont_filename_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    res2 = SWIG_AsCharArray(ST(1), temp2, STRMAX);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dumpfile_t_cont_filename_set" "', argument " "2"" of type '" "char [STRMAX]""'");
+    }
+    arg2 = (char *)(temp2);
+    {
+      strncpy(arg1->cont_filename, arg2, STRMAX);
+      if (arg1->cont_filename[STRMAX-1] != '\0')
+      SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+    }
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_cont_filename_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    char *result = 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_cont_filename_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_cont_filename_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (char *) ((arg1)->cont_filename);
+    {
+      size_t size = STRMAX;
+      
+      while (size && (result[size - 1] == '\0')) --size;
+      
+      ST(argvi) = SWIG_FromCharPtrAndSize(result, size); argvi++ ;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_is_partial_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_is_partial_set(self,is_partial);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_is_partial_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->is_partial = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_is_partial_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_is_partial_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_is_partial_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->is_partial);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_partnum_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_partnum_set(self,partnum);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_partnum_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->partnum = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_partnum_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_partnum_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_partnum_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->partnum);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_totalparts_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_totalparts_set(self,totalparts);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_totalparts_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(signed int) == 1) {
+        arg2 = amglue_SvI8(ST(1));
+      } else if (sizeof(signed int) == 2) {
+        arg2 = amglue_SvI16(ST(1));
+      } else if (sizeof(signed int) == 4) {
+        arg2 = amglue_SvI32(ST(1));
+      } else if (sizeof(signed int) == 8) {
+        arg2 = amglue_SvI64(ST(1));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    if (arg1) (arg1)->totalparts = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_totalparts_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    int result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_totalparts_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_totalparts_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result = (int) ((arg1)->totalparts);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_blocksize_set) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    size_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: dumpfile_t_blocksize_set(self,blocksize);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_blocksize_set" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      if (sizeof(size_t) == 1) {
+        arg2 = amglue_SvU8(ST(1));
+      } else if (sizeof(size_t) == 2) {
+        arg2 = amglue_SvU16(ST(1));
+      } else if (sizeof(size_t) == 4) {
+        arg2 = amglue_SvU32(ST(1));
+      } else if (sizeof(size_t) == 8) {
+        arg2 = amglue_SvU64(ST(1));
+      } else {
+        croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+      }
+    }
+    if (arg1) (arg1)->blocksize = arg2;
+    
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_dumpfile_t_blocksize_get) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    size_t result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpfile_t_blocksize_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpfile_t_blocksize_get" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    result =  ((arg1)->blocksize);
+    {
+      ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_dumpfile_t) {
+  {
+    dumpfile_t *result = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: new_dumpfile_t();");
+    }
+    result = (dumpfile_t *)new_dumpfile_t();
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_dumpfile_t__SWIG_1) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_dumpfile_t(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_dumpfile_t" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    free((char *) arg1);
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_dumpfile_t) {
+  dXSARGS;
+  
+  {
+    unsigned long _index = 0;
+    SWIG_TypeRank _rank = 0; 
+    if (items == 1) {
+      SWIG_TypeRank _ranki = 0;
+      SWIG_TypeRank _rankm = 0;
+      SWIG_TypeRank _pi = 1;
+      int _v = 0;
+      {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_dumpfile_t, 0);
+        _v = SWIG_CheckState(res);
+      }
+      if (!_v) goto check_1;
+      _ranki += _v*_pi;
+      _rankm += _pi;
+      _pi *= SWIG_MAXCASTRANK;
+      if (!_index || (_ranki < _rank)) {
+        _rank = _ranki; _index = 1;
+        if (_rank == _rankm) goto dispatch;
+      }
+    }
+  check_1:
+    
+  dispatch:
+    switch(_index) {
+    case 1:
+      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_delete_dumpfile_t__SWIG_1); return;
+    }
+  }
+  
+  croak("No matching function for overloaded 'delete_dumpfile_t'");
+  XSRETURN(0);
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_a_STRMAX__char = {"_p_a_STRMAX__char", "char (*)[STRMAX]|string_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Types::dumpfile_t", 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|filetype_t *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_a_STRMAX__char,
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_dumpfile_t,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_a_STRMAX__char[] = {  {&_swigt__p_a_STRMAX__char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_a_STRMAX__char,
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_dumpfile_t,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Typesc::dumpfile_t_type_set", _wrap_dumpfile_t_type_set},
+{"Amanda::Typesc::dumpfile_t_type_get", _wrap_dumpfile_t_type_get},
+{"Amanda::Typesc::dumpfile_t_datestamp_set", _wrap_dumpfile_t_datestamp_set},
+{"Amanda::Typesc::dumpfile_t_datestamp_get", _wrap_dumpfile_t_datestamp_get},
+{"Amanda::Typesc::dumpfile_t_dumplevel_set", _wrap_dumpfile_t_dumplevel_set},
+{"Amanda::Typesc::dumpfile_t_dumplevel_get", _wrap_dumpfile_t_dumplevel_get},
+{"Amanda::Typesc::dumpfile_t_compressed_set", _wrap_dumpfile_t_compressed_set},
+{"Amanda::Typesc::dumpfile_t_compressed_get", _wrap_dumpfile_t_compressed_get},
+{"Amanda::Typesc::dumpfile_t_encrypted_set", _wrap_dumpfile_t_encrypted_set},
+{"Amanda::Typesc::dumpfile_t_encrypted_get", _wrap_dumpfile_t_encrypted_get},
+{"Amanda::Typesc::dumpfile_t_comp_suffix_set", _wrap_dumpfile_t_comp_suffix_set},
+{"Amanda::Typesc::dumpfile_t_comp_suffix_get", _wrap_dumpfile_t_comp_suffix_get},
+{"Amanda::Typesc::dumpfile_t_encrypt_suffix_set", _wrap_dumpfile_t_encrypt_suffix_set},
+{"Amanda::Typesc::dumpfile_t_encrypt_suffix_get", _wrap_dumpfile_t_encrypt_suffix_get},
+{"Amanda::Typesc::dumpfile_t_name_set", _wrap_dumpfile_t_name_set},
+{"Amanda::Typesc::dumpfile_t_name_get", _wrap_dumpfile_t_name_get},
+{"Amanda::Typesc::dumpfile_t_disk_set", _wrap_dumpfile_t_disk_set},
+{"Amanda::Typesc::dumpfile_t_disk_get", _wrap_dumpfile_t_disk_get},
+{"Amanda::Typesc::dumpfile_t_program_set", _wrap_dumpfile_t_program_set},
+{"Amanda::Typesc::dumpfile_t_program_get", _wrap_dumpfile_t_program_get},
+{"Amanda::Typesc::dumpfile_t_dumper_set", _wrap_dumpfile_t_dumper_set},
+{"Amanda::Typesc::dumpfile_t_dumper_get", _wrap_dumpfile_t_dumper_get},
+{"Amanda::Typesc::dumpfile_t_srvcompprog_set", _wrap_dumpfile_t_srvcompprog_set},
+{"Amanda::Typesc::dumpfile_t_srvcompprog_get", _wrap_dumpfile_t_srvcompprog_get},
+{"Amanda::Typesc::dumpfile_t_clntcompprog_set", _wrap_dumpfile_t_clntcompprog_set},
+{"Amanda::Typesc::dumpfile_t_clntcompprog_get", _wrap_dumpfile_t_clntcompprog_get},
+{"Amanda::Typesc::dumpfile_t_srv_encrypt_set", _wrap_dumpfile_t_srv_encrypt_set},
+{"Amanda::Typesc::dumpfile_t_srv_encrypt_get", _wrap_dumpfile_t_srv_encrypt_get},
+{"Amanda::Typesc::dumpfile_t_clnt_encrypt_set", _wrap_dumpfile_t_clnt_encrypt_set},
+{"Amanda::Typesc::dumpfile_t_clnt_encrypt_get", _wrap_dumpfile_t_clnt_encrypt_get},
+{"Amanda::Typesc::dumpfile_t_recover_cmd_set", _wrap_dumpfile_t_recover_cmd_set},
+{"Amanda::Typesc::dumpfile_t_recover_cmd_get", _wrap_dumpfile_t_recover_cmd_get},
+{"Amanda::Typesc::dumpfile_t_uncompress_cmd_set", _wrap_dumpfile_t_uncompress_cmd_set},
+{"Amanda::Typesc::dumpfile_t_uncompress_cmd_get", _wrap_dumpfile_t_uncompress_cmd_get},
+{"Amanda::Typesc::dumpfile_t_encrypt_cmd_set", _wrap_dumpfile_t_encrypt_cmd_set},
+{"Amanda::Typesc::dumpfile_t_encrypt_cmd_get", _wrap_dumpfile_t_encrypt_cmd_get},
+{"Amanda::Typesc::dumpfile_t_decrypt_cmd_set", _wrap_dumpfile_t_decrypt_cmd_set},
+{"Amanda::Typesc::dumpfile_t_decrypt_cmd_get", _wrap_dumpfile_t_decrypt_cmd_get},
+{"Amanda::Typesc::dumpfile_t_srv_decrypt_opt_set", _wrap_dumpfile_t_srv_decrypt_opt_set},
+{"Amanda::Typesc::dumpfile_t_srv_decrypt_opt_get", _wrap_dumpfile_t_srv_decrypt_opt_get},
+{"Amanda::Typesc::dumpfile_t_clnt_decrypt_opt_set", _wrap_dumpfile_t_clnt_decrypt_opt_set},
+{"Amanda::Typesc::dumpfile_t_clnt_decrypt_opt_get", _wrap_dumpfile_t_clnt_decrypt_opt_get},
+{"Amanda::Typesc::dumpfile_t_cont_filename_set", _wrap_dumpfile_t_cont_filename_set},
+{"Amanda::Typesc::dumpfile_t_cont_filename_get", _wrap_dumpfile_t_cont_filename_get},
+{"Amanda::Typesc::dumpfile_t_is_partial_set", _wrap_dumpfile_t_is_partial_set},
+{"Amanda::Typesc::dumpfile_t_is_partial_get", _wrap_dumpfile_t_is_partial_get},
+{"Amanda::Typesc::dumpfile_t_partnum_set", _wrap_dumpfile_t_partnum_set},
+{"Amanda::Typesc::dumpfile_t_partnum_get", _wrap_dumpfile_t_partnum_get},
+{"Amanda::Typesc::dumpfile_t_totalparts_set", _wrap_dumpfile_t_totalparts_set},
+{"Amanda::Typesc::dumpfile_t_totalparts_get", _wrap_dumpfile_t_totalparts_get},
+{"Amanda::Typesc::dumpfile_t_blocksize_set", _wrap_dumpfile_t_blocksize_set},
+{"Amanda::Typesc::dumpfile_t_blocksize_get", _wrap_dumpfile_t_blocksize_get},
+{"Amanda::Typesc::new_dumpfile_t", _wrap_new_dumpfile_t},
+{"Amanda::Typesc::delete_dumpfile_t", _wrap_delete_dumpfile_t},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_UNKNOWN", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_UNKNOWN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_WEIRD", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_WEIRD)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_TAPESTART", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_TAPESTART)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_TAPEEND", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_TAPEEND)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_DUMPFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_DUMPFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_CONT_DUMPFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_CONT_DUMPFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_SPLIT_DUMPFILE", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_SPLIT_DUMPFILE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "F_EMPTY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(F_EMPTY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  SWIG_TypeClientData(SWIGTYPE_p_dumpfile_t, (void*) "Amanda::Types::dumpfile_t");
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Types.pm b/perl/Amanda/Types.pm
new file mode 100644 (file)
index 0000000..02ed893
--- /dev/null
@@ -0,0 +1,286 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Types;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Typesc;
+bootstrap Amanda::Types;
+package Amanda::Types;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Types;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Types;
+
+
+############# Class : Amanda::Types::dumpfile_t ##############
+
+package Amanda::Types::dumpfile_t;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( Amanda::Types );
+%OWNER = ();
+%ITERATORS = ();
+*swig_type_get = *Amanda::Typesc::dumpfile_t_type_get;
+*swig_type_set = *Amanda::Typesc::dumpfile_t_type_set;
+*swig_datestamp_get = *Amanda::Typesc::dumpfile_t_datestamp_get;
+*swig_datestamp_set = *Amanda::Typesc::dumpfile_t_datestamp_set;
+*swig_dumplevel_get = *Amanda::Typesc::dumpfile_t_dumplevel_get;
+*swig_dumplevel_set = *Amanda::Typesc::dumpfile_t_dumplevel_set;
+*swig_compressed_get = *Amanda::Typesc::dumpfile_t_compressed_get;
+*swig_compressed_set = *Amanda::Typesc::dumpfile_t_compressed_set;
+*swig_encrypted_get = *Amanda::Typesc::dumpfile_t_encrypted_get;
+*swig_encrypted_set = *Amanda::Typesc::dumpfile_t_encrypted_set;
+*swig_comp_suffix_get = *Amanda::Typesc::dumpfile_t_comp_suffix_get;
+*swig_comp_suffix_set = *Amanda::Typesc::dumpfile_t_comp_suffix_set;
+*swig_encrypt_suffix_get = *Amanda::Typesc::dumpfile_t_encrypt_suffix_get;
+*swig_encrypt_suffix_set = *Amanda::Typesc::dumpfile_t_encrypt_suffix_set;
+*swig_name_get = *Amanda::Typesc::dumpfile_t_name_get;
+*swig_name_set = *Amanda::Typesc::dumpfile_t_name_set;
+*swig_disk_get = *Amanda::Typesc::dumpfile_t_disk_get;
+*swig_disk_set = *Amanda::Typesc::dumpfile_t_disk_set;
+*swig_program_get = *Amanda::Typesc::dumpfile_t_program_get;
+*swig_program_set = *Amanda::Typesc::dumpfile_t_program_set;
+*swig_dumper_get = *Amanda::Typesc::dumpfile_t_dumper_get;
+*swig_dumper_set = *Amanda::Typesc::dumpfile_t_dumper_set;
+*swig_srvcompprog_get = *Amanda::Typesc::dumpfile_t_srvcompprog_get;
+*swig_srvcompprog_set = *Amanda::Typesc::dumpfile_t_srvcompprog_set;
+*swig_clntcompprog_get = *Amanda::Typesc::dumpfile_t_clntcompprog_get;
+*swig_clntcompprog_set = *Amanda::Typesc::dumpfile_t_clntcompprog_set;
+*swig_srv_encrypt_get = *Amanda::Typesc::dumpfile_t_srv_encrypt_get;
+*swig_srv_encrypt_set = *Amanda::Typesc::dumpfile_t_srv_encrypt_set;
+*swig_clnt_encrypt_get = *Amanda::Typesc::dumpfile_t_clnt_encrypt_get;
+*swig_clnt_encrypt_set = *Amanda::Typesc::dumpfile_t_clnt_encrypt_set;
+*swig_recover_cmd_get = *Amanda::Typesc::dumpfile_t_recover_cmd_get;
+*swig_recover_cmd_set = *Amanda::Typesc::dumpfile_t_recover_cmd_set;
+*swig_uncompress_cmd_get = *Amanda::Typesc::dumpfile_t_uncompress_cmd_get;
+*swig_uncompress_cmd_set = *Amanda::Typesc::dumpfile_t_uncompress_cmd_set;
+*swig_encrypt_cmd_get = *Amanda::Typesc::dumpfile_t_encrypt_cmd_get;
+*swig_encrypt_cmd_set = *Amanda::Typesc::dumpfile_t_encrypt_cmd_set;
+*swig_decrypt_cmd_get = *Amanda::Typesc::dumpfile_t_decrypt_cmd_get;
+*swig_decrypt_cmd_set = *Amanda::Typesc::dumpfile_t_decrypt_cmd_set;
+*swig_srv_decrypt_opt_get = *Amanda::Typesc::dumpfile_t_srv_decrypt_opt_get;
+*swig_srv_decrypt_opt_set = *Amanda::Typesc::dumpfile_t_srv_decrypt_opt_set;
+*swig_clnt_decrypt_opt_get = *Amanda::Typesc::dumpfile_t_clnt_decrypt_opt_get;
+*swig_clnt_decrypt_opt_set = *Amanda::Typesc::dumpfile_t_clnt_decrypt_opt_set;
+*swig_cont_filename_get = *Amanda::Typesc::dumpfile_t_cont_filename_get;
+*swig_cont_filename_set = *Amanda::Typesc::dumpfile_t_cont_filename_set;
+*swig_is_partial_get = *Amanda::Typesc::dumpfile_t_is_partial_get;
+*swig_is_partial_set = *Amanda::Typesc::dumpfile_t_is_partial_set;
+*swig_partnum_get = *Amanda::Typesc::dumpfile_t_partnum_get;
+*swig_partnum_set = *Amanda::Typesc::dumpfile_t_partnum_set;
+*swig_totalparts_get = *Amanda::Typesc::dumpfile_t_totalparts_get;
+*swig_totalparts_set = *Amanda::Typesc::dumpfile_t_totalparts_set;
+*swig_blocksize_get = *Amanda::Typesc::dumpfile_t_blocksize_get;
+*swig_blocksize_set = *Amanda::Typesc::dumpfile_t_blocksize_set;
+sub new {
+    my $pkg = shift;
+    my $self = Amanda::Typesc::new_dumpfile_t(@_);
+    bless $self, $pkg if defined($self);
+}
+
+sub DESTROY {
+    return unless $_[0]->isa('HASH');
+    my $self = tied(%{$_[0]});
+    return unless defined $self;
+    delete $ITERATORS{$self};
+    if (exists $OWNER{$self}) {
+        Amanda::Typesc::delete_dumpfile_t($self);
+        delete $OWNER{$self};
+    }
+}
+
+sub DISOWN {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+    my $self = shift;
+    my $ptr = tied(%$self);
+    $OWNER{$ptr} = 1;
+}
+
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Types;
+
+*F_UNKNOWN = *Amanda::Typesc::F_UNKNOWN;
+*F_WEIRD = *Amanda::Typesc::F_WEIRD;
+*F_TAPESTART = *Amanda::Typesc::F_TAPESTART;
+*F_TAPEEND = *Amanda::Typesc::F_TAPEEND;
+*F_DUMPFILE = *Amanda::Typesc::F_DUMPFILE;
+*F_CONT_DUMPFILE = *Amanda::Typesc::F_CONT_DUMPFILE;
+*F_SPLIT_DUMPFILE = *Amanda::Typesc::F_SPLIT_DUMPFILE;
+*F_EMPTY = *Amanda::Typesc::F_EMPTY;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+=head1 NAME
+
+Amanda::Types - Amanda data structures that are shared by several modules
+
+=head1 SYNOPSIS
+
+This module includes several types which are not specific to any
+single other module.
+
+=head1 API STATUS
+
+New structures may be added, but existing types are stable.
+
+=head1 dumpfile_t
+
+An in-memory representation of an Amanda header, with keys
+=over
+=item C<type>;
+=item C<datestamp>;
+=item C<dumplevel>;
+=item C<compressed>;
+=item C<encrypted>;
+=item C<comp_suffix>;
+=item C<encrypt_suffix>;
+=item C<name> -- hostname or label;
+=item C<disk>;
+=item C<program>;
+=item C<dumper>;
+=item C<srvcompprog>;
+=item C<clntcompprog>;
+=item C<srv_encrypt>;
+=item C<clnt_encrypt>;
+=item C<recover_cmd>;
+=item C<uncompress_cmd>;
+=item C<encrypt_cmd>;
+=item C<decrypt_cmd>;
+=item C<srv_decrypt_opt>;
+=item C<clnt_decrypt_opt>;
+=item C<cont_filename>;
+=item C<is_partial>;
+=item C<partnum>;
+=item C<totalparts> (-1 == UNKNOWN); and
+=item blocksize.
+=back
+
+where C<type> is one of the following constants, which are availble
+for import in the tag C<:filetype_t>:
+=over
+=item C<F_UNKNOWN>;
+=item C<F_WEIRD>;
+=item C<F_TAPESTART>;
+=item C<F_TAPEEND>;
+=item C<F_DUMPFILE>;
+=item C<F_CONT_DUMPFILE>;
+=item C<F_SPLIT_DUMPFILE>; or
+=item C<F_EMPTY>.
+=back
+
+NOTE: no methods are currently defined on C<dumpfile_t>; interfaces
+can be written as needed.
+
+=cut
+
+push @EXPORT_OK, qw(filetype_t_to_strings);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw(filetype_t_to_strings);
+
+my %_filetype_t_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub filetype_t_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_filetype_t_VALUES) {
+       my $v = $_filetype_t_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($F_UNKNOWN);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_UNKNOWN);
+
+$_filetype_t_VALUES{"F_UNKNOWN"} = $F_UNKNOWN;
+
+push @EXPORT_OK, qw($F_WEIRD);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_WEIRD);
+
+$_filetype_t_VALUES{"F_WEIRD"} = $F_WEIRD;
+
+push @EXPORT_OK, qw($F_TAPESTART);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_TAPESTART);
+
+$_filetype_t_VALUES{"F_TAPESTART"} = $F_TAPESTART;
+
+push @EXPORT_OK, qw($F_TAPEEND);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_TAPEEND);
+
+$_filetype_t_VALUES{"F_TAPEEND"} = $F_TAPEEND;
+
+push @EXPORT_OK, qw($F_DUMPFILE);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_DUMPFILE);
+
+$_filetype_t_VALUES{"F_DUMPFILE"} = $F_DUMPFILE;
+
+push @EXPORT_OK, qw($F_CONT_DUMPFILE);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_CONT_DUMPFILE);
+
+$_filetype_t_VALUES{"F_CONT_DUMPFILE"} = $F_CONT_DUMPFILE;
+
+push @EXPORT_OK, qw($F_SPLIT_DUMPFILE);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_SPLIT_DUMPFILE);
+
+$_filetype_t_VALUES{"F_SPLIT_DUMPFILE"} = $F_SPLIT_DUMPFILE;
+
+push @EXPORT_OK, qw($F_EMPTY);
+push @{$EXPORT_TAGS{"filetype_t"}}, qw($F_EMPTY);
+
+$_filetype_t_VALUES{"F_EMPTY"} = $F_EMPTY;
+1;
diff --git a/perl/Amanda/Types.swg b/perl/Amanda/Types.swg
new file mode 100644 (file)
index 0000000..ff23501
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Types"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include "fileheader.h"
+%}
+
+%perlcode %{
+=head1 NAME
+
+Amanda::Types - Amanda data structures that are shared by several modules
+
+=head1 SYNOPSIS
+
+This module includes several types which are not specific to any
+single other module.
+
+=head1 API STATUS
+
+New structures may be added, but existing types are stable.
+
+=head1 dumpfile_t
+
+An in-memory representation of an Amanda header, with keys
+=over
+=item C<type>;
+=item C<datestamp>;
+=item C<dumplevel>;
+=item C<compressed>;
+=item C<encrypted>;
+=item C<comp_suffix>;
+=item C<encrypt_suffix>;
+=item C<name> -- hostname or label;
+=item C<disk>;
+=item C<program>;
+=item C<dumper>;
+=item C<srvcompprog>;
+=item C<clntcompprog>;
+=item C<srv_encrypt>;
+=item C<clnt_encrypt>;
+=item C<recover_cmd>;
+=item C<uncompress_cmd>;
+=item C<encrypt_cmd>;
+=item C<decrypt_cmd>;
+=item C<srv_decrypt_opt>;
+=item C<clnt_decrypt_opt>;
+=item C<cont_filename>;
+=item C<is_partial>;
+=item C<partnum>;
+=item C<totalparts> (-1 == UNKNOWN); and
+=item blocksize.
+=back
+
+where C<type> is one of the following constants, which are availble
+for import in the tag C<:filetype_t>:
+=over
+=item C<F_UNKNOWN>;
+=item C<F_WEIRD>;
+=item C<F_TAPESTART>;
+=item C<F_TAPEEND>;
+=item C<F_DUMPFILE>;
+=item C<F_CONT_DUMPFILE>;
+=item C<F_SPLIT_DUMPFILE>; or
+=item C<F_EMPTY>.
+=back
+
+NOTE: no methods are currently defined on C<dumpfile_t>; interfaces
+can be written as needed.
+
+=cut
+%}
+
+amglue_add_flag_tag_fns(filetype_t);
+amglue_add_constant(F_UNKNOWN, filetype_t);
+amglue_add_constant(F_WEIRD, filetype_t);
+amglue_add_constant(F_TAPESTART, filetype_t);
+amglue_add_constant(F_TAPEEND, filetype_t);
+amglue_add_constant(F_DUMPFILE, filetype_t);
+amglue_add_constant(F_CONT_DUMPFILE, filetype_t);
+amglue_add_constant(F_SPLIT_DUMPFILE, filetype_t);
+amglue_add_constant(F_EMPTY, filetype_t);
+
+typedef char string_t[STRMAX];
+%typemap(memberin) string_t {
+    strncpy($1, $input, STRMAX);
+    if ($1[STRMAX-1] != '\0')
+       SWIG_exception(SWIG_ValueError, "String too large for dumpfile_t");
+}
+
+typedef struct {
+
+    filetype_t type;
+    string_t datestamp;
+    int dumplevel;
+    int compressed;
+    int encrypted;
+    string_t comp_suffix;
+    string_t encrypt_suffix;
+    string_t name;     /* hostname or label */
+    string_t disk;
+    string_t program;
+    string_t dumper;
+    string_t srvcompprog;
+    string_t clntcompprog;
+    string_t srv_encrypt;
+    string_t clnt_encrypt;
+    string_t recover_cmd;
+    string_t uncompress_cmd;
+    string_t encrypt_cmd;
+    string_t decrypt_cmd;
+    string_t srv_decrypt_opt;
+    string_t clnt_decrypt_opt;
+    string_t cont_filename;
+    int is_partial;
+    int partnum;
+    int totalparts; /* -1 == UNKNOWN */
+    size_t blocksize;
+
+    %extend {
+       /* constructor */
+       dumpfile_t(void) {
+           dumpfile_t *df = malloc(sizeof(*df));
+           fh_init(df);
+           return df;
+       }
+
+       /* destructor */
+       ~dumpfile_t(void) {
+           free(self);
+       }
+    }
+} dumpfile_t;
+
+/* TODO: rename to dump_header */
diff --git a/perl/Amanda/Util.c b/perl/Amanda/Util.c
new file mode 100644 (file)
index 0000000..b4cc13e
--- /dev/null
@@ -0,0 +1,2196 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.33
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPERL
+#define SWIG_CASTRANK_MODE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "3"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+       delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {                            
+          if (<need new object>) {                    
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;                       
+          } else {                                    
+            *ptr = <ptr to old object>;               
+            return SWIG_OLDOBJ;                       
+          }                                   
+        } else {                                      
+          return SWIG_BADOBJ;                 
+        }                                             
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store inforomation on one type */
+typedef struct swig_type_info {
+  const char             *name;                        /* mangled name of this type */
+  const char             *str;                 /* human readable name of this type */
+  swig_dycast_func        dcast;               /* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
+  void                   *clientdata;          /* language specific type data */
+  int                    owndata;              /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;           /* function to cast the void pointers */
+  struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;                        /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;              /* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;                 /* Number of types in this module */
+  struct swig_module_info *next;               /* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;       /* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;       /* Array of initially generated casting structures */
+  void                    *clientdata;         /* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+                 const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+       SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+                           const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+       /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+       register size_t i = (l + r) >> 1; 
+       const char *iname = iter->types[i]->name;
+       if (iname) {
+         register int compare = strcmp(name, iname);
+         if (compare == 0) {       
+           return iter->types[i];
+         } else if (compare < 0) {
+           if (i) {
+             r = i - 1;
+           } else {
+             break;
+           }
+         } else if (compare > 0) {
+           l = i + 1;
+         }
+       } else {
+         break; /* should never happen */
+       }
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+                    const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+       if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+         return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError        -1 
+#define  SWIG_IOError             -2 
+#define  SWIG_RuntimeError        -3 
+#define  SWIG_IndexError          -4 
+#define  SWIG_TypeError           -5 
+#define  SWIG_DivisionByZero      -6 
+#define  SWIG_OverflowError       -7 
+#define  SWIG_SyntaxError         -8 
+#define  SWIG_ValueError          -9 
+#define  SWIG_SystemError         -10
+#define  SWIG_AttributeError      -11
+#define  SWIG_MemoryError         -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#ifdef __cplusplus
+/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
+#include <math.h>
+#include <stdlib.h>
+extern "C" {
+#endif
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
+
+/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
+#ifndef PERL_REVISION
+#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
+#    define PERL_PATCHLEVEL_H_IMPLICIT
+#    include <patchlevel.h>
+#  endif
+#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#    include <could_not_find_Perl_patchlevel.h>
+#  endif
+#  ifndef PERL_REVISION
+#    define PERL_REVISION       (5)
+#    define PERL_VERSION        PATCHLEVEL
+#    define PERL_SUBVERSION     SUBVERSION
+#  endif
+#endif
+
+#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
+#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
+#endif
+
+#ifndef SvIOK_UV
+# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
+#endif
+
+#ifndef SvUOK
+# define SvUOK(sv)           SvIOK_UV(sv)
+#endif
+
+#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#  define PL_sv_undef               sv_undef
+#  define PL_na                            na
+#  define PL_errgv                  errgv
+#  define PL_sv_no                  sv_no
+#  define PL_sv_yes                 sv_yes
+#  define PL_markstack_ptr          markstack_ptr
+#endif
+
+#ifndef IVSIZE
+#  ifdef LONGSIZE
+#    define IVSIZE LONGSIZE
+#  else
+#    define IVSIZE 4 /* A bold guess, but the best we can make. */
+#  endif
+#endif
+
+#ifndef INT2PTR
+#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#    define PTRV                  UV
+#    define INT2PTR(any,d)        (any)(d)
+#  else
+#    if PTRSIZE == LONGSIZE
+#      define PTRV                unsigned long
+#    else
+#      define PTRV                unsigned
+#    endif
+#    define INT2PTR(any,d)        (any)(PTRV)(d)
+#  endif
+
+#  define NUM2PTR(any,d)  (any)(PTRV)(d)
+#  define PTR2IV(p)       INT2PTR(IV,p)
+#  define PTR2UV(p)       INT2PTR(UV,p)
+#  define PTR2NV(p)       NUM2PTR(NV,p)
+
+#  if PTRSIZE == LONGSIZE
+#    define PTR2ul(p)     (unsigned long)(p)
+#  else
+#    define PTR2ul(p)     INT2PTR(unsigned long,p)
+#  endif
+#endif /* !INT2PTR */
+
+#ifndef SvPV_nolen
+# define SvPV_nolen(x) SvPV(x,PL_na)
+#endif
+
+#ifndef get_sv
+#  define get_sv perl_get_sv
+#endif
+
+#ifndef ERRSV
+#  define ERRSV get_sv("@",FALSE)
+#endif
+
+#ifndef pTHX_
+#define pTHX_
+#endif   
+
+#include <string.h>
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGINTERN const char*
+SWIG_Perl_ErrorType(int code) {
+  const char* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = "MemoryError";
+    break;
+  case SWIG_IOError:
+    type = "IOError";
+    break;
+  case SWIG_RuntimeError:
+    type = "RuntimeError";
+    break;
+  case SWIG_IndexError:
+    type = "IndexError";
+    break;
+  case SWIG_TypeError:
+    type = "TypeError";
+    break;
+  case SWIG_DivisionByZero:
+    type = "ZeroDivisionError";
+    break;
+  case SWIG_OverflowError:
+    type = "OverflowError";
+    break;
+  case SWIG_SyntaxError:
+    type = "SyntaxError";
+    break;
+  case SWIG_ValueError:
+    type = "ValueError";
+    break;
+  case SWIG_SystemError:
+    type = "SystemError";
+    break;
+  case SWIG_AttributeError:
+    type = "AttributeError";
+    break;
+  default:
+    type = "RuntimeError";
+  }
+  return type;
+}
+
+
+
+
+/* -----------------------------------------------------------------------------
+ * perlrun.swg
+ *
+ * This file contains the runtime support for Perl modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef PERL_OBJECT
+#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
+#define SWIG_PERL_OBJECT_CALL pPerl,
+#else
+#define SWIG_PERL_OBJECT_DECL
+#define SWIG_PERL_OBJECT_CALL
+#endif
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
+#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
+#define SWIG_NewPackedObj(p, s, type)                  SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
+#define SWIG_Error(code, msg)                          sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
+#define SWIG_fail                                      goto fail                                                   
+
+/* Perl-specific SWIG API */
+
+#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
+#define SWIG_MakePackedObj(sv, p, s, type)             SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
+#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
+
+
+#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
+#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
+#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
+#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SWIG_OWNER   SWIG_POINTER_OWN
+#define SWIG_SHADOW  SWIG_OWNER << 1
+
+#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
+
+/* SWIG Perl macros */
+
+/* Macro to declare an XS function */
+#ifndef XSPROTO
+#   define XSPROTO(name) void name(pTHX_ CV* cv)
+#endif
+
+/* Macro to call an XS function */
+#ifdef PERL_OBJECT 
+#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
+#else 
+#  ifndef MULTIPLICITY 
+#    define SWIG_CALLXS(_name) _name(cv) 
+#  else 
+#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
+#  endif 
+#endif 
+
+#ifdef PERL_OBJECT
+#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+#define SWIGCLASS_STATIC
+
+#else /* PERL_OBJECT */
+
+#define MAGIC_PPERL
+#define SWIGCLASS_STATIC static SWIGUNUSED
+
+#ifndef MULTIPLICITY
+#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* MULTIPLICITY */
+
+#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MULTIPLICITY */
+#endif /* PERL_OBJECT */
+
+/* Workaround for bug in perl 5.6.x croak and earlier */
+#if (PERL_VERSION < 8)
+#  ifdef PERL_OBJECT
+#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
+static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+#  else
+static void SWIG_croak_null()
+#  endif
+{
+  SV *err=ERRSV;
+#  if (PERL_VERSION < 6)
+  croak("%_", err);
+#  else
+  if (SvOK(err) && !SvROK(err)) croak("%_", err);
+  croak(Nullch);
+#  endif
+}
+#else
+#  define SWIG_croak_null() croak(Nullch)
+#endif
+
+
+/* 
+   Define how strict is the cast between strings and integers/doubles
+   when overloading between these types occurs.
+   
+   The default is making it as strict as possible by using SWIG_AddCast
+   when needed.
+   
+   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
+   disable the SWIG_AddCast, making the casting between string and
+   numbers less strict.
+
+   In the end, we try to solve the overloading between strings and
+   numerical types in the more natural way, but if you can avoid it,
+   well, avoid it using %rename, for example.
+*/
+#ifndef SWIG_PERL_NO_STRICT_STR2NUM
+# ifndef SWIG_PERL_STRICT_STR2NUM
+#  define SWIG_PERL_STRICT_STR2NUM
+# endif
+#endif
+#ifdef SWIG_PERL_STRICT_STR2NUM
+/* string takes precedence */
+#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
+#else
+/* number takes precedence */
+#define SWIG_Str2NumCast(x) x
+#endif
+
+
+
+#include <stdlib.h>
+
+SWIGRUNTIME const char *
+SWIG_Perl_TypeProxyName(const swig_type_info *type) {
+  if (!type) return NULL;
+  if (type->clientdata != NULL) {
+    return (const char*) type->clientdata;
+  } 
+  else {
+    return type->name;
+  }
+}
+
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
+                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+}
+
+
+/* Function for getting a pointer value */
+
+SWIGRUNTIME int
+SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
+  swig_cast_info *tc;
+  void *voidptr = (void *)0;
+  SV *tsv = 0;
+  /* If magical, apply more magic */
+  if (SvGMAGICAL(sv))
+    mg_get(sv);
+
+  /* Check to see if this is an object */
+  if (sv_isobject(sv)) {
+    IV tmp = 0;
+    tsv = (SV*) SvRV(sv);
+    if ((SvTYPE(tsv) == SVt_PVHV)) {
+      MAGIC *mg;
+      if (SvMAGICAL(tsv)) {
+        mg = mg_find(tsv,'P');
+        if (mg) {
+          sv = mg->mg_obj;
+          if (sv_isobject(sv)) {
+           tsv = (SV*)SvRV(sv);
+            tmp = SvIV(tsv);
+          }
+        }
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      tmp = SvIV(tsv);
+    }
+    voidptr = INT2PTR(void *,tmp);
+  } else if (! SvOK(sv)) {            /* Check for undef */
+    *(ptr) = (void *) 0;
+    return SWIG_OK;
+  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
+    if (!SvROK(sv)) {
+      *(ptr) = (void *) 0;
+      return SWIG_OK;
+    } else {
+      return SWIG_ERROR;
+    }
+  } else {                            /* Don't know what it is */
+    return SWIG_ERROR;
+  }
+  if (_t) {
+    /* Now see if the types match */
+    char *_c = HvNAME(SvSTASH(SvRV(sv)));
+    tc = SWIG_TypeProxyCheck(_c,_t);
+    if (!tc) {
+      return SWIG_ERROR;
+    }
+    *ptr = SWIG_TypeCast(tc,voidptr);
+  } else {
+    *ptr = voidptr;
+  }
+
+  /* 
+   *  DISOWN implementation: we need a perl guru to check this one.
+   */
+  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
+    /* 
+     *  almost copy paste code from below SWIG_POINTER_OWN setting
+     */
+    SV *obj = sv;
+    HV *stash = SvSTASH(SvRV(obj));
+    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
+    if (isGV(gv)) {
+      HV *hv = GvHVn(gv);
+      /*
+       * To set ownership (see below), a newSViv(1) entry is added. 
+       * Hence, to remove ownership, we delete the entry.
+       */
+      if (hv_exists_ent(hv, obj, 0)) {
+       hv_delete_ent(hv, obj, 0, 0);
+      }
+    }
+  }
+  return SWIG_OK;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
+  if (ptr && (flags & SWIG_SHADOW)) {
+    SV *self;
+    SV *obj=newSV(0);
+    HV *hash=newHV();
+    HV *stash;
+    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+    stash=SvSTASH(SvRV(obj));
+    if (flags & SWIG_POINTER_OWN) {
+      HV *hv;
+      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
+      if (!isGV(gv))
+        gv_init(gv, stash, "OWNER", 5, FALSE);
+      hv=GvHVn(gv);
+      hv_store_ent(hv, obj, newSViv(1), 0);
+    }
+    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
+    SvREFCNT_dec(obj);
+    self=newRV_noinc((SV *)hash);
+    sv_setsv(sv, self);
+    SvREFCNT_dec((SV *)self);
+    sv_bless(sv, stash);
+  }
+  else {
+    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
+  }
+}
+
+SWIGRUNTIMEINLINE SV *
+SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
+  SV *result = sv_newmortal();
+  SWIG_MakePtr(result, ptr, t, flags);
+  return result;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  strcpy(r,SWIG_Perl_TypeProxyName(type));
+  sv_setpv(sv, result);
+}
+
+SWIGRUNTIME SV *
+SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
+  SV *result = sv_newmortal();
+  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
+  return result;
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c = 0;
+
+  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
+  c = SvPV_nolen(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') return SWIG_ERROR;
+  c++;
+  c = SWIG_UnpackData(c,ptr,sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c,ty);
+    if (!tc) return SWIG_ERROR;
+  }
+  return SWIG_OK;
+}
+
+
+/* Macros for low-level exception handling */
+#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
+
+
+typedef XSPROTO(SwigPerlWrapper);
+typedef SwigPerlWrapper *SwigPerlWrapperPtr;
+
+/* Structure for command table */
+typedef struct {
+  const char         *name;
+  SwigPerlWrapperPtr  wrapper;
+} swig_command_info;
+
+/* Information for constant table */
+
+#define SWIG_INT     1
+#define SWIG_FLOAT   2
+#define SWIG_STRING  3
+#define SWIG_POINTER 4
+#define SWIG_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_constant_info {
+    int              type;
+    const char      *name;
+    long             lvalue;
+    double           dvalue;
+    void            *pvalue;
+    swig_type_info **ptype;
+} swig_constant_info;
+
+
+/* Structure for variable table */
+typedef struct {
+  const char   *name;
+  SwigMagicFunc   set;
+  SwigMagicFunc   get;
+  swig_type_info  **type;
+} swig_variable_info;
+
+/* Magic variable code */
+#ifndef PERL_OBJECT
+#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
+  #ifndef MULTIPLICITY
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
+  #else
+     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
+  #endif
+#else
+#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
+SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
+#endif
+{
+  MAGIC *mg;
+  sv_magic(sv,sv,'U',(char *) name,strlen(name));
+  mg = mg_find(sv,'U');
+  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
+  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
+  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
+  mg->mg_virtual->svt_len = 0;
+  mg->mg_virtual->svt_clear = 0;
+  mg->mg_virtual->svt_free = 0;
+}
+
+
+SWIGRUNTIME swig_module_info *
+SWIG_Perl_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  SV *pointer;
+
+  /* first check if pointer already created */
+  if (!type_pointer) {
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    if (pointer && SvOK(pointer)) {
+      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
+    }
+  }
+
+  return (swig_module_info *) type_pointer;
+}
+
+SWIGRUNTIME void
+SWIG_Perl_SetModule(swig_module_info *module) {
+  SV *pointer;
+
+  /* create a new pointer */
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  sv_setiv(pointer, PTR2IV(module));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Workaround perl5 global namespace pollution. Note that undefining library
+ * functions like fopen will not solve the problem on all platforms as fopen
+ * might be a macro on Windows but not necessarily on other operating systems. */
+#ifdef do_open
+  #undef do_open
+#endif
+#ifdef do_close
+  #undef do_close
+#endif
+#ifdef scalar
+  #undef scalar
+#endif
+#ifdef list
+  #undef list
+#endif
+#ifdef apply
+  #undef apply
+#endif
+#ifdef convert
+  #undef convert
+#endif
+#ifdef Error
+  #undef Error
+#endif
+#ifdef form
+  #undef form
+#endif
+#ifdef vform
+  #undef vform
+#endif
+#ifdef LABEL
+  #undef LABEL
+#endif
+#ifdef METHOD
+  #undef METHOD
+#endif
+#ifdef Move
+  #undef Move
+#endif
+#ifdef yylex
+  #undef yylex
+#endif
+#ifdef yyparse
+  #undef yyparse
+#endif
+#ifdef yyerror
+  #undef yyerror
+#endif
+#ifdef invert
+  #undef invert
+#endif
+#ifdef ref
+  #undef ref
+#endif
+#ifdef read
+  #undef read
+#endif
+#ifdef write
+  #undef write
+#endif
+#ifdef eof
+  #undef eof
+#endif
+#ifdef bool
+  #undef bool
+#endif
+#ifdef close
+  #undef close
+#endif
+#ifdef rewind
+  #undef rewind
+#endif
+#ifdef free
+  #undef free
+#endif
+#ifdef malloc
+  #undef malloc
+#endif
+#ifdef calloc
+  #undef calloc
+#endif
+#ifdef Stat
+  #undef Stat
+#endif
+#ifdef check
+  #undef check
+#endif
+#ifdef seekdir
+  #undef seekdir
+#endif
+#ifdef open
+  #undef open
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_float swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_unsigned_char swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    boot_Amanda__Util
+
+#define SWIG_name   "Amanda::Utilc::boot_Amanda__Util"
+#define SWIG_prefix "Amanda::Utilc::"
+
+#define SWIGVERSION 0x010333 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+#ifndef PERL_OBJECT
+#ifndef MULTIPLICITY
+SWIGEXPORT void SWIG_init (CV* cv);
+#else
+SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
+#endif
+#else
+SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
+#endif
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "amglue.h"
+
+
+#include "debug.h"
+/* use a relative path here to avoid conflicting with Perl's util.h. */
+#include "../common-src/util.h"
+#include "file.h"
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
+{    
+  SV *obj = sv_newmortal();
+  sv_setiv(obj, (IV) value);
+  return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
+{    
+  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (SvPOK(obj)) {
+    STRLEN len = 0;
+    char *cstr = SvPV(obj, len); 
+    size_t size = len + 1;
+    if (cptr)  {
+      if (alloc) {
+       if (*alloc == SWIG_NEWOBJ) {
+         *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+       } else {
+         *cptr = cstr;
+         *alloc = SWIG_OLDOBJ;
+       }
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      char* vptr = 0; 
+      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+       if (cptr) *cptr = vptr;
+       if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+       if (alloc) *alloc = SWIG_OLDOBJ;
+       return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
+{
+  if (SvNIOK(obj)) {
+    if (val) *val = SvNV(obj);
+    return SWIG_OK;
+  } else if (SvIOK(obj)) {
+    if (val) *val = (double) SvIV(obj);
+    return SWIG_AddCast(SWIG_OK);
+  } else {
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      double v = strtod(nptr, &endptr);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
+{
+  if (SvIOK(obj)) {
+    if (val) *val = SvIV(obj);
+    return SWIG_OK;
+  } else {
+    int dispatch = 0;
+    const char *nptr = SvPV_nolen(obj);
+    if (nptr) {
+      char *endptr;
+      long v;
+      errno = 0;
+      v = strtol(nptr, &endptr,0);
+      if (errno == ERANGE) {
+       errno = 0;
+       return SWIG_OverflowError;
+      } else {
+       if (*endptr == '\0') {
+         if (val) *val = v;
+         return SWIG_Str2NumCast(SWIG_OK);
+       }
+      }
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+       if (val) *val = (long)(d);
+       return res;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+void
+set_erroutput_type(char *type, char *context)
+{
+    if (strcmp(context, "cmdline") == 0) {
+       erroutput_type = ERR_INTERACTIVE;
+    } else if (strcmp(context, "daemon") == 0) {
+       if (strcmp(type, "server") == 0) {
+           erroutput_type = ERR_INTERACTIVE|ERR_AMANDALOG;
+       } else if (strcmp(type, "client") == 0) {
+           erroutput_type = ERR_INTERACTIVE|ERR_SYSLOG;
+       }
+    }
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda::Util_var::
+class _wrap_Amanda::Util_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+    MAGIC_PPERL
+    croak("Value is read-only.");
+    return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_set_pname) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: set_pname(name);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_pname" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    set_pname(arg1);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_safe_cd) {
+  {
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 0) || (items > 0)) {
+      SWIG_croak("Usage: safe_cd();");
+    }
+    safe_cd();
+    
+    XSRETURN(argvi);
+  fail:
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_check_running_as) {
+  {
+    running_as_flags arg1 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: check_running_as(who);");
+    }
+    {
+      if (sizeof(signed int) == 1) {
+        arg1 = amglue_SvI8(ST(0));
+      } else if (sizeof(signed int) == 2) {
+        arg1 = amglue_SvI16(ST(0));
+      } else if (sizeof(signed int) == 4) {
+        arg1 = amglue_SvI32(ST(0));
+      } else if (sizeof(signed int) == 8) {
+        arg1 = amglue_SvI64(ST(0));
+      } else {
+        g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
+      }
+    }
+    check_running_as(arg1);
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_set_erroutput_type) {
+  {
+    char *arg1 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int res2 ;
+    char *buf2 = 0 ;
+    int alloc2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: set_erroutput_type(type,context);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_erroutput_type" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "set_erroutput_type" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    set_erroutput_type(arg1,arg2);
+    
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *|running_as_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_unsigned_char,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_unsigned_char,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_constant_info swig_constants[] = {
+{0,0,0,0,0,0}
+};
+#ifdef __cplusplus
+}
+#endif
+static swig_variable_info swig_variables[] = {
+{0,0,0,0}
+};
+static swig_command_info swig_commands[] = {
+{"Amanda::Utilc::set_pname", _wrap_set_pname},
+{"Amanda::Utilc::safe_cd", _wrap_safe_cd},
+{"Amanda::Utilc::check_running_as", _wrap_check_running_as},
+{"Amanda::Utilc::set_erroutput_type", _wrap_set_erroutput_type},
+{0,0}
+};
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+XS(SWIG_init) {
+  dXSARGS;
+  int i;
+  
+  SWIG_InitializeModule(0);
+  
+  /* Install commands */
+  for (i = 0; swig_commands[i].name; i++) {
+    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
+  }
+  
+  /* Install variables */
+  for (i = 0; swig_variables[i].name; i++) {
+    SV *sv;
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    if (swig_variables[i].type) {
+      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
+    } else {
+      sv_setiv(sv,(IV) 0);
+    }
+    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
+  }
+  
+  /* Install constant */
+  for (i = 0; swig_constants[i].type; i++) {
+    SV *sv;
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    switch(swig_constants[i].type) {
+    case SWIG_INT:
+      sv_setiv(sv, (IV) swig_constants[i].lvalue);
+      break;
+    case SWIG_FLOAT:
+      sv_setnv(sv, (double) swig_constants[i].dvalue);
+      break;
+    case SWIG_STRING:
+      sv_setpv(sv, (char *) swig_constants[i].pvalue);
+      break;
+    case SWIG_POINTER:
+      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
+      break;
+    case SWIG_BINARY:
+      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
+      break;
+    default:
+      break;
+    }
+    SvREADONLY_on(sv);
+  }
+  
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "RUNNING_AS_ROOT", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(RUNNING_AS_ROOT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "RUNNING_AS_DUMPUSER", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(RUNNING_AS_DUMPUSER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "RUNNING_AS_DUMPUSER_PREFERRED", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(RUNNING_AS_DUMPUSER_PREFERRED)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "RUNNING_AS_CLIENT_LOGIN", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(RUNNING_AS_CLIENT_LOGIN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "RUNNING_AS_UID_ONLY", TRUE | 0x2);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(RUNNING_AS_UID_ONLY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  ST(0) = &PL_sv_yes;
+  XSRETURN(1);
+}
+
diff --git a/perl/Amanda/Util.pm b/perl/Amanda/Util.pm
new file mode 100644 (file)
index 0000000..732e80a
--- /dev/null
@@ -0,0 +1,274 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.33
+#
+# Don't modify this file, modify the SWIG interface instead.
+
+package Amanda::Util;
+require Exporter;
+require DynaLoader;
+@ISA = qw(Exporter DynaLoader);
+package Amanda::Utilc;
+bootstrap Amanda::Util;
+package Amanda::Util;
+@EXPORT = qw( );
+
+# ---------- BASE METHODS -------------
+
+package Amanda::Util;
+
+sub TIEHASH {
+    my ($classname,$obj) = @_;
+    return bless $obj, $classname;
+}
+
+sub CLEAR { }
+
+sub FIRSTKEY { }
+
+sub NEXTKEY { }
+
+sub FETCH {
+    my ($self,$field) = @_;
+    my $member_func = "swig_${field}_get";
+    $self->$member_func();
+}
+
+sub STORE {
+    my ($self,$field,$newval) = @_;
+    my $member_func = "swig_${field}_set";
+    $self->$member_func($newval);
+}
+
+sub this {
+    my $ptr = shift;
+    return tied(%$ptr);
+}
+
+
+# ------- FUNCTION WRAPPERS --------
+
+package Amanda::Util;
+
+*set_pname = *Amanda::Utilc::set_pname;
+*safe_cd = *Amanda::Utilc::safe_cd;
+*check_running_as = *Amanda::Utilc::check_running_as;
+*set_erroutput_type = *Amanda::Utilc::set_erroutput_type;
+
+# ------- VARIABLE STUBS --------
+
+package Amanda::Util;
+
+*RUNNING_AS_ROOT = *Amanda::Utilc::RUNNING_AS_ROOT;
+*RUNNING_AS_DUMPUSER = *Amanda::Utilc::RUNNING_AS_DUMPUSER;
+*RUNNING_AS_DUMPUSER_PREFERRED = *Amanda::Utilc::RUNNING_AS_DUMPUSER_PREFERRED;
+*RUNNING_AS_CLIENT_LOGIN = *Amanda::Utilc::RUNNING_AS_CLIENT_LOGIN;
+*RUNNING_AS_UID_ONLY = *Amanda::Utilc::RUNNING_AS_UID_ONLY;
+
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+
+use Amanda::Debug qw(:init);
+use Carp;
+use POSIX qw(:fcntl_h);
+
+=head1 NAME
+
+Amanda::Util - Runtime support for Amanda applications
+
+=head1 Application Initialization
+
+Application initialization generally looks like this:
+
+  use Amanda::Config qw( :init );
+  use Amanda::Util qw( :check_running_as_flags );
+  use Amanda::Debug;
+
+  Amanda::Util::setup_application("myapp", "server", "cmdline");
+  # .. command-line processing ..
+  Amanda::Config::config_init(...);
+  Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+=over
+
+=item C<setup_application($name, $type, $context)>
+
+Set up the operating environment for an application, without requiring
+any configuration.
+
+=over
+
+=item C<$name> is the name of the application, used in log messages, etc.
+
+=item C<$type> is one of "server" or "client".
+
+=item C<$context> is one of "cmdline" for a user-invoked command-line
+utility (e.g., C<amadmin>) or "daemon" for a program started by
+C<amandad>.  (TODO: daemon is not supported yet)
+
+=back
+
+Based on C<$type> and C<$context>, this function does the following:
+
+=over
+
+=item sets up debug logging;
+
+=item configures internationalization
+
+=item sets the umask;
+
+=item sets the current working directory to the debug or temporary directory;
+
+=item closes any unnecessary file descriptors as a security meaasure;
+
+=item ignores C<SIGPIPE>; and
+
+=item sets the appropriate target for error messages.
+
+=back
+
+=cut
+
+# private package variables
+my $_pname;
+my $_ptype;
+my $_pcontext;
+
+sub setup_application {
+    my ($name, $type, $context) = @_;
+
+    # sanity check
+    croak("no name given") unless ($name);
+    croak("no type given") unless ($type);
+    croak("no context given") unless ($context);
+
+    # store these as perl values
+    $_pname = $name;
+    $_ptype = $type;
+    $_pcontext = $context;
+
+    # and let the C side know about the pname
+    set_pname($name);
+
+    safe_cd(); # (also sets umask)
+    check_std_fds();
+
+    # set up debugging for this application type
+    dbopen($type);
+
+    # ignore SIGPIPE
+    $SIG{'PIPE'} = 'IGNORE';
+
+    set_erroutput_type($type, $context);
+}
+
+=item C<finish_setup($running_as_flags)>
+
+Perform final initialization tasks that require a loaded configuration.
+Specifically, move the debug log into a configuration-specific
+subdirectory, and check that the current userid is appropriate for
+this applciation.
+
+The user is specified by one of the following flags, which are
+available in export tag C<:check_running_as_flags>:
+
+  $RUNNING_AS_ROOT                # root
+  $RUNNING_AS_DUMPUSER            # dumpuser, from configuration
+  $RUNNING_AS_DUMPUSER_PREFERRED  # dumpuser, but client_login is OK too
+  $RUNNING_AS_CLIENT_LOGIN        # client_login (--with-user at build time)
+
+If the flag C<$RUNNING_AS_UID_ONLY> is bit-or'd into C<$running_as_flags>, then
+the euid is ignored; this is used for programs that expect to be setuid-root.
+
+=cut
+
+sub finish_setup {
+    my ($running_as) = @_;
+
+    my $config_name = Amanda::Config::get_config_name();
+
+    if ($config_name) {
+       dbrename($config_name, $_ptype);
+    }
+
+    check_running_as($running_as);
+}
+
+=item safe_env
+
+Return a "safe" environment hash.  For non-setuid programs, this means filtering out any
+localization variables.
+
+=cut
+
+sub safe_env {
+    my %rv = %ENV;
+
+    delete @rv{qw(IFS CDPATH ENV BASH_ENV LANG)};
+
+    # delete all LC_* variables
+    for my $var (grep /^LC_/, keys %rv) {
+        delete $rv{$var};
+    }
+
+    return %rv;
+}
+
+
+push @EXPORT_OK, qw(running_as_flags_to_strings);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw(running_as_flags_to_strings);
+
+my %_running_as_flags_VALUES;
+#Convert a flag value to a list of names for flags that are set.
+sub running_as_flags_to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_running_as_flags_VALUES) {
+       my $v = $_running_as_flags_VALUES{$k};
+
+       #is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+#by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+
+push @EXPORT_OK, qw($RUNNING_AS_ROOT);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw($RUNNING_AS_ROOT);
+
+$_running_as_flags_VALUES{"RUNNING_AS_ROOT"} = $RUNNING_AS_ROOT;
+
+push @EXPORT_OK, qw($RUNNING_AS_DUMPUSER);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw($RUNNING_AS_DUMPUSER);
+
+$_running_as_flags_VALUES{"RUNNING_AS_DUMPUSER"} = $RUNNING_AS_DUMPUSER;
+
+push @EXPORT_OK, qw($RUNNING_AS_DUMPUSER_PREFERRED);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw($RUNNING_AS_DUMPUSER_PREFERRED);
+
+$_running_as_flags_VALUES{"RUNNING_AS_DUMPUSER_PREFERRED"} = $RUNNING_AS_DUMPUSER_PREFERRED;
+
+push @EXPORT_OK, qw($RUNNING_AS_CLIENT_LOGIN);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw($RUNNING_AS_CLIENT_LOGIN);
+
+$_running_as_flags_VALUES{"RUNNING_AS_CLIENT_LOGIN"} = $RUNNING_AS_CLIENT_LOGIN;
+
+push @EXPORT_OK, qw($RUNNING_AS_UID_ONLY);
+push @{$EXPORT_TAGS{"running_as_flags"}}, qw($RUNNING_AS_UID_ONLY);
+
+$_running_as_flags_VALUES{"RUNNING_AS_UID_ONLY"} = $RUNNING_AS_UID_ONLY;
+
+sub check_std_fds {
+    fcntl(STDIN, F_GETFD, 0) or critical("Standard input is not open");
+    fcntl(STDOUT, F_GETFD, 0) or critical("Standard output is not open");
+    fcntl(STDERR, F_GETFD, 0) or critical("Standard error is not open");
+}
+1;
diff --git a/perl/Amanda/Util.swg b/perl/Amanda/Util.swg
new file mode 100644 (file)
index 0000000..e67a471
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%module "Amanda::Util"
+%include "amglue/amglue.swg"
+%include "exception.i"
+
+%{
+#include "debug.h"
+/* use a relative path here to avoid conflicting with Perl's util.h. */
+#include "../common-src/util.h"
+#include "file.h"
+%}
+
+%perlcode %{
+use Amanda::Debug qw(:init);
+use Carp;
+use POSIX qw(:fcntl_h);
+
+=head1 NAME
+
+Amanda::Util - Runtime support for Amanda applications
+
+=head1 Application Initialization
+
+Application initialization generally looks like this:
+
+  use Amanda::Config qw( :init );
+  use Amanda::Util qw( :check_running_as_flags );
+  use Amanda::Debug;
+
+  Amanda::Util::setup_application("myapp", "server", "cmdline");
+  # .. command-line processing ..
+  Amanda::Config::config_init(...);
+  Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+=over
+
+=item C<setup_application($name, $type, $context)>
+
+Set up the operating environment for an application, without requiring
+any configuration.
+
+=over
+
+=item C<$name> is the name of the application, used in log messages, etc.
+
+=item C<$type> is one of "server" or "client".
+
+=item C<$context> is one of "cmdline" for a user-invoked command-line
+utility (e.g., C<amadmin>) or "daemon" for a program started by
+C<amandad>.  (TODO: daemon is not supported yet)
+
+=back
+
+Based on C<$type> and C<$context>, this function does the following:
+
+=over
+
+=item sets up debug logging;
+
+=item configures internationalization
+
+=item sets the umask;
+
+=item sets the current working directory to the debug or temporary directory;
+
+=item closes any unnecessary file descriptors as a security meaasure;
+
+=item ignores C<SIGPIPE>; and
+
+=item sets the appropriate target for error messages.
+
+=back
+
+=cut
+
+# private package variables
+my $_pname;
+my $_ptype;
+my $_pcontext;
+
+sub setup_application {
+    my ($name, $type, $context) = @_;
+
+    # sanity check
+    croak("no name given") unless ($name);
+    croak("no type given") unless ($type);
+    croak("no context given") unless ($context);
+
+    # store these as perl values
+    $_pname = $name;
+    $_ptype = $type;
+    $_pcontext = $context;
+
+    # and let the C side know about the pname
+    set_pname($name);
+
+    safe_cd(); # (also sets umask)
+    check_std_fds();
+
+    # set up debugging for this application type
+    dbopen($type);
+
+    # ignore SIGPIPE
+    $SIG{'PIPE'} = 'IGNORE';
+
+    set_erroutput_type($type, $context);
+}
+
+=item C<finish_setup($running_as_flags)>
+
+Perform final initialization tasks that require a loaded configuration.
+Specifically, move the debug log into a configuration-specific
+subdirectory, and check that the current userid is appropriate for
+this applciation.
+
+The user is specified by one of the following flags, which are
+available in export tag C<:check_running_as_flags>:
+
+  $RUNNING_AS_ROOT                # root
+  $RUNNING_AS_DUMPUSER            # dumpuser, from configuration
+  $RUNNING_AS_DUMPUSER_PREFERRED  # dumpuser, but client_login is OK too
+  $RUNNING_AS_CLIENT_LOGIN        # client_login (--with-user at build time)
+
+If the flag C<$RUNNING_AS_UID_ONLY> is bit-or'd into C<$running_as_flags>, then
+the euid is ignored; this is used for programs that expect to be setuid-root.
+
+=cut
+
+sub finish_setup {
+    my ($running_as) = @_;
+
+    my $config_name = Amanda::Config::get_config_name();
+
+    if ($config_name) {
+       dbrename($config_name, $_ptype);
+    }
+
+    check_running_as($running_as);
+}
+
+=item safe_env
+
+Return a "safe" environment hash.  For non-setuid programs, this means filtering out any
+localization variables.
+
+=cut
+
+sub safe_env {
+    my %rv = %ENV;
+
+    delete @rv{qw(IFS CDPATH ENV BASH_ENV LANG)};
+
+    # delete all LC_* variables
+    for my $var (grep /^LC_/, keys %rv) {
+        delete $rv{$var};
+    }
+
+    return %rv;
+}
+
+%}
+
+amglue_add_flag_tag_fns(running_as_flags);
+amglue_add_constant(RUNNING_AS_ROOT, running_as_flags);
+amglue_add_constant(RUNNING_AS_DUMPUSER, running_as_flags);
+amglue_add_constant(RUNNING_AS_DUMPUSER_PREFERRED, running_as_flags);
+amglue_add_constant(RUNNING_AS_CLIENT_LOGIN, running_as_flags);
+amglue_add_constant(RUNNING_AS_UID_ONLY, running_as_flags);
+
+/* -------------------------------------------------------------------------
+ * Functions below this line are only meant to be called within this module;
+ * do not call them externally. */
+
+void set_pname(char *name);
+void safe_cd(void);
+
+void check_running_as(running_as_flags who);
+
+/* Set erroutput_type as appropriate for this process type and context.
+ *
+ * @param type: process type
+ * @param context: process context
+ */
+%inline %{
+void
+set_erroutput_type(char *type, char *context)
+{
+    if (strcmp(context, "cmdline") == 0) {
+       erroutput_type = ERR_INTERACTIVE;
+    } else if (strcmp(context, "daemon") == 0) {
+       if (strcmp(type, "server") == 0) {
+           erroutput_type = ERR_INTERACTIVE|ERR_AMANDALOG;
+       } else if (strcmp(type, "client") == 0) {
+           erroutput_type = ERR_INTERACTIVE|ERR_SYSLOG;
+       }
+    }
+}
+%}
+
+/* Check that fd's 0, 1, and 2 are open, calling critical() if not.
+ */
+%perlcode %{
+sub check_std_fds {
+    fcntl(STDIN, F_GETFD, 0) or critical("Standard input is not open");
+    fcntl(STDOUT, F_GETFD, 0) or critical("Standard output is not open");
+    fcntl(STDERR, F_GETFD, 0) or critical("Standard error is not open");
+}
+%}
diff --git a/perl/Makefile.am b/perl/Makefile.am
new file mode 100644 (file)
index 0000000..701ae47
--- /dev/null
@@ -0,0 +1,210 @@
+##
+## Prepare for SWIGging
+## 
+
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+
+# add the SWIG symbol to avoid conflicts with perl definitions.
+# $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
+# to trigger warnings
+AM_CFLAGS = -DSWIG
+
+# Appropriate INCLUDES depends on which components (server or client) are 
+# being built
+INCLUDES =  \
+            -I$(top_builddir)/common-src \
+            -I$(top_srcdir)/common-src \
+            -I$(top_srcdir)/perl/amglue \
+            -I$(top_srcdir)/gnulib \
+            $(PERL_INC)
+
+if WANT_SERVER
+INCLUDES += -I$(top_srcdir)/device-src \
+           -I$(top_srcdir)/server-src
+endif
+
+if WANT_CLIENT
+INCLUDES += -I$(top_srcdir)/client-src
+endif
+
+if WANT_RESTORE
+INCLUDES += -I$(top_srcdir)/restore-src
+endif
+
+if WANT_RECOVER
+INCLUDES += -I$(top_srcdir)/recover-src
+endif
+
+# (amplot has a conditional, but doesn't have any header files)
+
+##
+## libamglue -- helper functions for gluing amanda to perl
+##
+
+amlib_LTLIBRARIES = libamglue.la
+libamglue_la_SOURCES = \
+       amglue/ghashtable.c \
+       amglue/bigint.c \
+       amglue/amglue.h
+libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+EXTRA_DIST += $(libamglue_la_SOURCES)
+
+##
+## SWIG-generated packages
+##
+
+# Tell libtool to not bother versioning the libs we build, since perl won't
+# pay attention to such things, anyway.
+PERL_EXT_LDFLAGS = -avoid-version
+
+# And add any flags the user has requested; on FreeBSD, this pulls in the 
+# threading library
+PERL_EXT_LDFLAGS += $(PERLEXTLIBS)
+
+# list our SWIG libraries. 
+AMGLUE_SWG = amglue/amglue.swg \
+       amglue/amglue.swg \
+       amglue/constants.swg \
+       amglue/exports.swg \
+       amglue/glib.swg \
+       amglue/integers.swg
+EXTRA_DIST += $(AMGLUE_SWG)
+
+# SWIG OPTIONS:
+# -perl5 -proxy: generate perl code, with proxy (shadow) classes
+# -DSWIG_TYPE_TABLE: the name for the global type table; customized
+#  to minimize type collisions with other SWIG-generated modules
+# -I$(srcdir) use include files relative to this directory
+SWIG_OPTIONS=-perl5 -proxy -DSWIG_TYPE_TABLE=SWIG_TYPES_Amanda -I$(srcdir)
+
+# Suffix rules.  These are parallel-build compatible, but may cause
+# strange behavior if there are other .c files in this directory.  The
+# 'rm -f $@' is needed because SWIG sometimes fails to remove its output
+# file in the event of a syntax error.  .i files are pre-processor output;
+# they are only used during development.
+%.c : %.swg $(AMGLUE_SWG)
+       $(mkdir_p) `dirname $@`
+       $(SWIG) $(SWIG_OPTIONS) -o $@ $(top_srcdir)/perl/$< || { rm -f $@; false; }
+%.pm : %.c
+       @echo "$@ was produced as a side-effect of creating $<"
+%.i : %.swg $(AMGLUE_SWG)
+       $(SWIG) $(SWIG_OPTIONS) -E $(top_srcdir)/perl/$< >$@
+
+Amandadir=$(amperldir)/Amanda
+Amanda_DATA =
+
+if WANT_SERVER
+# PACKAGE: Amanda::Device
+libDevicedir = $(amperldir)/auto/Amanda/Device
+libDevice_LTLIBRARIES = libDevice.la
+libDevice_la_SOURCES = Amanda/Device.c $(AMGLUE_SWG)
+libDevice_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libDevice_la_LIBADD = libamglue.la \
+       $(top_builddir)/device-src/libamdevice.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Device.pm
+EXTRA_DIST += Amanda/Device.swg Amanda/Device.pm
+MAINTAINERCLEANFILES += Amanda/Device.c Amanda/Device.pm
+
+# PACKAGE: Amanda::Logfile
+libLogfiledir = $(amperldir)/auto/Amanda/Logfile
+libLogfile_LTLIBRARIES = libLogfile.la
+libLogfile_la_SOURCES = Amanda/Logfile.c $(AMGLUE_SWG)
+libLogfile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libLogfile_la_LIBADD = libamglue.la \
+       $(top_builddir)/server-src/libamserver.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Logfile.pm
+EXTRA_DIST += Amanda/Logfile.swg Amanda/Logfile.pm
+MAINTAINERCLEANFILES += Amanda/Logfile.c Amanda/Logfile.pm
+
+# PACKAGE: Amanda::Cmdline
+libCmdlinedir = $(amperldir)/auto/Amanda/Cmdline
+libCmdline_LTLIBRARIES = libCmdline.la
+libCmdline_la_SOURCES = Amanda/Cmdline.c $(AMGLUE_SWG)
+libCmdline_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libCmdline_la_LIBADD = libamglue.la \
+       $(top_builddir)/server-src/libamserver.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Cmdline.pm
+EXTRA_DIST += Amanda/Cmdline.swg Amanda/Cmdline.pm
+MAINTAINERCLEANFILES += Amanda/Cmdline.c Amanda/Cmdline.pm
+
+# PACKAGE: Amanda::Tapefile
+libTapefiledir = $(amperldir)/auto/Amanda/Tapefile
+libTapefile_LTLIBRARIES = libTapefile.la
+libTapefile_la_SOURCES = Amanda/Tapefile.c $(AMGLUE_SWG)
+libTapefile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libTapefile_la_LIBADD = libamglue.la \
+       $(top_builddir)/server-src/libamserver.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Tapefile.pm
+EXTRA_DIST += Amanda/Tapefile.swg Amanda/Tapefile.pm
+MAINTAINERCLEANFILES += Amanda/Tapefile.c Amanda/Tapefile.pm
+
+# PACKAGE: Amanda::Changer
+Amanda_DATA += Amanda/Changer.pm
+EXTRA_DIST += Amanda/Changer.pm
+
+endif
+
+# PACKAGE: Amanda::Debug
+libDebugdir = $(amperldir)/auto/Amanda/Debug
+libDebug_LTLIBRARIES = libDebug.la
+libDebug_la_SOURCES = Amanda/Debug.c $(AMGLUE_SWG)
+libDebug_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libDebug_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Debug.pm
+EXTRA_DIST += Amanda/Debug.swg Amanda/Debug.pm
+MAINTAINERCLEANFILES += Amanda/Debug.c Amanda/Debug.pm
+
+# PACKAGE: Amanda::Config
+libConfigdir = $(amperldir)/auto/Amanda/Config
+libConfig_LTLIBRARIES = libConfig.la
+libConfig_la_SOURCES = Amanda/Config.c $(AMGLUE_SWG)
+libConfig_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libConfig_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Config.pm
+EXTRA_DIST += Amanda/Config.swg Amanda/Config.pm
+MAINTAINERCLEANFILES += Amanda/Config.c Amanda/Config.pm
+
+# PACKAGE: Amanda::Util
+libUtildir = $(amperldir)/auto/Amanda/Util
+libUtil_LTLIBRARIES = libUtil.la
+libUtil_la_SOURCES = Amanda/Util.c $(AMGLUE_SWG)
+libUtil_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libUtil_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Util.pm
+EXTRA_DIST += Amanda/Util.swg Amanda/Util.pm
+MAINTAINERCLEANFILES += Amanda/Util.c Amanda/Util.pm
+
+# PACKAGE: Amanda::Types
+libTypesdir = $(amperldir)/auto/Amanda/Types
+libTypes_LTLIBRARIES = libTypes.la
+libTypes_la_SOURCES = Amanda/Types.c $(AMGLUE_SWG)
+libTypes_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libTypes_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+Amanda_DATA += Amanda/Types.pm
+EXTRA_DIST += Amanda/Types.swg Amanda/Types.pm
+MAINTAINERCLEANFILES += Amanda/Types.c Amanda/Types.pm
+
+# PACKAGE: Amanda::Paths
+Amanda_DATA += Amanda/Paths.pm
+EXTRA_DIST += Amanda/Paths.pm.in
+DISTCLEANFILES += Amanda/Paths.pm
+
+# perl doesn't use the cyg prefix and it doesn't search in the bin
+# directory, dll must be copied to their modules directories.
+if WANT_CYGWIN_COPY_PERL_DLL
+amperldirauto="$(DESTDIR)$(amperldir)/auto/Amanda"
+install-data-hook:
+       @for cygdll in $(amperldirauto)/bin/cyg*.dll; do \
+           destfname=`echo $$cygdll|sed 's!/bin/cyg\([^.]*\).dll!/\1/\1.dll!'`; \
+           cp "$$cygdll" "$$destfname"; \
+       done
+endif
diff --git a/perl/Makefile.in b/perl/Makefile.in
new file mode 100644 (file)
index 0000000..8427359
--- /dev/null
@@ -0,0 +1,1684 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
+@WANT_SERVER_TRUE@am__append_1 = -I$(top_srcdir)/device-src \
+@WANT_SERVER_TRUE@         -I$(top_srcdir)/server-src
+
+@WANT_CLIENT_TRUE@am__append_2 = -I$(top_srcdir)/client-src
+@WANT_RESTORE_TRUE@am__append_3 = -I$(top_srcdir)/restore-src
+@WANT_RECOVER_TRUE@am__append_4 = -I$(top_srcdir)/recover-src
+
+# PACKAGE: Amanda::Changer
+@WANT_SERVER_TRUE@am__append_5 = Amanda/Device.pm Amanda/Logfile.pm \
+@WANT_SERVER_TRUE@     Amanda/Cmdline.pm Amanda/Tapefile.pm \
+@WANT_SERVER_TRUE@     Amanda/Changer.pm
+@WANT_SERVER_TRUE@am__append_6 = Amanda/Device.swg Amanda/Device.pm \
+@WANT_SERVER_TRUE@     Amanda/Logfile.swg Amanda/Logfile.pm \
+@WANT_SERVER_TRUE@     Amanda/Cmdline.swg Amanda/Cmdline.pm \
+@WANT_SERVER_TRUE@     Amanda/Tapefile.swg Amanda/Tapefile.pm \
+@WANT_SERVER_TRUE@     Amanda/Changer.pm
+@WANT_SERVER_TRUE@am__append_7 = Amanda/Device.c Amanda/Device.pm \
+@WANT_SERVER_TRUE@     Amanda/Logfile.c Amanda/Logfile.pm \
+@WANT_SERVER_TRUE@     Amanda/Cmdline.c Amanda/Cmdline.pm \
+@WANT_SERVER_TRUE@     Amanda/Tapefile.c Amanda/Tapefile.pm
+subdir = perl
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(libCmdlinedir)" \
+       "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" \
+       "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libLogfiledir)" \
+       "$(DESTDIR)$(libTapefiledir)" "$(DESTDIR)$(libTypesdir)" \
+       "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(Amandadir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+libCmdlineLTLIBRARIES_INSTALL = $(INSTALL)
+libConfigLTLIBRARIES_INSTALL = $(INSTALL)
+libDebugLTLIBRARIES_INSTALL = $(INSTALL)
+libDeviceLTLIBRARIES_INSTALL = $(INSTALL)
+libLogfileLTLIBRARIES_INSTALL = $(INSTALL)
+libTapefileLTLIBRARIES_INSTALL = $(INSTALL)
+libTypesLTLIBRARIES_INSTALL = $(INSTALL)
+libUtilLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES) $(libCmdline_LTLIBRARIES) \
+       $(libConfig_LTLIBRARIES) $(libDebug_LTLIBRARIES) \
+       $(libDevice_LTLIBRARIES) $(libLogfile_LTLIBRARIES) \
+       $(libTapefile_LTLIBRARIES) $(libTypes_LTLIBRARIES) \
+       $(libUtil_LTLIBRARIES)
+@WANT_SERVER_TRUE@libCmdline_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+am__libCmdline_la_SOURCES_DIST = Amanda/Cmdline.c amglue/amglue.swg \
+       amglue/constants.swg amglue/exports.swg amglue/glib.swg \
+       amglue/integers.swg
+am__objects_1 =
+@WANT_SERVER_TRUE@am_libCmdline_la_OBJECTS = Cmdline.lo \
+@WANT_SERVER_TRUE@     $(am__objects_1)
+libCmdline_la_OBJECTS = $(am_libCmdline_la_OBJECTS)
+libCmdline_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libCmdline_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_SERVER_TRUE@am_libCmdline_la_rpath = -rpath $(libCmdlinedir)
+libConfig_la_DEPENDENCIES = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+am_libConfig_la_OBJECTS = Config.lo $(am__objects_1)
+libConfig_la_OBJECTS = $(am_libConfig_la_OBJECTS)
+libConfig_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libConfig_la_LDFLAGS) $(LDFLAGS) -o $@
+libDebug_la_DEPENDENCIES = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+am_libDebug_la_OBJECTS = Debug.lo $(am__objects_1)
+libDebug_la_OBJECTS = $(am_libDebug_la_OBJECTS)
+libDebug_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libDebug_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_SERVER_TRUE@libDevice_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/device-src/libamdevice.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+am__libDevice_la_SOURCES_DIST = Amanda/Device.c amglue/amglue.swg \
+       amglue/constants.swg amglue/exports.swg amglue/glib.swg \
+       amglue/integers.swg
+@WANT_SERVER_TRUE@am_libDevice_la_OBJECTS = Device.lo $(am__objects_1)
+libDevice_la_OBJECTS = $(am_libDevice_la_OBJECTS)
+libDevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libDevice_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_SERVER_TRUE@am_libDevice_la_rpath = -rpath $(libDevicedir)
+@WANT_SERVER_TRUE@libLogfile_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+am__libLogfile_la_SOURCES_DIST = Amanda/Logfile.c amglue/amglue.swg \
+       amglue/constants.swg amglue/exports.swg amglue/glib.swg \
+       amglue/integers.swg
+@WANT_SERVER_TRUE@am_libLogfile_la_OBJECTS = Logfile.lo \
+@WANT_SERVER_TRUE@     $(am__objects_1)
+libLogfile_la_OBJECTS = $(am_libLogfile_la_OBJECTS)
+libLogfile_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libLogfile_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_SERVER_TRUE@am_libLogfile_la_rpath = -rpath $(libLogfiledir)
+@WANT_SERVER_TRUE@libTapefile_la_DEPENDENCIES = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+am__libTapefile_la_SOURCES_DIST = Amanda/Tapefile.c amglue/amglue.swg \
+       amglue/constants.swg amglue/exports.swg amglue/glib.swg \
+       amglue/integers.swg
+@WANT_SERVER_TRUE@am_libTapefile_la_OBJECTS = Tapefile.lo \
+@WANT_SERVER_TRUE@     $(am__objects_1)
+libTapefile_la_OBJECTS = $(am_libTapefile_la_OBJECTS)
+libTapefile_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libTapefile_la_LDFLAGS) $(LDFLAGS) -o $@
+@WANT_SERVER_TRUE@am_libTapefile_la_rpath = -rpath $(libTapefiledir)
+libTypes_la_DEPENDENCIES = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+am_libTypes_la_OBJECTS = Types.lo $(am__objects_1)
+libTypes_la_OBJECTS = $(am_libTypes_la_OBJECTS)
+libTypes_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libTypes_la_LDFLAGS) $(LDFLAGS) -o $@
+libUtil_la_DEPENDENCIES = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+am_libUtil_la_OBJECTS = Util.lo $(am__objects_1)
+libUtil_la_OBJECTS = $(am_libUtil_la_OBJECTS)
+libUtil_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libUtil_la_LDFLAGS) $(LDFLAGS) -o $@
+libamglue_la_LIBADD =
+am_libamglue_la_OBJECTS = ghashtable.lo bigint.lo
+libamglue_la_OBJECTS = $(am_libamglue_la_OBJECTS)
+libamglue_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamglue_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libCmdline_la_SOURCES) $(libConfig_la_SOURCES) \
+       $(libDebug_la_SOURCES) $(libDevice_la_SOURCES) \
+       $(libLogfile_la_SOURCES) $(libTapefile_la_SOURCES) \
+       $(libTypes_la_SOURCES) $(libUtil_la_SOURCES) \
+       $(libamglue_la_SOURCES)
+DIST_SOURCES = $(am__libCmdline_la_SOURCES_DIST) \
+       $(libConfig_la_SOURCES) $(libDebug_la_SOURCES) \
+       $(am__libDevice_la_SOURCES_DIST) \
+       $(am__libLogfile_la_SOURCES_DIST) \
+       $(am__libTapefile_la_SOURCES_DIST) $(libTypes_la_SOURCES) \
+       $(libUtil_la_SOURCES) $(libamglue_la_SOURCES)
+AmandaDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(Amanda_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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@
+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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = $(libamglue_la_SOURCES) $(AMGLUE_SWG) $(am__append_6) \
+       Amanda/Debug.swg Amanda/Debug.pm Amanda/Config.swg \
+       Amanda/Config.pm Amanda/Util.swg Amanda/Util.pm \
+       Amanda/Types.swg Amanda/Types.pm Amanda/Paths.pm.in
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \
+       Amanda/Paths.pm
+MAINTAINERCLEANFILES = $(am__append_7) Amanda/Debug.c Amanda/Debug.pm \
+       Amanda/Config.c Amanda/Config.pm Amanda/Util.c Amanda/Util.pm \
+       Amanda/Types.c Amanda/Types.pm
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# add the SWIG symbol to avoid conflicts with perl definitions.
+# $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
+# to trigger warnings
+AM_CFLAGS = -DSWIG
+
+# Appropriate INCLUDES depends on which components (server or client) are 
+# being built
+INCLUDES = -I$(top_builddir)/common-src -I$(top_srcdir)/common-src \
+       -I$(top_srcdir)/perl/amglue -I$(top_srcdir)/gnulib $(PERL_INC) \
+       $(am__append_1) $(am__append_2) $(am__append_3) \
+       $(am__append_4)
+
+# (amplot has a conditional, but doesn't have any header files)
+amlib_LTLIBRARIES = libamglue.la
+libamglue_la_SOURCES = \
+       amglue/ghashtable.c \
+       amglue/bigint.c \
+       amglue/amglue.h
+
+libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+
+# Tell libtool to not bother versioning the libs we build, since perl won't
+# pay attention to such things, anyway.
+
+# And add any flags the user has requested; on FreeBSD, this pulls in the 
+# threading library
+PERL_EXT_LDFLAGS = -avoid-version $(PERLEXTLIBS)
+
+# list our SWIG libraries. 
+AMGLUE_SWG = amglue/amglue.swg \
+       amglue/amglue.swg \
+       amglue/constants.swg \
+       amglue/exports.swg \
+       amglue/glib.swg \
+       amglue/integers.swg
+
+
+# SWIG OPTIONS:
+# -perl5 -proxy: generate perl code, with proxy (shadow) classes
+# -DSWIG_TYPE_TABLE: the name for the global type table; customized
+#  to minimize type collisions with other SWIG-generated modules
+# -I$(srcdir) use include files relative to this directory
+SWIG_OPTIONS = -perl5 -proxy -DSWIG_TYPE_TABLE=SWIG_TYPES_Amanda -I$(srcdir)
+Amandadir = $(amperldir)/Amanda
+
+# PACKAGE: Amanda::Paths
+Amanda_DATA = $(am__append_5) Amanda/Debug.pm Amanda/Config.pm \
+       Amanda/Util.pm Amanda/Types.pm Amanda/Paths.pm
+
+# PACKAGE: Amanda::Device
+@WANT_SERVER_TRUE@libDevicedir = $(amperldir)/auto/Amanda/Device
+@WANT_SERVER_TRUE@libDevice_LTLIBRARIES = libDevice.la
+@WANT_SERVER_TRUE@libDevice_la_SOURCES = Amanda/Device.c $(AMGLUE_SWG)
+@WANT_SERVER_TRUE@libDevice_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+@WANT_SERVER_TRUE@libDevice_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/device-src/libamdevice.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Logfile
+@WANT_SERVER_TRUE@libLogfiledir = $(amperldir)/auto/Amanda/Logfile
+@WANT_SERVER_TRUE@libLogfile_LTLIBRARIES = libLogfile.la
+@WANT_SERVER_TRUE@libLogfile_la_SOURCES = Amanda/Logfile.c $(AMGLUE_SWG)
+@WANT_SERVER_TRUE@libLogfile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+@WANT_SERVER_TRUE@libLogfile_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Cmdline
+@WANT_SERVER_TRUE@libCmdlinedir = $(amperldir)/auto/Amanda/Cmdline
+@WANT_SERVER_TRUE@libCmdline_LTLIBRARIES = libCmdline.la
+@WANT_SERVER_TRUE@libCmdline_la_SOURCES = Amanda/Cmdline.c $(AMGLUE_SWG)
+@WANT_SERVER_TRUE@libCmdline_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+@WANT_SERVER_TRUE@libCmdline_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Tapefile
+@WANT_SERVER_TRUE@libTapefiledir = $(amperldir)/auto/Amanda/Tapefile
+@WANT_SERVER_TRUE@libTapefile_LTLIBRARIES = libTapefile.la
+@WANT_SERVER_TRUE@libTapefile_la_SOURCES = Amanda/Tapefile.c $(AMGLUE_SWG)
+@WANT_SERVER_TRUE@libTapefile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+@WANT_SERVER_TRUE@libTapefile_la_LIBADD = libamglue.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/server-src/libamserver.la \
+@WANT_SERVER_TRUE@     $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Debug
+libDebugdir = $(amperldir)/auto/Amanda/Debug
+libDebug_LTLIBRARIES = libDebug.la
+libDebug_la_SOURCES = Amanda/Debug.c $(AMGLUE_SWG)
+libDebug_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libDebug_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Config
+libConfigdir = $(amperldir)/auto/Amanda/Config
+libConfig_LTLIBRARIES = libConfig.la
+libConfig_la_SOURCES = Amanda/Config.c $(AMGLUE_SWG)
+libConfig_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libConfig_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Util
+libUtildir = $(amperldir)/auto/Amanda/Util
+libUtil_LTLIBRARIES = libUtil.la
+libUtil_la_SOURCES = Amanda/Util.c $(AMGLUE_SWG)
+libUtil_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libUtil_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+
+
+# PACKAGE: Amanda::Types
+libTypesdir = $(amperldir)/auto/Amanda/Types
+libTypes_LTLIBRARIES = libTypes.la
+libTypes_la_SOURCES = Amanda/Types.c $(AMGLUE_SWG)
+libTypes_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
+libTypes_la_LIBADD = libamglue.la \
+       $(top_builddir)/common-src/libamanda.la
+
+
+# perl doesn't use the cyg prefix and it doesn't search in the bin
+# directory, dll must be copied to their modules directories.
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@amperldirauto = "$(DESTDIR)$(amperldir)/auto/Amanda"
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  perl/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  perl/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-amlibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
+       done
+
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libCmdlineLTLIBRARIES: $(libCmdline_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libCmdlinedir)" || $(MKDIR_P) "$(DESTDIR)$(libCmdlinedir)"
+       @list='$(libCmdline_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libCmdlineLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libCmdlinedir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libCmdlineLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libCmdlinedir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libCmdlineLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libCmdline_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libCmdlinedir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libCmdlinedir)/$$p"; \
+       done
+
+clean-libCmdlineLTLIBRARIES:
+       -test -z "$(libCmdline_LTLIBRARIES)" || rm -f $(libCmdline_LTLIBRARIES)
+       @list='$(libCmdline_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libConfigLTLIBRARIES: $(libConfig_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libConfigdir)" || $(MKDIR_P) "$(DESTDIR)$(libConfigdir)"
+       @list='$(libConfig_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libConfigLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libConfigdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libConfigLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libConfigdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libConfigLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libConfig_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libConfigdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libConfigdir)/$$p"; \
+       done
+
+clean-libConfigLTLIBRARIES:
+       -test -z "$(libConfig_LTLIBRARIES)" || rm -f $(libConfig_LTLIBRARIES)
+       @list='$(libConfig_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libDebugLTLIBRARIES: $(libDebug_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libDebugdir)" || $(MKDIR_P) "$(DESTDIR)$(libDebugdir)"
+       @list='$(libDebug_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libDebugLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libDebugdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libDebugLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libDebugdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libDebugLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libDebug_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libDebugdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libDebugdir)/$$p"; \
+       done
+
+clean-libDebugLTLIBRARIES:
+       -test -z "$(libDebug_LTLIBRARIES)" || rm -f $(libDebug_LTLIBRARIES)
+       @list='$(libDebug_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libDeviceLTLIBRARIES: $(libDevice_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libDevicedir)" || $(MKDIR_P) "$(DESTDIR)$(libDevicedir)"
+       @list='$(libDevice_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libDeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libDevicedir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libDeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libDevicedir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libDeviceLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libDevice_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libDevicedir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libDevicedir)/$$p"; \
+       done
+
+clean-libDeviceLTLIBRARIES:
+       -test -z "$(libDevice_LTLIBRARIES)" || rm -f $(libDevice_LTLIBRARIES)
+       @list='$(libDevice_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libLogfileLTLIBRARIES: $(libLogfile_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libLogfiledir)" || $(MKDIR_P) "$(DESTDIR)$(libLogfiledir)"
+       @list='$(libLogfile_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libLogfileLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libLogfiledir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libLogfileLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libLogfiledir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libLogfileLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libLogfile_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libLogfiledir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libLogfiledir)/$$p"; \
+       done
+
+clean-libLogfileLTLIBRARIES:
+       -test -z "$(libLogfile_LTLIBRARIES)" || rm -f $(libLogfile_LTLIBRARIES)
+       @list='$(libLogfile_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libTapefileLTLIBRARIES: $(libTapefile_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libTapefiledir)" || $(MKDIR_P) "$(DESTDIR)$(libTapefiledir)"
+       @list='$(libTapefile_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libTapefileLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libTapefiledir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libTapefileLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libTapefiledir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libTapefileLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libTapefile_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libTapefiledir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libTapefiledir)/$$p"; \
+       done
+
+clean-libTapefileLTLIBRARIES:
+       -test -z "$(libTapefile_LTLIBRARIES)" || rm -f $(libTapefile_LTLIBRARIES)
+       @list='$(libTapefile_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libTypesLTLIBRARIES: $(libTypes_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libTypesdir)" || $(MKDIR_P) "$(DESTDIR)$(libTypesdir)"
+       @list='$(libTypes_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libTypesLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libTypesdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libTypesLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libTypesdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libTypesLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libTypes_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libTypesdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libTypesdir)/$$p"; \
+       done
+
+clean-libTypesLTLIBRARIES:
+       -test -z "$(libTypes_LTLIBRARIES)" || rm -f $(libTypes_LTLIBRARIES)
+       @list='$(libTypes_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-libUtilLTLIBRARIES: $(libUtil_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libUtildir)" || $(MKDIR_P) "$(DESTDIR)$(libUtildir)"
+       @list='$(libUtil_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libUtilLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libUtildir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libUtilLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libUtildir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libUtilLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libUtil_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libUtildir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libUtildir)/$$p"; \
+       done
+
+clean-libUtilLTLIBRARIES:
+       -test -z "$(libUtil_LTLIBRARIES)" || rm -f $(libUtil_LTLIBRARIES)
+       @list='$(libUtil_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libCmdline.la: $(libCmdline_la_OBJECTS) $(libCmdline_la_DEPENDENCIES) 
+       $(libCmdline_la_LINK) $(am_libCmdline_la_rpath) $(libCmdline_la_OBJECTS) $(libCmdline_la_LIBADD) $(LIBS)
+libConfig.la: $(libConfig_la_OBJECTS) $(libConfig_la_DEPENDENCIES) 
+       $(libConfig_la_LINK) -rpath $(libConfigdir) $(libConfig_la_OBJECTS) $(libConfig_la_LIBADD) $(LIBS)
+libDebug.la: $(libDebug_la_OBJECTS) $(libDebug_la_DEPENDENCIES) 
+       $(libDebug_la_LINK) -rpath $(libDebugdir) $(libDebug_la_OBJECTS) $(libDebug_la_LIBADD) $(LIBS)
+libDevice.la: $(libDevice_la_OBJECTS) $(libDevice_la_DEPENDENCIES) 
+       $(libDevice_la_LINK) $(am_libDevice_la_rpath) $(libDevice_la_OBJECTS) $(libDevice_la_LIBADD) $(LIBS)
+libLogfile.la: $(libLogfile_la_OBJECTS) $(libLogfile_la_DEPENDENCIES) 
+       $(libLogfile_la_LINK) $(am_libLogfile_la_rpath) $(libLogfile_la_OBJECTS) $(libLogfile_la_LIBADD) $(LIBS)
+libTapefile.la: $(libTapefile_la_OBJECTS) $(libTapefile_la_DEPENDENCIES) 
+       $(libTapefile_la_LINK) $(am_libTapefile_la_rpath) $(libTapefile_la_OBJECTS) $(libTapefile_la_LIBADD) $(LIBS)
+libTypes.la: $(libTypes_la_OBJECTS) $(libTypes_la_DEPENDENCIES) 
+       $(libTypes_la_LINK) -rpath $(libTypesdir) $(libTypes_la_OBJECTS) $(libTypes_la_LIBADD) $(LIBS)
+libUtil.la: $(libUtil_la_OBJECTS) $(libUtil_la_DEPENDENCIES) 
+       $(libUtil_la_LINK) -rpath $(libUtildir) $(libUtil_la_OBJECTS) $(libUtil_la_LIBADD) $(LIBS)
+libamglue.la: $(libamglue_la_OBJECTS) $(libamglue_la_DEPENDENCIES) 
+       $(libamglue_la_LINK) -rpath $(amlibdir) $(libamglue_la_OBJECTS) $(libamglue_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cmdline.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Config.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Debug.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Logfile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Tapefile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Types.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Util.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bigint.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghashtable.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+Cmdline.lo: Amanda/Cmdline.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Cmdline.lo -MD -MP -MF $(DEPDIR)/Cmdline.Tpo -c -o Cmdline.lo `test -f 'Amanda/Cmdline.c' || echo '$(srcdir)/'`Amanda/Cmdline.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Cmdline.Tpo $(DEPDIR)/Cmdline.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Cmdline.c' object='Cmdline.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Cmdline.lo `test -f 'Amanda/Cmdline.c' || echo '$(srcdir)/'`Amanda/Cmdline.c
+
+Config.lo: Amanda/Config.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Config.lo -MD -MP -MF $(DEPDIR)/Config.Tpo -c -o Config.lo `test -f 'Amanda/Config.c' || echo '$(srcdir)/'`Amanda/Config.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Config.Tpo $(DEPDIR)/Config.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Config.c' object='Config.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Config.lo `test -f 'Amanda/Config.c' || echo '$(srcdir)/'`Amanda/Config.c
+
+Debug.lo: Amanda/Debug.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Debug.lo -MD -MP -MF $(DEPDIR)/Debug.Tpo -c -o Debug.lo `test -f 'Amanda/Debug.c' || echo '$(srcdir)/'`Amanda/Debug.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Debug.Tpo $(DEPDIR)/Debug.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Debug.c' object='Debug.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Debug.lo `test -f 'Amanda/Debug.c' || echo '$(srcdir)/'`Amanda/Debug.c
+
+Device.lo: Amanda/Device.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Device.lo -MD -MP -MF $(DEPDIR)/Device.Tpo -c -o Device.lo `test -f 'Amanda/Device.c' || echo '$(srcdir)/'`Amanda/Device.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Device.Tpo $(DEPDIR)/Device.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Device.c' object='Device.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Device.lo `test -f 'Amanda/Device.c' || echo '$(srcdir)/'`Amanda/Device.c
+
+Logfile.lo: Amanda/Logfile.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Logfile.lo -MD -MP -MF $(DEPDIR)/Logfile.Tpo -c -o Logfile.lo `test -f 'Amanda/Logfile.c' || echo '$(srcdir)/'`Amanda/Logfile.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Logfile.Tpo $(DEPDIR)/Logfile.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Logfile.c' object='Logfile.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Logfile.lo `test -f 'Amanda/Logfile.c' || echo '$(srcdir)/'`Amanda/Logfile.c
+
+Tapefile.lo: Amanda/Tapefile.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Tapefile.lo -MD -MP -MF $(DEPDIR)/Tapefile.Tpo -c -o Tapefile.lo `test -f 'Amanda/Tapefile.c' || echo '$(srcdir)/'`Amanda/Tapefile.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Tapefile.Tpo $(DEPDIR)/Tapefile.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Tapefile.c' object='Tapefile.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Tapefile.lo `test -f 'Amanda/Tapefile.c' || echo '$(srcdir)/'`Amanda/Tapefile.c
+
+Types.lo: Amanda/Types.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Types.lo -MD -MP -MF $(DEPDIR)/Types.Tpo -c -o Types.lo `test -f 'Amanda/Types.c' || echo '$(srcdir)/'`Amanda/Types.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Types.Tpo $(DEPDIR)/Types.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Types.c' object='Types.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Types.lo `test -f 'Amanda/Types.c' || echo '$(srcdir)/'`Amanda/Types.c
+
+Util.lo: Amanda/Util.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Util.lo -MD -MP -MF $(DEPDIR)/Util.Tpo -c -o Util.lo `test -f 'Amanda/Util.c' || echo '$(srcdir)/'`Amanda/Util.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/Util.Tpo $(DEPDIR)/Util.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Amanda/Util.c' object='Util.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Util.lo `test -f 'Amanda/Util.c' || echo '$(srcdir)/'`Amanda/Util.c
+
+ghashtable.lo: amglue/ghashtable.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ghashtable.lo -MD -MP -MF $(DEPDIR)/ghashtable.Tpo -c -o ghashtable.lo `test -f 'amglue/ghashtable.c' || echo '$(srcdir)/'`amglue/ghashtable.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/ghashtable.Tpo $(DEPDIR)/ghashtable.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/ghashtable.c' object='ghashtable.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ghashtable.lo `test -f 'amglue/ghashtable.c' || echo '$(srcdir)/'`amglue/ghashtable.c
+
+bigint.lo: amglue/bigint.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bigint.lo -MD -MP -MF $(DEPDIR)/bigint.Tpo -c -o bigint.lo `test -f 'amglue/bigint.c' || echo '$(srcdir)/'`amglue/bigint.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/bigint.Tpo $(DEPDIR)/bigint.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='amglue/bigint.c' object='bigint.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bigint.lo `test -f 'amglue/bigint.c' || echo '$(srcdir)/'`amglue/bigint.c
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-AmandaDATA: $(Amanda_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(Amandadir)" || $(MKDIR_P) "$(DESTDIR)$(Amandadir)"
+       @list='$(Amanda_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(AmandaDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(Amandadir)/$$f'"; \
+         $(AmandaDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(Amandadir)/$$f"; \
+       done
+
+uninstall-AmandaDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(Amanda_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(Amandadir)/$$f'"; \
+         rm -f "$(DESTDIR)$(Amandadir)/$$f"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libTapefiledir)" "$(DESTDIR)$(libTypesdir)" "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(Amandadir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) 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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_CYGWIN_COPY_PERL_DLL_FALSE@install-data-hook:
+clean: clean-am
+
+clean-am: clean-amlibLTLIBRARIES clean-generic \
+       clean-libCmdlineLTLIBRARIES clean-libConfigLTLIBRARIES \
+       clean-libDebugLTLIBRARIES clean-libDeviceLTLIBRARIES \
+       clean-libLogfileLTLIBRARIES clean-libTapefileLTLIBRARIES \
+       clean-libTypesLTLIBRARIES clean-libUtilLTLIBRARIES \
+       clean-libtool 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
+
+info: info-am
+
+info-am:
+
+install-data-am: install-AmandaDATA install-amlibLTLIBRARIES \
+       install-libCmdlineLTLIBRARIES install-libConfigLTLIBRARIES \
+       install-libDebugLTLIBRARIES install-libDeviceLTLIBRARIES \
+       install-libLogfileLTLIBRARIES install-libTapefileLTLIBRARIES \
+       install-libTypesLTLIBRARIES install-libUtilLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
+
+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
+
+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-AmandaDATA uninstall-amlibLTLIBRARIES \
+       uninstall-libCmdlineLTLIBRARIES uninstall-libConfigLTLIBRARIES \
+       uninstall-libDebugLTLIBRARIES uninstall-libDeviceLTLIBRARIES \
+       uninstall-libLogfileLTLIBRARIES \
+       uninstall-libTapefileLTLIBRARIES uninstall-libTypesLTLIBRARIES \
+       uninstall-libUtilLTLIBRARIES
+
+.MAKE: install-am install-data-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+       clean-amlibLTLIBRARIES clean-generic \
+       clean-libCmdlineLTLIBRARIES clean-libConfigLTLIBRARIES \
+       clean-libDebugLTLIBRARIES clean-libDeviceLTLIBRARIES \
+       clean-libLogfileLTLIBRARIES clean-libTapefileLTLIBRARIES \
+       clean-libTypesLTLIBRARIES clean-libUtilLTLIBRARIES \
+       clean-libtool ctags dist-hook distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-AmandaDATA \
+       install-am install-amlibLTLIBRARIES install-data \
+       install-data-am install-data-hook install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-libCmdlineLTLIBRARIES \
+       install-libConfigLTLIBRARIES install-libDebugLTLIBRARIES \
+       install-libDeviceLTLIBRARIES install-libLogfileLTLIBRARIES \
+       install-libTapefileLTLIBRARIES install-libTypesLTLIBRARIES \
+       install-libUtilLTLIBRARIES install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-AmandaDATA uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-libCmdlineLTLIBRARIES \
+       uninstall-libConfigLTLIBRARIES uninstall-libDebugLTLIBRARIES \
+       uninstall-libDeviceLTLIBRARIES uninstall-libLogfileLTLIBRARIES \
+       uninstall-libTapefileLTLIBRARIES uninstall-libTypesLTLIBRARIES \
+       uninstall-libUtilLTLIBRARIES
+
+
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
+               fi; \
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+# Suffix rules.  These are parallel-build compatible, but may cause
+# strange behavior if there are other .c files in this directory.  The
+# 'rm -f $@' is needed because SWIG sometimes fails to remove its output
+# file in the event of a syntax error.  .i files are pre-processor output;
+# they are only used during development.
+%.c : %.swg $(AMGLUE_SWG)
+       $(mkdir_p) `dirname $@`
+       $(SWIG) $(SWIG_OPTIONS) -o $@ $(top_srcdir)/perl/$< || { rm -f $@; false; }
+%.pm : %.c
+       @echo "$@ was produced as a side-effect of creating $<"
+%.i : %.swg $(AMGLUE_SWG)
+       $(SWIG) $(SWIG_OPTIONS) -E $(top_srcdir)/perl/$< >$@
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@install-data-hook:
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@       @for cygdll in $(amperldirauto)/bin/cyg*.dll; do \
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@           destfname=`echo $$cygdll|sed 's!/bin/cyg\([^.]*\).dll!/\1/\1.dll!'`; \
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@           cp "$$cygdll" "$$destfname"; \
+@WANT_CYGWIN_COPY_PERL_DLL_TRUE@       done
+# 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/perl/amglue/amglue.h b/perl/amglue/amglue.h
new file mode 100644 (file)
index 0000000..b9434cd
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#ifndef AMANDA_AMGLUE_H
+#define AMANDA_AMGLUE_H
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include <glib.h>
+#include <glib-object.h>
+
+/* These defines are missing from older glibs, so we add them here */
+#ifndef G_MAXINT8
+#define G_MAXINT8 (127)
+#endif
+
+#ifndef G_MININT8
+#define G_MININT8 (-127-1)
+#endif
+
+#ifndef G_MAXUINT8
+#define G_MAXUINT8 (255)
+#endif
+
+#ifndef G_MAXINT16
+#define G_MAXINT16 (32767)
+#endif
+
+#ifndef G_MININT16
+#define G_MININT16 (-32767-1)
+#endif
+
+#ifndef G_MAXUINT16
+#define G_MAXUINT16 (65535)
+#endif
+
+#ifndef G_MAXINT32
+#define G_MAXINT32 (2147483647)
+#endif
+
+#ifndef G_MININT32
+#define G_MININT32 (-2147483647-1)
+#endif
+
+#ifndef G_MAXUINT32
+#define G_MAXUINT32 (4294967295U)
+#endif
+
+/*
+ * prototypes for ghashtable.c
+ */
+
+/* Turn a GLib hash table (mapping strings to strings) into a reference
+ * to a Perl hash table.
+ *
+ * @param hash: GLib hash table
+ * @returns: Perl hashref
+ */
+SV *g_hash_table_to_hashref(GHashTable *hash);
+
+/*
+ * prototypes for bigint.c
+ */
+
+/*
+ * These functions handle conversion of integers to and from Perl-compatible
+ * values.  Most perls do not natively support 64-bit integers, so these functions
+ * interface with the Math::BigInt module to support those integers.  The functions
+ * also handle conversions from floating-point to integer values, with silent fraction
+ * truncation, as perl automatically promotes integers to doubles on overflow.
+ */
+
+/* Convert an (unsigned) integer to a Perl SV.  These will always produce a 
+ * Math::BigInt object.  Any failure is fatal.  *All* C-to-Perl integer conversions
+ * must use these functions.
+ *
+ * @param v: value to convert
+ * @returns: pointer to a new SV (refcount=1)
+ */
+SV *amglue_newSVi64(gint64 v);
+SV *amglue_newSVu64(guint64 v);
+
+/* Convert a Perl SV to an integer of the specified size.  These functions should
+ * be used for *all* Perl-to-C integer conversions, since the Perl value may be a
+ * Math::BigInt object.  All of these functions will call croak() on an overflow
+ * condition, rather than silently truncate.
+ *
+ * @param sv: perl value to convert
+ * @returns: value of the given type
+ */
+gint64 amglue_SvI64(SV *sv);
+guint64 amglue_SvU64(SV *sv);
+gint32 amglue_SvI32(SV *sv);
+guint32 amglue_SvU32(SV *sv);
+gint16 amglue_SvI16(SV *sv);
+guint16 amglue_SvU16(SV *sv);
+gint8 amglue_SvI8(SV *sv);
+guint8 amglue_SvU8(SV *sv);
+
+#endif /* AMANDA_AMGLUE_H */
diff --git a/perl/amglue/amglue.swg b/perl/amglue/amglue.swg
new file mode 100644 (file)
index 0000000..9ff37f4
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%{
+#include "amglue.h"
+%}
+
+%include "amglue/constants.swg"
+%include "amglue/exports.swg"
+%include "amglue/glib.swg"
+%include "amglue/integers.swg"
diff --git a/perl/amglue/bigint.c b/perl/amglue/bigint.c
new file mode 100644 (file)
index 0000000..75bc1a5
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amglue.h"
+
+/*
+ * C -> Perl
+ */
+
+/* these functions are only needed if Perl has 32-bit IV's */
+/* Make sure Math::BigInt is loaded
+ */
+static void
+load_Math_BigInt(void)
+{
+    static int loaded = 0;
+
+    if (loaded) return;
+
+    eval_pv("use Math::BigInt;", 1);
+    loaded = 1;
+}
+
+/* Given a string, create a Math::BigInt representing its value.
+ *
+ * @param num: string representation of a number
+ * @returns: BigInt representation of the same number
+ */
+static SV *
+str2bigint(char *num)
+{
+    int count;
+    SV *rv;
+    dSP;
+
+    load_Math_BigInt();
+
+    ENTER;
+    SAVETMPS;
+
+    PUSHMARK(SP);
+    XPUSHs(sv_2mortal(newSVpv("Math::BigInt", 0)));
+    XPUSHs(sv_2mortal(newSVpv(num, 0)));
+    PUTBACK;
+
+    count = call_method("Math::BigInt::new", G_SCALAR);
+
+    SPAGAIN;
+
+    if (count != 1)
+       croak("Expected a result from Math::Bigint->new");
+
+    rv = POPs;
+    SvREFCNT_inc(rv);
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+
+    return rv;
+}
+
+SV *
+amglue_newSVi64(gint64 v)
+{
+    char numstr[25];
+    g_snprintf(numstr, sizeof(numstr), "%jd", (intmax_t)v);
+    numstr[sizeof(numstr)-1] = '\0';
+    return str2bigint(numstr);
+}
+
+SV *
+amglue_newSVu64(guint64 v)
+{
+    char numstr[25];
+    g_snprintf(numstr, sizeof(numstr), "%ju", (uintmax_t)v);
+    numstr[sizeof(numstr)-1] = '\0';
+    return str2bigint(numstr);
+}
+
+/*
+ * Perl -> C
+ */
+
+/* Conversion from Perl values handles BigInts regardless of whether
+ * Perl's IVs are 32- or 64-bit, for completeness' sake.
+ */
+
+/* Convert a bigint to a signed integer, or croak trying.
+ *
+ * @param bigint: the perl object to convert
+ * @returns: signed integer
+ */
+static gint64
+bigint2int64(SV *bigint)
+{
+    SV *sv;
+    char *str;
+    guint64 absval;
+    gboolean negative = FALSE;
+    int count;
+    dSP;
+
+    /* first, see if it's a BigInt */
+    if (!sv_isobject(bigint) || !sv_derived_from(bigint, "Math::BigInt"))
+       croak("Expected an integer or a Math::BigInt; cannot convert");
+
+    ENTER;
+    SAVETMPS;
+
+    /* get the value:
+     * strtoull($bigint->bstr()) */
+
+    PUSHMARK(SP);
+    XPUSHs(bigint);
+    PUTBACK;
+
+    count = call_method("Math::BigInt::bstr", G_SCALAR);
+
+    SPAGAIN;
+
+    if (count != 1)
+       croak("Expected a result from Math::BigInt::bstr");
+
+    sv = POPs;
+    str = SvPV_nolen(sv);
+    if (!str)
+       croak("Math::BigInt::bstr did not return a string");
+
+    if (str[0] == '-') {
+       negative = TRUE;
+       str++;
+    }
+
+    errno = 0;
+    absval = g_ascii_strtoull(str, NULL, 0);
+    /* (the last branch of this || depends on G_MININT64 = -G_MAXINT64-1) */
+    if ((absval == G_MAXUINT64 && errno == ERANGE)
+        || (!negative && absval > (guint64)(G_MAXINT64))
+       || (negative && absval > (guint64)(G_MAXINT64)+1))
+       croak("Expected a signed 64-bit value or smaller; value '%s' out of range", str);
+    if (errno)
+       croak("Math::BigInt->bstr returned invalid number '%s'", str);
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+
+    if (negative) return -absval;
+    return absval;
+}
+
+/* Convert bigint to an unsigned integer, or croak trying.
+ *
+ * @param bigint: the perl object to convert
+ * @returns: unsigned integer
+ */
+static guint64
+bigint2uint64(SV *bigint)
+{
+    SV *sv;
+    char *str;
+    guint64 rv;
+    int count;
+    dSP;
+
+    /* first, see if it's a BigInt */
+    if (!sv_isobject(bigint) || !sv_derived_from(bigint, "Math::BigInt"))
+       croak("Expected an integer or a Math::BigInt; cannot convert");
+
+    ENTER;
+    SAVETMPS;
+
+    /* make sure the bigint is positive:
+     * croak(..) unless $bigint->sign() eq "+"; */
+
+    PUSHMARK(SP);
+    XPUSHs(bigint);
+    PUTBACK;
+
+    count = call_method("Math::BigInt::sign", G_SCALAR);
+
+    SPAGAIN;
+
+    if (count != 1)
+       croak("Expected a result from Math::BigInt::sign");
+
+    sv = POPs;
+    str = SvPV_nolen(sv);
+    if (!str)
+       croak("Math::BigInt::sign did not return a string");
+
+    if (strcmp(str, "+") != 0)
+       croak("Expected a positive number; value out of range");
+
+    /* get the value:
+     * strtoull($bigint->bstr()) */
+
+    PUSHMARK(SP);
+    XPUSHs(bigint);
+    PUTBACK;
+
+    count = call_method("Math::BigInt::bstr", G_SCALAR);
+
+    SPAGAIN;
+
+    if (count != 1)
+       croak("Expected a result from Math::BigInt::bstr");
+
+    sv = POPs;
+    str = SvPV_nolen(sv);
+    if (!str)
+       croak("Math::BigInt::bstr did not return a string");
+
+    errno = 0;
+    rv = g_ascii_strtoull(str, NULL, 0);
+    if (rv == G_MAXUINT64 && errno == ERANGE)
+       croak("Expected an unsigned 64-bit value or smaller; value '%s' out of range", str);
+    if (errno)
+       croak("Math::BigInt->bstr returned invalid number '%s'", str);
+
+    PUTBACK;
+    FREETMPS;
+    LEAVE;
+
+    return rv;
+}
+
+gint64 amglue_SvI64(SV *sv)
+{
+    if (SvIOK(sv)) {
+       if (SvIsUV(sv)) {
+           return SvUV(sv);
+       } else {
+           return SvIV(sv);
+       }
+    } else if (SvNOK(sv)) {
+       double dv = SvNV(sv);
+
+       /* preprocessor constants seem to have trouble here, so we convert to gint64 and
+        * back, and if the result differs, then we have lost something.  Note that this will
+        * also error out on integer truncation .. which is probably OK */
+       gint64 iv = (gint64)dv;
+       if (dv != (double)iv) {
+           croak("Expected a signed 64-bit value or smaller; value '%.0f' out of range", (float)dv);
+           return 0;
+       } else {
+           return iv;
+       }
+    } else {
+       return bigint2int64(sv);
+    }
+}
+
+guint64 amglue_SvU64(SV *sv)
+{
+    if (SvIOK(sv)) {
+       if (SvIsUV(sv)) {
+           return SvUV(sv);
+       } else if (SvIV(sv) < 0) {
+           croak("Expected an unsigned value, got a negative integer");
+           return 0;
+       } else {
+           return (guint64)SvIV(sv);
+       }
+    } else if (SvNOK(sv)) {
+       double dv = SvNV(sv);
+       if (dv < 0.0) {
+           croak("Expected an unsigned value, got a negative integer");
+           return 0;
+       } else if (dv > (double)G_MAXUINT64) {
+           croak("Expected an unsigned 64-bit value or smaller; value out of range");
+           return 0;
+       } else {
+           return (guint64)dv;
+       }
+    } else {
+       return bigint2uint64(sv);
+    }
+}
+
+gint32 amglue_SvI32(SV *sv)
+{
+    gint64 v64 = amglue_SvI64(sv);
+    if (v64 < G_MININT32 || v64 > G_MAXINT32) {
+       croak("Expected a 32-bit integer; value out of range");
+       return 0;
+    } else {
+       return (gint32)v64;
+    }
+}
+
+guint32 amglue_SvU32(SV *sv)
+{
+    guint64 v64 = amglue_SvU64(sv);
+    if (v64 > G_MAXUINT32) {
+       croak("Expected a 32-bit unsigned integer; value out of range");
+       return 0;
+    } else {
+       return (guint32)v64;
+    }
+}
+
+gint16 amglue_SvI16(SV *sv)
+{
+    gint64 v64 = amglue_SvI64(sv);
+    if (v64 < G_MININT16 || v64 > G_MAXINT16) {
+       croak("Expected a 16-bit integer; value out of range");
+       return 0;
+    } else {
+       return (gint16)v64;
+    }
+}
+
+guint16 amglue_SvU16(SV *sv)
+{
+    guint64 v64 = amglue_SvU64(sv);
+    if (v64 > G_MAXUINT16) {
+       croak("Expected a 16-bit unsigned integer; value out of range");
+       return 0;
+    } else {
+       return (guint16)v64;
+    }
+}
+
+gint8 amglue_SvI8(SV *sv)
+{
+    gint64 v64 = amglue_SvI64(sv);
+    if (v64 < G_MININT8 || v64 > G_MAXINT8) {
+       croak("Expected a 8-bit integer; value out of range");
+       return 0;
+    } else {
+       return (gint8)v64;
+    }
+}
+
+guint8 amglue_SvU8(SV *sv)
+{
+    guint64 v64 = amglue_SvU64(sv);
+    if (v64 > G_MAXUINT8) {
+       croak("Expected a 8-bit unsigned integer; value out of range");
+       return 0;
+    } else {
+       return (guint8)v64;
+    }
+}
+
diff --git a/perl/amglue/constants.swg b/perl/amglue/constants.swg
new file mode 100644 (file)
index 0000000..0fa1985
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/*
+ * This file contains SWIG macros to handle C constants, enums, and flags
+ */
+
+%include "amglue/exports.swg"
+
+/* Rather than try to use glib's flag/enum architecture, which is only used
+ * for a few constants (mostly in property.h), .swg files define constants using
+ * these macros.  A typical definition would look like:
+ *   amglue_add_flag_tag_fns(Permissions);
+ *   amglue_add_constant(PERM_READ, Permissions);
+ *   amglue_add_constant(PERM_WRITE, Permissions);
+ * note that the values of the constants do not appear here, although the header
+ * file in which they are defined must be included in the %{ .. %} block.
+ *
+ * The above would result in:
+ *  - typedef int Permissions;
+ *  - $PERM_READ and $PERM_WRITE in @EXPORT_OK
+ *  - $PERM_READ and $PERM_WRITE in %EXPORT_TAGS{'Permissions'}
+ *  - Permissions_to_strings($flags) -> ( name, name, .. )
+ *
+ * Similarly, amglue_add_enum_tag_fns(FileType) would add the same
+ * EXPORTs, but a function
+ *  - FileType_to_string($enum) -> name
+ */
+
+%define amglue_add_flag_tag_fns(TAG)
+typedef int TAG;
+amglue_export_tag(TAG, TAG ## _to_strings);
+%perlcode %{
+my %_ ## TAG ## _VALUES;
+# Convert a flag value to a list of names for flags that are set.
+sub TAG ## _to_strings {
+    my ($flags) = @_;
+    my @result = ();
+
+    for my $k (keys %_ ## TAG ## _VALUES) {
+       my $v = $_ ## TAG ## _VALUES{$k};
+
+       # is this a matching flag?
+       if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
+           push @result, $k;
+       }
+    }
+
+    # by default, just return the number as a 1-element list
+    if (!@result) {
+       return ($flags);
+    }
+
+    return @result;
+}
+%}
+%enddef
+
+%define amglue_add_enum_tag_fns(TAG)
+typedef int TAG;
+amglue_export_tag(TAG, TAG ## _to_string);
+%perlcode %{
+my %_ ## TAG ## _VALUES;
+# Convert an enum value to a single string
+sub TAG ## _to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_ ## TAG ## _VALUES) {
+       my $v = $_ ## TAG ## _VALUES{$k};
+
+       # is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+    # default, just return the number
+    return $enumval;
+}
+%}
+%enddef
+
+/* Add the given constant, assuming the constant name is the 
+ * short name
+ *
+ * @param CONSTNAME: the name of the constant, as used in C code
+ * @param TAG: the tag for this constant (enum name, etc.)
+ */
+%define amglue_add_constant(CONSTNAME, TAG)
+enum { CONSTNAME }; /* pass the constant to SWIG */
+amglue_export_tag(TAG, $CONSTNAME);
+%perlcode %{
+$_ ## TAG ## _VALUES{`CONSTNAME`} = $CONSTNAME;
+%}
+%enddef
+
+/* Add the given constant with a short name
+ *
+ * @param CONSTNAME: the name of the constant, as used in C code
+ * @param SHORTNAME: the name to be shown by TAG_to_string(s) (a string)
+ * @param TAG: the tag for this constant (enum name, etc.)
+ */
+%define amglue_add_constant_short(CONSTNAME, SHORTNAME, TAG)
+enum { CONSTNAME }; /* pass the constant to SWIG */
+amglue_export_tag(TAG, $CONSTNAME);
+%perlcode %{
+$_ ## TAG ## _VALUES{`SHORTNAME`} = $CONSTNAME;
+%}
+%enddef
+
+/* Add the given constant.  No shortname is supplied, so the constant
+ * will not be used for conversion to strings.  Use this function for
+ * bit combinations and other metadata, e.g., FOO_MASK or FOO_MAX
+ *
+ * @param CONSTNAME: the name of the constant, as used in C code
+ * @param TAG: the tag for this constant (enum name, etc.)
+ */
+%define amglue_add_constant_noshort(CONSTNAME, TAG)
+enum { CONSTNAME }; /* pass the constant to SWIG */
+amglue_export_tag(TAG, $CONSTNAME);
+%enddef
diff --git a/perl/amglue/exports.swg b/perl/amglue/exports.swg
new file mode 100644 (file)
index 0000000..ea4f5cb
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/*
+ * This file contains SWIG macros to handle exports from perl modules using
+ * the Exporter paackage;
+ */
+
+/* Initialization: SWIG sets up @EXPORT, but to be 'use strict'-compatible,
+ * we declare @EXPORT_OK and %EXPORT_TAGS.
+ */
+%perlcode %{
+@EXPORT_OK = ();
+%EXPORT_TAGS = ();
+%}
+
+/* Mark SYMBOLS as exported by default (in @EXPORT)
+ *
+ * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
+ */
+%define amglue_export(SYMBOLS)
+%perlcode %{
+push @EXPORT, qw(SYMBOLS);
+%}
+%enddef
+
+/* Mark SYMBOLS as exported on request (in @EXPORT_OK)
+ *
+ * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
+ */
+%define amglue_export_ok(SYMBOLS)
+%perlcode %{
+push @EXPORT_OK, qw(SYMBOLS);
+%}
+%enddef
+
+/* Mark SYMBOLS as exported for tag TAG (in $EXPORT_TAGS{TAG}); also
+ * adds SYMBOLS to EXPORT_OK.
+ *
+ * @param TAG: tag under which to export
+ * @param SYMBOLS: whitespace-separated list of symbols (used in qw())
+ */
+%define amglue_export_tag(TAG, SYMBOLS)
+%perlcode %{
+push @EXPORT_OK, qw(SYMBOLS);
+push @{$EXPORT_TAGS{`TAG`}}, qw(SYMBOLS);
+%}
+%enddef
+
+/* Copy symbols in tag SRCTAG to tag DESTTAG; this is usually used to
+ * include enums or flags into a categorical tag.
+ *
+ * @param SRCTAG: tag to copy from
+ * @param DESTTAG: tag to copy to
+ */
+%define amglue_copy_to_tag(SRCTAG, DESTTAG)
+%perlcode %{
+# copy symbols in SRCTAG to DESTTAG
+push @{$EXPORT_TAGS{`DESTTAG`}},  @{$EXPORT_TAGS{`SRCTAG`}};
+%}
+%enddef
diff --git a/perl/amglue/ghashtable.c b/perl/amglue/ghashtable.c
new file mode 100644 (file)
index 0000000..61a0289
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+#include "amglue.h"
+
+static void 
+foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p)
+{
+    char *key = key_p;
+    char *value = value_p;
+    HV *hv = user_data_p;
+    hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
+}
+
+SV *
+g_hash_table_to_hashref(GHashTable *hash)
+{
+    HV *hv = (HV *)sv_2mortal((SV *)newHV());
+
+    g_hash_table_foreach(hash, foreach_fn, hv);
+
+    return newRV((SV *)hv);
+}
diff --git a/perl/amglue/glib.swg b/perl/amglue/glib.swg
new file mode 100644 (file)
index 0000000..4ed25c1
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+/* Typedefs for a few glib basic types that SWIG doesn't recognize
+ * automatically.  Integers are handled specially; see bigint.{swg,c}
+ */
+
+%{
+#include "amglue.h"
+%}
+
+typedef int gboolean;
+typedef void *gpointer;
+typedef void *gconstpointer;
+
+typedef char gchar;
+typedef unsigned char guchar;
+
+typedef float gfloat;
+typedef double gdouble;
diff --git a/perl/amglue/integers.swg b/perl/amglue/integers.swg
new file mode 100644 (file)
index 0000000..505e7b7
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) Zmanda, Inc.  All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ *
+ * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ */
+
+%{
+#include "amglue.h"
+%}
+
+/*
+ * perl -> C (input)
+ */
+
+%typemap(in) guint64 {
+    $1 = amglue_SvU64($input);
+}
+
+%typemap(in) gint64 {
+    $1 = amglue_SvI64($input);
+}
+
+%typemap(in) guint32 {
+    $1 = amglue_SvU32($input);
+}
+
+%typemap(in) gint32 {
+    $1 = amglue_SvI32($input);
+}
+
+%typemap(in) guint16 {
+    $1 = amglue_SvU16($input);
+}
+
+%typemap(in) gint16 {
+    $1 = amglue_SvI16($input);
+}
+
+%typemap(in) guint8 {
+    $1 = amglue_SvU8($input);
+}
+
+%typemap(in) gint8 {
+    $1 = amglue_SvI8($input);
+}
+
+/* remaining types depend on the complier to optimize out constant sizeof() 
+ * expressions.  The SWIG preprocessor can't perform calculations based on 
+ * sizeof(). */
+
+%define typemap_in_unsigned(type)
+%typemap(in) type {
+    if (sizeof(type) == 1) {
+       $1 = amglue_SvU8($input);
+    } else if (sizeof(type) == 2) {
+       $1 = amglue_SvU16($input);
+    } else if (sizeof(type) == 4) {
+       $1 = amglue_SvU32($input);
+    } else if (sizeof(type) == 8) {
+       $1 = amglue_SvU64($input);
+    } else {
+       croak("Unexpected type >64 bits?"); /* should be optimized out unless sizeof(type) > 8 */
+    }
+}
+%enddef
+
+typemap_in_unsigned(unsigned int)
+typemap_in_unsigned(guint)
+typemap_in_unsigned(unsigned short)
+typemap_in_unsigned(gushort)
+typemap_in_unsigned(size_t)
+typemap_in_unsigned(gsize)
+typemap_in_unsigned(unsigned long long)
+typemap_in_unsigned(unsigned long)
+typemap_in_unsigned(gulong)
+typemap_in_unsigned(off_t)
+typemap_in_unsigned(ptrdiff_t)
+typemap_in_unsigned(uintmax_t)
+
+%define typemap_in_signed(type)
+%typemap(in) type {
+    if (sizeof(type) == 1) {
+       $1 = amglue_SvI8($input);
+    } else if (sizeof(type) == 2) {
+       $1 = amglue_SvI16($input);
+    } else if (sizeof(type) == 4) {
+       $1 = amglue_SvI32($input);
+    } else if (sizeof(type) == 8) {
+       $1 = amglue_SvI64($input);
+    } else {
+       g_critical("Unexpected type >64 bits?"); /* should be optimized out unless sizeof(type) > 8 */
+    }
+}
+%enddef
+
+typemap_in_signed(int)
+typemap_in_signed(gint)
+typemap_in_signed(signed int)
+typemap_in_signed(short)
+typemap_in_signed(gshort)
+typemap_in_signed(signed short)
+typemap_in_signed(ssize_t)
+typemap_in_signed(gssize)
+typemap_in_signed(long long)
+typemap_in_signed(signed long long)
+typemap_in_signed(long)
+typemap_in_signed(signed long)
+typemap_in_signed(glong)
+typemap_in_signed(intmax_t)
+
+/*
+ * C -> perl (output)
+ */
+
+/* All conversions from C to Perl create Math::BigInt objects, even when the
+ * C datatype is 32 bits or smaller.  This is to ensure that Perl's automatic
+ * promotion to double does not silently corrupt arithmetic on large numbers.
+ */
+
+/* (these all use newSV*64, relying on C to upcast to a 64-bit integer) */
+
+%define typemap_out_unsigned(type)
+%typemap(out) type {
+    $result = sv_2mortal(amglue_newSVu64($1));
+    argvi++;
+}
+%enddef
+
+typemap_out_unsigned(guint64)
+typemap_out_unsigned(guint32)
+typemap_out_unsigned(guint16)
+typemap_out_unsigned(guint8)
+typemap_out_unsigned(unsigned int)
+typemap_out_unsigned(guint)
+typemap_out_unsigned(unsigned short)
+typemap_out_unsigned(gushort)
+typemap_out_unsigned(size_t)
+typemap_out_unsigned(gsize)
+typemap_out_unsigned(unsigned long long)
+typemap_out_unsigned(unsigned long)
+typemap_out_unsigned(gulong)
+typemap_out_unsigned(off_t)
+typemap_out_unsigned(ptrdiff_t)
+typemap_out_unsigned(uintmax_t)
+
+%define typemap_out_signed(type)
+%typemap(out) type {
+    $result = sv_2mortal(amglue_newSVi64($1));
+    argvi++;
+}
+%enddef
+
+typemap_out_signed(gint64)
+typemap_out_signed(gint32)
+typemap_out_signed(gint16)
+typemap_out_signed(gint8)
+typemap_out_signed(int)
+typemap_out_signed(gint)
+typemap_out_signed(signed int)
+typemap_out_signed(short)
+typemap_out_signed(gshort)
+typemap_out_signed(signed short)
+typemap_out_signed(ssize_t)
+typemap_out_signed(gssize)
+typemap_out_signed(long long)
+typemap_out_signed(signed long long)
+typemap_out_signed(long)
+typemap_out_signed(signed long)
+typemap_out_signed(glong)
+typemap_out_signed(intmax_t)
diff --git a/po/Makefile.am b/po/Makefile.am
new file mode 100755 (executable)
index 0000000..d2f4fa8
--- /dev/null
@@ -0,0 +1,152 @@
+# Makefile for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+PACKAGE = amanda
+MAINTAINER_EMAIL = support@zmanda.com
+
+POFILES = $(wildcard *.po)
+#MOFILES = $(patsubst %.po,%.mo,$(POFILES)) 
+MOFILES = 
+
+CFILES = $(wildcard $(top_srcdir)/*/*.[ch])
+PLFILES = $(wildcard $(top_srcdir)/*/*.pl.in)
+SHFILES = $(wildcard $(top_srcdir)/*/*.sh.in)
+ALLFILES = $(CFILES) $(PLFILES) $(SHFILES)
+
+# This variable depends on the location of this directory.
+top_builddir = ..
+localedir=$(datadir)/locale
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=_T
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+
+GMSGFMT = gmsgfmt
+MSGFMT = msgfmt
+MSGINIT = msginit
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = msgmerge --update
+XGETTEXT = xgettext
+
+DISTFILES =                    \
+       ${POFILES}              \
+       ${MOFILES}              \
+       boldquot.sed            \
+       en@boldquot.header      \
+       en@quot.header          \
+       insert-header.sin       \
+       Makefile.am             \
+       Makefile.in             \
+       Makevars                \
+       quot.sed                \
+       remove-potcdate.sin     \
+       Rules-quot              \
+       stamp-po
+
+SUFFIXES = .po .mo .sed .sin
+
+.sin.sed:
+       sed -e '/^#/d' $< > t-$@
+       mv t-$@ $@
+
+all: $(MOFILES)
+
+# This target rebuilds amanda.pot; it is an expensive operation.
+# Note that amanda.pot is not touched if it doesn't need to be changed.
+amanda.pot: $(ALLFILES)
+       @echo $(XGETTEXT) --language=C --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=C     \
+         $(CFILES)
+       @echo $(XGETTEXT) --language=Perl --join-existing --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=Perl  \
+         --join-existing $(PLFILES)
+       @echo $(XGETTEXT) --language=Shell --join-existing --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=Shell \
+         --join-existing $(SHFILES)
+       @test ! -f amanda.po || {                                          \
+         if test -f $(srcdir)/amanda.pot; then                            \
+           sed -f remove-potcdate.sed < $(srcdir)/amanda.pot > amanda.1po && \
+           sed -f remove-potcdate.sed < amanda.po > amanda.2po &&         \
+           if cmp amanda.1po amanda.2po >/dev/null 2>&1; then             \
+             rm -f amanda.1po amanda.2po amanda.po;                       \
+           else                                                           \
+             rm -f amanda.1po amanda.2po $(srcdir)/amanda.pot &&          \
+             mv amanda.po $(srcdir)/amanda.pot;                           \
+           fi;                                                            \
+         else                                                             \
+           mv amanda.po $(srcdir)/amanda.pot;                             \
+         fi;                                                              \
+       }
+
+
+# This target rebuilds a PO file if amanda.pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+%.po: amanda.pot
+       @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+       if test "$$lang" = "en_ZM"; then  \
+         echo msgen -o en.po amanda.pot; \
+         msgen -o en.po amanda.pot; \
+       elif test -f "$(srcdir)/$${lang}.po"; then \
+         echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po amanda.pot"; \
+         cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po amanda.pot; \
+       else \
+         echo $(MSGINIT) --locale=$${lang} --input=amanda.pot --output-file=$${lang}.po; \
+         $(MSGINIT) --no-translator --locale=$${lang} --input=amanda.pot --output-file=$${lang}.po; \
+       fi
+
+#en_ZM.po: en.po zlocale.pl ztranslation
+#      @chmod +x ./zlocale.pl
+#      ./zlocale.pl                    
+
+%.mo: %.po
+       @echo "$(MSGFMT) -o $@ $<"; \
+       $(MSGFMT) -o t-$@ $< && mv t-$@ $@
+
+install-data-hook: $(MOFILES)
+       @for cat in "" $(MOFILES); do \
+         if test -z "$$cat" -o "$$cat" = "en.mo"; then \
+           continue; \
+         fi; \
+         cat=`basename $$cat`; \
+         lang=`echo $$cat | sed -e 's/\.mo$$//'`; \
+         dir=$(localedir)/$$lang/LC_MESSAGES; \
+         $(mkdir_p) $(DESTDIR)$$dir; \
+         if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+         $(INSTALL) $$realcat $(DESTDIR)$$dir/amanda.mo; \
+         echo "installing $$realcat as $(DESTDIR)$$dir/amanda.mo"; \
+         for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+           if test -n "$$lc"; then \
+             if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+             else \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
+             fi; \
+             rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo; \
+             ln -s ../LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo 2>/dev/null || \
+             ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo 2>/dev/null || \
+             cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo; \
+             echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo"; \
+           fi; \
+         done; \
+        done
diff --git a/po/Makefile.in b/po/Makefile.in
new file mode 100644 (file)
index 0000000..f1089da
--- /dev/null
@@ -0,0 +1,863 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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@
+
+# Makefile for PO directory in any package using GNU gettext.
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@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 = po
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASH = @BASH@
+BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FLOAT_H = @FLOAT_H@
+GETCONF = @GETCONF@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = gmsgfmt
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MSGFMT = msgfmt
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = msgmerge
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+OBJEXT = @OBJEXT@
+
+# Usually the message domain is the same as the package name.
+PACKAGE = amanda
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XGETTEXT = xgettext
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
+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@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+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 = $(datadir)/locale
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+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@
+
+# This variable depends on the location of this directory.
+top_builddir = ..
+top_srcdir = @top_srcdir@
+MAINTAINER_EMAIL = support@zmanda.com
+POFILES = $(wildcard *.po)
+#MOFILES = $(patsubst %.po,%.mo,$(POFILES)) 
+MOFILES = 
+CFILES = $(wildcard $(top_srcdir)/*/*.[ch])
+PLFILES = $(wildcard $(top_srcdir)/*/*.pl.in)
+SHFILES = $(wildcard $(top_srcdir)/*/*.sh.in)
+ALLFILES = $(CFILES) $(PLFILES) $(SHFILES)
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=_T
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES = 
+MSGINIT = msginit
+MSGMERGE_UPDATE = msgmerge --update
+DISTFILES = \
+       ${POFILES}              \
+       ${MOFILES}              \
+       boldquot.sed            \
+       en@boldquot.header      \
+       en@quot.header          \
+       insert-header.sin       \
+       Makefile.am             \
+       Makefile.in             \
+       Makevars                \
+       quot.sed                \
+       remove-potcdate.sin     \
+       Rules-quot              \
+       stamp-po
+
+SUFFIXES = .po .mo .sed .sin
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .po .mo .sed .sin
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  po/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnu  po/Makefile
+.PRECIOUS: 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:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$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:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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
+
+info: info-am
+
+info-am:
+
+install-data-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
+
+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
+
+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-data-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       distclean distclean-generic distclean-libtool distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-data-hook install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       uninstall uninstall-am
+
+
+.sin.sed:
+       sed -e '/^#/d' $< > t-$@
+       mv t-$@ $@
+
+all: $(MOFILES)
+
+# This target rebuilds amanda.pot; it is an expensive operation.
+# Note that amanda.pot is not touched if it doesn't need to be changed.
+amanda.pot: $(ALLFILES)
+       @echo $(XGETTEXT) --language=C --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=C     \
+         $(CFILES)
+       @echo $(XGETTEXT) --language=Perl --join-existing --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=Perl  \
+         --join-existing $(PLFILES)
+       @echo $(XGETTEXT) --language=Shell --join-existing --output=amanda.pot ... 
+       @$(XGETTEXT) --output=amanda.pot --default-domain=amanda           \
+         --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) --language=Shell \
+         --join-existing $(SHFILES)
+       @test ! -f amanda.po || {                                          \
+         if test -f $(srcdir)/amanda.pot; then                            \
+           sed -f remove-potcdate.sed < $(srcdir)/amanda.pot > amanda.1po && \
+           sed -f remove-potcdate.sed < amanda.po > amanda.2po &&         \
+           if cmp amanda.1po amanda.2po >/dev/null 2>&1; then             \
+             rm -f amanda.1po amanda.2po amanda.po;                       \
+           else                                                           \
+             rm -f amanda.1po amanda.2po $(srcdir)/amanda.pot &&          \
+             mv amanda.po $(srcdir)/amanda.pot;                           \
+           fi;                                                            \
+         else                                                             \
+           mv amanda.po $(srcdir)/amanda.pot;                             \
+         fi;                                                              \
+       }
+
+# This target rebuilds a PO file if amanda.pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+%.po: amanda.pot
+       @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+       if test "$$lang" = "en_ZM"; then  \
+         echo msgen -o en.po amanda.pot; \
+         msgen -o en.po amanda.pot; \
+       elif test -f "$(srcdir)/$${lang}.po"; then \
+         echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po amanda.pot"; \
+         cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po amanda.pot; \
+       else \
+         echo $(MSGINIT) --locale=$${lang} --input=amanda.pot --output-file=$${lang}.po; \
+         $(MSGINIT) --no-translator --locale=$${lang} --input=amanda.pot --output-file=$${lang}.po; \
+       fi
+
+#en_ZM.po: en.po zlocale.pl ztranslation
+#      @chmod +x ./zlocale.pl
+#      ./zlocale.pl                    
+
+%.mo: %.po
+       @echo "$(MSGFMT) -o $@ $<"; \
+       $(MSGFMT) -o t-$@ $< && mv t-$@ $@
+
+install-data-hook: $(MOFILES)
+       @for cat in "" $(MOFILES); do \
+         if test -z "$$cat" -o "$$cat" = "en.mo"; then \
+           continue; \
+         fi; \
+         cat=`basename $$cat`; \
+         lang=`echo $$cat | sed -e 's/\.mo$$//'`; \
+         dir=$(localedir)/$$lang/LC_MESSAGES; \
+         $(mkdir_p) $(DESTDIR)$$dir; \
+         if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+         $(INSTALL) $$realcat $(DESTDIR)$$dir/amanda.mo; \
+         echo "installing $$realcat as $(DESTDIR)$$dir/amanda.mo"; \
+         for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+           if test -n "$$lc"; then \
+             if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+             else \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
+             fi; \
+             rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo; \
+             ln -s ../LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo 2>/dev/null || \
+             ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo 2>/dev/null || \
+             cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/amanda.mo $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo; \
+             echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/amanda.mo"; \
+           fi; \
+         done; \
+        done
+# 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/po/Makevars b/po/Makevars
new file mode 100755 (executable)
index 0000000..79ec38d
--- /dev/null
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = amanda
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Zmanda Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = support@zmanda.com
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100755 (executable)
index 0000000..9c2a995
--- /dev/null
@@ -0,0 +1,47 @@
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en@quot.po-create:
+       $(MAKE) en@quot.po-update
+en@boldquot.po-create:
+       $(MAKE) en@boldquot.po-update
+
+en@quot.po-update: en@quot.po-update-en
+en@boldquot.po-update: en@boldquot.po-update-en
+
+.insert-header.po-update-en:
+       @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+       if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+       tmpdir=`pwd`; \
+       echo "$$lang:"; \
+       ll=`echo $$lang | sed -e 's/@.*//'`; \
+       LC_ALL=C; export LC_ALL; \
+       cd $(srcdir); \
+       if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+         if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+           rm -f $$tmpdir/$$lang.new.po; \
+         else \
+           if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+             :; \
+           else \
+             echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+             exit 1; \
+           fi; \
+         fi; \
+       else \
+         echo "creation of $$lang.po failed!" 1>&2; \
+         rm -f $$tmpdir/$$lang.new.po; \
+       fi
+
+en@quot.insert-header: insert-header.sin
+       sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
+
+en@boldquot.insert-header: insert-header.sin
+       sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+       rm -f *.insert-header
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100755 (executable)
index 0000000..4b937aa
--- /dev/null
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“\e[1m/g
+s/”/\e[0m”/g
+s/‘/‘\e[1m/g
+s/’/\e[0m’/g
diff --git a/po/en@boldquot.header b/po/en@boldquot.header
new file mode 100755 (executable)
index 0000000..fedb6a0
--- /dev/null
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/po/en@quot.header b/po/en@quot.header
new file mode 100755 (executable)
index 0000000..a9647fc
--- /dev/null
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100755 (executable)
index 0000000..b26de01
--- /dev/null
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100755 (executable)
index 0000000..0122c46
--- /dev/null
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100755 (executable)
index 0000000..2436c49
--- /dev/null
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/stamp-po b/po/stamp-po
new file mode 100644 (file)
index 0000000..9788f70
--- /dev/null
@@ -0,0 +1 @@
+timestamp
index ac37b7300e7dd9934e684b287c17701d5e029143..5face92160014e52cec0c9a4d63319b5b0c33f49 100644 (file)
@@ -1,10 +1,16 @@
 # Makefile for Amanda file recovery programs.
 
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
 
@@ -12,10 +18,6 @@ LIB_EXTENSION = la
 
 sbin_PROGRAMS =                amrecover
 
-if WANT_RUNTIME_PSEUDO_RELOC
-AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
-endif
-
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
 # libraries, and because of the way libtool sets up the command line, we
@@ -25,10 +27,10 @@ endif
 
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
+       $(READLINE_LIBS) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) \
-       $(READLINE_LIBS)
+       ../gnulib/libgnu.$(LIB_EXTENSION) 
 
 amrecover_CSRC =       amrecover.c                                     \
                        display_commands.c              extract_list.c  \
@@ -42,27 +44,18 @@ AM_YFLAGS =         -d
 
 # so that uscan.c is never generated before uparse.h
 # otherwise we might have makedepend problems
-$(srcdir)/uscan.c: $(srcdir)/uparse.h
+uscan.c: uparse.h
 
-uscan.$(OBJEXT): $(srcdir)/uscan.c
+# these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS)
+# since we don't want warnings for generated code
+uscan.$(OBJEXT): uscan.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-uparse.$(OBJEXT): $(srcdir)/uparse.c
+uparse.$(OBJEXT): uparse.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-               echo chmod o-rwx $$pa; \
-               chmod o-rwx $$pa; \
-       done
-
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS)
 
 lint:
        @f="$(amrecover_CSRC)";                                                 \
@@ -71,7 +64,7 @@ lint:
        (cd ../server-src; make listlibsrc);                                    \
        f="$$f "`cat ../server-src/listlibsrc.output`;                          \
        echo $(LINT) $$f;                                                       \
-       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
+       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\
        if [ $$? -ne 0 ]; then                                                  \
            exit 1;                                                             \
        fi;                                                                     \
index a31769562b42f6c1fe751a5e16649b77556c3791..62ae5bb9640ce780283e2f87a70014738fe3cf55 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda file recovery programs.
 
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -40,48 +77,119 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am uparse.c uparse.h \
+       uscan.c
 sbin_PROGRAMS = amrecover$(EXEEXT)
 subdir = recover-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in uparse.c uparse.h uscan.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -98,40 +206,43 @@ amrecover_OBJECTS = $(am_amrecover_OBJECTS)
 amrecover_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 amrecover_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
+       $(am__DEPENDENCIES_1) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+       ../gnulib/libgnu.$(LIB_EXTENSION)
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+YLWRAP = $(top_srcdir)/config/ylwrap
 YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
-       $(AM_YFLAGS)
+LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
 SOURCES = $(amrecover_SOURCES)
 DIST_SOURCES = $(amrecover_SOURCES)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -139,14 +250,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -157,20 +273,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -184,60 +299,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -247,10 +471,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -261,24 +499,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -290,59 +562,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -351,34 +610,46 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/client-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
 LIB_EXTENSION = la
-@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -388,10 +659,10 @@ LIB_EXTENSION = la
 ###
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
+       $(READLINE_LIBS) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) \
-       $(READLINE_LIBS)
+       ../gnulib/libgnu.$(LIB_EXTENSION) 
 
 amrecover_CSRC = amrecover.c                                   \
                        display_commands.c              extract_list.c  \
@@ -400,11 +671,14 @@ amrecover_CSRC = amrecover.c                                      \
 amrecover_SOURCES = $(amrecover_CSRC)  uparse.y        uscan.l
 noinst_HEADERS = amrecover.h uparse.h
 AM_YFLAGS = -d
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS)
+
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .l .lo .o .obj .y
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -435,7 +709,7 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
@@ -464,11 +738,11 @@ clean-sbinPROGRAMS:
 uparse.h: uparse.c
        @if test ! -f $@; then \
          rm -f uparse.c; \
-         $(MAKE) uparse.c; \
+         $(MAKE) $(AM_MAKEFLAGS) uparse.c; \
        else :; fi
 amrecover$(EXEEXT): $(amrecover_OBJECTS) $(amrecover_DEPENDENCIES) 
        @rm -f amrecover$(EXEEXT)
-       $(LINK) $(amrecover_LDFLAGS) $(amrecover_OBJECTS) $(amrecover_LDADD) $(LIBS)
+       $(LINK) $(amrecover_OBJECTS) $(amrecover_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -485,51 +759,31 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uscan.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
 .l.c:
-       $(LEXCOMPILE) $<
-       sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
-       rm -f $(LEX_OUTPUT_ROOT).c
+       $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
 
 .y.c:
-       $(YACCCOMPILE) $<
-       if test -f y.tab.h; then \
-         to=`echo "$*_H" | sed \
-                -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
-                -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
-         sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
-            y.tab.h >$*.ht; \
-         rm -f y.tab.h; \
-         if cmp -s $*.ht $*.h; then \
-           rm -f $*.ht ;\
-         else \
-           mv $*.ht $*.h; \
-         fi; \
-       fi
-       if test -f y.output; then \
-         mv y.output $*.output; \
-       fi
-       sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
-       rm -f y.tab.c
+       $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -537,10 +791,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -590,22 +840,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -621,7 +870,7 @@ check: check-am
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
        for dir in "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -650,6 +899,8 @@ maintainer-clean-generic:
        -rm -f uparse.c
        -rm -f uparse.h
        -rm -f uscan.c
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
@@ -659,7 +910,7 @@ distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -672,15 +923,25 @@ info: info-am
 info-am:
 
 install-data-am:
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
 install-exec-am: install-sbinPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -701,44 +962,95 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS
+uninstall-am: uninstall-sbinPROGRAMS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
        clean-libtool clean-sbinPROGRAMS ctags distclean \
        distclean-compile distclean-generic distclean-libtool \
        distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-exec \
-       install-exec-am install-exec-hook install-info install-info-am \
-       install-man 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 uninstall uninstall-am uninstall-info-am \
+       install install-am install-data install-data-am \
+       install-data-hook install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook 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 uninstall uninstall-am \
        uninstall-sbinPROGRAMS
 
 
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
+
 # so that uscan.c is never generated before uparse.h
 # otherwise we might have makedepend problems
-$(srcdir)/uscan.c: $(srcdir)/uparse.h
+uscan.c: uparse.h
 
-uscan.$(OBJEXT): $(srcdir)/uscan.c
+# these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS)
+# since we don't want warnings for generated code
+uscan.$(OBJEXT): uscan.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-uparse.$(OBJEXT): $(srcdir)/uparse.c
+uparse.$(OBJEXT): uparse.c
        $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-               echo chmod o-rwx $$pa; \
-               chmod o-rwx $$pa; \
-       done
-
 lint:
        @f="$(amrecover_CSRC)";                                                 \
        (cd ../common-src; make listlibsrc);                                    \
@@ -746,7 +1058,7 @@ lint:
        (cd ../server-src; make listlibsrc);                                    \
        f="$$f "`cat ../server-src/listlibsrc.output`;                          \
        echo $(LINT) $$f;                                                       \
-       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
+       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\
        if [ $$? -ne 0 ]; then                                                  \
            exit 1;                                                             \
        fi;                                                                     \
index 7752ee6f8a98c6e03fa4360c852765daef21d006..0f103dc87ca87cba193cc226ae2d62b22037b955 100644 (file)
@@ -42,9 +42,9 @@
 #include "event.h"
 #include "security.h"
 
-#define amrecover_debug(i,x) do {      \
+#define amrecover_debug(i, ...) do {   \
        if ((i) <= debug_amrecover) {   \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
@@ -54,9 +54,8 @@ int grab_reply(int show);
 void sigint_handler(int signum);
 int main(int argc, char **argv);
 
-#define USAGE "Usage: amrecover [[-C] <config>] [-s <index-server>] [-t <tape-server>] [-d <tape-device>] [-o <clientconfigoption>]*\n"
+#define USAGE _("Usage: amrecover [[-C] <config>] [-s <index-server>] [-t <tape-server>] [-d <tape-device>] [-o <clientconfigoption>]*\n")
 
-char *config = NULL;
 char *server_name = NULL;
 int server_socket;
 char *server_line = NULL;
@@ -110,18 +109,18 @@ get_line(void)
        buf = NULL;
        size = security_stream_read_sync(streams[MESGFD].fd, &buf);
        if(size < 0) {
-           amrecover_debug(1, ("%s: amrecover: get_line size < 0 (%zd)\n", debug_prefix_time(NULL), size));
+           amrecover_debug(1, "amrecover: get_line size < 0 (%zd)\n", size);
            return -1;
        }
        else if(size == 0) {
-           amrecover_debug(1, ("%s: amrecover: get_line size == 0 (%zd)\n", debug_prefix_time(NULL), size));
+           amrecover_debug(1, "amrecover: get_line size == 0 (%zd)\n", size);
            return -1;
        }
        else if (buf == NULL) {
-           amrecover_debug(1, ("%s: amrecover: get_line buf == NULL\n", debug_prefix_time(NULL)));
+           amrecover_debug(1, "amrecover: get_line buf == NULL\n");
            return -1;
        }
-        amrecover_debug(1, ("%s: amrecover: get_line size = %zd\n", debug_prefix_time(NULL), size));
+        amrecover_debug(1, "amrecover: get_line size = %zd\n", size);
        newbuf = alloc(strlen(mesg_buffer)+size+1);
        strncpy(newbuf, mesg_buffer, (size_t)(strlen(mesg_buffer) + size));
        memcpy(newbuf+strlen(mesg_buffer), buf, (size_t)size);
@@ -313,13 +312,20 @@ main(
     extern char *optarg;
     extern int optind;
     char *line = NULL;
-    char *conffile;
     const security_driver_t *secdrv;
     char *req = NULL;
     int response_error;
-    int new_argc;
-    char **new_argv;
     struct tm *tm;
+    config_overwrites_t *cfg_ovr;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -330,94 +336,76 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
 
-#ifndef IGNORE_UID_CHECK
-    if (geteuid() != 0) {
-       erroutput_type |= ERR_SYSLOG;
-       error("amrecover must be run by root");
-       /*NOTREACHED*/
-    }
-#endif
-
     localhost = alloc(MAX_HOSTNAME_LENGTH+1);
     if (gethostname(localhost, MAX_HOSTNAME_LENGTH) != 0) {
-       error("cannot determine local host name\n");
+       error(_("cannot determine local host name\n"));
        /*NOTREACHED*/
     }
     localhost[MAX_HOSTNAME_LENGTH] = '\0';
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
+    /* load the base client configuration */
+    config_init(CONFIG_INIT_CLIENT, NULL);
 
-    if (new_argc > 1 && new_argv[1][0] != '-') {
-       /*
-        * If the first argument is not an option flag, then we assume
-        * it is a configuration name to match the syntax of the other
-        * Amanda utilities.
-        */
-       char **new_argv1;
+    /* treat amrecover-specific command line options as the equivalent
+     * -o command-line options to set configuration values */
+    cfg_ovr = new_config_overwrites(argc/2);
 
-       new_argv1 = (char **) alloc((size_t)((new_argc + 1 + 1) * sizeof(*new_argv1)));
-       new_argv1[0] = new_argv[0];
-       new_argv1[1] = "-C";
-       for (i = 1; i < new_argc; i++) {
-           new_argv1[i + 1] = new_argv[i];
-       }
-       new_argv1[i + 1] = NULL;
-       new_argc++;
-       amfree(new_argv);
-       new_argv = new_argv1;
+    /* If the first argument is not an option flag, then we assume
+     * it is a configuration name to match the syntax of the other
+     * Amanda utilities. */
+    if (argc > 1 && argv[1][0] != '-') {
+       add_config_overwrite(cfg_ovr, "conf", argv[1]);
+
+       /* remove that option from the command line */
+       argv[1] = argv[0];
+       argv++; argc--;
     }
-    while ((i = getopt(new_argc, new_argv, "C:s:t:d:U")) != EOF) {
+
+    /* now parse regular command-line '-' options */
+    while ((i = getopt(argc, argv, "o:C:s:t:d:U")) != EOF) {
        switch (i) {
            case 'C':
-               add_client_conf(CNF_CONF, optarg);
+               add_config_overwrite(cfg_ovr, "conf", optarg);
                break;
 
            case 's':
-               add_client_conf(CNF_INDEX_SERVER, optarg);
+               add_config_overwrite(cfg_ovr, "index_server", optarg);
                break;
 
            case 't':
-               add_client_conf(CNF_TAPE_SERVER, optarg);
+               add_config_overwrite(cfg_ovr, "tape_server", optarg);
                break;
 
            case 'd':
-               add_client_conf(CNF_TAPEDEV, optarg);
+               add_config_overwrite(cfg_ovr, "tapedev", optarg);
+               break;
+
+           case 'o':
+               add_config_overwrite_opt(cfg_ovr, optarg);
                break;
 
            case 'U':
            case '?':
-               (void)printf(USAGE);
+               (void)g_printf(USAGE);
                return 0;
        }
     }
-    if (optind != new_argc) {
-       (void)fprintf(stderr, USAGE);
+    if (optind != argc) {
+       (void)g_fprintf(stderr, USAGE);
        exit(1);
     }
 
-    our_features = am_init_feature_set();
-    our_features_string = am_feature_to_string(our_features);
+    /* and now try to load the configuration named in that file */
+    apply_config_overwrites(cfg_ovr);
+    config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY,
+               getconf_str(CNF_CONF));
 
-    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_ROOT);
 
-    config = stralloc(getconf_str(CNF_CONF));
+    dbrename(config_name, DBG_SUBDIR_CLIENT);
 
-    conffile = vstralloc(CONFIG_DIR, "/", config, "/", "amanda-client.conf",
-                        NULL);
-    if (read_clientconf(conffile) > 0) {
-       error("error reading conffile: %s", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
-
-    dbrename(config, DBG_SUBDIR_CLIENT);
-
-    report_bad_conf_arg();
+    our_features = am_init_feature_set();
+    our_features_string = am_feature_to_string(our_features);
 
     server_name = NULL;
     if (getconf_seen(CNF_INDEX_SERVER) == -2) { /* command line argument */
@@ -426,14 +414,14 @@ main(
     if (!server_name) {
        server_name = getenv("AMANDA_SERVER");
        if (server_name) {
-           printf("Using index server from environment AMANDA_SERVER (%s)\n", server_name);
+           g_printf(_("Using index server from environment AMANDA_SERVER (%s)\n"), server_name);
        }
     }
     if (!server_name) {
        server_name = getconf_str(CNF_INDEX_SERVER);
     }
     if (!server_name) {
-       error("No index server set");
+       error(_("No index server set"));
        /*NOTREACHED*/
     }
     server_name = stralloc(server_name);
@@ -447,25 +435,30 @@ main(
        if (!tape_server_name) {
            tape_server_name = getenv("AMANDA_TAPESERVER");
            if (tape_server_name) {
-               printf("Using tape server from environment AMANDA_TAPESERVER (%s)\n", tape_server_name);
+               g_printf(_("Using tape server from environment AMANDA_TAPESERVER (%s)\n"), tape_server_name);
            }
        } else {
-           printf("Using tape server from environment AMANDA_TAPE_SERVER (%s)\n", tape_server_name);
+           g_printf(_("Using tape server from environment AMANDA_TAPE_SERVER (%s)\n"), tape_server_name);
        }
     }
     if (!tape_server_name) {
        tape_server_name = getconf_str(CNF_TAPE_SERVER);
     }
     if (!tape_server_name) {
-       error("No tape server set");
+       error(_("No tape server set"));
        /*NOTREACHED*/
     }
     tape_server_name = stralloc(tape_server_name);
 
     amfree(tape_device_name);
     tape_device_name = getconf_str(CNF_TAPEDEV);
-    if (tape_device_name)
+    if (!tape_device_name ||
+       strlen(tape_device_name) == 0 ||
+       !getconf_seen(CNF_TAPEDEV)) {
+       tape_device_name = NULL;
+    } else {
        tape_device_name = stralloc(tape_device_name);
+    }
 
     authopt = stralloc(getconf_str(CNF_AUTH));
 
@@ -483,7 +476,7 @@ main(
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
     if (sigaction(SIGINT, &act, &oact) != 0) {
-       error("error setting signal handler: %s", strerror(errno));
+       error(_("error setting signal handler: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -492,14 +485,13 @@ main(
     /* We assume that amindexd support fe_amindexd_options_features */
     /*                             and fe_amindexd_options_auth     */
     /* We should send a noop to really know                         */
-    req = vstralloc("SERVICE amindexd\n",
-                   "OPTIONS ", "features=", our_features_string, ";",
-                               "auth=", authopt, ";",
-                   "\n", NULL);
+    req = vstrallocf("SERVICE amindexd\n"
+                   "OPTIONS features=%s;auth=%s;\n",
+                   our_features_string, authopt);
 
     secdrv = security_getdriver(authopt);
     if (secdrv == NULL) {
-       error("no '%s' security driver available for host '%s'",
+       error(_("no '%s' security driver available for host '%s'"),
            authopt, server_name);
        /*NOTREACHED*/
     }
@@ -510,24 +502,14 @@ main(
     amfree(req);
     protocol_run();
 
-    printf("AMRECOVER Version %s. Contacting server on %s ...\n",
+    g_printf(_("AMRECOVER Version %s. Contacting server on %s ...\n"),
           version(), server_name);
 
     if(response_error != 0) {
-       fprintf(stderr,"%s\n",errstr);
+       g_fprintf(stderr,"%s\n",errstr);
        exit(1);
     }
 
-#if 0
-    /*
-     * We may need root privilege again later for a reserved port to
-     * the tape server, so we will drop down now but might have to
-     * come back later.
-     */
-    setegid(getgid());
-    seteuid(getuid());
-#endif
-
     /* get server's banner */
     if (grab_reply(1) == -1) {
         aclose(server_socket);
@@ -543,7 +525,7 @@ main(
     {
        char *their_feature_string = NULL;
 
-       line = stralloc2("FEATURES ", our_features_string);
+       line = vstrallocf("FEATURES %s", our_features_string);
        if(exchange(line) == 0) {
            their_feature_string = stralloc(server_line+13);
            indexsrv_features = am_string_to_feature(their_feature_string);
@@ -561,17 +543,17 @@ main(
     if (tm) 
        strftime(dump_date, sizeof(dump_date), "%Y-%m-%d", tm);
     else
-       error("BAD DATE");
+       error(_("BAD DATE"));
 
-    printf("Setting restore date to today (%s)\n", dump_date);
-    line = stralloc2("DATE ", dump_date);
+    g_printf(_("Setting restore date to today (%s)\n"), dump_date);
+    line = vstrallocf("DATE %s", dump_date);
     if (converse(line) == -1) {
         aclose(server_socket);
        exit(1);
     }
     amfree(line);
 
-    line = stralloc2("SCNF ", config);
+    line = vstrallocf("SCNF %s", config_name);
     if (converse(line) == -1) {
         aclose(server_socket);
        exit(1);
@@ -583,9 +565,9 @@ main(
        amfree(dump_hostname);
        set_host(localhost);
        if (dump_hostname)
-           printf("Use the setdisk command to choose dump disk to recover\n");
+           g_printf(_("Use the setdisk command to choose dump disk to recover\n"));
        else
-           printf("Use the sethost command to choose a host to recover\n");
+           g_printf(_("Use the sethost command to choose a host to recover\n"));
 
     }
 
@@ -599,6 +581,7 @@ main(
        if (lineread[0] != '\0') 
        {
            add_history(lineread);
+           dbprintf(_("user command: '%s'\n"), lineread);
            process_line(lineread);     /* act on line's content */
        }
        amfree(lineread);
@@ -625,15 +608,15 @@ amindexd_response(
     assert(sech != NULL);
 
     if (pkt == NULL) {
-       errstr = newvstralloc(errstr, "[request failed: ",
-                            security_geterror(sech), "]", NULL);
+       errstr = newvstrallocf(errstr, _("[request failed: %s]"),
+                            security_geterror(sech));
        *response_error = 1;
        return;
     }
 
     if (pkt->type == P_NAK) {
 #if defined(PACKET_DEBUG)
-       fprintf(stderr, "got nak response:\n----\n%s\n----\n\n", pkt->body);
+       dbprintf(_("got nak response:\n----\n%s\n----\n\n"), pkt->body);
 #endif
 
        tok = strtok(pkt->body, " ");
@@ -642,25 +625,25 @@ amindexd_response(
 
        tok = strtok(NULL, "\n");
        if (tok != NULL) {
-           errstr = newvstralloc(errstr, "NAK: ", tok, NULL);
+           errstr = newvstrallocf(errstr, "NAK: %s", tok);
            *response_error = 1;
        } else {
 bad_nak:
-           errstr = newstralloc(errstr, "request NAK");
+           errstr = newvstrallocf(errstr, _("request NAK"));
            *response_error = 2;
        }
        return;
     }
 
     if (pkt->type != P_REP) {
-       errstr = newvstralloc(errstr, "received strange packet type ",
-                             pkt_type2str(pkt->type), ": ", pkt->body, NULL);
+       errstr = newvstrallocf(errstr, _("received strange packet type %s: %s"),
+                             pkt_type2str(pkt->type), pkt->body);
        *response_error = 1;
        return;
     }
 
 #if defined(PACKET_DEBUG)
-    fprintf(stderr, "got response:\n----\n%s\n----\n\n", pkt->body);
+    g_fprintf(stderr, _("got response:\n----\n%s\n----\n\n"), pkt->body);
 #endif
 
     for(i = 0; i < NSTREAMS; i++) {
@@ -678,9 +661,11 @@ bad_nak:
         */
        if (strcmp(tok, "ERROR") == 0) {
            tok = strtok(NULL, "\n");
-           if (tok == NULL)
-               tok = "[bogus error packet]";
-           errstr = newstralloc(errstr, tok);
+           if (tok == NULL) {
+               errstr = newvstrallocf(errstr, _("[bogus error packet]"));
+           } else {
+               errstr = newvstrallocf(errstr, "%s", tok);
+           }
            *response_error = 2;
            return;
        }
@@ -697,22 +682,16 @@ bad_nak:
            for (i = 0; i < NSTREAMS; i++) {
                tok = strtok(NULL, " ");
                if (tok == NULL || strcmp(tok, streams[i].name) != 0) {
-                   extra = vstralloc("CONNECT token is \"",
-                                     tok ? tok : "(null)",
-                                     "\": expected \"",
-                                     streams[i].name,
-                                     "\"",
-                                     NULL);
+                   extra = vstrallocf(
+                          _("CONNECT token is \"%s\": expected \"%s\""),
+                          tok ? tok : _("(null)"), streams[i].name);
                    goto parse_error;
                }
                tok = strtok(NULL, " \n");
                if (tok == NULL || sscanf(tok, "%d", &ports[i]) != 1) {
-                   extra = vstralloc("CONNECT ",
-                                     streams[i].name,
-                                     " token is \"",
-                                     tok ? tok : "(null)",
-                                     "\": expected a port number",
-                                     NULL);
+                   extra = vstrallocf(
+                          _("CONNECT %s token is \"%s\" expected a port number"),
+                          streams[i].name, tok ? tok : _("(null)"));
                    goto parse_error;
                }
            }
@@ -725,10 +704,10 @@ bad_nak:
        if (strcmp(tok, "OPTIONS") == 0) {
            tok = strtok(NULL, "\n");
            if (tok == NULL) {
-               extra = stralloc("OPTIONS token is missing");
+               extra = vstrallocf(_("OPTIONS token is missing"));
                goto parse_error;
            }
-/*
+#if 0
            tok_end = tok + strlen(tok);
            while((p = strchr(tok, ';')) != NULL) {
                *p++ = '\0';
@@ -736,25 +715,21 @@ bad_nak:
                    tok += SIZEOF("features=") - 1;
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
-                       errstr = newvstralloc(errstr,
-                                             "OPTIONS: bad features value: ",
-                                             tok,
-                                             NULL);
+                       errstr = newvstrallocf(errstr,
+                                     _("OPTIONS: bad features value: %s"),
+                                     tok);
                        goto parse_error;
                    }
                }
                tok = p;
            }
-*/
+#endif
            continue;
        }
-/*
-       extra = vstralloc("next token is \"",
-                         tok ? tok : "(null)",
-                         "\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\"",
-                         NULL);
+#if 0
+       extra = vstrallocf(_("next token is \"%s\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\""), tok ? tok : _("(null)"));
        goto parse_error;
-*/
+#endif
     }
 
     /*
@@ -765,9 +740,9 @@ bad_nak:
            continue;
        streams[i].fd = security_stream_client(sech, ports[i]);
        if (streams[i].fd == NULL) {
-           errstr = newvstralloc(errstr,
-                       "[could not connect ", streams[i].name, " stream: ",
-                       security_geterror(sech), "]", NULL);
+           errstr = newvstrallocf(errstr,
+                       _("[could not connect %s stream: %s]"),
+                       streams[i].name, security_geterror(sech));
            goto connect_error;
        }
     }
@@ -778,9 +753,9 @@ bad_nak:
        if (streams[i].fd == NULL)
            continue;
        if (security_stream_auth(streams[i].fd) < 0) {
-           errstr = newvstralloc(errstr,
-               "[could not authenticate ", streams[i].name, " stream: ",
-               security_stream_geterror(streams[i].fd), "]", NULL);
+           errstr = newvstrallocf(errstr,
+               _("[could not authenticate %s stream: %s]"),
+               streams[i].name, security_stream_geterror(streams[i].fd));
            goto connect_error;
        }
     }
@@ -790,7 +765,7 @@ bad_nak:
      * them, complain.
      */
     if (streams[MESGFD].fd == NULL) {
-        errstr = newstralloc(errstr, "[couldn't open MESG streams]");
+        errstr = newvstrallocf(errstr, _("[couldn't open MESG streams]"));
         goto connect_error;
     }
 
@@ -800,11 +775,9 @@ bad_nak:
     return;
 
 parse_error:
-    errstr = newvstralloc(errstr,
-                         "[parse of reply message failed: ",
-                         extra ? extra : "(no additional information)",
-                         "]",
-                         NULL);
+    errstr = newvstrallocf(errstr,
+                         _("[parse of reply message failed: %s]"),
+                         extra ? extra : _("(no additional information)"));
     amfree(extra);
     *response_error = 2;
     return;
index 5accbb78b8965827a3c9b4d13e618aa42b3ced01..a1652e6f6e83beb54e93c9164ab0f910e6c3bfe5 100644 (file)
@@ -88,6 +88,7 @@ extern void cd_glob(char *dir);
 extern void cd_regex(char *dir);
 extern void cd_dir(char *dir, char *default_dir);
 extern void set_tape(char *tape);
+extern void set_device(char *host, char *device);
 extern void show_directory(void);
 extern void set_mode(int mode);
 extern void show_mode(void);
index 826c4ce3a5b8304336d16370f1ec931f9ce2443d..92a9e7d20dcf023998a49abb24efdebb23baf5a4 100644 (file)
@@ -99,9 +99,8 @@ add_dir_list_item(
 {
     DIR_ITEM *next;
 
-    dbprintf(("add_dir_list_item: Adding \"%s\" \"%d\" \"%s\" \""
-             OFF_T_FMT "\" \"%s\"\n",
-             date, level, tape, (OFF_T_FMT_TYPE)fileno, path));
+    dbprintf(_("add_dir_list_item: Adding \"%s\" \"%d\" \"%s\" \"%lld\" \"%s\"\n"),
+             date, level, tape, (long long)fileno, path);
 
     next = (DIR_ITEM *)alloc(sizeof(DIR_ITEM));
     memset(next, 0, sizeof(DIR_ITEM));
@@ -146,7 +145,7 @@ suck_dir_list_from_server(void)
     char *qdisk_path;
 
     if (disk_path == NULL) {
-       printf("Directory must be set before getting listing\n");
+       g_printf(_("Directory must be set before getting listing\n"));
        return;
     } else if(strcmp(disk_path, "/") == 0) {
        disk_path_slash = stralloc(disk_path);
@@ -174,7 +173,7 @@ suck_dir_list_from_server(void)
     {
        amfree(disk_path_slash);
        l = reply_line();
-       printf("%s\n", l);
+       g_printf("%s\n", l);
        return;
     }
     disk_path_slash_dot = stralloc2(disk_path_slash, ".");
@@ -200,18 +199,18 @@ suck_dir_list_from_server(void)
        l = reply_line();
        if (!server_happy())
        {
-           printf("%s\n", l);
+           g_printf("%s\n", l);
            continue;
        }
        s = l;
        if (strncmp_const_skip(l, "201-", s, ch) != 0) {
-           err = "bad reply: not 201-";
+           err = _("bad reply: not 201-");
            continue;
        }
        ch = *s++;
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing date field";
+           err = _("bad reply: missing date field");
            continue;
        }
        date = s - 1;
@@ -220,14 +219,14 @@ suck_dir_list_from_server(void)
 
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           err = "bad reply: cannot parse level field";
+           err = _("bad reply: cannot parse level field");
            continue;
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing tape field";
+           err = _("bad reply: missing tape field");
            continue;
        }
        tape = s - 1;
@@ -237,10 +236,10 @@ suck_dir_list_from_server(void)
        *tape_undo = '\0';
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
-           OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+           long long fileno_ = (long long)0;
            skip_whitespace(s, ch);
-           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-               err = "bad reply: cannot parse fileno field";
+           if(ch == '\0' || sscanf(s - 1, "%lld", &fileno_) != 1) {
+               err = _("bad reply: cannot parse fileno field");
                continue;
            }
            fileno = (off_t)fileno_;
@@ -252,7 +251,7 @@ suck_dir_list_from_server(void)
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           err = "bad reply: missing directory field";
+           err = _("bad reply: missing directory field");
            continue;
        }
        qdir = s - 1;
@@ -293,7 +292,7 @@ list_directory(void)
     char *quoted;
 
     if (disk_path == NULL) {
-       printf("Must select a disk before listing files; use the setdisk command.\n");
+       g_printf(_("Must select a disk before listing files; use the setdisk command.\n"));
        return;
     }
 
@@ -308,7 +307,7 @@ list_directory(void)
     pager_command = stralloc2(pager, " ; /bin/cat > /dev/null");
     if ((fp = popen(pager_command, "w")) == NULL)
     {
-       printf("Warning - can't pipe through %s\n", pager);
+       g_printf(_("Warning - can't pipe through %s\n"), pager);
        fp = stdout;
     }
     amfree(pager_command);
@@ -317,7 +316,7 @@ list_directory(void)
        i++;                            /* so disk_path != "/" */
     for (item = get_dir_list(); item != NULL; item=get_next_dir_item(item)) {
        quoted = quote_string(item->path + i);
-       fprintf(fp, "%s %s\n", item->date, quoted);
+       g_fprintf(fp, "%s %s\n", item->date, quoted);
        amfree(quoted);
     }
     apclose(fp);
index e46eb763d1d1160cbd47f439051b7cbdee2722e6..afb6278a58e9cfa7badda94f21b3615512e11742 100644 (file)
@@ -188,7 +188,7 @@ read_buffer(
         nfound = select(datafd+1, &readset, NULL, NULL, &timeout);
         if(nfound < 0 ) {
             /* Select returned an error. */
-           fprintf(stderr,"select error: %s\n", strerror(errno));
+           g_fprintf(stderr,_("select error: %s\n"), strerror(errno));
             size = -1;
            break;
         }
@@ -197,8 +197,8 @@ read_buffer(
             /* Select timed out. */
             if (timeout_s != 0)  {
                 /* Not polling: a real read timeout */
-                fprintf(stderr,"timeout waiting for restore\n");
-                fprintf(stderr,"increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n");
+                g_fprintf(stderr,_("timeout waiting for restore\n"));
+                g_fprintf(stderr,_("increase READ_TIMEOUT in recover-src/extract_list.c if your tape is slow\n"));
             }
             errno = ETIMEDOUT;
             size = -1;
@@ -215,7 +215,7 @@ read_buffer(
                continue;
            }
            if (errno != EPIPE) {
-               fprintf(stderr, "read_buffer: read error - %s",
+               g_fprintf(stderr, _("read_buffer: read error - %s"),
                    strerror(errno));
                break;
            }
@@ -364,8 +364,8 @@ clean_tape_list(
            }
 
            if (remove_fn2) {
-               dbprintf(("removing path %s, it is included in %s\n",
-                         fn2->path, fn1->path));
+               dbprintf(_("removing path %s, it is included in %s\n"),
+                         fn2->path, fn1->path);
                ofn2 = fn2;
                fn2 = fn2->next;
                amfree(ofn2->path);
@@ -379,8 +379,8 @@ clean_tape_list(
 
        if(remove_fn1 != 0) {
            /* fn2->path is always valid */
-           /*@i@*/ dbprintf(("removing path %s, it is included in %s\n",
-           /*@i@*/           fn1->path, fn2->path));
+           /*@i@*/ dbprintf(_("removing path %s, it is included in %s\n"),
+           /*@i@*/           fn1->path, fn2->path);
            ofn1 = fn1;
            fn1 = fn1->next;
            amfree(ofn1->path);
@@ -450,7 +450,7 @@ do_unlink_list(void)
 
     for (ul = unlink_list; ul != NULL; ul = ul->next) {
        if (unlink(ul->path) < 0) {
-           fprintf(stderr,"Can't unlink %s: %s\n", ul->path, strerror(errno));
+           g_fprintf(stderr,_("Can't unlink %s: %s\n"), ul->path, strerror(errno));
            ret = 0;
        }
     }
@@ -500,14 +500,14 @@ check_file_overwrite(
                if (lstat(path, &stat_buf) == 0) {
                    if(!S_ISDIR(stat_buf.st_mode)) {
                        if (add_to_unlink_list(path)) {
-                           printf("WARNING: %s is not a directory, "
-                                  "it will be deleted.\n",
+                           g_printf(_("WARNING: %s is not a directory, "
+                                  "it will be deleted.\n"),
                                   path);
                        }
                    }
                }
                else if (errno != ENOENT) {
-                   printf("Can't stat %s: %s\n", path, strerror(errno));
+                   g_printf(_("Can't stat %s: %s\n"), path, strerror(errno));
                }
                *s = '/';
                s++;
@@ -524,20 +524,20 @@ check_file_overwrite(
            if (lstat(filename, &stat_buf) == 0) {
                if(S_ISDIR(stat_buf.st_mode)) {
                    if(!is_empty_dir(filename)) {
-                       printf("WARNING: All existing files in %s "
-                              "will be deleted.\n", filename);
+                       g_printf(_("WARNING: All existing files in %s "
+                              "will be deleted.\n"), filename);
                    }
                } else if(S_ISREG(stat_buf.st_mode)) {
-                   printf("WARNING: Existing file %s will be overwritten\n",
+                   g_printf(_("WARNING: Existing file %s will be overwritten\n"),
                           filename);
                } else {
                    if (add_to_unlink_list(filename)) {
-                       printf("WARNING: Existing entry %s will be deleted\n",
+                       g_printf(_("WARNING: Existing entry %s will be deleted\n"),
                               filename);
                    }
                }
            } else if (errno != ENOENT) {
-               printf("Can't stat %s: %s\n", filename, strerror(errno));
+               g_printf(_("Can't stat %s: %s\n"), filename, strerror(errno));
            }
            amfree(filename);
        }
@@ -691,9 +691,9 @@ add_glob(
     char *uqglob = unquote_string(glob);
  
     regex = glob_to_regex(uqglob);
-    dbprintf(("add_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("add_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("%s is not a valid shell wildcard pattern: ", glob);
+       g_printf(_("%s is not a valid shell wildcard pattern: "), glob);
        puts(s);
     } else {
         /*
@@ -721,7 +721,7 @@ add_regex(
     char *uqregex = unquote_string(regex);
  
     if ((s = validate_regexp(uqregex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", regex);
+       g_printf(_("\"%s\" is not a valid regular expression: "), regex);
        puts(s);
     } else {
         add_file(uqregex, regex);
@@ -751,12 +751,12 @@ add_file(
     int dir_entries;
 
     if (disk_path == NULL) {
-       printf("Must select directory before adding files\n");
+       g_printf(_("Must select directory before adding files\n"));
        return;
     }
     memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */
 
-    dbprintf(("add_file: Looking for \"%s\"\n", regex));
+    dbprintf(_("add_file: Looking for \"%s\"\n"), regex);
 
     if(strcmp(regex, "/[/]*$") == 0) { /* "/" behave like "." */
        regex = "\\.[/]*$";
@@ -785,8 +785,8 @@ add_file(
        amfree(clean_disk_path);
     }
 
-    dbprintf(("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
-             regex, path_on_disk));
+    dbprintf(_("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"),
+             regex, path_on_disk);
 
     found_one = 0;
     dir_entries = 0;
@@ -794,7 +794,7 @@ add_file(
     {
        dir_entries++;
        quoted = quote_string(ditem->path);
-       dbprintf(("add_file: Pondering ditem->path=%s\n", quoted));
+       dbprintf(_("add_file: Pondering ditem->path=%s\n"), quoted);
        amfree(quoted);
        if (match(path_on_disk, ditem->path))
        {
@@ -807,7 +807,7 @@ add_file(
                clean_pathname(ditem_path);
 
                qditem_path = quote_string(ditem_path);
-               cmd = stralloc2("ORLD ", qditem_path);
+               cmd = newstralloc2(cmd, "ORLD ", qditem_path);
                amfree(qditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
@@ -827,7 +827,7 @@ add_file(
                    amfree(ditem_path);
                    amfree(path_on_disk);
                    l = reply_line();
-                   printf("%s\n", l);
+                   g_printf("%s\n", l);
                    return;
                }
                dir_undo = NULL;
@@ -857,14 +857,14 @@ add_file(
 
                    s = l;
                    if(strncmp_const_skip(l, "201-", s, ch) != 0) {
-                       err = "bad reply: not 201-";
+                       err = _("bad reply: not 201-");
                        continue;
                    }
                    ch = *s++;
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing date field";
+                       err = _("bad reply: missing date field");
                        continue;
                    }
                     fp = s-1;
@@ -875,14 +875,14 @@ add_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0' || sscanf(s - 1, "%d", &lditem.level) != 1) {
-                       err = "bad reply: cannot parse level field";
+                       err = _("bad reply: cannot parse level field");
                        continue;
                    }
                    skip_integer(s, ch);
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing tape field";
+                       err = _("bad reply: missing tape field");
                        continue;
                    }
                     fp = s-1;
@@ -892,11 +892,11 @@ add_file(
                     s[-1] = (char)ch;
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
-                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+                       long long fileno_ = (long long)0;
                        skip_whitespace(s, ch);
                        if(ch == '\0' ||
-                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-                           err = "bad reply: cannot parse fileno field";
+                          sscanf(s - 1, "%lld", &fileno_) != 1) {
+                           err = _("bad reply: cannot parse fileno field");
                            continue;
                        }
                        lditem.fileno = (off_t)fileno_;
@@ -905,7 +905,7 @@ add_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing directory field";
+                       err = _("bad reply: missing directory field");
                        continue;
                    }
                    dir = s - 1;
@@ -916,16 +916,16 @@ add_file(
 
                    switch(add_extract_item(&lditem)) {
                    case -1:
-                       printf("System error\n");
-                       dbprintf(("add_file: (Failed) System error\n"));
+                       g_printf(_("System error\n"));
+                       dbprintf(_("add_file: (Failed) System error\n"));
                        break;
 
                    case  0:
                        quoted = quote_string(lditem.path);
-                       printf("Added dir %s at date %s\n",
+                       g_printf(_("Added dir %s at date %s\n"),
                               quoted, lditem.date);
-                       dbprintf(("add_file: (Successful) Added dir %s at date %s\n",
-                                 quoted, lditem.date));
+                       dbprintf(_("add_file: (Successful) Added dir %s at date %s\n"),
+                                 quoted, lditem.date);
                        amfree(quoted);
                        added=1;
                        break;
@@ -943,8 +943,8 @@ add_file(
                        puts(cmd);
                } else if(added == 0) {
                    quoted = quote_string(ditem_path);
-                   printf("dir %s already added\n", quoted);
-                   dbprintf(("add_file: dir %s already added\n", quoted));
+                   g_printf(_("dir %s already added\n"), quoted);
+                   dbprintf(_("add_file: dir %s already added\n"), quoted);
                    amfree(quoted);
                }
            }
@@ -952,21 +952,21 @@ add_file(
            {
                switch(add_extract_item(ditem)) {
                case -1:
-                   printf("System error\n");
-                   dbprintf(("add_file: (Failed) System error\n"));
+                   g_printf(_("System error\n"));
+                   dbprintf(_("add_file: (Failed) System error\n"));
                    break;
 
                case  0:
                    quoted = quote_string(ditem->path);
-                   printf("Added file %s\n", quoted);
-                   dbprintf(("add_file: (Successful) Added %s\n", quoted));
+                   g_printf(_("Added file %s\n"), quoted);
+                   dbprintf(_("add_file: (Successful) Added %s\n"), quoted);
                    amfree(quoted);
                    break;
 
                case  1:
                    quoted = quote_string(ditem->path);
-                   printf("File %s already added\n", quoted);
-                   dbprintf(("add_file: file %s already added\n", quoted));
+                   g_printf(_("File %s already added\n"), quoted);
+                   dbprintf(_("add_file: file %s already added\n"), quoted);
                    amfree(quoted);
                }
            }
@@ -983,9 +983,9 @@ add_file(
 
     if(! found_one) {
        quoted = quote_string(path);
-       printf("File %s doesn't exist in directory\n", quoted);
-       dbprintf(("add_file: (Failed) File %s doesn't exist in directory\n",
-                 quoted));
+       g_printf(_("File %s doesn't exist in directory\n"), quoted);
+       dbprintf(_("add_file: (Failed) File %s doesn't exist in directory\n"),
+                 quoted);
        amfree(quoted);
     }
 }
@@ -1001,9 +1001,9 @@ delete_glob(
     char *uqglob = unquote_string(glob);
  
     regex = glob_to_regex(uqglob);
-    dbprintf(("delete_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("delete_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
+       g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob);
        puts(s);
     } else {
         /*
@@ -1031,7 +1031,7 @@ delete_regex(
     char *uqregex = unquote_string(regex);
 
     if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", regex);
+       g_printf(_("\"%s\" is not a valid regular expression: "), regex);
        puts(s);
     } else {
        delete_file(uqregex, uqregex);
@@ -1065,12 +1065,12 @@ delete_file(
     char *quoted;
 
     if (disk_path == NULL) {
-       printf("Must select directory before deleting files\n");
+       g_printf(_("Must select directory before deleting files\n"));
        return;
     }
     memset(&lditem, 0, sizeof(lditem)); /* Prevent use of bogus data... */
 
-    dbprintf(("delete_file: Looking for \"%s\"\n", path));
+    dbprintf(_("delete_file: Looking for \"%s\"\n"), path);
 
     if (strcmp(regex, "[^/]*[/]*$") == 0) {
        /* Looking for * find everything but single . */
@@ -1101,13 +1101,13 @@ delete_file(
        amfree(clean_disk_path);
     }
 
-    dbprintf(("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
-             regex, path_on_disk));
+    dbprintf(_("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n"),
+             regex, path_on_disk);
     found_one = 0;
     for (ditem=get_dir_list(); ditem!=NULL; ditem=get_next_dir_item(ditem))
     {
        quoted = quote_string(ditem->path);
-       dbprintf(("delete_file: Pondering ditem->path=%s\n", quoted));
+       dbprintf(_("delete_file: Pondering ditem->path=%s\n"), quoted);
        amfree(quoted);
        if (match(path_on_disk, ditem->path))
        {
@@ -1120,7 +1120,7 @@ delete_file(
                clean_pathname(ditem_path);
 
                qditem_path = quote_string(ditem_path);
-               cmd = stralloc2("ORLD ", qditem_path);
+               cmd = newstralloc2(cmd, "ORLD ", qditem_path);
                amfree(qditem_path);
                if(send_command(cmd) == -1) {
                    amfree(cmd);
@@ -1140,7 +1140,7 @@ delete_file(
                    amfree(ditem_path);
                    amfree(path_on_disk);
                    l = reply_line();
-                   printf("%s\n", l);
+                   g_printf("%s\n", l);
                    return;
                }
                deleted=0;
@@ -1172,14 +1172,14 @@ delete_file(
 
                    s = l;
                    if(strncmp_const_skip(l, "201-", s, ch) != 0) {
-                       err = "bad reply: not 201-";
+                       err = _("bad reply: not 201-");
                        continue;
                    }
                    ch = *s++;
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing date field";
+                       err = _("bad reply: missing date field");
                        continue;
                    }
                    date = s - 1;
@@ -1188,14 +1188,14 @@ delete_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-                       err = "bad reply: cannot parse level field";
+                       err = _("bad reply: cannot parse level field");
                        continue;
                    }
                    skip_integer(s, ch);
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing tape field";
+                       err = _("bad reply: missing tape field");
                        continue;
                    }
                    tape = s - 1;
@@ -1205,11 +1205,11 @@ delete_file(
                    *tape_undo = '\0';
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
-                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
+                       long long fileno_ = (long long)0;
                        skip_whitespace(s, ch);
                        if(ch == '\0' ||
-                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
-                           err = "bad reply: cannot parse fileno field";
+                          sscanf(s - 1, "%lld", &fileno_) != 1) {
+                           err = _("bad reply: cannot parse fileno field");
                            continue;
                        }
                        fileno = (off_t)fileno_;
@@ -1218,7 +1218,7 @@ delete_file(
 
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
-                       err = "bad reply: missing directory field";
+                       err = _("bad reply: missing directory field");
                        continue;
                    }
                    skip_non_whitespace(s, ch);
@@ -1231,13 +1231,13 @@ delete_file(
                     lditem.tape = newstralloc(lditem.tape, tape);
                    switch(delete_extract_item(&lditem)) {
                    case -1:
-                       printf("System error\n");
-                       dbprintf(("delete_file: (Failed) System error\n"));
+                       g_printf(_("System error\n"));
+                       dbprintf(_("delete_file: (Failed) System error\n"));
                        break;
                    case  0:
-                       printf("Deleted dir %s at date %s\n", ditem_path, date);
-                       dbprintf(("delete_file: (Successful) Deleted dir %s at date %s\n",
-                                 ditem_path, date));
+                       g_printf(_("Deleted dir %s at date %s\n"), ditem_path, date);
+                       dbprintf(_("delete_file: (Successful) Deleted dir %s at date %s\n"),
+                                 ditem_path, date);
                        deleted=1;
                        break;
                    case  1:
@@ -1252,29 +1252,29 @@ delete_file(
                    if (cmd)
                        puts(cmd);
                } else if(deleted == 0) {
-                   printf("Warning - dir '%s' not on tape list\n",
+                   g_printf(_("Warning - dir '%s' not on tape list\n"),
                           ditem_path);
-                   dbprintf(("delete_file: dir '%s' not on tape list\n",
-                             ditem_path));
+                   dbprintf(_("delete_file: dir '%s' not on tape list\n"),
+                             ditem_path);
                }
            }
            else
            {
                switch(delete_extract_item(ditem)) {
                case -1:
-                   printf("System error\n");
-                   dbprintf(("delete_file: (Failed) System error\n"));
+                   g_printf(_("System error\n"));
+                   dbprintf(_("delete_file: (Failed) System error\n"));
                    break;
                case  0:
-                   printf("Deleted %s\n", ditem->path);
-                   dbprintf(("delete_file: (Successful) Deleted %s\n",
-                             ditem->path));
+                   g_printf(_("Deleted %s\n"), ditem->path);
+                   dbprintf(_("delete_file: (Successful) Deleted %s\n"),
+                             ditem->path);
                    break;
                case  1:
-                   printf("Warning - file '%s' not on tape list\n",
+                   g_printf(_("Warning - file '%s' not on tape list\n"),
                           ditem->path);
-                   dbprintf(("delete_file: file '%s' not on tape list\n",
-                             ditem->path));
+                   dbprintf(_("delete_file: file '%s' not on tape list\n"),
+                             ditem->path);
                    break;
                }
            }
@@ -1285,9 +1285,9 @@ delete_file(
     amfree(path_on_disk);
 
     if(! found_one) {
-       printf("File %s doesn't exist in directory\n", path);
-       dbprintf(("delete_file: (Failed) File %s doesn't exist in directory\n",
-                 path));
+       g_printf(_("File %s doesn't exist in directory\n"), path);
+       dbprintf(_("delete_file: (Failed) File %s doesn't exist in directory\n"),
+                 path);
     }
 }
 
@@ -1317,7 +1317,7 @@ display_extract_list(
        pager_command = stralloc2(pager, " ; /bin/cat > /dev/null");
        if ((fp = popen(pager_command, "w")) == NULL)
        {
-           printf("Warning - can't pipe through %s\n", pager);
+           g_printf(_("Warning - can't pipe through %s\n"), pager);
            fp = stdout;
        }
        amfree(pager_command);
@@ -1327,7 +1327,7 @@ display_extract_list(
        uqfile = unquote_string(file);
        if ((fp = fopen(uqfile, "w")) == NULL)
        {
-           printf("Can't open file %s to print extract list into\n", file);
+           g_printf(_("Can't open file %s to print extract list into\n"), file);
            amfree(uqfile);
            return;
        }
@@ -1336,16 +1336,16 @@ display_extract_list(
 
     for (this = extract_list; this != NULL; this = this->next)
     {
-       fprintf(fp, "TAPE %s LEVEL %d DATE %s\n",
+       g_fprintf(fp, _("TAPE %s LEVEL %d DATE %s\n"),
                this->tape, this->level, this->date);
        for (that = this->files; that != NULL; that = that->next)
-           fprintf(fp, "\t%s\n", that->path);
+           g_fprintf(fp, "\t%s\n", that->path);
     }
 
     if (file == NULL) {
        apclose(fp);
     } else {
-       printf("Extract list written to file %s\n", file);
+       g_printf(_("Extract list written to file %s\n"), file);
        afclose(fp);
     }
 }
@@ -1393,20 +1393,20 @@ okay_to_continue(
     char *line = NULL;
     char *s;
     char *prompt;
-    int get_tape;
+    int get_device;
 
-    get_tape = 0;
+    get_device = 0;
     while (ret < 0) {
-       if (get_tape) {
-           prompt = "New tape device [?]: ";
+       if (get_device) {
+           prompt = _("New device name [?]: ");
        } else if (allow_tape && allow_skip) {
-           prompt = "Continue [?/Y/n/s/t]? ";
+           prompt = _("Continue [?/Y/n/s/d]? ");
        } else if (allow_tape && !allow_skip) {
-           prompt = "Continue [?/Y/n/t]? ";
+           prompt = _("Continue [?/Y/n/d]? ");
        } else if (allow_retry) {
-           prompt = "Continue [?/Y/n/r]? ";
+           prompt = _("Continue [?/Y/n/r]? ");
        } else {
-           prompt = "Continue [?/Y/n]? ";
+           prompt = _("Continue [?/Y/n]? ");
        }
        fputs(prompt, stdout);
        fflush(stdout); fflush(stderr);
@@ -1414,40 +1414,53 @@ okay_to_continue(
        if ((line = agets(stdin)) == NULL) {
            putchar('\n');
            clearerr(stdin);
-           if (get_tape) {
-               get_tape = 0;
+           if (get_device) {
+               get_device = 0;
                continue;
            }
            ret = 0;
            break;
        }
+       dbprintf("User prompt: '%s'; response: '%s'\n", prompt, line);
+
        s = line;
        while ((ch = *s++) != '\0' && isspace(ch)) {
            (void)ch;   /* Quiet empty loop compiler warning */
        }
        if (ch == '?') {
-           if (get_tape) {
-               printf("Enter a new device ([host:]device) or \"default\"\n");
+           if (get_device) {
+               g_printf(_("Enter a new device name or \"default\"\n"));
            } else {
-               printf("Enter \"y\"es to continue, \"n\"o to stop");
+               g_printf(_("Enter \"y\"es to continue, \"n\"o to stop"));
                if(allow_skip) {
-                   printf(", \"s\"kip this tape");
+                   g_printf(_(", \"s\"kip this tape"));
                }
                if(allow_retry) {
-                   printf(" or \"r\"etry this tape");
+                   g_printf(_(" or \"r\"etry this tape"));
                }
                if (allow_tape) {
-                   printf(" or \"t\"ape to change tape drives");
+                   g_printf(_(" or \"d\" to change to a new device"));
                }
                putchar('\n');
            }
-       } else if (get_tape) {
-           set_tape(s - 1);
-           get_tape = 0;
+       } else if (get_device) {
+           char *tmp = stralloc(tape_server_name);
+
+           if (strncmp_const(s - 1, "default") == 0) {
+               set_device(tmp, NULL); /* default device, existing host */
+           } else if (s[-1] != '\0') {
+               set_device(tmp, s - 1); /* specified device, existing host */
+           } else {
+               g_printf(_("No change.\n"));
+           }
+
+           amfree(tmp);
+
+           get_device = 0;
        } else if (ch == '\0' || ch == 'Y' || ch == 'y') {
            ret = 1;
-       } else if (allow_tape && (ch == 'T' || ch == 't')) {
-           get_tape = 1;
+       } else if (allow_tape && (ch == 'D' || ch == 'd' || ch == 'T' || ch == 't')) {
+           get_device = 1; /* ('T' and 't' are for backward-compatibility) */
        } else if (ch == 'N' || ch == 'n') {
            ret = 0;
        } else if (allow_retry && (ch == 'R' || ch == 'r')) {
@@ -1471,7 +1484,7 @@ send_to_tape_server(
 
     if (security_stream_write(stream, msg, strlen(msg)) < 0)
     {
-       error("Error writing to tape server");
+       error(_("Error writing to tape server"));
        exit(101);
        /*NOTREACHED*/
     }
@@ -1496,7 +1509,7 @@ extract_files_setup(
 
     amidxtaped_secdrv = security_getdriver(authopt);
     if (amidxtaped_secdrv == NULL) {
-       error("no '%s' security driver available for host '%s'",
+       error(_("no '%s' security driver available for host '%s'"),
              authopt, tape_server_name);
     }
 
@@ -1582,7 +1595,7 @@ extract_files_setup(
        if(strncmp_const(amidxtaped_line,"FEATURES=") == 0) {
            tapesrv_features = am_string_to_feature(amidxtaped_line+9);
        } else {
-           fprintf(stderr, "amrecover - expecting FEATURES line from amidxtaped\n");
+           g_fprintf(stderr, _("amrecover - expecting FEATURES line from amidxtaped\n"));
            stop_amidxtaped();
            amfree(disk_regex);
            amfree(host_regex);
@@ -1600,7 +1613,7 @@ extract_files_setup(
        am_has_feature(indexsrv_features, fe_amidxtaped_datestamp)) {
 
        if(am_has_feature(indexsrv_features, fe_amidxtaped_config)) {
-           tt = newstralloc2(tt, "CONFIG=", config);
+           tt = newstralloc2(tt, "CONFIG=", config_name);
            send_to_tape_server(amidxtaped_streams[CTLFD].fd, tt);
        }
        if(am_has_feature(indexsrv_features, fe_amidxtaped_label) &&
@@ -1610,7 +1623,7 @@ extract_files_setup(
        }
        if(am_has_feature(indexsrv_features, fe_amidxtaped_fsf)) {
            char v_fsf[100];
-           snprintf(v_fsf, 99, OFF_T_FMT, (OFF_T_FMT_TYPE)fsf);
+           g_snprintf(v_fsf, 99, "%lld", (long long)fsf);
            tt = newstralloc2(tt, "FSF=",v_fsf);
            send_to_tape_server(amidxtaped_streams[CTLFD].fd, tt);
        }
@@ -1644,8 +1657,8 @@ extract_files_setup(
        send_to_tape_server(amidxtaped_streams[CTLFD].fd, disk_regex);
        send_to_tape_server(amidxtaped_streams[CTLFD].fd, clean_datestamp);
 
-       dbprintf(("Started amidxtaped with arguments \"6 -h -p %s %s %s %s\"\n",
-                 dump_device_name, host_regex, disk_regex, clean_datestamp));
+       dbprintf(_("Started amidxtaped with arguments \"6 -h -p %s %s %s %s\"\n"),
+                 dump_device_name, host_regex, disk_regex, clean_datestamp);
     }
 
     amfree(disk_regex);
@@ -1670,16 +1683,17 @@ read_file_header(
     ssize_t bytes_read;
     bytes_read = read_buffer(tapedev, buffer, buflen, READ_TIMEOUT);
     if(bytes_read < 0) {
-       error("error reading header (%s), check amidxtaped.*.debug on server",
+       error(_("error reading header (%s), check amidxtaped.*.debug on server"),
              strerror(errno));
        /*NOTREACHED*/
     }
 
     if((size_t)bytes_read < buflen) {
-       fprintf(stderr, "%s: short block %d byte%s\n",
-               get_pname(), (int)bytes_read, (bytes_read == 1) ? "" : "s");
+       g_fprintf(stderr, plural(_("%s: short block %d byte\n"),
+                              _("%s: short block %d bytes\n"), bytes_read),
+               get_pname(), (int)bytes_read);
        print_header(stdout, file);
-       error("Can't read file header");
+       error(_("Can't read file header"));
        /*NOTREACHED*/
     }
 
@@ -1724,7 +1738,7 @@ extract_files_child(
     /* make in_fd be our stdin */
     if (dup2(in_fd, STDIN_FILENO) == -1)
     {
-       error("dup2 failed in extract_files_child: %s", strerror(errno));
+       error(_("dup2 failed in extract_files_child: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -1734,7 +1748,7 @@ extract_files_child(
 
     if(file.type != F_DUMPFILE) {
        print_header(stdout, &file);
-       error("bad header");
+       error(_("bad header"));
        /*NOTREACHED*/
     }
 
@@ -1862,7 +1876,7 @@ extract_files_child(
        restore_args[j++] = stralloc(file.dumper);
        restore_args[j++] = stralloc("restore");
        restore_args[j++] = stralloc("--config");
-       restore_args[j++] = stralloc(config);
+       restore_args[j++] = stralloc(config_name);
        restore_args[j++] = stralloc("--disk");
        restore_args[j++] = stralloc(file.disk);
        break;
@@ -1919,7 +1933,7 @@ extract_files_child(
     case IS_GNUTAR:
     case IS_SAMBA_TAR:
 #ifndef GNUTAR
-       fprintf(stderr, "warning: GNUTAR program not available.\n");
+       g_fprintf(stderr, _("warning: GNUTAR program not available.\n"));
        cmd = stralloc("tar");
 #else
        cmd = stralloc(GNUTAR);
@@ -1949,7 +1963,7 @@ extract_files_child(
        }
 #endif
        if (cmd == NULL) {
-           fprintf(stderr, "warning: restore program for %s not available.\n",
+           g_fprintf(stderr, _("warning: restore program for %s not available.\n"),
                    file.program);
            cmd = stralloc("restore");
        }
@@ -1959,13 +1973,14 @@ extract_files_child(
        break;
     }
     if (cmd) {
-        dbprintf(("Exec'ing %s with arguments:\n", cmd));
+        dbprintf(_("Exec'ing %s with arguments:\n"), cmd);
        for (i = 0; i < j; i++) {
            if( i == passwd_field)
-               dbprintf(("\tXXXXX\n"));
+               dbprintf("\tXXXXX\n");
            else
-               dbprintf(("\t%s\n", restore_args[i]));
+               dbprintf(_("\t%s\n"), restore_args[i]);
        }
+       safe_fd(-1, 0);
         (void)execv(cmd, restore_args);
        /* only get here if exec failed */
        save_errno = errno;
@@ -1974,8 +1989,8 @@ extract_files_child(
        }
        amfree(restore_args);
        errno = save_errno;
-        perror("amrecover couldn't exec");
-        fprintf(stderr, " problem executing %s\n", cmd);
+        perror(_("amrecover couldn't exec"));
+        g_fprintf(stderr, _(" problem executing %s\n"), cmd);
        amfree(cmd);
     }
     exit(1);
@@ -1996,7 +2011,7 @@ writer_intermediary(
     amwait_t extractor_status;
 
     if(pipe(child_pipe) == -1) {
-       error("extract_list - error setting up pipe to extractor: %s\n",
+       error(_("extract_list - error setting up pipe to extractor: %s\n"),
              strerror(errno));
        /*NOTREACHED*/
     }
@@ -2012,7 +2027,7 @@ writer_intermediary(
 
     /* This is the parent */
     if (pid == -1) {
-       printf("writer_intermediary - error forking child");
+       g_printf(_("writer_intermediary - error forking child"));
        return -1;
     }
 
@@ -2027,7 +2042,8 @@ writer_intermediary(
        /* if prompted for a tape, relay said prompt to the user */
        if(sscanf(amidxtaped_line, "FEEDME %132s\n", desired_tape) == 1) {
            int done;
-           printf("Load tape %s now\n", desired_tape);
+           g_printf(_("Load tape %s now\n"), desired_tape);
+           dbprintf(_("Requesting tape %s from user\n"), desired_tape);
            done = okay_to_continue(am_has_feature(indexsrv_features,
                                                   fe_amrecover_feedme_tape),
                                    0, 0);
@@ -2045,9 +2061,9 @@ writer_intermediary(
                break;
            }
        } else if(strncmp_const(amidxtaped_line, "MESSAGE ") == 0) {
-           printf("%s\n",&amidxtaped_line[8]);
+           g_printf("%s\n",&amidxtaped_line[8]);
        } else {
-           fprintf(stderr, "Strange message from tape server: %s",
+           g_fprintf(stderr, _("Strange message from tape server: %s"),
                    amidxtaped_line);
            break;
        }
@@ -2061,7 +2077,7 @@ writer_intermediary(
     if(WEXITSTATUS(extractor_status) != 0){
        int ret = WEXITSTATUS(extractor_status);
         if(ret == 255) ret = -1;
-       printf("Extractor child exited with status %d\n", ret);
+       g_printf(_("Extractor child exited with status %d\n"), ret);
        return -1;
     }
     return(0);
@@ -2090,7 +2106,7 @@ void
 extract_files(void)
 {
     EXTRACT_LIST *elist;
-    char cwd[STR_SIZE];
+    char * cwd;
     char *l;
     int first;
     int otc;
@@ -2098,7 +2114,7 @@ extract_files(void)
 
     if (!is_extract_list_nonempty())
     {
-       printf("Extract list empty - No files to extract!\n");
+       g_printf(_("Extract list empty - No files to extract!\n"));
        return;
     }
 
@@ -2116,7 +2132,7 @@ extract_files(void)
        l = reply_line();
        if (!server_happy())
        {
-           printf("%s\n", l);
+           g_printf("%s\n", l);
            exit(1);
        }
        /* skip reply number */
@@ -2125,7 +2141,7 @@ extract_files(void)
 
     if (strcmp(tape_device_name, "/dev/null") == 0)
     {
-       printf("amrecover: warning: using %s as the tape device will not work\n",
+       g_printf(_("amrecover: warning: using %s as the tape device will not work\n"),
               tape_device_name);
     }
 
@@ -2133,17 +2149,17 @@ extract_files(void)
     for (elist = first_tape_list(); elist != NULL; elist = next_tape_list(elist)) {
        if(elist->tape[0]!='/') {
            if(first) {
-               printf("\nExtracting files using tape drive %s on host %s.\n",
+               g_printf(_("\nExtracting files using tape drive %s on host %s.\n"),
                        tape_device_name, tape_server_name);
-               printf("The following tapes are needed:");
+               g_printf(_("The following tapes are needed:"));
                first=0;
            }
            else
-               printf("                               ");
+               g_printf("                               ");
            tlist = unmarshal_tapelist_str(elist->tape); 
            for(a_tlist = tlist ; a_tlist != NULL; a_tlist = a_tlist->next)
-               printf(" %s", a_tlist->label);
-           printf("\n");
+               g_printf(" %s", a_tlist->label);
+           g_printf("\n");
            free_tapelist(tlist);
        }
     }
@@ -2151,41 +2167,46 @@ extract_files(void)
     for (elist = first_tape_list(); elist != NULL; elist = next_tape_list(elist)) {
        if(elist->tape[0]=='/') {
            if(first) {
-               printf("\nExtracting files from holding disk on host %s.\n",
+               g_printf(_("\nExtracting files from holding disk on host %s.\n"),
                        tape_server_name);
-               printf("The following files are needed:");
+               g_printf(_("The following files are needed:"));
                first=0;
            }
            else
-               printf("                               ");
+               g_printf("                               ");
            tlist = unmarshal_tapelist_str(elist->tape); 
            for(a_tlist = tlist; a_tlist != NULL; a_tlist = a_tlist->next)
-               printf(" %s", a_tlist->label);
-           printf("\n");
+               g_printf(" %s", a_tlist->label);
+           g_printf("\n");
            free_tapelist(tlist);
        }
     }
-    printf("\n");
+    g_printf("\n");
 
-    if (getcwd(cwd, sizeof(cwd)) == NULL) {
-       perror("extract_list: Current working directory unavailable");
+    cwd = g_get_current_dir();
+    if (cwd == NULL) {
+       perror(_("extract_list: Current working directory unavailable"));
        exit(1);
     }
 
-    printf("Restoring files into directory %s\n", cwd);
+    g_printf(_("Restoring files into directory %s\n"), cwd);
     check_file_overwrite(cwd);
 
 #ifdef SAMBA_CLIENT
     if (samba_extract_method == SAMBA_SMBCLIENT)
-      printf("(unless it is a Samba backup, that will go through to the SMB server)\n");
+      g_printf(_("(unless it is a Samba backup, that will go through to the SMB server)\n"));
 #endif
-    if (!okay_to_continue(0,0,0))
+    dbprintf(_("Checking with user before restoring into directory %s\n"), cwd);
+    if (!okay_to_continue(0,0,0)) {
+        amfree(cwd);
        return;
-    printf("\n");
+    }
+    g_printf("\n");
 
     if (!do_unlink_list()) {
-       fprintf(stderr, "Can't recover because I can't cleanup the cwd (%s)\n",
+       g_fprintf(stderr, _("Can't recover because I can't cleanup the cwd (%s)\n"),
                cwd);
+        amfree(cwd);
        return;
     }
     free_unlink_list();
@@ -2194,18 +2215,19 @@ extract_files(void)
     {
        if(elist->tape[0]=='/') {
            dump_device_name = newstralloc(dump_device_name, elist->tape);
-           printf("Extracting from file ");
+           g_printf(_("Extracting from file "));
            tlist = unmarshal_tapelist_str(dump_device_name); 
            for(a_tlist = tlist; a_tlist != NULL; a_tlist = a_tlist->next)
-               printf(" %s", a_tlist->label);
-           printf("\n");
+               g_printf(" %s", a_tlist->label);
+           g_printf("\n");
            free_tapelist(tlist);
        }
        else {
-           printf("Extracting files using tape drive %s on host %s.\n",
+           g_printf(_("Extracting files using tape drive %s on host %s.\n"),
                   tape_device_name, tape_server_name);
            tlist = unmarshal_tapelist_str(elist->tape); 
-           printf("Load tape %s now\n", tlist->label);
+           g_printf(_("Load tape %s now\n"), tlist->label);
+           dbprintf(_("Requesting tape %s from user\n"), tlist->label);
            free_tapelist(tlist);
            otc = okay_to_continue(1,1,0);
            if (otc == 0)
@@ -2221,7 +2243,8 @@ extract_files(void)
        /* connect to the tape handler daemon on the tape drive server */
        if ((extract_files_setup(elist->tape, elist->fileno)) == -1)
        {
-           fprintf(stderr, "amrecover - can't talk to tape server: %s\n",errstr);
+           g_fprintf(stderr, _("amrecover - can't talk to tape server: %s\n"),
+                   errstr);
            return;
        }
 
@@ -2253,8 +2276,7 @@ amidxtaped_response(
     memset(ports, -1, SIZEOF(ports));
 
     if (pkt == NULL) {
-       errstr = newvstralloc(errstr, "[request failed: ",
-                            security_geterror(sech), "]", NULL);
+       errstr = newvstrallocf(errstr, _("[request failed: %s]"), security_geterror(sech));
        *response_error = 1;
        return;
     }
@@ -2262,7 +2284,7 @@ amidxtaped_response(
 
     if (pkt->type == P_NAK) {
 #if defined(PACKET_DEBUG)
-       fprintf(stderr, "got nak response:\n----\n%s\n----\n\n", pkt->body);
+       g_fprintf(stderr, _("got nak response:\n----\n%s\n----\n\n"), pkt->body);
 #endif
 
        tok = strtok(pkt->body, " ");
@@ -2282,14 +2304,14 @@ bad_nak:
     }
 
     if (pkt->type != P_REP) {
-       errstr = newvstralloc(errstr, "received strange packet type ",
-                             pkt_type2str(pkt->type), ": ", pkt->body, NULL);
+       errstr = newvstrallocf(errstr, _("received strange packet type %s: %s"),
+                             pkt_type2str(pkt->type), pkt->body);
        *response_error = 1;
        return;
     }
 
 #if defined(PACKET_DEBUG)
-    fprintf(stderr, "got response:\n----\n%s\n----\n\n", pkt->body);
+    g_fprintf(stderr, _("got response:\n----\n%s\n----\n\n"), pkt->body);
 #endif
 
     for(i = 0; i < NSTREAMS; i++) {
@@ -2308,7 +2330,7 @@ bad_nak:
        if (strcmp(tok, "ERROR") == 0) {
            tok = strtok(NULL, "\n");
            if (tok == NULL)
-               tok = "[bogus error packet]";
+               tok = _("[bogus error packet]");
            errstr = newstralloc(errstr, tok);
            *response_error = 2;
            return;
@@ -2326,22 +2348,16 @@ bad_nak:
            for (i = 0; i < NSTREAMS; i++) {
                tok = strtok(NULL, " ");
                if (tok == NULL || strcmp(tok, amidxtaped_streams[i].name) != 0) {
-                   extra = vstralloc("CONNECT token is \"",
+                   extra = vstrallocf(_("CONNECT token is \"%s\": expected \"%s\""),
                                      tok ? tok : "(null)",
-                                     "\": expected \"",
-                                     amidxtaped_streams[i].name,
-                                     "\"",
-                                     NULL);
+                                     amidxtaped_streams[i].name);
                    goto parse_error;
                }
                tok = strtok(NULL, " \n");
                if (tok == NULL || sscanf(tok, "%d", &ports[i]) != 1) {
-                   extra = vstralloc("CONNECT ",
+                   extra = vstrallocf(_("CONNECT %s token is \"%s\": expected a port number"),
                                      amidxtaped_streams[i].name,
-                                     " token is \"",
-                                     tok ? tok : "(null)",
-                                     "\": expected a port number",
-                                     NULL);
+                                     tok ? tok : "(null)");
                    goto parse_error;
                }
            }
@@ -2354,7 +2370,7 @@ bad_nak:
        if (strcmp(tok, "OPTIONS") == 0) {
            tok = strtok(NULL, "\n");
            if (tok == NULL) {
-               extra = stralloc("OPTIONS token is missing");
+               extra = stralloc(_("OPTIONS token is missing"));
                goto parse_error;
            }
 /*
@@ -2365,7 +2381,7 @@ bad_nak:
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
                        errstr = newvstralloc(errstr,
-                                             "OPTIONS: bad features value: ",
+                                             _("OPTIONS: bad features value: "),
                                              tok,
                                              NULL);
                        goto parse_error;
@@ -2377,10 +2393,8 @@ bad_nak:
            continue;
        }
 /*
-       extra = vstralloc("next token is \"",
-                         tok ? tok : "(null)",
-                         "\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\"",
-                         NULL);
+       extra = vstrallocf("next token is \"%s\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\""),
+                         tok ? tok : _("(null)"));
        goto parse_error;
 */
     }
@@ -2392,11 +2406,12 @@ bad_nak:
        if (ports[i] == -1)
            continue;
        amidxtaped_streams[i].fd = security_stream_client(sech, ports[i]);
-       dbprintf(("amidxtaped_streams[%d].fd = %p\n",i, amidxtaped_streams[i].fd));
+       dbprintf(_("amidxtaped_streams[%d].fd = %p\n"),i, amidxtaped_streams[i].fd);
        if (amidxtaped_streams[i].fd == NULL) {
-           errstr = newvstralloc(errstr,
-                       "[could not connect ", amidxtaped_streams[i].name, " stream: ",
-                       security_geterror(sech), "]", NULL);
+           errstr = newvstrallocf(errstr,\
+                       _("[could not connect %s stream: %s]"),
+                       amidxtaped_streams[i].name,
+                       security_geterror(sech));
            goto connect_error;
        }
     }
@@ -2407,9 +2422,10 @@ bad_nak:
        if (amidxtaped_streams[i].fd == NULL)
            continue;
        if (security_stream_auth(amidxtaped_streams[i].fd) < 0) {
-           errstr = newvstralloc(errstr,
-               "[could not authenticate ", amidxtaped_streams[i].name, " stream: ",
-               security_stream_geterror(amidxtaped_streams[i].fd), "]", NULL);
+           errstr = newvstrallocf(errstr,
+               _("[could not authenticate %s stream: %s]"),
+               amidxtaped_streams[i].name,
+               security_stream_geterror(amidxtaped_streams[i].fd));
            goto connect_error;
        }
     }
@@ -2419,11 +2435,11 @@ bad_nak:
      * them, complain.
      */
     if (amidxtaped_streams[CTLFD].fd == NULL) {
-        errstr = newstralloc(errstr, "[couldn't open CTL streams]");
+        errstr = newvstrallocf(errstr, _("[couldn't open CTL streams]"));
         goto connect_error;
     }
     if (amidxtaped_streams[DATAFD].fd == NULL) {
-        errstr = newstralloc(errstr, "[couldn't open DATA streams]");
+        errstr = newvstrallocf(errstr, _("[couldn't open DATA streams]"));
         goto connect_error;
     }
 
@@ -2432,11 +2448,13 @@ bad_nak:
     return;
 
 parse_error:
-    errstr = newvstralloc(errstr,
-                         "[parse of reply message failed: ",
-                         extra ? extra : "(no additional information)",
-                         "]",
-                         NULL);
+    if (extra) {
+       errstr = newvstrallocf(errstr,
+                         _("[parse of reply message failed: %s]"), extra);
+    } else {
+       errstr = newvstrallocf(errstr,
+                         _("[parse of reply message failed: (no additional information)"));
+    }
     amfree(extra);
     *response_error = 2;
     return;
@@ -2517,7 +2535,7 @@ read_amidxtaped_data(
 
     fd = *(int *)cookie;
     if (size < 0) {
-       errstr = newstralloc2(errstr, "amidxtaped read: ",
+       errstr = newstralloc2(errstr, _("amidxtaped read: "),
                 security_stream_geterror(amidxtaped_streams[DATAFD].fd));
        return;
     }
index 02690158827ac191d9660732e1e0b117b4e666ab..ecab73702cff9ac60c71c5001d9669c1318e37b1 100644 (file)
 void
 help_list(void)
 {
-    printf("valid commands are:\n\n");
+    g_printf(_("valid commands are:\n\n"));
 
-    printf("add path1 ...     - add to extraction list (shell wildcards)\n");
-    printf("addx path1 ...    - add to extraction list (regular expressions)\n");
-    printf("cd directory      - change cwd on virtual file system (shell wildcards)\n");
-    printf("cdx directory     - change cwd on virtual file system (regular expressions)\n");
-    printf("clear             - clear extraction list\n");
-    printf("delete path1 ...  - delete from extraction list (shell wildcards)\n");
-    printf("deletex path1 ... - delete from extraction list (regular expressions)\n");
-    printf("extract           - extract selected files from tapes\n");
-    printf("exit\n");
-    printf("help\n");
-    printf("history           - show dump history of disk\n");
-    printf("list [filename]   - show extraction list, optionally writing to file\n");
-    printf("lcd directory     - change cwd on local file system\n");
-    printf("ls                - list directory on virtual file system\n");
-    printf("lpwd              - show cwd on local file system\n");
-    printf("mode              - show the method used to extract SMB shares\n");
-    printf("pwd               - show cwd on virtual file system\n");
-    printf("quit\n");
-    printf("listhost          - list hosts\n");
-    printf("listdisk [diskdevice]              - list disks\n");
-    printf("setdate {YYYY-MM-DD|--MM-DD|---DD} - set date of look\n");
-    printf("        {YYYY-MM-DD-HH-MM-SS}      - set date of look\n");
-    printf("setdisk diskname [mountpoint]      - select disk on dump host\n");
-    printf("sethost host                       - select dump host\n");
-    printf("settape [host:][device|default]    - select tape server and/or device\n");
-    printf("setmode smb|tar                 - select the method used to extract SMB shares\n");
-    printf("\n");
+    g_printf(_("add path1 ...     - add to extraction list (shell wildcards)\n"));
+    g_printf(_("addx path1 ...    - add to extraction list (regular expressions)\n"));
+    g_printf(_("cd directory      - change cwd on virtual file system (shell wildcards)\n"));
+    g_printf(_("cdx directory     - change cwd on virtual file system (regular expressions)\n"));
+    g_printf(_("clear             - clear extraction list\n"));
+    g_printf(_("delete path1 ...  - delete from extraction list (shell wildcards)\n"));
+    g_printf(_("deletex path1 ... - delete from extraction list (regular expressions)\n"));
+    g_printf(_("extract           - extract selected files from tapes\n"));
+    g_printf(_("exit\n"));
+    g_printf(_("help\n"));
+    g_printf(_("history           - show dump history of disk\n"));
+    g_printf(_("list [filename]   - show extraction list, optionally writing to file\n"));
+    g_printf(_("lcd directory     - change cwd on local file system\n"));
+    g_printf(_("ls                - list directory on virtual file system\n"));
+    g_printf(_("lpwd              - show cwd on local file system\n"));
+    g_printf(_("mode              - show the method used to extract SMB shares\n"));
+    g_printf(_("pwd               - show cwd on virtual file system\n"));
+    g_printf(_("quit\n"));
+    g_printf(_("listhost          - list hosts\n"));
+    g_printf(_("listdisk [diskdevice]              - list disks\n"));
+    g_printf(_("setdate {YYYY-MM-DD|--MM-DD|---DD} - set date of look\n"));
+    g_printf(_("        {YYYY-MM-DD-HH-MM-SS}      - set date of look\n"));
+    g_printf(_("setdisk diskname [mountpoint]      - select disk on dump host\n"));
+    g_printf(_("sethost host                       - select dump host\n"));
+    g_printf(_("setdevice [[-h host] device]       - select tape server and/or device\n"));
+    g_printf(_("setmode smb|tar                    - select the method used to extract SMB shares\n"));
+    g_printf("\n");
 }
index 194e88d9243f9e7dc640d5cfbe48f562c8d7e903..2f659aec791bb9938c0a4489924554612a9522c7 100644 (file)
@@ -66,8 +66,8 @@ set_date(
        }
        else
        {
-           printf("No index records for cwd on new date\n");
-           printf("Setting cwd to mount point\n");
+           g_printf(_("No index records for cwd on new date\n"));
+           g_printf(_("Setting cwd to mount point\n"));
            disk_path = newstralloc(disk_path, "/");    /* fake it */
            clear_dir_list();
        }
@@ -89,7 +89,7 @@ set_host(
 
     if (is_extract_list_nonempty())
     {
-       printf("Must clear extract list before changing host\n");
+       g_printf(_("Must clear extract list before changing host\n"));
        return;
     }
 
@@ -112,7 +112,7 @@ set_host(
     if (!found_host) {
        if ((hp = gethostbyname(uqhost)) != NULL) {
            host = hp->h_name;
-           printf("Trying host %s ...\n", host);
+           g_printf(_("Trying host %s ...\n"), host);
            cmd = newstralloc2(cmd, "HOST ", host);
            if (converse(cmd) == -1)
                exit(1);
@@ -129,7 +129,7 @@ set_host(
        if (hp) {
            for (hostp = hp->h_aliases; (host = *hostp) != NULL; hostp++)
            {
-               printf(_("Trying host %s ...\n"), host);
+               g_printf(_("Trying host %s ...\n"), host);
                cmd = newstralloc2(cmd, "HOST ", host);
                if (converse(cmd) == -1)
                    exit(1);
@@ -142,38 +142,22 @@ set_host(
        }
     }
 
-    /*
-     * gethostbyname() will not return a canonical name for a host with no
-     * IPv4 addresses, so use getaddrinfo() (if supported)
-     */
-#ifdef WORKING_IPV6
+    /* Try looking up the canonical name of the host */
     if (!found_host) {
-       struct addrinfo hints;
-       struct addrinfo *gaires = NULL;
-       int res;
-
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_UNSPEC;
-       hints.ai_socktype = 0;
-       hints.ai_protocol = 0;
-       hints.ai_addrlen = 0;
-       hints.ai_addr = NULL;
-       hints.ai_canonname = NULL;
-       hints.ai_next = NULL;
-       if ((res = getaddrinfo(uqhost, NULL, &hints, &gaires)) == 0) {
-           if (gaires && (host = gaires->ai_canonname)) {
-               printf(_("Trying host %s ...\n"), host);
-               cmd = newstralloc2(cmd, "HOST ", host);
-               if (converse(cmd) == -1)
-                   exit(1);
-               if(server_happy())
-                   found_host = 1;
-           }
-       }
+       char *canonname;
+       int result;
 
-       if (gaires) freeaddrinfo(gaires);
+       result = resolve_hostname(uqhost, 0, NULL, &canonname);
+       if (result == 0 && canonname) {
+           host = canonname;
+           g_printf(_("Trying host %s ...\n"), host);
+           cmd = newstralloc2(cmd, "HOST ", host);
+           if (converse(cmd) == -1)
+               exit(1);
+           if(server_happy())
+               found_host = 1;
+       }
     }
-#endif
 
     if(found_host) {
        dump_hostname = newstralloc(dump_hostname, host);
@@ -209,7 +193,7 @@ set_disk(
 
     if (is_extract_list_nonempty())
     {
-       printf("Must clear extract list before changing disk\n");
+       g_printf(_("Must clear extract list before changing disk\n"));
        return;
     }
 
@@ -217,7 +201,7 @@ set_disk(
     if (mtpt != NULL) {
        uqmtpt = unquote_string(mtpt);
        if (*mtpt != '/') {
-           printf("Mount point \"%s\" invalid - must start with /\n", uqmtpt);
+           g_printf(_("Mount point \"%s\" invalid - must start with /\n"), uqmtpt);
            amfree(uqmtpt);
            return;
        }
@@ -270,8 +254,8 @@ set_disk(
     }
     else
     {
-       printf("No index records for disk for specified date\n");
-       printf("If date correct, notify system administrator\n");
+       g_printf(_("No index records for disk for specified date\n"));
+       g_printf(_("If date correct, notify system administrator\n"));
        disk_path = newstralloc(disk_path, "/");        /* fake it */
        clear_dir_list();
     }
@@ -327,15 +311,15 @@ cd_glob(
     char *path_on_disk = NULL;
 
     if (disk_name == NULL) {
-       printf("Must select disk before changing directory\n");
+       g_printf(_("Must select disk before changing directory\n"));
        return;
     }
 
     uqglob = unquote_string(glob);
     regex = glob_to_regex(uqglob);
-    dbprintf(("cd_glob (%s) -> %s\n", uqglob, regex));
+    dbprintf(_("cd_glob (%s) -> %s\n"), uqglob, regex);
     if ((s = validate_regexp(regex)) != NULL) {
-        printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
+        g_printf(_("\"%s\" is not a valid shell wildcard pattern: "), glob);
         puts(s);
        amfree(regex);
         return;
@@ -374,18 +358,33 @@ cd_regex(
     char *     regex)
 {
     char *s;
+    char *uq_orig_regex;
     char *uqregex;
+    int  len_uqregex;
 
     char *path_on_disk = NULL;
 
     if (disk_name == NULL) {
-       printf("Must select disk before changing directory\n");
+       g_printf(_("Must select disk before changing directory\n"));
        return;
     }
 
-    uqregex = unquote_string(regex);
+    uq_orig_regex = unquote_string(regex);
+    uqregex = stralloc(uq_orig_regex);
+
+    /* Add a terminating '/' if it is not there, maybe before a '$' */
+    len_uqregex = strlen(uqregex);
+    if (uqregex[len_uqregex-1] == '$') {
+       if (uqregex[len_uqregex-2] != '/') {
+           uqregex[len_uqregex-1] = '\0';
+           strappend(uqregex, "/$");
+       }
+    } else if (uqregex[len_uqregex-1] != '/') {
+       //uqregex[len_uqregex-1] = '\0';
+       strappend(uqregex, "/");
+    }
     if ((s = validate_regexp(uqregex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", uqregex);
+       g_printf(_("\"%s\" is not a valid regular expression: "), uq_orig_regex);
        amfree(uqregex);
        puts(s);
        return;
@@ -393,17 +392,18 @@ cd_regex(
 
     /* convert path (assumed in cwd) to one on disk */
     if (strcmp(disk_path, "/") == 0)
-        path_on_disk = stralloc2("/", regex);
+        path_on_disk = stralloc2("/", uqregex);
     else {
         char *clean_disk_path = clean_regex(disk_path);
         path_on_disk = vstralloc(clean_disk_path, "/", regex, NULL);
         amfree(clean_disk_path);
     }
 
-    cd_dir(path_on_disk, uqregex);
+    cd_dir(path_on_disk, uq_orig_regex);
 
     amfree(path_on_disk);
     amfree(uqregex);
+    amfree(uq_orig_regex);
 }
 
 void
@@ -411,22 +411,16 @@ cd_dir(
     char *     path_on_disk,
     char *     default_dir)
 {
-    char *path_on_disk_slash = NULL;
     char *dir = NULL;
     char *s;
-
     int nb_found;
     size_t i;
 
     DIR_ITEM *ditem;
 
-    path_on_disk_slash = stralloc2(path_on_disk, "/");
-    if ((s = validate_regexp(path_on_disk_slash)) != NULL) {
-       amfree(path_on_disk_slash);
-    }
-
     if ((s = validate_regexp(path_on_disk)) != NULL) {
-       path_on_disk = NULL;
+       set_directory(default_dir);
+       return;
     }
 
     nb_found = 0;
@@ -434,8 +428,7 @@ cd_dir(
     for (ditem=get_dir_list(); ditem!=NULL && nb_found <= 1; 
                               ditem=get_next_dir_item(ditem))
     {
-       if ((path_on_disk && match(path_on_disk, ditem->path))
-           || (path_on_disk_slash && match(path_on_disk_slash, ditem->path)))
+       if (match(path_on_disk, ditem->path))
        {
            i = strlen(ditem->path);
            if((i > 0 && ditem->path[i-1] == '/')
@@ -457,7 +450,6 @@ cd_dir(
            }
        }
     }
-    amfree(path_on_disk_slash);
 
     if(nb_found==0) {
        set_directory(default_dir);
@@ -466,7 +458,7 @@ cd_dir(
        set_directory(dir);
     }
     else {
-       printf("Too many directory\n");
+       g_printf(_("Too many directories\n"));
     }
     amfree(dir);
 }
@@ -489,7 +481,7 @@ set_directory(
     }
 
     if (disk_name == NULL) {
-       printf("Must select disk before setting directory\n");
+       g_printf(_("Must select disk before setting directory\n"));
        return;
        /*NOTREACHED*/
     }
@@ -509,7 +501,7 @@ set_directory(
        {
            if (strncmp(mount_point, ldir, strlen(mount_point)) != 0)
            {
-               printf("Invalid directory - Can't cd outside mount point \"%s\"\n",
+               g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"),
                       mount_point);
                amfree(ldir);
                return;
@@ -545,7 +537,7 @@ set_directory(
        if (strcmp(dp, "..") == 0) {
            if (strcmp(new_dir, "/") == 0) {
                /* at top of disk */
-               printf("Invalid directory - Can't cd outside mount point \"%s\"\n",
+               g_printf(_("Invalid directory - Can't cd outside mount point \"%s\"\n"),
                       mount_point);
                /*@ignore@*/
                amfree(new_dir);
@@ -591,7 +583,7 @@ set_directory(
     }
     else
     {
-       printf("Invalid directory - %s\n", dir);
+       g_printf(_("Invalid directory - %s\n"), dir);
     }
 
     /*@ignore@*/
@@ -606,41 +598,48 @@ void
 show_directory(void)
 {
     if (mount_point == NULL || disk_path == NULL)
-        printf("Must select disk first\n");
+        g_printf(_("Must select disk first\n"));
     else if (strcmp(mount_point, "/") == 0)
-       printf("%s\n", disk_path);
+       g_printf("%s\n", disk_path);
     else if (strcmp(disk_path, "/") == 0)
-       printf("%s\n", mount_point);
+       g_printf("%s\n", mount_point);
     else
-       printf("%s%s\n", mount_point, disk_path);
+       g_printf("%s%s\n", mount_point, disk_path);
 }
 
 
-/* set the tape server and device */
+/* set the tape server and device (deprecated version) */
 void
 set_tape(
     char *     tape)
 {
     char *uqtape = unquote_string(tape);
     char *tapedev = strchr(uqtape, ':');
+    char *host = NULL;
+
+    g_printf(_("NOTE: 'settape' is deprecated; use setdevice instead.\n"));
 
     if (tapedev)
     {
+       /* This command is deprecated because this parsing is going to fall 
+        * behind the list of available device names at some point, or to shadow
+        * an interesting hostname (wouldn't 'tape' be a good name for a 
+        * tape server?) */
        if (tapedev != uqtape) {
            if((strchr(tapedev+1, ':') == NULL) &&
-              (strncmp(uqtape, "null:", 5) == 0 ||
-               strncmp(uqtape, "rait:", 5) == 0 ||
-               strncmp(uqtape, "file:", 5) == 0 ||
-               strncmp(uqtape, "tape:", 5) == 0)) {
+              (strncmp_const(uqtape, "null:") == 0 ||
+               strncmp_const(uqtape, "rait:") == 0 ||
+               strncmp_const(uqtape, "file:") == 0 ||
+               strncmp_const(uqtape, "s3:") == 0 ||
+               strncmp_const(uqtape, "tape:") == 0)) {
                tapedev = uqtape;
            }
            else {
                *tapedev = '\0';
-               tape_server_name = newstralloc(tape_server_name, uqtape);
+               host = stralloc(uqtape);
                ++tapedev;
            }
-       } else { /* reset server_name if start with : */
-           amfree(tape_server_name);
+       } else {
            ++tapedev;
        }
     } else
@@ -649,20 +648,42 @@ set_tape(
     if (tapedev[0])
     {
        if (strcmp(tapedev, "default") == 0)
-           amfree(tape_device_name);
-       else
-           tape_device_name = newstralloc(tape_device_name, tapedev);
+           tapedev = NULL;
     }
 
+    /* call out to the new version */
+    set_device(host, tapedev);
+
+    amfree(host);
+    amfree(uqtape);
+}
+
+/* set the tape server and device, for real */
+void
+set_device(
+    char *     host,
+    char *     device)
+{
+    if (host)
+       tape_server_name = newstralloc(tape_server_name, host);
+    else
+       amfree(tape_server_name);
+
+    if (device)
+       tape_device_name = newstralloc(tape_device_name, device);
+    else
+       amfree(tape_device_name);
+
+    /* print the current status */
     if (tape_device_name)
-       printf ("Using tape \"%s\"", tape_device_name);
+       g_printf (_("Using tape \"%s\""), tape_device_name);
     else
-       printf ("Using default tape");
+       g_printf (_("Using default tape"));
 
     if (tape_server_name)
-       printf (" from server %s.\n", tape_server_name);
+       g_printf (_(" from server %s.\n"), tape_server_name);
     else
-       printf (".\nTape server unspecified, assumed to be %s.\n",
+       g_printf (_(".\nTape server unspecified, assumed to be %s.\n"),
                server_name);
 }
 
@@ -672,11 +693,11 @@ set_mode(
 {
 #ifdef SAMBA_CLIENT
   if (mode == SAMBA_SMBCLIENT) {
-    printf ("SAMBA dumps will be extracted using smbclient\n");
+    g_printf (_("SAMBA dumps will be extracted using smbclient\n"));
     samba_extract_method = SAMBA_SMBCLIENT;
   } else {
     if (mode == SAMBA_TAR) {
-      printf ("SAMBA dumps will be extracted as TAR dumps\n");
+      g_printf (_("SAMBA dumps will be extracted as TAR dumps\n"));
       samba_extract_method = SAMBA_TAR;
     }
   }
@@ -689,12 +710,12 @@ void
 show_mode(void) 
 {
 #ifdef SAMBA_CLIENT
-  printf ("SAMBA dumps are extracted ");
+  g_printf (_("SAMBA dumps are extracted "));
 
   if (samba_extract_method == SAMBA_TAR) {
-    printf (" as TAR dumps\n");
+    g_printf (_(" as TAR dumps\n"));
   } else {
-    printf ("using smbclient\n");
+    g_printf (_("using smbclient\n"));
   }
 #endif /* SAMBA_CLIENT */
 }
index 9a2010a2923fd9fdc10437d41812d6757d280b3e..c8e30a0924b88b9c71c9cd0f4be1ee06c7451f8e 100644 (file)
      SETDATE = 262,
      SETTAPE = 263,
      SETMODE = 264,
-     CD = 265,
-     CDX = 266,
-     QUIT = 267,
-     DHIST = 268,
-     LS = 269,
-     ADD = 270,
-     ADDX = 271,
-     EXTRACT = 272,
-     LIST = 273,
-     DELETE = 274,
-     DELETEX = 275,
-     PWD = 276,
-     CLEAR = 277,
-     HELP = 278,
-     LCD = 279,
-     LPWD = 280,
-     MODE = 281,
-     SMB = 282,
-     TAR = 283,
-     PATH = 284,
-     DATE = 285
+     SETDEVICE = 265,
+     CD = 266,
+     CDX = 267,
+     QUIT = 268,
+     DHIST = 269,
+     LS = 270,
+     ADD = 271,
+     ADDX = 272,
+     EXTRACT = 273,
+     DASH_H = 274,
+     LIST = 275,
+     DELETE = 276,
+     DELETEX = 277,
+     PWD = 278,
+     CLEAR = 279,
+     HELP = 280,
+     LCD = 281,
+     LPWD = 282,
+     MODE = 283,
+     SMB = 284,
+     TAR = 285,
+     PATH = 286,
+     DATE = 287
    };
 #endif
 /* Tokens.  */
 #define SETDATE 262
 #define SETTAPE 263
 #define SETMODE 264
-#define CD 265
-#define CDX 266
-#define QUIT 267
-#define DHIST 268
-#define LS 269
-#define ADD 270
-#define ADDX 271
-#define EXTRACT 272
-#define LIST 273
-#define DELETE 274
-#define DELETEX 275
-#define PWD 276
-#define CLEAR 277
-#define HELP 278
-#define LCD 279
-#define LPWD 280
-#define MODE 281
-#define SMB 282
-#define TAR 283
-#define PATH 284
-#define DATE 285
+#define SETDEVICE 265
+#define CD 266
+#define CDX 267
+#define QUIT 268
+#define DHIST 269
+#define LS 270
+#define ADD 271
+#define ADDX 272
+#define EXTRACT 273
+#define DASH_H 274
+#define LIST 275
+#define DELETE 276
+#define DELETEX 277
+#define PWD 278
+#define CLEAR 279
+#define HELP 280
+#define LCD 281
+#define LPWD 282
+#define MODE 283
+#define SMB 284
+#define TAR 285
+#define PATH 286
+#define DATE 287
 
 
 
@@ -169,7 +173,7 @@ typedef union YYSTYPE
        int     subtok;
 }
 /* Line 187 of yacc.c.  */
-#line 173 "uparse.c"
+#line 177 "uparse.c"
        YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -182,7 +186,7 @@ typedef union YYSTYPE
 
 
 /* Line 216 of yacc.c.  */
-#line 186 "uparse.c"
+#line 190 "uparse.c"
 
 #ifdef short
 # undef short
@@ -395,22 +399,22 @@ union yyalloc
 #endif
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  55
+#define YYFINAL  58
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   45
+#define YYLAST   50
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  31
+#define YYNTOKENS  33
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  16
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  49
+#define YYNRULES  52
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  61
+#define YYNSTATES  66
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   285
+#define YYMAXUTOK   287
 
 #define YYTRANSLATE(YYX)                                               \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -446,7 +450,7 @@ static const yytype_uint8 yytranslate[] =
        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30
+      25,    26,    27,    28,    29,    30,    31,    32
 };
 
 #if YYDEBUG
@@ -456,26 +460,28 @@ static const yytype_uint8 yyprhs[] =
 {
        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
       19,    21,    23,    24,    26,    29,    31,    34,    37,    41,
-      44,    47,    49,    52,    55,    58,    61,    63,    65,    68,
-      70,    72,    74,    76,    78,    81,    84,    86,    89,    92,
-      94,    97,   100,   102,   105,   108,   110,   112,   115,   117
+      44,    47,    49,    52,    57,    59,    62,    65,    68,    71,
+      73,    75,    78,    80,    82,    84,    86,    88,    91,    94,
+      96,    99,   102,   104,   107,   110,   112,   115,   118,   120,
+     122,   125,   127
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      32,     0,    -1,    33,    -1,    34,    -1,    35,    -1,    36,
-      -1,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    45,
-      -1,    46,    -1,    -1,     3,    -1,     4,    29,    -1,     4,
-      -1,     7,    30,    -1,     5,    29,    -1,     6,    29,    29,
-      -1,     6,    29,    -1,     8,    29,    -1,     8,    -1,    10,
-      29,    -1,    11,    29,    -1,     9,    27,    -1,     9,    28,
-      -1,    13,    -1,    14,    -1,    18,    29,    -1,    18,    -1,
-      21,    -1,    22,    -1,    26,    -1,    12,    -1,    15,    37,
-      -1,    37,    29,    -1,    29,    -1,    16,    39,    -1,    39,
-      29,    -1,    29,    -1,    19,    41,    -1,    41,    29,    -1,
-      29,    -1,    20,    43,    -1,    43,    29,    -1,    29,    -1,
-      25,    -1,    24,    29,    -1,    23,    -1,    17,    -1
+      34,     0,    -1,    35,    -1,    36,    -1,    37,    -1,    38,
+      -1,    40,    -1,    42,    -1,    44,    -1,    46,    -1,    47,
+      -1,    48,    -1,    -1,     3,    -1,     4,    31,    -1,     4,
+      -1,     7,    32,    -1,     5,    31,    -1,     6,    31,    31,
+      -1,     6,    31,    -1,     8,    31,    -1,     8,    -1,    10,
+      31,    -1,    10,    19,    31,    31,    -1,    10,    -1,    11,
+      31,    -1,    12,    31,    -1,     9,    29,    -1,     9,    30,
+      -1,    14,    -1,    15,    -1,    20,    31,    -1,    20,    -1,
+      23,    -1,    24,    -1,    28,    -1,    13,    -1,    16,    39,
+      -1,    39,    31,    -1,    31,    -1,    17,    41,    -1,    41,
+      31,    -1,    31,    -1,    21,    43,    -1,    43,    31,    -1,
+      31,    -1,    22,    45,    -1,    45,    31,    -1,    31,    -1,
+      27,    -1,    26,    31,    -1,    25,    -1,    18,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -483,9 +489,10 @@ static const yytype_uint8 yyrline[] =
 {
        0,    65,    65,    66,    67,    68,    69,    70,    71,    72,
       73,    74,    75,    84,    85,    86,    87,    88,    89,    90,
-      91,    92,    93,    94,    95,   100,   108,   109,   110,   111,
-     112,   113,   114,   118,   122,   126,   127,   131,   135,   136,
-     140,   144,   145,   149,   153,   154,   158,   159,   166,   170
+      91,    92,    93,    94,    95,    96,    97,    98,   103,   111,
+     112,   113,   114,   115,   116,   117,   121,   125,   129,   130,
+     134,   138,   139,   143,   147,   148,   152,   156,   157,   161,
+     162,   169,   173
 };
 #endif
 
@@ -495,13 +502,14 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
-  "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "CD", "CDX", "QUIT", "DHIST",
-  "LS", "ADD", "ADDX", "EXTRACT", "LIST", "DELETE", "DELETEX", "PWD",
-  "CLEAR", "HELP", "LCD", "LPWD", "MODE", "SMB", "TAR", "PATH", "DATE",
-  "$accept", "ucommand", "set_command", "display_command", "quit_command",
-  "add_command", "add_path", "addx_command", "addx_path", "delete_command",
-  "delete_path", "deletex_command", "deletex_path", "local_command",
-  "help_command", "extract_command", 0
+  "SETDISK", "SETDATE", "SETTAPE", "SETMODE", "SETDEVICE", "CD", "CDX",
+  "QUIT", "DHIST", "LS", "ADD", "ADDX", "EXTRACT", "DASH_H", "LIST",
+  "DELETE", "DELETEX", "PWD", "CLEAR", "HELP", "LCD", "LPWD", "MODE",
+  "SMB", "TAR", "PATH", "DATE", "$accept", "ucommand", "set_command",
+  "display_command", "quit_command", "add_command", "add_path",
+  "addx_command", "addx_path", "delete_command", "delete_path",
+  "deletex_command", "deletex_path", "local_command", "help_command",
+  "extract_command", 0
 };
 #endif
 
@@ -513,18 +521,19 @@ static const yytype_uint16 yytoknum[] =
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285
+     285,   286,   287
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    31,    32,    32,    32,    32,    32,    32,    32,    32,
-      32,    32,    32,    33,    33,    33,    33,    33,    33,    33,
-      33,    33,    33,    33,    33,    33,    34,    34,    34,    34,
-      34,    34,    34,    35,    36,    37,    37,    38,    39,    39,
-      40,    41,    41,    42,    43,    43,    44,    44,    45,    46
+       0,    33,    34,    34,    34,    34,    34,    34,    34,    34,
+      34,    34,    34,    35,    35,    35,    35,    35,    35,    35,
+      35,    35,    35,    35,    35,    35,    35,    35,    35,    36,
+      36,    36,    36,    36,    36,    36,    37,    38,    39,    39,
+      40,    41,    41,    42,    43,    43,    44,    45,    45,    46,
+      46,    47,    48
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -532,9 +541,10 @@ static const yytype_uint8 yyr2[] =
 {
        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     0,     1,     2,     1,     2,     2,     3,     2,
-       2,     1,     2,     2,     2,     2,     1,     1,     2,     1,
-       1,     1,     1,     1,     2,     2,     1,     2,     2,     1,
-       2,     2,     1,     2,     2,     1,     1,     2,     1,     1
+       2,     1,     2,     4,     1,     2,     2,     2,     2,     1,
+       1,     2,     1,     1,     1,     1,     1,     2,     2,     1,
+       2,     2,     1,     2,     2,     1,     2,     2,     1,     1,
+       2,     1,     1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -542,41 +552,41 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-      12,    13,    15,     0,     0,     0,    21,     0,     0,     0,
-      33,    26,    27,     0,     0,    49,    29,     0,     0,    30,
-      31,    48,     0,    46,    32,     0,     2,     3,     4,     5,
-       6,     7,     8,     9,    10,    11,    14,    17,    19,    16,
-      20,    24,    25,    22,    23,    36,    34,    39,    37,    28,
-      42,    40,    45,    43,    47,     1,    18,    35,    38,    41,
-      44
+      12,    13,    15,     0,     0,     0,    21,     0,    24,     0,
+       0,    36,    29,    30,     0,     0,    52,    32,     0,     0,
+      33,    34,    51,     0,    49,    35,     0,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    14,    17,    19,
+      16,    20,    27,    28,     0,    22,    25,    26,    39,    37,
+      42,    40,    31,    45,    43,    48,    46,    50,     1,    18,
+       0,    38,    41,    44,    47,    23
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int8 yydefgoto[] =
 {
-      -1,    25,    26,    27,    28,    29,    46,    30,    48,    31,
-      51,    32,    53,    33,    34,    35
+      -1,    26,    27,    28,    29,    30,    49,    31,    51,    32,
+      54,    33,    56,    34,    35,    36
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -6
+#define YYPACT_NINF -16
 static const yytype_int8 yypact[] =
 {
-      -3,    -6,    -5,    -1,     0,     1,     3,    -2,     4,     5,
-      -6,    -6,    -6,     6,     7,    -6,     8,     9,    10,    -6,
-      -6,    -6,    11,    -6,    -6,    27,    -6,    -6,    -6,    -6,
-      -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    12,    -6,
-      -6,    -6,    -6,    -6,    -6,    -6,    13,    -6,    14,    -6,
-      -6,    15,    -6,    16,    -6,    -6,    -6,    -6,    -6,    -6,
-      -6
+      -3,   -16,   -15,    -1,     0,     1,     3,    -2,     7,     4,
+       5,   -16,   -16,   -16,     6,     8,   -16,     9,    10,    11,
+     -16,   -16,   -16,    12,   -16,   -16,    29,   -16,   -16,   -16,
+     -16,   -16,   -16,   -16,   -16,   -16,   -16,   -16,   -16,    13,
+     -16,   -16,   -16,   -16,    14,   -16,   -16,   -16,   -16,    15,
+     -16,    16,   -16,   -16,    17,   -16,    18,   -16,   -16,   -16,
+      19,   -16,   -16,   -16,   -16,   -16
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int8 yypgoto[] =
 {
-      -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,
-      -6,    -6,    -6,    -6,    -6,    -6
+     -16,   -16,   -16,   -16,   -16,   -16,   -16,   -16,   -16,   -16,
+     -16,   -16,   -16,   -16,   -16,   -16
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -587,19 +597,21 @@ static const yytype_int8 yypgoto[] =
 static const yytype_uint8 yytable[] =
 {
        1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
-      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
-      21,    22,    23,    24,    36,    41,    42,    55,    37,    38,
-       0,    39,    40,    43,    44,    45,    47,    49,    50,    52,
-      54,    56,    57,    58,    59,    60
+      11,    12,    13,    14,    15,    16,    37,    17,    18,    19,
+      20,    21,    22,    23,    24,    25,    44,    42,    43,    58,
+      38,    39,     0,    40,    41,    46,    47,    48,    45,    50,
+      52,    53,    55,    57,    59,    60,    61,    62,    63,    64,
+      65
 };
 
 static const yytype_int8 yycheck[] =
 {
        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
-      13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    26,    29,    27,    28,     0,    29,    29,
-      -1,    30,    29,    29,    29,    29,    29,    29,    29,    29,
-      29,    29,    29,    29,    29,    29
+      13,    14,    15,    16,    17,    18,    31,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    19,    29,    30,     0,
+      31,    31,    -1,    32,    31,    31,    31,    31,    31,    31,
+      31,    31,    31,    31,    31,    31,    31,    31,    31,    31,
+      31
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -607,12 +619,12 @@ static const yytype_int8 yycheck[] =
 static const yytype_uint8 yystos[] =
 {
        0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
-      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-      22,    23,    24,    25,    26,    32,    33,    34,    35,    36,
-      38,    40,    42,    44,    45,    46,    29,    29,    29,    30,
-      29,    27,    28,    29,    29,    29,    37,    29,    39,    29,
-      29,    41,    29,    43,    29,     0,    29,    29,    29,    29,
-      29
+      12,    13,    14,    15,    16,    17,    18,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    34,    35,    36,    37,
+      38,    40,    42,    44,    46,    47,    48,    31,    31,    31,
+      32,    31,    29,    30,    19,    31,    31,    31,    31,    39,
+      31,    41,    31,    31,    43,    31,    45,    31,     0,    31,
+      31,    31,    31,    31,    31,    31
 };
 
 #define yyerrok                (yyerrstatus = 0)
@@ -1478,21 +1490,36 @@ yyreduce:
 
   case 21:
 #line 92 "uparse.y"
-    { set_tape(""); }
+    { set_tape("default"); }
     break;
 
   case 22:
 #line 93 "uparse.y"
-    { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
+    { set_device(NULL, (yyvsp[(2) - (2)].strval)); }
     break;
 
   case 23:
 #line 94 "uparse.y"
-    { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
+    { set_device((yyvsp[(3) - (4)].strval), (yyvsp[(4) - (4)].strval)); }
     break;
 
   case 24:
 #line 95 "uparse.y"
+    { set_device(NULL, NULL); }
+    break;
+
+  case 25:
+#line 96 "uparse.y"
+    { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
+    break;
+
+  case 26:
+#line 97 "uparse.y"
+    { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
+    break;
+
+  case 27:
+#line 98 "uparse.y"
     {
 #ifdef SAMBA_CLIENT
                         set_mode(SAMBA_SMBCLIENT);
@@ -1500,8 +1527,8 @@ yyreduce:
                     }
     break;
 
-  case 25:
-#line 100 "uparse.y"
+  case 28:
+#line 103 "uparse.y"
     {
 #ifdef SAMBA_CLIENT
                         set_mode(SAMBA_TAR);
@@ -1509,112 +1536,112 @@ yyreduce:
                     }
     break;
 
-  case 26:
-#line 108 "uparse.y"
+  case 29:
+#line 111 "uparse.y"
     { list_disk_history(); }
     break;
 
-  case 27:
-#line 109 "uparse.y"
+  case 30:
+#line 112 "uparse.y"
     { list_directory(); }
     break;
 
-  case 28:
-#line 110 "uparse.y"
+  case 31:
+#line 113 "uparse.y"
     { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
-  case 29:
-#line 111 "uparse.y"
+  case 32:
+#line 114 "uparse.y"
     { display_extract_list(NULL); }
     break;
 
-  case 30:
-#line 112 "uparse.y"
+  case 33:
+#line 115 "uparse.y"
     { show_directory(); }
     break;
 
-  case 31:
-#line 113 "uparse.y"
+  case 34:
+#line 116 "uparse.y"
     { clear_extract_list(); }
     break;
 
-  case 32:
-#line 114 "uparse.y"
+  case 35:
+#line 117 "uparse.y"
     { show_mode (); }
     break;
 
-  case 33:
-#line 118 "uparse.y"
+  case 36:
+#line 121 "uparse.y"
     { quit(); }
     break;
 
-  case 35:
-#line 126 "uparse.y"
+  case 38:
+#line 129 "uparse.y"
     { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
-  case 36:
-#line 127 "uparse.y"
+  case 39:
+#line 130 "uparse.y"
     { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
-  case 38:
-#line 135 "uparse.y"
+  case 41:
+#line 138 "uparse.y"
     { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
-  case 39:
-#line 136 "uparse.y"
+  case 42:
+#line 139 "uparse.y"
     { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
-  case 41:
-#line 144 "uparse.y"
+  case 44:
+#line 147 "uparse.y"
     { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
-  case 42:
-#line 145 "uparse.y"
+  case 45:
+#line 148 "uparse.y"
     { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
-  case 44:
-#line 153 "uparse.y"
+  case 47:
+#line 156 "uparse.y"
     { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
-  case 45:
-#line 154 "uparse.y"
+  case 48:
+#line 157 "uparse.y"
     { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
-  case 46:
-#line 158 "uparse.y"
-    { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
+  case 49:
+#line 161 "uparse.y"
+    { char * buf= g_get_current_dir(); puts(buf); free(buf); }
     break;
 
-  case 47:
-#line 159 "uparse.y"
+  case 50:
+#line 162 "uparse.y"
     {
                local_cd((yyvsp[(2) - (2)].strval));
                amfree((yyvsp[(2) - (2)].strval));
        }
     break;
 
-  case 48:
-#line 166 "uparse.y"
+  case 51:
+#line 169 "uparse.y"
     { help_list(); }
     break;
 
-  case 49:
-#line 170 "uparse.y"
+  case 52:
+#line 173 "uparse.y"
     { extract_files(); }
     break;
 
 
 /* Line 1267 of yacc.c.  */
-#line 1618 "uparse.c"
+#line 1645 "uparse.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1828,13 +1855,13 @@ yyreturn:
 }
 
 
-#line 174 "uparse.y"
+#line 177 "uparse.y"
 
 
 void
 yyerror(
     char *     s)
 {
-       printf("%s\n", s);
+       g_printf("%s\n", s);
 }
 
index d813294dfdcbf9abe68cf20b461d144d655a944f..3d33acd56737c49c99edb49093a1fa16a9be263d 100644 (file)
      SETDATE = 262,
      SETTAPE = 263,
      SETMODE = 264,
-     CD = 265,
-     CDX = 266,
-     QUIT = 267,
-     DHIST = 268,
-     LS = 269,
-     ADD = 270,
-     ADDX = 271,
-     EXTRACT = 272,
-     LIST = 273,
-     DELETE = 274,
-     DELETEX = 275,
-     PWD = 276,
-     CLEAR = 277,
-     HELP = 278,
-     LCD = 279,
-     LPWD = 280,
-     MODE = 281,
-     SMB = 282,
-     TAR = 283,
-     PATH = 284,
-     DATE = 285
+     SETDEVICE = 265,
+     CD = 266,
+     CDX = 267,
+     QUIT = 268,
+     DHIST = 269,
+     LS = 270,
+     ADD = 271,
+     ADDX = 272,
+     EXTRACT = 273,
+     DASH_H = 274,
+     LIST = 275,
+     DELETE = 276,
+     DELETEX = 277,
+     PWD = 278,
+     CLEAR = 279,
+     HELP = 280,
+     LCD = 281,
+     LPWD = 282,
+     MODE = 283,
+     SMB = 284,
+     TAR = 285,
+     PATH = 286,
+     DATE = 287
    };
 #endif
 /* Tokens.  */
 #define SETDATE 262
 #define SETTAPE 263
 #define SETMODE 264
-#define CD 265
-#define CDX 266
-#define QUIT 267
-#define DHIST 268
-#define LS 269
-#define ADD 270
-#define ADDX 271
-#define EXTRACT 272
-#define LIST 273
-#define DELETE 274
-#define DELETEX 275
-#define PWD 276
-#define CLEAR 277
-#define HELP 278
-#define LCD 279
-#define LPWD 280
-#define MODE 281
-#define SMB 282
-#define TAR 283
-#define PATH 284
-#define DATE 285
+#define SETDEVICE 265
+#define CD 266
+#define CDX 267
+#define QUIT 268
+#define DHIST 269
+#define LS 270
+#define ADD 271
+#define ADDX 272
+#define EXTRACT 273
+#define DASH_H 274
+#define LIST 275
+#define DELETE 276
+#define DELETEX 277
+#define PWD 278
+#define CLEAR 279
+#define HELP 280
+#define LCD 281
+#define LPWD 282
+#define MODE 283
+#define SMB 284
+#define TAR 285
+#define PATH 286
+#define DATE 287
 
 
 
@@ -112,7 +116,7 @@ typedef union YYSTYPE
        int     subtok;
 }
 /* Line 1489 of yacc.c.  */
-#line 116 "uparse.h"
+#line 120 "uparse.h"
        YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
index 6be3562f6914ca8504aebfe9686854bcfd59aeaa..72ae6eb784e8475abd16a989993413c6a5ba2c7d 100644 (file)
@@ -48,8 +48,8 @@ extern char * yytext;
 
        /* literal keyword tokens */
 
-%token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE
-%token CD CDX QUIT DHIST LS ADD ADDX EXTRACT
+%token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE SETDEVICE
+%token CD CDX QUIT DHIST LS ADD ADDX EXTRACT DASH_H
 %token LIST DELETE DELETEX PWD CLEAR HELP LCD LPWD MODE SMB TAR
 
         /* typed tokens */
@@ -89,7 +89,10 @@ set_command:
   |     SETDISK PATH PATH { set_disk($2, $3); amfree($2); amfree($3); }
   |     SETDISK PATH { set_disk($2, NULL); amfree($2); }
   |     SETTAPE PATH { set_tape($2); amfree($2); }
-  |     SETTAPE { set_tape(""); }
+  |     SETTAPE { set_tape("default"); }
+  |    SETDEVICE PATH { set_device(NULL, $2); }
+  |    SETDEVICE DASH_H PATH PATH { set_device($3, $4); }
+  |    SETDEVICE { set_device(NULL, NULL); }
   |     CD PATH { cd_glob($2); amfree($2); }
   |     CDX PATH { cd_regex($2); amfree($2); }
   |     SETMODE SMB {
@@ -155,7 +158,7 @@ deletex_path:
   ;
 
 local_command:
-       LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
+       LPWD { char * buf= g_get_current_dir(); puts(buf); free(buf); }
   |     LCD PATH {
                local_cd($2);
                amfree($2);
@@ -177,5 +180,5 @@ void
 yyerror(
     char *     s)
 {
-       printf("%s\n", s);
+       g_printf("%s\n", s);
 }
index 2b8045f27984aff86abdbc6f08ea0e0f2eda7e11..49a3a3c07776685aafe0e55b302b209200bcd7bc 100644 (file)
@@ -1,31 +1,92 @@
-/* A lexical scanner generated by flex*/
 
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#line 3 "uscan.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
 
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
 #include <stdio.h>
-#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
 
+/* end standard C headers. */
 
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
 #endif
 
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
 
-#ifdef __cplusplus
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
 
-#include <stdlib.h>
+#endif /* ! FLEXINT_H */
 
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
+#ifdef __cplusplus
 
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
 #if __STDC__
 
-#define YY_USE_PROTOS
 #define YY_USE_CONST
 
 #endif /* __STDC__ */
 #endif /* ! __cplusplus */
 
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
 #ifdef YY_USE_CONST
 #define yyconst const
 #else
 #define yyconst
 #endif
 
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
  * but we do it the disgusting crufty way forced on us by the ()-less
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
 /* Action number for EOF rule of a given start state. */
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart(yyin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
 
 extern int yyleng;
+
 extern FILE *yyin, *yyout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- *     if ( condition_holds )
- *             yyless( 5 );
- *     else
- *             do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
        do \
                { \
                /* Undo effects of setting up yytext. */ \
-               *yy_cp = yy_hold_char; \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
                YY_RESTORE_YY_MORE_OFFSET \
-               yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* Some routines like yy_flex_realloc() are emitted as static but are
-   not called by all lexers. This generates warnings in some compilers,
-   notably GCC. Arrange to suppress these. */
-#ifdef __GNUC__
-#define YY_MAY_BE_UNUSED __attribute__((unused))
-#else
-#define YY_MAY_BE_UNUSED
-#endif
+#define unput(c) yyunput( c, (yytext_ptr)  )
 
 /* The following is because we cannot portably get our hands on size_t
  * (without autoconf's help, which isn't available because we want
  * flex-generated scanners to compile on their own).
  */
-typedef unsigned int yy_size_t;
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
 
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
        {
        FILE *yy_input_file;
@@ -186,12 +225,16 @@ struct yy_buffer_state
         */
        int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
        int yy_fill_buffer;
 
        int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
        /* When an EOF's been seen but there's still some text to process
@@ -205,28 +248,38 @@ struct yy_buffer_state
         * just pointing yyin at a new input file.
         */
 #define YY_BUFFER_EOF_PENDING 2
+
        };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
  */
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
 
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-
 static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-
-
 int yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;                /* whether we need to initialize */
+static int yy_init = 0;                /* whether we need to initialize */
 static int yy_start = 0;       /* start state number */
 
 /* Flag which is used to allow yywrap()'s to do buffer switches
@@ -234,84 +287,111 @@ static int yy_start = 0; /* start state number */
  */
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
 
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
 
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
-static void yy_flex_free YY_PROTO(( void * ));
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
 
 #define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_is_interactive = is_interactive; \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }
 
 #define yy_set_bol(at_bol) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_at_bol = at_bol; \
+       if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
 
 typedef unsigned char YY_CHAR;
+
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
 typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
 extern char *yytext;
 #define yytext_ptr yytext
 
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-       yytext_ptr = yy_bp; \
-       yyleng = (int) (yy_cp - yy_bp); \
-       yy_hold_char = *yy_cp; \
+       (yytext_ptr) = yy_bp; \
+       yyleng = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
-       yy_c_buf_p = yy_cp;
+       (yy_c_buf_p) = yy_cp;
 
-#define YY_NUM_RULES 40
-#define YY_END_OF_BUFFER 41
-static yyconst short int yy_accept[131] =
+#define YY_NUM_RULES 42
+#define YY_END_OF_BUFFER 43
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_accept[137] =
     {   0,
-        0,    0,    0,    0,   41,   40,   39,   38,   34,   38,
-       38,   22,   38,   38,   38,   38,   38,   38,   38,   38,
-       38,   38,   38,   35,   37,   40,   39,   38,   38,   38,
-       38,   38,    8,   38,   38,   38,   38,   38,   38,   38,
-       38,   13,   38,   38,   38,   38,   38,   38,   35,   36,
-       38,   38,   38,   14,    9,   38,   38,   38,   38,   38,
-       38,   23,   38,   38,   38,   19,   38,   38,   26,   27,
-       29,   38,   38,   15,   38,   38,   11,   38,   21,   38,
-       16,   24,   28,   10,   38,   38,   38,   38,   30,   31,
-       20,   38,   38,   38,   38,   38,   38,   38,   38,   38,
-
-       38,   38,   17,   38,   38,   38,   38,   38,   38,   38,
-       38,   38,   38,   18,   25,   12,   38,   38,    5,    4,
-        3,    6,    7,   38,    2,    1,   33,   38,   32,    0
+        0,    0,    0,    0,   43,   42,   41,   40,   36,   40,
+       40,   24,   40,   40,   40,   40,   40,   40,   40,   40,
+       40,   40,   40,   37,   39,   42,   41,   40,   40,    9,
+       40,   40,   40,   10,   40,   40,   40,   40,   40,   40,
+       40,   40,   15,   40,   40,   40,   40,   40,   40,   37,
+       38,   40,   40,   40,   16,   11,   40,   40,   40,   40,
+       40,   40,   25,   40,   40,   40,   21,   40,   40,   28,
+       29,   31,   40,   40,   17,   40,   40,   13,   40,   23,
+       40,   18,   26,   30,   12,   40,   40,   40,   40,   32,
+       33,   22,   40,   40,   40,   40,   40,   40,   40,   40,
+
+       40,   40,   40,   40,   19,   40,   40,   40,   40,   40,
+       40,   40,   40,   40,   40,   40,   20,   27,   14,   40,
+       40,    5,   40,    4,    3,    6,    7,   40,    2,    1,
+       40,   35,    8,   40,   34,    0
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
         2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
@@ -325,8 +405,8 @@ static yyconst int yy_ec[256] =
         4,    9,    4,    4,    4,    4,   10,   11,   12,   13,
 
        14,    4,    4,   15,   16,    4,   17,   18,   19,    4,
-       20,   21,   22,   23,   24,   25,   26,    4,   27,   28,
-       29,    4,    4,    4,    4,    4,    1,    4,    4,    4,
+       20,   21,   22,   23,   24,   25,   26,   27,   28,   29,
+       30,    4,    4,    4,    4,    4,    1,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
@@ -343,106 +423,109 @@ static yyconst int yy_ec[256] =
         4,    4,    4,    4,    4
     } ;
 
-static yyconst int yy_meta[30] =
+static yyconst flex_int32_t yy_meta[31] =
     {   0,
         1,    1,    2,    3,    4,    3,    3,    3,    5,    3,
         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3
     } ;
 
-static yyconst short int yy_base[135] =
+static yyconst flex_int16_t yy_base[141] =
     {   0,
-        0,    0,   25,   26,  161,  162,   30,    0,  162,  154,
-       30,    0,  146,   25,  144,  129,   25,   28,  136,  128,
-      128,   28,  143,    0,  162,    0,   43,    0,   44,  145,
-       47,  138,  122,  135,  130,   32,  129,  122,  132,  120,
-      116,    0,  129,  128,  124,  114,  127,  114,    0,  162,
-      129,   49,   52,  107,    0,  124,  119,  107,  108,  109,
-      104,    0,  103,  114,  112,    0,  100,   47,    0,    0,
-      117,  116,  115,    0,   98,   95,    0,  109,    0,   98,
-       48,    0,    0,    0,   54,   97,   96,  105,  107,   61,
-        0,   99,  100,   88,   94,   89,   83,   83,   82,   92,
-
-       83,   96,   74,   76,   71,   75,   74,   83,   79,   70,
-       80,   79,   67,    0,    0,    0,   72,   58,    0,    0,
-        0,    0,    0,   64,    0,    0,   69,   62,   58,  162,
-       76,   79,   84,   87
+        0,    0,   26,   27,  168,  169,   31,    0,  169,   31,
+       32,    0,  154,   27,  152,  136,   27,   32,  144,  135,
+      136,   28,  151,    0,  169,    0,   47,    0,   45,    0,
+      153,   48,  146,  129,  143,  138,   41,  137,  130,  140,
+      128,  123,    0,  137,  136,  132,  122,  135,  122,    0,
+      169,  137,   52,   54,  114,    0,  132,  127,  115,  116,
+      117,  112,    0,  111,  122,  120,    0,  108,   49,    0,
+        0,  125,  124,  123,    0,  106,  103,    0,  117,    0,
+      106,   50,    0,    0,    0,   57,  105,  104,  113,  115,
+       63,    0,  107,  108,   96,  102,   97,   91,   88,   90,
+
+       89,   99,   90,  103,   80,   83,   77,   82,   81,   90,
+       87,   85,   76,   86,   85,   69,    0,    0,    0,   81,
+       72,    0,   84,    0,    0,    0,    0,   88,    0,    0,
+       77,   71,    0,   78,   65,  169,   78,   81,   86,   89
     } ;
 
-static yyconst short int yy_def[135] =
+static yyconst flex_int16_t yy_def[141] =
     {   0,
-      130,    1,  131,  131,  130,  130,  130,  132,  130,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  133,  130,  134,  130,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  133,  130,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,    0,
-      130,  130,  130,  130
+      136,    1,  137,  137,  136,  136,  136,  138,  136,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  139,  136,  140,  136,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  139,
+      136,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
+      138,  138,  138,  138,  138,    0,  136,  136,  136,  136
     } ;
 
-static yyconst short int yy_nxt[192] =
+static yyconst flex_int16_t yy_nxt[200] =
     {   0,
         6,    7,    7,    8,    9,   10,   11,   12,    8,   13,
         8,   14,   15,   16,   17,    8,    8,   18,   19,    8,
-       20,   21,    8,   22,   23,    8,    8,    8,    8,   25,
-       25,   27,   27,   26,   26,   30,   31,   33,   37,   39,
-       38,   46,   34,   40,   27,   27,   47,   58,   41,   51,
-       52,   42,   30,   31,   72,   52,   59,   73,   53,   85,
-       95,   86,   96,   97,  129,   87,  102,   90,  129,   98,
-      127,   88,  124,  113,  128,  127,   24,   24,   24,   24,
-       24,   28,  126,   28,   49,   49,   49,   50,  125,   50,
-       50,   50,  123,  122,  121,  120,  119,  118,  117,  116,
-
+       20,   21,    8,   22,   23,    8,    8,    8,    8,    8,
+       25,   25,   27,   27,   26,   26,   29,   31,   32,   34,
+       38,   47,   39,   40,   35,   30,   48,   41,   27,   27,
+       52,   53,   42,   31,   32,   43,   59,   73,   53,   74,
+       54,   86,   96,   87,   97,   60,   98,   88,  104,   91,
+       99,  135,  100,   89,  128,  116,  134,  132,   24,   24,
+       24,   24,   24,   28,  135,   28,   50,   50,   50,   51,
+      133,   51,   51,   51,  132,  131,  130,  129,  127,  126,
+
+      125,  124,  123,  122,  121,  120,  119,  118,  117,  116,
       115,  114,  113,  112,  111,  110,  109,  108,  107,  106,
-      105,  104,  103,   89,  101,  100,   99,   94,   93,   92,
-       91,   90,   89,   71,   84,   83,   82,   81,   80,   79,
-       78,   77,   76,   75,   74,   71,   70,   69,   68,   67,
-       66,   65,   64,   63,   62,   61,   60,   57,   56,   55,
-       54,   53,   48,   45,   44,   43,   36,   35,   32,   29,
-      130,    5,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130
+      105,   90,  103,  102,  101,   95,   94,   93,   92,   91,
+       90,   72,   85,   84,   83,   82,   81,   80,   79,   78,
+       77,   76,   75,   72,   71,   70,   69,   68,   67,   66,
+       65,   64,   63,   62,   61,   58,   57,   56,   55,   54,
+       49,   46,   45,   44,   37,   36,   33,  136,    5,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136
 
     } ;
 
-static yyconst short int yy_chk[192] =
+static yyconst flex_int16_t yy_chk[200] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
-        4,    7,    7,    3,    4,   11,   11,   14,   17,   18,
-       17,   22,   14,   18,   27,   27,   22,   36,   18,   29,
-       29,   18,   31,   31,   52,   52,   36,   53,   53,   68,
-       81,   68,   81,   85,  129,   68,   90,   90,  128,   85,
-      124,   68,  113,  113,  127,  127,  131,  131,  131,  131,
-      131,  132,  118,  132,  133,  133,  133,  134,  117,  134,
-      134,  134,  112,  111,  110,  109,  108,  107,  106,  105,
-
-      104,  103,  102,  101,  100,   99,   98,   97,   96,   95,
-       94,   93,   92,   89,   88,   87,   86,   80,   78,   76,
-       75,   73,   72,   71,   67,   65,   64,   63,   61,   60,
-       59,   58,   57,   56,   54,   51,   48,   47,   46,   45,
-       44,   43,   41,   40,   39,   38,   37,   35,   34,   33,
-       32,   30,   23,   21,   20,   19,   16,   15,   13,   10,
-        5,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        3,    4,    7,    7,    3,    4,   10,   11,   11,   14,
+       17,   22,   17,   18,   14,   10,   22,   18,   27,   27,
+       29,   29,   18,   32,   32,   18,   37,   53,   53,   54,
+       54,   69,   82,   69,   82,   37,   86,   69,   91,   91,
+       86,  135,   86,   69,  116,  116,  132,  132,  137,  137,
+      137,  137,  137,  138,  134,  138,  139,  139,  139,  140,
+      131,  140,  140,  140,  128,  123,  121,  120,  115,  114,
+
+      113,  112,  111,  110,  109,  108,  107,  106,  105,  104,
+      103,  102,  101,  100,   99,   98,   97,   96,   95,   94,
+       93,   90,   89,   88,   87,   81,   79,   77,   76,   74,
+       73,   72,   68,   66,   65,   64,   62,   61,   60,   59,
+       58,   57,   55,   52,   49,   48,   47,   46,   45,   44,
+       42,   41,   40,   39,   38,   36,   35,   34,   33,   31,
+       23,   21,   20,   19,   16,   15,   13,    5,  136,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  136,  136,  136,  136
 
     } ;
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
 
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
  */
@@ -452,7 +535,6 @@ static char *yy_last_accepting_cpos;
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
 #line 1 "uscan.l"
-#define INITIAL 0
 /*
  * amanda, the advanced maryland automatic network disk archiver
  * Copyright (c) 1991-2000 University of Maryland at College Park
@@ -509,11 +591,56 @@ extern void       yyerror(char *s);
 extern int     yyparse(void);
 static int     ll_parse_date(int type, char *text);
 int            process_line(char *line);
-#define quotedpath 1
 
 #line 62 "uscan.l"
 static char *string_buf = NULL;
-#line 517 "uscan.c"
+#line 598 "uscan.c"
+
+#define INITIAL 0
+#define quotedpath 1
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -521,65 +648,30 @@ static char *string_buf = NULL;
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int yywrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
+extern int yywrap (void );
 #endif
 #endif
 
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
+    static void yyunput (int c,char *buf_ptr  );
+    
 #ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
 #endif
 
 #ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
 
+#ifdef __cplusplus
+static int yyinput (void );
 #else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
+static int input (void );
 #endif
 
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
 #endif
 
 /* Amount of stuff to slurp up with each read. */
@@ -588,7 +680,6 @@ YY_MALLOC_DECL
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
@@ -601,9 +692,10 @@ YY_MALLOC_DECL
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-       if ( yy_current_buffer->yy_is_interactive ) \
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
-               int c = '*', n; \
+               int c = '*'; \
+               size_t n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -613,9 +705,22 @@ YY_MALLOC_DECL
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
                result = n; \
                } \
-       else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-                 && ferror( yyin ) ) \
-               YY_FATAL_ERROR( "input in flex scanner failed" );
+       else \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }\
+\
+
 #endif
 
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -636,12 +741,18 @@ YY_MALLOC_DECL
 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
 
 /* Code executed at the beginning of each rule, after yytext and yyleng
  * have been set up.
@@ -658,12 +769,14 @@ YY_MALLOC_DECL
 #define YY_RULE_SETUP \
        YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-       {
+{
        register yy_state_type yy_current_state;
-       register char *yy_cp = NULL, *yy_bp = NULL;
+       register char *yy_cp, *yy_bp;
        register int yy_act;
-
+    
 #line 65 "uscan.l"
 
 
@@ -671,18 +784,18 @@ YY_DECL
     /* literal keyword tokens */
 
 
-#line 675 "uscan.c"
+#line 788 "uscan.c"
 
-       if ( yy_init )
+       if ( !(yy_init) )
                {
-               yy_init = 0;
+               (yy_init) = 1;
 
 #ifdef YY_USER_INIT
                YY_USER_INIT;
 #endif
 
-               if ( ! yy_start )
-                       yy_start = 1;   /* first start state */
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
 
                if ( ! yyin )
                        yyin = stdin;
@@ -690,68 +803,68 @@ YY_DECL
                if ( ! yyout )
                        yyout = stdout;
 
-               if ( ! yy_current_buffer )
-                       yy_current_buffer =
-                               yy_create_buffer( yyin, YY_BUF_SIZE );
+               if ( ! YY_CURRENT_BUFFER ) {
+                       yyensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               yy_create_buffer(yyin,YY_BUF_SIZE );
+               }
 
-               yy_load_buffer_state();
+               yy_load_buffer_state( );
                }
 
        while ( 1 )             /* loops until end-of-file is reached */
                {
-               yy_cp = yy_c_buf_p;
+               yy_cp = (yy_c_buf_p);
 
                /* Support of yytext. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
 
                /* yy_bp points to the position in yy_ch_buf of the start of
                 * the current run.
                 */
                yy_bp = yy_cp;
 
-               yy_current_state = yy_start;
+               yy_current_state = (yy_start);
 yy_match:
                do
                        {
                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
                        if ( yy_accept[yy_current_state] )
                                {
-                               yy_last_accepting_state = yy_current_state;
-                               yy_last_accepting_cpos = yy_cp;
+                               (yy_last_accepting_state) = yy_current_state;
+                               (yy_last_accepting_cpos) = yy_cp;
                                }
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 131 )
+                               if ( yy_current_state >= 137 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 162 );
+               while ( yy_base[yy_current_state] != 169 );
 
 yy_find_action:
                yy_act = yy_accept[yy_current_state];
                if ( yy_act == 0 )
                        { /* have to back up */
-                       yy_cp = yy_last_accepting_cpos;
-                       yy_current_state = yy_last_accepting_state;
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
                        yy_act = yy_accept[yy_current_state];
                        }
 
                YY_DO_BEFORE_ACTION;
 
-
 do_action:     /* This label is used only to access EOF actions. */
 
-
                switch ( yy_act )
        { /* beginning of action switch */
                        case 0: /* must back up */
                        /* undo the effects of YY_DO_BEFORE_ACTION */
-                       *yy_cp = yy_hold_char;
-                       yy_cp = yy_last_accepting_cpos;
-                       yy_current_state = yy_last_accepting_state;
+                       *yy_cp = (yy_hold_char);
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
                        goto yy_find_action;
 
 case 1:
@@ -792,168 +905,179 @@ YY_RULE_SETUP
 case 8:
 YY_RULE_SETUP
 #line 78 "uscan.l"
-{ return CD; }
+{ return SETDEVICE; }
        YY_BREAK
 case 9:
 YY_RULE_SETUP
 #line 79 "uscan.l"
-{ return CDX; }
+{ return DASH_H; }
        YY_BREAK
 case 10:
 YY_RULE_SETUP
 #line 80 "uscan.l"
-{ return QUIT; }
+{ return CD; }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
 #line 81 "uscan.l"
-{ return QUIT; }
+{ return CDX; }
        YY_BREAK
 case 12:
 YY_RULE_SETUP
 #line 82 "uscan.l"
-{ return DHIST; }
+{ return QUIT; }
        YY_BREAK
 case 13:
 YY_RULE_SETUP
 #line 83 "uscan.l"
-{ return LS; }
+{ return QUIT; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
 #line 84 "uscan.l"
-{ return ADD; }
+{ return DHIST; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
 #line 85 "uscan.l"
-{ return ADDX; }
+{ return LS; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 86 "uscan.l"
-{ return LIST; }
+{ return ADD; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
 #line 87 "uscan.l"
-{ return DELETE; }
+{ return ADDX; }
        YY_BREAK
 case 18:
 YY_RULE_SETUP
 #line 88 "uscan.l"
-{ return DELETEX; }
+{ return LIST; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
 #line 89 "uscan.l"
-{ return PWD; }
+{ return DELETE; }
        YY_BREAK
 case 20:
 YY_RULE_SETUP
 #line 90 "uscan.l"
-{ return CLEAR; }
+{ return DELETEX; }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
 #line 91 "uscan.l"
-{ return HELP; }
+{ return PWD; }
        YY_BREAK
 case 22:
 YY_RULE_SETUP
 #line 92 "uscan.l"
-{ return HELP; }
+{ return CLEAR; }
        YY_BREAK
 case 23:
 YY_RULE_SETUP
 #line 93 "uscan.l"
-{ return LCD; }
+{ return HELP; }
        YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 94 "uscan.l"
-{ return LPWD; }
+{ return HELP; }
        YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 95 "uscan.l"
-{ return EXTRACT; }
+{ return LCD; }
        YY_BREAK
 case 26:
 YY_RULE_SETUP
 #line 96 "uscan.l"
-{ return SMB; }
+{ return LPWD; }
        YY_BREAK
 case 27:
 YY_RULE_SETUP
 #line 97 "uscan.l"
-{ return TAR; }
+{ return EXTRACT; }
        YY_BREAK
 case 28:
 YY_RULE_SETUP
 #line 98 "uscan.l"
-{ return MODE; }
+{ return SMB; }
        YY_BREAK
-
-    /* dates */
-
 case 29:
 YY_RULE_SETUP
-#line 104 "uscan.l"
-{ return ll_parse_date(1, yytext); }
+#line 99 "uscan.l"
+{ return TAR; }
        YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 105 "uscan.l"
-{ return ll_parse_date(2, yytext); }
+#line 100 "uscan.l"
+{ return MODE; }
        YY_BREAK
+
+    /* dates */
+
 case 31:
 YY_RULE_SETUP
 #line 106 "uscan.l"
-{ return ll_parse_date(3, yytext); }
+{ return ll_parse_date(1, yytext); }
        YY_BREAK
 case 32:
 YY_RULE_SETUP
 #line 107 "uscan.l"
-{ return ll_parse_date(4, yytext); }
+{ return ll_parse_date(2, yytext); }
        YY_BREAK
 case 33:
 YY_RULE_SETUP
 #line 108 "uscan.l"
+{ return ll_parse_date(3, yytext); }
+       YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 109 "uscan.l"
+{ return ll_parse_date(4, yytext); }
+       YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 110 "uscan.l"
 { return ll_parse_date(5, yytext); }
        YY_BREAK
 
     /* quoted file names */
 
-case 34:
+case 36:
 YY_RULE_SETUP
-#line 114 "uscan.l"
+#line 116 "uscan.l"
 {
     if(string_buf != NULL) {
-       printf("ERROR:string_buf != NULL: %s\n",string_buf);
+       g_printf("ERROR:string_buf != NULL: %s\n",string_buf);
     }
     BEGIN(quotedpath);
     strappend(string_buf, yytext);
 }
        YY_BREAK
-case 35:
+case 37:
+/* rule 37 can match eol */
 YY_RULE_SETUP
-#line 122 "uscan.l"
+#line 124 "uscan.l"
 {
     strappend(string_buf, yytext);
 }
        YY_BREAK
-case 36:
+case 38:
 YY_RULE_SETUP
-#line 126 "uscan.l"
+#line 128 "uscan.l"
 {
     /* escaped character (including quote) */
     strappend(string_buf, yytext);
 }
        YY_BREAK
-case 37:
+case 39:
 YY_RULE_SETUP
-#line 131 "uscan.l"
+#line 133 "uscan.l"
 { /* saw closing quote - all done */
     strappend(string_buf, yytext);
     yylval.strval = string_buf;
@@ -965,9 +1089,9 @@ YY_RULE_SETUP
 
     /* file names */
 
-case 38:
+case 40:
 YY_RULE_SETUP
-#line 143 "uscan.l"
+#line 145 "uscan.l"
 {
     yylval.strval = stralloc(yytext);
     return PATH;
@@ -976,9 +1100,10 @@ YY_RULE_SETUP
 
     /* whitespace */
 
-case 39:
+case 41:
+/* rule 41 can match eol */
 YY_RULE_SETUP
-#line 152 "uscan.l"
+#line 154 "uscan.l"
 ;     /* whitespace */
        YY_BREAK
 
@@ -990,12 +1115,12 @@ YY_RULE_SETUP
 .      { yyerror("invalid character"); }
 #endif
 
-case 40:
+case 42:
 YY_RULE_SETUP
-#line 165 "uscan.l"
+#line 167 "uscan.l"
 ECHO;
        YY_BREAK
-#line 999 "uscan.c"
+#line 1124 "uscan.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(quotedpath):
        yyterminate();
@@ -1003,26 +1128,26 @@ case YY_STATE_EOF(quotedpath):
        case YY_END_OF_BUFFER:
                {
                /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
                YY_RESTORE_YY_MORE_OFFSET
 
-               if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
                        {
                        /* We're scanning a new file or input source.  It's
                         * possible that this happened because the user
                         * just pointed yyin at a new source and called
                         * yylex().  If so, then we have to assure
-                        * consistency between yy_current_buffer and our
+                        * consistency between YY_CURRENT_BUFFER and our
                         * globals.  Here is the right place to do so, because
                         * this is the first action (other than possibly a
                         * back-up) that will match for the new input source.
                         */
-                       yy_n_chars = yy_current_buffer->yy_n_chars;
-                       yy_current_buffer->yy_input_file = yyin;
-                       yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
                        }
 
                /* Note that here we test for yy_c_buf_p "<=" to the position
@@ -1032,13 +1157,13 @@ case YY_STATE_EOF(quotedpath):
                 * end-of-buffer state).  Contrast this with the test
                 * in input().
                 */
-               if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        { /* This was really a NUL. */
                        yy_state_type yy_next_state;
 
-                       yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
-                       yy_current_state = yy_get_previous_state();
+                       yy_current_state = yy_get_previous_state(  );
 
                        /* Okay, we're now positioned to make the NUL
                         * transition.  We couldn't have
@@ -1051,30 +1176,30 @@ case YY_STATE_EOF(quotedpath):
 
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-                       yy_bp = yytext_ptr + YY_MORE_ADJ;
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
                        if ( yy_next_state )
                                {
                                /* Consume the NUL. */
-                               yy_cp = ++yy_c_buf_p;
+                               yy_cp = ++(yy_c_buf_p);
                                yy_current_state = yy_next_state;
                                goto yy_match;
                                }
 
                        else
                                {
-                               yy_cp = yy_c_buf_p;
+                               yy_cp = (yy_c_buf_p);
                                goto yy_find_action;
                                }
                        }
 
-               else switch ( yy_get_next_buffer() )
+               else switch ( yy_get_next_buffer(  ) )
                        {
                        case EOB_ACT_END_OF_FILE:
                                {
-                               yy_did_buffer_switch_on_eof = 0;
+                               (yy_did_buffer_switch_on_eof) = 0;
 
-                               if ( yywrap() )
+                               if ( yywrap( ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
@@ -1085,7 +1210,7 @@ case YY_STATE_EOF(quotedpath):
                                         * YY_NULL, it'll still work - another
                                         * YY_NULL will get returned.
                                         */
-                                       yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
                                        yy_act = YY_STATE_EOF(YY_START);
                                        goto do_action;
@@ -1093,30 +1218,30 @@ case YY_STATE_EOF(quotedpath):
 
                                else
                                        {
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
                                        }
                                break;
                                }
 
                        case EOB_ACT_CONTINUE_SCAN:
-                               yy_c_buf_p =
-                                       yytext_ptr + yy_amount_of_matched_text;
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_match;
 
                        case EOB_ACT_LAST_MATCH:
-                               yy_c_buf_p =
-                               &yy_current_buffer->yy_ch_buf[yy_n_chars];
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_find_action;
                        }
                break;
@@ -1127,8 +1252,7 @@ case YY_STATE_EOF(quotedpath):
                        "fatal flex scanner internal error--no action found" );
        } /* end of action switch */
                } /* end of scanning one token */
-       } /* end of yylex */
-
+} /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -1137,21 +1261,20 @@ case YY_STATE_EOF(quotedpath):
  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  *     EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-       {
-       register char *dest = yy_current_buffer->yy_ch_buf;
-       register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       register char *source = (yytext_ptr);
        register int number_to_move, i;
        int ret_val;
 
-       if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
                YY_FATAL_ERROR(
                "fatal flex scanner internal error--end of buffer missed" );
 
-       if ( yy_current_buffer->yy_fill_buffer == 0 )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
                { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
                        {
                        /* We matched a single character, the EOB, so
                         * treat this as a final EOF.
@@ -1171,34 +1294,30 @@ static int yy_get_next_buffer()
        /* Try to read more data. */
 
        /* First move last chars to start of buffer. */
-       number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
        for ( i = 0; i < number_to_move; ++i )
                *(dest++) = *(source++);
 
-       if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
                /* don't do the read, it's not guaranteed to return an EOF,
                 * just force an EOF
                 */
-               yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
        else
                {
-               int num_to_read =
-                       yy_current_buffer->yy_buf_size - number_to_move - 1;
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
                        { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-                       YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
 
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = yy_current_buffer;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
                        int yy_c_buf_p_offset =
-                               (int) (yy_c_buf_p - b->yy_ch_buf);
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
 
                        if ( b->yy_is_our_buffer )
                                {
@@ -1211,8 +1330,7 @@ static int yy_get_next_buffer()
 
                                b->yy_ch_buf = (char *)
                                        /* Include room in for 2 EOB chars. */
-                                       yy_flex_realloc( (void *) b->yy_ch_buf,
-                                                        b->yy_buf_size + 2 );
+                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
                                }
                        else
                                /* Can't grow it, we don't own it. */
@@ -1222,35 +1340,35 @@ static int yy_get_next_buffer()
                                YY_FATAL_ERROR(
                                "fatal error - scanner input buffer overflow" );
 
-                       yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
 
-                       num_to_read = yy_current_buffer->yy_buf_size -
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
                                                number_to_move - 1;
-#endif
+
                        }
 
                if ( num_to_read > YY_READ_BUF_SIZE )
                        num_to_read = YY_READ_BUF_SIZE;
 
                /* Read in more data. */
-               YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-                       yy_n_chars, num_to_read );
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), num_to_read );
 
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       if ( yy_n_chars == 0 )
+       if ( (yy_n_chars) == 0 )
                {
                if ( number_to_move == YY_MORE_ADJ )
                        {
                        ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart( yyin );
+                       yyrestart(yyin  );
                        }
 
                else
                        {
                        ret_val = EOB_ACT_LAST_MATCH;
-                       yy_current_buffer->yy_buffer_status =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
                                YY_BUFFER_EOF_PENDING;
                        }
                }
@@ -1258,153 +1376,137 @@ static int yy_get_next_buffer()
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
-       yy_n_chars += number_to_move;
-       yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-       yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
-       yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
        return ret_val;
-       }
-
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-       {
+    static yy_state_type yy_get_previous_state (void)
+{
        register yy_state_type yy_current_state;
        register char *yy_cp;
+    
+       yy_current_state = (yy_start);
 
-       yy_current_state = yy_start;
-
-       for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
                {
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
                if ( yy_accept[yy_current_state] )
                        {
-                       yy_last_accepting_state = yy_current_state;
-                       yy_last_accepting_cpos = yy_cp;
+                       (yy_last_accepting_state) = yy_current_state;
+                       (yy_last_accepting_cpos) = yy_cp;
                        }
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 131 )
+                       if ( yy_current_state >= 137 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
                }
 
        return yy_current_state;
-       }
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
  *     next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-       {
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
        register int yy_is_jam;
-       register char *yy_cp = yy_c_buf_p;
+       register char *yy_cp = (yy_c_buf_p);
 
        register YY_CHAR yy_c = 1;
        if ( yy_accept[yy_current_state] )
                {
-               yy_last_accepting_state = yy_current_state;
-               yy_last_accepting_cpos = yy_cp;
+               (yy_last_accepting_state) = yy_current_state;
+               (yy_last_accepting_cpos) = yy_cp;
                }
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 131 )
+               if ( yy_current_state >= 137 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 130);
+       yy_is_jam = (yy_current_state == 136);
 
        return yy_is_jam ? 0 : yy_current_state;
-       }
-
+}
 
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-       {
-       register char *yy_cp = yy_c_buf_p;
+    static void yyunput (int c, register char * yy_bp )
+{
+       register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
 
        /* undo effects of setting up yytext */
-       *yy_cp = yy_hold_char;
+       *yy_cp = (yy_hold_char);
 
-       if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               register int number_to_move = yy_n_chars + 2;
-               register char *dest = &yy_current_buffer->yy_ch_buf[
-                                       yy_current_buffer->yy_buf_size + 2];
+               register int number_to_move = (yy_n_chars) + 2;
+               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                register char *source =
-                               &yy_current_buffer->yy_ch_buf[number_to_move];
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
 
-               while ( source > yy_current_buffer->yy_ch_buf )
+               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
                        *--dest = *--source;
 
                yy_cp += (int) (dest - source);
                yy_bp += (int) (dest - source);
-               yy_current_buffer->yy_n_chars =
-                       yy_n_chars = yy_current_buffer->yy_buf_size;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
-               if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
                }
 
        *--yy_cp = (char) c;
 
-
-       yytext_ptr = yy_bp;
-       yy_hold_char = *yy_cp;
-       yy_c_buf_p = yy_cp;
-       }
-#endif /* ifndef YY_NO_UNPUT */
-
+       (yytext_ptr) = yy_bp;
+       (yy_hold_char) = *yy_cp;
+       (yy_c_buf_p) = yy_cp;
+}
 
 #ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
+    static int input  (void)
 #endif
-       {
-       int c;
 
-       *yy_c_buf_p = yy_hold_char;
+{
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
 
-       if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
                {
                /* yy_c_buf_p now points to the character we want to return.
                 * If this occurs *before* the EOB characters, then it's a
                 * valid NUL; if not, then we've hit the end of the buffer.
                 */
-               if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        /* This was really a NUL. */
-                       *yy_c_buf_p = '\0';
+                       *(yy_c_buf_p) = '\0';
 
                else
                        { /* need more input */
-                       int offset = yy_c_buf_p - yytext_ptr;
-                       ++yy_c_buf_p;
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
 
-                       switch ( yy_get_next_buffer() )
+                       switch ( yy_get_next_buffer(  ) )
                                {
                                case EOB_ACT_LAST_MATCH:
                                        /* This happens because yy_g_n_b()
@@ -1418,16 +1520,16 @@ static int input()
                                         */
 
                                        /* Reset buffer status. */
-                                       yyrestart( yyin );
+                                       yyrestart(yyin );
 
-                                       /* fall through */
+                                       /*FALLTHROUGH*/
 
                                case EOB_ACT_END_OF_FILE:
                                        {
-                                       if ( yywrap() )
+                                       if ( yywrap( ) )
                                                return EOF;
 
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
 #ifdef __cplusplus
                                        return yyinput();
@@ -1437,90 +1539,92 @@ static int input()
                                        }
 
                                case EOB_ACT_CONTINUE_SCAN:
-                                       yy_c_buf_p = yytext_ptr + offset;
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
                                        break;
                                }
                        }
                }
 
-       c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
-       *yy_c_buf_p = '\0';     /* preserve yytext */
-       yy_hold_char = *++yy_c_buf_p;
-
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve yytext */
+       (yy_hold_char) = *++(yy_c_buf_p);
 
        return c;
-       }
-#endif /* YY_NO_INPUT */
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-       {
-       if ( ! yy_current_buffer )
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
 
-       yy_init_buffer( yy_current_buffer, input_file );
-       yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
        }
 
+       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+       yy_load_buffer_state( );
+}
 
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-       {
-       if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              yypop_buffer_state();
+        *              yypush_buffer_state(new_buffer);
+     */
+       yyensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
                return;
 
-       if ( yy_current_buffer )
+       if ( YY_CURRENT_BUFFER )
                {
                /* Flush out information for old buffer. */
-               *yy_c_buf_p = yy_hold_char;
-               yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       yy_current_buffer = new_buffer;
-       yy_load_buffer_state();
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       yy_load_buffer_state( );
 
        /* We don't actually know whether we did this switch during
         * EOF (yywrap()) processing, but the only time this flag
         * is looked at is after yywrap() is called, so it's safe
         * to go ahead and always set it.
         */
-       yy_did_buffer_switch_on_eof = 1;
-       }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-       {
-       yy_n_chars = yy_current_buffer->yy_n_chars;
-       yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-       yyin = yy_current_buffer->yy_input_file;
-       yy_hold_char = *yy_c_buf_p;
-       }
+       (yy_did_buffer_switch_on_eof) = 1;
+}
 
+static void yy_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
 
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-       {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
        YY_BUFFER_STATE b;
-
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
@@ -1529,75 +1633,75 @@ int size;
        /* yy_ch_buf has to be 2 characters longer than the size given because
         * we need to put in 2 end-of-buffer characters.
         */
-       b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
        if ( ! b->yy_ch_buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
        b->yy_is_our_buffer = 1;
 
-       yy_init_buffer( b, file );
+       yy_init_buffer(b,file );
 
        return b;
-       }
-
+}
 
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-       {
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
        if ( ! b )
                return;
 
-       if ( b == yy_current_buffer )
-               yy_current_buffer = (YY_BUFFER_STATE) 0;
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
        if ( b->yy_is_our_buffer )
-               yy_flex_free( (void *) b->yy_ch_buf );
-
-       yy_flex_free( (void *) b );
-       }
+               yyfree((void *) b->yy_ch_buf  );
 
+       yyfree((void *) b  );
+}
 
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-       {
-       yy_flush_buffer( b );
+{
+       int oerrno = errno;
+    
+       yy_flush_buffer(b );
 
        b->yy_input_file = file;
        b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-       b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-       b->yy_is_interactive = 0;
-#else
-       b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-       }
-
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
 
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+       errno = oerrno;
+}
 
-       {
-       if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
+       if ( ! b )
                return;
 
        b->yy_n_chars = 0;
@@ -1614,29 +1718,121 @@ YY_BUFFER_STATE b;
        b->yy_at_bol = 1;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       if ( b == yy_current_buffer )
-               yy_load_buffer_state();
+       if ( b == YY_CURRENT_BUFFER )
+               yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       yyensure_buffer_stack();
+
+       /* This block is copied from yy_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from yy_switch_to_buffer. */
+       yy_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       yy_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               yy_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
        }
 
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
 
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-       {
-       YY_BUFFER_STATE b;
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
 
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
+       YY_BUFFER_STATE b;
+    
        if ( size < 2 ||
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
             base[size-1] != YY_END_OF_BUFFER_CHAR )
                /* They forgot to leave room for the EOB's. */
                return 0;
 
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
@@ -1650,56 +1846,51 @@ yy_size_t size;
        b->yy_fill_buffer = 0;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       yy_switch_to_buffer( b );
+       yy_switch_to_buffer( );
 
        return b;
-       }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-       {
-       int len;
-       for ( len = 0; yy_str[len]; ++len )
-               ;
-
-       return yy_scan_bytes( yy_str, len );
-       }
-#endif
+}
 
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+       return yy_scan_bytes(yystr,strlen(yystr) );
+}
 
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-       {
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
        YY_BUFFER_STATE b;
        char *buf;
        yy_size_t n;
        int i;
-
+    
        /* Get memory for full buffer, including space for trailing EOB's. */
-       n = len + 2;
-       buf = (char *) yy_flex_alloc( n );
+       n = _yybytes_len + 2;
+       buf = (char *) yyalloc(n  );
        if ( ! buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
-       for ( i = 0; i < len; ++i )
-               buf[i] = bytes[i];
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
 
-       buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = yy_scan_buffer( buf, n );
+       b = yy_scan_buffer(buf,n );
        if ( ! b )
                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
@@ -1709,148 +1900,196 @@ int len;
        b->yy_is_our_buffer = 1;
 
        return b;
-       }
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
 #endif
 
+static void yy_fatal_error (yyconst char* msg )
+{
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+}
 
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-       {
-       if ( yy_start_stack_ptr >= yy_start_stack_depth )
-               {
-               yy_size_t new_size;
+/* Redefine yyless() so it works in section 3 code. */
 
-               yy_start_stack_depth += YY_START_STACK_INCR;
-               new_size = yy_start_stack_depth * sizeof( int );
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               yytext[yyleng] = (yy_hold_char); \
+               (yy_c_buf_p) = yytext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               yyleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
 
-               if ( ! yy_start_stack )
-                       yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Accessor  methods (get/set functions) to struct members. */
 
-               else
-                       yy_start_stack = (int *) yy_flex_realloc(
-                                       (void *) yy_start_stack, new_size );
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
 
-               if ( ! yy_start_stack )
-                       YY_FATAL_ERROR(
-                       "out of memory expanding start-condition stack" );
-               }
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
 
-       yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
 
-       BEGIN(new_state);
-       }
-#endif
+/** Get the length of the current token.
+ * 
+ */
+int yyget_leng  (void)
+{
+        return yyleng;
+}
 
+/** Get the current token.
+ * 
+ */
 
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-       {
-       if ( --yy_start_stack_ptr < 0 )
-               YY_FATAL_ERROR( "start-condition stack underflow" );
+char *yyget_text  (void)
+{
+        return yytext;
+}
 
-       BEGIN(yy_start_stack[yy_start_stack_ptr]);
-       }
-#endif
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
 
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
 
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-       {
-       return yy_start_stack[yy_start_stack_ptr - 1];
-       }
-#endif
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
 
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
 #else
-static void yy_fatal_error( msg )
-char msg[];
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
 #endif
-       {
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-       }
 
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
 
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               yy_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               yypop_buffer_state();
+       }
 
-/* Redefine yyless() so it works in section 3 code. */
+       /* Destroy the stack itself. */
+       yyfree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
 
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-               yytext[yyleng] = yy_hold_char; \
-               yy_c_buf_p = yytext + n; \
-               yy_hold_char = *yy_c_buf_p; \
-               *yy_c_buf_p = '\0'; \
-               yyleng = n; \
-               } \
-       while ( 0 )
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
 
+    return 0;
+}
 
-/* Internal utility routines. */
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-       {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
        register int i;
        for ( i = 0; i < n; ++i )
                s1[i] = s2[i];
-       }
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-       {
+static int yy_flex_strlen (yyconst char * s )
+{
        register int n;
        for ( n = 0; s[n]; ++n )
                ;
 
        return n;
-       }
+}
 #endif
 
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-       {
+void *yyalloc (yy_size_t  size )
+{
        return (void *) malloc( size );
-       }
+}
 
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-       {
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
        /* The cast to (char *) in the following accommodates both
         * implementations that use char* generic pointers, and those
         * that use void* generic pointers.  It works with the latter
@@ -1859,26 +2098,17 @@ yy_size_t size;
         * as though doing an assignment.
         */
        return (void *) realloc( (char *) ptr, size );
-       }
+}
 
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-       {
-       free( ptr );
-       }
+void yyfree (void * ptr )
+{
+       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 167 "uscan.l"
 
-#if YY_MAIN
-int main()
-       {
-       yylex();
-       return 0;
-       }
-#endif
-#line 165 "uscan.l"
 
 
 int
@@ -1959,11 +2189,11 @@ ll_parse_date(
        yyerror("invalid second");
     } else if(type < 4) {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
        ret = DATE;
     } else {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
        ret = DATE;
     }
     return ret;
@@ -1975,3 +2205,4 @@ yywrap(void)
   return 1;
 }
 
+
index fbd97a2c92bda2724a53e3cb4a7950c586be18f8..8c86297cb631fd75c0116866d493620083cec884 100644 (file)
@@ -75,6 +75,8 @@ setdisk               { return SETDISK; }
 setdate                { return SETDATE; }
 setmode                { return SETMODE; }
 settape                { return SETTAPE; }
+setdevice      { return SETDEVICE; }
+-h             { return DASH_H; }
 cd             { return CD; }
 cdx            { return CDX; }
 quit           { return QUIT; }
@@ -113,7 +115,7 @@ mode                { return MODE; }
 
 \"                     {
     if(string_buf != NULL) {
-       printf("ERROR:string_buf != NULL: %s\n",string_buf);
+       g_printf("ERROR:string_buf != NULL: %s\n",string_buf);
     }
     BEGIN(quotedpath);
     strappend(string_buf, yytext);
@@ -242,11 +244,11 @@ ll_parse_date(
        yyerror("invalid second");
     } else if(type < 4) {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d", y, m, d);
        ret = DATE;
     } else {
        yylval.strval = alloc(DATE_ALLOC_SIZE);
-       snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
+       g_snprintf(yylval.strval, DATE_ALLOC_SIZE, "%04d-%02d-%02d-%02d-%02d-%02d", y, m, d, h, mi, s);
        ret = DATE;
     }
     return ret;
index f12bdbf199d67eadec270bb1745e33256b8858f5..fa14e255f8c95bd6e662449e034079ae600b8c6c 100644 (file)
@@ -1,21 +1,27 @@
 # Makefile for Amanda restore programs.
 
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/tape-src     \
+               -I$(top_srcdir)/device-src   \
                -I$(top_srcdir)/server-src   \
                -I$(top_srcdir)/amandad-src  \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
 
-lib_LTLIBRARIES =      librestore.la
+amlib_LTLIBRARIES =    librestore.la
 LIB_EXTENSION = la
 
 sbin_PROGRAMS =        amrestore amfetchdump
 
-libexec_PROGRAMS =     amidxtaped
+amlibexec_PROGRAMS =   amidxtaped
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -40,31 +46,17 @@ amfetchdump_SOURCES =       amfetchdump.c
 librestore_la_SOURCES  =       restore.c
 librestore_la_LDFLAGS  =       -release $(VERSION)
 librestore_la_LIBADD   =       ../common-src/libamanda.$(LIB_EXTENSION) \
-                   ../tape-src/libamtape.$(LIB_EXTENSION) \
-                  ../server-src/libamserver.$(LIB_EXTENSION)
+                               ../server-src/libamserver.$(LIB_EXTENSION) \
+                               ../device-src/libamdevice.$(LIB_EXTENSION)
 
 noinst_HEADERS = restore.h
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) \
+       dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS)
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do                     \
+       @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
                f="$$p.c $(librestore_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
@@ -73,7 +65,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index ec68cbebf5e61d8d893bb3717487d134766dcb16..ded5beb93bdf57d71d21844b583fdde11e799493 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda restore programs.
 
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -41,49 +78,119 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am
 sbin_PROGRAMS = amrestore$(EXEEXT) amfetchdump$(EXEEXT)
-libexec_PROGRAMS = amidxtaped$(EXEEXT)
+amlibexec_PROGRAMS = amidxtaped$(EXEEXT)
 subdir = restore-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -95,18 +202,21 @@ am__vpath_adj = case $$p in \
     *) f=$$p;; \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
        "$(DESTDIR)$(sbindir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
 librestore_la_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../server-src/libamserver.$(LIB_EXTENSION)
+       ../server-src/libamserver.$(LIB_EXTENSION) \
+       ../device-src/libamdevice.$(LIB_EXTENSION)
 am_librestore_la_OBJECTS = restore.lo
 librestore_la_OBJECTS = $(am_librestore_la_OBJECTS)
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+librestore_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(librestore_la_LDFLAGS) $(LDFLAGS) -o $@
+amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+PROGRAMS = $(amlibexec_PROGRAMS) $(sbin_PROGRAMS)
 am_amfetchdump_OBJECTS = amfetchdump.$(OBJEXT)
 amfetchdump_OBJECTS = $(am_amfetchdump_OBJECTS)
 amfetchdump_LDADD = $(LDADD)
@@ -128,17 +238,18 @@ amrestore_LDADD = $(LDADD)
 amrestore_DEPENDENCIES = librestore.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(librestore_la_SOURCES) $(amfetchdump_SOURCES) \
        $(amidxtaped_SOURCES) amrestore.c
 DIST_SOURCES = $(librestore_la_SOURCES) $(amfetchdump_SOURCES) \
@@ -147,15 +258,14 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -163,14 +273,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -181,20 +296,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -208,60 +322,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -271,10 +494,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -285,24 +522,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -314,59 +585,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -375,35 +633,48 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/tape-src     \
+               -I$(top_srcdir)/device-src   \
                -I$(top_srcdir)/server-src   \
                -I$(top_srcdir)/amandad-src  \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
-lib_LTLIBRARIES = librestore.la
+amlib_LTLIBRARIES = librestore.la
 LIB_EXTENSION = la
 
 ###
@@ -426,15 +697,19 @@ amfetchdump_SOURCES = amfetchdump.c
 librestore_la_SOURCES = restore.c
 librestore_la_LDFLAGS = -release $(VERSION)
 librestore_la_LIBADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-                   ../tape-src/libamtape.$(LIB_EXTENSION) \
-                  ../server-src/libamserver.$(LIB_EXTENSION)
+                               ../server-src/libamserver.$(LIB_EXTENSION) \
+                               ../device-src/libamdevice.$(LIB_EXTENSION)
 
 noinst_HEADERS = restore.h
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) \
+       dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS)
+
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -463,66 +738,66 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 librestore.la: $(librestore_la_OBJECTS) $(librestore_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(librestore_la_LDFLAGS) $(librestore_la_OBJECTS) $(librestore_la_LIBADD) $(LIBS)
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
+       $(librestore_la_LINK) -rpath $(amlibdir) $(librestore_la_OBJECTS) $(librestore_la_LIBADD) $(LIBS)
+install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
             || test -f $$p1 \
          ; then \
            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \
          else :; fi; \
        done
 
-uninstall-libexecPROGRAMS:
+uninstall-amlibexecPROGRAMS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
-clean-libexecPROGRAMS:
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+clean-amlibexecPROGRAMS:
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          echo " rm -f $$p $$f"; \
          rm -f $$p $$f ; \
        done
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
@@ -550,13 +825,13 @@ clean-sbinPROGRAMS:
        done
 amfetchdump$(EXEEXT): $(amfetchdump_OBJECTS) $(amfetchdump_DEPENDENCIES) 
        @rm -f amfetchdump$(EXEEXT)
-       $(LINK) $(amfetchdump_LDFLAGS) $(amfetchdump_OBJECTS) $(amfetchdump_LDADD) $(LIBS)
+       $(LINK) $(amfetchdump_OBJECTS) $(amfetchdump_LDADD) $(LIBS)
 amidxtaped$(EXEEXT): $(amidxtaped_OBJECTS) $(amidxtaped_DEPENDENCIES) 
        @rm -f amidxtaped$(EXEEXT)
-       $(LINK) $(amidxtaped_LDFLAGS) $(amidxtaped_OBJECTS) $(amidxtaped_LDADD) $(LIBS)
+       $(LINK) $(amidxtaped_OBJECTS) $(amidxtaped_LDADD) $(LIBS)
 amrestore$(EXEEXT): $(amrestore_OBJECTS) $(amrestore_DEPENDENCIES) 
        @rm -f amrestore$(EXEEXT)
-       $(LINK) $(amrestore_LDFLAGS) $(amrestore_OBJECTS) $(amrestore_LDADD) $(LIBS)
+       $(LINK) $(amrestore_OBJECTS) $(amrestore_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -570,22 +845,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restore.Plo@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -596,10 +871,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -649,22 +920,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -679,8 +949,8 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -706,16 +976,18 @@ distclean-generic:
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
+clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS 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-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -727,17 +999,26 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
-install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS \
-       install-sbinPROGRAMS
+install-exec-am: install-amlibexecPROGRAMS install-sbinPROGRAMS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -758,46 +1039,89 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool \
-       clean-sbinPROGRAMS ctags distclean distclean-compile \
-       distclean-generic distclean-libtool distclean-tags distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-exec install-exec-am \
-       install-exec-hook install-info install-info-am \
-       install-libLTLIBRARIES install-libexecPROGRAMS install-man \
-       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 uninstall uninstall-am uninstall-info-am \
-       uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS \
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
+       uninstall-sbinPROGRAMS
+
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+       clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
+       clean-libtool clean-sbinPROGRAMS ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       install install-am install-amlibLTLIBRARIES \
+       install-amlibexecPROGRAMS install-data install-data-am \
+       install-data-hook install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook 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 uninstall uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        uninstall-sbinPROGRAMS
 
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do                     \
+       @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
                f="$$p.c $(librestore_la_SOURCES)";                             \
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
@@ -806,7 +1130,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index 2253b60a92003d90c2047d9296535967ad888e59..d33d56d132cac6e0dc72ea66c6c0d42c17db0fb4 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 #include "amanda.h"
-#include "tapeio.h"
 #include "fileheader.h"
 #include "util.h"
 #include "restore.h"
@@ -39,6 +38,7 @@
 #include "find.h"
 #include "changer.h"
 #include "logfile.h"
+#include "cmdline.h"
 
 #define CREAT_MODE     0640
 
@@ -56,8 +56,7 @@ typedef struct needed_tapes_s {
 
 /* local functions */
 
-void errexit(void);
-tapelist_t *list_needed_tapes(match_list_t *match_list);
+tapelist_t *list_needed_tapes(GSList *dumpspecs);
 void usage(void);
 int main(int argc, char **argv);
 
@@ -66,17 +65,6 @@ static pid_t parent_pid = -1;
 static void cleanup(void);
 
 
-/*
- * Do exit(2) after an error, rather than exit(1).
- */
-
-void
-errexit(void)
-{
-    exit(2);
-}
-
-
 /*
  * Print usage message and terminate.
  */
@@ -84,22 +72,22 @@ errexit(void)
 void
 usage(void)
 {
-    fprintf(stderr, "Usage: amfetchdump [options] config hostname [diskname [datestamp [level [hostname [diskname [datestamp [level ... ]]]]]]] [-o configoption]*\n\n");
-    fprintf(stderr, "Goes and grabs a dump from tape, moving tapes around and assembling parts as\n");
-    fprintf(stderr, "necessary.  Files are restored to the current directory, unless otherwise\nspecified.\n\n");
-    fprintf(stderr, "  -p Pipe exactly *one* complete dumpfile to stdout, instead of to disk.\n");
-    fprintf(stderr, "  -O <output dir> Restore files to this directory.\n");
-    fprintf(stderr, "  -d <device> Force restoration from a particular tape device.\n");
-    fprintf(stderr, "  -c Compress output, fastest method available.\n");
-    fprintf(stderr, "  -C Compress output, best filesize method available.\n");
-    fprintf(stderr, "  -l Leave dumps (un)compressed, whichever way they were originally on tape.\n");
-    fprintf(stderr, "  -a Assume all tapes are available via changer, do not prompt for initial load.\n");
-    fprintf(stderr, "  -i <dst_file> Search through tapes and write out an inventory while we\n     restore.  Useful only if normal logs are unavailable.\n");
-    fprintf(stderr, "  -w Wait to put split dumps together until all chunks have been restored.\n");
-    fprintf(stderr, "  -n Do not reassemble split dumpfiles.\n");
-    fprintf(stderr, "  -k Skip the rewind/label read when reading a new tape.\n");
-    fprintf(stderr, "  -s Do not use fast forward to skip files we won't restore.  Use only if fsf\n     causes your tapes to skip too far.\n");
-    fprintf(stderr, "  -b <blocksize> Force a particular block size (default is 32kb).\n");
+    g_fprintf(stderr, _("Usage: amfetchdump [options] config hostname [diskname [datestamp [level [hostname [diskname [datestamp [level ... ]]]]]]] [-o configoption]*\n\n"));
+    g_fprintf(stderr, _("Goes and grabs a dump from tape, moving tapes around and assembling parts as\n"));
+    g_fprintf(stderr, _("necessary.  Files are restored to the current directory, unless otherwise\nspecified.\n\n"));
+    g_fprintf(stderr, _("  -p Pipe exactly *one* complete dumpfile to stdout, instead of to disk.\n"));
+    g_fprintf(stderr, _("  -O <output dir> Restore files to this directory.\n"));
+    g_fprintf(stderr, _("  -d <device> Force restoration from a particular tape device.\n"));
+    g_fprintf(stderr, _("  -c Compress output, fastest method available.\n"));
+    g_fprintf(stderr, _("  -C Compress output, best filesize method available.\n"));
+    g_fprintf(stderr, _("  -l Leave dumps (un)compressed, whichever way they were originally on tape.\n"));
+    g_fprintf(stderr, _("  -a Assume all tapes are available via changer, do not prompt for initial load.\n"));
+    g_fprintf(stderr, _("  -i <dst_file> Search through tapes and write out an inventory while we\n     restore.  Useful only if normal logs are unavailable.\n"));
+    g_fprintf(stderr, _("  -w Wait to put split dumps together until all chunks have been restored.\n"));
+    g_fprintf(stderr, _("  -n Do not reassemble split dumpfiles.\n"));
+    g_fprintf(stderr, _("  -k Skip the rewind/label read when reading a new tape.\n"));
+    g_fprintf(stderr, _("  -s Do not use fast forward to skip files we won't restore.  Use only if fsf\n     causes your tapes to skip too far.\n"));
+    g_fprintf(stderr, _("  -b <blocksize> Force a particular block size (default is 32kb).\n"));
     exit(1);
 }
 
@@ -110,65 +98,70 @@ usage(void)
  */
 tapelist_t *
 list_needed_tapes(
-    match_list_t *     match_list)
+    GSList *   dumpspecs)
 {
     needed_tape_t *needed_tapes = NULL, *curtape = NULL;
     disklist_t diskqp;
-    match_list_t *me = NULL;
+    dumpspec_t *ds = NULL;
     find_result_t *alldumps = NULL;
     tapelist_t *tapes = NULL;
     int numtapes = 0;
     char *conf_diskfile, *conf_tapelist;
 
     /* For disks and tape lists */
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_diskfile == '/') {
-        conf_diskfile = stralloc(conf_diskfile);
-    } else {
-        conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if(read_diskfile(conf_diskfile, &diskqp) != 0) {
-        error("could not load disklist \"%s\"", conf_diskfile);
+        error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
-    if (*conf_tapelist == '/') {
-        conf_tapelist = stralloc(conf_tapelist);
-    } else {
-        conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    amfree(conf_diskfile);
+
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-        error("could not load tapelist \"%s\"", conf_tapelist);
+        error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
-    amfree(conf_diskfile);
     amfree(conf_tapelist);
 
     /* Grab a find_output_t of all logged dumps */
-    alldumps = find_dump(1, &diskqp);
+    alldumps = find_dump(&diskqp);
     free_disklist(&diskqp);
     if(alldumps == NULL){
-        fprintf(stderr, "No dump records found\n");
+        g_fprintf(stderr, _("No dump records found\n"));
         exit(1);
     }
 
     /* Compare all known dumps to our match list, note what we'll need */
-    for(me = match_list; me; me = me->next) {
+    while (dumpspecs) {
        find_result_t *curmatch = NULL; 
        find_result_t *matches = NULL;  
+       ds = (dumpspec_t *)dumpspecs->data;
 
-       matches = dumps_match(alldumps, me->hostname, me->diskname,
-                                me->datestamp, me->level, 1);
+       matches = dumps_match(alldumps, ds->host, ds->disk,
+                                ds->datestamp, ds->level, 1);
        sort_find_result("Dhklp", &matches);
        for(curmatch = matches; curmatch; curmatch = curmatch->next){
            int havetape = 0;
+           int have_part = 0;
            if(strcmp("OK", curmatch->status)){
-               fprintf(stderr,"Dump %s %s %s %d had status '%s', skipping\n",
+               g_fprintf(stderr,_("Dump %s %s %s %d had status '%s', skipping\n"),
                                 curmatch->timestamp, curmatch->hostname,
                                 curmatch->diskname, curmatch->level,
                                 curmatch->status);
                continue;
            }
+           /* check if we already have that part */
+           for(curtape = needed_tapes; curtape; curtape = curtape->next) {
+               find_result_t *rsttemp = NULL;
+               for(rsttemp = curtape->files;
+                   rsttemp;
+                   rsttemp=rsttemp->next) {
+                   if (strcmp(rsttemp->partnum, curmatch->partnum) == 0)
+                       have_part = 1;
+               }
+           }
+           if (have_part)
+               continue;
            for(curtape = needed_tapes; curtape; curtape = curtape->next) {
                if(!strcmp(curtape->label, curmatch->label)){
                    find_result_t *rsttemp = NULL;
@@ -183,10 +176,10 @@ list_needed_tapes(
                            rsttemp;
                            rsttemp=rsttemp->next){
                        if(rstfile->filenum == rsttemp->filenum){
-                           fprintf(stderr, "Seeing multiple entries for tape "
-                                  "%s file " OFF_T_FMT ", using most recent\n",
+                           g_fprintf(stderr, _("Seeing multiple entries for tape "
+                                  "%s file %lld, using most recent\n"),
                                    curtape->label,
-                                   (OFF_T_FMT_TYPE)rstfile->filenum);
+                                   (long long)rstfile->filenum);
                            keep = 0;
                        }
                    }
@@ -229,10 +222,11 @@ list_needed_tapes(
            } /* if(!havetape) */
 
        } /* for(curmatch = matches ... */
-    } /* for(me = match_list ... */
+       dumpspecs = dumpspecs->next;
+    } /* while (dumpspecs) */
 
     if(numtapes == 0){
-      fprintf(stderr, "No matching dumps found\n");
+      g_fprintf(stderr, _("No matching dumps found\n"));
       exit(1);
       /* NOTREACHED */
     }
@@ -242,11 +236,11 @@ list_needed_tapes(
        find_result_t *curfind = NULL;
        for(curfind = curtape->files; curfind; curfind = curfind->next) {
            tapes = append_to_tapelist(tapes, curtape->label,
-                                      curfind->filenum, curtape->isafile);
+                                      curfind->filenum, -1, curtape->isafile);
        }
     }
 
-    fprintf(stderr, "%d tape(s) needed for restoration\n", numtapes);
+    g_fprintf(stderr, _("%d tape(s) needed for restoration\n"), numtapes);
     return(tapes);
 }
 
@@ -263,26 +257,27 @@ main(
 {
     extern int optind;
     int opt;
-    char *errstr;
-    match_list_t *match_list = NULL;
-    match_list_t *me = NULL;
+    GSList *dumpspecs = NULL;
     int fd;
-    char *config_name = NULL;
-    char *conffile = NULL;
     tapelist_t *needed_tapes = NULL;
     char *e;
-    int arg_state;
     rst_flags_t *rst_flags;
-#ifdef FORCE_USERID
-    struct passwd *pwent;
-#endif
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
+    int minimum_arguments;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     for(fd = 3; fd < (int)FD_SETSIZE; fd++) {
        /*
         * Make sure nobody spoofs us with a lot of extra open files
-        * that would cause an open we do to get a very high file
+        * that would cause a successful open to get a very high file
         * descriptor, which in turn might be used as an index into
         * an array (e.g. an fd_set).
         */
@@ -291,53 +286,20 @@ main(
 
     set_pname("amfetchdump");
 
-    dbopen(DBG_SUBDIR_SERVER);
-
-#ifdef FORCE_USERID
-
-    /* we'd rather not run as root */
-
-    if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
-       client_uid = pwent->pw_uid;
-       client_gid = pwent->pw_gid;
-       endpwent();
-    }
-    if(geteuid() == 0) {
-       if(client_uid == (uid_t) -1) {
-           error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-           /*NOTREACHED*/
-       }
-
-       /*@ignore@*/
-       initgroups(CLIENT_LOGIN, client_gid);
-       /*@end@*/
-       setgid(client_gid);
-       setuid(client_uid);
-    }
-
-#endif /* FORCE_USERID */
-
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    erroutput_type = ERR_INTERACTIVE;
-
-    onerror(errexit);
-
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    dbopen(DBG_SUBDIR_SERVER);
 
-    if(my_argc <= 1) {
-       usage();
-       /*NOTREACHED*/
-    }
+    erroutput_type = ERR_INTERACTIVE;
+    error_exit_status = 2;
 
     rst_flags = new_rst_flags();
     rst_flags->wait_tape_prompt = 1;
 
     /* handle options */
-    while( (opt = getopt(my_argc, my_argv, "alht:scCpb:nwi:d:O:")) != -1) {
+    cfg_ovr = new_config_overwrites(argc/2);
+    while( (opt = getopt(argc, argv, "alht:scCpb:nwi:d:O:o:")) != -1) {
        switch(opt) {
        case 'b':
             rst_flags->blocksize = (ssize_t)strtol(optarg, &e, 10);
@@ -346,11 +308,11 @@ main(
            } else if(*e == 'm' || *e == 'M') {
                rst_flags->blocksize *= 1024 * 1024;
            } else if(*e != '\0') {
-               error("invalid blocksize value \"%s\"", optarg);
+               error(_("invalid blocksize value \"%s\""), optarg);
                /*NOTREACHED*/
            }
            if(rst_flags->blocksize < DISK_BLOCK_BYTES) {
-               error("minimum block size is %dk", DISK_BLOCK_BYTES / 1024);
+               error(_("minimum block size is %dk"), DISK_BLOCK_BYTES / 1024);
                /*NOTREACHED*/
            }
            break;
@@ -361,7 +323,7 @@ main(
            rst_flags->compress = 1;
            rst_flags->comp_type = COMPRESS_BEST_OPT;
            break;
-       case 'p': rst_flags->pipe_to_fd = fileno(stdout); break;
+       case 'p': rst_flags->pipe_to_fd = STDOUT_FILENO; break;
        case 's': rst_flags->fsf = (off_t)0; break;
        case 'l': rst_flags->leave_comp = 1; break;
        case 'i': rst_flags->inventory_log = stralloc(optarg); break;
@@ -369,6 +331,7 @@ main(
        case 'w': rst_flags->delay_assemble = 1; break;
        case 'a': rst_flags->wait_tape_prompt = 0; break;
        case 'h': rst_flags->headers = 1; break;
+       case 'o': add_config_overwrite_opt(cfg_ovr, optarg); break;
        default:
            usage();
            /*NOTREACHED*/
@@ -381,14 +344,14 @@ main(
        rst_flags->inline_assemble = 0;
        rst_flags->leave_comp = 1;
        if(rst_flags->compress){
-           error("Cannot force compression when doing inventory/search");
+           error(_("Cannot force compression when doing inventory/search"));
            /*NOTREACHED*/
        }
-       fprintf(stderr, "Doing inventory/search, dumps will not be uncompressed or assembled on-the-fly.\n");
+       g_fprintf(stderr, _("Doing inventory/search, dumps will not be uncompressed or assembled on-the-fly.\n"));
     }
     else{
        if(rst_flags->delay_assemble){
-           fprintf(stderr, "Using -w, split dumpfiles will *not* be automatically uncompressed.\n");
+           g_fprintf(stderr, _("Using -w, split dumpfiles will *not* be automatically uncompressed.\n"));
        }
     }
 
@@ -398,128 +361,61 @@ main(
        /*NOTREACHED*/
     }
 
-    config_name = my_argv[optind++];
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
+    if (rst_flags->inventory_log) {
+        minimum_arguments = 1;
+    } else {
+        minimum_arguments = 2;
     }
-    amfree(conffile);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
-    if((my_argc - optind) < 1 && !rst_flags->inventory_log){
-       fprintf(stderr, "Not enough arguments\n\n");
+    if(argc - optind < minimum_arguments) {
        usage();
        /*NOTREACHED*/
     }
 
-#define ARG_GET_HOST 0
-#define ARG_GET_DISK 1
-#define ARG_GET_DATE 2
-#define ARG_GET_LEVL 3
-
-    arg_state = ARG_GET_HOST;
-    while(optind < my_argc) {
-        switch(arg_state) {
-        case ARG_GET_HOST:
-            /*
-             * New host/disk/date/level set, so allocate a match_list.
-             */
-            me = alloc(SIZEOF(*me));
-            me->hostname = my_argv[optind++];
-            me->diskname = "";
-            me->datestamp = "";
-            me->level = "";
-            me->next = match_list;
-            match_list = me;
-            if(me->hostname[0] != '\0'
-               && (errstr=validate_regexp(me->hostname)) != NULL) {
-                fprintf(stderr, "%s: bad hostname regex \"%s\": %s\n",
-                        get_pname(), me->hostname, errstr);
-                usage();
-               /*NOTREACHED*/
-            }
-            arg_state = ARG_GET_DISK;
-            break;
-        case ARG_GET_DISK:
-            me->diskname = my_argv[optind++];
-            if(me->diskname[0] != '\0'
-               && (errstr=validate_regexp(me->diskname)) != NULL) {
-                fprintf(stderr, "%s: bad diskname regex \"%s\": %s\n",
-                        get_pname(), me->diskname, errstr);
-                usage();
-               /*NOTREACHED*/
-            }
-            arg_state = ARG_GET_DATE;
-            break;
-        case ARG_GET_DATE:
-            me->datestamp = my_argv[optind++];
-            if(me->datestamp[0] != '\0'
-               && (errstr=validate_regexp(me->datestamp)) != NULL) {
-                fprintf(stderr, "%s: bad datestamp regex \"%s\": %s\n",
-                        get_pname(), me->datestamp, errstr);
-                usage();
-               /*NOTREACHED*/
-            }
-            arg_state = ARG_GET_LEVL;
-            break;
-        case ARG_GET_LEVL:
-            me->level = my_argv[optind++];
-            if(me->level[0] != '\0'
-               && (errstr=validate_regexp(me->level)) != NULL) {
-                fprintf(stderr, "%s: bad level regex \"%s\": %s\n",
-                        get_pname(), me->level, errstr);
-                usage();
-               /*NOTREACHED*/
-            }
-           arg_state = ARG_GET_HOST;
-           break;
-        }
-    }
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL, argv[optind++]);
+    apply_config_overwrites(cfg_ovr);
 
-    /* XXX I don't think this can happen */
-    if(match_list == NULL && !rst_flags->inventory_log) {
-        match_list = alloc(SIZEOF(*match_list));
-        match_list->hostname = "";
-        match_list->diskname = "";
-        match_list->datestamp = "";
-        match_list->level = "";
-        match_list->next = NULL;
-    }
+    check_running_as(RUNNING_AS_DUMPUSER);
+
+    dbrename(config_name, DBG_SUBDIR_SERVER);
+
+    dumpspecs = cmdline_parse_dumpspecs(argc - optind, argv + optind,
+                                       CMDLINE_PARSE_DATESTAMP |
+                                       CMDLINE_PARSE_LEVEL |
+                                       CMDLINE_EMPTY_TO_WILDCARD);
 
     /*
      * We've been told explicitly to go and search through the tapes the hard
      * way.
      */
     if(rst_flags->inventory_log){
-       fprintf(stderr, "Beginning tape-by-tape search.\n");
-       search_tapes(stderr, stdin, 1, NULL, match_list, rst_flags, NULL);
+       g_fprintf(stderr, _("Beginning tape-by-tape search.\n"));
+       search_tapes(stderr, stdin, rst_flags->alt_tapedev == NULL,
+                     NULL, dumpspecs, rst_flags, NULL);
        exit(0);
     }
 
 
     /* Decide what tapes we'll need */
-    needed_tapes = list_needed_tapes(match_list);
+    needed_tapes = list_needed_tapes(dumpspecs);
 
     parent_pid = getpid();
     atexit(cleanup);
     get_lock = lock_logfile(); /* config is loaded, should be ok here */
     if(get_lock == 0) {
-       error("%s exists: amdump or amflush is already running, or you must run amcleanup", rst_conf_logfile);
+       error(_("%s exists: amdump or amflush is already running, or you must run amcleanup"), rst_conf_logfile);
     }
-    search_tapes(NULL, stdin, 1, needed_tapes, match_list, rst_flags, NULL);
+    search_tapes(NULL, stdin, rst_flags->alt_tapedev == NULL,
+                 needed_tapes, dumpspecs, rst_flags, NULL);
     cleanup();
 
-    free_match_list(match_list);
+    dumpspec_list_free(dumpspecs);
 
     if(rst_flags->inline_assemble || rst_flags->delay_assemble)
        flush_open_outputs(1, NULL);
     else flush_open_outputs(0, NULL);
 
     free_rst_flags(rst_flags);
-    free_new_argv(new_argc, new_argv);
 
     return(0);
 }
index 2e7492c87a096988a9e2c6231b8938cf7646e056..73338545b7b9ca72a5eeb30c96ff384ca9150dec 100644 (file)
@@ -36,9 +36,9 @@
 #include "version.h"
 #include "clock.h"
 #include "restore.h"
+#include "cmdline.h"
 
 #include "changer.h"
-#include "tapeio.h"
 #include "conffile.h"
 #include "logfile.h"
 #include "amfeatures.h"
@@ -56,7 +56,6 @@
 static char *pgm = "amidxtaped";       /* in case argv[0] is not set */
 
 extern char *rst_conf_logfile;
-extern char *config_dir;
 
 static int get_lock = 0;
 static int from_amandad;
@@ -90,16 +89,15 @@ get_client_line(FILE *in)
     while(1) {
        if((part = agets(in)) == NULL) {
            if(errno != 0) {
-               dbprintf(("%s: read error: %s\n",
-                         debug_prefix_time(NULL), strerror(errno)));
+               dbprintf(_("read error: %s\n"), strerror(errno));
            } else {
-               dbprintf(("%s: EOF reached\n", debug_prefix_time(NULL)));
+               dbprintf(_("EOF reached\n"));
            }
            if(line) {
-               dbprintf(("%s: unprocessed input:\n", debug_prefix_time(NULL)));
-               dbprintf(("-----\n"));
-               dbprintf(("%s\n", line));
-               dbprintf(("-----\n"));
+               dbprintf(_("s: unprocessed input:\n"));
+               dbprintf("-----\n");
+               dbprintf("%s\n", line);
+               dbprintf("-----\n");
            }
            amfree(line);
            amfree(part);
@@ -125,7 +123,7 @@ get_client_line(FILE *in)
         */
        strappend(line, "\n");
     }
-    dbprintf(("%s: > %s\n", debug_prefix_time(NULL), line));
+    dbprintf("> %s\n", line);
     return line;
 }
 
@@ -153,8 +151,8 @@ get_client_line_fd(
                /* Keep looping if failure is temporary */
                continue;
            }
-           dbprintf(("%s: Control pipe read error - %s\n",
-                     pgm, strerror(errno)));
+           dbprintf(_("%s: Control pipe read error - %s\n"),
+                     pgm, strerror(errno));
            break;
        }
 
@@ -162,7 +160,7 @@ get_client_line_fd(
            line_size *= 2;
            line = realloc(line, line_size);
            if (line == NULL) {
-               error("Memory reallocation failure");
+               error(_("Memory reallocation failure"));
                /*NOTREACHED*/
            }
            s = &line[len];
@@ -193,17 +191,16 @@ check_security_buffer(
     char *s, *fp, ch;
     char *errstr = NULL;
 
-    dbprintf(("%s: check_security_buffer(buffer='%s')\n",
-               debug_prefix_time(NULL), buffer));
+    dbprintf(_("check_security_buffer(buffer='%s')\n"), buffer);
 
     i = SIZEOF(addr);
     if (getpeername(0, (struct sockaddr *)&addr, &i) == -1) {
-       error("getpeername: %s", strerror(errno));
+       error(_("getpeername: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     if ((addr.sin_family != (sa_family_t)AF_INET)
                || (ntohs(addr.sin_port) == 20)) {
-       error("connection rejected from %s family %d port %d",
+       error(_("connection rejected from %s family %d port %d"),
              inet_ntoa(addr.sin_addr), addr.sin_family, htons(addr.sin_port));
        /*NOTREACHED*/
     }
@@ -214,19 +211,19 @@ check_security_buffer(
 
     skip_whitespace(s, ch);
     if (ch == '\0') {
-       error("cannot parse SECURITY line");
+       error(_("cannot parse SECURITY line"));
        /*NOTREACHED*/
     }
     fp = s-1;
     skip_non_whitespace(s, ch);
     s[-1] = '\0';
     if (strcmp(fp, "SECURITY") != 0) {
-       error("cannot parse SECURITY line");
+       error(_("cannot parse SECURITY line"));
        /*NOTREACHED*/
     }
     skip_whitespace(s, ch);
     if (!check_security((struct sockaddr_storage *)&addr, s-1, 0, &errstr)) {
-       error("security check failed: %s", errstr);
+       error(_("security check failed: %s"), errstr);
        /*NOTREACHED*/
     }
 }
@@ -241,7 +238,7 @@ main(
     in_port_t data_port = (in_port_t)-1;
     socklen_t socklen;
     struct sockaddr_in addr;
-    match_list_t *match_list;
+    GSList *dumpspecs;
     tapelist_t *tapes = NULL;
     char *their_feature_string = NULL;
     rst_flags_t *rst_flags;
@@ -252,9 +249,16 @@ main(
     tapetype_t *tape;
     char *line;
     char *tapedev;
-#ifndef DEBUG_CODE
-    int i;
-#endif
+    dumpspec_t *ds;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(DATA_FD_OFFSET, 4);
     safe_cd();
@@ -294,25 +298,6 @@ main(
        safe_fd(-1, 0);
     }
 
-#ifdef FORCE_USERID
-
-    /* we'd rather not run as root */
-
-    if(geteuid() == 0) {
-       if(client_uid == (uid_t) -1) {
-           error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-           /*NOTREACHED*/
-       }
-
-       /*@ignore@*/
-       initgroups(CLIENT_LOGIN, client_gid);
-       /*@end@*/
-       setgid(client_gid);
-       setuid(client_uid);
-    }
-
-#endif /* FORCE_USERID */
-
     /* initialize */
     /* close stderr first so that debug file becomes it - amrestore
        chats to stderr, which we don't want going to client */
@@ -320,42 +305,22 @@ main(
     (void)close(STDERR_FILENO);
     dbopen(DBG_SUBDIR_SERVER);
     startclock();
-    dbprintf(("%s: version %s\n", pgm, version()));
-#ifdef DEBUG_CODE
-    if(dbfd() != -1 && dbfd() != STDERR_FILENO)
-    {
-       if(dup2(dbfd(),STDERR_FILENO) != STDERR_FILENO)
-       {
-           perror("amidxtaped can't redirect stderr to the debug file");
-           dbprintf(("%s: can't redirect stderr to the debug file\n",
-                     debug_prefix_time(NULL)));
-           return 1;
-       }
-    }
-#else
-    if ((i = open("/dev/null", O_WRONLY)) == -1 ||
-       (i != STDERR_FILENO &&
-        (dup2(i, STDERR_FILENO) != STDERR_FILENO ||
-         close(i) != 0))) {
-       perror("amidxtaped can't redirect stderr");
-       return 1;
-    }
-#endif
+    dbprintf(_("%s: version %s\n"), pgm, version());
+    debug_dup_stderr_to_debug();
 
     if (! (argc >= 1 && argv != NULL && argv[0] != NULL)) {
-       dbprintf(("%s: WARNING: argv[0] not defined: check inetd.conf\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n"));
     }
 
     if(from_amandad == 0) {
        socklen = SIZEOF(addr);
        if (getpeername(0, (struct sockaddr *)&addr, &socklen) == -1) {
-           error("getpeername: %s", strerror(errno));
+           error(_("getpeername: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        if ((addr.sin_family != (sa_family_t)AF_INET)
                || (ntohs(addr.sin_port) == 20)) {
-           error("connection rejected from %s family %d port %d",
+           error(_("connection rejected from %s family %d port %d"),
                  inet_ntoa(addr.sin_addr), addr.sin_family,
                  htons(addr.sin_port));
            /*NOTREACHED*/
@@ -390,39 +355,32 @@ main(
 
        if(amandad_auth && g_options->auth) {
            if(strcasecmp(amandad_auth, g_options->auth) != 0) {
-               printf("ERROR recover program ask for auth=%s while amidxtaped is configured for '%s'\n",
+               g_printf(_("ERROR recover program ask for auth=%s while amidxtaped is configured for '%s'\n"),
                       g_options->auth, amandad_auth);
-               error("ERROR recover program ask for auth=%s while amidxtaped is configured for '%s'",
+               error(_("ERROR recover program ask for auth=%s while amidxtaped is configured for '%s'"),
                      g_options->auth, amandad_auth);
                /*NOTREACHED*/
            }
        }
        /* send the REP packet */
-       printf("CONNECT CTL %d DATA %d\n", DATA_FD_OFFSET, DATA_FD_OFFSET+1);
-       printf("\n");
+       g_printf("CONNECT CTL %d DATA %d\n", DATA_FD_OFFSET, DATA_FD_OFFSET+1);
+       g_printf("\n");
        fflush(stdout);
        fclose(stdin);
        fclose(stdout);
        cmdout = fdopen(ctlfdout, "a");
        if (!cmdout) {
-           error("amidxtaped: Can't fdopen(ctlfdout): %s", strerror(errno));
+           error(_("amidxtaped: Can't fdopen(ctlfdout): %s"), strerror(errno));
            /*NOTREACHED*/
        }
        cmdin = fdopen(ctlfdin, "r");
        if (!cmdin) {
-           error("amidxtaped: Can't fdopen(ctlfdin): %s", strerror(errno));
+           error(_("amidxtaped: Can't fdopen(ctlfdin): %s"), strerror(errno));
            /*NOTREACHED*/
        }
     }
 
-    /* get the number of arguments */
-    match_list = alloc(SIZEOF(match_list_t));
-    match_list->next = NULL;
-    match_list->hostname = "";
-    match_list->datestamp = "";
-    match_list->level = "";
-    match_list->diskname = "";
-
+    ds = dumpspec_new(NULL, NULL, NULL, NULL);
     for (re_end = 0; re_end == 0; ) {
        char *s, ch;
        amfree(buf);
@@ -445,9 +403,9 @@ main(
            amfree(their_feature_string);
            our_feature_string = am_feature_to_string(our_features);
            if(from_amandad == 1) 
-               fprintf(cmdout,"FEATURES=%s\r\n", our_feature_string);
+               g_fprintf(cmdout,"FEATURES=%s\r\n", our_feature_string);
            else
-               fprintf(cmdout,"%s", our_feature_string);
+               g_fprintf(cmdout,"%s", our_feature_string);
            fflush(cmdout);
            amfree(our_feature_string);
        }
@@ -455,50 +413,37 @@ main(
            rst_flags->alt_tapedev= stralloc(s);
        }
        else if(strncmp_const_skip(buf, "HOST=", s, ch) == 0) {
-           match_list->hostname = stralloc(s);
+           ds->host = stralloc(s);
        }
        else if(strncmp_const_skip(buf, "DISK=", s, ch) == 0) {
-           match_list->diskname = stralloc(s);
+           ds->disk = stralloc(s);
        }
        else if(strncmp_const_skip(buf, "DATESTAMP=", s, ch) == 0) {
-           match_list->datestamp = stralloc(s);
+           ds->datestamp = stralloc(s);
        }
        else if(strncmp_const(buf, "END") == 0) {
            re_end = 1;
        }
        else if(strncmp_const_skip(buf, "CONFIG=", s, ch) == 0) {
            re_config = stralloc(s);
+           if(strlen(re_config) == 0)
+               amfree(re_config);
        }
        else if(buf[0] != '\0' && buf[0] >= '0' && buf[0] <= '9') {
-/* XXX does nothing?     amrestore_nargs = atoi(buf); */
            re_end = 1;
        }
     }
     amfree(buf);
 
-    if(!tapes && rst_flags->alt_tapedev){
-       dbprintf(("%s: Looks like we're restoring from a holding file...\n", debug_prefix_time(NULL)));
-        tapes = unmarshal_tapelist_str(rst_flags->alt_tapedev);
-       tapes->isafile = 1;
-       amfree(rst_flags->alt_tapedev);
-       rst_flags->alt_tapedev = NULL;
-    }
-
     if(re_config) {
-       char *conffile;
-       config_dir = vstralloc(CONFIG_DIR, "/", re_config, "/", NULL);
-       conffile = stralloc2(config_dir, CONFFILE_NAME);
-       if (read_conffile(conffile)) {
-           dbprintf(("%s: config '%s' not found\n",
-                     debug_prefix_time(NULL), re_config));
-           amfree(re_config);
-           re_config = NULL;
-       }
-       amfree(conffile);
-
-       dbrename(config_name, DBG_SUBDIR_SERVER);
+       config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL, re_config);
+       dbrename(re_config, DBG_SUBDIR_SERVER);
+    } else {
+       config_init(0, NULL);
     }
 
+    check_running_as(RUNNING_AS_DUMPUSER_PREFERRED);
+
     if(tapes &&
        (!rst_flags->alt_tapedev  ||
         (re_config && ( strcmp(rst_flags->alt_tapedev,
@@ -507,20 +452,34 @@ main(
                                getconf_str(CNF_TPCHANGER)) == 0 ) ) ) ) {
        /* We need certain options, if restoring from more than one tape */
         if(tapes->next && !am_has_feature(their_features, fe_recover_splits)) {
-            error("%s: Client must support split dumps to restore requested data.",  get_pname());
+            error(_("Client must support split dumps to restore requested data."));
             /*NOTREACHED*/
         }
-       dbprintf(("%s: Restoring from changer, checking labels\n", get_pname()));
+       dbprintf(_("Restoring from changer, checking labels\n"));
        rst_flags->check_labels = 1;
        use_changer = 1;
     }
 
+    /* build the dumpspec list from our single dumpspec */
+    dumpspecs = g_slist_append(NULL, (gpointer)ds);
+    ds = NULL;
+
+    if(!tapes && rst_flags->alt_tapedev){
+        sleep(10);
+       dbprintf(_("Looks like we're restoring from a holding file...\n"));
+        tapes = unmarshal_tapelist_str(rst_flags->alt_tapedev);
+       tapes->isafile = 1;
+       amfree(rst_flags->alt_tapedev);
+       rst_flags->alt_tapedev = NULL;
+        use_changer = FALSE;
+    } 
+
     tapedev = getconf_str(CNF_TAPEDEV);
     /* If we'll be stepping on the tape server's devices, lock them. */
     if(re_config &&
        (use_changer || (rst_flags->alt_tapedev && tapedev &&
                         strcmp(rst_flags->alt_tapedev, tapedev) == 0) ) ) {
-       dbprintf(("%s: Locking devices\n", get_pname()));
+       dbprintf(_("Locking devices\n"));
        parent_pid = getpid();
        atexit(cleanup);
        get_lock = lock_logfile();
@@ -528,7 +487,7 @@ main(
 
     /* Init the tape changer */
     if(tapes && use_changer && changer_init() == 0) {
-       dbprintf(("%s: No changer available\n", debug_prefix_time(NULL)));
+       dbprintf(_("No changer available\n"));
     }
 
     /* Read the default block size from the tape type */
@@ -556,23 +515,22 @@ main(
            int data_fd;
            char *buf;
 
-           dbprintf(("%s: Client understands split dumpfiles\n",get_pname()));
+           dbprintf(_("Client understands split dumpfiles\n"));
 
-           if((data_sock = stream_server(&data_port, STREAM_BUFSIZE, 
+           if((data_sock = stream_server(AF_INET, &data_port, STREAM_BUFSIZE, 
                 STREAM_BUFSIZE, 0)) < 0){
-               error("%s: could not create data socket: %s", get_pname(),
-                     strerror(errno));
+               error(_("could not create data socket: %s"), strerror(errno));
                /*NOTREACHED*/
            }
-           dbprintf(("%s: Local port %d set aside for data\n", get_pname(),                         data_port));
+           dbprintf(_("Local port %d set aside for data\n"), data_port);
 
            /* tell client where to connect */
-           printf("CONNECT %hu\n", (unsigned short)data_port);
+           g_printf(_("CONNECT %hu\n"), (unsigned short)data_port);
            fflush(stdout);
 
            if((data_fd = stream_accept(data_sock, TIMEOUT, STREAM_BUFSIZE, 
                  STREAM_BUFSIZE)) < 0){
-               error("stream_accept failed for client data connection: %s\n",
+               error(_("stream_accept failed for client data connection: %s\n"),
                      strerror(errno));
                /*NOTREACHED*/
            }
@@ -587,8 +545,7 @@ main(
        rst_flags->pipe_to_fd = fileno(stdout);
         cmdout = stderr;
     }
-    dbprintf(("%s: Sending output to file descriptor %d\n",
-             get_pname(), rst_flags->pipe_to_fd));
+    dbprintf(_("Sending output to file descriptor %d\n"), rst_flags->pipe_to_fd);
 
 
     tapedev = getconf_str(CNF_TAPEDEV);
@@ -597,11 +554,11 @@ main(
        (use_changer || (rst_flags->alt_tapedev && tapedev &&
                         strcmp(rst_flags->alt_tapedev, tapedev) == 0) ) ) {
        send_message(cmdout, rst_flags, their_features,
-                    "%s exists: amdump or amflush is already running, "
-                    "or you must run amcleanup", 
+                    _("%s exists: amdump or amflush is already running, "
+                    "or you must run amcleanup")
                     rst_conf_logfile);
-       error("%s exists: amdump or amflush is already running, "
-             "or you must run amcleanup",
+       error(_("%s exists: amdump or amflush is already running, "
+             "or you must run amcleanup"),
              rst_conf_logfile);
     }
 
@@ -610,14 +567,14 @@ main(
        if (rst_flags->pipe_to_fd != -1)
            aclose(rst_flags->pipe_to_fd);
        send_message(cmdout, rst_flags, their_features,
-                    "restore flags are crazy");
+                    _("restore flags are crazy"));
        exit(1);
     }
 
     /* actual restoration */
-    search_tapes(cmdout, cmdin, use_changer, tapes, match_list, rst_flags,
+    search_tapes(cmdout, cmdin, use_changer, tapes, dumpspecs, rst_flags,
                 their_features);
-    dbprintf(("%s: Restoration finished\n", debug_prefix_time(NULL)));
+    dbprintf(_("Restoration finished\n"));
 
     /* cleanup */
     if(rst_flags->pipe_to_fd != -1) aclose(rst_flags->pipe_to_fd);
@@ -627,11 +584,7 @@ main(
 
     amfree(rst_flags->alt_tapedev);
     amfree(rst_flags);
-    amfree(match_list->hostname);
-    amfree(match_list->diskname);
-    amfree(match_list->datestamp);
-    amfree(match_list);
-    amfree(config_dir);
+    dumpspec_list_free(dumpspecs);
     amfree(re_config);
     dbclose();
     return 0;
index d0a6435618b9ea61267a7d508f552e0b67472b87..d9f285bce6474b4e8020d8a9a07be00a5f87a818 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amrestore.c,v 1.63 2006/07/25 18:58:10 martinea Exp $
+ * $Id: amrestore.c 6512 2007-05-24 17:00:24Z ian $
  *
  * retrieves files from an amanda tape
  */
 
 #include "amanda.h"
 #include "util.h"
-#include "tapeio.h"
 #include "fileheader.h"
 #include "restore.h"
+#include "conffile.h"
+#include "device.h"
+#include "cmdline.h"
 
 #define CREAT_MODE     0640
 
-static off_t file_number;
-static pid_t comp_enc_pid = -1;
-static int tapedev;
-static off_t filefsf = (off_t)-1;
-
-/* local functions */
-
-static void errexit(void);
-static void usage(void);
-int main(int argc, char **argv);
-
-/*
- * Do exit(2) after an error, rather than exit(1).
- */
-
-static void
-errexit(void)
-{
-    exit(2);
-}
-
-
 /*
  * Print usage message and terminate.
  */
@@ -75,12 +55,81 @@ errexit(void)
 static void
 usage(void)
 {
-    error("Usage: amrestore [-b blocksize] [-r|-c] [-p] [-h] [-f fileno] "
+    error(_("Usage: amrestore [-b blocksize] [-r|-c] [-p] [-h] [-f fileno] "
          "[-l label] tape-device|holdingfile [hostname [diskname [datestamp "
-         "[hostname [diskname [datestamp ... ]]]]]]");
+         "[hostname [diskname [datestamp ... ]]]]]]"));
     /*NOTREACHED*/
 }
 
+/* Checks if the given tape device is actually a holding disk file. We
+   accomplish this by stat()ing the file; if it is a regular file, we
+   assume (somewhat dangerously) that it's a holding disk file. If
+   it doesn't exist or is not a regular file, we assume it's a device
+   name.
+
+   Returns TRUE if we suspect the device is a holding disk, FALSE
+   otherwise. */
+static gboolean check_device_type(char * device_name) {
+    struct stat stat_buf;
+    int result;
+    
+    result = stat(device_name, &stat_buf);
+
+    return !((result != 0 || !S_ISREG(stat_buf.st_mode)));
+}
+
+static void handle_holding_disk_restore(char * filename, rst_flags_t * flags,
+                                        GSList * dumpspecs) {
+    dumpfile_t this_header;
+    tapelist_t this_disk;
+
+    bzero(&this_disk, sizeof(this_disk));
+    this_disk.label = filename;
+
+    if (!restore_holding_disk(stderr, flags, NULL, &this_disk, NULL,
+                              dumpspecs, &this_header, NULL)) {
+        g_fprintf(stderr, "%s did not match requested host.\n", filename);
+        return;
+    }
+}
+
+static void handle_tape_restore(char * device_name, rst_flags_t * flags,
+                                GSList * dumpspecs, char * check_label) {
+    Device * device;
+    ReadLabelStatusFlags read_label_status;
+
+    device_api_init();
+    
+    device = device_open(device_name);
+    if (device == NULL) {
+        error("Could not open device.\n");
+    }
+    
+    device_set_startup_properties_from_config(device);
+    read_label_status = device_read_label(device);
+    if (read_label_status != READ_LABEL_STATUS_SUCCESS) {
+        char * errstr =
+            g_english_strjoinv_and_free
+                (g_flags_nick_to_strv(read_label_status,
+                                      READ_LABEL_STATUS_FLAGS_TYPE), "or");
+        error("Error reading volume label: %s.\n", errstr);
+    }
+
+    g_assert(device->volume_label != NULL);
+
+    if (!device_start(device, ACCESS_READ, NULL, NULL)) {
+        error("Could not open device %s for reading.\n", device_name);
+    }
+
+    if (check_label != NULL && strcmp(check_label,
+                                      device->volume_label) != 0) {
+        error("Wrong label: Expected %s, found %s.\n",
+              check_label, device->volume_label);
+    }
+
+    search_a_tape(device, stderr, flags, NULL, NULL, dumpspecs,
+                  NULL, NULL, 0, NULL);
+}
 
 /*
  * Parses command line, then loops through all files on tape, restoring
@@ -94,29 +143,23 @@ main(
 {
     extern int optind;
     int opt;
-    char *errstr;
-    int isafile;
-    struct stat stat_tape;
-    dumpfile_t file;
-    char *filename = NULL;
+    int holding_disk_mode;
     char *tapename = NULL;
-    struct match_list {
-       char *hostname;
-       char *diskname;
-       char *datestamp;
-       struct match_list *next;
-    } *match_list = NULL, *me = NULL;
-    int found_match;
-    int arg_state;
-    amwait_t compress_status;
-    int r = 0;
     char *e;
-    char *err;
     char *label = NULL;
     rst_flags_t *rst_flags;
-    int count_error;
     long tmplong;
-    ssize_t read_result;
+    GSList *dumpspecs;
+    config_overwrites_t *cfg_ovr;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -128,14 +171,14 @@ main(
     signal(SIGPIPE, SIG_IGN);
 
     erroutput_type = ERR_INTERACTIVE;
-
-    onerror(errexit);
+    error_exit_status = 2;
 
     rst_flags = new_rst_flags();
     rst_flags->inline_assemble = 0;
 
+    cfg_ovr = new_config_overwrites(argc/2);
     /* handle options */
-    while( (opt = getopt(argc, argv, "b:cCd:rphf:l:")) != -1) {
+    while( (opt = getopt(argc, argv, "b:cCd:rphf:l:o:")) != -1) {
        switch(opt) {
        case 'b':
            tmplong = strtol(optarg, &e, 10);
@@ -145,21 +188,24 @@ main(
            } else if(*e == 'm' || *e == 'M') {
                rst_flags->blocksize *= 1024 * 1024;
            } else if(*e != '\0') {
-               error("invalid rst_flags->blocksize value \"%s\"", optarg);
+               error(_("invalid rst_flags->blocksize value \"%s\""), optarg);
                /*NOTREACHED*/
            }
            if(rst_flags->blocksize < DISK_BLOCK_BYTES) {
-               error("minimum block size is %dk", DISK_BLOCK_BYTES / 1024);
+               error(_("minimum block size is %dk"), DISK_BLOCK_BYTES / 1024);
                /*NOTREACHED*/
            }
            if(rst_flags->blocksize > MAX_TAPE_BLOCK_KB * 1024) {
-               fprintf(stderr,"maximum block size is %dk, using it\n",
+               g_fprintf(stderr,_("maximum block size is %dk, using it\n"),
                        MAX_TAPE_BLOCK_KB);
                rst_flags->blocksize = MAX_TAPE_BLOCK_KB * 1024;
                /*NOTREACHED*/
            }
            break;
        case 'c': rst_flags->compress = 1; break;
+       case 'o':
+           add_config_overwrite_opt(cfg_ovr, optarg);
+           break;
        case 'C':
            rst_flags->compress = 1;
            rst_flags->comp_type = COMPRESS_BEST_OPT;
@@ -167,13 +213,12 @@ main(
        case 'r': rst_flags->raw = 1; break;
        case 'p': rst_flags->pipe_to_fd = fileno(stdout); break;
        case 'h': rst_flags->headers = 1; break;
-       case 'f':
-           filefsf = (off_t)OFF_T_STRTOL(optarg, &e, 10);
+       case 'f': rst_flags->fsf = (off_t)OFF_T_STRTOL(optarg, &e, 10);
            /*@ignore@*/
            if(*e != '\0') {
-               error("invalid fileno value \"%s\"", optarg);
-               /*NOTREACHED*/
-           }
+               error(_("invalid fileno value \"%s\""), optarg);
+                g_assert_not_reached();
+            }
            /*@end@*/
            break;
        case 'l':
@@ -184,249 +229,48 @@ main(
        }
     }
 
+    /* initialize a generic configuration without reading anything */
+    config_init(CONFIG_INIT_CLIENT, NULL);
+    apply_config_overwrites(cfg_ovr);
+
     if(rst_flags->compress && rst_flags->raw) {
-       fprintf(stderr,
-               "Cannot specify both -r (raw) and -c (compressed) output.\n");
+       g_fprintf(stderr,
+               _("Cannot specify both -r (raw) and -c (compressed) output.\n"));
        usage();
     }
 
     if(optind >= argc) {
-       fprintf(stderr, "%s: Must specify tape-device or holdingfile\n",
+       g_fprintf(stderr, _("%s: Must specify tape-device or holdingfile\n"),
                        get_pname());
        usage();
     }
 
     tapename = argv[optind++];
 
-#define ARG_GET_HOST 0
-#define ARG_GET_DISK 1
-#define ARG_GET_DATE 2
-
-    arg_state = ARG_GET_HOST;
-    while(optind < argc) {
-       switch(arg_state) {
-       case ARG_GET_HOST:
-           /*
-            * This is a new host/disk/date triple, so allocate a match_list.
-            */
-           me = alloc(SIZEOF(*me));
-           me->hostname = argv[optind++];
-           me->diskname = "";
-           me->datestamp = "";
-           me->next = match_list;
-           match_list = me;
-           if(me->hostname[0] != '\0'
-              && (errstr=validate_regexp(me->hostname)) != NULL) {
-               fprintf(stderr, "%s: bad hostname regex \"%s\": %s\n",
-                       get_pname(), me->hostname, errstr);
-               usage();
-           }
-           arg_state = ARG_GET_DISK;
-           break;
-       case ARG_GET_DISK:
-           me->diskname = argv[optind++];
-           if(me->diskname[0] != '\0'
-              && (errstr=validate_regexp(me->diskname)) != NULL) {
-               fprintf(stderr, "%s: bad diskname regex \"%s\": %s\n",
-                       get_pname(), me->diskname, errstr);
-               usage();
-           }
-           arg_state = ARG_GET_DATE;
-           break;
-       case ARG_GET_DATE:
-           me->datestamp = argv[optind++];
-           if(me->datestamp[0] != '\0'
-              && (errstr=validate_regexp(me->datestamp)) != NULL) {
-               fprintf(stderr, "%s: bad datestamp regex \"%s\": %s\n",
-                       get_pname(), me->datestamp, errstr);
-               usage();
-           }
-           arg_state = ARG_GET_HOST;
-           break;
-       }
-    }
-    if(match_list == NULL) {
-       match_list = alloc(SIZEOF(*match_list));
-       match_list->hostname = "";
-       match_list->diskname = "";
-       match_list->datestamp = "";
-       match_list->next = NULL;
-    }
+    dumpspecs = cmdline_parse_dumpspecs(argc - optind, argv + optind, 
+                                       CMDLINE_PARSE_DATESTAMP |
+                                       CMDLINE_EMPTY_TO_WILDCARD);
 
-    if(tape_stat(tapename,&stat_tape)!=0) {
-       error("could not stat %s: %s", tapename, strerror(errno));
-       /*NOTREACHED*/
-    }
-    isafile=S_ISREG((stat_tape.st_mode));
+    holding_disk_mode = check_device_type(tapename);
 
-    if(label) {
-       if(isafile) {
-           fprintf(stderr,"%s: ignoring -l flag when restoring from a file.\n",
+    if (holding_disk_mode) {
+        if (label) {
+           g_fprintf(stderr,_("%s: ignoring -l flag when restoring from a file.\n"),
                    get_pname());
-       }
-       else {
-           if((err = tape_rewind(tapename)) != NULL) {
-               error("Could not rewind device '%s': %s", tapename, err);
-               /*NOTREACHED*/
-           }
-           if ((tapedev = tape_open(tapename, 0)) == -1) {;
-               error("Could not open device '%s': %s", tapename, err);
-               /*NOTREACHED*/
-           }
-           read_file_header(&file, tapedev, isafile, rst_flags);
-           if(file.type != F_TAPESTART) {
-               fprintf(stderr,"Not an amanda tape\n");
-               exit (1);
-           }
-           if(strcmp(label, file.name) != 0) {
-               fprintf(stderr,"Wrong label: '%s'\n", file.name);
-               exit (1);
-           }
-           tapefd_close(tapedev);
-           if((err = tape_rewind(tapename)) != NULL) {
-               error("Could not rewind device '%s': %s", tapename, err);
-               /*NOTREACHED*/
-           }
-       }
-    }
-    file_number = (off_t)0;
-    if(filefsf != (off_t)-1) {
-       if(isafile) {
-           fprintf(stderr,"%s: ignoring -f flag when restoring from a file.\n",
+        }
+
+        if (rst_flags->fsf > 0) {
+            g_fprintf(stderr,
+                    "%s: ignoring -f flag when restoring from a file.\n",
                    get_pname());
-       }
-       else {
-           if((err = tape_rewind(tapename)) != NULL) {
-               error("Could not rewind device '%s': %s", tapename, err);
-               /*NOTREACHED*/
-           }
-           if((err = tape_fsf(tapename, filefsf)) != NULL) {
-               error("Could not fsf device '%s': %s", tapename, err);
-               /*NOTREACHED*/
-           }
-           file_number = filefsf;
-       }
-    }
+        }
 
-    if(isafile) {
-       tapedev = open(tapename, O_RDWR);
+        handle_holding_disk_restore(tapename, rst_flags, dumpspecs);
     } else {
-       tapedev = tape_open(tapename, 0);
-    }
-    if(tapedev < 0) {
-       error("could not open %s: %s", tapename, strerror(errno));
-       /*NOTREACHED*/
+        handle_tape_restore(tapename, rst_flags, dumpspecs, label);
     }
 
-    read_result = read_file_header(&file, tapedev, isafile, rst_flags);
-    if(file.type != F_TAPESTART && !isafile && filefsf == (off_t)-1) {
-       fprintf(stderr, "%s: WARNING: not at start of tape, file numbers will be offset\n",
-                       get_pname());
-    }
-
-    count_error = 0;
-    while(count_error < 10) {
-       if(file.type == F_TAPEEND) break;
-       found_match = 0;
-       if(file.type == F_DUMPFILE || file.type == F_SPLIT_DUMPFILE) {
-           amfree(filename);
-           filename = make_filename(&file);
-           for(me = match_list; me; me = me->next) {
-               if(disk_match(&file,me->datestamp,me->hostname,me->diskname,"") != 0) {
-                   found_match = 1;
-                   break;
-               }
-           }
-           fprintf(stderr, "%s: " OFF_T_FMT ": %s ",
-                           get_pname(),
-                           (OFF_T_FMT_TYPE)file_number,
-                           found_match ? "restoring" : "skipping");
-           if(file.type != F_DUMPFILE  && file.type != F_SPLIT_DUMPFILE) {
-               print_header(stderr, &file);
-           } else {
-               fprintf(stderr, "%s\n", filename);
-           }
-       }
-       if(found_match) {
-           count_error=0;
-           read_result = restore(&file, filename,
-               tapedev, isafile, rst_flags);
-           if(comp_enc_pid > 0) {
-               waitpid(comp_enc_pid, &compress_status, 0);
-               comp_enc_pid = -1;
-           }
-           if(rst_flags->pipe_to_fd != -1) {
-               file_number++;                  /* for the last message */
-               break;
-           }
-       }
-       if(isafile) {
-           break;
-       }
-       /*
-        * Note that at this point we know we are working with a tape,
-        * not a holding disk file, so we can call the tape functions
-        * without checking.
-        */
-       if(read_result == 0) {
-           /*
-            * If the last read got EOF, how to get to the next
-            * file depends on how the tape device driver is acting.
-            * If it is BSD-like, we do not really need to do anything.
-            * If it is Sys-V-like, we need to either fsf or close/open.
-            * The good news is, a close/open works in either case,
-            * so that's what we do.
-            */
-           tapefd_close(tapedev);
-           if((tapedev = tape_open(tapename, 0)) < 0) {
-               error("could not open %s: %s", tapename, strerror(errno));
-               /*NOTREACHED*/
-           }
-           count_error++;
-       } else {
-           /*
-            * If the last read got something (even an error), we can
-            * do an fsf to get to the next file.
-            */
-           if(tapefd_fsf(tapedev, (off_t)1) < 0) {
-               error("could not fsf %s: %s", tapename, strerror(errno));
-               /*NOTREACHED*/
-           }
-           count_error=0;
-       }
-       file_number++;
-       read_result = read_file_header(&file, tapedev, isafile, rst_flags);
-    }
-    if(isafile) {
-       close(tapedev);
-    } else {
-       /*
-        * See the notes above about advancing to the next file.
-        */
-       if(read_result == 0) {
-           tapefd_close(tapedev);
-           if((tapedev = tape_open(tapename, 0)) < 0) {
-               error("could not open %s: %s", tapename, strerror(errno));
-               /*NOTREACHED*/
-           }
-       } else {
-           if(tapefd_fsf(tapedev, (off_t)1) < 0) {
-               error("could not fsf %s: %s", tapename, strerror(errno));
-               /*NOTREACHED*/
-           }
-       }
-       tapefd_close(tapedev);
-    }
+    dumpspec_list_free(dumpspecs);
 
-    if((read_result <= 0 || file.type == F_TAPEEND) && !isafile) {
-       fprintf(stderr, "%s: " OFF_T_FMT ": reached ",
-               get_pname(), (OFF_T_FMT_TYPE)file_number);
-       if(read_result <= 0) {
-           fprintf(stderr, "end of information\n");
-       } else {
-           print_header(stderr,&file);
-       }
-       r = 1;
-    }
-    return r;
+    return 0;
 }
index 9cede42df06a317c68eb7c37853bb8a55be83139..a12b5f52bc6ca5a5b11ff0f04b570a97d0b96cbf 100644 (file)
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: restore.c,v 1.52 2006/08/23 11:41:54 martinea Exp $
+ * $Id: restore.c 6512 2007-05-24 17:00:24Z ian $
  *
  * retrieves files from an amanda tape
  */
 
 #include "amanda.h"
-#include "tapeio.h"
 #include "util.h"
 #include "restore.h"
 #include "find.h"
 #include "logfile.h"
 #include "fileheader.h"
 #include "arglist.h"
+#include "cmdline.h"
 #include <signal.h>
+#include <timestamp.h>
 
-#define LOAD_STOP    -1
-#define LOAD_CHANGER -2
+#include <device.h>
+#include <queueing.h>
+#include <glib.h>
+
+typedef enum {
+    LOAD_NEXT = 1,     /* An unknown new slot has been loaded. */
+    LOAD_CHANGER = -2, /* The requested slot has been loaded. */
+    LOAD_STOP = -1,    /* The search is complete. */
+} LoadStatus;
+
+typedef enum {
+    RESTORE_STATUS_NEXT_FILE,
+    RESTORE_STATUS_NEXT_TAPE,
+    RESTORE_STATUS_STOP
+} RestoreFileStatus;
 
 int file_number;
 
 /* stuff we're stuck having global */
-static size_t blocksize = (size_t)SSIZE_MAX;
-static char *cur_tapedev = NULL;
-static char *searchlabel = NULL;
 static int backwards;
 static int exitassemble = 0;
-static int tapefd;
 
 char *rst_conf_logdir = NULL;
 char *rst_conf_logfile = NULL;
-char *curslot = NULL;
+static char *curslot = NULL;
 
 typedef struct open_output_s {
     struct open_output_s *next;
@@ -70,43 +80,39 @@ typedef struct dumplist_s {
     dumpfile_t *file;
 } dumplist_t;
 
-typedef struct seentapes_s {
+struct seentapes_s {
     struct seentapes_s *next;
     char *slotstr;
     char *label;
     dumplist_t *files;
-} seentapes_t;
+};
 
 static open_output_t *open_outputs = NULL;
 static dumplist_t *alldumps_list = NULL;
 
 /* local functions */
 
-static ssize_t get_block(int tapefd, char *buffer, int isafile);
 static void append_file_to_fd(char *filename, int fd);
 static int headers_equal(dumpfile_t *file1, dumpfile_t *file2, int ignore_partnums);
 static int already_have_dump(dumpfile_t *file);
 static void handle_sigint(int sig);
 static int scan_init(void *ud, int rc, int ns, int bk, int s);
+static Device * conditional_device_open(char * tapedev, FILE * orompt_out,
+                                        rst_flags_t * flags,
+                                        am_feature_t * their_features,
+                                        tapelist_t * desired_tape);
 int loadlabel_slot(void *ud, int rc, char *slotstr, char *device);
-void drain_file(int tapefd, rst_flags_t *flags);
 char *label_of_current_slot(char *cur_tapedev, FILE *prompt_out,
                            int *tapefd, dumpfile_t *file, rst_flags_t *flags,
                            am_feature_t *their_features,
                            ssize_t *read_result, tapelist_t *desired_tape);
 
-int load_next_tape(char **cur_tapedev, FILE *prompt_out, int backwards,
+LoadStatus load_next_tape(char **cur_tapedev, FILE *prompt_out, int backwards,
                   rst_flags_t *flags, am_feature_t *their_features,
                   tapelist_t *desired_tape);
-int load_manual_tape(char **cur_tapedev, FILE *prompt_out, FILE *prompt_in,
+LoadStatus load_manual_tape(char **cur_tapedev, FILE *prompt_out, FILE *prompt_in,
                     rst_flags_t *flags, am_feature_t *their_features,
                     tapelist_t *desired_tape);
-void search_a_tape(char *cur_tapedev, FILE *prompt_out, rst_flags_t *flags,
-                  am_feature_t *their_features, tapelist_t *desired_tape,
-                  int isafile, match_list_t *match_list,
-                  seentapes_t *tape_seen, dumpfile_t *file,
-                  dumpfile_t *prev_rst_file, dumpfile_t *tapestart,
-                  int slot_num, ssize_t *read_result);
 
 /*
  * We might want to flush any open dumps and unmerged splits before exiting
@@ -126,16 +132,11 @@ handle_sigint(
 int
 lock_logfile(void)
 {
-    rst_conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*rst_conf_logdir == '/') {
-       rst_conf_logdir = stralloc(rst_conf_logdir);
-    } else {
-       rst_conf_logdir = stralloc2(config_dir, rst_conf_logdir);
-    }
+    rst_conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     rst_conf_logfile = vstralloc(rst_conf_logdir, "/log", NULL);
     if (access(rst_conf_logfile, F_OK) == 0) {
-       dbprintf(("%s exists: amdump or amflush is already running, "
-                 "or you must run amcleanup\n", rst_conf_logfile));
+       dbprintf(_("%s exists: amdump or amflush is already running, "
+                 "or you must run amcleanup\n"), rst_conf_logfile);
        return 0;
     }
     log_add(L_INFO, get_pname());
@@ -191,73 +192,34 @@ already_have_dump(
 static void
 append_file_to_fd(
     char *     filename,
-    int                fd)
+    int                write_fd)
 {
-    ssize_t bytes_read;
-    ssize_t s;
-    off_t wc = (off_t)0;
-    char *buffer;
+    int read_fd;
 
-    if(blocksize == SIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
-    buffer = alloc(blocksize);
-
-    if((tapefd = open(filename, O_RDONLY)) == -1) {
-       error("can't open %s: %s", filename, strerror(errno));
+    read_fd = robust_open(filename, O_RDONLY, 0);
+    if (read_fd < 0) {
+       error(_("can't open %s: %s"), filename, strerror(errno));
        /*NOTREACHED*/
     }
 
-    for (;;) {
-       bytes_read = get_block(tapefd, buffer, 1); /* same as isafile = 1 */
-       if(bytes_read < 0) {
-           error("read error: %s", strerror(errno));
-           /*NOTREACHED*/
-       }
-
-       if (bytes_read == 0)
-               break;
-
-       s = fullwrite(fd, buffer, (size_t)bytes_read);
-       if (s < bytes_read) {
-           fprintf(stderr,"Error (%s) offset " OFF_T_FMT "+" OFF_T_FMT ", wrote " OFF_T_FMT "\n",
-                   strerror(errno), (OFF_T_FMT_TYPE)wc,
-                   (OFF_T_FMT_TYPE)bytes_read, (OFF_T_FMT_TYPE)s);
-           if (s < 0) {
-               if((errno == EPIPE) || (errno == ECONNRESET)) {
-                   error("%s: pipe reader has quit in middle of file.",
-                       get_pname());
-                   /*NOTREACHED*/
-               }
-               error("restore: write error = %s", strerror(errno));
-               /*NOTREACHED*/
-           }
-           error("Short write: wrote " SSIZE_T_FMT " bytes expected " SSIZE_T_FMT ".", s, bytes_read);
-           /*NOTREACHCED*/
-       }
-       wc += (off_t)bytes_read;
+    if (!do_consumer_producer_queue(fd_read_producer, GINT_TO_POINTER(read_fd),
+                                    fd_write_consumer,
+                                    GINT_TO_POINTER(write_fd))) {
+        error("Error copying data from file \"%s\" to fd %d.\n",
+              filename, write_fd);
+        g_assert_not_reached();
     }
 
-    amfree(buffer);
-    aclose(tapefd);
+    aclose(read_fd);
 }
 
-/*
- * Tape changer support routines, stolen brazenly from amtape
- */
+/* A user_init function for changer_find(). See changer.h for
+   documentation. */
 static int 
-scan_init(
-     void *    ud,
-     int       rc,
-     int       ns,
-     int       bk,
-     int       s)
-{
-    (void)ud;  /* Quiet unused parameter warning */
-    (void)ns;  /* Quiet unused parameter warning */
-    (void)s;   /* Quiet unused parameter warning */
-
+scan_init(G_GNUC_UNUSED void * ud, int rc, G_GNUC_UNUSED int ns,
+          int bk, G_GNUC_UNUSED int s) {
     if(rc) {
-        error("could not get changer info: %s", changer_resultstr);
+        error(_("could not get changer info: %s"), changer_resultstr);
        /*NOTREACHED*/
     }
     backwards = bk;
@@ -265,63 +227,91 @@ scan_init(
     return 0;
 }
 
+typedef struct {
+    char ** cur_tapedev;
+    char * searchlabel;
+} loadlabel_data;
+
+/* DANGER WILL ROBINSON: This function references globals:
+          char * curslot;
+ */
 int
-loadlabel_slot(
-     void *    ud,
-     int       rc,
-     char *    slotstr,
-     char *    device)
+loadlabel_slot(void *  datap,
+               int     rc,
+               char *  slotstr,
+               char *  device_name)
 {
-    char *errstr;
-    char *datestamp = NULL;
-    char *label = NULL;
+    loadlabel_data * data = (loadlabel_data*)datap;
+    Device * device;
+    ReadLabelStatusFlags label_status;
+
+    g_return_val_if_fail(rc > 1 || device_name != NULL, 0);
+    g_return_val_if_fail(slotstr != NULL, 0);
 
-    (void)ud;  /* Quiet unused parameter warning */
+    amfree(curslot);
 
     if(rc > 1) {
-        error("could not load slot %s: %s", slotstr, changer_resultstr);
-       /*NOTREACHED*/
-    } else if(rc == 1) {
-        fprintf(stderr, "%s: slot %s: %s\n",
+        error(_("could not load slot %s: %s"), slotstr, changer_resultstr);
+        g_assert_not_reached();
+    }
+
+    if(rc == 1) {
+        g_fprintf(stderr, _("%s: slot %s: %s\n"),
                 get_pname(), slotstr, changer_resultstr);
-    } else if((errstr = tape_rdlabel(device, &datestamp, &label)) != NULL) {
-        fprintf(stderr, "%s: slot %s: %s\n", get_pname(), slotstr, errstr);
-    } else {
-       if(strlen(datestamp)>8)
-            fprintf(stderr, "%s: slot %s: date %-14s label %s",
-                   get_pname(), slotstr, datestamp, label);
-       else
-            fprintf(stderr, "%s: slot %s: date %-8s label %s",
-                   get_pname(), slotstr, datestamp, label);
-        if(strcmp(label, FAKE_LABEL) != 0
-           && strcmp(label, searchlabel) != 0)
-            fprintf(stderr, " (wrong tape)\n");
-        else {
-            fprintf(stderr, " (exact label match)\n");
-            if((errstr = tape_rewind(device)) != NULL) {
-                fprintf(stderr,
-                        "%s: could not rewind %s: %s",
-                        get_pname(), device, errstr);
-                amfree(errstr);
-            }
-           amfree(cur_tapedev);
-           curslot = newstralloc(curslot, slotstr);
-            amfree(datestamp);
-            amfree(label);
-           if(device)
-               cur_tapedev = stralloc(device);
-            return 1;
-        }
+        return 0;
+    } 
+    
+    device = device_open(device_name);
+    if (device == NULL) {
+        g_fprintf(stderr, "%s: slot %s: Could not open device.\n",
+                get_pname(), slotstr);
+        return 0;
     }
-    amfree(datestamp);
-    amfree(label);
 
-    amfree(cur_tapedev);
-    curslot = newstralloc(curslot, slotstr);
-    if(!device) return(1);
-    cur_tapedev = stralloc(device);
+    device_set_startup_properties_from_config(device);
+    label_status = device_read_label(device);
+    if (label_status != READ_LABEL_STATUS_SUCCESS) {
+        char * errstr =
+            g_english_strjoinv_and_free
+                (g_flags_nick_to_strv(label_status,
+                                      READ_LABEL_STATUS_FLAGS_TYPE), "or");
+        g_fprintf(stderr, "%s: slot %s: Error reading tape label:\n"
+                "%s: slot %s: %s\n",
+                get_pname(), slotstr, get_pname(), slotstr, errstr);
+        g_object_unref(device);
+        return 0;
+    }
 
-    return 0;
+    g_assert(device->volume_label != NULL);
+    if (device->volume_label == NULL) {
+        g_fprintf(stderr, "%s: slot %s: Could not read tape label.\n",
+                get_pname(), slotstr);
+        g_object_unref(device);
+        return 0;
+    }
+
+    if (!device_start(device, ACCESS_READ, NULL, NULL)) {
+        g_fprintf(stderr, "%s: slot %s: Could not open device for reading.\n",
+                get_pname(), slotstr);
+        return 0;
+    }
+
+    g_fprintf(stderr, "%s: slot %s: time %-14s label %s",
+            get_pname(), slotstr, device->volume_time, device->volume_label);
+
+    if(strcmp(device->volume_label, data->searchlabel) != 0) {
+        g_fprintf(stderr, " (wrong tape)\n");
+        g_object_unref(device);
+        return 0;
+    }
+
+    g_fprintf(stderr, " (exact label match)\n");
+
+    g_object_unref(device);
+    curslot = newstralloc(curslot, slotstr);
+    amfree(*(data->cur_tapedev));
+    *(data->cur_tapedev) = stralloc(device_name);
+    return 1;
 }
 
 
@@ -389,7 +379,7 @@ flush_open_outputs(
     amwait_t compress_status;
 
     if(!only_file){
-       fprintf(stderr, "\n");
+       g_fprintf(stderr, "\n");
     }
 
     /*
@@ -421,7 +411,7 @@ flush_open_outputs(
            if(cur_file->partnum < 1) cur_find_res->partnum = stralloc("--");
            else{
                char part_str[NUM_STR_SIZE];
-               snprintf(part_str, SIZEOF(part_str), "%d", cur_file->partnum);
+               g_snprintf(part_str, SIZEOF(part_str), "%d", cur_file->partnum);
                cur_find_res->partnum = stralloc(part_str);
            }
            cur_find_res->user_ptr = (void*)cur_out;
@@ -458,11 +448,11 @@ flush_open_outputs(
 
                    cur_filename  = make_filename(cur_file);
                    main_filename = make_filename(main_file);
-                   fprintf(stderr, "Merging %s with %s\n",
+                   g_fprintf(stderr, _("Merging %s with %s\n"),
                            cur_filename, main_filename);
                    append_file_to_fd(cur_filename, outfd);
                    if(unlink(cur_filename) < 0){
-                       fprintf(stderr, "Failed to unlink %s: %s\n",
+                       g_fprintf(stderr, _("Failed to unlink %s: %s\n"),
                                     cur_filename, strerror(errno));
                    }
                    amfree(cur_filename);
@@ -479,7 +469,7 @@ flush_open_outputs(
                        char *cur_filename = make_filename(cur_file);
                        open(cur_filename, O_RDWR|O_APPEND);
                        if (outfd < 0) {
-                         error("Couldn't open %s for appending: %s",
+                         error(_("Couldn't open %s for appending: %s"),
                                cur_filename, strerror(errno));
                          /*NOTREACHED*/
                        }
@@ -541,21 +531,21 @@ make_filename(
     char *pad = NULL;
     size_t padlen = 0;
 
-    snprintf(number, SIZEOF(number), "%d", file->dumplevel);
-    snprintf(part, SIZEOF(part), "%d", file->partnum);
+    g_snprintf(number, SIZEOF(number), "%d", file->dumplevel);
+    g_snprintf(part, SIZEOF(part), "%d", file->partnum);
 
     if(file->totalparts < 0) {
-       snprintf(totalparts, SIZEOF(totalparts), "UNKNOWN");
+       g_snprintf(totalparts, SIZEOF(totalparts), "UNKNOWN");
     }
     else {
-       snprintf(totalparts, SIZEOF(totalparts), "%d", file->totalparts);
+       g_snprintf(totalparts, SIZEOF(totalparts), "%d", file->totalparts);
     }
     padlen = strlen(totalparts) + 1 - strlen(part);
     pad = alloc(padlen);
     memset(pad, '0', padlen);
     pad[padlen - 1] = '\0';
 
-    snprintf(part, SIZEOF(part), "%s%d", pad, file->partnum);
+    g_snprintf(part, SIZEOF(part), "%s%d", pad, file->partnum);
 
     sfn = sanitise_filename(file->disk);
     fn = vstralloc(file->name,
@@ -574,32 +564,19 @@ make_filename(
     return fn;
 }
 
-
-/*
- * XXX Making this thing a lib functiong broke a lot of assumptions everywhere,
- * but I think I've found them all.  Maybe.  Damn globals all over the place.
- */
-
-static ssize_t
-get_block(
-    int                tapefd,
-    char *     buffer,
-    int        isafile)
-{
-    if(isafile)
-       return (fullread(tapefd, buffer, blocksize));
-
-    return(tapefd_read(tapefd, buffer, blocksize));
-}
-
-/*
- * Returns 1 if the current dump file matches the hostname and diskname
+/* Returns 1 if the dump file matches the hostname and diskname
  * regular expressions given on the command line, 0 otherwise.  As a 
- * special case, empty regexs are considered equivalent to ".*": they 
- * match everything.
+ * special case, empty regexs and NULLs are considered equivalent to 
+ * ".*": they match everything.
+ *
+ * @param file: the file to examine
+ * @param datestamp: the datestamp regex, or NULL for any
+ * @param hostname: the hostname regex, or NULL for any
+ * @param diskname: the diskname regex, or NULL for any
+ * @param level: the level regex, or NULL for any
+ * @returns: 1 if the dump file matches
  */
-
-int
+static int
 disk_match(
     dumpfile_t *file,
     char *     datestamp,
@@ -608,84 +585,62 @@ disk_match(
     char *     level)
 {
     char level_str[NUM_STR_SIZE];
-    snprintf(level_str, SIZEOF(level_str), "%d", file->dumplevel);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", file->dumplevel);
 
     if(file->type != F_DUMPFILE && file->type != F_SPLIT_DUMPFILE) return 0;
 
-    if((*hostname == '\0' || match_host(hostname, file->name)) &&
-       (*diskname == '\0' || match_disk(diskname, file->disk)) &&
-       (*datestamp == '\0' || match_datestamp(datestamp, file->datestamp)) &&
-       (*level == '\0' || match_level(level, level_str)))
+    if((!hostname || *hostname == '\0' || match_host(hostname, file->name)) &&
+       (!diskname || *diskname == '\0' || match_disk(diskname, file->disk)) &&
+       (!datestamp || *datestamp == '\0' || match_datestamp(datestamp, file->datestamp)) &&
+       (!level || *level == '\0' || match_level(level, level_str)))
        return 1;
     else
        return 0;
 }
 
-
 /*
- * Reads the first block of a tape file.
+ * Reads the first block of a holding disk file.
  */
 
-ssize_t
-read_file_header(
-    dumpfile_t *       file,
-    int                        tapefd,
-    int                        isafile,
-    rst_flags_t *      flags)
+static gboolean
+read_holding_disk_header(
+    dumpfile_t *       file,
+    int                        tapefd,
+    rst_flags_t *      flags)
 {
     ssize_t bytes_read;
     char *buffer;
-  
+    size_t blocksize;
+
     if(flags->blocksize > 0)
-       blocksize = (size_t)flags->blocksize;
-    else if(blocksize == (size_t)SSIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
+        blocksize = (size_t)flags->blocksize;
+    else
+        blocksize = DISK_BLOCK_BYTES;
     buffer = alloc(blocksize);
 
-    bytes_read = get_block(tapefd, buffer, isafile);
+    bytes_read = fullread(tapefd, buffer, blocksize);
     if(bytes_read < 0) {
-       fprintf(stderr, "%s: error reading file header: %s\n",
+       g_fprintf(stderr, _("%s: error reading file header: %s\n"),
                get_pname(), strerror(errno));
        file->type = F_UNKNOWN;
     } else if((size_t)bytes_read < DISK_BLOCK_BYTES) {
        if(bytes_read == 0) {
-           fprintf(stderr, "%s: missing file header block\n", get_pname());
+           g_fprintf(stderr, _("%s: missing file header block\n"), get_pname());
        } else {
-           fprintf(stderr, "%s: short file header block: " OFF_T_FMT " byte%s\n",
-                   get_pname(), (OFF_T_FMT_TYPE)bytes_read, (bytes_read == 1) ? "" : "s");
+           g_fprintf(stderr,
+                   plural(_("%s: short file header block: %zd byte"),
+                          _("%s: short file header block: %zd bytes\n"),
+                          bytes_read),
+                   get_pname(), (size_t)bytes_read);
        }
        file->type = F_UNKNOWN;
     } else {
-       parse_file_header(buffer, file, (size_t)bytes_read);
+        parse_file_header(buffer, file, (size_t)bytes_read);
     }
     amfree(buffer);
-    return bytes_read;
-}
-
-
-void
-drain_file(
-    int                        tapefd,
-    rst_flags_t *      flags)
-{
-    ssize_t bytes_read;
-    char *buffer;
-
-    if(flags->blocksize)
-       blocksize = (size_t)flags->blocksize;
-    else if(blocksize == (size_t)SSIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
-    buffer = alloc(blocksize);
-
-    do {
-       bytes_read = get_block(tapefd, buffer, 0);
-       if(bytes_read < 0) {
-           error("drain read error: %s", strerror(errno));
-          /*NOTREACHED*/
-       }
-    } while (bytes_read > 0);
-
-    amfree(buffer);
+    return (file->type != F_UNKNOWN &&
+            file->type != F_EMPTY &&
+            file->type != F_WEIRD);
 }
 
 /*
@@ -697,16 +652,12 @@ drain_file(
  * piped to restore).
  */
 
-ssize_t
-restore(
-    dumpfile_t *       file,
-    char *             filename,
-    int                        tapefd,
-    int                        isafile,
-    rst_flags_t *      flags)
+
+/* FIXME: Mondo function that needs refactoring. */
+void restore(RestoreSource * source,
+             rst_flags_t *     flags)
 {
     int dest = -1, out;
-    ssize_t s;
     int file_is_compressed;
     int is_continuation = 0;
     int check_for_aborted = 0;
@@ -717,50 +668,46 @@ restore(
     char *buffer;
     int need_compress=0, need_uncompress=0, need_decrypt=0;
     int stage=0;
-    ssize_t bytes_read;
     struct pipeline {
         int    pipe[2];
     } pipes[3];
+    char * filename;
+
+    filename = make_filename(source->header);
 
     memset(pipes, -1, SIZEOF(pipes));
-    if(flags->blocksize)
-       blocksize = (size_t)flags->blocksize;
-    else if(blocksize == (size_t)SSIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
-
-    if(already_have_dump(file)){
-       char *filename = make_filename(file);
-       fprintf(stderr, " *** Duplicate file %s, one is probably an aborted write\n", filename);
-       amfree(filename);
+
+    if(already_have_dump(source->header)){
+       g_fprintf(stderr, _(" *** Duplicate file %s, one is probably an aborted write\n"), filename);
        check_for_aborted = 1;
     }
 
     /* store a shorthand record of this dump */
-    tempdump = alloc(SIZEOF(dumplist_t));
-    tempdump->file = alloc(SIZEOF(dumpfile_t));
+    tempdump = malloc(SIZEOF(dumplist_t));
+    tempdump->file = malloc(SIZEOF(dumpfile_t));
     tempdump->next = NULL;
-    memcpy(tempdump->file, file, SIZEOF(dumpfile_t));
+    memcpy(tempdump->file, source->header, SIZEOF(dumpfile_t));
 
     /*
      * If we're appending chunked files to one another, and if this is a
      * continuation of a file we just restored, and we've still got the
      * output handle from that previous restore, we're golden.  Phew.
      */
-    if(flags->inline_assemble && file->type == F_SPLIT_DUMPFILE){
+    if(flags->inline_assemble && source->header->type == F_SPLIT_DUMPFILE){
        myout = open_outputs;
        while(myout != NULL){
            if(myout->file->type == F_SPLIT_DUMPFILE &&
-                   headers_equal(file, myout->file, 1)){
-               if(file->partnum == myout->lastpartnum + 1){
+               headers_equal(source->header, myout->file, 1)){
+               if(source->header->partnum == myout->lastpartnum + 1){
                    is_continuation = 1;
                    break;
                }
            }
            myout = myout->next;
        }
-       if(myout != NULL) myout->lastpartnum = file->partnum;
-       else if(file->partnum != 1){
-           fprintf(stderr, "%s:      Chunk out of order, will save to disk and append to output.\n", get_pname());
+       if(myout != NULL) myout->lastpartnum = source->header->partnum;
+       else if(source->header->partnum != 1){
+           g_fprintf(stderr, _("%s:      Chunk out of order, will save to disk and append to output.\n"), get_pname());
            flags->pipe_to_fd = -1;
            flags->compress = 0;
            flags->leave_comp = 1;
@@ -779,17 +726,18 @@ restore(
     if(is_continuation && flags->pipe_to_fd == -1){
        char *filename;
        filename = make_filename(myout->file);
-       fprintf(stderr, "%s:      appending to %s\n", get_pname(),
+       g_fprintf(stderr, _("%s:      appending to %s\n"), get_pname(),
                filename);
        amfree(filename);
     }
 
     /* adjust compression flag */
-    file_is_compressed = file->compressed;
-    if(!flags->compress && file_is_compressed && !known_compress_type(file)) {
-       fprintf(stderr, 
-               "%s: unknown compression suffix %s, can't uncompress\n",
-               get_pname(), file->comp_suffix);
+    file_is_compressed = source->header->compressed;
+    if(!flags->compress && file_is_compressed &&
+       !known_compress_type(source->header)) {
+       g_fprintf(stderr, 
+               _("%s: unknown compression suffix %s, can't uncompress\n"),
+               get_pname(), source->header->comp_suffix);
        flags->compress = 1;
     }
 
@@ -799,12 +747,12 @@ restore(
       out = myout->outfd;
     } else {
       if(flags->pipe_to_fd != -1) {
-         dest = flags->pipe_to_fd;     /* standard output */
+         dest = flags->pipe_to_fd;
       } else {
          char *filename_ext = NULL;
   
          if(flags->compress) {
-             filename_ext = file_is_compressed ? file->comp_suffix
+             filename_ext = file_is_compressed ? source->header->comp_suffix
                                              : COMPRESS_SUFFIX;
          } else if(flags->raw) {
              filename_ext = ".RAW";
@@ -823,7 +771,7 @@ restore(
          tmp_filename = vstralloc(final_filename, ".tmp", NULL);
          if((dest = open(tmp_filename, (O_CREAT | O_RDWR | O_TRUNC),
                          CREAT_MODE)) < 0) {
-             error("could not create output file %s: %s",
+             error(_("could not create output file %s: %s"),
                    tmp_filename, strerror(errno));
               /*NOTREACHED*/
          }
@@ -845,8 +793,9 @@ restore(
        dumpfile_t tmp_hdr;
 
        if(flags->compress && !file_is_compressed) {
-           file->compressed = 1;
-           snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
+           source->header->compressed = 1;
+           g_snprintf(source->header->uncompress_cmd,
+                     SIZEOF(source->header->uncompress_cmd),
                        " %s %s |", UNCOMPRESS_PATH,
 #ifdef UNCOMPRESS_OPT
                        UNCOMPRESS_OPT
@@ -854,63 +803,67 @@ restore(
                        ""
 #endif
                        );
-           strncpy(file->comp_suffix,
+           strncpy(source->header->comp_suffix,
                    COMPRESS_SUFFIX,
-                   SIZEOF(file->comp_suffix)-1);
-           file->comp_suffix[SIZEOF(file->comp_suffix)-1] = '\0';
+                   SIZEOF(source->header->comp_suffix)-1);
+           source->header->comp_suffix[SIZEOF(source->header->comp_suffix)-1]
+                = '\0';
        }
 
-       memcpy(&tmp_hdr, file, SIZEOF(dumpfile_t));
+       memcpy(&tmp_hdr, source->header, SIZEOF(dumpfile_t));
 
        /* remove CONT_FILENAME from header */
-       memset(file->cont_filename,'\0',SIZEOF(file->cont_filename));
-       file->blocksize = DISK_BLOCK_BYTES;
+       memset(source->header->cont_filename, '\0',
+               SIZEOF(source->header->cont_filename));
+       source->header->blocksize = DISK_BLOCK_BYTES;
 
        /*
         * Dumb down split file headers as well, so that older versions of
         * things like amrecover won't gag on them.
         */
-       if(file->type == F_SPLIT_DUMPFILE && flags->mask_splits){
-           file->type = F_DUMPFILE;
+       if(source->header->type == F_SPLIT_DUMPFILE && flags->mask_splits){
+           source->header->type = F_DUMPFILE;
        }
 
        buffer = alloc(DISK_BLOCK_BYTES);
-       build_header(buffer, file, DISK_BLOCK_BYTES);
+       buffer = build_header(source->header, DISK_BLOCK_BYTES);
 
-       if((w = fullwrite(out, buffer, DISK_BLOCK_BYTES)) != DISK_BLOCK_BYTES) {
+       if((w = fullwrite(out, buffer,
+                          DISK_BLOCK_BYTES)) != DISK_BLOCK_BYTES) {
            if(w < 0) {
-               error("write error: %s", strerror(errno));
+               error(_("write error: %s"), strerror(errno));
                /*NOTREACHED*/
            } else {
-               error("write error: " SSIZE_T_FMT " instead of %d", w, DISK_BLOCK_BYTES);
+               error(_("write error: %zd instead of %d"), w, DISK_BLOCK_BYTES);
                /*NOTREACHED*/
            }
        }
        amfree(buffer);
-
-       memcpy(file, &tmp_hdr, SIZEOF(dumpfile_t));
+       memcpy(source->header, &tmp_hdr, SIZEOF(dumpfile_t));
     }
  
     /* find out if compression or uncompression is needed here */
     if(flags->compress && !file_is_compressed && !is_continuation
          && !flags->leave_comp
-         && (flags->inline_assemble || file->type != F_SPLIT_DUMPFILE))
+         && (flags->inline_assemble ||
+              source->header->type != F_SPLIT_DUMPFILE))
        need_compress=1;
        
     if(!flags->raw && !flags->compress && file_is_compressed
          && !is_continuation && !flags->leave_comp && (flags->inline_assemble
-         || file->type != F_SPLIT_DUMPFILE))
+         || source->header->type != F_SPLIT_DUMPFILE))
        need_uncompress=1;   
 
-    if(!flags->raw && file->encrypted && !is_continuation
-         && (flags->inline_assemble || file->type != F_SPLIT_DUMPFILE))
+    if(!flags->raw && source->header->encrypted && !is_continuation &&
+       (flags->inline_assemble || source->header->type != F_SPLIT_DUMPFILE)) {
        need_decrypt=1;
+    }
    
     /* Setup pipes for decryption / compression / uncompression  */
     stage = 0;
     if (need_decrypt) {
       if (pipe(&pipes[stage].pipe[0]) < 0) {
-        error("error [pipe[%d]: %s]", stage, strerror(errno));
+        error(_("error [pipe[%d]: %s]"), stage, strerror(errno));
        /*NOTREACHED*/
       }
       stage++;
@@ -918,7 +871,7 @@ restore(
 
     if (need_compress || need_uncompress) {
       if (pipe(&pipes[stage].pipe[0]) < 0) {
-        error("error [pipe[%d]: %s]", stage, strerror(errno));
+        error(_("error [pipe[%d]: %s]"), stage, strerror(errno));
        /*NOTREACHED*/
       }
       stage++;
@@ -932,7 +885,7 @@ restore(
     if(need_decrypt) {
       switch(myout->comp_enc_pid = fork()) {
       case -1:
-       error("could not fork for decrypt: %s", strerror(errno));
+       error(_("could not fork for decrypt: %s"), strerror(errno));
        /*NOTREACHED*/
 
       default:
@@ -943,28 +896,32 @@ restore(
 
       case 0:
        if(dup2(pipes[stage].pipe[0], 0) == -1) {
-           error("error decrypt stdin [dup2 %d %d: %s]", stage,
+           error(_("error decrypt stdin [dup2 %d %d: %s]"), stage,
                pipes[stage].pipe[0], strerror(errno));
                /*NOTREACHED*/
        }
 
        if(dup2(pipes[stage+1].pipe[1], 1) == -1) {
-           error("error decrypt stdout [dup2 %d %d: %s]", stage + 1,
+           error(_("error decrypt stdout [dup2 %d %d: %s]"), stage + 1,
                pipes[stage+1].pipe[1], strerror(errno));
                /*NOTREACHED*/
        }
 
        safe_fd(-1, 0);
-       if (*file->srv_encrypt) {
-         (void) execlp(file->srv_encrypt, file->srv_encrypt,
-                       file->srv_decrypt_opt, (char *)NULL);
-         error("could not exec %s: %s", file->srv_encrypt, strerror(errno));
-         /*NOTREACHED*/
-       }  else if (*file->clnt_encrypt) {
-         (void) execlp(file->clnt_encrypt, file->clnt_encrypt,
-                       file->clnt_decrypt_opt, (char *)NULL);
-         error("could not exec %s: %s", file->clnt_encrypt, strerror(errno));
-         /*NOTREACHED*/
+       if (source->header->srv_encrypt[0] != '\0') {
+         (void) execlp(source->header->srv_encrypt,
+                        source->header->srv_encrypt,
+                       source->header->srv_decrypt_opt, NULL);
+         error("could not exec %s: %s",
+                source->header->srv_encrypt, strerror(errno));
+          g_assert_not_reached();
+       }  else if (source->header->clnt_encrypt[0] != '\0') {
+         (void) execlp(source->header->clnt_encrypt,
+                        source->header->clnt_encrypt,
+                       source->header->clnt_decrypt_opt, NULL);
+         error("could not exec %s: %s",
+                source->header->clnt_encrypt, strerror(errno));
+          g_assert_not_reached();
        }
       }
     }
@@ -975,7 +932,7 @@ restore(
          */
        switch(myout->comp_enc_pid = fork()) {
        case -1:
-           error("could not fork for %s: %s", COMPRESS_PATH, strerror(errno));
+           error(_("could not fork for %s: %s"), COMPRESS_PATH, strerror(errno));
            /*NOTREACHED*/
 
        default:
@@ -986,13 +943,13 @@ restore(
 
        case 0:
            if(dup2(pipes[stage].pipe[0], 0) == -1) {
-               error("error compress stdin [dup2 %d %d: %s]", stage,
+               error(_("error compress stdin [dup2 %d %d: %s]"), stage,
                  pipes[stage].pipe[0], strerror(errno));
                /*NOTREACHED*/
            }
 
            if(dup2(pipes[stage+1].pipe[1], 1) == -1) {
-               error("error compress stdout [dup2 %d %d: %s]", stage + 1,
+               error(_("error compress stdout [dup2 %d %d: %s]"), stage + 1,
                  pipes[stage+1].pipe[1], strerror(errno));
                  /*NOTREACHED*/
            }
@@ -1002,7 +959,7 @@ restore(
 
            safe_fd(-1, 0);
            (void) execlp(COMPRESS_PATH, COMPRESS_PATH, flags->comp_type, (char *)0);
-           error("could not exec %s: %s", COMPRESS_PATH, strerror(errno));
+           error(_("could not exec %s: %s"), COMPRESS_PATH, strerror(errno));
            /*NOTREACHED*/
        }
     } else if(need_uncompress) {
@@ -1019,7 +976,7 @@ restore(
         */ 
        switch(myout->comp_enc_pid = fork()) {
        case -1: 
-           error("could not fork for %s: %s",
+           error(_("could not fork for %s: %s"),
                  UNCOMPRESS_PATH, strerror(errno));
            /*NOTREACHED*/
 
@@ -1031,115 +988,93 @@ restore(
 
        case 0:
            if(dup2(pipes[stage].pipe[0], 0) == -1) {
-               error("error uncompress stdin [dup2 %d %d: %s]", stage,
+               error(_("error uncompress stdin [dup2 %d %d: %s]"), stage,
                  pipes[stage].pipe[0], strerror(errno));
                /*NOTREACHED*/
            }
 
            if(dup2(pipes[stage+1].pipe[1], 1) == -1) {
-               error("error uncompress stdout [dup2 %d %d: %s]", stage + 1,
+               error(_("error uncompress stdout [dup2 %d %d: %s]"), stage + 1,
                  pipes[stage+1].pipe[1], strerror(errno));
                /*NOTREACHED*/
            }
 
            safe_fd(-1, 0);
-           if (*file->srvcompprog) {
-             (void) execlp(file->srvcompprog, file->srvcompprog, "-d",
-                           (char *)NULL);
-             error("could not exec %s: %s", file->srvcompprog,
-                   strerror(errno));
-             /*NOTREACHED*/
-           } else if (*file->clntcompprog) {
-             (void) execlp(file->clntcompprog, file->clntcompprog, "-d",
-                           (char *)NULL);
-             error("could not exec %s: %s", file->clntcompprog,
-                   strerror(errno));
-             /*NOTREACHED*/
+           if (source->header->srvcompprog[0] != '\0') {
+             (void) execlp(source->header->srvcompprog,
+                            source->header->srvcompprog, "-d", NULL);
+             error("could not exec %s: %s", source->header->srvcompprog,
+                    strerror(errno));
+              g_assert_not_reached();
+           } else if (source->header->clntcompprog[0] != '\0') {
+             (void) execlp(source->header->clntcompprog,
+                            source->header->clntcompprog, "-d", NULL);
+             error("could not exec %s: %s", source->header->clntcompprog,
+                    strerror(errno));
+              g_assert_not_reached();
            } else {
              (void) execlp(UNCOMPRESS_PATH, UNCOMPRESS_PATH,
 #ifdef UNCOMPRESS_OPT
                          UNCOMPRESS_OPT,
 #endif
                          (char *)NULL);
-             error("could not exec %s: %s", UNCOMPRESS_PATH, strerror(errno));
+             error(_("could not exec %s: %s"), UNCOMPRESS_PATH, strerror(errno));
              /*NOTREACHED*/
            }
        }
     }
 
     /* copy the rest of the file from tape to the output */
-    if(flags->blocksize > 0)
-       blocksize = (size_t)flags->blocksize;
-    else if(blocksize == SIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
-    buffer = alloc(blocksize);
-
-    do {
-       bytes_read = get_block(tapefd, buffer, isafile);
-       if(bytes_read < 0) {
-           error("restore read error: %s", strerror(errno));
-           /*NOTREACHED*/
-       }
-
-       if(bytes_read > 0) {
-           if((s = fullwrite(pipes[0].pipe[1], buffer, (size_t)bytes_read)) < 0) {
-               if ((errno == EPIPE) || (errno == ECONNRESET)) {
-                   /*
-                    * reading program has ended early
-                    * e.g: bzip2 closes pipe when it
-                    * trailing garbage after EOF
-                    */
-                   break;
-               }
-               error("restore: write error: %s", strerror(errno));
-               /* NOTREACHED */
-           } else if (s < bytes_read) {
-               error("restore: wrote " SSIZE_T_FMT " of " SSIZE_T_FMT " bytes: %s",
-                   s, bytes_read, strerror(errno));
-               /* NOTREACHED */
-           }
-       }
-       else if(isafile) {
+    if (source->restore_mode == HOLDING_MODE) {
+        dumpfile_t file;
+        int fd = source->u.holding_fd;
+        memcpy(& file, source->header, sizeof(file));
+        for (;;) {
+            do_consumer_producer_queue(fd_read_producer,
+                                       GINT_TO_POINTER(fd),
+                                       fd_write_consumer,
+                                       GINT_TO_POINTER(pipes[0].pipe[1]));
            /*
             * See if we need to switch to the next file in a holding restore
             */
-           if(file->cont_filename[0] == '\0') {
+           if(file.cont_filename[0] == '\0') {
                break;                          /* no more files */
            }
-           aclose(tapefd);
-           if((tapefd = open(file->cont_filename, O_RDONLY)) == -1) {
-               char *cont_filename = strrchr(file->cont_filename,'/');
+           aclose(fd);
+           if((fd = open(file.cont_filename, O_RDONLY)) == -1) {
+               char *cont_filename =
+                    strrchr(file.cont_filename,'/');
                if(cont_filename) {
                    cont_filename++;
-                   if((tapefd = open(cont_filename,O_RDONLY)) == -1) {
-                       error("can't open %s: %s", file->cont_filename,
+                   if((fd = open(cont_filename,O_RDONLY)) == -1) {
+                       error(_("can't open %s: %s"), file.cont_filename,
                              strerror(errno));
                        /*NOTREACHED*/
                    }
                    else {
-                       fprintf(stderr, "cannot open %s: %s\n",
-                               file->cont_filename, strerror(errno));
-                       fprintf(stderr, "using %s\n",
+                       g_fprintf(stderr, _("cannot open %s: %s\n"),
+                               file.cont_filename, strerror(errno));
+                       g_fprintf(stderr, _("using %s\n"),
                                cont_filename);
                    }
                }
                else {
-                   error("can't open %s: %s", file->cont_filename,
+                   error(_("can't open %s: %s"), file.cont_filename,
                          strerror(errno));
                    /*NOTREACHED*/
                }
            }
-           bytes_read = read_file_header(file, tapefd, isafile, flags);
-           if(file->type != F_DUMPFILE && file->type != F_CONT_DUMPFILE
-                   && file->type != F_SPLIT_DUMPFILE) {
-               fprintf(stderr, "unexpected header type: ");
-               print_header(stderr, file);
+           read_holding_disk_header(&file, fd, flags);
+           if(file.type != F_DUMPFILE && file.type != F_CONT_DUMPFILE
+                   && file.type != F_SPLIT_DUMPFILE) {
+               g_fprintf(stderr, _("unexpected header type: "));
+               print_header(stderr, source->header);
                exit(2);
            }
-       }
-    } while (bytes_read > 0);
-
-    amfree(buffer);
+       }            
+    } else {
+        device_read_to_fd(source->u.device, pipes[0].pipe[1]);
+    }
 
     if(!flags->inline_assemble) {
         if(out != dest)
@@ -1147,7 +1082,7 @@ restore(
     }
     if(!is_continuation){
        if(tmp_filename && stat(tmp_filename, &statinfo) < 0){
-           error("Can't stat the file I just created (%s)!", tmp_filename);
+           error(_("Can't stat the file I just created (%s)!"), tmp_filename);
            /*NOTREACHED*/
        } else {
            statinfo.st_size = (off_t)0;
@@ -1159,12 +1094,13 @@ restore(
                if(oldstat.st_size <= statinfo.st_size){
                    dumplist_t *prev_fileentry = NULL;
                    open_output_t *prev_out = NULL;
-                   fprintf(stderr, "Newer restore is larger, using that\n");
+                   g_fprintf(stderr, _("Newer restore is larger, using that\n"));
                    /* nuke the old dump's entry in alldump_list */
                    for(fileentry=alldumps_list;
                            fileentry->next;
                            fileentry=fileentry->next){
-                       if(headers_equal(file, fileentry->file, 0)){
+                       if(headers_equal(source->header,
+                                         fileentry->file, 0)){
                            if(prev_fileentry){
                                prev_fileentry->next = fileentry->next;
                            }
@@ -1178,7 +1114,7 @@ restore(
                    }
                    myout = open_outputs;
                    while(myout != NULL){
-                       if(headers_equal(file, myout->file, 0)){
+                       if(headers_equal(source->header, myout->file, 0)){
                            if(myout->outfd >= 0)
                                aclose(myout->outfd);
                            if(prev_out){
@@ -1193,20 +1129,21 @@ restore(
                    }
                }
                else{
-                   fprintf(stderr, "Older restore is larger, using that\n");
+                   g_fprintf(stderr, _("Older restore is larger, using that\n"));
                    if (tmp_filename)
                        unlink(tmp_filename);
                    amfree(tempdump->file);
                    amfree(tempdump);
                    amfree(tmp_filename);
                    amfree(final_filename);
-                    return (bytes_read);
+                    amfree(filename);
+                    return;
                }
            }
        }
        if(tmp_filename && final_filename &&
-               rename(tmp_filename, final_filename) < 0) {
-           error("Can't rename %s to %s: %s",
+           rename(tmp_filename, final_filename) < 0) {
+           error(_("Can't rename %s to %s: %s"),
                   tmp_filename, final_filename, strerror(errno));
            /*NOTREACHED*/
        }
@@ -1222,11 +1159,11 @@ restore(
     if(!is_continuation){
         oldout = alloc(SIZEOF(open_output_t));
         oldout->file = alloc(SIZEOF(dumpfile_t));
-        memcpy(oldout->file, file, SIZEOF(dumpfile_t));
+        memcpy(oldout->file, source->header, SIZEOF(dumpfile_t));
         if(flags->inline_assemble) oldout->outfd = pipes[0].pipe[1];
        else oldout->outfd = -1;
         oldout->comp_enc_pid = -1;
-        oldout->lastpartnum = file->partnum;
+        oldout->lastpartnum = source->header->partnum;
         oldout->next = open_outputs;
         open_outputs = oldout;
     }
@@ -1239,76 +1176,66 @@ restore(
     else {
        alldumps_list = tempdump;
     }
-
-    return (bytes_read);
 }
 
 /* return NULL if the label is not the expected one                     */
-/* return the label if it is the expected one, and set *tapefd to a     */
-/* file descriptor to the tapedev                                       */
-char *
-label_of_current_slot(
-    char         *cur_tapedev,
-    FILE         *prompt_out,
-    int          *tapefd,
-    dumpfile_t   *file,
-    rst_flags_t  *flags,
-    am_feature_t *their_features,
-    ssize_t      *read_result,
-    tapelist_t   *desired_tape)
+/* returns a Device handle if it is the expected one. */
+/* FIXME: Was label_of_current_slot */
+static Device *
+conditional_device_open(char         *tapedev,
+                        FILE         *prompt_out,
+                        rst_flags_t  *flags,
+                        am_feature_t *their_features,
+                        tapelist_t   *desired_tape)
 {
-    struct stat stat_tape;
-    char *label = NULL;
-    int wrongtape = 0;
-    char *err;
+    Device * rval;
 
-    if (!cur_tapedev) {
+    if (tapedev == NULL) {
        send_message(prompt_out, flags, their_features,
-                    "no tapedev specified");
-    } else if (tape_stat(cur_tapedev, &stat_tape) !=0 ) {
-       send_message(prompt_out, flags, their_features, 
-                    "could not stat '%s': %s",
-                    cur_tapedev, strerror(errno));
-       wrongtape = 1;
-    } else if((err = tape_rewind(cur_tapedev)) != NULL) {
+                    _("Volume labeled '%s' not found."), desired_tape->label);
+        return NULL;
+    }
+
+    rval = device_open(tapedev);
+    if (rval == NULL) {
        send_message(prompt_out, flags, their_features, 
-                        "Could not rewind device '%s': %s",
-                        cur_tapedev, err);
-       wrongtape = 1;
-       /* err should not be freed */
-    } else if((*tapefd = tape_open(cur_tapedev, 0)) < 0){
-       send_message(prompt_out, flags, their_features,
-                        "could not open tape device %s: %s",
-                        cur_tapedev, strerror(errno));
-       wrongtape = 1;
+                    "Error opening device '%s'.",
+                    tapedev);
+        return NULL;
     }
 
-    if (!wrongtape) {
-       *read_result = read_file_header(file, *tapefd, 0, flags);
-       if (file->type != F_TAPESTART) {
-           send_message(prompt_out, flags, their_features,
-                            "Not an amanda tape");
-           tapefd_close(*tapefd);
-       } else {
-           if (flags->check_labels && desired_tape &&
-                        strcmp(file->name, desired_tape->label) != 0) {
-               send_message(prompt_out, flags, their_features,
-                                "Label mismatch, got %s and expected %s",
-                                file->name, desired_tape->label);
-               tapefd_close(*tapefd);
-           }
-           else {
-               label = stralloc(file->name);
-           }
-       }
+    device_set_startup_properties_from_config(rval);
+    device_read_label(rval);
+
+    if (rval->volume_label == NULL) {
+        send_message(prompt_out, flags, their_features,
+                     "Not an amanda tape");
+        g_object_unref(rval);
+        return NULL;
+    }
+
+    if (!device_start(rval, ACCESS_READ, NULL, NULL)) {
+        send_message(prompt_out, flags, their_features,
+                     "Colud not open device %s for reading.\n",
+                     tapedev);
+        return NULL;
     }
-    return label;
+
+    if (flags->check_labels && desired_tape &&
+        strcmp(rval->volume_label, desired_tape->label) != 0) {
+        send_message(prompt_out, flags, their_features,
+                     "Label mismatch, got %s and expected %s",
+                     rval->volume_label, desired_tape->label);
+        g_object_unref(rval);
+        return NULL;
+    }
+
+    return rval;
 }
 
-/* return >0            the number of slot move            */
-/* return LOAD_STOP     if the search must be stopped      */
-/* return LOAD_CHANGER  if the changer search the library  */
-int
+/* Do the right thing to try and load the next required tape. See
+   LoadStatus above for return value meaning. */
+LoadStatus
 load_next_tape(
     char         **cur_tapedev,
     FILE          *prompt_out,
@@ -1317,350 +1244,676 @@ load_next_tape(
     am_feature_t  *their_features,
     tapelist_t    *desired_tape)
 {
-    int ret = -1;
-
     if (desired_tape) {
        send_message(prompt_out, flags, their_features,
-                    "Looking for tape %s...",
+                    _("Looking for tape %s..."),
                     desired_tape->label);
        if (backwards) {
-           searchlabel = desired_tape->label; 
-           changer_find(NULL, scan_init, loadlabel_slot,
+            loadlabel_data data;
+            data.cur_tapedev = cur_tapedev;
+            data.searchlabel = desired_tape->label;
+           changer_find(&data, scan_init, loadlabel_slot,
                         desired_tape->label);
-           ret = LOAD_CHANGER;
+            return LOAD_CHANGER;
        } else {
            amfree(curslot);
            changer_loadslot("next", &curslot,
                             cur_tapedev);
-           ret = 1;
+            return LOAD_NEXT;
        }
     } else {
        assert(!flags->amidxtaped);
        amfree(curslot);
        changer_loadslot("next", &curslot, cur_tapedev);
-       ret = 1;
+        return LOAD_NEXT;
     }
-    return ret;
+
+    g_assert_not_reached();
 }
 
 
-/* return  0     a new tape is loaded       */
-/* return -1     no new tape                */
-int
+/* will never return LOAD_CHANGER. */
+LoadStatus
 load_manual_tape(
-    char         **cur_tapedev,
+    char         **tapedev_ptr,
     FILE          *prompt_out,
     FILE          *prompt_in,
     rst_flags_t   *flags,
     am_feature_t  *their_features,
     tapelist_t    *desired_tape)
 {
-    int ret = 0;
     char *input = NULL;
 
     if (flags->amidxtaped) {
        if (their_features &&
            am_has_feature(their_features,
                           fe_amrecover_FEEDME)) {
-           fprintf(prompt_out, "FEEDME %s\r\n",
+           g_fprintf(prompt_out, "FEEDME %s\r\n",
                    desired_tape->label);
            fflush(prompt_out);
            input = agets(prompt_in);/* Strips \n but not \r */
            if(!input) {
-               error("Connection lost with amrecover");
+               error(_("Connection lost with amrecover"));
                /*NOTREACHED*/
            } else if (strcmp("OK\r", input) == 0) {
            } else if (strncmp("TAPE ", input, 5) == 0) {
-               amfree(*cur_tapedev);
-               *cur_tapedev = alloc(1025);
-               if (sscanf(input, "TAPE %1024s\r", *cur_tapedev) != 1) {
-                   error("Got bad response from amrecover: %s", input);
+               amfree(*tapedev_ptr);
+               *tapedev_ptr = alloc(1025);
+               if (sscanf(input, "TAPE %1024s\r", *tapedev_ptr) != 1) {
+                   error(_("Got bad response from amrecover: %s"), input);
                    /*NOTREACHED*/
                }
            } else {
                send_message(prompt_out, flags, their_features,
-                            "Got bad response from amrecover: %s", input);
-               error("Got bad response from amrecover: %s", input);
+                            _("Got bad response from amrecover: %s"), input);
+               error(_("Got bad response from amrecover: %s"), input);
                /*NOTREACHED*/
            }
        } else {
            send_message(prompt_out, flags, their_features,
-                        "Client doesn't support fe_amrecover_FEEDME");
-           error("Client doesn't support fe_amrecover_FEEDME");
+                        _("Client doesn't support fe_amrecover_FEEDME"));
+           error(_("Client doesn't support fe_amrecover_FEEDME"));
            /*NOTREACHED*/
        }
     }
     else {
        if (desired_tape) {
-           fprintf(prompt_out,
-                   "Insert tape labeled %s in device %s \n"
-                   "and press enter, ^D to finish reading tapes\n",
-                   desired_tape->label, *cur_tapedev);
+           g_fprintf(prompt_out,
+                   _("Insert tape labeled %s in device %s \n"
+                   "and press enter, ^D to finish reading tapes\n"),
+                   desired_tape->label, *tapedev_ptr);
        } else {
-           fprintf(prompt_out,"Insert a tape to search and press "
-                   "enter, ^D to finish reading tapes\n");
+           g_fprintf(prompt_out,_("Insert a tape to search and press "
+                   "enter, ^D to finish reading tapes\n"));
        }
        fflush(prompt_out);
        if((input = agets(prompt_in)) == NULL)
-           ret = -1;
+            return LOAD_STOP;
     }
 
     amfree(input);
-    return ret;
+    return LOAD_NEXT;
 }
 
+/* Search a seen-tapes list for a particular name, to see if we've already
+ * processed this tape. Returns TRUE if this label has already been seen. */
+static gboolean check_volume_seen(seentapes_t * list, char * label) {
+    seentapes_t * cur_tape;
+    for (cur_tape = list; cur_tape != NULL; cur_tape = cur_tape->next) {
+        if (strcmp(cur_tape->label, label) == 0) {
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
 
-void 
-search_a_tape(
-    char         *cur_tapedev,
-    FILE         *prompt_out,
-    rst_flags_t  *flags,
-    am_feature_t *their_features,
-    tapelist_t   *desired_tape,
-    int           isafile,
-    match_list_t *match_list,
-    seentapes_t  *tape_seen,
-    dumpfile_t   *file,
-    dumpfile_t   *prev_rst_file,
-    dumpfile_t   *tapestart,
-    int           slot_num,
-    ssize_t      *read_result)
-{
+/* Add a volume to the seen tapes list. */
+static void record_seen_volume(seentapes_t ** list, char * label,
+                               char * slotstr) {
+    seentapes_t * new_entry;
+
+    if (list == NULL)
+        return;
+
+    new_entry = malloc(sizeof(seentapes_t));
+    new_entry->label = stralloc(label);
+    if (slotstr == NULL) {
+        new_entry->slotstr = NULL;
+    } else {
+        new_entry->slotstr = stralloc(slotstr);
+    }
+    new_entry->files = NULL;
+    new_entry->next = *list;
+    *list = new_entry;
+}
+
+/* Record a specific dump on a volume. */
+static void record_seen_dump(seentapes_t * volume, dumpfile_t * header) {
+    dumplist_t * this_dump;
+
+    if (volume == NULL)
+        return;
+    
+    this_dump = malloc(sizeof(*this_dump));
+    this_dump->file = g_memdup(header, sizeof(*header));
+    this_dump->next = NULL;
+    if (volume->files) {
+        dumplist_t * tmp_dump = volume->files;
+        while (tmp_dump->next != NULL) {
+            tmp_dump = tmp_dump->next;
+        }
+        tmp_dump->next = this_dump;
+    } else {
+        volume->files = this_dump;
+    }
+}
+
+static void print_tape_inventory(FILE * logstream, seentapes_t * tape_seen,
+                                 char * timestamp, char * label,
+                                 int tape_count) {
+    char * logline;
+    dumplist_t * fileentry;
+
+    logline = log_genstring(L_START, "taper",
+                            "datestamp %s label %s tape %d",
+                            timestamp, label, tape_count);
+    fputs(logline, logstream);
+    amfree(logline);
+    for(fileentry=tape_seen->files; fileentry; fileentry=fileentry->next){
+        switch (fileentry->file->type) {
+        case F_DUMPFILE:
+            logline = log_genstring(L_SUCCESS, "taper",
+                                    "%s %s %s %d [faked log entry]",
+                                    fileentry->file->name,
+                                    fileentry->file->disk,
+                                    fileentry->file->datestamp,
+                                    fileentry->file->dumplevel);
+            break;
+        case F_SPLIT_DUMPFILE:
+            logline = log_genstring(L_CHUNK, "taper", 
+                                    "%s %s %s %d %d [faked log entry]",
+                                    fileentry->file->name,
+                                    fileentry->file->disk,
+                                    fileentry->file->datestamp,
+                                    fileentry->file->partnum,
+                                    fileentry->file->dumplevel);
+            break;
+        default:
+            break;
+        }
+        if(logline != NULL){
+            fputs(logline, logstream);
+            amfree(logline);
+            fflush(logstream);
+        }
+    }
+}
+
+/* Check if the given header matches the given dumpspecs. Returns
+   TRUE if dumpspecs is NULL and false if the header is NULL. Returns
+   true if the header matches the  match list. */
+static gboolean run_dumpspecs(GSList * dumpspecs,
+                               dumpfile_t * header) {
+    dumpspec_t *ds;
+
+    if (dumpspecs == NULL)
+        return TRUE;
+    if (header == NULL)
+        return FALSE;
+
+    while (dumpspecs) {
+       ds = (dumpspec_t *)dumpspecs->data;
+        if (disk_match(header, ds->datestamp, ds->host,
+                       ds->disk, ds->level) != 0) {
+            return TRUE;
+        }
+       dumpspecs = dumpspecs->next;
+    }
+
+    return FALSE;
+}
+
+/* A wrapper around restore() above. This function does some extra
+   checking to seek to the file in question and ensure that we really,
+   really want to use it.
+
+   The next_file argument provides instruction on what to do if the
+   requested file does not exist on the volume: If next_file is NULL
+   then if the requested file is missing the function will return
+   RESTORE_STATUS_NEXT_FILE. If next_file is not NULL then the first
+   extant file whose number is equal to or greater than file_num will
+   be attempted. *next_file will be filled in with the number of the
+   file following the one that was attempted. */
+static RestoreFileStatus
+try_restore_single_file(Device * device, int file_num, int* next_file,
+                        FILE * prompt_out,
+                        rst_flags_t * flags,
+                        am_feature_t * their_features,
+                        dumpfile_t * first_restored_file,
+                        GSList * dumpspecs,
+                        seentapes_t * tape_seen) {
+    RestoreSource source;
+    source.u.device = device;
+    source.restore_mode = DEVICE_MODE;
+
+    source.header = device_seek_file(device, file_num);
+
+    if (source.header == NULL) {
+        /* This definitely indicates an error. */
+        send_message(prompt_out, flags, their_features,
+                     "Could not seek device %s to file %d.",
+                     device->device_name, file_num);
+        return RESTORE_STATUS_NEXT_TAPE;
+    } else if (source.header->type == F_TAPEEND) {
+        amfree(source.header);
+        return RESTORE_STATUS_NEXT_TAPE;
+    } else if (device->file != file_num) {
+        if (next_file == NULL) {
+            send_message(prompt_out, flags, their_features,
+                         "Requested file %d does not exist.",
+                         file_num);
+            return RESTORE_STATUS_NEXT_FILE;
+        } else {
+            send_message(prompt_out, flags, their_features,
+                         "Skipped from file %d to file %d.", 
+                         file_num, device->file);
+            file_num = device->file;
+        }
+    }
+
+    if (next_file != NULL) {
+        *next_file = file_num + 1;
+    }
+    
+    g_return_val_if_fail(source.header->type == F_DUMPFILE ||
+                         source.header->type == F_CONT_DUMPFILE ||
+                         source.header->type == F_SPLIT_DUMPFILE,
+                         RESTORE_STATUS_NEXT_FILE);
+    
+
+    if (!run_dumpspecs(dumpspecs, source.header)) {
+       if(!flags->amidxtaped) {
+            g_fprintf(prompt_out, "%s: %d: skipping ",
+                   get_pname(), file_num);
+            print_header(prompt_out, source.header);
+       }
+        return RESTORE_STATUS_NEXT_FILE;
+    }
+
+    if (first_restored_file != NULL &&
+        first_restored_file->type != F_UNKNOWN &&
+        !headers_equal(first_restored_file, source.header, 1) &&
+        (flags->pipe_to_fd == fileno(stdout))) {
+        return RESTORE_STATUS_STOP;
+    }
+
+    if (!flags->amidxtaped) {
+       g_fprintf(stderr, "%s: %d: restoring ",
+               get_pname(), file_num);
+       print_header(stderr, source.header);
+    }
+    record_seen_dump(tape_seen, source.header);
+    restore(&source, flags);
+    return RESTORE_STATUS_NEXT_FILE;
+}
+
+/* This function handles processing of a particular tape or holding
+   disk file. It returns TRUE if it is useful to load another tape.*/
+
+gboolean
+search_a_tape(Device      * device,
+              FILE         *prompt_out, /* Where to send any prompts */
+              rst_flags_t  *flags,      /* Restore options. */
+              am_feature_t *their_features, 
+              tapelist_t   *desired_tape, /* A list of desired tape files */
+              GSList *dumpspecs, /* What disks to restore. */
+              seentapes_t **tape_seen,  /* Where to record data on
+                                           this tape. */
+              /* May be NULL. If zeroed, will be filled in with the
+                 first restored file. If already filled in, then we
+                 may only restore other files from the same dump. */
+              dumpfile_t   * first_restored_file,
+              int           tape_count,
+              FILE * logstream) {
+    seentapes_t * tape_seen_head = NULL;
+    RestoreSource source;
     off_t       filenum;
-    dumplist_t *fileentry = NULL;
+
     int         tapefile_idx = -1;
     int         i;
-    char       *logline = NULL;
-    FILE       *logstream = NULL;
-    off_t       fsf_by;
+    RestoreFileStatus restore_status = RESTORE_STATUS_NEXT_TAPE;
+
+    source.restore_mode = DEVICE_MODE;
+    source.u.device = device;
 
     filenum = (off_t)0;
     if(desired_tape && desired_tape->numfiles > 0)
        tapefile_idx = 0;
 
     if (desired_tape) {
-       dbprintf(("search_a_tape: desired_tape=%p label=%s\n",
-                 desired_tape, desired_tape->label));
-       dbprintf(("tape:   numfiles = %d\n", desired_tape->numfiles));
+       dbprintf(_("search_a_tape: desired_tape=%p label=%s\n"),
+                 desired_tape, desired_tape->label);
+       dbprintf(_("tape:   numfiles = %d\n"), desired_tape->numfiles);
        for (i=0; i < desired_tape->numfiles; i++) {
-           dbprintf(("tape:   files[%d] = " OFF_T_FMT "\n",
-                     i, (OFF_T_FMT_TYPE)desired_tape->files[i]));
+           dbprintf(_("tape:   files[%d] = %lld\n"),
+                     i, (long long)desired_tape->files[i]);
        }
     } else {
-       dbprintf(("search_a_tape: no desired_tape\n"));
+       dbprintf(_("search_a_tape: no desired_tape\n"));
+    }
+    dbprintf(_("current tapefile_idx = %d\n"), tapefile_idx);
+
+    if (tape_seen) {
+        if (check_volume_seen(*tape_seen, device->volume_label)) {
+            send_message(prompt_out, flags, their_features,
+                         "Skipping repeat tape %s in slot %s",
+                         device->volume_label, curslot);
+            return TRUE;
+        }
+        record_seen_volume(tape_seen, device->volume_label, curslot);
+        tape_seen_head = *tape_seen;
     }
-    dbprintf(("current tapefile_idx = %d\n", tapefile_idx));
        
-    /* if we know where we're going, fastforward there */
-    if(flags->fsf && !isafile){
-       /* If we have a tapelist entry, filenums will be store there */
-       if(tapefile_idx >= 0) {
-           fsf_by = desired_tape->files[tapefile_idx]; 
-       } else {
-           /*
-            * older semantics assume we're restoring one file, with the fsf
-            * flag being the filenum on tape for said file
-            */
-           fsf_by = (flags->fsf == 0) ? (off_t)0 : (off_t)1;
-       }
-       if(fsf_by > (off_t)0){
-           if(tapefd_rewind(tapefd) < 0) {
-               send_message(prompt_out, flags, their_features,
-                            "Could not rewind device %s: %s",
-                            cur_tapedev, strerror(errno));
-               error("Could not rewind device %s: %s",
-                     cur_tapedev, strerror(errno));
-               /*NOTREACHED*/
-           }
+    if (desired_tape && desired_tape->numfiles > 0) {
+        /* Iterate the tape list, handle each file in order. */
+        int file_index;
+        for (file_index = 0; file_index < desired_tape->numfiles;
+             file_index ++) {
+            int file_num = desired_tape->files[file_index];
+            restore_status = try_restore_single_file(device, file_num, NULL,
+                                                     prompt_out, flags,
+                                                     their_features,
+                                                     first_restored_file,
+                                                     NULL, tape_seen_head);
+            if (restore_status != RESTORE_STATUS_NEXT_FILE)
+                break;
+        }
+    } else if(flags->fsf && flags->amidxtaped) {
+        /* Restore a single file, then quit. */
+        restore_status =
+            try_restore_single_file(device, flags->fsf, NULL, prompt_out, flags,
+                                    their_features, first_restored_file,
+                                    dumpspecs, tape_seen_head);
+    } else {
+        /* Search the tape from beginning to end. */
+        int file_num;
 
-           if(tapefd_fsf(tapefd, fsf_by) < 0) {
-               send_message(prompt_out, flags, their_features,
-                            "Could not fsf device %s by " OFF_T_FMT ": %s",
-                            cur_tapedev, (OFF_T_FMT_TYPE)fsf_by,
-                            strerror(errno));
-               error("Could not fsf device %s by " OFF_T_FMT ": %s",
-                     cur_tapedev, (OFF_T_FMT_TYPE)fsf_by,
-                     strerror(errno));
-               /*NOTREACHED*/
-           }
-           else {
-               filenum = fsf_by;
-           }
-           *read_result = read_file_header(file, tapefd, isafile, flags);
+        if (flags->fsf > 0) {
+            file_num = flags->fsf;
+        } else {
+            file_num = 1;
+        }
+
+       if (!flags->amidxtaped) {
+            g_fprintf(prompt_out, "Restoring from tape %s starting with file %d.\n",
+                   device->volume_label, file_num);
+           fflush(prompt_out);
        }
+
+        for (;;) {
+            restore_status =
+                try_restore_single_file(device, file_num, &file_num,
+                                        prompt_out, flags,
+                                        their_features, first_restored_file,
+                                        dumpspecs, tape_seen_head);
+            if (restore_status != RESTORE_STATUS_NEXT_FILE)
+                break;
+        }
     }
+    
+    /* spit out our accumulated list of dumps, if we're inventorying */
+    if (logstream != NULL) {
+        print_tape_inventory(logstream, tape_seen_head, device->volume_time,
+                             device->volume_label, tape_count);
+    }
+    return (restore_status != RESTORE_STATUS_STOP);
+}
 
-    while((file->type == F_TAPESTART || file->type == F_DUMPFILE ||
-          file->type == F_SPLIT_DUMPFILE) &&
-         (tapefile_idx < 0 || tapefile_idx < desired_tape->numfiles)) {
-       int found_match = 0;
-       match_list_t *me;
-       dumplist_t *tempdump = NULL;
-
-       /* store record of this dump for inventorying purposes */
-       tempdump = alloc(SIZEOF(dumplist_t));
-       tempdump->file = alloc(SIZEOF(dumpfile_t));
-       tempdump->next = NULL;
-       memcpy(tempdump->file, &file, SIZEOF(dumpfile_t));
-       if(tape_seen->files){
-           fileentry = tape_seen->files;
-           while (fileentry->next != NULL)
-                  fileentry = fileentry->next;
-           fileentry->next = tempdump;
-       }
-       else {
-           tape_seen->files = tempdump;
+static void free_seen_tapes(seentapes_t * seentapes) {
+    while (seentapes != NULL) {
+       seentapes_t *tape_seen = seentapes;
+       seentapes = seentapes->next;
+       while(tape_seen->files != NULL) {
+           dumplist_t *temp_dump = tape_seen->files;
+           tape_seen->files = temp_dump->next;
+           amfree(temp_dump->file);
+           amfree(temp_dump);
        }
+       amfree(tape_seen->label);
+       amfree(tape_seen->slotstr);
+       amfree(tape_seen);
+       
+    }
+}
 
-       /* see if we need to restore the thing */
-       if(isafile)
-           found_match = 1;
-       else if(tapefile_idx >= 0){ /* do it by explicit file #s */
-           if(filenum == desired_tape->files[tapefile_idx]){
-               found_match = 1;
-               tapefile_idx++;
-           }
-       }
-       else{ /* search and match headers */
-           for(me = match_list; me; me = me->next) {
-               if(disk_match(file, me->datestamp, me->hostname,
-                             me->diskname, me->level) != 0){
-                   found_match = 1;
-                   break;
-               }
-           }
-       }
+/* Spit out a list of expected tapes, so people with manual changers know
+   what to load */
+static void print_expected_tape_list(FILE* prompt_out, FILE* prompt_in,
+                                     tapelist_t *tapelist,
+                                     rst_flags_t * flags) {
+    tapelist_t * cur_volume;
+
+    g_fprintf(prompt_out, "The following tapes are needed:");
+    for(cur_volume = tapelist; cur_volume != NULL;
+        cur_volume = cur_volume->next){
+       g_fprintf(prompt_out, " %s", cur_volume->label);
+    }
+    g_fprintf(prompt_out, "\n");
+    fflush(prompt_out);
+    if(flags->wait_tape_prompt){
+       char *input = NULL;
+        g_fprintf(prompt_out,"Press enter when ready\n");
+       fflush(prompt_out);
+        input = agets(prompt_in);
+       amfree(input);
+       g_fprintf(prompt_out, "\n");
+       fflush(prompt_out);
+    }
+}
 
-       if(found_match){
-           char *filename = make_filename(file);
+/* Restore a single holding-disk file. We will fill in this_header
+   with the header from this restore (if it is not null), and in the
+   stdout-pipe case, we abort according to last_header. Returns TRUE
+   if the restore should continue, FALSE if we are done. */
+gboolean restore_holding_disk(FILE * prompt_out,
+                              rst_flags_t * flags,
+                              am_feature_t * features,
+                              tapelist_t * file,
+                              seentapes_t ** seen,
+                              GSList * dumpspecs,
+                              dumpfile_t * this_header,
+                              dumpfile_t * last_header) {
+    RestoreSource source;
+    gboolean read_result;
+    dumpfile_t header;
+
+    source.header = &header;
+    source.restore_mode = HOLDING_MODE;
+    source.u.holding_fd = robust_open(file->label, 0, 0);
+    if (source.u.holding_fd < 0) {
+        send_message(prompt_out, flags, features, 
+                     "could not open %s: %s",
+                     file->label, strerror(errno));
+        return TRUE;
+    }
 
-           fprintf(stderr, "%s: " OFF_T_FMT ": restoring ",
-                   get_pname(), (OFF_T_FMT_TYPE)filenum);
-           print_header(stderr, file);
-           *read_result = restore(file, filename, tapefd, isafile, flags);
-           filenum++;
-           amfree(filename);
-       }
+    g_fprintf(stderr, "Reading %s from fd %d\n",
+            file->label, source.u.holding_fd);
+    
+    read_result = read_holding_disk_header(source.header,
+                                           source.u.holding_fd, flags);
+    if (!read_result) {
+        send_message(prompt_out, flags, features, 
+                     "Invalid header reading %s.",
+                     file->label);
+        aclose(source.u.holding_fd);
+        return TRUE;
+    }
 
-       /* advance to the next file, fast-forwarding where reasonable */
-       if (!isafile) {
-           if (*read_result == 0) {
-               tapefd_close(tapefd);
-               if((tapefd = tape_open(cur_tapedev, 0)) < 0) {
-                   send_message(prompt_out, flags, their_features,
-                                "could not open %s: %s",
-                                cur_tapedev, strerror(errno));
-                   error("could not open %s: %s",
-                         cur_tapedev, strerror(errno));
-                   /*NOTREACHED*/
-               }
-           /* if the file is not what we're looking for fsf to next one */
-           }
-           else if (!found_match) {
-               if (tapefd_fsf(tapefd, (off_t)1) < 0) {
-                   send_message(prompt_out, flags, their_features,
-                                "Could not fsf device %s: %s",
-                                cur_tapedev, strerror(errno));
-                   error("Could not fsf device %s: %s",
-                         cur_tapedev, strerror(errno));
-                   /*NOTREACHED*/
-               }
-               filenum ++;
-           }
-           else if (flags->fsf && (tapefile_idx >= 0) && 
-                    (tapefile_idx < desired_tape->numfiles)) {
-               fsf_by = desired_tape->files[tapefile_idx] - filenum;
-               if (fsf_by > (off_t)0) {
-                   if(tapefd_fsf(tapefd, fsf_by) < 0) {
-                       send_message(prompt_out, flags, their_features,
-                                    "Could not fsf device %s by "
-                                    OFF_T_FMT ": %s",
-                                    cur_tapedev, (OFF_T_FMT_TYPE)fsf_by,
-                                    strerror(errno));
-                       error("Could not fsf device %s by " OFF_T_FMT ": %s",
-                             cur_tapedev, (OFF_T_FMT_TYPE)fsf_by,
-                             strerror(errno));
-                       /*NOTREACHED*/
-                   }
-                   filenum = desired_tape->files[tapefile_idx];
-               }
-           }
-       } /* !isafile */
+    if (!run_dumpspecs(dumpspecs, source.header)) {
+        return FALSE;
+    }
 
-       memcpy(prev_rst_file, file, SIZEOF(dumpfile_t));
-             
-       if(isafile)
-           break;
-        *read_result = read_file_header(file, tapefd, isafile, flags);
+    if (last_header != NULL && !flags->amidxtaped &&
+       flags->pipe_to_fd == STDOUT_FILENO &&
+        !headers_equal(last_header, source.header, 1)) {
+        return FALSE;
+    } else if (this_header != NULL) {
+        memcpy(this_header, source.header, sizeof(*this_header));
+    }
 
-       /* only restore a single dump, if piping to stdout */
-       if (!headers_equal(prev_rst_file, file, 1) &&
-           (flags->pipe_to_fd == fileno(stdout)) && found_match) {
-           break;
-       }
-    } /* while we keep seeing headers */
+    if (seen != NULL) {
+        record_seen_volume(seen, file->label, "<none>");
+        record_seen_dump(*seen, source.header);
+    }
 
-    if (!isafile) {
-       if (file->type == F_EMPTY) {
-           aclose(tapefd);
-           if((tapefd = tape_open(cur_tapedev, 0)) < 0) {
-               send_message(prompt_out, flags, their_features,
-                            "could not open %s: %s",
-                            cur_tapedev, strerror(errno));
-               error("could not open %s: %s",
-                     cur_tapedev, strerror(errno));
-               /*NOTREACHED*/
-           }
-       } else {
-           if (tapefd_fsf(tapefd, (off_t)1) < 0) {
-               send_message(prompt_out, flags, their_features,
-                            "could not fsf %s: %s",
-                            cur_tapedev, strerror(errno));;
-               error("could not fsf %s: %s",
-                     cur_tapedev, strerror(errno));
-               /*NOTREACHED*/
-           }
-       }
+    print_header(stderr, source.header);
+
+    restore(&source, flags);
+    aclose(source.u.holding_fd);
+    return TRUE;
+}
+
+/* Ask for a specific manual tape. If we find the right one, then open it
+ * and return a Device handle. If not, return NULL. Pass a device name, but
+ * it might be overridden. */
+static Device* manual_find_tape(char ** cur_tapedev, tapelist_t * cur_volume,
+                                FILE * prompt_out, FILE * prompt_in,
+                                rst_flags_t * flags,
+                                am_feature_t * features) {
+    LoadStatus status = LOAD_NEXT;
+    Device * rval;
+
+    for (;;) {
+        status = load_manual_tape(cur_tapedev, prompt_out, prompt_in,
+                                  flags, features, cur_volume);
+        
+        if (status == LOAD_STOP)
+            return NULL;
+
+        rval =  conditional_device_open(*cur_tapedev, prompt_out, flags,
+                                        features, cur_volume);
+        if (rval != NULL)
+            return rval;
     }
-    tapefd_close(tapefd);
+}
 
-    /* spit out our accumulated list of dumps, if we're inventorying */
-    if (logstream) {
-       logline = log_genstring(L_START, "taper",
-                                   "datestamp %s label %s tape %d",
-                                   tapestart->datestamp, tapestart->name,
-                                   slot_num);
-       fprintf(logstream, "%s", logline);
-       for(fileentry=tape_seen->files; fileentry; fileentry=fileentry->next){
-           logline = NULL;
-           switch (fileentry->file->type) {
-               case F_DUMPFILE:
-                   logline = log_genstring(L_SUCCESS, "taper",
-                                      "%s %s %s %d [faked log entry]",
-                                      fileentry->file->name,
-                                      fileentry->file->disk,
-                                      fileentry->file->datestamp,
-                                      fileentry->file->dumplevel);
-                   break;
-               case F_SPLIT_DUMPFILE:
-                   logline = log_genstring(L_CHUNK, "taper", 
-                                      "%s %s %s %d %d [faked log entry]",
-                                      fileentry->file->name,
-                                      fileentry->file->disk,
-                                      fileentry->file->datestamp,
-                                      fileentry->file->partnum,
-                                      fileentry->file->dumplevel);
-                   break;
-               default:
-                   break;
+/* If we have a tapelist, then we mandate restoring in tapelist
+   order. The logic is simple: Get the next tape, and deal with it,
+   then move on to the next one. */
+static void
+restore_from_tapelist(FILE * prompt_out,
+                      FILE * prompt_in,
+                      tapelist_t * tapelist,
+                      GSList * dumpspecs,
+                      rst_flags_t * flags,
+                      am_feature_t * features,
+                      char * cur_tapedev,
+                      gboolean use_changer,
+                      FILE * logstream) {
+    tapelist_t * cur_volume;
+    dumpfile_t first_restored_file;
+    seentapes_t * seentapes = NULL;
+
+    fh_init(&first_restored_file);
+
+    for(cur_volume = tapelist; cur_volume != NULL;
+        cur_volume = cur_volume->next){
+        if (cur_volume->isafile) {
+            /* Restore from holding disk; just go. */
+            if (first_restored_file.type == F_UNKNOWN) {
+                if (!restore_holding_disk(prompt_out, flags,
+                                          features, cur_volume, &seentapes,
+                                          NULL, NULL, &first_restored_file)) {
+                    break;
+                }
+            } else {
+                restore_holding_disk(prompt_out, flags, features,
+                                     cur_volume, &seentapes,
+                                     NULL, &first_restored_file, NULL);
             }
-           if(logline){
-               fprintf(logstream, "%s", logline);
-               amfree(logline);
-               fflush(logstream);
-           }
+        } else {
+            Device * device = NULL;
+            if (use_changer) {
+                char * tapedev = NULL;
+                loadlabel_data data;
+                data.cur_tapedev = &tapedev;
+                data.searchlabel =  cur_volume->label;
+                changer_find(&data, scan_init, loadlabel_slot,
+                             cur_volume->label);
+                device = conditional_device_open(tapedev, prompt_out,
+                                                 flags, features,
+                                                 cur_volume);
+               amfree(tapedev);
+            }
+
+            if (device == NULL)
+                device = manual_find_tape(&cur_tapedev, cur_volume, prompt_out,
+                                          prompt_in, flags, features);
+
+            if (device == NULL)
+                break;
+
+            if (use_changer) {
+                g_fprintf(stderr, "Scanning volume %s (slot %s)\n",
+                          device->volume_label,
+                          curslot);
+            } else {
+                g_fprintf(stderr, "Scanning volume %s\n",
+                          device->volume_label);
+            }
+
+            if (!search_a_tape(device, prompt_out, flags, features,
+                               cur_volume, dumpspecs, &seentapes,
+                               &first_restored_file, 0, logstream)) {
+                g_object_unref(device);
+                break;;
+            }
+            g_object_unref(device);
+        }            
+    }
+
+    free_seen_tapes(seentapes);
+}
+
+/* This function works when we are operating without a tapelist
+   (regardless of whether or not we have a changer). This only happens
+   when we are using amfetchdump without dump logs, but in the future
+   may include amrestore as well. The philosophy is to keep loading
+   tapes until we run out. */
+static void
+restore_without_tapelist(FILE * prompt_out,
+                         FILE * prompt_in,
+                         GSList * dumpspecs,
+                         rst_flags_t * flags,
+                         am_feature_t * features,
+                         char * cur_tapedev,
+                         /* -1 if no changer. */
+                         int slot_count,
+                         FILE * logstream) {
+    int cur_slot = 1;
+    seentapes_t * seentapes;
+    int tape_count = 0;
+    dumpfile_t first_restored_file;
+
+    /* This loop also aborts if we run out of manual tapes, or
+       encounter a changer error. */
+    for (;;) {
+        Device * device = NULL;
+        if (slot_count > 0) {
+            while (cur_slot < slot_count && device == NULL) {
+                amfree(curslot);
+                changer_loadslot("next", &curslot, &cur_tapedev);
+                device = conditional_device_open(cur_tapedev, prompt_out,
+                                                 flags, features,
+                                                 NULL);
+               amfree(cur_tapedev);
+                cur_slot ++;
+            }
+            if (cur_slot >= slot_count)
+                break;
+            
+            g_fprintf(stderr, "Scanning %s (slot %s)\n", device->volume_label,
+                    curslot);
+        } else {
+            device = manual_find_tape(&cur_tapedev, NULL, prompt_out,
+                                      prompt_in, flags, features);
         }
+        
+        if (device == NULL)
+            break;;
+        
+        if (!search_a_tape(device, prompt_out, flags, features,
+                           NULL, dumpspecs, &seentapes, &first_restored_file,
+                           tape_count, logstream)) {
+            g_object_unref(device);
+            break;
+        }
+        g_object_unref(device);
+        tape_count ++;
     }
+           
+    free_seen_tapes(seentapes);
 }
 
 /* 
@@ -1671,40 +1924,25 @@ search_a_tape(
  * tapes to search (rather than "everything I can find"), which in turn can
  * optionally list specific files to restore.
  */
-void
+ void
 search_tapes(
     FILE *             prompt_out,
-    FILE               *prompt_in,
+    FILE *              prompt_in,
     int                        use_changer,
     tapelist_t *       tapelist,
-    match_list_t *     match_list,
+    GSList *           dumpspecs,
     rst_flags_t *      flags,
     am_feature_t *     their_features)
 {
-    int have_changer = 1;
-    int slot_num = -1;
+    char *cur_tapedev;
     int slots = -1;
     FILE *logstream = NULL;
     tapelist_t *desired_tape = NULL;
     struct sigaction act, oact;
-    ssize_t read_result;
-    int slot;
-    char *label = NULL;
-    seentapes_t *seentapes = NULL;
-    int ret;
-
-    if(!prompt_out) prompt_out = stderr;
 
-    dbprintf(("search_tapes(prompt_out=%d, prompt_in=%d,  use_changer=%d, "
-             "tapelist=%p, "
-             "match_list=%p, flags=%p, features=%p)\n",
-             fileno(prompt_out), fileno(prompt_in), use_changer, tapelist,
-             match_list, flags, their_features));
+    device_api_init();
 
-    if(flags->blocksize)
-       blocksize = (size_t)flags->blocksize;
-    else if(blocksize == (size_t)SSIZE_MAX)
-       blocksize = DISK_BLOCK_BYTES;
+    if(!prompt_out) prompt_out = stderr;
 
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
@@ -1714,7 +1952,7 @@ search_tapes(
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
     if(sigaction(SIGINT, &act, &oact) != 0){
-       error("error setting SIGINT handler: %s", strerror(errno));
+       error(_("error setting SIGINT handler: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     if(flags->delay_assemble || flags->inline_assemble) exitassemble = 1;
@@ -1724,61 +1962,42 @@ search_tapes(
     if(flags->inventory_log) {
        if(!strcmp(flags->inventory_log, "-")) logstream = stdout;
        else if((logstream = fopen(flags->inventory_log, "w+")) == NULL) {
-           error("Couldn't open log file %s for writing: %s",
+           error(_("Couldn't open log file %s for writing: %s"),
                  flags->inventory_log, strerror(errno));
            /*NOTREACHED*/
        }
     }
 
     /* Suss what tape device we're using, whether there's a changer, etc. */
-    if(!use_changer || (have_changer = changer_init()) == 0) {
+    if (use_changer) {
+       use_changer = changer_init();
+    }
+    if (!use_changer) {
+        cur_tapedev = NULL;
        if (flags->alt_tapedev) {
            cur_tapedev = stralloc(flags->alt_tapedev);
        } else if(!cur_tapedev) {
            cur_tapedev = getconf_str(CNF_TAPEDEV);
            if (cur_tapedev == NULL) {
-               error("No tapedev specified");
+               error(_("No tapedev specified"));
            }
        }
        /* XXX oughta complain if no config is loaded */
-       fprintf(stderr, "%s: Using tapedev %s\n", get_pname(), cur_tapedev);
-       have_changer = 0;
-    } else if (have_changer != 1) {
-       error("changer initialization failed: %s", strerror(errno));
-       /*NOTREACHED*/
+       g_fprintf(stderr, _("%s: Using tapedev %s\n"), get_pname(), cur_tapedev);
     }
     else{ /* good, the changer works, see what it can do */
        amfree(curslot);
        changer_info(&slots, &curslot, &backwards);
     }
 
-    if(tapelist && !flags->amidxtaped){
-      slots = num_entries(tapelist);
-      /*
-       Spit out a list of expected tapes, so people with manual changers know
-       what to load
-      */
-      fprintf(prompt_out, "The following tapes are needed:");
-      for(desired_tape = tapelist; desired_tape != NULL;
-         desired_tape = desired_tape->next){
-       fprintf(prompt_out, " %s", desired_tape->label);
-      }
-      fprintf(prompt_out, "\n");
-      fflush(prompt_out);
-      if(flags->wait_tape_prompt){
-       char *input = NULL;
-        fprintf(prompt_out,"Press enter when ready\n");
-       fflush(prompt_out);
-        input = agets(prompt_in);
-       amfree(input);
-       fprintf(prompt_out, "\n");
-       fflush(prompt_out);
-      }
+    if (tapelist && !flags->amidxtaped) {
+        print_expected_tape_list(prompt_out, prompt_in, tapelist, flags);
     }
     desired_tape = tapelist;
 
-    if(use_changer && !cur_tapedev) { /* load current slot */
+    if (use_changer) { /* load current slot */
        amfree(curslot);
+       cur_tapedev = NULL;
        changer_loadslot("current", &curslot, &cur_tapedev);
     }
 
@@ -1794,155 +2013,15 @@ search_tapes(
      * (obnoxious, isn't this?)
      */
 
-    do { /* all desired tape */
-       seentapes_t *tape_seen = NULL;
-       dumpfile_t file, tapestart, prev_rst_file;
-       int isafile = 0;
-       read_result = 0;
-
-       slot_num = 0;
-
-       memset(&file, 0, SIZEOF(file));
-
-       if (desired_tape && desired_tape->isafile) {
-           isafile = 1;
-           if ((tapefd = open(desired_tape->label, 0)) == -1) {
-               send_message(prompt_out, flags, their_features, 
-                            "could not open %s: %s",
-                            desired_tape->label, strerror(errno));
-               continue;
-           }
-           fprintf(stderr, "Reading %s to fd %d\n",
-                           desired_tape->label, tapefd);
-
-           read_result = read_file_header(&file, tapefd, 1, flags);
-           label = stralloc(desired_tape->label);
-       } else {
-           /* check current_slot */
-           label = label_of_current_slot(cur_tapedev, prompt_out,
-                                         &tapefd, &file, flags,
-                                         their_features, &read_result,
-                                         desired_tape);
-           while (label==NULL && slot_num < slots &&
-                  use_changer) {
-               /*
-                * If we have an incorrect tape loaded, go try to find
-                * the right one
-                * (or just see what the next available one is).
-                */
-               slot = load_next_tape(&cur_tapedev, prompt_out,
-                                     backwards, flags,
-                                     their_features, desired_tape);
-               if(slot == LOAD_STOP) {
-                   slot_num = slots;
-                   amfree(label);
-               } else {
-                   if (slot == LOAD_CHANGER)
-                       slot_num = slots;
-                   else /* slot > 0 */
-                       slot_num += slot;
-
-                   /* check current_slot */
-                   label = label_of_current_slot(cur_tapedev, prompt_out,
-                                                 &tapefd, &file, flags,
-                                                 their_features, &read_result,
-                                                 desired_tape);
-               }
-           }
-
-           if (label == NULL) {
-               ret = load_manual_tape(&cur_tapedev, prompt_out, prompt_in,
-                                      flags,
-                                      their_features, desired_tape);
-               if (ret == 0) {
-                   label = label_of_current_slot(cur_tapedev, prompt_out,
-                                                 &tapefd, &file, flags,
-                                                 their_features, &read_result,
-                                                 desired_tape);
-               }
-           }
-
-           if (label)
-               memcpy(&tapestart, &file, SIZEOF(dumpfile_t));
-       }
-       
-       if (!label)
-           continue;
-
-       /*
-        * Skip this tape if we did it already.  Note that this would let
-        * duplicate labels through, so long as they were in the same slot.
-        * I'm over it, are you?
-        */
-       if (!isafile) {
-           for (tape_seen = seentapes; tape_seen;
-                tape_seen = tape_seen->next) {
-               if (!strcmp(tape_seen->label, label) &&
-                   !strcmp(tape_seen->slotstr, curslot)){
-                   send_message(prompt_out, flags, their_features,
-                                "Saw repeat tape %s in slot %s",
-                                label, curslot);
-                   amfree(label);
-                   break;
-               }
-           }
-       }
-
-       if(!label)
-           continue;
-
-       if(!curslot)
-           curslot = stralloc("<none>");
-
-       if(!isafile){
-           fprintf(stderr, "Scanning %s (slot %s)\n", label, curslot);
-           fflush(stderr);
-       }
-
-       tape_seen = alloc(SIZEOF(seentapes_t));
-       memset(tape_seen, '\0', SIZEOF(seentapes_t));
-
-       tape_seen->label = label;
-       tape_seen->slotstr = stralloc(curslot);
-       tape_seen->next = seentapes;
-       tape_seen->files = NULL;
-       seentapes = tape_seen;
-
-       /*
-        * Start slogging through the tape itself.  If our tapelist (if we
-        * have one) contains a list of files to restore, obey that instead
-        * of checking for matching headers on all files.
-        */
-
-       search_a_tape(cur_tapedev, prompt_out, flags, their_features,
-                     desired_tape, isafile, match_list, tape_seen,
-                     &file, &prev_rst_file, &tapestart, slot_num,
-                     &read_result);
-
-       fprintf(stderr, "%s: Search of %s complete\n",
-                       get_pname(), tape_seen->label);
-       if (desired_tape) desired_tape = desired_tape->next;
-
-       /* only restore a single dump, if piping to stdout */
-       if (!headers_equal(&prev_rst_file, &file, 1) &&
-           flags->pipe_to_fd == fileno(stdout))
-               break;
-
-    } while (desired_tape);
-
-    while (seentapes != NULL) {
-       seentapes_t *tape_seen = seentapes;
-       seentapes = seentapes->next;
-       while(tape_seen->files != NULL) {
-           dumplist_t *temp_dump = tape_seen->files;
-           tape_seen->files = temp_dump->next;
-           amfree(temp_dump->file);
-           amfree(temp_dump);
-       }
-       amfree(tape_seen->label);
-       amfree(tape_seen->slotstr);
-       amfree(tape_seen);
-       
+    if (tapelist) {
+        restore_from_tapelist(prompt_out, prompt_in, tapelist, dumpspecs,
+                              flags, their_features, cur_tapedev, use_changer,
+                              logstream);
+    } else {
+        restore_without_tapelist(prompt_out, prompt_in, dumpspecs, flags,
+                                 their_features, cur_tapedev,
+                                 (use_changer ? slots : -1),
+                                 logstream);
     }
 
     if(logstream && logstream != stderr && logstream != stdout){
@@ -1964,7 +2043,7 @@ new_rst_flags(void)
 
     memset(flags, 0, SIZEOF(rst_flags_t));
 
-    flags->fsf = 1;
+    flags->fsf = 0;
     flags->comp_type = COMPRESS_FAST_OPT;
     flags->inline_assemble = 1;
     flags->pipe_to_fd = -1;
@@ -1986,7 +2065,7 @@ check_rst_flags(
     if(!flags) return(-1);
 
     if(flags->compress && flags->leave_comp){
-       fprintf(stderr, "Cannot specify 'compress output' and 'leave compression alone' together\n");
+       g_fprintf(stderr, _("Cannot specify 'compress output' and 'leave compression alone' together\n"));
        ret = -1;
     }
 
@@ -1994,28 +2073,28 @@ check_rst_flags(
        struct stat statinfo;
 
        if(flags->pipe_to_fd != -1){
-           fprintf(stderr, "Specifying output directory and piping output are mutually exclusive\n");
+           g_fprintf(stderr, _("Specifying output directory and piping output are mutually exclusive\n"));
            ret = -1;
        }
        if(stat(flags->restore_dir, &statinfo) < 0){
-           fprintf(stderr, "Cannot stat restore target dir '%s': %s\n",
+           g_fprintf(stderr, _("Cannot stat restore target dir '%s': %s\n"),
                      flags->restore_dir, strerror(errno));
            ret = -1;
        }
        if((statinfo.st_mode & S_IFMT) != S_IFDIR){
-           fprintf(stderr, "'%s' is not a directory\n", flags->restore_dir);
+           g_fprintf(stderr, _("'%s' is not a directory\n"), flags->restore_dir);
            ret = -1;
        }
     }
 
     if((flags->pipe_to_fd != -1 || flags->compress) &&
            (flags->delay_assemble || !flags->inline_assemble)){
-       fprintf(stderr, "Split dumps *must* be automatically reassembled when piping output or compressing/uncompressing\n");
+       g_fprintf(stderr, _("Split dumps *must* be automatically reassembled when piping output or compressing/uncompressing\n"));
        ret = -1;
     }
 
     if(flags->delay_assemble && flags->inline_assemble){
-       fprintf(stderr, "Inline split assembling and delayed assembling are mutually exclusive\n");
+       g_fprintf(stderr, _("Inline split assembling and delayed assembling are mutually exclusive\n"));
        ret = -1;
     }
 
@@ -2039,29 +2118,6 @@ free_rst_flags(
 }
 
 
-/*
- * Clean up after a match_list_t
- */
-void
-free_match_list(
-    match_list_t *     match_list)
-{
-    match_list_t *me;
-    match_list_t *prev = NULL;
-  
-    for(me = match_list; me; me = me->next){
-       /* XXX freeing these is broken? can't work out why */
-/*     amfree(me->hostname);
-       amfree(me->diskname);
-       amfree(me->datestamp);
-       amfree(me->level); */
-       amfree(prev);
-       prev = me;
-    }
-    amfree(prev);
-}
-
-
 printf_arglist_function3(
     void send_message,
     FILE *, prompt_out,
@@ -2073,13 +2129,13 @@ printf_arglist_function3(
     char linebuf[STR_SIZE];
 
     arglist_start(argp, format);
-    vsnprintf(linebuf, SIZEOF(linebuf)-1, format, argp);
+    g_vsnprintf(linebuf, SIZEOF(linebuf)-1, format, argp);
     arglist_end(argp);
 
-    fprintf(stderr,"%s\n", linebuf);
+    g_fprintf(stderr,"%s\n", linebuf);
     if (flags->amidxtaped && their_features &&
        am_has_feature(their_features, fe_amrecover_message)) {
-       fprintf(prompt_out, "MESSAGE %s\r\n", linebuf);
+       g_fprintf(prompt_out, "MESSAGE %s\r\n", linebuf);
        fflush(prompt_out);
     }
 }
index ae11c8c501f5d156005351b5fca34231b27fc7d8..02775774c43d9aee99f425316b25fe026ddff282 100644 (file)
 #include "fileheader.h"
 #include "tapelist.h"
 #include "amfeatures.h"
+#include "device.h"
 
 #define CREAT_MODE  0640
 
-typedef struct match_list_s {
-    char *hostname;
-    char *diskname;
-    char *datestamp;
-    char *level;
-    struct match_list_s *next;
-} match_list_t;
-
 typedef struct rst_flags_s {
     unsigned int inline_assemble:1;
     unsigned int delay_assemble:1;
@@ -67,27 +60,49 @@ typedef struct rst_flags_s {
     char *inventory_log;
 } rst_flags_t;
 
+typedef struct {
+    enum { HOLDING_MODE, DEVICE_MODE} restore_mode;
+    dumpfile_t * header;
+    union {
+        int holding_fd;
+        Device * device;
+    } u;
+} RestoreSource;
+
+typedef struct seentapes_s seentapes_t;
+
 char *make_filename(dumpfile_t *file);
-int disk_match(dumpfile_t *file, char *datestamp,
-                   char *hostname, char *diskname, char *level);
 ssize_t read_file_header(dumpfile_t *file, int tapefd, int isafile,
                         rst_flags_t *flags);
-ssize_t restore(dumpfile_t *file, char *filename, int tapefd, int isafile,
-                       rst_flags_t *flags);
+void restore(RestoreSource * source, rst_flags_t * flags);
+gboolean restore_holding_disk(FILE * prompt_out,
+                              rst_flags_t * flags,
+                              am_feature_t * features,
+                              tapelist_t * file,
+                              seentapes_t ** seen,
+                              GSList * dumpspecs,
+                              dumpfile_t * this_header,
+                              dumpfile_t * last_header);
+
+gboolean search_a_tape(Device * device, FILE *prompt_out, rst_flags_t  *flags,
+                       am_feature_t *their_features, 
+                       tapelist_t   *desired_tape, GSList *dumpspecs,
+                       seentapes_t **tape_seen,
+                       dumpfile_t * first_restored_file, int tape_count,
+                       FILE * logstream);
+
 void flush_open_outputs(int reassemble, dumpfile_t *only_file);
 void search_tapes(FILE *prompt_out, FILE *prompt_in, int use_changer,
-                 tapelist_t *tapelist, match_list_t *restorethese,
+                 tapelist_t *tapelist, GSList *dumpspecs,
                  rst_flags_t *flags, am_feature_t *their_features);
 int have_all_parts(dumpfile_t *file, int upto);
 rst_flags_t *new_rst_flags(void);
 int check_rst_flags(rst_flags_t *flags);
 void free_rst_flags(rst_flags_t *flags);
-void free_match_list(match_list_t *match_list);
 int lock_logfile(void);
 void send_message(FILE *prompt_out, rst_flags_t *flags,
-                 am_feature_t *their_features, char * format, ...);
-       /*     __attribute__ ((format (printf, 4, 5))); */
-
+                 am_feature_t *their_features,
+                 char * format, ...) G_GNUC_PRINTF(4,5);
 
 #endif /* RESTORE_H */
 
index c883daf4ee0d8b5d061037e304026f8b4358d66c..0a03c66558948a7a4490fabdd0d227242dcedbab 100644 (file)
@@ -1,40 +1,73 @@
 # Makefile for Amanda server programs.
 
+include $(top_srcdir)/config/automake/vars.am
+include $(top_srcdir)/config/automake/scripts.am
+include $(top_srcdir)/config/automake/installperms.am
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/restore-src  \
-               -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/device-src   \
                -I$(top_srcdir)/gnulib
 
-LINT=@AMLINT@
-LINTFLAGS=@AMLINTFLAGS@
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
+LINT=$(AMLINT)
+LINTFLAGS=$(AMLINTFLAGS)
+
+amlib_LTLIBRARIES =    libamserver.la
 
-lib_LTLIBRARIES =      libamserver.la
-LIB_EXTENSION = la
+sbin_PROGRAMS =                amadmin         amcheck         \
+                       amflush         amgetconf       amlabel         \
+                       amtape          amreport
 
-sbin_PROGRAMS =                amadmin         amcheck         amflush         \
-                       amgetconf       amlabel         amtape          \
-                       amreport
+noinst_PROGRAMS = taper_source_test
 
-libexec_PROGRAMS =     amindexd        amlogroll       amtrmidx        \
+amlibexec_PROGRAMS =   amindexd        amlogroll       amtrmidx        \
                        amtrmlog        driver          dumper          \
                        planner         taper           amcleanupdisk   \
                        chunker
 
-sbin_SCRIPTS =         amcheckdb       amcleanup       amdump          \
-                       amoverview      amrmtape        amtoc           \
-                       amverify        amverifyrun     amstatus        \
-                       amcrypt         amaespipe       amcrypt-ossl    \
-                       amcrypt-ossl-asym
-
-libamserver_la_SOURCES=        amindex.c       changer.c                       \
-                       diskfile.c      driverio.c      cmdline.c  \
-                       holding.c       infofile.c      logfile.c       \
-                       tapefile.c      find.c          server_util.c   \
-                        taperscan.c
-
-libamserver_la_LDFLAGS= -release $(VERSION)
+# Exclude scripts which depend on perl extension modules from the syntax checks
+CHECK_PERL = \
+           amaddclient \
+           amoverview \
+           amserverconfig \
+           amstatus \
+           amtoc
+SCRIPTS_PERL =  \
+           $(CHECK_PERL) \
+           amdevcheck \
+           amcheckdump
+
+SCRIPTS_SHELL = \
+           amcheckdb \
+           amcleanup \
+           amdump \
+           amrmtape \
+           amverify \
+           amverifyrun
+
+sbin_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod= \
+               $(sbin_PROGRAMS) \
+       chown=root chmod=u+s,o-rwx \
+               amcheck \
+       dest=$(amlibexecdir) chown=amanda chmod= \
+               $(amlibexec_PROGRAMS) \
+       chown=root chmod=u+s,o-rwx \
+               dumper planner
+
+INSTALLPERMS_data = \
+       dest=$(sbindir) chown=amanda chmod= \
+               $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) chown=amanda chmod= \
+               $(amlibexec_SCRIPTS)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -43,41 +76,52 @@ libamserver_la_LDFLAGS= -release $(VERSION)
 # routines, and second to pick up any references in the other libraries.
 ###
 
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION)   \
-       libamserver.$(LIB_EXTENSION)               \
-       ../tape-src/libamtape.$(LIB_EXTENSION)     \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../tape-src/libamtape.$(LIB_EXTENSION)     \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../gnulib/libgnu.$(LIB_EXTENSION)          \
+LDADD = ../common-src/libamanda.la   \
+       libamserver.la               \
+       ../device-src/libamdevice.la     \
+       ../common-src/libamanda.la   \
+       ../gnulib/libgnu.la          \
         $(READLINE_LIBS)
 
-amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+libamserver_la_SOURCES=        amindex.c       changer.c                       \
+                       diskfile.c      driverio.c      cmdline.c  \
+                       holding.c       infofile.c      logfile.c       \
+                       tapefile.c      find.c          server_util.c   \
+                        taperscan.c
+
+libamserver_la_LDFLAGS= -release $(VERSION)
+libamserver_la_LIBADD= ../device-src/libamdevice.la \
+                      ../common-src/libamanda.la
+
+taper_source_test_SOURCES = taper-source-test.c \
+                       taper-source.c \
+                       taper-file-source.c \
+                       taper-port-source.c \
+                       taper-disk-port-source.c \
+                       taper-mem-port-source.c
+
+taper_SOURCES =        taper.c \
+                       taper-source.c \
+                       taper-file-source.c \
+                       taper-port-source.c \
+                       taper-disk-port-source.c \
+                       taper-mem-port-source.c
 
-SUFFIXES =             .sh .pl
+taper_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
 
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
+taper_source_test_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
 
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+amindexd_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
 
 # there are used for testing only:
 TEST_PROGS = diskfile infofile
 
 EXTRA_PROGRAMS =       $(TEST_PROGS)
 
-CLEANFILES = *.test.c $(sbin_SCRIPTS)
+CLEANFILES += *.test.c
 
 amindexd_CSRC =                amindexd.c      disk_history.c  list_dir.c
 amindexd_SOURCES =     disk_history.h  list_dir.h      $(amindexd_CSRC)
@@ -86,58 +130,16 @@ amreport_SOURCES = reporter.c
 
 amgetconf_SOURCES =    getconf.c
 
-noinst_HEADERS =       amindex.h       changer.h                       \
+noinst_HEADERS =       amindex.h       changer.h       cmdline.h       \
                        diskfile.h      driverio.h      \
                        holding.h       infofile.h      logfile.h       \
                        tapefile.h      find.h          server_util.h   \
-                       taperscan.h cmdline.h
-
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="amcheck"; \
-       for p in $$list; do \
-               if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-                       pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-                       echo chown root $$pa; \
-                       chown root $$pa; \
-                       echo chmod u+s,o-rwx $$pa; \
-                       chmod u+s,o-rwx $$pa; \
-               else true; \
-               fi; \
-       done
-##                                                    ##
-## enterprise version will install dumper/planner suid ##
-##                                                    ##
-
-       @list="dumper planner"; \
-       for p in $$list; do \
-               if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-                       pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-                       echo chown root $$pa; \
-                       chown root $$pa; \
-                       echo chmod u+s,o-rwx $$pa; \
-                       chmod u+s,o-rwx $$pa; \
-               else true; \
-               fi; \
-       done
+                       taperscan.h taper-disk-port-source.h \
+                       taper-mem-port-source.h  taper-file-source.h \
+                       taper-port-source.h taper-source.h
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do                     \
+       @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
                if [ $$p = "amindexd" ]; then                                   \
                        s="$(amindexd_CSRC)";                                   \
                elif [ $$p = "amreport" ]; then                                 \
@@ -153,7 +155,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index 1b30e78f811ff8bdb6315e0ccf90fcd53539aed6..1d8a134f85cb8eb944757647a82997e9177501f8 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda server programs.
 
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# simple include file to pre-define variables which are then +='d by other
+# scripts in this directory.
+
+# vim:ft=automake
+# Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License version 2.1 as 
+# published by the Free Software Foundation.
+# 
+# This library is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+# License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+# 
+# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+# SYNOPSIS:
+#
+# Automake magic to handle the various tasks of building scripts.  Scripts can
+# be built down to extensionless executables (e.g., foo.pl -> foo), or to 
+# files with the usual extension (foo-lib.sh.in -> foo.sh).
+#
+# Files which support it are syntax-checked when the user invokes 'make check'.
+#
+# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and 
+# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'.
+#
+# USAGE:
+#
+#   include $(top_srcdir)/config/automake/vars.am
+#   include $(top_srcdir)/config/automake/scripts.am
+#   ...
+#   SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm
+#   SCRIPTS_SHELL = shell1 shell2 sh-lib.sh
+#   SCRIPTS_AWK = talk balk chalk awk-lib.awk
+#
+# with the corresponding files in the repository:
+#
+#   fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in
+#   shell1.sh shell2.sh sh-lib.sh.in
+#   talk.awk balk.awk chalk.awk awk-lib.awk.in
+#
+# by default, all shell and perl scripts are syntax checked.  If this is
+# a problem (for example, perl scripts depending on Amanda extension 
+# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish
+# to be checked (which can be empty).
+#
+# To add extra flags to the perl checks (e.g., to add new -I flags), set
+# CHECK_PERL_FLAGS.
+
+# Implementation note:
+#
+# This file uses config.status to substitute @foo@ in those scripts while
+# converting them. It also adds the executable bits (a+x) to extensionless
+# files.  The substitution works even though the files are not listed in 
+# configure.in
+
+# vim:ft=automake
+#
+# Adjust post-install permissions settings.  This rule works off two
+# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. 
+# Each is a whitespace-separated list of commands, all of which are either
+# a variable assignment or a filename.  Three variables are available:
+#
+#  - dest= sets the destination directory to e.g., $(sbindir)
+#  - chown= controls changes in ownership; value is first argument to chown
+#  - chmod= controls changes in permissions; value is first argument to chmod
+#
+# As a special case, chown=amanda is taken as equivalent to 
+# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with
+# whitespace in the user/group names.
+# 
+# when a filename is seen, the currently active variables are applied.
+#
+# Note that scripts are data, not executables!
+#
+# EXAMPLE
+#
+# sbin_PROGRAMS = foo bar bing
+# libexec_PROGRAMS = pro gram
+# sbin_SCRIPTS = sk ript
+# INSTALLPERMS_exec = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              foo bar \
+#      chmod=u+s,o-rwx \
+#              bing
+#      dest=$(libexecdir) chmod= \
+#              $(libexec_PROGRAMS)
+# INSTALLPERMS_data = \
+#      dest=$(sbindir) chown=amanda chmod= \
+#              $(sbin_SCRIPTS)
+#
+# This whole operation is not required when making builds for packaging,
+# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS
+# AM_CONDITIONAL.
+
+# vim:ft=automake
+
 
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -42,318 +161,320 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/installperms.am \
+       $(top_srcdir)/config/automake/precompile.am \
+       $(top_srcdir)/config/automake/scripts.am \
+       $(top_srcdir)/config/automake/vars.am
 sbin_PROGRAMS = amadmin$(EXEEXT) amcheck$(EXEEXT) amflush$(EXEEXT) \
        amgetconf$(EXEEXT) amlabel$(EXEEXT) amtape$(EXEEXT) \
        amreport$(EXEEXT)
-libexec_PROGRAMS = amindexd$(EXEEXT) amlogroll$(EXEEXT) \
+noinst_PROGRAMS = taper_source_test$(EXEEXT)
+amlibexec_PROGRAMS = amindexd$(EXEEXT) amlogroll$(EXEEXT) \
        amtrmidx$(EXEEXT) amtrmlog$(EXEEXT) driver$(EXEEXT) \
        dumper$(EXEEXT) planner$(EXEEXT) taper$(EXEEXT) \
        amcleanupdisk$(EXEEXT) chunker$(EXEEXT)
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
 subdir = server-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/amaespipe.sh.in \
-       $(srcdir)/amcheckdb.sh.in $(srcdir)/amcleanup.sh.in \
-       $(srcdir)/amcrypt-ossl-asym.sh.in $(srcdir)/amcrypt-ossl.sh.in \
-       $(srcdir)/amcrypt.sh.in $(srcdir)/amdump.sh.in \
-       $(srcdir)/amfreetapes.sh.in $(srcdir)/amoverview.pl.in \
-       $(srcdir)/amrmtape.sh.in $(srcdir)/amstatus.pl.in \
-       $(srcdir)/amtoc.pl.in $(srcdir)/amverify.sh.in \
-       $(srcdir)/amverifyrun.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = amcheckdb.sh amcleanup.sh amdump.sh \
-       amfreetapes.sh amoverview.pl amrmtape.sh amtoc.pl amverify.sh \
-       amstatus.pl amverifyrun.sh amcrypt.sh amaespipe.sh \
-       amcrypt-ossl.sh amcrypt-ossl-asym.sh
+CONFIG_CLEAN_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 = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
        "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libamserver_la_LIBADD =
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamserver_la_DEPENDENCIES = ../device-src/libamdevice.la \
+       ../common-src/libamanda.la
 am_libamserver_la_OBJECTS = amindex.lo changer.lo diskfile.lo \
        driverio.lo cmdline.lo holding.lo infofile.lo logfile.lo \
        tapefile.lo find.lo server_util.lo taperscan.lo
 libamserver_la_OBJECTS = $(am_libamserver_la_OBJECTS)
+libamserver_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamserver_la_LDFLAGS) $(LDFLAGS) -o $@
 am__EXEEXT_1 = diskfile$(EXEEXT) infofile$(EXEEXT)
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS)
+PROGRAMS = $(amlibexec_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
 amadmin_SOURCES = amadmin.c
 amadmin_OBJECTS = amadmin.$(OBJEXT)
 amadmin_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
-amadmin_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amadmin_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amcheck_SOURCES = amcheck.c
 amcheck_OBJECTS = amcheck.$(OBJEXT)
 amcheck_LDADD = $(LDADD)
-amcheck_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amcheck_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amcleanupdisk_SOURCES = amcleanupdisk.c
 amcleanupdisk_OBJECTS = amcleanupdisk.$(OBJEXT)
 amcleanupdisk_LDADD = $(LDADD)
-amcleanupdisk_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amcleanupdisk_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amflush_SOURCES = amflush.c
 amflush_OBJECTS = amflush.$(OBJEXT)
 amflush_LDADD = $(LDADD)
-amflush_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amflush_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am_amgetconf_OBJECTS = getconf.$(OBJEXT)
 amgetconf_OBJECTS = $(am_amgetconf_OBJECTS)
 amgetconf_LDADD = $(LDADD)
-amgetconf_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amgetconf_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am__objects_1 = amindexd.$(OBJEXT) disk_history.$(OBJEXT) \
        list_dir.$(OBJEXT)
 am_amindexd_OBJECTS = $(am__objects_1)
 amindexd_OBJECTS = $(am_amindexd_OBJECTS)
-amindexd_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+am__DEPENDENCIES_2 = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
+amindexd_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       ../amandad-src/libamandad.la
 amlabel_SOURCES = amlabel.c
 amlabel_OBJECTS = amlabel.$(OBJEXT)
 amlabel_LDADD = $(LDADD)
-amlabel_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amlabel_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amlogroll_SOURCES = amlogroll.c
 amlogroll_OBJECTS = amlogroll.$(OBJEXT)
 amlogroll_LDADD = $(LDADD)
-amlogroll_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amlogroll_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am_amreport_OBJECTS = reporter.$(OBJEXT)
 amreport_OBJECTS = $(am_amreport_OBJECTS)
 amreport_LDADD = $(LDADD)
-amreport_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amreport_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amtape_SOURCES = amtape.c
 amtape_OBJECTS = amtape.$(OBJEXT)
 amtape_LDADD = $(LDADD)
-amtape_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amtape_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amtrmidx_SOURCES = amtrmidx.c
 amtrmidx_OBJECTS = amtrmidx.$(OBJEXT)
 amtrmidx_LDADD = $(LDADD)
-amtrmidx_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amtrmidx_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 amtrmlog_SOURCES = amtrmlog.c
 amtrmlog_OBJECTS = amtrmlog.$(OBJEXT)
 amtrmlog_LDADD = $(LDADD)
-amtrmlog_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+amtrmlog_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 chunker_SOURCES = chunker.c
 chunker_OBJECTS = chunker.$(OBJEXT)
 chunker_LDADD = $(LDADD)
-chunker_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+chunker_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am_diskfile_OBJECTS = diskfile.test.$(OBJEXT)
 diskfile_OBJECTS = $(am_diskfile_OBJECTS)
 diskfile_LDADD = $(LDADD)
-diskfile_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+diskfile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 driver_SOURCES = driver.c
 driver_OBJECTS = driver.$(OBJEXT)
 driver_LDADD = $(LDADD)
-driver_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+driver_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 dumper_SOURCES = dumper.c
 dumper_OBJECTS = dumper.$(OBJEXT)
 dumper_LDADD = $(LDADD)
-dumper_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+dumper_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 am_infofile_OBJECTS = infofile.test.$(OBJEXT)
 infofile_OBJECTS = $(am_infofile_OBJECTS)
 infofile_LDADD = $(LDADD)
-infofile_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+infofile_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
 planner_SOURCES = planner.c
 planner_OBJECTS = planner.$(OBJEXT)
 planner_LDADD = $(LDADD)
-planner_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-taper_SOURCES = taper.c
-taper_OBJECTS = taper.$(OBJEXT)
-taper_LDADD = $(LDADD)
-taper_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+planner_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
+       ../device-src/libamdevice.la ../common-src/libamanda.la \
+       ../gnulib/libgnu.la $(am__DEPENDENCIES_1)
+am_taper_OBJECTS = taper.$(OBJEXT) taper-source.$(OBJEXT) \
+       taper-file-source.$(OBJEXT) taper-port-source.$(OBJEXT) \
+       taper-disk-port-source.$(OBJEXT) \
+       taper-mem-port-source.$(OBJEXT)
+taper_OBJECTS = $(am_taper_OBJECTS)
+taper_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       ../amandad-src/libamandad.la
+am_taper_source_test_OBJECTS = taper-source-test.$(OBJEXT) \
+       taper-source.$(OBJEXT) taper-file-source.$(OBJEXT) \
+       taper-port-source.$(OBJEXT) taper-disk-port-source.$(OBJEXT) \
+       taper-mem-port-source.$(OBJEXT)
+taper_source_test_OBJECTS = $(am_taper_source_test_OBJECTS)
+taper_source_test_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       ../amandad-src/libamandad.la
 sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(sbin_SCRIPTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
        amcleanupdisk.c amflush.c $(amgetconf_SOURCES) \
        $(amindexd_SOURCES) amlabel.c amlogroll.c $(amreport_SOURCES) \
        amtape.c amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) \
-       driver.c dumper.c $(infofile_SOURCES) planner.c taper.c
+       driver.c dumper.c $(infofile_SOURCES) planner.c \
+       $(taper_SOURCES) $(taper_source_test_SOURCES)
 DIST_SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
        amcleanupdisk.c amflush.c $(amgetconf_SOURCES) \
        $(amindexd_SOURCES) amlabel.c amlogroll.c $(amreport_SOURCES) \
        amtape.c amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) \
-       driver.c dumper.c $(infofile_SOURCES) planner.c taper.c
+       driver.c dumper.c $(infofile_SOURCES) planner.c \
+       $(taper_SOURCES) $(taper_source_test_SOURCES)
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -361,14 +482,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -379,20 +505,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -406,60 +531,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -469,10 +703,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -483,24 +731,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -512,59 +794,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -573,49 +842,101 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUFFIXES = 
+EXTRA_DIST = 
+BUILT_SOURCES = 
+MOSTLYCLEANFILES = 
+
+# config.status leaves config.log files around
+CLEANFILES = config.log *.test.c
+
+# and we'll need to clean up our generated files for distclean
+DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK)
+MAINTAINERCLEANFILES = 
+
+# syntax-check shell scripts on 'make check'
+CHECK_SHELL = $(SCRIPTS_SHELL)
+
+# sed expression to strip leading directories from a filename; this converts e.g.,
+# src/foo/bar.so to bar.so.
+strip_leading_dirs = s|^.*/||
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/restore-src  \
-               -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/device-src   \
                -I$(top_srcdir)/gnulib
 
-LINT = @AMLINT@
-LINTFLAGS = @AMLINTFLAGS@
-lib_LTLIBRARIES = libamserver.la
-LIB_EXTENSION = la
-sbin_SCRIPTS = amcheckdb       amcleanup       amdump          \
-                       amoverview      amrmtape        amtoc           \
-                       amverify        amverifyrun     amstatus        \
-                       amcrypt         amaespipe       amcrypt-ossl    \
-                       amcrypt-ossl-asym
-
-libamserver_la_SOURCES = amindex.c     changer.c                       \
-                       diskfile.c      driverio.c      cmdline.c  \
-                       holding.c       infofile.c      logfile.c       \
-                       tapefile.c      find.c          server_util.c   \
-                        taperscan.c
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+LINT = $(AMLINT)
+LINTFLAGS = $(AMLINTFLAGS)
+amlib_LTLIBRARIES = libamserver.la
+
+# Exclude scripts which depend on perl extension modules from the syntax checks
+CHECK_PERL = \
+           amaddclient \
+           amoverview \
+           amserverconfig \
+           amstatus \
+           amtoc
+
+SCRIPTS_PERL = \
+           $(CHECK_PERL) \
+           amdevcheck \
+           amcheckdump
+
+SCRIPTS_SHELL = \
+           amcheckdb \
+           amcleanup \
+           amdump \
+           amrmtape \
+           amverify \
+           amverifyrun
+
+sbin_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda chmod= \
+               $(sbin_PROGRAMS) \
+       chown=root chmod=u+s,o-rwx \
+               amcheck \
+       dest=$(amlibexecdir) chown=amanda chmod= \
+               $(amlibexec_PROGRAMS) \
+       chown=root chmod=u+s,o-rwx \
+               dumper planner
+
+INSTALLPERMS_data = \
+       dest=$(sbindir) chown=amanda chmod= \
+               $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) chown=amanda chmod= \
+               $(amlibexec_SCRIPTS)
 
-libamserver_la_LDFLAGS = -release $(VERSION)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -623,46 +944,69 @@ libamserver_la_LDFLAGS = -release $(VERSION)
 # need to list libamanda twice here, first to override the system library
 # routines, and second to pick up any references in the other libraries.
 ###
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION)   \
-       libamserver.$(LIB_EXTENSION)               \
-       ../tape-src/libamtape.$(LIB_EXTENSION)     \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../tape-src/libamtape.$(LIB_EXTENSION)     \
-       ../common-src/libamanda.$(LIB_EXTENSION)   \
-       ../gnulib/libgnu.$(LIB_EXTENSION)          \
+LDADD = ../common-src/libamanda.la   \
+       libamserver.la               \
+       ../device-src/libamdevice.la     \
+       ../common-src/libamanda.la   \
+       ../gnulib/libgnu.la          \
         $(READLINE_LIBS)
 
-amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../gnulib/libgnu.$(LIB_EXTENSION)
+libamserver_la_SOURCES = amindex.c     changer.c                       \
+                       diskfile.c      driverio.c      cmdline.c  \
+                       holding.c       infofile.c      logfile.c       \
+                       tapefile.c      find.c          server_util.c   \
+                        taperscan.c
+
+libamserver_la_LDFLAGS = -release $(VERSION)
+libamserver_la_LIBADD = ../device-src/libamdevice.la \
+                      ../common-src/libamanda.la
+
+taper_source_test_SOURCES = taper-source-test.c \
+                       taper-source.c \
+                       taper-file-source.c \
+                       taper-port-source.c \
+                       taper-disk-port-source.c \
+                       taper-mem-port-source.c
+
+taper_SOURCES = taper.c \
+                       taper-source.c \
+                       taper-file-source.c \
+                       taper-port-source.c \
+                       taper-disk-port-source.c \
+                       taper-mem-port-source.c
+
+taper_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
+
+taper_source_test_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
+
+amindexd_LDADD = $(LDADD) \
+       ../amandad-src/libamandad.la
 
-SUFFIXES = .sh .pl
 
 # there are used for testing only:
 TEST_PROGS = diskfile infofile
-CLEANFILES = *.test.c $(sbin_SCRIPTS)
 amindexd_CSRC = amindexd.c     disk_history.c  list_dir.c
 amindexd_SOURCES = disk_history.h      list_dir.h      $(amindexd_CSRC)
 amreport_SOURCES = reporter.c
 amgetconf_SOURCES = getconf.c
-noinst_HEADERS = amindex.h     changer.h                       \
+noinst_HEADERS = amindex.h     changer.h       cmdline.h       \
                        diskfile.h      driverio.h      \
                        holding.h       infofile.h      logfile.h       \
                        tapefile.h      find.h          server_util.h   \
-                       taperscan.h cmdline.h
+                       taperscan.h taper-disk-port-source.h \
+                       taper-mem-port-source.h  taper-file-source.h \
+                       taper-port-source.h taper-source.h
 
 diskfile_SOURCES = diskfile.test.c
 infofile_SOURCES = infofile.test.c
-all: all-am
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sh .pl .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -691,94 +1035,73 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-amcheckdb.sh: $(top_builddir)/config.status $(srcdir)/amcheckdb.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amcleanup.sh: $(top_builddir)/config.status $(srcdir)/amcleanup.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amdump.sh: $(top_builddir)/config.status $(srcdir)/amdump.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amfreetapes.sh: $(top_builddir)/config.status $(srcdir)/amfreetapes.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amoverview.pl: $(top_builddir)/config.status $(srcdir)/amoverview.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amrmtape.sh: $(top_builddir)/config.status $(srcdir)/amrmtape.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amtoc.pl: $(top_builddir)/config.status $(srcdir)/amtoc.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amverify.sh: $(top_builddir)/config.status $(srcdir)/amverify.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amstatus.pl: $(top_builddir)/config.status $(srcdir)/amstatus.pl.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amverifyrun.sh: $(top_builddir)/config.status $(srcdir)/amverifyrun.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amcrypt.sh: $(top_builddir)/config.status $(srcdir)/amcrypt.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amaespipe.sh: $(top_builddir)/config.status $(srcdir)/amaespipe.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amcrypt-ossl.sh: $(top_builddir)/config.status $(srcdir)/amcrypt-ossl.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-amcrypt-ossl-asym.sh: $(top_builddir)/config.status $(srcdir)/amcrypt-ossl-asym.sh.in
-       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 libamserver.la: $(libamserver_la_OBJECTS) $(libamserver_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(libamserver_la_LDFLAGS) $(libamserver_la_OBJECTS) $(libamserver_la_LIBADD) $(LIBS)
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
+       $(libamserver_la_LINK) -rpath $(amlibdir) $(libamserver_la_OBJECTS) $(libamserver_la_LIBADD) $(LIBS)
+install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)"
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
             || test -f $$p1 \
          ; then \
            f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \
          else :; fi; \
        done
 
-uninstall-libexecPROGRAMS:
+uninstall-amlibexecPROGRAMS:
        @$(NORMAL_UNINSTALL)
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
          f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
-         rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+         echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \
        done
 
-clean-libexecPROGRAMS:
-       @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+clean-amlibexecPROGRAMS:
+       @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; for p in $$list; do \
          f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          echo " rm -f $$p $$f"; \
          rm -f $$p $$f ; \
        done
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
@@ -806,64 +1129,67 @@ clean-sbinPROGRAMS:
        done
 amadmin$(EXEEXT): $(amadmin_OBJECTS) $(amadmin_DEPENDENCIES) 
        @rm -f amadmin$(EXEEXT)
-       $(LINK) $(amadmin_LDFLAGS) $(amadmin_OBJECTS) $(amadmin_LDADD) $(LIBS)
+       $(LINK) $(amadmin_OBJECTS) $(amadmin_LDADD) $(LIBS)
 amcheck$(EXEEXT): $(amcheck_OBJECTS) $(amcheck_DEPENDENCIES) 
        @rm -f amcheck$(EXEEXT)
-       $(LINK) $(amcheck_LDFLAGS) $(amcheck_OBJECTS) $(amcheck_LDADD) $(LIBS)
+       $(LINK) $(amcheck_OBJECTS) $(amcheck_LDADD) $(LIBS)
 amcleanupdisk$(EXEEXT): $(amcleanupdisk_OBJECTS) $(amcleanupdisk_DEPENDENCIES) 
        @rm -f amcleanupdisk$(EXEEXT)
-       $(LINK) $(amcleanupdisk_LDFLAGS) $(amcleanupdisk_OBJECTS) $(amcleanupdisk_LDADD) $(LIBS)
+       $(LINK) $(amcleanupdisk_OBJECTS) $(amcleanupdisk_LDADD) $(LIBS)
 amflush$(EXEEXT): $(amflush_OBJECTS) $(amflush_DEPENDENCIES) 
        @rm -f amflush$(EXEEXT)
-       $(LINK) $(amflush_LDFLAGS) $(amflush_OBJECTS) $(amflush_LDADD) $(LIBS)
+       $(LINK) $(amflush_OBJECTS) $(amflush_LDADD) $(LIBS)
 amgetconf$(EXEEXT): $(amgetconf_OBJECTS) $(amgetconf_DEPENDENCIES) 
        @rm -f amgetconf$(EXEEXT)
-       $(LINK) $(amgetconf_LDFLAGS) $(amgetconf_OBJECTS) $(amgetconf_LDADD) $(LIBS)
+       $(LINK) $(amgetconf_OBJECTS) $(amgetconf_LDADD) $(LIBS)
 amindexd$(EXEEXT): $(amindexd_OBJECTS) $(amindexd_DEPENDENCIES) 
        @rm -f amindexd$(EXEEXT)
-       $(LINK) $(amindexd_LDFLAGS) $(amindexd_OBJECTS) $(amindexd_LDADD) $(LIBS)
+       $(LINK) $(amindexd_OBJECTS) $(amindexd_LDADD) $(LIBS)
 amlabel$(EXEEXT): $(amlabel_OBJECTS) $(amlabel_DEPENDENCIES) 
        @rm -f amlabel$(EXEEXT)
-       $(LINK) $(amlabel_LDFLAGS) $(amlabel_OBJECTS) $(amlabel_LDADD) $(LIBS)
+       $(LINK) $(amlabel_OBJECTS) $(amlabel_LDADD) $(LIBS)
 amlogroll$(EXEEXT): $(amlogroll_OBJECTS) $(amlogroll_DEPENDENCIES) 
        @rm -f amlogroll$(EXEEXT)
-       $(LINK) $(amlogroll_LDFLAGS) $(amlogroll_OBJECTS) $(amlogroll_LDADD) $(LIBS)
+       $(LINK) $(amlogroll_OBJECTS) $(amlogroll_LDADD) $(LIBS)
 amreport$(EXEEXT): $(amreport_OBJECTS) $(amreport_DEPENDENCIES) 
        @rm -f amreport$(EXEEXT)
-       $(LINK) $(amreport_LDFLAGS) $(amreport_OBJECTS) $(amreport_LDADD) $(LIBS)
+       $(LINK) $(amreport_OBJECTS) $(amreport_LDADD) $(LIBS)
 amtape$(EXEEXT): $(amtape_OBJECTS) $(amtape_DEPENDENCIES) 
        @rm -f amtape$(EXEEXT)
-       $(LINK) $(amtape_LDFLAGS) $(amtape_OBJECTS) $(amtape_LDADD) $(LIBS)
+       $(LINK) $(amtape_OBJECTS) $(amtape_LDADD) $(LIBS)
 amtrmidx$(EXEEXT): $(amtrmidx_OBJECTS) $(amtrmidx_DEPENDENCIES) 
        @rm -f amtrmidx$(EXEEXT)
-       $(LINK) $(amtrmidx_LDFLAGS) $(amtrmidx_OBJECTS) $(amtrmidx_LDADD) $(LIBS)
+       $(LINK) $(amtrmidx_OBJECTS) $(amtrmidx_LDADD) $(LIBS)
 amtrmlog$(EXEEXT): $(amtrmlog_OBJECTS) $(amtrmlog_DEPENDENCIES) 
        @rm -f amtrmlog$(EXEEXT)
-       $(LINK) $(amtrmlog_LDFLAGS) $(amtrmlog_OBJECTS) $(amtrmlog_LDADD) $(LIBS)
+       $(LINK) $(amtrmlog_OBJECTS) $(amtrmlog_LDADD) $(LIBS)
 chunker$(EXEEXT): $(chunker_OBJECTS) $(chunker_DEPENDENCIES) 
        @rm -f chunker$(EXEEXT)
-       $(LINK) $(chunker_LDFLAGS) $(chunker_OBJECTS) $(chunker_LDADD) $(LIBS)
+       $(LINK) $(chunker_OBJECTS) $(chunker_LDADD) $(LIBS)
 diskfile$(EXEEXT): $(diskfile_OBJECTS) $(diskfile_DEPENDENCIES) 
        @rm -f diskfile$(EXEEXT)
-       $(LINK) $(diskfile_LDFLAGS) $(diskfile_OBJECTS) $(diskfile_LDADD) $(LIBS)
+       $(LINK) $(diskfile_OBJECTS) $(diskfile_LDADD) $(LIBS)
 driver$(EXEEXT): $(driver_OBJECTS) $(driver_DEPENDENCIES) 
        @rm -f driver$(EXEEXT)
-       $(LINK) $(driver_LDFLAGS) $(driver_OBJECTS) $(driver_LDADD) $(LIBS)
+       $(LINK) $(driver_OBJECTS) $(driver_LDADD) $(LIBS)
 dumper$(EXEEXT): $(dumper_OBJECTS) $(dumper_DEPENDENCIES) 
        @rm -f dumper$(EXEEXT)
-       $(LINK) $(dumper_LDFLAGS) $(dumper_OBJECTS) $(dumper_LDADD) $(LIBS)
+       $(LINK) $(dumper_OBJECTS) $(dumper_LDADD) $(LIBS)
 infofile$(EXEEXT): $(infofile_OBJECTS) $(infofile_DEPENDENCIES) 
        @rm -f infofile$(EXEEXT)
-       $(LINK) $(infofile_LDFLAGS) $(infofile_OBJECTS) $(infofile_LDADD) $(LIBS)
+       $(LINK) $(infofile_OBJECTS) $(infofile_LDADD) $(LIBS)
 planner$(EXEEXT): $(planner_OBJECTS) $(planner_DEPENDENCIES) 
        @rm -f planner$(EXEEXT)
-       $(LINK) $(planner_LDFLAGS) $(planner_OBJECTS) $(planner_LDADD) $(LIBS)
+       $(LINK) $(planner_OBJECTS) $(planner_LDADD) $(LIBS)
 taper$(EXEEXT): $(taper_OBJECTS) $(taper_DEPENDENCIES) 
        @rm -f taper$(EXEEXT)
-       $(LINK) $(taper_LDFLAGS) $(taper_OBJECTS) $(taper_LDADD) $(LIBS)
+       $(LINK) $(taper_OBJECTS) $(taper_LDADD) $(LIBS)
+taper_source_test$(EXEEXT): $(taper_source_test_OBJECTS) $(taper_source_test_DEPENDENCIES) 
+       @rm -f taper_source_test$(EXEEXT)
+       $(LINK) $(taper_source_test_OBJECTS) $(taper_source_test_LDADD) $(LIBS)
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_SCRIPTS)'; for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f $$d$$p; then \
@@ -918,26 +1244,32 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reporter.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server_util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapefile.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-disk-port-source.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-file-source.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-mem-port-source.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-port-source.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-source-test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper-source.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taper.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taperscan.Plo@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -948,10 +1280,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -1001,22 +1329,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -1027,14 +1354,20 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
 check-am: all-am
-check: check-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-am
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -1049,26 +1382,33 @@ install-strip:
          `test -z '$(STRIP)' || \
            echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 clean-generic:
        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+@WANT_INSTALLPERMS_FALSE@install-exec-hook:
+@WANT_INSTALLPERMS_FALSE@install-data-hook:
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \
-       clean-libtool clean-sbinPROGRAMS mostlyclean-am
+clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
+       clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS \
+       mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -1080,17 +1420,27 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
 
-install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS \
-       install-sbinPROGRAMS install-sbinSCRIPTS
+install-exec-am: install-amlibexecPROGRAMS install-sbinPROGRAMS \
+       install-sbinSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 
+install-html: install-html-am
+
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -1111,79 +1461,163 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS \
-       uninstall-sbinSCRIPTS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool \
-       clean-sbinPROGRAMS ctags distclean distclean-compile \
-       distclean-generic distclean-libtool distclean-tags distdir dvi \
-       dvi-am html html-am info info-am install install-am \
-       install-data install-data-am install-exec install-exec-am \
-       install-exec-hook install-info install-info-am \
-       install-libLTLIBRARIES install-libexecPROGRAMS install-man \
-       install-sbinPROGRAMS install-sbinSCRIPTS install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-info-am \
-       uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS \
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
 
+.MAKE: install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+       clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \
+       clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS ctags \
+       dist-hook distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am \
+       install-amlibLTLIBRARIES install-amlibexecPROGRAMS \
+       install-data install-data-am install-data-hook install-dvi \
+       install-dvi-am install-exec install-exec-am install-exec-hook \
+       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-sbinSCRIPTS \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
+       uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
 
-.pl:
-                       cat $< > $@
-                       chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
 
-.sh:
-                       cat $< > $@
-                       chmod a+x $@
+# Perl
+%: %.pl $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="amcheck"; \
-       for p in $$list; do \
-               if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-                       pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-                       echo chown root $$pa; \
-                       chown root $$pa; \
-                       echo chmod u+s,o-rwx $$pa; \
-                       chmod u+s,o-rwx $$pa; \
-               else true; \
-               fi; \
-       done
+%.pl: %.pl.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+%.pm: %.pm.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Shell
+%: %.sh $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.sh: %.sh.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+
+# Awk
+%: %.awk $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
+       chmod a+x $@
+
+%.awk: %.awk.in $(top_builddir)/config.status
+       $(top_builddir)/config.status --file=$@:$<
 
-       @list="dumper planner"; \
-       for p in $$list; do \
-               if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
-                       pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-                       echo chown root $$pa; \
-                       chown root $$pa; \
-                       echo chmod u+s,o-rwx $$pa; \
-                       chmod u+s,o-rwx $$pa; \
-               else true; \
+# syntax-check perl scripts on 'make check'
+check-perl: $(CHECK_PERL)
+       @CHECK_PERL="$(CHECK_PERL)"; \
+       if test -n "$(PERL)"; then \
+               for perlobj in $$CHECK_PERL; do \
+                       $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \
+               done; \
+       fi
+check-local: check-perl
+check-shell: $(CHECK_SHELL)
+       @CHECK_SHELL="$(CHECK_SHELL)"; \
+       if test -n "$$CHECK_SHELL"; then \
+               if test -n "$(BASH)"; then \
+                       for shobj in $$CHECK_SHELL; do \
+                               if $(BASH) -n $$shobj; then \
+                                       echo "$$shobj syntax OK"; \
+                               else \
+                                       echo "$$shobj syntax error"; \
+                                       exit 1; \
+                               fi; \
+                       done; \
+               else \
+                       echo "No 'bash' available -- cannot syntax-check shell scripts"; \
                fi; \
-       done
+       fi
+check-local: check-shell
+
+# make sure that the sources for all shell and perl scripts get included
+# in the distribution
+dist-scripts:
+       SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \
+       for script in $$SCRIPTS_PERL; do \
+               test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL; do \
+               test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \
+       done; \
+       for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \
+               test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \
+       done; \
+       true
+dist-hook: dist-scripts
+
+@WANT_INSTALLPERMS_TRUE@installperms-exec:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_exec)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on executables"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@installperms-data:
+@WANT_INSTALLPERMS_TRUE@       @installperms="$(INSTALLPERMS_data)"; \
+@WANT_INSTALLPERMS_TRUE@       test -n "$$installperms" && echo "Setting installation permissions on data"; \
+@WANT_INSTALLPERMS_TRUE@       dest=; chown=; chmod=; \
+@WANT_INSTALLPERMS_TRUE@       for cmd in $$installperms; do \
+@WANT_INSTALLPERMS_TRUE@           case "$$cmd" in \
+@WANT_INSTALLPERMS_TRUE@               chown=amanda) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \
+@WANT_INSTALLPERMS_TRUE@               dest=*|chown=*|chmod=*) \
+@WANT_INSTALLPERMS_TRUE@                       echo "  ($$cmd)"; eval $$cmd;; \
+@WANT_INSTALLPERMS_TRUE@               *)  pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chown"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chown "$$chown" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chown "$$chown" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@                   if test -n "$$chmod"; then \
+@WANT_INSTALLPERMS_TRUE@                       echo chmod "$$chmod" "$$pa"; \
+@WANT_INSTALLPERMS_TRUE@                       chmod "$$chmod" "$$pa" || exit 1; \
+@WANT_INSTALLPERMS_TRUE@                   fi; \
+@WANT_INSTALLPERMS_TRUE@           esac; \
+@WANT_INSTALLPERMS_TRUE@       done
+
+@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec
+@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 lint:
-       @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do                     \
+       @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
                if [ $$p = "amindexd" ]; then                                   \
                        s="$(amindexd_CSRC)";                                   \
                elif [ $$p = "amreport" ]; then                                 \
@@ -1199,7 +1633,7 @@ lint:
                (cd ../tape-src; make listlibsrc);                              \
                f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
diff --git a/server-src/amaddclient.pl b/server-src/amaddclient.pl
new file mode 100755 (executable)
index 0000000..510b0e6
--- /dev/null
@@ -0,0 +1,497 @@
+#!@PERL@
+#
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+
+use Getopt::Long;
+use Time::Local;
+use File::Copy;
+use Socket;   # for gethostbyname
+
+my $confdir="@CONFIG_DIR@";
+my $tmpdir="@AMANDA_DBGDIR@";
+
+my $prefix="@prefix@";
+my $localstatedir="@localstatedir@";
+my $amandahomedir="$localstatedir/lib/amanda";
+
+my $amanda_user="@CLIENT_LOGIN@";
+my $amanda_group="disk";
+my $def_root_user="root";
+my $def_dumptype="user-tar";
+
+my $sp_diskfile=0;
+
+# Get the version suffix.
+my $USE_VERSION_SUFFIXES = '@USE_VERSION_SUFFIXES@';
+my $suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+        $suf='-@VERSION@';
+}
+
+
+sub usage {
+        print "$0 $suf\n";      
+        print "\t\t--config <config>         Required. Ex: DailySet1\n";       
+       print "\t\t--client <FQDN-name>      Required. Ex: server.zmanda.com\n";
+        print "\t\t--diskdev <directory>     Required. Ex: /home\n";
+       print "\t\t--m                       Modify exisiting entry\n";
+       print "\t\t[--dumptype <dumptype>    Default: user-tar]\n";
+        print "\t\t[--includefile <string>   glob expression of file(s) to include]\n";
+       print "\t\t[--includelist <file>     file contains glob expressions to include]\n";
+       print "\t\t[ specify either --includefile or --includelist ]\n";
+       print "\t\t[--excludefile <string>   glob expression of file(s) to exclude]\n";
+       print "\t\t[--excludelist <file>     file contains glob expressions to exclude]\n";
+       print "\t\t[ specify either --excludefile or --excludelist ]\n";
+       print "\t\t[--user <username>          name of user running amrecover on the client]\n";
+       print "\t\t[--auth <string>            authentication used when running amrecover]\n";
+       print "\t\t[--gnutar_list_dir <string> directory where gnutar keep its state file on the client]\n";
+       print "\t\t[--amandates <string>       file where amanda keep the date of dumplevel on the client]\n";
+       print "\t\t[--batch                    batch mode used when copying file to client]\n";
+       print "\t\t[--no-client-update         do not update files on the client";
+        print "\t\t[--help]\n";
+}
+
+sub mprint {
+    for $fh ( STDOUT, LOG ) {
+       print $fh @_;
+    }
+}
+
+sub log_and_die {
+    print LOG @_;
+    die @_;
+}
+
+sub is_user_right {
+    my $user = `whoami`;
+    chomp($user);
+    ( $user eq $amanda_user ) ||
+       die ("ERROR: $0 must be run by $amanda_user\n");
+}
+
+
+# alphabetics, numerics, and underscores, 
+# hyphen, at sign, dot and "/" are ok
+sub is_tainted { 
+ local($arg) = @_;
+ if ( $arg  =~ /^([-\@\/\w.]+)$/ ) {
+        return 0; # ok
+    } else {
+        return 1; # bad, tainted input
+    }
+}
+
+
+# modify existing entry. 
+# only got here if -m is used and entry is found.
+sub dle_mod {
+    my $open_seen=0;     # '{' is seen
+    my $include_done=0;  # original include line is parsed
+    my $exclude_done=0;  # original exclude line is parsed
+    my $ok=0;            # 1 if target entry is found
+
+    @ARGV = ("$confdir/$config/disklist");
+    $^I = ".tmp"; # allow inplace editing
+    while (<>) {
+       my ($one, $two, $three ) = split(/\s+/, $_);
+
+       # if include or exclude is not previously there, 
+       # take care of them here
+       if ( $one eq "}" ) {
+           $open_seen=0;
+               if ( $include_done==0 && $ok ) {
+                  print "include list \"$includelist\"\n" if ( $includelist );
+                  print "include file \"$includefile\"\n" if ( $includefile );
+                   }
+               if ( $exclude_done==0 && $ok ) {
+                  print "exclude list \"$excludelist\"\n" if ( $excludelist );
+                  print "exclude file \"$excludefile\"\n" if ( $excludefile );
+                   }
+           $ok=0; # reset, done with one entry
+       }   
+       
+       # take care of entry that has '{'
+       if ( $open_seen==1 ) {
+           if ( !$two  && !$three ) {   # inside {, dumptype line has 1 field only
+               s/$one/$dumptype/ if ( $dumptype );
+           } elsif ( $two && $three ) { # inside {, include/exclude line
+               if ( $one eq "include" ) {
+                   if ( $includelist ) {
+                       s/$two.*$/list "$includelist"/;
+                   } elsif ( $includefile ) {
+                       s/$two.*$/file "$includefile"/;
+                   }
+                   $include_done=1;
+               }
+               if ( $one eq "exclude" ) {
+                   if ( $excludelist ) {
+                       s/$two.*$/list "$excludelist"/;
+                   } elsif ( $excludefile ) {
+                       s/$two.*$/file "$excludefile"/;
+                   }
+                   $exclude_done=1;
+               }
+
+           }
+       }  # inside '{'
+       
+       # entry which previously doesn't have include/exclude
+       if (( $one eq $client ) && ($two eq $diskdev) ) {
+           $ok=1;
+           if ( $three && ($three ne "{") ) {
+               if ( $sp_diskfile==1 ) {  #previously don't have include/exclude
+                   $three = $dumptype if ( $dumptype );
+                   $includeline="include list \"$includelist\""   if ( $includelist );
+                   $includeline="include file \"$includefile\""   if ( $includefile );
+                   $excludeline="exclude list \"$excludelist\"\n" if ( $excludelist );
+                   $excludeline="exclude file \"$excludefile\"\n" if ( $excludefile );
+                   s/$three/{\n$three\n$includeline\n$excludeline}/;
+               } else {
+                   s/$three/$dumptype/ if ( $dumptype ); #easy one, just replace dumptype.
+                   $ok=0; #done with one entry
+               }
+           } else {
+               $open_seen=1;
+           }
+       }
+       print;
+    }  # while loop
+    unlink("$confdir/$config/disklist.tmp");
+    exit 0;
+}
+    
+
+
+#main
+my $ret=0;
+          
+$ret= GetOptions (      "config=s"=>\$config,
+                        "client=s"=>\$client,
+                        "diskdev=s"=>\$diskdev,
+                        "dumptype=s"=>\$dumptype,
+                        "includefile=s"=>\$includefile,
+                        "includelist=s"=>\$includelist,
+                        "excludefile=s"=>\$excludefile,
+                        "excludelist=s"=>\$excludelist,
+                       "user=s"=>\$root_user,
+                       "auth=s"=>\$auth,
+                       "gnutar_list_dir=s"=>\$tarlist,
+                       "amandates=s"=>\$amandates,
+                       "batch!"=>\$batch,
+                       "m!"=>\$mod,
+                       "no-client-update!"=>\$no_client_update,
+                        "help!"=>\$help
+                       );
+
+
+unless ( $ret ) {
+    &usage;
+    exit 1;
+}
+
+
+if($help) {
+    &usage;
+    exit 0;
+}
+
+unless (defined $config && defined $client && defined $diskdev ) {
+    print STDERR "--config, --client and --diskdev are required.\n";
+    &usage;
+    exit 1;
+}
+else {
+    die ("ERROR: Invalid data in config.\n")  if is_tainted($config);
+    die ("ERROR: Invalid data in client.\n")  if is_tainted($client);
+}
+
+
+if ( defined $includefile && defined $includelist ) {
+    print STDERR "Specify either --includefile or --includelist, not both.\n";
+    &usage;
+    exit 1;
+}
+   
+if ( defined $excludefile && defined $excludelist ) {
+    print STDERR "Specify either --excludefile or --excludelist, not both.\n";
+    &usage;
+    exit 1;
+}   
+
+$oldPATH = $ENV{'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin:/usr/ucb"; # force known path
+$date=`date +%Y%m%d%H%M%S`;
+chomp($date);
+my $logfile="$tmpdir/amaddclient.$date.debug";
+
+&is_user_right;
+open (LOG, ">$logfile") || die "ERROR: Cannot create logfile : $!\n";
+print STDOUT "Logging to $logfile\n";
+
+my $lhost=`hostname`;
+chomp($lhost);
+# get our own canonical name, if possible (we don't sweat the IPv6 stuff here)
+my $host=(gethostbyname($lhost))[0];
+
+unless ( $host ) {
+    $host = $lhost;  #gethostbyname() failed, go with hostname output
+}
+
+
+my $found=0;
+my $fhs;
+
+# make sure dumptype is defined in dumptypes or amanda.conf file
+
+if ( defined $dumptype ) { 
+for $fhs ( "$confdir/template.d/dumptypes", "$confdir/$config/amanda.conf" ) {
+    open (DTYPE, $fhs) ||
+       &log_and_die ("ERROR: Cannot open $fhs file : $!\n");
+    while (<DTYPE>) {
+       if (/^\s*define\s*dumptype\s*$dumptype\s*{/) {
+           $found=1;
+           last;
+       }
+       }
+       close (DTYPE);
+    }
+
+    unless ( $found ) {
+        &log_and_die ("ERROR: $dumptype not defined in $confdir/template.d/dumptypes or $confdir/$config/amanda.conf\n");
+    }
+}
+
+# create disklist file
+    unless ( -e "$confdir/$config"  ) {
+       &log_and_die ("ERROR: $confdir/$config not found\n");
+    }
+    $found=0;
+    if (defined $includefile || defined $includelist 
+                   || defined $excludefile || defined $excludelist) {
+       $sp_diskfile=1;
+       }
+
+    unless ( -e "$confdir/$config/disklist" ) {         # create it if necessary
+        open (DLE, ">$confdir/$config/disklist") || 
+           &log_and_die ("ERROR: Cannot create $confdir/$config/disklist file : $!\n");
+       print DLE "#This file is generated by amaddclient.\n";
+       print DLE "#Don't edit it manually, otherwise, 'amaddclient -m ...' might not work\n";
+    }
+
+    open (DLE, "+<$confdir/$config/disklist")    # open for read/write
+       || &log_and_die ("ERROR: Cannot open $confdir/$config/disklist file : $!\n");
+    while (<DLE>) {
+       my ($lclient, $ldiskdev, $dontcare ) = split(/\s+/, $_);
+       if (( $lclient eq $client ) && ($ldiskdev eq $diskdev) ) {
+           $found=1;
+           last;
+       }
+    }
+
+# if found and -m, do modification and exit 
+    if ( defined $mod ) {
+       if ( $found ) {
+       &dle_mod;
+    } else {
+       &log_and_die ("ERROR: $client $diskdev not found, cannot modify\n");
+    }
+    }
+
+unless ( defined $dumptype ) {
+    $dumptype=$def_dumptype;
+} 
+    if ( $found==1 ) {
+       &mprint("$confdir/$config/disklist has '$client $diskdev ...' entry, file not updated\n"); }
+    else {
+       print DLE "$client  $diskdev ";
+       print DLE "{\n$dumptype\n" if ($sp_diskfile);
+       if ( defined $includefile ) {
+           print DLE "include file \"$includefile\"\n";
+       }
+       elsif ( defined $includelist ) {
+           print DLE "include list \"$includelist\"\n";
+       }
+       if ( defined $excludefile ) {
+           print DLE "exclude file \"$excludefile\"\n";
+       }
+       elsif ( defined $excludelist ) {
+           print DLE "exclude list \"$excludelist\"\n";
+       }
+        print DLE "}\n" if ($sp_diskfile);
+
+        print DLE "  $dumptype\n" if ($sp_diskfile==0);
+       &mprint ("$confdir/$config/disklist updated\n");
+       close (DLE);
+    }
+
+
+# update .amandahosts on server and client
+    my $scp="scp";
+    my $scp_opt1="-p";   # p: preserve mode
+    my $scp_opt2="-o ConnectTimeout=15";   #timeout after 15 seconds
+    my $ssh="ssh";
+    my $ssh_opt="-x"; # -x as a placeholder, otherwise ssh complains
+    my $mkdir="mkdir";
+    my $client_conf_dir="$confdir/$config";
+    my $amanda_client_conf="$client_conf_dir/amanda-client.conf";
+    my $file="$amandahomedir/.amandahosts";
+    my $client_file="$amandahomedir/amanda-client.conf-$client";
+   
+   if ( defined $batch ) {
+    $scp_opt1="-Bp";
+    $ssh_opt="-o BatchMode=yes";
+  }
+    
+    &mprint ("updating $file on $host\n");
+    unless ( defined $root_user ) {
+    $root_user=$def_root_user;
+  }
+    $found=0;
+    open (HFILE, "+<$file") 
+       || &log_and_die ("ERROR: Cannot open $file : $!\n");
+       
+       while (<HFILE>) {
+           if (/^\s*$client\s*$root_user\s*amindexd\s*amidxtaped\s/) {
+               $found=1;
+               last;
+           }
+       }
+    if ( $found==1 ) {
+       &mprint ("$file contains $client $root_user, file not updated\n") ; }
+    else {
+       print HFILE "$client  $root_user amindexd amidxtaped\n";
+       close (HFILE);
+    }
+
+# update client .amandahosts
+unless ( $no_client_update ) {
+     
+    &mprint ("Attempting to update $file on $client\n");
+
+    chdir ("$amandahomedir");
+    system "$scp", "$scp_opt1", "$scp_opt2", "$amanda_user\@$client:$file", "$file.tmp";
+    $exit_value  = $? >> 8;
+    if ( $exit_value !=0 ) {
+       &mprint ("WARNING: $scp from $client not successful.\n");
+       &mprint ("Check $client:$file file.\n");
+       &mprint ("If entry '$host $amanda_user' is not present,\n");
+       &mprint ("append the entry to the file manually.\n");
+    }
+    else { 
+    $found=0;
+    unless ( -e "$file.tmp" ) {
+       &mprint ("WARNING: $file.tmp not found\n"); }
+    else {
+       open (CFILE, "+<$file.tmp") 
+           || &log_and_die ("ERROR: Cannot open $file.tmp file : $!\n");
+       while (<CFILE>) {
+           if (/^\s*$host\s*$amanda_user\s*amdump\s/) {
+               $found=1;
+               last;
+           }
+       }
+       if ( $found==1 ) {
+           &mprint ("$file contains $host $amanda_user, file not updated\n") ; }
+       else {
+           print CFILE "$host  $amanda_user amdump\n";
+           close (CFILE);
+           
+           #make sure permission mode is correct
+           chmod (0600, "$file.tmp");
+           system "$scp", "$scp_opt1", "$scp_opt2", "$file.tmp", "$client:$file";
+           $exit_value  = $? >> 8;
+           if ( $exit_value !=0 ) {
+               &mprint ("WARNING: $scp to $client not successful.\n");
+               &mprint ("Check $client:$file file.\n");
+               &mprint ("If entry '$host $amanda_user amdump' is not present,\n");
+               &mprint ("append the entry to the file manually.\n");
+           }
+    
+       } 
+    }
+    unlink ("$file.tmp") || &mprint("unlink $file.tmp failed: $!\n");
+    &mprint ("$client:$file updated successfully\n");
+  }
+  }
+
+# done updating client .amandahosts
+
+#create amanda-client.conf and scp over to client
+
+unless ( $no_client_update ) {
+&mprint ("Creating amanda-client.conf for $client\n");
+
+$auth="bsdtcp" unless ( defined $auth ); 
+
+open (ACFILE, ">$client_file") || &log_and_die ("ERROR: Cannot open $client_file file : $!\n");
+ print ACFILE "#amanda-client.conf - Amanda client configuration file.\n";
+ print ACFILE "conf            \"$config\"\n";
+ print ACFILE "index_server    \"$host\"\n";
+ print ACFILE "tape_server     \"$host\"\n";
+ print ACFILE "#  auth  - authentication scheme to use between server and client.\n";
+ print ACFILE "#          Valid values are 'bsdtcp' or 'ssh'\n";
+ print ACFILE "auth            \"$auth\"\n";
+ print ACFILE "# ssh keys file if ssh auth is used\n";
+ print ACFILE "ssh_keys        \"$amandahomedir/.ssh/id_rsa_amrecover\"\n";
+ print ACFILE "gnutar_list_dir \"$tarlist\"\n" if ( defined $tarlist );
+ print ACFILE "amandates       \"$amandates\"\n" if ( defined $amandates ); 
+
+close (ACFILE);
+&mprint ("Creating  $client_conf_dir on $client\n");
+system "$ssh", "$ssh_opt", "$amanda_user\@$client", "$mkdir", "$client_conf_dir";
+$exit_value  = $? >> 8;
+if ( $exit_value !=0 ) {
+  &mprint ("WARNING: Cannot create $client_conf_dir on $client\n");
+  &mprint ("Please copy $client_file to $client manually\n");
+} else { 
+  chmod (0600, "$client_file");
+  system "$scp", "$scp_opt1", "$scp_opt2", "$client_file", "$amanda_user\@$client:$amanda_client_conf";
+  $exit_value  = $? >> 8;
+  if ( $exit_value !=0 ) {
+    &mprint ("WARNING: Cannot copy $client_file to $client\n");
+    &mprint ("Please copy $client_file to $client:$client_conf_dir manually\n");
+  } else {
+    &mprint ("Copy $client_file to $client successfully\n");
+    unlink($client_file);
+  }      
+}
+}
+
+#create gnutar_list_dir
+if ( defined $tarlist && !defined $no_update_client ) {
+ system "$ssh", "$ssh_opt", "$amanda_user\@$client", "$mkdir", "$gnutar_list_dir";
+ $exit_value  = $? >> 8;
+if ( $exit_value !=0 ) {
+  &mprint ("WARNING: Cannot create $gnutar_list_dir on $client\n"); 
+  &mprint ("Please create $gnutar_list_dir on $client manually\n");
+} else { 
+  &mprint ("$client_file created on $client successfully\n");
+}
+}
+
+&mprint ("File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration.\n");
+&mprint ("Please merge it to /etc/xinetd.d/amandaclient.\n");
+$ENV{'PATH'} = $oldPATH;
+close (LOG);
+
+#THE END                                      
+    
index 526434c895efca54eff374e024a7d8ba730dfd99..40da5b5f16990671efbc2c33271fc6eb33cf9b6f 100644 (file)
@@ -40,6 +40,7 @@
 #include "holding.h"
 #include "find.h"
 #include "util.h"
+#include "timestamp.h"
 
 disklist_t diskq;
 
@@ -78,7 +79,6 @@ void disklist(int argc, char **argv);
 void disklist_one(disk_t *dp);
 void show_version(int argc, char **argv);
 static void show_config(int argc, char **argv);
-static void check_dumpuser(void);
 
 static char *conf_tapelist = NULL;
 static char *displayunit;
@@ -90,50 +90,48 @@ static const struct {
     const char *usage;
 } cmdtab[] = {
     { "version", show_version,
-       "\t\t\t\t\t# Show version info." },
+       T_("\t\t\t\t\t# Show version info.") },
     { "config", show_config,
-       "\t\t\t\t\t# Show configuration." },
+       T_("\t\t\t\t\t# Show configuration.") },
     { "force", force,
-       " [<hostname> [<disks>]* ]+\t\t# Force level 0 at next run." },
+       T_(" [<hostname> [<disks>]* ]+\t\t# Force level 0 at next run.") },
     { "unforce", unforce,
-       " [<hostname> [<disks>]* ]+\t# Clear force command." },
+       T_(" [<hostname> [<disks>]* ]+\t# Clear force command.") },
     { "force-bump", force_bump,
-       " [<hostname> [<disks>]* ]+\t# Force bump at next run." },
+       T_(" [<hostname> [<disks>]* ]+\t# Force bump at next run.") },
     { "force-no-bump", force_no_bump,
-       " [<hostname> [<disks>]* ]+\t# Force no-bump at next run." },
+       T_(" [<hostname> [<disks>]* ]+\t# Force no-bump at next run.") },
     { "unforce-bump", unforce_bump,
-       " [<hostname> [<disks>]* ]+\t# Clear bump command." },
+       T_(" [<hostname> [<disks>]* ]+\t# Clear bump command.") },
     { "disklist", disklist,
-       " [<hostname> [<disks>]* ]*\t# Debug disklist entries." },
+       T_(" [<hostname> [<disks>]* ]*\t# Debug disklist entries.") },
     { "reuse", reuse,
-       " <tapelabel> ...\t\t # re-use this tape." },
+       T_(" <tapelabel> ...\t\t # re-use this tape.") },
     { "no-reuse", noreuse,
-       " <tapelabel> ...\t # never re-use this tape." },
+       T_(" <tapelabel> ...\t # never re-use this tape.") },
     { "find", find,
-       " [<hostname> [<disks>]* ]*\t # Show which tapes these dumps are on." },
+       T_(" [<hostname> [<disks>]* ]*\t # Show which tapes these dumps are on.") },
     { "holding", holding,
-       " {list [ -l ] |delete} [ <hostname> [ <disk> [ <datestamp> [ .. ] ] ] ]+\t # Show or delete holding disk contents." },
+       T_(" {list [ -l ] |delete} [ <hostname> [ <disk> [ <datestamp> [ .. ] ] ] ]+\t # Show or delete holding disk contents.") },
     { "delete", delete,
-       " [<hostname> [<disks>]* ]+ # Delete from database." },
+       T_(" [<hostname> [<disks>]* ]+ # Delete from database.") },
     { "info", info,
-       " [<hostname> [<disks>]* ]*\t # Show current info records." },
+       T_(" [<hostname> [<disks>]* ]*\t # Show current info records.") },
     { "due", due,
-       " [<hostname> [<disks>]* ]*\t # Show due date." },
+       T_(" [<hostname> [<disks>]* ]*\t # Show due date.") },
     { "balance", balance,
-       " [-days <num>]\t\t # Show nightly dump size balance." },
+       T_(" [-days <num>]\t\t # Show nightly dump size balance.") },
     { "tape", tape,
-       " [-days <num>]\t\t # Show which tape is due next." },
+       T_(" [-days <num>]\t\t # Show which tape is due next.") },
     { "bumpsize", bumpsize,
-       "\t\t\t # Show current bump thresholds." },
+       T_("\t\t\t # Show current bump thresholds.") },
     { "export", export_db,
-       " [<hostname> [<disks>]* ]* # Export curinfo database to stdout." },
+       T_(" [<hostname> [<disks>]* ]* # Export curinfo database to stdout.") },
     { "import", import_db,
-       "\t\t\t\t # Import curinfo database from stdin." },
+       T_("\t\t\t\t # Import curinfo database from stdin.") },
 };
 #define        NCMDS   (int)(sizeof(cmdtab) / sizeof(cmdtab[0]))
 
-static char *conffile;
-
 int
 main(
     int                argc,
@@ -142,80 +140,63 @@ main(
     int i;
     char *conf_diskfile;
     char *conf_infofile;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-    int new_argc;
-    char **new_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
 
     set_pname("amadmin");
 
-    dbopen(DBG_SUBDIR_SERVER);
-
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+    dbopen(DBG_SUBDIR_SERVER);
 
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if(new_argc < 3) usage();
+    if(argc < 3) usage();
 
-    if(strcmp(new_argv[2],"version") == 0) {
-       show_version(new_argc, new_argv);
+    if(strcmp(argv[2],"version") == 0) {
+       show_version(argc, argv);
        goto done;
     }
 
-    config_name = new_argv[1];
-
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL, argv[1]);
+    apply_config_overwrites(cfg_ovr);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    check_dumpuser();
+    check_running_as(RUNNING_AS_DUMPUSER);
 
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &diskq) < 0) {
-       error("could not load disklist \"%s\"", conf_diskfile);
+       error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
-    conf_infofile = getconf_str(CNF_INFOFILE);
-    if (*conf_infofile == '/') {
-       conf_infofile = stralloc(conf_infofile);
-    } else {
-       conf_infofile = stralloc2(config_dir, conf_infofile);
-    }
+    /* conf_tapelist is not freed yet -- it may be used to write the
+     * tapelist later. */
+
+    conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if(open_infofile(conf_infofile)) {
-       error("could not open info db \"%s\"", conf_infofile);
+       error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
     amfree(conf_infofile);
@@ -224,33 +205,22 @@ main(
     unitdivisor = getconf_unit_divisor();
 
     for (i = 0; i < NCMDS; i++)
-       if (strcmp(new_argv[2], cmdtab[i].name) == 0) {
-           (*cmdtab[i].fn)(new_argc, new_argv);
+       if (strcmp(argv[2], cmdtab[i].name) == 0) {
+           (*cmdtab[i].fn)(argc, argv);
            break;
        }
     if (i == NCMDS) {
-       fprintf(stderr, "%s: unknown command \"%s\"\n", new_argv[0], new_argv[2]);
+       g_fprintf(stderr, _("%s: unknown command \"%s\"\n"), argv[0], argv[2]);
        usage();
     }
 
-    free_new_argv(new_argc, new_argv);
-
     close_infofile();
     clear_tapelist();
     amfree(conf_tapelist);
-    amfree(config_dir);
 
 done:
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
-    amfree(conffile);
     free_disklist(&diskq);
-    free_server_config();
     dbclose();
     return 0;
 }
@@ -261,11 +231,11 @@ usage(void)
 {
     int i;
 
-    fprintf(stderr, "\nUsage: %s%s <conf> <command> {<args>} [-o configoption]* ...\n",
+    g_fprintf(stderr, _("\nUsage: %s%s <conf> <command> {<args>} [-o configoption]* ...\n"),
            get_pname(), versionsuffix());
-    fprintf(stderr, "    Valid <command>s are:\n");
+    g_fprintf(stderr, _("    Valid <command>s are:\n"));
     for (i = 0; i < NCMDS; i++)
-       fprintf(stderr, "\t%s%s\n", cmdtab[i].name, cmdtab[i].usage);
+       g_fprintf(stderr, "\t%s%s\n", cmdtab[i].name, _(cmdtab[i].usage));
     exit(1);
 }
 
@@ -280,17 +250,25 @@ seqdatestr(
     int                seq)
 {
     static char str[16];
-    static char *dow[7] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
+    static char *dow[7] = {
+                       T_("Sun"),
+                       T_("Mon"),
+                       T_("Tue"),
+                       T_("Wed"),
+                       T_("Thu"),
+                       T_("Fri"),
+                       T_("Sat")
+               };
     time_t t = today + seq*SECS_PER_DAY;
     struct tm *tm;
 
     tm = localtime(&t);
 
     if (tm)
-       snprintf(str, SIZEOF(str),
-                "%2d/%02d %3s", tm->tm_mon+1, tm->tm_mday, dow[tm->tm_wday]);
+       g_snprintf(str, SIZEOF(str),
+                "%2d/%02d %3s", tm->tm_mon+1, tm->tm_mday, _(dow[tm->tm_wday]));
     else
-       strcpy(str, "BAD DATE");
+       strcpy(str, _("BAD DATE"));
 
     return str;
 }
@@ -312,40 +290,6 @@ next_level0(
        return dp->dumpcycle - days_diff(info->inf[0].date, today);
 }
 
-static void
-check_dumpuser(void)
-{
-    static int been_here = 0;
-    uid_t uid_me;
-    uid_t uid_dumpuser;
-    char *dumpuser;
-    struct passwd *pw;
-
-    if (been_here) {
-       return;
-    }
-    uid_me = getuid();
-    uid_dumpuser = uid_me;
-    dumpuser = getconf_str(CNF_DUMPUSER);
-
-    if ((pw = getpwnam(dumpuser)) == NULL) {
-       error("cannot look up dump user \"%s\"", dumpuser);
-       /*NOTREACHED*/
-    }
-    uid_dumpuser = pw->pw_uid;
-    if ((pw = getpwuid(uid_me)) == NULL) {
-       error("cannot look up my own uid %ld", (long)uid_me);
-       /*NOTREACHED*/
-    }
-    if (uid_me != uid_dumpuser) {
-       error("ERROR: running as user \"%s\" instead of \"%s\"",
-             pw->pw_name, dumpuser);
-        /*NOTREACHED*/
-    }
-    been_here = 1;
-    return;
-}
-
 /* ----------------------------------------------- */
 
 void
@@ -360,14 +304,14 @@ diskloop(
     char *errstr;
 
     if(argc < 4) {
-       fprintf(stderr,"%s: expecting \"%s [<hostname> [<disks>]* ]+\"\n",
+       g_fprintf(stderr,_("%s: expecting \"%s [<hostname> [<disks>]* ]+\"\n"),
                get_pname(), cmdname);
        usage();
     }
 
     errstr = match_disklist(&diskq, argc-3, argv+3);
     if (errstr) {
-       printf("%s", errstr);
+       g_printf("%s", errstr);
        amfree(errstr);
     }
 
@@ -378,7 +322,7 @@ diskloop(
        }
     }
     if(count==0) {
-       fprintf(stderr,"%s: no disk matched\n",get_pname());
+       g_fprintf(stderr,_("%s: no disk matched\n"),get_pname());
     }
 }
 
@@ -393,21 +337,18 @@ force_one(
     char *diskname = dp->name;
     info_t info;
 
-#if TEXTDB
-    check_dumpuser();
-#endif
     get_info(hostname, diskname, &info);
     SET(info.command, FORCE_FULL);
     if (ISSET(info.command, FORCE_BUMP)) {
        CLR(info.command, FORCE_BUMP);
-       printf("%s: WARNING: %s:%s FORCE_BUMP command was cleared.\n",
+       g_printf(_("%s: WARNING: %s:%s FORCE_BUMP command was cleared.\n"),
               get_pname(), hostname, diskname);
     }
     if(put_info(hostname, diskname, &info) == 0) {
-       printf("%s: %s:%s is set to a forced level 0 at next run.\n",
+       g_printf(_("%s: %s:%s is set to a forced level 0 at next run.\n"),
               get_pname(), hostname, diskname);
     } else {
-       fprintf(stderr, "%s: %s:%s could not be forced.\n",
+       g_fprintf(stderr, _("%s: %s:%s could not be forced.\n"),
                get_pname(), hostname, diskname);
     }
 }
@@ -435,21 +376,18 @@ unforce_one(
 
     get_info(hostname, diskname, &info);
     if (ISSET(info.command, FORCE_FULL)) {
-#if TEXTDB
-       check_dumpuser();
-#endif
        CLR(info.command, FORCE_FULL);
        if(put_info(hostname, diskname, &info) == 0){
-           printf("%s: force command for %s:%s cleared.\n",
+           g_printf(_("%s: force command for %s:%s cleared.\n"),
                   get_pname(), hostname, diskname);
        } else {
-           fprintf(stderr,
-                   "%s: force command for %s:%s could not be cleared.\n",
+           g_fprintf(stderr,
+                   _("%s: force command for %s:%s could not be cleared.\n"),
                    get_pname(), hostname, diskname);
        }
     }
     else {
-       printf("%s: no force command outstanding for %s:%s, unchanged.\n",
+       g_printf(_("%s: no force command outstanding for %s:%s, unchanged.\n"),
               get_pname(), hostname, diskname);
     }
 }
@@ -474,26 +412,23 @@ force_bump_one(
     char *diskname = dp->name;
     info_t info;
 
-#if TEXTDB
-    check_dumpuser();
-#endif
     get_info(hostname, diskname, &info);
     SET(info.command, FORCE_BUMP);
     if (ISSET(info.command, FORCE_NO_BUMP)) {
        CLR(info.command, FORCE_NO_BUMP);
-       printf("%s: WARNING: %s:%s FORCE_NO_BUMP command was cleared.\n",
+       g_printf(_("%s: WARNING: %s:%s FORCE_NO_BUMP command was cleared.\n"),
               get_pname(), hostname, diskname);
     }
     if (ISSET(info.command, FORCE_FULL)) {
        CLR(info.command, FORCE_FULL);
-       printf("%s: WARNING: %s:%s FORCE_FULL command was cleared.\n",
+       g_printf(_("%s: WARNING: %s:%s FORCE_FULL command was cleared.\n"),
               get_pname(), hostname, diskname);
     }
     if(put_info(hostname, diskname, &info) == 0) {
-       printf("%s: %s:%s is set to bump at next run.\n",
+       g_printf(_("%s: %s:%s is set to bump at next run.\n"),
               get_pname(), hostname, diskname);
     } else {
-       fprintf(stderr, "%s: %s:%s could not be forced to bump.\n",
+       g_fprintf(stderr, _("%s: %s:%s could not be forced to bump.\n"),
                get_pname(), hostname, diskname);
     }
 }
@@ -519,21 +454,18 @@ force_no_bump_one(
     char *diskname = dp->name;
     info_t info;
 
-#if TEXTDB
-    check_dumpuser();
-#endif
     get_info(hostname, diskname, &info);
     SET(info.command, FORCE_NO_BUMP);
     if (ISSET(info.command, FORCE_BUMP)) {
        CLR(info.command, FORCE_BUMP);
-       printf("%s: WARNING: %s:%s FORCE_BUMP command was cleared.\n",
+       g_printf(_("%s: WARNING: %s:%s FORCE_BUMP command was cleared.\n"),
               get_pname(), hostname, diskname);
     }
     if(put_info(hostname, diskname, &info) == 0) {
-       printf("%s: %s:%s is set to not bump at next run.\n",
+       g_printf(_("%s: %s:%s is set to not bump at next run.\n"),
               get_pname(), hostname, diskname);
     } else {
-       fprintf(stderr, "%s: %s:%s could not be force to not bump.\n",
+       g_fprintf(stderr, _("%s: %s:%s could not be force to not bump.\n"),
                get_pname(), hostname, diskname);
     }
 }
@@ -561,20 +493,17 @@ unforce_bump_one(
 
     get_info(hostname, diskname, &info);
     if (ISSET(info.command, FORCE_BUMP|FORCE_NO_BUMP)) {
-#if TEXTDB
-       check_dumpuser();
-#endif
        CLR(info.command, FORCE_BUMP|FORCE_NO_BUMP);
        if(put_info(hostname, diskname, &info) == 0) {
-           printf("%s: bump command for %s:%s cleared.\n",
+           g_printf(_("%s: bump command for %s:%s cleared.\n"),
                   get_pname(), hostname, diskname);
        } else {
-           fprintf(stderr, "%s: %s:%s bump command could not be cleared.\n",
+           g_fprintf(stderr, _("%s: %s:%s bump command could not be cleared.\n"),
                    get_pname(), hostname, diskname);
        }
     }
     else {
-       printf("%s: no bump command outstanding for %s:%s, unchanged.\n",
+       g_printf(_("%s: no bump command outstanding for %s:%s, unchanged.\n"),
               get_pname(), hostname, diskname);
     }
 }
@@ -600,31 +529,30 @@ reuse(
     int count;
 
     if(argc < 4) {
-       fprintf(stderr,"%s: expecting \"reuse <tapelabel> ...\"\n",
+       g_fprintf(stderr,_("%s: expecting \"reuse <tapelabel> ...\"\n"),
                get_pname());
        usage();
     }
 
-    check_dumpuser();
     for(count=3; count< argc; count++) {
        tp = lookup_tapelabel(argv[count]);
        if ( tp == NULL) {
-           fprintf(stderr, "reuse: tape label %s not found in tapelist.\n",
+           g_fprintf(stderr, _("reuse: tape label %s not found in tapelist.\n"),
                argv[count]);
            continue;
        }
        if( tp->reuse == 0 ) {
            tp->reuse = 1;
-           printf("%s: marking tape %s as reusable.\n",
+           g_printf(_("%s: marking tape %s as reusable.\n"),
                   get_pname(), argv[count]);
        } else {
-           fprintf(stderr, "%s: tape %s already reusable.\n",
+           g_fprintf(stderr, _("%s: tape %s already reusable.\n"),
                    get_pname(), argv[count]);
        }
     }
 
     if(write_tapelist(conf_tapelist)) {
-       error("could not write tapelist \"%s\"", conf_tapelist);
+       error(_("could not write tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
 }
@@ -638,31 +566,30 @@ noreuse(
     int count;
 
     if(argc < 4) {
-       fprintf(stderr,"%s: expecting \"no-reuse <tapelabel> ...\"\n",
+       g_fprintf(stderr,_("%s: expecting \"no-reuse <tapelabel> ...\"\n"),
                get_pname());
        usage();
     }
 
-    check_dumpuser();
     for(count=3; count< argc; count++) {
        tp = lookup_tapelabel(argv[count]);
        if ( tp == NULL) {
-           fprintf(stderr, "no-reuse: tape label %s not found in tapelist.\n",
+           g_fprintf(stderr, _("no-reuse: tape label %s not found in tapelist.\n"),
                argv[count]);
            continue;
        }
        if( tp->reuse == 1 ) {
            tp->reuse = 0;
-           printf("%s: marking tape %s as not reusable.\n",
+           g_printf(_("%s: marking tape %s as not reusable.\n"),
                   get_pname(), argv[count]);
        } else {
-           fprintf(stderr, "%s: tape %s already not reusable.\n",
+           g_fprintf(stderr, _("%s: tape %s already not reusable.\n"),
                    get_pname(), argv[count]);
        }
     }
 
     if(write_tapelist(conf_tapelist)) {
-       error("could not write tapelist \"%s\"", conf_tapelist);
+       error(_("could not write tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
 }
@@ -681,18 +608,18 @@ delete_one(
     info_t info;
 
     if(get_info(hostname, diskname, &info)) {
-       printf("%s: %s:%s NOT currently in database.\n",
+       g_printf(_("%s: %s:%s NOT currently in database.\n"),
               get_pname(), hostname, diskname);
        return;
     }
 
     deleted++;
     if(del_info(hostname, diskname)) {
-       error("couldn't delete %s:%s from database: %s",
+       error(_("couldn't delete %s:%s from database: %s"),
              hostname, diskname, strerror(errno));
         /*NOTREACHED*/
     } else {
-       printf("%s: %s:%s deleted from curinfo database.\n",
+       g_printf(_("%s: %s:%s deleted from curinfo database.\n"),
               get_pname(), hostname, diskname);
     }
 }
@@ -706,8 +633,8 @@ delete(
     diskloop(argc, argv, "delete", delete_one);
 
    if(deleted)
-       printf(
-        "%s: NOTE: you'll have to remove these from the disklist yourself.\n",
+       g_printf(
+        _("%s: NOTE: you'll have to remove these from the disklist yourself.\n"),
         get_pname());
 }
 
@@ -724,44 +651,42 @@ info_one(
 
     get_info(dp->host->hostname, dp->name, &info);
 
-    printf("\nCurrent info for %s %s:\n", dp->host->hostname, dp->name);
+    g_printf(_("\nCurrent info for %s %s:\n"), dp->host->hostname, dp->name);
     if (ISSET(info.command, FORCE_FULL))
-       printf("  (Forcing to level 0 dump at next run)\n");
+       g_printf(_("  (Forcing to level 0 dump at next run)\n"));
     if (ISSET(info.command, FORCE_BUMP))
-       printf("  (Forcing bump at next run)\n");
+       g_printf(_("  (Forcing bump at next run)\n"));
     if (ISSET(info.command, FORCE_NO_BUMP))
-       printf("  (Forcing no-bump at next run)\n");
-    printf("  Stats: dump rates (kps), Full:  %5.1lf, %5.1lf, %5.1lf\n",
+       g_printf(_("  (Forcing no-bump at next run)\n"));
+    g_printf(_("  Stats: dump rates (kps), Full:  %5.1lf, %5.1lf, %5.1lf\n"),
           info.full.rate[0], info.full.rate[1], info.full.rate[2]);
-    printf("                    Incremental:  %5.1lf, %5.1lf, %5.1lf\n",
+    g_printf(_("                    Incremental:  %5.1lf, %5.1lf, %5.1lf\n"),
           info.incr.rate[0], info.incr.rate[1], info.incr.rate[2]);
-    printf("          compressed size, Full: %5.1lf%%,%5.1lf%%,%5.1lf%%\n",
+    g_printf(_("          compressed size, Full: %5.1lf%%,%5.1lf%%,%5.1lf%%\n"),
           info.full.comp[0]*100, info.full.comp[1]*100, info.full.comp[2]*100);
-    printf("                    Incremental: %5.1lf%%,%5.1lf%%,%5.1lf%%\n",
+    g_printf(_("                    Incremental: %5.1lf%%,%5.1lf%%,%5.1lf%%\n"),
           info.incr.comp[0]*100, info.incr.comp[1]*100, info.incr.comp[2]*100);
 
-    printf("  Dumps: lev datestmp  tape             file   origK   compK secs\n");
+    g_printf(_("  Dumps: lev datestmp  tape             file   origK   compK secs\n"));
     for(lev = 0, sp = &info.inf[0]; lev < 9; lev++, sp++) {
        if(sp->date < (time_t)0 && sp->label[0] == '\0') continue;
        tm = localtime(&sp->date);
        if (tm) {
-           printf("          %d  %04d%02d%02d  %-15s  "
-                  OFF_T_FMT " " OFF_T_FMT " " OFF_T_FMT " " TIME_T_FMT "\n",
+           g_printf(_("          %d  %04d%02d%02d  %-15s  %lld %lld %lld %jd\n"),
                   lev, tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
                   sp->label,
-                  (OFF_T_FMT_TYPE)sp->filenum,
-                  (OFF_T_FMT_TYPE)sp->size,
-                  (OFF_T_FMT_TYPE)sp->csize,
-                  (TIME_T_FMT_TYPE)sp->secs);
+                  (long long)sp->filenum,
+                  (long long)sp->size,
+                  (long long)sp->csize,
+                  (intmax_t)sp->secs);
        } else {
-           printf("          %d  BAD-DATE  %-15s  "
-                  OFF_T_FMT " " OFF_T_FMT " " OFF_T_FMT " " TIME_T_FMT "\n",
+           g_printf(_("          %d  BAD-DATE  %-15s  %lld %lld %lld %jd\n"),
                   lev,
                   sp->label,
-                  (OFF_T_FMT_TYPE)sp->filenum,
-                  (OFF_T_FMT_TYPE)sp->size,
-                  (OFF_T_FMT_TYPE)sp->csize,
-                  (TIME_T_FMT_TYPE)sp->secs);
+                  (long long)sp->filenum,
+                  (long long)sp->size,
+                  (long long)sp->csize,
+                  (intmax_t)sp->secs);
        }
     }
 }
@@ -793,20 +718,20 @@ due_one(
 
     hp = dp->host;
     if(get_info(hp->hostname, dp->name, &info)) {
-       printf("new disk %s:%s ignored.\n", hp->hostname, dp->name);
+       g_printf(_("new disk %s:%s ignored.\n"), hp->hostname, dp->name);
     }
     else {
        days = next_level0(dp, &info);
        if(days < 0) {
-           printf("Overdue %2d day%s %s:%s\n",
+           g_printf(_("Overdue %2d day%s %s:%s\n"),
                   -days, (-days == 1) ? ": " : "s:",
                   hp->hostname, dp->name);
        }
        else if(days == 0) {
-           printf("Due today: %s:%s\n", hp->hostname, dp->name);
+           g_printf(_("Due today: %s:%s\n"), hp->hostname, dp->name);
        }
        else {
-           printf("Due in %2d day%s %s:%s\n", days,
+           g_printf(_("Due in %2d day%s %s:%s\n"), days,
                   (days == 1) ? ": " : "s:",
                   hp->hostname, dp->name);
        }
@@ -842,7 +767,7 @@ tape(
     if(argc > 4 && strcmp(argv[3],"--days") == 0) {
        nb_days = atoi(argv[4]);
        if(nb_days < 1) {
-           printf("days must be an integer bigger than 0\n");
+           g_printf(_("days must be an integer bigger than 0\n"));
            return;
        }
        if (nb_days > 10000)
@@ -855,16 +780,16 @@ tape(
     for ( j=0 ; j < nb_days ; j++ ) {
        for ( i=0 ; i < runtapes ; i++ ) {
            if(i==0)
-               printf("The next Amanda run should go onto ");
+               g_printf(_("The next Amanda run should go onto "));
            else
-               printf("                                   ");
+               g_printf("                                   ");
            if(tp != NULL) {
-               printf("tape %s or a new tape.\n", tp->label);
+               g_printf(_("tape %s or a new tape.\n"), tp->label);
            } else {
                if (runtapes - i == 1)
-                   printf("1 new tape.\n");
+                   g_printf(_("1 new tape.\n"));
                else
-                   printf("%d new tapes.\n", runtapes - i);
+                   g_printf(_("%d new tapes.\n"), runtapes - i);
                i = runtapes;
            }
        
@@ -883,20 +808,20 @@ tape(
        lasttp = lookup_tapepos(lookup_nb_tape());
        i = runtapes;
        if(c == 1) {
-           printf("The next new tape already labelled is: %s.\n",
+           g_printf(_("The next new tape already labelled is: %s.\n"),
                   lasttp->label);
        }
        else {
-           printf("The next %d new tapes already labelled are: %s", c,
+           g_printf(_("The next %d new tapes already labelled are: %s"), c,
                   lasttp->label);
            lasttp = lasttp->prev;
            c--;
            while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-               printf(", %s", lasttp->label);
+               g_printf(", %s", lasttp->label);
                lasttp = lasttp->prev;
                c--;
            }
-           printf(".\n");
+           g_printf(".\n");
        }
     }
 }
@@ -959,7 +884,7 @@ balance(
 
     for(dp = diskq.head; dp != NULL; dp = dp->next) {
        if(get_info(dp->host->hostname, dp->name, &info)) {
-           printf("new disk %s:%s ignored.\n", dp->host->hostname, dp->name);
+           g_printf(_("new disk %s:%s ignored.\n"), dp->host->hostname, dp->name);
            continue;
        }
        if (dp->strategy == DS_NOFULL) {
@@ -1016,7 +941,7 @@ balance(
     }
 
     if(sp[total].outsize == (off_t)0 && sp[later].outsize == (off_t)0) {
-       printf("\nNo data to report on yet.\n");
+       g_printf(_("\nNo data to report on yet.\n"));
        amfree(sp);
        return;
     }
@@ -1031,9 +956,9 @@ balance(
     }
 
     empty_day = 0;
-    printf("\n due-date  #fs    orig %cB     out %cB   balance\n",
+    g_printf(_("\n due-date  #fs    orig %cB     out %cB   balance\n"),
           displayunit[0], displayunit[0]);
-    printf("----------------------------------------------\n");
+    g_printf("----------------------------------------------\n");
     for(seq = 0; seq < later; seq++) {
        if(sp[seq].disks == 0 &&
           ((seq > 0 && sp[seq-1].disks == 0) ||
@@ -1042,56 +967,61 @@ balance(
        }
        else {
            if(empty_day > 0) {
-               printf("\n");
+               g_printf("\n");
                empty_day = 0;
            }
-           printf("%-9.9s  %3d " OFF_T_FMT " " OFF_T_FMT " ",
+           g_printf(_("%-9.9s  %3d %10lld %10lld "),
                   seqdatestr(seq), sp[seq].disks,
-                  (OFF_T_FMT_TYPE)sp[seq].origsize,
-                  (OFF_T_FMT_TYPE)sp[seq].outsize);
-           if(!sp[seq].outsize) printf("     --- \n");
-           else printf("%+8.1lf%%\n",
+                  (long long)sp[seq].origsize,
+                  (long long)sp[seq].outsize);
+           if(!sp[seq].outsize) g_printf("     --- \n");
+           else g_printf(_("%+8.1lf%%\n"),
                        (((double)sp[seq].outsize - (double)balanced) * 100.0 /
                        (double)balanced));
        }
     }
 
     if(sp[later].disks != 0) {
-       printf("later      %3d " OFF_T_FMT " " OFF_T_FMT " ",
+       g_printf(_("later      %3d %10lld %10lld "),
               sp[later].disks,
-              (OFF_T_FMT_TYPE)sp[later].origsize,
-              (OFF_T_FMT_TYPE)sp[later].outsize);
-       if(!sp[later].outsize) printf("     --- \n");
-       else printf("%+8.1lf%%\n",
+              (long long)sp[later].origsize,
+              (long long)sp[later].outsize);
+       if(!sp[later].outsize) g_printf("     --- \n");
+       else g_printf(_("%+8.1lf%%\n"),
                    (((double)sp[later].outsize - (double)balanced) * 100.0 /
                    (double)balanced));
     }
-    printf("----------------------------------------------\n");
-    printf("TOTAL      %3d " OFF_T_FMT " " OFF_T_FMT " " OFF_T_FMT "\n",
+    g_printf("----------------------------------------------\n");
+    g_printf(_("TOTAL      %3d %10lld %10lld %9lld\n"),
           sp[total].disks,
-          (OFF_T_FMT_TYPE)sp[total].origsize,
-          (OFF_T_FMT_TYPE)sp[total].outsize,
-          (OFF_T_FMT_TYPE)total_balanced);
+          (long long)sp[total].origsize,
+          (long long)sp[total].outsize,
+          (long long)total_balanced);
     if (sp[balance].origsize != sp[total].origsize ||
         sp[balance].outsize != sp[total].outsize ||
        balanced != total_balanced) {
-       printf("BALANCED       " OFF_T_FMT " " OFF_T_FMT " " OFF_T_FMT "\n",
-              (OFF_T_FMT_TYPE)sp[balance].origsize,
-              (OFF_T_FMT_TYPE)sp[balance].outsize,
-              (OFF_T_FMT_TYPE)balanced);
+       g_printf(_("BALANCED       %10lld %10lld %9lld\n"),
+              (long long)sp[balance].origsize,
+              (long long)sp[balance].outsize,
+              (long long)balanced);
     }
     if (sp[distinct].disks != sp[total].disks) {
-       printf("DISTINCT   %3d " OFF_T_FMT " " OFF_T_FMT "\n",
+       g_printf(_("DISTINCT   %3d %10lld %10lld\n"),
               sp[distinct].disks,
-              (OFF_T_FMT_TYPE)sp[distinct].origsize,
-              (OFF_T_FMT_TYPE)sp[distinct].outsize);
+              (long long)sp[distinct].origsize,
+              (long long)sp[distinct].outsize);
     }
-    printf("  (estimated %d run%s per dumpcycle)\n",
-          runs_per_cycle, (runs_per_cycle == 1) ? "" : "s");
+    g_printf(plural(_("  (estimated %d run per dumpcycle)\n"),
+                 _("  (estimated %d runs per dumpcycle)\n"),
+                 runs_per_cycle),
+          runs_per_cycle);
     if (overdue) {
-       printf(" (%d filesystem%s overdue, the most being overdue %d day%s)\n",
-              overdue, (overdue == 1) ? "" : "s",
-              max_overdue, (max_overdue == 1) ? "" : "s");
+       g_printf(plural(_(" (%d filesystem overdue."),
+                     _(" (%d filesystems overdue."), overdue),
+              overdue);
+       g_printf(plural(_(" The most being overdue %d day.)\n"),
+                     _(" The most being overdue %d days.)\n"), max_overdue),
+              max_overdue);
     }
     amfree(sp);
 }
@@ -1110,8 +1040,8 @@ find(
     char *errstr;
 
     if(argc < 3) {
-       fprintf(stderr,
-               "%s: expecting \"find [--sort <hkdlpb>] [hostname [<disk>]]*\"\n",
+       g_fprintf(stderr,
+               _("%s: expecting \"find [--sort <hkdlpbf>] [hostname [<disk>]]*\"\n"),
                get_pname());
        usage();
     }
@@ -1129,6 +1059,8 @@ find(
            case 'K':
            case 'd':
            case 'D':
+           case 'f':
+           case 'F':
            case 'l':
            case 'L':
            case 'p':
@@ -1142,8 +1074,8 @@ find(
        if(valid_sort) {
            sort_order = newstralloc(sort_order, argv[4]);
        } else {
-           printf("Invalid sort order: %s\n", argv[4]);
-           printf("Use default sort order: %s\n", sort_order);
+           g_printf(_("Invalid sort order: %s\n"), argv[4]);
+           g_printf(_("Use default sort order: %s\n"), sort_order);
        }
        start_argc=6;
     } else {
@@ -1151,20 +1083,20 @@ find(
     }
     errstr = match_disklist(&diskq, argc-(start_argc-1), argv+(start_argc-1));
     if (errstr) {
-       printf("%s", errstr);
+       g_printf("%s", errstr);
        amfree(errstr);
     }
 
-    output_find = find_dump(1, &diskq);
+    output_find = find_dump(&diskq);
     if(argc-(start_argc-1) > 0) {
        free_find_result(&output_find);
        errstr = match_disklist(&diskq, argc-(start_argc-1),
                                        argv+(start_argc-1));
        if (errstr) {
-           printf("%s", errstr);
+           g_printf("%s", errstr);
            amfree(errstr);
        }
-       output_find = find_dump(0, NULL);
+       output_find = find_dump(NULL);
     }
 
     sort_find_result(sort_order, &output_find);
@@ -1177,62 +1109,47 @@ find(
 
 /* ------------------------ */
 
-static sl_t *
+static GSList *
 get_file_list(
     int argc,
     char **argv,
     int allow_empty)
 {
-    sl_t * file_list = NULL;
-    dumpspec_list_t * dumplist;
-
-    if (argc > 0) {
-        dumplist = cmdline_parse_dumpspecs(argc, argv);
-        if (!dumplist) {
-            fprintf(stderr, _("Could not get dump list\n"));
-            return NULL;
-        }
+    GSList * file_list = NULL;
+    GSList * dumplist;
+    int flags;
 
-        file_list = cmdline_match_holding(dumplist);
-        dumpspec_free_list(dumplist);
-    } else if (allow_empty) {
-        /* just list all of them */
-        file_list = holding_get_files(NULL, NULL, 1);
-    }
+    flags = CMDLINE_PARSE_DATESTAMP;
+    if (allow_empty) flags |= CMDLINE_EMPTY_TO_WILDCARD;
+    dumplist = cmdline_parse_dumpspecs(argc, argv, flags);
+
+    file_list = cmdline_match_holding(dumplist);
+    dumpspec_list_free(dumplist);
 
     return file_list;
 }
 
+/* Given a file header, find the history element in curinfo most likely
+ * corresponding to that dump (this is not an exact science).
+ *
+ * @param info: the info_t element for this DLE
+ * @param file: the header of the file
+ * @returns: index of the matching history element, or -1 if not found
+ */
 static int
-remove_holding_file_from_catalog(
-    char *filename)
+holding_file_find_history(
+    info_t *info,
+    dumpfile_t *file)
 {
-    static int warnings_printed; /* only print once per invocation */
-    char *host;
-    char *disk;
-    int level;
-    char *datestamp;
-    info_t info;
     int matching_hist_idx = -1;
-    history_t matching_hist; /* will be a copy */
     int nhist;
     int i;
 
-    if (!holding_file_read_header(filename, &host, &disk, &level, &datestamp)) {
-        printf(_("Could not read holding file %s\n"), filename);
-        return 0;
-    }
-
-    if (get_info(host, disk, &info) == -1) {
-           printf(_("WARNING: No curinfo record for %s:%s\n"), host, disk);
-           return 1; /* not an error */
-    }
-
     /* Begin by trying to find the history element matching this dump.
      * The datestamp on the dump is for the entire run of amdump, while the
      * 'date' in the history element of 'info' is the time the dump itself
      * began.  A matching history element, then, is the earliest element
-     * with a 'date' equal to or later than the date of the dumpfile. 
+     * with a 'date' equal to or later than the date of the dumpfile.
      *
      * We compare using formatted datestamps; even using seconds since epoch,
      * we would still face timezone issues, and have to do a reverse (timezone
@@ -1240,26 +1157,95 @@ remove_holding_file_from_catalog(
      */
 
     /* get to the end of the history list and search backward */
-    for (nhist = 0; info.history[nhist].level > -1; nhist++) /* empty loop */;
+    for (nhist = 0; info->history[nhist].level > -1; nhist++) /* empty loop */;
     for (i = nhist-1; i > -1; i--) {
-        char *info_datestamp = construct_timestamp(&info.history[i].date);
-        int order = strcmp(datestamp, info_datestamp);
+        char *info_datestamp = get_timestamp_from_time(info->history[i].date);
+        int order = strcmp(file->datestamp, info_datestamp);
         amfree(info_datestamp);
 
         if (order <= 0) {
             /* only a match if the levels are equal */
-            if (info.history[i].level == level) {
+            if (info->history[i].level == file->dumplevel) {
                 matching_hist_idx = i;
-                matching_hist = info.history[matching_hist_idx];
             }
             break;
         }
     }
 
+    return matching_hist_idx;
+}
+
+/* A holding file is 'outdated' if a subsequent dump of the same DLE was made
+ * at the same level or a lower leve; for example, a level 2 dump is outdated if
+ * there is a subsequent level 2, or a subsequent level 0.
+ *
+ * @param file: the header of the file
+ * @returns: true if the file is outdated
+ */
+static int
+holding_file_is_outdated(
+    dumpfile_t *file)
+{
+    info_t info;
+    int matching_hist_idx;
+
+    if (get_info(file->name, file->disk, &info) == -1) {
+       return 0; /* assume it's not outdated */
+    }
+
+    /* if the last level is less than the level of this dump, then
+     * it's outdated */
+    if (info.last_level < file->dumplevel)
+       return 1;
+
+    /* otherwise, we need to see if this dump is the last at its level */
+    matching_hist_idx = holding_file_find_history(&info, file);
     if (matching_hist_idx == -1) {
-        printf(_("WARNING: No dump matching %s found in curinfo.\n"), filename);
-        return 1; /* not an error */
+        return 0; /* assume it's not outdated */
+    }
+
+    /* compare the date of the history element with the most recent date
+     * for this level.  If they match, then this is the last dump at this
+     * level, and we checked above for more recent lower-level dumps, so
+     * the dump is not outdated. */
+    if (info.history[matching_hist_idx].date == 
+       info.inf[info.history[matching_hist_idx].level].date) {
+       return 0;
+    } else {
+       return 1;
     }
+}
+
+static int
+remove_holding_file_from_catalog(
+    char *filename)
+{
+    static int warnings_printed; /* only print once per invocation */
+    dumpfile_t file;
+    info_t info;
+    int matching_hist_idx = -1;
+    history_t matching_hist; /* will be a copy */
+    int i;
+
+    if (!holding_file_get_dumpfile(filename, &file)) {
+        g_printf(_("Could not read holding file %s\n"), filename);
+        return 0;
+    }
+
+    if (get_info(file.name, file.disk, &info) == -1) {
+           g_printf(_("WARNING: No curinfo record for %s:%s\n"), file.name, file.disk);
+           return 1; /* not an error */
+    }
+
+    matching_hist_idx = holding_file_find_history(&info, &file);
+
+    if (matching_hist_idx == -1) {
+        g_printf(_("WARNING: No dump matching %s found in curinfo.\n"), filename);
+       return 1; /* not an error */
+    }
+
+    /* make a copy */
+    matching_hist = info.history[matching_hist_idx];
 
     /* Remove the history element itself before doing the stats */
     for (i = matching_hist_idx; i <= NB_HISTORY; i++) {
@@ -1297,10 +1283,10 @@ remove_holding_file_from_catalog(
          * or lower */
         info.last_level = matching_hist.level;
         if (info.last_level == 0) {
-            printf(_("WARNING: Deleting the most recent full dump; forcing a full dump at next run.\n"));
+            g_printf(_("WARNING: Deleting the most recent full dump; forcing a full dump at next run.\n"));
             SET(info.command, FORCE_FULL);
         } else {
-            printf(_("WARNING: Deleting the most recent level %d dump; forcing a level %d dump or \nWARNING: lower at next run.\n"),
+            g_printf(_("WARNING: Deleting the most recent level %d dump; forcing a level %d dump or \nWARNING: lower at next run.\n"),
                 info.last_level, info.last_level);
             SET(info.command, FORCE_NO_BUMP);
         }
@@ -1311,15 +1297,15 @@ remove_holding_file_from_catalog(
             char *datestamp;
             if (info.history[i].level <= matching_hist.level) break;
 
-            datestamp = construct_timestamp(&info.history[i].date);
-            printf(_("WARNING: Level %d dump made %s can no longer be accurately restored.\n"), 
+            datestamp = get_timestamp_from_time(info.history[i].date);
+            g_printf(_("WARNING: Level %d dump made %s can no longer be accurately restored.\n"), 
                 info.history[i].level, datestamp);
             amfree(datestamp);
 
             warnings_printed = 1;
         }
         if (warnings_printed)
-            printf(_("WARNING: (note, dates shown above are for dumps, and may be later than the\nWARNING: corresponding run date)\n"));
+            g_printf(_("WARNING: (note, dates shown above are for dumps, and may be later than the\nWARNING: corresponding run date)\n"));
     }
 
     /* recalculate consecutive_runs based on the history: find the first run
@@ -1335,26 +1321,25 @@ remove_holding_file_from_catalog(
     /* this function doesn't touch the performance stats */
 
     /* write out the changes */
-    if (put_info(host, disk, &info) == -1) {
-           printf(_("Could not write curinfo record for %s:%s\n"), host, disk);
+    if (put_info(file.name, file.disk, &info) == -1) {
+           g_printf(_("Could not write curinfo record for %s:%s\n"), file.name, file.disk);
            return 0;
     }
 
     return 1;
 }
+
 void
 holding(
     int                argc,
     char **    argv)
 {
-    sl_t *file_list;
-    sle_t *h;
+    GSList *file_list;
+    GSList *li;
     enum { HOLDING_USAGE, HOLDING_LIST, HOLDING_DELETE } action = HOLDING_USAGE;
-    char *host;
-    char *disk;
-    char *datestamp;
-    int level;
     int long_list = 0;
+    int outdated_list = 0;
+    dumpfile_t file;
 
     if (argc < 4)
         action = HOLDING_USAGE;
@@ -1363,63 +1348,85 @@ holding(
     else if (strcmp(argv[3], "delete") == 0 && argc > 4)
         action = HOLDING_DELETE;
 
-    holding_set_verbosity(1);
-
     switch (action) {
         case HOLDING_USAGE:
-            fprintf(stderr,
-                    _("%s: expecting \"holding list [-l]\" or \"holding delete <host> [ .. ]\"\n"),
+            g_fprintf(stderr,
+                    _("%s: expecting \"holding list [-l] [-d]\" or \"holding delete <host> [ .. ]\"\n"),
                     get_pname());
             usage();
             return;
 
         case HOLDING_LIST:
             argc -= 4; argv += 4;
-            if (argc && strcmp(argv[0], "-l") == 0) {
-                argc--; argv++;
-                long_list = 1;
-            }
+           while (argc && argv[0][0] == '-') {
+               switch (argv[0][1]) {
+                   case 'l': 
+                       long_list = 1; 
+                       break;
+                   case 'd': /* have to use '-d', and not '-o', because of parse_config */
+                       outdated_list = 1;
+                       break;
+                   default:
+                       g_fprintf(stderr, _("Unknown option -%c\n"), argv[0][1]);
+                       usage();
+                       return;
+               }
+               argc--; argv++;
+           }
 
-            file_list = get_file_list(argc, argv, 1);
+           /* header */
             if (long_list) {
-                printf("%-10s %-2s %s\n", "size (kB)", "lv", "dump specification");
+                g_printf("%-10s %-2s %-4s %s\n", 
+                   _("size (kB)"), _("lv"), _("outd"), _("dump specification"));
             }
-            for (h = file_list->first; h != NULL; h = h->next) {
+
+            file_list = get_file_list(argc, argv, 1);
+            for (li = file_list; li != NULL; li = li->next) {
                 char *dumpstr;
-                if (!holding_file_read_header(h->name, &host, &disk, &level, &datestamp)) {
-                    fprintf(stderr, _("Error reading %s\n"), h->name);
+               int is_outdated;
+
+                if (!holding_file_get_dumpfile((char *)li->data, &file)) {
+                    g_fprintf(stderr, _("Error reading %s\n"), (char *)li->data);
                     continue;
                 }
 
-                dumpstr = cmdline_format_dumpspec_components(host, disk, datestamp);
-                if (long_list) {
-                    printf("%-10"OFF_T_RFMT" %-2d %s\n", 
-                        (OFF_T_FMT_TYPE)holding_file_size(h->name, 0), level, dumpstr);
-                } else {
-                    printf("%s\n", dumpstr);
-                }
+               is_outdated = holding_file_is_outdated(&file);
+
+                dumpstr = cmdline_format_dumpspec_components(file.name, file.disk, file.datestamp, NULL);
+               /* only print this entry if we're printing everything, or if it's outdated and
+                * we're only printing outdated files (-o) */
+               if (!outdated_list || is_outdated) {
+                   if (long_list) {
+                       g_printf("%-10lld %-2d %-4s %s\n", 
+                              (long long)holding_file_size((char *)li->data, 0),
+                              file.dumplevel,
+                              is_outdated? " *":"",
+                              dumpstr);
+                   } else {
+                       g_printf("%s\n", dumpstr);
+                   }
+               }
                 amfree(dumpstr);
             }
-            free_sl(file_list);
+            g_slist_free_full(file_list);
             break;
-            
+
         case HOLDING_DELETE:
             argc -= 4; argv += 4;
 
             file_list = get_file_list(argc, argv, 0);
-            for (h = file_list->first; h != NULL; h = h->next) {
-                fprintf(stderr, _("Deleting '%s'\n"), h->name);
+            for (li = file_list; li != NULL; li = li->next) {
+                g_fprintf(stderr, _("Deleting '%s'\n"), (char *)li->data);
                 /* remove it from the catalog */
-                if (!remove_holding_file_from_catalog(h->name))
+                if (!remove_holding_file_from_catalog((char *)li->data))
                     exit(1);
 
                 /* unlink it */
-                if (!holding_file_unlink(h->name)) {
-                    /* holding_file_unlink printed an error message */
-                    exit(1);
+                if (!holding_file_unlink((char *)li->data)) {
+                    error(_("Could not delete '%s'"), (char *)li->data);
                 }
             }
-            free_sl(file_list);
+            g_slist_free_full(file_list);
             break;
     }
 }
@@ -1454,32 +1461,32 @@ bumpsize(
     (void)argc;        /* Quiet unused parameter warning */
     (void)argv;        /* Quiet unused parameter warning */
 
-    printf("Current bump parameters:\n");
+    g_printf(_("Current bump parameters:\n"));
     if(conf_bumppercent == 0) {
-       printf("  bumpsize %5d KB\t- minimum savings (threshold) to bump level 1 -> 2\n",
+       g_printf(_("  bumpsize %5d KB\t- minimum savings (threshold) to bump level 1 -> 2\n"),
               getconf_int(CNF_BUMPSIZE));
-       printf("  bumpdays %5d\t- minimum days at each level\n",
+       g_printf(_("  bumpdays %5d\t- minimum days at each level\n"),
               getconf_int(CNF_BUMPDAYS));
-       printf("  bumpmult %5.5lg\t- threshold = bumpsize * bumpmult**(level-1)\n\n",
+       g_printf(_("  bumpmult %5.5lg\t- threshold = bumpsize * bumpmult**(level-1)\n\n"),
               conf_bumpmult);
 
-       printf("      Bump -> To  Threshold\n");
+       g_printf(_("      Bump -> To  Threshold\n"));
        for(l = 1; l < 9; l++)
-           printf("\t%d  ->  %d  %9d KB\n", l, l+1, bump_thresh(l));
+           g_printf(_("\t%d  ->  %d  %9d KB\n"), l, l+1, bump_thresh(l));
        putchar('\n');
     }
     else {
        double bumppercent = (double)conf_bumppercent;
 
-       printf("  bumppercent %3d %%\t- minimum savings (threshold) to bump level 1 -> 2\n",
+       g_printf(_("  bumppercent %3d %%\t- minimum savings (threshold) to bump level 1 -> 2\n"),
               conf_bumppercent);
-       printf("  bumpdays %5d\t- minimum days at each level\n",
+       g_printf(_("  bumpdays %5d\t- minimum days at each level\n"),
               getconf_int(CNF_BUMPDAYS));
-       printf("  bumpmult %5.5lg\t- threshold = disk_size * bumppercent * bumpmult**(level-1)\n\n",
+       g_printf(_("  bumpmult %5.5lg\t- threshold = disk_size * bumppercent * bumpmult**(level-1)\n\n"),
               conf_bumpmult);
-       printf("      Bump -> To  Threshold\n");
+       g_printf(_("      Bump -> To  Threshold\n"));
        for(l = 1; l < 9; l++) {
-           printf("\t%d  ->  %d  %7.2lf %%\n", l, l+1, bumppercent);
+           g_printf(_("\t%d  ->  %d  %7.2lf %%\n"), l, l+1, bumppercent);
            bumppercent *= conf_bumpmult;
            if(bumppercent >= 100.000) { bumppercent = 100.0;}
        }
@@ -1501,23 +1508,23 @@ export_db(
     char hostname[MAX_HOSTNAME_LENGTH+1];
     int i;
 
-    printf("CURINFO Version %s CONF %s\n", version(), getconf_str(CNF_ORG));
+    g_printf(_("CURINFO Version %s CONF %s\n"), version(), getconf_str(CNF_ORG));
 
     curtime = time(0);
     if(gethostname(hostname, SIZEOF(hostname)-1) == -1) {
-       error("could not determine host name: %s\n", strerror(errno));
+       error(_("could not determine host name: %s\n"), strerror(errno));
        /*NOTREACHED*/
     }
     hostname[SIZEOF(hostname)-1] = '\0';
-    printf("# Generated by:\n#    host: %s\n#    date: %s",
+    g_printf(_("# Generated by:\n#    host: %s\n#    date: %s"),
           hostname, ctime(&curtime));
 
-    printf("#    command:");
+    g_printf(_("#    command:"));
     for(i = 0; i < argc; i++)
-       printf(" %s", argv[i]);
+       g_printf(_(" %s"), argv[i]);
 
-    printf("\n# This file can be merged back in with \"amadmin import\".\n");
-    printf("# Edit only with care.\n");
+    g_printf(_("\n# This file can be merged back in with \"amadmin import\".\n"));
+    g_printf(_("# Edit only with care.\n"));
 
     if(argc >= 4)
        diskloop(argc, argv, "export", export_one);
@@ -1533,42 +1540,42 @@ export_one(
     int i,l;
 
     if(get_info(dp->host->hostname, dp->name, &info)) {
-       fprintf(stderr, "Warning: no curinfo record for %s:%s\n",
+       g_fprintf(stderr, _("Warning: no curinfo record for %s:%s\n"),
                dp->host->hostname, dp->name);
        return;
     }
-    printf("host: %s\ndisk: %s\n", dp->host->hostname, dp->name);
-    printf("command: %u\n", info.command);
-    printf("last_level: %d\n",info.last_level);
-    printf("consecutive_runs: %d\n",info.consecutive_runs);
-    printf("full-rate:");
-    for(i=0;i<AVG_COUNT;i++) printf(" %lf", info.full.rate[i]);
-    printf("\nfull-comp:");
-    for(i=0;i<AVG_COUNT;i++) printf(" %lf", info.full.comp[i]);
-
-    printf("\nincr-rate:");
-    for(i=0;i<AVG_COUNT;i++) printf(" %lf", info.incr.rate[i]);
-    printf("\nincr-comp:");
-    for(i=0;i<AVG_COUNT;i++) printf(" %lf", info.incr.comp[i]);
-    printf("\n");
+    g_printf(_("host: %s\ndisk: %s\n"), dp->host->hostname, dp->name);
+    g_printf(_("command: %u\n"), info.command);
+    g_printf(_("last_level: %d\n"),info.last_level);
+    g_printf(_("consecutive_runs: %d\n"),info.consecutive_runs);
+    g_printf(_("full-rate:"));
+    for(i=0;i<AVG_COUNT;i++) g_printf(_(" %lf"), info.full.rate[i]);
+    g_printf(_("\nfull-comp:"));
+    for(i=0;i<AVG_COUNT;i++) g_printf(_(" %lf"), info.full.comp[i]);
+
+    g_printf(_("\nincr-rate:"));
+    for(i=0;i<AVG_COUNT;i++) g_printf(_(" %lf"), info.incr.rate[i]);
+    g_printf(_("\nincr-comp:"));
+    for(i=0;i<AVG_COUNT;i++) g_printf(_(" %lf"), info.incr.comp[i]);
+    g_printf("\n");
     for(l=0;l<DUMP_LEVELS;l++) {
        if(info.inf[l].date < (time_t)0 && info.inf[l].label[0] == '\0') continue;
-       printf("stats: %d " OFF_T_FMT " " OFF_T_FMT " " TIME_T_FMT " " TIME_T_FMT " " OFF_T_FMT " %s\n", l,
-              (OFF_T_FMT_TYPE)info.inf[l].size,
-              (OFF_T_FMT_TYPE)info.inf[l].csize,
-              (TIME_T_FMT_TYPE)info.inf[l].secs,
-              (TIME_T_FMT_TYPE)info.inf[l].date,
-              (OFF_T_FMT_TYPE)info.inf[l].filenum,
+       g_printf(_("stats: %d %lld %lld %jd %jd %lld %s\n"), l,
+              (long long)info.inf[l].size,
+              (long long)info.inf[l].csize,
+              (intmax_t)info.inf[l].secs,
+              (intmax_t)info.inf[l].date,
+              (long long)info.inf[l].filenum,
               info.inf[l].label);
     }
     for(l=0;info.history[l].level > -1;l++) {
-       printf("history: %d " OFF_T_FMT " " OFF_T_FMT " " TIME_T_FMT "\n",
+       g_printf(_("history: %d %lld %lld %jd\n"),
               info.history[l].level,
-              (OFF_T_FMT_TYPE)info.history[l].size,
-              (OFF_T_FMT_TYPE)info.history[l].csize,
-              (TIME_T_FMT_TYPE)info.history[l].date);
+              (long long)info.history[l].size,
+              (long long)info.history[l].csize,
+              (intmax_t)info.history[l].date);
     }
-    printf("//\n");
+    g_printf("//\n");
 }
 
 /* ----------------------------------------------- */
@@ -1598,7 +1605,7 @@ import_db(
     /* process header line */
 
     if((line = agets(stdin)) == NULL) {
-       fprintf(stderr, "%s: empty input.\n", get_pname());
+       g_fprintf(stderr, _("%s: empty input.\n"), get_pname());
        return;
     }
 
@@ -1654,13 +1661,13 @@ import_db(
            (vers_min != VERSION_MINOR)? vers_min > VERSION_MINOR :
                                         vers_patch > VERSION_PATCH;
     if(newer)
-       fprintf(stderr,
-            "%s: WARNING: input is from newer Amanda version: %d.%d.%d.\n",
+       g_fprintf(stderr,
+            _("%s: WARNING: input is from newer Amanda version: %d.%d.%d.\n"),
                get_pname(), vers_maj, vers_min, vers_patch);
     /*@end@*/
 
     if(strcmp(org, getconf_str(CNF_ORG)) != 0) {
-       fprintf(stderr, "%s: WARNING: input is from different org: %s\n",
+       g_fprintf(stderr, _("%s: WARNING: input is from different org: %s\n"),
                get_pname(), org);
     }
 
@@ -1674,9 +1681,9 @@ import_db(
  bad_header:
 
     /*@i@*/ amfree(line);
-    fprintf(stderr, "%s: bad CURINFO header line in input: %s.\n",
+    g_fprintf(stderr, _("%s: bad CURINFO header line in input: %s.\n"),
            get_pname(), hdr);
-    fprintf(stderr, "    Was the input in \"amadmin export\" format?\n");
+    g_fprintf(stderr, _("    Was the input in \"amadmin export\" format?\n"));
     return;
 }
 
@@ -1687,19 +1694,14 @@ import_one(void)
     info_t info;
     stats_t onestat;
     int rc, level;
-    time_t onedate;
-    time_t *onedate_p = &onedate;
     char *line = NULL;
     char *s, *fp;
     int ch;
     int nb_history, i;
     char *hostname = NULL;
     char *diskname = NULL;
-    time_t *secs_p;
-
-#if TEXTDB
-    check_dumpuser();
-#endif
+    long long off_t_tmp;
+    long long time_t_tmp;
 
     memset(&info, 0, SIZEOF(info_t));
 
@@ -1815,39 +1817,40 @@ import_one(void)
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onestat.size) != 1) {
+       if(ch == '\0' || sscanf(s - 1, "%lld", &off_t_tmp) != 1) {
            goto parse_err;
        }
+       onestat.size = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onestat.csize) != 1) {
+       if(ch == '\0' || sscanf(s - 1, "%lld", &off_t_tmp) != 1) {
            goto parse_err;
        }
+       onestat.csize = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-        secs_p = &onestat.secs;
-       if(ch == '\0' || sscanf(s - 1, TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)secs_p) != 1) {
+       if(ch == '\0' || sscanf(s - 1, "%lld", &time_t_tmp) != 1) {
            goto parse_err;
        }
+        onestat.secs = (time_t)time_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf(s - 1, TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)onedate_p) != 1) {
+       if(ch == '\0' || sscanf(s - 1, "%lld", &time_t_tmp) != 1) {
            goto parse_err;
        }
+       /* time_t not guarranteed to be long */
+       /*@i1@*/ onestat.date = (time_t)time_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
        if(ch != '\0') {
-           if(sscanf(s - 1, OFF_T_FMT, (OFF_T_FMT_TYPE *)&onestat.filenum) != 1) {
+           if(sscanf(s - 1, "%lld", &off_t_tmp) != 1) {
                goto parse_err;
            }
+           onestat.filenum = (off_t)off_t_tmp;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);
@@ -1861,8 +1864,6 @@ import_one(void)
            }
        }
 
-       /* time_t not guarranteed to be long */
-       /*@i1@*/ onestat.date = onedate;
        if(level < 0 || level > 9) goto parse_err;
 
        info.inf[level] = onestat;
@@ -1873,8 +1874,6 @@ import_one(void)
     }
     while(1) {
        history_t onehistory;
-       time_t date;
-        time_t *date_p = &date;
 
        if(line[0] == '/' && line[1] == '/') {
            info.history[nb_history].level = -2;
@@ -1895,26 +1894,26 @@ import_one(void)
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onehistory.size) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            break;
        }
+       onehistory.size = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onehistory.csize) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            break;
        }
+       onehistory.csize = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if((ch == '\0') || (sscanf((s - 1), TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)date_p) != 1)) {
+       if((ch == '\0') || sscanf((s - 1), "%lld", &time_t_tmp) != 1) {
            break;
        }
+       /* time_t not guarranteed to be long */
+       /*@i1@*/ onehistory.date = (time_t)time_t_tmp;
        skip_integer(s, ch);
-       /*@i1@*/onehistory.date = date; /* time_t not guarranteed to be long */
 
        info.history[nb_history++] = onehistory;
        amfree(line);
@@ -1925,7 +1924,7 @@ import_one(void)
     /* got a full record, now write it out to the database */
 
     if(put_info(hostname, diskname, &info)) {
-       fprintf(stderr, "%s: error writing record for %s:%s\n",
+       g_fprintf(stderr, _("%s: error writing record for %s:%s\n"),
                get_pname(), hostname, diskname);
     }
     amfree(hostname);
@@ -1936,14 +1935,14 @@ import_one(void)
     /*@i@*/ amfree(line);
     amfree(hostname);
     amfree(diskname);
-    fprintf(stderr, "%s: parse error reading import record.\n", get_pname());
+    g_fprintf(stderr, _("%s: parse error reading import record.\n"), get_pname());
     return 0;
 
  shortfile_err:
     /*@i@*/ amfree(line);
     amfree(hostname);
     amfree(diskname);
-    fprintf(stderr, "%s: short file reading import record.\n", get_pname());
+    g_fprintf(stderr, _("%s: short file reading import record.\n"), get_pname());
     return 0;
 }
 
@@ -1969,7 +1968,7 @@ impget_line(void)
        /* otherwise, a blank line, so keep going */
     }
     if(ferror(stdin)) {
-       fprintf(stderr, "%s: reading stdin: %s\n",
+       g_fprintf(stderr, _("%s: reading stdin: %s\n"),
                get_pname(), strerror(errno));
     }
     return NULL;
@@ -1982,174 +1981,174 @@ disklist_one(
     disk_t *   dp)
 {
     am_host_t *hp;
-    interface_t *ip;
+    netif_t *ip;
     sle_t *excl;
 
     hp = dp->host;
     ip = hp->netif;
 
-    printf("line %d:\n", dp->line);
+    g_printf("line %d:\n", dp->line);
 
-    printf("    host %s:\n", hp->hostname);
-    printf("        interface %s\n",
-          ip->name[0] ? ip->name : "default");
-    printf("    disk %s:\n", dp->name);
-    if(dp->device) printf("        device %s\n", dp->device);
+    g_printf("    host %s:\n", hp->hostname);
+    g_printf("        interface %s\n",
+          interface_name(ip->config)[0] ? interface_name(ip->config) : "default");
+    g_printf("    disk %s:\n", dp->name);
+    if(dp->device) g_printf("        device %s\n", dp->device);
 
-    printf("        program \"%s\"\n", dp->program);
+    g_printf("        program \"%s\"\n", dp->program);
     if(dp->exclude_file != NULL && dp->exclude_file->nb_element > 0) {
-       printf("        exclude file");
+       g_printf("        exclude file");
        for(excl = dp->exclude_file->first; excl != NULL; excl = excl->next) {
-           printf(" \"%s\"", excl->name);
+           g_printf(" \"%s\"", excl->name);
        }
-       printf("\n");
+       g_printf("\n");
     }
     if(dp->exclude_list != NULL && dp->exclude_list->nb_element > 0) {
-       printf("        exclude list");
-       if(dp->exclude_optional) printf(" optional");
+       g_printf("        exclude list");
+       if(dp->exclude_optional) g_printf(" optional");
        for(excl = dp->exclude_list->first; excl != NULL; excl = excl->next) {
-           printf(" \"%s\"", excl->name);
+           g_printf(" \"%s\"", excl->name);
        }
-       printf("\n");
+       g_printf("\n");
     }
     if(dp->include_file != NULL && dp->include_file->nb_element > 0) {
-       printf("        include file");
+       g_printf("        include file");
        for(excl = dp->include_file->first; excl != NULL; excl = excl->next) {
-           printf(" \"%s\"", excl->name);
+           g_printf(" \"%s\"", excl->name);
        }
-       printf("\n");
+       g_printf("\n");
     }
     if(dp->include_list != NULL && dp->include_list->nb_element > 0) {
-       printf("        include list");
-       if(dp->include_optional) printf(" optional");
+       g_printf("        include list");
+       if(dp->include_optional) g_printf(" optional");
        for(excl = dp->include_list->first; excl != NULL; excl = excl->next) {
-           printf(" \"%s\"", excl->name);
+           g_printf(" \"%s\"", excl->name);
        }
-       printf("\n");
+       g_printf("\n");
     }
-    printf("        priority %d\n", dp->priority);
-    printf("        dumpcycle %d\n", dp->dumpcycle);
-    printf("        maxdumps %d\n", dp->maxdumps);
-    printf("        maxpromoteday %d\n", dp->maxpromoteday);
+    g_printf("        priority %d\n", dp->priority);
+    g_printf("        dumpcycle %d\n", dp->dumpcycle);
+    g_printf("        maxdumps %d\n", dp->maxdumps);
+    g_printf("        maxpromoteday %d\n", dp->maxpromoteday);
     if(dp->bumppercent > 0) {
-       printf("        bumppercent %d\n", dp->bumppercent);
+       g_printf("        bumppercent %d\n", dp->bumppercent);
     }
     else {
-       printf("        bumpsize " OFF_T_FMT "\n",
-               (OFF_T_FMT_TYPE)dp->bumpsize);
+       g_printf("        bumpsize %lld\n",
+               (long long)dp->bumpsize);
     }
-    printf("        bumpdays %d\n", dp->bumpdays);
-    printf("        bumpmult %lf\n", dp->bumpmult);
+    g_printf("        bumpdays %d\n", dp->bumpdays);
+    g_printf("        bumpmult %lf\n", dp->bumpmult);
 
-    printf("        strategy ");
+    g_printf("        strategy ");
     switch(dp->strategy) {
     case DS_SKIP:
-       printf("SKIP\n");
+       g_printf("SKIP\n");
        break;
     case DS_STANDARD:
-       printf("STANDARD\n");
+       g_printf("STANDARD\n");
        break;
     case DS_NOFULL:
-       printf("NOFULL\n");
+       g_printf("NOFULL\n");
        break;
     case DS_NOINC:
-       printf("NOINC\n");
+       g_printf("NOINC\n");
        break;
     case DS_HANOI:
-       printf("HANOI\n");
+       g_printf("HANOI\n");
        break;
     case DS_INCRONLY:
-       printf("INCRONLY\n");
+       g_printf("INCRONLY\n");
        break;
     }
-    printf("        ignore %s\n", (dp->ignore? "YES" : "NO"));
-    printf("        estimate ");
+    g_printf("        ignore %s\n", (dp->ignore? "YES" : "NO"));
+    g_printf("        estimate ");
     switch(dp->estimate) {
     case ES_CLIENT:
-       printf("CLIENT\n");
+       g_printf("CLIENT\n");
        break;
     case ES_SERVER:
-       printf("SERVER\n");
+       g_printf("SERVER\n");
        break;
     case ES_CALCSIZE:
-       printf("CALCSIZE\n");
+       g_printf("CALCSIZE\n");
        break;
     }
 
-    printf("        compress ");
+    g_printf("        compress ");
     switch(dp->compress) {
     case COMP_NONE:
-       printf("NONE\n");
+       g_printf("NONE\n");
        break;
     case COMP_FAST:
-       printf("CLIENT FAST\n");
+       g_printf("CLIENT FAST\n");
        break;
     case COMP_BEST:
-       printf("CLIENT BEST\n");
+       g_printf("CLIENT BEST\n");
        break;
     case COMP_SERVER_FAST:
-       printf("SERVER FAST\n");
+       g_printf("SERVER FAST\n");
        break;
     case COMP_SERVER_BEST:
-       printf("SERVER BEST\n");
+       g_printf("SERVER BEST\n");
        break;
     }
     if(dp->compress != COMP_NONE) {
-       printf("        comprate %.2lf %.2lf\n",
+       g_printf("        comprate %.2lf %.2lf\n",
               dp->comprate[0], dp->comprate[1]);
     }
 
-    printf("        encrypt ");
+    g_printf("        encrypt ");
     switch(dp->encrypt) {
     case ENCRYPT_NONE:
-       printf("NONE\n");
+       g_printf("NONE\n");
        break;
     case ENCRYPT_CUST:
-       printf("CLIENT\n");
+       g_printf("CLIENT\n");
        break;
     case ENCRYPT_SERV_CUST:
-       printf("SERVER\n");
+       g_printf("SERVER\n");
        break;
     }
 
-    printf("        auth %s\n", dp->security_driver);
-    printf("        kencrypt %s\n", (dp->kencrypt? "YES" : "NO"));
-    printf("        amandad_path %s\n", dp->amandad_path);
-    printf("        client_username %s\n", dp->client_username);
-    printf("        ssh_keys %s\n", dp->ssh_keys);
+    g_printf("        auth %s\n", dp->security_driver);
+    g_printf("        kencrypt %s\n", (dp->kencrypt? "YES" : "NO"));
+    g_printf("        amandad_path %s\n", dp->amandad_path);
+    g_printf("        client_username %s\n", dp->client_username);
+    g_printf("        ssh_keys %s\n", dp->ssh_keys);
 
-    printf("        holdingdisk ");
+    g_printf("        holdingdisk ");
     switch(dp->to_holdingdisk) {
     case HOLD_NEVER:
-       printf("NEVER\n");
+       g_printf("NEVER\n");
        break;
     case HOLD_AUTO:
-       printf("AUTO\n");
+       g_printf("AUTO\n");
        break;
     case HOLD_REQUIRED:
-       printf("REQUIRED\n");
+       g_printf("REQUIRED\n");
        break;
     }
 
-    printf("        record %s\n", (dp->record? "YES" : "NO"));
-    printf("        index %s\n", (dp->index? "YES" : "NO"));
-    printf("        starttime %04d\n", (int)dp->starttime);
+    g_printf("        record %s\n", (dp->record? "YES" : "NO"));
+    g_printf("        index %s\n", (dp->index? "YES" : "NO"));
+    g_printf("        starttime %04d\n", (int)dp->starttime);
     if(dp->tape_splitsize > (off_t)0) {
-       printf("        tape_splitsize " OFF_T_FMT "\n",
-              (OFF_T_FMT_TYPE)dp->tape_splitsize);
+       g_printf("        tape_splitsize %lld\n",
+              (long long)dp->tape_splitsize);
     }
     if(dp->split_diskbuffer) {
-       printf("        split_diskbuffer %s\n", dp->split_diskbuffer);
+       g_printf("        split_diskbuffer %s\n", dp->split_diskbuffer);
     }
     if(dp->fallback_splitsize > (off_t)0) {
-       printf("        fallback_splitsize " OFF_T_FMT "Mb\n",
-              (OFF_T_FMT_TYPE)(dp->fallback_splitsize / (off_t)1024));
+       g_printf("        fallback_splitsize %lldMb\n",
+              (long long)(dp->fallback_splitsize / (off_t)1024));
     }
-    printf("        skip-incr %s\n", (dp->skip_incr? "YES" : "NO"));
-    printf("        skip-full %s\n", (dp->skip_full? "YES" : "NO"));
-    printf("        spindle %d\n", dp->spindle);
+    g_printf("        skip-incr %s\n", (dp->skip_incr? "YES" : "NO"));
+    g_printf("        skip-full %s\n", (dp->skip_full? "YES" : "NO"));
+    g_printf("        spindle %d\n", dp->spindle);
 
-    printf("\n");
+    g_printf("\n");
 }
 
 void
@@ -2177,16 +2176,14 @@ show_version(
     (void)argv;        /* Quiet unused parameter warning */
 
     for(i = 0; version_info[i] != NULL; i++)
-       printf("%s", version_info[i]);
+       g_printf("%s", version_info[i]);
 }
 
 
 void show_config(
-    int argc,
-    char **argv)
+    int argc G_GNUC_UNUSED,
+    char **argv G_GNUC_UNUSED)
 {
-    argc = argc;
-    argv = argv;
-    dump_configuration(conffile);
+    dump_configuration();
 }
 
diff --git a/server-src/amaespipe.sh.in b/server-src/amaespipe.sh.in
deleted file mode 100755 (executable)
index 123786c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#! @SHELL@
-#
-# Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
-# 
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-# 
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-# 
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-# 
-# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
-# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
-#
-
-
-# wrapper script to use aespipe
-# based on bz2aespipe distributed by aespipe from 
-# http://loop-aes.sourceforge.net/
-# FILE FORMAT
-# 10 bytes: constant string 'bz2aespipe'
-# 10 bytes: itercountk digits
-# 1 byte: '0' = AES128, '1' = AES192, '2' = AES256
-# 1 byte: '0' = SHA256, '1' = SHA384, '2' = SHA512, '3' = RMD160
-# 24 bytes: random seed string
-# remaining bytes are aespipe encrypted
-
-# These definitions are only used when encrypting.
-# Decryption will autodetect these definitions from archive.
-ENCRYPTION=AES256
-HASHFUNC=SHA256
-ITERCOUNTK=100
-WAITSECONDS=1
-AMANDA_HOME=~@CLIENT_LOGIN@
-GPGKEY="$AMANDA_HOME/.gnupg/am_key.gpg"
-FDNUMBER=3
-
-PATH=/usr/bin:/usr/local/bin:/sbin:/usr/sbin
-export PATH
-
-if test x$1 = x-d ; then
-    # decrypt
-    n=`head -c 10 - | tr -d -c 0-9a-zA-Z`
-    if test x${n} != xbz2aespipe ; then
-        echo "bz2aespipe: wrong magic - aborted" >/dev/tty
-        exit 1
-    fi
-    itercountk=`head -c 10 - | tr -d -c 0-9`
-    if test x${itercountk} = x ; then itercountk=0; fi
-    n=`head -c 1 - | tr -d -c 0-9`
-    encryption=AES128
-    if test x${n} = x1 ; then encryption=AES192; fi
-    if test x${n} = x2 ; then encryption=AES256; fi
-    n=`head -c 1 - | tr -d -c 0-9`
-    hashfunc=SHA256
-    if test x${n} = x1 ; then hashfunc=SHA384; fi
-    if test x${n} = x2 ; then hashfunc=SHA512; fi
-    if test x${n} = x3 ; then hashfunc=RMD160; fi
-    seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/`
-    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -S ${seedstr} -C ${itercountk} -d
-else
-    # encrypt
-    echo -n bz2aespipe
-    echo ${ITERCOUNTK} | awk '{printf "%10u", $1;}'
-    n=`echo ${ENCRYPTION} | tr -d -c 0-9`
-    aesstr=0
-    if test x${n} = x192 ; then aesstr=1; fi
-    if test x${n} = x256 ; then aesstr=2; fi
-    n=`echo ${HASHFUNC} | tr -d -c 0-9`
-    hashstr=0
-    if test x${n} = x384 ; then hashstr=1; fi
-    if test x${n} = x512 ; then hashstr=2; fi
-    if test x${n} = x160 ; then hashstr=3; fi
-    seedstr=`head -c 18 /dev/urandom | uuencode -m - | head -n 2 | tail -n 1`
-    echo -n ${aesstr}${hashstr}${seedstr}
-    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
-fi
-exit 0
index 4498cd7a6bf77a04830c3ae677fe3817dcb6f11c..fdbd8cfb74f3729e52106196edc1223b03c91fbd 100644 (file)
 #include "amanda.h"
 #include "util.h"
 #include "conffile.h"
-#include "statfs.h"
+#include "columnar.h"
+#include "fsusage.h"
 #include "diskfile.h"
 #include "tapefile.h"
-#include "tapeio.h"
 #include "changer.h"
 #include "packet.h"
 #include "security.h"
@@ -47,6 +47,9 @@
 #include "server_util.h"
 #include "pipespawn.h"
 #include "amfeatures.h"
+#include "device.h"
+#include "property.h"
+#include "timestamp.h"
 
 #define BUFFER_SIZE    32768
 
@@ -63,18 +66,16 @@ void usage(void);
 pid_t start_client_checks(int fd);
 pid_t start_server_check(int fd, int do_localchk, int do_tapechk);
 int main(int argc, char **argv);
+int check_tapefile(FILE *outf, char *tapefile);
 int test_server_pgm(FILE *outf, char *dir, char *pgm, int suid, uid_t dumpuid);
 
 void
 usage(void)
 {
-    error("Usage: amcheck%s [-am] [-w] [-sclt] [-M <address>] <conf> [host [disk]* ]* [-o configoption]*", versionsuffix());
+    error(_("Usage: amcheck%s [-am] [-w] [-sclt] [-M <address>] <conf> [host [disk]* ]* [-o configoption]*"), versionsuffix());
     /*NOTREACHED*/
 }
 
-static unsigned long malloc_hist_1, malloc_size_1;
-static unsigned long malloc_hist_2, malloc_size_2;
-
 static am_feature_t *our_features = NULL;
 static char *our_feature_string = NULL;
 static char *displayunit;
@@ -102,19 +103,30 @@ main(
     int mailout;
     int alwaysmail;
     char *tempfname = NULL;
-    char *conffile;
     char *conf_diskfile;
     char *dumpuser;
     struct passwd *pw;
     uid_t uid_me;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     char *errstr;
+    config_overwrites_t *cfg_ovr;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
 
     set_pname("amcheck");
+    /* drop root privileges */
+    if (!set_root_privs(0)) {
+       error(_("amcheck must be run setuid root"));
+    }
 
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
@@ -122,18 +134,14 @@ main(
     dbopen(DBG_SUBDIR_SERVER);
 
     memset(buffer, 0, sizeof(buffer));
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
 
-    snprintf(pid_str, SIZEOF(pid_str), "%ld", (long)getpid());
+    g_snprintf(pid_str, SIZEOF(pid_str), "%ld", (long)getpid());
 
     erroutput_type = ERR_INTERACTIVE;
 
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
 
-    if(geteuid() == 0) {
-       seteuid(getuid());
-    }
     uid_me = getuid();
 
     alwaysmail = mailout = overwrite = 0;
@@ -141,17 +149,14 @@ main(
     server_probs = client_probs = 0;
     tempfd = mainfd = -1;
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
-
     /* process arguments */
 
-    while((opt = getopt(my_argc, my_argv, "M:mawsclt")) != EOF) {
+    cfg_ovr = new_config_overwrites(argc/2);
+    while((opt = getopt(argc, argv, "M:mawsclto:")) != EOF) {
        switch(opt) {
        case 'M':       mailto=stralloc(optarg);
                        if(!validate_mailto(mailto)){
-                          printf("Invalid characters in mail address\n");
+                          g_printf(_("Invalid characters in mail address\n"));
                           exit(1);
                        }
                        /*FALLTHROUGH*/
@@ -159,7 +164,8 @@ main(
 #ifdef MAILER
                        mailout = 1;
 #else
-                       printf("You can't use -%c because configure didn't find a mailer.\n",
+                       g_printf(_("You can't use -%c because configure didn't "
+                                "find a mailer./usr/bin/mail not found\n"),
                                opt);
                        exit(1);
 #endif
@@ -169,7 +175,8 @@ main(
                        mailout = 1;
                        alwaysmail = 1;
 #else
-                       printf("You can't use -%c because configure didn't find a mailer.\n",
+                       g_printf(_("You can't use -%c because configure didn't "
+                                "find a mailer./usr/bin/mail not found\n"),
                                opt);
                        exit(1);
 #endif
@@ -182,6 +189,8 @@ main(
                        break;
        case 'w':       overwrite = 1;
                        break;
+       case 'o':       add_config_overwrite_opt(cfg_ovr, optarg);
+                       break;
        case 't':       do_tapechk = 1;
                        break;
        case '?':
@@ -189,8 +198,8 @@ main(
            usage();
        }
     }
-    my_argc -= optind, my_argv += optind;
-    if(my_argc < 1) usage();
+    argc -= optind, argv += optind;
+    if(argc < 1) usage();
 
 
     if ((do_localchk | do_clientchk | do_tapechk) == 0) {
@@ -201,27 +210,20 @@ main(
     if(overwrite)
        do_tapechk = 1;
 
-    config_name = stralloc(*my_argv);
-
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-
+    config_init(CONFIG_INIT_EXPLICIT_NAME|CONFIG_INIT_FATAL,
+               argv[0]);
+    apply_config_overwrites(cfg_ovr);
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    amfree(conffile);
     if(mailout && !mailto && 
        (getconf_seen(CNF_MAILTO)==0 || strlen(getconf_str(CNF_MAILTO)) == 0)) {
-       printf("\nNo mail address configured in  amanda.conf\n");
+       g_printf(_("\nWARNING:No mail address configured in  amanda.conf.\n"));
+       g_printf(_("To receive dump results by email configure the "
+                "\"mailto\" parameter in amanda.conf\n"));
         if(alwaysmail)        
-               printf("When using -a option please specify -Maddress also\n\n"); 
+               g_printf(_("When using -a option please specify -Maddress also\n\n")); 
        else
-               printf("Use -Maddress instead of -m\n\n"); 
+               g_printf(_("Use -Maddress instead of -m\n\n")); 
        exit(1);
     }
     if(mailout && !mailto)
@@ -229,58 +231,59 @@ main(
        if(getconf_seen(CNF_MAILTO) && 
           strlen(getconf_str(CNF_MAILTO)) > 0) {
           if(!validate_mailto(getconf_str(CNF_MAILTO))){
-               printf("\nMail address in amanda.conf has invalid characters"); 
-               printf("\nNo email will be sent\n"); 
+               g_printf(_("\nMail address in amanda.conf has invalid characters")); 
+               g_printf(_("\nNo email will be sent\n")); 
                 mailout = 0;
           }
        }
        else {
-         printf("\nNo mail address configured in  amanda.conf\n");
+         g_printf(_("\nNo mail address configured in  amanda.conf\n"));
           if(alwaysmail)        
-               printf("When using -a option please specify -Maddress also\n\n"); 
+               g_printf(_("When using -a option please specify -Maddress also\n\n")); 
          else
-               printf("Use -Maddress instead of -m\n\n"); 
+               g_printf(_("Use -Maddress instead of -m\n\n")); 
          exit(1);
       }
     }
 
     conf_ctimeout = (time_t)getconf_int(CNF_CTIMEOUT);
 
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if(read_diskfile(conf_diskfile, &origq) < 0) {
-       error("could not load disklist %s", conf_diskfile);
+       error(_("could not load disklist %s. Make sure it exists and has correct permissions"), conf_diskfile);
        /*NOTREACHED*/
     }
-    errstr = match_disklist(&origq, my_argc-1, my_argv+1);
+    errstr = match_disklist(&origq, argc-1, argv+1);
     if (errstr) {
-       printf("%s",errstr);
+       g_printf(_("%s"),errstr);
        amfree(errstr);
     }
     amfree(conf_diskfile);
 
     /*
-     * Make sure we are running as the dump user.
+     * Make sure we are running as the dump user.  Don't use
+     * check_running_as(..) here, because we want to produce more
+     * verbose error messages.
      */
     dumpuser = getconf_str(CNF_DUMPUSER);
     if ((pw = getpwnam(dumpuser)) == NULL) {
-       error("cannot look up dump user \"%s\"", dumpuser);
+       error(_("amanda.conf has dump user configured to \"%s\", but that user does not exist."), dumpuser);
        /*NOTREACHED*/
     }
     uid_dumpuser = pw->pw_uid;
     if ((pw = getpwuid(uid_me)) == NULL) {
-       error("cannot look up my own uid (%ld)", (long)uid_me);
+       error(_("cannot get username for running user, uid %ld is not in your user database."),
+           (long)uid_me);
        /*NOTREACHED*/
     }
+#ifdef CHECK_USERID
     if (uid_me != uid_dumpuser) {
-       error("running as user \"%s\" instead of \"%s\"",
-             pw->pw_name, dumpuser);
+       error(_("running as user \"%s\" instead of \"%s\".\n"
+               "Change user to \"%s\" or change dump user to \"%s\" in amanda.conf"),
+             pw->pw_name, dumpuser, dumpuser, pw->pw_name);
         /*NOTREACHED*/
     }
+#endif
 
     displayunit = getconf_str(CNF_DISPLAYUNIT);
     unitdivisor = getconf_unit_divisor();
@@ -297,7 +300,7 @@ main(
        /* we need the temp file */
        tempfname = vstralloc(AMANDA_TMPDIR, "/amcheck.temp.", pid_str, NULL);
        if((tempfd = open(tempfname, O_RDWR|O_CREAT|O_TRUNC, 0600)) == -1) {
-           error("could not open %s: %s", tempfname, strerror(errno));
+           error(_("could not open temporary amcheck output file %s: %s. Check permissions"), tempfname, strerror(errno));
            /*NOTREACHED*/
        }
        unlink(tempfname);                      /* so it goes away on close */
@@ -308,7 +311,7 @@ main(
        /* the main fd is a file too */
        mainfname = vstralloc(AMANDA_TMPDIR, "/amcheck.main.", pid_str, NULL);
        if((mainfd = open(mainfname, O_RDWR|O_CREAT|O_TRUNC, 0600)) == -1) {
-           error("could not open %s: %s", mainfname, strerror(errno));
+           error(_("could not open amcheck server output file %s: %s. Check permissions"), mainfname, strerror(errno));
            /*NOTREACHED*/
        }
        unlink(mainfname);                      /* so it goes away on close */
@@ -346,14 +349,11 @@ main(
            server_probs = WIFSIGNALED(retstat) || WEXITSTATUS(retstat);
            serverchk_pid = 0;
        } else {
-           char number[NUM_STR_SIZE];
            char *wait_msg = NULL;
 
-           snprintf(number, SIZEOF(number), "%ld", (long)pid);
-           wait_msg = vstralloc("parent: reaped bogus pid ", number, "\n",
-                                NULL);
+           wait_msg = vstrallocf(_("parent: reaped bogus pid %ld\n"), (long)pid);
            if (fullwrite(mainfd, wait_msg, strlen(wait_msg)) < 0) {
-               error("write main file: %s", strerror(errno));
+               error(_("write main file: %s"), strerror(errno));
                /*NOTREACHED*/
            }
            amfree(wait_msg);
@@ -364,43 +364,33 @@ main(
 
     if(do_clientchk && (do_localchk || do_tapechk)) {
        if(lseek(tempfd, (off_t)0, 0) == (off_t)-1) {
-           error("seek temp file: %s", strerror(errno));
+           error(_("seek temp file: %s"), strerror(errno));
            /*NOTREACHED*/
        }
 
        while((size = fullread(tempfd, buffer, SIZEOF(buffer))) > 0) {
            if (fullwrite(mainfd, buffer, (size_t)size) < 0) {
-               error("write main file: %s", strerror(errno));
+               error(_("write main file: %s"), strerror(errno));
                /*NOTREACHED*/
            }
        }
        if(size < 0) {
-           error("read temp file: %s", strerror(errno));
+           error(_("read temp file: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        aclose(tempfd);
     }
 
-    version_string = vstralloc("\n",
-                              "(brought to you by Amanda ", version(), ")\n",
-                              NULL);
+    version_string = vstrallocf(_("\n(brought to you by Amanda %s)\n"), version());
     if (fullwrite(mainfd, version_string, strlen(version_string)) < 0) {
-       error("write main file: %s", strerror(errno));
+       error(_("write main file: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     amfree(version_string);
-    amfree(config_dir);
-    amfree(config_name);
     amfree(our_feature_string);
     am_release_feature_set(our_features);
     our_features = NULL;
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     /* send mail if requested, but only if there were problems */
 #ifdef MAILER
 
@@ -419,22 +409,20 @@ main(
        char *err = NULL;
        char *extra_info = NULL;
        char *line = NULL;
-       int ret;
        int rc;
-       int sig;
-       char number[NUM_STR_SIZE];
 
        fflush(stdout);
        if(lseek(mainfd, (off_t)0, SEEK_SET) == (off_t)-1) {
-           error("lseek main file: %s", strerror(errno));
+           error(_("lseek main file: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        if(alwaysmail && !(server_probs || client_probs)) {
-           subject = stralloc2(getconf_str(CNF_ORG),
-                           " AMCHECK REPORT: NO PROBLEMS FOUND");
+           subject = vstrallocf(_("%s AMCHECK REPORT: NO PROBLEMS FOUND"),
+                       getconf_str(CNF_ORG));
        } else {
-           subject = stralloc2(getconf_str(CNF_ORG),
-                           " AMANDA PROBLEM: FIX BEFORE RUN, IF POSSIBLE");
+           subject = vstrallocf(
+                       _("%s AMANDA PROBLEM: FIX BEFORE RUN, IF POSSIBLE"),
+                       getconf_str(CNF_ORG));
        }
        /*
         * Variable arg lists are hard to deal with when we do not know
@@ -475,13 +463,13 @@ main(
        while((r = fullread(mainfd, buffer, SIZEOF(buffer))) > 0) {
            if((w = fullwrite(mailfd, buffer, (size_t)r)) != (ssize_t)r) {
                if(w < 0 && errno == EPIPE) {
-                   strappend(extra_info, "EPIPE writing to mail process\n");
+                   strappend(extra_info, _("EPIPE writing to mail process\n"));
                    break;
                } else if(w < 0) {
-                   error("mailfd write: %s", strerror(errno));
+                   error(_("mailfd write: %s"), strerror(errno));
                    /*NOTREACHED*/
                } else {
-                   error("mailfd write: wrote " SSIZE_T_FMT " instead of " SIZE_T_FMT, w, r);
+                   error(_("mailfd write: wrote %zd instead of %zd"), w, r);
                    /*NOTREACHED*/
                }
            }
@@ -489,7 +477,7 @@ main(
        aclose(mailfd);
        ferr = fdopen(errfd, "r");
        if (!ferr) {
-           error("Can't fdopen: %s", strerror(errno));
+           error(_("Can't fdopen: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        for(; (line = agets(ferr)) != NULL; free(line)) {
@@ -502,22 +490,12 @@ main(
        errfd = -1;
        rc = 0;
        while (wait(&retstat) != -1) {
-           if (WIFSIGNALED(retstat)) {
-                   ret = 0;
-                   rc = sig = WTERMSIG(retstat);
-           } else {
-                   sig = 0;
-                   rc = ret = WEXITSTATUS(retstat);
-           }
-           if (rc != 0) {
-                   if (ret == 0) {
-                       strappend(err, "got signal ");
-                       ret = sig;
-                   } else {
-                       strappend(err, "returned ");
-                   }
-                   snprintf(number, SIZEOF(number), "%d", ret);
-                   strappend(err, number);
+           if (!WIFEXITED(retstat) || WEXITSTATUS(retstat) != 0) {
+               char *mailer_error = str_exit_status("mailer", retstat);
+               strappend(err, mailer_error);
+               amfree(mailer_error);
+
+               rc = 1;
            }
        }
        if (rc != 0) {
@@ -525,27 +503,49 @@ main(
                fputs(extra_info, stderr);
                amfree(extra_info);
            }
-           error("error running mailer %s: %s", MAILER, err);
+           error(_("error running mailer %s: %s"), MAILER, err?err:"(unknown)");
            /*NOTREACHED*/
        }
     }
 #endif
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
-
     dbclose();
     return (server_probs || client_probs);
 }
 
 /* --------------------------------------------------- */
 
-int nslots, backwards, found, got_match, tapedays;
-char *datestamp;
-char *first_match_label = NULL, *first_match = NULL, *found_device = NULL;
-char *label;
-char *searchlabel, *labelstr;
-tape_t *tp;
-FILE *errf = NULL;
+static char *datestamp;
+static FILE *errf = NULL;
+
+int check_tapefile(
+    FILE *outf,
+    char *tapefile)
+{
+    struct stat statbuf;
+    char *quoted;
+    int tapebad = 0;
+
+    if (stat(tapefile, &statbuf) == 0) {
+       if (!S_ISREG(statbuf.st_mode)) {
+           quoted = quote_string(tapefile);
+           g_fprintf(outf, _("ERROR: tapelist %s: should be a regular file.\n"),
+                   quoted);
+           tapebad = 1;
+           amfree(quoted);
+       } else if (access(tapefile, F_OK) != 0) {
+           quoted = quote_string(tapefile);
+           g_fprintf(outf, _("ERROR: can't access tapelist %s\n"), quoted);
+           tapebad = 1;
+           amfree(quoted);
+       } else if (access(tapefile, W_OK) != 0) {
+           quoted = quote_string(tapefile);
+           g_fprintf(outf, _("ERROR: tapelist %s: not writable\n"), quoted);
+           tapebad = 1;
+           amfree(quoted);
+       }
+    }
+    return tapebad;
+}
 
 int
 test_server_pgm(
@@ -562,76 +562,199 @@ test_server_pgm(
     pgm = vstralloc(dir, "/", pgm, versionsuffix(), NULL);
     quoted = quote_string(pgm);
     if(stat(pgm, &statbuf) == -1) {
-       fprintf(outf, "ERROR: program %s: does not exist\n",
+       g_fprintf(outf, _("ERROR: program %s: does not exist\n"),
                quoted);
        pgmbad = 1;
     } else if (!S_ISREG(statbuf.st_mode)) {
-       fprintf(outf, "ERROR: program %s: not a file\n",
+       g_fprintf(outf, _("ERROR: program %s: not a file\n"),
                quoted);
        pgmbad = 1;
     } else if (access(pgm, X_OK) == -1) {
-       fprintf(outf, "ERROR: program %s: not executable\n",
+       g_fprintf(outf, _("ERROR: program %s: not executable\n"),
                quoted);
        pgmbad = 1;
+#ifndef SINGLE_USERID
     } else if (suid \
               && dumpuid != 0
               && (statbuf.st_uid != 0 || (statbuf.st_mode & 04000) == 0)) {
-       fprintf(outf, "ERROR: program %s: not setuid-root\n",
+       g_fprintf(outf, _("ERROR: program %s: not setuid-root\n"),
                quoted);
        pgmbad = 1;
+#else
+    /* Quiet unused parameter warnings */
+    (void)suid;
+    (void)dumpuid;
+#endif /* SINGLE_USERID */
     }
     amfree(quoted);
     amfree(pgm);
     return pgmbad;
 }
 
+/* check that the tape is a valid amanda tape
+   Returns TRUE if all tests passed; FALSE otherwise. */
+static gboolean test_tape_status(FILE * outf) {
+    int tape_status;
+    Device * device;
+    GValue property_value;
+    char * label = NULL;
+    char * tapename = NULL;
+    ReadLabelStatusFlags label_status;
+
+    bzero(&property_value, sizeof(property_value));
+    
+    tapename = getconf_str(CNF_TAPEDEV);
+    g_return_val_if_fail(tapename != NULL, FALSE);
+
+    device_api_init();
+    
+    if (!getconf_seen(CNF_TPCHANGER) && getconf_int(CNF_RUNTAPES) != 1) {
+        g_fprintf(outf,
+                _("WARNING: if a tape changer is not available, runtapes "
+                  "must be set to 1\n"));
+        g_fprintf(outf, _("Change the value of the \"runtapes\" parameter in " 
+                        "amanda.conf or configure a tape changer\n"));
+    }
+    
+    tape_status = taper_scan(NULL, &label, &datestamp, &tapename, NULL,
+                             FILE_taperscan_output_callback, outf,
+                             NULL, NULL);
+    if (tape_status < 0) {
+        tape_t *exptape = lookup_last_reusable_tape(0);
+        g_fprintf(outf, _("       (expecting "));
+        if(exptape != NULL) g_fprintf(outf, _("tape %s or "), exptape->label);
+        g_fprintf(outf, _("a new tape)\n"));
+        amfree(label);
+        return FALSE;
+    }
+
+    device = device_open(tapename);
+
+    if (device == NULL) {
+        g_fprintf(outf, "ERROR: Could not open tape device.\n");
+        amfree(label);
+        return FALSE;
+    }
+    
+    device_set_startup_properties_from_config(device);
+    label_status = device_read_label(device);
+
+    if (tape_status == 3 && 
+        !(label_status & READ_LABEL_STATUS_VOLUME_UNLABELED)) {
+        if (label_status == READ_LABEL_STATUS_SUCCESS) {
+            g_fprintf(outf, "WARNING: Volume was unlabeled, but now "
+                    "is labeled \"%s\".\n", device->volume_label);
+        }
+    } else if (label_status != READ_LABEL_STATUS_SUCCESS && tape_status != 3) {
+        char * errstr = 
+            g_english_strjoinv_and_free
+                (g_flags_nick_to_strv(label_status &
+                                       (~READ_LABEL_STATUS_VOLUME_UNLABELED),
+                                       READ_LABEL_STATUS_FLAGS_TYPE), "or");
+        g_fprintf(outf, "WARNING: Reading label the second time failed: "
+                "One of %s.\n", errstr);
+        g_free(errstr);
+    } else if (tape_status != 3 &&
+               (device->volume_label == NULL || label == NULL ||
+                strcmp(device->volume_label, label) != 0)) {
+        g_fprintf(outf, "WARNING: Label mismatch on re-read: "
+                "Got %s first, then %s.\n", label, device->volume_label);
+    }
+    
+    /* If we can't get this property, it's not an error. Maybe the device
+     * doesn't support this property, or needs an actual volume to know
+     * for sure. */
+    if (device_property_get(device, PROPERTY_MEDIUM_TYPE, &property_value)) {
+        g_assert(G_VALUE_TYPE(&property_value) == MEDIA_ACCESS_MODE_TYPE);
+        if (g_value_get_enum(&property_value) ==
+            MEDIA_ACCESS_MODE_WRITE_ONLY) {
+            g_fprintf(outf, "WARNING: Media access mode is WRITE_ONLY, "
+                    "dumps will be thrown away.\n");
+        }
+    }
+    
+    if (overwrite) {
+       char *timestamp = get_undef_timestamp();
+        if (!device_start(device, ACCESS_WRITE, label, timestamp)) {
+            if (tape_status == 3) {
+                g_fprintf(outf, "ERROR: Could not label brand new tape.\n");
+            } else {
+                g_fprintf(outf,
+                        "ERROR: tape %s label ok, but is not writable.\n",
+                        label);
+            }
+           amfree(timestamp);
+            amfree(label);
+            g_object_unref(device);
+            return FALSE;
+        } else { /* Write succeeded. */
+            if (tape_status != 3) {
+                g_fprintf(outf, "Tape %s is writable; rewrote label.\n", label);
+            } else {
+                g_fprintf(outf, "Wrote label %s to brand new tape.\n", label);
+            }
+        }
+       amfree(timestamp);
+    } else { /* !overwrite */
+        g_fprintf(outf, "NOTE: skipping tape-writable test\n");
+        if (tape_status == 3) {
+            g_fprintf(outf,
+                    "Found a brand new tape, will label it %s.\n", 
+                    label);
+        } else {
+            g_fprintf(outf, "Tape %s label ok\n", label);
+        }                    
+    }
+    g_object_unref(device);
+    amfree(label);
+    return TRUE;
+}
+
 pid_t
 start_server_check(
     int                fd,
     int                do_localchk,
     int                do_tapechk)
 {
-    char *tapename;
-    generic_fs_stats_t fs;
+    struct fs_usage fsusage;
     FILE *outf = NULL;
     holdingdisk_t *hdp;
-    pid_t pid;
+    pid_t pid G_GNUC_UNUSED;
     int confbad = 0, tapebad = 0, disklow = 0, logbad = 0;
     int userbad = 0, infobad = 0, indexbad = 0, pgmbad = 0;
     int testtape = do_tapechk;
     tapetype_t *tp = NULL;
     char *quoted;
     int res;
-    struct addrinfo *gaires;
-    struct addrinfo hints;
+    intmax_t kb_avail;
 
     switch(pid = fork()) {
     case -1:
-       error("could not fork server check: %s", strerror(errno));
-       /*NOTREACHED*/
-
+       error(_("could not spawn a process for checking the server: %s"), strerror(errno));
+        g_assert_not_reached();
+        
     case 0:
        break;
-
+        
     default:
        return pid;
     }
-
+    
     dup2(fd, 1);
     dup2(fd, 2);
-
+    
     set_pname("amcheck-server");
-
+    
     startclock();
 
     if((outf = fdopen(fd, "w")) == NULL) {
-       error("fdopen %d: %s", fd, strerror(errno));
+       error(_("fdopen %d: %s"), fd, strerror(errno));
        /*NOTREACHED*/
     }
     errf = outf;
 
-    fprintf(outf, "Amanda Tape Server Host Check\n");
-    fprintf(outf, "-----------------------------\n");
+    g_fprintf(outf, _("Amanda Tape Server Host Check\n"));
+    g_fprintf(outf, "-----------------------------\n");
 
     if (do_localchk || testtape) {
         tp = lookup_tapetype(getconf_str(CNF_TAPETYPE));
@@ -646,57 +769,52 @@ start_server_check(
        char *lbl_templ;
 
        ColumnSpec = getconf_str(CNF_COLUMNSPEC);
-       if(SetColumDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
-           fprintf(outf, "ERROR: %s\n", errstr);
+       if(SetColumnDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
+           g_fprintf(outf, _("ERROR: %s\n"), errstr);
            amfree(errstr);
            confbad = 1;
        }
        lbl_templ = tapetype_get_lbl_templ(tp);
        if(strcmp(lbl_templ, "") != 0) {
-           if(strchr(lbl_templ, '/') == NULL) {
-               lbl_templ = stralloc2(config_dir, lbl_templ);
-           } else {
-               lbl_templ = stralloc(lbl_templ);
-           }
+           lbl_templ = config_dir_relative(lbl_templ);
            if(access(lbl_templ, R_OK) == -1) {
-               fprintf(outf,
-                       "ERROR: cannot access lbl_templ file %s: %s\n",
+               g_fprintf(outf,
+                       _("ERROR: cannot read label template (lbl-templ) file %s: %s. Check permissions\n"),
                        lbl_templ,
                        strerror(errno));
                confbad = 1;
            }
 #if !defined(LPRCMD)
-           fprintf(outf, "ERROR: lbl_templ set but no LPRCMD defined, you should reconfigure amanda\n       and make sure it find a lpr or lp command.\n");
+           g_fprintf(outf, _("ERROR:lbl-templ  set but no LPRCMD defined. You should reconfigure amanda\n       and make sure it finds a lpr or lp command.\n"));
            confbad = 1;
 #endif
        }
 
-       /* Double-check that 'localhost' resolves properly */
-#ifdef WORKING_IPV6
-       hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-       hints.ai_family = AF_UNSPEC;
-#else
-       hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = AF_INET;
-#endif
-       hints.ai_socktype = 0;
-       hints.ai_protocol = 0;
-       hints.ai_addrlen = 0;
-       hints.ai_addr = NULL;
-       hints.ai_canonname = NULL;
-       hints.ai_next = NULL;
-       res = getaddrinfo("localhost", NULL, &hints, &gaires);
-#ifdef WORKING_IPV6
-       if (res != 0) {
-           hints.ai_flags = AI_CANONNAME;
-           hints.ai_family = AF_UNSPEC;
-           res = getaddrinfo("localhost", NULL, &hints, &gaires);
+       if (getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED) <
+                                getconf_int(CNF_FLUSH_THRESHOLD_DUMPED)) {
+           g_fprintf(outf, _("WARNING: flush_threshold_dumped (%d) must be less than or equal to flush_threshold_scheduled (%d).\n"), 
+                     getconf_int(CNF_FLUSH_THRESHOLD_DUMPED),
+                     getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED));
        }
-#endif
-       if (res != 0) {
-           fprintf(outf, _("ERROR: Cannot resolve `localhost': %s\n"), gai_strerror(res));
+
+       if (getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED) <
+                                getconf_int(CNF_TAPERFLUSH)) {
+           g_fprintf(outf, _("WARNING: taperflush (%d) must be less than or equal to flush_threshold_scheduled (%d).\n"), 
+                     getconf_int(CNF_TAPERFLUSH),
+                     getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED));
+       }
+
+       if (getconf_int(CNF_TAPERFLUSH) > 0 &&
+           !getconf_boolean(CNF_AUTOFLUSH)) {
+           g_fprintf(outf, _("WARNING: autoflush must be set to 'yes' if taperflush (%d) is greater that 0.\n"),
+                     getconf_int(CNF_TAPERFLUSH));
+       }
+
+       /* Double-check that 'localhost' resolves properly */
+       if ((res = resolve_hostname("localhost", 0, NULL, NULL) != 0)) {
+           g_fprintf(outf, _("ERROR: Cannot resolve `localhost': %s\n"), gai_strerror(res));
+           confbad = 1;
        }
-       if (gaires) freeaddrinfo(gaires);
     }
 
     /*
@@ -706,30 +824,32 @@ start_server_check(
        /* 
         * entreprise version will do planner/dumper suid check
         */
-       if(access(libexecdir, X_OK) == -1) {
-           quoted = quote_string(libexecdir);
-           fprintf(outf, "ERROR: program dir %s: not accessible\n",
+       if(access(amlibexecdir, X_OK) == -1) {
+           quoted = quote_string(amlibexecdir);
+           g_fprintf(outf, _("ERROR: Directory %s containing Amanda tools is not accessible\n."),
                    quoted);
+           g_fprintf(outf, _("Check permissions\n"));
            pgmbad = 1;
            amfree(quoted);
        } else {
-           if(test_server_pgm(outf, libexecdir, "planner", 1, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "planner", 1, uid_dumpuser))
                pgmbad = 1;
-           if(test_server_pgm(outf, libexecdir, "dumper", 1, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "dumper", 1, uid_dumpuser))
                pgmbad = 1;
-           if(test_server_pgm(outf, libexecdir, "driver", 0, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "driver", 0, uid_dumpuser))
                pgmbad = 1;
-           if(test_server_pgm(outf, libexecdir, "taper", 0, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "taper", 0, uid_dumpuser))
                pgmbad = 1;
-           if(test_server_pgm(outf, libexecdir, "amtrmidx", 0, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "amtrmidx", 0, uid_dumpuser))
                pgmbad = 1;
-           if(test_server_pgm(outf, libexecdir, "amlogroll", 0, uid_dumpuser))
+           if(test_server_pgm(outf, amlibexecdir, "amlogroll", 0, uid_dumpuser))
                pgmbad = 1;
        }
        if(access(sbindir, X_OK) == -1) {
            quoted = quote_string(sbindir);
-           fprintf(outf, "ERROR: program dir %s: not accessible\n",
+           g_fprintf(outf, _("ERROR: Directory %s containing Amanda tools is not accessible\n"),
                    sbindir);
+           g_fprintf(outf, _("Check permissions\n"));
            pgmbad = 1;
            amfree(quoted);
        } else {
@@ -744,8 +864,9 @@ start_server_check(
        }
        if(access(COMPRESS_PATH, X_OK) == -1) {
            quoted = quote_string(COMPRESS_PATH);
-           fprintf(outf, "WARNING: %s is not executable, server-compression and indexing will not work\n",
-                   quoted);
+           g_fprintf(outf, _("WARNING: %s is not executable, server-compression "
+                           "and indexing will not work. \n"),quoted);
+           g_fprintf(outf, _("Check permissions\n"));
            amfree(quoted);
        }
     }
@@ -758,19 +879,15 @@ start_server_check(
      */
 
     if(do_localchk || do_tapechk) {
-       char *conf_tapelist;
        char *tapefile;
+       char *newtapefile;
        char *tape_dir;
        char *lastslash;
        char *holdfile;
+        char * tapename;
        struct stat statbuf;
        
-       conf_tapelist=getconf_str(CNF_TAPELIST);
-       if (*conf_tapelist == '/') {
-           tapefile = stralloc(conf_tapelist);
-       } else {
-           tapefile = stralloc2(config_dir, conf_tapelist);
-       }
+       tapefile = config_dir_relative(getconf_str(CNF_TAPELIST));
        /*
         * XXX There Really Ought to be some error-checking here... dhw
         */
@@ -783,45 +900,49 @@ start_server_check(
        }
        if(access(tape_dir, W_OK) == -1) {
            quoted = quote_string(tape_dir);
-           fprintf(outf, "ERROR: tapelist dir %s: not writable.\n", quoted);
+           g_fprintf(outf, _("ERROR: tapelist dir %s: not writable.\nCheck permissions\n"), 
+                   quoted);
            tapebad = 1;
            amfree(quoted);
        }
        else if(stat(tapefile, &statbuf) == -1) {
            quoted = quote_string(tape_dir);
-           fprintf(outf, "ERROR: tapelist %s (%s), "
-                   "you must create an empty file.\n",
+           g_fprintf(outf, _("ERROR: tapelist %s (%s), "
+                   "you must create an empty file.\n"),
                    quoted, strerror(errno));
            tapebad = 1;
            amfree(quoted);
        }
-       else if(!S_ISREG(statbuf.st_mode)) {
-           quoted = quote_string(tapefile);
-           fprintf(outf, "ERROR: tapelist %s: should be a regular file.\n",
-                   quoted);
-           tapebad = 1;
-           amfree(quoted);
-       }
-       else if(access(tapefile, F_OK) != 0) {
-           quoted = quote_string(tapefile);
-           fprintf(outf, "ERROR: can't access tapelist %s\n", quoted);
-           tapebad = 1;
-           amfree(quoted);
-       } else if(access(tapefile, F_OK) == 0 && access(tapefile, W_OK) != 0) {
-           quoted = quote_string(tapefile);
-           fprintf(outf, "ERROR: tapelist %s: not writable\n", quoted);
-           tapebad = 1;
-           amfree(quoted);
-       } else if(read_tapelist(tapefile)) {
-           quoted = quote_string(tapefile);
-           fprintf(outf, "ERROR: tapelist %s: parse error\n", quoted);
-           tapebad = 1;
-           amfree(quoted);
+       else {
+           tapebad |= check_tapefile(outf, tapefile);
+           if (tapebad == 0 && read_tapelist(tapefile)) {
+               quoted = quote_string(tapefile);
+               g_fprintf(outf, _("ERROR: tapelist %s: parse error\n"), quoted);
+               tapebad = 1;
+               amfree(quoted);
+           }
+           newtapefile = stralloc2(tapefile, ".new");
+           tapebad |= check_tapefile(outf, newtapefile);
+           amfree(newtapefile);
+           newtapefile = stralloc2(tapefile, ".amlabel");
+           tapebad |= check_tapefile(outf, newtapefile);
+           amfree(newtapefile);
+           newtapefile = stralloc2(tapefile, ".amlabel.new");
+           tapebad |= check_tapefile(outf, newtapefile);
+           amfree(newtapefile);
+           newtapefile = stralloc2(tapefile, ".yesterday");
+           tapebad |= check_tapefile(outf, newtapefile);
+           amfree(newtapefile);
+           newtapefile = stralloc2(tapefile, ".yesterday.new");
+           tapebad |= check_tapefile(outf, newtapefile);
+           amfree(newtapefile);
        }
-       holdfile = vstralloc(config_dir, "/", "hold", NULL);
+       holdfile = config_dir_relative("hold");
        if(access(holdfile, F_OK) != -1) {
            quoted = quote_string(holdfile);
-           fprintf(outf, "WARNING: hold file %s exists\n", holdfile);
+           g_fprintf(outf, _("WARNING: hold file %s exists."), holdfile);
+           g_fprintf(outf, _("Amdump will sleep as long as this file exists.\n"));
+           g_fprintf(outf, _("You might want to delete the existing hold file\n"));
            amfree(quoted);
        }
        amfree(tapefile);
@@ -830,89 +951,92 @@ start_server_check(
        tapename = getconf_str(CNF_TAPEDEV);
        if (tapename == NULL) {
            if (getconf_str(CNF_TPCHANGER) == NULL) {
-               fprintf(outf, "WARNING: No tapedev or tpchanger specified\n");
+               g_fprintf(outf, _("WARNING:Parameter \"tapedev\" or \"tpchanger\" not specified in amanda.conf.\n"));
                testtape = 0;
                do_tapechk = 0;
            }
-       } else if (strncmp_const(tapename, "null:") == 0) {
-           fprintf(outf,
-                   "WARNING: tapedev is %s, dumps will be thrown away\n",
-                   tapename);
-           testtape = 0;
-           do_tapechk = 0;
        }
     }
 
     /* check available disk space */
 
     if(do_localchk) {
-       for(hdp = holdingdisks; hdp != NULL; hdp = hdp->next) {
+       for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = holdingdisk_next(hdp)) {
            quoted = quote_string(holdingdisk_get_diskdir(hdp));
-           if(get_fs_stats(holdingdisk_get_diskdir(hdp), &fs) == -1) {
-               fprintf(outf, "ERROR: holding dir %s (%s), "
-                       "you must create a directory.\n",
+           if(get_fs_usage(holdingdisk_get_diskdir(hdp), NULL, &fsusage) == -1) {
+               g_fprintf(outf, _("ERROR: holding dir %s (%s), "
+                       "you must create a directory.\n"),
                        quoted, strerror(errno));
                disklow = 1;
+               amfree(quoted);
+               continue;
            }
-           else if(access(holdingdisk_get_diskdir(hdp), W_OK) == -1) {
-               fprintf(outf, "ERROR: holding disk %s: not writable: %s.\n",
+
+           /* do the division first to avoid potential integer overflow */
+           if (fsusage.fsu_bavail_top_bit_set)
+               kb_avail = 0;
+           else
+               kb_avail = fsusage.fsu_bavail / 1024 * fsusage.fsu_blocksize;
+
+           if(access(holdingdisk_get_diskdir(hdp), W_OK) == -1) {
+               g_fprintf(outf, _("ERROR: holding disk %s: not writable: %s.\n"),
                        quoted, strerror(errno));
+               g_fprintf(outf, _("Check permissions\n"));
                disklow = 1;
            }
            else if(access(holdingdisk_get_diskdir(hdp), X_OK) == -1) {
-               fprintf(outf, "ERROR: holding disk %s: not searcheable: %s.\n",
+               g_fprintf(outf, _("ERROR: holding disk %s: not searcheable: %s.\n"),
                        quoted, strerror(errno));
-               disklow = 1;
-           }
-           else if(fs.avail == (off_t)-1) {
-               fprintf(outf,
-                       "WARNING: holding disk %s: "
-                       "available space unknown (" OFF_T_FMT" KB requested)\n",
-                       quoted, (OFF_T_FMT_TYPE)holdingdisk_get_disksize(hdp));
+               g_fprintf(outf, _("Check permissions of ancestors of %s\n"), quoted);
                disklow = 1;
            }
            else if(holdingdisk_get_disksize(hdp) > (off_t)0) {
-               if(fs.avail < holdingdisk_get_disksize(hdp)) {
-                   fprintf(outf,
-                           "WARNING: holding disk %s: "
-                           "only " OFF_T_FMT " %sB free ("
-                           OFF_T_FMT " %sB requested)\n", quoted,
-                           (OFF_T_FMT_TYPE)(fs.avail / (off_t)unitdivisor),
+               if(kb_avail == 0) {
+                   g_fprintf(outf,
+                           _("WARNING: holding disk %s: "
+                           "no space available (%lld %sB requested)\n"), quoted,
+                           (long long)(holdingdisk_get_disksize(hdp)/(off_t)unitdivisor),
+                           displayunit);
+                   disklow = 1;
+               }
+               else if(kb_avail < holdingdisk_get_disksize(hdp)) {
+                   g_fprintf(outf,
+                           _("WARNING: holding disk %s: "
+                           "only %lld %sB available (%lld %sB requested)\n"), quoted,
+                           (long long)(kb_avail / (off_t)unitdivisor),
                            displayunit,
-                           (OFF_T_FMT_TYPE)(holdingdisk_get_disksize(hdp)/(off_t)unitdivisor),
+                           (long long)(holdingdisk_get_disksize(hdp)/(off_t)unitdivisor),
                            displayunit);
                    disklow = 1;
                }
                else {
-                   fprintf(outf,
-                           "Holding disk %s: " OFF_T_FMT
-                           " %sB disk space available,"
-                           " using " OFF_T_FMT " %sB as requested\n",
+                   g_fprintf(outf,
+                           _("Holding disk %s: %lld %sB disk space available,"
+                           " using %lld %sB as requested\n"),
                            quoted,
-                           (OFF_T_FMT_TYPE)(fs.avail/(off_t)unitdivisor),
+                           (long long)(kb_avail / (off_t)unitdivisor),
                            displayunit,
-                           (OFF_T_FMT_TYPE)(holdingdisk_get_disksize(hdp)/(off_t)unitdivisor),
+                           (long long)(holdingdisk_get_disksize(hdp)/(off_t)unitdivisor),
                            displayunit);
                }
            }
            else {
-               if((fs.avail + holdingdisk_get_disksize(hdp)) < (off_t)0) {
-                   fprintf(outf,
-                           "WARNING: holding disk %s: "
-                           "only " OFF_T_FMT " %sB free, using nothing\n",
-                           quoted, (OFF_T_FMT_TYPE)(fs.avail/(off_t)unitdivisor),
+               if(kb_avail < -holdingdisk_get_disksize(hdp)) {
+                   g_fprintf(outf,
+                           _("WARNING: holding disk %s: "
+                           "only %lld %sB free, using nothing\n"),
+                           quoted, (long long)(kb_avail / (off_t)unitdivisor),
                            displayunit);
+                   g_fprintf(outf, _("WARNING: Not enough free space specified in amanda.conf\n"));
                    disklow = 1;
                }
                else {
-                   fprintf(outf,
-                           "Holding disk %s: "
-                           OFF_T_FMT " %sB disk space available, using "
-                           OFF_T_FMT " %sB\n",
+                   g_fprintf(outf,
+                           _("Holding disk %s: %lld %sB disk space available, using %lld %sB\n"),
                            quoted,
-                           (OFF_T_FMT_TYPE)(fs.avail/(off_t)unitdivisor),
+                           (long long)(kb_avail/(off_t)unitdivisor),
                            displayunit,
-                           (OFF_T_FMT_TYPE)((fs.avail + holdingdisk_get_disksize(hdp)) / (off_t)unitdivisor),
+                           (long long)((kb_avail + holdingdisk_get_disksize(hdp)) / (off_t)unitdivisor),
                            displayunit);
                }
            }
@@ -929,22 +1053,17 @@ start_server_check(
        struct stat stat_old;
        struct stat statbuf;
 
-       conf_logdir = getconf_str(CNF_LOGDIR);
-       if (*conf_logdir == '/') {
-           conf_logdir = stralloc(conf_logdir);
-       } else {
-           conf_logdir = stralloc2(config_dir, conf_logdir);
-       }
+       conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
        logfile = vstralloc(conf_logdir, "/log", NULL);
 
        quoted = quote_string(conf_logdir);
        if(stat(conf_logdir, &statbuf) == -1) {
-           fprintf(outf, "ERROR: logdir %s (%s), you must create directory.\n",
+           g_fprintf(outf, _("ERROR: logdir %s (%s), you must create directory.\n"),
                    quoted, strerror(errno));
            disklow = 1;
        }
        else if(access(conf_logdir, W_OK) == -1) {
-           fprintf(outf, "ERROR: log dir %s: not writable\n", quoted);
+           g_fprintf(outf, _("ERROR: log dir %s: not writable\n"), quoted);
            logbad = 1;
        }
        amfree(quoted);
@@ -954,7 +1073,7 @@ start_server_check(
            logbad = 2;
            if(access(logfile, W_OK) != 0) {
                quoted = quote_string(logfile);
-               fprintf(outf, "ERROR: log file %s: not writable\n", quoted);
+               g_fprintf(outf, _("ERROR: log file %s: not writable\n"), quoted);
                amfree(quoted);
            }
        }
@@ -963,18 +1082,21 @@ start_server_check(
        quoted = quote_string(olddir);
        if (stat(olddir,&stat_old) == 0) { /* oldlog exist */
            if(!(S_ISDIR(stat_old.st_mode))) {
-               fprintf(outf, "ERROR: oldlog directory %s is not a directory\n",
+               g_fprintf(outf, _("ERROR: oldlog directory %s is not a directory\n"),
                        quoted);
+               g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                logbad = 1;
            }
            if(access(olddir, W_OK) == -1) {
-               fprintf(outf, "ERROR: oldlog dir %s: not writable\n", quoted);
+               g_fprintf(outf, _("ERROR: oldlog dir %s: not writable\n"), quoted);
+               g_fprintf(outf, _("Check permissions\n"));
                logbad = 1;
            }
        }
        else if(lstat(olddir,&stat_old) == 0) {
-           fprintf(outf, "ERROR: oldlog directory %s is not a directory\n",
+           g_fprintf(outf, _("ERROR: oldlog directory %s is not a directory\n"),
                    quoted);
+               g_fprintf(outf, _("Remove the entry and create a new directory\n"));
            logbad = 1;
        }
        amfree(quoted);
@@ -993,86 +1115,15 @@ start_server_check(
     }
 
     if (testtape) {
-       /* check that the tape is a valid amanda tape */
-        int tape_status;
-
-       tapedays = getconf_int(CNF_TAPECYCLE);
-       labelstr = getconf_str(CNF_LABELSTR);
-       tapename = getconf_str(CNF_TAPEDEV);
-
-       if (!getconf_seen(CNF_TPCHANGER) && getconf_int(CNF_RUNTAPES) != 1) {
-           fprintf(outf,
-                   "WARNING: if a tape changer is not available, runtapes must be set to 1\n");
-       }
-
-        tape_status = taper_scan(NULL, &label, &datestamp, &tapename,
-                                FILE_taperscan_output_callback, outf);
-       if (tapename) {
-           if (tape_access(tapename,F_OK) == -1) {
-               fprintf(outf, "ERROR: Can't access device %s: %s\n", tapename,
-                       strerror(errno));
-               tapebad = 1;
-           }
-           if (tape_access(tapename,R_OK) == -1) {
-               fprintf(outf, "ERROR: Can't read device %s: %s\n", tapename,
-                       strerror(errno));
-               tapebad = 1;
-           }
-           if (tape_access(tapename,W_OK) == -1) {
-               fprintf(outf, "ERROR: Can't write to device %s: %s\n", tapename,
-                       strerror(errno));
-               tapebad = 1;
-           }
-       }
-        if (tape_status < 0) {
-           tape_t *exptape = lookup_last_reusable_tape(0);
-           fprintf(outf, "       (expecting ");
-           if(exptape != NULL) fprintf(outf, "tape %s or ", exptape->label);
-           fprintf(outf, "a new tape)\n");
-            tapebad = 1;
-       } else {
-            if (overwrite) {
-                char *wrlabel_status;
-                wrlabel_status = tape_wrlabel(tapename, "X", label,
-                               (unsigned)(tapetype_get_blocksize(tp) * 1024));
-                if (wrlabel_status != NULL) {
-                    if (tape_status == 3) {
-                        fprintf(outf,
-                                "ERROR: Could not label brand new tape: %s\n",
-                                wrlabel_status);
-                    } else {
-                        fprintf(outf,
-                                "ERROR: tape %s label ok, but is not writable (%s)\n",
-                                label, wrlabel_status);
-                    }
-                    tapebad = 1;
-                } else {
-                    if (tape_status != 3) {
-                        fprintf(outf, "Tape %s is writable; rewrote label.\n", label);
-                    } else {
-                        fprintf(outf, "Wrote label %s to brand new tape.\n", label);
-                    }
-                }
-            } else {
-                fprintf(outf, "NOTE: skipping tape-writable test\n");
-                if (tape_status == 3) {
-                    fprintf(outf,
-                            "Found a brand new tape, will label it %s.\n", 
-                            label);
-                } else {
-                    fprintf(outf, "Tape %s label ok\n", label);
-                }                    
-            }
-        }
-       amfree(tapename);
+        tapebad = !test_tape_status(outf);
     } else if (do_tapechk) {
-       fprintf(outf, "WARNING: skipping tape test because amdump or amflush seem to be running\n");
-       fprintf(outf, "WARNING: if they are not, you must run amcleanup\n");
+       g_fprintf(outf, _("WARNING: skipping tape test because amdump or amflush seem to be running\n"));
+       g_fprintf(outf, _("WARNING: if they are not, you must run amcleanup\n"));
     } else if (logbad == 2) {
-       fprintf(outf, "WARNING: amdump or amflush seem to be running\n");
-       fprintf(outf, "WARNING: if they are not, you must run amcleanup\n");
+       g_fprintf(outf, _("WARNING: amdump or amflush seem to be running\n"));
+       g_fprintf(outf, _("WARNING: if they are not, you must run amcleanup\n"));
     } else {
-       fprintf(outf, "NOTE: skipping tape checks\n");
+       g_fprintf(outf, _("NOTE: skipping tape checks\n"));
     }
 
     /*
@@ -1100,83 +1151,73 @@ start_server_check(
        conf_runspercycle = getconf_int(CNF_RUNSPERCYCLE);
 
        if(conf_tapecycle <= conf_runspercycle) {
-               fprintf(outf, "WARNING: tapecycle (%d) <= runspercycle (%d).\n",
+               g_fprintf(outf, _("WARNING: tapecycle (%d) <= runspercycle (%d).\n"),
                        conf_tapecycle, conf_runspercycle);
        }
 
-       conf_infofile = getconf_str(CNF_INFOFILE);
-       if (*conf_infofile == '/') {
-           conf_infofile = stralloc(conf_infofile);
-       } else {
-           conf_infofile = stralloc2(config_dir, conf_infofile);
-       }
+       conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
+       conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR));
 
-       conf_indexdir = getconf_str(CNF_INDEXDIR);
-       if (*conf_indexdir == '/') {
-           conf_indexdir = stralloc(conf_indexdir);
-       } else {
-           conf_indexdir = stralloc2(config_dir, conf_indexdir);
-       }
-
-#if TEXTDB
        quoted = quote_string(conf_infofile);
        if(stat(conf_infofile, &statbuf) == -1) {
            if (errno == ENOENT) {
-               fprintf(outf, "NOTE: conf info dir %s does not exist\n",
+               g_fprintf(outf, _("NOTE: conf info dir %s does not exist\n"),
                        quoted);
-               fprintf(outf, "NOTE: it will be created on the next run.\n");
+               g_fprintf(outf, _("NOTE: it will be created on the next run.\n"));
            } else {
-               fprintf(outf, "ERROR: conf info dir %s (%s)\n",
+               g_fprintf(outf, _("ERROR: conf info dir %s (%s)\n"),
                        quoted, strerror(errno));
                infobad = 1;
            }   
            amfree(conf_infofile);
        } else if (!S_ISDIR(statbuf.st_mode)) {
-           fprintf(outf, "ERROR: info dir %s: not a directory\n", quoted);
+           g_fprintf(outf, _("ERROR: info dir %s: not a directory\n"), quoted);
+           g_fprintf(outf, _("Remove the entry and create a new directory\n"));
            amfree(conf_infofile);
            infobad = 1;
        } else if (access(conf_infofile, W_OK) == -1) {
-           fprintf(outf, "ERROR: info dir %s: not writable\n", quoted);
+           g_fprintf(outf, _("ERROR: info dir %s: not writable\n"), quoted);
+           g_fprintf(outf, _("Check permissions\n"));
            amfree(conf_infofile);
            infobad = 1;
        } else {
            char *errmsg = NULL;
            if (check_infofile(conf_infofile, &origq, &errmsg) == -1) {
-               fprintf(outf, "ERROR: Can't copy infofile: %s\n", errmsg);
+               g_fprintf(outf, "ERROR: Can't copy infofile: %s\n", errmsg);
                infobad = 1;
                amfree(errmsg);
            }
            strappend(conf_infofile, "/");
        }
        amfree(quoted);
-#endif
 
        while(!empty(origq)) {
            hostp = origq.head->host;
            host = sanitise_filename(hostp->hostname);
-#if TEXTDB
            if(conf_infofile) {
                hostinfodir = newstralloc2(hostinfodir, conf_infofile, host);
                quoted = quote_string(hostinfodir);
                if(stat(hostinfodir, &statbuf) == -1) {
                    if (errno == ENOENT) {
-                       fprintf(outf, "NOTE: host info dir %s does not exist\n",
+                       g_fprintf(outf, _("NOTE: host info dir %s does not exist\n"),
                                quoted);
-                       fprintf(outf,
-                               "NOTE: it will be created on the next run.\n");
+                       g_fprintf(outf,
+                               _("NOTE: it will be created on the next run.\n"));
                    } else {
-                       fprintf(outf, "ERROR: host info dir %s (%s)\n",
+                       g_fprintf(outf, _("ERROR: host info dir %s (%s)\n"),
                                quoted, strerror(errno));
                        infobad = 1;
                    }   
                    amfree(hostinfodir);
                } else if (!S_ISDIR(statbuf.st_mode)) {
-                   fprintf(outf, "ERROR: info dir %s: not a directory\n",
+                   g_fprintf(outf, _("ERROR: info dir %s: not a directory\n"),
                            quoted);
+                   g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                    amfree(hostinfodir);
                    infobad = 1;
                } else if (access(hostinfodir, W_OK) == -1) {
-                   fprintf(outf, "ERROR: info dir %s: not writable\n", quoted);
+                   g_fprintf(outf, _("ERROR: info dir %s: not writable\n"), quoted);
+                   g_fprintf(outf, _("Check permissions\n"));
                    amfree(hostinfodir);
                    infobad = 1;
                } else {
@@ -1184,10 +1225,8 @@ start_server_check(
                }
                amfree(quoted);
            }
-#endif
            for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
                disk = sanitise_filename(dp->name);
-#if TEXTDB
                if(hostinfodir) {
                    char *quotedif;
 
@@ -1197,39 +1236,42 @@ start_server_check(
                    quotedif = quote_string(infofile);
                    if(stat(diskdir, &statbuf) == -1) {
                        if (errno == ENOENT) {
-                           fprintf(outf, "NOTE: info dir %s does not exist\n",
+                           g_fprintf(outf, _("NOTE: info dir %s does not exist\n"),
                                quoted);
-                           fprintf(outf,
-                               "NOTE: it will be created on the next run.\n");
+                           g_fprintf(outf,
+                               _("NOTE: it will be created on the next run.\n"));
                        } else {
-                           fprintf(outf, "ERROR: info dir %s (%s)\n",
+                           g_fprintf(outf, _("ERROR: info dir %s (%s)\n"),
                                    quoted, strerror(errno));
                            infobad = 1;
                        }       
                    } else if (!S_ISDIR(statbuf.st_mode)) {
-                       fprintf(outf, "ERROR: info dir %s: not a directory\n",
+                       g_fprintf(outf, _("ERROR: info dir %s: not a directory\n"),
                                quoted);
+                       g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                        infobad = 1;
                    } else if (access(diskdir, W_OK) == -1) {
-                       fprintf(outf, "ERROR: info dir %s: not writable\n",
+                       g_fprintf(outf, _("ERROR: info dir %s: not writable\n"),
                                quoted);
+                       g_fprintf(outf,_("Check permissions\n"));
                        infobad = 1;
                    } else if(stat(infofile, &statbuf) == -1) {
                        if (errno == ENOENT) {
-                           fprintf(outf, "NOTE: info file %s does not exist\n",
+                           g_fprintf(outf, _("NOTE: info file %s does not exist\n"),
                                    quotedif);
-                           fprintf(outf, "NOTE: it will be created on the next run.\n");
+                           g_fprintf(outf, _("NOTE: it will be created on the next run.\n"));
                        } else {
-                           fprintf(outf, "ERROR: info dir %s (%s)\n",
+                           g_fprintf(outf, _("ERROR: info dir %s (%s)\n"),
                                    quoted, strerror(errno));
                            infobad = 1;
                        }       
                    } else if (!S_ISREG(statbuf.st_mode)) {
-                       fprintf(outf, "ERROR: info file %s: not a file\n",
+                       g_fprintf(outf, _("ERROR: info file %s: not a file\n"),
                                quotedif);
+                       g_fprintf(outf, _("Remove the entry and create a new file\n"));
                        infobad = 1;
                    } else if (access(infofile, R_OK) == -1) {
-                       fprintf(outf, "ERROR: info file %s: not readable\n",
+                       g_fprintf(outf, _("ERROR: info file %s: not readable\n"),
                                quotedif);
                        infobad = 1;
                    }
@@ -1237,28 +1279,28 @@ start_server_check(
                    amfree(quoted);
                    amfree(infofile);
                }
-#endif
                if(dp->index) {
                    if(! indexdir_checked) {
                        quoted = quote_string(conf_indexdir);
                        if(stat(conf_indexdir, &statbuf) == -1) {
                            if (errno == ENOENT) {
-                               fprintf(outf, "NOTE: index dir %s does not exist\n",
+                               g_fprintf(outf, _("NOTE: index dir %s does not exist\n"),
                                        quoted);
-                               fprintf(outf, "NOTE: it will be created on the next run.\n");
+                               g_fprintf(outf, _("NOTE: it will be created on the next run.\n"));
                            } else {
-                               fprintf(outf, "ERROR: index dir %s (%s)\n",
+                               g_fprintf(outf, _("ERROR: index dir %s (%s)\n"),
                                        quoted, strerror(errno));
                                indexbad = 1;
                            }   
                            amfree(conf_indexdir);
                        } else if (!S_ISDIR(statbuf.st_mode)) {
-                           fprintf(outf, "ERROR: index dir %s: not a directory\n",
+                           g_fprintf(outf, _("ERROR: index dir %s: not a directory\n"),
                                    quoted);
+                           g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                            amfree(conf_indexdir);
                            indexbad = 1;
                        } else if (access(conf_indexdir, W_OK) == -1) {
-                           fprintf(outf, "ERROR: index dir %s: not writable\n",
+                           g_fprintf(outf, _("ERROR: index dir %s: not writable\n"),
                                    quoted);
                            amfree(conf_indexdir);
                            indexbad = 1;
@@ -1274,22 +1316,23 @@ start_server_check(
                            quoted = quote_string(hostindexdir);
                            if(stat(hostindexdir, &statbuf) == -1) {
                                if (errno == ENOENT) {
-                                   fprintf(outf, "NOTE: index dir %s does not exist\n",
+                                   g_fprintf(outf, _("NOTE: index dir %s does not exist\n"),
                                            quoted);
-                                   fprintf(outf, "NOTE: it will be created on the next run.\n");
+                                   g_fprintf(outf, _("NOTE: it will be created on the next run.\n"));
                                } else {
-                                   fprintf(outf, "ERROR: index dir %s (%s)\n",
+                                   g_fprintf(outf, _("ERROR: index dir %s (%s)\n"),
                                            quoted, strerror(errno));
                                    indexbad = 1;
                                }
                                amfree(hostindexdir);
                            } else if (!S_ISDIR(statbuf.st_mode)) {
-                               fprintf(outf, "ERROR: index dir %s: not a directory\n",
+                               g_fprintf(outf, _("ERROR: index dir %s: not a directory\n"),
                                        quoted);
+                               g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                                amfree(hostindexdir);
                                indexbad = 1;
                            } else if (access(hostindexdir, W_OK) == -1) {
-                               fprintf(outf, "ERROR: index dir %s: not writable\n",
+                               g_fprintf(outf, _("ERROR: index dir %s: not writable\n"),
                                        quoted);
                                amfree(hostindexdir);
                                indexbad = 1;
@@ -1304,20 +1347,21 @@ start_server_check(
                            quoted = quote_string(diskdir);
                            if(stat(diskdir, &statbuf) == -1) {
                                if (errno == ENOENT) {
-                                   fprintf(outf, "NOTE: index dir %s does not exist\n",
+                                   g_fprintf(outf, _("NOTE: index dir %s does not exist\n"),
                                            quoted);
-                                   fprintf(outf, "NOTE: it will be created on the next run.\n");
+                                   g_fprintf(outf, _("NOTE: it will be created on the next run.\n"));
                                } else {
-                                   fprintf(outf, "ERROR: index dir %s (%s)\n",
+                                   g_fprintf(outf, _("ERROR: index dir %s (%s)\n"),
                                        quoted, strerror(errno));
                                    indexbad = 1;
                                }       
                            } else if (!S_ISDIR(statbuf.st_mode)) {
-                               fprintf(outf, "ERROR: index dir %s: not a directory\n",
+                               g_fprintf(outf, _("ERROR: index dir %s: not a directory\n"),
                                        quoted);
+                               g_fprintf(outf, _("Remove the entry and create a new directory\n"));
                                indexbad = 1;
                            } else if (access(diskdir, W_OK) == -1) {
-                               fprintf(outf, "ERROR: index dir %s: is not writable\n",
+                               g_fprintf(outf, _("ERROR: index dir %s: is not writable\n"),
                                        quoted);
                                indexbad = 1;
                            }
@@ -1328,26 +1372,33 @@ start_server_check(
 
                if ( dp->encrypt == ENCRYPT_SERV_CUST ) {
                  if ( dp->srv_encrypt[0] == '\0' ) {
-                   fprintf(outf, "ERROR: server encryption program not specified\n");
+                   g_fprintf(outf, _("ERROR: server encryption program not specified\n"));
+                   g_fprintf(outf, _("Specify \"server_custom_encrypt\" in the dumptype\n"));
                    pgmbad = 1;
                  }
                  else if(access(dp->srv_encrypt, X_OK) == -1) {
-                   fprintf(outf, "ERROR: %s is not executable, server encryption will not work\n",
+                   g_fprintf(outf, _("ERROR: %s is not executable, server encryption will not work\n"),
                            dp->srv_encrypt );
+                  g_fprintf(outf, _("Check file type\n"));
                    pgmbad = 1;
                  }
                }
                if ( dp->compress == COMP_SERVER_CUST ) {
                  if ( dp->srvcompprog[0] == '\0' ) {
-                   fprintf(outf, "ERROR: server custom compression program not specified\n");
+                   g_fprintf(outf, _("ERROR: server custom compression program "
+                                   "not specified\n"));
+                   g_fprintf(outf, _("Specify \"server_custom_compress\" in "
+                                   "the dumptype\n"));
                    pgmbad = 1;
                  }
                  else if(access(dp->srvcompprog, X_OK) == -1) {
                    quoted = quote_string(dp->srvcompprog);
 
-                   fprintf(outf, "ERROR: %s is not executable, server custom compression will not work\n",
+                   g_fprintf(outf, _("ERROR: %s is not executable, server custom "
+                                   "compression will not work\n"),
                            quoted);
                    amfree(quoted);
+                  g_fprintf(outf, _("Check file type\n"));
                    pgmbad = 1;
                  }
                }
@@ -1366,20 +1417,11 @@ start_server_check(
     }
 
     amfree(datestamp);
-    amfree(label);
-    amfree(config_dir);
-    amfree(config_name);
 
-    fprintf(outf, "Server check took %s seconds\n", walltime_str(curclock()));
+    g_fprintf(outf, _("Server check took %s seconds\n"), walltime_str(curclock()));
 
     fflush(outf);
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fd, malloc_hist_1, malloc_hist_2);
-    }
-
     exit(userbad \
         || confbad \
         || tapebad \
@@ -1424,8 +1466,8 @@ start_host(
     }
 
     if (strcmp(hostp->hostname,"localhost") == 0) {
-       fprintf(outf,
-                    "WARNING: Usage of fully qualified hostname recommended for Client %s.\n",
+       g_fprintf(outf,
+                    _("WARNING: Usage of fully qualified hostname recommended for Client %s.\n"),
                     hostp->hostname);
     }
 
@@ -1449,40 +1491,46 @@ start_host(
 
        if(!am_has_feature(hostp->features, fe_selfcheck_req) &&
           !am_has_feature(hostp->features, fe_selfcheck_req_device)) {
-           fprintf(outf,
-                   "ERROR: Client %s does not support selfcheck REQ packet.\n",
+           g_fprintf(outf,
+                   _("ERROR: Client %s does not support selfcheck REQ packet.\n"),
                    hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
        if(!am_has_feature(hostp->features, fe_selfcheck_rep)) {
-           fprintf(outf,
-                   "ERROR: Client %s does not support selfcheck REP packet.\n",
+           g_fprintf(outf,
+                   _("ERROR: Client %s does not support selfcheck REP packet.\n"),
                    hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
        if(!am_has_feature(hostp->features, fe_sendsize_req_options) &&
           !am_has_feature(hostp->features, fe_sendsize_req_no_options) &&
           !am_has_feature(hostp->features, fe_sendsize_req_device)) {
-           fprintf(outf,
-                   "ERROR: Client %s does not support sendsize REQ packet.\n",
+           g_fprintf(outf,
+                   _("ERROR: Client %s does not support sendsize REQ packet.\n"),
                    hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
        if(!am_has_feature(hostp->features, fe_sendsize_rep)) {
-           fprintf(outf,
-                   "ERROR: Client %s does not support sendsize REP packet.\n",
+           g_fprintf(outf,
+                   _("ERROR: Client %s does not support sendsize REP packet.\n"),
                    hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
        if(!am_has_feature(hostp->features, fe_sendbackup_req) &&
           !am_has_feature(hostp->features, fe_sendbackup_req_device)) {
-           fprintf(outf,
-                  "ERROR: Client %s does not support sendbackup REQ packet.\n",
+           g_fprintf(outf,
+                  _("ERROR: Client %s does not support sendbackup REQ packet.\n"),
                   hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
        if(!am_has_feature(hostp->features, fe_sendbackup_rep)) {
-           fprintf(outf,
-                  "ERROR: Client %s does not support sendbackup REP packet.\n",
+           g_fprintf(outf,
+                  _("ERROR: Client %s does not support sendbackup REP packet.\n"),
                   hostp->hostname);
+           g_fprintf(outf, _("Client might be of a very old version\n"));
        }
 
-       snprintf(number, SIZEOF(number), "%d", hostp->maxdumps);
+       g_snprintf(number, SIZEOF(number), "%d", hostp->maxdumps);
        req = vstralloc("SERVICE ", "selfcheck", "\n",
                        "OPTIONS ",
                        has_features ? "features=" : "",
@@ -1524,45 +1572,64 @@ start_host(
            if ((dp->name && qname[0] == '"') || 
                (dp->device && qdevice[0] == '"')) {
                if(!am_has_feature(hostp->features, fe_interface_quoted_text)) {
-                   fprintf(outf,
-                           "WARNING: %s:%s:%s host does not support quoted text\n",
+                   g_fprintf(outf,
+                           _("WARNING: %s:%s:%s host does not support quoted text\n"),
                            hostp->hostname, qname, qdevice);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to "
+                                   "specify a quoted text/device in the disklist, "
+                                   "or don't use quoted text for the device.\n"));
                }
            }
 
            if(dp->device) {
                if(!am_has_feature(hostp->features, fe_selfcheck_req_device)) {
-                   fprintf(outf,
-                    "ERROR: %s:%s (%s): selfcheck does not support device.\n",
+                   g_fprintf(outf,
+                    _("ERROR: %s:%s (%s): selfcheck does not support device.\n"),
                     hostp->hostname, qname, dp->device);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to "
+                                   "specify a diskdevice in the disklist "     
+                                   "or don't specify a diskdevice in the disklist.\n"));       
                }
                if(!am_has_feature(hostp->features, fe_sendsize_req_device)) {
-                   fprintf(outf,
-                    "ERROR: %s:%s (%s): sendsize does not support device.\n",
+                   g_fprintf(outf,
+                    _("ERROR: %s:%s (%s): sendsize does not support device.\n"),
                     hostp->hostname, qname, dp->device);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to "
+                                   "specify a diskdevice in the disklist"      
+                                   " or don't specify a diskdevice in the disklist.\n"));      
                }
                if(!am_has_feature(hostp->features, fe_sendbackup_req_device)) {
-                   fprintf(outf,
-                    "ERROR: %s:%s (%s): sendbackup does not support device.\n",
+                   g_fprintf(outf,
+                    _("ERROR: %s:%s (%s): sendbackup does not support device.\n"),
                     hostp->hostname, qname, dp->device);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to "
+                                   "specify a diskdevice in the disklist"      
+                                   " or don't specify a diskdevice in the disklist.\n"));      
                }
            }
            if(strcmp(dp->program,"DUMP") == 0 || 
               strcmp(dp->program,"GNUTAR") == 0) {
                if(strcmp(dp->program, "DUMP") == 0 &&
                   !am_has_feature(hostp->features, fe_program_dump)) {
-                   fprintf(outf, "ERROR: %s:%s does not support DUMP.\n",
+                   g_fprintf(outf, _("ERROR: %s:%s does not support DUMP.\n"),
                            hostp->hostname, qname);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to use DUMP "
+                                   "or you can use another program.\n"));      
                }
                if(strcmp(dp->program, "GNUTAR") == 0 &&
                   !am_has_feature(hostp->features, fe_program_gnutar)) {
-                   fprintf(outf, "ERROR: %s:%s does not support GNUTAR.\n",
+                   g_fprintf(outf, _("ERROR: %s:%s does not support GNUTAR.\n"),
                            hostp->hostname, qname);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to use GNUTAR "
+                                   "or you can use another program.\n"));      
                }
                if(dp->estimate == ES_CALCSIZE &&
                   !am_has_feature(hostp->features, fe_calcsize_estimate)) {
-                   fprintf(outf, "ERROR: %s:%s does not support CALCSIZE for estimate, using CLIENT.\n",
+                   g_fprintf(outf, _("ERROR: %s:%s does not support CALCSIZE for "
+                                   "estimate, using CLIENT.\n"),
                            hostp->hostname, qname);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to use "
+                                   "CALCSIZE for estimate or don't use CALCSIZE for estimate.\n"));
                    dp->estimate = ES_CLIENT;
                }
                if(dp->estimate == ES_CALCSIZE &&
@@ -1573,21 +1640,28 @@ start_host(
 
                if(dp->compress == COMP_CUST &&
                   !am_has_feature(hostp->features, fe_options_compress_cust)) {
-                 fprintf(outf,
-                         "ERROR: Client %s does not support custom compression.\n",
+                 g_fprintf(outf,
+                         _("ERROR: Client %s does not support custom compression.\n"),
                          hostp->hostname);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to "
+                                   "use custom compression\n"));
+                   g_fprintf(outf, _("Otherwise you can use the default client "
+                                   "compression program.\n"));
                }
                if(dp->encrypt == ENCRYPT_CUST ) {
                  if ( !am_has_feature(hostp->features, fe_options_encrypt_cust)) {
-                   fprintf(outf,
-                           "ERROR: Client %s does not support data encryption.\n",
+                   g_fprintf(outf,
+                           _("ERROR: Client %s does not support data encryption.\n"),
                            hostp->hostname);
+                   g_fprintf(outf, _("You must upgrade amanda on the client to use encryption program.\n"));
                    remote_errors++;
                  } else if ( dp->compress == COMP_SERVER_FAST || 
                              dp->compress == COMP_SERVER_BEST ||
                              dp->compress == COMP_SERVER_CUST ) {
-                   fprintf(outf,
-                           "ERROR: %s: Client encryption with server compression is not supported. See amanda.conf(5) for detail.\n", hostp->hostname);
+                   g_fprintf(outf,
+                           _("ERROR: %s: Client encryption with server compression "
+                             "is not supported. See amanda.conf(5) for detail.\n"), 
+                           hostp->hostname);
                    remote_errors++;
                  } 
                }
@@ -1612,8 +1686,10 @@ start_host(
                }
            } else {
                if(!am_has_feature(hostp->features, fe_program_backup_api)) {
-                   fprintf(outf, "ERROR: %s:%s does not support BACKUP-API.\n",
+                   g_fprintf(outf, _("ERROR: %s:%s does not support BACKUP-API.\n"),
                            hostp->hostname, qname);
+                   g_fprintf(outf, _("Dumptype configuration is not GNUTAR or DUMP."
+                                   " It is case sensitive\n"));
                }
                if(dp->device) {
                    l = vstralloc("BACKUP ",
@@ -1671,12 +1747,12 @@ start_host(
 
     secdrv = security_getdriver(hostp->disks->security_driver);
     if (secdrv == NULL) {
-       error("could not find security driver '%s' for host '%s'",
+       fprintf(stderr, _("Could not find security driver \"%s\" for host \"%s\". auth for this dle is invalid\n"),
              hostp->disks->security_driver, hostp->hostname);
-        /*NOTREACHED*/
+    } else {
+       protocol_sendreq(hostp->hostname, secdrv, amhost_get_security_conf, 
+                        req, conf_ctimeout, handle_result, hostp);
     }
-    protocol_sendreq(hostp->hostname, secdrv, amhost_get_security_conf, 
-                    req, conf_ctimeout, handle_result, hostp);
 
     amfree(req);
 
@@ -1695,7 +1771,7 @@ start_client_checks(
 
     switch(pid = fork()) {
     case -1:
-       error("could not fork client check: %s", strerror(errno));
+       error(_("INTERNAL ERROR:could not fork client check: %s"), strerror(errno));
        /*NOTREACHED*/
 
     case 0:
@@ -1713,13 +1789,13 @@ start_client_checks(
     startclock();
 
     if((outf = fdopen(fd, "w")) == NULL) {
-       error("fdopen %d: %s", fd, strerror(errno));
+       error(_("fdopen %d: %s"), fd, strerror(errno));
        /*NOTREACHED*/
     }
     errf = outf;
 
-    fprintf(outf, "\nAmanda Backup Client Hosts Check\n");
-    fprintf(outf,   "--------------------------------\n");
+    g_fprintf(outf, _("\nAmanda Backup Client Hosts Check\n"));
+    g_fprintf(outf,   "--------------------------------\n");
 
     protocol_init();
 
@@ -1736,22 +1812,15 @@ start_client_checks(
 
     protocol_run();
 
-    fprintf(outf,
-     "Client check: %d host%s checked in %s seconds, %d problem%s found\n",
-           hostcount, (hostcount == 1) ? "" : "s",
-           walltime_str(curclock()),
-           remote_errors, (remote_errors == 1) ? "" : "s");
+    g_fprintf(outf, plural(_("Client check: %d host checked in %s seconds."), 
+                        _("Client check: %d hosts checked in %s seconds."),
+                        hostcount),
+           hostcount, walltime_str(curclock()));
+    g_fprintf(outf, plural(_("  %d problem found.\n"),
+                        _("  %d problems found.\n"), remote_errors),
+           remote_errors);
     fflush(outf);
 
-    amfree(config_dir);
-    amfree(config_name);
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fd, malloc_hist_1, malloc_hist_2);
-    }
-
     exit(userbad || remote_errors > 0);
     /*NOTREACHED*/
     return 0;
@@ -1775,8 +1844,8 @@ handle_result(
     hostp->up = HOST_READY;
 
     if (pkt == NULL) {
-       fprintf(outf,
-           "WARNING: %s: selfcheck request failed: %s\n", hostp->hostname,
+       g_fprintf(outf,
+           _("WARNING: %s: selfcheck request failed: %s\n"), hostp->hostname,
            security_geterror(sech));
        remote_errors++;
        hostp->up = HOST_DONE;
@@ -1784,7 +1853,7 @@ handle_result(
     }
 
 #if 0
-    fprintf(errf, "got response from %s:\n----\n%s----\n\n",
+    g_fprintf(errf, _("got response from %s:\n----\n%s----\n\n"),
            hostp->hostname, pkt->body);
 #endif
 
@@ -1804,8 +1873,9 @@ handle_result(
                t += SIZEOF("features=")-1;
                am_release_feature_set(hostp->features);
                if((hostp->features = am_string_to_feature(t)) == NULL) {
-                   fprintf(outf, "ERROR: %s: bad features value: %s\n",
+                   g_fprintf(outf, _("ERROR: %s: bad features value: %s\n"),
                            hostp->hostname, line);
+                   g_fprintf(outf, _("The amfeature in the reply packet is invalid\n"));
                }
            }
 
@@ -1827,7 +1897,7 @@ handle_result(
            if(!((hostp->features == NULL) && (pkt->type == P_NAK)
               && ((strcmp(t - 1, "unknown service: noop") == 0)
                   || (strcmp(t - 1, "noop: invalid service") == 0)))) {
-               fprintf(outf, "ERROR: %s%s: %s\n",
+               g_fprintf(outf, _("ERROR: %s%s: %s\n"),
                        (pkt->type == P_NAK) ? "NAK " : "",
                        hostp->hostname,
                        t - 1);
@@ -1837,7 +1907,7 @@ handle_result(
            continue;
        }
 
-       fprintf(outf, "ERROR: %s: unknown response: %s\n",
+       g_fprintf(outf, _("ERROR: %s: unknown response: %s\n"),
                hostp->hostname, line);
        remote_errors++;
        hostp->up = HOST_DONE;
@@ -1847,8 +1917,7 @@ handle_result(
         * The client does not support the features list, so give it an
         * empty one.
         */
-       dbprintf(("%s: no feature set from host %s\n",
-                 debug_prefix_time(NULL), hostp->hostname));
+       dbprintf(_("no feature set from host %s\n"), hostp->hostname);
        hostp->features = am_set_default_feature_set();
     }
     for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
@@ -1859,4 +1928,7 @@ handle_result(
     start_host(hostp);
     if(hostp->up == HOST_DONE)
        security_close_connection(sech, hostp->hostname);
+    /* try to clean up any defunct processes, since Amanda doesn't wait() for
+       them explicitly */
+    while(waitpid(-1, NULL, WNOHANG)> 0);
 }
diff --git a/server-src/amcheckdb.sh b/server-src/amcheckdb.sh
new file mode 100644 (file)
index 0000000..ec527b7
--- /dev/null
@@ -0,0 +1,92 @@
+#! @SHELL@
+#
+# check tapelist against database and vice versa
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+ConfigDir=@CONFIG_DIR@
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+Program=`basename $0`
+
+log () {
+       echo 1>&2 "$@"
+       return 0
+}
+
+Config=$1
+if [ "$Config" = "" ]; then
+       log "usage: ${Program} <config>"
+       exit 1
+fi
+shift;
+
+#
+# Check if the configuration directory exists.  Make sure that the
+# necessary files can be found, such as amanda.conf and tapelist.
+#
+if [ ! -d ${ConfigDir}/${Config} ]; then
+       log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
+       exit 1
+fi
+(cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
+cd ${ConfigDir}/${Config}
+if [ ! -r amanda.conf ]; then
+       log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
+       exit 1
+fi
+
+# Get the location and name of the tapelist filename.  If tapelist is not
+# specified in the amanda.conf file, then use tapelist in the config
+# directory.
+TapeList=`amgetconf${SUF} $Config tapelist "@$"`
+if [ ! "$TapeList" ]; then
+       TapeList="$ConfigDir/$Config/tapelist"
+fi
+if [ ! -r $TapeList ]; then
+       log "${Program}: $TapeList not found or is not readable."
+       exit 1
+fi
+
+Amadmin=$sbindir/amadmin$SUF
+
+[ ! -f $Amadmin ] \
+       && echo `_ '%s was not found' $Amadmin` >&2 \
+       && exit 1
+[ ! -x $Amadmin ] \
+       && echo `_ '%s is not executable' $Amadmin` >&2 \
+       && exit 1
+
+$Amadmin $Config export "$@"\
+       | grep "^stats: " \
+       | while read LINE; do
+               [ "$LINE" = "" ] && continue
+               set $LINE
+               echo $8
+       done \
+       | sort -u \
+       | while read TAPE; do
+               [ "$TAPE" = "" ] && continue
+               grep " $TAPE " $TapeList 2>/dev/null >/dev/null
+               [ $? != 0 ] \
+                       && echo `_ 'Tape %s missing in %s' "$TAPE" "$TapeList"`
+       done
+
+echo `_ 'Ready.'`
+
+exit 0
diff --git a/server-src/amcheckdb.sh.in b/server-src/amcheckdb.sh.in
deleted file mode 100644 (file)
index ff1f63e..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#! @SHELL@
-#
-# check tapelist against database and vice versa
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-ConfigDir=@CONFIG_DIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-Program=`basename $0`
-
-log () {
-       echo 1>&2 "$@"
-       return 0
-}
-
-Config=$1
-if [ "$Config" = "" ]; then
-       log "usage: ${Program} <config>"
-       exit 1
-fi
-shift;
-
-#
-# Check if the configuration directory exists.  Make sure that the
-# necessary files can be found, such as amanda.conf and tapelist.
-#
-if [ ! -d ${ConfigDir}/${Config} ]; then
-       log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
-       exit 1
-fi
-(cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
-cd ${ConfigDir}/${Config}
-if [ ! -r amanda.conf ]; then
-       log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
-       exit 1
-fi
-
-# Get the location and name of the tapelist filename.  If tapelist is not
-# specified in the amanda.conf file, then use tapelist in the config
-# directory.
-TapeList=`amgetconf${SUF} $Config tapelist "@$"`
-if [ ! "$TapeList" ]; then
-       TapeList="$ConfigDir/$Config/tapelist"
-fi
-if [ ! -r $TapeList ]; then
-       log "${Program}: $TapeList not found or is not readable."
-       exit 1
-fi
-
-Amadmin=$sbindir/amadmin$SUF
-
-[ ! -x $Amadmin ] \
-       && echo "$Amadmin not found or not executable" >&2 \
-       && exit 1
-
-$Amadmin $Config export "$@"\
-       | grep "^stats: " \
-       | while read LINE; do
-               [ "$LINE" = "" ] && continue
-               set $LINE
-               echo $8
-       done \
-       | sort -u \
-       | while read TAPE; do
-               [ "$TAPE" = "" ] && continue
-               grep " $TAPE " $TapeList 2>/dev/null >/dev/null
-               [ $? != 0 ] \
-                       && echo "Tape $TAPE missing in $TapeList"
-       done
-
-echo "Ready."
-
-exit 0
diff --git a/server-src/amcheckdump.pl b/server-src/amcheckdump.pl
new file mode 100644 (file)
index 0000000..a7352de
--- /dev/null
@@ -0,0 +1,428 @@
+#! @PERL@
+use lib '@amperldir@';
+use strict;
+
+use File::Basename;
+use Getopt::Long;
+
+use Amanda::Device qw( :constants );
+use Amanda::Debug qw( :logging );
+use Amanda::Config qw( :init :getconf config_dir_relative );
+use Amanda::Logfile;
+use Amanda::Util qw( :running_as_flags );
+use Amanda::Tapefile;
+use Amanda::Changer;
+
+# Have all images been verified successfully so far?
+my $all_success = 1;
+
+sub usage {
+    print <<EOF;
+USAGE: amcheckdump config [ --timestamp|-t timestamp ] [-o configoption]*
+    amcheckdump validates Amanda dump images by reading them from storage
+volume(s), and verifying archive integrity if the proper tool is locally
+available. amcheckdump does not actually compare the data located in the image
+to anything; it just validates that the archive stream is valid.
+    Arguments:
+       config       - The Amanda configuration name to use.
+       -t timestamp - The run of amdump or amflush to check. By default, check
+                       the most recent dump; if this parameter is specified,
+                       check the most recent dump matching the given
+                       date- or timestamp.
+       -o configoption - see the CONFIGURATION OVERRIDE section of amanda(8)
+EOF
+    exit(1);
+}
+
+# Find the most recent logfile name matching the given timestamp
+sub find_logfile_name($) {
+    my $timestamp = shift @_;
+    my $rval;
+    my $config_dir = config_dir_relative(getconf($CNF_LOGDIR));
+    # First try log.$datestamp.$seq
+    for (my $seq = 0;; $seq ++) {
+        my $logfile = sprintf("%s/log.%s.%u", $config_dir, $timestamp, $seq);
+        if (-f $logfile) {
+            $rval = $logfile;
+        } else {
+            last;
+        }
+    }
+    return $rval if defined $rval;
+
+    # Next try log.$datestamp.amflush
+    $rval = sprintf("%s/log.%s.amflush", $config_dir, $timestamp);
+
+    return $rval if -f $rval;
+
+    # Finally try log.datestamp.
+    $rval = sprintf("%s/log.%s.amflush", $config_dir, $timestamp);
+    
+    return $rval if -f $rval;
+
+    # No dice.
+    return undef;
+}
+
+## Device management
+
+my $changer_init_done = 0;
+my $current_device;
+my $current_device_label;
+
+sub find_next_device {
+    my $label = shift;
+    if (getconf_seen($CNF_TPCHANGER)) {
+       # We're using a changer script.
+       if (!$changer_init_done) {
+           my $error = (Amanda::Changer::reset())[0];
+           critical($error) if $error;
+           $changer_init_done = 1;
+       }
+       my ($error, $slot, $tapedev) = Amanda::Changer::find($label);
+       if ($error) {
+           critical("Error operating changer: $error.");
+       } elsif ($slot eq "<none>") {
+           critical("Could not find tape label $label in changer.");
+       } else {
+           return $tapedev;
+       }
+    } else {
+       # The user is changing tapes for us.
+       my $device_name = getconf($CNF_TAPEDEV);
+       printf("Insert volume with label %s in device %s and press ENTER: ",
+              $label, $device_name);
+       <>;
+       return $device_name;
+    }
+}
+
+# Try to open a device containing a volume with the given label.  Returns undef
+# if there is a problem.
+sub try_open_device {
+    my ($label) = @_;
+
+    # can we use the same device as last time?
+    if ($current_device_label eq $label) {
+       return $current_device;
+    }
+
+    # nope -- get rid of that device
+    close_device();
+
+    my $device_name = find_next_device($label);
+    if ( !$device_name ) {
+       print "Could not find a device for label '$label'.\n";
+        return undef;
+    }
+
+    my $device = Amanda::Device->new($device_name);
+    if ( !$device ) {
+       print "Could not open '$device_name'.\n";
+        return undef;
+    }
+
+    $device->set_startup_properties_from_config();
+
+    my $label_status = $device->read_label();
+    if ($label_status != $READ_LABEL_STATUS_SUCCESS) {
+       print "Could not read device $device_name: one of ",
+            join(", ", ReadLabelStatusFlags_to_strings($label_status)),
+            "\n";
+       return undef;
+    }
+
+    if ($device->{volume_label} ne $label) {
+       printf("Labels do not match: Expected '%s', but the device contains '%s'.\n",
+                    $label, $device->{volume_label});
+       return undef;
+    }
+
+    if (!$device->start($ACCESS_READ, undef, undef)) {
+       printf("Error reading device %s.\n", $device_name);
+       return undef;
+    }
+
+    $current_device = $device;
+    $current_device_label = $device->{volume_label};
+
+    return $device;
+}
+
+sub close_device {
+    $current_device = undef;
+    $current_device_label = undef;
+}
+
+## Validation application
+
+my ($current_validation_pid, $current_validation_pipeline, $current_validation_image);
+
+# Return a filehandle for the validation application that will handle this
+# image.  This function takes care of split dumps.  At the moment, we have
+# a single "current" validation application, and as such assume that split dumps
+# are stored contiguously and in order on the volume.
+sub open_validation_app {
+    my ($image, $header) = @_;
+
+    # first, see if this is the same image we were looking at previously
+    if (defined($current_validation_image)
+       and $current_validation_image->{timestamp} eq $image->{timestamp}
+       and $current_validation_image->{hostname} eq $image->{hostname}
+       and $current_validation_image->{diskname} eq $image->{diskname}
+       and $current_validation_image->{level} == $image->{level}) {
+       # TODO: also check that the part number is correct
+        print "Continuing with previously started validation process.\n";
+       return $current_validation_pipeline;
+    }
+
+    # nope, new image.  close the previous pipeline
+    close_validation_app();
+       
+    my $validation_command = find_validation_command($header);
+    print "  using '$validation_command'.\n";
+    $current_validation_pid = open($current_validation_pipeline, "|-", $validation_command);
+        
+    if (!$current_validation_pid) {
+       print "Can't execute validation command: $!\n";
+       undef $current_validation_pid;
+       undef $current_validation_pipeline;
+       return undef;
+    }
+
+    $current_validation_image = $image;
+    return $current_validation_pipeline;
+}
+
+# Close any running validation app, checking its exit status for errors.  Sets
+# $all_success to false if there is an error.
+sub close_validation_app {
+    if (!defined($current_validation_pipeline)) {
+       return;
+    }
+
+    # first close the applications standard input to signal it to stop
+    if (!close($current_validation_pipeline)) {
+       my $exit_value = $? >> 8;
+       print "Validation process returned $exit_value (full status $?)\n";
+       $all_success = 0; # flag this as a failure
+    }
+
+    $current_validation_pid = undef;
+    $current_validation_pipeline = undef;
+    $current_validation_image = undef;
+}
+
+# Given a dumpfile_t, figure out the command line to validate.
+sub find_validation_command {
+    my ($header) = @_;
+
+    # We base the actual archiver on our own table, but just trust
+    # whatever is listed as the decrypt/uncompress commands.
+    my $program = uc(basename($header->{program}));
+    
+    my $validation_program;
+    my %validation_programs = (
+        "DUMP" => "@RESTORE@ tbf 2 -",
+        "VDUMP" => "@VRESTORE@ tf -",
+        "VXDUMP" => "@VXRESTORE@ tbf 2 -",
+        "XFSDUMP" => "@XFSRESTORE@ -t -v silent -",
+        "TAR" => "@GNUTAR@ tf -",
+        "GTAR" => "@GNUTAR@ tf -",
+        "GNUTAR" => "@GNUTAR@ tf -",
+        "SMBCLIENT" => "@SAMBA_CLIENT@ tf -",
+    );
+
+    $validation_program = $validation_programs{$program};
+    if (!defined $validation_program) {
+        warning("Could not determine validation for dumper $program; ".
+             "Will send dumps to /dev/null instead.");
+        $validation_program = "cat > /dev/null";
+    } else {
+        # This is to clean up any extra output the program doesn't read.
+        $validation_program .= " > /dev/null && cat > /dev/null";
+    }
+    
+    my $cmdline = "";
+    if (defined $header->{decrypt_cmd} && 
+        length($header->{decrypt_cmd}) > 0) {
+        $cmdline .= $header->{decrypt_cmd};
+    }
+    if (defined $header->{uncompress_cmd} && 
+        length($header->{uncompress_cmd}) > 0) {
+        $cmdline .= $header->{uncompress_cmd};
+    }
+    $cmdline .= $validation_program;
+
+    return $cmdline;
+}
+
+## Application initialization
+
+Amanda::Util::setup_application("amcheckdump", "server", "cmdline");
+
+my $timestamp = undef;
+my $config_overwrites = new_config_overwrites($#ARGV+1);
+
+Getopt::Long::Configure(qw(bundling));
+GetOptions(
+    'timestamp|t=s' => \$timestamp,
+    'help|usage|?' => \&usage,
+    'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); },
+) or usage();
+
+usage() if (@ARGV < 1);
+
+my $config_name = shift @ARGV;
+if (!config_init($CONFIG_INIT_EXPLICIT_NAME |
+                 $CONFIG_INIT_FATAL, $config_name)) {
+    critical('errors processing config file "' . 
+               Amanda::Config::get_config_filename() . '"');
+}
+apply_config_overwrites($config_overwrites);
+
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+# Read the tape list.
+my $tl = Amanda::Tapefile::read_tapelist(config_dir_relative(getconf($CNF_TAPELIST)));
+
+# If we weren't given a timestamp, find the newer of
+# amdump.1 or amflush.1 and extract the datestamp from it.
+if (!defined $timestamp) {
+    my $amdump_log = config_dir_relative(getconf($CNF_LOGDIR)) . "/amdump.1";
+    my $amflush_log = config_dir_relative(getconf($CNF_LOGDIR)) . "/amflush.1";
+    my $logfile;
+    if (-f $amflush_log && -f $amdump_log &&
+         -M $amflush_log  < -M $amdump_log) {
+         $logfile=$amflush_log;
+    } elsif (-f $amdump_log) {
+         $logfile=$amdump_log;
+    } elsif (-f $amflush_log) {
+         $logfile=$amflush_log;
+    } else {
+       print "Could not find any dump log file.\n";
+       exit;
+    }
+
+    # extract the datestamp from the dump log
+    open (AMDUMP, "<$logfile") || critical();
+    while(<AMDUMP>) {
+       if (/^amdump: starttime (\d*)$/) {
+           $timestamp = $1;
+       }
+       elsif (/^amflush: starttime (\d*)$/) {
+           $timestamp = $1;
+       }
+       elsif (/^planner: timestamp (\d*)$/) {
+           $timestamp = $1;
+       }
+    }
+    close AMDUMP;
+}
+
+# Find all logfiles matching our timestamp
+my @logfiles =
+    grep { $_ =~ /^log\.$timestamp(?:\.[0-9]+|\.amflush)?$/ }
+    Amanda::Logfile::find_log();
+
+if (!@logfiles) {
+    critical("Can't find any logfiles with timestamp $timestamp.");
+}
+
+# compile a list of *all* dumps in those logfiles
+my $logfile_dir = config_dir_relative(getconf($CNF_LOGDIR));
+my @images;
+for my $logfile (@logfiles) {
+    push @images, Amanda::Logfile::search_logfile(undef, $timestamp,
+                                                  "$logfile_dir/$logfile", 1);
+}
+
+# filter only "ok" dumps, removing partial and failed dumps
+@images = Amanda::Logfile::dumps_match([@images],
+       undef, undef, undef, undef, 1);
+
+if (!@images) {
+    critical("Could not find any matching dumps");
+}
+
+# Find unique tapelist, using a hash to filter duplicate tapes
+my %tapes = map { ($_->{label}, undef) } @images;
+my @tapes = sort { $a cmp $b } keys %tapes;
+
+if (!@tapes) {
+    critical("Could not find any matching dumps");
+}
+
+printf("You will need the following tape%s: %s\n", (@tapes > 1) ? "s" : "",
+       join(", ", @tapes));
+
+# Now loop over the images, verifying each one.  
+
+IMAGE:
+for my $image (@images) {
+    # Currently, L_PART results will be n/x, n >= 1, x >= -1
+    # In the past (before split dumps), L_PART could be --
+    # Headers can give partnum >= 0, where 0 means not split.
+    my $logfile_part = 1; # assume this is not a split dump
+    if ($image->{partnum} =~ m$(\d+)/(-?\d+)$) {
+        $logfile_part = $1;
+    }
+
+    printf("Validating image %s:%s datestamp %s level %s part %s on tape %s file #%d\n",
+           $image->{hostname}, $image->{diskname}, $image->{timestamp},
+           $image->{level}, $logfile_part, $image->{label}, $image->{filenum});
+
+    # note that if there is a device failure, we may try the same device
+    # again for the next image.  That's OK -- it may give a user with an
+    # intermittent drive some indication of such.
+    my $device = try_open_device($image->{label});
+    if (!defined $device) {
+       # error message already printed
+       $all_success = 0;
+       next IMAGE;
+    }
+
+    # Now get the header from the device
+    my $header = $device->seek_file($image->{filenum});
+    if (!defined $header) {
+        printf("Could not seek to file %d of volume %s.\n",
+                     $image->{filenum}, $image->{label});
+       $all_success = 0;
+        next IMAGE;
+    }
+
+    # Make sure that the on-device header matches what the logfile
+    # told us we'd find.
+
+    my $volume_part = $header->{partnum};
+    if ($volume_part == 0) {
+        $volume_part = 1;
+    }
+
+    if ($image->{timestamp} ne $header->{datestamp} ||
+        $image->{hostname} ne $header->{name} ||
+        $image->{diskname} ne $header->{disk} ||
+        $image->{level} != $header->{dumplevel} ||
+        $logfile_part != $volume_part) {
+        printf("Details of dump at file %d of volume %s do not match logfile.\n",
+                     $image->{filenum}, $image->{label});
+       $all_success = 0;
+        next IMAGE;
+    }
+    
+    # get the validation application pipeline that will process this dump.
+    my $pipeline = open_validation_app($image, $header);
+
+    # send the datastream from the device straight to the application
+    if (!$device->read_to_fd(fileno($pipeline))) {
+        print "Error reading device or writing data to validation command.\n";
+       $all_success = 0;
+       next IMAGE;
+    }
+}
+
+# clean up
+close_validation_app();
+close_device();
+
+exit($all_success? 0 : 1);
diff --git a/server-src/amcleanup.sh b/server-src/amcleanup.sh
new file mode 100644 (file)
index 0000000..166dace
--- /dev/null
@@ -0,0 +1,289 @@
+#!@SHELL@
+#
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1991-1998 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: James da Silva, Systems Design and Analysis Group
+#                         Computer Science Department
+#                         University of Maryland at College Park
+#
+
+#
+# amcleanup.sh - clean up and generate a report after a crash.
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+confdir=@CONFIG_DIR@
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = yes; then
+        SUF=-@VERSION@
+else
+        SUF=
+fi
+
+#
+#Function to :
+#   parse process tree and get the children of a given process ID
+#
+
+
+find_children() {
+
+#sample ps -ef output
+#500      20810  4938  0 10:21 pts/2    00:00:00 /bin/sh /usr/sbin/amdump tapebackup
+
+       for pid in $(ps -ef | awk "{if ( \$3 == $1 ) { print \$2 }}")
+       do
+               process_name=`ps -e|grep -w ${pid}|awk '{print $4}'`
+               echo `_ '%s: Process %s found running at pid #%s.' "amcleanup" "${process_name}" "${pid}"`
+               pidname[$i]=$pid
+               i=`expr $i + 1`
+               find_children $pid
+       done
+}
+
+#
+#Function to :
+#   send SIGTERM signal to kill given process ID and check if process still alive 
+#   after receiving SIGTERM,  if yes send SIGKILL  
+#
+
+function killpid() {
+
+killPID=$1
+SIGTERM=15
+
+       echo `_ '%s: Sending process %s the %s signal.' "$0" "${killPID}" "SIGTERM"`
+       `kill -${SIGTERM} ${killPID} 2>/dev/null`
+       for second in 0 1 2 3 4 ; do
+               pid_status=`ps -e|grep -w ${killPID}|grep -v grep |wc -l`
+               if [ ${pid_status} -ne 0 ] ; then
+                       # process is still alive
+                       sleep 1
+               else
+                       return 0
+               fi
+       done
+       SIGKILL=9
+       echo `_ '%s: Sending process %s the %s signal.' "$0" "${killPID}" "SIGKILL"`
+       `kill -${SIGKILL} ${killPID} 2>/dev/null`
+       sleep 2
+       pid_status=`ps -e|grep -w ${killPID}|grep -v grep |wc -l`
+       if [ ${pid_status} -ne 0 ] ; then
+               return 1
+       else
+               return 0
+       fi
+}
+
+
+# process arguments
+KILL_ENABLE=0
+VERBOSE=0
+while test $# -ge 2; do
+    case "$1" in
+       -k) KILL_ENABLE=1;;
+       -v) VERBOSE=1;;
+       *)
+           echo `_ 'Usage: amcleanup [-k] [-v] conf'`
+           exit 1 ;;
+    esac
+    shift
+done
+conf="$1"
+shift
+
+if test ! -d $confdir/$conf ; then
+       echo `_ '%s: could not cd into %s' "amcleanup" "$confdir/$conf"`
+       exit 1
+fi
+
+#check if amdump/amflush is running for given config  
+if test ${KILL_ENABLE} -eq 0 ; then
+       for am_process in amdump amflush ; do
+               am_pid=`ps -ef|grep -w ${am_process}|grep -w ${conf}|awk '{print $2}'`
+               if test ! -z "${am_pid}" ; then
+                       echo `_ '%s: %s Process is running at PID %s for %s configuration.' "$0" "${am_process}" ${am_pid} ${conf}`
+                       echo `_ '%s: Use -k option to stop all the process...' "$0"`
+                       echo `_ 'Usage: amcleanup [-k] conf'`
+                       exit 0
+               fi
+       done
+fi
+
+cd $confdir/$conf
+
+logdir=`amgetconf$SUF $conf logdir "$@"`
+rc=$?
+if test $rc -ne 0 ; then
+       echo `_ '%s: "%s" exited with status: %s' "amcleanup" "amgetconf$SUF logdir" "$rc"` 1>&2
+       exit 1
+fi
+logfile=$logdir/log
+errfile=$logdir/amdump
+erramflush=$logdir/amflush
+tapecycle=`amgetconf$SUF $conf tapecycle "$@"`
+rc=$?
+if test $rc -ne 0 ; then
+       echo `_ '%s: "%s" exited with status: %s' "amcleanup" "amgetconf$SUF tapecycle" "$rc"` 1>&2
+       exit 1
+fi
+dumpuser=`amgetconf$SUF $conf dumpuser "$@"`
+rc=$?
+if test $rc -ne 0 ; then
+       echo `_ '%s: "%s" exited with status: %s' "amcleanup" "amgetconf$SUF $conf dumpuser" "$rc"` 1>&2
+       exit 1
+fi
+if test ${KILL_ENABLE} -eq 1 ; then
+
+       #check if any one of the dumps are runing, if yes get the process tree and kill them
+        for am_process in amdump amflush ; do
+                unset pidname
+                am_pid=`ps -ef|grep -w ${am_process}|grep -w ${conf}|awk '{print $2}'`
+                #echo "checking children for ${am_pid}"
+                if test ! -z "${am_pid}" ; then
+                        find_children ${am_pid}
+                fi
+
+                KILL_FAILURES=0
+               i=0
+
+                while test ${#pidname[@]} -gt $i ; do
+
+                        mypid=`ps -e|grep -w ${pidname[$i]}|grep -v grep|wc -l`
+                        if [ ${mypid} -ne 0 ] ; then
+                                killpid ${pidname[$i]}
+                                rc=$?
+                                if test $rc -ne 0 ; then
+                                        KILL_FAILURES=`expr ${KILL_FAILURES} + 1`
+                                fi
+                        else
+                                echo `_ '%s: Process %s no longer running.  Skipping...' "$0" "${pidname[$i]}"`
+                        fi
+                       i=`expr $i + 1`
+                done
+
+        if test ${#pidname[@]} -gt 0 ; then
+                echo `_ '%s: %s Amanda processes were found running.' "$0" "${#pidname[@]}"`
+                echo `_ '%s: %s processes failed to terminate.' "$0" "${KILL_FAILURES}"`
+        fi
+
+        done
+fi
+
+retstatus=0
+if test -f $logfile ; then
+       echo `_ '%s: processing outstanding log file.' "$0"`
+       exec </dev/null >/dev/null 2>&1
+       amreport$SUF $conf "$@"
+       rc=$?
+       if test $rc -ne 0 ; then
+               echo `_ '%s: "%s" exited with status: %s' "$0" "amreport" "$rc"` 1>&2
+               retstatus=`expr $retstatus + 1`
+       fi
+
+       # Roll the log file to its datestamped name.
+       amlogroll$SUF $conf "$@"
+       rc=$?
+       if test $rc -ne 0 ; then
+               echo `_ '%s: "%s" exited with status: %s' "$0" "amlogroll" "$rc"` 1>&2
+               retstatus=`expr $retstatus + 2`
+       fi
+
+       # Trim the index file to those for dumps that still exist.
+       amtrmidx$SUF $conf "$@"
+       rc=$?
+       if test $rc -ne 0 ; then
+               echo `_ '%s: "%s" exited with status: %s' "$0" "amtrmidx" "$rc"` 1>&2
+               retstatus=`expr $retstatus + 4`
+       fi
+
+else
+       echo `_ '%s: no unprocessed logfile to clean up.' "$0"`
+fi
+
+if test -f $errfile ; then
+    # if log was found, this will have been directed to /dev/null,
+    # which is fine.
+    echo `_ '%s: %s exists, renaming it.' "$0" "$errfile"`
+
+    # Keep debug log through the tapecycle plus a couple days
+    maxdays=`expr $tapecycle + 2`
+
+    days=1
+    # First, find out the last existing errfile,
+    # to avoid ``infinite'' loops if tapecycle is infinite
+    while test $days -lt $maxdays  && test -f $errfile.$days ; do
+       days=`expr $days + 1`
+    done
+    # Now, renumber the existing log files
+    while test $days -ge 2 ; do
+       ndays=`expr $days - 1`
+       mv $errfile.$ndays $errfile.$days
+       days=$ndays
+    done
+    mv $errfile $errfile.1
+fi
+
+if test -f $erramflush ; then
+    # if log was found, this will have been directed to /dev/null,
+    # which is fine.
+    echo `_ '%s: %s exists, renaming it.' "$0" "$erramflush"`
+
+    # Keep debug log through the tapecycle plus a couple days
+    maxdays=`expr $tapecycle + 2`
+
+    days=1
+    # First, find out the last existing erramflush,
+    # to avoid ``infinite'' loops if tapecycle is infinite
+    while test $days -lt $maxdays  && test -f $erramflush.$days ; do
+       days=`expr $days + 1`
+    done
+    # Now, renumber the existing log files
+    while test $days -ge 2 ; do
+       ndays=`expr $days - 1`
+       mv $erramflush.$ndays $erramflush.$days
+       days=$ndays
+    done
+    mv $erramflush $erramflush.1
+fi
+
+v=''
+if test $VERBOSE -eq 1; then
+    v='-v'
+fi
+$amlibexecdir/amcleanupdisk $v $conf "$@"
+rc=$?
+if test $rc -ne 0 ; then
+       echo `_ '%s: "%s" exited with status: %s' "$0" "amcleanupdisk" "$rc"` 1>&2
+       retstatus=`expr $retstatus + 8`
+fi
+
+exit $retstatus
diff --git a/server-src/amcleanup.sh.in b/server-src/amcleanup.sh.in
deleted file mode 100644 (file)
index f301c5c..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-#!@SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# amcleanup.sh - clean up and generate a report after a crash.
-
-# try to hit all the possibilities here
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libexecdir=@libexecdir@
-sbindir=@sbindir@
-
-confdir=@CONFIG_DIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = yes; then
-       SUF=-@VERSION@
-else
-       SUF=
-fi
-
-if test -h /proc/1/exe ; then
-       if test $# -ge 2 && test "$1" == "-k" ; then
-               KILL_ENABLE=1
-               conf=$2
-               shift
-               shift
-       elif test $# -ge 1 ; then
-               KILL_ENABLE=0
-               conf=$1
-               shift;
-       else
-               echo "Usage: amcleanup [-k] conf"
-               exit 1
-       fi
-else
-       if test $# -lt 1 ; then
-               echo "Usage: amcleanup conf"
-               exit 1
-       else
-               conf=$1
-               shift
-               KILL_ENABLE=0
-       fi
-fi
-
-if test ! -d $confdir/$conf ; then
-       echo "amcleanup: could not cd into $confdir/$conf"
-       exit 1
-fi
-
-cd $confdir/$conf
-
-logdir=`amgetconf$SUF $conf logdir "$@"`
-rc=$?
-if test $rc -ne 0 ; then
-       echo "amcleanup: 'amgetconf$SUF logdir' exited with status: $rc" 1>&2
-       exit 1
-fi
-logfile=$logdir/log
-errfile=$logdir/amdump
-erramflush=$logdir/amflush
-tapecycle=`amgetconf$SUF $conf tapecycle "$@"`
-rc=$?
-if test $rc -ne 0 ; then
-       echo "amcleanup: 'amgetconf$SUF tapecycle' exited with status: $rc " 1>&2
-       exit 1
-fi
-dumpuser=`amgetconf$SUF $conf dumpuser "$@"`
-rc=$?
-if test $rc -ne 0 ; then
-       echo "amcleanup: 'amgetconf$SUF $conf dumpuser' exited with status: $rc" 1>&2
-       exit 1
-fi
-
-# Check for running processes which should not be
-# running right now.
-if test ${KILL_ENABLE} -eq 1 ; then
-       if test -h /proc/1/exe ; then
-               USER_PROCESS_NAMES="\
-                       @libexecdir@/amandad \
-                       @libexecdir@/amcleanupdisk \
-                       @libexecdir@/amidxtaped \
-                       @libexecdir@/amindexd \
-                       @libexecdir@/amlogroll \
-                       @libexecdir@/amtrmidx \
-                       @libexecdir@/amtrmlog \
-                       @libexecdir@/chg-chio \
-                       @libexecdir@/chg-chs \
-                       @libexecdir@/chg-disk \
-                       @libexecdir@/chg-iomega \
-                       @libexecdir@/chg-juke \
-                       @libexecdir@/chg-manual \
-                       @libexecdir@/chg-mcutil \
-                       @libexecdir@/chg-mtx \
-                       @libexecdir@/chg-multi \
-                       @libexecdir@/chg-null \
-                       @libexecdir@/chg-rait \
-                       @libexecdir@/chg-rth \
-                       @libexecdir@/chg-scsi \
-                       @libexecdir@/chg-zd-mtx \
-                       @libexecdir@/chunker \
-                       @libexecdir@/driver \
-                       @libexecdir@/generic-dumper \
-                       @libexecdir@/gnutar \
-                       @libexecdir@/noop \
-                       @libexecdir@/patch-system \
-                       @libexecdir@/selfcheck \
-                       @libexecdir@/sendbackup \
-                       @libexecdir@/sendsize \
-                       @libexecdir@/star \
-                       @libexecdir@/taper \
-                       @libexecdir@/versionsuffix \
-                       @sbindir@/amaddclient \
-                       @sbindir@/amadmin \
-                       @sbindir@/amaespipe \
-                       @sbindir@/amcheckdb \
-                       @sbindir@/amcrypt \
-                       @sbindir@/amcryptsimple \
-                       @sbindir@/amdd \
-                       @sbindir@/amdump \
-                       @sbindir@/amfetchdump \
-                       @sbindir@/amflush \
-                       @sbindir@/amgetconf \
-                       @sbindir@/amgpgcrypt \
-                       @sbindir@/amlabel \
-                       @sbindir@/ammt \
-                       @sbindir@/amoverview \
-                       @sbindir@/amplot \
-                       @sbindir@/amrecover \
-                       @sbindir@/amreport \
-                       @sbindir@/amrestore \
-                       @sbindir@/amrmtape \
-                       @sbindir@/amserverconfig \
-                       @sbindir@/amstatus \
-                       @sbindir@/amtape \
-                       @sbindir@/amtapetype \
-                       @sbindir@/amtoc \
-                       @sbindir@/amverify \
-                       @sbindir@/amverifyrun"
-
-               ROOT_PROCESS_NAMES="\
-                       @libexecdir@/calcsize \
-                       @libexecdir@/killpgrp \
-                       @libexecdir@/rundump \
-                       @libexecdir@/runtar \
-                       @libexecdir@/dumper \
-                       @libexecdir@/planner \
-                       @sbindir@/amcheck"
-
-               PREVIOUS_DIR="`pwd`"
-               cd /proc
-               PIDS_FOUND=0
-               KEEP_CHECKING=1
-               while test ${KEEP_CHECKING} -ne 0 ; do
-                       PIDS_THIS_PASS=0
-                       for search_user in ${dumpuser} root ; do
-                               if test "${search_user}" == "${dumpuser}" ; then
-                                       PROCESS_NAMES=${USER_PROCESS_NAMES}
-                               elif test "${search_user}" == "root" ; then
-                                       PROCESS_NAMES=${ROOT_PROCESS_NAMES}
-                               fi
-                               for search_pid in [0-9]* ; do
-                                       for search_name in ${PROCESS_NAMES} ; do
-                                               ls -l /proc/${search_pid}/exe 2>/dev/null | grep ${search_name} >/dev/null
-                                               match_name=$?
-                                               pid_uid="`cat /proc/${search_pid}/status 2>/dev/null | grep Uid | awk '//{split($_,i); print i[2]}'`"
-                                               if test ${match_name} -eq 0  && test "${pid_uid}" == "${search_user}" ; then
-                                                       echo "amcleanup: Process ${search_name} found running at pid #${search_pid}."
-                                                       kill_pid=${search_pid}
-                                                       kill_name=${search_name}
-                                                       PIDS_FOUND=`expr ${PIDS} + 1`
-                                                       PIDS_THIS_PASS=1
-                                                       break
-                                               else
-                                                       kill_pid=""
-                                                       continue
-                                               fi
-                                       done
-                                       if test ! -z "${kill_pid}" ; then
-                                               if test -d /proc/${kill_pid} ; then
-                                                       echo "amcleanup: Sending process ${kill_pid} the TERM signal."
-                                                       kill -15 -- ${kill_pid}
-                                                       sleep 5
-                                                       if test -d /proc/${kill_pid} ; then
-                                                               echo "amcleanup: Sending process  ${kill_pid} the KILL signal."
-                                                               kill -9 -- ${kill_pid}
-                                                       fi
-                                                       sleep 5
-                                                       if test -d /proc/${kill_pid} ; then
-                                                               echo "amcleanup: Process ${kill_pid} did not respond to the KILL signal (and may be hung)!" 1>&2
-                                                               KILL_FAILURES=`expr ${KILL_FAILURES} + 1`
-                                                       fi
-                                               else
-                                                       echo "amcleanup: Process ${kill_pid} no longer running.  Skipping..."
-                                               fi
-                                       fi
-                               done
-                       done
-                       if test ${PIDS_THIS_PASS} -eq 0 ; then
-                               KEEP_CHECKING=0
-                       else
-                               KEEP_CHECKING=1
-                       fi
-               done
-               if test ${PIDS_FOUND} -gt 0 ; then
-                       echo "amcleanup: ${PIDS_FOUND} Amanda processes were found running."
-                       echo "amcleanup: ${KILL_FAILURES} processes failed to terminate."
-               else
-                       echo "amcleanup: No Amanda processes were found running."
-               fi
-               cd "${PREVIOUS_DIR}"
-       fi
-fi
-
-retstatus=0
-if test -f $logfile ; then
-       echo "amcleanup: processing outstanding log file."
-       exec </dev/null >/dev/null 2>&1
-       amreport$SUF $conf "$@"
-       rc=$?
-       if test $rc -ne 0 ; then
-               echo "amcleanup: amreport exited with status: $rc" 1>&2
-               retstatus=`expr $retstatus + 1`
-       fi
-
-       # Roll the log file to its datestamped name.
-       amlogroll$SUF $conf "$@"
-       rc=$?
-       if test $rc -ne 0 ; then
-               echo "acmleanup: amlogroll exited with status: $rc" 1>&2
-               retstatus=`expr $retstatus + 2`
-       fi
-
-       # Trim the index file to those for dumps that still exist.
-       amtrmidx$SUF $conf "$@"
-       rc=$?
-       if test $rc -ne 0 ; then
-               echo "amcleanup: amtrmidx exited with status: $rc" 1>&2
-               retstatus=`expr $retstatus + 4`
-       fi
-
-else
-       echo "amcleanup: no unprocessed logfile to clean up."
-fi
-
-if test -f $errfile ; then
-    # if log was found, this will have been directed to /dev/null,
-    # which is fine.
-    echo "amcleanup: $errfile exists, renaming it."
-
-    # Keep debug log through the tapecycle plus a couple days
-    maxdays=`expr $tapecycle + 2`
-
-    days=1
-    # First, find out the last existing errfile,
-    # to avoid ``infinite'' loops if tapecycle is infinite
-    while test $days -lt $maxdays  && test -f $errfile.$days ; do
-       days=`expr $days + 1`
-    done
-    # Now, renumber the existing log files
-    while test $days -ge 2 ; do
-       ndays=`expr $days - 1`
-       mv $errfile.$ndays $errfile.$days
-       days=$ndays
-    done
-    mv $errfile $errfile.1
-fi
-
-if test -f $erramflush ; then
-    # if log was found, this will have been directed to /dev/null,
-    # which is fine.
-    echo "amcleanup: $erramflush exists, renaming it."
-
-    # Keep debug log through the tapecycle plus a couple days
-    maxdays=`expr $tapecycle + 2`
-
-    days=1
-    # First, find out the last existing erramflush,
-    # to avoid ``infinite'' loops if tapecycle is infinite
-    while test $days -lt $maxdays  && test -f $erramflush.$days ; do
-       days=`expr $days + 1`
-    done
-    # Now, renumber the existing log files
-    while test $days -ge 2 ; do
-       ndays=`expr $days - 1`
-       mv $erramflush.$ndays $erramflush.$days
-       days=$ndays
-    done
-    mv $erramflush $erramflush.1
-fi
-
-$libexecdir/amcleanupdisk $conf "$@"
-rc=$?
-if test $rc -ne 0 ; then
-       echo "amcleanup: amcleanupdisk exited with status: $rc" 1>&2
-       retstatus=`expr $retstatus + 8`
-fi
-
-exit $retstatus
index 924e3cdee93ef245970cd81edb8c8d303788fa35..a67154cbbf5657db027e1334de3f62e2558b2e15 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amcleanupdisk.c,v 1.22 2006/07/25 18:27:57 martinea Exp $
+ * $Id: amcleanupdisk.c 7238 2007-07-06 20:03:37Z dustin $
  */
 #include "amanda.h"
 
 #include "infofile.h"
 #include "server_util.h"
 
-sl_t *holding_list;
-char *datestamp;
+/* Utility funcitons */
 
-/* local functions */
-int main(int argc, char **argv);
-void check_holdingdisk(char *diskdir, char *datestamp);
-void check_disks(void);
-
-int
-main(
-    int                main_argc,
-    char **    main_argv)
+/* Call open_diskfile() with the diskfile from the configuration
+ */
+static void
+init_diskfile(void)
 {
-    struct passwd *pw;
-    char *dumpuser;
-    disklist_t diskq;
-    char *conffile;
-    char *conf_diskfile;
-    char *conf_infofile;
-
-    safe_fd(-1, 0);
-    safe_cd();
-
-    set_pname("amcleanupdisk");
-
-    dbopen(DBG_SUBDIR_SERVER);
-
-    /* Don't die when child closes pipe */
-    signal(SIGPIPE, SIG_IGN);
-
-    if(main_argc < 2) {
-       error("Usage: amcleanupdisk%s <config>", versionsuffix());
-       /*NOTREACHED*/
-    }
-
-    config_name = main_argv[1];
+    char *conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
+    disklist_t diskq; /* never used, but required by read_diskfile */
 
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
     if (read_diskfile(conf_diskfile, &diskq) < 0) {
-       error("could not load disklist %s", conf_diskfile);
+       error(_("could not load disklist %s"), conf_diskfile);
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
+}
 
-    conf_infofile = getconf_str(CNF_INFOFILE);
-    if (*conf_infofile == '/') {
-       conf_infofile = stralloc(conf_infofile);
-    } else {
-       conf_infofile = stralloc2(config_dir, conf_infofile);
-    }
+/* Call open_infofile() with the infofile from the configuration
+ */
+static void
+init_infofile(void)
+{
+    char *conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if (open_infofile(conf_infofile) < 0) {
-       error("could not open info db \"%s\"", conf_infofile);
+       error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
     amfree(conf_infofile);
+}
 
-    datestamp = construct_datestamp(NULL);
+/* A callback for holding_cleanup to mark corrupt DLEs with force_no_bump
+ * for their next run.
+ *
+ * @param hostname: hostname of DLE
+ * @param disk: disk of DLE
+ */
+static void
+corrupt_dle(
+    char *hostname,
+    char *disk)
+{
+    info_t info;
 
-    dumpuser = getconf_str(CNF_DUMPUSER);
-    if((pw = getpwnam(dumpuser)) == NULL) {
-       error("dumpuser %s not found in password file", dumpuser);
-       /*NOTREACHED*/
-    }
+    dbprintf(_("Corrupted dump of DLE %s:%s found; setting force-no-bump.\n"),
+       hostname, disk);
 
-    if(pw->pw_uid != getuid()) {
-       error("must run amcleanupdisk as user %s", dumpuser);
-       /*NOTREACHED*/
+    get_info(hostname, disk, &info);
+    info.command &= ~FORCE_BUMP;
+    info.command |= FORCE_NO_BUMP;
+    if(put_info(hostname, disk, &info)) {
+       dbprintf(_("could not put info record for %s:%s: %s"),
+             hostname, disk, strerror(errno));
     }
-
-    holding_list = pick_all_datestamp(1);
-
-    check_disks();
-
-    close_infofile();
-
-    free_sl(holding_list);
-    holding_list = NULL;
-    amfree(config_dir);
-    return 0;
 }
 
-
-void
-check_holdingdisk(
-    char *     diskdir,
-    char *     datestamp)
+int
+main(
+    int                argc,
+    char **    argv)
 {
-    DIR *workdir;
-    struct dirent *entry;
-    char *dirname = NULL;
-    char *tmpname = NULL;
-    char *destname = NULL;
-    char *hostname = NULL;
-    char *diskname = NULL;
-    disk_t *dp;
-    filetype_t filetype;
-    info_t info;
-    int level;
-    size_t dl, l;
+    FILE *verbose_output = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
-    dirname = vstralloc(diskdir, "/", datestamp, NULL);
-    dl = strlen(dirname);
+    safe_fd(-1, 0);
+    safe_cd();
+
+    set_pname("amcleanupdisk");
+
+    dbopen(DBG_SUBDIR_SERVER);
 
-    if((workdir = opendir(dirname)) == NULL) {
-       amfree(dirname);
-       return;
+    if(argc < 2) {
+       error(_("Usage: amcleanupdisk%s <config>"), versionsuffix());
+       /*NOTREACHED*/
     }
 
-    while((entry = readdir(workdir)) != NULL) {
-       if(is_dot_or_dotdot(entry->d_name)) {
-           continue;
-       }
-
-       if((l = strlen(entry->d_name)) < 7 ) {
-           continue;
-       }
-
-       if(strncmp(&entry->d_name[l-4],".tmp",4) != 0) {
-           continue;
-       }
-
-       tmpname = newvstralloc(tmpname,
-                              dirname, "/", entry->d_name,
-                              NULL);
-
-       destname = newstralloc(destname, tmpname);
-       destname[dl + 1 + l - 4] = '\0';
-
-       amfree(hostname);
-       amfree(diskname);
-       filetype = holding_file_read_header(tmpname, &hostname, &diskname, &level, NULL);
-       amfree(tmpname);
-       if(filetype != F_DUMPFILE) {
-           continue;
-       }
-
-       dp = lookup_disk(hostname, diskname);
-
-       if (dp == NULL) {
-           continue;
-       }
-
-       if(level < 0 || level > 9) {
-           continue;
-       }
-
-       if(rename_tmp_holding(destname, 0)) {
-           get_info(dp->host->hostname, dp->name, &info);
-           info.command &= ~FORCE_BUMP;
-           info.command |= FORCE_NO_BUMP;
-           if(put_info(dp->host->hostname, dp->name, &info)) {
-               error("could not put info record for %s:%s: %s",
-                     dp->host->hostname, dp->name, strerror(errno));
-               /*NOTREACHED*/
-           }
-       } else {
-           fprintf(stderr,"rename_tmp_holding(%s) failed\n", destname);
-       }
+    /* parse options */
+    if (argc >= 2 && strcmp(argv[1], "-v") == 0) {
+       verbose_output = stderr;
+       cfg_opt = argv[2];
+    } else {
+       cfg_opt = argv[1];
     }
-    closedir(workdir);
 
-    /* try to zap the potentially empty working dir */
-    /* ignore any errors -- it either works or it doesn't */
-    (void) rmdir(dirname);
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL,
+               cfg_opt);
 
-    amfree(diskname);
-    amfree(hostname);
-    amfree(destname);
-    amfree(dirname);
-}
+    check_running_as(RUNNING_AS_DUMPUSER);
 
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
-void
-check_disks(void)
-{
-    holdingdisk_t *hdisk;
-    sle_t *dir;
+    init_diskfile();
+    init_infofile();
 
-    for(dir = holding_list->first; dir !=NULL; dir = dir->next) {
-       for(hdisk = getconf_holdingdisks(); hdisk != NULL; hdisk = hdisk->next)
-           check_holdingdisk(holdingdisk_get_diskdir(hdisk), dir->name);
-    }
+    /* actually perform the cleanup */
+    holding_cleanup(corrupt_dle, verbose_output);
+
+    close_infofile();
+    return 0;
 }
+
diff --git a/server-src/amcrypt-ossl-asym.sh.in b/server-src/amcrypt-ossl-asym.sh.in
deleted file mode 100644 (file)
index 9afc430..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#!@SHELL@
-#
-# amcrypt-ossl-asym.sh - asymmetric crypto helper using OpenSSL
-# Usage: amcrypt-ossl-asym.sh [-d]
-#
-# Copyright © 2006  Ben Slusky <sluskyb@paranoiacs.org>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-#
-# 
-# Keys can be generated with the standard OpenSSL commands, e.g.:
-#
-# $ openssl genrsa -aes128 -out backup-privkey.pem 1024
-# Generating RSA private key, 1024 bit long modulus
-# [...]
-# Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
-# Verifying - Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
-#
-# $ openssl rsa -in backup-privkey.pem -pubout -out backup-pubkey.pem
-# Enter pass phrase for backup-privkey.pem: <ENTER YOUR PASS PHRASE>
-# Writing RSA key
-#
-
-# change these as needed
-OPENSSL=                       # whatever's in $PATH
-CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
-AMANDA_HOME=~@CLIENT_LOGIN@
-RANDFILE=$AMANDA_HOME/.rnd
-export RANDFILE
-PASSPHRASE=$AMANDA_HOME/.am_passphrase # optional
-PRIVKEY=$AMANDA_HOME/backup-privkey.pem
-PUBKEY=$AMANDA_HOME/backup-pubkey.pem
-
-# where might openssl be?
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin
-export PATH
-MAGIC='AmAnDa+OpEnSsL'
-ME=`basename "$0"`
-WORKDIR="/tmp/.${ME}.$$"
-
-# first things first
-if [ -z "${OPENSSL:=`which openssl`}" ]; then
-       echo "${ME}: openssl not found" >&2
-       exit 1
-elif [ ! -x "${OPENSSL}" ]; then
-       echo "${ME}: can't execute openssl (${OPENSSL})" >&2
-       exit 1
-fi
-
-if [ -n "${PASSPHRASE}" ]; then
-       # check the openssl version. if it's too old, we have to handle
-       # the pass phrase differently.
-       OSSL_VERSION=`eval \"${OPENSSL}\" version |cut -d\  -f2`
-       case "${OSSL_VERSION}" in
-        ''|0.[0-8].*|0.9.[0-6]*|0.9.7|0.9.7[a-c]*)
-               echo "${ME}: ${OPENSSL} is version ${OSSL_VERSION}" >&2
-               echo "${ME}: Using pass phrase kluge for OpenSSL version >=0.9.7d" >&2
-               PASS_FROM_STDIN=yes
-               ;;
-       esac
-fi
-
-mkdir -m 700 "${WORKDIR}"
-if [ $? -ne 0 ]; then
-       echo "${ME}: failed to create temp directory" >&2
-       exit 1
-fi
-# ignore SIGINT
-trap "" 2
-trap "rm -rf \"${WORKDIR}\"" 0 1 3 15
-
-# we'll need to pad the datastream to a multiple of the cipher block size
-# prior to encryption and decryption. 96 bytes (= 768 bits) should be good
-# for any cipher.
-pad() {
-       perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }'
-}
-
-encrypt() {
-       # generate a random printable cipher key (on one line)
-       echo `"${OPENSSL}" rand -base64 80` >"${WORKDIR}/pass"
-
-       # encrypt the cipher key using the RSA public key
-       "${OPENSSL}" rsautl -encrypt -in "${WORKDIR}/pass" -out "${WORKDIR}/pass.ciphertext" -pubin -inkey "${PUBKEY}" -pkcs
-       [ $? -eq 0 ] || return 1
-
-       # print magic
-       printf %s "${MAGIC}"
-
-       # print the encrypted cipher key, preceded by size
-       ls -l "${WORKDIR}/pass.ciphertext" | awk '{ printf("%-10d", $5) }'
-       cat "${WORKDIR}/pass.ciphertext"
-
-       # encrypt data using the cipher key and print
-       pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -e -pass "file:${WORKDIR}/pass" -nosalt
-       [ $? -eq 0 ] || return 1
-}
-
-decrypt() {
-       # read magic
-       magicsize=`printf %s "${MAGIC}" | wc -c | sed 's/^ *//'`
-       magic=`dd bs=$magicsize count=1 2>/dev/null`
-       if [ "$magic" != "${MAGIC}" ]; then
-               echo "${ME}: bad magic" >&2
-               return 1
-       fi
-
-       # read size of encrypted cipher key
-       n=`dd bs=10 count=1 2>/dev/null`
-       [ $n -gt 0 ] 2>/dev/null
-       if [ $? -ne 0 ]; then
-               echo "${ME}: bad header" >&2
-               return 1
-       fi
-
-       # read the encrypted cipher key
-       dd "of=${WORKDIR}/pass.ciphertext" bs=$n count=1 2>/dev/null
-
-       # decrypt the cipher key using the RSA private key
-       if [ "${PASS_FROM_STDIN}" = yes ]; then
-               "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" -pkcs < "${PASSPHRASE}"
-       else
-               "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" ${PASSARG} -pkcs 3< "${PASSPHRASE}"
-       fi
-       [ $? -eq 0 ] || return 1
-
-       # use the cipher key to decrypt data
-       pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -d -pass "file:${WORKDIR}/pass" -nosalt
-
-       # N.B.: in the likely event that we're piping to gzip, the above command
-       # may return a spurious error if gzip closes the output stream early.
-       return 0
-}
-
-if [ "$1" = -d ]; then
-       if [ -z "${PRIVKEY}" ]; then
-               echo "${ME}: must specify private key for decryption" >&2
-               exit 1
-       elif [ ! -r "${PRIVKEY}" ]; then
-               echo "${ME}: can't read private key from ${PRIVKEY}" >&2
-               exit 1
-       fi
-
-       if [ -n "${PASSPHRASE}" -a -e "${PASSPHRASE}" -a -r "${PASSPHRASE}" ]; then
-               PASSARG='-passin fd:3'
-       else
-               PASSPHRASE=/dev/null
-       fi
-
-       decrypt
-       if [ $? -ne 0 ]; then
-               echo "${ME}: decryption failed" >&2
-               exit 1
-       fi
-else
-       if [ -z "${PUBKEY}" ]; then
-               echo "${ME}: must specify public key for encryption" >&2
-               exit 1
-       elif [ ! -r "${PUBKEY}" ]; then
-               echo "${ME}: can't read public key from ${PUBKEY}" >&2
-               exit 1
-       fi
-
-       encrypt
-       if [ $? -ne 0 ]; then
-               echo "${ME}: encryption failed" >&2
-               exit 1
-       fi
-fi
diff --git a/server-src/amcrypt-ossl.sh.in b/server-src/amcrypt-ossl.sh.in
deleted file mode 100644 (file)
index 9799d4a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!@SHELL@
-#
-# amcrypt-ossl.sh - crypto helper using OpenSSL
-# Usage: amcrypt-ossl.sh [-d]
-#
-
-# change these as needed
-OPENSSL=                       # whatever's in $PATH
-CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
-AMANDA_HOME=~@CLIENT_LOGIN@
-RANDFILE=$AMANDA_HOME/.rnd
-export RANDFILE
-PASSPHRASE=$AMANDA_HOME/.am_passphrase # required
-
-# where might openssl be?
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin
-export PATH
-ME=`basename "$0"`
-
-if [ -z "${OPENSSL:=`which openssl`}" ]; then
-       echo "${ME}: openssl not found" >&2
-       exit 1
-elif [ ! -x "${OPENSSL}" ]; then
-       echo "${ME}: can't execute openssl (${OPENSSL})" >&2
-       exit 1
-fi
-
-# we'll need to pad the datastream to a multiple of the cipher block size prior
-# to encryption. 96 bytes (= 768 bits) should be good for any cipher.
-pad() {
-       perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }'
-}
-
-if [ "$1" = -d ]; then
-       # decrypt
-       "${OPENSSL}" enc -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
-else
-       # encrypt
-       pad | "${OPENSSL}" enc -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}"
-fi
-
diff --git a/server-src/amcrypt.sh.in b/server-src/amcrypt.sh.in
deleted file mode 100755 (executable)
index 3fbcf52..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!@SHELL@
-#
-# Original wrapper by Paul Bijnens
-#
-# worked by Stefan G. Weichinger
-# to enable gpg-encrypted dumps via aespipe
-# also worked by Matthieu Lochegnies for server-side encryption
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-AMANDA_HOME=~@CLIENT_LOGIN@
-
-AM_AESPIPE=@sbindir@/amaespipe
-AM_PASSPHRASE=$AMANDA_HOME/.am_passphrase
-PATH=/usr/bin:/usr/local/bin:/sbin:/usr/sbin
-export PATH
-
-AESPIPE=`which aespipe`
-
-if [ $? -ne 0 ] ; then
-       echo "amcrypt: aespipe not found in $PATH" >&2
-        exit 2
-fi
-
-if [ ! -x $AESPIPE ] ; then
-        echo "amcrypt: aespipe it's not executable" >&2
-        exit 2
-fi
-
-if [ ! -x $AM_AESPIPE ] ; then
-        echo "amcrypt: $AM_AESPIPE not found or it's not executable"  >&2
-        exit 2
-fi
-
-$AM_AESPIPE "$@" 3< $AM_PASSPHRASE
-
-rc=$?
-exit $rc
diff --git a/server-src/amdevcheck.pl b/server-src/amdevcheck.pl
new file mode 100644 (file)
index 0000000..1e6d8b4
--- /dev/null
@@ -0,0 +1,65 @@
+#! @PERL@
+use lib '@amperldir@';
+use strict;
+use Amanda::Device qw( :constants );
+use Amanda::Config qw( :getconf :init );
+use Amanda::Debug qw( :logging );
+use Amanda::Util qw( :running_as_flags );
+
+# try to open the device and read its label, returning the device_read_label
+# result (one or more of ReadLabelStatusFlags)
+sub try_read_label {
+    my ($device_name) = @_;
+
+    if ( !$device_name ) {
+        return $READ_LABEL_STATUS_DEVICE_MISSING;
+    }
+
+    my $device = Amanda::Device->new($device_name);
+    if ( !$device ) {
+        return $READ_LABEL_STATUS_DEVICE_MISSING
+             | $READ_LABEL_STATUS_DEVICE_ERROR;
+    }
+
+    $device->set_startup_properties_from_config();
+
+    return $device->read_label();
+}
+
+# print the results, one flag per line
+sub print_result {
+    my ($flags) = @_;
+
+    print join( "\n", ReadLabelStatusFlags_to_strings($flags) ), "\n";
+}
+
+sub usage {
+    print <<EOF;
+Usage: amdevcheck <config> [ <device name> ]
+EOF
+    exit(1);
+}
+
+## Application initialization
+
+Amanda::Util::setup_application("amdevcheck", "server", "cmdline");
+
+usage() if ( @ARGV < 1 || @ARGV > 2 );
+my $config_name = $ARGV[0];
+if (!config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name)) {
+    critical('errors processing config file "' .
+              Amanda::Config::get_config_filename() . '"');
+}
+
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+## Check the device
+
+my $device_name;
+if ( $#ARGV == 1 ) {
+    $device_name = $ARGV[1];
+} else {
+    $device_name = getconf($CNF_TAPEDEV);
+}
+
+print_result( try_read_label($device_name) );
diff --git a/server-src/amdump.sh b/server-src/amdump.sh
new file mode 100644 (file)
index 0000000..803adcc
--- /dev/null
@@ -0,0 +1,181 @@
+#!@SHELL@
+#
+# Amanda, The Advanced Maryland Automatic Network Disk Archiver
+# Copyright (c) 1991-1998 University of Maryland at College Park
+# All Rights Reserved.
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of U.M. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  U.M. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Author: James da Silva, Systems Design and Analysis Group
+#                         Computer Science Department
+#                         University of Maryland at College Park
+#
+
+#
+# amdump: Manage running one night's Amanda dump run.
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+confdir=@CONFIG_DIR@
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+if [ $# -lt 1 ]
+then
+        echo `_ 'Usage: %s config [host [disk...]...]' "$0"`  1>&2
+        exit 1
+fi
+
+exit_status=0;
+
+conf=$1
+if [ ! -d $confdir/$conf ]; then
+    echo `_ '%s: could not find directory %s' "amdump$SUF" "$confdir/$conf"` 1>&2
+    exit 1
+fi
+shift
+
+cd $confdir/$conf || exit 1
+
+logdir=`amgetconf$SUF $conf logdir "$@"`
+[ $? -ne 0 ]  && exit 1
+errfile=$logdir/amdump
+tapecycle=`amgetconf$SUF $conf tapecycle "$@"`
+[ $? -ne 0 ]  && exit 1
+dumpuser=`amgetconf$SUF $conf dumpuser "$@"`
+[ $? -ne 0 ]  && exit 1
+
+runuser=`{ whoami ; } 2>/dev/null`
+if [ $? -ne 0 ]; then
+       idinfo=`{ id ; } 2>/dev/null`
+       if [ $? -ne 0 ]; then
+               runuser=${LOGNAME:-"??unknown??"}
+       else
+               runuser=`echo $idinfo | sed -e 's/).*//' -e 's/^.*(//'`
+       fi
+fi
+
+if [ $runuser != $dumpuser ]; then
+       echo `_ '%s: must be run as user %s, not %s' "$0" "$dumpuser" "$runuser"` 1>&2
+       exit 1
+fi
+
+if test -f hold; then
+       echo `_ '%s: waiting for hold file to be removed' "$0"` 1>&2
+       while test -f hold; do
+               sleep 60
+       done
+fi
+
+if test -f $errfile || test -f $logdir/log; then
+       echo `_ '%s: amdump or amflush is already running, or you must run amcleanup' "$0"` 1>&2
+       exit 1
+fi
+
+umask 077
+
+exit_code=0
+# Plan and drive the dumps.
+#exec </dev/null >$errfile 2>&1
+touch $errfile
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+exec </dev/null 2>>$errfile 1>&2
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+gdate=`date +'%a %b %e %H:%M:%S %Z %YAAAAA%Y%m%dBBBBB%Y%m%d%H%M%SCCCCC%Y-%m-%d %H:%M:%S %Z'`
+
+#date=%a %b %e %H:%M:%S %Z %Y
+date=`echo $gdate |sed -e "s/AAAAA.*$//"`
+
+#date_datestamp="%Y%m%d"
+date_datestamp=`echo $gdate |sed -e "s/^.*AAAAA//;s/BBBBB.*$//"`
+
+#date_starttime="%Y%m%d%H%M%S"
+date_starttime=`echo $gdate |sed -e "s/^.*BBBBB//;s/CCCCC.*$//"`
+
+#date_locale_independent=%Y-%m-%d %H:%M:%S %Z
+date_locale_independent=`echo $gdate |sed -e "s/^.*CCCCC//"`
+
+printf '%s: start at %s\n' "amdump" "$date"
+printf '%s: datestamp %s\n' "amdump" "$date_datestamp"
+printf '%s: starttime %s\n' "amdump" "$date_starttime"
+printf '%s: starttime-locale-independent %s\n' "amdump" "$date_locale_independent"
+
+$amlibexecdir/planner$SUF $conf --starttime $date_starttime "$@" | $amlibexecdir/driver$SUF $conf "$@"
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+printf '%s: end at %s\n' "amdump" "`date`"
+
+# Send out a report on the dumps.
+$sbindir/amreport$SUF $conf "$@"
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+# Roll the log file to its datestamped name.
+$amlibexecdir/amlogroll$SUF $conf "$@"
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+# Trim the log file to those for dumps that still exist.
+$amlibexecdir/amtrmlog$SUF $conf "$@"
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+# Trim the index file to those for dumps that still exist.
+$amlibexecdir/amtrmidx$SUF $conf "$@"
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+# Keep a debug log through the tapecycle plus a couple of days.
+maxdays=`expr $tapecycle + 2`
+days=1
+# First, find out the last existing errfile,
+# to avoid ``infinite'' loops if tapecycle is infinite
+while [ $days -lt $maxdays ] && [ -f $errfile.$days ]; do
+       days=`expr $days + 1`
+done
+# Now, renumber the existing log files
+while [ $days -ge 2 ]; do
+       ndays=`expr $days - 1`
+       mv $errfile.$ndays $errfile.$days
+       exit_code=$?
+       echo $exit_code
+       [ $exit_code -ne 0 ] && exit_status=$exit_code
+       days=$ndays
+done
+mv $errfile $errfile.1
+exit_code=$?
+[ $exit_code -ne 0 ] && exit_status=$exit_code
+
+exit $exit_status
diff --git a/server-src/amdump.sh.in b/server-src/amdump.sh.in
deleted file mode 100644 (file)
index 25471a5..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-#!@SHELL@
-#
-# Amanda, The Advanced Maryland Automatic Network Disk Archiver
-# Copyright (c) 1991-1998 University of Maryland at College Park
-# All Rights Reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of U.M. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  U.M. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
-# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-#
-# Author: James da Silva, Systems Design and Analysis Group
-#                         Computer Science Department
-#                         University of Maryland at College Park
-#
-
-#
-# amdump: Manage running one night's Amanda dump run.
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-confdir=@CONFIG_DIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-if [ $# -lt 1 ]
-then
-        echo "Usage: amdump config [host [disk...]...]" 1>&2
-        exit 1
-fi
-
-exit_status=0;
-
-conf=$1
-if [ ! -d $confdir/$conf ]; then
-    echo "amdump$SUF: could not find directory $confdir/$conf" 1>&2
-    exit 1
-fi
-shift
-
-cd $confdir/$conf || exit 1
-
-logdir=`amgetconf$SUF $conf logdir "$@"`
-[ $? -ne 0 ]  && exit 1
-errfile=$logdir/amdump
-tapecycle=`amgetconf$SUF $conf tapecycle "$@"`
-[ $? -ne 0 ]  && exit 1
-dumpuser=`amgetconf$SUF $conf dumpuser "$@"`
-[ $? -ne 0 ]  && exit 1
-
-runuser=`{ whoami ; } 2>/dev/null`
-if [ $? -ne 0 ]; then
-       idinfo=`{ id ; } 2>/dev/null`
-       if [ $? -ne 0 ]; then
-               runuser=${LOGNAME:-"??unknown??"}
-       else
-               runuser=`echo $idinfo | sed -e 's/).*//' -e 's/^.*(//'`
-       fi
-fi
-
-#if [ $runuser != $dumpuser ]; then
-#      echo "amdump: must be run as user $dumpuser, not $runuser" 1>&2
-#      exit 1
-#fi
-
-if test -f hold; then
-       echo "amdump: waiting for hold file to be removed" 1>&2
-       while test -f hold; do
-               sleep 60
-       done
-fi
-
-if test -f $errfile || test -f $logdir/log; then
-       echo "amdump: amdump or amflush is already running, or you must run amcleanup" 1>&2
-       exit 1
-fi
-
-umask 077
-
-exit_code=0
-# Plan and drive the dumps.
-#exec </dev/null >$errfile 2>&1
-touch $errfile
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-exec </dev/null 2>>$errfile 1>&2
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-echo "amdump: start at `date`"
-echo "amdump: datestamp `date +%Y%m%d`"
-echo "amdump: starttime `date +%Y%m%d%H%M%S`"
-$libexecdir/planner$SUF $conf "$@" | $libexecdir/driver$SUF $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-echo "amdump: end at `date`"
-
-# Send out a report on the dumps.
-$sbindir/amreport$SUF $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Roll the log file to its datestamped name.
-$libexecdir/amlogroll$SUF $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Trim the log file to those for dumps that still exist.
-$libexecdir/amtrmlog$SUF $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Trim the index file to those for dumps that still exist.
-$libexecdir/amtrmidx$SUF $conf "$@"
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-# Keep a debug log through the tapecycle plus a couple of days.
-maxdays=`expr $tapecycle + 2`
-days=1
-# First, find out the last existing errfile,
-# to avoid ``infinite'' loops if tapecycle is infinite
-while [ $days -lt $maxdays ] && [ -f $errfile.$days ]; do
-       days=`expr $days + 1`
-done
-# Now, renumber the existing log files
-while [ $days -ge 2 ]; do
-       ndays=`expr $days - 1`
-       mv $errfile.$ndays $errfile.$days
-       exit_code=$?
-       echo $exit_code
-       [ $exit_code -ne 0 ] && exit_status=$exit_code
-       days=$ndays
-done
-mv $errfile $errfile.1
-exit_code=$?
-[ $exit_code -ne 0 ] && exit_status=$exit_code
-
-exit $exit_status
index 5b9e6448c167bca72fbc461a349c9ca0727121d0..4515e67298480a93325060f7dfb1795e7145f86d 100644 (file)
@@ -39,6 +39,7 @@
 #include "holding.h"
 #include "driverio.h"
 #include "server_util.h"
+#include "timestamp.h"
 
 static char *conf_logdir;
 FILE *driver_stream;
@@ -48,12 +49,11 @@ char *logroll_program;
 char *datestamp;
 char *amflush_timestamp;
 char *amflush_datestamp;
-sl_t *datestamp_list;
 
 /* local functions */
-int main(int main_argc, char **main_argv);
 void flush_holdingdisk(char *diskdir, char *datestamp);
-void confirm(void);
+static GSList * pick_datestamp(void);
+void confirm(GSList *datestamp_list);
 void redirect_stderr(void);
 void detach(void);
 void run_dumps(void);
@@ -61,17 +61,14 @@ static int get_letter_from_user(void);
 
 int
 main(
-    int                main_argc,
-    char **    main_argv)
+    int                argc,
+    char **    argv)
 {
     int foreground;
     int batch;
     int redirect;
-    struct passwd *pw;
-    char *dumpuser;
     char **datearg = NULL;
     int nb_datearg = 0;
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_logfile;
@@ -83,29 +80,39 @@ main(
     amwait_t exitcode;
     int opt;
     dumpfile_t file;
-    sl_t *holding_list=NULL;
-    sle_t *holding_file;
+    GSList *holding_list=NULL, *holding_file;
     int driver_pipe[2];
     char date_string[100];
+    char date_string_standard[100];
     time_t today;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     char *errstr;
     struct tm *tm;
     char *tapedev;
     char *tpchanger;
     char *qdisk, *qhname;
+    GSList *datestamp_list = NULL;
+    config_overwrites_t *cfg_ovr;
+    char **config_options;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
 
     set_pname("amflush");
 
-    dbopen(DBG_SUBDIR_SERVER);
-
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
+    dbopen(DBG_SUBDIR_SERVER);
+
     erroutput_type = ERR_INTERACTIVE;
     foreground = 0;
     batch = 0;
@@ -113,11 +120,8 @@ main(
 
     /* process arguments */
 
-    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
-
-    while((opt = getopt(my_argc, my_argv, "bfsD:")) != EOF) {
+    cfg_ovr = new_config_overwrites(argc/2);
+    while((opt = getopt(argc, argv, "bfso:D:")) != EOF) {
        switch(opt) {
        case 'b': batch = 1;
                  break;
@@ -125,10 +129,12 @@ main(
                  break;
        case 's': redirect = 0;
                  break;
+       case 'o': add_config_overwrite_opt(cfg_ovr, optarg);
+                 break;
        case 'D': if (datearg == NULL)
                      datearg = alloc(21*SIZEOF(char *));
                  if(nb_datearg == 20) {
-                     fprintf(stderr,"maximum of 20 -D arguments.\n");
+                     g_fprintf(stderr,_("maximum of 20 -D arguments.\n"));
                      exit(1);
                  }
                  datearg[nb_datearg++] = stralloc(optarg);
@@ -136,145 +142,120 @@ main(
                  break;
        }
     }
+    argc -= optind, argv += optind;
+
     if(!foreground && !redirect) {
-       fprintf(stderr,"Can't redirect to stdout/stderr if not in forground.\n");
+       g_fprintf(stderr,_("Can't redirect to stdout/stderr if not in forground.\n"));
        exit(1);
     }
 
-    my_argc -= optind, my_argv += optind;
-
-    if(my_argc < 1) {
-       error("Usage: amflush%s [-b] [-f] [-s] [-D date]* <confdir> [host [disk]* ]* [-o configoption]*", versionsuffix());
+    if(argc < 1) {
+       error(_("Usage: amflush%s [-b] [-f] [-s] [-D date]* <confdir> [host [disk]* ]* [-o configoption]*"), versionsuffix());
        /*NOTREACHED*/
     }
 
-    config_name = my_argv[0];
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL,
+               argv[0]);
+    apply_config_overwrites(cfg_ovr);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &diskq) < 0) {
-       error("could not read disklist file \"%s\"", conf_diskfile);
+       error(_("could not read disklist file \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
-    errstr = match_disklist(&diskq, my_argc-1, my_argv+1);
+    errstr = match_disklist(&diskq, argc-1, argv+1);
     if (errstr) {
-       printf("%s",errstr);
+       g_printf(_("%s"),errstr);
        amfree(errstr);
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
     amfree(conf_tapelist);
 
     conf_usetimestamps = getconf_boolean(CNF_USETIMESTAMPS);
 
-    amflush_datestamp = construct_datestamp(NULL);
+    amflush_datestamp = get_datestamp_from_time(0);
     if(conf_usetimestamps == 0) {
        amflush_timestamp = stralloc(amflush_datestamp);
     }
     else {
-       amflush_timestamp = construct_timestamp(NULL);
-    }
-
-    dumpuser = getconf_str(CNF_DUMPUSER);
-    if((pw = getpwnam(dumpuser)) == NULL) {
-       error("dumpuser %s not found in password file", dumpuser);
-       /*NOTREACHED*/
-    }
-    if(pw->pw_uid != getuid()) {
-       error("must run amflush as user %s", dumpuser);
-       /*NOTREACHED*/
+       amflush_timestamp = get_timestamp_from_time(0);
     }
 
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     conf_logfile = vstralloc(conf_logdir, "/log", NULL);
     if (access(conf_logfile, F_OK) == 0) {
-       error("%s exists: amdump or amflush is already running, or you must run amcleanup", conf_logfile);
+       error(_("%s exists: amdump or amflush is already running, or you must run amcleanup"), conf_logfile);
        /*NOTREACHED*/
     }
     amfree(conf_logfile);
 
-    driver_program = vstralloc(libexecdir, "/", "driver", versionsuffix(),
+    driver_program = vstralloc(amlibexecdir, "/", "driver", versionsuffix(),
                               NULL);
     reporter_program = vstralloc(sbindir, "/", "amreport", versionsuffix(),
                                 NULL);
-    logroll_program = vstralloc(libexecdir, "/", "amlogroll", versionsuffix(),
+    logroll_program = vstralloc(amlibexecdir, "/", "amlogroll", versionsuffix(),
                                NULL);
 
     tapedev = getconf_str(CNF_TAPEDEV);
     tpchanger = getconf_str(CNF_TPCHANGER);
     if (tapedev == NULL && tpchanger == NULL) {
-       error("No tapedev or tpchanger specified");
+       error(_("No tapedev or tpchanger specified"));
     }
 
+    /* if dates were specified (-D), then use match_datestamp
+     * against the list of all datestamps to turn that list
+     * into a set of existing datestamps (basically, evaluate the
+     * expressions into actual datestamps) */
     if(datearg) {
-       sle_t *dir, *next_dir;
+       GSList *all_datestamps;
+       GSList *datestamp;
        int i, ok;
 
-       datestamp_list = pick_all_datestamp(1);
-       for(dir = datestamp_list->first; dir != NULL;) {
-           next_dir = dir->next;
+       all_datestamps = holding_get_all_datestamps();
+       for(datestamp = all_datestamps; datestamp != NULL; datestamp = datestamp->next) {
            ok = 0;
            for(i=0; i<nb_datearg && ok==0; i++) {
-               ok = match_datestamp(datearg[i], dir->name);
+               ok = match_datestamp(datearg[i], (char *)datestamp->data);
            }
-           if(ok == 0) { /* remove dir */
-               remove_sl(datestamp_list, dir);
-           }
-           dir = next_dir;
+           if (ok)
+               datestamp_list = g_slist_insert_sorted(datestamp_list,
+                   stralloc((char *)datestamp->data),
+                   g_compare_strings);
        }
+       g_slist_free_full(all_datestamps);
     }
     else {
+       /* otherwise, in batch mode, use all datestamps */
        if(batch) {
-           datestamp_list = pick_all_datestamp(1);
+           datestamp_list = holding_get_all_datestamps();
        }
+       /* or allow the user to pick datestamps */
        else {
-           datestamp_list = pick_datestamp(1);
+           datestamp_list = pick_datestamp();
        }
     }
 
-    if(is_empty_sl(datestamp_list)) {
-       printf("Could not find any Amanda directories to flush.\n");
+    if(!datestamp_list) {
+       g_printf(_("Could not find any Amanda directories to flush.\n"));
        exit(1);
     }
 
-    holding_list = holding_get_files_for_flush(datestamp_list, 1);
-    if(holding_list->first == NULL) {
-       printf("Could not find any valid dump image, check directory.\n");
+    holding_list = holding_get_files_for_flush(datestamp_list);
+    if (holding_list == NULL) {
+       g_printf(_("Could not find any valid dump image, check directory.\n"));
        exit(1);
     }
 
-    if(!batch) confirm();
+    if(!batch) confirm(datestamp_list);
 
     for(dp = diskq.head; dp != NULL; dp = dp->next) {
        if(dp->todo) {
@@ -286,8 +267,8 @@ main(
     }
 
     if(!foreground) { /* write it before redirecting stdout */
-       puts("Running in background, you can log off now.");
-       puts("You'll get mail when amflush is finished.");
+       puts(_("Running in background, you can log off now."));
+       puts(_("You'll get mail when amflush is finished."));
     }
 
     if(redirect) redirect_stderr();
@@ -298,18 +279,22 @@ main(
     set_logerror(logerror);
     today = time(NULL);
     tm = localtime(&today);
-    if (tm)
+    if (tm) {
        strftime(date_string, 100, "%a %b %e %H:%M:%S %Z %Y", tm);
-    else
-       error("BAD DATE"); /* should never happen */
-    fprintf(stderr, "amflush: start at %s\n", date_string);
-    fprintf(stderr, "amflush: datestamp %s\n", amflush_timestamp);
-    fprintf(stderr, "amflush: starttime %s\n", construct_timestamp(NULL));
-    log_add(L_START, "date %s", amflush_timestamp);
+       strftime(date_string_standard, 100, "%Y-%m-%d %H:%M:%S %Z", tm);
+    } else {
+       error(_("BAD DATE")); /* should never happen */
+    }
+    g_fprintf(stderr, _("amflush: start at %s\n"), date_string);
+    g_fprintf(stderr, _("amflush: datestamp %s\n"), amflush_timestamp);
+    g_fprintf(stderr, _("amflush: starttime %s\n"), amflush_timestamp);
+    g_fprintf(stderr, _("amflush: starttime-locale-independent %s\n"),
+             date_string_standard);
+    log_add(L_START, _("date %s"), amflush_timestamp);
 
     /* START DRIVER */
     if(pipe(driver_pipe) == -1) {
-       error("error [opening pipe to driver: %s]", strerror(errno));
+       error(_("error [opening pipe to driver: %s]"), strerror(errno));
        /*NOTREACHED*/
     }
     if((driver_pid = fork()) == 0) {
@@ -318,30 +303,33 @@ main(
         */
        dup2(driver_pipe[0], 0);
        close(driver_pipe[1]);
-       execle(driver_program,
-              "driver", config_name, "nodump", (char *)0,
-              safe_env());
-       error("cannot exec %s: %s", driver_program, strerror(errno));
+       config_options = get_config_options(3);
+       config_options[0] = "driver";
+       config_options[1] = config_name;
+       config_options[2] = "nodump";
+       safe_fd(-1, 0);
+       execve(driver_program, config_options, safe_env());
+       error(_("cannot exec %s: %s"), driver_program, strerror(errno));
        /*NOTREACHED*/
     } else if(driver_pid == -1) {
-       error("cannot fork for %s: %s", driver_program, strerror(errno));
+       error(_("cannot fork for %s: %s"), driver_program, strerror(errno));
        /*NOTREACHED*/
     }
     driver_stream = fdopen(driver_pipe[1], "w");
     if (!driver_stream) {
-       error("Can't fdopen: %s", strerror(errno));
+       error(_("Can't fdopen: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
-    fprintf(driver_stream, "DATE %s\n", amflush_timestamp);
-    for(holding_file=holding_list->first; holding_file != NULL;
+    g_fprintf(driver_stream, "DATE %s\n", amflush_timestamp);
+    for(holding_file=holding_list; holding_file != NULL;
                                   holding_file = holding_file->next) {
-       holding_file_get_dumpfile(holding_file->name, &file);
+       holding_file_get_dumpfile((char *)holding_file->data, &file);
 
-       if (holding_file_size(holding_file->name, 1) <= 0) {
+       if (holding_file_size((char *)holding_file->data, 1) <= 0) {
            log_add(L_INFO, "%s: removing file with no data.",
-                   holding_file->name);
-           holding_file_unlink(holding_file->name);
+                   (char *)holding_file->data);
+           holding_file_unlink((char *)holding_file->data);
            continue;
        }
 
@@ -353,15 +341,15 @@ main(
        if (dp->todo == 0) continue;
 
        qdisk = quote_string(file.disk);
-       qhname = quote_string(holding_file->name);
-       fprintf(stderr,
+       qhname = quote_string((char *)holding_file->data);
+       g_fprintf(stderr,
                "FLUSH %s %s %s %d %s\n",
                file.name,
                qdisk,
                file.datestamp,
                file.dumplevel,
                qhname);
-       fprintf(driver_stream,
+       g_fprintf(driver_stream,
                "FLUSH %s %s %s %d %s\n",
                file.name,
                qdisk,
@@ -371,8 +359,8 @@ main(
        amfree(qdisk);
        amfree(qhname);
     }
-    fprintf(stderr, "ENDFLUSH\n"); fflush(stderr);
-    fprintf(driver_stream, "ENDFLUSH\n"); fflush(driver_stream);
+    g_fprintf(stderr, "ENDFLUSH\n"); fflush(stderr);
+    g_fprintf(driver_stream, "ENDFLUSH\n"); fflush(driver_stream);
     fclose(driver_stream);
 
     /* WAIT DRIVER */
@@ -381,7 +369,7 @@ main(
            if(errno == EINTR) {
                continue;
            } else {
-               error("wait for %s: %s", driver_program, strerror(errno));
+               error(_("wait for %s: %s"), driver_program, strerror(errno));
                /*NOTREACHED*/
            }
        } else if (pid == driver_pid) {
@@ -389,9 +377,9 @@ main(
        }
     }
 
-    free_sl(datestamp_list);
+    g_slist_free_full(datestamp_list);
     datestamp_list = NULL;
-    free_sl(holding_list);
+    g_slist_free_full(holding_list);
     holding_list = NULL;
 
     if(redirect) { /* rename errfile */
@@ -410,31 +398,31 @@ main(
        /* First, find out the last existing errfile,           */
        /* to avoid ``infinite'' loops if tapecycle is infinite */
 
-       snprintf(number,100,"%d",days);
+       g_snprintf(number,100,"%d",days);
        errfilex = newvstralloc(errfilex, errfile, ".", number, NULL);
        while ( days < maxdays && stat(errfilex,&stat_buf)==0) {
            days++;
-           snprintf(number,100,"%d",days);
+           g_snprintf(number,100,"%d",days);
            errfilex = newvstralloc(errfilex, errfile, ".", number, NULL);
        }
-       snprintf(number,100,"%d",days);
+       g_snprintf(number,100,"%d",days);
        errfilex = newvstralloc(errfilex, errfile, ".", number, NULL);
        nerrfilex = NULL;
        while (days > 1) {
            amfree(nerrfilex);
            nerrfilex = errfilex;
            days--;
-           snprintf(number,100,"%d",days);
+           g_snprintf(number,100,"%d",days);
            errfilex = vstralloc(errfile, ".", number, NULL);
            if (rename(errfilex, nerrfilex) != 0) {
-               error("cannot rename \"%s\" to \"%s\": %s",
+               error(_("cannot rename \"%s\" to \"%s\": %s"),
                      errfilex, nerrfilex, strerror(errno));
                /*NOTREACHED*/
            }
        }
        errfilex = newvstralloc(errfilex, errfile, ".1", NULL);
        if (rename(errfile,errfilex) != 0) {
-           error("cannot rename \"%s\" to \"%s\": %s",
+           error(_("cannot rename \"%s\" to \"%s\": %s"),
                  errfilex, nerrfilex, strerror(errno));
            /*NOTREACHED*/
        }
@@ -453,13 +441,15 @@ main(
        /*
         * This is the child process.
         */
-       execle(reporter_program,
-              "amreport", config_name, (char *)0,
-              safe_env());
-       error("cannot exec %s: %s", reporter_program, strerror(errno));
+       config_options = get_config_options(2);
+       config_options[0] = "amreport";
+       config_options[1] = config_name;
+       safe_fd(-1, 0);
+       execve(reporter_program, config_options, safe_env());
+       error(_("cannot exec %s: %s"), reporter_program, strerror(errno));
        /*NOTREACHED*/
     } else if(reporter_pid == -1) {
-       error("cannot fork for %s: %s", reporter_program, strerror(errno));
+       error(_("cannot fork for %s: %s"), reporter_program, strerror(errno));
        /*NOTREACHED*/
     }
     while(1) {
@@ -467,7 +457,7 @@ main(
            if(errno == EINTR) {
                continue;
            } else {
-               error("wait for %s: %s", reporter_program, strerror(errno));
+               error(_("wait for %s: %s"), reporter_program, strerror(errno));
                /*NOTREACHED*/
            }
        } else if (pid == reporter_pid) {
@@ -479,10 +469,12 @@ main(
      * Call amlogroll to rename the log file to its datestamped version.
      * Since we exec at this point, our exit code will be that of amlogroll.
      */
-    execle(logroll_program,
-          "amlogroll", config_name, (char *)0,
-          safe_env());
-    error("cannot exec %s: %s", logroll_program, strerror(errno));
+    config_options = get_config_options(2);
+    config_options[0] = "amlogroll";
+    config_options[1] = config_name;
+    safe_fd(-1, 0);
+    execve(logroll_program, config_options, safe_env());
+    error(_("cannot exec %s: %s"), logroll_program, strerror(errno));
     /*NOTREACHED*/
     return 0;                          /* keep the compiler happy */
 }
@@ -512,43 +504,129 @@ get_letter_from_user(void)
     return r;
 }
 
+/* Allow the user to select a set of datestamps from those in
+ * holding disks.  The result can be passed to 
+ * holding_get_files_for_flush.  If less than two dates are
+ * available, then no user interaction takes place.
+ *
+ * @returns: a new GSList listing the selected datestamps
+ */
+static GSList *
+pick_datestamp(void)
+{
+    GSList *datestamp_list;
+    GSList *r_datestamp_list = NULL;
+    GSList *ds;
+    char **datestamps = NULL;
+    int i;
+    char *answer = NULL;
+    char *a = NULL;
+    int ch = 0;
+    char max_char = '\0', chupper = '\0';
+
+    datestamp_list = holding_get_all_datestamps();
+
+    if(g_slist_length(datestamp_list) < 2) {
+       return datestamp_list;
+    } else {
+       datestamps = alloc(g_slist_length(datestamp_list) * SIZEOF(char *));
+       for(ds = datestamp_list, i=0; ds != NULL; ds = ds->next,i++) {
+           datestamps[i] = (char *)ds->data; /* borrowing reference */
+       }
+
+       while(1) {
+           puts(_("\nMultiple Amanda runs in holding disks; please pick one by letter:"));
+           for(ds = datestamp_list, max_char = 'A';
+               ds != NULL && max_char <= 'Z';
+               ds = ds->next, max_char++) {
+               g_printf("  %c. %s\n", max_char, (char *)ds->data);
+           }
+           max_char--;
+           g_printf(_("Select datestamps to flush [A..%c or <enter> for all]: "), max_char);
+           fflush(stdout); fflush(stderr);
+           amfree(answer);
+           if ((answer = agets(stdin)) == NULL) {
+               clearerr(stdin);
+               continue;
+           }
+
+           if (*answer == '\0' || strncasecmp(answer, "ALL", 3) == 0) {
+               break;
+           }
+
+           a = answer;
+           while ((ch = *a++) != '\0') {
+               if (!isspace(ch))
+                   break;
+           }
+
+           /* rewrite the selected list into r_datestamp_list, then copy it over
+            * to datestamp_list */
+           do {
+               if (isspace(ch) || ch == ',') {
+                   continue;
+               }
+               chupper = (char)toupper(ch);
+               if (chupper < 'A' || chupper > max_char) {
+                   g_slist_free_full(r_datestamp_list);
+                   r_datestamp_list = NULL;
+                   break;
+               }
+               r_datestamp_list = g_slist_append(r_datestamp_list,
+                                          stralloc(datestamps[chupper - 'A']));
+           } while ((ch = *a++) != '\0');
+           if (r_datestamp_list && ch == '\0') {
+               g_slist_free_full(datestamp_list);
+               datestamp_list = r_datestamp_list;
+               break;
+           }
+       }
+    }
+    amfree(datestamps); /* references in this array are borrowed */
+    amfree(answer);
+
+    return datestamp_list;
+}
+
 
 /*
  * confirm before detaching and running
  */
 
 void
-confirm(void)
+confirm(GSList *datestamp_list)
 {
     tape_t *tp;
     char *tpchanger;
-    sle_t *dir;
+    GSList *datestamp;
     int ch;
     char *extra;
 
-    printf("\nToday is: %s\n",amflush_datestamp);
-    printf("Flushing dumps in");
+    g_printf(_("\nToday is: %s\n"),amflush_datestamp);
+    g_printf(_("Flushing dumps from"));
     extra = "";
-    for(dir = datestamp_list->first; dir != NULL; dir = dir->next) {
-       printf("%s %s", extra, dir->name);
+    for(datestamp = datestamp_list; datestamp != NULL; datestamp = datestamp->next) {
+       g_printf("%s %s", extra, (char *)datestamp->data);
        extra = ",";
     }
     tpchanger = getconf_str(CNF_TPCHANGER);
     if(*tpchanger != '\0') {
-       printf(" using tape changer \"%s\".\n", tpchanger);
+       g_printf(_(" using tape changer \"%s\".\n"), tpchanger);
     } else {
-       printf(" to tape drive \"%s\".\n", getconf_str(CNF_TAPEDEV));
+       g_printf(_(" to tape drive \"%s\".\n"), getconf_str(CNF_TAPEDEV));
     }
 
-    printf("Expecting ");
+    g_printf(_("Expecting "));
     tp = lookup_last_reusable_tape(0);
-    if(tp != NULL) printf("tape %s or ", tp->label);
-    printf("a new tape.");
+    if(tp != NULL)
+       g_printf(_("tape %s or "), tp->label);
+    g_printf(_("a new tape."));
     tp = lookup_tapepos(1);
-    if(tp != NULL) printf("  (The last dumps were to tape %s)", tp->label);
+    if(tp != NULL)
+       g_printf(_("  (The last dumps were to tape %s)"), tp->label);
 
     while (1) {
-       printf("\nAre you sure you want to do this [yN]? ");
+       g_printf(_("\nAre you sure you want to do this [yN]? "));
        if((ch = get_letter_from_user()) == 'Y') {
            return;
        } else if (ch == 'N' || ch == '\0' || ch == EOF) {
@@ -559,7 +637,7 @@ confirm(void)
        }
     }
 
-    printf("Ok, quitting.  Run amflush again when you are ready.\n");
+    g_printf(_("Ok, quitting.  Run amflush again when you are ready.\n"));
     exit(1);
 }
 
@@ -572,7 +650,7 @@ redirect_stderr(void)
     fflush(stdout); fflush(stderr);
     errfile = vstralloc(conf_logdir, "/amflush", NULL);
     if((fderr = open(errfile, O_WRONLY| O_CREAT | O_TRUNC, 0600)) == -1) {
-       error("could not open %s: %s", errfile, strerror(errno));
+       error(_("could not open %s: %s"), errfile, strerror(errno));
        /*NOTREACHED*/
     }
     dup2(fderr,1);
@@ -588,7 +666,7 @@ detach(void)
 
     fflush(stdout); fflush(stderr);
     if((fd = open("/dev/null", O_RDWR, 0666)) == -1) {
-       error("could not open /dev/null: %s", strerror(errno));
+       error(_("could not open /dev/null: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -597,7 +675,7 @@ detach(void)
 
     switch(fork()) {
     case -1:
-       error("could not fork: %s", strerror(errno));
+       error(_("could not fork: %s"), strerror(errno));
        /*NOTREACHED*/
 
     case 0:
diff --git a/server-src/amfreetapes.sh.in b/server-src/amfreetapes.sh.in
deleted file mode 100644 (file)
index d734d17..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#! @SHELL@
-#
-# ICEM internal :-)
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-ConfigDir=@CONFIG_DIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-Program=`basename $0`
-
-log () {
-       echo 1>&2 "$@"
-       return 0
-}
-
-Config=$1
-if [ "$Config" = "" ]; then
-       log "usage: ${Program} <config> <volume header>"
-       exit 1
-fi
-VOLHEADER=$2
-if [ "$VOLHEADER" = "" ]; then
-       log "usage: ${Program} <config> <volume header>"
-       exit 1
-fi
-
-#
-# Check if the configuration directory exists.  Make sure that the
-# necessary files can be found, such as amanda.conf and tapelist.
-#
-if [ ! -d ${ConfigDir}/${Config} ]; then
-       log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
-       exit 1
-fi
-(cd ${ConfigDir}/${Config} >/dev/null 2>&1) || exit $?
-cd ${ConfigDir}/${Config}
-if [ ! -r amanda.conf ]; then
-       log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
-       exit 1
-fi
-
-# Get the location and name of the tapelist filename.  If tapelist is not
-# specified in the amanda.conf file, then use tapelist in the config
-# directory.
-TapeList=`amgetconf${SUF} tapelist`
-if [ ! "$TapeList" ]; then
-       TapeList="$ConfigDir/$Config/tapelist"
-fi
-if [ ! -r $TapeList ]; then
-       log "${Program}: $TapeList not found or is not readable."
-       exit 1
-fi
-
-AllTapeList="${TapeList}.all"
-
-[ ! -f $AllTapeList ] \
-       && echo "no tapelist $AllTapeList found" >&2 \
-       && cat $TapeList | sed 's/^.* //' | sort -u > $AllTapeList \
-       && echo "$AllTapeList created" >&2
-
-cat $TapeList | sed 's/^.* //' > $AllTapeList.n
-cat $AllTapeList >> $AllTapeList.n
-sort -u $AllTapeList.n > $AllTapeList && rm -f $AllTapeList.n
-
-MAXTAPE=`cat $AllTapeList | sed "s/^$VOLHEADER//" | sort -n | tail -1`
-NEXTTAPE=`expr $MAXTAPE + 1`
-echo "last Tape is ${VOLHEADER}${MAXTAPE}" >&2
-
-I=1
-while [ $I -le $MAXTAPE ]; do
-       WRITTEN=`grep "${VOLHEADER}${I}\$" $TapeList`
-       EXISTS=`grep "${VOLHEADER}${I}\$" $AllTapeList`
-       if [ "$EXISTS" = "" -a "$WRITTEN" = "" ]; then
-               echo "missing tape ${VOLHEADER}${I}" >&2
-               echo "${VOLHEADER}${I}" >> $AllTapeList \
-               && echo "added ${VOLHEADER}${I} to $AllTapeList" >&2
-       elif [ "$EXISTS" = "" -a "$WRITTEN" != "" ]; then
-               echo "tape written, but not existing: ${VOLHEADER}${I}" >&2
-       elif [ "$EXISTS" != "" -a "$WRITTEN" = "" ]; then
-               echo "free tape: ${VOLHEADER}${I}" >&2
-       fi
-       I=`expr $I + 1`
-done
-
-echo "next tape is ${VOLHEADER}${NEXTTAPE}" >&2
-
-exit 0
index d703618732480fe33103e6fcbf38eae64a418f9a..7c52bd380564043709666ffa4f51a23dbc93f03c 100644 (file)
@@ -64,7 +64,7 @@ getindexfname(
     datebuf[SIZEOF(datebuf)-1] = '\0';
     dc = datebuf;
 
-    snprintf(level_str, SIZEOF(level_str), "%d", level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", level);
   }
 
   host = sanitise_filename(host);
@@ -72,12 +72,7 @@ getindexfname(
     disk = sanitise_filename(disk);
   }
 
-  conf_indexdir = getconf_str(CNF_INDEXDIR);
-  if (*conf_indexdir == '/') {
-    conf_indexdir = stralloc(conf_indexdir);
-  } else {
-    conf_indexdir = stralloc2(config_dir, conf_indexdir);
-  }
+  conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR));
   /*
    * Note: vstralloc() will stop at the first NULL, which might be
    * "disk" or "dc" (datebuf) rather than the full file name.
@@ -126,7 +121,7 @@ getoldindexfname(
     datebuf[SIZEOF(datebuf)-1] = '\0';
     dc = datebuf;
 
-    snprintf(level_str, SIZEOF(level_str), "%d", level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", level);
   }
 
   host = old_sanitise_filename(host);
@@ -134,12 +129,7 @@ getoldindexfname(
     disk = old_sanitise_filename(disk);
   }
 
-  conf_indexdir = getconf_str(CNF_INDEXDIR);
-  if (*conf_indexdir == '/') {
-    conf_indexdir = stralloc(conf_indexdir);
-  } else {
-    conf_indexdir = stralloc2(config_dir, conf_indexdir);
-  }
+  conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR));
   /*
    * Note: vstralloc() will stop at the first NULL, which might be
    * "disk" or "dc" (datebuf) rather than the full file name.
index 951151bfd42bd39ac716cac90fb1522d8fae0f67..29ef093282c0ad4a51b344a67fdbee8332eaad84 100644 (file)
@@ -56,6 +56,7 @@
 #include "util.h"
 #include "amandad.h"
 #include "pipespawn.h"
+#include "sockaddr-util.h"
 
 #include <grp.h>
 
@@ -100,15 +101,12 @@ static char *amandad_auth = NULL;
 static FILE *cmdin;
 static FILE *cmdout;
 
-static void reply(int, char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
-static void lreply(int, char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
-static void fast_lreply(int, char *, ...)
-    __attribute__ ((format (printf, 2, 3)));
+static void reply(int, char *, ...) G_GNUC_PRINTF(2, 3);
+static void lreply(int, char *, ...) G_GNUC_PRINTF(2, 3);
+static void fast_lreply(int, char *, ...) G_GNUC_PRINTF(2, 3);
 static am_host_t *is_dump_host_valid(char *);
 static int is_disk_valid(char *);
-static int is_config_valid(char *);
+static int check_and_load_config(char *);
 static int build_disk_table(void);
 static int disk_history_list(void);
 static int is_dir_valid_opaque(char *);
@@ -133,8 +131,7 @@ remove_files(
     REMOVE_ITEM *prev;
 
     while(remove) {
-       dbprintf(("%s: removing index file: %s\n",
-                 debug_prefix_time(NULL), remove->filename));
+       dbprintf(_("removing index file: %s\n"), remove->filename);
        unlink(remove->filename);
        amfree(remove->filename);
        prev = remove;
@@ -159,7 +156,6 @@ uncompress_file(
     int indexfd;
     int nullfd;
     int debugfd;
-    int debugnullfd;
     char line[STR_SIZE];
     FILE *pipe_stream;
     pid_t pid_gzip;
@@ -185,12 +181,10 @@ uncompress_file(
         * Check that compressed file exists manually.
         */
        if (stat(filename_gz, &statbuf) < 0) {
-           *emsg = newvstralloc(*emsg, "Compressed file '",
-                               filename_gz,
-                               "' is inaccessable: ",
-                               strerror(errno),
-                               NULL);
-           dbprintf(("%s\n",*emsg));
+           *emsg = newvstrallocf(*emsg,
+                               _("Compressed file '%s' is inaccessable: %s"),
+                               filename_gz, strerror(errno));
+           dbprintf("%s\n",*emsg);
            amfree(filename);
            return NULL;
        }
@@ -201,25 +195,22 @@ uncompress_file(
 #  define PARAM_UNCOMPRESS_OPT skip_argument
 #endif
 
-       debugfd = dbfd();
-       debugnullfd = 0;
-       if(debugfd < 0) {
-           debugfd = open("/dev/null", O_WRONLY);
-           debugnullfd = 1;
-       }
-
        nullfd = open("/dev/null", O_RDONLY);
+
        indexfd = open(filename,O_WRONLY|O_CREAT, 0600);
        if (indexfd == -1) {
-           *emsg = newvstralloc(*emsg, "Can't open '",
-                                filename, "' for writting: ",
-                                strerror(errno),
-                                NULL);
-           dbprintf(("%s\n",*emsg));
+           *emsg = newvstrallocf(*emsg, _("Can't open '%s' for writting: %s"),
+                                filename, strerror(errno));
+           dbprintf("%s\n",*emsg);
            amfree(filename);
            return NULL;
        }
 
+       /* just use our stderr directly for the pipe's stderr; in 
+        * main() we send stderr to the debug file, or /dev/null
+        * if debugging is disabled */
+       debugfd = STDERR_FILENO;
+
        /* start the uncompress process */
        putenv(stralloc("LC_ALL=C"));
        pid_gzip = pipespawn(UNCOMPRESS_PATH, STDOUT_PIPE,
@@ -230,20 +221,18 @@ uncompress_file(
 
        pipe_stream = fdopen(pipe_from_gzip,"r");
        if(pipe_stream == NULL) {
-           *emsg = newvstralloc(*emsg, "Can't fdopen pipe from gzip: ",
-                                strerror(errno),
-                                NULL);
-           dbprintf(("%s\n",*emsg));
+           *emsg = newvstrallocf(*emsg, _("Can't fdopen pipe from gzip: %s"),
+                                strerror(errno));
+           dbprintf("%s\n",*emsg);
            amfree(filename);
            return NULL;
        }
 
        /* start the sort process */
+       putenv(stralloc("LC_ALL=C"));
        pid_sort = pipespawn(SORT_PATH, STDIN_PIPE,
                             &pipe_to_sort, &indexfd, &debugfd,
                             SORT_PATH, NULL);
-       if (debugnullfd == 1)
-           aclose(debugfd);
        aclose(indexfd);
 
        /* send all ouput from uncompress process to sort process */
@@ -261,26 +250,26 @@ uncompress_file(
        aclose(pipe_to_sort);
        if (waitpid(pid_gzip, &wait_status, 0) < 0) {
            if (!WIFEXITED(wait_status)) {
-               dbprintf(("Uncompress exited with signal %d",
-                         WTERMSIG(wait_status)));
+               dbprintf(_("Uncompress exited with signal %d"),
+                         WTERMSIG(wait_status));
            } else if (WEXITSTATUS(wait_status) != 0) {
-               dbprintf(("Uncompress exited with status %d",
-                         WEXITSTATUS(wait_status)));
+               dbprintf(_("Uncompress exited with status %d"),
+                         WEXITSTATUS(wait_status));
            } else {
-               dbprintf(("Uncompres returned negative value: %s",
-                         strerror(errno)));
+               dbprintf(_("Uncompres returned negative value: %s"),
+                         strerror(errno));
            }
        }
-       if (waitpid(pid_sort, &wait_status, 0)) {
+       if (waitpid(pid_sort, &wait_status, 0) < 0) {
            if (!WIFEXITED(wait_status)) {
-               dbprintf(("Sort exited with signal %d",
-                         WTERMSIG(wait_status)));
+               dbprintf(_("Sort exited with signal %d"),
+                         WTERMSIG(wait_status));
            } else if (WEXITSTATUS(wait_status) != 0) {
-               dbprintf(("Sort exited with status %d",
-                         WEXITSTATUS(wait_status)));
+               dbprintf(_("Sort exited with status %d"),
+                         WEXITSTATUS(wait_status));
            } else {
-               dbprintf(("Sort returned negative value: %s",
-                         strerror(errno)));
+               dbprintf(_("Sort returned negative value: %s"),
+                         strerror(errno));
            }
        }
 
@@ -291,7 +280,7 @@ uncompress_file(
        uncompress_remove = remove_file;
     } else if(!S_ISREG((stat_filename.st_mode))) {
            amfree(*emsg);
-           *emsg = vstralloc("\"", filename, "\" is not a regular file", NULL);
+           *emsg = vstrallocf(_("\"%s\" is not a regular file"), filename);
            errno = -1;
            amfree(filename);
            amfree(cmd);
@@ -329,7 +318,7 @@ process_ls_dump(
     filename_gz = get_index_name(dump_hostname, dump_item->hostname, disk_name,
                                 dump_item->date, dump_item->level);
     if (filename_gz == NULL) {
-       *emsg = stralloc("index file not found");
+       *emsg = stralloc(_("index file not found"));
        amfree(filename_gz);
        return -1;
     }
@@ -342,7 +331,7 @@ process_ls_dump(
 
     if((fp = fopen(filename,"r"))==0) {
        amfree(*emsg);
-       *emsg = stralloc(strerror(errno));
+       *emsg = vstrallocf("%s", strerror(errno));
        amfree(dir_slash);
        return -1;
     }
@@ -390,7 +379,7 @@ printf_arglist_function1(static void reply, int, n, char *, fmt)
 
     while(1) {
        arglist_start(args, fmt);
-       len = vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
+       len = g_vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
        arglist_end(args);
 
        if (len > -1 && (size_t)len < reply_buffer_size-1)
@@ -401,21 +390,19 @@ printf_arglist_function1(static void reply, int, n, char *, fmt)
        reply_buffer = alloc(reply_buffer_size);
     }
 
-    if (fprintf(cmdout,"%03d %s\r\n", n, reply_buffer) < 0)
+    if (g_fprintf(cmdout,"%03d %s\r\n", n, reply_buffer) < 0)
     {
-       dbprintf(("%s: ! error %d (%s) in printf\n",
-                 debug_prefix_time(NULL), errno, strerror(errno)));
+       dbprintf(_("! error %d (%s) in printf\n"), errno, strerror(errno));
        uncompress_remove = remove_files(uncompress_remove);
        exit(1);
     }
     if (fflush(cmdout) != 0)
     {
-       dbprintf(("%s: ! error %d (%s) in fflush\n",
-                 debug_prefix_time(NULL), errno, strerror(errno)));
+       dbprintf(_("! error %d (%s) in fflush\n"), errno, strerror(errno));
        uncompress_remove = remove_files(uncompress_remove);
        exit(1);
     }
-    dbprintf(("%s: < %03d %s\n", debug_prefix_time(NULL), n, reply_buffer));
+    dbprintf(_("< %03d %s\n"), n, reply_buffer);
 }
 
 /* send one line of a multi-line response */
@@ -429,7 +416,7 @@ printf_arglist_function1(static void lreply, int, n, char *, fmt)
 
     while(1) {
        arglist_start(args, fmt);
-       len = vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
+       len = g_vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
        arglist_end(args);
 
        if (len > -1 && (size_t)len < reply_buffer_size-1)
@@ -440,22 +427,22 @@ printf_arglist_function1(static void lreply, int, n, char *, fmt)
        reply_buffer = alloc(reply_buffer_size);
     }
 
-    if (fprintf(cmdout,"%03d-%s\r\n", n, reply_buffer) < 0)
+    if (g_fprintf(cmdout,"%03d-%s\r\n", n, reply_buffer) < 0)
     {
-       dbprintf(("%s: ! error %d (%s) in printf\n",
-                 debug_prefix_time(NULL), errno, strerror(errno)));
+       dbprintf(_("! error %d (%s) in printf\n"),
+                 errno, strerror(errno));
        uncompress_remove = remove_files(uncompress_remove);
        exit(1);
     }
     if (fflush(cmdout) != 0)
     {
-       dbprintf(("%s: ! error %d (%s) in fflush\n",
-                 debug_prefix_time(NULL), errno, strerror(errno)));
+       dbprintf(_("! error %d (%s) in fflush\n"),
+                 errno, strerror(errno));
        uncompress_remove = remove_files(uncompress_remove);
        exit(1);
     }
 
-    dbprintf(("%s: < %03d-%s\n", debug_prefix_time(NULL), n, reply_buffer));
+    dbprintf("< %03d-%s\n", n, reply_buffer);
 
 }
 
@@ -470,7 +457,7 @@ printf_arglist_function1(static void fast_lreply, int, n, char *, fmt)
 
     while(1) {
        arglist_start(args, fmt);
-       len = vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
+       len = g_vsnprintf(reply_buffer, reply_buffer_size, fmt, args);
        arglist_end(args);
 
        if (len > -1 && (size_t)len < reply_buffer_size-1)
@@ -481,15 +468,15 @@ printf_arglist_function1(static void fast_lreply, int, n, char *, fmt)
        reply_buffer = alloc(reply_buffer_size);
     }
 
-    if (fprintf(cmdout,"%03d-%s\r\n", n, reply_buffer) < 0)
+    if (g_fprintf(cmdout,"%03d-%s\r\n", n, reply_buffer) < 0)
     {
-       dbprintf(("%s: ! error %d (%s) in printf\n",
-                 debug_prefix_time(NULL), errno, strerror(errno)));
+       dbprintf(_("! error %d (%s) in printf\n"),
+                 errno, strerror(errno));
        uncompress_remove = remove_files(uncompress_remove);
        exit(1);
     }
 
-    dbprintf(("%s: < %03d-%s\n", debug_prefix_time(NULL), n, reply_buffer));
+    dbprintf("< %03d-%s\n", n, reply_buffer);
 }
 
 /* see if hostname is valid */
@@ -505,14 +492,14 @@ is_dump_host_valid(
     disk_t      *diskp;
 
     if (config_name == NULL) {
-       reply(501, "Must set config before setting host.");
+       reply(501, _("Must set config before setting host."));
        return NULL;
     }
 
     /* check that the config actually handles that host */
     ihost = lookup_host(host);
     if(ihost == NULL) {
-       reply(501, "Host %s is not in your disklist.", host);
+       reply(501, _("Host %s is not in your disklist."), host);
        return NULL;
     }
 
@@ -528,7 +515,8 @@ is_dump_host_valid(
        }
     }
 
-    reply(501, "No index records for host: %s. Have you enabled indexing?", host);
+    reply(501, _("No index records for host: %s. Have you enabled indexing?"),
+         host);
     return NULL;
 }
 
@@ -541,11 +529,11 @@ is_disk_valid(
     char *qdisk;
 
     if (config_name == NULL) {
-       reply(501, "Must set config,host before setting disk.");
+       reply(501, _("Must set config,host before setting disk."));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(501, "Must set host before setting disk.");
+       reply(501, _("Must set host before setting disk."));
        return -1;
     }
 
@@ -553,7 +541,7 @@ is_disk_valid(
     idisk = lookup_disk(dump_hostname, disk);
     if(idisk == NULL) {
        qdisk = quote_string(disk);
-       reply(501, "Disk %s:%s is not in your disklist.", dump_hostname, qdisk);
+       reply(501, _("Disk %s:%s is not in your disklist."), dump_hostname, qdisk);
        amfree(qdisk);
        return -1;
     }
@@ -561,7 +549,7 @@ is_disk_valid(
     /* assume an index dir already */
     if (get_index_dir(dump_hostname, idisk->hostname, disk) == 0) {
        qdisk = quote_string(disk);
-       reply(501, "No index records for disk: %s. Invalid?", qdisk);
+       reply(501, _("No index records for disk: %s. Invalid?"), qdisk);
        amfree(qdisk);
        return -1;
     }
@@ -571,10 +559,9 @@ is_disk_valid(
 
 
 static int
-is_config_valid(
+check_and_load_config(
     char *     config)
 {
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_indexdir;
@@ -582,58 +569,42 @@ is_config_valid(
 
     /* check that the config actually exists */
     if (config == NULL) {
-       reply(501, "Must set config first.");
+       reply(501, _("Must set config first."));
        return -1;
     }
 
-    /* read conffile */
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       reply(501, "Could not read config file %s!", conffile);
-       amfree(conffile);
+    /* (re-)initialize configuration with the new config name */
+    if (!config_init(CONFIG_INIT_EXPLICIT_NAME, config)) {
+       reply(501, _("Could not read config file for %s!"), config);
        return -1;
     }
-    amfree(conffile);
 
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    check_running_as(RUNNING_AS_DUMPUSER_PREFERRED);
+
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &disk_list) < 0) {
-       reply(501, "Could not read disk file %s!", conf_diskfile);
+       reply(501, _("Could not read disk file %s!"), conf_diskfile);
        amfree(conf_diskfile);
        return -1;
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-       reply(501, "Could not read tapelist file %s!", conf_tapelist);
+       reply(501, _("Could not read tapelist file %s!"), conf_tapelist);
        amfree(conf_tapelist);
        return -1;
     }
     amfree(conf_tapelist);
 
-    dbrename(config, DBG_SUBDIR_SERVER);
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    output_find = find_dump(1, &disk_list);
+    output_find = find_dump(&disk_list);
     sort_find_result("DLKHpB", &output_find);
 
-    conf_indexdir = getconf_str(CNF_INDEXDIR);
-    if(*conf_indexdir == '/') {
-       conf_indexdir = stralloc(conf_indexdir);
-    } else {
-       conf_indexdir = stralloc2(config_dir, conf_indexdir);
-    }
+    conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR));
     if (stat (conf_indexdir, &dir_stat) != 0 || !S_ISDIR(dir_stat.st_mode)) {
-       reply(501, "Index directory %s does not exist", conf_indexdir);
+       reply(501, _("Index directory %s does not exist"), conf_indexdir);
        amfree(conf_indexdir);
        return -1;
     }
@@ -654,15 +625,15 @@ build_disk_table(void)
     find_result_t *find_output;
 
     if (config_name == NULL) {
-       reply(590, "Must set config,host,disk before building disk table");
+       reply(590, _("Must set config,host,disk before building disk table"));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(590, "Must set host,disk before building disk table");
+       reply(590, _("Must set host,disk before building disk table"));
        return -1;
     }
     else if (disk_name == NULL) {
-       reply(590, "Must set disk before building disk table");
+       reply(590, _("Must set disk before building disk table"));
        return -1;
     }
 
@@ -678,8 +649,30 @@ build_disk_table(void)
           strcmp(disk_name    , find_output->diskname) == 0 &&
           strcmp("OK"         , find_output->status)   == 0) {
            int partnum = -1;
-           if(strcmp("--", find_output->partnum)){
+           int maxpart = -1;
+           if (strcmp("1/1", find_output->partnum) == 0) {
+               partnum = -1;
+           } else if (strcmp("1/-1", find_output->partnum) == 0) {
+               if (find_output->next &&
+                   strcmp(dump_hostname, find_output->next->hostname) == 0 &&
+                   strcmp(disk_name, find_output->next->diskname) == 0 &&
+                   strcmp(find_output->timestamp,
+                          find_output->next->timestamp) == 0 &&
+                   strcmp("OK", find_output->next->status) == 0 &&
+                   strcmp("2/-1", find_output->next->partnum) == 0) {
+                   partnum = 1;
+               }
+               else {
+                   partnum = -1;
+               }
+           } else if (strcmp("--", find_output->partnum)) {
+               char *c;
                partnum = atoi(find_output->partnum);
+               c = strchr(find_output->partnum,'/');
+               if (c)
+                   maxpart = atoi(c+1);
+               else
+                   maxpart = -1;
            }
            /*
             * The sort order puts holding disk entries first.  We want to
@@ -693,20 +686,31 @@ build_disk_table(void)
               partnum == last_partnum && last_filenum == 0) {
                continue;
            }
+           /* ignore duplicate partnum */
+           if(last_timestamp &&
+              strcmp(find_output->timestamp, last_timestamp) == 0 &&
+              find_output->level == last_level && 
+              partnum == last_partnum) {
+               continue;
+           }
            last_timestamp = find_output->timestamp;
            last_filenum = find_output->filenum;
            last_level = find_output->level;
            last_partnum = partnum;
            date = amindexd_nicedate(find_output->timestamp);
            add_dump(find_output->hostname, date, find_output->level,
-                    find_output->label, find_output->filenum, partnum);
-           dbprintf(("%s: - %s %d %s " OFF_T_FMT " %d\n",
-                    debug_prefix_time(NULL), date, find_output->level, 
+                    find_output->label, find_output->filenum, partnum,
+                    maxpart);
+           dbprintf("- %s %d %s %lld %d %d\n",
+                    date, find_output->level, 
                     find_output->label,
-                    (OFF_T_FMT_TYPE)find_output->filenum,
-                    partnum));
+                    (long long)find_output->filenum,
+                    partnum, maxpart);
        }
     }
+
+    clean_dump();
+
     return 0;
 }
 
@@ -718,19 +722,19 @@ disk_history_list(void)
     char date[20];
 
     if (config_name == NULL) {
-       reply(502, "Must set config,host,disk before listing history");
+       reply(502, _("Must set config,host,disk before listing history"));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(502, "Must set host,disk before listing history");
+       reply(502, _("Must set host,disk before listing history"));
        return -1;
     }
     else if (disk_name == NULL) {
-       reply(502, "Must set disk before listing history");
+       reply(502, _("Must set disk before listing history"));
        return -1;
     }
 
-    lreply(200, " Dump history for config \"%s\" host \"%s\" disk %s",
+    lreply(200, _(" Dump history for config \"%s\" host \"%s\" disk %s"),
          config_name, dump_hostname, qdisk_name);
 
     for (item=first_dump(); item!=NULL; item=next_dump(item)){
@@ -745,13 +749,13 @@ disk_history_list(void)
            lreply(201, " %s %d %s", date, item->level, tapelist_str);
        }
        else{
-           lreply(201, " %s %d %s " OFF_T_FMT, date, item->level,
-               tapelist_str, (OFF_T_FMT_TYPE)item->file);
+           lreply(201, " %s %d %s %lld", date, item->level,
+               tapelist_str, (long long)item->file);
        }
        amfree(tapelist_str);
     }
 
-    reply(200, "Dump history for config \"%s\" host \"%s\" disk %s",
+    reply(200, _("Dump history for config \"%s\" host \"%s\" disk %s"),
          config_name, dump_hostname, qdisk_name);
 
     return 0;
@@ -778,19 +782,19 @@ is_dir_valid_opaque(
     static char *emsg = NULL;
 
     if (config_name == NULL || dump_hostname == NULL || disk_name == NULL) {
-       reply(502, "Must set config,host,disk before asking about directories");
+       reply(502, _("Must set config,host,disk before asking about directories"));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(502, "Must set host,disk before asking about directories");
+       reply(502, _("Must set host,disk before asking about directories"));
        return -1;
     }
     else if (disk_name == NULL) {
-       reply(502, "Must set disk before asking about directories");
+       reply(502, _("Must set disk before asking about directories"));
        return -1;
     }
     else if (target_date == NULL) {
-       reply(502, "Must set date before asking about directories");
+       reply(502, _("Must set date before asking about directories"));
        return -1;
     }
     /* scan through till we find first dump on or before date */
@@ -801,7 +805,7 @@ is_dir_valid_opaque(
     if (item == NULL)
     {
        /* no dump for given date */
-       reply(500, "No dumps available on or before date \"%s\"", target_date);
+       reply(500, _("No dumps available on or before date \"%s\""), target_date);
        return -1;
     }
 
@@ -824,16 +828,16 @@ is_dir_valid_opaque(
            return -1;
        }
        if((filename = uncompress_file(filename_gz, &emsg)) == NULL) {
-           reply(599, "System error %s", emsg);
+           reply(599, _("System error %s"), emsg);
            amfree(filename_gz);
            amfree(emsg);
            amfree(ldir);
            return -1;
        }
        amfree(filename_gz);
-       dbprintf(("%s: f %s\n", debug_prefix_time(NULL), filename));
+       dbprintf("f %s\n", filename);
        if ((fp = fopen(filename, "r")) == NULL) {
-           reply(599, "System error %s", strerror(errno));
+           reply(599, _("System error %s"), strerror(errno));
            amfree(filename);
            amfree(ldir);
            return -1;
@@ -862,7 +866,7 @@ is_dir_valid_opaque(
 
     amfree(filename);
     amfree(ldir);
-    reply(500, "\"%s\" is an invalid directory", dir);
+    reply(500, _("\"%s\" is an invalid directory"), dir);
     return -1;
 }
 
@@ -886,19 +890,19 @@ opaque_ls(
     clear_dir_list();
 
     if (config_name == NULL) {
-       reply(502, "Must set config,host,disk before listing a directory");
+       reply(502, _("Must set config,host,disk before listing a directory"));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(502, "Must set host,disk before listing a directory");
+       reply(502, _("Must set host,disk before listing a directory"));
        return -1;
     }
     else if (disk_name == NULL) {
-       reply(502, "Must set disk before listing a directory");
+       reply(502, _("Must set disk before listing a directory"));
        return -1;
     }
     else if (target_date == NULL) {
-       reply(502, "Must set date before listing a directory");
+       reply(502, _("Must set date before listing a directory"));
        return -1;
     }
 
@@ -910,13 +914,13 @@ opaque_ls(
     if (dump_item == NULL)
     {
        /* no dump for given date */
-       reply(500, "No dumps available on or before date \"%s\"", target_date);
+       reply(500, _("No dumps available on or before date \"%s\""), target_date);
        return -1;
     }
 
     /* get data from that dump */
     if (process_ls_dump(dir, dump_item, recursive, &emsg) == -1) {
-       reply(599, "System error %s", emsg);
+       reply(599, _("System error %s"), emsg);
        amfree(emsg);
        return -1;
     }
@@ -929,7 +933,7 @@ opaque_ls(
        {
            last_level = dump_item->level;
            if (process_ls_dump(dir, dump_item, recursive, &emsg) == -1) {
-               reply(599, "System error %s", emsg);
+               reply(599, _("System error %s"), emsg);
                amfree(emsg);
                return -1;
            }
@@ -937,7 +941,7 @@ opaque_ls(
     }
 
     /* return the information to the caller */
-    lreply(200, " Opaque list of %s", dir);
+    lreply(200, _(" Opaque list of %s"), dir);
     for(level=0; level<=9; level++) {
        for (dir_item = get_dir_list(); dir_item != NULL; 
             dir_item = dir_item->next) {
@@ -946,8 +950,8 @@ opaque_ls(
                if (!am_has_feature(their_features, marshall_feature) &&
                    (num_entries(dir_item->dump->tapes) > 1 ||
                    dir_item->dump->tapes->numfiles > 1)) {
-                   fast_lreply(501, " ERROR: Split dumps not supported"
-                               " with old version of amrecover.");
+                   fast_lreply(501, _(" ERROR: Split dumps not supported"
+                               " with old version of amrecover."));
                    break;
                }
                else {
@@ -956,7 +960,7 @@ opaque_ls(
            }
        }
     }
-    reply(200, " Opaque list of %s", dir);
+    reply(200, _(" Opaque list of %s"), dir);
 
     clear_dir_list();
     return 0;
@@ -987,11 +991,11 @@ void opaque_ls_one(
                                     fe_amindexd_fileno_in_OLSD)) ||
        (recursive && am_has_feature(their_features,
                                    fe_amindexd_fileno_in_ORLD))) {
-       fast_lreply(201, " %s %d %s " OFF_T_FMT " %s",
+       fast_lreply(201, " %s %d %s %lld %s",
                    date,
                    dir_item->dump->level,
                    tapelist_str,
-                   (OFF_T_FMT_TYPE)dir_item->dump->file,
+                   (long long)dir_item->dump->file,
                    qpath);
     }
     else {
@@ -1018,38 +1022,35 @@ tapedev_is(void)
 
     /* check state okay to do this */
     if (config_name == NULL) {
-       reply(501, "Must set config before asking about tapedev.");
+       reply(501, _("Must set config before asking about tapedev."));
        return -1;
     }
 
     /* use amrecover_changer if possible */
     if ((result = getconf_str(CNF_AMRECOVER_CHANGER)) != NULL  &&
         *result != '\0') {
-       dbprintf(("%s: tapedev_is amrecover_changer: %s\n",
-                  debug_prefix_time(NULL), result));
+       dbprintf(_("tapedev_is amrecover_changer: %s\n"), result);
        reply(200, result);
        return 0;
     }
 
     /* use changer if possible */
     if ((result = getconf_str(CNF_TPCHANGER)) != NULL  &&  *result != '\0') {
-       dbprintf(("%s: tapedev_is tpchanger: %s\n",
-                  debug_prefix_time(NULL), result));
+       dbprintf(_("tapedev_is tpchanger: %s\n"), result);
        reply(200, result);
        return 0;
     }
 
     /* get tapedev value */
     if ((result = getconf_str(CNF_TAPEDEV)) != NULL  &&  *result != '\0') {
-       dbprintf(("%s: tapedev_is tapedev: %s\n",
-                  debug_prefix_time(NULL), result));
+       dbprintf(_("tapedev_is tapedev: %s\n"), result);
        reply(200, result);
        return 0;
     }
 
-    dbprintf(("%s: No tapedev or tpchanger in config site.\n",
-              debug_prefix_time(NULL)));
-    reply(501, "Tapedev or tpchanger not set in config file.");
+    dbprintf(_("No tapedev or tpchanger in config site.\n"));
+
+    reply(501, _("Tapedev or tpchanger not set in config file."));
     return -1;
 }
 
@@ -1062,15 +1063,15 @@ are_dumps_compressed(void)
 
     /* check state okay to do this */
     if (config_name == NULL) {
-       reply(501, "Must set config,host,disk name before asking about dumps.");
+       reply(501, _("Must set config,host,disk name before asking about dumps."));
        return -1;
     }
     else if (dump_hostname == NULL) {
-       reply(501, "Must set host,disk name before asking about dumps.");
+       reply(501, _("Must set host,disk name before asking about dumps."));
        return -1;
     }
     else if (disk_name == NULL) {
-       reply(501, "Must set disk name before asking about dumps.");
+       reply(501, _("Must set disk name before asking about dumps."));
        return -1;
     }
 
@@ -1083,7 +1084,7 @@ are_dumps_compressed(void)
     }
 
     if (diskp == NULL) {
-       reply(501, "Couldn't find host/disk in disk file.");
+       reply(501, _("Couldn't find host/disk in disk file."));
        return -1;
     }
 
@@ -1114,6 +1115,16 @@ main(
     char *errstr = NULL;
     char *pgm = "amindexd";            /* in case argv[0] is not set */
     char his_hostname[MAX_HOSTNAME_LENGTH];
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(DATA_FD_OFFSET, 2);
     safe_cd();
@@ -1137,43 +1148,18 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-#ifdef FORCE_USERID
-
-    /* we'd rather not run as root */
-
-    if(geteuid() == 0) {
-       if(client_uid == (uid_t) -1) {
-           error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-           /*NOTREACHED*/
-       }
-
-       /*@ignore@*/
-       initgroups(CLIENT_LOGIN, client_gid);
-       /*@end@*/
-       setgid(client_gid);
-       setuid(client_uid);
-    }
-
-#endif /* FORCE_USERID */
-
     dbopen(DBG_SUBDIR_SERVER);
-    dbprintf(("%s: version %s\n", get_pname(), version()));
+    dbprintf(_("version %s\n"), version());
 
     if(argv == NULL) {
        error("argv == NULL\n");
     }
 
     if (! (argc >= 1 && argv[0] != NULL)) {
-       dbprintf(("%s: WARNING: argv[0] not defined: check inetd.conf\n",
-                 debug_prefix_time(NULL)));
+       dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n"));
     }
 
-    {
-       int db_fd = dbfd();
-       if(db_fd != -1) {
-           dup2(db_fd, 2);
-       }
-    }
+    debug_dup_stderr_to_debug();
 
     /* initialize */
 
@@ -1202,14 +1188,13 @@ main(
     }
 
     if (argc > 0) {
-       config_name = stralloc(*argv);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
+       cfg_opt = *argv;
        argc--;
        argv++;
     }
 
     if(gethostname(local_hostname, SIZEOF(local_hostname)-1) == -1) {
-       error("gethostname: %s", strerror(errno));
+       error(_("gethostname: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     local_hostname[SIZEOF(local_hostname)-1] = '\0';
@@ -1226,7 +1211,7 @@ main(
            /* who are we talking to? */
            socklen = sizeof (his_addr);
            if (getpeername(0, (struct sockaddr *)&his_addr, &socklen) == -1)
-               error("getpeername: %s", strerror(errno));
+               error(_("getpeername: %s"), strerror(errno));
 
            /* Try a reverse (IP->hostname) resolution, and fail if it does
             * not work -- this is a basic security check */
@@ -1260,16 +1245,16 @@ main(
 
        if(amandad_auth && g_options->auth) {
            if(strcasecmp(amandad_auth, g_options->auth) != 0) {
-               printf("ERROR recover program ask for auth=%s while amindexd is configured for '%s'\n",
+               g_printf(_("ERROR recover program ask for auth=%s while amindexd is configured for '%s'\n"),
                       g_options->auth, amandad_auth);
-               error("amindexd: ERROR recover program ask for auth=%s while amindexd is configured for '%s'",
+               error(_("amindexd: ERROR recover program ask for auth=%s while amindexd is configured for '%s'"),
                      g_options->auth, amandad_auth);
                /*NOTREACHED*/
            }
        }
        /* send the REP packet */
-       printf("CONNECT MESG %d\n", DATA_FD_OFFSET);
-       printf("\n");
+       g_printf("CONNECT MESG %d\n", DATA_FD_OFFSET);
+       g_printf("\n");
        fflush(stdin);
        fflush(stdout);
        fclose(stdin);
@@ -1297,11 +1282,11 @@ main(
     our_features = am_init_feature_set();
     their_features = am_set_default_feature_set();
 
-    if (config_name != NULL && is_config_valid(config_name) != -1) {
+    if (cfg_opt != NULL && check_and_load_config(cfg_opt) != -1) { /* load the config */
        return 1;
     }
 
-    reply(220, "%s AMANDA index server (%s) ready.", local_hostname,
+    reply(220, _("%s AMANDA index server (%s) ready."), local_hostname,
          version());
 
     user_validated = from_amandad;
@@ -1313,18 +1298,15 @@ main(
        while(1) {
            if((part = agets(cmdin)) == NULL) {
                if(errno != 0) {
-                   dbprintf(("%s: ? read error: %s\n",
-                             debug_prefix_time(NULL), strerror(errno)));
+                   dbprintf(_("? read error: %s\n"), strerror(errno));
                } else {
-                   dbprintf(("%s: ? unexpected EOF\n",
-                             debug_prefix_time(NULL)));
+                   dbprintf(_("? unexpected EOF\n"));
                }
                if(line) {
-                   dbprintf(("%s: ? unprocessed input:\n",
-                             debug_prefix_time(NULL)));
-                   dbprintf(("-----\n"));
-                   dbprintf(("? %s\n", line));
-                   dbprintf(("-----\n"));
+                   dbprintf(_("? unprocessed input:\n"));
+                   dbprintf("-----\n");
+                   dbprintf("? %s\n", line);
+                   dbprintf("-----\n");
                }
                amfree(line);
                amfree(part);
@@ -1350,7 +1332,7 @@ main(
            strappend(line, "\n");
        }
 
-       dbprintf(("%s: > %s\n", debug_prefix_time(NULL), line));
+       dbprintf("> %s\n", line);
 
        if (arg != NULL)
            amfree(arg);
@@ -1359,7 +1341,7 @@ main(
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
-           reply(500, "Command not recognised/incorrect: %s", line);
+           reply(500, _("Command not recognised/incorrect: %s"), line);
            amfree(line);
            continue;
        }
@@ -1385,15 +1367,15 @@ main(
                                        (struct sockaddr_storage *)&his_addr,
                                        arg, 0, &errstr);
            if(user_validated) {
-               reply(200, "Access OK");
+               reply(200, _("Access OK"));
                amfree(line);
                continue;
            }
        }
        if (!user_validated) {  /* don't tell client the reason, just log it to debug log */
-           reply(500, "Access not allowed");
+           reply(500, _("Access not allowed"));
            if (errstr) {   
-               dbprintf(("%s: %s\n", debug_prefix_time(NULL), errstr));
+               dbprintf("%s\n", errstr);
            }
            break;
        }
@@ -1408,7 +1390,7 @@ main(
            if ((lhost = is_dump_host_valid(arg)) != NULL)
            {
                dump_hostname = newstralloc(dump_hostname, lhost->hostname);
-               reply(200, "Dump host set to %s.", dump_hostname);
+               reply(200, _("Dump host set to %s."), dump_hostname);
                amfree(qdisk_name);             /* invalidate any value */
                amfree(disk_name);              /* invalidate any value */
            }
@@ -1420,10 +1402,10 @@ main(
                 found = 0;
            s[-1] = '\0';
            if (config_name == NULL) {
-               reply(501, "Must set config before listhost");
+               reply(501, _("Must set config before listhost"));
            }
            else {
-               lreply(200, " List hosts for config %s", config_name);
+               lreply(200, _(" List hosts for config %s"), config_name);
                for (disk = disk_list.head; disk!=NULL; disk = disk->next) {
                     found = 0;
                    for (diskdup = disk_list.head; diskdup!=disk; diskdup = diskdup->next) {
@@ -1438,10 +1420,10 @@ main(
                     }
                }
                if(nbhost > 0) {
-                   reply(200, " List hosts for config %s", config_name);
+                   reply(200, _(" List hosts for config %s"), config_name);
                }
                else {
-                   reply(200, "No hosts for config %s", config_name);
+                   reply(200, _("No hosts for config %s"), config_name);
                }
            }
            s[-1] = (char)ch;
@@ -1451,7 +1433,7 @@ main(
                disk_name = newstralloc(disk_name, arg);
                qdisk_name = quote_string(disk_name);
                if (build_disk_table() != -1) {
-                   reply(200, "Disk set to %s.", qdisk_name);
+                   reply(200, _("Disk set to %s."), qdisk_name);
                }
            }
            s[-1] = (char)ch;
@@ -1461,13 +1443,13 @@ main(
            int nbdisk = 0;
            s[-1] = '\0';
            if (config_name == NULL) {
-               reply(501, "Must set config, host before listdisk");
+               reply(501, _("Must set config, host before listdisk"));
            }
            else if (dump_hostname == NULL) {
-               reply(501, "Must set host before listdisk");
+               reply(501, _("Must set host before listdisk"));
            }
            else if(arg) {
-               lreply(200, " List of disk for device %s on host %s", arg,
+               lreply(200, _(" List of disk for device %s on host %s"), arg,
                       dump_hostname);
                for (disk = disk_list.head; disk!=NULL; disk = disk->next) {
 
@@ -1481,16 +1463,16 @@ main(
                    }
                }
                if(nbdisk > 0) {
-                   reply(200, "List of disk for device %s on host %s", arg,
+                   reply(200, _("List of disk for device %s on host %s"), arg,
                          dump_hostname);
                }
                else {
-                   reply(200, "No disk for device %s on host %s", arg,
+                   reply(200, _("No disk for device %s on host %s"), arg,
                          dump_hostname);
                }
            }
            else {
-               lreply(200, " List of disk for host %s", dump_hostname);
+               lreply(200, _(" List of disk for host %s"), dump_hostname);
                for (disk = disk_list.head; disk!=NULL; disk = disk->next) {
                    if(strcasecmp(disk->host->hostname, dump_hostname) == 0) {
                        qname = quote_string(disk->name);
@@ -1500,28 +1482,21 @@ main(
                    }
                }
                if(nbdisk > 0) {
-                   reply(200, "List of disk for host %s", dump_hostname);
+                   reply(200, _("List of disk for host %s"), dump_hostname);
                }
                else {
-                   reply(200, "No disk for host %s", dump_hostname);
+                   reply(200, _("No disk for host %s"), dump_hostname);
                }
            }
            s[-1] = (char)ch;
        } else if (strcmp(cmd, "SCNF") == 0 && arg) {
            s[-1] = '\0';
-           amfree(config_name);
-           amfree(config_dir);
-           config_name = newstralloc(config_name, arg);
-           config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-           if (is_config_valid(arg) != -1) {
+           if (check_and_load_config(arg) != -1) {    /* try to load the new config */
                amfree(dump_hostname);          /* invalidate any value */
                amfree(qdisk_name);             /* invalidate any value */
                amfree(disk_name);              /* invalidate any value */
-               reply(200, "Config set to %s.", config_name);
-           } else {
-               amfree(config_name);
-               amfree(config_dir);
-           }
+               reply(200, _("Config set to %s."), config_name);
+           } /* check_and_load_config replies with any failure messages */
            s[-1] = (char)ch;
        } else if (strcmp(cmd, "FEATURES") == 0 && arg) {
            char *our_feature_string = NULL;
@@ -1540,13 +1515,13 @@ main(
        } else if (strcmp(cmd, "DATE") == 0 && arg) {
            s[-1] = '\0';
            target_date = newstralloc(target_date, arg);
-           reply(200, "Working date set to %s.", target_date);
+           reply(200, _("Working date set to %s."), target_date);
            s[-1] = (char)ch;
        } else if (strcmp(cmd, "DHST") == 0) {
            (void)disk_history_list();
        } else if (strcmp(cmd, "OISD") == 0 && arg) {
            if (is_dir_valid_opaque(arg) != -1) {
-               reply(200, "\"%s\" is a valid directory", arg);
+               reply(200, _("\"%s\" is a valid directory"), arg);
            }
        } else if (strcmp(cmd, "OLSD") == 0 && arg) {
            (void)opaque_ls(arg,0);
@@ -1558,7 +1533,7 @@ main(
            (void)are_dumps_compressed();
        } else {
            *cmd_undo = cmd_undo_ch;    /* restore the command line */
-           reply(500, "Command not recognised/incorrect: %s", cmd);
+           reply(500, _("Command not recognised/incorrect: %s"), cmd);
        }
        amfree(line);
     }
@@ -1566,7 +1541,7 @@ main(
     
     uncompress_remove = remove_files(uncompress_remove);
     free_find_result(&output_find);
-    reply(200, "Good bye.");
+    reply(200, _("Good bye."));
     dbclose();
     return 0;
 }
@@ -1589,7 +1564,7 @@ amindexd_nicedate(
     day   = numdate % 100;
 
     if(strlen(datestamp) <= 8) {
-       snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d",
+       g_snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d",
                year, month, day);
     }
     else {
@@ -1600,7 +1575,7 @@ amindexd_nicedate(
        minutes = (numtime / 100) % 100;
        seconds = numtime % 100;
 
-       snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d-%02d-%02d-%02d",
+       g_snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d-%02d-%02d-%02d",
                year, month, day, hours, minutes, seconds);
     }
 
@@ -1628,9 +1603,9 @@ clean_backslash(
            s++;
            s1 = s+1;
            s2 = s+2;
-           if (*s != '\0' && isdigit(*s) &&
-               *s1 != '\0' && isdigit(*s1) &&
-               *s2 != '\0' &&  isdigit(*s2)) {
+           if (*s != '\0' && isdigit((int)*s) &&
+               *s1 != '\0' && isdigit((int)*s1) &&
+               *s2 != '\0' &&  isdigit((int)*s2)) {
                /* this is \000, an octal value */
                i = ((*s)-'0')*64 + ((*s1)-'0')*8 + ((*s2)-'0');
                *p++ = i;
index 1ead3ae917d86f42a8ef2409c2728e64f80431f5..0eda70b62afdc5bd3f45c7f7b6a2424be322ae78 100644 (file)
 #include "amanda.h"
 #include "conffile.h"
 #include "tapefile.h"
-#include "tapeio.h"
 #include "changer.h"
-
-#ifdef HAVE_LIBVTBLC
-#include <vtblc.h>
-#endif /* HAVE_LIBVTBLC */
+#include <device.h>
+#include <timestamp.h>
+#include <taperscan.h>
 
 /* local functions */
 
 int main(int argc, char **argv);
-void usage(void);
 
-void
-usage(void)
-{
-    fprintf(stderr, "Usage: %s [-f] <conf> <label> [slot <slot-number>] [-o configoption]*\n",
+static void usage(void) {
+    g_fprintf(stderr, _("Usage: %s [-f] <conf> <label> [slot <slot-number>] [-o configoption]*\n"),
            get_pname());
     exit(1);
 }
 
+static void print_read_label_status_error(ReadLabelStatusFlags status) {
+    char ** status_strv;
+
+    if (status == READ_LABEL_STATUS_SUCCESS)
+        return;
+
+    status_strv = g_flags_nick_to_strv(status,
+                                       READ_LABEL_STATUS_FLAGS_TYPE);
+    g_assert(g_strv_length(status_strv) > 0);
+    if (g_strv_length(status_strv) == 1) {
+        g_printf("Error was %s.\n", *status_strv);
+    } else {
+        char * status_list = g_english_strjoinv(status_strv, "or");
+        g_printf("Error was one of %s.\n", status_list);
+        amfree(status_list);
+    }
+    g_strfreev(status_strv);
+}
+
 int
 main(
     int                argc,
     char **    argv)
 {
-    char *conffile;
     char *conf_tapelist;
     char *outslot = NULL;
-    char *errstr = NULL, *label, *oldlabel=NULL, *tapename = NULL;
+    char *label, *tapename = NULL;
     char *labelstr, *slotstr;
-    char *olddatestamp=NULL;
     char *conf_tapelist_old;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-#ifdef HAVE_LINUX_ZFTAPE_H
-    int fd = -1;
-    int isa_zftape;
-#endif /* HAVE_LINUX_ZFTAPE_H */
     int have_changer;
     int force, tape_ok;
     tapetype_t *tape;
     size_t tt_blocksize_kb;
     int slotcommand;
-    uid_t uid_me;
-    uid_t uid_dumpuser;
-    char *dumpuser;
-    struct passwd *pw;
-    int    new_argc;
-    char **new_argv;
-
-#ifdef HAVE_LIBVTBLC
-    int vtbl_no      = -1;
-    char *datestr    = NULL;
-    char *rawtapedev = NULL;
-    int first_seg, last_seg;
-#endif /* HAVE_LIBVTBLC */
+    Device * device;
+    ReadLabelStatusFlags label_status;
+    char *cfg_opt = NULL;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
@@ -94,87 +100,59 @@ main(
     set_pname("amlabel");
 
     dbopen(DBG_SUBDIR_SERVER);
+    device_api_init();
 
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if(new_argc > 1 && strcmp(new_argv[1],"-f") == 0)
+    if(argc > 1 && strcmp(argv[1],"-f") == 0)
         force=1;
     else force=0;
 
-    if(new_argc != 3+force && new_argc != 5+force)
+    if(argc != 3+force && argc != 5+force)
        usage();
 
-    config_name = new_argv[1+force];
-    label = new_argv[2+force];
+    cfg_opt = argv[1+force];
+    label = argv[2+force];
 
-    if(new_argc == 5+force) {
-       if(strcmp(new_argv[3+force], "slot"))
+    if(argc == 5+force) {
+       if(strcmp(argv[3+force], "slot"))
            usage();
-       slotstr = new_argv[4+force];
+       slotstr = argv[4+force];
        slotcommand = 1;
     } else {
        slotstr = "current";
        slotcommand = 0;
     }
 
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-    dbrename(config_name, DBG_SUBDIR_SERVER);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
-    report_bad_conf_arg();
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if (read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
-       /*NOTREACHED*/
-    }
-
-    uid_me = getuid();
-    uid_dumpuser = uid_me;
-    dumpuser = getconf_str(CNF_DUMPUSER);
-
-    if ((pw = getpwnam(dumpuser)) == NULL) {
-       error("cannot look up dump user \"%s\"", dumpuser);
-       /*NOTREACHED*/
-    }
-    uid_dumpuser = pw->pw_uid;
-    if ((pw = getpwuid(uid_me)) == NULL) {
-       error("cannot look up my own uid %ld", (long)uid_me);
-       /*NOTREACHED*/
-    }
-    if (uid_me != uid_dumpuser) {
-       error("running as user \"%s\" instead of \"%s\"",
-             pw->pw_name, dumpuser);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
 
     labelstr = getconf_str(CNF_LABELSTR);
 
     if(!match(labelstr, label)) {
-       error("label %s doesn't match labelstr \"%s\"", label, labelstr);
+       error(_("label %s doesn't match labelstr \"%s\""), label, labelstr);
        /*NOTREACHED*/
     }
 
     if((lookup_tapelabel(label))!=NULL) {
        if(!force) {
-           error("label %s already on a tape\n",label);
+           error(_("label %s already on a tape\n"),label);
            /*NOTREACHED*/
        }
     }
@@ -183,310 +161,127 @@ main(
 
     if((have_changer = changer_init()) == 0) {
        if(slotcommand) {
-           fprintf(stderr,
-            "%s: no tpchanger specified in \"%s\", so slot command invalid\n",
-                   new_argv[0], conffile);
+           g_fprintf(stderr,
+            _("%s: no tpchanger specified in \"%s\", so slot command invalid\n"),
+                   argv[0], config_filename);
            usage();
        }
        tapename = getconf_str(CNF_TAPEDEV);
        if (tapename == NULL) {
-           error("No tapedev specified");
-       } else {
-           tapename = stralloc(tapename);
+           error(_("No tapedev specified"));
        }
-#ifdef HAVE_LIBVTBLC
-       rawtapedev = stralloc(getconf_str(CNF_RAWTAPEDEV));
-#endif /* HAVE_LIBVTBLC */
     } else if(have_changer != 1) {
-       error("changer initialization failed: %s", strerror(errno));
+       error(_("changer initialization failed: %s"), strerror(errno));
        /*NOTREACHED*/
     } else {
        if(changer_loadslot(slotstr, &outslot, &tapename)) {
-           error("could not load slot \"%s\": %s", slotstr, changer_resultstr);
+           error(_("could not load slot \"%s\": %s"), slotstr, changer_resultstr);
            /*NOTREACHED*/
        }
 
-       printf("labeling tape in slot %s (%s):\n", outslot, tapename);
-    }
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-    isa_zftape = is_zftape(tapename);
-    if (isa_zftape) {
-       if((fd = tape_open(tapename, O_WRONLY)) == -1) {
-           errstr = newstralloc2(errstr, "amlabel: ",
-                                 (errno == EACCES) ? "tape is write-protected"
-                                 : strerror(errno));
-           error(errstr);
-           /*NOTREACHED*/
-       }
-    }
-#endif /* HAVE_LINUX_ZFTAPE_H */
-
-    printf("rewinding"); fflush(stdout);
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-    if (isa_zftape) {
-       if(tapefd_rewind(fd) == -1) {
-           putchar('\n');
-           error(strerror(errno));
-           /*NOTREACHED*/
-       }
-    }
-    else
-#endif /* HAVE_LINUX_ZFTAPE_H */
-    if((errstr = tape_rewind(tapename)) != NULL) {
-       putchar('\n');
-       error(errstr);
-       /*NOTREACHED*/
+       g_printf(_("labeling tape in slot %s (%s):\n"), outslot, tapename);
     }
 
     tape_ok=1;
-    printf(", reading label");fflush(stdout);
-    if((errstr = tape_rdlabel(tapename, &olddatestamp, &oldlabel)) != NULL) {
-       printf(", %s\n",errstr);
-       tape_ok=1;
+    g_printf("Reading label...\n");fflush(stdout);
+    device = device_open(tapename);
+    if (device == NULL) {
+        error("Could not open device %s.\n", tapename);
     }
-    else {
+    
+    device_set_startup_properties_from_config(device);
+    label_status = device_read_label(device);
+
+    if (label_status & READ_LABEL_STATUS_VOLUME_UNLABELED) {
+        g_printf("Found an unlabeled tape.\n");
+    } else if (label_status != READ_LABEL_STATUS_SUCCESS) {
+        g_printf("Reading the tape label failed: \n  ");
+        print_read_label_status_error(label_status);
+        tape_ok = 0;
+    } else {
        /* got an amanda tape */
-       printf(" %s",oldlabel);
-       if(strcmp(oldlabel, FAKE_LABEL) != 0
-          && match(labelstr, oldlabel) == 0) {
-           printf(", tape is in another amanda configuration");
+       g_printf(_("Found Amanda tape %s"),device->volume_label);
+       if(match(labelstr, device->volume_label) == 0) {
+           g_printf(_(", but it is not from configuration %s."), config_name);
            if(!force)
                tape_ok=0;
-       }
-       else {
-           if((lookup_tapelabel(oldlabel)) != NULL) {
-               printf(", tape is active");
+       } else {
+           if((lookup_tapelabel(device->volume_label)) != NULL) {
+               g_printf(_(", tape is active"));
                if(!force)
                    tape_ok=0;
            }
        }
-       printf("\n");
-    }
-    amfree(oldlabel);
-    amfree(olddatestamp);
-       
-    printf("rewinding"); fflush(stdout);
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-    if (isa_zftape) {
-       if(tapefd_rewind(fd) == -1) {
-           putchar('\n');
-           error(strerror(errno));
-           /*NOTREACHED*/
-       }
-    }
-    else
-#endif /* HAVE_LINUX_ZFTAPE_H */
-    if((errstr = tape_rewind(tapename)) != NULL) {
-       putchar('\n');
-       error(errstr);
-       /*NOTREACHED*/
+       g_printf("\n");
     }
 
     if(tape_ok) {
-       printf(", writing label %s", label); fflush(stdout);
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-       if (isa_zftape) {
-           errstr = tapefd_wrlabel(fd, "X", label,
-                                   (tt_blocksize_kb * 1024));
-           if(errstr != NULL) {
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-       }
-       else
-#endif /* HAVE_LINUX_ZFTAPE_H */
-       errstr = tape_wrlabel(tapename, "X", label,
-                             (tt_blocksize_kb * 1024));
-       if(errstr != NULL) {
-           putchar('\n');
-           error(errstr);
-           /*NOTREACHED*/
-       }
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-       if (isa_zftape) {
-           tapefd_weof(fd, (off_t)1);
-       }
-#endif /* HAVE_LINUX_ZFTAPE_H */
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-       if (isa_zftape) {
-           errstr = tapefd_wrendmark(fd, "X",
-                                     (tt_blocksize_kb * 1024));
-           if(errstr != NULL) {
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-       }
-       else
-#endif /* HAVE_LINUX_ZFTAPE_H */
-       errstr = tape_wrendmark(tapename, "X",
-                               (tt_blocksize_kb * 1024));
-       if(errstr != NULL) {
-           putchar('\n');
-           error(errstr);
-           /*NOTREACHED*/
-       }
-
-#ifdef HAVE_LINUX_ZFTAPE_H
-       if (isa_zftape) {
-           tapefd_weof(fd, (off_t)1);
-
-           printf(",\nrewinding"); fflush(stdout); 
-     
-           if(tapefd_rewind(fd) == -1) { 
-               putchar('\n'); 
-               error(strerror(errno)); 
-               /*NOTREACHED*/
-           } 
-           close(fd);
-#ifdef HAVE_LIBVTBLC
-           /* update volume table */
-           printf(", updating volume table"); fflush(stdout);
-    
-           if ((fd = raw_tape_open(rawtapedev, O_RDWR)) == -1) {
-               if(errno == EACCES) {
-                   errstr = newstralloc(errstr,
-                                        "updating volume table: raw tape device is write protected");
-               } else {
-                   errstr = newstralloc2(errstr,
-                                         "updating volume table: ", strerror(errno));
-               }
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           /* read volume table */
-           if ((num_volumes = read_vtbl(fd, volumes, vtbl_buffer,
-                                        &first_seg, &last_seg)) == -1 ) {
-               errstr = newstralloc2(errstr,
-                                     "reading volume table: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           /* set date and volume label for first entry */
-           vtbl_no = 0;
-           datestr = NULL; 
-           if (set_date(datestr, volumes, num_volumes, vtbl_no)){
-               errstr = newstralloc2(errstr,
-                                     "setting date for entry 1: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           if(set_label(label, volumes, num_volumes, vtbl_no)){
-               errstr = newstralloc2(errstr,
-                                     "setting label for entry 1: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           /* set date and volume label for last entry */
-           vtbl_no = 1;
-           datestr = NULL; 
-           if (set_date(datestr, volumes, num_volumes, vtbl_no)){
-               errstr = newstralloc2(errstr,
-                                     "setting date for entry 2: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           if(set_label("AMANDA Tape End", volumes, num_volumes, vtbl_no)){
-               errstr = newstralloc2(errstr,
-                                     "setting label for entry 2: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }
-           /* write volume table back */
-           if (write_vtbl(fd, volumes, vtbl_buffer, num_volumes, first_seg,
-                          op_mode == trunc)) {
-               errstr = newstralloc2(errstr,
-                                     "writing volume table: ", strerror(errno));
-               putchar('\n');
-               error(errstr);
-               /*NOTREACHED*/
-           }  
-           close(fd);
-#endif /* HAVE_LIBVTBLC */
-       }
-#endif /* HAVE_LINUX_ZFTAPE_H */
-
-       if (tape_ok) {
-           printf(", checking label"); fflush(stdout);
-
-           if((errstr = tape_rdlabel(tapename, &olddatestamp, &oldlabel)) != NULL) {
-               putchar('\n');
-               if (strcmp(errstr, "not an amanda tape") != 0) {
-                   error(errstr);
-                   /*NOTREACHED*/
-               }
-               error("no label found, are you sure %s is non-rewinding?",
-                     tapename);
-               /*NOTREACHED*/
-           }
-
-           if (strcmp("X", olddatestamp) != 0 ||
-               (strcmp(oldlabel, FAKE_LABEL) != 0
-                && strcmp(label, oldlabel) != 0)) {
-               putchar('\n');
-               error("read label %s back, timestamp %s (expected X), what now?",
-                     oldlabel, olddatestamp);
-               /*NOTREACHED*/
-           }
-           amfree(oldlabel);
-           amfree(olddatestamp);
-
-           /* write tape list */
-
-           /* make a copy */
-                   conf_tapelist_old = stralloc2(conf_tapelist, ".amlabel");
-           if(write_tapelist(conf_tapelist_old)) {
-               error("couldn't write tapelist: %s", strerror(errno));
-               /*NOTREACHED*/
-           }
-           amfree(conf_tapelist_old);
-
-           /* XXX add cur_tape number to tape list structure */
-           remove_tapelabel(label);
-           add_tapelabel("0", label);
-           if(write_tapelist(conf_tapelist)) {
-               error("couldn't write tapelist: %s", strerror(errno));
-               /*NOTREACHED*/
-           }
-
-            if (have_changer) {
-                changer_label(outslot, label);
-            }
-       } /* write tape list */
-       printf(", done.\n");
+       char *timestamp = NULL;
+
+       g_printf(_("Writing label %s..\n"), label); fflush(stdout);
+        
+       timestamp = get_undef_timestamp();
+        if (!device_start(device, ACCESS_WRITE, label, timestamp)) {
+           error(_("Error writing label.\n"));
+            g_assert_not_reached();
+       } else if (!device_finish(device)) {
+            error(_("Error closing device.\n"));
+            g_assert_not_reached();
+        }
+       amfree(timestamp);
+
+        g_printf(_("Checking label...\n")); fflush(stdout);
+
+        label_status = device_read_label(device);
+        if (label_status != READ_LABEL_STATUS_SUCCESS) {
+            g_printf("Checking the tape label failed: \n  ");
+            print_read_label_status_error(label_status);
+            exit(EXIT_FAILURE);
+        } else if (device->volume_label == NULL) {
+            error(_("no label found.\n"));
+            g_assert_not_reached();
+        } else if (strcmp(device->volume_label, label) != 0) {
+            error(_("Read back a different label: Got %s, but expected %s\n"),
+                  device->volume_label, label);
+            g_assert_not_reached();
+        } else if (get_timestamp_state(device->volume_time) !=
+                   TIME_STATE_UNDEF) {
+            error(_("Read the right label, but the wrong timestamp: "
+                    "Got %s, expected X.\n"), device->volume_time);
+            g_assert_not_reached();
+        }
+        
+        /* write tape list */
+        
+        /* make a copy */
+        conf_tapelist_old = stralloc2(conf_tapelist, ".amlabel");
+        if(write_tapelist(conf_tapelist_old)) {
+            error(_("couldn't write tapelist: %s"), strerror(errno));
+            /*NOTREACHED*/
+        }
+        amfree(conf_tapelist_old);
+        
+        /* XXX add cur_tape number to tape list structure */
+        remove_tapelabel(label);
+        add_tapelabel("0", label);
+        if(write_tapelist(conf_tapelist)) {
+            error(_("couldn't write tapelist: %s"), strerror(errno));
+            /*NOTREACHED*/
+        }
+        
+        g_printf(_("Success!\n"));
     } else {
-       printf("\ntape not labeled\n");
+       g_printf(_("\ntape not labeled\n"));
     }
+    
+    g_object_unref(device);
+    device = NULL;
 
     clear_tapelist();
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     amfree(outslot);
-    amfree(tapename);
-    amfree(conffile);
     amfree(conf_tapelist);
-    amfree(config_dir);
     config_name=NULL;
     dbclose();
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     return 0;
 }
index 0132fd0aebfaec8cb46ae1b72186a8140ff20b03..7875815975622c4bf9539c0076ce9fd259baf4f2 100644 (file)
@@ -40,17 +40,25 @@ char *datestamp;
 void handle_start(void);
 int main(int argc, char **argv);
 
-int main(int argc, char **argv)
+int
+main(
+    int                argc,
+    char **    argv)
 {
-    char *conffile;
     char *logfname;
     char *conf_logdir;
     FILE *logfile;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-    char my_cwd[STR_SIZE];
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -58,57 +66,33 @@ int main(int argc, char **argv)
 
     dbopen(DBG_SUBDIR_SERVER);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+    erroutput_type = ERR_INTERACTIVE;
 
     /* Process options */
-    
-    erroutput_type = ERR_INTERACTIVE;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-       error("cannot determine current working directory");
-       /*NOTREACHED*/
+    if (argc >= 2) {
+       cfg_opt = argv[1];
     }
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    /* read configuration files */
 
-    if (my_argc < 2) {
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    } else {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    }
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-    safe_cd();
+    safe_cd(); /* must happen after config_init */
 
-    /* read configuration files */
-
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-        error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-        conf_logdir = stralloc(conf_logdir);
-    } else {
-        conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     logfname = vstralloc(conf_logdir, "/", "log", NULL);
     amfree(conf_logdir);
 
     if((logfile = fopen(logfname, "r")) == NULL) {
-       error("could not open log %s: %s", logfname, strerror(errno));
+       error(_("could not open log %s: %s"), logfname, strerror(errno));
        /*NOTREACHED*/
     }
     amfree(logfname);
@@ -129,16 +113,6 @@ int main(int argc, char **argv)
     log_rename(datestamp);
 
     amfree(datestamp);
-    amfree(config_dir);
-    amfree(config_name);
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
 
     dbclose();
 
diff --git a/server-src/amoverview.pl b/server-src/amoverview.pl
new file mode 100644 (file)
index 0000000..35594e4
--- /dev/null
@@ -0,0 +1,265 @@
+#!@PERL@
+
+# Catch for sh/csh on systems without #! ability.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+       & eval 'exec @PERL@ -S $0 $argv:q'
+               if 0;
+
+require 5.001;
+
+use FileHandle;
+use Getopt::Long;
+use Text::ParseWords;
+use Carp;
+use POSIX;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+sub Usage {
+    print STDERR <<END;
+Usage: $0 [[-config] CONFIG] [-hostwidth width] [-diskwidth width] [-skipmissed] [-last] [-num0] [-togo0] [-verbose]
+
+This script generates to standard output an overview of the filesystems
+dumped over time and the type of dump done on a particular day, such as
+a full dump, or an incremental, or if the dump failed.
+
+You may override the default configuration `@DEFAULT_CONFIG@' by using
+the -config command line option.  On larger installations, this script
+will take a while to run.  In this case, run it with --verbose to see
+how far along it is.
+END
+    exit 1;
+}
+
+# Default paths for this installation of Amanda.
+my $prefix='@prefix@';
+$prefix=$prefix;               # avoid warnings about possible typo
+my $exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;     # ditto
+my $amlibexecdir="@amlibexecdir@";
+my $sbindir="@sbindir@";
+# The directory where configurations can be found.
+my $confdir="@CONFIG_DIR@";
+
+# The default configuration.
+my $config="@DEFAULT_CONFIG@";
+
+# Get the version suffix.
+my $USE_VERSION_SUFFIXES = '@USE_VERSION_SUFFIXES@';
+my $suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+       $suf='-@VERSION@';
+}
+
+my $amadmin    = "$sbindir/amadmin$suf";
+
+# overrideable defaults
+my $opt_config         = "$config";
+my $opt_hostwidth      = 8;
+my $opt_diskwidth      = 20;
+my $opt_skipmissed     = 0;
+my $opt_last           = 0;
+my $opt_num0           = 0;
+my $opt_togo0          = 0;
+my $opt_verbose                = 0;
+
+GetOptions('config=s'          => \$opt_config,
+          'hostwidth=i'        => \$opt_hostwidth,
+          'diskwidth=i'        => \$opt_diskwidth,
+          'skipmissed'         => \$opt_skipmissed,
+          'last'               => \$opt_last,
+          'num0'               => \$opt_num0,
+          'togo0'              => \$opt_togo0,
+          'verbose'            => \$opt_verbose)
+or Usage();
+
+if($#ARGV == 0) {
+  $opt_config = $ARGV[0];
+}
+elsif($#ARGV > 0) {
+  Usage();
+}
+
+#untaint user input $ARGV[0]
+
+if ($opt_config =~ /^([\w.-]+)$/) {          # $1 is untainted
+   $opt_config = $1;
+} else {
+    die "filename '$opt_config' has invalid characters.\n";
+}
+
+
+-d "$confdir/$opt_config" or
+       die "$0: directory `$confdir/$opt_config' does not exist.\n";
+
+# read disklist
+my %disks = ();
+$::host = '';
+$::disk = '';
+$opt_verbose and
+    print STDERR "Running $amadmin $opt_config disklist\n";
+my $dlfh = new FileHandle "$amadmin $opt_config disklist|" or
+    die "$0: error in opening `$amadmin $opt_config disklist' pipe: $!\n";
+$/ = "";
+while (<$dlfh>) {
+    ($host, $disk) = m/    host (.*?):.*    disk (.*?):.*strategy (STANDARD|NOFULL|NOINC|HANOI|INCRONLY).*ignore NO/s;
+    next unless $host;
+    $disks{$host}{$disk}++;
+}
+
+$/ = "\n";
+$dlfh->close or
+    die "$0: error in closing `$amadmin $opt_config disklist|' pipe: $!\n";
+
+# Get backup dates
+%::dates = ();
+%::level = ();
+$::level = '';
+my ($date, $tape, $file, $status);
+$opt_verbose and
+    print STDERR "Running $amadmin $opt_config find\n";
+my $fh = new FileHandle "$amadmin $opt_config find|" or
+    die "$0: error in opening `$amadmin $opt_config find' pipe: $!\n";
+<$fh>;
+while (<$fh>) {
+    chomp;
+    next if /found Amanda directory/;
+    next if /skipping cruft directory/;
+    next if /skip-incr/;
+
+    ($date, $time, $host, $disk, $level, $tape, $file, $part, $status) = shellwords($_);
+
+    next if $date eq 'date';
+    next if $date eq 'Warning:';
+    next if $date eq 'Scanning';
+    next if $date eq "";
+
+    if($time !~/^\d\d:\d\d:\d\d$/) {
+       $status = $part;
+       $part = $file;
+       $file = $tape;
+       $tape = $level;
+       $level = $disk;
+       $disk = $host;
+       $host = $time;
+    }
+
+    if ($date =~ /^\d\d\d\d-\d\d-\d\d$/) {
+       if(defined $disks{$host}{$disk}) {
+           defined($level{$host}{$disk}{$date}) or
+               $level{$host}{$disk}{$date} = '';
+           $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E';
+           $dates{$date}++;
+       }
+    }
+    else {
+       print "bad date $date in $_\n";
+    }
+}
+$fh->close or
+    die "$0: error in closing `$amadmin $opt_config find|' pipe: $!\n";
+
+# Process the status to arrive at a "last" status
+if ($opt_last) {
+    for $host (sort keys %disks) {
+        for $disk (sort keys %{$disks{$host}}) {
+           $level{$host}{$disk}{"0000-LA-ST"} = '';
+           for $date (sort keys %dates) {
+               if ($level{$host}{$disk}{$date} eq "E"
+                    && $level{$host}{$disk}{"0000-LA-ST"} =~ /^\d/ ) {
+                   $level{$host}{$disk}{"0000-LA-ST"} .= $level{$host}{$disk}{$date};
+               } elsif ($level{$host}{$disk}{$date} eq "") {
+                   $level{$host}{$disk}{"0000-LA-ST"} =~ s/E//;
+               } else {
+                   $level{$host}{$disk}{"0000-LA-ST"} = $level{$host}{$disk}{$date};
+               }
+           }
+        }
+    }
+}
+
+# Number of level 0 backups
+if ($opt_num0) {
+    for $host (sort keys %disks) {
+        for $disk (sort keys %{$disks{$host}}) {
+            $level{$host}{$disk}{'0000-NM-L0'} = 0;
+            for $date (sort keys %dates) {
+                if ($level{$host}{$disk}{$date} =~ /0/) {
+                    $level{$host}{$disk}{'0000-NM-L0'} += 1;
+                }
+            }
+        }
+    }
+}
+
+# Runs to the last level 0
+if ($opt_togo0) {
+    for $host (sort keys %disks) {
+        for $disk (sort keys %{$disks{$host}}) {
+            $level{$host}{$disk}{'0000-TO-GO'} = 0;
+            my $togo=0;
+            for $date (sort keys %dates) {
+                if ($level{$host}{$disk}{$date} =~ /0/) {
+                    $level{$host}{$disk}{'0000-TO-GO'} = $togo;
+                }
+                $togo++;
+            }
+        }
+    }
+}
+
+unless ($opt_skipmissed)
+# touch all the dates just in case whole days were missed.
+{
+    my ($start, $finish) = 
+       map {
+           my($y,$m,$d) = split /-/, $_;
+           POSIX::mktime(0,0,0,$d,$m-1,$y-1900);
+       } (sort keys %dates)[0,-1];
+
+    while ($start < $finish) {
+       my @l = localtime $start;
+       $dates{sprintf("%d-%02d-%02d", 1900+$l[5], $l[4]+1, $l[3])}++;
+       $start += 86400;
+    }
+}
+
+#Add the "last" entry    
+$dates{"0000-LA-ST"}=1 if ($opt_last);
+
+#Add the "Number of Level 0s" entry
+$dates{"0000-NM-L0"}=1 if ($opt_num0);
+
+#Add the "Runs to go" entry
+$dates{"0000-TO-GO"}=1 if ($opt_togo0);
+
+# make formats
+
+my $top_format = "format TOP =\n\n" .
+    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", '', 'date') .
+    join(' ', map((split(/-/, $_))[1], sort keys %dates)) . "\n" .
+    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", 'host', 'disk') .
+    join(' ', map((split(/-/, $_))[2], sort keys %dates)) . "\n" .
+    "\n.\n";
+
+my $out_format = "format STDOUT =\n" .
+    "@" . "<" x ($opt_hostwidth - 1) . ' ' .
+    "@" . "<" x ($opt_diskwidth - 1) . ' ' .
+    '@> ' x scalar(keys %dates) . "\n" .
+    join(', ', '$host', '$disk', 
+        map("substr(\$level{\$host}{\$disk}{'$_'},-2)", sort keys %dates)) . "\n" .
+    ".\n";
+
+eval $top_format;
+die $@ if $@;
+$^ = 'TOP';
+eval $out_format;
+die $@ if $@;
+
+for $host (sort keys %disks) {
+    for $disk (sort keys %{$disks{$host}}) {
+       write;
+    }
+}
diff --git a/server-src/amoverview.pl.in b/server-src/amoverview.pl.in
deleted file mode 100644 (file)
index a6f7bf6..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-#!@PERL@
-
-# Catch for sh/csh on systems without #! ability.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-require 5.001;
-
-use FileHandle;
-use Getopt::Long;
-use Text::ParseWords;
-use Carp;
-use POSIX;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-sub Usage {
-    print STDERR <<END;
-Usage: $0 [[-config] CONFIG] [-hostwidth width] [-diskwidth width] [-skipmissed] [-last] [-num0] [-togo0] [-verbose]
-
-This script generates to standard output an overview of the filesystems
-dumped over time and the type of dump done on a particular day, such as
-a full dump, or an incremental, or if the dump failed.
-
-You may override the default configuration `@DEFAULT_CONFIG@' by using
-the -config command line option.  On larger installations, this script
-will take a while to run.  In this case, run it with --verbose to see
-how far along it is.
-END
-    exit 1;
-}
-
-# Default paths for this installation of Amanda.
-my $prefix='@prefix@';
-$prefix=$prefix;               # avoid warnings about possible typo
-my $exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # ditto
-my $libexecdir="@libexecdir@";
-my $sbindir="@sbindir@";
-# The directory where configurations can be found.
-my $confdir="@CONFIG_DIR@";
-
-# The default configuration.
-my $config="@DEFAULT_CONFIG@";
-
-# Get the version suffix.
-my $USE_VERSION_SUFFIXES = '@USE_VERSION_SUFFIXES@';
-my $suf = '';
-if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
-       $suf='-@VERSION@';
-}
-
-my $amadmin    = "$sbindir/amadmin$suf";
-
-# overrideable defaults
-my $opt_config         = "$config";
-my $opt_hostwidth      = 8;
-my $opt_diskwidth      = 20;
-my $opt_skipmissed     = 0;
-my $opt_last           = 0;
-my $opt_num0           = 0;
-my $opt_togo0          = 0;
-my $opt_verbose                = 0;
-
-GetOptions('config=s'          => \$opt_config,
-          'hostwidth=i'        => \$opt_hostwidth,
-          'diskwidth=i'        => \$opt_diskwidth,
-          'skipmissed'         => \$opt_skipmissed,
-          'last'               => \$opt_last,
-          'num0'               => \$opt_num0,
-          'togo0'              => \$opt_togo0,
-          'verbose'            => \$opt_verbose)
-or Usage();
-
-if($#ARGV == 0) {
-  $opt_config = $ARGV[0];
-}
-elsif($#ARGV > 0) {
-  Usage();
-}
-
-#untaint user input $ARGV[0]
-
-if ($opt_config =~ /^([\w.-]+)$/) {          # $1 is untainted
-   $opt_config = $1;
-} else {
-    die "filename '$opt_config' has invalid characters.\n";
-}
-
-
--d "$confdir/$opt_config" or
-       die "$0: directory `$confdir/$opt_config' does not exist.\n";
-
-# read disklist
-my %disks = ();
-$::host = '';
-$::disk = '';
-$opt_verbose and
-    print STDERR "Running $amadmin $opt_config disklist\n";
-my $dlfh = new FileHandle "$amadmin $opt_config disklist|" or
-    die "$0: error in opening `$amadmin $opt_config disklist' pipe: $!\n";
-$/ = "";
-while (<$dlfh>) {
-    ($host, $disk) = m/    host (.*?):.*    disk (.*?):.*strategy (STANDARD|NOFULL|NOINC|HANOI|INCRONLY).*ignore NO/s;
-    next unless $host;
-    $disks{$host}{$disk}++;
-}
-
-$/ = "\n";
-$dlfh->close or
-    die "$0: error in closing `$amadmin $opt_config disklist|' pipe: $!\n";
-
-# Get backup dates
-%::dates = ();
-%::level = ();
-$::level = '';
-my ($date, $tape, $file, $status);
-$opt_verbose and
-    print STDERR "Running $amadmin $opt_config find\n";
-my $fh = new FileHandle "$amadmin $opt_config find|" or
-    die "$0: error in opening `$amadmin $opt_config find' pipe: $!\n";
-<$fh>;
-while (<$fh>) {
-    chomp;
-    next if /found Amanda directory/;
-    next if /skipping cruft directory/;
-    next if /skip-incr/;
-
-    ($date, $time, $host, $disk, $level, $tape, $file, $part, $status) = shellwords($_);
-
-    next if $date eq 'date';
-    next if $date eq 'Warning:';
-    next if $date eq 'Scanning';
-    next if $date eq "";
-
-    if($time !~/^\d\d:\d\d:\d\d$/) {
-       $status = $part;
-       $part = $file;
-       $file = $tape;
-       $tape = $level;
-       $level = $disk;
-       $disk = $host;
-       $host = $time;
-    }
-
-    if ($date =~ /^\d\d\d\d-\d\d-\d\d$/) {
-       if(defined $disks{$host}{$disk}) {
-           defined($level{$host}{$disk}{$date}) or
-               $level{$host}{$disk}{$date} = '';
-           $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E';
-           $dates{$date}++;
-       }
-    }
-    else {
-       print "bad date $date in $_\n";
-    }
-}
-$fh->close or
-    die "$0: error in closing `$amadmin $opt_config find|' pipe: $!\n";
-
-# Process the status to arrive at a "last" status
-if ($opt_last) {
-    for $host (sort keys %disks) {
-        for $disk (sort keys %{$disks{$host}}) {
-           $level{$host}{$disk}{"0000-LA-ST"} = '';
-           for $date (sort keys %dates) {
-               if ($level{$host}{$disk}{$date} eq "E"
-                    && $level{$host}{$disk}{"0000-LA-ST"} =~ /^\d/ ) {
-                   $level{$host}{$disk}{"0000-LA-ST"} .= $level{$host}{$disk}{$date};
-               } elsif ($level{$host}{$disk}{$date} eq "") {
-                   $level{$host}{$disk}{"0000-LA-ST"} =~ s/E//;
-               } else {
-                   $level{$host}{$disk}{"0000-LA-ST"} = $level{$host}{$disk}{$date};
-               }
-           }
-        }
-    }
-}
-
-# Number of level 0 backups
-if ($opt_num0) {
-    for $host (sort keys %disks) {
-        for $disk (sort keys %{$disks{$host}}) {
-            $level{$host}{$disk}{'0000-NM-L0'} = 0;
-            for $date (sort keys %dates) {
-                if ($level{$host}{$disk}{$date} =~ /0/) {
-                    $level{$host}{$disk}{'0000-NM-L0'} += 1;
-                }
-            }
-        }
-    }
-}
-
-# Runs to the last level 0
-if ($opt_togo0) {
-    for $host (sort keys %disks) {
-        for $disk (sort keys %{$disks{$host}}) {
-            $level{$host}{$disk}{'0000-TO-GO'} = 0;
-            my $togo=0;
-            for $date (sort keys %dates) {
-                if ($level{$host}{$disk}{$date} =~ /0/) {
-                    $level{$host}{$disk}{'0000-TO-GO'} = $togo;
-                }
-                $togo++;
-            }
-        }
-    }
-}
-
-unless ($opt_skipmissed)
-# touch all the dates just in case whole days were missed.
-{
-    my ($start, $finish) = 
-       map {
-           my($y,$m,$d) = split /-/, $_;
-           POSIX::mktime(0,0,0,$d,$m-1,$y-1900);
-       } (sort keys %dates)[0,-1];
-
-    while ($start < $finish) {
-       my @l = localtime $start;
-       $dates{sprintf("%d-%02d-%02d", 1900+$l[5], $l[4]+1, $l[3])}++;
-       $start += 86400;
-    }
-}
-
-#Add the "last" entry    
-$dates{"0000-LA-ST"}=1 if ($opt_last);
-
-#Add the "Number of Level 0s" entry
-$dates{"0000-NM-L0"}=1 if ($opt_num0);
-
-#Add the "Runs to go" entry
-$dates{"0000-TO-GO"}=1 if ($opt_togo0);
-
-# make formats
-
-my $top_format = "format TOP =\n\n" .
-    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", '', 'date') .
-    join(' ', map((split(/-/, $_))[1], sort keys %dates)) . "\n" .
-    sprintf("%-0${opt_hostwidth}s %-0${opt_diskwidth}s ", 'host', 'disk') .
-    join(' ', map((split(/-/, $_))[2], sort keys %dates)) . "\n" .
-    "\n.\n";
-
-my $out_format = "format STDOUT =\n" .
-    "@" . "<" x ($opt_hostwidth - 1) . ' ' .
-    "@" . "<" x ($opt_diskwidth - 1) . ' ' .
-    '@> ' x scalar(keys %dates) . "\n" .
-    join(', ', '$host', '$disk', 
-        map("substr(\$level{\$host}{\$disk}{'$_'},-2)", sort keys %dates)) . "\n" .
-    ".\n";
-
-eval $top_format;
-die $@ if $@;
-$^ = 'TOP';
-eval $out_format;
-die $@ if $@;
-
-for $host (sort keys %disks) {
-    for $disk (sort keys %{$disks{$host}}) {
-       write;
-    }
-}
diff --git a/server-src/amrmtape.sh b/server-src/amrmtape.sh
new file mode 100644 (file)
index 0000000..3e5a88e
--- /dev/null
@@ -0,0 +1,271 @@
+#!@SHELL@
+#
+# amrmtape.sh
+# Time-stamp: <96/10/23 12:07:21 adrian>
+# Copyright 1996, Adrian Filipi-Martin
+#
+# amrmtape
+#
+# Summary:  This script allow you to invalidate the contents of an
+# existing backup tape within the Amanda current tape database.  This
+# is meant as a recovery mecanism for when a good backup is damaged
+# either by faulty hardware or user error, i.e. the tape is eaten by
+# the tape drive, or the tape has been overwritten.
+#
+# To remove a tape you must specify the Amanda configuration to
+# operate upon as well as the name of the tape. e.g.
+#
+# amrmtape nvl NVL-006
+#
+# N.B.  amrmtape must be run as a user that can read the tape database
+# files and rewrite them.
+#
+# Usage: amrmtape [-n] [-v] [-q] [-d] <configuration> <label>
+#          -n Do nothing to original files, leave new ones in --with-tmpdir
+#            directory.
+#          -v Verbose mode.  Enabled by default.
+#          -q Quiet (opposite of -v).
+#          -d Enable debug tracing.
+#
+# Credits: The what-to-do algorithm was provided by Cedric Scott,
+#          cedric.scott@sse.ie. 
+#
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+ConfigDir=@CONFIG_DIR@
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if test "$USE_VERSION_SUFFIXES" = "yes"; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+Program=`basename $0`
+
+CleanTapelist () {
+  [ "xyes" = "x${DebugMode}" ] && set -x
+
+  #
+  # Check if the configuration directory exists.  Make sure that the
+  # necessary files can be found, such as amanda.conf and tapelist.
+  #
+  if [ ! -d ${ConfigDir}/${Config} ]; then
+    log `_ '%s: configuration directory %s does not exist.' "$0" "${ConfigDir}/${Config}"`
+    return 1
+  fi
+  (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || return $?
+  cd ${ConfigDir}/${Config}
+  if [ ! -r amanda.conf ]; then
+    log `_ '%s: amanda.conf not found or is not readable in %s.' "$0" "${ConfigDir}"`
+    return 1
+  fi
+
+  dumpuser=`amgetconf$SUF dumpuser`
+  runuser=`whoami`
+  if [ $runuser != $dumpuser ]; then
+    log `_ '%s: must be run as user %s' "$0" "$dumpuser"`
+    return 1
+  fi
+
+  # Get the location and name of the tapelist filename.  If tapelist is not
+  # specified in the amanda.conf file, then use tapelist in the config
+  # directory.
+  TapeList=`amgetconf${SUF} tapelist`
+  if [ ! "$TapeList" ]; then
+    TapeList="$ConfigDir/$Config/tapelist"
+  fi
+  if [ ! -r $TapeList ]; then
+    log `_ '%s: %s not found or is not readable.' "$0" "$TapeList"`
+    return 1
+  fi
+
+  # Get the location and name of the database filename.
+  InfoFile=`amgetconf${SUF} infofile`
+  if [ ! "$InfoFile" ]; then
+    log `_ '%s: unable to find name of infofile from %s.' "$0" "${ConfigDir}/${Config}/amanda.conf"`
+    return 1
+  fi
+  VarDir=`echo "$InfoFile" | sed -e 's%^[^/]*$%.%' -e 's%/[^/]*$%%'`
+
+  # Check that the database directory and files really exist.
+  if [ ! -d "${VarDir}" ]; then
+    log `_ '%s: %s does not exist or is not a directory.' "$0" "${VarDir}"`
+    return 1
+  fi
+  if [ ! -r "${InfoFile}" ] && [ ! -d "${InfoFile}" ]; then
+    log `_ '%s: %s does not exist or is not readable.' "${Program}" "${InfoFile}"`
+    return 1
+  fi
+
+  if [ ! -d @AMANDA_TMPDIR@ ]; then
+    log `_ '%s: directory %s does not exist.' "$0" "@AMANDA_TMPDIR@"`
+    exit 1
+  fi
+
+  NewTapelist=@AMANDA_TMPDIR@/tapelist
+  rm -f ${NewTapelist}
+  awk "\$2 == \"${Tape}\" { next; } { print; }" \
+      > ${NewTapelist} < $TapeList ||
+  return $?
+  if [ "xno" = "x${DoNothing}" ]; then
+    lines=`wc -l < $TapeList`
+    linesafter=`wc -l < $NewTapelist`
+    if [ "$lines" -gt "$linesafter" ]; then
+      cp -p $TapeList ${TapeList}~ && (
+        if test "$lines" -gt 1; then
+          [ -s ${NewTapelist} ] &&
+            cp ${NewTapelist} $TapeList &&
+            rm -f ${NewTapelist}
+        else
+          [ -f ${NewTapelist} ] &&
+            cp ${NewTapelist} $TapeList &&
+            rm -f ${NewTapelist}
+        fi
+      )
+      log `_ '%s: remove label %s.' "$0" "${Tape}"`
+    else
+      log `_ '%s: no such tape: %s.' "$0" "${Tape}"`
+      return 1
+    fi
+  fi
+  
+  return $?
+}
+
+
+CleanCurinfo () {
+  [ "xyes" = "x${DebugMode}" ] && set -x
+  (cd ${VarDir} >/dev/null 2>&1) || return $?
+  cd ${VarDir}
+  InfoFileBase=`echo $InfoFile | sed -e 's%.*/%%g'`
+
+  TmpSrc=$InfoFileBase.orig.$$
+  TmpDest=$InfoFileBase.new.$$
+  rm -f ${TmpSrc} ${TmpDest}
+  amadmin${SUF} ${Config} export > ${TmpSrc} || return $?
+  log `_ '%s: preserving original database in %s (exported).' "$0" "${TmpSrc}"`
+  exec < ${TmpSrc} > ${TmpDest} || return $?
+  DeadLevel=10
+  while read Line; do
+    case ${Line} in
+      CURINFO*|"#"*|command*|last_level*|consecutive_runs*|full*|incr*)
+       echo "${Line}"
+        ;;
+      host*)
+       set ${Line}
+        Host=$2
+       echo "${Line}"
+        ;;
+      disk*)
+       set ${Line}
+        Disk=$2
+       echo "${Line}"
+        ;;
+      stats*)
+       set ${Line}
+       if [ $# -lt 6 ] || [ $# -gt 8 ]; then
+         log `_ '%s: unexpected number of fields in "stats" entry for %s.' "${Program}" "${Host}:${Disk}"`
+         log "${Line}"
+         return 1
+       fi
+       Level=$2
+       CurrentTape=$8
+       if [ "${CurrentTape}" = "${Tape}" ]; then
+         DeadLevel=${Level}
+         ${Verbose} "Discarding Host: ${Host}, Disk: ${Disk}, Level: ${Level}"
+       elif [ $Level -gt $DeadLevel ]; then
+         ${Verbose} "Discarding Host: ${Host}, Disk: ${Disk}, Level: ${Level}"
+       else
+         echo "${Line}"
+       fi
+       ;;
+      history*)
+       set ${Line}
+       echo "${Line}"
+       ;;
+      //)
+       echo "${Line}"
+       DeadLevel=10
+       ;;
+      *)
+       log `_ 'Error: unrecognized line of input: "%s"' "${Line}"`
+       return 1
+    esac
+  done
+  exec < /dev/tty > /dev/tty
+
+  if [ "xno" = "x${DoNothing}" ]; then
+    [ -s ${TmpDest} ] && 
+    amadmin${SUF} ${Config} import < ${TmpDest} &&
+    rm -f ${TmpDest}
+  fi
+
+  return $?
+}
+
+
+log () {
+  echo 1>&2 "$@"
+  return 0
+}
+
+
+usage () {
+  echo `_ '%s [-n] [-v] [-q] [-d] <configuration> <label>' "${Program}"`
+  echo `_ '  -n Do nothing to original files, leave new ones in database directory.'`
+  echo `_ '  -v Verbose, list backups of hosts and disks that are being discarded.'`
+  echo `_ '  -q Quiet, opposite of -v.'`
+  echo `_ '  -d Enable debug tracing.'`
+  echo `_ 'This program allows you to invalidate the contents of an existing
+backup tape within the Amanda current tape database.  This is meant
+as a recovery mecanism for when a good backup is damaged either by
+faulty hardware or user error, i.e. the tape is eaten by the tape drive,
+or the tape has been overwritten.'`
+  return 0
+}
+
+
+Verbose="log "
+DoNothing="no"
+DebugMode="no"
+
+set dummy ${1+"$@"}
+while shift 2>/dev/null; do
+  case "$1" in
+    -q)
+      Verbose=": "
+      ;;
+    -v)
+      Verbose="log "
+      ;;
+    -n)
+      DoNothing="yes"
+      ;;
+    -d)
+      DebugMode="yes"
+      ;;
+    *)
+      if [ $# = 2 ]; then
+        Config=$1
+        Tape=$2
+       break
+      else
+        usage 1>&2
+       exit 1
+      fi
+
+  esac
+done
+
+( CleanTapelist && CleanCurinfo )
+exit $?
diff --git a/server-src/amrmtape.sh.in b/server-src/amrmtape.sh.in
deleted file mode 100644 (file)
index 1f18eba..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-#!@SHELL@
-#
-# amrmtape.sh
-# Time-stamp: <96/10/23 12:07:21 adrian>
-# Copyright 1996, Adrian Filipi-Martin
-#
-# amrmtape
-#
-# Summary:  This script allow you to invalidate the contents of an
-# existing backup tape within the Amanda current tape database.  This
-# is meant as a recovery mecanism for when a good backup is damaged
-# either by faulty hardware or user error, i.e. the tape is eaten by
-# the tape drive, or the tape has been overwritten.
-#
-# To remove a tape you must specify the Amanda configuration to
-# operate upon as well as the name of the tape. e.g.
-#
-# amrmtape nvl NVL-006
-#
-# N.B.  amrmtape must be run as a user that can read the tape database
-# files and rewrite them.
-#
-# Usage: amrmtape [-n] [-v] [-q] [-d] <configuration> <label>
-#          -n Do nothing to original files, leave new ones in --with-tmpdir
-#            directory.
-#          -v Verbose mode.  Enabled by default.
-#          -q Quiet (opposite of -v).
-#          -d Enable debug tracing.
-#
-# Credits: The what-to-do algorithm was provided by Cedric Scott,
-#          cedric.scott@sse.ie. 
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-ConfigDir=@CONFIG_DIR@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if test "$USE_VERSION_SUFFIXES" = "yes"; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-Program=`basename $0`
-
-CleanTapelist () {
-  [ "xyes" = "x${DebugMode}" ] && set -x
-
-  #
-  # Check if the configuration directory exists.  Make sure that the
-  # necessary files can be found, such as amanda.conf and tapelist.
-  #
-  if [ ! -d ${ConfigDir}/${Config} ]; then
-    log "${Program}: configuration directory ${ConfigDir}/${Config} does not exist."
-    return 1
-  fi
-  (cd ${ConfigDir}/${Config} >/dev/null 2>&1) || return $?
-  cd ${ConfigDir}/${Config}
-  if [ ! -r amanda.conf ]; then
-    log "${Program}: amanda.conf not found or is not readable in ${ConfigDir}."
-    return 1
-  fi
-
-  dumpuser=`amgetconf$SUF dumpuser`
-  runuser=`whoami`
-  if [ $runuser != $dumpuser ]; then
-    log "${Program}: must be run as user $dumpuser"
-    return 1
-  fi
-
-  # Get the location and name of the tapelist filename.  If tapelist is not
-  # specified in the amanda.conf file, then use tapelist in the config
-  # directory.
-  TapeList=`amgetconf${SUF} tapelist`
-  if [ ! "$TapeList" ]; then
-    TapeList="$ConfigDir/$Config/tapelist"
-  fi
-  if [ ! -r $TapeList ]; then
-    log "${Program}: $TapeList not found or is not readable."
-    return 1
-  fi
-
-  # Get the location and name of the database filename.
-  InfoFile=`amgetconf${SUF} infofile`
-  if [ ! "$InfoFile" ]; then
-    log "${Program}: unable to find name of infofile from ${ConfigDir}/${Config}/amanda.conf."
-    return 1
-  fi
-  VarDir=`echo "$InfoFile" | sed -e 's%^[^/]*$%.%' -e 's%/[^/]*$%%'`
-
-  # Check that the database directory and files really exist.
-  if [ ! -d "${VarDir}" ]; then
-    log "${Program}: ${VarDir} does not exist or is not a directory."
-    return 1
-  fi
-  for dbext in @DB_EXT@; do
-    if [ ! -r ${InfoFile}${dbext} ] && [ ! -d ${InfoFile}${dbext} ]; then
-      log "${Program}: ${InfoFile}${dbext} does not exist or is not readable."
-      return 1
-    fi
-  done
-
-  if [ ! -d @AMANDA_TMPDIR@ ]; then
-    log "${Program}: directory @AMANDA_TMPDIR@ does not exist."
-    exit 1
-  fi
-
-  NewTapelist=@AMANDA_TMPDIR@/tapelist
-  rm -f ${NewTapelist}
-  awk "\$2 == \"${Tape}\" { next; } { print; }" \
-      > ${NewTapelist} < $TapeList ||
-  return $?
-  if [ "xno" = "x${DoNothing}" ]; then
-    lines=`wc -l < $TapeList`
-    linesafter=`wc -l < $NewTapelist`
-    if [ "$lines" -gt "$linesafter" ]; then
-      cp -p $TapeList ${TapeList}~ && (
-        if test "$lines" -gt 1; then
-          [ -s ${NewTapelist} ] &&
-            cp ${NewTapelist} $TapeList &&
-            rm -f ${NewTapelist}
-        else
-          [ -f ${NewTapelist} ] &&
-            cp ${NewTapelist} $TapeList &&
-            rm -f ${NewTapelist}
-        fi
-      )
-      log "${Program}: remove label ${Tape}."
-    else
-      log "${Program}: no such tape: ${Tape}."
-      return 1
-    fi
-  fi
-  
-  return $?
-}
-
-
-CleanCurinfo () {
-  [ "xyes" = "x${DebugMode}" ] && set -x
-  (cd ${VarDir} >/dev/null 2>&1) || return $?
-  cd ${VarDir}
-  InfoFileBase=`echo $InfoFile | sed -e 's%.*/%%g'`
-
-  TmpSrc=$InfoFileBase.orig.$$
-  TmpDest=$InfoFileBase.new.$$
-  rm -f ${TmpSrc} ${TmpDest}
-  amadmin${SUF} ${Config} export > ${TmpSrc} || return $?
-  log "${Program}: preserving original database in ${TmpSrc} (exported)."
-  exec < ${TmpSrc} > ${TmpDest} || return $?
-  DeadLevel=10
-  while read Line; do
-    case ${Line} in
-      CURINFO*|"#"*|command*|last_level*|consecutive_runs*|full*|incr*)
-       echo "${Line}"
-        ;;
-      host*)
-       set ${Line}
-        Host=$2
-       echo "${Line}"
-        ;;
-      disk*)
-       set ${Line}
-        Disk=$2
-       echo "${Line}"
-        ;;
-      stats*)
-       set ${Line}
-       if [ $# -lt 6 ] || [ $# -gt 8 ]; then
-         log "${Program}: unexpected number of fields in 'stats' entry for ${Host}:${Disk}."
-         log "${Line}"
-         return 1
-       fi
-       Level=$2
-       CurrentTape=$8
-       if [ "${CurrentTape}" = "${Tape}" ]; then
-         DeadLevel=${Level}
-         ${Verbose} "Discarding Host: ${Host}, Disk: ${Disk}, Level: ${Level}"
-       elif [ $Level -gt $DeadLevel ]; then
-         ${Verbose} "Discarding Host: ${Host}, Disk: ${Disk}, Level: ${Level}"
-       else
-         echo "${Line}"
-       fi
-       ;;
-      history*)
-       set ${Line}
-       echo "${Line}"
-       ;;
-      //)
-       echo "${Line}"
-       DeadLevel=10
-       ;;
-      *)
-       log "Error: unrecognized line of input: \"${Line}\""
-       return 1
-    esac
-  done
-  exec < /dev/tty > /dev/tty
-
-  if [ "xno" = "x${DoNothing}" ]; then
-    [ -s ${TmpDest} ] && 
-    amadmin${SUF} ${Config} import < ${TmpDest} &&
-    rm -f ${TmpDest}
-  fi
-
-  return $?
-}
-
-
-log () {
-  echo 1>&2 "$@"
-  return 0
-}
-
-
-usage () {
-  echo "${Program} [-n] [-v] [-q] [-d] <configuration> <label>"
-  echo "  -n Do nothing to original files, leave new ones in database directory."
-  echo "  -v Verbose, list backups of hosts and disks that are being discarded."
-  echo "  -q Quiet, opposite of -v."
-  echo "  -d Enable debug tracing."  
-  echo "This program allows you to invalidate the contents of an existing"
-  echo "backup tape within the Amanda current tape database.  This is meant as"
-  echo "a recovery mecanism for when a good backup is damaged either by faulty"
-  echo "hardware or user error, i.e. the tape is eaten by the tape drive, or"
-  echo "the tape has been overwritten."
-  return 0
-}
-
-
-Verbose="log "
-DoNothing="no"
-DebugMode="no"
-
-set dummy ${1+"$@"}
-while shift 2>/dev/null; do
-  case "$1" in
-    -q)
-      Verbose=": "
-      ;;
-    -v)
-      Verbose="log "
-      ;;
-    -n)
-      DoNothing="yes"
-      ;;
-    -d)
-      DebugMode="yes"
-      ;;
-    *)
-      if [ $# = 2 ]; then
-        Config=$1
-        Tape=$2
-       break
-      else
-        usage 1>&2
-       exit 1
-      fi
-
-  esac
-done
-
-( CleanTapelist && CleanCurinfo )
-exit $?
diff --git a/server-src/amserverconfig.pl b/server-src/amserverconfig.pl
new file mode 100755 (executable)
index 0000000..09557cb
--- /dev/null
@@ -0,0 +1,655 @@
+#!@PERL@
+#
+# Copyright (c) 2006 Zmanda Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+#
+
+use Getopt::Long;
+use Time::Local;
+use File::Copy;
+use Socket;   # for gethostbyname
+
+my $confdir="@CONFIG_DIR@";
+my $prefix="@prefix@";
+my $tmpdir="@AMANDA_DBGDIR@";
+$prefix=$prefix;                # avoid warnings about possible typo
+my $exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;      # ditto
+my $sbindir="@sbindir@";
+my $localstatedir="@localstatedir@";
+my $amandahomedir="$localstatedir/lib/amanda";
+my $datadir="$amandahomedir/template.d"; #rpm install template files here
+my $def_tapedev="file:/$amandahomedir/vtapes";
+
+my $amanda_user="@CLIENT_LOGIN@";
+my $def_config="@DEFAULT_CONFIG@";
+my $def_dtimeout="1800";
+my $def_ctimeout="30";
+my $def_etimeout="300";
+my $def_perm=0750;
+my $amanda_conf_perm=0600;
+my $def_tapecycle=10;
+my $config;
+my $vtape_err=0;
+my $holding_err=0;
+my $template_only=0;
+my $parentdir;
+my $host;
+# Get the version suffix.
+my $USE_VERSION_SUFFIXES = '@USE_VERSION_SUFFIXES@';
+my $suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+        $suf='-@VERSION@';
+}
+
+
+#usage
+sub usage {
+        print "$0 $suf\n";
+        print "\t\t <config> [--template <template>]\n";
+       print "\t\t[--no-vtape] (do not create virtual tapes)\n";
+        print "\t\t[--tapetype <tapetype>] [--tpchanger <tpchanger>]\n";
+        print "\t\t[--tapedev <tapedev>] [--changerfile <changerfile>]\n";
+        print "\t\t[--changerdev <changerdev>] [--labelstr <labelstr>] \n";
+       print "\t\t[--mailto <mailto>] [--dumpcycle <dumpcycle> (ex: 5days, 1week or 2weeks)]\n";
+       print "\t\t[--runspercycle <runspercycle>] [--runtapes <runtapes>]\n";
+       print "\t\t[--tapecycle <tapecycle>]\n";
+       print "\t\t[--help]\n";
+}
+
+#print and log
+sub mprint {
+    for $fh ( STDOUT, LOG ) {
+       print $fh @_;
+    }
+}
+
+sub log_and_die { 
+    my ($err, $cleanup) = @_;
+    print LOG $err;
+    # clean up $config directory if cleanup=1
+    # if error in creating vtape or holding disk, 
+    # advise user to create manually, no need to cleanup
+    if ( $cleanup && defined $config  && -e "$confdir/$config" ) {
+       print LOG "cleaning up $confdir/$config\n";
+       if ( -e "$confdir/$config/amanda.conf" ) {
+           unlink "$confdir/$config/amanda.conf" || 
+           print LOG "unlink $confdir/$config/amanda.conf failed: $!\n";
+       }
+       if ( -e "$confdir/$config/advanced.conf" ) {
+           unlink "$confdir/$config/advanced.conf" || 
+           print LOG "unlink $confdir/$config/advanced.conf failed: $!\n";
+       }
+       if ( -e "$confdir/$config/tapelist" ) {
+           unlink "$confdir/$config/tapelist" || 
+           print LOG "unlink $confdir/$config/tapelist failed: $!\n";
+       }
+       if ( -e "$confdir/$config/curinfo" ) {
+           rmdir "$confdir/$config/curinfo" || 
+           print LOG "rmdir $confdir/$config failed: $!\n";
+       }
+       if ( -e "$confdir/$config/index" ) {
+           rmdir "$confdir/$config/index" || 
+           print LOG "rmdir $confdir/$config/index failed: $!\n";
+       }
+       rmdir "$confdir/$config" || 
+           print LOG "rmdir $confdir/$config failed: $!\n";
+    }
+    die $err;
+}
+
+
+sub is_user_right {
+    my $user = `whoami`;
+    chomp($user);
+    ( $user eq $amanda_user ) ||
+       die ("ERROR: $0 must be run by $amanda_user\n", 0);
+}
+
+
+# rpm installation should have taken care of these. Create one if it's not there
+sub check_gnutarlist_dir {
+    if ( -e "$amandahomedir/gnutar-lists" ) {
+       &mprint ("$amandahomedir/gnutar-lists directory exists\n");
+    }
+    else {
+       mkdir ("$amandahomedir/gnutar-lists", $def_perm) ||
+           &log_and_die ("ERROR: mkdir:$amandahomedir/gnutar-lists failed: $!\n", 0);
+    }
+}
+
+sub create_conf_dir {
+  unless ( -e $confdir ) {
+    &log_and_die ("ERROR: $confdir does not exist\n", 0);
+  }
+  unless ( -e "$confdir/$config" ) {
+    mkdir ("$confdir/$config", $def_perm) ||
+      &log_and_die ("ERROR: mkdir: $confdir/$config failed: $!\n", 0); # $! = system error
+  } else {
+    &log_and_die ("ERROR: Configuration $config exists\n", 0);
+  }
+  unless ( -e "$confdir/template.d" ) {
+    mkdir ("$confdir/template.d", $def_perm)  ||
+      &log_and_die ("ERROR: mkdir: $confdir/template.d failed: $!\n", 0);
+    &mprint ("$confdir/template.d directory created\n");
+  }
+}
+
+sub copy_template_file {
+    my $tplate = $_[0];
+    unless ($tplate) {
+       &log_and_die ("ERROR: template is missing\n", 1);
+    }
+    # create and update amanda.conf
+    open(CONF, "$datadir/amanda-$tplate.conf")
+       || &log_and_die ("ERROR: Cannot open $datadir/amanda-$tplate.conf: $!\n", 1);
+    open(NEWCONF, ">$confdir/$config/amanda.conf") ||
+       &log_and_die ("ERROR: Cannot create $confdir/$config/amanda.conf: $!\n", 1);
+    chmod ($amanda_conf_perm, "$confdir/$config/amanda.conf") ||
+       &log_and_die ("ERROR: Cannot set amanda.conf file access permission: $!\n", 1);
+    while (<CONF>) {
+       $_ =~ s/$def_config/$config/;
+       print NEWCONF $_;
+    }
+    close(CONF);
+    close(NEWCONF);
+    &mprint ("$confdir/$config/amanda.conf created and updated\n");
+}
+
+
+sub create_curinfo_index_dir {
+    mkdir("$confdir/$config/curinfo", $def_perm) ||
+       &log_and_die ("ERROR: mkdir: $confdir/$config/curinfo failed: $!\n", 1);
+    mkdir("$confdir/$config/index", $def_perm) || 
+       &log_and_die ("ERROR: mkdir: $confdir/$config/index failed: $!\n", 1);
+    &mprint ("curinfo and index directory created\n");
+}
+
+sub touch_list_files {
+    open (TLIST, ">$confdir/$config/tapelist")
+       || &log_and_die ("ERROR: Cannot create tapelist file: $!\n", 1);
+    close (TLIST);
+    &mprint ("tapelist file created\n");
+
+    open (DLIST, ">$confdir/$config/disklist")
+       || &log_and_die ("ERROR: Cannot create disklist file: $!\n", 1);
+    close (DLIST);
+    &mprint ("disklist file created\n");
+}
+
+# create holding disk directory, check disk space first
+sub create_holding { 
+  if ( -d "$amandahomedir/holdings/$config" ) {
+    my $uid = (stat("$amandahomedir/holdings/$config"))[4];
+    my $owner = (getpwuid($uid))[0];
+    unless ( $owner eq $amanda_user ) {
+      &mprint ("WARNING: holding disk directory exists and is not owned by $amanda_user\n");
+      $holding_err++;
+    }
+    return;
+  }
+    my $div=1;
+    my $out = `df -k $amandahomedir`;
+    my @dfout = split(" " , $out);
+    unless ( $#dfout == 12 ) { # df should output 12 elem
+       &mprint ("WARNING: df failed, holding disk directory not created\n");
+       $holding_err++;
+       return;
+    }
+    unless (( $dfout[1] eq "1K-blocks" ) || ( $dfout[1] eq "kbytes")) {
+         $div=2;       # 512-blocks displayed by df
+     }
+    
+    if (( $dfout[10] / $div )  > 1024000 ) { # holding disk is defined 1000 MB
+       &mprint ("creating holding disk directory\n");
+       unless ( -d "$amandahomedir/holdings" ) { 
+       mkdir ( "$amandahomedir/holdings", $def_perm) ||
+           (&mprint ("WARNING: mkdir $amandahomedir/holdings failed: $!\n"), $holding_err++, return );
+    }
+       mkdir ( "$amandahomedir/holdings/$config", $def_perm) ||
+           (&mprint ("WARNING: mkdir $amandahomedir/holdings/$config failed: $!\n"), $holding_err++, return) ;
+    }
+}
+
+#create default tape dir
+sub create_deftapedir{
+    unless ( -e "$amandahomedir/vtapes" ) { 
+       mkdir ( "$amandahomedir/vtapes", $def_perm) ||
+           ( &mprint ("WARNING: mkdir $amandahomedir/$config/vtapes failed: $!\n"), return );
+    }
+    unless ( -e "$amandahomedir/vtapes/$config" ) { 
+       mkdir ( "$amandahomedir/vtapes/$config", $def_perm) ||
+           ( &mprint ("WARNING: mkdir $amandahomedir/vtapes/$config failed: $!\n"), return );
+    }
+       $parentdir="$amandahomedir/vtapes/$config";
+}
+
+# create and label vtape
+sub create_vtape {
+       &mprint ("creating vtape directory\n");
+       if ($template_only==0){ #  check $template mode
+               $mylabelprefix=$labelstr;   #set labelstr
+               if ($tapedev eq "$def_tapedev/$config"){
+               &create_deftapedir;
+               }
+               else {
+               $tapedev=~/^(file:\/)/;
+               $parentdir=$';
+               }
+       }
+       else {
+               $mylabelprefix=$config;
+               &create_deftapedir;     
+       }
+       unless ( -e $parentdir){
+               &mprint ("WARNING: tapedev $parentdir does not exists, vtapes creation failed!\n");
+               &mprint ("Please create $parentdir and $confdir/$config and rerun the same command or else create vtapes manually.\n");
+               $vtape_err++;
+               return;
+       }
+
+       chdir ("$parentdir") ||
+               ( &mprint("WARNING: chdir $parentdir failed: $!\n"), $vtape_err++, return );
+    my $i;
+    &mprint ("amlabel vtapes\n");
+       if (defined $tapecycle) {
+               $tapecycle=~/^\d+/; 
+               $tp_cyclelimit=$&;
+                       # check space
+               my $dfout =`df $parentdir`;
+               my $mul=1024;
+               @dfdata=split(" ",$dfout);
+               unless ( $dfdata[1] eq "1K-blocks" ) {
+                       $mul=512;       # 512-blocks displayed by df
+               }
+               if (($dfdata[10]*$mul) < (($tp_cyclelimit*73728)+10240)){
+                       &mprint ("WARNING: Not enough space for vtapes. Creation of vtapes failed\n");
+                       $vtape_err++;
+                       return;
+               }
+       }
+       else {
+               $tp_cyclelimit=$def_tapecycle;
+       }
+
+       for $i (1..$tp_cyclelimit) {
+               unless ( -e "slot$i"){
+               mkdir ("slot$i", $def_perm) ||
+               ( &mprint ("WARNING: mkdir $parentdir/slot$i failed: $!\n"), $vtape_err++, return);
+               }
+               ( @amlabel_out = `$sbindir/amlabel -f $config $mylabelprefix-$i slot $i`) ||
+           ( &mprint ("WARNING: amlabel vtapes failed at slot $i: $!\n"), $vtape_err++, return);
+    }
+       foreach (@amlabel_out) {
+         print LOG;
+        }
+       # reset tape to the first slot
+       `$sbindir/amtape $config reset`;
+}
+
+sub create_customconf{
+          # now create a custom amanda.conf from user input
+       unless ( $mailto ) 
+       { $mailto="$amanda_user"; }
+       else {  # untaint mailto which can be evil
+                # reject mailto with the following * ( ) < > [ ] , ; : ! $ \ / "
+           if ( $mailto =~ /^([^\*\(\)<>\[\]\,\;\:\!\$\\\/\"]+)$/ ) {
+               $mailto = $1;                      #  now untainted
+           } else {
+               &log_and_die ("ERROR: Invalid data in mailto.\n");  # log this somewhere
+           }
+       }
+       unless ( $dumpcycle ) { $dumpcycle="1 week"; }
+       unless ( $runspercycle ) { $runspercycle="5"; }
+       unless ( $tapecycle ) { $tapecycle="10 tapes"; }
+       unless ( $runtapes ) { $runtapes="1"; }
+       unless ( $labelstr ) {
+         if ($template eq "harddisk") {
+           $labelstr="$config";
+         } else {
+           $labelstr="^$config-[0-9][0-9]*\$";
+         }
+       }
+       if ((!(defined($template)))||($template eq "harddisk")) 
+         {
+               if (defined $tapedev){
+               $tapedev="file:/".$tapedev;
+               }
+               unless ( $tpchanger ) { $tpchanger="chg-disk"; }
+               unless ( $tapedev ) { $tapedev="$def_tapedev/$config"; }
+               unless ( $changerfile ) { $changerfile="$confdir/$config/changer.conf"; }
+               unless ( $changerdev ) { $changerdev="/dev/null";}
+               unless ( $tapetype ) { $tapetype="HARDDISK"; }  
+         }
+       elsif ($template eq "single-tape")
+         {
+               unless ($tpchanger) {$tpchanger="chg-manual";}
+               unless ($tapedev)     {$tapedev="/dev/nst0";}
+               unless ($changerfile) {$changerfile="$confdir/$config/chg-manual.conf";}
+               unless ($changerdev) {$changerdev="/dev/null";}
+               unless ($tapetype) {$tapetype="HP-DAT";}
+         }
+       elsif ($template eq "tape-changer") 
+          {
+               unless ($tpchanger){$tpchanger="chg-zd-mtx";}
+               unless ($tapedev){ $tapedev="/dev/nst0";}
+               unless ($changerfile){$changerfile="$confdir/$config/changer.conf";}
+               unless ($changerdev) {$changerdev="/dev/sg1";}
+               unless ($tapetype)  {$tapetype="HP-DAT";}
+          }
+        else # S3 case
+         {
+           unless ($tpchanger){$tpchanger="chg-multi";}
+           unless ($changerfile){$changerfile="$confdir/$config/changer.conf";}
+           unless ($tapetype)  {$tapetype="HP-DAT";}
+         }
+
+
+       open (CONF, ">$confdir/$config/amanda.conf") ||
+           &log_and_die ("ERROR: Cannot create amanda.conf file: $!\n", 1);
+       chmod ($amanda_conf_perm, "$confdir/$config/amanda.conf") ||
+           &log_and_die ("ERROR: Cannot set amanda.conf file access permission: $!\n", 1);
+
+       print CONF "org \"$config\"\t\t# your organization name for reports\n";
+       print CONF "mailto \"$mailto\"\t# space separated list of operators at your site\n";
+       print CONF "dumpcycle $dumpcycle\t\t# the number of days in the normal dump cycle\n";
+        print CONF "runspercycle $runspercycle\t\t# the number of amdump runs in dumpcycle days\n";
+       print CONF "tapecycle $tapecycle\t# the number of tapes in rotation\n"; 
+       print CONF "runtapes $runtapes\t\t# number of tapes to be used in a single run of amdump\n";
+       print CONF "tpchanger \"$tpchanger\"\t# the tape-changer glue script\n";
+       print CONF "tapedev \"$tapedev\"\t# the no-rewind tape device\n";
+       print CONF "changerfile \"$changerfile\"\t# tape changer configuration parameter file\n";
+       print CONF "changerdev \"$changerdev\"\t# tape changer configuration parameter device\n";
+       print CONF "tapetype $tapetype\t# what kind of tape it is\n";
+       print CONF "labelstr \"$labelstr\"\t# label constraint regex: all tapes must match\n";
+       print CONF "dtimeout $def_dtimeout\t# number of idle seconds before a dump is aborted\n";
+       print CONF "ctimeout $def_ctimeout\t# max number of secconds amcheck waits for each client\n";
+       print CONF "etimeout $def_etimeout\t# number of seconds per filesystem for estimates\n";
+       print CONF "define dumptype global {\n";
+       print CONF "       comment \"Global definitions\"\n";
+       print CONF "       auth \"bsdtcp\"\n}\n";
+       print CONF "define dumptype gui-base {\n";
+       print CONF "       global\n";
+       print CONF "       program \"GNUTAR\"\n";
+       print CONF "       comment \"gui base dumptype dumped with tar\"\n";
+       print CONF "       compress none\n";
+       print CONF "       index yes\n}\n";
+       if ($tapetype eq "HARDDISK") {
+         print CONF "define tapetype HARDDISK {\n";
+         print CONF "       comment \"Virtual Tapes\"\n";
+         print CONF "       length 5000 mbytes\n}\n";
+       }
+       print CONF "includefile \"advanced.conf\"\n";
+       print CONF "includefile \"$confdir/template.d/dumptypes\"\n";
+       print CONF "includefile \"$confdir/template.d/tapetypes\"\n";
+       close (CONF);
+       mprint ("custom amanda.conf created\n");
+  }
+
+
+sub check_xinetd{
+    &mprint ("/var/lib/amanda/example/xinetd.amandaserver contains the latest Amanda server daemon configuration.\n");
+    &mprint ("Please merge it to /etc/xinetd.d/amandaserver.\n");
+}
+
+
+sub build_amanda_ssh_key{
+  if ( -e "$amandahomedir/.ssh/id_rsa_amdump.pub" ) {
+    if ( -e "$amandahomedir/.ssh/client_authorized_key" ) {
+      &mprint ("$amandahomedir/.ssh/client_authorized_keys exists.\n");
+    }
+    else {
+      open(NEWAUTH, ">$amandahomedir/.ssh/client_authorized_keys") ||
+       (&mprint("WARNING: open $amandahomedir/.ssh/client_authorized_key failed: $!\n"), return);
+      open(PUB, "$amandahomedir/.ssh/id_rsa_amdump.pub") ||
+       (&mprint("WARNING: open $amandahomedir/.ssh/id_rsa_amdump.pub failed: $!\n"), return);
+      print NEWAUTH "from=\"$host\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=\"/usr/lib/amanda/amandad -auth=ssh amdump\" ";
+      while (<PUB>) {
+      print NEWAUTH;
+    }
+      close NEWAUTH;
+      close PUB;
+      &mprint("$amandahomedir/.ssh/client_authorized_keys created. Please append to /var/lib/amanda/.ssh/authorized_keys file on Amanda clients\n");
+      }
+  }
+}
+
+sub copy_chg_manual_conf {
+  if ( $template eq "single-tape" && !defined $changerfile && !defined $tpchanger)
+    {
+      my $my_changerfile="$confdir/$config/chg-manual.conf";
+      copy("$datadir/chg-manual.conf", $my_changerfile) ||
+       &mprint ("copy $datadir/chg-manual.conf to $my_changerfile failed: $!\n");
+    }
+}
+
+#main
+my $ret=0;
+
+$ret = GetOptions ("template=s"=>\$template,
+                  "no-vtape!"=>\$novtape,
+             "tapetype=s"=>\$tapetype,
+             "tpchanger=s"=>\$tpchanger,
+             "tapedev=s"=>\$tapedev,
+             "changerfile=s"=>\$changerfile,
+             "changerdev=s"=>\$changerdev,
+             "labelstr=s"=>\$labelstr,
+             "mailto=s"=>\$mailto,
+             "dumpcycle=s"=>\$dumpcycle,
+             "runspercycle=i"=>\$runspercycle,
+             "runtapes=i"=>\$runtapes,
+             "tapecycle=i"=>\$tapecycle,
+             "help!"=>\$help
+             );
+
+unless ( $ret ) {
+    &usage;
+    exit 1;
+}
+
+if($help) {
+    &usage;
+    exit 0;
+}
+
+unless ( $#ARGV == 0 ) {
+    print STDERR "ERROR: config name is required.\n";
+    &usage;
+    exit 1;
+}
+else {
+    if ( "$ARGV[0]" =~ /^([-\@\w.]+)$/ ) {
+       $config = $1;                   #  now untainted
+    } else {
+       die ("ERROR: Invalid data in config name.\n");  # log this somewhere
+    }
+}
+
+
+$oldPATH = $ENV{'PATH'};
+
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin:/usr/ucb"; # force known path
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+$date=`date +%Y%m%d%H%M%S`;
+chomp($date);
+my $logfile="$tmpdir/amserverconfig.$date.debug";
+
+&is_user_right;
+unless ( -e "$tmpdir" ) {
+    mkdir ("$tmpdir", $def_perm) ||
+       die ("ERROR: mkdir: $tmpdir failed: $!\n");
+}
+
+open (LOG, ">$logfile") || die ("ERROR: Cannot create logfile: $!\n");
+print STDOUT "Logging to $logfile\n";
+
+my $lhost=`hostname`;
+chomp($lhost);
+# get our own canonical name, if possible (we don't sweat the IPv6 stuff here)
+$host=(gethostbyname($lhost))[0];
+
+unless ( $host ) {
+    $host = $lhost;  #gethostbyname() failed, go with hostname output
+}
+
+
+&create_conf_dir;
+
+if ( defined $template ) {
+# validate user input to template
+    chomp($template);
+    my $found = 0;
+    @valid_templates = ( "harddisk", "single-tape", "tape-changer", "s3");
+    foreach $elt (@valid_templates) {
+       if ($elt eq lc($template)) {
+           $found = 1;
+           last;
+       }
+    }
+    unless ( $found ) {
+       print STDERR "valid inputs to --templates are harddisk, single-tape, tape-changer or S3\n";
+       &usage;
+       exit 1;
+}
+# if tape-changer is chosen, check if mtx is installed
+    if ($template eq "tape-changer") {
+      my $ok = 0;
+      for $dir ("/usr/sbin", "/usr/local/sbin", "/usr/local/bin", "/usr/bin", "/bin","/opt/csw/sbin",split(":",$oldPATH)) {
+       if ( -e "$dir/mtx" ) {
+         $ok = 1;
+         last;
+       }
+      }
+      unless ($ok) {
+       &mprint      ("ERROR: mtx binary not found, tape-changer template will not work and is not installed.\n");
+       &log_and_die ("ERROR: Please install mtx and rerun the same command.\n", 0);
+      }
+      unless ($changerfile) {$changerfile="$confdir/$config/changer.conf";}
+      open (CCONF, ">$changerfile")
+       || &log_and_die ("ERROR: Cannot create $changerfile: $!\n", 1);
+      close (CCONF);
+  } elsif ($template eq "S3" ) {
+
+      unless ($changerfile) {$changerfile="$confdir/$config/changer.conf";}
+      open (CCONF, ">$changerfile")
+    || &log_and_die ("ERROR: Cannot create $changerfile: $!\n", 1);
+      close (CCONF);
+
+  }
+
+}
+
+&check_gnutarlist_dir;
+
+# copy dumptypes and tapetypes files if none exists.
+my $dtype="$confdir/template.d/dumptypes";
+my $ttype="$confdir/template.d/tapetypes";
+
+unless ( -e $dtype ) {
+    copy("$datadir/dumptypes", $dtype ) ||
+    &log_and_die ("ERROR: copy dumptypes failed: $!\n", 1);
+}
+
+
+unless ( -e $ttype ) {
+    copy("$datadir/tapetypes", $ttype ) ||
+    &log_and_die ("ERROR: copy tapetypes file to $ttype failed: $!\n", 1);
+}
+
+
+
+# update $def_config value to the specified config value in advanced.conf
+    open(ADV, "$datadir/advanced.conf") || &log_and_die ("ERROR: Cannot open advanced.conf file: $!\n", 1);
+    open(NEWADV, ">$confdir/$config/advanced.conf") || 
+       &log_and_die ("ERROR: Cannot create advanced.conf file: $!\n", 1);
+    while (<ADV>) {
+       $_ =~ s/$def_config/$config/;
+       print NEWADV $_;
+    }
+    close(ADV);
+    close(NEWADV);
+    &mprint ("$confdir/$config/advanced.conf created and updated\n");
+
+
+&create_curinfo_index_dir;
+&touch_list_files;
+
+
+if ( defined $template ) {
+# if any other parameters are provided, create a workable custom config
+       if ( defined $tapetype || defined $tpchanger || defined $tapedev
+        || defined $changerdev || defined $labelstr || defined $mailto || defined $dumpcycle
+        || defined $runspercycle || defined $runtapes || defined $tapecycle ) {
+               &mprint("Creating custom configuration using templates\n");
+               create_customconf();
+               if ( $template ne "harddisk" ) {
+                 &create_holding;
+               } else {
+                 if (defined $labelstr) {
+                   if ($labelstr=~/^([-\w.]+)$/) {
+                     &create_vtape unless ( defined $novtape );
+                   } else {
+                     &mprint ("WARNING: Only alphanumeric string is supported in labelstr when using template to create vtapes. ");
+                     &mprint ("If you want to use regex in labelstr, please create vtapes manually.\n");
+                   }
+                 }
+               }
+             } else {
+               $template_only=1;
+               $tapedev="$def_tapedev/$config";
+               &copy_template_file($template);
+               if ($template ne "harddisk") {
+                 unless ( -e "$amandahomedir/holdings/$config" ) {
+                   &create_holding;
+                 }
+               } else {  # harddisk and template only
+                 unless ( -e "$amandahomedir/vtapes/$config" || defined $novtape ) {
+                   &create_vtape;
+                 }
+               }
+             }
+       &copy_chg_manual_conf;
+      } else {
+&create_customconf;
+}
+
+&check_xinetd;
+&build_amanda_ssh_key;
+
+if ( $vtape_err ) {
+  &mprint("Error in creating virtual tape, please check log and create virtual tape manually.\n");
+  exit 1;
+}
+
+if ( $holding_err ) {
+  &mprint("Error in creating holding disk, please check log and create holding disk manually.\n");
+  exit 1;
+}
+
+
+
+if ( $vtape_err==0 && $holding_err==0) {
+  &mprint("DONE.\n");
+  exit 0;
+}
+
+
+$ENV{'PATH'} = $oldPATH;
+
+
+# THE END
diff --git a/server-src/amstatus.pl b/server-src/amstatus.pl
new file mode 100644 (file)
index 0000000..2c32d1b
--- /dev/null
@@ -0,0 +1,1439 @@
+#!@PERL@ -Tw
+#
+
+# Run perl.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+        & eval 'exec @PERL@ -S $0 $argv:q'
+               if 0;
+
+require "newgetopt.pl";
+use Time::Local;
+use Text::ParseWords;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/bin:/usr/bin:/usr/sbin:/sbin";       # force known path
+
+$confdir="@CONFIG_DIR@";
+$prefix='@prefix@';
+$prefix=$prefix;               # avoid warnings about possible typo
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;     # ditto
+$sbindir="@sbindir@";
+
+#$STATUS_STRANGE =  2;
+$STATUS_FAILED  =  4;
+$STATUS_MISSING =  8;
+$STATUS_TAPE    = 16;
+$exit_status    =  0;
+
+$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
+$suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+        $suf='-@VERSION@';
+}
+
+$result = &NGetOpt (   "summary",
+                       "stats|statistics",
+                       "dumping|d",
+                       "waitdumping|wdumping",
+                       "waittaper|wtaper",
+                       "dumpingtape|dtape",
+                       "writingtape|wtape",
+                       "finished",
+                       "failed|error",
+                       "estimate",
+                       "gestimate|gettingestimate",
+                       "date",
+                       "config|c:s",
+                       "file:s",
+                       "locale-independent-date-format",
+                       );
+if($result !=1 ) {
+       &usage();
+}
+
+if( defined $opt_config ) {
+       $conf = $opt_config;
+}
+else {
+       if($#ARGV == 0 ) {
+               $conf=$ARGV[0];
+       }
+       else {
+               &usage();
+       }
+}
+
+#untaint user input $ARGV[0]
+
+if ($conf =~ /^([\w.-]+)$/) {          # $1 is untainted
+   $conf = $1;
+} else {
+    die "filename '$conf' has invalid characters.\n";
+}
+
+if ( ! -e "$confdir/$conf" ) {
+    print "Configuration directory '" . $confdir/$conf . "' doesn't exist\n";
+    exit 1;
+}
+if ( ! -d "$confdir/$conf" ) {
+    print "Configuration directory '" . $confdir/$conf . "' is not a directory\n";
+    exit 1;
+ }
+
+
+$pwd = `pwd`;
+chomp $pwd;
+chdir "$confdir/$conf";
+
+$logdir=`$sbindir/amgetconf$suf logdir`;
+exit 1 if $? != 0;
+chomp $logdir;
+$errfile="$logdir/amdump";
+
+$nb_options = defined( $opt_summary ) +
+                                 defined( $opt_stats ) +
+                                 defined( $opt_dumping ) +
+                                 defined( $opt_waitdumping ) +
+                                 defined( $opt_waittaper ) +
+                                 defined( $opt_dumpingtape ) +
+                                 defined( $opt_writingtape ) +
+                                 defined( $opt_finished ) +
+                                 defined( $opt_estimate ) +
+                                 defined( $opt_gestimate ) +
+                                 defined( $opt_failed );
+
+if($nb_options == 0 ) {
+       $opt_summary     = 1;
+       $opt_stats       = 1; 
+       $opt_dumping     = 1;
+       $opt_waitdumping = 1;
+       $opt_waittaper   = 1;
+       $opt_dumpingtape = 1;
+       $opt_writingtape = 1;
+       $opt_finished    = 1;
+       $opt_failed      = 1;
+       $opt_gestimate   = 1;
+       $opt_estimate    = 1;
+}
+
+$unit=`$sbindir/amgetconf$suf displayunit`;
+chomp($unit);
+$unit =~ tr/A-Z/a-z/;
+$unitdivisor=1;
+if($unit eq 'k') {
+  $unitdivisor = 1;
+}
+elsif($unit eq 'm') {
+  $unitdivisor = 1024;
+}
+elsif($unit eq 'g') {
+  $unitdivisor = 1024*1024;
+}
+elsif($unit eq 't') {
+  $unitdivisor = 1024*1024*1024;
+}
+else {
+  $unit = 'k';
+  $unitdivisor = 1;
+}
+
+
+if( defined $opt_file) {
+       if( $opt_file =~ m,^/, ) {
+               $errfile = $opt_file;
+       } else {
+               $errfile = "$pwd/$opt_file";
+               $errfile = "$logdir/$opt_file" if ( ! (-f $errfile ));
+       }
+}
+else {
+       $errfile="$logdir/amflush" if(! (-f $errfile));
+       if (! -f $errfile) {
+               if (-f "$logdir/amflush.1" && -f "$logdir/amdump.1" &&
+                   -M "$logdir/amflush.1"  < -M "$logdir/amdump.1") {
+                       $errfile="$logdir/amflush.1";
+               } else {
+                       $errfile="$logdir/amdump.1";
+               }
+       }
+}
+
+open(AMDUMP,"<$errfile") || die("$errfile: $!");
+print "Using $errfile\n";
+
+$start_degraded_mode = 0;
+
+$label = "";                                   # -w fodder
+$origsize = 0;                                 # -w fodder
+$idle_dumpers = 0;
+$status_driver = "";
+$status_taper = 0;
+$estimate_done = 0;
+$holding_space = 0;
+$start_time = 0;
+@dumpers_active = ();
+$nb_tape = 0;
+$ntpartition{$nb_tape} = 0;
+$ntsize{$nb_tape} = 0;
+$ntesize{$nb_tape} = 0;
+$tape_size = 0;
+$driver_finished = 0;
+$generating_schedule = 0;
+
+while($lineX = <AMDUMP>) {
+       chomp $lineX;
+       $lineX =~ s/[:\s]+$//g; #remove separator at end of line
+       next if $lineX eq "";
+       @line = &quotewords('[:\s]+', 0, $lineX);
+       next if !defined $line[0];
+
+       if($line[0] eq "amdump" || $line[0] eq "amflush") {
+               if ($line[1] eq "start" && $line[2] eq "at") {
+                       $datestr = $lineX;
+                       $datestr =~ s/.*start at //g;
+                       if (!defined $opt_locale_independent_date_format) {
+                               print "From " . $datestr . "\n";
+                       }
+               } elsif($line[1] eq "datestamp") {
+                       $gdatestamp = $line[2];
+                       if(!defined $datestamp{$gdatestamp}) {
+                               $datestamp{$gdatestamp} = 1;
+                               push @datestamp, $gdatestamp;
+                       }
+               } elsif($line[1] eq "starttime") {
+                       $starttime=&set_starttime($line[2]);
+               } elsif($line[1] eq "starttime-locale-independent") {
+                       if (defined $opt_locale_independent_date_format) {
+                               printf "From " . $line[2] . " " . $line[3] . ":" . $line[4] . ":" . $line[5] . " " . $line[6] . "\n";
+                       }
+               }
+               if($line[0] eq "amflush") {
+                       $estimate_done=1;
+               }
+       } elsif($line[0] eq "planner") {
+               if($line[1] eq "timestamp") {
+                       $gdatestamp = $line[2];
+                       if(!defined $datestamp{$gdatestamp}) {
+                               $datestamp{$gdatestamp} = 1;
+                               push @datestamp, $gdatestamp;
+                       }
+               }
+               elsif($line[1] eq "FAILED") {
+                       #2:host 3:disk 4:datestamp 5:level 6:errmsg
+                       $host=$line[2];
+                       $partition=$line[3];
+                       $datestamp=$line[4];
+                       $hostpart=&make_hostpart($host,$partition,$datestamp);
+                       $dump_started{$hostpart}=-1;
+                       $level{$hostpart}=$line[5];
+                       $error{$hostpart}="planner: " . $line[6];
+       } elsif($line[1] eq "time") {
+               if($line[3] eq "got") {
+                               if($line[4] eq "result") {
+                                       $host = $line[7];
+                                       $partition = $line[9];
+                                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
+                                       $estimate{$hostpart}=1;
+                                       $level{$hostpart}=$line[10];
+                                       $line[12] =~ /(\d+)K/;
+                                       $esize{$hostpart}=$1 / $unitdivisor;
+                                       $partialestimate{$hostpart}=0;
+                                       $getest{$hostpart} = "";
+                               } elsif($line[4] eq "partial") {
+                                       $host = $line[8];
+                                       $partition = $line[10];
+                                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
+                                       $level1 = $line[11];
+                                       $line[13] =~ /(-?\d+)K/;
+                                       $size1 = $1;
+                                       $level2 = $line[14];
+                                       $line[16] =~ /(-?\d+)K/;
+                                       $size2 = $1;
+                                       $level3 = $line[17];
+                                       $line[19] =~ /(-?\d+)K/;
+                                       $size3 = $1;
+                                       if($size1 > 0 || $size2 > 0 || $size3 > 0) {
+                                               $estimate{$hostpart}=1;
+                                               $level{$hostpart}=$line[11];
+                                               $esize{$hostpart}=$size1 / $unitdivisor;
+                                               $partialestimate{$hostpart}=1;
+                                               if($size1 > 0) { $getest{$hostpart} =~ s/:$level1://; }
+                                               if($size2 > 0) { $getest{$hostpart} =~ s/:$level2://; }
+                                               if($size3 > 0) { $getest{$hostpart} =~ s/:$level3://; }
+                                               if($getest{$hostpart} eq "") {$partialestimate{$hostpart}=0;}
+                                       }
+                               }
+                       } elsif($line[3] eq "getting" &&
+                                         $line[4] eq "estimates" &&
+                                         $line[5] eq "took") {
+                               $estimate_done=1;
+                       }
+               }
+       } elsif($line[0] eq "setup_estimate") {
+               $host = $line[1];
+               $partition = $line[2];
+               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
+               $estimate{$hostpart}=0;
+               $level{$hostpart}=0;
+               $degr_level{$hostpart}=-1;
+               $esize{$hostpart}=0;
+               $dump_started{$hostpart}=0;
+               $dump_finished{$hostpart}=0;
+               $taper_started{$hostpart}=0;
+               $taper_finished{$hostpart}=0;
+               $partialestimate{$hostpart}=0;
+               $error{$hostpart}="";
+               if($line[7] eq "last_level") {
+                       $getest{$hostpart}="";
+                       $level1 = $line[15];
+                       $level2 = $line[17];
+                       $level3 = $line[19];
+                       if($level1 != -1) { $getest{$hostpart} .= ":$level1:" };
+                       if($level2 != -1) { $getest{$hostpart} .= ":$level2:" };
+                       if($level3 != -1) { $getest{$hostpart} .= ":$level3:" };
+               }
+       } elsif($line[0] eq "GENERATING" &&
+                               $line[1] eq "SCHEDULE") {
+               $generating_schedule=1;
+       } elsif($line[0] eq "--------") {
+               if ($generating_schedule == 1) {
+                       $generating_schedule = 2;
+               } elsif ($generating_schedule == 2) {
+                       $generating_schedule = 3;
+               }
+       } elsif($line[0] eq "DUMP") {
+               if($generating_schedule == 2 ) {
+                       $host = $line[1];
+                       $partition = $line[3];
+                       $datestamp = $line[4];
+                       $hostpart=&make_hostpart($host,$partition,$datestamp);
+                       $level{$hostpart}=$line[6];
+                       $esize=$line[14];       #compressed size
+                       $esize=32 if $esize<32;
+                       $esize{$hostpart}=$esize / $unitdivisor;
+                       if(!defined($line[22])) {
+                               $degr_level{$hostpart}=-1;
+                       } else {
+                               $degr_level{$hostpart}=$line[18];
+                               $esize=$line[25];       #compressed size
+                               $esize=32 if $esize<32;
+                               $degr_size{$hostpart}=$esize / $unitdivisor;
+                       }
+               }
+       } elsif($line[0] eq "FLUSH") {
+               $host = $line[1];
+               $partition = $line[2];
+               $datestamp = $line[3];
+               $level = $line[4];
+               $holding_file = $line[5];
+               $hostpart=&make_hostpart($host,$partition,$datestamp);
+               $flush{$hostpart}=0;
+               $holding_file{$hostpart}=$holding_file;
+               $level{$hostpart}=$level;
+       } elsif($line[0] eq "driver") {
+               if($line[1] eq "start" && $line[2] eq "time") {
+                       $start_time=$line[3];
+                       $current_time=$line[3];
+                       $dumpers_active[0]=0;
+                       $dumpers_held[0]={};
+                       $dumpers_active=0;
+               }
+               elsif($line[1] eq "tape" && $line[2] eq "size") {
+                       $lineX =~ /^driver: start time (\S+)/;
+                       $tape_size = $line[3] / $unitdivisor;
+               }
+               elsif($line[1] eq "adding" &&
+                          $line[2] eq "holding" &&
+                               $line[3] eq "disk") {
+                       $holding_space += $line[8];
+               }
+               elsif($line[1] eq "send-cmd" && $line[2] eq "time") {
+                       #print "send-cmd: " , $line[5] . " " . $line[6] . " " . $line[7] . "\n" if defined $line[5] && defined $line[6] && defined $line[7];
+                       $current_time = $line[3];
+                       if($line[5] =~ /dumper\d*/) {
+                               $dumper = $line[5];
+                               if($line[6] eq "PORT-DUMP") {
+                                       #7:handle 8:port 9:host 10:amfeatures 11:disk 12:device 13:level ...
+                                       $host = $line[9];
+                                       $partition = $line[11];
+                                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
+                                       $serial=$line[7];
+                                       $dump_started{$hostpart}=1;
+                                       $dump_time{$hostpart}=$current_time;
+                                       $dump_finished{$hostpart}=0;
+                                       if(     $level{$hostpart} != $line[13] &&
+                                          $degr_level{$hostpart} == $line[13]) {
+                                               $level{$hostpart}=$degr_level{$hostpart};
+                                               $esize{$hostpart}=$degr_size{$hostpart};
+                                       }
+                                       if(! defined($busy_time{$dumper})) {
+                                               $busy_time{$dumper}=0;
+                                       }
+                                       $running_dumper{$dumper} = $hostpart;
+                                       $error{$hostpart}="";
+                                       $size{$hostpart} = 0;
+                                       $dumpers_active++;
+                                       if(! defined($dumpers_active[$dumpers_active])) {
+                                               $dumpers_active[$dumpers_active]=0;
+                                       }
+                                       if(! defined($dumpers_held[$dumpers_active])) {
+                                               $dumpers_held[$dumpers_active]={};
+                                       }
+                               }
+                       }
+                       elsif($line[5] =~ /chunker\d*/) {
+                               if($line[6] eq "PORT-WRITE") {
+                                       $host=$line[9];
+                                       $partition=$line[11];
+                                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
+                                       $serial=$line[7];
+                                       $serial{$serial}=$hostpart;
+                                       $holding_file{$hostpart}=$line[8];
+                                       #$chunk_started{$hostpart}=1;
+                                       $chunk_time{$hostpart}=$current_time;
+                                       #$chunk_finished{$hostpart}=0;
+                               }
+                               elsif($line[6] eq "CONTINUE") {
+                                       #7:handle 8:filename 9:chunksize 10:use
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       if($hostpart ne "") {
+                                               $dump_roomq{$hostpart}=undef;
+                                               $error{$hostpart}="";
+                                       }
+                               }
+                       }
+                       elsif($line[5] =~ /taper/) {
+                               if($line[6] eq "START-TAPER") {
+                                       #7:timestamp
+                                       $gdatestamp=$line[7];
+                                       if(!defined $datestamp{$gdatestamp}) {
+                                               $datestamp{$gdatestamp} = 1;
+                                               push @datestamp, $gdatestamp;
+                                       }
+                               }
+                               elsif($line[6] eq "FILE-WRITE") {
+                                       #7:handle 8:filename 9:host 10:disk 11:level 12:datestamp 13:splitsize
+                                       $serial=$line[7];
+                                       $host=$line[9];
+                                       $partition=$line[10];
+                                       $level=$line[11];
+                                       $ldatestamp=$line[12];
+                                       if(!defined $datestamp{$ldatestamp}) {
+                                               $datestamp{$ldatestamp} = 1;
+                                               push @datestamp, $ldatestamp;
+                                       }
+                                       $hostpart=&make_hostpart($host,$partition,$ldatestamp);
+                                       $serial{$serial}=$hostpart;
+                                       if(!defined $level{$hostpart}) {
+                                               $level{$hostpart} = $level;
+                                       }
+                                       $taper_started{$hostpart}=1;
+                                       $taper_finished{$hostpart}=0;
+                                       $taper_time{$hostpart}=$current_time;
+                                       $ntchunk_size = 0;
+                               }
+                               elsif($line[6] eq "PORT-WRITE") {
+                                       #7:handle 8:host 9:disk 10:level 11:datestamp 12:splitsize 13:diskbuffer 14:fallback_splitsize
+                                       $serial=$line[7];
+                                       $host=$line[8];
+                                       $partition=$line[9];
+                                       $level=$line[10];
+                                       $ldatestamp=$line[11];
+                                       $hostpart=&make_hostpart($host,$partition,$ldatestamp);
+                                       $serial{$serial}=$hostpart;
+                                       $taper_started{$hostpart}=1;
+                                       $taper_finished{$hostpart}=0;
+                                       $taper_time{$hostpart}=$current_time;
+                                       $ntchunk_size = 0;
+                               }
+                       }
+               }
+               elsif($line[1] eq "result" && $line[2] eq "time") {
+                       #print "result: " , $line[5] . " " . $line[6] . " " . $line[7] . "\n" if defined $line[5] && defined $line[6] && defined $line[7];
+                       $current_time = $line[3];
+                       if($line[5] =~ /dumper\d+/) {
+                               if($line[6] eq "FAILED" || $line[6] eq "TRY-AGAIN") {
+                                       #7:handle 8:message
+                                       $serial = $line[7];
+                                       $error = $line[8];
+                                       $hostpart=$serial{$serial};
+                             $dump_finished{$hostpart}=-1;
+                                       $busy_time{$line[5]}+=($current_time-$dump_time{$hostpart});
+                             $running_dumper{$line[5]} = "0";
+                             $dump_time{$hostpart}=$current_time;
+                             $error{$hostpart}="dumper: $error";
+                             $dumpers_active--;
+
+                               }
+                               elsif($line[6] eq "DONE") {
+                                       #7:handle 8:origsize 9:size ...
+                                       $serial=$line[7];
+                                       $origsize=$line[8] / $unitdivisor;
+                                       $outputsize=$line[9] / $unitdivisor;
+                                       $hostpart=$serial{$serial};
+                                       $size{$hostpart}=$outputsize;
+                                       $dump_finished{$hostpart}=1;
+                                       $busy_time{$line[5]}+=($current_time-$dump_time{$hostpart});
+                                       $running_dumper{$line[5]} = "0";
+                                       $dump_time{$hostpart}=$current_time;
+                                       $error{$hostpart}="";
+                                       $dumpers_active--;
+                               }
+                               elsif($line[6] eq "ABORT-FINISHED") {
+                                       #7:handle
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       $dump_started{$hostpart}=0;
+                                       $dump_finished{$hostpart}=0;
+                                       $busy_time{$line[5]}+=($current_time-$dump_time{$hostpart});
+                                       $running_dumper{$line[5]} = "0";
+                                       $dump_time{$hostpart}=$current_time;
+                                       $error{$hostpart}="dumper: (aborted)";
+                                       $dumpers_active--;
+                               }
+                       }
+                       elsif($line[5] =~ /chunker\d+/) {
+                               if($line[6] eq "DONE" || $line[6] eq "PARTIAL") {
+                                       #7:handle 8:size
+                                       $serial=$line[7];
+                                       $outputsize=$line[8] / $unitdivisor;
+                                       $hostpart=$serial{$serial};
+                                       $size{$hostpart}=$outputsize;
+                                       $dump_finished{$hostpart}=1;
+                                       $busy_time{$line[5]}+=($current_time-$chunk_time{$hostpart});
+                                       $running_dumper{$line[5]} = "0";
+                                       $chunk_time{$hostpart}=$current_time;
+                                       $error{$hostpart}="";
+                                       if ($line[6] eq "PARTIAL") {
+                                               $partial{$hostpart} = 1;
+                                       }
+                                       else {
+                                               $partial{$hostpart} = 0;
+                                       }
+                               }
+                               elsif($line[6] eq "FAILED") {
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       $dump_finished{$hostpart}=-1;
+                                       $busy_time{$line[5]}+=($current_time-$chunk_time{$hostpart});
+                                       $running_dumper{$line[5]} = "0";
+                                       $chunk_time{$hostpart}=$current_time;
+                                       $error{$hostpart}="chunker: " .$line[8] if $error{$hostpart} eq "";
+                               }
+                               elsif($line[6] eq "RQ-MORE-DISK") {
+                                       #7:handle
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       $dump_roomq{$hostpart}=1;
+                                       $error{$hostpart}="(waiting for holding disk space)";
+                               }
+                       }
+                       elsif($line[5] eq "taper") {
+                               if($line[6] eq "DONE" || $line[6] eq "PARTIAL") {
+                                       #7:handle 8:label 9:filenum 10:errstr
+                                       $serial=$line[7];
+                                       $label=$line[8];
+                                       $hostpart=$serial{$serial};
+                                       $line[10] =~ /sec (\S+) kb (\d+) kps/;
+                                       $size=$2 / $unitdivisor;
+                                       $taper_finished{$hostpart}=1;
+                                       $busy_time{"taper"}+=($current_time-$taper_time{$hostpart});
+                                       $taper_time{$hostpart}=$current_time;
+                                       if(!defined $size{$hostpart}) {
+                                               $size{$hostpart}=$size;
+                                       }
+                                       $ntpartition{$nb_tape}++;
+                                       $ntsize{$nb_tape} += $size{$hostpart} - $ntchunk_size;
+                                       if(defined $esize{$hostpart} && $esize{$hostpart} > 1) {
+                                               $ntesize{$nb_tape} += $esize{$hostpart} - $ntchunk_size;
+                                       }
+                                       else {
+                                               $ntesize{$nb_tape} += $size{$hostpart} - $ntchunk_size;
+                                       }
+                                       if ($line[6] eq "PARTIAL") {
+                                               $partial{$hostpart} = 1;
+                                       }
+                                       else {
+                                               $partial{$hostpart} = 0;
+                                       }
+                                       if ($ntchunk_size > 0) {
+                                               $ntchunk{$nb_tape}++;
+                                       }
+                               }
+                               elsif($line[6] eq "PARTDONE") {
+                                       #7:handle 8:label 9:filenum 10:ksize 11:errstr
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       #$line[11] =~ /.*kb (\d*) kps/;
+                                       #$size=$1 / $unitdivisor;
+                                       $size=$line[10] / $unitdivisor;
+                                       $tapedsize{$hostpart} += $size;
+                                       $ntchunk{$nb_tape}++;
+                                       $ntsize{$nb_tape} += $size;
+                                       $ntesize{$nb_tape} += $size;
+                                       $ntchunk_size += $size;
+                               }
+                               elsif($line[6] eq "REQUEST-NEW-TAPE") {
+                                       #7:serial
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       if (defined $hostpart) {
+                                               $error{$hostpart} = "waiting for a new tape";
+                                       }
+                               }
+                               elsif($line[6] eq "NEW-TAPE") {
+                                       #7:serial #8:label
+                                       $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       if (defined $hostpart) {
+                                               $error{$hostpart} = "";
+                                       }
+                               }
+                               elsif($line[6] eq "TRY-AGAIN" || $line[6] eq "TAPE-ERROR") {
+                                       #7:handle 8:errstr
+                                       $serial=$line[7];
+                                       $error=$line[8];
+                                       $hostpart=$serial{$serial};
+                                       if(defined $hostpart) {
+                                               $taper_finished{$hostpart}= $line[6] eq 'TAPE-ERROR' ? -2 : -1;
+                                               $busy_time{"taper"}+=($current_time-$taper_time{$hostpart});
+                                               $taper_time{$hostpart}=$current_time;
+                                               $error{$hostpart}="taper: $error";
+                                       }
+                               }
+                               elsif($line[6] eq "FAILED") {
+                                       #7:handle 8:INPUT- 9:TAPE- 10:input_message 11:tape_message
+                                  $serial=$line[7];
+                                       $hostpart=$serial{$serial};
+                                       if(defined $hostpart) {
+                                               if($line[9] eq "TAPE-ERROR") {
+                                                       $error=$line[11];
+                                                       $taper_finished{$hostpart} = -2;
+                                               }
+                                               else {
+                                                       $error=$line[10];
+                                                       $taper_finished{$hostpart} = -1;
+                                               }
+                                               $busy_time{"taper"}+=($current_time-$taper_time{$hostpart});
+                                               $taper_time{$hostpart}=$current_time;
+                                               $error{$hostpart}="$error";
+                                       }
+                               }
+                       }
+               }
+               elsif($line[1] eq "finished-cmd" && $line[2] eq "time") {
+                       $current_time=$line[3];
+                       if($line[4] =~ /dumper\d+/) {
+                       }
+               }
+               elsif($line[1] eq "dump" && $line[2] eq "failed") {
+                       #3:handle 4: 5: 6:"too many dumper retry"
+                       $serial=$line[3];
+                       $hostpart=$serial{$serial};
+                       $dump_started{$hostpart}=-1;
+                       $dump_finished{$hostpart}=-2;
+                       $error{$hostpart} .= "(" . $line[6] . ")";
+               }
+               elsif($line[1] eq "tape" && $line[2] eq "failed") {
+                       #3:handle 4: 5: 6:"too many dumper retry"
+                       $serial=$line[3];
+                       $hostpart=$serial{$serial};
+                       $taper_started{$hostpart}=-1;
+                       $taper_finished{$hostpart}=-2;
+                       $error{$hostpart} .= "(" . $line[6] . ")";
+               }
+               elsif($line[1] eq "state" && $line[2] eq "time") {
+                       #3:time 4:"free" 5:"kps" 6:free 7:"space" 8:space 9:"taper" 10:taper 11:"idle-dumpers" 12:idle-dumpers 13:"qlen" 14:"tapeq" 15:tapeq 16:"runq" 17:runq 18:"roomq" 19:roomq 20:"wakeup" 21:wakeup 22:"driver-idle" 23:driver-idle
+                       $current_time=$line[3];
+                       $status_taper=$line[10];
+                       $idle_dumpers=$line[12];
+
+                       $free{"kps"} = $line[6];
+                       $free{"space"} = $line[8];
+                       $qlen{"tapeq"} = $line[15];
+                       $qlen{"runq"} = $line[17];
+                       $qlen{"roomq"} = $line[19];
+
+                       if(defined($dumpers_active)) {
+                               if($status_driver ne "") {
+                                       $dumpers_active[$dumpers_active_prev]
+                                               +=$current_time-$state_time_prev;
+                                       $dumpers_held[$dumpers_active_prev]{$status_driver}
+                                               +=$current_time-$state_time_prev;
+                               }
+                               $state_time_prev=$current_time;
+                               $dumpers_active_prev=$dumpers_active;
+                               $status_driver=$line[16];
+                               if(! defined($dumpers_held[$dumpers_active]{$status_driver})) {
+                                       $dumpers_held[$dumpers_active]{$status_driver}=0;
+                               }
+                       }
+               }
+          elsif($line[1] eq "FINISHED") {
+                       $driver_finished = 1;
+               }
+       }
+       elsif($line[0] eq "dump") {
+               if($line[1] eq "of" &&
+                       $line[2] eq "driver" &&
+                       $line[3] eq "schedule" &&
+                       $line[4] eq "after" &&
+                       $line[5] eq "start" &&
+                       $line[6] eq "degraded" &&
+                       $line[7] eq "mode") {
+                       $start_degraded_mode=1;
+               }
+       }
+       elsif($line[0] eq "taper") {
+               if($line[1] eq "slot") {
+                       #2:slot 3:"wrote" 4:"label" 5:corrupted...
+                       $nb_tape++;
+                       $lineX =~ /wrote label `(\S*)'/;
+                       $label = $1;
+                       $ntlabel{$nb_tape} = $label;
+                       $ntpartition{$nb_tape} = 0;
+                       $ntsize{$nb_tape} = 0;
+                       $ntesize{$nb_tape} = 0;
+               }
+               elsif($line[1] eq "wrote") {
+                       #1:"wrote" 2:"label" 3:corrupted
+                       $nb_tape++;
+                       $lineX =~ /wrote label `(\S*)'/;
+                       $label = $1;
+                       $ntlabel{$nb_tape} = $label;
+                       $ntpartition{$nb_tape} = 0;
+                       $ntsize{$nb_tape} = 0;
+                       $ntesize{$nb_tape} = 0;
+               }
+       }
+   elsif($line[0] eq "splitting" &&
+                        $line[1] eq "chunk" &&
+                        $line[2] eq "that" &&
+                        $line[3] eq "started" &&
+                        $line[4] eq "at" &&
+                        $line[6] eq "after") {
+               $line[7] =~ /(\d*)kb/;
+               $size = $1;
+               $ntchunk{$nb_tape}++;
+          $ntsize{$nb_tape} += $size / $unitdivisor;
+               $ntesize{$nb_tape} += $size / $unitdivisor;
+               $ntchunk_size += $size / $unitdivisor;
+       }
+       else {
+               #print "Ignoring: $lineX\n";
+       }
+}
+
+close(AMDUMP);
+
+if(defined $current_time) {
+       for ($d = 0; $d < $#dumpers_active; $d++) {
+               $the_dumper = "dumper$d";
+               if(defined($running_dumper{$the_dumper}) &&
+                  $running_dumper{$the_dumper} ne "0") {
+                       $busy_time{$the_dumper}+=($current_time-$dump_time{$running_dumper{$the_dumper}});
+               }
+       }
+}
+
+print "\n";
+
+$nb_partition = 0;
+
+$epartition = 0;
+$estsize = 0;
+$fpartition = 0;
+$fsize = 0;
+$wpartition = 0;
+$wsize = 0;
+
+$flpartition = 0;
+$flsize = 0;
+$wfpartition = 0;
+$wfsize = 0;
+
+$dtpartition = 0;
+$dtesize = 0;
+$dupartition = 0;
+$dusize = 0;
+$duesize = 0;
+$dpartition = 0;
+$dsize = 0;
+$desize = 0;
+
+$twpartition = 0;
+$twsize = 0;
+$twesize = 0;
+$tapartition = 0;
+$tasize = 0;
+$taesize = 0;
+$tfpartition = 0;
+$tfsize = 0;
+$tfesize = 0;
+$tpartition = 0;
+$tsize = 0;
+$tesize = 0;
+
+$maxnamelength = 10;
+foreach $host (sort @hosts) {
+       foreach $partition (sort @$host) {
+               foreach $datestamp (sort @datestamp) {
+                       $hostpart=&make_hostpart($host,$partition,$datestamp);
+                       next if(!defined $estimate{$hostpart} && !defined $flush{$hostpart});
+                       if(length("$host:$partition") > $maxnamelength) {
+                               $maxnamelength = length("$host:$partition");
+                       }
+               }
+       }
+}
+
+foreach $host (sort @hosts) {
+       foreach $partition (sort @$host) {
+          foreach $datestamp (sort @datestamp) {
+                       $hostpart=&make_hostpart($host,$partition,$datestamp);
+                       next if(!defined $estimate{$hostpart} && !defined $flush{$hostpart});
+                       $nb_partition++;
+                       if( (!defined $size{$hostpart} || $size{$hostpart} == 0) &&
+                                defined $holding_file{$hostpart}) {
+                               $size{$hostpart} = &dump_size($holding_file{$hostpart}) / (1024 * $unitdivisor);
+                       }
+                       $in_flush=0;
+                       if($estimate_done != 1 && !defined $flush{$hostpart}) {
+                               if(defined $estimate{$hostpart}) {
+                                       if($estimate{$hostpart} != 1) {
+                                               if( defined $opt_gestimate) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s", "$host:$partition";
+                                                       print "              getting estimate\n";
+                                               }
+                                       }
+                                       else {
+                                               if(defined $opt_estimate ||
+                                                       (defined $opt_gestimate && $partialestimate{$hostpart} == 1)) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s", "$host:$partition";
+                                                       printf "%2d ",  $level{$hostpart};
+                                                       printf "%9d$unit", $esize{$hostpart};
+                                                       if($partialestimate{$hostpart} == 1) {
+                                                               print " partial";
+                                                       }
+                                                       print " estimate done\n";
+                                               }
+                                               $epartition++;
+                                               $estsize += $esize{$hostpart};
+                                       }
+                               }
+                       }
+                       else {
+                               if(defined $estimate{$hostpart}) {
+                                       if($estimate{$hostpart} == 1) {
+                                               $epartition++;
+                                               $estsize += $esize{$hostpart};
+                                       }
+                                       elsif (!defined $dump_started{$hostpart} || $dump_started{$hostpart} == 0) {
+                                               if( defined $opt_failed) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "           no estimate\n";
+                                               }
+                                               $exit_status |= $STATUS_FAILED;
+                                               $fpartition++;
+                                               $fsize+=$esize{$hostpart};
+                                       }
+                               }
+                               else {
+                                       $flpartition++;
+                                       $flsize += $size{$hostpart};
+                                       $in_flush=1;
+                               }
+                               if(defined $taper_started{$hostpart} &&
+                                               $taper_started{$hostpart}==1) {
+                                       if(defined $dump_started{$hostpart}) {
+                                               $dpartition++;
+                                               if(defined($size{$hostpart})) {
+                                                       $dsize += $size{$hostpart};
+                                               }
+                                               else {
+                                                       $dsize += $esize{$hostpart};
+                                               }
+                                               $desize += $esize{$hostpart};
+                                       }
+                                       if(defined $dump_started{$hostpart} &&
+                                               $dump_started{$hostpart} == 1 &&
+                                                       $dump_finished{$hostpart} == -1) {
+                                               if(defined $opt_failed) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $esize{$hostpart};
+                                                       print " dump to tape failed: " . $error{$hostpart};
+                                                       print "\n";
+                                               }
+                                               $exit_status |= $STATUS_FAILED;
+                                               $fpartition++;
+                                               $fsize+=$esize{$hostpart};
+                                       } elsif(defined $dump_started{$hostpart} &&
+                                               $dump_started{$hostpart} == 1 &&
+                                                       $dump_finished{$hostpart} == 0 &&
+                                                       $taper_started{$hostpart} == 1) {
+                                               if( defined $opt_dumpingtape ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $esize{$hostpart};
+                                                       print " dumping to tape";
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($taper_time{$hostpart}), ")";
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $dtpartition++;
+                                               $dtesize += $esize{$hostpart};
+                                       }
+                                       elsif($taper_finished{$hostpart} == 0) {
+                                               if( defined $opt_writingtape ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $size{$hostpart};
+                                                       if($in_flush == 0) {
+                                                               print " writing to tape";
+                                                       }
+                                                       else {
+                                                               print " flushing to tape";
+                                                       }
+                                                       if(defined($tapedsize{$hostpart})) {
+                                                               printf " (%d$unit done)", $tapedsize{$hostpart};
+                                                       }
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($taper_time{$hostpart}), ")";
+                                                       }
+                                                       print ", ", $error{$hostpart} if defined($error{$hostpart} &&
+                                                                                                                                          $error{$hostpart} ne "");
+                                                       print "\n";
+                                               }
+                                               $tapartition++;
+                                               $tasize += $size{$hostpart};
+                                               if(defined $esize{$hostpart}) {
+                                                       $taesize += $esize{$hostpart};
+                                               }
+                                               else {
+                                                       $taesize += $size{$hostpart};
+                                               }
+                                       }
+                                       elsif($taper_finished{$hostpart} < 0) {
+
+                                               if(defined $size{$hostpart}) {
+                                                       $xsize = $size{$hostpart};
+                                               }
+                                               elsif(defined $esize{$hostpart}) {
+                                                       $xsize = $esize{$hostpart};
+                                               }
+                                               else {
+                                                       $xsize = 0;
+                                               }
+
+                                               if(defined $esize{$hostpart}) {
+                                                       $exsize += $esize{$hostpart};
+                                               }
+                                               else {
+                                                       $exsize += $xsize;
+                                               }
+
+                                               if( defined $opt_failed  ||
+                                                        (defined $opt_waittaper && ($taper_finished{$hostpart} == -1))) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $xsize;
+                                                       if($in_flush == 0) {
+                                                               print " failed to tape";
+                                                       }
+                                                       else {
+                                                               print " failed to flush";
+                                                       }
+                                                       print ": ",$error{$hostpart} if defined $error{$hostpart};
+                                               
+                                                       print " (will retry)" unless $taper_finished{$hostpart} < -1;
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($taper_time{$hostpart}), ")";
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $exit_status |= $STATUS_TAPE;
+
+                                               $tfpartition++;
+                                               $tfsize += $xsize;
+                                               $tfesize += $exsize;
+
+                                               if($in_flush == 0) {
+                                                       $twpartition++;
+                                                       $twsize += $xsize;
+                                                       $twesize += $exsize;
+                                               }
+                                               else {
+                                                       $wfpartition++;
+                                                       $wfsize += $xsize;
+                                               }
+                                       }
+                                       elsif($taper_finished{$hostpart} == 1) {
+                                               if( defined $opt_finished ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $size{$hostpart};
+                                                       if($in_flush == 0) {
+                                                               print " finished";
+                                                       }
+                                                       else {
+                                                               print " flushed";
+                                                       }
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($taper_time{$hostpart}), ")";
+                                                       }
+                                                       if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
+                                                               print ", PARTIAL";
+                                                               $exit_status |= $STATUS_FAILED;
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $tpartition++;
+                                               $tsize += $size{$hostpart};
+                                               if(defined $esize{$hostpart} && $esize{$hostpart} > 1) {
+                                                       $tesize += $esize{$hostpart};
+                                               }
+                                               else {
+                                                       $tesize += $size{$hostpart};
+                                               }
+                                       }
+                                       else {
+                                               printf "%8s ", $datestamp if defined $opt_date;
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                               print " unknown state TAPER\n";
+                                       }
+                               }
+                               elsif(defined $dump_started{$hostpart}) {
+                                       if($dump_started{$hostpart} == -1) {
+                                               if( defined $opt_failed ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf " " . $error{$hostpart} . "\n";
+                                               }
+                                               $exit_status |= $STATUS_FAILED;
+
+                                               $fpartition++;
+                                               $fsize+=$esize{$hostpart};
+                                       }
+                                       elsif($dump_started{$hostpart} == 0) {
+                                               if($estimate{$hostpart} == 1) {
+                                                       if( defined $opt_waitdumping ) {
+                                                               printf "%8s ", $datestamp if defined $opt_date;
+                                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                               printf "%9d$unit", $esize{$hostpart};
+                                                               print " wait for dumping $error{$hostpart}\n";
+                                                       }
+                                                       if($driver_finished == 1) {
+                                                               $exit_status |= $STATUS_MISSING;
+                                                       }
+                                                       $wpartition++;
+                                                       $wsize += $esize{$hostpart};
+                                               }
+                                       }
+                                       elsif($dump_started{$hostpart} == 1 &&
+                                                       $dump_finished{$hostpart} == -1) {
+                                               if( defined $opt_failed ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       print " ", $error{$hostpart};
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($dump_time{$hostpart}), ")";
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $exit_status |= $STATUS_FAILED;
+                                               $fpartition++;
+                                               $fsize+=$esize{$hostpart};
+                                       }
+                                       elsif($dump_started{$hostpart} == 1 &&
+                                                       $dump_finished{$hostpart} != 1) {
+                                               if( defined $opt_dumping ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $esize{$hostpart};
+                                                       printf " dumping %8d$unit", $size{$hostpart};
+                                                       if($size{$hostpart} != 0) {
+                                                               printf " (%6.2f%%)", (100.0*$size{$hostpart})/$esize{$hostpart};
+                                                       }
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($dump_time{$hostpart}), ")";
+                                                       }
+                                                       if(defined $dump_roomq{$hostpart}) {
+                                                               print " " . $error{$hostpart};
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $dupartition++;
+                                               $dusize += $size{$hostpart};
+                                               $duesize += $esize{$hostpart};
+                                       }
+                                       elsif($dump_finished{$hostpart} == 1 &&
+                                                       $taper_started{$hostpart} != 1) {
+                                               if( defined $opt_waittaper ) {
+                                                       printf "%8s ", $datestamp if defined $opt_date;
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                                       printf "%9d$unit", $size{$hostpart};
+                                                       print " dump done";
+                                                       if( defined $starttime ) {
+                                                               print " (", &showtime($dump_time{$hostpart}), ")";
+                                                       }
+                                                       print ", wait for writing to tape";
+                                                       if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
+                                                               print ", PARTIAL";
+                                                               $exit_status |= $STATUS_FAILED;
+                                                       }
+                                                       print "\n";
+                                               }
+                                               $dpartition++;
+                                               $dsize += $size{$hostpart};
+                                               $desize += $esize{$hostpart};
+                                               $twpartition++;
+                                               $twsize += $size{$hostpart};
+                                               $twesize += $esize{$hostpart};
+                                       }
+                                       else {
+                                               printf "%8s ", $datestamp if defined $opt_date;
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                               print " unknown state DUMPER\n";
+                                       }
+                               }
+                               elsif(defined $flush{$hostpart}) {
+                                       if( defined $opt_waittaper ) {
+                                               printf "%8s ", $datestamp if defined $opt_date;
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                               printf "%9d$unit", $size{$hostpart};
+                                               print " waiting to flush";
+                                               if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
+                                                       print ", PARTIAL";
+                                                       $exit_status |= $STATUS_FAILED;
+                                               }
+                                               print "\n";
+                                       }
+                                       $wfpartition++;
+                                       $wfsize += $size{$hostpart};
+                               }
+                               elsif(defined $level{$hostpart}) {
+                                       printf "%8s ", $datestamp if defined $opt_date;
+                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
+                                       print " unknown state\n";
+                               }
+                       }
+               }
+       }
+}
+
+if (defined $opt_summary) {
+       print "\n";
+       print  "SUMMARY          part      real  estimated\n";
+       print  "                           size       size\n";
+       printf "partition       : %3d\n", $nb_partition;
+       printf "estimated       : %3d %20d$unit\n", $epartition , $estsize;
+       printf "flush           : %3d %9d$unit\n", $flpartition, $flsize;
+       printf "failed          : %3d %20d$unit           (%6.2f%%)\n",
+               $fpartition , $fsize,
+               $estsize ? ($fsize * 1.0 / $estsize) * 100 : 0.0;
+       printf "wait for dumping: %3d %20d$unit           (%6.2f%%)\n",
+               $wpartition , $wsize,
+               $estsize ? ($wsize * 1.0 / $estsize) * 100 : 0.0;
+       printf "dumping to tape : %3d %20d$unit           (%6.2f%%)\n",
+               $dtpartition, $dtesize,
+               $estsize ? ($dtesize * 1.0 / $estsize) * 100 : 0.0;
+       printf "dumping         : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $dupartition, $dusize, $duesize,
+               $duesize ? ($dusize * 1.0 / $duesize) * 100 : 0.0,
+               $estsize ? ($dusize * 1.0 / $estsize) * 100 : 0.0;
+       printf "dumped          : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $dpartition , $dsize , $desize,
+               $desize ? ($dsize * 1.0 / $desize) * 100 : 0.0,
+               $estsize ? ($dsize * 1.0 / $estsize) * 100 : 0.0;
+       printf "wait for writing: %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $twpartition, $twsize, $twesize,
+               $twesize ? ($twsize * 1.0 / $twesize) * 100 : 0.0,
+               $estsize ? ($twsize * 1.0 / $estsize) * 100 : 0.0;
+       printf "wait to flush   : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $wfpartition, $wfsize, $wfsize, 100, 0;
+       printf "writing to tape : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $tapartition, $tasize, $taesize,
+               $taesize ? ($tasize * 1.0 / $taesize) * 100 : 0.0,
+               $estsize ? ($tasize * 1.0 / $estsize) * 100 : 0.0;
+       printf "failed to tape  : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $tfpartition, $tfsize, $tfesize,
+               $tfesize ? ($tfsize * 1.0 / $tfesize) * 100 : 0.0,
+               $estsize ? ($tfsize * 1.0 / $estsize) * 100 : 0.0;
+       printf "taped           : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
+               $tpartition , $tsize , $tesize,
+               $tesize ? ($tsize * 1.0 / $tesize) * 100 : 0.0,
+               ($estsize+$flsize) ? ($tsize * 1.0 / ($estsize + $flsize)) * 100 : 0.0;
+       if($nb_tape > 1 || $tape_size != 0) {
+               for($i=1; $i <= $nb_tape; $i++) {
+                       if($tape_size != 0) {
+                               printf "  tape %-3d      : %3d %9d$unit %9d$unit (%6.2f%%) %s",
+                                       $i, $ntpartition{$i}, $ntsize{$i}, $ntesize{$i}, 100*$ntsize{$i}/$tape_size, $ntlabel{$i};
+                       }
+                       else {
+                               printf "  tape %-3d      : %3d %9d$unit %9d$unit %s",
+                                       $i, $ntpartition{$i}, $ntsize{$i}, $ntesize{$i}, $ntlabel{$i};
+                       }
+                       if(defined($ntchunk{$i}) && $ntchunk{$i} > 0) {
+                               printf " (%d chunks)", $ntchunk{$i};
+                       }
+                       print "\n";
+               }
+       }
+       if($idle_dumpers == 0) {
+               printf "all dumpers active\n";
+       }
+       else {
+               $c1 = ($idle_dumpers == 1) ? "" : "s";
+               $c2 = ($idle_dumpers < 10) ? " " : "";
+               $c3 = ($idle_dumpers == 1) ? " " : "";
+               printf "%d dumper%s idle%s %s: %s\n", $idle_dumpers, $c1, $c2, $c3, $status_driver;
+       }
+       if($status_taper eq "writing" && defined($qlen{"tapeq:"})) {
+               printf "taper writing, tapeq: %d\n", $qlen{"tapeq:"};
+       }
+       else {
+               printf "taper idle\n";
+       }
+       if (defined ($free{"kps:"})) {
+               printf "network free kps: %9d\n", $free{"kps:"};
+       }
+       if (defined ($free{"space:"})) {
+               if ($holding_space) {
+                       $hs = ($free{"space:"} * 1.0 / $holding_space) * 100;
+               } else {
+                       $hs = 0.0;
+               }
+               printf "holding space   : %9d$unit (%6.2f%%)\n", ($free{"space:"}/$unitdivisor), $hs;
+       }
+}
+
+if(defined $opt_stats) {
+       if(defined($current_time) && $current_time != $start_time) {
+               $total_time=$current_time-$start_time;
+               foreach $key (sort byprocess keys %busy_time) {
+                       printf "%8s busy   : %8s  (%6.2f%%)\n",
+                               $key, &busytime($busy_time{$key}),
+                               ($busy_time{$key} * 1.0 / $total_time) * 100;
+               }
+               for ($d = 0; $d <= $#dumpers_active; $d++) {
+                       $l = sprintf "%2d dumper%s busy%s : %8s  (%6.2f%%)",
+                               $d, ($d == 1) ? "" : "s", ($d == 1) ? " " : "",
+                               &busytime($dumpers_active[$d]),
+                               ($dumpers_active[$d] * 1.0 / $total_time) * 100;
+                       print $l;
+                       $s1 = "";
+                       $s2 = " " x length($l);
+                       $r = $dumpers_held[$d];
+                       foreach $key (sort valuesort keys %$r) {
+                               next
+                                 unless $dumpers_held[$d]{$key} >= 1;
+                               printf "%s%20s: %8s  (%6.2f%%)\n",
+                                       $s1,
+                                       $key,
+                                       &busytime($dumpers_held[$d]{$key}),
+                                       ($dumpers_held[$d]{$key} * 1.0 / $dumpers_active[$d]) * 100;
+                               $s1 = $s2;
+                       }
+                       if ($s1 eq "") {
+                               print "\n";
+                       }
+               }
+       }
+}
+
+exit $exit_status;
+
+sub make_hostpart() {
+       local($host,$partition,$datestamp) = @_;
+
+       if(! defined($hosts{$host})) {
+               push @hosts, $host;
+               $hosts{$host}=1;
+       }
+       my($new_part) = 1;
+       foreach $pp (sort @$host) {
+               $new_part = 0 if ($pp eq $partition);
+       }
+       push @$host, $partition if $new_part==1;
+
+       my($hostpart) = "$host$partition$datestamp";
+       if(!defined $datestamp{$datestamp}) {
+               $datestamp{$datestamp} = 1;
+               push @datestamp, $datestamp;
+       }
+
+       return $hostpart;
+}
+
+sub byprocess() {
+       my(@tmp_a) = split(/(\d*)$/, $a, 2);
+       my(@tmp_b) = split(/(\d*)$/, $b, 2);
+       return ($tmp_a[0] cmp $tmp_b[0]) || ($tmp_a[1] <=> $tmp_b[1]);
+}                               
+sub valuesort() {
+       $r->{$b} <=> $r->{$a};
+}
+
+sub dump_size() {
+       local($filename) = @_;
+       local($size);
+       local($dsize) = 0;
+       local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+                  $atime,$mtime,$ctime,$blksize,$blocks);
+       while ($filename ne "") {
+               $filename = "$filename.tmp" if (!(-e "$filename"));
+               $filename = "/dev/null" if (!(-e "$filename"));
+               ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+                               $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
+               $size=$size-32768 if $size > 32768;
+               $dsize += $size;
+               open(DUMP,$filename);
+               $filename = "";
+               while(<DUMP>) {
+                       if(/^CONT_FILENAME=(.*)$/) { $filename = $1; last }
+                       last if /^To restore, position tape at start of file and run/;
+               }
+               close(DUMP);
+       }
+       return $dsize;
+}
+
+sub unctime() {
+       my (@MoY);
+       my (@tl);
+       my ($a);
+       my ($m);
+       my ($month);
+       my ($time);
+
+       @MoY = ('Jan','Feb','Mar','Apr','May','Jun',
+               'Jul','Aug','Sep','Oct','Nov','Dec');
+
+       # Preset an array of values in case some parts are not passed as
+       # arguments.  This lets the date, etc, be omitted and default to
+       # today.
+
+       @tl = localtime;
+
+       foreach $a (@_) {
+               next
+                 if ($a eq '');
+
+               # See if this argument looks like a month name.
+
+               $month = 0;
+               foreach $m (@MoY) {
+                       last
+                         if ($m eq $a);
+                       $month = $month + 1;
+               }
+               if ($month < 12) {
+                       $tl[4] = $month;
+                       next;
+               }
+
+               # See if this is a day of the month.
+
+               if ($a =~ /^\d+$/ && $a >= 1 && $a <= 32) {
+                       $tl[3] = $a;
+                       next;
+               }
+
+               # See if the next argument looks like a time.
+
+               if ($a =~ /^(\d+):(\d+)/) {
+                       $tl[2] = $1;
+                       $tl[1] = $2;
+                       if ($a =~ /^(\d+):(\d+):(\d+)/) {
+                               $tl[0] = $3;
+                       }
+                       next;
+               }
+
+               # See if this is a year.
+
+               if ($a =~ /^\d\d\d\d$/ && $a >= 1900) {
+                       $tl[5] = $a;
+                       next;
+               }
+       }
+
+       $time = &timelocal (@tl);
+
+       return $time;
+}
+
+sub set_starttime() {
+       my (@tl);
+       my ($time);
+       my ($date);
+
+       # Preset an array of values in case some parts are not passed as
+       # arguments.  This lets the date, etc, be omitted and default to
+       # today.
+
+       ($date)=@_;
+       @tl = localtime;
+
+       $tl[5] = substr($date,  0, 4)   if(length($date) >= 4);
+       $tl[4] = substr($date,  4, 2)-1 if(length($date) >= 6);
+       $tl[3] = substr($date,  6, 2)   if(length($date) >= 8);
+       $tl[2] = substr($date,  8, 2)   if(length($date) >= 10);
+       $tl[1] = substr($date, 10, 2)   if(length($date) >= 12);
+       $tl[0] = substr($date, 12, 2)   if(length($date) >= 14);
+
+       $time = &timelocal (@tl);
+
+       return $time;
+}
+
+
+sub showtime() {
+       my($delta)=shift;
+       my($oneday)=24*60*60;
+
+       @now=localtime($starttime+$delta);
+       if($delta > $oneday) {
+               $result=sprintf("%d+",$delta/$oneday);
+       } else {
+               $result="";
+       }
+       $result.=sprintf("%d:%02d:%02d",$now[2],$now[1],$now[0]);
+       return $result;
+}
+
+sub busytime() {
+       my($busy)=shift;
+       my($oneday)=24*60*60;
+
+       if($busy > $oneday) {
+               $days=int($busy/$oneday);
+               $result=sprintf("%d+",$busy/$oneday);
+               $busy-=$days*$oneday;
+       } else {
+               $result="";
+       }
+       $hours=int($busy/60/60);
+       $busy-=$hours*60*60;
+       $minutes=int($busy/60);
+       $busy-=$minutes*60;
+       $seconds=$busy;
+       $result.=sprintf("%d:%02d:%02d",$hours,$minutes,$seconds);
+       return $result;
+}
+
+sub usage() {
+       print "amstatus [--config] config [--file amdump_file]\n";
+       print "         [--summary] [--dumping] [--waitdumping] [--waittaper]\n";
+       print "         [--dumpingtape] [--writingtape] [--finished] [--failed]\n";
+       print "         [--estimate] [--gestimate] [--stats] [--date] [--locale-independent-date-format]\n";
+       exit 0;
+}
diff --git a/server-src/amstatus.pl.in b/server-src/amstatus.pl.in
deleted file mode 100644 (file)
index db853d0..0000000
+++ /dev/null
@@ -1,1480 +0,0 @@
-#!@PERL@ -Tw
-#
-
-# Run perl.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-        & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-require "newgetopt.pl";
-use Time::Local;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$confdir="@CONFIG_DIR@";
-$prefix='@prefix@';
-$prefix=$prefix;               # avoid warnings about possible typo
-$exec_prefix="@exec_prefix@";
-$exec_prefix=$exec_prefix;     # ditto
-$sbindir="@sbindir@";
-
-#$STATUS_STRANGE =  2;
-$STATUS_FAILED  =  4;
-$STATUS_MISSING =  8;
-$STATUS_TAPE    = 16;
-$exit_status    =  0;
-
-$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
-$suf = '';
-if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
-        $suf='-@VERSION@';
-}
-
-$result = &NGetOpt (   "summary",
-                       "stats|statistics",
-                       "dumping|d",
-                       "waitdumping|wdumping",
-                       "waittaper|wtaper",
-                       "dumpingtape|dtape",
-                       "writingtape|wtape",
-                       "finished",
-                       "failed|error",
-                       "estimate",
-                       "gestimate|gettingestimate",
-                       "date",
-                       "config|c:s",
-                       "file:s"
-                       );
-if($result !=1 ) {
-       &usage();
-}
-
-if( defined $opt_config ) {
-       $conf = $opt_config;
-}
-else {
-       if($#ARGV == 0 ) {
-               $conf=$ARGV[0];
-       }
-       else {
-               &usage();
-       }
-}
-
-#untaint user input $ARGV[0]
-
-if ($conf =~ /^([\w.-]+)$/) {          # $1 is untainted
-   $conf = $1;
-} else {
-    die "filename '$conf' has invalid characters.\n";
-}
-
-
-if ( ! -e "$confdir/$conf" ) {
-    print "Configuration directory '" . $confdir/$conf . "' doesn't exist\n";
-    exit 1;
-}
-if ( ! -d "$confdir/$conf" ) {
-    print "Configuration directory '" . $confdir/$conf . "' is not a directory\n";
-    exit 1;
-}
-
-$pwd = `pwd`;
-chomp $pwd;
-chdir "$confdir/$conf";
-
-$logdir=`$sbindir/amgetconf$suf logdir`;
-exit 1 if $? != 0;
-chomp $logdir;
-$errfile="$logdir/amdump";
-
-$nb_options = defined( $opt_summary ) +
-                                 defined( $opt_stats ) +
-                                 defined( $opt_dumping ) +
-                                 defined( $opt_waitdumping ) +
-                                 defined( $opt_waittaper ) +
-                                 defined( $opt_dumpingtape ) +
-                                 defined( $opt_writingtape ) +
-                                 defined( $opt_finished ) +
-                                 defined( $opt_estimate ) +
-                                 defined( $opt_gestimate ) +
-                                 defined( $opt_failed );
-
-if($nb_options == 0 ) {
-       $opt_summary     = 1;
-       $opt_stats       = 1; 
-       $opt_dumping     = 1;
-       $opt_waitdumping = 1;
-       $opt_waittaper   = 1;
-       $opt_dumpingtape = 1;
-       $opt_writingtape = 1;
-       $opt_finished    = 1;
-       $opt_failed      = 1;
-       $opt_gestimate   = 1;
-       $opt_estimate    = 1;
-}
-
-$unit=`$sbindir/amgetconf$suf displayunit`;
-chomp($unit);
-$unitdivisor=1;
-if($unit eq 'K') {
-  $unitdivisor = 1;
-  $unit='k';
-}
-elsif($unit eq 'M') {
-  $unitdivisor = 1024;
-  $unit='m';
-}
-elsif($unit eq 'G') {
-  $unitdivisor = 1024*1024;
-  $unit='g';
-}
-elsif($unit eq 'T') {
-  $unitdivisor = 1024*1024*1024;
-  $unit='t';
-}
-
-
-if( defined $opt_file) {
-       if( $opt_file =~ m,^/, ) {
-               $errfile = $opt_file;
-       } else {
-               $errfile = "$pwd/$opt_file";
-               $errfile = "$logdir/$opt_file" if ( ! (-f $errfile ));
-       }
-}
-else {
-       $errfile="$logdir/amflush" if(! (-f $errfile));
-       if (! -f $errfile) {
-               if (-f "$logdir/amflush.1" && -f "$logdir/amdump.1" &&
-                   -M "$logdir/amflush.1"  < -M "$logdir/amdump.1") {
-                       $errfile="$logdir/amflush.1";
-               } else {
-                       $errfile="$logdir/amdump.1";
-               }
-       }
-}
-
-open(AMDUMP,"<$errfile") || die("$errfile: $!");
-print "Using $errfile";
-
-$start_degraded_mode = 0;
-
-$label = "";                                   # -w fodder
-$origsize = 0;                                 # -w fodder
-$idle_dumpers = 0;
-$status_driver = "";
-$status_taper = 0;
-$estimate_done = 0;
-$holding_space = 0;
-$start_time = 0;
-@dumpers_active = ();
-$nb_tape = 0;
-$ntpartition{$nb_tape} = 0;
-$ntsize{$nb_tape} = 0;
-$ntesize{$nb_tape} = 0;
-$tape_size = 0;
-$driver_finished = 0;
-
-while(<AMDUMP>) {
-       chomp;
-       if(/(amdump|amflush): start at (.*)/) {
-               print " from $2\n";
-       }
-       elsif(/(amdump|amflush): datestamp (\S+)/) {
-               $gdatestamp = $2;
-               if(!defined $datestamp{$gdatestamp}) {
-                       $datestamp{$gdatestamp} = 1;
-                       push @datestamp, $gdatestamp;
-               }
-               $starttime=&set_starttime($2);
-       }
-       elsif(/(amdump|amflush): starttime (\S+)/) {
-               $starttime=&set_starttime($2);
-       }
-       elsif(/planner: timestamp (\S+)/) {
-               $gdatestamp = $1;
-               if(!defined $datestamp{$gdatestamp}) {
-                       $datestamp{$gdatestamp} = 1;
-                       push @datestamp, $gdatestamp;
-               }
-       }
-       elsif(/setup_estimate: ([_\-\d\.A-Za-z]*):(\S+): command .*, options: *(\S+) *last_level -?\d+ next_level0 -?\d+ level_days \d+ *getting estimates (-?\d) \(-2\) (-?\d) \(-2\) (-?\d) \(-2\)/) {
-               $host=$1;
-               $partition=$2;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $estimate{$hostpart}=0;
-               $level{$hostpart}=0;
-               $esize{$hostpart}=0;
-               $dump_started{$hostpart}=0;
-               $dump_finished{$hostpart}=0;
-               $taper_started{$hostpart}=0;
-               $taper_finished{$hostpart}=0;
-               $partialestimate{$hostpart}=0;
-               $error{$hostpart}="";
-               if($4 != -1) { $getest{$hostpart} .= ":$4:" };
-               if($5 != -1) { $getest{$hostpart} .= ":$5:" };
-               if($6 != -1) { $getest{$hostpart} .= ":$6:" };
-       }
-       elsif(/setup_estimate: (\S+):(\S+): command .*, options:/) {
-               $host=$1;
-               $partition=$2;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $estimate{$hostpart}=0;
-               $level{$hostpart}=0;
-               $esize{$hostpart}=0;
-               $dump_started{$hostpart}=0;
-               $dump_finished{$hostpart}=0;
-               $taper_started{$hostpart}=0;
-               $taper_finished{$hostpart}=0;
-               $partialestimate{$hostpart}=0;
-               $error{$hostpart}="";
-               $_ = <AMDUMP>;
-               while (! /getting estimates/) { $_ = <AMDUMP>; }
-               chomp;
-               if(/getting estimates (-?\d) \(-2\) (-?\d) \(-2\) (-?\d) \(-2\)/) {
-                       if($1 != -1) { $getest{$hostpart} .= ":$1:" };
-                       if($2 != -1) { $getest{$hostpart} .= ":$2:" };
-                       if($3 != -1) { $getest{$hostpart} .= ":$3:" };
-               }
-               else {
-                       die("ERROR $_");
-               }
-       }
-       elsif(/got result for host (\S+) disk (\S+): (\d+) -> (\d+)K,/) {
-               $host=$1;
-               $partition=$2;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $estimate{$hostpart}=1;
-               $level{$hostpart}=$3;
-               $esize{$hostpart}=$4 / $unitdivisor;
-               $partialestimate{$hostpart}=0;
-               $getest{$hostpart} = "";
-       }
-       elsif(/got partial result for host (\S+) disk (\S+): (-?\d+) -> (-?\d+)K, (-?\d+) -> (-?\d+)K, (-?\d+) -> (-?\d+)K/) {
-               $host=$1;
-               $partition=$2;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               if($4 > 0 || $6 > 0 || $8 > 0) {
-                       $estimate{$hostpart}=1;
-                       $level{$hostpart}=$3;
-                       $esize{$hostpart}=$4 / $unitdivisor;
-                       $partialestimate{$hostpart}=1;
-                       if($4 > 0) { $getest{$hostpart} =~ s/:$3://; }
-                       if($6 > 0) { $getest{$hostpart} =~ s/:$5://; }
-                       if($8 > 0) { $getest{$hostpart} =~ s/:$7://; }
-
-                       if($getest{$hostpart} eq "") { $partialestimate{$hostpart}=0; }
-               }
-       }
-       elsif(/getting estimates took/) {
-               $estimate_done=1;
-       }
-       elsif(/amflush/) {
-               $estimate_done=1;
-       }
-       elsif(/GENERATING SCHEDULE:/) {
-               $generating_schedule=1;
-       }
-       elsif(/^(\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ (\d+) \d+/) {
-               if($generating_schedule == 1 ) {
-                       $host=$1;
-                       $partition=$2;
-                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-                       $level{"$hostpart"}=$4;
-                       $esize=$5;
-                       $esize=32 if $esize<32;
-                       $esize{$hostpart}=$esize / $unitdivisor;
-                       $degr_level{$hostpart}=-1;
-               }
-       }
-       elsif(/^DUMP (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ (\d+) \d+/) {
-               if($generating_schedule == 1 ) {
-                       $host=$1;
-                       $partition=$2;
-                       $datestamp=$3;
-                       $hostpart=&make_hostpart($host,$partition,$datestamp);
-                       $level{"$hostpart"}=$5;
-                       $esize=$6;
-                       $esize=32 if $esize<32;
-                       $esize{$hostpart}=$esize / $unitdivisor;
-                       $degr_level{$hostpart}=-1;
-               }
-       }
-       elsif(/^DUMP (\S+) (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ \d+ (\d+) \d+/) {
-               if($generating_schedule == 1 ) {
-                       $host=$1;
-                       $features=$2;
-                       $features=$features;
-                       $partition=$3;
-                       $datestamp=$4;
-                       $hostpart=&make_hostpart($host,$partition,$datestamp);
-                       $level{"$hostpart"}=$6;
-                       $esize=$7;
-                       $esize=32 if $esize<32;
-                       $esize{$hostpart}=$esize / $unitdivisor;
-                       $degr_level{$hostpart}=-1;
-               }
-       }
-       elsif(/^(\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ (\d+) \d+ (\d+) \d+:\d+:\d+:\d+:\d+:\d+ ([-]*\d+) \d+/) {
-               if($generating_schedule == 1 ) {
-                       $host=$1;
-                       $partition=$2;
-                       $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-                       $level{$hostpart}=$4;
-                       $esize=$5;
-                       $esize=32 if $esize<32;
-                       $esize{$hostpart}=$esize / $unitdivisor;
-                       $degr_level{$hostpart}=$6;
-                       $degr_size{$hostpart}=$7 / $unitdivisor;
-                       $degr_size{$hostpart}=32 if ($7 < 32);
-               }
-       }
-       elsif(/^DUMP (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ \d+ (\d+) \d+ (\d+) \d+:\d+:\d+:\d+:\d+:\d+ [-]*\d+ ([-]*\d+) \d+/) {
-               if($generating_schedule == 1 ) {
-                       $host=$1;
-                       $partition=$2;
-                       $datestamp=$3;
-                       $hostpart=&make_hostpart($host,$partition,$datestamp);
-                       $level{$hostpart}=$5;
-                       $esize=$6;
-                       $esize=32 if $esize<32;
-                       $esize{$hostpart}=$esize / $unitdivisor;
-                       $degr_level{$hostpart}=$7;
-                       $degr_size{$hostpart}=$8 / $unitdivisor;
-                       $degr_size{$hostpart}=32 if ($8 < 32);
-               }
-       }
-       elsif(/^FLUSH (\S+) (\S+) (\S+) (\d+) (\S+)/) {
-               $host=$1;
-               $partition=$2;
-               $datestamp="$3";
-               $level=$4;
-               $holding_file=$5;
-               $hostpart=&make_hostpart($host,$partition,$datestamp);
-               $flush{$hostpart}=0;
-               $holding_file{$hostpart}=$holding_file;
-               $level{$hostpart}=$level;
-       }
-       elsif(/^driver: start time (\S+)/) {
-               $start_time=$1;
-               $current_time=$1;
-               $dumpers_active[0]=0;
-               $dumpers_held[0]={};
-               $dumpers_active=0;
-       }
-       elsif(/^driver: tape size (\d+)/) {
-               $tape_size = $1 / $unitdivisor;
-       }
-       elsif(/^driver: adding holding disk \d+ dir \S+ size (\d+)/) {
-               $holding_space += $1;
-       }
-       elsif(/driver: send-cmd time (\S+) to (dumper\d*): (FILE-DUMP|PORT-DUMP) (\d+-\d+) (\S+) (\S+) (\S+) (\d+)/) {
-               $current_time=$1;
-               $host=$6;
-               $partition=$7;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial=$4;
-               $serial{$serial}=$hostpart;
-               $dump_started{$hostpart}=1;
-               $dump_time{$hostpart}=$1;
-               $dump_finished{$hostpart}=0;
-               if(     $level{$hostpart} != $8 &&
-                  $degr_level{$hostpart} == $8) {
-                       $level{$hostpart}=$degr_level{$hostpart};
-                       $esize{$hostpart}=$degr_size{$hostpart};
-               }
-               if(! defined($busy_time{$2})) {
-                       $busy_time{$2}=0;
-               }
-               $running_dumper{$2} = $hostpart;
-               $error{$hostpart}="";
-               $size{$hostpart} = 0;
-               $dumpers_active++;
-               if(! defined($dumpers_active[$dumpers_active])) {
-                       $dumpers_active[$dumpers_active]=0;
-               }
-               if(! defined($dumpers_held[$dumpers_active])) {
-                       $dumpers_held[$dumpers_active]={};
-               }
-       }
-       elsif(/driver: send-cmd time (\S+) to (chunker\d*): (PORT-WRITE) (\d+-\d+) (\S+) (\S+) (\S+) (\d+)/) {
-               $current_time=$1;
-               $host=$6;
-               $partition=$7;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial=$4;
-               $serial{$serial}=$hostpart;
-               #$chunk_started{$hostpart}=1;
-               $chunk_time{$hostpart}=$1;
-               #$chunk_finished{$hostpart}=0;
-               $holding_file{$hostpart}=$5;
-       }
-       elsif(/driver: send-cmd time (\S+) to (chunker\d*): (PORT-WRITE) (\d+-\d+) (\S+) (\S+) (\S+) (\S+) (\d+)/) {
-               $current_time=$1;
-               $host=$6;
-               $features=$7;
-               $features=$features;
-               $partition=$8;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial=$4;
-               $serial{$serial}=$hostpart;
-               #$chunk_started{$hostpart}=1;
-               $chunk_time{$hostpart}=$1;
-               #$chunk_finished{$hostpart}=0;
-               $holding_file{$hostpart}=$5;
-       }
-       elsif(/driver: send-cmd time (\S+) to (dumper\d*): (FILE-DUMP|PORT-DUMP) (\d+-\d+) (\S+) (\S+) (\S+) (\S+) (\d+)/) {
-               $current_time=$1;
-               $host=$6;
-               $partition=$7;
-               $device=$8;
-               $device=$device;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial=$4;
-               $serial{$serial}=$hostpart;
-               $dump_started{$hostpart}=1;
-               $dump_time{$hostpart}=$1;
-               $dump_finished{$hostpart}=0;
-               $holding_file{$hostpart}=$5 if $3 eq "FILE-DUMP";
-               if(     $level{$hostpart} != $9 &&
-                  $degr_level{$hostpart} == $9) {
-                       $level{$hostpart}=$degr_level{$hostpart};
-                       $esize{$hostpart}=$degr_size{$hostpart};
-               }
-               if(! defined($busy_time{$2})) {
-                       $busy_time{$2}=0;
-               }
-               $running_dumper{$2} = $hostpart;
-               $error{$hostpart}="";
-               $size{$hostpart} = 0;
-               $dumpers_active++;
-               if(! defined($dumpers_active[$dumpers_active])) {
-                       $dumpers_active[$dumpers_active]=0;
-               }
-               if(! defined($dumpers_held[$dumpers_active])) {
-                       $dumpers_held[$dumpers_active]={};
-               }
-       }
-       elsif(/driver: send-cmd time (\S+) to (dumper\d*): (FILE-DUMP|PORT-DUMP) (\d+-\d+) (\S+) (\S+) (\S+) (\S+) (\S+) (\d+)/) {
-               $current_time=$1;
-               $host=$6;
-               $features=$7;
-               $features=$features;
-               $partition=$8;
-               $device=$9;
-               $device=$device;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial=$4;
-               $serial{$serial}=$hostpart;
-               $dump_started{$hostpart}=1;
-               $dump_time{$hostpart}=$1;
-               $dump_finished{$hostpart}=0;
-               $holding_file{$hostpart}=$5 if $3 eq "FILE-DUMP";
-               if(     $level{$hostpart} != $10 &&
-                  $degr_level{$hostpart} == $10) {
-                       $level{$hostpart}=$degr_level{$hostpart};
-                       $esize{$hostpart}=$degr_size{$hostpart};
-               }
-               if(! defined($busy_time{$2})) {
-                       $busy_time{$2}=0;
-               }
-               $running_dumper{$2} = $hostpart;
-               $error{$hostpart}="";
-               $size{$hostpart} = 0;
-               $dumpers_active++;
-               if(! defined($dumpers_active[$dumpers_active])) {
-                       $dumpers_active[$dumpers_active]=0;
-               }
-               if(! defined($dumpers_held[$dumpers_active])) {
-                       $dumpers_held[$dumpers_active]={};
-               }
-       }
-       elsif(/driver: send-cmd time (\S+) to (chunker\d*): CONTINUE (\d+-\d+) (\S+) (\d+) (\d+)/) {
-               $current_time=$1;
-               $serial=$3;
-               $hostpart=$serial{$serial};
-               if($hostpart ne "") {
-                       $dump_roomq{$hostpart}=undef;
-                       $error{$hostpart}="";
-               }
-       }
-       elsif(/driver: result time (\S+) from (dumper\d+): FAILED (\d+-\d+) (.*)/) {
-               $current_time=$1;
-               $serial=$3;
-               $error=$4;
-               $hostpart=$serial{$serial};
-               $dump_finished{$hostpart}=-1;
-               $busy_time{$2}+=($1-$dump_time{$hostpart});
-               $running_dumper{$2} = "0";
-               $dump_time{$hostpart}=$1;
-               $error{$hostpart}="driver: $error";
-               $dumpers_active--;
-       }
-       elsif(/driver: result time (\S+) from (dumper\d+): TRY-AGAIN (\d+-\d+) (.*)/) {
-               $current_time=$1;
-               $serial=$3;
-               $error=$4;
-               $hostpart=$serial{$serial};
-               $dump_started{$hostpart}=0;
-               $dump_finished{$hostpart}=0;
-               $busy_time{$2}+=($1-$dump_time{$hostpart});
-               $running_dumper{$2} = "0";
-               $dump_time{$hostpart}=$1;
-               $error{$hostpart}="driver: (aborted:$error)";
-               $dumpers_active--;
-       }
-       elsif(/driver: result time (\S+) from (dumper\d+): (DONE|PARTIAL) (\d+-\d+) (\d+) (\d+) (\d+) "?\[.*\]"?/) {
-               $current_time=$1;
-               $serial=$4;
-               $origsize=$5 / $unitdivisor;
-               $outputsize=$6 / $unitdivisor;
-               $hostpart=$serial{$serial};
-               $size{$hostpart}=$outputsize;
-               $dump_finished{$hostpart}=1;
-               $busy_time{$2}+=($1-$dump_time{$hostpart});
-               $running_dumper{$2} = "0";
-               $dump_time{$hostpart}=$1;
-               $error{$hostpart}="";
-               $dumpers_active--;
-               if ($3 eq "PARTIAL") {
-                       $partial{$hostpart} = 1;
-               }
-               else {
-                       $partial{$hostpart} = 0;
-               }
-       }
-       elsif(/driver: result time (\S+) from (chunker\d+): (DONE|PARTIAL) (\d+-\d+) (\d+) "?\[.*\]"?/) {
-               $current_time=$1;
-               $serial=$4;
-               $outputsize=$5 / $unitdivisor;
-               $hostpart=$serial{$serial};
-               $size{$hostpart}=$outputsize;
-               $dump_finished{$hostpart}=1;
-               $busy_time{$2}+=($1-$chunk_time{$hostpart});
-               $running_dumper{$2} = "0";
-               $chunk_time{$hostpart}=$1;
-               $error{$hostpart}="";
-               if ($3 eq "PARTIAL") {
-                       $partial{$hostpart} = 1;
-               }
-               else {
-                       $partial{$hostpart} = 0;
-               }
-       }
-       elsif(/driver: result time (\S+) from (dumper\d+): ABORT-FINISHED (\d+-\d+)/) {
-               $current_time=$1;
-               $serial=$3;
-               $hostpart=$serial{$serial};
-               $dump_started{$hostpart}=0;
-               $dump_finished{$hostpart}=0;
-               $busy_time{$2}+=($1-$dump_time{$hostpart});
-               $running_dumper{$2} = "0";
-               $dump_time{$hostpart}=$1;
-               $error{$hostpart}="driver: (aborted)";
-               $dumpers_active--;
-       }
-       elsif(/driver: result time (\S+) from (chunker\d+): RQ-MORE-DISK (\d+-\d+)/) {
-               $current_time=$1;
-               $serial=$3;
-               $hostpart=$serial{$serial};
-               $dump_roomq{$hostpart}=1;
-               $error{$hostpart}="(waiting for holding disk space)";
-       }
-       elsif(/driver: finished-cmd time (\S+) dumper\d+ dumped (\S+):(\S+)/){
-               $current_time=$1;
-       }
-       elsif(/driver: send-cmd time (\S+) to taper: START-TAPER (\S+)/) {
-               if(!defined $gdatestamp) {
-                       $gdatestamp=$2;
-                       if(!defined $datestamp{$gdatestamp}) {
-                               $datestamp{$gdatestamp} = 1;
-                               push @datestamp, $gdatestamp;
-                       }
-               }
-       }
-       elsif(/driver: send-cmd time (\S+) to taper: FILE-WRITE (\d+-\d+) (\S+) (\S+) (\S+) (\d*) (\S+)/){
-               $current_time=$1;
-               $serial=$2;
-               $host=$4;
-               $partition=$5;
-               $level=$6;
-               $ldatestamp=$7;
-               if(!defined $datestamp{$ldatestamp}) {
-                       $datestamp{$ldatestamp} = 1;
-                       push @datestamp, $ldatestamp;
-               }
-               $hostpart=&make_hostpart($host,$partition,$ldatestamp);
-               $serial{$serial}=$hostpart;
-               if(!defined $level{$hostpart}) {
-                       $level{$hostpart} = $level;
-               }
-               $taper_started{$hostpart}=1;
-               $taper_finished{$hostpart}=0;
-               $taper_time{$hostpart}=$1;
-               $ntchunk_size = 0;
-       }
-       #features (maybe missing features)
-       elsif(/driver: send-cmd time (\S+) to taper: FILE-WRITE (\d+-\d+) (\S+) (\S+) (\S*) (\S+) (\d*) (\S+)/){
-               $current_time=$1;
-               $serial=$2;
-               $host=$4;
-               $features=$5;
-               $features=$features;
-               $partition=$6;
-               $level=$7;
-               $ldatestamp=$8;
-               if(!defined $datestamp{$ldatestamp}) {
-                       $datestamp{$ldatestamp} = 1;
-                       push @datestamp, $ldatestamp;
-               }
-               $hostpart=&make_hostpart($host,$partition,$ldatestamp);
-               $serial{$serial}=$hostpart;
-               if(!defined $level{$hostpart}) {
-                       $level{$hostpart} = $level;
-               }
-               $taper_started{$hostpart}=1;
-               $taper_finished{$hostpart}=0;
-               $taper_time{$hostpart}=$1;
-               $ntchunk_size = 0;
-       }
-       elsif(/driver: send-cmd time (\S+) to taper: PORT-WRITE (\d+-\d+) (\S+) (\S+) \d+( \d+|)/){
-               $current_time=$1;
-               $serial=$2;
-               $host=$3;
-               $partition=$4;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial{$serial}=$hostpart;
-               $taper_started{$hostpart}=1;
-               $taper_finished{$hostpart}=0;
-               $taper_time{$hostpart}=$1;
-               $ntchunk_size = 0;
-       }
-       elsif(/driver: send-cmd time (\S+) to taper: PORT-WRITE (\d+-\d+) (\S+) (\S+) (\S+) \d+ \d+/){
-               $current_time=$1;
-               $serial=$2;
-               $host=$3;
-               $features=$4;
-               $partition=$5;
-               $hostpart=&make_hostpart($host,$partition,$gdatestamp);
-               $serial{$serial}=$hostpart;
-               $taper_started{$hostpart}=1;
-               $taper_finished{$hostpart}=0;
-               $taper_time{$hostpart}=$1;
-               $ntchunk_size = 0;
-       }
-       elsif(/driver: result time (\S+) from taper: (DONE|PARTIAL) (\d+-\d+) (\S+) (\d+) "?\[sec (\S+) kb (\d+) kps/) {
-               $current_time=$1;
-               $serial=$3;
-               $label=$4;
-               $size=$7 / $unitdivisor;
-               $hostpart=$serial{$serial};
-               $taper_finished{$hostpart}=1;
-               $busy_time{"taper"}+=($1-$taper_time{$hostpart});
-               $taper_time{$hostpart}=$1;
-               if(!defined $size{$hostpart}) {
-                       $size{$hostpart}=$size;
-               }
-               $ntpartition{$nb_tape}++;
-               $ntsize{$nb_tape} += $size{$hostpart} - $ntchunk_size;
-               if(defined $esize{$hostpart} && $esize{$hostpart} > 1) {
-                       $ntesize{$nb_tape} += $esize{$hostpart} - $ntchunk_size;
-               }
-               else {
-                       $ntesize{$nb_tape} += $size{$hostpart} - $ntchunk_size;
-               }
-               if ($3 eq "PARTIAL") {
-                       $partial{$hostpart} = 1;
-               }
-               else {
-                       $partial{$hostpart} = 0;
-               }
-               if($ntchunk_size > 0) {
-                       $ntchunk{$nb_tape}++;
-               }
-       }
-       elsif(/driver: result time (\S+) from taper: (TRY-AGAIN|TAPE-ERROR) (\d+-\d+) (.+)/) {
-               $current_time=$1;
-               $serial=$3;
-               $error=$4;
-               $hostpart=$serial{$serial};
-               $taper_finished{$hostpart}= $2 eq 'TAPE-ERROR' ? -2 : -1;
-               $busy_time{"taper"}+=($1-$taper_time{$hostpart});
-               $taper_time{$hostpart}=$1;
-               $error{$hostpart}="driver: $error";
-       }
-       elsif(/driver: dump failed (\S+) (\S+) (\S+), too many dumper retry/) {
-               $serial=$1;
-               $hostpart=$serial{$serial};
-               $dump_started{$hostpart}=-1;
-               $dump_finished{$hostpart}=-2;
-               $error{$hostpart} .= "(too many dumper retry)";
-       }
-       elsif(/driver: tape failed (\S+) (\S+) (\S+), too many taper retry/) {
-               $serial=$1;
-               $hostpart=$serial{$serial};
-               $taper_started{$hostpart}=-1;
-               $taper_finished{$hostpart}=-2;
-               $error{$hostpart} .= "(too many taper retry)";
-       }
-       elsif(/planner: FAILED (\S+) (\S+) (\S+) (-?\d+) (.*)/) {
-               $host=$1;
-               $partition=$2;
-               $datestamp=$3;
-               $hostpart=&make_hostpart($host,$partition,$datestamp);
-               $dump_started{$hostpart}=-1;
-               $level{$hostpart}=$4;
-               $error{$hostpart}="planner: $5";
-       }
-       elsif(/dump of driver schedule after start degraded mode:/) {
-               $start_degraded_mode=1;
-       }
-       elsif(/driver: state time (\S+) free (.*) taper: (\S+) idle-dumpers: (\d+) qlen (.*) driver-idle: (\S+)/) {
-               $current_time=$1;
-               $status_taper=$3;
-               $idle_dumpers=$4;
-
-               %free = split (/ +/, $2);
-               %qlen = split (/ +/, $5);
-
-               if(defined($dumpers_active)) {
-                       if($status_driver ne "") {
-                               $dumpers_active[$dumpers_active_prev]
-                                       +=$current_time-$state_time_prev;
-                               $dumpers_held[$dumpers_active_prev]{$status_driver}
-                                       +=$current_time-$state_time_prev;
-                       }
-                       $state_time_prev=$current_time;
-                       $dumpers_active_prev=$dumpers_active;
-                       $status_driver=$6;
-                       if(! defined($dumpers_held[$dumpers_active]{$status_driver})) {
-                               $dumpers_held[$dumpers_active]{$status_driver}=0;
-                       }
-               }
-       }
-       elsif(/taper: .*wrote label `(\S*)'/) {
-               $nb_tape++;
-               $ntlabel{$nb_tape} = $1;
-               $ntpartition{$nb_tape} = 0;
-               $ntsize{$nb_tape} = 0;
-               $ntesize{$nb_tape} = 0;
-               $ntchunk{$nb_tape} = 0;
-       }
-       elsif(/splitting chunk that started at \d*kb after (\d*)kb/) {
-               $ntchunk{$nb_tape}++;
-               $ntsize{$nb_tape} += $1 / $unitdivisor;
-               $ntesize{$nb_tape} += $1 / $unitdivisor;
-               $ntchunk_size += $1 / $unitdivisor;
-       }
-       elsif(/driver: FINISHED/) {
-               $driver_finished = 1;
-       }
-       else {
-               #print "Ignoring: $_\n";
-       }
-}
-
-close(AMDUMP);
-
-if(defined $current_time) {
-       for ($d = 0; $d < $#dumpers_active; $d++) {
-               $the_dumper = "dumper$d";
-               if(defined($running_dumper{$the_dumper}) &&
-                  $running_dumper{$the_dumper} ne "0") {
-                       $busy_time{$the_dumper}+=($current_time-$dump_time{$running_dumper{$the_dumper}});
-               }
-       }
-}
-
-print "\n";
-
-$nb_partition = 0;
-
-$epartition = 0;
-$estsize = 0;
-$fpartition = 0;
-$fsize = 0;
-$wpartition = 0;
-$wsize = 0;
-
-$flpartition = 0;
-$flsize = 0;
-$wfpartition = 0;
-$wfsize = 0;
-
-$dtpartition = 0;
-$dtesize = 0;
-$dupartition = 0;
-$dusize = 0;
-$duesize = 0;
-$dpartition = 0;
-$dsize = 0;
-$desize = 0;
-
-$twpartition = 0;
-$twsize = 0;
-$twesize = 0;
-$tapartition = 0;
-$tasize = 0;
-$taesize = 0;
-$tfpartition = 0;
-$tfsize = 0;
-$tfesize = 0;
-$tpartition = 0;
-$tsize = 0;
-$tesize = 0;
-
-$maxnamelength = 10;
-foreach $host (sort @hosts) {
-       foreach $partition (sort @$host) {
-               foreach $datestamp (sort @datestamp) {
-                       $hostpart=&make_hostpart($host,$partition,$datestamp);
-                       next if(!defined $estimate{$hostpart} && !defined $flush{$hostpart});
-                       if(length("$host:$partition") > $maxnamelength) {
-                               $maxnamelength = length("$host:$partition");
-                       }
-               }
-       }
-}
-
-foreach $host (sort @hosts) {
-       foreach $partition (sort @$host) {
-          foreach $datestamp (sort @datestamp) {
-                       $hostpart=&make_hostpart($host,$partition,$datestamp);
-                       next if(!defined $estimate{$hostpart} && !defined $flush{$hostpart});
-                       $nb_partition++;
-                       if( (!defined $size{$hostpart} || $size{$hostpart} == 0) &&
-                                defined $holding_file{$hostpart}) {
-                               $size{$hostpart} = &dump_size($holding_file{$hostpart}) / (1024 * $unitdivisor);
-                       }
-                       $in_flush=0;
-                       if($estimate_done != 1 && !defined $flush{$hostpart}) {
-                               if(defined $estimate{$hostpart}) {
-                                       if($estimate{$hostpart} != 1) {
-                                               if( defined $opt_gestimate) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s", "$host:$partition";
-                                                       print "             getting estimate\n";
-                                               }
-                                       }
-                                       else {
-                                               if(defined $opt_estimate ||
-                                                       (defined $opt_gestimate && $partialestimate{$hostpart} == 1)) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s", "$host:$partition";
-                                                       printf "%2d ",  $level{$hostpart};
-                                                       printf "%9d$unit", $esize{$hostpart};
-                                                       if($partialestimate{$hostpart} == 1) {
-                                                               print " partial";
-                                                       }
-                                                       print " estimate done\n";
-                                               }
-                                               $epartition++;
-                                               $estsize += $esize{$hostpart};
-                                       }
-                               }
-                       }
-                       else {
-                               if(defined $estimate{$hostpart}) {
-                                       if($estimate{$hostpart} == 1) {
-                                               $epartition++;
-                                               $estsize += $esize{$hostpart};
-                                       }
-                                       elsif (!defined $dump_started{$hostpart} || $dump_started{$hostpart} == 0) {
-                                               if( defined $opt_failed) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "           no estimate\n";
-                                               }
-                                               $exit_status |= $STATUS_FAILED;
-                                               $fpartition++;
-                                               $fsize+=$esize{$hostpart};
-                                       }
-                               }
-                               else {
-                                       $flpartition++;
-                                       $flsize += $size{$hostpart};
-                                       $in_flush=1;
-                               }
-                               if(defined $taper_started{$hostpart} &&
-                                               $taper_started{$hostpart}==1) {
-                                       if(defined $dump_started{$hostpart}) {
-                                               $dpartition++;
-                                               if(defined($size{$hostpart})) {
-                                                       $dsize += $size{$hostpart};
-                                               }
-                                               else {
-                                                       $dsize += $esize{$hostpart};
-                                               }
-                                               $desize += $esize{$hostpart};
-                                       }
-                                       if(defined $dump_started{$hostpart} &&
-                                                       $dump_started{$hostpart} == 1 &&
-                                                       $dump_finished{$hostpart} == -1) {
-                                               if(defined $opt_failed) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $esize{$hostpart};
-                                                       print " dump to tape failed: " . $error{$hostpart};
-                                                       print "\n";
-                                               }
-                                               $exit_status |= $STATUS_FAILED;
-                                               $fpartition++;
-                                               $fsize+=$esize{$hostpart};
-                                       }
-                                       elsif(defined $dump_started{$hostpart} &&
-                                                       $dump_started{$hostpart} == 1 &&
-                                                       $dump_finished{$hostpart} == 0 &&
-                                                       $taper_started{$hostpart} == 1) {
-                                               if( defined $opt_dumpingtape ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $esize{$hostpart};
-                                                       print " dumping to tape";
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($taper_time{$hostpart}), ")";
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $dtpartition++;
-                                               $dtesize += $esize{$hostpart};
-                                       }
-                                       elsif($taper_finished{$hostpart} == 0) {
-                                               if( defined $opt_writingtape ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $size{$hostpart};
-                                                       if($in_flush == 0) {
-                                                               print " writing to tape";
-                                                       }
-                                                       else {
-                                                               print " flushing to tape";
-                                                       }
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($taper_time{$hostpart}), ")";
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $tapartition++;
-                                               $tasize += $size{$hostpart};
-                                               if(defined $esize{$hostpart}) {
-                                                       $taesize += $esize{$hostpart};
-                                               }
-                                               else {
-                                                       $taesize += $size{$hostpart};
-                                               }
-                                       }
-                                       elsif($taper_finished{$hostpart} < 0) {
-
-                                               if(defined $size{$hostpart}) {
-                                                       $xsize = $size{$hostpart};
-                                               }
-                                               elsif(defined $esize{$hostpart}) {
-                                                       $xsize = $esize{$hostpart};
-                                               }
-                                               else {
-                                                       $xsize = 0;
-                                               }
-
-                                               if(defined $esize{$hostpart}) {
-                                                       $exsize += $esize{$hostpart};
-                                               }
-                                               else {
-                                                       $exsize += $xsize;
-                                               }
-
-                                               if( defined $opt_failed  ||
-                                                        (defined $opt_waittaper && ($taper_finished{$hostpart} == -1))) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $xsize;
-                                                       if($in_flush == 0) {
-                                                               print " failed to tape";
-                                                       }
-                                                       else {
-                                                               print " failed to flush";
-                                                       }
-                                                       print " (will retry)" unless $taper_finished{$hostpart} < -1;
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($taper_time{$hostpart}), ")";
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $exit_status |= $STATUS_TAPE;
-
-                                               $tfpartition++;
-                                               $tfsize += $xsize;
-                                               $tfesize += $exsize;
-
-                                               if($in_flush == 0) {
-                                                       $twpartition++;
-                                                       $twsize += $xsize;
-                                                       $twesize += $exsize;
-                                               }
-                                               else {
-                                                       $wfpartition++;
-                                                       $wfsize += $xsize;
-                                               }
-                                       }
-                                       elsif($taper_finished{$hostpart} == 1) {
-                                               if( defined $opt_finished ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $size{$hostpart};
-                                                       if($in_flush == 0) {
-                                                               print " finished";
-                                                       }
-                                                       else {
-                                                               print " flushed";
-                                                       }
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($taper_time{$hostpart}), ")";
-                                                       }
-                                                       if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
-                                                               print ", PARTIAL";
-                                                               $exit_status |= $STATUS_FAILED;
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $tpartition++;
-                                               $tsize += $size{$hostpart};
-                                               if(defined $esize{$hostpart} && $esize{$hostpart} > 1) {
-                                                       $tesize += $esize{$hostpart};
-                                               }
-                                               else {
-                                                       $tesize += $size{$hostpart};
-                                               }
-                                       }
-                                       else {
-                                               printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                               print " unknown state TAPER\n";
-                                       }
-                               }
-                               elsif(defined $dump_started{$hostpart}) {
-                                       if($dump_started{$hostpart} == -1) {
-                                               if( defined $opt_failed ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf " " . $error{$hostpart} . "\n";
-                                               }
-                                               $exit_status |= $STATUS_FAILED;
-                                               
-                                               $fpartition++;
-                                               $fsize+=$esize{$hostpart};
-                                       }
-                                       elsif($dump_started{$hostpart} == 0) {
-                                               if($estimate{$hostpart} == 1) {
-                                                       if( defined $opt_waitdumping ) {
-                                                               printf "%8s ", $datestamp if defined $opt_date;
-                                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                               printf "%9d$unit", $esize{$hostpart};
-                                                               print " wait for dumping $error{$hostpart}\n";
-                                                       }
-                                                       if($driver_finished == 1) {
-                                                               $exit_status |= $STATUS_MISSING;
-                                                       }
-                                                       $wpartition++;
-                                                       $wsize += $esize{$hostpart};
-                                               }
-                                       }
-                                       elsif($dump_started{$hostpart} == 1 &&
-                                                       $dump_finished{$hostpart} == -1) {
-                                               if( defined $opt_failed ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       print " ", $error{$hostpart};
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($dump_time{$hostpart}), ")";
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $exit_status |= $STATUS_FAILED;
-                                               $fpartition++;
-                                               $fsize+=$esize{$hostpart};
-                                       }
-                                       elsif($dump_started{$hostpart} == 1 &&
-                                                       $dump_finished{$hostpart} != 1) {
-                                               if( defined $opt_dumping ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $esize{$hostpart};
-                                                       printf " dumping %8d$unit", $size{$hostpart};
-                                                       if($size{$hostpart} != 0) {
-                                                               printf " (%6.2f%%)", (100.0*$size{$hostpart})/$esize{$hostpart};
-                                                       }
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($dump_time{$hostpart}), ")";
-                                                       }
-                                                       if(defined $dump_roomq{$hostpart}) {
-                                                               print " " . $error{$hostpart};
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $dupartition++;
-                                               $dusize += $size{$hostpart};
-                                               $duesize += $esize{$hostpart};
-                                       }
-                                       elsif($dump_finished{$hostpart} == 1 &&
-                                                       $taper_started{$hostpart} != 1) {
-                                               if( defined $opt_waittaper ) {
-                                                       printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                                       printf "%9d$unit", $size{$hostpart};
-                                                       print " dump done";
-                                                       if( defined $starttime ) {
-                                                               print " (", &showtime($dump_time{$hostpart}), ")";
-                                                       }
-                                                       print ", wait for writing to tape";
-                                                       if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
-                                                               print ", PARTIAL";
-                                                               $exit_status |= $STATUS_FAILED;
-                                                       }
-                                                       print "\n";
-                                               }
-                                               $dpartition++;
-                                               $dsize += $size{$hostpart};
-                                               $desize += $esize{$hostpart};
-                                               $twpartition++;
-                                               $twsize += $size{$hostpart};
-                                               $twesize += $esize{$hostpart};
-                                       }
-                                       else {
-                                               printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                               print " unknown state DUMPER\n";
-                                       }
-                               }
-                               elsif(defined $flush{$hostpart}) {
-                                       if( defined $opt_waittaper ) {
-                                               printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                               printf "%9d$unit", $size{$hostpart};
-                                               print " waiting to flush";
-                                               if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
-                                                       print ", PARTIAL";
-                                                       $exit_status |= $STATUS_FAILED;
-                                               }
-                                               print "\n";
-                                       }
-                                       $wfpartition++;
-                                       $wfsize += $size{$hostpart};
-                               }
-                               elsif(defined $level{$hostpart}) {
-                                       printf "%8s ", $datestamp if defined $opt_date;
-                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
-                                       print " unknown state\n";
-                               }
-                       }
-               }
-       }
-}
-
-if (defined $opt_summary) {
-       print "\n";
-       print  "SUMMARY          part      real  estimated\n";
-       print  "                           size       size\n";
-       printf "partition       : %3d\n", $nb_partition;
-       printf "estimated       : %3d %20d$unit\n", $epartition , $estsize;
-       printf "flush           : %3d %9d$unit\n", $flpartition, $flsize;
-       printf "failed          : %3d %20d$unit           (%6.2f%%)\n",
-               $fpartition , $fsize,
-               $estsize ? ($fsize * 1.0 / $estsize) * 100 : 0.0;
-       printf "wait for dumping: %3d %20d$unit           (%6.2f%%)\n",
-               $wpartition , $wsize,
-               $estsize ? ($wsize * 1.0 / $estsize) * 100 : 0.0;
-       printf "dumping to tape : %3d %20d$unit           (%6.2f%%)\n",
-               $dtpartition, $dtesize,
-               $estsize ? ($dtesize * 1.0 / $estsize) * 100 : 0.0;
-       printf "dumping         : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $dupartition, $dusize, $duesize,
-               $duesize ? ($dusize * 1.0 / $duesize) * 100 : 0.0,
-               $estsize ? ($dusize * 1.0 / $estsize) * 100 : 0.0;
-       printf "dumped          : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $dpartition , $dsize , $desize,
-               $desize ? ($dsize * 1.0 / $desize) * 100 : 0.0,
-               $estsize ? ($dsize * 1.0 / $estsize) * 100 : 0.0;
-       printf "wait for writing: %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $twpartition, $twsize, $twesize,
-               $twesize ? ($twsize * 1.0 / $twesize) * 100 : 0.0,
-               $estsize ? ($twsize * 1.0 / $estsize) * 100 : 0.0;
-       printf "wait to flush   : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $wfpartition, $wfsize, $wfsize, 100, 0;
-       printf "writing to tape : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $tapartition, $tasize, $taesize,
-               $taesize ? ($tasize * 1.0 / $taesize) * 100 : 0.0,
-               $estsize ? ($tasize * 1.0 / $estsize) * 100 : 0.0;
-       printf "failed to tape  : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $tfpartition, $tfsize, $tfesize,
-               $tfesize ? ($tfsize * 1.0 / $tfesize) * 100 : 0.0,
-               $estsize ? ($tfsize * 1.0 / $estsize) * 100 : 0.0;
-       printf "taped           : %3d %9d$unit %9d$unit (%6.2f%%) (%6.2f%%)\n",
-               $tpartition , $tsize , $tesize,
-               $tesize ? ($tsize * 1.0 / $tesize) * 100 : 0.0,
-               ($estsize+$flsize) ? ($tsize * 1.0 / ($estsize + $flsize)) * 100 : 0.0;
-       if($nb_tape > 1 || $tape_size != 0) {
-               for($i=1; $i <= $nb_tape; $i++) {
-                       if($tape_size != 0) {
-                               printf "  tape %-3d      : %3d %9d$unit %9d$unit (%6.2f%%) %s",
-                                       $i, $ntpartition{$i}, $ntsize{$i}, $ntesize{$i}, 100*$ntsize{$i}/$tape_size, $ntlabel{$i};
-                               if($ntchunk{$i} > 0) {
-                                       printf " (%d chunks)", $ntchunk{$i};
-                               }
-                               print "\n";
-                       }
-                       else {
-                               printf "  tape %-3d      : %3d %9d$unit %9d$unit %s\n",
-                                       $i, $ntpartition{$i}, $ntsize{$i}, $ntesize{$i}, $ntlabel{$i};
-                       }
-               }
-       }
-       if($idle_dumpers ==0) {
-               printf "all dumpers active\n";
-       }
-       else {
-               $c1 = ($idle_dumpers == 1) ? "" : "s";
-               $c2 = ($idle_dumpers < 10) ? " " : "";
-               $c3 = ($idle_dumpers == 1) ? " " : "";
-               printf "%d dumper%s idle%s %s: %s\n", $idle_dumpers, $c1, $c2, $c3, $status_driver;
-       }
-       if($status_taper eq "writing" && defined($qlen{"tapeq:"})) {
-               printf "taper writing, tapeq: %d\n", $qlen{"tapeq:"};
-       }
-       else {
-               printf "taper idle\n";
-       }
-       if (defined ($free{"kps:"})) {
-               printf "network free kps: %9d\n", $free{"kps:"};
-       }
-       if (defined ($free{"space:"})) {
-               if ($holding_space) {
-                       $hs = ($free{"space:"} * 1.0 / $holding_space) * 100;
-               } else {
-                       $hs = 0.0;
-               }
-               printf "holding space   : %9d$unit (%6.2f%%)\n", ($free{"space:"}/$unitdivisor), $hs;
-       }
-}
-
-if(defined $opt_stats) {
-       if(defined($current_time) && $current_time != $start_time) {
-               $total_time=$current_time-$start_time;
-               foreach $key (sort byprocess keys %busy_time) {
-                       printf "%8s busy   : %8s  (%6.2f%%)\n",
-                               $key, &busytime($busy_time{$key}),
-                               ($busy_time{$key} * 1.0 / $total_time) * 100;
-               }
-               for ($d = 0; $d <= $#dumpers_active; $d++) {
-                       $l = sprintf "%2d dumper%s busy%s : %8s  (%6.2f%%)",
-                               $d, ($d == 1) ? "" : "s", ($d == 1) ? " " : "",
-                               &busytime($dumpers_active[$d]),
-                               ($dumpers_active[$d] * 1.0 / $total_time) * 100;
-                       print $l;
-                       $s1 = "";
-                       $s2 = " " x length($l);
-                       $r = $dumpers_held[$d];
-                       foreach $key (sort valuesort keys %$r) {
-                               next
-                                 unless $dumpers_held[$d]{$key} >= 1;
-                               printf "%s%20s: %8s  (%6.2f%%)\n",
-                                       $s1,
-                                       $key,
-                                       &busytime($dumpers_held[$d]{$key}),
-                                       ($dumpers_held[$d]{$key} * 1.0 / $dumpers_active[$d]) * 100;
-                               $s1 = $s2;
-                       }
-                       if ($s1 eq "") {
-                               print "\n";
-                       }
-               }
-       }
-}
-
-exit $exit_status;
-
-sub make_hostpart() {
-       local($host,$partition,$datestamp) = @_;
-
-       if(! defined($hosts{$host})) {
-               push @hosts, $host;
-               $hosts{$host}=1;
-       }
-       my($new_part) = 1;
-       foreach $pp (sort @$host) {
-               $new_part = 0 if ($pp eq $partition);
-       }
-       push @$host, $partition if $new_part==1;
-
-       my($hostpart) = "$host$partition$datestamp";
-       if(!defined $datestamp{$datestamp}) {
-               $datestamp{$datestamp} = 1;
-               push @datestamp, $datestamp;
-       }
-       return $hostpart;
-}
-
-sub byprocess() {
-       my(@tmp_a) = split(/(\d*)$/, $a, 2);
-       my(@tmp_b) = split(/(\d*)$/, $b, 2);
-       return ($tmp_a[0] cmp $tmp_b[0]) || ($tmp_a[1] <=> $tmp_b[1]);
-}                               
-sub valuesort() {
-       $r->{$b} <=> $r->{$a};
-}
-
-sub dump_size() {
-       local($filename) = @_;
-       local($size);
-       local($dsize) = 0;
-       local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
-                  $atime,$mtime,$ctime,$blksize,$blocks);
-       while ($filename ne "") {
-               $filename = "$filename.tmp" if (!(-e "$filename"));
-               $filename = "/dev/null" if (!(-e "$filename"));
-               ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
-                               $atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
-               $size=$size-32768 if $size > 32768;
-               $dsize += $size;
-               open(DUMP,$filename);
-               $filename = "";
-               while(<DUMP>) {
-                       if(/^CONT_FILENAME=(.*)$/) { $filename = $1; last }
-                       last if /^To restore, position tape at start of file and run/;
-               }
-               close(DUMP);
-       }
-       return $dsize;
-}
-
-sub unctime() {
-       my (@MoY);
-       my (@tl);
-       my ($a);
-       my ($m);
-       my ($month);
-       my ($time);
-
-       @MoY = ('Jan','Feb','Mar','Apr','May','Jun',
-               'Jul','Aug','Sep','Oct','Nov','Dec');
-
-       # Preset an array of values in case some parts are not passed as
-       # arguments.  This lets the date, etc, be omitted and default to
-       # today.
-
-       @tl = localtime;
-
-       foreach $a (@_) {
-               next
-                 if ($a eq '');
-
-               # See if this argument looks like a month name.
-
-               $month = 0;
-               foreach $m (@MoY) {
-                       last
-                         if ($m eq $a);
-                       $month = $month + 1;
-               }
-               if ($month < 12) {
-                       $tl[4] = $month;
-                       next;
-               }
-
-               # See if this is a day of the month.
-
-               if ($a =~ /^\d+$/ && $a >= 1 && $a <= 32) {
-                       $tl[3] = $a;
-                       next;
-               }
-
-               # See if the next argument looks like a time.
-
-               if ($a =~ /^(\d+):(\d+)/) {
-                       $tl[2] = $1;
-                       $tl[1] = $2;
-                       if ($a =~ /^(\d+):(\d+):(\d+)/) {
-                               $tl[0] = $3;
-                       }
-                       next;
-               }
-
-               # See if this is a year.
-
-               if ($a =~ /^\d\d\d\d$/ && $a >= 1900) {
-                       $tl[5] = $a;
-                       next;
-               }
-       }
-
-       $time = &timelocal (@tl);
-
-       return $time;
-}
-
-sub set_starttime() {
-       my (@tl);
-       my ($time);
-       my ($date);
-
-       # Preset an array of values in case some parts are not passed as
-       # arguments.  This lets the date, etc, be omitted and default to
-       # today.
-
-       ($date)=@_;
-       @tl = localtime;
-
-       $tl[5] = substr($date,  0, 4)   if(length($date) >= 4);
-       $tl[4] = substr($date,  4, 2)-1 if(length($date) >= 6);
-       $tl[3] = substr($date,  6, 2)   if(length($date) >= 8);
-       $tl[2] = substr($date,  8, 2)   if(length($date) >= 10);
-       $tl[1] = substr($date, 10, 2)   if(length($date) >= 12);
-       $tl[0] = substr($date, 12, 2)   if(length($date) >= 14);
-
-       $time = &timelocal (@tl);
-
-       return $time;
-}
-
-sub showtime() {
-       my($delta)=shift;
-       my($oneday)=24*60*60;
-
-       @now=localtime($starttime+$delta);
-       if($delta > $oneday) {
-               $result=sprintf("%d+",$delta/$oneday);
-       } else {
-               $result="";
-       }
-       $result.=sprintf("%d:%02d:%02d",$now[2],$now[1],$now[0]);
-       return $result;
-}
-
-sub busytime() {
-       my($busy)=shift;
-       my($oneday)=24*60*60;
-
-       if($busy > $oneday) {
-               $days=int($busy/$oneday);
-               $result=sprintf("%d+",$busy/$oneday);
-               $busy-=$days*$oneday;
-       } else {
-               $result="";
-       }
-       $hours=int($busy/60/60);
-       $busy-=$hours*60*60;
-       $minutes=int($busy/60);
-       $busy-=$minutes*60;
-       $seconds=$busy;
-       $result.=sprintf("%d:%02d:%02d",$hours,$minutes,$seconds);
-       return $result;
-}
-
-sub usage() {
-       print "amstatus [--config] config [--file amdump_file]\n";
-       print "         [--summary] [--dumping] [--waitdumping] [--waittaper]\n";
-       print "         [--dumpingtape] [--writingtape] [--finished] [--failed]\n";
-       print "         [--estimate] [--gestimate] [--stats] [--date]\n";
-       exit 0;
-}
index 4075ea44e2ef75d78c46a868e0d1cd60c7d5d506..fed07efd571fb00e5307920f16b84c8143671845 100644 (file)
 #include "conffile.h"
 #include "tapefile.h"
 #include "taperscan.h"
-#include "tapeio.h"
 #include "clock.h"
 #include "changer.h"
 #include "version.h"
+#include "device.h"
+#include "timestamp.h"
 
 /* local functions */
-void usage(void);
+static void usage(void);
 int main(int argc, char **argv);
-void reset_changer(int argc, char **argv);
-void eject_tape(int argc, char **argv);
-void clean_tape(int argc, char **argv);
-void load_slot(int argc, char **argv);
-void load_label(int argc, char **argv);
-void show_slots(int argc, char **argv);
-void show_current(int argc, char **argv);
-void update_labeldb (int argc, char **argv);
-void amtape_taper_scan(int argc, char **argv);
-void show_device(int argc, char **argv);
-int update_one_slot (void *ud, int rc, char *slotstr, char *device);
-int loadlabel_slot(void *ud, int rc, char *slotstr, char *device);
+static void reset_changer(int argc, char **argv);
+static void eject_tape(int argc, char **argv);
+static void clean_tape(int argc, char **argv);
+static void load_slot(int argc, char **argv);
+static void load_label(int argc, char **argv);
+static void show_slots(int argc, char **argv);
+static void show_current(int argc, char **argv);
+static void amtape_taper_scan(int argc, char **argv);
+static void show_device(int argc, char **argv);
+static int loadlabel_slot(void *ud, int rc, char *slotstr, char *device);
 int show_init(void *ud, int rc, int ns, int bk, int s);
-int show_init_all(void *ud, int rc, int ns, int bk, int s);
-int show_init_current(void *ud, int rc, int ns, int bk, int s);
-int show_slot(void *ud, int rc, char *slotstr, char *device);
+static int show_slots_slot(void *ud, int rc, char *slotstr, char *device);
 
 static const struct {
     const char *name;
@@ -63,49 +60,49 @@ static const struct {
     const char *usage;
 } cmdtab[] = {
     { "reset", reset_changer,
-       "reset                Reset changer to known state" },
+       T_("reset                Reset changer to known state") },
     { "eject", eject_tape,
-       "eject                Eject current tape from drive" },
+       T_("eject                Eject current tape from drive") },
     { "clean", clean_tape,
-       "clean                Clean the drive" },
+       T_("clean                Clean the drive") },
     { "show", show_slots,
-       "show                 Show contents of all slots" },
+       T_("show                 Show contents of all slots") },
     { "current", show_current,
-       "current              Show contents of current slot" },
+       T_("current              Show contents of current slot") },
     { "slot" , load_slot,
-       "slot <slot #>        load tape from slot <slot #>" },
+       T_("slot <slot #>        load tape from slot <slot #>") },
     { "slot" , load_slot,
-       "slot current         load tape from current slot" },
+       T_("slot current         load tape from current slot") },
     { "slot" , load_slot,
-       "slot prev            load tape from previous slot" },
+       T_("slot prev            load tape from previous slot") },
     { "slot" , load_slot,
-       "slot next            load tape from next slot" },
+       T_("slot next            load tape from next slot") },
     { "slot" , load_slot,
-       "slot advance         advance to next slot but do not load" },
+       T_("slot advance         advance to next slot but do not load") },
     { "slot" , load_slot,
-       "slot first           load tape from first slot" },
+       T_("slot first           load tape from first slot") },
     { "slot" , load_slot,
-       "slot last            load tape from last slot" },
+       T_("slot last            load tape from last slot") },
     { "label", load_label,
-       "label <label>        find and load labeled tape" },
+       T_("label <label>        find and load labeled tape") },
     { "taper", amtape_taper_scan,
-       "taper                perform taper's scan alg." },
+       T_("taper                perform taper's scan alg.") },
     { "device", show_device,
-       "device               show current tape device" },
-    { "update", update_labeldb,
-       "update               update the label matchingdatabase"},
+       T_("device               show current tape device") },
+    { "update", show_slots,
+       T_("update               update the label matchingdatabase")},
 };
 #define        NCMDS   (int)(sizeof(cmdtab) / sizeof(cmdtab[0]))
 
-void
+static void
 usage(void)
 {
     int i;
 
-    fprintf(stderr, "Usage: amtape%s <conf> <command> {<args>} [-o configoption]*\n", versionsuffix());
-    fprintf(stderr, "\tValid commands are:\n");
+    g_fprintf(stderr, _("Usage: amtape%s <conf> <command> {<args>} [-o configoption]*\n"), versionsuffix());
+    g_fprintf(stderr, _("\tValid commands are:\n"));
     for (i = 0; i < NCMDS; i++)
-       fprintf(stderr, "\t\t%s\n", cmdtab[i].usage);
+       g_fprintf(stderr, "\t\t%s\n", _(cmdtab[i].usage));
     exit(1);
 }
 
@@ -114,19 +111,19 @@ main(
     int                argc,
     char **    argv)
 {
-    char *conffile;
     char *conf_tapelist;
-    char *argv0 = argv[0];
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
     int i;
     int have_changer;
-    uid_t uid_me;
-    uid_t uid_dumpuser;
-    char *dumpuser;
-    struct passwd *pw;
-    int new_argc;
-    char **new_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
@@ -138,85 +135,48 @@ main(
 
     dbopen(DBG_SUBDIR_SERVER);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    if(new_argc < 3) usage();
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
+    if(argc < 3) usage();
 
-    config_name = new_argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL,
+               argv[1]);
+    apply_config_overwrites(cfg_ovr);
 
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if (read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
     amfree(conf_tapelist);
 
-    uid_me = getuid();
-    uid_dumpuser = uid_me;
-    dumpuser = getconf_str(CNF_DUMPUSER);
-
-    if ((pw = getpwnam(dumpuser)) == NULL) {
-       error("cannot look up dump user \"%s\"", dumpuser);
-       /*NOTREACHED*/
-    }
-    uid_dumpuser = pw->pw_uid;
-    if ((pw = getpwuid(uid_me)) == NULL) {
-       error("cannot look up my own uid %ld", (long)uid_me);
-       /*NOTREACHED*/
-    }
-    if (uid_me != uid_dumpuser) {
-       error("running as user \"%s\" instead of \"%s\"",
-             pw->pw_name, dumpuser);
-       /*NOTREACHED*/
-    }
-
     if((have_changer = changer_init()) == 0) {
-       error("no tpchanger specified in \"%s\"", conffile);
+       error(_("no tpchanger specified in \"%s\""), config_filename);
        /*NOTREACHED*/
     } else if (have_changer != 1) {
-       error("changer initialization failed: %s", strerror(errno));
+       error(_("changer initialization failed: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
     /* switch on command name */
 
-    new_argc -= 2; new_argv += 2;
+    argc -= 2; argv += 2;
     for (i = 0; i < NCMDS; i++)
-       if (strcmp(new_argv[0], cmdtab[i].name) == 0) {
-           (*cmdtab[i].fn)(new_argc, new_argv);
+       if (strcmp(argv[0], cmdtab[i].name) == 0) {
+           (*cmdtab[i].fn)(argc, argv);
            break;
        }
     if (i == NCMDS) {
-       fprintf(stderr, "%s: unknown command \"%s\"\n", argv0, new_argv[0]);
+       g_fprintf(stderr, _("%s: unknown command \"%s\"\n"), get_pname(), argv[0]);
        usage();
     }
 
     amfree(changer_resultstr);
-    amfree(conffile);
-    amfree(config_dir);
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
 
     dbclose();
     return 0;
@@ -224,27 +184,22 @@ main(
 
 /* ---------------------------- */
 
-void
-reset_changer(
-    int                argc,
-    char **    argv)
-{
+static void
+reset_changer(G_GNUC_UNUSED int        argc,
+              G_GNUC_UNUSED char ** argv) {
     char *slotstr = NULL;
 
-    (void)argc;        /* Quiet unused parameter warning */
-    (void)argv;        /* Quiet unused parameter warning */
-
     switch(changer_reset(&slotstr)) {
     case 0:
-       fprintf(stderr, "%s: changer is reset, slot %s is loaded.\n",
+       g_fprintf(stderr, _("%s: changer is reset, slot %s is loaded.\n"),
                get_pname(), slotstr);
        break;
     case 1:
-       fprintf(stderr, "%s: changer is reset, but slot %s not loaded: %s\n",
+       g_fprintf(stderr, _("%s: changer is reset, but slot %s not loaded: %s\n"),
                get_pname(), slotstr, changer_resultstr);
        break;
     default:
-       error("could not reset changer: %s", changer_resultstr);
+       error(_("could not reset changer: %s"), changer_resultstr);
        /*NOTREACHED*/
     }
     amfree(slotstr);
@@ -252,20 +207,15 @@ reset_changer(
 
 
 /* ---------------------------- */
-void
-clean_tape(
-    int                argc,
-    char **    argv)
-{
+static void
+clean_tape(G_GNUC_UNUSED int   argc,
+           G_GNUC_UNUSED char ** argv) {
     char *devstr = NULL;
 
-    (void)argc;        /* Quiet unused parameter warning */
-    (void)argv;        /* Quiet unused parameter warning */
-
     if(changer_clean(&devstr) == 0) {
-       fprintf(stderr, "%s: device %s is clean.\n", get_pname(), devstr);
+       g_fprintf(stderr, _("%s: device %s is clean.\n"), get_pname(), devstr);
     } else {
-       fprintf(stderr, "%s: device %s not clean: %s\n",
+       g_fprintf(stderr, _("%s: device %s not clean: %s\n"),
                get_pname(), devstr ? devstr : "??", changer_resultstr);
     }
     amfree(devstr);
@@ -273,20 +223,15 @@ clean_tape(
 
 
 /* ---------------------------- */
-void
-eject_tape(
-    int                argc,
-    char **    argv)
-{
+static void
+eject_tape(G_GNUC_UNUSED int   argc,
+           G_GNUC_UNUSED char ** argv) {
     char *slotstr = NULL;
 
-    (void)argc;        /* Quiet unused parameter warning */
-    (void)argv;        /* Quiet unused parameter warning */
-
     if(changer_eject(&slotstr) == 0) {
-       fprintf(stderr, "%s: slot %s is ejected.\n", get_pname(), slotstr);
+       g_fprintf(stderr, _("%s: slot %3s is ejected.\n"), get_pname(), slotstr);
     } else {
-       fprintf(stderr, "%s: slot %s not ejected: %s\n",
+       g_fprintf(stderr, _("%s: slot %3s not ejected: %s\n"),
                get_pname(), slotstr ? slotstr : "??", changer_resultstr);
     }
     amfree(slotstr);
@@ -295,32 +240,40 @@ eject_tape(
 
 /* ---------------------------- */
 
-void
+static void
 load_slot(
     int                argc,
     char **    argv)
 {
     char *slotstr = NULL, *devicename = NULL;
-    char *errstr;
     int is_advance;
+    Device * device;
 
     if(argc != 2)
        usage();
 
+    device_api_init();
+
     is_advance = (strcmp(argv[1], "advance") == 0);
     if(changer_loadslot(argv[1], &slotstr, &devicename)) {
-       error("could not load slot %s: %s", slotstr, changer_resultstr);
+       error(_("could not load slot %s: %s"), slotstr, changer_resultstr);
        /*NOTREACHED*/
     }
-    if(! is_advance && (errstr = tape_rewind(devicename)) != NULL) {
-       fprintf(stderr,
-               "%s: could not rewind %s: %s", get_pname(), devicename, errstr);
-       amfree(errstr);
+    
+    if (!is_advance) {
+        device = device_open(devicename);
+        if (device == NULL) {
+            g_fprintf(stderr,
+                    _("%s: could not open device %s"), get_pname(),
+                    devicename);
+        } else {
+            g_object_unref(device);
+        }
     }
 
-    fprintf(stderr, "%s: changed to slot %s", get_pname(), slotstr);
+    g_fprintf(stderr, _("%s: changed to slot %s"), get_pname(), slotstr);
     if(! is_advance) {
-       fprintf(stderr, " on %s", devicename);
+       g_fprintf(stderr, _(" on %s"), devicename);
     }
     fputc('\n', stderr);
     amfree(slotstr);
@@ -330,320 +283,254 @@ load_slot(
 
 /* ---------------------------- */
 
-int nslots, backwards, found, got_match, tapedays;
-char *datestamp;
-char *label = NULL, *first_match_label = NULL, *first_match = NULL;
-char *searchlabel, *labelstr;
-tape_t *tp;
-static int scan_init(void *ud, int rc, int ns, int bk, int s);
-
+/* This initalizes the ChangerStatus structure for all commands that
+   use changer_find; namely, show_slots, load_label, and
+   show_current. */
 static int 
-scan_init(
-    void *     ud,
-    int                rc,
-    int                ns,
-    int                bk,
-    int                s)
-{
-    (void)ud;  /* Quiet unused parameter warning */
-    (void)s;   /* Quiet unused parameter warning */
-
-    if(rc) {
-       error("could not get changer info: %s", changer_resultstr);
+scan_init(G_GNUC_UNUSED void * data, int rc, G_GNUC_UNUSED int numslots,
+          G_GNUC_UNUSED int backwards, G_GNUC_UNUSED int searchable) {
+    if(rc != 0) {
+       error(_("could not get changer info: %s"), changer_resultstr);
        /*NOTREACHED*/
     }
 
-    nslots = ns;
-    backwards = bk;
-
     return 0;
 }
 
-int
+static int scan_init_print(void * data, int rc, int numslots,
+                         int backwards, int searchable) {
+    
+    g_fprintf(stderr, _("%s: scanning all %d slots in tape-changer rack:\n"),
+            get_pname(), numslots);
+
+    return scan_init(data, rc, numslots, backwards, searchable);
+}
+
+typedef struct {
+    gboolean found;
+    char *searchlabel;
+} LabelChangerStatus;
+
+/* This is the 'user_slot' callback for the 'load label' command. */
+static int
 loadlabel_slot(
     void *     ud,
     int                rc,
     char *     slotstr,
-    char *     device)
+    char *     device_name)
 {
-    char *errstr;
-
-    (void)ud;  /* Quiet unused parameter warning */
+    LabelChangerStatus * status = ud;
+    Device * device;
+    ReadLabelStatusFlags label_status;
+
+    if (rc > 1) {
+       error(_("could not load slot %s: %s"), slotstr, changer_resultstr);
+        g_assert_not_reached();
+    } else if (rc == 1) {
+       g_fprintf(stderr, _("%s: slot %3s: %s\n"),
+               get_pname(), slotstr, changer_resultstr);
+        return 0;
+    }
 
-    if(rc > 1) {
-       error("could not load slot %s: %s", slotstr, changer_resultstr);
-       /*NOTREACHED*/
+    device = device_open(device_name);
+    if (device == NULL) {
+        g_fprintf(stderr, _("%s: slot %3s: Could not open device.\n"),
+                get_pname(), slotstr);
+        return 0;
     }
-    else if(rc == 1)
-       fprintf(stderr, "%s: slot %s: %s\n",
-               get_pname(), slotstr, changer_resultstr);
-    else if((errstr = tape_rdlabel(device, &datestamp, &label)) != NULL)
-       fprintf(stderr, "%s: slot %s: %s\n", get_pname(), slotstr, errstr);
-    else {
-       fprintf(stderr, "%s: slot %s: date %-8s label %s",
-               get_pname(), slotstr, datestamp, label);
-       if(strcmp(label, FAKE_LABEL) != 0
-          && strcmp(label, searchlabel) != 0)
-           fprintf(stderr, " (wrong tape)\n");
-       else {
-           fprintf(stderr, " (exact label match)\n");
-           if((errstr = tape_rewind(device)) != NULL) {
-               fprintf(stderr,
-                       "%s: could not rewind %s: %s",
-                       get_pname(), device, errstr);
-               amfree(errstr);
-           }
-           found = 1;
-           amfree(datestamp);
-           amfree(label);
-           return 1;
-       }
+    
+    device_set_startup_properties_from_config(device);
+
+    label_status = device_read_label(device);
+    if (label_status != READ_LABEL_STATUS_SUCCESS) {
+        char * errstr = 
+            g_english_strjoinv_and_free
+                (g_flags_nick_to_strv(label_status,
+                                      READ_LABEL_STATUS_FLAGS_TYPE), "or");
+        g_fprintf(stderr, _("%s: slot %3s: %s\n"),
+                get_pname(), slotstr, errstr);
+        g_object_unref(device);
+        return 0;
     }
-    amfree(datestamp);
-    amfree(label);
-    return 0;
+    
+    g_fprintf(stderr, _("%s: slot %3s: time %-14s label %s"),
+            get_pname(), slotstr, device->volume_time, device->volume_label);
+
+    if(strcmp(device->volume_label, status->searchlabel) != 0) {
+        g_fprintf(stderr, _(" (wrong tape)\n"));
+        g_object_unref(device);
+        return 0;
+    } else {
+        g_fprintf(stderr, _(" (exact label match)\n"));
+        g_object_unref(device);
+        status->found = 1;
+        return 1;
+    }
+
+    g_assert_not_reached();
 }
 
-void
+/* This does the 'load label' command. */
+static void
 load_label(
     int                argc,
     char **    argv)
 {
+    LabelChangerStatus status;
+
     if(argc != 2)
        usage();
+    
+    device_api_init();
 
-    searchlabel = argv[1];
+    status.searchlabel = argv[1];
 
-    fprintf(stderr, "%s: scanning for tape with label %s\n",
-           get_pname(), searchlabel);
+    g_fprintf(stderr, _("%s: scanning for tape with label %s\n"),
+           get_pname(), status.searchlabel);
 
-    found = 0;
+    status.found = 0;
 
-    changer_find(NULL, scan_init, loadlabel_slot, searchlabel);
+    changer_find(&status, scan_init, loadlabel_slot, status.searchlabel);
 
-    if(found)
-       fprintf(stderr, "%s: label %s is now loaded.\n",
-               get_pname(), searchlabel);
+    if(status.found)
+       g_fprintf(stderr, _("%s: label %s is now loaded.\n"),
+               get_pname(), status.searchlabel);
     else
-       fprintf(stderr, "%s: could not find label %s in tape rack.\n",
-               get_pname(), searchlabel);
+       g_fprintf(stderr, _("%s: could not find label %s in tape rack.\n"),
+               get_pname(), status.searchlabel);
 }
 
 
 /* ---------------------------- */
 
-int
-show_init(
-    void *     ud,
-    int                rc,
-    int                ns,
-    int                bk,
-    int                s)
-{
-    (void)ud;  /* Quiet unused parameter warning */
-    (void)s;   /* Quiet unused parameter warning */
-
-    if(rc) {
-       error("could not get changer info: %s", changer_resultstr);
-       /*NOTREACHED*/
-    }
-
-    nslots = ns;
-    backwards = bk;
-    return 0;
-}
-
-int
-show_init_all(
-    void *     ud,
-    int                rc,
-    int                ns,
-    int                bk,
-    int                s)
+/* This is the user_slot function for "amtape show". */
+static int
+show_slots_slot(G_GNUC_UNUSED void * data, int rc, char * slotstr,
+                char * device_name)
 {
-    int ret = show_init(NULL, rc, ns, bk, s);
-
-    (void)ud;  /* Quiet unused parameter warning */
-
-    fprintf(stderr, "%s: scanning all %d slots in tape-changer rack:\n",
-           get_pname(), nslots);
-    return ret;
-}
-
-int
-show_init_current(
-    void *     ud,
-    int                rc,
-    int                ns,
-    int                bk,
-    int                s)
-{
-    int ret = show_init(NULL, rc, ns, bk, s);
-
-    (void)ud;  /* Quiet unused parameter warning */
-
-    fprintf(stderr, "%s: scanning current slot in tape-changer rack:\n",
-           get_pname());
-    return ret;
-}
-
-int
-show_slot(
-    void *     ud,
-    int                rc,
-    char *     slotstr,
-    char *     device)
-{
-    char *errstr;
-
-    (void)ud;  /* Quiet unused parameter warning */
+    Device * device;
 
     if(rc > 1) {
-       error("could not load slot %s: %s", slotstr, changer_resultstr);
-       /*NOTREACHED*/
+       error(_("could not load slot %s: %s"), slotstr, changer_resultstr);
+        g_assert_not_reached();
     }
-    else if(rc == 1) {
-       fprintf(stderr, "slot %s: %s\n", slotstr, changer_resultstr);
+
+    if(rc == 1) {
+       g_fprintf(stderr, _("slot %s: %s\n"), slotstr, changer_resultstr);
+        return 0;
     }
-    else if((errstr = tape_rdlabel(device, &datestamp, &label)) != NULL) {
-       fprintf(stderr, "slot %s: %s\n", slotstr, errstr);
-       amfree(errstr);
+
+    device = device_open(device_name);
+    if (device == NULL) {
+        g_fprintf(stderr, _("%s: slot %3s: Could not open device.\n"),
+                get_pname(), slotstr);
     } else {
-       fprintf(stderr, "slot %s: date %-8s label %s\n",
-               slotstr, datestamp, label);
+        ReadLabelStatusFlags label_status;
+        device_set_startup_properties_from_config(device);
+        label_status = device_read_label(device);
+
+        if (label_status != READ_LABEL_STATUS_SUCCESS) {
+            char * errstr = 
+                g_english_strjoinv_and_free
+                (g_flags_nick_to_strv(label_status,
+                                      READ_LABEL_STATUS_FLAGS_TYPE), "or");
+            g_fprintf(stderr, _("%s: slot %3s: %s\n"),
+                    get_pname(), slotstr, errstr);
+        } else {
+            g_fprintf(stderr, _("slot %3s: time %-14s label %s\n"),
+                    slotstr, device->volume_time, device->volume_label);
+
+           /* update the changer db */
+           changer_label(slotstr, device->volume_label);
+        }
     }
-    amfree(datestamp);
-    amfree(label);
+
+    if (device != NULL)
+        g_object_unref(device);
+
     return 0;
 }
 
-void
-show_current(
-    int                argc,
-    char **    argv)
-{
-    (void)argv;        /* Quiet unused parameter warning */
-
+static void
+show_current(int argc, G_GNUC_UNUSED char ** argv) {
     if(argc != 1)
        usage();
 
-    changer_current(NULL, show_init_current, show_slot);
-}
+    device_api_init();
 
-void
-show_slots(
-    int                argc,
-    char **    argv)
-{
-    (void)argv;        /* Quiet unused parameter warning */
+    g_fprintf(stderr, _("%s: scanning current slot in tape-changer rack:\n"),
+           get_pname());
+    changer_current(NULL, scan_init, show_slots_slot);
+}
 
+static void
+show_slots(int argc, G_GNUC_UNUSED char ** argv) {
     if(argc != 1)
        usage();
 
-    changer_find(NULL, show_init_all, show_slot, NULL);
+    device_api_init();
+    changer_find(NULL, scan_init_print, show_slots_slot, NULL);
 }
 
 
 /* ---------------------------- */
 
-void
-amtape_taper_scan(
-    int                argc,
-    char **    argv)
-{
-    char *device = NULL;
+static void
+amtape_taper_scan(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv) {
     char *label = NULL;
-
-    (void)argc;        /* Quiet unused parameter warning */
-    (void)argv;        /* Quiet unused parameter warning */
-
-    if((tp = lookup_last_reusable_tape(0)) == NULL)
-       searchlabel = NULL;
-    else
+    char * searchlabel;
+    tape_t * tp;
+    char *timestamp = NULL;
+    char *tapedev = NULL;
+    int result;
+
+    device_api_init();
+    
+    g_fprintf(stderr, _("%s: scanning for "), get_pname());
+
+    tp = lookup_last_reusable_tape(0);
+    if (tp == NULL) {
+        searchlabel = NULL;
+    } else {
        searchlabel = stralloc(tp->label);
+        g_fprintf(stderr, _("tape label %s or "), searchlabel);
+    }
+    g_fprintf(stderr, _("a new tape.\n"));
 
-    tapedays   = getconf_int(CNF_TAPECYCLE);
-    labelstr   = getconf_str(CNF_LABELSTR);
-    found = 0;
-    got_match = 0;
-
-    fprintf(stderr, "%s: scanning for ", get_pname());
-    if(searchlabel) fprintf(stderr, "tape label %s or ", searchlabel);
-    fprintf(stderr, "a new tape.\n");
-
-    taper_scan(searchlabel, &label, &datestamp,&device, FILE_taperscan_output_callback, stderr);
+    result = taper_scan(searchlabel, &label, &timestamp, &tapedev, NULL,
+                       FILE_taperscan_output_callback, stderr, NULL, NULL);
 
-    fprintf(stderr, "%s: label %s is now loaded.\n",
-            get_pname(), label);
+    if (result < 0) {
+       g_fprintf(stderr, _("Could not find a  non-active Amanda tape.\n"));
+       if (label) {
+           g_fprintf(stderr, _("Tape with label `%s' is now loaded.\n"), label);
+       }
+    } else if (result == 3) {
+       g_fprintf(stderr, _("New tape loaded, it will be labelled `%s'.\n"),
+                 label);
+    } else {
+       g_fprintf(stderr, _("Tape with label `%s' is now loaded.\n"), label);
+    }
 
+    amfree(searchlabel);
     amfree(label);
-    amfree(datestamp);
-    amfree(device);
+    amfree(timestamp);
+    amfree(tapedev);
 }
 
 /* ---------------------------- */
 
-void
-show_device(
-    int                argc,
-    char **    argv)
-{
+static void
+show_device(G_GNUC_UNUSED int  argc,
+            G_GNUC_UNUSED char ** argv) {
     char *slot = NULL, *device = NULL;
-
-    (void)argc;        /* Quiet unused parameter warning */
-    (void)argv;        /* Quiet unused parameter warning */
-
-    if(changer_loadslot("current", &slot, &device)) {
-       error("Could not load current slot.\n");
+    
+    if(changer_loadslot(_("current"), &slot, &device)) {
+       error(_("Could not load current slot.\n"));
        /*NOTREACHED*/
     }
 
-    printf("%s\n", device);
+    g_printf("%s\n", device);
     amfree(slot);
     amfree(device);
 }
-
-/* ---------------------------- */
-
-int
-update_one_slot(
-    void *     ud,
-    int                rc,
-    char *     slotstr,
-    char *     device)
-{
-    char *errstr = NULL;
-    char *datestamp = NULL;
-    char *label = NULL;
-
-    (void)ud;  /* Quiet unused parameter warning */
-
-    if(rc > 1)
-       error("could not load slot %s: %s", slotstr, changer_resultstr);
-    else if(rc == 1)
-       fprintf(stderr, "slot %s: %s\n", slotstr, changer_resultstr);
-    else if((errstr = tape_rdlabel(device, &datestamp, &label)) != NULL)
-       fprintf(stderr, "slot %s: %s\n", slotstr, errstr);
-    else {
-       fprintf(stderr, "slot %s: date %-8s label %s\n",
-               slotstr, datestamp, label);
-       changer_label(slotstr, label);
-    }
-    amfree(errstr);
-    amfree(datestamp);
-    amfree(label);
-    return 0;
-}
-
-void
-update_labeldb(
-    int                argc,
-    char **    argv)
-{
-    (void)argv;        /* Quiet unused parameter warning */
-
-    if(argc != 1)
-       usage();
-
-    changer_find(NULL, show_init_all, update_one_slot, NULL);
-}
diff --git a/server-src/amtoc.pl b/server-src/amtoc.pl
new file mode 100644 (file)
index 0000000..79d0757
--- /dev/null
@@ -0,0 +1,257 @@
+#!@PERL@ -w
+
+# create a TOC (Table Of Content) file for an amanda dump
+
+# Author: Nicolas.Mayencourt@cui.unige.ch
+
+# release 3.1.4
+
+# HISTORY
+# 1.0 19??-??-?? nicolas@cui.unige.ch
+#      don't remember :-)
+# 2.0 1996-??-?? nicolas@cui.unige.ch
+#      amanda 2.2.6 support
+# 3.0 1999-02-17 Nicolas.Mayencourt@cui.unige.ch
+#      major rewrite, incompatible with release 2.0, amanda 2.4 support
+# 3.0.1 1999-02-17 oliva@dcc.unicamp.br
+#      minor fixes for multi-tape runs
+# 3.0.2 1999-02-28 martineau@IRO.UMontreal.CA
+#      output the datestamp of each dump
+# 3.0.3 1999-09-01 jrj@purdue.edu
+#      allow multiple -s entries
+# 3.0.4 1999-09-15 jrj@purdue.edu
+#      handle an image failing on one tape...
+# 3.1.0 1999-10-06 Nicolas.Mayencourt@cui.unige.ch
+#      add new options (-i -t)
+# 3.1.1 1999-10-08 Nicolas.Mayencourt@cui.unige.ch
+#      print original size, instead of size-on-tape
+# 3.1.2 1999-10-11 Nicolas.Mayencourt@cui.unige.ch
+#      really print original size, instead of size-on-tape
+# 3.1.3 Nicolas.Mayencourt@cui.unige.ch
+#      correct a bug for total report
+# 3.1.4 2000-01-14 dhw@whistle.com
+#      Add a flag (-w) for vertical whitespace
+
+
+#--------------------------------------------------------
+sub pr($$$$$$$) { 
+# you can update these proc if you want another formating
+# format: filenumber  host:part  date  level  size
+# If you use tabular option, modifie the format at the end of the code
+  if (defined($tabular)) {
+       $fnbr=$_[0];
+       $hstprt=$_[1] . ":" . $_[2];
+       $dt=$_[3];
+       $lvl=$_[4];
+       $sz=$_[5];
+       $ch=$_[6];
+    write($OF);
+  } else {
+    print $OF "$_[0]  $_[1]:$_[2]  $_[3]  $_[4]  $_[5]  $_[6]\n";
+  }
+}
+#--------------------------------------------------------
+
+
+
+#--------------------------------------------------------
+sub tfn($) {
+  # calculate tocfilename
+  $_ = $_[0];
+  foreach $s (@subs) {
+    eval $s;
+  }
+  return $dir . $_ ;
+}
+#--------------------------------------------------------
+
+
+#--------------------------------------------------------
+sub usage($) {
+  print STDERR "@_\n\n";
+  print STDERR "usage: amtoc [-a] [-i] [-t] [-f file] [-s subs] [-w] [--] logfile\n";
+  print STDERR "         -a      : file output to `label`.toc\n";
+  print STDERR "         -i      : Start TOC with a small help message\n";
+  print STDERR "         -t      : tabular output\n";
+  print STDERR "         -f file : output to file\n";
+  print STDERR "         -s subs : output file name evaluated to `eval \$subs`\n";
+  print STDERR "         -w      : add vertical whitespace after each tape\n";
+  print STDERR "         --      : last option\n";
+  print STDERR "         logfile : input file ('-' for stdin)\n";
+  exit;
+}
+#--------------------------------------------------------
+
+#--------------------------------------------------------
+sub init() {
+  &usage("amtoc required at least 'logfile' parameter.") if ($#ARGV==-1) ;
+
+  @subs = ();
+  for ($i=0;$i<=$#ARGV;$i++) {
+    if ($ARGV[$i] eq '-a') {
+        push (@subs, "s/\$/.toc/");
+      }
+    elsif ($ARGV[$i] eq '-i') {
+        $info=1;
+      }
+    elsif ($ARGV[$i] eq '-t') {
+        $tabular=1;
+      }
+    elsif ($ARGV[$i] eq '-f') {
+        $i++;
+        &usage("'-f' option require 'file' parameter.")  if ($i > $#ARGV);
+        $tocfilename=$ARGV[$i];
+      }
+    elsif ($ARGV[$i] eq '-s') {
+        $i++;
+        &usage("'-s' option require 'subs' parameter.")  if ($i > $#ARGV);
+        push (@subs, $ARGV[$i]);
+      }
+    elsif ($ARGV[$i] eq '-w') {
+        $vwspace=1;
+      }
+    elsif ($ARGV[$i] eq '--') {
+      # no more options: next arg == logfile
+        $i++;
+        &usage("amtoc required at least 'logfile' parameter.") if ($i > $#ARGV);
+        $logfile=$ARGV[$i];
+        &usage("too many parameters.") unless ($i == $#ARGV);
+      }
+    else {
+        $logfile=$ARGV[$i];
+        &usage("too many parameters.") unless ($i == $#ARGV);
+      }
+  }
+  &usage("amtoc required at least 'logfile' parameter.") unless ($logfile);
+}
+
+#--------------------------------------------------------
+
+&init;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$dir=$logfile;
+$dir =~ s/[^\/]*$//;
+
+
+if ($logfile eq '-') {$IF=STDIN} else 
+  {die ("Cannot open logfile $logfile") unless open (IF,"$logfile");$IF=IF;}
+
+$filenumber=0;
+$tot_or_size=0;
+
+while ( <$IF> ) {
+  $line = $_;
+  if ( /^FAIL dumper (\S+) (\S+)/ ) {
+    next;
+  }
+  if ( /^SUCCESS dumper (\S+) (\S+)/ ) {
+    $host = $1;
+    $disk = $2;
+    $line =~ /orig-kb (\d+)/;
+    $osize{$host}{$disk} = $1;
+    $tot_or_size += $osize{$host}{$disk};
+    $fail{$host}{$disk} = 0;
+    next;
+  }
+  if ( /^START amflush/ ) {
+    $flash_mode = 1;
+    next;
+  }
+  if ( ! /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+) (\S+)/) { next;}
+  # $_ = $1;
+  $host = $2;
+  $disk = $3;
+  $date = $4;
+  $chunk = $5;
+  $level = $6;
+  switch: {
+    /START taper/ && do {
+      $tocfilename=&tfn($chunk) if ($#subs >= 0);
+      if (!$tocfilename || ($tocfilename eq '-')) {$OF=STDOUT;}
+      else {
+          die ("Cannot open tocfile $tocfilename") unless open(OF,">$tocfilename");
+          $OF=OF;
+        }
+
+       print $OF "\f" if ($vwspace && $filenumber);
+       if (defined($info)) {
+         print $OF "AMANDA: To restore:\n";
+         print $OF "    position tape at start of file and run:\n";
+         print $OF "        dd if=<tape> bs=32k skip=1 [ | zcat ] | restore -...f\n";
+         print $OF "    or run: amrestore -p <tape> [host [partition]] | restore -...f\n";
+         print $OF "\n";
+       }
+
+
+
+      $filenumber=0;
+      &pr("#","Server","/partition","date", "level","size[Kb]","part");
+      &pr("$filenumber","$chunk","","$disk","-","-","-");
+      last switch; };
+    /^(?:SUCCESS|CHUNK) taper/ && do {
+      if(/SUCCESS/){
+       $level = $chunk;
+       $chunk = "-";
+      }
+      $mysize = 0;
+      if(/ kb (\d+) /){
+       $mysize = $1;
+      }
+      if ( $fail{$host}{$disk} ) {
+        &pr("$filenumber","${host}","${disk}","${date}","${level}","FAIL","${chunk}");
+      } else {
+       if (defined($flash_mode)) {
+          &pr("$filenumber","${host}","${disk}","${date}","${level}","$mysize","${chunk}");
+       } else {
+         if (defined($osize{$host}{$disk}) && !/^CHUNK/) {
+            &pr("$filenumber","${host}","${disk}","${date}","${level}","$osize{$host}{$disk}","${chunk}");
+         } else {
+           $note = "";
+           if(!/^CHUNK/){
+               # this case should never happend: 
+           $strange=1;
+             $note = "*";
+           }
+            &pr("$filenumber","${host}","${disk}","${date}","${level}","$note$mysize","${chunk}");
+         }
+       }
+      }
+      last switch;};
+    /INFO taper retrying/ && do {
+      --$filenumber;
+      last switch; };
+    /INFO taper tape .* \[OK\]/ && do {
+      $line =~ / kb (\d+) /;
+      $size = $1;
+      $line =~ / fm (\d+) /;
+      print "\n\n" if ($vwspace);
+      &pr("$1","total","on_tape","-","-","$size","-");
+      if (defined($flash_mode)) {
+       &pr("$1","total","origin","-","not","available","-");
+      } else {
+       &pr("$1","total","origin","-","-","$tot_or_size","-");
+      }
+      if (defined($strange)) {
+       &pr("*","size","on_tape","-","-","-","-");
+      }
+      last switch; };
+    /FAIL taper/ && do { next; };
+  }
+  $filenumber += 1;
+}
+close $IF;
+close OF;
+
+
+format OF =
+@>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>>
+$fnbr,$hstprt,$dt,$lvl,$sz
+.
+
+format STDOUT =
+@>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>> @>>>
+$fnbr,$hstprt,$dt,$lvl,$sz,$ch
+.
diff --git a/server-src/amtoc.pl.in b/server-src/amtoc.pl.in
deleted file mode 100644 (file)
index 79d0757..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-#!@PERL@ -w
-
-# create a TOC (Table Of Content) file for an amanda dump
-
-# Author: Nicolas.Mayencourt@cui.unige.ch
-
-# release 3.1.4
-
-# HISTORY
-# 1.0 19??-??-?? nicolas@cui.unige.ch
-#      don't remember :-)
-# 2.0 1996-??-?? nicolas@cui.unige.ch
-#      amanda 2.2.6 support
-# 3.0 1999-02-17 Nicolas.Mayencourt@cui.unige.ch
-#      major rewrite, incompatible with release 2.0, amanda 2.4 support
-# 3.0.1 1999-02-17 oliva@dcc.unicamp.br
-#      minor fixes for multi-tape runs
-# 3.0.2 1999-02-28 martineau@IRO.UMontreal.CA
-#      output the datestamp of each dump
-# 3.0.3 1999-09-01 jrj@purdue.edu
-#      allow multiple -s entries
-# 3.0.4 1999-09-15 jrj@purdue.edu
-#      handle an image failing on one tape...
-# 3.1.0 1999-10-06 Nicolas.Mayencourt@cui.unige.ch
-#      add new options (-i -t)
-# 3.1.1 1999-10-08 Nicolas.Mayencourt@cui.unige.ch
-#      print original size, instead of size-on-tape
-# 3.1.2 1999-10-11 Nicolas.Mayencourt@cui.unige.ch
-#      really print original size, instead of size-on-tape
-# 3.1.3 Nicolas.Mayencourt@cui.unige.ch
-#      correct a bug for total report
-# 3.1.4 2000-01-14 dhw@whistle.com
-#      Add a flag (-w) for vertical whitespace
-
-
-#--------------------------------------------------------
-sub pr($$$$$$$) { 
-# you can update these proc if you want another formating
-# format: filenumber  host:part  date  level  size
-# If you use tabular option, modifie the format at the end of the code
-  if (defined($tabular)) {
-       $fnbr=$_[0];
-       $hstprt=$_[1] . ":" . $_[2];
-       $dt=$_[3];
-       $lvl=$_[4];
-       $sz=$_[5];
-       $ch=$_[6];
-    write($OF);
-  } else {
-    print $OF "$_[0]  $_[1]:$_[2]  $_[3]  $_[4]  $_[5]  $_[6]\n";
-  }
-}
-#--------------------------------------------------------
-
-
-
-#--------------------------------------------------------
-sub tfn($) {
-  # calculate tocfilename
-  $_ = $_[0];
-  foreach $s (@subs) {
-    eval $s;
-  }
-  return $dir . $_ ;
-}
-#--------------------------------------------------------
-
-
-#--------------------------------------------------------
-sub usage($) {
-  print STDERR "@_\n\n";
-  print STDERR "usage: amtoc [-a] [-i] [-t] [-f file] [-s subs] [-w] [--] logfile\n";
-  print STDERR "         -a      : file output to `label`.toc\n";
-  print STDERR "         -i      : Start TOC with a small help message\n";
-  print STDERR "         -t      : tabular output\n";
-  print STDERR "         -f file : output to file\n";
-  print STDERR "         -s subs : output file name evaluated to `eval \$subs`\n";
-  print STDERR "         -w      : add vertical whitespace after each tape\n";
-  print STDERR "         --      : last option\n";
-  print STDERR "         logfile : input file ('-' for stdin)\n";
-  exit;
-}
-#--------------------------------------------------------
-
-#--------------------------------------------------------
-sub init() {
-  &usage("amtoc required at least 'logfile' parameter.") if ($#ARGV==-1) ;
-
-  @subs = ();
-  for ($i=0;$i<=$#ARGV;$i++) {
-    if ($ARGV[$i] eq '-a') {
-        push (@subs, "s/\$/.toc/");
-      }
-    elsif ($ARGV[$i] eq '-i') {
-        $info=1;
-      }
-    elsif ($ARGV[$i] eq '-t') {
-        $tabular=1;
-      }
-    elsif ($ARGV[$i] eq '-f') {
-        $i++;
-        &usage("'-f' option require 'file' parameter.")  if ($i > $#ARGV);
-        $tocfilename=$ARGV[$i];
-      }
-    elsif ($ARGV[$i] eq '-s') {
-        $i++;
-        &usage("'-s' option require 'subs' parameter.")  if ($i > $#ARGV);
-        push (@subs, $ARGV[$i]);
-      }
-    elsif ($ARGV[$i] eq '-w') {
-        $vwspace=1;
-      }
-    elsif ($ARGV[$i] eq '--') {
-      # no more options: next arg == logfile
-        $i++;
-        &usage("amtoc required at least 'logfile' parameter.") if ($i > $#ARGV);
-        $logfile=$ARGV[$i];
-        &usage("too many parameters.") unless ($i == $#ARGV);
-      }
-    else {
-        $logfile=$ARGV[$i];
-        &usage("too many parameters.") unless ($i == $#ARGV);
-      }
-  }
-  &usage("amtoc required at least 'logfile' parameter.") unless ($logfile);
-}
-
-#--------------------------------------------------------
-
-&init;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$dir=$logfile;
-$dir =~ s/[^\/]*$//;
-
-
-if ($logfile eq '-') {$IF=STDIN} else 
-  {die ("Cannot open logfile $logfile") unless open (IF,"$logfile");$IF=IF;}
-
-$filenumber=0;
-$tot_or_size=0;
-
-while ( <$IF> ) {
-  $line = $_;
-  if ( /^FAIL dumper (\S+) (\S+)/ ) {
-    next;
-  }
-  if ( /^SUCCESS dumper (\S+) (\S+)/ ) {
-    $host = $1;
-    $disk = $2;
-    $line =~ /orig-kb (\d+)/;
-    $osize{$host}{$disk} = $1;
-    $tot_or_size += $osize{$host}{$disk};
-    $fail{$host}{$disk} = 0;
-    next;
-  }
-  if ( /^START amflush/ ) {
-    $flash_mode = 1;
-    next;
-  }
-  if ( ! /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+) (\S+)/) { next;}
-  # $_ = $1;
-  $host = $2;
-  $disk = $3;
-  $date = $4;
-  $chunk = $5;
-  $level = $6;
-  switch: {
-    /START taper/ && do {
-      $tocfilename=&tfn($chunk) if ($#subs >= 0);
-      if (!$tocfilename || ($tocfilename eq '-')) {$OF=STDOUT;}
-      else {
-          die ("Cannot open tocfile $tocfilename") unless open(OF,">$tocfilename");
-          $OF=OF;
-        }
-
-       print $OF "\f" if ($vwspace && $filenumber);
-       if (defined($info)) {
-         print $OF "AMANDA: To restore:\n";
-         print $OF "    position tape at start of file and run:\n";
-         print $OF "        dd if=<tape> bs=32k skip=1 [ | zcat ] | restore -...f\n";
-         print $OF "    or run: amrestore -p <tape> [host [partition]] | restore -...f\n";
-         print $OF "\n";
-       }
-
-
-
-      $filenumber=0;
-      &pr("#","Server","/partition","date", "level","size[Kb]","part");
-      &pr("$filenumber","$chunk","","$disk","-","-","-");
-      last switch; };
-    /^(?:SUCCESS|CHUNK) taper/ && do {
-      if(/SUCCESS/){
-       $level = $chunk;
-       $chunk = "-";
-      }
-      $mysize = 0;
-      if(/ kb (\d+) /){
-       $mysize = $1;
-      }
-      if ( $fail{$host}{$disk} ) {
-        &pr("$filenumber","${host}","${disk}","${date}","${level}","FAIL","${chunk}");
-      } else {
-       if (defined($flash_mode)) {
-          &pr("$filenumber","${host}","${disk}","${date}","${level}","$mysize","${chunk}");
-       } else {
-         if (defined($osize{$host}{$disk}) && !/^CHUNK/) {
-            &pr("$filenumber","${host}","${disk}","${date}","${level}","$osize{$host}{$disk}","${chunk}");
-         } else {
-           $note = "";
-           if(!/^CHUNK/){
-               # this case should never happend: 
-           $strange=1;
-             $note = "*";
-           }
-            &pr("$filenumber","${host}","${disk}","${date}","${level}","$note$mysize","${chunk}");
-         }
-       }
-      }
-      last switch;};
-    /INFO taper retrying/ && do {
-      --$filenumber;
-      last switch; };
-    /INFO taper tape .* \[OK\]/ && do {
-      $line =~ / kb (\d+) /;
-      $size = $1;
-      $line =~ / fm (\d+) /;
-      print "\n\n" if ($vwspace);
-      &pr("$1","total","on_tape","-","-","$size","-");
-      if (defined($flash_mode)) {
-       &pr("$1","total","origin","-","not","available","-");
-      } else {
-       &pr("$1","total","origin","-","-","$tot_or_size","-");
-      }
-      if (defined($strange)) {
-       &pr("*","size","on_tape","-","-","-","-");
-      }
-      last switch; };
-    /FAIL taper/ && do { next; };
-  }
-  $filenumber += 1;
-}
-close $IF;
-close OF;
-
-
-format OF =
-@>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>>
-$fnbr,$hstprt,$dt,$lvl,$sz
-.
-
-format STDOUT =
-@>>  @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<< @>> @>>>>>>>> @>>>
-$fnbr,$hstprt,$dt,$lvl,$sz,$ch
-.
index e30a1d5968344720e5891068403c6a5529abe56d..76c17c7ab22dfe5b33f7ca41e39e054b6aa3f16b 100644 (file)
@@ -33,9 +33,6 @@
 
 #include "amanda.h"
 #include "arglist.h"
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
 #include "conffile.h"
 #include "diskfile.h"
 #include "tapefile.h"
@@ -58,20 +55,30 @@ static int sort_by_name_reversed(
 }
 
 
-int main(int argc, char **argv)
+int
+main(
+    int                argc,
+    char **    argv)
 {
     disk_t *diskp;
     disklist_t diskl;
     size_t i;
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_indexdir;
     find_result_t *output_find;
     time_t tmp_time;
     int amtrmidx_debug = 0;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
@@ -82,69 +89,46 @@ int main(int argc, char **argv)
     signal(SIGPIPE, SIG_IGN);
 
     dbopen(DBG_SUBDIR_SERVER);
-    dbprintf(("%s: version %s\n", argv[0], version()));
+    dbprintf(_("%s: version %s\n"), argv[0], version());
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (my_argc > 1 && strcmp(my_argv[1], "-t") == 0) {
+    if (argc > 1 && strcmp(argv[1], "-t") == 0) {
        amtrmidx_debug = 1;
-       my_argc--;
-       my_argv++;
+       argc--;
+       argv++;
     }
 
-    if (my_argc < 2) {
-       fprintf(stderr, "Usage: %s [-t] <config> [-o configoption]*\n", my_argv[0]);
+    if (argc < 2) {
+       g_fprintf(stderr, _("Usage: %s [-t] <config> [-o configoption]*\n"), argv[0]);
        return 1;
     }
 
-    config_name = my_argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL | CONFIG_INIT_USE_CWD,
+       argv[1]);
+    apply_config_overwrites(cfg_ovr);
 
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if(*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &diskl) < 0) {
-       error("could not load disklist \"%s\"", conf_diskfile);
+       error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if(*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
     amfree(conf_tapelist);
 
-    output_find = find_dump(1, &diskl);
+    output_find = find_dump(&diskl);
 
-    conf_indexdir = getconf_str(CNF_INDEXDIR);
-    if(*conf_indexdir == '/') {
-       conf_indexdir = stralloc(conf_indexdir);
-    } else {
-       conf_indexdir = stralloc2(config_dir, conf_indexdir);
-    }
+    conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR));
 
     /* now go through the list of disks and find which have indexes */
     time(&tmp_time);
@@ -174,13 +158,13 @@ int main(int argc, char **argv)
                                 NULL);
            qindexdir = quote_string(indexdir);
 
-           dbprintf(("%s %s -> %s\n", diskp->host->hostname,
-                       qdisk, qindexdir));
+           dbprintf("%s %s -> %s\n", diskp->host->hostname,
+                       qdisk, qindexdir);
            amfree(host);
            amfree(qdisk);
            amfree(disk);
            if ((d = opendir(indexdir)) == NULL) {
-               dbprintf(("could not open index directory %s\n", qindexdir));
+               dbprintf(_("could not open index directory %s\n"), qindexdir);
                amfree(indexdir);
                amfree(qindexdir);
                continue;
@@ -221,10 +205,10 @@ int main(int argc, char **argv)
                    if(lstat(path, &sbuf) != -1
                        && ((sbuf.st_mode & S_IFMT) == S_IFREG)
                        && ((time_t)sbuf.st_mtime < tmp_time)) {
-                       dbprintf(("rm %s\n", qpath));
+                       dbprintf("rm %s\n", qpath);
                        if(amtrmidx_debug == 0 && unlink(path) == -1) {
-                           dbprintf(("Error removing %s: %s\n",
-                                     qpath, strerror(errno)));
+                           dbprintf(_("Error removing %s: %s\n"),
+                                     qpath, strerror(errno));
                        }
                    }
                    amfree(qpath);
@@ -268,10 +252,10 @@ int main(int argc, char **argv)
                    char *path, *qpath;
                    path = stralloc2(indexdir, names[i]);
                    qpath = quote_string(path);
-                   dbprintf(("rm %s\n", qpath));
+                   dbprintf("rm %s\n", qpath);
                    if(amtrmidx_debug == 0 && unlink(path) == -1) {
-                       dbprintf(("Error removing %s: %s\n",
-                                 qpath, strerror(errno)));
+                       dbprintf(_("Error removing %s: %s\n"),
+                                 qpath, strerror(errno));
                    }
                    amfree(qpath);
                    amfree(path);
@@ -286,12 +270,9 @@ int main(int argc, char **argv)
     }
 
     amfree(conf_indexdir);
-    amfree(config_dir);
     free_find_result(&output_find);
     clear_tapelist();
     free_disklist(&diskl);
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
 
     dbclose();
 
index 691eb9e1e9d7a372d64ad15f33172c273f79d438..0c389234ea39452ec2e2ccc7ed6572ca0a73c080 100644 (file)
@@ -33,9 +33,6 @@
 
 #include "amanda.h"
 #include "arglist.h"
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
 #include "conffile.h"
 #include "diskfile.h"
 #include "tapefile.h"
@@ -64,13 +61,20 @@ main(
     char *logname = NULL;
     struct stat stat_log;
     struct stat stat_old;
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_logdir;
     int dumpcycle;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
     safe_cd();
@@ -80,58 +84,40 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (my_argc > 1 && strcmp(my_argv[1], "-t") == 0) {
+    if (argc > 1 && strcmp(argv[1], "-t") == 0) {
        amtrmidx_debug = 1;
-       my_argc--;
-       my_argv++;
+       argc--;
+       argv++;
     }
 
-    if (my_argc < 2) {
-       fprintf(stderr, "Usage: %s [-t] <config> [-o configoption]*\n", my_argv[0]);
+    if (argc < 2) {
+       g_fprintf(stderr, _("Usage: %s [-t] <config> [-o configoption]*\n"), argv[0]);
        return 1;
     }
 
     dbopen(DBG_SUBDIR_SERVER);
-    dbprintf(("%s: version %s\n", my_argv[0], version()));
+    dbprintf(_("%s: version %s\n"), argv[0], version());
 
-    config_name = my_argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL,
+               argv[1]);
+    apply_config_overwrites(cfg_ovr);
 
-    config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing amanda config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &diskl) < 0) {
-       error("could not load disklist \"%s\"", conf_diskfile);
+       error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if (read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
     amfree(conf_tapelist);
@@ -146,36 +132,33 @@ main(
 
     /* determine how many log to keep */
     no_keep = getconf_int(CNF_TAPECYCLE) * 2;
-    dbprintf(("Keeping %d log file%s\n", no_keep, (no_keep == 1) ? "" : "s"));
+    dbprintf(plural(_("Keeping %d log file\n"),
+                   _("Keeping %d log files\n"), no_keep),
+            no_keep);
 
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     olddir = vstralloc(conf_logdir, "/oldlog", NULL);
     if (mkpdir(olddir, 02700, (uid_t)-1, (gid_t)-1) != 0) {
-       error("could not create parents of %s: %s", olddir, strerror(errno));
+       error(_("could not create parents of %s: %s"), olddir, strerror(errno));
        /*NOTREACHED*/
     }
     if (mkdir(olddir, 02700) != 0 && errno != EEXIST) {
-       error("could not create %s: %s", olddir, strerror(errno));
+       error(_("could not create %s: %s"), olddir, strerror(errno));
        /*NOTREACHED*/
     }
 
     if (stat(olddir,&stat_old) == -1) {
-       error("can't stat oldlog directory \"%s\": %s", olddir, strerror(errno));
+       error(_("can't stat oldlog directory \"%s\": %s"), olddir, strerror(errno));
        /*NOTREACHED*/
     }
 
     if (!S_ISDIR(stat_old.st_mode)) {
-       error("Oldlog directory \"%s\" is not a directory", olddir);
+       error(_("Oldlog directory \"%s\" is not a directory"), olddir);
        /*NOTREACHED*/
     }
 
     if ((dir = opendir(conf_logdir)) == NULL) {
-       error("could not open log directory \"%s\": %s", conf_logdir,strerror(errno));
+       error(_("could not open log directory \"%s\": %s"), conf_logdir,strerror(errno));
        /*NOTREACHED*/
     }
     while ((adir=readdir(dir)) != NULL) {
@@ -204,7 +187,7 @@ main(
                newfile = newvstralloc(newfile,
                                       olddir, "/", adir->d_name, NULL);
                if (rename(oldfile,newfile) != 0) {
-                   error("could not rename \"%s\" to \"%s\": %s",
+                   error(_("could not rename \"%s\" to \"%s\": %s"),
                          oldfile, newfile, strerror(errno));
                    /*NOTREACHED*/
                }
@@ -220,12 +203,9 @@ main(
     amfree(oldfile);
     amfree(newfile);
     amfree(olddir);
-    amfree(config_dir);
     amfree(conf_logdir);
     clear_tapelist();
     free_disklist(&diskl);
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
 
     dbclose();
 
diff --git a/server-src/amverify.sh b/server-src/amverify.sh
new file mode 100644 (file)
index 0000000..7ed64cc
--- /dev/null
@@ -0,0 +1,501 @@
+#! @SHELL@
+#
+#      $Id: amverify.sh.in,v 1.38 2006/07/25 19:00:56 martinea Exp $
+#
+# (C) 1996 by ICEM Systems GmbH
+# Author: Axel Zinser (fifi@icem.de)
+#
+# amverify: check amanda tapes and report errors
+#
+
+echo "amverify is deprecated -- use amcheckdump" >& 2
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then
+       SUF="-@VERSION@"
+else
+       SUF=
+fi
+
+# If the shell/system echo support \r and \c, use them to write some
+# status messages over the top of each other as things progress, otherwise
+# use a normal echo and let them go on new lines.  Define $Echoe to be
+# an echo that goes to stderr.  In the code, $Echoe is used and it may
+# be either echoe or echone, the latter being code that knows about echon.
+
+t=`echo "abc\r\c" | wc -c`
+if [ $t -eq 4 ]; then
+       Echon=echon
+else
+       Echon=echo
+fi
+Echoe=echoe
+elen=0
+echoe() {
+       echo "$@" >&2
+       Echoe=echoe
+}
+echon() {
+        newelen=`expr "$1" : '.*'`
+       blanks=
+        while [ $newelen -lt $elen ]; do
+               blanks="$blanks "
+                elen=`expr $elen - 1`
+        done
+        echo "$1""$blanks\r\c"
+        elen=$newelen
+       Echoe=echone
+}
+echone() {
+       echon
+       echoe "$@"
+       Echoe=echoe
+}
+
+report() {
+       $Echoe "$@"
+       echo "$@" >> $REPORT
+}
+
+getparm() {
+       $AMGETCONF $CONFIG $1 2>/dev/null
+}
+
+sendreport() {
+       if [ -f $REPORT -a X"$REPORTTO" != X"" ]; then
+               (
+               echo `_ 'Tapes: %s' "$TAPELIST"`
+               if [ -s $DEFECTS ]; then
+                       echo `_ 'Errors found:'`
+                       cat $DEFECTS
+               else
+                       echo `_ 'No errors found!'`
+               fi
+               echo
+
+               [ -s $REPORT ] \
+                       && cat $REPORT
+               ) | (
+                   if test -n "$MAIL"; then
+                       $MAIL -s "$ORG AMANDA VERIFY REPORT FOR$TAPELIST" $REPORTTO
+                   else
+                       cat >&2
+                   fi
+               )
+       fi
+}
+
+###
+# This function is called to process one dump image.  Standard input is
+# the dump image.  We parse the header and decide if it is a GNU tar
+# dump or a system dump.  Then we do a catalog operation to /dev/null
+# and finally a "cat" to /dev/null to soak up whatever data is still in
+# the pipeline.
+#
+# In the case of a system restore catalogue, this does not fully check
+# the integrity of the dump image because system restore programs stop
+# as soon as they are done with the directories, which are all at the
+# beginning.  But the trailing cat will at least make sure the whole
+# image is readable.
+###
+
+doonefile() {
+
+       ###
+       # The goal here is to collect the first 32 KBytes and save the
+       # first line.  But the pipe size coming in to us from amrestore
+       # is highly system dependent and "dd" does not do reblocking.
+       # So we pick a block size that is likely to always be available in
+       # the pipe and a count to take it up to 32 KBytes.  Worst case,
+       # this could be changed to "bs=1 count=32k".  We also have to
+       # soak up the rest of the output after the "head" so an EPIPE
+       # does not go back and terminate the "dd" early.
+       ###
+
+        HEADER=`$DD bs=512 count=64 2>/dev/null | ( sed 1q ; cat > /dev/null )`
+       CMD=
+       result=1
+       if [ X"$HEADER" = X"" ]; then
+               echo `_ '** No header'` > $TEMP/errors
+       else
+               set X $HEADER
+               # XXX meh, while[] is dangerous, what about a bad header?
+               while [ X"$1" != X"program" ]; do shift; done
+               if [ X"$1" = X"program" -a X"$2" != X"" ]; then
+                       if [ X"$TAR" != X"" \
+                            -a \( X"`basename $2`" = X"`basename $TAR`" \
+                                  -o X"`basename $2`" = X"gtar" \
+                                  -o X"`basename $2`" = X"gnutar" \
+                                  -o X"`basename $2`" = X"tar" \) ]; then
+                               CMD=$TAR
+                               ARGS="tf -"
+                       elif [ X"$TAR" != X"" \
+                              -a X"$SAMBA_CLIENT" != X"" \
+                              -a X"$2" = X"$SAMBA_CLIENT" ]; then
+                               CMD=$TAR
+                               ARGS="tf -"
+                       elif [ X"$DUMP" != X"" -a X"$2" = X"$DUMP" ]; then
+                               CMD=$RESTORE
+                               if [ $IS_AIX -eq 1 ]; then
+                                       ARGS=-tB
+                               else
+                                       ARGS="tbf 2 -"
+                               fi
+                       elif [ X"$VDUMP" != X"" -a X"$2" = X"$VDUMP" ]; then
+                               CMD=$VRESTORE
+                               ARGS="tf -"
+                       elif [ X"$VXDUMP" != X"" -a X"$2" = X"$VXDUMP" ]; then
+                               CMD=$VXRESTORE
+                               ARGS="tbf 2 -"
+                       elif [ X"$XFSDUMP" != X"" -a X"$2" = X"$XFSDUMP" ]; then
+                               CMD=$XFSRESTORE
+                               ARGS="-t -v silent -"
+                       else
+                               echo `_ '** Cannot do %s dumps' "$2"` > $TEMP/errors
+                               result=999      # flag as not really an error
+                       fi
+               else
+                       echo `_ '** Cannot find dump type'` > $TEMP/errors
+               fi
+       fi
+       echo $CMD > $TEMP/onefile.cmd
+       if [ X"`echo $HEADER | grep '^AMANDA: SPLIT_FILE'`" != X"" ]; then
+           result=500
+           set X $HEADER
+           shift 7
+           echo $1 | cut -f7 -d' ' > $TEMP/onefile.partnum
+       elif [ X"$CMD" != X"" ]; then
+               if [ -x $CMD ]; then
+                       $CMD $ARGS > /dev/null 2> $TEMP/errors
+                       result=$?
+               else
+                       echo `_ '** Cannot execute %s' "$CMD"` > $TEMP/errors
+               fi
+       fi
+       cat >/dev/null                          # soak up the rest of the image
+       echo $result
+}
+
+#
+# some paths
+#
+#      CONFIG_DIR      directory in which the config file resides
+#      AMRESTORE       full path name of amrestore
+#      AMGETCONF       full path name of amgetconf
+#      AMTAPE          full path name of amtape
+#      TAR             ditto for GNU-tar
+#      SAMBA_CLIENT    ditto for smbclient
+#      DUMP            ditto for the system dump program
+#      RESTORE         ditto for the system restore program
+#      VDUMP           ditto for the system dump program
+#      VRESTORE        ditto for the system restore program
+#      VXDUMP          ditto for the system dump program
+#      VXRESTORE       ditto for the system restore program
+#      XFSDUMP         ditto for the system dump program
+#      XFSRESTORE      ditto for the system restore program
+#      DD              ditto for dd
+#      MT              ditto for mt
+#      MTF             flag given to MT to specify tape device: -f or -t
+#      MAIL            mail program
+#      IS_AIX          true if this is an AIX system
+
+CONFIG_DIR=@CONFIG_DIR@
+amlibexecdir=$amlibexecdir
+sbindir=$sbindir
+AMRESTORE=$sbindir/amrestore$SUF
+AMGETCONF=$sbindir/amgetconf$SUF
+AMTAPE=$sbindir/amtape$SUF
+TAR=@GNUTAR@
+SAMBA_CLIENT=@SAMBA_CLIENT@
+DUMP=@DUMP@
+RESTORE=@RESTORE@
+VDUMP=@VDUMP@
+VRESTORE=@VRESTORE@
+VXDUMP=@VXDUMP@
+VXRESTORE=@VXRESTORE@
+XFSDUMP=@XFSDUMP@
+XFSRESTORE=@XFSRESTORE@
+MAIL=@MAILER@
+DD=@DD@
+
+. ${amlibexecdir}/chg-lib.sh
+
+#
+# config file
+#
+SLOT=0
+CONFIG=$1
+[ X"$CONFIG" = X"" ] \
+       && $Echoe "usage: amverify$SUF <config> [slot [ runtapes ] ]" \
+       && exit 1
+
+AMCONFIG=$CONFIG_DIR/$CONFIG/amanda.conf
+[ ! -f $AMCONFIG ] \
+       && $Echoe "Cannot find config file $AMCONFIG" \
+       && exit 1
+
+TPCHANGER=`getparm tpchanger`
+if [ X"$TPCHANGER" = X"" ]; then
+       $Echoe "No tape changer..."
+       DEVICE=`getparm tapedev`
+       [ X"$DEVICE" = X"" ] \
+               && $Echoe "No tape device..." \
+               && exit 1
+       $Echoe "Tape device is $DEVICE..."
+       SLOTS=1
+else
+       CHANGER_SLOT=${2:-current}
+       $Echoe "Tape changer is $TPCHANGER..."
+       SLOTS=${3:-`getparm runtapes`}
+       [ X"$SLOTS" = X"" ] && SLOTS=1
+       if [ $SLOTS -eq 1 ]; then
+               p=""
+       else
+               p=s
+       fi
+       $Echoe "$SLOTS slot${p}..."
+       MAXRETRIES=2
+fi
+
+#
+# check the accessability
+#
+[ X"$TAR" != X"" -a ! -x "$TAR" ] \
+       && $Echoe "GNU tar not found: $TAR"
+[ X"$DUMP" != X"" -a \( X"$RESTORE" = X"" -o ! -x "$RESTORE" \) ] \
+       && $Echoe "System restore program not found: $RESTORE"
+[ X"$VDUMP" != X"" -a \( X"$VRESTORE" = X"" -o ! -x "$VRESTORE" \) ] \
+       && $Echoe "System restore program not found: $VRESTORE"
+[ X"$VXDUMP" != X"" -a \( X"$VXRESTORE" = X"" -o ! -x "$VXRESTORE" \) ] \
+       && $Echoe "System restore program not found: $VXRESTORE"
+[ X"$XFSDUMP" != X"" -a \( X"$XFSRESTORE" = X"" -o ! -x "$XFSRESTORE" \) ] \
+       && $Echoe "System restore program not found: $XFSRESTORE"
+[ ! -x $AMRESTORE ] \
+       && $Echoe "amrestore not found: $AMRESTORE" \
+       && exit 1
+
+REPORTTO=`getparm mailto`
+if [ X"$REPORTTO" = X"" ]; then
+       $Echoe "No notification by mail!"
+else
+       $Echoe "Verify summary to $REPORTTO"
+fi
+
+ORG=`getparm org`
+if [ X"$ORG" = X"" ]; then
+       $Echoe "No org in amanda.conf -- using $CONFIG"
+       ORG=$CONFIG
+fi
+
+#
+# ok, let's do it
+#
+#      TEMP            directory for temporary tar archives and stderr
+#      DEFECTS         defect list
+#      REPORT          report for mail
+
+if [ ! -d @AMANDA_TMPDIR@ ]; then
+  $Echoe "amverify: directory @AMANDA_TMPDIR@ does not exist."
+  exit 1
+fi
+
+cd @AMANDA_TMPDIR@ || exit 1
+
+TEMP=@AMANDA_TMPDIR@/amverify.$$
+trap 'rm -fr $TEMP' 0
+if ( umask 077 ; mkdir $TEMP ) ; then
+       :
+else
+       $Echoe "Cannot create $TEMP"
+       exit 1
+fi
+DEFECTS=$TEMP/defects; rm -f $DEFECTS
+REPORT=$TEMP/report; rm -f $REPORT
+TAPELIST=
+EXITSTAT=$TEMP/amrecover.exit; rm -rf $EXITSTAT
+
+trap 'report "aborted!"; echo `_ 'aborted!'` >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' 1 2 3 4 5 6 7 8 10 12 13 14 15
+
+$Echoe "Defects file is $DEFECTS"
+report "amverify $CONFIG"
+report "`date`"
+report ""
+
+# ----------------------------------------------------------------------------
+
+SPLIT_DUMPS= # this will keep track of split dumps that we'll tally later
+while [ $SLOT -lt $SLOTS ]; do
+       SLOT=`expr $SLOT + 1`
+       #
+       # Tape Changer: dial slot
+       #
+       if [ X"$TPCHANGER" != X"" ]; then
+               report "Loading ${CHANGER_SLOT} slot..."
+               $AMTAPE $CONFIG slot $CHANGER_SLOT > $TEMP/amtape.out 2>&1
+               THIS_SLOT=$CHANGER_SLOT
+               CHANGER_SLOT=next
+               RESULT=`grep "changed to slot" $TEMP/amtape.out`
+               [ X"$RESULT" = X"" ] \
+                       && report "** Error loading slot $THIS_SLOT" \
+                       && report "`cat $TEMP/amtape.out`" \
+                       && cat $TEMP/amtape.out >> $DEFECTS \
+                       && continue
+               DEVICE=`$AMTAPE $CONFIG device`
+       fi
+       report "Using device $DEVICE"
+       $Echon "Waiting for device to go ready..."
+       count=1800
+        while true; do
+            amdevcheck_output="`amdevcheck $CONFIG $DEVICE`"
+            amdevcheck_status=$?
+            if [ $amdevcheck_status -eq 0 ]; then
+                break;
+            else
+                if echo $amdevcheck_output | grep UNLABELED > /dev/null; then
+                   if [ count -lt 0 ]; then
+                       report "Device not ready"
+                        break;
+                   fi
+                    sleep 3
+                   count=`expr $count - 3`
+                else
+                    report "Volume in $DEVICE unlabeled."
+                    break;
+                fi
+            fi
+       done
+       $Echon "Processing label..."
+        amtape_output="`amtape $CONFIG current 2>&1`";
+        if echo "$amtape_output" | \
+            egrep "^slot +[0-9]+: time [^ ]+ +label [^ ]+" > /dev/null; then
+           : # everything is fine
+       else
+            report "Error reading tape label using amtape."
+            continue
+        fi
+        
+        set X $amtape_output
+        until [ "$1" = "time" ]; do
+            shift
+        done
+        
+       VOLUME=$4
+       DWRITTEN=$2
+       report "Volume $VOLUME, Date $DWRITTEN"
+       [ X"$DWRITTEN" = X"0" -o X"$DWRITTEN" = X"X" ] \
+               && report "Fresh tape. Skipping..." \
+               && continue
+       TAPELIST="$TAPELIST $VOLUME"
+
+        FILENO=0
+       ERG=0
+       ERRORS=0
+       while [ $ERG = 0 ]; do
+               FILENO=`expr $FILENO + 1`
+#            { cat <<EOF; dd if=/dev/zero bs=32k count=1; } | doonefile
+#AMANDA: FILE 20070925205916 localhost /boot  lev 0 comp N program /bin/tar
+#To restore, position tape at start of file and run:
+#        dd if=<tape> bs=32k skip=1 |      /bin/tar -xpGf - ...
+#EOF
+               RESULT=`$AMRESTORE -h -p -f $FILENO $DEVICE \
+                            2> $TEMP/amrestore.out \
+                       | doonefile 2> $TEMP/onefile.errors`
+               FILE=`grep restoring $TEMP/amrestore.out \
+                       | sed 's/^.*restoring //'`
+               if [ X"$FILE" != X"" -a X"$RESULT" = X"0" ]; then
+                       report "Checked $FILE"
+               elif [ X"$FILE" != X"" -a X"$RESULT" = X"500" ]; then
+                       report "Skipped `cat $TEMP/onefile.cmd` check on partial dump $FILE"
+                       dump="`echo $FILE | cut -d'.' -f'1,2,3,4'`"
+                       cat $TEMP/onefile.partnum >> $TEMP/$dump.parts
+                       if [ X"`echo $SPLIT_DUMPS | grep $dump`" = X"" ]; then
+                           SPLIT_DUMPS="$dump $SPLIT_DUMPS"
+                       fi
+               elif [ X"$FILE" != X"" -a X"$RESULT" = X"999" ]; then
+                       report "Skipped $FILE (`cat $TEMP/errors`)"
+               elif [ -z "$FILE" ]; then
+                        # Unless we went over, there is no extra output.
+                       report "End-of-Tape detected."
+                       break
+               else
+                       report "** Error detected ($FILE)"
+                       echo "$VOLUME ($FILE):" >>$DEFECTS
+                       [ -s $TEMP/amrestore.out ] \
+                               && report "`cat $TEMP/amrestore.out`" \
+                               && cat $TEMP/amrestore.out >>$DEFECTS
+                       [ -s $TEMP/errors ] \
+                               && report "`cat $TEMP/errors`" \
+                               && cat $TEMP/errors >>$DEFECTS
+                       [ -s $TEMP/onefile.errors ] \
+                               && report "`cat $TEMP/onefile.errors`" \
+                               && cat $TEMP/onefile.errors >>$DEFECTS
+                       ERRORS=`expr $ERRORS + 1`
+                       [ $ERRORS -gt 5 ] \
+                               && report "Too many errors." \
+                               && break
+               fi
+       done
+       rm -f $TEMP/header \
+             $TEMP/amtape.out \
+             $TEMP/amrestore.out \
+             $TEMP/errors \
+             $TEMP/onefile.cmd \
+             $TEMP/onefile.partnum \
+             $TEMP/onefile.errors
+done
+
+[ -s $DEFECTS ] \
+       && $Echoe "Errors found: " \
+       && cat $DEFECTS
+
+# Work out whether any split dumps we saw had all their parts
+for dump in $SPLIT_DUMPS;do
+    report ""
+    numparts=0
+    max=0
+    max_known=0
+    missing=0
+    # figure out 
+    for part in `cat $TEMP/$dump.parts`;do
+       cur="`echo $part | cut -d/ -f1`"
+       max="`echo $part | cut -d/ -f2`"
+       if [ $max != "UNKNOWN" ]; then
+           numparts=$max
+           max_known=1
+           break;
+       fi
+       if [ $cur -gt $numparts ]; then
+           numparts=$cur
+       fi
+    done
+    report "Split dump $dump should have $numparts total pieces"
+    if [ $max_known != 1 ]; then
+       report "NOTE: Header field for total pieces was UNKNOWN, $numparts is best guess"
+    fi
+    part=1
+    while [ $part -lt $numparts ];do
+       part=`expr $part + 1`
+       if [ X"`grep \"^$part/\" $TEMP/$dump.parts`" = X"" ];then
+           report "Spanning chunk part $part is missing!"
+           missing=`expr $missing + 1`
+       fi
+    done
+    if [ $missing = 0 ];then
+       report "All parts found"        
+    fi
+    rm -f $TEMP/$dump.parts
+done
+
+sendreport
+
+exit 0
diff --git a/server-src/amverify.sh.in b/server-src/amverify.sh.in
deleted file mode 100644 (file)
index 21e111d..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-#! @SHELL@
-#
-#      $Id: amverify.sh.in,v 1.38 2006/07/25 19:00:56 martinea Exp $
-#
-# (C) 1996 by ICEM Systems GmbH
-# Author: Axel Zinser (fifi@icem.de)
-#
-# amverify: check amanda tapes and report errors
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then
-       SUF="-@VERSION@"
-else
-       SUF=
-fi
-
-# If the shell/system echo support \r and \c, use them to write some
-# status messages over the top of each other as things progress, otherwise
-# use a normal echo and let them go on new lines.  Define $Echoe to be
-# an echo that goes to stderr.  In the code, $Echoe is used and it may
-# be either echoe or echone, the latter being code that knows about echon.
-
-t=`echo "abc\r\c" | wc -c`
-if [ $t -eq 4 ]; then
-       Echon=echon
-else
-       Echon=echo
-fi
-Echoe=echoe
-elen=0
-echoe() {
-       echo "$@" >&2
-       Echoe=echoe
-}
-echon() {
-        newelen=`expr "$1" : '.*'`
-       blanks=
-        while [ $newelen -lt $elen ]; do
-               blanks="$blanks "
-                elen=`expr $elen - 1`
-        done
-        echo "$1""$blanks\r\c"
-        elen=$newelen
-       Echoe=echone
-}
-echone() {
-       echon
-       echoe "$@"
-       Echoe=echoe
-}
-
-report() {
-       $Echoe "$@"
-       echo "$@" >> $REPORT
-}
-
-getparm() {
-       $AMGETCONF $CONFIG $1 2>/dev/null
-}
-
-sendreport() {
-       if [ -f $REPORT -a X"$REPORTTO" != X"" ]; then
-               (
-               echo "Tapes: $TAPELIST"
-               if [ -s $DEFECTS ]; then
-                       echo "Errors found: "
-                       cat $DEFECTS
-               else
-                       echo "No errors found!"
-               fi
-               echo
-
-               [ -s $REPORT ] \
-                       && cat $REPORT
-               ) | $MAIL -s "$ORG AMANDA VERIFY REPORT FOR$TAPELIST" $REPORTTO
-       fi
-}
-
-###
-# This function is called to process one dump image.  Standard input is
-# the dump image.  We parse the header and decide if it is a GNU tar
-# dump or a system dump.  Then we do a catalog operation to /dev/null
-# and finally a "cat" to /dev/null to soak up whatever data is still in
-# the pipeline.
-#
-# In the case of a system restore catalogue, this does not fully check
-# the integrity of the dump image because system restore programs stop
-# as soon as they are done with the directories, which are all at the
-# beginning.  But the trailing cat will at least make sure the whole
-# image is readable.
-###
-
-doonefile() {
-
-       ###
-       # The goal here is to collect the first 32 KBytes and save the
-       # first line.  But the pipe size coming in to us from amrestore
-       # is highly system dependent and "dd" does not do reblocking.
-       # So we pick a block size that is likely to always be available in
-       # the pipe and a count to take it up to 32 KBytes.  Worst case,
-       # this could be changed to "bs=1 count=32k".  We also have to
-       # soak up the rest of the output after the "head" so an EPIPE
-       # does not go back and terminate the "dd" early.
-       ###
-
-       HEADER=`$DD bs=512 count=64 | ( sed 1q ; cat > /dev/null )`
-       CMD=
-       result=1
-       if [ X"$HEADER" = X"" ]; then
-               echo "** No header" > $TEMP/errors
-       else
-               set X $HEADER
-               # XXX meh, while[] is dangerous, what about a bad header?
-               while [ X"$1" != X"program" ]; do shift; done
-               if [ X"$1" = X"program" -a X"$2" != X"" ]; then
-                       if [ X"$TAR" != X"" \
-                            -a \( X"`basename $2`" = X"`basename $TAR`" \
-                                  -o X"`basename $2`" = X"gtar" \
-                                  -o X"`basename $2`" = X"gnutar" \
-                                  -o X"`basename $2`" = X"tar" \) ]; then
-                               CMD=$TAR
-                               ARGS="tf -"
-                       elif [ X"$TAR" != X"" \
-                              -a X"$SAMBA_CLIENT" != X"" \
-                              -a X"$2" = X"$SAMBA_CLIENT" ]; then
-                               CMD=$TAR
-                               ARGS="tf -"
-                       elif [ X"$DUMP" != X"" -a X"$2" = X"$DUMP" ]; then
-                               CMD=$RESTORE
-                               if [ $IS_AIX -eq 1 ]; then
-                                       ARGS=-tB
-                               else
-                                       ARGS="tbf 2 -"
-                               fi
-                       elif [ X"$VDUMP" != X"" -a X"$2" = X"$VDUMP" ]; then
-                               CMD=$VRESTORE
-                               ARGS="tf -"
-                       elif [ X"$VXDUMP" != X"" -a X"$2" = X"$VXDUMP" ]; then
-                               CMD=$VXRESTORE
-                               ARGS="tbf 2 -"
-                       elif [ X"$XFSDUMP" != X"" -a X"$2" = X"$XFSDUMP" ]; then
-                               CMD=$XFSRESTORE
-                               ARGS="-t -v silent -"
-                       else
-                               echo "** Cannot do $2 dumps" > $TEMP/errors
-                               result=999      # flag as not really an error
-                       fi
-               else
-                       echo "** Cannot find dump type" > $TEMP/errors
-               fi
-       fi
-       echo $CMD > $TEMP/onefile.cmd
-       if [ X"`echo $HEADER | grep '^AMANDA: SPLIT_FILE'`" != X"" ]; then
-           result=500
-           set X $HEADER
-           shift 7
-           echo $1 | cut -f7 -d' ' > $TEMP/onefile.partnum
-       elif [ X"$CMD" != X"" ]; then
-               if [ -x $CMD ]; then
-                       $CMD $ARGS > /dev/null 2> $TEMP/errors
-                       result=$?
-               else
-                       echo "** Cannot execute $CMD" > $TEMP/errors
-               fi
-       fi
-       cat >/dev/null                          # soak up the rest of the image
-       echo $result
-}
-
-#
-# some paths
-#
-#      CONFIG_DIR      directory in which the config file resides
-#      AMRESTORE       full path name of amrestore
-#      AMGETCONF       full path name of amgetconf
-#      AMTAPE          full path name of amtape
-#      TAR             ditto for GNU-tar
-#      SAMBA_CLIENT    ditto for smbclient
-#      DUMP            ditto for the system dump program
-#      RESTORE         ditto for the system restore program
-#      VDUMP           ditto for the system dump program
-#      VRESTORE        ditto for the system restore program
-#      VXDUMP          ditto for the system dump program
-#      VXRESTORE       ditto for the system restore program
-#      XFSDUMP         ditto for the system dump program
-#      XFSRESTORE      ditto for the system restore program
-#      DD              ditto for dd
-#      MT              ditto for mt
-#      MTF             flag given to MT to specify tape device: -f or -t
-#      MAIL            mail program
-#      IS_AIX          true if this is an AIX system
-
-CONFIG_DIR=@CONFIG_DIR@
-libexecdir=$libexecdir
-sbindir=$sbindir
-AMRESTORE=$sbindir/amrestore$SUF
-AMGETCONF=$sbindir/amgetconf$SUF
-AMTAPE=$sbindir/amtape$SUF
-TAR=@GNUTAR@
-SAMBA_CLIENT=@SAMBA_CLIENT@
-DUMP=@DUMP@
-RESTORE=@RESTORE@
-VDUMP=@VDUMP@
-VRESTORE=@VRESTORE@
-VXDUMP=@VXDUMP@
-VXRESTORE=@VXRESTORE@
-XFSDUMP=@XFSDUMP@
-XFSRESTORE=@XFSRESTORE@
-if [ -x $sbindir/ammt$SUF ]; then
-       MT=$sbindir/ammt$SUF
-       MTF=-f
-elif [ -x "@MT@" ]; then
-       MT=@MT@
-       MTF=@MT_FILE_FLAG@
-else
-       $Echoe "amverify$SUF mt program not found"
-       exit 1
-fi
-if [ -x $sbindir/amdd$SUF ]; then
-       DD=$sbindir/amdd$SUF
-elif [ -x "@DD@" ]; then
-       DD=@DD@
-else
-       $Echoe "amverify$SUF dd program not found"
-       exit 1
-fi
-MAIL=@MAILER@
-if [ X"`/bin/uname -s 2>/dev/null`" = X"AIX" ]; then
-       IS_AIX=1
-
-       # The AIX "mt stat" function does not really do anything w.r.t.
-       # checking the drive for ready, and in fact, will fail under
-       # some conditions (e.g. if the tape "file" is a symlink to the
-       # real device).  We let the rewind do the equivalent since all
-       # we use this for is to wait for device ready.
-
-       DEVICE_READY=:
-else
-       IS_AIX=0
-       DEVICE_READY='$MT $MTF $DEVICE stat'
-fi
-
-#
-# config file
-#
-SLOT=0
-CONFIG=$1
-[ X"$CONFIG" = X"" ] \
-       && $Echoe "usage: amverify$SUF <config> [slot [ runtapes ] ]" \
-       && exit 1
-
-AMCONFIG=$CONFIG_DIR/$CONFIG/amanda.conf
-[ ! -f $AMCONFIG ] \
-       && $Echoe "Cannot find config file $AMCONFIG" \
-       && exit 1
-
-TPCHANGER=`getparm tpchanger`
-if [ X"$TPCHANGER" = X"" ]; then
-       $Echoe "No tape changer..."
-       DEVICE=`getparm tapedev`
-       [ X"$DEVICE" = X"" ] \
-               && $Echoe "No tape device..." \
-               && exit 1
-       $Echoe "Tape device is $DEVICE..."
-       SLOTS=1
-else
-       CHANGER_SLOT=${2:-current}
-       $Echoe "Tape changer is $TPCHANGER..."
-       SLOTS=${3:-`getparm runtapes`}
-       [ X"$SLOTS" = X"" ] && SLOTS=1
-       if [ $SLOTS -eq 1 ]; then
-               p=""
-       else
-               p=s
-       fi
-       $Echoe "$SLOTS slot${p}..."
-       MAXRETRIES=2
-fi
-
-#
-# check the accessability
-#
-[ X"$TAR" != X"" -a ! -x "$TAR" ] \
-       && $Echoe "GNU tar not found: $TAR"
-[ X"$DUMP" != X"" -a \( X"$RESTORE" = X"" -o ! -x "$RESTORE" \) ] \
-       && $Echoe "System restore program not found: $RESTORE"
-[ X"$VDUMP" != X"" -a \( X"$VRESTORE" = X"" -o ! -x "$VRESTORE" \) ] \
-       && $Echoe "System restore program not found: $VRESTORE"
-[ X"$VXDUMP" != X"" -a \( X"$VXRESTORE" = X"" -o ! -x "$VXRESTORE" \) ] \
-       && $Echoe "System restore program not found: $VXRESTORE"
-[ X"$XFSDUMP" != X"" -a \( X"$XFSRESTORE" = X"" -o ! -x "$XFSRESTORE" \) ] \
-       && $Echoe "System restore program not found: $XFSRESTORE"
-[ ! -x $AMRESTORE ] \
-       && $Echoe "amrestore not found: $AMRESTORE" \
-       && exit 1
-
-REPORTTO=`getparm mailto`
-if [ X"$REPORTTO" = X"" ]; then
-       $Echoe "No notification by mail!"
-else
-       $Echoe "Verify summary to $REPORTTO"
-fi
-
-ORG=`getparm org`
-if [ X"$ORG" = X"" ]; then
-       $Echoe "No org in amanda.conf -- using $CONFIG"
-       ORG=$CONFIG
-fi
-
-#
-# ok, let's do it
-#
-#      TEMP            directory for temporary tar archives and stderr
-#      DEFECTS         defect list
-#      REPORT          report for mail
-
-if [ ! -d @AMANDA_TMPDIR@ ]; then
-  $Echoe "amverify: directory @AMANDA_TMPDIR@ does not exist."
-  exit 1
-fi
-
-cd @AMANDA_TMPDIR@ || exit 1
-
-TEMP=@AMANDA_TMPDIR@/amverify.$$
-trap 'rm -fr $TEMP' 0
-if ( umask 077 ; mkdir $TEMP ) ; then
-       :
-else
-       $Echoe "Cannot create $TEMP"
-       exit 1
-fi
-DEFECTS=$TEMP/defects; rm -f $DEFECTS
-REPORT=$TEMP/report; rm -f $REPORT
-TAPELIST=
-EXITSTAT=$TEMP/amrecover.exit; rm -rf $EXITSTAT
-
-trap 'report "aborted!"; echo "aborted!" >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' 1 2 3 4 5 6 7 8 10 12 13 14 15
-
-$Echoe "Defects file is $DEFECTS"
-report "amverify $CONFIG"
-report "`date`"
-report ""
-
-# ----------------------------------------------------------------------------
-
-SPLIT_DUMPS= # this will keep track of split dumps that we'll tally later
-while [ $SLOT -lt $SLOTS ]; do
-       SLOT=`expr $SLOT + 1`
-       #
-       # Tape Changer: dial slot
-       #
-       if [ X"$TPCHANGER" != X"" ]; then
-               report "Loading ${CHANGER_SLOT} slot..."
-               $AMTAPE $CONFIG slot $CHANGER_SLOT > $TEMP/amtape.out 2>&1
-               THIS_SLOT=$CHANGER_SLOT
-               CHANGER_SLOT=next
-               RESULT=`grep "changed to slot" $TEMP/amtape.out`
-               [ X"$RESULT" = X"" ] \
-                       && report "** Error loading slot $THIS_SLOT" \
-                       && report "`cat $TEMP/amtape.out`" \
-                       && cat $TEMP/amtape.out >> $DEFECTS \
-                       && continue
-               DEVICE=`$AMTAPE $CONFIG device`
-       fi
-       report "Using device $DEVICE"
-       $Echon "Waiting for device to go ready..."
-       count=1800
-       until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
-               [ count -lt 0 ] \
-                       && report "Device not ready" \
-                       && report "`cat $TEMP/ammt.out`" \
-                       && report cat $TEMP/ammt.out >> $DEFECTS \
-                       && break;
-               sleep 3
-               count=`expr $count - 3`
-       done
-       $Echon "Rewinding..."
-       ERRORS=0
-       until $MT $MTF $DEVICE rewind > $TEMP/ammt.out 2>&1; do
-               RESULT=`grep "No medium found" $TEMP/ammt.out`
-               [ X"$RESULT" != X"" ] \
-                       && report "** Error rewinding tape" \
-                       && report "`cat $TEMP/ammt.out`" \
-                       && cat $TEMP/ammt.out >> $DEFECTS \
-                       && break
-               ERRORS=`expr $ERRORS + 1`
-               [ $ERRORS -gt 100 ] \
-                       && report "** Error rewinding tape" \
-                       && report "`cat $TEMP/ammt.out`" \
-                       && cat $TEMP/ammt.out >> $DEFECTS \
-                       && break
-               sleep 3
-       done
-       $Echon "Processing label..."
-       $DD if=$DEVICE count=1 bs=@MAXTAPEBLOCKSIZE@k 2> $TEMP/errors > $TEMP/header
-       [ ! -s $TEMP/header ] \
-               && report "** Error reading label on tape" \
-               && cat $TEMP/errors >> $DEFECTS \
-               && continue
-       TAPENDATE=`sed 1q < $TEMP/header | grep '^AMANDA: TAPESTART'`
-       [ X"$TAPENDATE" = X"" ] \
-               && report "** No amanda tape in slot" \
-               && continue
-       set X $TAPENDATE
-       shift
-       shift                   # "AMANDA:"
-       shift                   # "TAPESTART"
-       VOLUME=$4
-       DWRITTEN=$2
-       report "Volume $VOLUME, Date $DWRITTEN"
-       [ X"$DWRITTEN" = X"0" -o X"$DWRITTEN" = X"X" ] \
-               && report "Fresh tape. Skipping..." \
-               && continue
-       TAPELIST="$TAPELIST $VOLUME"
-       $Echon "Rewinding..."
-       until $MT $MTF $DEVICE rewind; do
-               sleep 3
-       done
-       ERG=0
-       ERRORS=0
-       while [ $ERG = 0 ]; do
-               if [ $Echon = echon ]; then
-                       $Echon "Waiting for device to go ready..."
-               fi
-               count=1800
-               until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
-                       [ count -lt 0 ] \
-                               && report "Device not ready" \
-                               && report "`cat $TEMP/ammt.out`" \
-                               && report cat $TEMP/ammt.out >> $DEFECTS \
-                               && break;
-                       sleep 3
-                       count=`expr $count - 3`
-               done
-               if [ $Echon = echon ]; then
-                       $Echon "Reading..."
-               fi
-               RESULT=`$AMRESTORE -h -p $DEVICE 2> $TEMP/amrestore.out \
-                       | doonefile 2> $TEMP/onefile.errors`
-               FILE=`grep restoring $TEMP/amrestore.out \
-                       | sed 's/^.*restoring //'`
-               EOF=`grep "reached end of tape" $TEMP/amrestore.out`
-               EOI=`grep "reached end of information" $TEMP/amrestore.out`
-               # amrestore:   0: restoring sundae._mnt_sol1_usr.19961127.1
-               if [ X"$FILE" != X"" -a X"$RESULT" = X"0" ]; then
-                       report "Checked $FILE"
-               elif [ X"$FILE" != X"" -a X"$RESULT" = X"500" ]; then
-                       report "Skipped `cat $TEMP/onefile.cmd` check on partial dump $FILE"
-                       dump="`echo $FILE | cut -d'.' -f'1,2,3,4'`"
-                       cat $TEMP/onefile.partnum >> $TEMP/$dump.parts
-                       if [ X"`echo $SPLIT_DUMPS | grep $dump`" = X"" ]; then
-                           SPLIT_DUMPS="$dump $SPLIT_DUMPS"
-                       fi
-               elif [ X"$FILE" != X"" -a X"$RESULT" = X"999" ]; then
-                       report "Skipped $FILE (`cat $TEMP/errors`)"
-               elif [ -n "$EOF" ]; then
-                       report "End-of-Tape detected."
-                       break
-               elif [ -n "$EOI" ]; then
-                        report "End-of-Information detected."
-                        break
-               else
-                       report "** Error detected ($FILE)"
-                       echo "$VOLUME ($FILE):" >>$DEFECTS
-                       [ -s $TEMP/amrestore.out ] \
-                               && report "`cat $TEMP/amrestore.out`" \
-                               && cat $TEMP/amrestore.out >>$DEFECTS
-                       [ -s $TEMP/errors ] \
-                               && report "`cat $TEMP/errors`" \
-                               && cat $TEMP/errors >>$DEFECTS
-                       [ -s $TEMP/onefile.errors ] \
-                               && report "`cat $TEMP/onefile.errors`" \
-                               && cat $TEMP/onefile.errors >>$DEFECTS
-                       ERRORS=`expr $ERRORS + 1`
-                       [ $ERRORS -gt 5 ] \
-                               && report "Too many errors." \
-                               && break
-               fi
-       done
-       $Echon "Rewinding..."
-       until $MT $MTF $DEVICE rewind; do
-               sleep 3
-       done
-       rm -f $TEMP/header \
-             $TEMP/amtape.out \
-             $TEMP/amrestore.out \
-             $TEMP/errors \
-             $TEMP/onefile.cmd \
-             $TEMP/onefile.partnum \
-             $TEMP/onefile.errors
-done
-
-[ -s $DEFECTS ] \
-       && $Echoe "Errors found: " \
-       && cat $DEFECTS
-
-# Work out whether any split dumps we saw had all their parts
-for dump in $SPLIT_DUMPS;do
-    report ""
-    numparts=0
-    max=0
-    max_known=0
-    missing=0
-    # figure out 
-    for part in `cat $TEMP/$dump.parts`;do
-       cur="`echo $part | cut -d/ -f1`"
-       max="`echo $part | cut -d/ -f2`"
-       if [ $max != "UNKNOWN" ]; then
-           numparts=$max
-           max_known=1
-           break;
-       fi
-       if [ $cur -gt $numparts ]; then
-           numparts=$cur
-       fi
-    done
-    report "Split dump $dump should have $numparts total pieces"
-    if [ $max_known != 1 ]; then
-       report "NOTE: Header field for total pieces was UNKNOWN, $numparts is best guess"
-    fi
-    part=1
-    while [ $part -lt $numparts ];do
-       part=`expr $part + 1`
-       if [ X"`grep \"^$part/\" $TEMP/$dump.parts`" = X"" ];then
-           report "Spanning chunk part $part is missing!"
-           missing=`expr $missing + 1`
-       fi
-    done
-    if [ $missing = 0 ];then
-       report "All parts found"        
-    fi
-    rm -f $TEMP/$dump.parts
-done
-
-sendreport
-
-exit 0
diff --git a/server-src/amverifyrun.sh b/server-src/amverifyrun.sh
new file mode 100644 (file)
index 0000000..d35826e
--- /dev/null
@@ -0,0 +1,76 @@
+#!@SHELL@
+#
+
+echo "amverifyrun is deprecated -- use amcheckdump" >& 2
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+amlibexecdir="@amlibexecdir@"
+. "${amlibexecdir}/amanda-sh-lib.sh"
+
+# add sbin and ucb dirs
+PATH="$PATH:/usr/sbin:/sbin:/usr/ucb"
+export PATH
+
+USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
+if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then
+        SUF="-@VERSION@"
+else
+        SUF=
+fi
+
+getparm() {
+        $AMGETCONF $CONFIG $1 2>/dev/null
+}
+
+CONFIG=$1
+amlibexecdir=$amlibexecdir  
+sbindir=$sbindir
+AMGETCONF=$sbindir/amgetconf$SUF
+AMVERIFY=$sbindir/amverify$SUF
+LOGDIR=`getparm logdir`
+AMDUMPLOG=${LOGDIR}/amdump.1
+AMFLUSHLOG=${LOGDIR}/amflush.1
+if [ -f $AMDUMPLOG ]; then
+  if [ -f $AMFLUSHLOG ]; then
+    if [ $AMDUMPLOG -nt $AMFLUSHLOG ]; then
+      AMLOG=$AMDUMPLOG
+    else
+      AMLOG=$AMFLUSHLOG
+    fi
+  else
+    AMLOG=$AMDUMPLOG
+  fi
+else
+  if [ -f $AMFLUSHLOG ]; then
+    AMLOG=$AMFLUSHLOG
+  else
+    echo `_ 'Nothing to verify'`
+    exit 1;
+  fi
+fi
+
+
+FIRST_SLOT=`grep "taper: slot" $AMLOG | fgrep 'exact label match
+new tape
+first labelstr match' | sed 1q | sed 's/://g' | awk '{print $3}'`
+if [ X"$FIRST_SLOT" = X"" ]; then
+  FIRST_SLOT=`grep "taper: slot: .* wrote label" $AMLOG | sed 1q | sed 's/://g' | awk '{print $3}'`
+  if [ X"$FIRST_SLOT" = X"" ]; then
+    FIRST_SLOT='-1'
+  fi
+fi
+
+NBTAPES=`grep -c "taper: .*wrote label " $AMLOG`
+
+if [ X"$NBTAPES" != X"0" ]; then
+  if ln -s $AMLOG $LOGDIR/log ; then
+    $AMVERIFY $CONFIG $FIRST_SLOT $NBTAPES
+    if [ -L $LOGDIR/log ] ; then rm $LOGDIR/log ; fi
+  else
+    echo "amdump or amflush is already running, or you must run amcleanup"
+  fi
+else
+  echo `_ 'Nothing to verify'`
+fi
diff --git a/server-src/amverifyrun.sh.in b/server-src/amverifyrun.sh.in
deleted file mode 100644 (file)
index eeaebf6..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!@SHELL@
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-libexecdir=@libexecdir@
-
-PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
-export PATH
-
-USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
-if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then
-        SUF="-@VERSION@"
-else
-        SUF=
-fi
-
-getparm() {
-        $AMGETCONF $CONFIG $1 2>/dev/null
-}
-
-CONFIG=$1
-libexecdir=$libexecdir  
-sbindir=$sbindir
-AMGETCONF=$sbindir/amgetconf$SUF
-AMVERIFY=$sbindir/amverify$SUF
-LOGDIR=`getparm logdir`
-AMDUMPLOG=${LOGDIR}/amdump.1
-AMFLUSHLOG=${LOGDIR}/amflush.1
-if [ -f $AMDUMPLOG ]; then
-  if [ -f $AMFLUSHLOG ]; then
-    if [ $AMDUMPLOG -nt $AMFLUSHLOG ]; then
-      AMLOG=$AMDUMPLOG
-    else
-      AMLOG=$AMFLUSHLOG
-    fi
-  else
-    AMLOG=$AMDUMPLOG
-  fi
-else
-  if [ -f $AMFLUSHLOG ]; then
-    AMLOG=$AMFLUSHLOG
-  else
-    echo "Nothing to verify"
-    exit 1;
-  fi
-fi
-
-
-FIRST_SLOT=`grep "taper: slot" $AMLOG | fgrep 'exact label match
-new tape
-first labelstr match' | sed 1q | sed 's/://g' | awk '{print $3}'`
-if [ X"$FIRST_SLOT" = X"" ]; then
-  FIRST_SLOT=`grep "taper: slot: .* wrote label" $AMLOG | sed 1q | sed 's/://g' | awk '{print $3}'`
-  if [ X"$FIRST_SLOT" = X"" ]; then
-    FIRST_SLOT='-1'
-  fi
-fi
-
-NBTAPES=`grep -c "taper: .*wrote label " $AMLOG`
-
-if [ X"$NBTAPES" != X"0" ]; then
-  $AMVERIFY $CONFIG $FIRST_SLOT $NBTAPES
-else
-  echo "Nothing to verify"
-fi
index 84ea94296576f5bce504aff4b72bb562352e9b8b..c49319a2ec507abcb45c346424c7af37af6be92c 100644 (file)
@@ -57,25 +57,29 @@ static char *tapechanger = NULL;
 
 /* local functions */
 static int changer_command(char *cmd, char *arg);
-static int report_bad_resultstr(void);
+static int report_bad_resultstr(char *cmd);
 static int run_changer_command(char *cmd, char *arg, char **slotstr, char **rest);
 
 int
 changer_init(void)
 {
-    tapechanger = getconf_str(CNF_TPCHANGER);
+    if (tapechanger == NULL)
+       tapechanger = getconf_str(CNF_TPCHANGER);
+    if (*tapechanger != '\0' && *tapechanger != '/') {
+       tapechanger = vstralloc(amlibexecdir, "/", tapechanger, versionsuffix(),
+                               NULL);
+    }
     return strcmp(tapechanger, "") != 0;
 }
 
 
 static int
-report_bad_resultstr(void)
+report_bad_resultstr(char *cmd)
 {
     char *s;
 
-    s = vstralloc("badly formed result from changer: ",
-                 "\"", changer_resultstr, "\"",
-                 NULL);
+    s = vstrallocf(_("badly formed result from changer command %s: \"%s\""),
+                 cmd, changer_resultstr);
     amfree(changer_resultstr);
     changer_resultstr = s;
     return 2;
@@ -105,7 +109,7 @@ run_changer_command(
     ch = *s++;
 
     skip_whitespace(s, ch);
-    if(ch == '\0') return report_bad_resultstr();
+    if(ch == '\0') return report_bad_resultstr(cmd);
     slot = s - 1;
     skip_non_whitespace(s, ch);
     s[-1] = '\0';
@@ -120,7 +124,7 @@ run_changer_command(
     }
 
     if(exitcode) {
-       if(ch == '\0') return report_bad_resultstr();
+       if(ch == '\0') return report_bad_resultstr(cmd);
        result_copy = stralloc(s - 1);
        amfree(changer_resultstr);
        changer_resultstr = result_copy;
@@ -168,7 +172,7 @@ changer_loadslot(
     rc = run_changer_command("-slot", inslotstr, outslotstr, &rest);
 
     if(rc) return rc;
-    if(*rest == '\0') return report_bad_resultstr();
+    if(*rest == '\0') return report_bad_resultstr("-slot");
 
     *devicename = newstralloc(*devicename, rest);
     return 0;
@@ -198,15 +202,15 @@ changer_query(
     rc = run_changer_command("-info", (char *) NULL, curslotstr, &rest);
     if(rc) return rc;
 
-    dbprintf(("changer_query: changer return was %s\n",rest));
+    dbprintf(_("changer_query: changer return was %s\n"),rest);
     if (sscanf(rest, "%d %d %d", nslotsp, backwardsp, searchable) != 3) {
       if (sscanf(rest, "%d %d", nslotsp, backwardsp) != 2) {
-        return report_bad_resultstr();
+        return report_bad_resultstr("-info");
       } else {
         *searchable = 0;
       }
     }
-    dbprintf(("changer_query: searchable = %d\n",*searchable));
+    dbprintf(_("changer_query: searchable = %d\n"),*searchable);
     return 0;
 }
 
@@ -223,7 +227,7 @@ changer_info(
     if(rc) return rc;
 
     if (sscanf(rest, "%d %d", nslotsp, backwardsp) != 2) {
-       return report_bad_resultstr();
+       return report_bad_resultstr("-info");
     }
     return 0;
 }
@@ -253,7 +257,7 @@ changer_find(
 
     if (rc != 0) {
         /* Problem with the changer script. Bail. */
-        fprintf(stderr, "Changer problem: %s\n", changer_resultstr);
+        g_fprintf(stderr, _("Changer problem: %s\n"), changer_resultstr);
         return;
     }
 
@@ -262,11 +266,11 @@ changer_find(
    
     if (searchlabel != NULL)
     {
-      dbprintf(("changer_find: looking for %s changer is searchable = %d\n",
-               searchlabel, searchable));
+      dbprintf(_("changer_find: looking for %s changer is searchable = %d\n"),
+               searchlabel, searchable);
     } else {
-      dbprintf(("changer_find: looking for NULL changer is searchable = %d\n",
-               searchable));
+      dbprintf(_("changer_find: looking for NULL changer is searchable = %d\n"),
+               searchable);
     }
 
     if ((searchlabel!=NULL) && searchable && !done){
@@ -327,36 +331,26 @@ changer_command(
     int fd[2];
     amwait_t wait_exitcode = 1;
     int exitcode;
-    char num1[NUM_STR_SIZE];
-    char num2[NUM_STR_SIZE];
     char *cmdstr;
     pid_t pid, changer_pid = 0;
     int fd_to_close[4], *pfd_to_close = fd_to_close;
 
-    if (*tapechanger != '/') {
-       tapechanger = vstralloc(libexecdir, "/", tapechanger, versionsuffix(),
-                               NULL);
-       malloc_mark(tapechanger);
-    }
     cmdstr = vstralloc(tapechanger, " ",
                       cmd, arg ? " " : "", 
                       arg ? arg : "",
                       NULL);
 
     if(changer_debug) {
-       fprintf(stderr, "changer: opening pipe to: %s\n", cmdstr);
+       g_fprintf(stderr, _("changer: opening pipe to: %s\n"), cmdstr);
        fflush(stderr);
     }
 
     amfree(changer_resultstr);
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not create pipe for \"",
-                                      cmdstr,
-                                      "\": ",
-                                      strerror(errno),
-                                      NULL);
+       changer_resultstr = vstrallocf(
+                               _("<error> could not create pipe for \"%s\": %s"),
+                               cmdstr, strerror(errno));
        exitcode = 2;
        goto failed;
     }
@@ -378,96 +372,73 @@ changer_command(
     }
 
     if(fd[0] < 0 || fd[0] >= (int)FD_SETSIZE) {
-       snprintf(num1, SIZEOF(num1), "%d", fd[0]);
-       snprintf(num2, SIZEOF(num2), "%d", FD_SETSIZE-1);
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not create pipe for \"",
-                                      cmdstr,
-                                      "\": ",
-                                      "socketpair 0: descriptor ",
-                                      num1,
-                                      " out of range ( .. ",
-                                      num2,
-                                      ")",
-                                      NULL);
+       changer_resultstr = vstrallocf(
+                       _("<error> could not create pipe for \"%s\":"
+                       "socketpair 0: descriptor %d out of range ( 0 .. %d)"),
+                       cmdstr, fd[0], (int)FD_SETSIZE-1);
        exitcode = 2;
        goto done;
     }
     if(fd[1] < 0 || fd[1] >= (int)FD_SETSIZE) {
-       snprintf(num1, SIZEOF(num1), "%d", fd[1]);
-       snprintf(num2, SIZEOF(num2), "%d", FD_SETSIZE-1);
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not create pipe for \"",
-                                      cmdstr,
-                                      "\": ",
-                                      "socketpair 1: descriptor ",
-                                      num1,
-                                      " out of range ( .. ",
-                                      num2,
-                                      ")",
-                                      NULL);
+       changer_resultstr = vstrallocf(
+                       _("<error> could not create pipe for \"%s\":"
+                       "socketpair 1: descriptor %d out of range ( 0 .. %d)"),
+                       cmdstr, fd[1], (int)FD_SETSIZE-1);
        exitcode = 2;
        goto done;
     }
 
     switch(changer_pid = fork()) {
     case -1:
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not fork for \"",
-                                      cmdstr,
-                                      "\": ",
-                                      strerror(errno),
-                                      NULL);
+       changer_resultstr = vstrallocf(
+                       _("<error> could not fork for \"%s\": %s"),
+                       cmdstr, strerror(errno));
        exitcode = 2;
        goto done;
     case 0:
-       if(dup2(fd[1], 1) == -1 || dup2(dbfd(), 2) == -1) {
-           changer_resultstr = vstralloc ("<error> ",
-                                          "could not open pipe to \"",
-                                          cmdstr,
-                                          "\": ",
-                                          strerror(errno),
-                                          NULL);
+       debug_dup_stderr_to_debug();
+       if(dup2(fd[1], 1) == -1) {
+           changer_resultstr = vstrallocf(
+                       _("<error> could not open pipe to \"%s\": %s"),
+                       cmdstr, strerror(errno));
            (void)fullwrite(fd[1], changer_resultstr, strlen(changer_resultstr));
            exit(1);
        }
        aclose(fd[0]);
        aclose(fd[1]);
        if(config_dir && chdir(config_dir) == -1) {
-           changer_resultstr = vstralloc ("<error> ",
-                                          "could not cd to \"",
-                                          config_dir,
-                                          "\": ",
-                                          strerror(errno),
-                                          NULL);
-           (void)fullwrite(2, changer_resultstr, strlen(changer_resultstr));
+           changer_resultstr = vstrallocf(
+                       _("<error> could not cd to \"%s\": %s"),
+                       config_dir, strerror(errno));
+           (void)fullwrite(STDOUT_FILENO, changer_resultstr, strlen(changer_resultstr));
            exit(1);
        }
+       safe_fd(-1, 0);
        if(arg) {
            execle(tapechanger, tapechanger, cmd, arg, (char *)NULL,
                   safe_env());
        } else {
            execle(tapechanger, tapechanger, cmd, (char *)NULL, safe_env());
        }
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not exec \"",
-                                      tapechanger,
-                                      "\": ",
-                                      strerror(errno),
-                                      NULL);
-       (void)fullwrite(2, changer_resultstr, strlen(changer_resultstr));
+       changer_resultstr = vstrallocf(
+                       _("<error> could not exec \"%s\": %s"),
+                       tapechanger, strerror(errno));
+       (void)fullwrite(STDOUT_FILENO, changer_resultstr, strlen(changer_resultstr));
        exit(1);
     default:
        aclose(fd[1]);
     }
 
     if((changer_resultstr = areads(fd[0])) == NULL) {
-       changer_resultstr = vstralloc ("<error> ",
-                                      "could not read result from \"",
-                                      tapechanger,
-                                      errno ? "\": " : "\"",
-                                      errno ? strerror(errno) : "",
-                                      NULL);
+       if (errno == 0) {
+           changer_resultstr = vstrallocf(
+                       _("<error> could not read result from \"%s\": Premature end of file, see %s"),
+                       tapechanger, dbfn());
+       } else {
+           changer_resultstr = vstrallocf(
+                       _("<error> could not read result from \"%s\": %s"),
+                       tapechanger, strerror(errno));
+       }
     }
 
     while(1) {
@@ -475,23 +446,16 @@ changer_command(
            if(errno == EINTR) {
                continue;
            } else {
-               changer_resultstr = vstralloc ("<error> ",
-                                              "wait for \"",
-                                              tapechanger,
-                                              "\" failed: ",
-                                              strerror(errno),
-                                              NULL);
+               changer_resultstr = vstrallocf(
+                       _("<error> wait for \"%s\" failed: %s"),
+                       tapechanger, strerror(errno));
                exitcode = 2;
                goto done;
            }
        } else if (pid != changer_pid) {
-           snprintf(num1, SIZEOF(num1), "%ld", (long)pid);
-           changer_resultstr = vstralloc ("<error> ",
-                                          "wait for \"",
-                                          tapechanger,
-                                          "\" returned unexpected pid ",
-                                          num1,
-                                          NULL);
+           changer_resultstr = vstrallocf(
+                       _("<error> wait for \"%s\" returned unexpected pid %ld"),
+                       tapechanger, (long)pid);
            exitcode = 2;
            goto done;
        } else {
@@ -501,12 +465,9 @@ changer_command(
 
     /* mark out-of-control changers as fatal error */
     if(WIFSIGNALED(wait_exitcode)) {
-       snprintf(num1, SIZEOF(num1), "%d", WTERMSIG(wait_exitcode));
-       changer_resultstr = newvstralloc (changer_resultstr,
-                                         "<error> ",
-                                         changer_resultstr,
-                                         " (got signal ", num1, ")",
-                                         NULL);
+       changer_resultstr = newvstrallocf(changer_resultstr,
+                       _("<error> %s (got signal %d)"),
+                       changer_resultstr, WTERMSIG(wait_exitcode));
        exitcode = 2;
     } else {
        exitcode = WEXITSTATUS(wait_exitcode);
@@ -518,7 +479,7 @@ done:
 
 failed:
     if (exitcode != 0) {
-        dbprintf(("changer: got exit: %d str: %s\n", exitcode, changer_resultstr)); 
+        dbprintf(_("changer: got exit: %d str: %s\n"), exitcode, changer_resultstr); 
     }
 
     amfree(cmdstr);
@@ -542,11 +503,11 @@ changer_search(
     char *rest;
     int rc;
 
-    dbprintf(("changer_search: %s\n",searchlabel));
+    dbprintf("changer_search: %s\n",searchlabel);
     rc = run_changer_command("-search", searchlabel, outslotstr, &rest);
     if(rc) return rc;
 
-    if(*rest == '\0') return report_bad_resultstr();
+    if(*rest == '\0') return report_bad_resultstr("-search");
 
     *devicename = newstralloc(*devicename, rest);
     return 0;
@@ -572,12 +533,12 @@ changer_label(
     char *curslotstr = NULL;
     int nslots, backwards, searchable;
 
-    dbprintf(("changer_label: %s for slot %s\n",labelstr,slotsp));
+    dbprintf(_("changer_label: %s for slot %s\n"),labelstr,slotsp);
     rc = changer_query(&nslots, &curslotstr, &backwards,&searchable);
     amfree(curslotstr);
 
     if ((rc == 0) && (searchable == 1)){
-       dbprintf(("changer_label: calling changer -label %s\n",labelstr));
+       dbprintf(_("changer_label: calling changer -label %s\n"),labelstr);
        rc = run_changer_command("-label", labelstr, &slotstr, &rest);
        amfree(slotstr);
     }
index 043edba80ea9b7147d2784b83190c8fca26fdc74..ea81c624de7bb8e2a60a8fd4000e5cd974a2b445 100644 (file)
 #include "server_util.h"
 #include "util.h"
 #include "holding.h"
+#include "timestamp.h"
 
-#define chunker_debug(i,x) do {                \
+#define chunker_debug(i, ...) do {     \
        if ((i) <= debug_chunker) {     \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
@@ -109,16 +110,13 @@ static int do_chunk(int, struct databuf *);
 
 int
 main(
-    int                main_argc,
-    char **    main_argv)
+    int                argc,
+    char **    argv)
 {
     static struct databuf db;
     struct cmdargs cmdargs;
     cmd_t cmd;
     int infd;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-    char *conffile;
     char *q = NULL;
     char *filename = NULL;
     char *qfilename = NULL;
@@ -126,8 +124,17 @@ main(
     times_t runtime;
     am_feature_t *their_features = NULL;
     int a;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -138,68 +145,43 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
-    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (my_argc > 1) {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    } else {
-       char my_cwd[STR_SIZE];
+    if (argc > 1) 
+       cfg_opt = argv[1];
 
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    }
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-    safe_cd();
+    safe_cd(); /* do this *after* config_init() */
 
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
-    fprintf(stderr,
-           "%s: pid %ld executable %s version %s\n",
+    g_fprintf(stderr,
+           _("%s: pid %ld executable %s version %s\n"),
            get_pname(), (long) getpid(),
-           my_argv[0], version());
+           argv[0], version());
     fflush(stderr);
 
     /* now, make sure we are a valid user */
 
-    if (getpwuid(getuid()) == NULL) {
-       error("can't get login name for my uid %ld", (long)getuid());
-       /*NOTREACHED*/
-    }
-
     signal(SIGPIPE, SIG_IGN);
     signal(SIGCHLD, SIG_IGN);
 
     cmd = getcmd(&cmdargs);
     if(cmd == START) {
        if(cmdargs.argc <= 1)
-           error("error [dumper START: not enough args: timestamp]");
+           error(_("error [dumper START: not enough args: timestamp]"));
        chunker_timestamp = newstralloc(chunker_timestamp, cmdargs.argv[2]);
     }
     else {
-       error("Didn't get START command");
+       error(_("Didn't get START command"));
     }
 
 /*    do {*/
@@ -228,13 +210,13 @@ main(
            a = 2;
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: handle]");
+               error(_("error [chunker PORT-WRITE: not enough args: handle]"));
                /*NOTREACHED*/
            }
            handle = newstralloc(handle, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: filename]");
+               error(_("error [chunker PORT-WRITE: not enough args: filename]"));
                /*NOTREACHED*/
            }
            qfilename = newstralloc(qfilename, cmdargs.argv[a++]);
@@ -244,20 +226,20 @@ main(
            amfree(qfilename);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: hostname]");
+               error(_("error [chunker PORT-WRITE: not enough args: hostname]"));
                /*NOTREACHED*/
            }
            hostname = newstralloc(hostname, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: features]");
+               error(_("error [chunker PORT-WRITE: not enough args: features]"));
                /*NOTREACHED*/
            }
            am_release_feature_set(their_features);
            their_features = am_string_to_feature(cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: diskname]");
+               error(_("error [chunker PORT-WRITE: not enough args: diskname]"));
                /*NOTREACHED*/
            }
            qdiskname = newstralloc(qdiskname, cmdargs.argv[a++]);
@@ -266,50 +248,50 @@ main(
            diskname = unquote_string(qdiskname);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: level]");
+               error(_("error [chunker PORT-WRITE: not enough args: level]"));
                /*NOTREACHED*/
            }
            level = atoi(cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: dumpdate]");
+               error(_("error [chunker PORT-WRITE: not enough args: dumpdate]"));
                /*NOTREACHED*/
            }
            dumpdate = newstralloc(dumpdate, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: chunksize]");
+               error(_("error [chunker PORT-WRITE: not enough args: chunksize]"));
                /*NOTREACHED*/
            }
            chunksize = OFF_T_ATOI(cmdargs.argv[a++]);
            chunksize = am_floor(chunksize, (off_t)DISK_BLOCK_KB);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: progname]");
+               error(_("error [chunker PORT-WRITE: not enough args: progname]"));
                /*NOTREACHED*/
            }
            progname = newstralloc(progname, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: use]");
+               error(_("error [chunker PORT-WRITE: not enough args: use]"));
                /*NOTREACHED*/
            }
            use = am_floor(OFF_T_ATOI(cmdargs.argv[a++]), DISK_BLOCK_KB);
 
            if(a >= cmdargs.argc) {
-               error("error [chunker PORT-WRITE: not enough args: options]");
+               error(_("error [chunker PORT-WRITE: not enough args: options]"));
                /*NOTREACHED*/
            }
            options = newstralloc(options, cmdargs.argv[a++]);
 
            if(a != cmdargs.argc) {
-               error("error [chunker PORT-WRITE: too many args: %d != %d]",
+               error(_("error [chunker PORT-WRITE: too many args: %d != %d]"),
                      cmdargs.argc, a);
                /*NOTREACHED*/
            }
 
            if((infd = startup_chunker(filename, use, chunksize, &db)) < 0) {
-               q = squotef("[chunker startup failed: %s]", errstr);
+               q = squotef(_("[chunker startup failed: %s]"), errstr);
                putresult(TRYAGAIN, "%s %s\n", handle, q);
                error("startup_chunker failed");
            }
@@ -320,17 +302,13 @@ main(
                double rt;
 
                runtime = stopclock();
-               rt = (double)(runtime.r.tv_sec) +
-                    ((double)(runtime.r.tv_usec) / 1000000.0);
-               snprintf(kb_str, SIZEOF(kb_str), OFF_T_FMT,
-                        (OFF_T_FMT_TYPE)(dumpsize - (off_t)headersize));
-               snprintf(kps_str, SIZEOF(kps_str), "%3.1lf",
+                rt = g_timeval_to_double(runtime);
+               g_snprintf(kb_str, SIZEOF(kb_str), "%lld",
+                        (long long)(dumpsize - (off_t)headersize));
+               g_snprintf(kps_str, SIZEOF(kps_str), "%3.1lf",
                                isnormal(rt) ? (double)dumpsize / rt : 0.0);
-               errstr = newvstralloc(errstr,
-                                     "sec ", walltime_str(runtime),
-                                     " kb ", kb_str,
-                                     " kps ", kps_str,
-                                     NULL);
+               errstr = newvstrallocf(errstr, "sec %s kb %s kps %s",
+                               walltime_str(runtime), kb_str, kps_str);
                q = squotef("[%s]", errstr);
                if(command_in_transit != -1)
                    cmd = command_in_transit;
@@ -338,8 +316,8 @@ main(
                    cmd = getcmd(&cmdargs);
                switch(cmd) {
                case DONE:
-                   putresult(DONE, "%s " OFF_T_FMT " %s\n", handle,
-                            (OFF_T_FMT_TYPE)(dumpsize - (off_t)headersize), q);
+                   putresult(DONE, "%s %lld %s\n", handle,
+                            (long long)(dumpsize - (off_t)headersize), q);
                    log_add(L_SUCCESS, "%s %s %s %d [%s]",
                            hostname, qdiskname, chunker_timestamp, level, errstr);
                    break;
@@ -348,17 +326,15 @@ main(
                case FAILED:
                case ABORT_FINISHED:
                    if(dumpsize > (off_t)DISK_BLOCK_KB) {
-                       putresult(PARTIAL, "%s " OFF_T_FMT " %s\n", handle,
-                                (OFF_T_FMT_TYPE)(dumpsize - (off_t)headersize),
+                       putresult(PARTIAL, "%s %lld %s\n", handle,
+                                (long long)(dumpsize - (off_t)headersize),
                                 q);
                        log_add(L_PARTIAL, "%s %s %s %d [%s]",
                                hostname, qdiskname, chunker_timestamp, level, errstr);
                    }
                    else {
-                       errstr = newvstralloc(errstr,
-                                             "dumper returned ",
-                                             cmdstr[cmd],
-                                             NULL);
+                       errstr = newvstrallocf(errstr,
+                                       _("dumper returned %s"), cmdstr[cmd]);
                        amfree(q);
                        q = squotef("[%s]",errstr);
                        putresult(FAILED, "%s %s\n", handle, q);
@@ -389,7 +365,7 @@ main(
            } else if(cmdargs.argc >= 0) {
                q = squote(cmdargs.argv[0]);
            } else {
-               q = stralloc("(no input?)");
+               q = stralloc(_("(no input?)"));
            }
            putresult(BAD_COMMAND, "%s\n", q);
            amfree(q);
@@ -398,8 +374,6 @@ main(
 
 /*    } while(cmd != QUIT); */
 
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     amfree(errstr);
     amfree(chunker_timestamp);
     amfree(handle);
@@ -409,16 +383,9 @@ main(
     amfree(dumpdate);
     amfree(progname);
     amfree(options);
-    amfree(config_dir);
-    amfree(config_name);
     am_release_feature_set(their_features);
     their_features = NULL;
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if (malloc_size_1 != malloc_size_2)
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-
     dbclose();
 
     return (0); /* exit */
@@ -439,12 +406,20 @@ startup_chunker(
     char *tmp_filename, *pc;
     in_port_t data_port;
     int data_socket;
+    int result;
+    struct addrinfo *res;
 
     data_port = 0;
-    data_socket = stream_server(&data_port, 0, STREAM_BUFSIZE, 0);
+    if ((result = resolve_hostname("localhost", 0, &res, NULL) != 0)) {
+       errstr = newvstrallocf(errstr, _("could not resolve localhost: %s"),
+                              gai_strerror(result));
+       return -1;
+    }
+    data_socket = stream_server(res->ai_family, &data_port, 0,
+                               STREAM_BUFSIZE, 0);
 
     if(data_socket < 0) {
-       errstr = stralloc2("error creating stream server: ", strerror(errno));
+       errstr = vstrallocf(_("error creating stream server: %s"), strerror(errno));
        return -1;
     }
 
@@ -452,7 +427,7 @@ startup_chunker(
 
     infd = stream_accept(data_socket, CONNECT_TIMEOUT, 0, STREAM_BUFSIZE);
     if(infd == -1) {
-       errstr = stralloc2("error accepting stream: ", strerror(errno));
+       errstr = vstrallocf(_("error accepting stream: %s"), strerror(errno));
        return -1;
     }
 
@@ -464,14 +439,14 @@ startup_chunker(
     if ((outfd = open(tmp_filename, O_RDWR|O_CREAT|O_TRUNC, 0600)) < 0) {
        int save_errno = errno;
 
-       errstr = squotef("holding file \"%s\": %s",
+       errstr = squotef(_("holding file \"%s\": %s"),
                         tmp_filename,
                         strerror(errno));
        amfree(tmp_filename);
        aclose(infd);
        if(save_errno == ENOSPC) {
-           putresult(NO_ROOM, "%s " OFF_T_FMT "\n",
-                     handle, (OFF_T_FMT_TYPE)use);
+           putresult(NO_ROOM, "%s %lld\n",
+                     handle, (long long)use);
            return -2;
        } else {
            return -1;
@@ -504,20 +479,12 @@ do_chunk(
      */
     nread = fullread(infd, header_buf, SIZEOF(header_buf));
     if (nread != DISK_BLOCK_BYTES) {
-       char number1[NUM_STR_SIZE];
-       char number2[NUM_STR_SIZE];
-
        if(nread < 0) {
-           errstr = stralloc2("cannot read header: ", strerror(errno));
+           errstr = vstrallocf(_("cannot read header: %s"), strerror(errno));
        } else {
-           snprintf(number1, SIZEOF(number1), SSIZE_T_FMT,
-                       (SSIZE_T_FMT_TYPE)nread);
-           snprintf(number2, SIZEOF(number2), "%d", DISK_BLOCK_BYTES);
-           errstr = vstralloc("cannot read header: got ",
-                              number1,
-                              " instead of ",
-                              number2,
-                              NULL);
+           errstr = vstrallocf(_("cannot read header: got %zd bytes instead of %d"),
+                               nread,
+                               DISK_BLOCK_BYTES);
        }
        return 0;
     }
@@ -525,11 +492,11 @@ do_chunk(
     if(write_tapeheader(db->fd, &file)) {
        int save_errno = errno;
 
-       errstr = squotef("write_tapeheader file %s: %s",
+       errstr = squotef(_("write_tapeheader file %s: %s"),
                         db->filename, strerror(errno));
        if(save_errno == ENOSPC) {
-           putresult(NO_ROOM, "%s " OFF_T_FMT "\n", handle, 
-                     (OFF_T_FMT_TYPE)(db->use+db->split_size-dumpsize));
+           putresult(NO_ROOM, "%s %lld\n", handle, 
+                     (long long)(db->use+db->split_size-dumpsize));
        }
        return 0;
     }
@@ -642,7 +609,7 @@ databuf_flush(
                a = 3;
 
                if(a >= cmdargs.argc) {
-                   error("error [chunker CONTINUE: not enough args: filename]");
+                   error(_("error [chunker CONTINUE: not enough args: filename]"));
                    /*NOTREACHED*/
                }
                qarg_filename = newstralloc(qarg_filename, cmdargs.argv[a++]);
@@ -651,20 +618,20 @@ databuf_flush(
                arg_filename = unquote_string(qarg_filename);
 
                if(a >= cmdargs.argc) {
-                   error("error [chunker CONTINUE: not enough args: chunksize]");
+                   error(_("error [chunker CONTINUE: not enough args: chunksize]"));
                    /*NOTREACHED*/
                }
                db->chunk_size = OFF_T_ATOI(cmdargs.argv[a++]);
                db->chunk_size = am_floor(db->chunk_size, (off_t)DISK_BLOCK_KB);
 
                if(a >= cmdargs.argc) {
-                   error("error [chunker CONTINUE: not enough args: use]");
+                   error(_("error [chunker CONTINUE: not enough args: use]"));
                    /*NOTREACHED*/
                }
                db->use = OFF_T_ATOI(cmdargs.argv[a++]);
 
                if(a != cmdargs.argc) {
-                   error("error [chunker CONTINUE: too many args: %d != %d]",
+                   error(_("error [chunker CONTINUE: too many args: %d != %d]"),
                          cmdargs.argc, a);
                    /*NOTREACHED*/
                }
@@ -707,9 +674,9 @@ databuf_flush(
                } else if(cmdargs.argc >= 0) {
                    q = squote(cmdargs.argv[0]);
                } else {
-                   q = stralloc("(no input?)");
+                   q = stralloc(_("(no input?)"));
                }
-               error("error [bad command after RQ-MORE-DISK: \"%s\"]", q);
+               error(_("error [bad command after RQ-MORE-DISK: \"%s\"]"), q);
                /*NOTREACHED*/
            }
        }
@@ -722,7 +689,7 @@ databuf_flush(
         * First, open the new chunk file, and give it a new header
         * that has no cont_filename pointer.
         */
-       snprintf(sequence, SIZEOF(sequence), "%d", db->filename_seq);
+       g_snprintf(sequence, SIZEOF(sequence), "%d", db->filename_seq);
        new_filename = newvstralloc(new_filename,
                                    db->filename,
                                    ".",
@@ -741,13 +708,13 @@ databuf_flush(
            int save_errno = errno;
 
            if(save_errno == ENOSPC) {
-               putresult(NO_ROOM, "%s " OFF_T_FMT "\n", handle, 
-                         (OFF_T_FMT_TYPE)(db->use+db->split_size-dumpsize));
+               putresult(NO_ROOM, "%s %lld\n", handle, 
+                         (long long)(db->use+db->split_size-dumpsize));
                db->use = (off_t)0;                     /* force RQ_MORE_DISK */
                db->split_size = dumpsize;
                continue;
            }
-           errstr = squotef("creating chunk holding file \"%s\": %s",
+           errstr = squotef(_("creating chunk holding file \"%s\": %s"),
                             tmp_filename,
                             strerror(errno));
            aclose(db->fd);
@@ -762,13 +729,13 @@ databuf_flush(
 
            aclose(newfd);
            if(save_errno == ENOSPC) {
-               putresult(NO_ROOM, "%s " OFF_T_FMT "\n", handle, 
-                         (OFF_T_FMT_TYPE)(db->use+db->split_size-dumpsize));
+               putresult(NO_ROOM, "%s %lld\n", handle, 
+                         (long long)(db->use+db->split_size-dumpsize));
                db->use = (off_t)0;                     /* force RQ_MORE DISK */
                db->split_size = dumpsize;
                continue;
            }
-           errstr = squotef("write_tapeheader file %s: %s",
+           errstr = squotef(_("write_tapeheader file %s: %s"),
                             tmp_filename,
                             strerror(errno));
            rc = 0;
@@ -780,7 +747,7 @@ databuf_flush(
         * to the next chunk, and then close it.
         */
        if (lseek(db->fd, (off_t)0, SEEK_SET) < (off_t)0) {
-           errstr = squotef("lseek holding file %s: %s",
+           errstr = squotef(_("lseek holding file %s: %s"),
                             db->filename,
                             strerror(errno));
            aclose(newfd);
@@ -792,7 +759,7 @@ databuf_flush(
        strncpy(file.cont_filename, new_filename, SIZEOF(file.cont_filename));
        file.cont_filename[SIZEOF(file.cont_filename)] = '\0';
        if(write_tapeheader(db->fd, &file)) {
-           errstr = squotef("write_tapeheader file \"%s\": %s",
+           errstr = squotef(_("write_tapeheader file \"%s\": %s"),
                             db->filename,
                             strerror(errno));
            aclose(newfd);
@@ -850,7 +817,7 @@ databuf_flush(
     dumpbytes %= 1024;
     if (written < 0) {
        if (errno != ENOSPC) {
-           errstr = squotef("data write: %s", strerror(errno));
+           errstr = squotef(_("data write: %s"), strerror(errno));
            rc = 0;
            goto common_exit;
        }
@@ -859,8 +826,8 @@ databuf_flush(
         * NO-ROOM is informational only.  Later, RQ_MORE_DISK will be
         * issued to use another holding disk.
         */
-       putresult(NO_ROOM, "%s " OFF_T_FMT "\n", handle,
-                 (OFF_T_FMT_TYPE)(db->use+db->split_size-dumpsize));
+       putresult(NO_ROOM, "%s %lld\n", handle,
+                 (long long)(db->use+db->split_size-dumpsize));
        db->use = (off_t)0;                             /* force RQ_MORE_DISK */
        db->split_size = dumpsize;
        goto common_exit;
@@ -890,19 +857,16 @@ write_tapeheader(
     int                outfd,
     dumpfile_t *file)
 {
-    char buffer[DISK_BLOCK_BYTES];
+    char *buffer;
     ssize_t written;
 
     file->blocksize = DISK_BLOCK_BYTES;
-    build_header(buffer, file, SIZEOF(buffer));
-
-    written = fullwrite(outfd, buffer, SIZEOF(buffer));
-    if(written == (ssize_t)sizeof(buffer))
-       return 0;
-
-    if(written < 0)
-       return written;
+    buffer = build_header(file, DISK_BLOCK_BYTES);
 
+    written = fullwrite(outfd, buffer, DISK_BLOCK_BYTES);
+    amfree(buffer);
+    if(written == DISK_BLOCK_BYTES) return 0;
+    if(written < 0) return written;
     errno = ENOSPC;
     return (ssize_t)-1;
 }
index 74c4079dd3e287d1c9766b45a4cb30ba6b33326c..816c19488a71260fffe5cb8db56826ced6f5e731 100644 (file)
@@ -2,9 +2,8 @@
  * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
  * 
  * This program is free software; you can 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.
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
  * 
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -35,7 +34,8 @@ dumpspec_t *
 dumpspec_new(
     char *host, 
     char *disk, 
-    char *datestamp)
+    char *datestamp,
+    char *level)
 {
     dumpspec_t *rv;
 
@@ -44,6 +44,7 @@ dumpspec_new(
     if (host) rv->host = stralloc(host);
     if (disk) rv->disk = stralloc(disk);
     if (datestamp) rv->datestamp = stralloc(datestamp);
+    if (level) rv->level = stralloc(level);
 
     return rv;
 }
@@ -56,81 +57,90 @@ dumpspec_free(
     if (dumpspec->host) free(dumpspec->host);
     if (dumpspec->disk) free(dumpspec->disk);
     if (dumpspec->datestamp) free(dumpspec->datestamp);
+    if (dumpspec->level) free(dumpspec->level);
     free(dumpspec);
 }
 
 void
-dumpspec_free_list(
-    dumpspec_list_t *dumpspec_list)
+dumpspec_list_free(
+    GSList *dumpspec_list)
 {
-    dumpspec_t *dumpspec = (dumpspec_t *)dumpspec_list;
-    dumpspec_t *next;
+    /* first free all of the individual dumpspecs */
+    g_slist_foreach_nodata(dumpspec_list, dumpspec_free);
 
-    while (dumpspec) {
-        next = dumpspec->next;
-        dumpspec_free(dumpspec);
-        dumpspec = next;
-    }
+    /* then free the list itself */
+    g_slist_free(dumpspec_list);
 }
 
-dumpspec_list_t *
+GSList *
 cmdline_parse_dumpspecs(
     int argc,
-    char **argv)
+    char **argv,
+    int flags)
 {
-    dumpspec_t *dumpspec = NULL, *t;
+    dumpspec_t *dumpspec = NULL;
+    GSList *list = NULL;
     char *errstr;
     char *name;
     int optind = 0;
-    enum { ARG_GET_HOST, ARG_GET_DISK, ARG_GET_DATE } arg_state = ARG_GET_HOST;
+    enum { ARG_GET_HOST, ARG_GET_DISK, ARG_GET_DATESTAMP, ARG_GET_LEVEL } arg_state = ARG_GET_HOST;
 
     while (optind < argc) {
-        name = argv[optind++];
+        name = argv[optind];
         switch (arg_state) {
             case ARG_GET_HOST:
+                arg_state = ARG_GET_DISK;
                 if (name[0] != '\0'
                     && (errstr=validate_regexp(name)) != NULL) {
-                    fprintf(stderr, _("%s: bad hostname regex \"%s\": %s\n"),
-                                   get_pname(), name, errstr);
-                    goto error;
+                    error(_("bad hostname regex \"%s\": %s\n"), name, errstr);
                 }
-                t = dumpspec_new(name, NULL, NULL);
-                t->next = (dumpspec_t *)dumpspec;
-                dumpspec = t;
-                arg_state = ARG_GET_DISK;
+                dumpspec = dumpspec_new(name, NULL, NULL, NULL);
+               list = g_slist_append(list, (gpointer)dumpspec);
                 break;
 
             case ARG_GET_DISK:
+                arg_state = ARG_GET_DATESTAMP;
                 if (name[0] != '\0'
                     && (errstr=validate_regexp(name)) != NULL) {
-                    fprintf(stderr, _("%s: bad diskname regex \"%s\": %s\n"),
-                                   get_pname(), name, errstr);
-                    goto error;
+                    error(_("bad diskname regex \"%s\": %s\n"), name, errstr);
                 }
                 dumpspec->disk = stralloc(name);
-                arg_state = ARG_GET_DATE;
                 break;
 
-            case ARG_GET_DATE:
+            case ARG_GET_DATESTAMP:
+                arg_state = ARG_GET_LEVEL;
+               if (!(flags & CMDLINE_PARSE_DATESTAMP)) continue;
                 if (name[0] != '\0'
                     && (errstr=validate_regexp(name)) != NULL) {
-                    fprintf(stderr, _("%s: bad datestamp regex \"%s\": %s\n"),
-                                   get_pname(), name, errstr);
-                    goto error;
+                    error(_("bad datestamp regex \"%s\": %s\n"), name, errstr);
                 }
                 dumpspec->datestamp = stralloc(name);
+                break;
+
+            case ARG_GET_LEVEL:
                 arg_state = ARG_GET_HOST;
+               if (!(flags & CMDLINE_PARSE_LEVEL)) continue;
+                if (name[0] != '\0'
+                    && (errstr=validate_regexp(name)) != NULL) {
+                    error(_("bad level regex \"%s\": %s\n"), name, errstr);
+                }
+                dumpspec->level = stralloc(name);
                 break;
         }
+
+       optind++;
     }
 
-    if (dumpspec == NULL) 
-        dumpspec = dumpspec_new("", "", "");
-    return (dumpspec_list_t *)dumpspec;
+    /* if nothing was processed and the caller has requested it, 
+     * then add an "empty" element */
+    if (list == NULL && (flags & CMDLINE_EMPTY_TO_WILDCARD)) {
+        dumpspec = dumpspec_new("", "", 
+               (flags & CMDLINE_PARSE_DATESTAMP)?"":NULL,
+               (flags & CMDLINE_PARSE_LEVEL)?"":NULL);
+       list = g_slist_append(list, (gpointer)dumpspec);
+    }
 
-error:
-    dumpspec_free_list((dumpspec_list_t *)dumpspec);
-    return NULL;
+    return list;
 }
 
 char *
@@ -141,7 +151,8 @@ cmdline_format_dumpspec(
     return cmdline_format_dumpspec_components(
         dumpspec->host,
         dumpspec->disk,
-        dumpspec->datestamp);
+        dumpspec->datestamp,
+       dumpspec->level);
 }
 
 /* Quote str for shell interpretation, being conservative.
@@ -157,8 +168,11 @@ quote_dumpspec_string(char *str)
     int len = 0;
     int need_single_quotes = 0;
 
+    if (!str[0])
+       return stralloc("''"); /* special-case the empty string */
+
     for (p = str; *p; p++) {
-        if (!isalnum(*p) && *p != '.' && *p != '/') need_single_quotes=1;
+        if (!isalnum((int)*p) && *p != '.' && *p != '/') need_single_quotes=1;
         if (*p == '\'' || *p == '\\') len++; /* extra byte for '\' */
         len++;
     }
@@ -180,58 +194,65 @@ char *
 cmdline_format_dumpspec_components(
     char *host,
     char *disk,
-    char *datestamp)
+    char *datestamp,
+    char *level)
 {
     char *rv = NULL;
 
     host = host? quote_dumpspec_string(host):NULL;
     disk = disk? quote_dumpspec_string(disk):NULL;
     datestamp = datestamp? quote_dumpspec_string(datestamp):NULL;
+    level = level? quote_dumpspec_string(level):NULL;
 
     if (host) {
         rv = host;
+       host = NULL;
         if (disk) {
             rv = newvstralloc(rv, rv, " ", disk, NULL);
-            amfree(disk);
             if (datestamp) {
                 rv = newvstralloc(rv, rv, " ", datestamp, NULL);
-                amfree(datestamp);
+               if (level) {
+                   rv = newvstralloc(rv, rv, " ", level, NULL);
+               }
             }
         }
     }
+
+    if (host) amfree(host);
     if (disk) amfree(disk);
     if (datestamp) amfree(datestamp);
+    if (level) amfree(level);
 
     return rv;
 }
 
-sl_t *
+GSList *
 cmdline_match_holding(
-    dumpspec_list_t *dumpspec_list)
+    GSList *dumpspec_list)
 {
-    char *host;
-    char *disk;
-    char *datestamp;
-    filetype_t filetype;
     dumpspec_t *de;
-    sl_t *holding_files;
-    sle_t *he;
-    sl_t *matching_files = new_sl();
-
-    holding_set_verbosity(0);
-    holding_files = holding_get_files(NULL, NULL, 1);
-
-    for (he = holding_files->first; he != NULL; he = he->next) {
-        filetype = holding_file_read_header(he->name, &host, &disk, NULL, &datestamp);
-        if (filetype != F_DUMPFILE) continue;
-        for (de = (dumpspec_t *)dumpspec_list; de != NULL; de = de->next) {
-            if (de->host && !match_host(de->host, host)) continue;
-            if (de->disk && !match_disk(de->disk, disk)) continue;
-            if (de->datestamp && !match_datestamp(de->datestamp, datestamp)) continue;
-            matching_files = insert_sort_sl(matching_files, he->name);
+    GSList *li, *hi;
+    GSList *holding_files;
+    GSList *matching_files = NULL;
+    dumpfile_t file;
+
+    holding_files = holding_get_files(NULL, 1);
+
+    for (hi = holding_files; hi != NULL; hi = hi->next) {
+       /* TODO add level */
+       if (!holding_file_get_dumpfile((char *)hi->data, &file)) continue;
+        if (file.type != F_DUMPFILE) continue;
+        for (li = dumpspec_list; li != NULL; li = li->next) {
+           de = (dumpspec_t *)(li->data);
+            if (de->host && de->host[0] && !match_host(de->host, file.name)) continue;
+            if (de->disk && de->disk[0] && !match_disk(de->disk, file.disk)) continue;
+            if (de->datestamp && de->datestamp[0] && !match_datestamp(de->datestamp, file.datestamp)) continue;
+            matching_files = g_slist_append(matching_files, g_strdup((char *)hi->data));
             break;
         }
     }
 
+    g_slist_free_full(holding_files);
+
     return matching_files;
 }
index f3c20a33ac475fa0e4f3b0cc473e9edfeb111af5..9d0489f634ac56eecce59660b674939a008288a2 100644 (file)
@@ -2,9 +2,8 @@
  * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
  * 
  * This program is free software; you can 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.
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
  * 
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 #ifndef CMDLINE_H
 #define CMDLINE_H
 
-#include "sl.h"
-
-/* TODO: use glib's linked lists instead; dumpspec_list_t provides basic
- * type-checking to allow that to be implemented with a simple search and
- * replace. */
+#include <glib.h>
+#include "glib-util.h"
 
 /* A dumpspec can specify a particular dump (combining host, disk, and 
  * datestamp), or can be less specific by leaving out some components.
- * In some cases (such as selecting DLEs), the datestamp is not relevant.
- * Functions for these cases leave the datestamp NULL.
+ * Missing components are NULL, except in the special case of an 
+ * "wildcard" dumpspec, as detailed below.
+ *
+ * All strings in this struct are independently malloc()ed.
  */
 typedef struct dumpspec_s {
     char *host;
     char *disk;
     char *datestamp;
-
-    struct dumpspec_s * next;
+    char *level;
 } dumpspec_t;
 
-/* temporary */
-typedef dumpspec_t dumpspec_list_t;
-#define dumpspec_list_first(dsl) ((dumpspec_t *)(dsl))
-
 /*
  * Dumpspec list management
  */
@@ -61,13 +54,15 @@ typedef dumpspec_t dumpspec_list_t;
  * @param host: host name
  * @param disk: disk name
  * @param datestamp: datestamp
+ * @param level: level (as a string, allowing regexes)
  * @returns: dumpspec, or NULL on error
  */
 dumpspec_t *
 dumpspec_new(
     char *host, 
     char *disk, 
-    char *datestamp);
+    char *datestamp,
+    char *level);
 
 /* Free memory associated with a single dumpspec.  (Does not chase 
  * next pointers)
@@ -78,13 +73,15 @@ void
 dumpspec_free(
     dumpspec_t *dumpspec);
 
-/* Free memory associated with a list of dumpspecs.
+/* Free memory associated with a list of dumpspecs.  CAUTION: do not
+ * use glib's g_slist_free directly on a dumpspec list, as it will not
+ * free the elements themselves.
  *
- * @param dumpspec_list: the dumpspec list to free
+ * @param dumpspec_list: the GSList of dumpspecs to free
  */
 void
-dumpspec_free_list(
-    dumpspec_list_t *dumpspec_list);
+dumpspec_list_free(
+    GSList *dumpspec_list);
 
 /*
  * Parsing
@@ -95,26 +92,29 @@ dumpspec_free_list(
  *
  *  [ host [ disk [ datestamp [ host [ disk [ datestamp .. ] ] ] ] ] ]
  *
- * If no results are specified, a dumpspec with all entries set to ""
- * is returned; the caller may treat this as a wildcard or an error, as
- * appropriate.
+ * If no results are specified, the function either returns NULL (an 
+ * empty list) or, if CMDLINE_EMPTY_TO_WILDCARD is given, a list 
+ * containing a single dumpspec with all fields set to "".
  *
- * Prints a message to stderr and returns NULL if an error occurs.
+ * Calls error() with any fatal errors, e.g., invalid regexes.
  *
  * @param argc: count of command line arguments
  * @param argv: command line arguments
- * @returns: dumpspec list, or NULL on error
+ * @param flags: bitmask of the CMDLINE_* flags
+ * @returns: dumpspec list
  */
-dumpspec_list_t *
+GSList *
 cmdline_parse_dumpspecs(
     int argc,
-    char **argv);
-
-/* TODO: new name for match_disklist */
-int
-cmdline_parse_disk_list_entries(
-    int argc,
-    char **argv);
+    char **argv,
+    int flags);
+/* flags values (bitmask): */
+    /* parse datestamps after disks */
+#    define CMDLINE_PARSE_DATESTAMP (1<<0)
+    /* parse levels after datestamps or disks */
+#    define CMDLINE_PARSE_LEVEL (1<<1)
+    /* an empty argv should result in a wildcard dumpspec */
+#    define CMDLINE_EMPTY_TO_WILDCARD (1<<2)
 
 /*
  * Formatting
@@ -144,22 +144,25 @@ char *
 cmdline_format_dumpspec_components(
     char *host,
     char *disk,
-    char *datestamp);
+    char *datestamp,
+    char *level);
 
 /*
  * Searching
  */
 
-/* TODO: use glib here too */
-
-/* Find all holding files matching the dumpspec list.  
+/* Find all holding files matching the dumpspec list.  If
+ * the dumpspec list contains a dumpspec with all blank
+ * entries, all holding files are returned.
+ *
+ * Free the resulting list with g_slist_free_full()
  *
  * @param dumpspec_list: a list of dumpspecs
  * @returns: a list of holding disk filenames.
  */
-sl_t *
+GSList *
 cmdline_match_holding(
-    dumpspec_list_t *dumpspec_list);
+    GSList *dumpspec_list);
 
 #endif /* CMDLINE_H */
 
index 4d26969381caaa756fb2e238e9570c10ce2f9290..6c04a6fd7454e633d4c4468658b73c5986b51467 100644 (file)
@@ -65,11 +65,53 @@ add_dump(
     int                level,
     char *     tape,
     off_t      file,
-    int                partnum)
+    int                partnum,
+    int                maxpart)
 {
     DUMP_ITEM *new, *item, *before;
     int isafile = 0;
 
+    if(tape[0] == '/')
+       isafile = 1; /* XXX kludgey, like this whole thing */
+
+    /* See if we already have partnum=partnum-1 */
+    if (partnum > 1) {
+       int partnum_minus_1 = 0;
+       for(item = disk_hist, before = NULL; item;
+           before = item, item = item->next) {
+           if (!strcmp(item->date, date) &&
+                   item->level == level && item->is_split) {
+               tapelist_t *cur_tape;
+               for (cur_tape = item->tapes; cur_tape;
+                                            cur_tape = cur_tape->next) {
+                   int files;
+                   for(files=0; files<cur_tape->numfiles; files++) {
+                       if (cur_tape->partnum[files] == partnum - 1)
+                           partnum_minus_1 = 1;
+                   }
+               }
+               if (partnum_minus_1 == 1) {
+                   item->tapes = append_to_tapelist(item->tapes, tape, file,
+                                                    partnum, isafile);
+                   if (maxpart > item->maxpart)
+                       item->maxpart = maxpart;
+               } else {
+                   /* some part are missing, remove the item from disk_hist */
+                   if (before)
+                       before->next = item->next;
+                   else
+                       disk_hist = item->next;
+                   /* free item */
+                   free_tapelist(item->tapes);
+                   amfree(item->hostname);
+                   amfree(item);
+               }
+               return;
+           }
+       }
+       return;
+    }
+
     new = (DUMP_ITEM *)alloc(SIZEOF(DUMP_ITEM));
     strncpy(new->date, date, SIZEOF(new->date)-1);
     new->date[SIZEOF(new->date)-1] = '\0';
@@ -77,36 +119,23 @@ add_dump(
     strncpy(new->tape, tape, SIZEOF(new->tape)-1);
     new->tape[SIZEOF(new->tape)-1] = '\0';
     new->file = file;
-    if(partnum == -1) new->is_split = 0;
-    else new->is_split = 1;
+    new->maxpart = maxpart;
+    if(partnum == -1)
+        new->is_split = 0;
+    else
+        new->is_split = 1;
     new->tapes = NULL;
     new->hostname = stralloc(hostname);
 
-    if(new->tape[0] == '/')
-       isafile = 1; /* XXX kludgey, like this whole thing */
+    new->tapes = append_to_tapelist(new->tapes, tape, file, partnum, isafile);
 
     if (disk_hist == NULL)
     {
        disk_hist = new;
-       new->tapes = append_to_tapelist(new->tapes, tape, file, isafile);
        new->next = NULL;
        return;
     }
 
-    /* see if we already have part of this dump somewhere */
-    if(new->is_split){
-       for(item = disk_hist; item; item = item->next){
-           if (!strcmp(item->date, new->date) &&
-                   item->level == new->level && item->is_split){
-               item->tapes = append_to_tapelist(item->tapes, tape, file, isafile);
-               amfree(new);
-               return;
-           }
-       }
-    }
-
-    new->tapes = append_to_tapelist(new->tapes, tape, file, isafile);
-
     /* prepend this item to the history list, if it's newer */
     /* XXX this should probably handle them being on the same date with
        datestamp_uax or something */
@@ -129,6 +158,44 @@ add_dump(
     before->next = new;
 }
 
+void
+clean_dump(void)
+{
+    DUMP_ITEM *item, *before;
+
+    /* check if the maxpart part is avaliable */
+    for(item = disk_hist, before = NULL; item;
+                                        before = item, item = item->next) {
+       int found_maxpart = 0;
+       tapelist_t *cur_tape;
+
+       if (item->maxpart > 1) {
+           for (cur_tape = item->tapes; cur_tape; cur_tape = cur_tape->next) {
+               int files;
+               for(files=0; files<cur_tape->numfiles; files++) {
+                   if (cur_tape->partnum[files] == item->maxpart) {
+                       found_maxpart = 1;
+                   }
+               }
+           }
+           if (found_maxpart == 0) {
+               DUMP_ITEM *myitem = item; 
+
+               if (before)
+                   before->next = item->next;
+               else
+                   disk_hist = item->next;
+               item = item->next;
+               /* free myitem */
+               free_tapelist(myitem->tapes);
+               amfree(myitem->hostname);
+               amfree(myitem);
+               if (item == NULL)
+                   break;
+           }
+       }
+    }
+}
 
 DUMP_ITEM *
 first_dump(void)
index 2d21d88c33e19fd9347b01c5631fada31d372977..2a706f0af2b43c32b43da7fc21967231d40da1cf 100644 (file)
@@ -37,6 +37,7 @@ typedef struct DUMP_ITEM
     char date[20];
     int  level;
     int  is_split;
+    int  maxpart;
     char tape[256];
     tapelist_t *tapes;
     off_t  file;
@@ -49,6 +50,8 @@ DUMP_ITEM;
 #define next_dump(item)        ((item)->next)
 
 extern void clear_list(void);
-extern void add_dump(char *hostname, char *date, int level, char *tape, off_t file, int partnum);
+extern void add_dump(char *hostname, char *date, int level, char *tape,
+                    off_t file, int partnum, int maxpart);
+extern void clean_dump(void);
 extern DUMP_ITEM *first_dump(void);
 #endif /* !DISK_HISTORY_H */
index e13dcbf9184c833dedb19aeac4c7e017f19be2c2..b909b0dcc97ba032920b6fbb2f3c87246dd21960 100644 (file)
 #include "util.h"
 
 static am_host_t *hostlist;
+static netif_t *all_netifs;
 
 /* local functions */
 static char *upcase(char *st);
 static int parse_diskline(disklist_t *, const char *, FILE *, int *, char **);
 static void disk_parserror(const char *, int, const char *, ...)
-    __attribute__ ((format (printf, 3, 4)));
+                           G_GNUC_PRINTF(3, 4);
 
 
 int
@@ -318,6 +319,8 @@ free_disklist(
     while (dl->head != NULL) {
        dp = dequeue_disk(dl);
        amfree(dp->name);
+       amfree(dp->hostname);
+       amfree(dp->device);
        free_sl(dp->exclude_file);
        free_sl(dp->exclude_list);
        free_sl(dp->include_file);
@@ -362,7 +365,8 @@ parse_diskline(
     am_host_t *host;
     disk_t *disk;
     dumptype_t *dtype;
-    interface_t *netif = 0;
+    netif_t *netif = NULL;
+    interface_t *cfg_if = NULL;
     char *hostname = NULL;
     char *diskname, *diskdevice;
     char *dumptype;
@@ -392,7 +396,6 @@ parse_diskline(
     host = lookup_host(fp);
     if (host == NULL) {
        hostname = stralloc(fp);
-       malloc_mark(hostname);
     } else {
        hostname = stralloc(host->hostname);
        if (strcmp(host->hostname, fp) != 0) {
@@ -404,15 +407,15 @@ parse_diskline(
     shost = sanitise_filename(hostname);
     for (p = hostlist; p != NULL; p = p->next) {
        char *shostp = sanitise_filename(p->hostname);
-       if (!strcmp(hostname, p->hostname) &&
-            strcmp(shost, shostp)) {
-           disk_parserror(filename, line_num, "Two host are mapping to the same name: \"%s\" and \"%s\"", p->hostname, hostname);
+       if (strcmp(hostname, p->hostname) &&
+           !strcmp(shost, shostp)) {
+           disk_parserror(filename, line_num, "Two hosts are mapping to the same name: \"%s\" and \"%s\"", p->hostname, hostname);
            return(-1);
        }
        else if (strcasecmp(hostname, p->hostname) &&
                 match_host(hostname, p->hostname) &&
                 match_host(p->hostname, hostname)) {
-           disk_parserror(filename, line_num, "Duplicate host name: \"%s\" and \"%s\"", p->hostname, hostname);
+           disk_parserror(filename, line_num, _("Duplicate host name: \"%s\" and \"%s\""), p->hostname, hostname);
            return(-1);
        }
        amfree(shostp);
@@ -421,7 +424,7 @@ parse_diskline(
 
     skip_whitespace(s, ch);
     if(ch == '\0' || ch == '#') {
-       disk_parserror(filename, line_num, "disk device name expected");
+       disk_parserror(filename, line_num, _("disk device name expected"));
        amfree(hostname);
        return (-1);
     }
@@ -433,7 +436,7 @@ parse_diskline(
 
     skip_whitespace(s, ch);
     if(ch == '\0' || ch == '#') {
-       disk_parserror(filename, line_num, "disk dumptype expected");
+       disk_parserror(filename, line_num, _("disk dumptype expected"));
        amfree(hostname);
        amfree(diskname);
        return (-1);
@@ -452,7 +455,7 @@ parse_diskline(
            skip_whitespace(s, ch);
            if(ch == '\0' || ch == '#') {
                disk_parserror(filename, line_num,
-                       "disk dumptype '%s' not found", dumptype);
+                       _("disk dumptype '%s' not found"), dumptype);
                amfree(hostname);
                amfree(diskdevice);
                amfree(diskname);
@@ -487,18 +490,16 @@ parse_diskline(
        }
        if (dup == 1) {
            disk_parserror(filename, line_num,
-                          "duplicate disk record, previous on line %d",
+                          _("duplicate disk record, previous on line %d"),
                           disk->line);
        }
     }
     if (!disk) {
        disk = alloc(SIZEOF(disk_t));
-       malloc_mark(disk);
        disk->line = line_num;
        disk->hostname = stralloc(hostname);
        disk->name = diskname;
        disk->device = diskdevice;
-       malloc_mark(disk->name);
        disk->spindle = -1;
        disk->up = NULL;
        disk->inprogress = 0;
@@ -511,8 +512,7 @@ parse_diskline(
            if (strcmp(diskname, dp->name) != 0 &&
                 strcmp(sdisk, sdiskp) == 0) {
                disk_parserror(filename, line_num,
-                "Two disk are mapping to the same name: \"%s\" and \"%s\""
-                ", you must use different diskname",
+                _("Two disks are mapping to the same name: \"%s\" and \"%s\"; you must use different diskname"),
                 dp->name, diskname);
            return(-1);
            }
@@ -527,13 +527,13 @@ parse_diskline(
        skip_whitespace(s, ch);
        if (ch != '\0' && ch != '#') {
            disk_parserror(filename, line_num,
-                     "expected line break after `{\', ignoring rest of line");
+                     _("expected line break after `{\', ignoring rest of line"));
        }
 
        if (strchr(s-1, '}') &&
            (strchr(s-1, '#') == NULL ||
             strchr(s-1, '}') < strchr(s-1, '#'))) {
-           disk_parserror(filename, line_num,"'}' on same line than '{'");
+           disk_parserror(filename, line_num,_("'}' on same line than '{'"));
            amfree(hostname);
            if(!dup) {
                amfree(disk->device);
@@ -550,7 +550,7 @@ parse_diskline(
                              diskf, (char*)filename, line_num_p);
        if (dtype == NULL || dup) {
            disk_parserror(filename, line_num,
-                          "read of custom dumptype failed");
+                          _("read of custom dumptype failed"));
            amfree(hostname);
            if(!dup) {
                amfree(disk->device);
@@ -575,7 +575,7 @@ parse_diskline(
        if((dtype = lookup_dumptype(dumptype)) == NULL) {
            char *qdt = quote_string(dumptype);
 
-           disk_parserror(filename, line_num, "undefined dumptype `%s'", qdt);
+           disk_parserror(filename, line_num, _("undefined dumptype `%s'"), qdt);
            amfree(qdt);
            amfree(dumptype);
            amfree(hostname);
@@ -598,7 +598,7 @@ parse_diskline(
        return (-1);
     }
 
-    disk->dtype_name        = dtype->name;
+    disk->dtype_name        = dumptype_name(dtype);
     disk->program           = dumptype_get_program(dtype);
     disk->exclude_list     = duplicate_sl(dumptype_get_exclude(dtype).sl_list);
     disk->exclude_file     = duplicate_sl(dumptype_get_exclude(dtype).sl_file);
@@ -677,7 +677,7 @@ parse_diskline(
            }
        }
        if(is_digit == 0) {
-           disk_parserror(filename, line_num, "non-integer spindle `%s'", fp);
+           disk_parserror(filename, line_num, _("non-integer spindle `%s'"), fp);
            amfree(hostname);
            amfree(disk->name);
            amfree(disk);
@@ -692,21 +692,36 @@ parse_diskline(
     if(ch && ch != '#') {              /* get optional network interface */
        skip_non_whitespace(s, ch);
        s[-1] = '\0';
-       if((netif = lookup_interface(upcase(fp))) == NULL) {
+       if((cfg_if = lookup_interface(upcase(fp))) == NULL) {
            disk_parserror(filename, line_num,
-               "undefined network interface `%s'", fp);
+               _("undefined network interface `%s'"), fp);
            amfree(hostname);
            amfree(disk->name);
            amfree(disk);
            return (-1);
        }
     } else {
-       netif = lookup_interface("default");
+       cfg_if = lookup_interface("default");
+    }
+
+    /* see if we already have a netif_t for this interface */
+    for (netif = all_netifs; netif != NULL; netif = netif->next) {
+       if (netif->config == cfg_if)
+           break;
+    }
+
+    /* nope; make up a new one */
+    if (!netif) {
+       netif = alloc(sizeof(*netif));
+       netif->next = all_netifs;
+       all_netifs = netif;
+       netif->config = cfg_if;
+       netif->curusage = 0;
     }
 
     skip_whitespace(s, ch);
     if(ch && ch != '#') {              /* now we have garbage, ignore it */
-       disk_parserror(filename, line_num, "end of line expected");
+       disk_parserror(filename, line_num, _("end of line expected"));
     }
 
     if(dumptype_get_ignore(dtype) || dumptype_get_strategy(dtype) == DS_SKIP) {
@@ -717,7 +732,6 @@ parse_diskline(
 
     if(host == NULL) {                 /* new host */
        host = alloc(SIZEOF(am_host_t));
-       malloc_mark(host);
        host->next = hostlist;
        hostlist = host;
 
@@ -751,12 +765,13 @@ printf_arglist_function2(void disk_parserror, const char *, filename,
     int, line_num, const char *, format)
 {
     va_list argp;
+    const char *xlated_fmt = gettext(format);
 
     /* print error message */
 
-    fprintf(stderr, "\"%s\", line %d: ", filename, line_num);
+    g_fprintf(stderr, "\"%s\", line %d: ", filename, line_num);
     arglist_start(argp, format);
-    vfprintf(stderr, format, argp);
+    g_vfprintf(stderr, xlated_fmt, argp);
     arglist_end(argp);
     fputc('\n', stderr);
 }
@@ -774,24 +789,24 @@ dump_queue(
     char *qname;
 
     if(empty(q)) {
-       fprintf(f, "%s QUEUE: empty\n", st);
+       g_fprintf(f, _("%s QUEUE: empty\n"), st);
        return;
     }
-    fprintf(f, "%s QUEUE:\n", st);
+    g_fprintf(f, _("%s QUEUE:\n"), st);
     for(pos = 0, d = q.head, p = NULL; d != NULL; p = d, d = d->next, pos++) {
        qname = quote_string(d->name);
-       if(pos < npr) fprintf(f, "%3d: %-10s %-4s\n",
+       if(pos < npr) g_fprintf(f, "%3d: %-10s %-4s\n",
                              pos, d->host->hostname, qname);
        amfree(qname);
     }
     if(pos > npr) {
-       if(pos > npr+2) fprintf(f, "  ...\n");
+       if(pos > npr+2) g_fprintf(f, "  ...\n");
        if(pos > npr+1) {
            d = p->prev;
-           fprintf(f, "%3d: %-10s %-4s\n", pos-2, d->host->hostname, d->name);
+           g_fprintf(f, "%3d: %-10s %-4s\n", pos-2, d->host->hostname, d->name);
        }
        d = p;
-       fprintf(f, "%3d: %-10s %-4s\n", pos-1, d->host->hostname, d->name);
+       g_fprintf(f, "%3d: %-10s %-4s\n", pos-1, d->host->hostname, d->name);
     }
 }
 
@@ -833,16 +848,16 @@ optionstr(
        if(am_has_feature(dp->host->features, fe_options_bsd_auth))
            auth_opt = stralloc("bsd-auth;");
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support auth or bsd-auth\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support auth or bsd-auth\n"),
                    dp->host->hostname, qdpname);
        }
     } else if(strcasecmp(dp->security_driver, "krb4") == 0) {
        if(am_has_feature(dp->host->features, fe_options_krb4_auth))
            auth_opt = stralloc("krb4-auth;");
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support auth or krb4-auth\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support auth or krb4-auth\n"),
                    dp->host->hostname, qdpname);
        }
        if(dp->kencrypt) {
@@ -850,8 +865,8 @@ optionstr(
                kencrypt_opt = "kencrypt;";
            }
            else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support kencrypt\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support kencrypt\n"),
                    dp->host->hostname, qdpname);
            }
        }
@@ -863,8 +878,8 @@ optionstr(
            compress_opt = "compress-fast;";
        }
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support fast compression\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support fast compression\n"),
                    dp->host->hostname, qdpname);
        }
        break;
@@ -873,8 +888,8 @@ optionstr(
            compress_opt = "compress-best;";
        }
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support best compression\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support best compression\n"),
                    dp->host->hostname, qdpname);
        }
        break;
@@ -883,16 +898,16 @@ optionstr(
          compress_opt = vstralloc("comp-cust=", dp->clntcompprog, ";", NULL);
          if (BSTRNCMP(compress_opt, "comp-cust=;") == 0){
            if(fdout) {
-             fprintf(fdout,
-                     "ERROR: %s:%s client custom compression with no compression program specified\n",
+             g_fprintf(fdout,
+                     _("ERROR: %s:%s client custom compression with no compression program specified\n"),
                      dp->host->hostname, qdpname);
            }
            err++;
          }
        }
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support client custom compression\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support client custom compression\n"),
                    dp->host->hostname, qdpname);
        }
        break;
@@ -911,16 +926,16 @@ optionstr(
          compress_opt = vstralloc("srvcomp-cust=", dp->srvcompprog, ";", NULL);
          if (BSTRNCMP(compress_opt, "srvcomp-cust=;") == 0){
            if(fdout) {
-             fprintf(fdout,
-                     "ERROR: %s:%s server custom compression with no compression program specified\n",
+             g_fprintf(fdout,
+                     _("ERROR: %s:%s server custom compression with no compression program specified\n"),
                      dp->host->hostname, qdpname);
            }
            err++;
          }
        }
        else if(fdout) {
-         fprintf(fdout,
-                 "WARNING: %s:%s does not support server custom compression\n",
+         g_fprintf(fdout,
+                 _("WARNING: %s:%s does not support server custom compression\n"),
                  dp->host->hostname, qdpname);
        }
        break;
@@ -933,8 +948,8 @@ optionstr(
                                    dp->clnt_encrypt, ";", NULL);
         if (BSTRNCMP(encrypt_opt, "encrypt-cust=;") == 0) {
            if(fdout) {
-             fprintf(fdout,
-                     "ERROR: %s:%s encrypt client with no encryption program specified\n",
+             g_fprintf(fdout,
+                     _("ERROR: %s:%s encrypt client with no encryption program specified\n"),
                      dp->host->hostname, qdpname);
            }
            err++;
@@ -943,8 +958,10 @@ optionstr(
              dp->compress == COMP_SERVER_BEST ||
              dp->compress == COMP_SERVER_CUST ) {
           if(fdout) {
-             fprintf(fdout,
-                     "ERROR: %s:Client encryption with server compression is not supported. See amanda.conf(5) for detail.\n", dp->host->hostname);
+             g_fprintf(fdout,
+                     _("ERROR: %s:Client encryption with server compression is "
+                       "not supported. See amanda.conf(5) for detail.\n"), 
+                       dp->host->hostname);
            }
            err++;
          }
@@ -954,15 +971,15 @@ optionstr(
                                        dp->clnt_decrypt_opt, ";", NULL);
           }
           else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support client decrypt option\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support client decrypt option\n"),
                    dp->host->hostname, qdpname);
           }
         }
       }
       else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support client data encryption\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support client data encryption\n"),
                    dp->host->hostname, qdpname);
      }
         break;
@@ -972,9 +989,12 @@ optionstr(
                                    dp->srv_encrypt, ";", NULL);
         if (BSTRNCMP(encrypt_opt, "encrypt-serv-cust=;") == 0){
            if(fdout) {
-             fprintf(fdout,
-                     "ERROR: %s:%s encrypt server with no encryption program specified\n",
+             g_fprintf(fdout,
+                     _("ERROR: %s:%s No encryption program specified in dumptypes\n"),
                      dp->host->hostname, qdpname);
+             g_fprintf(fdout, _("Change the dumptype in the disklist or mention "
+                              "the ecnryption program to use in the dumptypes file"));
+
            }
            err++;
          }
@@ -984,15 +1004,15 @@ optionstr(
                                        dp->srv_decrypt_opt, ";", NULL);
           }
           else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support server decrypt option\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support server decrypt option\n"),
                    dp->host->hostname, qdpname);
           }
         }
       }
       else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support server data encryption\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support server data encryption\n"),
                    dp->host->hostname, qdpname);
       }
         break;
@@ -1003,7 +1023,7 @@ optionstr(
            record_opt = "no-record;";
        }
        else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support no record\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support no record\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1013,7 +1033,7 @@ optionstr(
            index_opt = "index;";
        }
        else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support index\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support index\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1040,14 +1060,14 @@ optionstr(
                exc = newvstralloc(exc, "exclude-file=", qname, ";", NULL);
                strappend(exclude_file, exc);
                if(fdout) {
-                   fprintf(fdout,
-                      "WARNING: %s:%s does not support multiple exclude\n",
+                   g_fprintf(fdout,
+                      _("WARNING: %s:%s does not support multiple exclude\n"),
                       dp->host->hostname, qdpname);
                }
                amfree(qname);
            }
        } else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support exclude file\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support exclude file\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1068,14 +1088,14 @@ optionstr(
                exc = newvstralloc(exc, "exclude-list=", qname, ";", NULL);
                strappend(exclude_list, exc);
                if(fdout) {
-                       fprintf(fdout,
-                        "WARNING: %s:%s does not support multiple exclude\n",
+                       g_fprintf(fdout,
+                        _("WARNING: %s:%s does not support multiple exclude\n"),
                         dp->host->hostname, qdpname);
                }
                amfree(qname);
            }
        } else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support exclude list\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support exclude list\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1099,14 +1119,14 @@ optionstr(
                exc = newvstralloc(exc, "include-file=", qname, ";", NULL);
                strappend(include_file, exc);
                if(fdout) {
-                   fprintf(fdout,
-                        "WARNING: %s:%s does not support multiple include\n",
+                   g_fprintf(fdout,
+                        _("WARNING: %s:%s does not support multiple include\n"),
                         dp->host->hostname, qdpname);
                }
                amfree(qname);
            }
        } else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support include file\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support include file\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1127,14 +1147,14 @@ optionstr(
                exc = newvstralloc(exc, "include-list=", qname, ";", NULL);
                strappend(include_list, exc);
                if(fdout) {
-                       fprintf(fdout,
-                        "WARNING: %s:%s does not support multiple include\n",
+                       g_fprintf(fdout,
+                        _("WARNING: %s:%s does not support multiple include\n"),
                         dp->host->hostname, qdpname);
                }
                amfree(qname);
            }
        } else if(fdout) {
-           fprintf(fdout, "WARNING: %s:%s does not support include list\n",
+           g_fprintf(fdout, _("WARNING: %s:%s does not support include list\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1144,8 +1164,8 @@ optionstr(
            excl_opt = "exclude-optional;";
        }
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support optional exclude\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support optional exclude\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1154,8 +1174,8 @@ optionstr(
           incl_opt = "include-optional;";
        }
        else if(fdout) {
-           fprintf(fdout,
-                   "WARNING: %s:%s does not support optional include\n",
+           g_fprintf(fdout,
+                   _("WARNING: %s:%s does not support optional include\n"),
                    dp->host->hostname, qdpname);
        }
     }
@@ -1231,7 +1251,7 @@ match_disklist(
               (match_disk(sargv[i], dp->name) ||
                (dp->device && match_disk(sargv[i], dp->device)))) {
                if(match_a_host) {
-                   error("Argument %s match a host and a disk",sargv[i]);
+                   error(_("Argument %s cannot be both a host and a disk"),sargv[i]);
                    /*NOTREACHED*/
                }
                else {
@@ -1256,7 +1276,9 @@ match_disklist(
                prev_match = 1;
            }
            else {
-               vstrextend(&errstr, "Argument '", sargv[i], "' match neither a host nor a disk.\n", NULL);
+               char *errstr1 = vstrallocf(_("Argument '%s' matches neither a host nor a disk.\n"), sargv[i]);
+               vstrextend(&errstr, errstr1, NULL);
+               prev_match = 0;
            }
        }
     }
@@ -1277,6 +1299,11 @@ match_disklist(
     return errstr;
 }
 
+netif_t *
+disklist_netifs(void)
+{
+    return all_netifs;
+}
 
 #ifdef TEST
 
@@ -1288,7 +1315,7 @@ static void
 dump_disk(
     const disk_t *     dp)
 {
-    printf("  DISK %s (HOST %s, LINE %d) TYPE %s NAME %s SPINDLE %d\n",
+    g_printf(_("  DISK %s (HOST %s, LINE %d) TYPE %s NAME %s SPINDLE %d\n"),
           dp->name, dp->host->hostname, dp->line, dp->dtype_name,
           dp->name == NULL? "(null)": dp->name,
           dp->spindle);
@@ -1302,31 +1329,34 @@ dump_disklist(
     const am_host_t *hp;
 
     if(hostlist == NULL) {
-       printf("DISKLIST not read in\n");
+       g_printf(_("DISKLIST not read in\n"));
        return;
     }
 
-    printf("DISKLIST BY HOSTNAME:\n");
+    g_printf(_("DISKLIST BY HOSTNAME:\n"));
 
     for(hp = hostlist; hp != NULL; hp = hp->next) {
-       printf("HOST %s INTERFACE %s\n",
+       char *if_name = NULL;
+       if (hp->netif && hp->netif->config)
+           if_name = interface_name(hp->netif->config);
+
+       g_printf(_("HOST %s INTERFACE %s\n"),
               hp->hostname,
-              (hp->netif == NULL||hp->netif->name == NULL) ? "(null)"
-                                                           : hp->netif->name);
+              if_name ? _("(null)") : if_name);
        for(dp = hp->disks; dp != NULL; dp = dp->hostnext)
            dump_disk(dp);
        putchar('\n');
     }
 
 
-    printf("DISKLIST IN FILE ORDER:\n");
+    g_printf(_("DISKLIST IN FILE ORDER:\n"));
 
     prev = NULL;
     for(dp = lst->head; dp != NULL; prev = dp, dp = dp->next) {
        dump_disk(dp);
        /* check pointers */
-       if(dp->prev != prev) printf("*** prev pointer mismatch!\n");
-       if(dp->next == NULL && lst->tail != dp) printf("tail mismatch!\n");
+       if(dp->prev != prev) g_printf(_("*** prev pointer mismatch!\n"));
+       if(dp->next == NULL && lst->tail != dp) g_printf(_("tail mismatch!\n"));
     }
 }
 
@@ -1339,8 +1369,15 @@ main(
   char *conf_diskfile;
   disklist_t lst;
   int result;
-  unsigned long malloc_hist_1, malloc_size_1;
-  unsigned long malloc_hist_2, malloc_size_2;
+
+  /*
+   * Configure program for internationalization:
+   *   1) Only set the message locale for now.
+   *   2) Set textdomain for all amanda related programs to "amanda"
+   *      We don't want to be forced to support dozens of message catalogs.
+   */  
+  setlocale(LC_MESSAGES, "C");
+  textdomain("amanda"); 
 
   safe_fd(-1, 0);
 
@@ -1351,8 +1388,6 @@ main(
   /* Don't die when child closes pipe */
   signal(SIGPIPE, SIG_IGN);
 
-  malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
   if (argc>1) {
     config_name = argv[1];
     if (strchr(config_name, '/') != NULL) {
@@ -1366,12 +1401,7 @@ main(
   }
   conffile = stralloc2(config_dir, CONFFILE_NAME);
   if((result = read_conffile(conffile)) == 0) {
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-      conf_diskfile = stralloc(conf_diskfile);
-    } else {
-      conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     result = read_diskfile(conf_diskfile, &lst);
     if(result == 0) {
       dump_disklist(&lst);
@@ -1381,12 +1411,6 @@ main(
   amfree(conffile);
   amfree(config_dir);
 
-  malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-  if(malloc_size_1 != malloc_size_2) {
-    malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-  }
-
   return result;
 }
 #endif /* TEST */
index 78a49efed844ce77dbbbacd5fec955d4ffa7a690..a7f13b60c233cf70d4eb3436d720154a17ee3707 100644 (file)
 #include "conffile.h"
 #include "amfeatures.h"
 
+typedef struct netif_s {
+    struct netif_s *next;
+    interface_t *config;
+    unsigned long curusage;
+} netif_t;
+
 typedef struct amhost_s {
     struct amhost_s *next;             /* next host */
     char *hostname;                    /* name of host */
     struct disk_s *disks;              /* linked list of disk records */
     int inprogress;                    /* # dumps in progress */
     int maxdumps;                      /* maximum dumps in parallel */
-    interface_t *netif;                        /* network interface this host is on */
+    netif_t *netif;                    /* network interface this host is on */
     time_t start_t;                    /* start dump after this time */
     char *up;                          /* generic user pointer */
     am_feature_t *features;            /* feature set */
@@ -138,4 +144,6 @@ char *optionstr(disk_t *dp, am_feature_t *their_features, FILE *fdout);
 char *match_disklist(disklist_t *origqp, int sargc, char **sargv);
 void free_disklist(disklist_t *dl);
 
+netif_t *disklist_netifs(void);
+
 #endif /* ! DISKFILE_H */
index d5f265c0d664f084d16d3eccac23c29927acd6b6..0a5c2c580377b7b9d0ac3b352dc185b8f110d245 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: driver.c,v 1.198 2006/08/24 01:57:16 paddy_s Exp $
+ * $Id: driver.c 6512 2007-05-24 17:00:24Z ian $
  *
  * controlling process for the Amanda backup system
  */
 #include "holding.h"
 #include "infofile.h"
 #include "logfile.h"
-#include "statfs.h"
+#include "fsusage.h"
 #include "version.h"
 #include "driverio.h"
 #include "server_util.h"
+#include "timestamp.h"
 
-#define driver_debug(i,x) do {         \
+#define driver_debug(i, ...) do {      \
        if ((i) <= debug_driver) {      \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
-#define hold_debug(i,x) do {           \
+#define hold_debug(i, ...) do {                \
        if ((i) <= debug_holding) {     \
-           dbprintf(x);                \
+           dbprintf(__VA_ARGS__);      \
        }                               \
 } while (0)
 
-static disklist_t waitq, runq, tapeq, roomq;
+static disklist_t waitq;       // dle waiting estimate result
+static disklist_t runq;                // dle waiting to be dumped to holding disk
+static disklist_t directq;     // dle waiting to be dumped directly to tape
+static disklist_t tapeq;       // dle on holding disk waiting to be written
+                               //   to tape
+static disklist_t roomq;       // dle waiting for more space on holding disk
 static int pending_aborts;
 static disk_t *taper_disk;
 static int degraded_mode;
@@ -71,7 +77,7 @@ static int  inparallel;
 static int nodump = 0;
 static off_t tape_length = (off_t)0;
 static off_t tape_left = (off_t)0;
-static int current_tape = 1;
+static int current_tape = 0;
 static int conf_taperalgo;
 static int conf_runtapes;
 static time_t sleep_time;
@@ -80,30 +86,44 @@ static char *driver_timestamp;
 static char *hd_driver_timestamp;
 static am_host_t *flushhost = NULL;
 static int need_degraded=0;
-
+static holdalloc_t *holdalloc;
+static int num_holdalloc;
 static event_handle_t *dumpers_ev_time = NULL;
 static event_handle_t *schedule_ev_read = NULL;
+static int   conf_flush_threshold_dumped;
+static int   conf_flush_threshold_scheduled;
+static int   conf_taperflush;
+static off_t flush_threshold_dumped;
+static off_t flush_threshold_scheduled;
+static off_t taperflush;
+static int   schedule_done;                    // 1 if we don't wait for a
+                                               //   schedule from the planner
+static int   force_flush;                      // All dump are terminated, we
+                                               // must now respect taper_flush
 
 static int wait_children(int count);
 static void wait_for_children(void);
-static void allocate_bandwidth(interface_t *ip, unsigned long kps);
+static void allocate_bandwidth(netif_t *ip, unsigned long kps);
 static int assign_holdingdisk(assignedhd_t **holdp, disk_t *diskp);
 static void adjust_diskspace(disk_t *diskp, cmd_t cmd);
 static void delete_diskspace(disk_t *diskp);
 static assignedhd_t **build_diskspace(char *destname);
 static int client_constrained(disk_t *dp);
-static void deallocate_bandwidth(interface_t *ip, unsigned long kps);
+static void deallocate_bandwidth(netif_t *ip, unsigned long kps);
 static void dump_schedule(disklist_t *qp, char *str);
-static int dump_to_tape(disk_t *dp);
+static void dump_to_tape(disk_t *dp);
 static assignedhd_t **find_diskspace(off_t size, int *cur_idle,
                                        assignedhd_t *preferred);
-static unsigned long free_kps(interface_t *ip);
+static unsigned long free_kps(netif_t *ip);
 static off_t free_space(void);
-static void dumper_result(disk_t *dp);
+static void dumper_chunker_result(disk_t *dp);
+static void dumper_taper_result(disk_t *dp);
+static void file_taper_result(disk_t *dp);
 static void handle_dumper_result(void *);
 static void handle_chunker_result(void *);
 static void handle_dumpers_time(void *);
 static void handle_taper_result(void *);
+
 static void holdingdisk_state(char *time_str);
 static dumper_t *idle_dumper(void);
 static void interface_state(char *time_str);
@@ -116,48 +136,46 @@ static void start_degraded_mode(disklist_t *queuep);
 static void start_some_dumps(disklist_t *rq);
 static void continue_port_dumps(void);
 static void update_failed_dump_to_tape(disk_t *);
-#if 0
-static void dump_state(const char *str);
-#endif
-int main(int main_argc, char **main_argv);
+
+typedef enum {
+    TAPE_ACTION_NO_ACTION     = 0,
+    TAPE_ACTION_NEW_TAPE      = (1 << 0),
+    TAPE_ACTION_NO_NEW_TAPE   = (1 << 1),
+    TAPE_ACTION_START_A_FLUSH = (1 << 2)
+} TapeAction;
+
+static TapeAction tape_action(void);
 
 static const char *idle_strings[] = {
 #define NOT_IDLE               0
-    "not-idle",
+    T_("not-idle"),
 #define IDLE_NO_DUMPERS                1
-    "no-dumpers",
+    T_("no-dumpers"),
 #define IDLE_START_WAIT                2
-    "start-wait",
+    T_("start-wait"),
 #define IDLE_NO_HOLD           3
-    "no-hold",
+    T_("no-hold"),
 #define IDLE_CLIENT_CONSTRAINED        4
-    "client-constrained",
-#define IDLE_NO_DISKSPACE      5
-    "no-diskspace",
-#define IDLE_TOO_LARGE         6
-    "file-too-large",
-#define IDLE_NO_BANDWIDTH      7
-    "no-bandwidth",
-#define IDLE_TAPER_WAIT                8
-    "taper-wait",
+    T_("client-constrained"),
+#define IDLE_NO_BANDWIDTH      5
+    T_("no-bandwidth"),
+#define IDLE_NO_DISKSPACE      6
+    T_("no-diskspace")
 };
 
 int
 main(
-    int                main_argc,
-    char **    main_argv)
+    int                argc,
+    char **    argv)
 {
     disklist_t origq;
     disk_t *diskp;
     int dsk;
     dumper_t *dumper;
     char *newdir = NULL;
-    generic_fs_stats_t fs;
+    struct fs_usage fsusage;
     holdingdisk_t *hdp;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
     unsigned long reserve = 100;
-    char *conffile;
     char *conf_diskfile;
     cmd_t cmd;
     int result_argc;
@@ -166,9 +184,20 @@ main(
     char *conf_tapetype;
     tapetype_t *tape;
     char *line;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     char hostname[1025];
+    intmax_t kb_avail;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+    holdalloc_t *ha, *ha_last;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda");
 
     safe_fd(-1, 0);
 
@@ -184,56 +213,34 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
     startclock();
 
-    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
-
-    printf("%s: pid %ld executable %s version %s\n",
-          get_pname(), (long) getpid(), my_argv[0], version());
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (my_argc > 1) {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-       if(my_argc > 2) {
-           if(strncmp(my_argv[2], "nodump", 6) == 0) {
-               nodump = 1;
-           }
-       }
+    if (argc > 1)
+       cfg_opt = argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-    } else {
+    g_printf(_("%s: pid %ld executable %s version %s\n"),
+          get_pname(), (long) getpid(), argv[0], version());
 
-       char my_cwd[STR_SIZE];
-
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
+    if(argc > 2) {
+        if(strncmp(argv[2], "nodump", 6) == 0) {
+            nodump = 1;
+        }
     }
 
-    safe_cd();
+    safe_cd(); /* do this *after* config_init */
 
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-
     amfree(driver_timestamp);
     /* read timestamp from stdin */
     while ((line = agets(stdin)) != NULL) {
@@ -242,17 +249,17 @@ main(
        amfree(line);
     }
     if ( line == NULL ) {
-      error("Did not get DATE line from planner");
+      error(_("Did not get DATE line from planner"));
       /*NOTREACHED*/
     }
     driver_timestamp = alloc(15);
     strncpy(driver_timestamp, &line[5], 14);
     driver_timestamp[14] = '\0';
     amfree(line);
-    log_add(L_START,"date %s", driver_timestamp);
+    log_add(L_START,_("date %s"), driver_timestamp);
 
     gethostname(hostname, SIZEOF(hostname));
-    log_add(L_STATS,"hostname %s", hostname);
+    log_add(L_STATS,_("hostname %s"), hostname);
 
     /* check that we don't do many dump in a day and usetimestamps is off */
     if(strlen(driver_timestamp) == 8) {
@@ -263,21 +270,21 @@ main(
            char *oldlogfile = vstralloc(conf_logdir, "/oldlog/log.",
                                         driver_timestamp, ".0", NULL);
            if(access(logfile, F_OK) == 0 || access(oldlogfile, F_OK) == 0) {
-               log_add(L_WARNING, "WARNING: This is not the first amdump run today. Enable the usetimestamps option in the configuration file if you want to run amdump more than once per calendar day.");
+               log_add(L_WARNING, _("WARNING: This is not the first amdump run today. Enable the usetimestamps option in the configuration file if you want to run amdump more than once per calendar day."));
            }
            amfree(oldlogfile);
            amfree(logfile);
        }
-       hd_driver_timestamp = construct_timestamp(NULL);
+       hd_driver_timestamp = get_timestamp_from_time(0);
     }
     else {
        hd_driver_timestamp = stralloc(driver_timestamp);
     }
 
-    taper_program = vstralloc(libexecdir, "/", "taper", versionsuffix(), NULL);
-    dumper_program = vstralloc(libexecdir, "/", "dumper", versionsuffix(),
+    taper_program = vstralloc(amlibexecdir, "/", "taper", versionsuffix(), NULL);
+    dumper_program = vstralloc(amlibexecdir, "/", "dumper", versionsuffix(),
                               NULL);
-    chunker_program = vstralloc(libexecdir, "/", "chunker", versionsuffix(),
+    chunker_program = vstralloc(amlibexecdir, "/", "chunker", versionsuffix(),
                               NULL);
 
     conf_taperalgo = getconf_taperalgo(CNF_TAPERALGO);
@@ -285,18 +292,23 @@ main(
     conf_runtapes = getconf_int(CNF_RUNTAPES);
     tape = lookup_tapetype(conf_tapetype);
     tape_length = tapetype_get_length(tape);
-    printf("driver: tape size " OFF_T_FMT "\n", (OFF_T_FMT_TYPE)tape_length);
+    conf_flush_threshold_dumped = getconf_int(CNF_FLUSH_THRESHOLD_DUMPED);
+    conf_flush_threshold_scheduled = getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED);
+    conf_taperflush = getconf_int(CNF_TAPERFLUSH);
+
+    flush_threshold_dumped = (conf_flush_threshold_dumped * tape_length) / 100;
+    flush_threshold_scheduled = (conf_flush_threshold_scheduled * tape_length) / 100;
+    taperflush = (conf_taperflush *tape_length) / 100;
+
+    driver_debug(1, _("flush_threshold_dumped: %lld\n"), (long long)flush_threshold_dumped);
+    driver_debug(1, _("flush_threshold_scheduled: %lld\n"), (long long)flush_threshold_scheduled);
+    driver_debug(1, _("taperflush: %lld\n"), (long long)taperflush);
 
     /* start initializing: read in databases */
 
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &origq) < 0) {
-       error("could not load disklist \"%s\"", conf_diskfile);
+       error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
@@ -308,62 +320,81 @@ main(
     reserve = (unsigned long)getconf_int(CNF_RESERVE);
 
     total_disksize = (off_t)0;
-    for(hdp = getconf_holdingdisks(), dsk = 0; hdp != NULL; hdp = hdp->next, dsk++) {
-       hdp->up = (void *)alloc(SIZEOF(holdalloc_t));
-       holdalloc(hdp)->allocated_dumpers = 0;
-       holdalloc(hdp)->allocated_space = (off_t)0;
+    ha_last = NULL;
+    num_holdalloc = 0;
+    for(hdp = getconf_holdingdisks(), dsk = 0; hdp != NULL; hdp = holdingdisk_next(hdp), dsk++) {
+       ha = alloc(SIZEOF(holdalloc_t));
+       num_holdalloc++;
+
+       /* link the list in the same order as getconf_holdingdisks's results */
+       ha->next = NULL;
+       if (ha_last == NULL)
+           holdalloc = ha;
+       else
+           ha_last->next = ha;
+       ha_last = ha;
+
+       ha->hdisk = hdp;
+       ha->allocated_dumpers = 0;
+       ha->allocated_space = (off_t)0;
+       ha->disksize = holdingdisk_get_disksize(hdp);
 
-       if(get_fs_stats(holdingdisk_get_diskdir(hdp), &fs) == -1
+       /* get disk size */
+       if(get_fs_usage(holdingdisk_get_diskdir(hdp), NULL, &fsusage) == -1
           || access(holdingdisk_get_diskdir(hdp), W_OK) == -1) {
-           log_add(L_WARNING, "WARNING: ignoring holding disk %s: %s\n",
+           log_add(L_WARNING, _("WARNING: ignoring holding disk %s: %s\n"),
                    holdingdisk_get_diskdir(hdp), strerror(errno));
-           hdp->disksize = 0L;
+           ha->disksize = 0L;
            continue;
        }
 
-       if(fs.avail != (off_t)-1) {
-           if(hdp->disksize > (off_t)0) {
-               if(hdp->disksize > fs.avail) {
-                   log_add(L_WARNING,
-                           "WARNING: %s: " OFF_T_FMT " KB requested, "
-                           "but only " OFF_T_FMT " KB available.",
-                           holdingdisk_get_diskdir(hdp),
-                           (OFF_T_FMT_TYPE)hdp->disksize,
-                           (OFF_T_FMT_TYPE)fs.avail);
-                           hdp->disksize = fs.avail;
-               }
-           }
-           else if((fs.avail + hdp->disksize) < (off_t)0) {
+       /* do the division first to avoid potential integer overflow */
+       if (fsusage.fsu_bavail_top_bit_set)
+           kb_avail = 0;
+       else
+           kb_avail = fsusage.fsu_bavail / 1024 * fsusage.fsu_blocksize;
+
+       if(ha->disksize > (off_t)0) {
+           if(ha->disksize > kb_avail) {
                log_add(L_WARNING,
-                       "WARNING: %s: not " OFF_T_FMT " KB free.",
-                       holdingdisk_get_diskdir(hdp), -hdp->disksize);
-               hdp->disksize = (off_t)0;
-               continue;
+                       _("WARNING: %s: %lld KB requested, "
+                       "but only %lld KB available."),
+                       holdingdisk_get_diskdir(hdp),
+                       (long long)ha->disksize,
+                       (long long)kb_avail);
+                       ha->disksize = kb_avail;
            }
-           else
-               hdp->disksize += fs.avail;
        }
+       /* ha->disksize is negative; use all but that amount */
+       else if(kb_avail < -ha->disksize) {
+           log_add(L_WARNING,
+                   _("WARNING: %s: not %lld KB free."),
+                   holdingdisk_get_diskdir(hdp),
+                   (long long)-ha->disksize);
+           ha->disksize = (off_t)0;
+           continue;
+       }
+       else
+           ha->disksize += kb_avail;
 
-       printf("driver: adding holding disk %d dir %s size "
-               OFF_T_FMT " chunksize " OFF_T_FMT "\n",
+       g_printf(_("driver: adding holding disk %d dir %s size %lld chunksize %lld\n"),
               dsk, holdingdisk_get_diskdir(hdp),
-              (OFF_T_FMT_TYPE)hdp->disksize,
-              (OFF_T_FMT_TYPE)(holdingdisk_get_chunksize(hdp)));
+              (long long)ha->disksize,
+              (long long)(holdingdisk_get_chunksize(hdp)));
 
        newdir = newvstralloc(newdir,
                              holdingdisk_get_diskdir(hdp), "/", hd_driver_timestamp,
                              NULL);
        if(!mkholdingdir(newdir)) {
-           hdp->disksize = (off_t)0;
+           ha->disksize = (off_t)0;
        }
-       total_disksize += hdp->disksize;
+       total_disksize += ha->disksize;
     }
 
     reserved_space = total_disksize * (off_t)(reserve / 100);
 
-    printf("reserving " OFF_T_FMT " out of " OFF_T_FMT
-          " for degraded-mode dumps\n",
-          (OFF_T_FMT_TYPE)reserved_space, (OFF_T_FMT_TYPE)free_space());
+    g_printf(_("reserving %lld out of %lld for degraded-mode dumps\n"),
+          (long long)reserved_space, (long long)free_space());
 
     amfree(newdir);
 
@@ -390,39 +421,45 @@ main(
 
     runq.head = NULL;
     runq.tail = NULL;
+    directq.head = NULL;
+    directq.tail = NULL;
     waitq = origq;
+    taper_state = TAPER_STATE_DEFAULT;
     tapeq = read_flush();
 
     roomq.head = roomq.tail = NULL;
 
-    log_add(L_STATS, "startup time %s", walltime_str(curclock()));
+    log_add(L_STATS, _("startup time %s"), walltime_str(curclock()));
 
-    printf("driver: start time %s inparallel %d bandwidth %lu diskspace "
-          OFF_T_FMT " ", walltime_str(curclock()), inparallel,
-          free_kps((interface_t *)0), (OFF_T_FMT_TYPE)free_space());
-    printf(" dir %s datestamp %s driver: drain-ends tapeq %s big-dumpers %s\n",
+    g_printf(_("driver: start time %s inparallel %d bandwidth %lu diskspace %lld "), walltime_str(curclock()), inparallel,
+          free_kps(NULL), (long long)free_space());
+    g_printf(_(" dir %s datestamp %s driver: drain-ends tapeq %s big-dumpers %s\n"),
           "OBSOLETE", driver_timestamp, taperalgo2str(conf_taperalgo),
           getconf_str(CNF_DUMPORDER));
     fflush(stdout);
 
     /* ok, planner is done, now lets see if the tape is ready */
 
-    if(conf_runtapes > 0) {
+    if (conf_runtapes > 0) {
        cmd = getresult(taper, 1, &result_argc, result_argv, MAX_ARGS+1);
-
-       if(cmd != TAPER_OK) {
+       if (cmd != TAPER_OK) {
            /* no tape, go into degraded mode: dump to holding disk */
-           need_degraded=1;
+           need_degraded = 1;
        }
-    }
-    else {
-       need_degraded=1;
+    } else {
+       need_degraded = 1;
     }
 
     tape_left = tape_length;
     taper_busy = 0;
+    taper_input_error = NULL;
+    taper_tape_error = NULL;
     taper_disk = NULL;
     taper_ev_read = NULL;
+
+    schedule_done = nodump;
+    force_flush = 0;
+
     if(!need_degraded) startaflush();
 
     if(!nodump)
@@ -431,43 +468,45 @@ main(
     short_dump_state();
     event_loop(0);
 
-    /* handle any remaining dumps by dumping directly to tape, if possible */
+    force_flush = 1;
 
-    while(!empty(runq) && taper > 0) {
+    /* mv runq to directq */
+    while (!empty(runq)) {
        diskp = dequeue_disk(&runq);
+       headqueue_disk(&directq, diskp);
+    }
+
+    /* handle any remaining dumps by dumping directly to tape, if possible */
+    while(!empty(directq) && taper > 0) {
+       diskp = dequeue_disk(&directq);
        if (diskp->to_holdingdisk == HOLD_REQUIRED) {
-           log_add(L_FAIL, "%s %s %s %d [%s]",
+           log_add(L_FAIL, _("%s %s %s %d [%s]"),
                diskp->host->hostname, diskp->name, sched(diskp)->datestamp,
                sched(diskp)->level,
-               "can't dump required holdingdisk");
+               _("can't dump required holdingdisk"));
        }
        else if (!degraded_mode) {
-           int rc = dump_to_tape(diskp);
-           if(rc == 1)
-               log_add(L_INFO,
-                       "%s %s %d [dump to tape failed, will try again]",
-                       diskp->host->hostname,
-                       diskp->name,
-                       sched(diskp)->level);
-           else if(rc == 2)
-               log_add(L_FAIL, "%s %s %s %d [dump to tape failed]",
-                       diskp->host->hostname,
-                       diskp->name,
-                       sched(diskp)->datestamp,
-                       sched(diskp)->level);
+           taper_state |= TAPER_STATE_DUMP_TO_TAPE;
+           dump_to_tape(diskp);
+           event_loop(0);
+           taper_state &= !TAPER_STATE_DUMP_TO_TAPE;
        }
        else
-           log_add(L_FAIL, "%s %s %s %d [%s]",
+           log_add(L_FAIL, _("%s %s %s %d [%s]"),
                diskp->host->hostname, diskp->name, sched(diskp)->datestamp,
                sched(diskp)->level,
                diskp->to_holdingdisk == HOLD_AUTO ?
-                   "no more holding disk space" :
-                   "can't dump no-hold disk in degraded mode");
+                   _("no more holding disk space") :
+                   _("can't dump no-hold disk in degraded mode"));
     }
 
+    /* fill up the tape or start new one for taperflush */
+    startaflush();
+    event_loop(0);
+
     short_dump_state();                                /* for amstatus */
 
-    printf("driver: QUITTING time %s telling children to quit\n",
+    g_printf(_("driver: QUITTING time %s telling children to quit\n"),
            walltime_str(curclock()));
     fflush(stdout);
 
@@ -485,29 +524,19 @@ main(
     /* wait for all to die */
     wait_children(600);
 
-    for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next) {
-       cleanup_holdingdisk(holdingdisk_get_diskdir(hdp), 0);
-       amfree(hdp->up);
-    }
+    /* cleanup */
+    holding_cleanup(NULL, NULL);
+
     amfree(newdir);
 
     check_unfree_serial();
-    printf("driver: FINISHED time %s\n", walltime_str(curclock()));
+    g_printf(_("driver: FINISHED time %s\n"), walltime_str(curclock()));
     fflush(stdout);
-    log_add(L_FINISH,"date %s time %s", driver_timestamp, walltime_str(curclock()));
+    log_add(L_FINISH,_("date %s time %s"), driver_timestamp, walltime_str(curclock()));
     amfree(driver_timestamp);
 
-    free_new_argv(new_argc, new_argv);
     amfree(dumper_program);
     amfree(taper_program);
-    amfree(config_dir);
-    amfree(config_name);
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
 
     dbclose();
 
@@ -537,10 +566,10 @@ wait_children(int count)
            if (pid > 0) {
                what = NULL;
                if (! WIFEXITED(retstat)) {
-                   what = "signal";
+                   what = _("signal");
                    code = WTERMSIG(retstat);
                } else if (WEXITSTATUS(retstat) != 0) {
-                   what = "code";
+                   what = _("code");
                    code = WEXITSTATUS(retstat);
                }
                who = NULL;
@@ -565,9 +594,9 @@ wait_children(int count)
                    who = stralloc("unknown");
                }
                if(who && what) {
-                   log_add(L_WARNING, "%s pid %u exited with %s %d\n", who, 
+                   log_add(L_WARNING, _("%s pid %u exited with %s %d\n"), who, 
                            (unsigned)pid, what, code);
-                   printf("driver: %s pid %u exited with %s %d\n", who,
+                   g_printf(_("driver: %s pid %u exited with %s %d\n"), who,
                           (unsigned)pid, what, code);
                }
                amfree(who);
@@ -589,14 +618,14 @@ kill_children(int signal)
     if(!nodump) {
         for(dumper = dmptable; dumper < dmptable + inparallel; dumper++) {
            if (!dumper->down && dumper->pid > 1) {
-               printf("driver: sending signal %d to %s pid %u\n", signal,
+               g_printf(_("driver: sending signal %d to %s pid %u\n"), signal,
                       dumper->name, (unsigned)dumper->pid);
                if (kill(dumper->pid, signal) == -1 && errno == ESRCH) {
                    if (dumper->chunker)
                        dumper->chunker->pid = 0;
                }
                if (dumper->chunker && dumper->chunker->pid > 1) {
-                   printf("driver: sending signal %d to %s pid %u\n", signal,
+                   g_printf(_("driver: sending signal %d to %s pid %u\n"), signal,
                           dumper->chunker->name,
                           (unsigned)dumper->chunker->pid);
                    if (kill(dumper->chunker->pid, signal) == -1 &&
@@ -608,7 +637,7 @@ kill_children(int signal)
     }
 
     if(taper_pid > 1)
-       printf("driver: sending signal %d to %s pid %u\n", signal,
+       g_printf(_("driver: sending signal %d to %s pid %u\n"), signal,
               "taper", (unsigned)taper_pid);
        if (kill(taper_pid, signal) == -1 && errno == ESRCH)
            taper_pid = 0;
@@ -655,8 +684,20 @@ startaflush(void)
     char *datestamp;
     int extra_tapes = 0;
     char *qname;
+    TapeAction result_tape_action;
+
+    result_tape_action = tape_action();
 
-    if(!degraded_mode && !taper_busy && !empty(tapeq)) {
+    if (result_tape_action & TAPE_ACTION_NEW_TAPE) {
+       taper_state &= !TAPER_STATE_WAIT_FOR_TAPE;
+       taper_cmd(NEW_TAPE, NULL, NULL, 0, NULL);
+    } else if (result_tape_action & TAPE_ACTION_NO_NEW_TAPE) {
+       taper_state &= !TAPER_STATE_WAIT_FOR_TAPE;
+       taper_cmd(NO_NEW_TAPE, NULL, NULL, 0, NULL);
+    }
+
+    if (!degraded_mode && !taper_busy && !empty(tapeq) &&
+       (result_tape_action & TAPE_ACTION_START_A_FLUSH)) {
        
        datestamp = sched(tapeq.head)->datestamp;
        switch(conf_taperalgo) {
@@ -715,8 +756,8 @@ startaflush(void)
        }
        if(!dp) { /* ALGO_SMALLEST, or default if nothing fit. */
            if(conf_taperalgo != ALGO_SMALLEST)  {
-               fprintf(stderr,
-                  "driver: startaflush: Using SMALLEST because nothing fit\n");
+               g_fprintf(stderr,
+                  _("driver: startaflush: Using SMALLEST because nothing fit\n"));
            }
            fit = dp = tapeq.head;
            while (fit != NULL) {
@@ -735,21 +776,28 @@ startaflush(void)
        if (dp) {
            taper_disk = dp;
            taper_busy = 1;
+           taper_input_error = NULL;
+           taper_tape_error = NULL;
+           taper_result = LAST_TOK;
+           taper_sendresult = 0;
+           taper_first_label = NULL;
+           taper_written = 0;
+           taper_state &= !TAPER_STATE_DUMP_TO_TAPE;
+           taper_dumper = NULL;
            qname = quote_string(dp->name);
            taper_cmd(FILE_WRITE, dp, sched(dp)->destname, sched(dp)->level,
                      sched(dp)->datestamp);
-           fprintf(stderr,"driver: startaflush: %s %s %s "
-                   OFF_T_FMT " " OFF_T_FMT "\n",
+           g_fprintf(stderr,_("driver: startaflush: %s %s %s %lld %lld\n"),
                    taperalgo2str(conf_taperalgo), dp->host->hostname, qname,
-                   (OFF_T_FMT_TYPE)sched(taper_disk)->act_size,
-                   (OFF_T_FMT_TYPE)tape_left);
+                   (long long)sched(taper_disk)->act_size,
+                   (long long)tape_left);
            if(sched(dp)->act_size <= tape_left)
                tape_left -= sched(dp)->act_size;
            else
                tape_left = (off_t)0;
            amfree(qname);
        } else {
-           error("FATAL: Taper marked busy and no work found.");
+           error(_("FATAL: Taper marked busy and no work found."));
            /*NOTREACHED*/
        }
     } else if(!taper_busy && taper_ev_read != NULL) {
@@ -758,7 +806,6 @@ startaflush(void)
     }
 }
 
-
 static int
 client_constrained(
     disk_t *   dp)
@@ -800,6 +847,7 @@ start_some_dumps(
     dumper_t *dumper;
     char dumptype;
     char *dumporder;
+    int  busy_dumpers = 0;
 
     idle_reason = IDLE_NO_DUMPERS;
     sleep_time = 0;
@@ -809,6 +857,12 @@ start_some_dumps(
        dumpers_ev_time = NULL;
     }
 
+    for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
+       if( dumper->busy ) {
+           busy_dumpers++;
+       }
+    }
+
     for (dumper = dmptable; dumper < dmptable+inparallel; dumper++) {
 
        if( dumper->busy || dumper->down) {
@@ -881,6 +935,10 @@ start_some_dumps(
            } else if ((holdp =
                find_diskspace(sched(diskp)->est_size, &cur_idle, NULL)) == NULL) {
                cur_idle = max(cur_idle, IDLE_NO_DISKSPACE);
+               if (empty(tapeq) && busy_dumpers == 0) {
+                   remove_disk(rq, diskp);
+                   enqueue_disk(&directq, diskp);
+               }
            } else if (client_constrained(diskp)) {
                free_assignedhd(holdp);
                cur_idle = max(cur_idle, IDLE_CLIENT_CONSTRAINED);
@@ -902,7 +960,7 @@ start_some_dumps(
                                break;
                      case 'B': accept = (sched(diskp)->est_kps > sched(diskp_accept)->est_kps);
                                break;
-                     default:  log_add(L_WARNING, "Unknown dumporder character \'%c\', using 's'.\n",
+                     default:  log_add(L_WARNING, _("Unknown dumporder character \'%c\', using 's'.\n"),
                                        dumptype);
                                accept = (sched(diskp)->est_size < sched(diskp_accept)->est_size);
                                break;
@@ -972,7 +1030,7 @@ start_some_dumps(
                assignedhd_t **h=NULL;
                int activehd;
 
-               printf("driver: did not get PORT from %s for %s:%s\n",
+               g_printf(_("driver: did not get PORT from %s for %s:%s\n"),
                       chunker->name, diskp->host->hostname, diskp->name);
                fflush(stdout);
 
@@ -980,7 +1038,7 @@ start_some_dumps(
                h = sched(diskp)->holdp;
                activehd = sched(diskp)->activehd;
                h[activehd]->used = 0;
-               holdalloc(h[activehd]->disk)->allocated_dumpers--;
+               h[activehd]->disk->allocated_dumpers--;
                adjust_diskspace(diskp, DONE);
                delete_diskspace(diskp);
                diskp->host->inprogress--;
@@ -988,9 +1046,9 @@ start_some_dumps(
                sched(diskp)->dumper = NULL;
                dumper->busy = 0;
                dumper->dp = NULL;
-               sched(diskp)->attempted++;
+               sched(diskp)->dump_attempted++;
                free_serial_dp(diskp);
-               if(sched(diskp)->attempted < 2)
+               if(sched(diskp)->dump_attempted < 2)
                    enqueue_disk(rq, diskp);
            }
            else {
@@ -1031,17 +1089,17 @@ dump_schedule(
     disk_t *dp;
     char *qname;
 
-    printf("dump of driver schedule %s:\n--------\n", str);
+    g_printf(_("dump of driver schedule %s:\n--------\n"), str);
 
     for(dp = qp->head; dp != NULL; dp = dp->next) {
         qname = quote_string(dp->name);
-       printf("  %-20s %-25s lv %d t %5lu s " OFF_T_FMT " p %d\n",
+       g_printf("  %-20s %-25s lv %d t %5lu s %lld p %d\n",
               dp->host->hostname, qname, sched(dp)->level,
               sched(dp)->est_time,
-              (OFF_T_FMT_TYPE)sched(dp)->est_size, sched(dp)->priority);
+              (long long)sched(dp)->est_size, sched(dp)->priority);
         amfree(qname);
     }
-    printf("--------\n");
+    g_printf("--------\n");
 }
 
 static void
@@ -1053,14 +1111,9 @@ start_degraded_mode(
     off_t est_full_size;
     char *qname;
 
-    if (taper_ev_read != NULL) {
-       event_release(taper_ev_read);
-       taper_ev_read = NULL;
-    }
-
     newq.head = newq.tail = 0;
 
-    dump_schedule(queuep, "before start degraded mode");
+    dump_schedule(queuep, _("before start degraded mode"));
 
     est_full_size = (off_t)0;
     while(!empty(*queuep)) {
@@ -1086,7 +1139,7 @@ start_degraded_mode(
                enqueue_disk(&newq, dp);
            }
            else {
-               log_add(L_FAIL,"%s %s %s %d [can't switch to incremental dump]",
+               log_add(L_FAIL,_("%s %s %s %d [can't switch to incremental dump]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
                        sched(dp)->level);
            }
@@ -1097,7 +1150,7 @@ start_degraded_mode(
     /*@i@*/ *queuep = newq;
     degraded_mode = 1;
 
-    dump_schedule(queuep, "after start degraded mode");
+    dump_schedule(queuep, _("after start degraded mode"));
 }
 
 
@@ -1178,15 +1231,14 @@ continue_port_dumps(void)
 
 static void
 handle_taper_result(
-    void *     cookie)
+    void *cookie)
 {
     disk_t *dp;
-    off_t filenum;
     cmd_t cmd;
     int result_argc;
     char *result_argv[MAX_ARGS+1];
-    int avail_tapes = 0;
-    
+    char *qname;
+
     (void)cookie;      /* Quiet unused parameter warning */
 
     assert(cookie == NULL);
@@ -1199,127 +1251,156 @@ handle_taper_result(
         
        switch(cmd) {
             
-       case PARTIAL:
-       case DONE:      /* DONE <handle> <label> <tape file> <err mess> */
-           if(result_argc != 5) {
-               error("error: [taper DONE result_argc != 5: %d", result_argc);
+       case FAILED:    /* FAILED <handle> INPUT-* TAPE-* <input err mesg> <tape err mesg> */
+           if(result_argc != 6) {
+               error(_("error: [taper FAILED result_argc != 6: %d"), result_argc);
                /*NOTREACHED*/
            }
             
            dp = serial2disk(result_argv[2]);
-           free_serial(result_argv[2]);
-            
-           filenum = OFF_T_ATOI(result_argv[4]);
-           if(cmd == DONE) {
-               update_info_taper(dp, result_argv[3], filenum,
-                                  sched(dp)->level);
-           }
+           assert(dp == taper_disk);
+           if (!taper_dumper)
+               free_serial(result_argv[2]);
             
-           delete_diskspace(dp);
-            
-           printf("driver: finished-cmd time %s taper wrote %s:%s\n",
-                  walltime_str(curclock()), dp->host->hostname, dp->name);
+           qname = quote_string(dp->name);
+           g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
+                  walltime_str(curclock()), dp->host->hostname, qname);
            fflush(stdout);
-            
-           amfree(sched(dp)->destname);
-           amfree(sched(dp)->dumpdate);
-           amfree(sched(dp)->degr_dumpdate);
-           amfree(sched(dp)->datestamp);
-           amfree(dp->up);
-            
-           taper_busy = 0;
-           taper_disk = NULL;
-           startaflush();
-            
-           /* continue with those dumps waiting for diskspace */
-           continue_port_dumps();
+            amfree(qname);
+
+           if (strcmp(result_argv[3], "INPUT-ERROR") == 0) {
+               taper_input_error = stralloc(result_argv[5]);
+           }
+           if (strcmp(result_argv[4], "TAPE-ERROR") == 0) {
+               taper_tape_error = stralloc(result_argv[6]);
+           }
+
+           taper_result = cmd;
+
            break;
             
-       case TRYAGAIN:  /* TRY-AGAIN <handle> <err mess> */
-           if (result_argc < 2) {
-               error("error [taper TRYAGAIN result_argc < 2: %d]",
-                     result_argc);
-               /*NOTREACHED*/
+       case PARTIAL:   /* PARTIAL <handle> INPUT-* TAPE-* <stat mess> <input err mesg> <tape err mesg>*/
+       case DONE:      /* DONE <handle> INPUT-GOOD TAPE-GOOD <stat mess> <input err mesg> <tape err mesg> */
+           if(result_argc != 7) {
+               error(_("error: [taper PARTIAL result_argc != 7: %d"), result_argc);
+               /*NOTREACHED*/
            }
+            
            dp = serial2disk(result_argv[2]);
-           free_serial(result_argv[2]);
-           printf("driver: taper-tryagain time %s disk %s:%s\n",
+           assert(dp == taper_disk);
+            if (!taper_dumper)
+                free_serial(result_argv[2]);
+
+           g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
                   walltime_str(curclock()), dp->host->hostname, dp->name);
            fflush(stdout);
-            
-           /* See how many tapes we have left, but we alwyays
-              retry once (why?) */
-           current_tape++;
-           if(dp->tape_splitsize > (off_t)0)
-               avail_tapes = conf_runtapes - current_tape;
-           else
-               avail_tapes = 0;
-            
-           if(sched(dp)->attempted > avail_tapes) {
-               log_add(L_FAIL, "%s %s %s %d [too many taper retries]",
-                        dp->host->hostname, dp->name, sched(dp)->datestamp,
-                        sched(dp)->level);
-               printf("driver: taper failed %s %s %s, too many taper retry\n",
-                       result_argv[2], dp->host->hostname, dp->name);
+
+           if (strcmp(result_argv[3], "INPUT-ERROR") == 0) {
+               taper_input_error = stralloc(result_argv[5]);
            }
-           else {
-               /* Re-insert into taper queue. */
-               sched(dp)->attempted++;
-               headqueue_disk(&tapeq, dp);
+           if (strcmp(result_argv[4], "TAPE-ERROR") == 0) {
+               taper_tape_error = stralloc(result_argv[6]);
            }
-            
-           tape_left = tape_length;
-            
-           /* run next thing from queue */
-            
-           taper_busy = 0;
-           taper_disk = NULL;
-           startaflush();
-           continue_port_dumps();
+
+           taper_result = cmd;
+
            break;
             
-        case SPLIT_CONTINUE:  /* SPLIT_CONTINUE <handle> <new_label> */
-            if (result_argc != 3) {
-                error("error [taper SPLIT_CONTINUE result_argc != 3: %d]",
+        case PARTDONE:  /* PARTDONE <handle> <label> <fileno> <stat> */
+           dp = serial2disk(result_argv[2]);
+           assert(dp == taper_disk);
+            if (result_argc != 6) {
+                error(_("error [taper PARTDONE result_argc != 5: %d]"),
                       result_argc);
                /*NOTREACHED*/
             }
+           if (!taper_first_label) {
+               taper_first_label = stralloc(result_argv[3]);
+               taper_first_fileno = OFF_T_ATOI(result_argv[4]);
+           }
+           taper_written = OFF_T_ATOI(result_argv[5]);
+           if (taper_written > sched(taper_disk)->act_size)
+               sched(taper_disk)->act_size = taper_written;
             
             break;
-        case SPLIT_NEEDNEXT:  /* SPLIT-NEEDNEXT <handle> <kb written> */
+
+        case REQUEST_NEW_TAPE:  /* REQUEST-NEW-TAPE */
+            if (result_argc != 2) {
+                error(_("error [taper REQUEST_NEW_TAPE result_argc != 2: %d]"),
+                      result_argc);
+               /*NOTREACHED*/
+            }
+           taper_state &= !TAPER_STATE_TAPE_STARTED;
+
+           if (current_tape >= conf_runtapes) {
+               taper_cmd(NO_NEW_TAPE, NULL, NULL, 0, NULL);
+               log_add(L_WARNING,
+                       _("Out of tapes; going into degraded mode."));
+               start_degraded_mode(&runq);
+           } else {
+               TapeAction result_tape_action;
+
+               taper_state |= TAPER_STATE_WAIT_FOR_TAPE;
+               result_tape_action = tape_action();
+               if (result_tape_action & TAPE_ACTION_NEW_TAPE) {
+                   taper_cmd(NEW_TAPE, NULL, NULL, 0, NULL);
+                   taper_state &= !TAPER_STATE_WAIT_FOR_TAPE;
+               } else if (result_tape_action & TAPE_ACTION_NO_NEW_TAPE) {
+                   taper_cmd(NO_NEW_TAPE, NULL, NULL, 0, NULL);
+                   taper_state &= !TAPER_STATE_WAIT_FOR_TAPE;
+               }
+           }
+           break;
+
+       case NEW_TAPE: /* NEW-TAPE <handle> <label> */
             if (result_argc != 3) {
-                error("error [taper SPLIT_NEEDNEXT result_argc != 3: %d]",
+                error(_("error [taper NEW_TAPE result_argc != 3: %d]"),
                       result_argc);
                /*NOTREACHED*/
             }
-            
+
             /* Update our tape counter and reset tape_left */
-            current_tape++;
-            tape_left = tape_length;
-            
-            /* Reduce the size of the dump by amount written and reduce
-               tape_left by the amount left over */
-            dp = serial2disk(result_argv[2]);
-            sched(dp)->act_size -= OFF_T_ATOI(result_argv[3]);
-            if (sched(dp)->act_size < tape_left)
-                tape_left -= sched(dp)->act_size;
-            else
-                tape_length = 0;
-            
-            break;
-            
+           current_tape++;
+           tape_left = tape_length;
+           taper_state |= TAPER_STATE_TAPE_STARTED;
+           break;
+
+       case NO_NEW_TAPE:  /* NO-NEW-TAPE <handle> */
+            if (result_argc != 2) {
+                error(_("error [taper NO_NEW_TAPE result_argc != 2: %d]"),
+                      result_argc);
+               /*NOTREACHED*/
+            }
+           break;
+
+       case DUMPER_STATUS:  /* DUMPER-STATUS <handle> */
+            if (result_argc != 2) {
+                error(_("error [taper NO_NEW_TAPE result_argc != 2: %d]"),
+                      result_argc);
+               /*NOTREACHED*/
+            }
+           if (taper_dumper->result == LAST_TOK) {
+               taper_sendresult = 1;
+           } else {
+               taper_cmd(taper_dumper->result, NULL, NULL, 0, NULL);
+           }
+           break;
+
         case TAPE_ERROR: /* TAPE-ERROR <handle> <err mess> */
             dp = serial2disk(result_argv[2]);
-            free_serial(result_argv[2]);
-            printf("driver: finished-cmd time %s taper wrote %s:%s\n",
+           if (!taper_dumper)
+               free_serial(result_argv[2]);
+            g_printf(_("driver: finished-cmd time %s taper wrote %s:%s\n"),
                    walltime_str(curclock()), dp->host->hostname, dp->name);
             fflush(stdout);
-            log_add(L_WARNING, "Taper  error: %s", result_argv[3]);
+            log_add(L_WARNING, _("Taper  error: %s"), result_argv[3]);
+           taper_tape_error = stralloc(result_argv[3]);
             /*FALLTHROUGH*/
 
         case BOGUS:
             if (cmd == BOGUS) {
-               log_add(L_WARNING, "Taper protocol error");
+               log_add(L_WARNING, _("Taper protocol error"));
+               taper_tape_error = stralloc("BOGUS");
             }
             /*
              * Since we received a taper error, we can't send anything more
@@ -1331,34 +1412,188 @@ handle_taper_result(
              */
             if(!nodump) {
                 log_add(L_WARNING,
-                        "going into degraded mode because of taper component error.");
+                        _("going into degraded mode because of taper component error."));
                 start_degraded_mode(&runq);
             }
             tapeq.head = tapeq.tail = NULL;
             taper_busy = 0;
-            taper_disk = NULL;
             if(taper_ev_read != NULL) {
                 event_release(taper_ev_read);
                 taper_ev_read = NULL;
             }
             if(cmd != TAPE_ERROR) aclose(taper);
-            continue_port_dumps();
+           taper_result = cmd;
+
             break;
 
        default:
-            error("driver received unexpected token (%s) from taper",
+            error(_("driver received unexpected token (%s) from taper"),
                   cmdstr[cmd]);
            /*NOTREACHED*/
        }
-       /*
-        * Wakeup any dumpers that are sleeping because of network
-        * or disk constraints.
-        */
-       start_some_dumps(&runq);
+
+       if (taper_result != LAST_TOK) {
+           if(taper_dumper) {
+               if (taper_dumper->result != LAST_TOK) {
+                   // Dumper already returned it's result
+                   dumper_taper_result(taper_disk);
+               }
+           } else {
+               file_taper_result(taper_disk);
+           }
+       }
         
     } while(areads_dataready(taper));
 }
 
+
+static void
+file_taper_result(
+    disk_t *dp)
+{
+    if (taper_result == DONE) {
+       update_info_taper(dp, taper_first_label, taper_first_fileno,
+                         sched(dp)->level);
+    }
+
+    sched(dp)->taper_attempted += 1;
+
+    if (taper_input_error) {
+       g_printf("driver: taper failed %s %s: %s\n",
+                  dp->host->hostname, dp->name, taper_input_error);
+       if (strcmp(sched(dp)->datestamp, driver_timestamp) == 0) {
+           if(sched(dp)->taper_attempted >= 2) {
+               log_add(L_FAIL, _("%s %s %s %d [too many taper retries after holding disk error: %s]"),
+                   dp->host->hostname, dp->name, sched(dp)->datestamp,
+                   sched(dp)->level, taper_input_error);
+               g_printf("driver: taper failed %s %s, too many taper retry after holding disk error\n",
+                  dp->host->hostname, dp->name);
+               amfree(sched(dp)->destname);
+               amfree(sched(dp)->dumpdate);
+               amfree(sched(dp)->degr_dumpdate);
+               amfree(sched(dp)->datestamp);
+               amfree(dp->up);
+           } else {
+               log_add(L_INFO, _("%s %s %s %d [Will retry dump because of holding disk error: %s]"),
+                       dp->host->hostname, dp->name, sched(dp)->datestamp,
+                       sched(dp)->level, taper_input_error);
+               g_printf("driver: taper will retry %s %s because of holding disk error\n",
+                       dp->host->hostname, dp->name);
+               if (dp->to_holdingdisk != HOLD_REQUIRED) {
+                   dp->to_holdingdisk = HOLD_NEVER;
+                   sched(dp)->dump_attempted -= 1;
+                   headqueue_disk(&directq, dp);
+               } else {
+                   amfree(sched(dp)->destname);
+                   amfree(sched(dp)->dumpdate);
+                   amfree(sched(dp)->degr_dumpdate);
+                   amfree(sched(dp)->datestamp);
+                   amfree(dp->up);
+               }
+           }
+       } else {
+           amfree(sched(dp)->destname);
+           amfree(sched(dp)->dumpdate);
+           amfree(sched(dp)->degr_dumpdate);
+           amfree(sched(dp)->datestamp);
+           amfree(dp->up);
+       }
+    } else if (taper_tape_error) {
+       if(sched(dp)->taper_attempted >= 2) {
+           log_add(L_FAIL, _("%s %s %s %d [too many taper retries]"),
+                   dp->host->hostname, dp->name, sched(dp)->datestamp,
+                   sched(dp)->level);
+           g_printf("driver: taper failed %s %s, too many taper retry\n",
+                  dp->host->hostname, dp->name);
+           amfree(sched(dp)->destname);
+           amfree(sched(dp)->dumpdate);
+           amfree(sched(dp)->degr_dumpdate);
+           amfree(sched(dp)->datestamp);
+           amfree(dp->up);
+       } else {
+           g_printf("driver: taper will retry %s %s\n",
+                  dp->host->hostname, dp->name);
+           /* Re-insert into taper queue. */
+           headqueue_disk(&tapeq, dp);
+       }
+    } else {
+       delete_diskspace(dp);
+       amfree(sched(dp)->destname);
+       amfree(sched(dp)->dumpdate);
+       amfree(sched(dp)->degr_dumpdate);
+       amfree(sched(dp)->datestamp);
+       amfree(dp->up);
+    }
+
+    taper_busy = 0;
+    taper_input_error = NULL;
+    taper_tape_error = NULL;
+    taper_disk = NULL;
+            
+    /* continue with those dumps waiting for diskspace */
+    continue_port_dumps();
+    start_some_dumps(&runq);
+    startaflush();
+}
+
+static void
+dumper_taper_result(
+    disk_t *dp)
+{
+    dumper_t *dumper;
+    int is_partial;
+    char *qname;
+
+    dumper = sched(dp)->dumper;
+
+    free_serial_dp(dp);
+    if(dumper->result == DONE && taper_result == DONE) {
+       update_info_dumper(dp, sched(dp)->origsize,
+                          sched(dp)->dumpsize, sched(dp)->dumptime);
+       update_info_taper(dp, taper_first_label, taper_first_fileno,
+                         sched(dp)->level);
+       qname = quote_string(dp->name); /*quote to take care of spaces*/
+
+       log_add(L_STATS, _("estimate %s %s %s %d [sec %ld nkb %lld ckb %lld kps %lu]"),
+               dp->host->hostname, qname, sched(dp)->datestamp,
+               sched(dp)->level,
+               sched(dp)->est_time, (long long)sched(dp)->est_nsize,
+               (long long)sched(dp)->est_csize,
+               sched(dp)->est_kps);
+       amfree(qname);
+    } else {
+       update_failed_dump_to_tape(dp);
+    }
+
+    is_partial = dumper->result != DONE || taper_result != DONE;
+
+    sched(dp)->dump_attempted += 1;
+    sched(dp)->taper_attempted += 1;
+
+    if((dumper->result != DONE || taper_result != DONE) &&
+       sched(dp)->dump_attempted <= 1 &&
+       sched(dp)->taper_attempted <= 1) {
+       enqueue_disk(&directq, dp);
+    }
+
+    if(dumper->ev_read != NULL) {
+       event_release(dumper->ev_read);
+       dumper->ev_read = NULL;
+    }
+    if(taper_ev_read != NULL) {
+       event_release(taper_ev_read);
+       taper_ev_read = NULL;
+    }
+    taper_busy = 0;
+    taper_input_error = NULL;
+    taper_tape_error = NULL;
+    dumper->busy = 0;
+    dp->host->inprogress -= 1;
+    dp->inprogress = 0;
+    deallocate_bandwidth(dp->host->netif, sched(dp)->est_kps);
+}
+
+
 static dumper_t *
 idle_dumper(void)
 {
@@ -1371,7 +1606,7 @@ idle_dumper(void)
 }
 
 static void
-dumper_result(
+dumper_chunker_result(
     disk_t *   dp)
 {
     dumper_t *dumper;
@@ -1381,6 +1616,7 @@ dumper_result(
     off_t dummy;
     off_t size;
     int is_partial;
+    char *qname;
 
     dumper = sched(dp)->dumper;
     chunker = dumper->chunker;
@@ -1393,13 +1629,15 @@ dumper_result(
     if(dumper->result == DONE && chunker->result == DONE) {
        update_info_dumper(dp, sched(dp)->origsize,
                           sched(dp)->dumpsize, sched(dp)->dumptime);
-       log_add(L_STATS, "estimate %s %s %s %d [sec %ld nkb " OFF_T_FMT
-               " ckb " OFF_T_FMT " kps %lu]",
-               dp->host->hostname, dp->name, sched(dp)->datestamp,
+       qname = quote_string(dp->name);/*quote to take care of spaces*/
+
+       log_add(L_STATS, _("estimate %s %s %s %d [sec %ld nkb %lld ckb %lld kps %lu]"),
+               dp->host->hostname, qname, sched(dp)->datestamp,
                sched(dp)->level,
-               sched(dp)->est_time, (OFF_T_FMT_TYPE)sched(dp)->est_nsize, 
-                (OFF_T_FMT_TYPE)sched(dp)->est_csize,
+               sched(dp)->est_time, (long long)sched(dp)->est_nsize, 
+                (long long)sched(dp)->est_csize,
                sched(dp)->est_kps);
+       amfree(qname);
     }
 
     deallocate_bandwidth(dp->host->netif, sched(dp)->est_kps);
@@ -1414,20 +1652,22 @@ dumper_result(
 
     size = holding_file_size(sched(dp)->destname, 0);
     h[activehd]->used = size - dummy;
-    holdalloc(h[activehd]->disk)->allocated_dumpers--;
+    h[activehd]->disk->allocated_dumpers--;
     adjust_diskspace(dp, DONE);
 
-    sched(dp)->attempted += 1;
+    sched(dp)->dump_attempted += 1;
 
     if((dumper->result != DONE || chunker->result != DONE) &&
-       sched(dp)->attempted <= 1) {
+       sched(dp)->dump_attempted <= 1) {
        delete_diskspace(dp);
-       enqueue_disk(&runq, dp);
+       if (sched(dp)->no_space) {
+           enqueue_disk(&directq, dp);
+       } else {
+           enqueue_disk(&runq, dp);
+       }
     }
     else if(size > (off_t)DISK_BLOCK_KB) {
-       sched(dp)->attempted = 0;
        enqueue_disk(&tapeq, dp);
-       startaflush();
     }
     else {
        delete_diskspace(dp);
@@ -1451,6 +1691,7 @@ dumper_result(
      * or disk constraints.
      */
     start_some_dumps(&runq);
+    startaflush();
 }
 
 
@@ -1468,8 +1709,8 @@ handle_dumper_result(
 
     assert(dumper != NULL);
     dp = dumper->dp;
-    assert(dp != NULL && sched(dp) != NULL);
-
+    assert(dp != NULL);
+    assert(sched(dp) != NULL);
     do {
 
        short_dump_state();
@@ -1480,8 +1721,8 @@ handle_dumper_result(
            /* result_argv[2] always contains the serial number */
            sdp = serial2disk(result_argv[2]);
            if (sdp != dp) {
-               error("%s: Invalid serial number: %s", get_pname(), result_argv[2]);
-               /*NOTREACHED*/
+               error(_("Invalid serial number %s"), result_argv[2]);
+                g_assert_not_reached();
            }
        }
 
@@ -1490,16 +1731,14 @@ handle_dumper_result(
 
        case DONE: /* DONE <handle> <origsize> <dumpsize> <dumptime> <errstr> */
            if(result_argc != 6) {
-               error("error [dumper DONE result_argc != 6: %d]", result_argc);
+               error(_("error [dumper DONE result_argc != 6: %d]"), result_argc);
                /*NOTREACHED*/
            }
 
-           /*free_serial(result_argv[2]);*/
-
            sched(dp)->origsize = OFF_T_ATOI(result_argv[3]);
            sched(dp)->dumptime = TIME_T_ATOI(result_argv[5]);
 
-           printf("driver: finished-cmd time %s %s dumped %s:%s\n",
+           g_printf(_("driver: finished-cmd time %s %s dumped %s:%s\n"),
                   walltime_str(curclock()), dumper->name,
                   dp->host->hostname, qname);
            fflush(stdout);
@@ -1513,11 +1752,11 @@ handle_dumper_result(
             * Requeue this disk, and fall through to the FAILED
             * case for cleanup.
             */
-           if(sched(dp)->attempted) {
-               log_add(L_FAIL, "%s %s %s %d [too many dumper retry: %s]",
+           if(sched(dp)->dump_attempted) {
+               log_add(L_FAIL, _("%s %s %s %d [too many dumper retry: %s]"),
                    dp->host->hostname, dp->name, sched(dp)->datestamp,
                    sched(dp)->level, result_argv[3]);
-               printf("driver: dump failed %s %s %s, too many dumper retry: %s\n",
+               g_printf(_("driver: dump failed %s %s %s, too many dumper retry: %s\n"),
                        result_argv[2], dp->host->hostname, dp->name,
                        result_argv[3]);
            }
@@ -1541,7 +1780,7 @@ handle_dumper_result(
 
        case BOGUS:
            /* either EOF or garbage from dumper.  Turn it off */
-           log_add(L_WARNING, "%s pid %ld is messed up, ignoring it.\n",
+           log_add(L_WARNING, _("%s pid %ld is messed up, ignoring it.\n"),
                    dumper->name, (long)dumper->pid);
            if (dumper->ev_read) {
                event_release(dumper->ev_read);
@@ -1552,13 +1791,13 @@ handle_dumper_result(
            dumper->down = 1;   /* mark it down so it isn't used again */
            if(dp) {
                /* if it was dumping something, zap it and try again */
-               if(sched(dp)->attempted) {
-               log_add(L_FAIL, "%s %s %s %d [%s died]",
+               if(sched(dp)->dump_attempted) {
+               log_add(L_FAIL, _("%s %s %s %d [%s died]"),
                        dp->host->hostname, qname, sched(dp)->datestamp,
                        sched(dp)->level, dumper->name);
                }
                else {
-               log_add(L_WARNING, "%s died while dumping %s:%s lev %d.",
+               log_add(L_WARNING, _("%s died while dumping %s:%s lev %d."),
                        dumper->name, dp->host->hostname, qname,
                        sched(dp)->level);
                }
@@ -1572,19 +1811,32 @@ handle_dumper_result(
         amfree(qname);
 
        /* send the dumper result to the chunker */
-       if(dumper->chunker->down == 0 && dumper->chunker->fd != -1 &&
-          dumper->chunker->result == LAST_TOK) {
-           if(cmd == DONE) {
-               chunker_cmd(dumper->chunker, DONE, dp);
+       if (dumper->chunker) {
+           if (dumper->chunker->down == 0 && dumper->chunker->fd != -1 &&
+               dumper->chunker->result == LAST_TOK) {
+               if (cmd == DONE) {
+                   chunker_cmd(dumper->chunker, DONE, dp);
+               }
+               else {
+                   chunker_cmd(dumper->chunker, FAILED, dp);
+               }
            }
-           else {
-               chunker_cmd(dumper->chunker, FAILED, dp);
+           if( dumper->result != LAST_TOK &&
+               dumper->chunker->result != LAST_TOK)
+               dumper_chunker_result(dp);
+       } else { /* send the dumper result to the taper */
+           if (taper_sendresult) {
+               if (cmd == DONE) {
+                   taper_cmd(DONE, driver_timestamp, NULL, 0, NULL);
+               } else {
+                   taper_cmd(FAILED, driver_timestamp, NULL, 0, NULL);
+               }
+               taper_sendresult = 0;
            }
        }
-
-       if(dumper->result != LAST_TOK && dumper->chunker->result != LAST_TOK)
-           dumper_result(dp);
-
+       if (taper_dumper && taper_result != LAST_TOK) {
+           dumper_taper_result(dp);
+       }
     } while(areads_dataready(dumper->fd));
 }
 
@@ -1629,8 +1881,8 @@ handle_chunker_result(
            /* result_argv[2] always contains the serial number */
            sdp = serial2disk(result_argv[2]);
            if (sdp != dp) {
-               error("%s: Invalid serial number: %s", get_pname(), result_argv[2]);
-               /*NOTREACHED*/
+               error(_("Invalid serial number %s"), result_argv[2]);
+                g_assert_not_reached();
            }
        }
 
@@ -1639,7 +1891,7 @@ handle_chunker_result(
        case PARTIAL: /* PARTIAL <handle> <dumpsize> <errstr> */
        case DONE: /* DONE <handle> <dumpsize> <errstr> */
            if(result_argc != 4) {
-               error("error [chunker %s result_argc != 4: %d]", cmdstr[cmd],
+               error(_("error [chunker %s result_argc != 4: %d]"), cmdstr[cmd],
                      result_argc);
                /*NOTREACHED*/
            }
@@ -1648,7 +1900,7 @@ handle_chunker_result(
            sched(dp)->dumpsize = (off_t)atof(result_argv[3]);
 
            qname = quote_string(dp->name);
-           printf("driver: finished-cmd time %s %s chunked %s:%s\n",
+           g_printf(_("driver: finished-cmd time %s %s chunked %s:%s\n"),
                   walltime_str(curclock()), chunker->name,
                   dp->host->hostname, qname);
            fflush(stdout);
@@ -1677,21 +1929,21 @@ handle_chunker_result(
 
        case NO_ROOM: /* NO-ROOM <handle> <missing_size> */
            if (!h || activehd < 0) { /* should never happen */
-               error("!h || activehd < 0");
+               error(_("!h || activehd < 0"));
                /*NOTREACHED*/
            }
            h[activehd]->used -= OFF_T_ATOI(result_argv[3]);
            h[activehd]->reserved -= OFF_T_ATOI(result_argv[3]);
-           holdalloc(h[activehd]->disk)->allocated_space -= OFF_T_ATOI(result_argv[3]);
+           h[activehd]->disk->allocated_space -= OFF_T_ATOI(result_argv[3]);
            h[activehd]->disk->disksize -= OFF_T_ATOI(result_argv[3]);
            break;
 
        case RQ_MORE_DISK: /* RQ-MORE-DISK <handle> */
            if (!h || activehd < 0) { /* should never happen */
-               error("!h || activehd < 0");
+               error(_("!h || activehd < 0"));
                /*NOTREACHED*/
            }
-           holdalloc(h[activehd]->disk)->allocated_dumpers--;
+           h[activehd]->disk->allocated_dumpers--;
            h[activehd]->used = h[activehd]->reserved;
            if( h[++activehd] ) { /* There's still some allocated space left.
                                   * Tell the dumper about it. */
@@ -1739,23 +1991,23 @@ handle_chunker_result(
 
        case BOGUS:
            /* either EOF or garbage from chunker.  Turn it off */
-           log_add(L_WARNING, "%s pid %ld is messed up, ignoring it.\n",
+           log_add(L_WARNING, _("%s pid %ld is messed up, ignoring it.\n"),
                    chunker->name, (long)chunker->pid);
 
            if(dp) {
                /* if it was dumping something, zap it and try again */
                if (!h || activehd < 0) { /* should never happen */
-                   error("!h || activehd < 0");
+                   error(_("!h || activehd < 0"));
                    /*NOTREACHED*/
                }
                qname = quote_string(dp->name);
-               if(sched(dp)->attempted) {
-                   log_add(L_FAIL, "%s %s %s %d [%s died]",
+               if(sched(dp)->dump_attempted) {
+                   log_add(L_FAIL, _("%s %s %s %d [%s died]"),
                            dp->host->hostname, qname, sched(dp)->datestamp,
                            sched(dp)->level, chunker->name);
                }
                else {
-                   log_add(L_WARNING, "%s died while dumping %s:%s lev %d.",
+                   log_add(L_WARNING, _("%s died while dumping %s:%s lev %d."),
                            chunker->name, dp->host->hostname, qname,
                            sched(dp)->level);
                }
@@ -1774,7 +2026,7 @@ handle_chunker_result(
        }
 
        if(chunker->result != LAST_TOK && chunker->dumper->result != LAST_TOK)
-           dumper_result(dp);
+           dumper_chunker_result(dp);
 
     } while(areads_dataready(chunker->fd));
 }
@@ -1811,7 +2063,7 @@ read_flush(void)
 
        skip_whitespace(s, ch);                 /* find the command */
        if(ch == '\0') {
-           error("flush line %d: syntax error (no command)", line);
+           error(_("flush line %d: syntax error (no command)"), line);
            /*NOTREACHED*/
        }
        command = s - 1;
@@ -1823,13 +2075,13 @@ read_flush(void)
        }
 
        if(strcmp(command,"FLUSH") != 0) {
-           error("flush line %d: syntax error (%s != FLUSH)", line, command);
+           error(_("flush line %d: syntax error (%s != FLUSH)"), line, command);
            /*NOTREACHED*/
        }
 
        skip_whitespace(s, ch);                 /* find the hostname */
        if(ch == '\0') {
-           error("flush line %d: syntax error (no hostname)", line);
+           error(_("flush line %d: syntax error (no hostname)"), line);
            /*NOTREACHED*/
        }
        hostname = s - 1;
@@ -1838,7 +2090,7 @@ read_flush(void)
 
        skip_whitespace(s, ch);                 /* find the diskname */
        if(ch == '\0') {
-           error("flush line %d: syntax error (no diskname)", line);
+           error(_("flush line %d: syntax error (no diskname)"), line);
            /*NOTREACHED*/
        }
        qname = s - 1;
@@ -1848,7 +2100,7 @@ read_flush(void)
 
        skip_whitespace(s, ch);                 /* find the datestamp */
        if(ch == '\0') {
-           error("flush line %d: syntax error (no datestamp)", line);
+           error(_("flush line %d: syntax error (no datestamp)"), line);
            /*NOTREACHED*/
        }
        datestamp = s - 1;
@@ -1857,14 +2109,14 @@ read_flush(void)
 
        skip_whitespace(s, ch);                 /* find the level number */
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           error("flush line %d: syntax error (bad level)", line);
+           error(_("flush line %d: syntax error (bad level)"), line);
            /*NOTREACHED*/
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the filename */
        if(ch == '\0') {
-           error("flush line %d: syntax error (no filename)", line);
+           error(_("flush line %d: syntax error (no filename)"), line);
            /*NOTREACHED*/
        }
        qdestname = s - 1;
@@ -1875,17 +2127,19 @@ read_flush(void)
        holding_file_get_dumpfile(destname, &file);
        if( file.type != F_DUMPFILE) {
            if( file.type != F_CONT_DUMPFILE )
-               log_add(L_INFO, "%s: ignoring cruft file.", destname);
+               log_add(L_INFO, _("%s: ignoring cruft file."), destname);
            amfree(diskname);
+           amfree(destname);
            continue;
        }
 
        if(strcmp(hostname, file.name) != 0 ||
           strcmp(diskname, file.disk) != 0 ||
           strcmp(datestamp, file.datestamp) != 0) {
-           log_add(L_INFO, "disk %s:%s not consistent with file %s",
+           log_add(L_INFO, _("disk %s:%s not consistent with file %s"),
                    hostname, diskname, destname);
            amfree(diskname);
+           amfree(destname);
            continue;
        }
        amfree(diskname);
@@ -1893,20 +2147,23 @@ read_flush(void)
        dp = lookup_disk(file.name, file.disk);
 
        if (dp == NULL) {
-           log_add(L_INFO, "%s: disk %s:%s not in database, skipping it.",
+           log_add(L_INFO, _("%s: disk %s:%s not in database, skipping it."),
                    destname, file.name, file.disk);
+           amfree(destname);
            continue;
        }
 
        if(file.dumplevel < 0 || file.dumplevel > 9) {
-           log_add(L_INFO, "%s: ignoring file with bogus dump level %d.",
+           log_add(L_INFO, _("%s: ignoring file with bogus dump level %d."),
                    destname, file.dumplevel);
+           amfree(destname);
            continue;
        }
 
        if (holding_file_size(destname,1) <= 0) {
            log_add(L_INFO, "%s: removing file with no data.", destname);
            holding_file_unlink(destname);
+           amfree(destname);
            continue;
        }
 
@@ -1926,7 +2183,7 @@ read_flush(void)
        flushhost->disks = dp1;
 
        sp = (sched_t *) alloc(SIZEOF(sched_t));
-       sp->destname = stralloc(destname);
+       sp->destname = destname;
        sp->level = file.dumplevel;
        sp->dumpdate = NULL;
        sp->degr_dumpdate = NULL;
@@ -1937,7 +2194,8 @@ read_flush(void)
        sp->est_kps = 10;
        sp->priority = 0;
        sp->degr_level = -1;
-       sp->attempted = 0;
+       sp->dump_attempted = 0;
+       sp->taper_attempted = 0;
        sp->act_size = holding_file_size(destname, 0);
        sp->holdp = build_diskspace(destname);
        if(sp->holdp == NULL) continue;
@@ -1973,10 +2231,11 @@ read_schedule(
     int ch;
     off_t flush_size = (off_t)0;
     char *qname = NULL;
-    OFF_T_FMT_TYPE nsize_;
-    OFF_T_FMT_TYPE csize_;
-    OFF_T_FMT_TYPE degr_nsize_;
-    OFF_T_FMT_TYPE degr_csize_;
+    long long time_;
+    long long nsize_;
+    long long csize_;
+    long long degr_nsize_;
+    long long degr_csize_;
 
     (void)cookie;      /* Quiet unused parameter warning */
 
@@ -1994,7 +2253,7 @@ read_schedule(
 
        skip_whitespace(s, ch);                 /* find the command */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (no command)", line);
+           error(_("schedule line %d: syntax error (no command)"), line);
            /*NOTREACHED*/
        }
        command = s - 1;
@@ -2002,13 +2261,13 @@ read_schedule(
        s[-1] = '\0';
 
        if(strcmp(command,"DUMP") != 0) {
-           error("schedule line %d: syntax error (%s != DUMP)", line, command);
+           error(_("schedule line %d: syntax error (%s != DUMP)"), line, command);
            /*NOTREACHED*/
        }
 
        skip_whitespace(s, ch);                 /* find the host name */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (no host name)", line);
+           error(_("schedule line %d: syntax error (no host name)"), line);
            /*NOTREACHED*/
        }
        hostname = s - 1;
@@ -2017,7 +2276,7 @@ read_schedule(
 
        skip_whitespace(s, ch);                 /* find the feature list */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (no feature list)", line);
+           error(_("schedule line %d: syntax error (no feature list)"), line);
            /*NOTREACHED*/
        }
        features = s - 1;
@@ -2026,7 +2285,7 @@ read_schedule(
 
        skip_whitespace(s, ch);                 /* find the disk name */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (no disk name)", line);
+           error(_("schedule line %d: syntax error (no disk name)"), line);
            /*NOTREACHED*/
        }
        qname = s - 1;
@@ -2036,7 +2295,7 @@ read_schedule(
 
        skip_whitespace(s, ch);                 /* find the datestamp */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (no datestamp)", line);
+           error(_("schedule line %d: syntax error (no datestamp)"), line);
            /*NOTREACHED*/
        }
        datestamp = s - 1;
@@ -2045,21 +2304,21 @@ read_schedule(
 
        skip_whitespace(s, ch);                 /* find the priority number */
        if(ch == '\0' || sscanf(s - 1, "%d", &priority) != 1) {
-           error("schedule line %d: syntax error (bad priority)", line);
+           error(_("schedule line %d: syntax error (bad priority)"), line);
            /*NOTREACHED*/
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the level number */
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-           error("schedule line %d: syntax error (bad level)", line);
+           error(_("schedule line %d: syntax error (bad level)"), line);
            /*NOTREACHED*/
        }
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the dump date */
        if(ch == '\0') {
-           error("schedule line %d: syntax error (bad dump date)", line);
+           error(_("schedule line %d: syntax error (bad dump date)"), line);
            /*NOTREACHED*/
        }
        dumpdate = s - 1;
@@ -2067,34 +2326,34 @@ read_schedule(
        s[-1] = '\0';
 
        skip_whitespace(s, ch);                 /* find the native size */
-       nsize_ = (OFF_T_FMT_TYPE)0;
-       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &nsize_) != 1) {
-           error("schedule line %d: syntax error (bad nsize)", line);
+       nsize_ = (off_t)0;
+       if(ch == '\0' || sscanf(s - 1, "%lld", &nsize_) != 1) {
+           error(_("schedule line %d: syntax error (bad nsize)"), line);
            /*NOTREACHED*/
        }
        nsize = (off_t)nsize_;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the compressed size */
-       csize_ = (OFF_T_FMT_TYPE)0;
-       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &csize_) != 1) {
-           error("schedule line %d: syntax error (bad csize)", line);
+       csize_ = (off_t)0;
+       if(ch == '\0' || sscanf(s - 1, "%lld", &csize_) != 1) {
+           error(_("schedule line %d: syntax error (bad csize)"), line);
            /*NOTREACHED*/
        }
        csize = (off_t)csize_;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the time number */
-       if(ch == '\0' || sscanf(s - 1, TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)time_p) != 1) {
-           error("schedule line %d: syntax error (bad estimated time)", line);
+       if(ch == '\0' || sscanf(s - 1, "%lld", &time_) != 1) {
+           error(_("schedule line %d: syntax error (bad estimated time)"), line);
            /*NOTREACHED*/
        }
+       *time_p = (time_t)time_;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the kps number */
        if(ch == '\0' || sscanf(s - 1, "%lu", &kps) != 1) {
-           error("schedule line %d: syntax error (bad kps)", line);
+           error(_("schedule line %d: syntax error (bad kps)"), line);
            continue;
        }
        skip_integer(s, ch);
@@ -2103,14 +2362,14 @@ read_schedule(
        skip_whitespace(s, ch);                 /* find the degr level number */
        if(ch != '\0') {
            if(sscanf(s - 1, "%d", &degr_level) != 1) {
-               error("schedule line %d: syntax error (bad degr level)", line);
+               error(_("schedule line %d: syntax error (bad degr level)"), line);
                /*NOTREACHED*/
            }
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr dump date */
            if(ch == '\0') {
-               error("schedule line %d: syntax error (bad degr dump date)", line);
+               error(_("schedule line %d: syntax error (bad degr dump date)"), line);
                /*NOTREACHED*/
            }
            degr_dumpdate = s - 1;
@@ -2118,34 +2377,34 @@ read_schedule(
            s[-1] = '\0';
 
            skip_whitespace(s, ch);             /* find the degr native size */
-           degr_nsize_ = (OFF_T_FMT_TYPE)0;
-           if(ch == '\0'  || sscanf(s - 1, OFF_T_FMT, &degr_nsize_) != 1) {
-               error("schedule line %d: syntax error (bad degr nsize)", line);
+           degr_nsize_ = (off_t)0;
+           if(ch == '\0'  || sscanf(s - 1, "%lld", &degr_nsize_) != 1) {
+               error(_("schedule line %d: syntax error (bad degr nsize)"), line);
                /*NOTREACHED*/
            }
            degr_nsize = (off_t)degr_nsize_;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr compressed size */
-           degr_csize_ = (OFF_T_FMT_TYPE)0;
-           if(ch == '\0'  || sscanf(s - 1, OFF_T_FMT, &degr_csize_) != 1) {
-               error("schedule line %d: syntax error (bad degr csize)", line);
+           degr_csize_ = (off_t)0;
+           if(ch == '\0'  || sscanf(s - 1, "%lld", &degr_csize_) != 1) {
+               error(_("schedule line %d: syntax error (bad degr csize)"), line);
                /*NOTREACHED*/
            }
            degr_csize = (off_t)degr_csize_;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr time number */
-           if(ch == '\0' || sscanf(s - 1, TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)degr_time_p) != 1) {
-               error("schedule line %d: syntax error (bad degr estimated time)", line);
+           if(ch == '\0' || sscanf(s - 1, "%lld", &time_) != 1) {
+               error(_("schedule line %d: syntax error (bad degr estimated time)"), line);
                /*NOTREACHED*/
            }
+           *degr_time_p = (time_t)time_;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr kps number */
            if(ch == '\0' || sscanf(s - 1, "%lu", &degr_kps) != 1) {
-               error("schedule line %d: syntax error (bad degr kps)", line);
+               error(_("schedule line %d: syntax error (bad degr kps)"), line);
                /*NOTREACHED*/
            }
            skip_integer(s, ch);
@@ -2160,7 +2419,7 @@ read_schedule(
        dp = lookup_disk(hostname, diskname);
        if(dp == NULL) {
            log_add(L_WARNING,
-                   "schedule line %d: %s:'%s' not in disklist, ignored",
+                   _("schedule line %d: %s:'%s' not in disklist, ignored"),
                    line, hostname, qname);
            amfree(diskname);
            continue;
@@ -2195,8 +2454,9 @@ read_schedule(
        }
        /*@end@*/
 
-       sp->attempted = 0;
-       sp->act_size = (off_t)0;
+       sp->dump_attempted = 0;
+       sp->taper_attempted = 0;
+       sp->act_size = 0;
        sp->holdp = NULL;
        sp->activehd = -1;
        sp->dumper = NULL;
@@ -2209,30 +2469,35 @@ read_schedule(
            dp->host->features = am_string_to_feature(features);
        }
        remove_disk(&waitq, dp);
-       enqueue_disk(&runq, dp);
+       if (dp->to_holdingdisk == HOLD_NEVER) {
+           enqueue_disk(&directq, dp);
+       } else {
+           enqueue_disk(&runq, dp);
+       }
        flush_size += sp->act_size;
        amfree(diskname);
     }
-    printf("driver: flush size " OFF_T_FMT "\n", (OFF_T_FMT_TYPE)flush_size);
+    g_printf(_("driver: flush size %lld\n"), (long long)flush_size);
     amfree(inpline);
     if(line == 0)
-       log_add(L_WARNING, "WARNING: got empty schedule from planner");
+       log_add(L_WARNING, _("WARNING: got empty schedule from planner"));
     if(need_degraded==1) start_degraded_mode(&runq);
+    schedule_done = 1;
     start_some_dumps(&runq);
 }
 
 static unsigned long
 free_kps(
-    interface_t *ip)
+    netif_t *ip)
 {
     unsigned long res;
 
-    if (ip == (interface_t *)0) {
-       interface_t *p;
+    if (ip == NULL) {
+       netif_t *p;
        unsigned long maxusage=0;
        unsigned long curusage=0;
-       for(p = lookup_interface(NULL); p != NULL; p = p->next) {
-           maxusage += interface_get_maxusage(p);
+       for(p = disklist_netifs(); p != NULL; p = p->next) {
+           maxusage += interface_get_maxusage(p->config);
            curusage += p->curusage;
        }
        if (maxusage >= curusage)
@@ -2241,8 +2506,8 @@ free_kps(
            res = 0;
 #ifndef __lint
     } else {
-       if ((unsigned long)interface_get_maxusage(ip) >= ip->curusage)
-           res = interface_get_maxusage(ip) - ip->curusage;
+       if ((unsigned long)interface_get_maxusage(ip->config) >= ip->curusage)
+           res = interface_get_maxusage(ip->config) - ip->curusage;
        else
            res = 0;
 #endif
@@ -2255,19 +2520,19 @@ static void
 interface_state(
     char *time_str)
 {
-    interface_t *ip;
+    netif_t *ip;
 
-    printf("driver: interface-state time %s", time_str);
+    g_printf(_("driver: interface-state time %s"), time_str);
 
-    for(ip = lookup_interface(NULL); ip != NULL; ip = ip->next) {
-       printf(" if %s: free %lu", ip->name, free_kps(ip));
+    for(ip = disklist_netifs(); ip != NULL; ip = ip->next) {
+       g_printf(_(" if %s: free %lu"), interface_name(ip->config), free_kps(ip));
     }
-    printf("\n");
+    g_printf("\n");
 }
 
 static void
 allocate_bandwidth(
-    interface_t *      ip,
+    netif_t *          ip,
     unsigned long      kps)
 {
     ip->curusage += kps;
@@ -2275,7 +2540,7 @@ allocate_bandwidth(
 
 static void
 deallocate_bandwidth(
-    interface_t *      ip,
+    netif_t *          ip,
     unsigned long      kps)
 {
     assert(kps <= ip->curusage);
@@ -2286,13 +2551,13 @@ deallocate_bandwidth(
 static off_t
 free_space(void)
 {
-    holdingdisk_t *hdp;
+    holdalloc_t *ha;
     off_t total_free;
     off_t diff;
 
     total_free = (off_t)0;
-    for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next) {
-       diff = hdp->disksize - holdalloc(hdp)->allocated_space;
+    for(ha = holdalloc; ha != NULL; ha = ha->next) {
+       diff = ha->disksize - ha->allocated_space;
        if(diff > (off_t)0)
            total_free += diff;
     }
@@ -2315,8 +2580,8 @@ find_diskspace(
     assignedhd_t *     pref)
 {
     assignedhd_t **result = NULL;
-    holdingdisk_t *minp, *hdp;
-    int i=0, num_holdingdisks=0; /* are we allowed to use the global thing? */
+    holdalloc_t *ha, *minp;
+    int i=0;
     int j, minj;
     char *used;
     off_t halloc, dalloc, hfree, dfree;
@@ -2327,38 +2592,33 @@ find_diskspace(
        size = 2*DISK_BLOCK_KB;
     size = am_round(size, (off_t)DISK_BLOCK_KB);
 
-    hold_debug(1, ("%s: want " OFF_T_FMT " K\n",
-                  debug_prefix_time(": find_diskspace"),
-                  (OFF_T_FMT_TYPE)size));
+    hold_debug(1, _("find_diskspace: want %lld K\n"),
+                  (long long)size);
 
-    for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next) {
-       num_holdingdisks++;
-    }
-
-    used = alloc(SIZEOF(*used) * num_holdingdisks);/*disks used during this run*/
-    memset( used, 0, (size_t)num_holdingdisks );
-    result = alloc(SIZEOF(assignedhd_t *) * (num_holdingdisks + 1));
+    used = alloc(SIZEOF(*used) * num_holdalloc);/*disks used during this run*/
+    memset( used, 0, (size_t)num_holdalloc );
+    result = alloc(SIZEOF(assignedhd_t *) * (num_holdalloc + 1));
     result[0] = NULL;
 
-    while( i < num_holdingdisks && size > (off_t)0 ) {
+    while( i < num_holdalloc && size > (off_t)0 ) {
        /* find the holdingdisk with the fewest active dumpers and among
         * those the one with the biggest free space
         */
        minp = NULL; minj = -1;
-       for(j = 0, hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next, j++ ) {
-           if( pref && pref->disk == hdp && !used[j] &&
-               holdalloc(hdp)->allocated_space <= hdp->disksize - (off_t)DISK_BLOCK_KB) {
-               minp = hdp;
+       for(j = 0, ha = holdalloc; ha != NULL; ha = ha->next, j++ ) {
+           if( pref && pref->disk == ha && !used[j] &&
+               ha->allocated_space <= ha->disksize - (off_t)DISK_BLOCK_KB) {
+               minp = ha;
                minj = j;
                break;
            }
-           else if( holdalloc(hdp)->allocated_space <= hdp->disksize - (off_t)(2*DISK_BLOCK_KB) &&
+           else if( ha->allocated_space <= ha->disksize - (off_t)(2*DISK_BLOCK_KB) &&
                !used[j] &&
                (!minp ||
-                holdalloc(hdp)->allocated_dumpers < holdalloc(minp)->allocated_dumpers ||
-                (holdalloc(hdp)->allocated_dumpers == holdalloc(minp)->allocated_dumpers &&
-                 hdp->disksize-holdalloc(hdp)->allocated_space > minp->disksize-holdalloc(minp)->allocated_space)) ) {
-               minp = hdp;
+                ha->allocated_dumpers < minp->allocated_dumpers ||
+                (ha->allocated_dumpers == minp->allocated_dumpers &&
+                 ha->disksize-ha->allocated_space > minp->disksize-minp->allocated_space)) ) {
+               minp = ha;
                minj = j;
            }
        }
@@ -2368,25 +2628,23 @@ find_diskspace(
        used[minj] = 1;
 
        /* hfree = free space on the disk */
-       hfree = minp->disksize - holdalloc(minp)->allocated_space;
+       hfree = minp->disksize - minp->allocated_space;
 
        /* dfree = free space for data, remove 1 header for each chunksize */
-       dfree = hfree - (((hfree-(off_t)1)/holdingdisk_get_chunksize(minp))+(off_t)1) * (off_t)DISK_BLOCK_KB;
+       dfree = hfree - (((hfree-(off_t)1)/holdingdisk_get_chunksize(minp->hdisk))+(off_t)1) * (off_t)DISK_BLOCK_KB;
 
        /* dalloc = space I can allocate for data */
        dalloc = ( dfree < size ) ? dfree : size;
 
        /* halloc = space to allocate, including 1 header for each chunksize */
-       halloc = dalloc + (((dalloc-(off_t)1)/holdingdisk_get_chunksize(minp))+(off_t)1) * (off_t)DISK_BLOCK_KB;
-
-       hold_debug(1, ("%s: find diskspace: size " OFF_T_FMT " hf " OFF_T_FMT
-                      " df " OFF_T_FMT " da " OFF_T_FMT " ha " OFF_T_FMT"\n",
-                      debug_prefix_time(": find_diskspace"),
-                      (OFF_T_FMT_TYPE)size,
-                      (OFF_T_FMT_TYPE)hfree,
-                      (OFF_T_FMT_TYPE)dfree,
-                      (OFF_T_FMT_TYPE)dalloc,
-                      (OFF_T_FMT_TYPE)halloc));
+       halloc = dalloc + (((dalloc-(off_t)1)/holdingdisk_get_chunksize(minp->hdisk))+(off_t)1) * (off_t)DISK_BLOCK_KB;
+
+       hold_debug(1, _("find_diskspace: find diskspace: size %lld hf %lld df %lld da %lld ha %lld\n"),
+                      (long long)size,
+                      (long long)hfree,
+                      (long long)dfree,
+                      (long long)dalloc,
+                      (long long)halloc);
        size -= dalloc;
        result[i] = alloc(SIZEOF(assignedhd_t));
        result[i]->disk = minp;
@@ -2395,12 +2653,11 @@ find_diskspace(
        result[i]->destname = NULL;
        result[i+1] = NULL;
        i++;
-    } /* while i < num_holdingdisks && size > 0 */
+    }
     amfree(used);
 
     if(size != (off_t)0) { /* not enough space available */
-       printf("find diskspace: not enough diskspace. Left with "
-              OFF_T_FMT " K\n", (OFF_T_FMT_TYPE)size);
+       g_printf(_("find diskspace: not enough diskspace. Left with %lld K\n"), (long long)size);
        fflush(stdout);
        free_assignedhd(result);
        result = NULL;
@@ -2408,14 +2665,12 @@ find_diskspace(
 
     if (debug_holding > 1) {
        for( i = 0; result && result[i]; i++ ) {
-           hold_debug(1, ("%s: find diskspace: selected %s free " OFF_T_FMT
-                          " reserved " OFF_T_FMT " dumpers %d\n",
-                          debug_prefix_time(": find_diskspace"),
-                          holdingdisk_get_diskdir(result[i]->disk),
-                          (OFF_T_FMT_TYPE)(result[i]->disk->disksize -
-                            holdalloc(result[i]->disk)->allocated_space),
-                          (OFF_T_FMT_TYPE)result[i]->reserved,
-                          holdalloc(result[i]->disk)->allocated_dumpers));
+           hold_debug(1, _("find_diskspace: find diskspace: selected %s free %lld reserved %lld dumpers %d\n"),
+                          holdingdisk_get_diskdir(result[i]->disk->hdisk),
+                          (long long)(result[i]->disk->disksize -
+                            result[i]->disk->allocated_space),
+                          (long long)result[i]->reserved,
+                          result[i]->disk->allocated_dumpers);
        }
     }
 
@@ -2434,7 +2689,7 @@ assign_holdingdisk(
     assignedhd_t **new_holdp;
     char *qname;
 
-    snprintf( lvl, SIZEOF(lvl), "%d", sched(diskp)->level );
+    g_snprintf( lvl, SIZEOF(lvl), "%d", sched(diskp)->level );
 
     size = am_round(sched(diskp)->est_size - sched(diskp)->act_size,
                    (off_t)DISK_BLOCK_KB);
@@ -2459,19 +2714,16 @@ assign_holdingdisk(
        l=j;
        if( sched(diskp)->holdp[j-1]->disk == holdp[0]->disk ) { /* Yes! */
            sched(diskp)->holdp[j-1]->reserved += holdp[0]->reserved;
-           holdalloc(holdp[0]->disk)->allocated_space += holdp[0]->reserved;
+           holdp[0]->disk->allocated_space += holdp[0]->reserved;
            size = (holdp[0]->reserved>size) ? (off_t)0 : size-holdp[0]->reserved;
            qname = quote_string(diskp->name);
-           hold_debug(1, ("%s: merging holding disk %s to disk %s:%s, add "
-                          OFF_T_FMT " for reserved " OFF_T_FMT ", left "
-                          OFF_T_FMT "\n",
-                          debug_prefix_time(": assign_holdingdisk"),
+           hold_debug(1, _("assign_holdingdisk: merging holding disk %s to disk %s:%s, add %lld for reserved %lld, left %lld\n"),
                           holdingdisk_get_diskdir(
-                                              sched(diskp)->holdp[j-1]->disk),
+                                              sched(diskp)->holdp[j-1]->disk->hdisk),
                           diskp->host->hostname, qname,
-                          (OFF_T_FMT_TYPE)holdp[0]->reserved,
-                          (OFF_T_FMT_TYPE)sched(diskp)->holdp[j-1]->reserved,
-                          (OFF_T_FMT_TYPE)size));
+                          (long long)holdp[0]->reserved,
+                          (long long)sched(diskp)->holdp[j-1]->reserved,
+                          (long long)size);
            i++;
            amfree(qname);
            amfree(holdp[0]);
@@ -2482,24 +2734,22 @@ assign_holdingdisk(
     /* copy assignedhd_s to sched(diskp), adjust allocated_space */
     for( ; holdp[i]; i++ ) {
        holdp[i]->destname = newvstralloc( holdp[i]->destname,
-                                          holdingdisk_get_diskdir(holdp[i]->disk), "/",
+                                          holdingdisk_get_diskdir(holdp[i]->disk->hdisk), "/",
                                           hd_driver_timestamp, "/",
                                           diskp->host->hostname, ".",
                                           sfn, ".",
                                           lvl, NULL );
        sched(diskp)->holdp[j++] = holdp[i];
-       holdalloc(holdp[i]->disk)->allocated_space += holdp[i]->reserved;
+       holdp[i]->disk->allocated_space += holdp[i]->reserved;
        size = (holdp[i]->reserved > size) ? (off_t)0 :
                  (size - holdp[i]->reserved);
        qname = quote_string(diskp->name);
        hold_debug(1,
-                  ("%s: %d assigning holding disk %s to disk %s:%s, reserved "
-                    OFF_T_FMT ", left " OFF_T_FMT "\n",
-                   debug_prefix_time(": assign_holdingdisk"),
-                   i, holdingdisk_get_diskdir(holdp[i]->disk),
+                  _("assign_holdingdisk: %d assigning holding disk %s to disk %s:%s, reserved %lld, left %lld\n"),
+                   i, holdingdisk_get_diskdir(holdp[i]->disk->hdisk),
                    diskp->host->hostname, qname,
-                   (OFF_T_FMT_TYPE)holdp[i]->reserved,
-                   (OFF_T_FMT_TYPE)size));
+                   (long long)holdp[i]->reserved,
+                   (long long)size);
        amfree(qname);
        holdp[i] = NULL; /* so it doesn't get free()d... */
     }
@@ -2524,9 +2774,8 @@ adjust_diskspace(
 
     qname = quote_string(diskp->name);
     qdest = quote_string(sched(diskp)->destname);
-    hold_debug(1, ("%s: %s:%s %s\n",
-                  debug_prefix_time(": adjust_diskspace"),
-                  diskp->host->hostname, qname, qdest));
+    hold_debug(1, _("adjust_diskspace: %s:%s %s\n"),
+                  diskp->host->hostname, qname, qdest);
 
     holdp = sched(diskp)->holdp;
 
@@ -2535,29 +2784,24 @@ adjust_diskspace(
     for( i = 0; holdp[i]; i++ ) { /* for each allocated disk */
        diff = holdp[i]->used - holdp[i]->reserved;
        total += holdp[i]->used;
-       holdalloc(holdp[i]->disk)->allocated_space += diff;
-       hqname = quote_string(holdp[i]->disk->name);
-       hold_debug(1, ("%s: hdisk %s done, reserved " OFF_T_FMT " used "
-                      OFF_T_FMT " diff " OFF_T_FMT " alloc " OFF_T_FMT
-                      " dumpers %d\n",
-                      debug_prefix_time(": adjust_diskspace"),
-                      holdp[i]->disk->name,
-                      (OFF_T_FMT_TYPE)holdp[i]->reserved,
-                      (OFF_T_FMT_TYPE)holdp[i]->used,
-                      (OFF_T_FMT_TYPE)diff,
-                      (OFF_T_FMT_TYPE)holdalloc(holdp[i]->disk)
-                                                            ->allocated_space,
-                      holdalloc(holdp[i]->disk)->allocated_dumpers ));
+       holdp[i]->disk->allocated_space += diff;
+       hqname = quote_string(holdingdisk_name(holdp[i]->disk->hdisk));
+       hold_debug(1, _("adjust_diskspace: hdisk %s done, reserved %lld used %lld diff %lld alloc %lld dumpers %d\n"),
+                      holdingdisk_name(holdp[i]->disk->hdisk),
+                      (long long)holdp[i]->reserved,
+                      (long long)holdp[i]->used,
+                      (long long)diff,
+                      (long long)holdp[i]->disk->allocated_space,
+                      holdp[i]->disk->allocated_dumpers );
        holdp[i]->reserved += diff;
        amfree(hqname);
     }
 
     sched(diskp)->act_size = total;
 
-    hold_debug(1, ("%s: after: disk %s:%s used " OFF_T_FMT "\n",
-                  debug_prefix_time(": adjust_diskspace"),
+    hold_debug(1, _("adjust_diskspace: after: disk %s:%s used %lld\n"),
                   diskp->host->hostname, qname,
-                  (OFF_T_FMT_TYPE)sched(diskp)->act_size));
+                  (long long)sched(diskp)->act_size);
     amfree(qdest);
     amfree(qname);
 }
@@ -2577,7 +2821,7 @@ delete_diskspace(
        /* find all files of this dump on that disk, and subtract their
         * reserved sizes from the disk's allocated space
         */
-       holdalloc(holdp[i]->disk)->allocated_space -= holdp[i]->used;
+       holdp[i]->disk->allocated_space -= holdp[i]->used;
     }
 
     holding_file_unlink(holdp[0]->destname);   /* no need for the entire list,
@@ -2599,21 +2843,17 @@ build_diskspace(
     char buffer[DISK_BLOCK_BYTES];
     dumpfile_t file;
     assignedhd_t **result;
-    holdingdisk_t *hdp;
+    holdalloc_t *ha;
     off_t *used;
-    int num_holdingdisks=0;
     char dirname[1000], *ch;
     struct stat finfo;
     char *filename = destname;
 
     memset(buffer, 0, sizeof(buffer));
-    for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next) {
-        num_holdingdisks++;
-    }
-    used = alloc(SIZEOF(off_t) * num_holdingdisks);
-    for(i=0;i<num_holdingdisks;i++)
+    used = alloc(SIZEOF(off_t) * num_holdalloc);
+    for(i=0;i<num_holdalloc;i++)
        used[i] = (off_t)0;
-    result = alloc(SIZEOF(assignedhd_t *) * (num_holdingdisks + 1));
+    result = alloc(SIZEOF(assignedhd_t *) * (num_holdalloc + 1));
     result[0] = NULL;
     while(filename != NULL && filename[0] != '\0') {
        strncpy(dirname, filename, 999);
@@ -2623,20 +2863,19 @@ build_diskspace(
        ch = strrchr(dirname,'/');
         *ch = '\0';
 
-       for(j = 0, hdp = getconf_holdingdisks(); hdp != NULL;
-                                                hdp = hdp->next, j++ ) {
-           if(strcmp(dirname, holdingdisk_get_diskdir(hdp))==0) {
+       for(j = 0, ha = holdalloc; ha != NULL; ha = ha->next, j++ ) {
+           if(strcmp(dirname, holdingdisk_get_diskdir(ha->hdisk))==0) {
                break;
            }
        }
 
        if(stat(filename, &finfo) == -1) {
-           fprintf(stderr, "stat %s: %s\n", filename, strerror(errno));
+           g_fprintf(stderr, _("stat %s: %s\n"), filename, strerror(errno));
            finfo.st_size = (off_t)0;
        }
        used[j] += ((off_t)finfo.st_size+(off_t)1023)/(off_t)1024;
        if((fd = open(filename,O_RDONLY)) == -1) {
-           fprintf(stderr,"build_diskspace: open of %s failed: %s\n",
+           g_fprintf(stderr,_("build_diskspace: open of %s failed: %s\n"),
                    filename, strerror(errno));
            return NULL;
        }
@@ -2647,11 +2886,10 @@ build_diskspace(
        filename = file.cont_filename;
     }
 
-    for(j = 0, i=0, hdp = getconf_holdingdisks(); hdp != NULL;
-                                                 hdp = hdp->next, j++ ) {
+    for(j = 0, i=0, ha = holdalloc; ha != NULL; ha = ha->next, j++ ) {
        if(used[j] != (off_t)0) {
            result[i] = alloc(SIZEOF(assignedhd_t));
-           result[i]->disk = hdp;
+           result[i]->disk = ha;
            result[i]->reserved = used[j];
            result[i]->used = used[j];
            result[i]->destname = stralloc(destname);
@@ -2668,18 +2906,18 @@ static void
 holdingdisk_state(
     char *     time_str)
 {
-    holdingdisk_t *hdp;
+    holdalloc_t *ha;
     int dsk;
     off_t diff;
 
-    printf("driver: hdisk-state time %s", time_str);
+    g_printf(_("driver: hdisk-state time %s"), time_str);
 
-    for(hdp = getconf_holdingdisks(), dsk = 0; hdp != NULL; hdp = hdp->next, dsk++) {
-       diff = hdp->disksize - holdalloc(hdp)->allocated_space;
-       printf(" hdisk %d: free " OFF_T_FMT " dumpers %d", dsk,
-              (OFF_T_FMT_TYPE)diff, holdalloc(hdp)->allocated_dumpers);
+    for(ha = holdalloc, dsk = 0; ha != NULL; ha = ha->next, dsk++) {
+       diff = ha->disksize - ha->allocated_space;
+       g_printf(_(" hdisk %d: free %lld dumpers %d"), dsk,
+              (long long)diff, ha->allocated_dumpers);
     }
-    printf("\n");
+    g_printf("\n");
 }
 
 static void
@@ -2702,25 +2940,18 @@ update_failed_dump_to_tape(
 }
 
 /* ------------------- */
-static int
+static void
 dump_to_tape(
     disk_t *   dp)
 {
     dumper_t *dumper;
-    int failed = 0;
-    off_t filenum;
-    off_t origsize = (off_t)0;
-    off_t dumpsize = (off_t)0;
-    time_t dumptime = (time_t)0;
-    double tapetime = 0.0;
     cmd_t cmd;
-    int result_argc, rc;
+    int result_argc;
     char *result_argv[MAX_ARGS+1];
-    int dumper_tryagain = 0;
     char *qname;
 
     qname = quote_string(dp->name);
-    printf("driver: dumping %s:%s directly to tape\n",
+    g_printf(_("driver: dumping %s:%s directly to tape\n"),
           dp->host->hostname, qname);
     fflush(stdout);
 
@@ -2728,13 +2959,13 @@ dump_to_tape(
 
     dumper = idle_dumper();
     if (!dumper) {
-       printf("driver: no idle dumpers for %s:%s.\n"
+       g_printf(_("driver: no idle dumpers for %s:%s.\n")
                dp->host->hostname, qname);
        fflush(stdout);
-       log_add(L_WARNING, "no idle dumpers for %s:%s.\n",
+       log_add(L_WARNING, _("no idle dumpers for %s:%s.\n"),
                dp->host->hostname, qname);
         amfree(qname);
-       return 2;       /* fatal problem */
+       return; /* fatal problem */
     }
 
     /* tell the taper to read from a port number of its choice */
@@ -2742,23 +2973,42 @@ dump_to_tape(
     taper_cmd(PORT_WRITE, dp, NULL, sched(dp)->level, sched(dp)->datestamp);
     cmd = getresult(taper, 1, &result_argc, result_argv, MAX_ARGS+1);
     if(cmd != PORT) {
-       printf("driver: did not get PORT from taper for %s:%s\n",
+       g_printf(_("driver: did not get PORT from taper for %s:%s\n"),
                dp->host->hostname, qname);
        fflush(stdout);
+       log_add(L_WARNING, _("driver: did not get PORT from taper for %s:%s.\n"),
+               dp->host->hostname, qname);
         amfree(qname);
-       return 2;       /* fatal problem */
+       return; /* fatal problem */
     }
+    amfree(qname);
+
     /* copy port number */
     dumper->output_port = atoi(result_argv[2]);
 
-    /* tell the dumper to dump to a port */
+    dumper->dp = dp;
+    dumper->chunker = NULL;
+    dumper->result = LAST_TOK;
+    taper_result = LAST_TOK;
+    sched(dp)->dumper = dumper;
 
+    /* tell the dumper to dump to a port */
     dumper_cmd(dumper, PORT_DUMP, dp);
     dp->host->start_t = time(NULL) + 15;
 
     /* update statistics & print state */
 
     taper_busy = dumper->busy = 1;
+    taper_input_error = NULL;
+    taper_tape_error = NULL;
+    taper_dumper = dumper;
+    taper_disk = dp;
+    taper_input_error = NULL;
+    taper_tape_error = NULL;
+    taper_first_label = NULL;
+    taper_written = 0;
+    taper_state |= TAPER_STATE_DUMP_TO_TAPE;
+    sched(dp)->act_size = sched(dp)->est_size;
     dp->host->inprogress += 1;
     dp->inprogress = 1;
     sched(dp)->timestamp = time((time_t *)0);
@@ -2767,152 +3017,10 @@ dump_to_tape(
 
     short_dump_state();
 
-    /* wait for result from dumper */
-
-    cmd = getresult(dumper->fd, 1, &result_argc, result_argv, MAX_ARGS+1);
-
-    switch(cmd) {
-    case BOGUS:
-       /* either eof or garbage from dumper */
-       log_add(L_WARNING, "%s pid %ld is messed up, ignoring it.\n",
-               dumper->name, (long)dumper->pid);
-       dumper->down = 1;       /* mark it down so it isn't used again */
-       failed = 1;     /* dump failed, must still finish up with taper */
-       break;
-
-    case DONE: /* DONE <handle> <origsize> <dumpsize> <dumptime> <errstr> */
-       /* everything went fine */
-       origsize = (off_t)atof(result_argv[3]);
-       /*dumpsize = (off_t)atof(result_argv[4]);*/
-       dumptime = (time_t)atof(result_argv[5]);
-       break;
-
-    case NO_ROOM: /* NO-ROOM <handle> */
-       dumper_cmd(dumper, ABORT, dp);
-       cmd = getresult(dumper->fd, 1, &result_argc, result_argv, MAX_ARGS+1);
-       assert(cmd == ABORT_FINISHED);
-
-    case TRYAGAIN: /* TRY-AGAIN <handle> <errstr> */
-    default:
-       /* dump failed, but we must still finish up with taper */
-       /* problem with dump, possibly nonfatal, retry one time */
-       sched(dp)->attempted++;
-       failed = sched(dp)->attempted;
-       dumper_tryagain = 1;
-       break;
-       
-    case FAILED: /* FAILED <handle> <errstr> */
-       /* dump failed, but we must still finish up with taper */
-       failed = 2;     /* fatal problem with dump */
-       break;
-    }
-
-    /*
-     * Note that at this point, even if the dump above failed, it may
-     * not be a fatal failure if taper below says we can try again.
-     * E.g. a dumper failure above may actually be the result of a
-     * tape overflow, which in turn causes dump to see "broken pipe",
-     * "no space on device", etc., since taper closed the port first.
-     */
-
-    continue_port_dump:
-
-    cmd = getresult(taper, 1, &result_argc, result_argv, MAX_ARGS+1);
-
-    switch(cmd) {
-    case PARTIAL:
-    case DONE: /* DONE <handle> <label> <tape file> <err mess> */
-       if(result_argc != 5) {
-           error("error [dump to tape DONE result_argc != 5: %d]", result_argc);
-           /*NOTREACHED*/
-       }
-
-       if(failed == 1) goto tryagain;  /* dump didn't work */
-       else if(failed == 2) goto failed_dumper;
-
-       free_serial(result_argv[2]);
-
-       dumpsize = (off_t)0;
-       if (*result_argv[5] == '"') {
-           /* String was quoted */
-           OFF_T_FMT_TYPE dumpsize_ = (OFF_T_FMT_TYPE)0;
-           rc = sscanf(result_argv[5],"\"[sec %lf kb " OFF_T_FMT " ",
-                       &tapetime, &dumpsize_);
-           dumpsize = (off_t)dumpsize_;
-       } else {
-           /* String was not quoted */
-           OFF_T_FMT_TYPE dumpsize_ = (OFF_T_FMT_TYPE)0;
-           rc = sscanf(result_argv[5],"[sec %lf kb " OFF_T_FMT " ",
-                       &tapetime, &dumpsize_);
-           dumpsize = (off_t)dumpsize_;
-       }
-       if (rc < 2) {
-           error("error [malformed result: %d items matched in '%s']",
-                 rc, result_argv[5]);
-           /*NOTREACHED*/
-       }
-
-       if(cmd == DONE) {
-           /* every thing went fine */
-           update_info_dumper(dp, origsize, dumpsize, dumptime);
-           filenum = OFF_T_ATOI(result_argv[4]);
-           update_info_taper(dp, result_argv[3], filenum, sched(dp)->level);
-           /* note that update_info_dumper() must be run before
-              update_info_taper(), since update_info_dumper overwrites
-              tape information.  */
-       }
-
-       break;
-
-    case TRYAGAIN: /* TRY-AGAIN <handle> <err mess> */
-       tape_left = tape_length;
-       current_tape++;
-       if(dumper_tryagain == 0) {
-           sched(dp)->attempted++;
-           if(sched(dp)->attempted > failed)
-               failed = sched(dp)->attempted;
-       }
-    tryagain:
-       if(failed <= 1)
-           headqueue_disk(&runq, dp);
-    failed_dumper:
-       update_failed_dump_to_tape(dp);
-       free_serial(result_argv[2]);
-       break;
-
-    case SPLIT_CONTINUE:  /* SPLIT_CONTINUE <handle> <new_label> */
-        if (result_argc != 3) {
-            error("error [taper SPLIT_CONTINUE result_argc != 3: %d]", result_argc);
-           /*NOTREACHED*/
-        }
-        fprintf(stderr, "driver: Got SPLIT_CONTINUE %s %s\n",
-               result_argv[2], result_argv[3]);
-        goto continue_port_dump;
-
-    case SPLIT_NEEDNEXT:
-        fprintf(stderr, "driver: Got SPLIT_NEEDNEXT %s %s\n", result_argv[2], result_argv[3]);
-
-        goto continue_port_dump;
-
-    case TAPE_ERROR: /* TAPE-ERROR <handle> <err mess> */
-    case BOGUS:
-    default:
-       update_failed_dump_to_tape(dp);
-       free_serial(result_argv[2]);
-       failed = 2;     /* fatal problem */
-       start_degraded_mode(&runq);
-       break;
-    }
-
-    /* reset statistics & return */
-
-    taper_busy = dumper->busy = 0;
-    dp->host->inprogress -= 1;
-    dp->inprogress = 0;
-    deallocate_bandwidth(dp->host->netif, sched(dp)->est_kps);
-    amfree(qname);
-
-    return failed;
+    dumper->ev_read = event_register(dumper->fd, EV_READFD,
+                                    handle_dumper_result, dumper);
+    taper_ev_read = event_register(taper, EV_READFD,
+                                  handle_taper_result, NULL);
 }
 
 static int
@@ -2935,26 +3043,118 @@ short_dump_state(void)
 
     wall_time = walltime_str(curclock());
 
-    printf("driver: state time %s ", wall_time);
-    printf("free kps: %lu space: " OFF_T_FMT " taper: ",
-          free_kps((interface_t *)0),
-          (OFF_T_FMT_TYPE)free_space());
-    if(degraded_mode) printf("DOWN");
-    else if(!taper_busy) printf("idle");
-    else printf("writing");
+    g_printf(_("driver: state time %s "), wall_time);
+    g_printf(_("free kps: %lu space: %lld taper: "),
+          free_kps(NULL),
+          (long long)free_space());
+    if(degraded_mode) g_printf(_("DOWN"));
+    else if(!taper_busy) g_printf(_("idle"));
+    else g_printf(_("writing"));
     nidle = 0;
     for(i = 0; i < inparallel; i++) if(!dmptable[i].busy) nidle++;
-    printf(" idle-dumpers: %d", nidle);
-    printf(" qlen tapeq: %d", queue_length(tapeq));
-    printf(" runq: %d", queue_length(runq));
-    printf(" roomq: %d", queue_length(roomq));
-    printf(" wakeup: %d", (int)sleep_time);
-    printf(" driver-idle: %s\n", idle_strings[idle_reason]);
+    g_printf(_(" idle-dumpers: %d"), nidle);
+    g_printf(_(" qlen tapeq: %d"), queue_length(tapeq));
+    g_printf(_(" runq: %d"), queue_length(runq));
+    g_printf(_(" roomq: %d"), queue_length(roomq));
+    g_printf(_(" wakeup: %d"), (int)sleep_time);
+    g_printf(_(" driver-idle: %s\n"), _(idle_strings[idle_reason]));
     interface_state(wall_time);
     holdingdisk_state(wall_time);
     fflush(stdout);
 }
 
+static TapeAction tape_action(void)
+{
+    TapeAction result = TAPE_ACTION_NO_ACTION;
+    dumper_t *dumper;
+    disk_t   *dp;
+    off_t dumpers_size;
+    off_t runq_size;
+    off_t directq_size;
+    off_t tapeq_size;
+    off_t sched_size;
+    off_t dump_to_disk_size;
+    int   dump_to_disk_terminated;
+
+    dumpers_size = 0;
+    for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
+       if (dumper->busy)
+           dumpers_size += sched(dumper->dp)->est_size;
+    }
+    driver_debug(1, _("dumpers_size: %lld\n"), (long long)dumpers_size);
+
+    runq_size = 0;
+    for(dp = runq.head; dp != NULL; dp = dp->next) {
+       runq_size += sched(dp)->est_size;
+    }
+    driver_debug(1, _("runq_size: %lld\n"), (long long)runq_size);
+
+    directq_size = 0;
+    for(dp = directq.head; dp != NULL; dp = dp->next) {
+       directq_size += sched(dp)->est_size;
+    }
+    driver_debug(1, _("directq_size: %lld\n"), (long long)directq_size);
+
+    tapeq_size = 0;
+    for(dp = tapeq.head; dp != NULL; dp = dp->next) {
+       tapeq_size += sched(dp)->act_size;
+    }
+    if (taper_disk) {
+       tapeq_size += sched(taper_disk)->act_size - taper_written;
+    }
+    driver_debug(1, _("tapeq_size: %lld\n"), (long long)tapeq_size);
+
+    sched_size = runq_size + tapeq_size + dumpers_size;
+    driver_debug(1, _("sched_size: %lld\n"), (long long)sched_size);
+
+    dump_to_disk_size = dumpers_size + runq_size;
+    driver_debug(1, _("dump_to_disk_size: %lld\n"), (long long)dump_to_disk_size);
+
+    dump_to_disk_terminated = schedule_done && dump_to_disk_size == 0;
+
+    // Changing conditionals can produce a driver hang, take care.
+    // 
+    // when to start writting to a new tape
+    if ((taper_state & TAPER_STATE_WAIT_FOR_TAPE) &&
+        ((taper_state & TAPER_STATE_DUMP_TO_TAPE) ||   // for dump to tape
+        !empty(directq) ||                             // if a dle is waiting for a dump to tape
+         !empty(roomq) ||                              // holding disk constraint
+         idle_reason == IDLE_NO_DISKSPACE ||           // holding disk constraint
+         (flush_threshold_dumped < tapeq_size &&       // flush-threshold-dumped &&
+         flush_threshold_scheduled < sched_size) ||    //  flush-threshold-scheduled
+        (taperflush < tapeq_size &&                    // taperflush
+         (force_flush == 1 ||                          //  if force_flush
+          dump_to_disk_terminated))                    //  or all dump to disk terminated
+       )) {
+       result |= TAPE_ACTION_NEW_TAPE;
+    // when to stop using new tape
+    } else if ((taper_state & TAPER_STATE_WAIT_FOR_TAPE) &&
+              (taperflush >= tapeq_size &&             // taperflush criteria not meet
+               (force_flush == 1 ||                    //  if force_flush
+                dump_to_disk_terminated))              //  or all dump to disk terminated
+             ) {
+       result |= TAPE_ACTION_NO_NEW_TAPE;
+    }
+
+    // when to start a flush
+    // We don't start a flush if taper_tape_started == 1 && dump_to_disk_terminated && force_flush == 0,
+    // it is a criteria need to exit the first event_loop without flushing everything to tape,
+    // they will be flush in another event_loop.
+    if (!degraded_mode && !taper_busy && !empty(tapeq) &&
+       (!((taper_state & TAPER_STATE_TAPE_STARTED) &&
+           dump_to_disk_terminated && force_flush == 0) ||     // if tape already started and dump to disk not terminated
+         ((taper_state & TAPER_STATE_TAPE_STARTED) &&
+         force_flush == 1) ||                                  // if tape already started and force_flush
+         !empty(roomq) ||                                      // holding disk constraint
+         idle_reason == IDLE_NO_DISKSPACE ||                   // holding disk constraint
+         (flush_threshold_dumped < tapeq_size &&               // flush-threshold-dumped &&
+        flush_threshold_scheduled < sched_size) ||             //  flush-threshold-scheduled
+         (force_flush == 1 && taperflush < tapeq_size))) {     // taperflush if force_flush
+       result |= TAPE_ACTION_START_A_FLUSH;
+    }
+    return result;
+}
+
 #if 0
 static void
 dump_state(
@@ -2964,32 +3164,32 @@ dump_state(
     disk_t *dp;
     char *qname;
 
-    printf("================\n");
-    printf("driver state at time %s: %s\n", walltime_str(curclock()), str);
-    printf("free kps: %lu, space: " OFF_T_FMT "\n",
-          free_kps((interface_t *)0),
-          (OFF_T_FMT_TYPE)free_space());
-    if(degraded_mode) printf("taper: DOWN\n");
-    else if(!taper_busy) printf("taper: idle\n");
-    else printf("taper: writing %s:%s.%d est size " OFF_T_FMT "\n",
+    g_printf("================\n");
+    g_printf(_("driver state at time %s: %s\n"), walltime_str(curclock()), str);
+    g_printf(_("free kps: %lu, space: %lld\n"),
+          free_kps(NULL),
+          (long long)free_space());
+    if(degraded_mode) g_printf(_("taper: DOWN\n"));
+    else if(!taper_busy) g_printf(_("taper: idle\n"));
+    else g_printf(_("taper: writing %s:%s.%d est size %lld\n"),
                taper_disk->host->hostname, taper_disk->name,
                sched(taper_disk)->level,
-               sched(taper_disk)->est_size);
+               (long long)sched(taper_disk)->est_size);
     for(i = 0; i < inparallel; i++) {
        dp = dmptable[i].dp;
        if(!dmptable[i].busy)
-         printf("%s: idle\n", dmptable[i].name);
+         g_printf(_("%s: idle\n"), dmptable[i].name);
        else
          qname = quote_string(dp->name);
-         printf("%s: dumping %s:%s.%d est kps %d size " OFF_T_FMT " time %lu\n",
+         g_printf(_("%s: dumping %s:%s.%d est kps %d size %lld time %lu\n"),
                dmptable[i].name, dp->host->hostname, qname, sched(dp)->level,
-               sched(dp)->est_kps, sched(dp)->est_size, sched(dp)->est_time);
+               sched(dp)->est_kps, (long long)sched(dp)->est_size, sched(dp)->est_time);
           amfree(qname);
     }
     dump_queue("TAPE", tapeq, 5, stdout);
     dump_queue("ROOM", roomq, 5, stdout);
     dump_queue("RUN ", runq, 5, stdout);
-    printf("================\n");
+    g_printf("================\n");
     fflush(stdout);
 }
 #endif
index 8d5e495ff43114cc89da39193131d16e7f12545c..326c1be40845d29908bec2f08554a50a6f0e02dd 100644 (file)
@@ -72,10 +72,10 @@ childstr(
     for (dumper = dmptable; dumper < dmptable + MAX_DUMPERS; dumper++) {
        if (dumper->fd == fd)
            return (dumper->name);
-       if (dumper->chunker->fd == fd)
+       if (dumper->chunker && dumper->chunker->fd == fd)
            return (dumper->chunker->name);
     }
-    snprintf(buf, SIZEOF(buf), "unknown child (fd %d)", fd);
+    g_snprintf(buf, SIZEOF(buf), _("unknown child (fd %d)"), fd);
     return (buf);
 }
 
@@ -88,32 +88,33 @@ startup_tape_process(
     char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
-       error("taper pipe: %s", strerror(errno));
+       error(_("taper pipe: %s"), strerror(errno));
        /*NOTREACHED*/
     }
     if(fd[0] < 0 || fd[0] >= (int)FD_SETSIZE) {
-       error("taper socketpair 0: descriptor %d out of range (0 .. %d)\n",
-             fd[0], FD_SETSIZE-1);
+       error(_("taper socketpair 0: descriptor %d out of range (0 .. %d)\n"),
+             fd[0], (int)FD_SETSIZE-1);
         /*NOTREACHED*/
     }
     if(fd[1] < 0 || fd[1] >= (int)FD_SETSIZE) {
-       error("taper socketpair 1: descriptor %d out of range (0 .. %d)\n",
-             fd[1], FD_SETSIZE-1);
+       error(_("taper socketpair 1: descriptor %d out of range (0 .. %d)\n"),
+             fd[1], (int)FD_SETSIZE-1);
         /*NOTREACHED*/
     }
 
     switch(taper_pid = fork()) {
     case -1:
-       error("fork taper: %s", strerror(errno));
+       error(_("fork taper: %s"), strerror(errno));
        /*NOTREACHED*/
 
     case 0:    /* child process */
        aclose(fd[0]);
        if(dup2(fd[1], 0) == -1 || dup2(fd[1], 1) == -1)
-           error("taper dup2: %s", strerror(errno));
+           error(_("taper dup2: %s"), strerror(errno));
        config_options = get_config_options(2);
        config_options[0] = "taper";
        config_options[1] = config_name;
+       safe_fd(-1, 0);
        execve(taper_program, config_options, safe_env());
        error("exec %s: %s", taper_program, strerror(errno));
        /*NOTREACHED*/
@@ -134,24 +135,25 @@ startup_dump_process(
     char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
-       error("%s pipe: %s", dumper->name, strerror(errno));
+       error(_("%s pipe: %s"), dumper->name, strerror(errno));
        /*NOTREACHED*/
     }
 
     switch(dumper->pid = fork()) {
     case -1:
-       error("fork %s: %s", dumper->name, strerror(errno));
+       error(_("fork %s: %s"), dumper->name, strerror(errno));
        /*NOTREACHED*/
 
     case 0:            /* child process */
        aclose(fd[0]);
        if(dup2(fd[1], 0) == -1 || dup2(fd[1], 1) == -1)
-           error("%s dup2: %s", dumper->name, strerror(errno));
+           error(_("%s dup2: %s"), dumper->name, strerror(errno));
        config_options = get_config_options(2);
        config_options[0] = dumper->name ? dumper->name : "dumper",
        config_options[1] = config_name;
+       safe_fd(-1, 0);
        execve(dumper_program, config_options, safe_env());
-       error("exec %s (%s): %s", dumper_program,
+       error(_("exec %s (%s): %s"), dumper_program,
              dumper->name, strerror(errno));
         /*NOTREACHED*/
 
@@ -161,7 +163,7 @@ startup_dump_process(
        dumper->ev_read = NULL;
        dumper->busy = dumper->down = 0;
        dumper->dp = NULL;
-       fprintf(stderr,"driver: started %s pid %u\n",
+       g_fprintf(stderr,_("driver: started %s pid %u\n"),
                dumper->name, (unsigned)dumper->pid);
        fflush(stderr);
     }
@@ -178,7 +180,7 @@ startup_dump_processes(
     char number[NUM_STR_SIZE];
 
     for(dumper = dmptable, i = 0; i < inparallel; dumper++, i++) {
-       snprintf(number, SIZEOF(number), "%d", i);
+       g_snprintf(number, SIZEOF(number), "%d", i);
        dumper->name = stralloc2("dumper", number);
        dumper->chunker = &chktable[i];
        chktable[i].name = stralloc2("chunker", number);
@@ -199,26 +201,27 @@ startup_chunk_process(
     char **config_options;
 
     if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
-       error("%s pipe: %s", chunker->name, strerror(errno));
+       error(_("%s pipe: %s"), chunker->name, strerror(errno));
        /*NOTREACHED*/
     }
 
     switch(chunker->pid = fork()) {
     case -1:
-       error("fork %s: %s", chunker->name, strerror(errno));
+       error(_("fork %s: %s"), chunker->name, strerror(errno));
        /*NOTREACHED*/
 
     case 0:            /* child process */
        aclose(fd[0]);
        if(dup2(fd[1], 0) == -1 || dup2(fd[1], 1) == -1) {
-           error("%s dup2: %s", chunker->name, strerror(errno));
+           error(_("%s dup2: %s"), chunker->name, strerror(errno));
            /*NOTREACHED*/
        }
        config_options = get_config_options(2);
        config_options[0] = chunker->name ? chunker->name : "chunker",
        config_options[1] = config_name;
+       safe_fd(-1, 0);
        execve(chunker_program, config_options, safe_env());
-       error("exec %s (%s): %s", chunker_program,
+       error(_("exec %s (%s): %s"), chunker_program,
              chunker->name, strerror(errno));
         /*NOTREACHED*/
 
@@ -227,7 +230,7 @@ startup_chunk_process(
        chunker->down = 0;
        chunker->fd = fd[0];
        chunker->ev_read = NULL;
-       fprintf(stderr,"driver: started %s pid %u\n",
+       g_fprintf(stderr,_("driver: started %s pid %u\n"),
                chunker->name, (unsigned)chunker->pid);
        fflush(stderr);
     }
@@ -247,7 +250,7 @@ getresult(
 
     if((line = areads(fd)) == NULL) {
        if(errno) {
-           error("reading result from %s: %s", childstr(fd), strerror(errno));
+           error(_("reading result from %s: %s"), childstr(fd), strerror(errno));
            /*NOTREACHED*/
        }
        *result_argc = 0;                               /* EOF */
@@ -256,25 +259,25 @@ getresult(
     }
 
     if(show) {
-       printf("driver: result time %s from %s:",
+       g_printf(_("driver: result time %s from %s:"),
               walltime_str(curclock()),
               childstr(fd));
        if(line) {
            for(arg = 1; arg <= *result_argc; arg++) {
-               printf(" %s", result_argv[arg]);
+               g_printf(" %s", result_argv[arg]);
            }
            putchar('\n');
        } else {
-           printf(" (eof)\n");
+           g_printf(" (eof)\n");
        }
        fflush(stdout);
     }
     amfree(line);
 
 #ifdef DEBUG
-    printf("argc = %d\n", *result_argc);
+    g_printf("argc = %d\n", *result_argc);
     for(arg = 0; arg < *result_argc; arg++)
-       printf("argv[%d] = \"%s\"\n", arg, result_argv[arg]);
+       g_printf("argv[%d] = \"%s\"\n", arg, result_argv[arg]);
 #endif
 
     if(*result_argc < 1) return BOGUS;
@@ -300,7 +303,6 @@ taper_cmd(
     char fallback_splitsize[NUM_STR_SIZE];
     char *diskbuffer = NULL;
     disk_t *dp;
-    char *features;
     char *qname;
     char *qdest;
 
@@ -312,28 +314,25 @@ taper_cmd(
        dp = (disk_t *) ptr;
         qname = quote_string(dp->name);
        qdest = quote_string(destname);
-       snprintf(number, SIZEOF(number), "%d", level);
-       snprintf(splitsize, SIZEOF(splitsize), OFF_T_FMT,
-                (OFF_T_FMT_TYPE)dp->tape_splitsize);
-       features = am_feature_to_string(dp->host->features);
+       g_snprintf(number, SIZEOF(number), "%d", level);
+       g_snprintf(splitsize, SIZEOF(splitsize), "%lld",
+                (long long)dp->tape_splitsize * 1024);
        cmdline = vstralloc(cmdstr[cmd],
                            " ", disk2serial(dp),
                            " ", qdest,
                            " ", dp->host->hostname,
-                           " ", features,
                            " ", qname,
                            " ", number,
                            " ", datestamp,
                            " ", splitsize,
                            "\n", NULL);
-       amfree(features);
        amfree(qdest);
        amfree(qname);
        break;
     case PORT_WRITE:
        dp = (disk_t *) ptr;
         qname = quote_string(dp->name);
-       snprintf(number, SIZEOF(number), "%d", level);
+       g_snprintf(number, SIZEOF(number), "%d", level);
 
        /*
           If we haven't been given a place to buffer split dumps to disk,
@@ -345,15 +344,13 @@ taper_cmd(
        } else {
            diskbuffer = dp->split_diskbuffer;
        }
-       snprintf(splitsize, SIZEOF(splitsize), OFF_T_FMT,
-                (OFF_T_FMT_TYPE)dp->tape_splitsize);
-       snprintf(fallback_splitsize, SIZEOF(fallback_splitsize), OFF_T_FMT,
-                (OFF_T_FMT_TYPE)dp->fallback_splitsize);
-       features = am_feature_to_string(dp->host->features);
+       g_snprintf(splitsize, SIZEOF(splitsize), "%lld",
+                (long long)dp->tape_splitsize * 1024);
+       g_snprintf(fallback_splitsize, SIZEOF(fallback_splitsize), "%lld",
+                (long long)dp->fallback_splitsize * 1024);
        cmdline = vstralloc(cmdstr[cmd],
                            " ", disk2serial(dp),
                            " ", dp->host->hostname,
-                           " ", features,
                            " ", qname,
                            " ", number,
                            " ", datestamp,
@@ -361,25 +358,33 @@ taper_cmd(
                            " ", diskbuffer,
                            " ", fallback_splitsize,
                            "\n", NULL);
-       amfree(features);
        amfree(qname);
        break;
+    case DONE: /* handle */
+    case FAILED: /* handle */
+       dp = (disk_t *) ptr;
+       cmdline = vstralloc(cmdstr[cmd],
+                           " ", disk2serial(dp),
+                           "\n", NULL);
+       break;
+    case NEW_TAPE:
+    case NO_NEW_TAPE:
     case QUIT:
        cmdline = stralloc2(cmdstr[cmd], "\n");
        break;
     default:
-       error("Don't know how to send %s command to taper", cmdstr[cmd]);
+       error(_("Don't know how to send %s command to taper"), cmdstr[cmd]);
        /*NOTREACHED*/
     }
 
     /*
      * Note: cmdline already has a '\n'.
      */
-    printf("driver: send-cmd time %s to taper: %s",
+    g_printf(_("driver: send-cmd time %s to taper: %s"),
           walltime_str(curclock()), cmdline);
     fflush(stdout);
     if ((fullwrite(taper, cmdline, strlen(cmdline))) < 0) {
-       printf("writing taper command '%s' failed: %s\n",
+       g_printf(_("writing taper command '%s' failed: %s\n"),
                cmdline, strerror(errno));
        fflush(stdout);
        amfree(cmdline);
@@ -420,12 +425,12 @@ dumper_cmd(
        if (dp != NULL) {
            device = quote_string((dp->device) ? dp->device : "NODEVICE");
            qname = quote_string(dp->name);
-           snprintf(number, SIZEOF(number), "%d", sched(dp)->level);
-           snprintf(numberport, SIZEOF(numberport), "%d", dumper->output_port);
+           g_snprintf(number, SIZEOF(number), "%d", sched(dp)->level);
+           g_snprintf(numberport, SIZEOF(numberport), "%d", dumper->output_port);
            features = am_feature_to_string(dp->host->features);
            o = optionstr(dp, dp->host->features, NULL);
            if ( o == NULL ) {
-             error("problem with option string, check the dumptype definition.\n");
+             error(_("problem with option string, check the dumptype definition.\n"));
            }
              
            cmdline = vstralloc(cmdstr[cmd],
@@ -448,7 +453,7 @@ dumper_cmd(
            amfree(qname);
            amfree(device);
        } else {
-               error("PORT-DUMP without disk pointer\n");
+               error(_("PORT-DUMP without disk pointer\n"));
                /*NOTREACHED*/
        }
        break;
@@ -465,7 +470,7 @@ dumper_cmd(
        }
        break;
     default:
-       error("Don't know how to send %s command to dumper", cmdstr[cmd]);
+       error(_("Don't know how to send %s command to dumper"), cmdstr[cmd]);
        /*NOTREACHED*/
     }
 
@@ -473,14 +478,14 @@ dumper_cmd(
      * Note: cmdline already has a '\n'.
      */
     if(dumper->down) {
-       printf("driver: send-cmd time %s ignored to down dumper %s: %s",
+       g_printf(_("driver: send-cmd time %s ignored to down dumper %s: %s"),
               walltime_str(curclock()), dumper->name, cmdline);
     } else {
-       printf("driver: send-cmd time %s to %s: %s",
+       g_printf(_("driver: send-cmd time %s to %s: %s"),
               walltime_str(curclock()), dumper->name, cmdline);
        fflush(stdout);
        if (fullwrite(dumper->fd, cmdline, strlen(cmdline)) < 0) {
-           printf("writing %s command: %s\n", dumper->name, strerror(errno));
+           g_printf(_("writing %s command: %s\n"), dumper->name, strerror(errno));
            fflush(stdout);
            amfree(cmdline);
            return 0;
@@ -521,16 +526,16 @@ chunker_cmd(
        if (dp && h) {
            qname = quote_string(dp->name);
            qdest = quote_string(sched(dp)->destname);
-           holdalloc(h[activehd]->disk)->allocated_dumpers++;
-           snprintf(number, SIZEOF(number), "%d", sched(dp)->level);
-           snprintf(chunksize, SIZEOF(chunksize), OFF_T_FMT,
-                   (OFF_T_FMT_TYPE)holdingdisk_get_chunksize(h[0]->disk));
-           snprintf(use, SIZEOF(use), OFF_T_FMT,
-                   (OFF_T_FMT_TYPE)h[0]->reserved);
+           h[activehd]->disk->allocated_dumpers++;
+           g_snprintf(number, SIZEOF(number), "%d", sched(dp)->level);
+           g_snprintf(chunksize, SIZEOF(chunksize), "%lld",
+                   (long long)holdingdisk_get_chunksize(h[0]->disk->hdisk));
+           g_snprintf(use, SIZEOF(use), "%lld",
+                   (long long)h[0]->reserved);
            features = am_feature_to_string(dp->host->features);
            o = optionstr(dp, dp->host->features, NULL);
            if ( o == NULL ) {
-             error("problem with option string, check the dumptype definition.\n");
+             error(_("problem with option string, check the dumptype definition.\n"));
            }
            cmdline = vstralloc(cmdstr[cmd],
                            " ", disk2serial(dp),
@@ -550,7 +555,7 @@ chunker_cmd(
            amfree(qdest);
            amfree(qname);
        } else {
-               error("%s command without disk and holding disk.\n",
+               error(_("%s command without disk and holding disk.\n"),
                      cmdstr[cmd]);
                /*NOTREACHED*/
        }
@@ -564,11 +569,11 @@ chunker_cmd(
        if(dp && h) {
            qname = quote_string(dp->name);
            qdest = quote_string(h[activehd]->destname);
-           holdalloc(h[activehd]->disk)->allocated_dumpers++;
-           snprintf(chunksize, SIZEOF(chunksize), OFF_T_FMT
-                    (OFF_T_FMT_TYPE)holdingdisk_get_chunksize(h[activehd]->disk));
-           snprintf(use, SIZEOF(use), OFF_T_FMT
-                    (OFF_T_FMT_TYPE)(h[activehd]->reserved - h[activehd]->used));
+           h[activehd]->disk->allocated_dumpers++;
+           g_snprintf(chunksize, SIZEOF(chunksize), "%lld"
+                    (long long)holdingdisk_get_chunksize(h[activehd]->disk->hdisk));
+           g_snprintf(use, SIZEOF(use), "%lld"
+                    (long long)(h[activehd]->reserved - h[activehd]->used));
            cmdline = vstralloc(cmdstr[cmd],
                                " ", disk2serial(dp),
                                " ", qdest,
@@ -596,18 +601,18 @@ chunker_cmd(
        }
        break;
     default:
-       error("Don't know how to send %s command to chunker", cmdstr[cmd]);
+       error(_("Don't know how to send %s command to chunker"), cmdstr[cmd]);
        /*NOTREACHED*/
     }
 
     /*
      * Note: cmdline already has a '\n'.
      */
-    printf("driver: send-cmd time %s to %s: %s",
+    g_printf(_("driver: send-cmd time %s to %s: %s"),
           walltime_str(curclock()), chunker->name, cmdline);
     fflush(stdout);
     if (fullwrite(chunker->fd, cmdline, strlen(cmdline)) < 0) {
-       printf("writing %s command: %s\n", chunker->name, strerror(errno));
+       g_printf(_("writing %s command: %s\n"), chunker->name, strerror(errno));
        fflush(stdout);
        amfree(cmdline);
        return 0;
@@ -635,14 +640,14 @@ serial2disk(
 
     rc = sscanf(str, "%d-%ld", &s, &gen);
     if(rc != 2) {
-       error("error [serial2disk \"%s\" parse error]", str);
+       error(_("error [serial2disk \"%s\" parse error]"), str);
        /*NOTREACHED*/
     } else if (s < 0 || s >= MAX_SERIAL) {
-       error("error [serial out of range 0..%d: %d]", MAX_SERIAL, s);
+       error(_("error [serial out of range 0..%d: %d]"), MAX_SERIAL, s);
        /*NOTREACHED*/
     }
     if(gen != stable[s].gen)
-       printf("driver: serial2disk error time %s serial gen mismatch %s\n",
+       g_printf(_("driver: serial2disk error time %s serial gen mismatch %s\n"),
               walltime_str(curclock()), str);
     return stable[s].dp;
 }
@@ -654,17 +659,17 @@ free_serial(
     int rc, s;
     long gen;
 
-    rc = sscanf(str, "%d-%ld", &s, &gen);
+    rc = sscanf(str, _("%d-%ld"), &s, &gen);
     if(!(rc == 2 && s >= 0 && s < MAX_SERIAL)) {
        /* nuke self to get core dump for Brett */
-       fprintf(stderr, "driver: free_serial: str \"%s\" rc %d s %d\n",
+       g_fprintf(stderr, _("driver: free_serial: str \"%s\" rc %d s %d\n"),
                str, rc, s);
        fflush(stderr);
        abort();
     }
 
     if(gen != stable[s].gen)
-       printf("driver: free_serial error time %s serial gen mismatch %s\n",
+       g_printf(_("driver: free_serial error time %s serial gen mismatch %s\n"),
               walltime_str(curclock()),str);
     stable[s].gen = 0;
     stable[s].dp = NULL;
@@ -685,7 +690,7 @@ free_serial_dp(
        }
     }
 
-    printf("driver: error time %s serial not found\n",
+    g_printf(_("driver: error time %s serial not found\n"),
           walltime_str(curclock()));
 }
 
@@ -698,7 +703,7 @@ check_unfree_serial(void)
     /* find used serial number */
     for(s = 0; s < MAX_SERIAL; s++) {
        if(stable[s].gen != 0 || stable[s].dp != NULL) {
-           printf("driver: error time %s bug: serial in use: %02d-%05ld\n",
+           g_printf(_("driver: error time %s bug: serial in use: %02d-%05ld\n"),
                   walltime_str(curclock()), s, stable[s].gen);
        }
     }
@@ -712,7 +717,7 @@ char *disk2serial(
 
     for(s = 0; s < MAX_SERIAL; s++) {
        if(stable[s].dp == dp) {
-           snprintf(str, SIZEOF(str), "%02d-%05ld", s, stable[s].gen);
+           g_snprintf(str, SIZEOF(str), "%02d-%05ld", s, stable[s].gen);
            return str;
        }
     }
@@ -722,7 +727,7 @@ char *disk2serial(
        if(stable[s].gen == 0 && stable[s].dp == NULL)
            break;
     if(s >= MAX_SERIAL) {
-       printf("driver: error time %s bug: out of serial numbers\n",
+       g_printf(_("driver: error time %s bug: out of serial numbers\n"),
               walltime_str(curclock()));
        s = 0;
     }
@@ -730,7 +735,7 @@ char *disk2serial(
     stable[s].gen = generation++;
     stable[s].dp = dp;
 
-    snprintf(str, SIZEOF(str), "%02d-%05ld", s, stable[s].gen);
+    g_snprintf(str, SIZEOF(str), "%02d-%05ld", s, stable[s].gen);
     return str;
 }
 
@@ -749,14 +754,9 @@ update_info_dumper(
 
     level = sched(dp)->level;
 
-    conf_infofile = getconf_str(CNF_INFOFILE);
-    if (*conf_infofile == '/') {
-       conf_infofile = stralloc(conf_infofile);
-    } else {
-       conf_infofile = stralloc2(config_dir, conf_infofile);
-    }
+    conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if (open_infofile(conf_infofile)) {
-       error("could not open info db \"%s\"", conf_infofile);
+       error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
     amfree(conf_infofile);
@@ -821,7 +821,7 @@ update_info_dumper(
     }
 
     if(put_info(dp->host->hostname, dp->name, &info)) {
-       error("infofile update failed (%s,'%s')\n", dp->host->hostname, dp->name);
+       error(_("infofile update failed (%s,'%s')\n"), dp->host->hostname, dp->name);
        /*NOTREACHED*/
     }
 
@@ -841,7 +841,7 @@ update_info_taper(
 
     rc = open_infofile(getconf_str(CNF_INFOFILE));
     if(rc) {
-       error("could not open infofile %s: %s (%d)", getconf_str(CNF_INFOFILE),
+       error(_("could not open infofile %s: %s (%d)"), getconf_str(CNF_INFOFILE),
              strerror(errno), rc);
        /*NOTREACHED*/
     }
@@ -857,7 +857,7 @@ update_info_taper(
     info.command = NO_COMMAND;
 
     if(put_info(dp->host->hostname, dp->name, &info)) {
-       error("infofile update failed (%s,'%s')\n", dp->host->hostname, dp->name);
+       error(_("infofile update failed (%s,'%s')\n"), dp->host->hostname, dp->name);
        /*NOTREACHED*/
     }
     close_infofile();
index e1725c7cc48b55a4e134d0b79ff5e43df868620d..b965550df474d75a134eb649e6a888bc352678e8 100644 (file)
@@ -68,8 +68,20 @@ typedef struct dumper_s {
     chunker_t *chunker;
 } dumper_t;
 
+/* holding disk reservation structure; this is built as a list parallel
+ * to the configuration's linked list of holding disks. */
+
+typedef struct holdalloc_s {
+    struct holdalloc_s *next;
+    holdingdisk_t *hdisk;
+
+    off_t disksize;
+    int allocated_dumpers;
+    off_t allocated_space;
+} holdalloc_t;
+
 typedef struct assignedhd_s {
-    holdingdisk_t      *disk;
+    holdalloc_t                *disk;
     off_t              used;
     off_t              reserved;
     char               *destname;
@@ -78,7 +90,9 @@ typedef struct assignedhd_s {
 /* schedule structure */
 
 typedef struct sched_s {
-    int attempted, priority;
+    int dump_attempted;
+    int taper_attempted;
+    int  priority;
     int level, degr_level;
     unsigned long est_time, degr_time;
     off_t est_nsize, est_csize, est_size;
@@ -99,23 +113,33 @@ typedef struct sched_s {
 #define sched(dp)      ((sched_t *) (dp)->up)
 
 
-/* holding disk reservation structure */
-
-typedef struct holdalloc_s {
-    int allocated_dumpers;
-    off_t allocated_space;
-} holdalloc_t;
-
-#define holdalloc(hp)  ((holdalloc_t *) (hp)->up)
-
 GLOBAL dumper_t dmptable[MAX_DUMPERS];
 GLOBAL chunker_t chktable[MAX_DUMPERS];
 
 /* command/result tokens */
 
+typedef enum {
+   TAPER_STATE_DEFAULT       = 0,
+   TAPER_STATE_DUMP_TO_TAPE  = (1 << 0), // if taper is doing a dump to tape
+   TAPER_STATE_WAIT_FOR_TAPE = (1 << 1), // if taper wait for a tape, after a
+                                        //   REQUEST-NEW-TAPE
+   TAPER_STATE_TAPE_STARTED  = (1 << 2)         // taper already started to write to
+                                        //   a tape.
+} TaperState;
+
 GLOBAL int taper, taper_busy;
+GLOBAL int taper_sendresult;
+GLOBAL char *taper_input_error;
+GLOBAL char *taper_tape_error;
 GLOBAL pid_t taper_pid;
+GLOBAL int taper_result;
+GLOBAL dumper_t *taper_dumper;
 GLOBAL event_handle_t *taper_ev_read;
+GLOBAL char *taper_first_label;
+GLOBAL off_t taper_first_fileno;
+GLOBAL TaperState taper_state;
+GLOBAL off_t taper_written;            // Number of kb already written to tape
+                                       //   for the DLE.
 
 void init_driverio(void);
 void startup_tape_process(char *taper_program);
index 49982b2ffcb9755570d7ce5af24421143efe29b4..6d20b8a4adbe5b43fcd5df6d9eb1c7a4c108a2b6 100644 (file)
@@ -44,6 +44,7 @@
 #include "amfeatures.h"
 #include "server_util.h"
 #include "util.h"
+#include "timestamp.h"
 
 #define dumper_debug(i,x) do {         \
        if ((i) <= debug_dumper) {      \
@@ -88,6 +89,7 @@ char *srv_encrypt = NULL;
 char *clnt_encrypt = NULL;
 char *srv_decrypt_opt = NULL;
 char *clnt_decrypt_opt = NULL;
+static kencrypt_type dumper_kencrypt;
 
 static FILE *errf = NULL;
 static char *hostname = NULL;
@@ -230,13 +232,19 @@ check_options(
        *decryptend = ';';
       }
     }
+
+    if (strstr(options, "kencrypt;") != NULL) {
+       dumper_kencrypt = KENCRYPT_WILL_DO;
+    } else {
+       dumper_kencrypt = KENCRYPT_NONE;
+    }
 }
 
 
 int
 main(
-    int                main_argc,
-    char **    main_argv)
+    int                argc,
+    char **    argv)
 {
     static struct databuf db;
     struct cmdargs cmdargs;
@@ -244,17 +252,25 @@ main(
     int outfd = -1;
     int rc;
     in_port_t taper_port;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-    char *conffile;
     char *q = NULL;
     int a;
-    uid_t ruid;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
-    struct addrinfo hints;
     int res;
-    struct addrinfo *gaires = NULL;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
+    /* drop root privileges */
+    if (!set_root_privs(0)) {
+       error(_("dumper must be run setuid root"));
+    }
 
     safe_fd(-1, 0);
 
@@ -265,75 +281,33 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
-    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
+    if (argc > 1)
+       cfg_opt = argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-    if (my_argc > 1) {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    } else {
-       char my_cwd[STR_SIZE];
+    safe_cd(); /* do this *after* config_init() */
 
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    }
+    check_running_as(RUNNING_AS_DUMPUSER);
 
-    safe_cd();
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
 
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
-    report_bad_conf_arg();
-    /*
-     * Make our effective uid nonprivlidged, keeping save uid as root
-     * in case we need to get back (to bind privlidged ports, etc).
-     */
-    ruid = getuid();
-    if(geteuid() == 0) {
-       seteuid(ruid);
-       setgid(getgid());
-    }
-#if defined BSD_SECURITY && !defined SSH_SECURITY
-    else {
-       error("must be run setuid root to communicate correctly");
-       /*NOTREACHED*/
-    }
-#endif
-
-    fprintf(stderr,
-           "%s: pid %ld executable %s version %s\n",
+    g_fprintf(stderr,
+           _("%s: pid %ld executable %s version %s\n"),
            get_pname(), (long) getpid(),
-           my_argv[0], version());
+           argv[0], version());
     fflush(stderr);
 
     /* now, make sure we are a valid user */
 
-    if (getpwuid(getuid()) == NULL) {
-       error("can't get login name for my uid %ld", (long)getuid());
-       /*NOTREACHED*/
-    }
-
     signal(SIGPIPE, SIG_IGN);
 
     conf_dtimeout = (time_t)getconf_int(CNF_DTIMEOUT);
@@ -346,7 +320,7 @@ main(
        switch(cmd) {
        case START:
            if(cmdargs.argc <  2)
-               error("error [dumper START: not enough args: timestamp]");
+               error(_("error [dumper START: not enough args: timestamp]"));
            dumper_timestamp = newstralloc(dumper_timestamp, cmdargs.argv[2]);
            break;
 
@@ -377,32 +351,32 @@ main(
            a = 2;
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: handle]");
+               error(_("error [dumper PORT-DUMP: not enough args: handle]"));
                /*NOTREACHED*/
            }
            handle = newstralloc(handle, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: port]");
+               error(_("error [dumper PORT-DUMP: not enough args: port]"));
                /*NOTREACHED*/
            }
            taper_port = (in_port_t)atoi(cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: hostname]");
+               error(_("error [dumper PORT-DUMP: not enough args: hostname]"));
                /*NOTREACHED*/
            }
            hostname = newstralloc(hostname, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: features]");
+               error(_("error [dumper PORT-DUMP: not enough args: features]"));
                /*NOTREACHED*/
            }
            am_release_feature_set(their_features);
            their_features = am_string_to_feature(cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: diskname]");
+               error(_("error [dumper PORT-DUMP: not enough args: diskname]"));
                /*NOTREACHED*/
            }
            qdiskname = newstralloc(qdiskname, cmdargs.argv[a++]);
@@ -411,7 +385,7 @@ main(
            diskname = unquote_string(qdiskname);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: device]");
+               error(_("error [dumper PORT-DUMP: not enough args: device]"));
                /*NOTREACHED*/
            }
            device = newstralloc(device, cmdargs.argv[a++]);
@@ -419,76 +393,55 @@ main(
                amfree(device);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: level]");
+               error(_("error [dumper PORT-DUMP: not enough args: level]"));
                /*NOTREACHED*/
            }
            level = atoi(cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: dumpdate]");
+               error(_("error [dumper PORT-DUMP: not enough args: dumpdate]"));
                /*NOTREACHED*/
            }
            dumpdate = newstralloc(dumpdate, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: program]");
+               error(_("error [dumper PORT-DUMP: not enough args: program]"));
                /*NOTREACHED*/
            }
            progname = newstralloc(progname, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: amandad_path]");
+               error(_("error [dumper PORT-DUMP: not enough args: amandad_path]"));
                /*NOTREACHED*/
            }
            amandad_path = newstralloc(amandad_path, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: client_username]");
+               error(_("error [dumper PORT-DUMP: not enough args: client_username]"));
            }
            client_username = newstralloc(client_username, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: ssh_keys]");
+               error(_("error [dumper PORT-DUMP: not enough args: ssh_keys]"));
            }
            ssh_keys = newstralloc(ssh_keys, cmdargs.argv[a++]);
 
            if(a >= cmdargs.argc) {
-               error("error [dumper PORT-DUMP: not enough args: options]");
+               error(_("error [dumper PORT-DUMP: not enough args: options]"));
            }
            options = newstralloc(options, cmdargs.argv[a++]);
 
            if(a != cmdargs.argc) {
-               error("error [dumper PORT-DUMP: too many args: %d != %d]",
+               error(_("error [dumper PORT-DUMP: too many args: %d != %d]"),
                      cmdargs.argc, a);
                /*NOTREACHED*/
            }
 
            /* Double-check that 'localhost' resolves properly */
-#ifdef WORKING_IPV6
-           hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
-           hints.ai_family = AF_UNSPEC;
-#else
-           hints.ai_flags = AI_CANONNAME;
-           hints.ai_family = AF_INET;
-#endif
-           hints.ai_socktype = 0;
-           hints.ai_protocol = 0;
-           hints.ai_addrlen = 0;
-           hints.ai_addr = NULL;
-           hints.ai_canonname = NULL;
-           hints.ai_next = NULL;
-           res = getaddrinfo("localhost", NULL, &hints, &gaires);
-#ifdef WORKING_IPV6
-           if (res != 0) {
-               hints.ai_flags = AI_CANONNAME;
-               hints.ai_family = AF_UNSPEC;
-               res = getaddrinfo("localhost", NULL, &hints, &gaires);
-           }
-#endif
-           if (res != 0) {
-               errstr = newvstralloc(errstr,
-                                    _("could not resolve localhost: "),
-                                    gai_strerror(res), NULL);
+           if ((res = resolve_hostname("localhost", 0, NULL, NULL) != 0)) {
+               errstr = newvstrallocf(errstr,
+                                    _("could not resolve localhost: %s"),
+                                    gai_strerror(res));
                q = squotef(errstr);
                putresult(FAILED, "%s %s\n", handle, q);
                log_add(L_FAIL, "%s %s %s %d [%s]", hostname, qdiskname,
@@ -496,7 +449,6 @@ main(
                amfree(q);
                break;
            }
-           if (gaires) freeaddrinfo(gaires);
 
            /* connect outf to chunker/taper port */
 
@@ -504,8 +456,8 @@ main(
                                  STREAM_BUFSIZE, 0, NULL, 0);
            if (outfd == -1) {
                
-               errstr = newvstralloc(errstr, "port open: ",
-                                     strerror(errno), NULL);
+               errstr = newvstrallocf(errstr, _("port open: %s"),
+                                     strerror(errno));
                q = squotef(errstr);
                putresult(FAILED, "%s %s\n", handle, q);
                log_add(L_FAIL, "%s %s %s %d [%s]", hostname, qdiskname,
@@ -537,6 +489,9 @@ main(
                amfree(q);
            } else {
                do_dump(&db);
+               /* try to clean up any defunct processes, since Amanda doesn't
+                  wait() for them explicitly */
+               while(waitpid(-1, NULL, WNOHANG)> 0);
            }
 
            amfree(amandad_path);
@@ -550,7 +505,7 @@ main(
            } else if(cmdargs.argc >= 0) {
                q = squote(cmdargs.argv[0]);
            } else {
-               q = stralloc("(no input?)");
+               q = stralloc(_("(no input?)"));
            }
            putresult(BAD_COMMAND, "%s\n", q);
            amfree(q);
@@ -561,14 +516,6 @@ main(
            aclose(outfd);
     } while(cmd != QUIT);
 
-    /* make sure root privilege is dropped */
-    if ( geteuid() == 0 ) {
-      setuid(ruid);
-      seteuid(ruid);
-    }
-
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     am_release_feature_set(our_features);
     amfree(our_feature_string);
     amfree(errstr);
@@ -587,14 +534,6 @@ main(
     amfree(srv_decrypt_opt);
     amfree(clnt_decrypt_opt);
     amfree(options);
-    amfree(config_dir);
-    amfree(config_name);
-
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if (malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
 
     dbclose();
     return (0); /* exit */
@@ -665,7 +604,7 @@ databuf_flush(
        dumpbytes %= (off_t)1024;
     }
     if (written < 0) {
-       errstr = squotef("data write: %s", strerror(errno));
+       errstr = squotef(_("data write: %s"), strerror(errno));
        return -1;
     }
     db->datain = db->dataout = db->buf;
@@ -687,21 +626,21 @@ process_dumpeof(void)
     add_msg_data(NULL, 0);
     if(!ISSET(status, GOT_SIZELINE) && dump_result < 2) {
        /* make a note if there isn't already a failure */
-       fprintf(errf,
-               "? %s: strange [missing size line from sendbackup]\n",
+       g_fprintf(errf,
+               _("? %s: strange [missing size line from sendbackup]\n"),
                get_pname());
        if(errstr == NULL) {
-           errstr = stralloc("missing size line from sendbackup");
+           errstr = stralloc(_("missing size line from sendbackup"));
        }
        dump_result = max(dump_result, 2);
     }
 
     if(!ISSET(status, GOT_ENDLINE) && dump_result < 2) {
-       fprintf(errf,
-               "? %s: strange [missing end line from sendbackup]\n",
+       g_fprintf(errf,
+               _("? %s: strange [missing end line from sendbackup]\n"),
                get_pname());
        if(errstr == NULL) {
-           errstr = stralloc("missing end line from sendbackup");
+           errstr = stralloc(_("missing end line from sendbackup"));
        }
        dump_result = max(dump_result, 2);
     }
@@ -811,7 +750,7 @@ process_dumpline(
 
            tok = strtok(NULL, "");
            if (tok == NULL || *tok != '[') {
-               errstr = newvstralloc(errstr, "bad remote error: ", str, NULL);
+               errstr = newvstrallocf(errstr, _("bad remote error: %s"), str);
            } else {
                char *enderr;
 
@@ -833,11 +772,11 @@ process_dumpline(
     default:
 bad_line:
        /* prefix with ?? */
-       fprintf(errf, "??");
+       g_fprintf(errf, "??");
        dump_result = max(dump_result, 1);
        break;
     }
-    fprintf(errf, "%s\n", str);
+    g_fprintf(errf, "%s\n", str);
     amfree(buf);
 }
 
@@ -852,7 +791,6 @@ add_msg_data(
     } msg = { NULL, 0 };
     char *line, *ch;
     size_t buflen;
-    int        in_quotes = 0;
 
     if (msg.buf != NULL)
        buflen = strlen(msg.buf);
@@ -866,10 +804,9 @@ add_msg_data(
     if (str == NULL) {
        if (buflen == 0)
            return;
-       fprintf(errf,"? %s: error [partial line in msgbuf: "
-                               SIZE_T_FMT " bytes]\n", get_pname(),
-                               (SIZE_T_FMT_TYPE)buflen);
-       fprintf(errf,"? %s: error [partial line in msgbuf: \"%s\"]\n",
+       g_fprintf(errf,_("? %s: error [partial line in msgbuf: %zu bytes]\n"),
+           get_pname(), buflen);
+       g_fprintf(errf,_("? %s: error [partial line in msgbuf: \"%s\"]\n"),
            get_pname(), msg.buf);
        msg.buf[0] = '\0';
        return;
@@ -908,13 +845,9 @@ add_msg_data(
      * scanning line for unqouted newline.
      */
     for (ch = line = msg.buf; *ch != '\0'; ch++) {
-       if (*ch == '"') {
-           in_quotes = !in_quotes;
-       } else if ((*ch == '\\') && (*(ch + 1) == '"')) {
-               ch++;
-       } else if (!in_quotes && (*ch == '\n')) {
+       if (*ch == '\n') {
            /*
-            * Found an unqouted newline.  Terminate and process line.
+            * Found a newline.  Terminate and process line.
             */
            *ch = '\0';
            process_dumpline(line);
@@ -943,7 +876,7 @@ log_msgout(
 
     fflush(errf);
     if (fseek(errf, 0L, SEEK_SET) < 0) {
-       dbprintf(("log_msgout: warning - seek failed: %s\n", strerror(errno)));
+       dbprintf(_("log_msgout: warning - seek failed: %s\n"), strerror(errno));
     }
     while ((line = agets(errf)) != NULL) {
        if (line[0] != '\0') {
@@ -983,21 +916,21 @@ finish_tapeheader(
 #define        UNCOMPRESS_OPT  ""
 #endif
        if (srvcompress == COMP_SERVER_CUST) {
-           snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
+           g_snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
                     " %s %s |", srvcompprog, "-d");
            strncpy(file->comp_suffix, "cust", SIZEOF(file->comp_suffix) - 1);
            file->comp_suffix[SIZEOF(file->comp_suffix) - 1] = '\0';
            strncpy(file->srvcompprog, srvcompprog, SIZEOF(file->srvcompprog) - 1);
            file->srvcompprog[SIZEOF(file->srvcompprog) - 1] = '\0';
        } else if ( srvcompress == COMP_CUST ) {
-           snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
+           g_snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
                     " %s %s |", clntcompprog, "-d");
            strncpy(file->comp_suffix, "cust", SIZEOF(file->comp_suffix) - 1);
            file->comp_suffix[SIZEOF(file->comp_suffix) - 1] = '\0';
            strncpy(file->clntcompprog, clntcompprog, SIZEOF(file->clntcompprog));
            file->clntcompprog[SIZEOF(file->clntcompprog) - 1] = '\0';
        } else {
-           snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
+           g_snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
                " %s %s |", UNCOMPRESS_PATH, UNCOMPRESS_OPT);
            strncpy(file->comp_suffix, COMPRESS_SUFFIX,SIZEOF(file->comp_suffix) - 1);
            file->comp_suffix[SIZEOF(file->comp_suffix) - 1] = '\0';
@@ -1016,7 +949,7 @@ finish_tapeheader(
     if (srvencrypt != ENCRYPT_NONE) {
       file->encrypted= 1;
       if (srvencrypt == ENCRYPT_SERV_CUST) {
-       snprintf(file->decrypt_cmd, SIZEOF(file->decrypt_cmd),
+       g_snprintf(file->decrypt_cmd, SIZEOF(file->decrypt_cmd),
                 " %s %s |", srv_encrypt, srv_decrypt_opt); 
        strncpy(file->encrypt_suffix, "enc", SIZEOF(file->encrypt_suffix) - 1);
        file->encrypt_suffix[SIZEOF(file->encrypt_suffix) - 1] = '\0';
@@ -1025,7 +958,7 @@ finish_tapeheader(
        strncpy(file->srv_decrypt_opt, srv_decrypt_opt, SIZEOF(file->srv_decrypt_opt) - 1);
        file->srv_decrypt_opt[SIZEOF(file->srv_decrypt_opt) - 1] = '\0';
       } else if ( srvencrypt == ENCRYPT_CUST ) {
-       snprintf(file->decrypt_cmd, SIZEOF(file->decrypt_cmd),
+       g_snprintf(file->decrypt_cmd, SIZEOF(file->decrypt_cmd),
                 " %s %s |", clnt_encrypt, clnt_decrypt_opt);
        strncpy(file->encrypt_suffix, "enc", SIZEOF(file->encrypt_suffix) - 1);
        file->encrypt_suffix[SIZEOF(file->encrypt_suffix) - 1] = '\0';
@@ -1054,16 +987,17 @@ write_tapeheader(
     int                outfd,
     dumpfile_t *file)
 {
-    char buffer[DISK_BLOCK_BYTES];
+    char * buffer;
     ssize_t written;
 
-    build_header(buffer, file, SIZEOF(buffer));
+    buffer = build_header(file, DISK_BLOCK_BYTES);
 
-    written = fullwrite(outfd, buffer, SIZEOF(buffer));
-    if(written == (ssize_t)sizeof(buffer))
-       return 0;
+    written = fullwrite(outfd, buffer, DISK_BLOCK_BYTES);
+    amfree(buffer);
+    if(written == DISK_BLOCK_BYTES)
+        return 0;
     if(written < 0)
-       return written;
+        return written;
 
     return -1;
 }
@@ -1090,7 +1024,7 @@ do_dump(
     dumpbytes = dumpsize = headersize = origsize = (off_t)0;
     fh_init(&file);
 
-    snprintf(level_str, SIZEOF(level_str), "%d", level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", level);
     fn = sanitise_filename(diskname);
     errfname = newvstralloc(errfname,
                            AMANDA_TMPDIR,
@@ -1101,10 +1035,8 @@ do_dump(
                            NULL);
     amfree(fn);
     if((errf = fopen(errfname, "w+")) == NULL) {
-       errstr = newvstralloc(errstr,
-                             "errfile open \"", errfname, "\": ",
-                             strerror(errno),
-                             NULL);
+       errstr = newvstrallocf(errstr, "errfile open \"%s\": %s",
+                             errfname, strerror(errno));
        amfree(errfname);
        goto failed;
     }
@@ -1116,20 +1048,18 @@ do_dump(
        indexfile_tmp = stralloc2(indexfile_real, ".tmp");
 
        if (mkpdir(indexfile_tmp, 02755, (uid_t)-1, (gid_t)-1) == -1) {
-          errstr = newvstralloc(errstr,
-                                "err create ",
+          errstr = newvstrallocf(errstr,
+                                _("err create %s: %s"),
                                 indexfile_tmp,
-                                ": ",
-                                strerror(errno),
-                                NULL);
+                                strerror(errno));
           amfree(indexfile_real);
           amfree(indexfile_tmp);
           goto failed;
        }
        indexout = open(indexfile_tmp, O_WRONLY | O_CREAT | O_TRUNC, 0600);
        if (indexout == -1) {
-           errstr = newvstralloc(errstr, "err open ", indexfile_tmp, ": ",
-               strerror(errno), NULL);
+           errstr = newvstrallocf(errstr, _("err open %s: %s"),
+                       indexfile_tmp, strerror(errno));
            goto failed;
        } else {
            if (runcompress(indexout, &indexpid, COMP_BEST) < 0) {
@@ -1162,28 +1092,35 @@ do_dump(
      */
     event_loop(0);
 
+    if (!ISSET(status, HEADER_DONE)) {
+       dump_result = max(dump_result, 2);
+       if (!errstr) errstr = stralloc(_("got no header information"));
+    }
+
+    dumpsize -= headersize;            /* don't count the header */
+    if (dumpsize <= (off_t)0) {
+       dumpsize = (off_t)0;
+       dump_result = max(dump_result, 2);
+       if (!errstr) errstr = stralloc(_("got no data"));
+    }
+
     if (dump_result > 1)
        goto failed;
 
     runtime = stopclock();
-    dumptime = (double)(runtime.r.tv_sec) +
-              ((double)(runtime.r.tv_usec) / 1000000.0);
-
-    dumpsize -= headersize;            /* don't count the header */
-    if (dumpsize < (off_t)0)           /* XXX - maybe this should be fatal? */
-       dumpsize = (off_t)0;
+    dumptime = g_timeval_to_double(runtime);
 
     amfree(errstr);
     errstr = alloc(128);
-    snprintf(errstr, 128, "sec %s kb " OFF_T_FMT " kps %3.1lf orig-kb " OFF_T_FMT "",
+    g_snprintf(errstr, 128, _("sec %s kb %lld kps %3.1lf orig-kb %lld"),
        walltime_str(runtime),
-       (OFF_T_FMT_TYPE)dumpsize,
+       (long long)dumpsize,
        (isnormal(dumptime) ? ((double)dumpsize / (double)dumptime) : 0.0),
-       (OFF_T_FMT_TYPE)origsize);
+       (long long)origsize);
     q = squotef("[%s]", errstr);
-    putresult(DONE, "%s " OFF_T_FMT " " OFF_T_FMT " %lu %s\n", handle,
-               (OFF_T_FMT_TYPE)origsize,
-               (OFF_T_FMT_TYPE)dumpsize,
+    putresult(DONE, _("%s %lld %lld %lu %s\n"), handle,
+               (long long)origsize,
+               (long long)dumpsize,
                (unsigned long)((double)dumptime+0.5), q);
     amfree(q);
 
@@ -1211,7 +1148,7 @@ do_dump(
        /*@i@*/ aclose(indexout);
        waitpid(indexpid,&index_status,0);
        if (rename(indexfile_tmp, indexfile_real) != 0) {
-           log_add(L_WARNING, "could not rename \"%s\" to \"%s\": %s",
+           log_add(L_WARNING, _("could not rename \"%s\" to \"%s\": %s"),
                    indexfile_tmp, indexfile_real, strerror(errno));
        }
        amfree(indexfile_tmp);
@@ -1237,10 +1174,10 @@ failed:
     aclose(db->fd);
     /* kill all child process */
     if (db->compresspid != -1) {
-       fprintf(stderr,"%s: kill compress command\n",get_pname());
+       g_fprintf(stderr,_("%s: kill compress command\n"),get_pname());
        if (kill(db->compresspid, SIGTERM) < 0) {
            if (errno != ESRCH)
-               fprintf(stderr,"%s: can't kill compress command: %s\n"
+               g_fprintf(stderr,_("%s: can't kill compress command: %s\n")
                    get_pname(), strerror(errno));
        }
        else {
@@ -1249,10 +1186,10 @@ failed:
     }
 
     if (db->encryptpid != -1) {
-       fprintf(stderr,"%s: kill encrypt command\n",get_pname());
+       g_fprintf(stderr,_("%s: kill encrypt command\n"),get_pname());
        if (kill(db->encryptpid, SIGTERM) < 0) {
            if (errno != ESRCH)
-               fprintf(stderr,"%s: can't kill encrypt command: %s\n"
+               g_fprintf(stderr,_("%s: can't kill encrypt command: %s\n")
                    get_pname(), strerror(errno));
        }
        else {
@@ -1261,10 +1198,10 @@ failed:
     }
 
     if (indexpid != -1) {
-       fprintf(stderr,"%s: kill index command\n",get_pname());
+       g_fprintf(stderr,_("%s: kill index command\n"),get_pname());
        if (kill(indexpid, SIGTERM) < 0) {
            if (errno != ESRCH)
-               fprintf(stderr,"%s: can't kill index command: %s\n"
+               g_fprintf(stderr,_("%s: can't kill index command: %s\n")
                    get_pname(),strerror(errno));
        }
        else {
@@ -1273,7 +1210,7 @@ failed:
     }
 
     log_start_multiline();
-    log_add(L_FAIL, "%s %s %s %d [%s]", hostname, qdiskname, dumper_timestamp,
+    log_add(L_FAIL, _("%s %s %s %d [%s]"), hostname, qdiskname, dumper_timestamp,
            level, errstr);
     if (errf) {
        log_msgout(L_FAIL);
@@ -1306,7 +1243,7 @@ read_mesgfd(
 
     switch (size) {
     case -1:
-       errstr = newstralloc2(errstr, "mesg read: ",
+       errstr = newvstrallocf(errstr, _("mesg read: %s"),
            security_stream_geterror(streams[MESGFD].fd));
        dump_result = 2;
        stop_dump();
@@ -1339,7 +1276,7 @@ read_mesgfd(
        /* time to do the header */
        finish_tapeheader(&file);
        if (write_tapeheader(db->fd, &file)) {
-           errstr = newstralloc2(errstr, "write_tapeheader: "
+           errstr = newvstrallocf(errstr, _("write_tapeheader: %s")
                                  strerror(errno));
            dump_result = 2;
            stop_dump();
@@ -1393,7 +1330,7 @@ read_datafd(
      * The read failed.  Error out
      */
     if (size < 0) {
-       errstr = newstralloc2(errstr, "data read: ",
+       errstr = newvstrallocf(errstr, _("data read: %s"),
            security_stream_geterror(streams[DATAFD].fd));
        dump_result = 2;
        stop_dump();
@@ -1427,7 +1364,7 @@ read_datafd(
      */
     assert(buf != NULL);
     if (databuf_write(db, buf, (size_t)size) < 0) {
-       errstr = newstralloc2(errstr, "data write: ", strerror(errno));
+       errstr = newvstrallocf(errstr, _("data write: %s"), strerror(errno));
        dump_result = 2;
        stop_dump();
        return;
@@ -1456,7 +1393,7 @@ read_indexfd(
     fd = *(int *)cookie;
 
     if (size < 0) {
-       errstr = newstralloc2(errstr, "index read: ",
+       errstr = newvstrallocf(errstr, _("index read: %s"),
            security_stream_geterror(streams[INDEXFD].fd));
        dump_result = 2;
        stop_dump();
@@ -1487,7 +1424,7 @@ read_indexfd(
        /* Ignore error, but schedule another read. */
        if(indexfderror == 0) {
            indexfderror = 1;
-           log_add(L_INFO, "Index corrupted for %s:%s", hostname, qdiskname);
+           log_add(L_INFO, _("Index corrupted for %s:%s"), hostname, qdiskname);
        }
     }
     security_stream_read(streams[INDEXFD].fd, read_indexfd, cookie);
@@ -1529,7 +1466,7 @@ timeout_callback(
     (void)unused;      /* Quiet unused parameter warning */
 
     assert(unused == NULL);
-    errstr = newstralloc(errstr, "data timeout");
+    errstr = newstralloc(errstr, _("data timeout"));
     dump_result = 2;
     stop_dump();
 }
@@ -1572,41 +1509,41 @@ runcompress(
 
     /* outpipe[0] is pipe's stdin, outpipe[1] is stdout. */
     if (pipe(outpipe) < 0) {
-       errstr = newstralloc2(errstr, "pipe: ", strerror(errno));
+       errstr = newvstrallocf(errstr, _("pipe: %s"), strerror(errno));
        return (-1);
     }
 
     switch (*pid = fork()) {
     case -1:
-       errstr = newstralloc2(errstr, "couldn't fork: ", strerror(errno));
+       errstr = newvstrallocf(errstr, _("couldn't fork: %s"), strerror(errno));
        aclose(outpipe[0]);
        aclose(outpipe[1]);
        return (-1);
     default:
        rval = dup2(outpipe[1], outfd);
        if (rval < 0)
-           errstr = newstralloc2(errstr, "couldn't dup2: ", strerror(errno));
+           errstr = newvstrallocf(errstr, _("couldn't dup2: %s"), strerror(errno));
        aclose(outpipe[1]);
        aclose(outpipe[0]);
        return (rval);
     case 0:
        if (dup2(outpipe[0], 0) < 0) {
-           error("err dup2 in: %s", strerror(errno));
+           error(_("err dup2 in: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        if (dup2(outfd, 1) == -1) {
-           error("err dup2 out: %s", strerror(errno));
+           error(_("err dup2 out: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        safe_fd(-1, 0);
        if (comptype != COMP_SERVER_CUST) {
            execlp(COMPRESS_PATH, COMPRESS_PATH, (  comptype == COMP_BEST ?
                COMPRESS_BEST_OPT : COMPRESS_FAST_OPT), (char *)NULL);
-           error("error: couldn't exec %s: %s", COMPRESS_PATH, strerror(errno));
+           error(_("error: couldn't exec %s: %s"), COMPRESS_PATH, strerror(errno));
            /*NOTREACHED*/
        } else if (*srvcompprog) {
            execlp(srvcompprog, srvcompprog, (char *)0);
-           error("error: couldn't exec server custom filter%s.\n", srvcompprog);
+           error(_("error: couldn't exec server custom filter%s.\n"), srvcompprog);
            /*NOTREACHED*/
        }
     }
@@ -1633,36 +1570,36 @@ runencrypt(
 
     /* outpipe[0] is pipe's stdin, outpipe[1] is stdout. */
     if (pipe(outpipe) < 0) {
-       errstr = newstralloc2(errstr, "pipe: ", strerror(errno));
+       errstr = newvstrallocf(errstr, _("pipe: %s"), strerror(errno));
        return (-1);
     }
 
     switch (*pid = fork()) {
     case -1:
-       errstr = newstralloc2(errstr, "couldn't fork: ", strerror(errno));
+       errstr = newvstrallocf(errstr, _("couldn't fork: %s"), strerror(errno));
        aclose(outpipe[0]);
        aclose(outpipe[1]);
        return (-1);
     default:
        rval = dup2(outpipe[1], outfd);
        if (rval < 0)
-           errstr = newstralloc2(errstr, "couldn't dup2: ", strerror(errno));
+           errstr = newvstrallocf(errstr, _("couldn't dup2: %s"), strerror(errno));
        aclose(outpipe[1]);
        aclose(outpipe[0]);
        return (rval);
     case 0:
        if (dup2(outpipe[0], 0) < 0) {
-           error("err dup2 in: %s", strerror(errno));
+           error(_("err dup2 in: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        if (dup2(outfd, 1) < 0 ) {
-           error("err dup2 out: %s", strerror(errno));
+           error(_("err dup2 out: %s"), strerror(errno));
            /*NOTREACHED*/
        }
        safe_fd(-1, 0);
        if ((encrypttype == ENCRYPT_SERV_CUST) && *srv_encrypt) {
            execlp(srv_encrypt, srv_encrypt, (char *)0);
-           error("error: couldn't exec server encryption%s.\n", srv_encrypt);
+           error(_("error: couldn't exec server encryption%s.\n"), srv_encrypt);
            /*NOTREACHED*/
        }
     }
@@ -1688,8 +1625,8 @@ sendbackup_response(
     assert(sech != NULL);
 
     if (pkt == NULL) {
-       errstr = newvstralloc(errstr, "[request failed: ",
-           security_geterror(sech), "]", NULL);
+       errstr = newvstrallocf(errstr, _("[request failed: %s]"),
+           security_geterror(sech));
        *response_error = 1;
        return;
     }
@@ -1700,7 +1637,7 @@ sendbackup_response(
     memset(ports, 0, SIZEOF(ports));
     if (pkt->type == P_NAK) {
 #if defined(PACKET_DEBUG)
-       fprintf(stderr, "got nak response:\n----\n%s\n----\n\n", pkt->body);
+       g_fprintf(stderr, _("got nak response:\n----\n%s\n----\n\n"), pkt->body);
 #endif
 
        tok = strtok(pkt->body, " ");
@@ -1709,26 +1646,24 @@ sendbackup_response(
 
        tok = strtok(NULL, "\n");
        if (tok != NULL) {
-           errstr = newvstralloc(errstr, "NAK: ", tok, NULL);
+           errstr = newvstrallocf(errstr, "NAK: %s", tok);
            *response_error = 1;
        } else {
 bad_nak:
-           errstr = newstralloc(errstr, "request NAK");
+           errstr = newvstrallocf(errstr, "request NAK");
            *response_error = 2;
        }
        return;
     }
 
     if (pkt->type != P_REP) {
-       errstr = newvstralloc(errstr, "received strange packet type ",
-           pkt_type2str(pkt->type), ": ", pkt->body, NULL);
+       errstr = newvstrallocf(errstr, _("received strange packet type %s: %s"),
+           pkt_type2str(pkt->type), pkt->body);
        *response_error = 1;
        return;
     }
 
-#if 1
-    fprintf(stderr, "got response:\n----\n%s\n----\n\n", pkt->body);
-#endif
+    dbprintf(_("got response:\n----\n%s\n----\n\n"), pkt->body);
 
     for(i = 0; i < NSTREAMS; i++) {
        ports[i] = -1;
@@ -1746,8 +1681,8 @@ bad_nak:
        if (strcmp(tok, "ERROR") == 0) {
            tok = strtok(NULL, "\n");
            if (tok == NULL)
-               tok = "[bogus error packet]";
-           errstr = newstralloc(errstr, tok);
+               tok = _("[bogus error packet]");
+           errstr = newvstrallocf(errstr, "%s", tok);
            *response_error = 2;
            return;
        }
@@ -1763,22 +1698,17 @@ bad_nak:
            for (i = 0; i < NSTREAMS; i++) {
                tok = strtok(NULL, " ");
                if (tok == NULL || strcmp(tok, streams[i].name) != 0) {
-                   extra = vstralloc("CONNECT token is \"",
-                                     tok ? tok : "(null)",
-                                     "\": expected \"",
-                                     streams[i].name,
-                                     "\"",
-                                     NULL);
+                   extra = vstrallocf(
+                               _("CONNECT token is \"%s\": expected \"%s\""),
+                               tok ? tok : "(null)",
+                               streams[i].name);
                    goto parse_error;
                }
                tok = strtok(NULL, " \n");
                if (tok == NULL || sscanf(tok, "%d", &ports[i]) != 1) {
-                   extra = vstralloc("CONNECT ",
-                                     streams[i].name,
-                                     " token is \"",
-                                     tok ? tok : "(null)",
-                                     "\": expected a port number",
-                                     NULL);
+                   extra = vstrallocf(
+                       _("CONNECT %s token is \"%s\": expected a port number"),
+                       streams[i].name, tok ? tok : "(null)");
                    goto parse_error;
                }
            }
@@ -1791,7 +1721,7 @@ bad_nak:
        if (strcmp(tok, "OPTIONS") == 0) {
            tok = strtok(NULL, "\n");
            if (tok == NULL) {
-               extra = stralloc("OPTIONS token is missing");
+               extra = vstrallocf(_("OPTIONS token is missing"));
                goto parse_error;
            }
 
@@ -1801,10 +1731,9 @@ bad_nak:
                if(strncmp_const_skip(tok, "features=", tok, ch) == 0) {
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
-                       errstr = newvstralloc(errstr,
-                                             "OPTIONS: bad features value: ",
-                                             tok,
-                                             NULL);
+                       errstr = newvstrallocf(errstr,
+                                             _("OPTIONS: bad features value: %s"),
+                                             tok);
                        goto parse_error;
                    }
                }
@@ -1813,13 +1742,14 @@ bad_nak:
            continue;
        }
 
-       extra = vstralloc("next token is \"",
-                         tok ? tok : "(null)",
-                         "\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\"",
-                         NULL);
+       extra = vstrallocf(_("next token is \"%s\": expected \"CONNECT\", \"ERROR\" or \"OPTIONS\""),
+                         tok ? tok : "(null)");
        goto parse_error;
     }
 
+    if (dumper_kencrypt == KENCRYPT_WILL_DO)
+       dumper_kencrypt = KENCRYPT_YES;
+
     /*
      * Connect the streams to their remote ports
      */
@@ -1828,9 +1758,10 @@ bad_nak:
            continue;
        streams[i].fd = security_stream_client(sech, ports[i]);
        if (streams[i].fd == NULL) {
-           errstr = newvstralloc(errstr,
-               "[could not connect ", streams[i].name, " stream: ",
-               security_geterror(sech), "]", NULL);
+           errstr = newvstrallocf(errstr,
+               _("[could not connect %s stream: %s]"),
+               streams[i].name,
+               security_geterror(sech));
            goto connect_error;
        }
     }
@@ -1852,9 +1783,10 @@ bad_nak:
            continue;
 #endif
        if (security_stream_auth(streams[i].fd) < 0) {
-           errstr = newvstralloc(errstr,
-               "[could not authenticate ", streams[i].name, " stream: ",
-               security_stream_geterror(streams[i].fd), "]", NULL);
+           errstr = newvstrallocf(errstr,
+               _("[could not authenticate %s stream: %s]"),
+               streams[i].name, 
+               security_stream_geterror(streams[i].fd));
            goto connect_error;
        }
     }
@@ -1864,7 +1796,7 @@ bad_nak:
      * them, complain.
      */
     if (streams[MESGFD].fd == NULL || streams[DATAFD].fd == NULL) {
-       errstr = newstralloc(errstr, "[couldn't open MESG or INDEX streams]");
+       errstr = newvstrallocf(errstr, _("[couldn't open MESG or INDEX streams]"));
        goto connect_error;
     }
 
@@ -1873,11 +1805,9 @@ bad_nak:
     return;
 
 parse_error:
-    errstr = newvstralloc(errstr,
-                         "[parse of reply message failed: ",
-                         extra ? extra : "(no additional information)",
-                         "]",
-                         NULL);
+    errstr = newvstrallocf(errstr,
+                         _("[parse of reply message failed: %s]"),
+                         extra ? extra : _("(no additional information)"));
     amfree(extra);
     *response_error = 2;
     return;
@@ -1907,6 +1837,11 @@ dumper_get_security_conf(
                 return (client_username);
         } else if(strcmp(string, "ssh_keys")==0) {
                 return (ssh_keys);
+        } else if(strcmp(string, "kencrypt")==0) {
+               if (dumper_kencrypt == KENCRYPT_YES)
+                    return ("yes");
+               else
+                   return (NULL);
         }
         return(NULL);
 }
@@ -1967,7 +1902,7 @@ startup_dump(
        }
     }
 
-    snprintf(level_string, SIZEOF(level_string), "%d", level);
+    g_snprintf(level_string, SIZEOF(level_string), "%d", level);
     if(strcmp(progname, "DUMP") == 0
        || strcmp(progname, "GNUTAR") == 0) {
        backup_api = "";
@@ -1997,12 +1932,13 @@ startup_dump(
                    "\n",
                    NULL);
 
-fprintf(stderr, "send request:\n----\n%s\n----\n\n", req);
+    dbprintf(_("send request:\n----\n%s\n----\n\n"), req);
     secdrv = security_getdriver(authopt);
     if (secdrv == NULL) {
-       error("no '%s' security driver available for host '%s'",
-           authopt, hostname);
-       /*NOTREACHED*/
+       errstr = newvstrallocf(errstr,
+               _("[could not find security driver '%s']"), authopt);
+       amfree(req);
+       return 2;
     }
 
     protocol_sendreq(hostname, secdrv, dumper_get_security_conf, req,
index 2e5dd1813489907296df8d3502bdc0f4b0c3a01e..e430bf3abaf7f1a2922de2018bf1aa9069c835ad 100644 (file)
 #include "find.h"
 
 int find_match(char *host, char *disk);
-int search_logfile(find_result_t **output_find, char *label, char *datestamp, char *logfile);
 void search_holding_disk(find_result_t **output_find);
-void strip_failed_chunks(find_result_t **output_find);
 char *find_nicedate(char *datestamp);
 static int find_compare(const void *, const void *);
 static int parse_taper_datestamp_log(char *logline, char **datestamp, char **level);
-static int seen_chunk_of(find_result_t *output_find, char *date, char *host, char *disk, int level);
+static gboolean logfile_has_tape(char * label, char * datestamp,
+                                 char * logfile);
 
 static char *find_sort_order = NULL;
-int dynamic_disklist = 0;
-disklist_t* find_diskqp = NULL;
 
-find_result_t *
-find_dump(
-    int dyna_disklist,
-    disklist_t* diskqp)
-{
+find_result_t * find_dump(disklist_t* diskqp) {
     char *conf_logdir, *logfile = NULL;
     int tape, maxtape, logs;
     unsigned seq;
     tape_t *tp;
     find_result_t *output_find = NULL;
 
-    dynamic_disklist = dyna_disklist;
-    find_diskqp = diskqp;
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     maxtape = lookup_nb_tape();
 
     for(tape = 1; tape <= maxtape; tape++) {
@@ -84,38 +70,47 @@ find_dump(
        for(seq = 0; 1; seq++) {
            char seq_str[NUM_STR_SIZE];
 
-           snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
+           g_snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
            logfile = newvstralloc(logfile,
                        conf_logdir, "/log.", tp->datestamp, ".", seq_str, NULL);
            if(access(logfile, R_OK) != 0) break;
-           logs += search_logfile(&output_find, tp->label, tp->datestamp, logfile);
+           if (search_logfile(&output_find, tp->label, tp->datestamp,
+                               logfile, diskqp)) {
+                logs ++;
+            }
        }
 
        /* search old-style amflush log, if any */
 
-       logfile = newvstralloc(logfile,
-                              conf_logdir, "/log.", tp->datestamp, ".amflush", NULL);
+       logfile = newvstralloc(logfile, conf_logdir, "/log.",
+                               tp->datestamp, ".amflush", NULL);
        if(access(logfile,R_OK) == 0) {
-           logs += search_logfile(&output_find, tp->label, tp->datestamp, logfile);
-       }
-
+           if (search_logfile(&output_find, tp->label, tp->datestamp,
+                               logfile, diskqp)) {
+                logs ++;
+            }
+        }
+        
        /* search old-style main log, if any */
 
-       logfile = newvstralloc(logfile, conf_logdir, "/log.", tp->datestamp, NULL);
+       logfile = newvstralloc(logfile, conf_logdir, "/log.", tp->datestamp,
+                               NULL);
        if(access(logfile,R_OK) == 0) {
-           logs += search_logfile(&output_find, tp->label, tp->datestamp, logfile);
+           if (search_logfile(&output_find, tp->label, tp->datestamp,
+                               logfile, diskqp)) {
+                logs ++;
+            }
        }
        if(logs == 0 && strcmp(tp->datestamp,"0") != 0)
-           fprintf(stderr, "Warning: no log files found for tape %s written %s\n",
-                  tp->label, find_nicedate(tp->datestamp));
+           g_fprintf(stderr,
+                      _("Warning: no log files found for tape %s written %s\n"),
+                      tp->label, find_nicedate(tp->datestamp));
     }
     amfree(logfile);
     amfree(conf_logdir);
 
     search_holding_disk(&output_find);
 
-    strip_failed_chunks(&output_find);
-    
     return(output_find);
 }
 
@@ -123,18 +118,14 @@ char **
 find_log(void)
 {
     char *conf_logdir, *logfile = NULL;
+    char *pathlogfile = NULL;
     int tape, maxtape, logs;
     unsigned seq;
     tape_t *tp;
     char **output_find_log = NULL;
     char **current_log;
 
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     maxtape = lookup_nb_tape();
 
     output_find_log = alloc((maxtape*5+10) * SIZEOF(char *));
@@ -154,13 +145,15 @@ find_log(void)
        for(seq = 0; 1; seq++) {
            char seq_str[NUM_STR_SIZE];
 
-           snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
-           logfile = newvstralloc(logfile,
-                       conf_logdir, "/log.", tp->datestamp, ".", seq_str, NULL);
-           if(access(logfile, R_OK) != 0) break;
-           if( search_logfile(NULL, tp->label, tp->datestamp, logfile)) {
-               *current_log = vstralloc("log.", tp->datestamp, ".", seq_str, NULL);
-               current_log++;
+           g_snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
+           logfile = newvstralloc(logfile, "log.", tp->datestamp, ".", seq_str, NULL);
+           pathlogfile = newvstralloc(pathlogfile, conf_logdir, "/", logfile, NULL);
+           if (access(pathlogfile, R_OK) != 0) break;
+           if (logfile_has_tape(tp->label, tp->datestamp, pathlogfile)) {
+               if (current_log == output_find_log || strcmp(*(current_log-1), logfile)) {
+                   *current_log = stralloc(logfile);
+                   current_log++;
+               }
                logs++;
                break;
            }
@@ -168,120 +161,57 @@ find_log(void)
 
        /* search old-style amflush log, if any */
 
-       logfile = newvstralloc(logfile,
-                              conf_logdir, "/log.", tp->datestamp, ".amflush", NULL);
-       if(access(logfile,R_OK) == 0) {
-           if( search_logfile(NULL, tp->label, tp->datestamp, logfile)) {
-               *current_log = vstralloc("log.", tp->datestamp, ".amflush", NULL);
-               current_log++;
+       logfile = newvstralloc(logfile, "log.", tp->datestamp, ".amflush", NULL);
+       pathlogfile = newvstralloc(pathlogfile, conf_logdir, "/", logfile, NULL);
+       if (access(pathlogfile, R_OK) == 0) {
+           if (logfile_has_tape(tp->label, tp->datestamp, pathlogfile)) {
+               if (current_log == output_find_log || strcmp(*(current_log-1), logfile)) {
+                   *current_log = stralloc(logfile);
+                   current_log++;
+               }
                logs++;
            }
        }
 
        /* search old-style main log, if any */
 
-       logfile = newvstralloc(logfile, conf_logdir, "/log.", tp->datestamp, NULL);
-       if(access(logfile,R_OK) == 0) {
-           if(search_logfile(NULL, tp->label, tp->datestamp, logfile)) {
-               *current_log = vstralloc("log.", tp->datestamp, NULL);
-               current_log++;
+       logfile = newvstralloc(logfile, "log.", tp->datestamp, NULL);
+       pathlogfile = newvstralloc(pathlogfile, conf_logdir, "/", logfile, NULL);
+       if (access(pathlogfile, R_OK) == 0) {
+           if (logfile_has_tape(tp->label, tp->datestamp, pathlogfile)) {
+               if (current_log == output_find_log || strcmp(*(current_log-1), logfile)) {
+                   *current_log = stralloc(logfile);
+                   current_log++;
+               }
                logs++;
            }
        }
+
        if(logs == 0 && strcmp(tp->datestamp,"0") != 0)
-           fprintf(stderr, "Warning: no log files found for tape %s written %s\n",
+           g_fprintf(stderr, _("Warning: no log files found for tape %s written %s\n"),
                   tp->label, find_nicedate(tp->datestamp));
     }
     amfree(logfile);
+    amfree(pathlogfile);
     amfree(conf_logdir);
     *current_log = NULL;
     return(output_find_log);
 }
 
-/*
- * Remove CHUNK entries from dumps that ultimately failed from our report.
- */
-void strip_failed_chunks(
-    find_result_t **output_find)
-{
-    find_result_t *cur, *prev = NULL, *failed = NULL, *failures = NULL;
-
-    /* Generate a list of failures */
-    for(cur=*output_find; cur; cur=cur->next) {
-       if(!cur->hostname  || !cur->diskname ||
-          !cur->timestamp || !cur->label)
-           continue;
-
-       if(strcmp(cur->status, "OK")){
-           failed = alloc(SIZEOF(find_result_t));
-           memcpy(failed, cur, SIZEOF(find_result_t));
-           failed->next = failures;
-           failures = failed;
-       }
-    }
-
-    /* Now if a CHUNK matches the parameters of a failed dump, remove it */
-    for(failed=failures; failed; failed=failed->next) {
-       prev = NULL;
-       cur = *output_find;
-       while (cur != NULL) {
-           find_result_t *next = cur->next;
-           if(!cur->hostname  || !cur->diskname || 
-              !cur->timestamp || !cur->label    || !cur->partnum ||
-              !strcmp(cur->partnum, "--") || strcmp(cur->status, "OK")) {
-               prev = cur;
-               cur = next;
-           }
-           else if(!strcmp(cur->hostname, failed->hostname) &&
-                !strcmp(cur->diskname, failed->diskname) &&
-                !strcmp(cur->timestamp, failed->timestamp) &&
-                !strcmp(cur->label, failed->label) &&
-                cur->level == failed->level){
-               amfree(cur->diskname);
-               amfree(cur->hostname);
-               amfree(cur->label);
-               amfree(cur->timestamp);
-               amfree(cur->partnum);
-               amfree(cur->status);
-               cur = next;
-               if (prev) {
-                   amfree(prev->next);
-                   prev->next = next;
-               } else {
-                   amfree(*output_find);
-                   *output_find = next;
-               }
-           }
-            else {
-               prev = cur;
-               cur = next;
-           }
-
-       }
-    }
-
-    for(failed=failures; failed;) {
-       find_result_t *fai = failed->next;
-       fai = failed->next;
-       amfree(failed);
-       failed=fai;
-    }
-}
-
 void
 search_holding_disk(
     find_result_t **output_find)
 {
-    sl_t  *holding_file_list;
-    sle_t *e;
+    GSList *holding_file_list;
+    GSList *e;
     char *holding_file;
     disk_t *dp;
     dumpfile_t file;
 
-    holding_file_list = holding_get_files(NULL, NULL, 1);
+    holding_file_list = holding_get_files(NULL, 1);
 
-    for(e = holding_file_list->first; e != NULL; e = e->next) {
-       holding_file = e->name;
+    for(e = holding_file_list; e != NULL; e = e->next) {
+       holding_file = (char *)e->data;
 
        if (!holding_file_get_dumpfile(holding_file, &file))
            continue;
@@ -318,7 +248,7 @@ search_holding_disk(
        }
     }
 
-    free_sl(holding_file_list);
+    g_slist_free_full(holding_file_list);
 }
 
 static int
@@ -327,53 +257,44 @@ find_compare(
     const void *j1)
 {
     int compare=0;
-    find_result_t **i = (find_result_t **)i1;
-    find_result_t **j = (find_result_t **)j1;
+    find_result_t *i, *j;
 
     size_t nb_compare=strlen(find_sort_order);
     size_t k;
 
     for(k=0;k<nb_compare;k++) {
-       switch (find_sort_order[k]) {
-       case 'h' : compare=strcmp((*i)->hostname,(*j)->hostname);
-                  break;
-       case 'H' : compare=strcmp((*j)->hostname,(*i)->hostname);
-                  break;
-       case 'k' : compare=strcmp((*i)->diskname,(*j)->diskname);
-                  break;
-       case 'K' : compare=strcmp((*j)->diskname,(*i)->diskname);
-                  break;
-       case 'd' : compare=strcmp((*i)->timestamp,(*j)->timestamp);
+        char sort_key = find_sort_order[k];
+        if (isupper((int)sort_key)) {
+            /* swap */
+            sort_key = tolower(sort_key);
+            j = *(find_result_t **)i1;
+            i = *(find_result_t **)j1;
+        } else {
+            i = *(find_result_t **)i1;
+            j = *(find_result_t **)j1;
+        }            
+        
+       switch (sort_key) {
+       case 'h' : compare=strcmp(i->hostname,j->hostname);
                   break;
-       case 'D' : compare=strcmp((*j)->timestamp,(*i)->timestamp);
+       case 'k' : compare=strcmp(i->diskname,j->diskname);
                   break;
-       case 'l' : compare=(*j)->level - (*i)->level;
+       case 'd' : compare=strcmp(i->timestamp,j->timestamp);
                   break;
-       case 'f' : compare=((*i)->filenum == (*j)->filenum) ? 0 :
-                          (((*i)->filenum < (*j)->filenum) ? -1 : 1);
+       case 'l' : compare=j->level - i->level;
                   break;
-       case 'F' : compare=((*j)->filenum == (*i)->filenum) ? 0 :
-                          (((*j)->filenum < (*i)->filenum) ? -1 : 1);
-                  break;
-       case 'L' : compare=(*i)->level - (*j)->level;
-                  break;
-       case 'b' : compare=strcmp((*i)->label,(*j)->label);
-                  break;
-       case 'B' : compare=strcmp((*j)->label,(*i)->label);
+       case 'f' : compare=(i->filenum == j->filenum) ? 0 :
+                          ((i->filenum < j->filenum) ? -1 : 1);
                   break;
+       case 'b' : compare=compare_possibly_null_strings(i->label,
+                                                         j->label);
+                   break;
        case 'p' :
-                  if(strcmp((*i)->partnum, "--") != 0 &&
-                     strcmp((*j)->partnum, "--") != 0){
-                     compare = atoi((*i)->partnum) - atoi((*j)->partnum);
-                  }
-                  else compare=strcmp((*i)->partnum,(*j)->partnum);
-                  break;
-       case 'P' :
-                  if(strcmp((*i)->partnum, "--") != 0 &&
-                     strcmp((*j)->partnum, "--") != 0){
-                     compare = atoi((*j)->partnum) - atoi((*i)->partnum);
+                  if(strcmp(i->partnum, "--") != 0 &&
+                     strcmp(j->partnum, "--") != 0){
+                     compare = atoi(i->partnum) - atoi(j->partnum);
                   }
-                  else compare=strcmp((*j)->partnum,(*i)->partnum);
+                  else compare=strcmp(i->partnum,j->partnum);
                   break;
        }
        if(compare != 0)
@@ -444,6 +365,7 @@ print_find_result(
     for(output_find_result=output_find;
        output_find_result;
        output_find_result=output_find_result->next) {
+       char *qdiskname;
 
        len=strlen(find_nicedate(output_find_result->timestamp));
        if((int)len > max_len_datestamp)
@@ -453,13 +375,17 @@ print_find_result(
        if((int)len > max_len_hostname)
            max_len_hostname = (int)len;
 
-       len=strlen(output_find_result->diskname);
+       qdiskname=quote_string(output_find_result->diskname);
+       len=strlen(qdiskname);
+       amfree(qdiskname);
        if((int)len > max_len_diskname)
            max_len_diskname = (int)len;
 
-       len=strlen(output_find_result->label);
-       if((int)len > max_len_label)
-           max_len_label = (int)len;
+        if (output_find_result->label != NULL) {
+            len=strlen(output_find_result->label);
+            if((int)len > max_len_label)
+                max_len_label = (int)len;
+        }
 
        len=strlen(output_find_result->status);
        if((int)len > max_len_status)
@@ -478,10 +404,10 @@ print_find_result(
     max_len_status = 1;
 
     if(output_find==NULL) {
-       printf("\nNo dump to list\n");
+       g_printf(_("\nNo dump to list\n"));
     }
     else {
-       printf("\ndate%*s host%*s disk%*s lv%*s tape or file%*s file%*s part%*s status\n",
+       g_printf(_("\ndate%*s host%*s disk%*s lv%*s tape or file%*s file%*s part%*s status\n"),
               max_len_datestamp-4,"",
               max_len_hostname-4 ,"",
               max_len_diskname-4 ,"",
@@ -493,19 +419,23 @@ print_find_result(
                output_find_result;
                output_find_result=output_find_result->next) {
            char *qdiskname;
+            char * formatted_label;
 
            qdiskname = quote_string(output_find_result->diskname);
+            formatted_label = output_find_result->label;
+            if (formatted_label == NULL)
+                formatted_label = "";
            /*@ignore@*/
-           printf("%-*s %-*s %-*s %*d %-*s %*" OFF_T_RFMT " %*s %-*s\n",
-                   max_len_datestamp, 
-                       find_nicedate(output_find_result->timestamp),
-                   max_len_hostname,  output_find_result->hostname,
-                   max_len_diskname,  qdiskname,
-                   max_len_level,     output_find_result->level,
-                   max_len_label,     output_find_result->label,
-                   max_len_filenum,   (OFF_T_FMT_TYPE)output_find_result->filenum,
-                   max_len_part,      output_find_result->partnum,
-                   max_len_status,    output_find_result->status
+           g_printf("%-*s %-*s %-*s %*d %-*s %*lld %*s %-*s\n",
+                     max_len_datestamp, 
+                     find_nicedate(output_find_result->timestamp),
+                     max_len_hostname,  output_find_result->hostname,
+                     max_len_diskname,  qdiskname,
+                     max_len_level,     output_find_result->level,
+                     max_len_label,     formatted_label,
+                     max_len_filenum,   (long long)output_find_result->filenum,
+                     max_len_part,      output_find_result->partnum,
+                     max_len_status,    output_find_result->status
                    );
            /*@end@*/
            amfree(qdiskname);
@@ -530,7 +460,6 @@ free_find_result(
        amfree(output_find_result->label);
        amfree(output_find_result->partnum);
        amfree(output_find_result->status);
-       amfree(output_find_result->timestamp);
        prev = output_find_result;
     }
     amfree(prev);
@@ -564,7 +493,7 @@ find_nicedate(
     day   = numdate % 100;
 
     if(strlen(datestamp) <= 8) {
-       snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d",
+       g_snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d",
                year, month, day);
     }
     else {
@@ -575,7 +504,7 @@ find_nicedate(
        minutes = (numtime / 100) % 100;
        seconds = numtime % 100;
 
-       snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d %02d:%02d:%02d",
+       g_snprintf(nice, SIZEOF(nice), "%4d-%02d-%02d %02d:%02d:%02d",
                year, month, day, hours, minutes, seconds);
     }
 
@@ -629,123 +558,161 @@ parse_taper_datestamp_log(
     return 1;
 }
 
-/*
- * Check whether we've already seen a CHUNK log entry for the given dump.
- * This is so we can interpret the final SUCCESS entry for a split dump as 
- * 'list its parts' instead.  Return 1 if we have, 0 if not.
- */
-int
-seen_chunk_of(
-    find_result_t *output_find,
-    char *date,
-    char *host,
-    char *disk,
-    int level)
-{
-    find_result_t *cur;
-
-    if(!host || !disk) return(0);
-
-    for(cur=output_find; cur; cur=cur->next) {
-       if(atoi(cur->partnum) < 1 || !cur->hostname || !cur->diskname) continue;
+/* Returns TRUE if the given logfile mentions the given tape. */
+static gboolean logfile_has_tape(char * label, char * datestamp,
+                                 char * logfile) {
+    FILE * logf;
+    char * ck_datestamp, *ck_label;
+    if((logf = fopen(logfile, "r")) == NULL) {
+       error(_("could not open logfile %s: %s"), logfile, strerror(errno));
+       /*NOTREACHED*/
+    }
 
-       if(strcmp(cur->timestamp, date) == 0 && strcmp(cur->hostname, host) == 0 &&
-               strcmp(cur->diskname, disk) == 0 && cur->level == level){
-           return(1);
+    while(get_logline(logf)) {
+       if(curlog == L_START && curprog == P_TAPER) {
+           if(parse_taper_datestamp_log(curstr,
+                                        &ck_datestamp, &ck_label) == 0) {
+               g_printf(_("strange log line \"start taper %s\" curstr='%s'\n"),
+                         logfile, curstr);
+           } else if(strcmp(ck_datestamp, datestamp) == 0
+                     && strcmp(ck_label, label) == 0) {
+                afclose(logf);
+                return TRUE;
+           }
        }
     }
-    return(0);
+
+    afclose(logf);
+    return FALSE;
 }
 
-/* if output_find is NULL                                      */
-/*     return 1 if this is the logfile for this label          */
-/*     return 0 if this is not the logfile for this label      */
-/* else                                                                */
-/*     add to output_find all the dump for this label          */
-/*     return the number of dump added.                        */
-int
+/* Like (strcmp(label1, label2) == 0), except that NULL values force TRUE. */
+static gboolean volume_matches(const char * label1, const char * label2) {
+    return (label1 == NULL || label2 == NULL || strcmp(label1, label2) == 0);
+}
+
+/* WARNING: Function accesses globals find_diskqp, curlog, curlog, curstr,
+ * dynamic_disklist */
+gboolean
 search_logfile(
     find_result_t **output_find,
-    char *label,
-    char *datestamp,
-    char *logfile)
+    const char *label,
+    const char *passed_datestamp,
+    const char *logfile,
+    disklist_t * dynamic_disklist)
 {
     FILE *logf;
     char *host, *host_undo;
     char *disk, *qdisk, *disk_undo;
     char *date, *date_undo;
     char *partnum=NULL, *partnum_undo;
+    char *number;
+    int fileno;
+    char *current_label = NULL;
     char *rest;
     char *ck_label=NULL;
     int level = 0; 
-    int tapematch;
     off_t filenum;
-    int passlabel;
-    char *ck_datestamp, *ck_datestamp2;
+    char *ck_datestamp, *datestamp;
     char *s;
     int ch;
     disk_t *dp;
+    find_result_t *part_find = NULL;  /* List for all part of a DLE */
+    find_result_t *a_part_find;
+    gboolean right_label = FALSE;
+    gboolean found_something = FALSE;
+
+    g_return_val_if_fail(output_find != NULL, 0);
+    g_return_val_if_fail(logfile != NULL, 0);
+
+    datestamp = g_strdup(passed_datestamp);
 
     if((logf = fopen(logfile, "r")) == NULL) {
-       error("could not open logfile %s: %s", logfile, strerror(errno));
+       error(_("could not open logfile %s: %s"), logfile, strerror(errno));
        /*NOTREACHED*/
     }
 
-    /* check that this log file corresponds to the right tape */
-    tapematch = 0;
-    while(!tapematch && get_logline(logf)) {
-       if(curlog == L_START && curprog == P_TAPER) {
-           if(parse_taper_datestamp_log(curstr,
-                                        &ck_datestamp, &ck_label) == 0) {
-               printf("strange log line \"start taper %s\" curstr='%s'\n",
-                   logfile, curstr);
-           } else if(strcmp(ck_datestamp, datestamp) == 0
-                     && strcmp(ck_label, label) == 0) {
-               tapematch = 1;
+    filenum = (off_t)0;
+    while(get_logline(logf)) {
+       if (curlog == L_START && curprog == P_TAPER) {
+           if(parse_taper_datestamp_log(curstr, &ck_datestamp,
+                                         &ck_label) == 0) {
+               g_printf(_("strange log line in %s \"start taper %s\"\n"),
+                         logfile, curstr);
+                continue;
+           }
+            if (datestamp != NULL) {
+                if (strcmp(datestamp, ck_datestamp) != 0) {
+                    g_printf(_("Log file %s stamped %s, expecting %s!\n"),
+                             logfile, ck_datestamp, datestamp);
+                    break;
+                }
+            }
+            
+            right_label = volume_matches(label, ck_label);
+           if (label && datestamp && right_label) {
+               found_something = TRUE;
            }
+            amfree(current_label);
+            current_label = g_strdup(ck_label);
+            if (datestamp == NULL) {
+                datestamp = g_strdup(ck_datestamp);
+            }
        }
-    }
-
-    if(output_find == NULL) {
-       afclose(logf);
-        if(tapematch == 0)
-           return 0;
-       else
-           return 1;
-    }
-
-    if(tapematch == 0) {
-       afclose(logf);
-       return 0;
-    }
-
-    filenum = (off_t)0;
-    passlabel = 1;
-    while(get_logline(logf) && passlabel) {
-       if((curlog == L_SUCCESS || curlog == L_CHUNK || curlog == L_PARTIAL) &&
-                               curprog == P_TAPER && passlabel){
-           filenum++;
+        if (!right_label) {
+           continue;
        }
-       if(curlog == L_START && curprog == P_TAPER) {
-           if(parse_taper_datestamp_log(curstr,
-                                        &ck_datestamp2, &ck_label) == 0) {
-               printf("strange log line in %s \"start taper %s\"\n",
-                   logfile, curstr);
-           } else if (strcmp(ck_label, label)) {
-               passlabel = !passlabel;
-           }
+       if ((curlog == L_SUCCESS ||
+            curlog == L_CHUNK || curlog == L_PART || curlog == L_PARTPARTIAL) &&
+           curprog == P_TAPER) {
+           filenum++;
        }
        partnum = "--";
-       if(curlog == L_SUCCESS || curlog == L_PARTIAL || curlog == L_FAIL || curlog == L_CHUNK) {
+       if (curlog == L_SUCCESS || curlog == L_CHUNKSUCCESS ||
+           curlog == L_DONE    || curlog == L_FAIL ||
+           curlog == L_CHUNK   || curlog == L_PART || curlog == L_PARTIAL ||
+           curlog == L_PARTPARTIAL ) {
            s = curstr;
            ch = *s++;
 
            skip_whitespace(s, ch);
            if(ch == '\0') {
-               printf("strange log line in %s \"%s\"\n",
+               g_printf(_("strange log line in %s \"%s\"\n"),
                    logfile, curstr);
                continue;
            }
+
+           if (curlog == L_PART || curlog == L_PARTPARTIAL) {
+               char * part_label = s - 1;
+               skip_non_whitespace(s, ch);
+               s[-1] = '\0';
+
+               if (strcmp(current_label, part_label) != 0) {
+                   g_printf("PART label %s doesn't match START label %s\n",
+                             part_label, current_label);
+                   continue;
+               }
+               skip_whitespace(s, ch);
+               if(ch == '\0') {
+                   g_printf("strange log line in %s \"%s\"\n",
+                          logfile, curstr);
+                   continue;
+               }
+
+               number = s - 1;
+               skip_non_whitespace(s, ch);
+               s[-1] = '\0';
+               fileno = atoi(number);
+               filenum = fileno;
+
+               skip_whitespace(s, ch);
+               if(ch == '\0') {
+                   g_printf("strange log line in %s \"%s\"\n",
+                          logfile, curstr);
+                   continue;
+               }
+           }
+
            host = s - 1;
            skip_non_whitespace(s, ch);
            host_undo = s - 1;
@@ -753,7 +720,7 @@ search_logfile(
 
            skip_whitespace(s, ch);
            if(ch == '\0') {
-               printf("strange log line in %s \"%s\"\n",
+               g_printf(_("strange log line in %s \"%s\"\n"),
                    logfile, curstr);
                continue;
            }
@@ -765,8 +732,8 @@ search_logfile(
 
            skip_whitespace(s, ch);
            if(ch == '\0') {
-               printf("strange log line in %s \"%s\"\n",
-                   logfile, curstr);
+               g_printf(_("strange log line in %s \"%s\"\n"),
+                         logfile, curstr);
                continue;
            }
            date = s - 1;
@@ -777,9 +744,9 @@ search_logfile(
            if(strlen(date) < 3) { /* old log didn't have datestamp */
                level = atoi(date);
                date = stralloc(datestamp);
-           }
-           else {
-               if(curlog == L_CHUNK){
+           } else {
+               if (curlog == L_CHUNK || curlog == L_PART ||
+                   curlog == L_PARTPARTIAL || curlog == L_DONE){
                    skip_whitespace(s, ch);
                    partnum = s - 1;
                    skip_non_whitespace(s, ch);
@@ -788,7 +755,7 @@ search_logfile(
                }
                skip_whitespace(s, ch);
                if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-                   printf("strange log line in %s \"%s\"\n",
+                   g_printf(_("strange log line in %s \"%s\"\n"),
                    logfile, curstr);
                    continue;
                }
@@ -797,7 +764,7 @@ search_logfile(
 
            skip_whitespace(s, ch);
            if(ch == '\0') {
-               printf("strange log line in %s \"%s\"\n",
+               g_printf(_("strange log line in %s \"%s\"\n"),
                    logfile, curstr);
                continue;
            }
@@ -808,32 +775,65 @@ search_logfile(
 
            dp = lookup_disk(host,disk);
            if ( dp == NULL ) {
-               if (dynamic_disklist == 0) {
+               if (dynamic_disklist == NULL) {
                    continue;
                }
-               dp = add_disk(find_diskqp, host, disk);
-               enqueue_disk(find_diskqp, dp);
+               dp = add_disk(dynamic_disklist, host, disk);
+               enqueue_disk(dynamic_disklist, dp);
            }
-            if(find_match(host, disk) && (curlog != L_SUCCESS ||
-               !seen_chunk_of(*output_find, date, host, disk, level))) {
+            if (find_match(host, disk)) {
                if(curprog == P_TAPER) {
                    find_result_t *new_output_find =
                        (find_result_t *)alloc(SIZEOF(find_result_t));
-                   new_output_find->next=*output_find;
                    new_output_find->timestamp = stralloc(date);
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
                    new_output_find->level=level;
                    new_output_find->partnum = stralloc(partnum);
-                   new_output_find->label=stralloc(label);
+                    new_output_find->label=stralloc(current_label);
+                   new_output_find->status=NULL;
                    new_output_find->filenum=filenum;
-                   if(curlog == L_SUCCESS || curlog == L_CHUNK) 
-                       new_output_find->status=stralloc("OK");
-                   else if(curlog == L_PARTIAL)
-                       new_output_find->status=stralloc("PARTIAL");
-                   else
-                       new_output_find->status=stralloc(rest);
-                   *output_find=new_output_find;
+                   new_output_find->next=NULL;
+                   if (curlog == L_SUCCESS) {
+                       new_output_find->status = stralloc("OK");
+                       new_output_find->next = *output_find;
+                       *output_find = new_output_find;
+                        found_something = TRUE;
+                   } else if (curlog == L_CHUNKSUCCESS || curlog == L_DONE ||
+                              curlog == L_PARTIAL      || curlog == L_FAIL) {
+                       /* result line */
+                       if (curlog == L_PARTIAL || curlog == L_FAIL) {
+                           /* change status of each part */
+                           for (a_part_find = part_find; a_part_find;
+                                a_part_find = a_part_find->next) {
+                               if (curlog == L_PARTIAL)
+                                   a_part_find->status = stralloc("PARTIAL");
+                               else
+                                   a_part_find->status = stralloc(rest);
+                           }
+                       }
+                       if (part_find) { /* find last element */
+                           for (a_part_find = part_find;
+                                a_part_find->next != NULL;
+                                a_part_find=a_part_find->next) {
+                           }
+                           /* merge part_find to *output_find */
+                           a_part_find->next = *output_find;
+                           *output_find = part_find;
+                           part_find = NULL;
+                            found_something = TRUE;
+                       }
+                       free_find_result(&new_output_find);
+                   } else { /* part line */
+                       if (curlog == L_PART || curlog == L_CHUNK)
+                           new_output_find->status=stralloc("OK");
+                       else /* PARTPARTIAL */
+                           new_output_find->status=stralloc("PARTIAL");
+                       /* Add to part_find list */
+                       new_output_find->next = part_find;
+                       part_find = new_output_find;
+                       found_something = TRUE;
+                   }
                }
                else if(curlog == L_FAIL) {     /* print other failures too */
                    find_result_t *new_output_find =
@@ -843,7 +843,7 @@ search_logfile(
                    new_output_find->hostname=stralloc(host);
                    new_output_find->diskname=stralloc(disk);
                    new_output_find->level=level;
-                   new_output_find->label=stralloc(label);
+                   new_output_find->label=NULL;
                    new_output_find->partnum=stralloc(partnum);
                    new_output_find->filenum=0;
                    new_output_find->status=vstralloc(
@@ -853,13 +853,46 @@ search_logfile(
                         rest,
                         NULL);
                    *output_find=new_output_find;
+                    found_something = TRUE;
                }
            }
            amfree(disk);
        }
     }
+
+    if (part_find != NULL) {
+       if (label) {
+           /* parse log file until PARTIAL/DONE/SUCCESS/FAIL from taper */
+           while(get_logline(logf)) {
+               if (curprog == P_TAPER &&
+                   (curlog == L_DONE || curlog == L_SUCCESS ||
+                    curlog == L_PARTIAL || curlog == L_FAIL)) {
+                   break;
+               }
+           }
+       }
+       for (a_part_find = part_find; a_part_find;
+            a_part_find = a_part_find->next) {
+           if (curlog == L_PARTIAL)
+               a_part_find->status = stralloc("PARTIAL");
+           else if (curlog == L_FAIL)
+               a_part_find->status = stralloc("FAIL");
+       }
+       for (a_part_find = part_find;
+            a_part_find->next != NULL;
+            a_part_find=a_part_find->next) {
+       }
+       /* merge part_find to *output_find */
+       a_part_find->next = *output_find;
+       *output_find = part_find;
+       part_find = NULL;
+    }
+
     afclose(logf);
-    return 1;
+    amfree(datestamp);
+    amfree(current_label);
+
+    return found_something;
 }
 
 
@@ -867,6 +900,9 @@ search_logfile(
  * Return the set of dumps that match *all* of the given patterns (we consider
  * an empty pattern to match .*, though).  If 'ok' is true, will only match
  * dumps with SUCCESS status.
+ *
+ * Returns a newly allocated list of results, where all strings are also newly
+ * allocated.  Apparently some part of Amanda leaks under this condition.
  */
 find_result_t *
 dumps_match(
@@ -884,24 +920,25 @@ dumps_match(
        cur_result;
        cur_result=cur_result->next) {
        char level_str[NUM_STR_SIZE];
-       snprintf(level_str, SIZEOF(level_str), "%d", cur_result->level);
-       if((*hostname == '\0' || match_host(hostname, cur_result->hostname)) &&
-          (*diskname == '\0' || match_disk(diskname, cur_result->diskname)) &&
-          (*datestamp== '\0' || match_datestamp(datestamp, cur_result->timestamp)) &&
-          (*level== '\0' || match_level(level, level_str)) &&
+       g_snprintf(level_str, SIZEOF(level_str), "%d", cur_result->level);
+       if((!hostname || *hostname == '\0' || match_host(hostname, cur_result->hostname)) &&
+          (!diskname || *diskname == '\0' || match_disk(diskname, cur_result->diskname)) &&
+          (!datestamp || *datestamp== '\0' || match_datestamp(datestamp, cur_result->timestamp)) &&
+          (!level || *level== '\0' || match_level(level, level_str)) &&
           (!ok || !strcmp(cur_result->status, "OK"))){
 
            find_result_t *curmatch = alloc(SIZEOF(find_result_t));
            memcpy(curmatch, cur_result, SIZEOF(find_result_t));
 
-/*
+           curmatch->timestamp = stralloc(cur_result->timestamp);
            curmatch->hostname = stralloc(cur_result->hostname);
            curmatch->diskname = stralloc(cur_result->diskname);
-           curmatch->datestamp = stralloc(cur_result->datestamp);
-           curmatch->partnum = stralloc(cur_result->partnum);
+           curmatch->level = cur_result->level;
+           curmatch->label = stralloc(cur_result->label);
+           curmatch->filenum = cur_result->filenum;
            curmatch->status = stralloc(cur_result->status);
-           curmatch->level = stralloc(cur_result->level);
-*/         
+           curmatch->partnum = stralloc(cur_result->partnum);
+
            curmatch->next = matches;
            matches = curmatch;
        }
index e3f76c1ad764dbb04bb9baf15111d3762bb2c330..2fd5ed673c518ecf5eedad0ca4130a132e63f800 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "diskfile.h"
 
-#define DEFAULT_SORT_ORDER      "hkdlpb"
+#define DEFAULT_SORT_ORDER      "hkdlpbf"
 
 typedef struct find_result_s {
     struct find_result_s *next;
@@ -18,11 +18,43 @@ typedef struct find_result_s {
     void *user_ptr;
 } find_result_t;
 
-find_result_t *find_dump(int dyna_disklist, disklist_t* diskqp);
+/* Finds /all/ dumps still on a volume. If diskqp is not NULL, then dumps
+ * not matching any existing disklist entry will be added to diskqp and to
+ * the global disklist. If diskqp is NULL, disks not matching existing
+ * disklist entries will be skipped. See search_logfile below, which does
+ * the dirty work for find_dump. */
+find_result_t *find_dump(disklist_t* diskqp);
+
+/* Return a list of unqualified filenames of logfiles for active
+ * tapes.  Filenames are relative to the logdir.
+ *
+ * @returns: dynamically allocated, null-terminated strv
+ */
 char **find_log(void);
+
 void sort_find_result(char *sort_order, find_result_t **output_find);
 void print_find_result(find_result_t *output_find);
 void free_find_result(find_result_t **output_find);
-find_result_t *dump_exist(find_result_t *output_find, char *hostname, char *diskname, char *datestamp, int level);
-find_result_t *dumps_match(find_result_t *output_find, char *hostname, char *diskname, char *datestamp, char *level, int ok);
+find_result_t *dump_exist(find_result_t *output_find, char *hostname,
+                          char *diskname, char *datestamp, int level);
+find_result_t *dumps_match(find_result_t *output_find, char *hostname,
+                           char *diskname, char *datestamp, char *level,
+                           int ok);
+
+/* This function looks in a particular log.xxx file for dumps. Returns TRUE
+ * if something was found. This function also skips dumps whose disklist
+ * entries are not marked 'todo'.
+ * * output_find      : Put found dumps here.
+ * * volume_label     : If not NULL, restrict the search to
+ *                      dumps matching the given volume details.
+ * * log_datestamp    : If not NULL, checks that this logfile is from this time.
+ * * logfile          : Name of logfile in config dir.
+ * * dynamic_disklist : If not NULL, adds disks not already in the global
+ *                      disklist to the given disklist (and the global one).
+ *                      If dynamic_disklist is NULL, skips disks not in the
+ *                      global disklist.
+ */
+gboolean search_logfile(find_result_t **output_find, const char *volume_label,
+                        const char *log_datestamp, const char *logfile,
+                        disklist_t * dynamic_disklist);
 #endif /* !FIND_H */
index 9d8394daa72ab298d544557b083176752df4ae8a..fb90b37afb0150863f3dc9a7a0b3288c53fa3b78 100644 (file)
@@ -40,8 +40,8 @@ int main(int argc, char **argv);
  * HOSTNAME_INSTANCE may not be defined at this point.
  * We define it locally if it is needed...
  *
- * If CLIENT_HOST_PRINCIPLE is defined as HOSTNAME_INSTANCE
- * then local host is the client host principle.
+ * If CLIENT_HOST_PRINCIPAL is defined as HOSTNAME_INSTANCE
+ * then local host is the client host principal.
  */
 #ifndef HOSTNAME_INSTANCE
 #  define HOSTNAME_INSTANCE "localhost"
@@ -62,10 +62,13 @@ static struct build_info {
     { "bindir",                                bindir },
     { "sbindir",                       sbindir },
     { "libexecdir",                    libexecdir },
+    { "amlibexecdir",                  amlibexecdir },
     { "mandir",                                mandir },
     { "AMANDA_TMPDIR",                 AMANDA_TMPDIR },
     { "CONFIG_DIR",                    CONFIG_DIR },
+#ifdef MAILER
     { "MAILER",                                MAILER },
+#endif
     { "DEFAULT_SERVER",                        DEFAULT_SERVER },
     { "DEFAULT_CONFIG",                        DEFAULT_CONFIG },
     { "DEFAULT_TAPE_SERVER",           DEFAULT_TAPE_SERVER },
@@ -221,13 +224,6 @@ static struct build_info {
        "1"
 #else
        NULL
-#endif
-    },
-    { "AIX_TAPEIO",
-#if defined(AIX_TAPEIO)
-       "1"
-#else
-       NULL
 #endif
     },
     { "DUMP_RETURNS_1",
@@ -278,13 +274,6 @@ static struct build_info {
        "1"
 #else
        NULL
-#endif
-    },
-    { "DEBUG_CODE",
-#if defined(DEBUG_CODE)
-       "1"
-#else
-       NULL
 #endif
     },
     { "BSD_SECURITY",
@@ -308,8 +297,8 @@ static struct build_info {
        NULL
 #endif
     },
-    { "FORCE_USERID",
-#if defined(FORCE_USERID)
+    { "CHECK_USERID",
+#if defined(CHECK_USERID)
        "1"
 #else
        NULL
@@ -337,9 +326,16 @@ static struct build_info {
        NULL
 #endif
     },
-    { "SERVER_HOST_PRINCIPLE",
+    { "SERVER_HOST_PRINCIPAL",
 #if defined(KRB4_SECURITY)
-       SERVER_HOST_PRINCIPLE
+       SERVER_HOST_PRINCIPAL
+#else
+       NULL
+#endif
+    },
+    { "SERVER_HOST_PRINCIPLE", /* backward-compatibility (spelling error) */
+#if defined(KRB4_SECURITY)
+       SERVER_HOST_PRINCIPAL
 #else
        NULL
 #endif
@@ -358,9 +354,16 @@ static struct build_info {
        NULL
 #endif
     },
-    { "CLIENT_HOST_PRINCIPLE",
+    { "CLIENT_HOST_PRINCIPAL",
+#if defined(KRB4_SECURITY)
+       CLIENT_HOST_PRINCIPAL
+#else
+       NULL
+#endif
+    },
+    { "CLIENT_HOST_PRINCIPLE", /* backward-compatibility (spelling error) */
 #if defined(KRB4_SECURITY)
-       CLIENT_HOST_PRINCIPLE
+       CLIENT_HOST_PRINCIPAL
 #else
        NULL
 #endif
@@ -417,29 +420,32 @@ main(
     int                argc,
     char **    argv)
 {
-    char *result;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
-    char *pgm;
-    char *conffile;
-    char *parmname;
+    char *result = NULL;
+    char *pgm = NULL;
+    char *parmname = NULL;
     int i;
     int asklist;
     char number[NUM_STR_SIZE];
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     int myarg;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+    gboolean cfg_ok;
 
-    safe_fd(-1, 0);
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+    safe_fd(-1, 0);
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if((pgm = strrchr(my_argv[0], '/')) == NULL) {
-       pgm = my_argv[0];
+    if((pgm = strrchr(argv[0], '/')) == NULL) {
+       pgm = argv[0];
     } else {
        pgm++;
     }
@@ -448,44 +454,41 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    if(my_argc < 2) {
-       fprintf(stderr, "Usage: %s [config] [--list] <parmname> [-o configoption]*\n", pgm);
+    if(argc < 2) {
+       g_fprintf(stderr, _("Usage: %s [config] [--list] <parmname> [-o configoption]*\n"), pgm);
        exit(1);
     }
 
     asklist = 0;
     myarg = 1;
-    if (strcmp(my_argv[1],"--list") == 0) {
+    if (strcmp(argv[1],"--list") == 0) {
        asklist = 1;
        myarg = 2;
-    } else if (my_argc > 2 && strcmp(my_argv[2],"--list") == 0) {
+    } else if (argc > 2 && strcmp(argv[2],"--list") == 0) {
        asklist = 1;
        myarg = 3;
-    } else if (my_argc > 2) {
+    } else if (argc > 2) {
        myarg = 2;
     }
 
-    if (myarg > asklist+1) {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    } else {
-       char my_cwd[STR_SIZE];
+    if (myarg > asklist + 1)
+       cfg_opt = argv[1];
 
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    }
-    if (myarg >= my_argc) {
-       error("Must specify a parameter");
+    if (myarg >= argc) {
+       error(_("Must specify a parameter"));
     }
-    parmname = my_argv[myarg];
+    parmname = argv[myarg];
+
+    /* do the config_init() now, although the result isn't checked until the end,
+     * when we try to look up config parameters */
+    cfg_ok = config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD, cfg_opt);
+    if (cfg_ok) apply_config_overwrites(cfg_ovr);
+
+    safe_cd(); /* call this *after* config_init() */
 
-    safe_cd();
+    /* Note that we dont use check_running_as(..) here, because we may not have a configuration
+     * (e.g., when we're examining build parameters).  If folks run this as the wrong user, that's
+     * their own problem. */
 
     /*
      * Fill in the build values that need runtime help.
@@ -496,14 +499,14 @@ main(
 #else
     i = -1;
 #endif
-    snprintf(number, SIZEOF(number), "%ld", (long)i);
+    g_snprintf(number, SIZEOF(number), "%ld", (long)i);
     build_info[1].value = stralloc(number);
 #if defined(KRB4_SECURITY)
     i = TICKET_LIFETIME;
 #else
     i = -1;
 #endif
-    snprintf(number, SIZEOF(number), "%ld", (long)i);
+    g_snprintf(number, SIZEOF(number), "%ld", (long)i);
     build_info[2].value = stralloc(number);
 
 #undef p
@@ -560,7 +563,7 @@ main(
 
        t = stralloc(parmname + SIZEOF(p) - 1);
        if((dbname = strchr(t, ':')) == NULL) {
-           error("cannot parse %s", parmname);
+           error(_("cannot parse %s"), parmname);
            /*NOTREACHED*/
        }
        *dbname++ = '\0';
@@ -577,23 +580,40 @@ main(
        amfree(t);
 
     } else {
-       conffile = stralloc2(config_dir, CONFFILE_NAME);
-       if(read_conffile(conffile)) {
-           error("errors processing config file \"%s\"", conffile);
-           /*NOTREACHED*/
+       /* *now* we check the result of config_init */
+       if (!cfg_ok) {
+           if (cfg_opt) {
+               error(_("errors processing conf file \"%s\""), cfg_opt);
+               /*NOTREACHED*/
+           } else {
+               error(_("errors processing conf file in current directory."));
+               /*NOTREACHED*/
+           }
        }
-       amfree(conffile);
+
        dbrename(config_name, DBG_SUBDIR_SERVER);
-       report_bad_conf_arg();
        if (asklist) {
-           result = getconf_list(parmname);
+           GSList *list = getconf_list(parmname);
+           GSList *iter;
+           result = stralloc("");
+
+           for (iter = list; iter != NULL; iter = iter->next) {
+               result = newvstralloc(result, result, iter->data, "\n", NULL);
+           }
+
+           g_slist_free(list);
        } else {
-           result = getconf_byname(parmname);
+           val_t *val = getconf_byname(parmname);
+           if (val) {
+               char **dispstrs = val_t_display_strs(val, FALSE);
+               result = g_strjoinv("\n", dispstrs);
+               g_strfreev(dispstrs);
+           }
        }
     }
 
     if (result == NULL) {
-       fprintf(stderr, "%s: no such parameter \"%s\"\n",
+       g_fprintf(stderr, _("%s: no such parameter \"%s\"\n"),
                get_pname(), parmname);
        fflush(stderr);
     } else {
@@ -603,20 +623,10 @@ main(
            puts(result); /* add a '\n' */
     }
 
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     amfree(result);
-    amfree(config_dir);
-    amfree(config_name);
     for(i = 0; i < 3; i++) {
        amfree(build_info[i].value);
     }
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     return 0;
 }
index 7d9ee32362c3ebf481ae1bd676b3f8eecff6ac99..e6a5f6626f840c98fa58729c8be134eeb2fba503 100644 (file)
  */
 static int is_dir(char *fname);
 
+/* Is fname an empty file?
+ *
+ * @param fname: filename (fully qualified)
+ * @returns: boolean
+ */
+static int is_emptyfile(char *fname);
+
 /* sanity check that datestamp is of the form YYYYMMDD or 
  * YYYYMMDDhhmmss
  *
@@ -53,10 +60,6 @@ static int is_dir(char *fname);
  */
 static int is_datestr(char *fname);
 
-/*
- * Static variables */
-static int verbose = 0;
-
 /*
  * Static functions */
 
@@ -131,151 +134,124 @@ is_datestr(
 }
 
 /*
- * Verbosity
+ * Recursion functions
+ *
+ * These implement a general-purpose walk down the holding-* hierarchy.
  */
-int
-holding_set_verbosity(int v)
-{
-    int old = verbose;
-    verbose = v;
-    return old;
-}
 
-/*
- * Holding directories
+/* Perform a custom action for this holding element (disk, dir, file, chunk).
+ *
+ * If the element is not cruft, the next step into the tree will only take place 
+ * if this function returns a nonzero value.
+ *
+ * The walk is depth-first, with the callback for an element invoked
+ * before entering that element.  Callbacks may depend on this behavior.
+ *
+ * @param datap: generic user-data pointer
+ * @param base: the parent of the element being examined, or NULL for 
+ * holding disks
+ * @param element: the name of the element being examined
+ * @param fqpath: fully qualified path to 'element'
+ * @param is_cruft: nonzero if this element doesn't belong here
+ * @returns: nonzero if the walk should descend into this element.
  */
-
-static void
-holding_get_directories_per_disk(
-    char *hdisk,
-    sl_t *date_list,
-    int fullpaths,
-    sl_t *rv)
+typedef int (*holding_walk_fn)(
+    gpointer datap,
+    char *base,
+    char *element,
+    char *fqpath,
+    int is_cruft);
+
+typedef enum {
+    STOP_AT_DISK,
+    STOP_AT_DIR,
+    STOP_AT_FILE,
+    STOP_AT_CHUNK
+} stop_at_t;
+
+/* Recurse over all holding chunks in a holding file.
+ *
+ * Call per_chunk_fn for each chunk of the given file
+ *
+ * datap is passed, unchanged, to all holding_walk_fns.
+ *
+ * @param hfile: holding file to examine (fully qualified path)
+ * @param datap: generic user-data pointer
+ * @param per_chunk_fn: function to call for each holding chunk
+ */
+static void holding_walk_file(
+    char *hfile,
+    gpointer datap,
+    holding_walk_fn per_chunk_fn)
 {
-    DIR *dir;
-    struct dirent *workdir;
-    char *hdir = NULL;
-    sle_t *dl;
-    int date_found;
-
-    if ((dir = opendir(hdisk)) == NULL) {
-        if (verbose && errno != ENOENT)
-           printf(_("Warning: could not open holding disk %s: %s\n"),
-                  hdisk, strerror(errno));
-        return;
-    }
-
-    if (verbose)
-        printf(_("Scanning %s...\n"), hdisk);
-
-    while ((workdir = readdir(dir)) != NULL) {
-        if (is_dot_or_dotdot(workdir->d_name))
-            continue;
+    dumpfile_t file;
+    char *filename = NULL;
 
-        if(verbose) 
-            printf("  %s: ", workdir->d_name);
-            
-        hdir = newvstralloc(hdir,
-                     hdisk, "/", workdir->d_name,
-                     NULL);
+    /* Loop through all cont_filenames (subsequent chunks) */
+    filename = stralloc(hfile);
+    while (filename != NULL && filename[0] != '\0') {
+       int is_cruft = 0;
 
-        /* filter out various undesirables */
-        if (!is_dir(hdir)) {
-            if (verbose)
-                puts(_("skipping cruft file, perhaps you should delete it."));
-        } else if (!is_datestr(workdir->d_name)) {
-            /* EXT2/3 leave these in the root of each volume */
-            if (strcmp(workdir->d_name, "lost+found")==0)
-                puts(_("skipping system directory"));
-            if (verbose)
-                puts(_("skipping cruft directory, perhaps you should delete it."));
-        } else {
-            /* found a holding directory -- keep it */
-           if (date_list) {
-               date_found = 0;
-               for (dl= date_list->first; dl != NULL; dl = dl->next) {
-                   if (strcmp(dl->name, workdir->d_name) == 0) {
-                       date_found = 1;
-                       break;
-                   }
-               }
-           } else {
-               date_found = 1;
-           }
-           if (date_found == 1) {
-               if (fullpaths)
-                    rv = insert_sort_sl(rv, hdir);
-               else
-                    rv = insert_sort_sl(rv, workdir->d_name);
-               if (verbose) {
-                    puts(_("found Amanda directory."));
-               }
-           }
+        /* get the header to look for cont_filename */
+        if (!holding_file_get_dumpfile(filename, &file)) {
+           is_cruft = 1;
         }
-    }
-
-    if (hdir) amfree(hdir);
-}
-
 
-sl_t *
-holding_get_directories(
-    char *hdisk,
-    sl_t *date_list,
-    int fullpaths)
-{
-    holdingdisk_t *hdisk_conf;
-    sl_t *rv;
-
-    rv = new_sl();
-    if (!rv) {
-        return NULL;
+       if (per_chunk_fn) 
+           per_chunk_fn(datap, 
+                       hfile, 
+                       filename, 
+                       filename, 
+                       is_cruft);
+       amfree(filename);
+
+        /* and go on to the next chunk if this wasn't cruft */
+       if (!is_cruft)
+           filename = stralloc(file.cont_filename);
     }
 
-    /* call _per_disk for the hdisk we were given, or for all
-     * hdisks if we were given NULL */
-    if (hdisk) {
-        holding_get_directories_per_disk(hdisk, date_list, fullpaths, rv);
-    } else {
-        for (hdisk_conf = getconf_holdingdisks(); 
-                    hdisk_conf != NULL;
-                    hdisk_conf = hdisk_conf->next) {
-            hdisk = holdingdisk_get_diskdir(hdisk_conf);
-            holding_get_directories_per_disk(hdisk, date_list, fullpaths, rv);
-        }
-    }
-
-    return rv;
+    amfree(filename);
 }
 
-/*
- * Holding files
+/* Recurse over all holding files in a holding directory.
+ *
+ * Call per_file_fn for each file, and so on, stopping at the level given by 
+ * stop_at.
+ *
+ * datap is passed, unchanged, to all holding_walk_fns.
+ *
+ * @param hdir: holding directory to examine (fully qualified path)
+ * @param datap: generic user-data pointer
+ * @param stop_at: do not proceed beyond this level of the hierarchy
+ * @param per_file_fn: function to call for each holding file
+ * @param per_chunk_fn: function to call for each holding chunk
  */
-static void
-holding_get_files_per_dir(
+static void holding_walk_dir(
     char *hdir,
-    int fullpaths,
-    sl_t *rv)
+    gpointer datap,
+    stop_at_t stop_at,
+    holding_walk_fn per_file_fn,
+    holding_walk_fn per_chunk_fn)
 {
     DIR *dir;
     struct dirent *workdir;
     char *hfile = NULL;
     dumpfile_t dumpf;
     int dumpf_ok;
+    int proceed = 1;
 
     if ((dir = opendir(hdir)) == NULL) {
-        if (verbose && errno != ENOENT)
-           printf(_("Warning: could not open holding dir %s: %s\n"),
+        if (errno != ENOENT)
+           dbprintf(_("Warning: could not open holding dir %s: %s\n"),
                   hdir, strerror(errno));
         return;
     }
 
-    if (verbose)
-        printf(_("Scanning %s...\n"), hdir);
-
     while ((workdir = readdir(dir)) != NULL) {
+       int is_cruft = 0;
+
         if (is_dot_or_dotdot(workdir->d_name))
-            continue;
+            continue; /* expected cruft */
 
         hfile = newvstralloc(hfile,
                      hdir, "/", workdir->d_name,
@@ -283,175 +259,331 @@ holding_get_files_per_dir(
 
         /* filter out various undesirables */
         if (is_emptyfile(hfile))
-            continue;
+            is_cruft = 1;
 
         if (is_dir(hfile)) {
-            if (verbose)
-                printf(_("%s: ignoring directory\n"), hfile);
-            continue;
+            is_cruft= 1;
         }
 
         if (!(dumpf_ok=holding_file_get_dumpfile(hfile, &dumpf)) ||
             dumpf.type != F_DUMPFILE) {
             if (dumpf_ok && dumpf.type == F_CONT_DUMPFILE)
                 continue; /* silently skip expected file */
-            if (verbose)
-                printf(_("%s: not a dumpfile\n"), hfile);
-            continue;
+
+            is_cruft = 1;
         }
 
        if (dumpf.dumplevel < 0 || dumpf.dumplevel > 9) {
-            if (verbose)
-                printf(_("%s: ignoring file with bogus dump level %d.\n"),
-                       hfile, dumpf.dumplevel);
-           continue;
+           is_cruft = 1;
        }
 
-        /* found a holding file -- keep it */
-        if (fullpaths)
-            rv = insert_sort_sl(rv, hfile);
-        else
-            rv = insert_sort_sl(rv, workdir->d_name);
+       if (per_file_fn) 
+           proceed = per_file_fn(datap, 
+                       hdir, 
+                       workdir->d_name, 
+                       hfile, 
+                       is_cruft);
+       if (!is_cruft && proceed && stop_at != STOP_AT_FILE)
+           holding_walk_file(hfile,
+                   datap,
+                   per_chunk_fn);
+    }
+
+    closedir(dir);
+    amfree(hfile);
+}
+
+/* Recurse over all holding directories in a holding disk.
+ *
+ * Call per_dir_fn for each dir, and so on, stopping at the level given by 
+ * stop_at.
+ *
+ * datap is passed, unchanged, to all holding_walk_fns.
+ *
+ * @param hdisk: holding disk to examine (fully qualified path)
+ * @param datap: generic user-data pointer
+ * @param stop_at: do not proceed beyond this level of the hierarchy
+ * @param per_dir_fn: function to call for each holding dir
+ * @param per_file_fn: function to call for each holding file
+ * @param per_chunk_fn: function to call for each holding chunk
+ */
+static void 
+holding_walk_disk(
+    char *hdisk,
+    gpointer datap,
+    stop_at_t stop_at,
+    holding_walk_fn per_dir_fn,
+    holding_walk_fn per_file_fn,
+    holding_walk_fn per_chunk_fn)
+{
+    DIR *dir;
+    struct dirent *workdir;
+    char *hdir = NULL;
+    int proceed = 1;
+
+    if ((dir = opendir(hdisk)) == NULL) {
+        if (errno != ENOENT)
+           dbprintf(_("Warning: could not open holding disk %s: %s\n"),
+                  hdisk, strerror(errno));
+        return;
+    }
+
+    while ((workdir = readdir(dir)) != NULL) {
+       int is_cruft = 0;
+
+        if (is_dot_or_dotdot(workdir->d_name))
+            continue; /* expected cruft */
+
+        hdir = newvstralloc(hdir,
+                     hdisk, "/", workdir->d_name,
+                     NULL);
+
+        /* detect cruft */
+        if (!is_dir(hdir)) {
+           is_cruft = 1;
+        } else if (!is_datestr(workdir->d_name)) {
+            /* EXT2/3 leave these in the root of each volume */
+            if (strcmp(workdir->d_name, "lost+found") == 0)
+               continue; /* expected cruft */
+           else
+               is_cruft = 1; /* unexpected */
+        }
+
+       if (per_dir_fn) 
+           proceed = per_dir_fn(datap, 
+                       hdisk, 
+                       workdir->d_name, 
+                       hdir, 
+                       is_cruft);
+       if (!is_cruft && proceed && stop_at != STOP_AT_DIR)
+           holding_walk_dir(hdir,
+                   datap,
+                   stop_at,
+                   per_file_fn,
+                   per_chunk_fn);
     }
 
-    if (hfile) amfree(hfile);
+    closedir(dir);
+    amfree(hdir);
+}
+
+/* Recurse over all holding disks.
+ *
+ * Call per_disk_fn for each disk, per_dir_fn for each dir, and so on, stopping
+ * at the level given by stop_at.
+ *
+ * datap is passed, unchanged, to all holding_walk_fns.
+ *
+ * @param datap: generic user-data pointer
+ * @param stop_at: do not proceed beyond this level of the hierarchy
+ * @param per_disk_fn: function to call for each holding disk
+ * @param per_dir_fn: function to call for each holding dir
+ * @param per_file_fn: function to call for each holding file
+ * @param per_chunk_fn: function to call for each holding chunk
+ */
+static void 
+holding_walk(
+    gpointer datap,
+    stop_at_t stop_at,
+    holding_walk_fn per_disk_fn,
+    holding_walk_fn per_dir_fn,
+    holding_walk_fn per_file_fn,
+    holding_walk_fn per_chunk_fn)
+{
+    holdingdisk_t *hdisk_conf;
+    char *hdisk;
+    int proceed = 1;
+
+    for (hdisk_conf = getconf_holdingdisks(); 
+               hdisk_conf != NULL;
+               hdisk_conf = holdingdisk_next(hdisk_conf)) {
+       int is_cruft = 0;
+
+       hdisk = holdingdisk_get_diskdir(hdisk_conf);
+       if (!is_dir(hdisk))
+           is_cruft = 1;
+
+       if (per_disk_fn) 
+           proceed = per_disk_fn(datap, 
+                       NULL, 
+                       hdisk, 
+                       hdisk, 
+                       0);
+       if (proceed && stop_at != STOP_AT_DISK)
+           holding_walk_disk(hdisk,
+                   datap,
+                   stop_at,
+                   per_dir_fn,
+                   per_file_fn,
+                   per_chunk_fn);
+    }
+}
+
+/*
+ * holding_get_* functions
+ */
+typedef struct {
+    GSList *result;
+    int fullpaths;
+} holding_get_datap_t;
+
+/* Functor for holding_get_*; adds 'element' or 'fqpath' to
+ * the result.
+ */
+static int
+holding_get_walk_fn(
+    gpointer datap,
+    G_GNUC_UNUSED char *base,
+    char *element,
+    char *fqpath,
+    int is_cruft)
+{
+    holding_get_datap_t *data = (holding_get_datap_t *)datap;
+
+    /* ignore cruft */
+    if (is_cruft) return 0;
+
+    if (data->fullpaths)
+       data->result = g_slist_insert_sorted(data->result,
+               stralloc(fqpath), 
+               g_compare_strings);
+    else
+       data->result = g_slist_insert_sorted(data->result, 
+               stralloc(element), 
+               g_compare_strings);
+
+    /* don't proceed any deeper */
+    return 0;
+}
+
+GSList *
+holding_get_disks(void)
+{
+    holding_get_datap_t data;
+    data.result = NULL;
+    data.fullpaths = 1; /* ignored anyway */
+
+    holding_walk((gpointer)&data,
+       STOP_AT_DISK,
+       holding_get_walk_fn, NULL, NULL, NULL);
+
+    return data.result;
 }
 
-sl_t *
+GSList *
 holding_get_files(
     char *hdir,
-    sl_t *date_list,
     int fullpaths)
 {
-    sl_t *hdirs;
-    sle_t *e;
-    sl_t *rv;
-
-    rv = new_sl();
-    if (!rv) {
-        return NULL;
-    }
+    holding_get_datap_t data;
+    data.result = NULL;
+    data.fullpaths = fullpaths;
 
-    /* call _per_dir for the hdir we were given, or for all
-     * hdir if we were given NULL */
     if (hdir) {
-        holding_get_files_per_dir(hdir, fullpaths, rv);
+        holding_walk_dir(hdir, (gpointer)&data,
+           STOP_AT_FILE,
+           holding_get_walk_fn, NULL);
     } else {
-        hdirs = holding_get_directories(NULL, date_list, 1);
-        for (e = hdirs->first; e != NULL; e = e->next) {
-            holding_get_files_per_dir(e->name, fullpaths, rv);
-        }
+        holding_walk((gpointer)&data,
+           STOP_AT_FILE,
+           NULL, NULL, holding_get_walk_fn, NULL);
     }
 
-    return rv;
+    return data.result;
+}
+
+GSList *
+holding_get_file_chunks(char *hfile)
+{
+    holding_get_datap_t data;
+    data.result = NULL;
+
+    holding_walk_file(hfile, (gpointer)&data,
+       holding_get_walk_fn);
+
+    return data.result;
 }
 
-sl_t *
+GSList *
 holding_get_files_for_flush(
-    sl_t *dateargs,
-    int interactive)
+    GSList *dateargs)
 {
-    sl_t *date_list;
-    sl_t *file_list;
-    sl_t *result_list;
-    sle_t *datearg;
-    sle_t *date, *next_date;
-    sle_t *file_elt;
+    GSList *file_list, *file_elt;
+    GSList *date;
+    int date_matches;
     disk_t *dp;
-    char *host;
-    char *disk;
-    char *datestamp;
-    filetype_t filetype;
-
-    /* make date_list the intersection of available holding directories and
-     * the dateargs parameter.  */
-    if (dateargs) {
-        int ok;
-
-        date_list = pick_all_datestamp(verbose);
-        for (date = date_list->first; date != NULL;) {
-            next_date = date->next;
-            ok = 0;
-            for(datearg=dateargs->first; datearg != NULL && ok==0;
-                datearg = datearg->next) {
-                ok = match_datestamp(datearg->name, date->name);
-            }
-            if(ok == 0) { /* remove dir */
-                remove_sl(date_list, date);
-            }
-            date = next_date;
-        }
-    }
-    else {
-        /* no date args were provided, so use everything */
-        if (interactive)
-            date_list = pick_datestamp(verbose);
-        else
-            date_list = pick_all_datestamp(verbose);
-    }
-
-    result_list = new_sl();
-    if (!result_list) {
-        return NULL;
-    }
+    dumpfile_t file;
+    GSList *result_list = NULL;
 
-    /* loop over *all* files, checking each one */
-    file_list = holding_get_files(NULL, date_list, 1);
-    for (file_elt = file_list->first; file_elt != NULL; file_elt = file_elt->next) {
+    /* loop over *all* files, checking each one's datestamp against the expressions
+     * in dateargs */
+    file_list = holding_get_files(NULL, 1);
+    for (file_elt = file_list; file_elt != NULL; file_elt = file_elt->next) {
         /* get info on that file */
-        filetype = holding_file_read_header(file_elt->name, &host, &disk, NULL, &datestamp);
-        if (filetype != F_DUMPFILE)
+       if (!holding_file_get_dumpfile((char *)file_elt->data, &file))
+           continue;
+
+        if (file.type != F_DUMPFILE)
+            continue;
+
+       if (dateargs) {
+           date_matches = 0;
+           /* loop over date args, until we find a match */
+           for (date = dateargs; date !=NULL; date = date->next) {
+               if (strcmp((char *)date->data, file.datestamp) == 0) {
+                   date_matches = 1;
+                   break;
+               }
+           }
+       } else {
+           /* if no date list was provided, then all dates match */
+           date_matches = 1;
+       }
+        if (!date_matches)
             continue;
 
         /* check that the hostname and disk are in the disklist */
-        dp = lookup_disk(host, disk);
+        dp = lookup_disk(file.name, file.disk);
         if (dp == NULL) {
-            if (verbose)
-               printf(_("%s: disk %s:%s not in database, skipping it."),
-                        file_elt->name, host, disk);
+           dbprintf(_("%s: disk %s:%s not in database, skipping it."),
+                        (char *)file_elt->data, file.name, file.disk);
             continue;
         }
 
         /* passed all tests -- we'll flush this file */
-        result_list = insert_sort_sl(result_list, file_elt->name);
+        result_list = g_slist_insert_sorted(result_list, 
+           stralloc(file_elt->data), 
+           g_compare_strings);
     }
 
-    if (date_list) free_sl(date_list);
-    if (file_list) free_sl(file_list);
+    if (file_list) g_slist_free_full(file_list);
 
     return result_list;
 }
 
-sl_t *
-holding_get_file_chunks(char *hfile)
+GSList *
+holding_get_all_datestamps(void)
 {
-    dumpfile_t file;
-    char *filename;
-    sl_t *rv = new_sl();
-
-    if (!rv) {
-        return NULL;
+    GSList *all_files, *file;
+    GSList *datestamps = NULL;
+
+    /* enumerate all files */
+    all_files = holding_get_files(NULL, 1);
+    for (file = all_files; file != NULL; file = file->next) {
+       dumpfile_t dfile;
+       if (!holding_file_get_dumpfile((char *)file->data, &dfile))
+           continue;
+       if (!g_slist_find_custom(datestamps, dfile.datestamp,
+                                g_compare_strings)) {
+           datestamps = g_slist_insert_sorted(datestamps, 
+                                              stralloc(dfile.datestamp), 
+                                              g_compare_strings);
+       }
     }
 
-    /* Loop through all cont_filenames (subsequent chunks) */
-    filename = stralloc(hfile);
-    while (filename != NULL && filename[0] != '\0') {
-        /* get the header to look for cont_filename */
-        if (!holding_file_get_dumpfile(filename, &file)) {
-            if (verbose)
-                printf(_("holding_get_file_chunks: open of %s failed.\n"), filename);
-            amfree(filename);
-            return rv;
-        }
-
-        /* add the file to the results */
-        insert_sort_sl(rv, filename);
+    g_slist_free_full(all_files);
 
-        /* and go on to the next chunk */
-        filename = newstralloc(filename, file.cont_filename);
-    }
-    amfree(filename);
-    return rv;
+    return datestamps;
 }
 
 off_t
@@ -472,8 +604,7 @@ holding_file_size(
     while (filename != NULL && filename[0] != '\0') {
         /* stat the file for its size */
         if (stat(filename, &finfo) == -1) {
-            if (verbose)
-                printf(_("stat %s: %s\n"), filename, strerror(errno));
+           dbprintf(_("stat %s: %s\n"), filename, strerror(errno));
             return (off_t)-1;
         }
         size += (finfo.st_size+(off_t)1023)/(off_t)1024;
@@ -482,8 +613,7 @@ holding_file_size(
 
         /* get the header to look for cont_filename */
         if (!holding_file_get_dumpfile(filename, &file)) {
-            if (verbose)
-                printf(_("holding_file_size: open of %s failed.\n"), filename);
+           dbprintf(_("holding_file_size: open of %s failed.\n"), filename);
             amfree(filename);
             return (off_t)-1;
         }
@@ -500,56 +630,23 @@ int
 holding_file_unlink(
     char *hfile)
 {
-    sl_t *chunklist;
-    sle_t *chunk;
+    GSList *chunklist;
+    GSList *chunk;
 
     chunklist = holding_get_file_chunks(hfile);
     if (!chunklist)
         return 0;
 
-    for (chunk = chunklist->first; chunk != NULL; chunk = chunk->next) {
-        if (unlink(chunk->name)<0) {
-            if (verbose)
-                printf(_("holding_file_unlink: could not unlink %s: %s\n"),
-                    chunk->name, strerror(errno));
+    for (chunk = chunklist; chunk != NULL; chunk = chunk->next) {
+        if (unlink((char *)chunk->data)<0) {
+           dbprintf(_("holding_file_unlink: could not unlink %s: %s\n"),
+                    (char *)chunk->data, strerror(errno));
             return 0;
         }
     }
-
     return 1;
 }
 
-filetype_t
-holding_file_read_header( 
-    char *     fname,
-    char **    hostname,
-    char **    diskname,
-    int *      level,
-    char ** datestamp)
-{
-    dumpfile_t file;
-
-    if (hostname) *hostname = NULL;
-    if (diskname) *diskname = NULL;
-    if (datestamp) *datestamp = NULL;
-
-    if (!holding_file_get_dumpfile(fname, &file)) {
-        return F_UNKNOWN;
-    }
-
-    if(file.type != F_DUMPFILE && file.type != F_CONT_DUMPFILE) {
-        return file.type;
-    }
-
-    if (hostname) *hostname = stralloc(file.name);
-    if (diskname) *diskname = stralloc(file.disk);
-    if (level) *level = file.dumplevel;
-    if (datestamp) *datestamp = stralloc(file.datestamp);
-
-    return file.type;
-}
-
-
 int
 holding_file_get_dumpfile(
     char *     fname,
@@ -562,7 +659,7 @@ holding_file_get_dumpfile(
 
     fh_init(file);
     file->type = F_UNKNOWN;
-    if((fd = open(fname, O_RDONLY)) == -1)
+    if((fd = robust_open(fname, O_RDONLY, 0)) == -1)
         return 0;
 
     if(fullread(fd, buffer, SIZEOF(buffer)) != (ssize_t)sizeof(buffer)) {
@@ -576,101 +673,168 @@ holding_file_get_dumpfile(
 }
 
 /*
- * Interactive functions 
+ * Cleanup
  */
 
-sl_t *
-pick_all_datestamp(
-    int        v)
+typedef struct {
+    corrupt_dle_fn corrupt_dle;
+    FILE *verbose_output;
+} holding_cleanup_datap_t;
+
+static int
+holding_cleanup_disk(
+    gpointer datap,
+    G_GNUC_UNUSED char *base,
+    G_GNUC_UNUSED char *element,
+    char *fqpath,
+    int is_cruft)
+{
+    holding_cleanup_datap_t *data = (holding_cleanup_datap_t *)datap;
+
+    if (data->verbose_output) {
+       if (is_cruft)
+           g_fprintf(data->verbose_output, 
+               _("Invalid holding disk '%s'\n"), fqpath);
+       else
+           g_fprintf(data->verbose_output, 
+               _("Cleaning up holding disk '%s'\n"), fqpath);
+    }
+
+    return 1;
+}
+
+static int
+holding_cleanup_dir(
+    gpointer datap,
+    G_GNUC_UNUSED char *base,
+    char *element,
+    char *fqpath,
+    int is_cruft)
 {
-    int old_verbose = holding_set_verbosity(v);
-    sl_t *rv;
+    holding_cleanup_datap_t *data = (holding_cleanup_datap_t *)datap;
 
-    /* get all holding directories, without full paths -- this
-     * will be datestamps only */
-    rv = holding_get_directories(NULL, NULL, 0);
+    if (is_cruft) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("Invalid holding directory '%s'\n"), fqpath);
+       return 0;
+    }
+
+    /* try removing it */
+    if (rmdir(fqpath) == 0) {
+       /* success, so don't try to walk into it */
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output,
+               _(" ..removed empty directory '%s'\n"), element);
+       return 0;
+    }
+
+    if (data->verbose_output)
+       g_fprintf(data->verbose_output, 
+           _(" ..cleaning up holding directory '%s'\n"), element);
 
-    holding_set_verbosity(old_verbose);
-    return rv;
+    return 1;
 }
 
-sl_t *
-pick_datestamp(
-    int                verbose)
+static int
+holding_cleanup_file(
+    gpointer datap,
+    G_GNUC_UNUSED char *base,
+    char *element,
+    char *fqpath,
+    int is_cruft)
 {
-    sl_t *holding_list;
-    sl_t *r_holding_list = NULL;
-    sle_t *dir;
-    char **directories = NULL;
-    int i;
-    char *answer = NULL;
-    char *a = NULL;
-    int ch = 0;
-    char max_char = '\0', chupper = '\0';
-
-    holding_list = pick_all_datestamp(verbose);
-
-    if(holding_list->nb_element == 0) {
-       return holding_list;
+    holding_cleanup_datap_t *data = (holding_cleanup_datap_t *)datap;
+    int stat;
+    int l;
+    dumpfile_t file;
+    disk_t *dp;
+
+    if (is_cruft) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("Invalid holding file '%s'\n"), element);
+       return 0;
     }
-    else if(holding_list->nb_element == 1 || !verbose) {
-       return holding_list;
+
+
+    stat = holding_file_get_dumpfile(fqpath, &file);
+
+    if (!stat) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("Could not read read header from '%s'\n"), element);
+       return 0;
     }
-    else {
-       directories = alloc((holding_list->nb_element) * SIZEOF(char *));
-       for(dir = holding_list->first, i=0; dir != NULL; dir = dir->next,i++) {
-           directories[i] = dir->name;
-       }
 
-       while(1) {
-           puts(_("\nMultiple Amanda directories, please pick one by letter:"));
-           for(dir = holding_list->first, max_char = 'A';
-               dir != NULL && max_char <= 'Z';
-               dir = dir->next, max_char++) {
-               printf("  %c. %s\n", max_char, dir->name);
-           }
-           max_char--;
-           printf(_("Select directories to flush [A..%c]: [ALL] "), max_char);
-           fflush(stdout); fflush(stderr);
-           amfree(answer);
-           if ((answer = agets(stdin)) == NULL) {
-               clearerr(stdin);
-               continue;
-           }
+    if (file.type != F_DUMPFILE && file.type != F_CONT_DUMPFILE) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("File '%s' is not a dump file\n"), element);
+       return 0;
+    }
 
-           if (*answer == '\0' || strncasecmp(answer, "ALL", 3) == 0) {
-               break;
-           }
+    if(file.dumplevel < 0 || file.dumplevel > 9) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("File '%s' has invalid level %d\n"), element, file.dumplevel);
+       return 0;
+    }
 
-           a = answer;
-           while ((ch = *a++) != '\0') {
-               if (!isspace(ch))
-                   break;
-           }
+    dp = lookup_disk(file.name, file.disk);
 
-           do {
-               if (isspace(ch) || ch == ',') {
-                   continue;
-               }
-               chupper = (char)toupper(ch);
-               if (chupper < 'A' || chupper > max_char) {
-                   free_sl(r_holding_list);
-                   r_holding_list = NULL;
-                   break;
-               }
-               r_holding_list = append_sl(r_holding_list,
-                                          directories[chupper - 'A']);
-           } while ((ch = *a++) != '\0');
-           if (r_holding_list && ch == '\0') {
-               free_sl(holding_list);
-               holding_list = r_holding_list;
-               break;
-           }
+    if (dp == NULL) {
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("File '%s' is for '%s:%s', which is not in the disklist\n"), 
+                   element, file.name, file.disk);
+       return 0;
+    }
+
+    if ((l = strlen(element)) >= 7 && strncmp(&fqpath[l-4],".tmp",4) == 0) {
+       char *destname;
+
+       /* generate a name without '.tmp' */
+       destname = stralloc(fqpath);
+       destname[strlen(destname) - 4] = '\0';
+
+       /* OK, it passes muster -- rename it to salvage some data,
+        * and mark the DLE as corrupted */
+       if (data->verbose_output)
+           g_fprintf(data->verbose_output, 
+               _("Processing partial holding file '%s'\n"), element);
+
+       if(rename_tmp_holding(destname, 0)) {
+           if (data->corrupt_dle)
+               data->corrupt_dle(dp->host->hostname, dp->name);
+       } else {
+           dbprintf(_("rename_tmp_holding(%s) failed\n"), destname);
+           if (data->verbose_output)
+               g_fprintf(data->verbose_output, 
+                   _("Rename of '%s' to '%s' failed.\n"), element, destname);
        }
+
+       amfree(destname);
     }
-    amfree(directories);
-    amfree(answer);
-    return holding_list;
+
+    return 1;
+}
+
+void
+holding_cleanup(
+    corrupt_dle_fn corrupt_dle,
+    FILE *verbose_output)
+{
+    holding_cleanup_datap_t data;
+    data.corrupt_dle = corrupt_dle;
+    data.verbose_output = verbose_output;
+
+    holding_walk((gpointer)&data,
+       STOP_AT_FILE,
+       holding_cleanup_disk,
+       holding_cleanup_dir,
+       holding_cleanup_file,
+       NULL);
 }
 
 /*
@@ -693,8 +857,8 @@ rename_tmp_holding(
     filename = stralloc(holding_file);
     while(filename != NULL && filename[0] != '\0') {
        filename_tmp = newvstralloc(filename_tmp, filename, ".tmp", NULL);
-       if((fd = open(filename_tmp,O_RDONLY)) == -1) {
-           fprintf(stderr,_("rename_tmp_holding: open of %s failed: %s\n"),filename_tmp,strerror(errno));
+       if((fd = robust_open(filename_tmp,O_RDONLY, 0)) == -1) {
+           dbprintf(_("rename_tmp_holding: open of %s failed: %s\n"),filename_tmp,strerror(errno));
            amfree(filename);
            amfree(filename_tmp);
            return 0;
@@ -703,21 +867,21 @@ rename_tmp_holding(
        close(fd);
 
        if(rename(filename_tmp, filename) != 0) {
-           fprintf(stderr,
-                   _("rename_tmp_holding: could not rename \"%s\" to \"%s\": %s"),
+           dbprintf(_("rename_tmp_holding: could not rename \"%s\" to \"%s\": %s"),
                    filename_tmp, filename, strerror(errno));
        }
 
        if (buflen <= 0) {
-           fprintf(stderr,_("rename_tmp_holding: %s: empty file?\n"), filename);
+           dbprintf(_("rename_tmp_holding: %s: empty file?\n"), filename);
            amfree(filename);
            amfree(filename_tmp);
            return 0;
        }
        parse_file_header(buffer, &file, (size_t)buflen);
        if(complete == 0 ) {
-           if((fd = open(filename, O_RDWR)) == -1) {
-               fprintf(stderr, _("rename_tmp_holdingX: open of %s failed: %s\n"),
+            char * header;
+           if((fd = robust_open(filename, O_RDWR, 0)) == -1) {
+               dbprintf(_("rename_tmp_holdingX: open of %s failed: %s\n"),
                        filename, strerror(errno));
                amfree(filename);
                amfree(filename_tmp);
@@ -725,8 +889,8 @@ rename_tmp_holding(
 
            }
            file.is_partial = 1;
-           build_header(buffer, &file, SIZEOF(buffer));
-           fullwrite(fd, buffer, SIZEOF(buffer));
+            header = build_header(&file, DISK_BLOCK_BYTES);
+           fullwrite(fd, header, DISK_BLOCK_BYTES);
            close(fd);
        }
        filename = newstralloc(filename, file.cont_filename);
@@ -736,53 +900,6 @@ rename_tmp_holding(
     return 1;
 }
 
-void
-cleanup_holdingdisk(
-    char *     diskdir,
-    int                verbose)
-{
-    DIR *topdir;
-    struct dirent *workdir;
-
-    if((topdir = opendir(diskdir)) == NULL) {
-       if(verbose && errno != ENOENT)
-           printf(_("Warning: could not open holding dir %s: %s\n"),
-                  diskdir, strerror(errno));
-       return;
-   }
-
-    /* find all directories of the right format  */
-
-    if(verbose)
-       printf(_("Scanning %s...\n"), diskdir);
-    if ((chdir(diskdir)) == -1) {
-       log_add(L_INFO, _("%s: could not chdir: %s"),
-                   diskdir, strerror(errno));
-    }
-    while((workdir = readdir(topdir)) != NULL) {
-       if(strcmp(workdir->d_name, ".") == 0
-          || strcmp(workdir->d_name, "..") == 0
-          || strcmp(workdir->d_name, "lost+found") == 0)
-           continue;
-
-       if(verbose)
-           printf("  %s: ", workdir->d_name);
-       if(!is_dir(workdir->d_name)) {
-           if(verbose)
-               puts(_("skipping cruft file, perhaps you should delete it."));
-       }
-       else if(!is_datestr(workdir->d_name)) {
-           if(verbose && (strcmp(workdir->d_name, "lost+found")!=0) )
-               puts(_("skipping cruft directory, perhaps you should delete it."));
-       }
-       else if(rmdir(workdir->d_name) == 0) {
-           if(verbose)
-               puts(_("deleted empty Amanda directory."));
-       }
-     }
-     closedir(topdir);
-}
-
 
 int
 mkholdingdir(
index f01fb6e5d030219a4f0e66fdc2ceb9cfed193255..acebfd048aef6121c9b1a22d2e0e6ada61487ed4 100644 (file)
@@ -29,7 +29,8 @@
  * Terminology:
  *
  * Holding disk: a top-level directory given in amanda.conf
- * Holding directory: a subdirectory of a holding disk, named by datestamp
+ * Holding directory: a subdirectory of a holding disk, usually named by 
+ *  datestamp.  These are not accessible through this API.
  * Holding file: one or more os-level files in a holding directory, together
  *  representing a single dump
  * Holding file chunks: the individual os-level files (continuations) of
@@ -39,7 +40,7 @@
  *
  * /data/holding                                     <-- holding disk
  * /data/holding/200703061234                        <-- holding dir
- * /data/holding/200703061234/videoserver._video_a   <-- holding file, 
+ * /data/holding/200703061234/videoserver._video_a   <-- holding file,
                                                          holding file chunk
  * /data/holding/200703061234/videoserver._video_a.1 <-- holding file chunk
  *
 #include "amanda.h"
 #include "diskfile.h"
 #include "fileheader.h"
-#include "sl.h"
 
-/*
- * Verbosity
- */
-
-/* Set verbose flag for holding-disk functions
+/* Get a list of holding disks.  This is equivalent to 
+ * getconf_holdingdisks() with holdingdisk_get_diskdir().
  *
- * @param verbose: if true, log verbosely to stdout
- * @returns: old verbosity
- */
-int
-holding_set_verbosity(int verbose);
-
-/*
- * Holding disks
- *
- * Use getconf_holdingdisks() to access the list of holding disks.
- */
-
-/*
- * Holding directories
- */
-
-/* Get a list of holding directories, optionally limited to a single
- * holding disk.  Can return a list either of full pathnames or of
- * bare directory names (datestamps).
- *
- * @param hdisk: holding disk to enumerate, or NULL for all
- * @param date_list: Limit to thes timestamps.
- * @param fullpaths: if true, return full pathnames
- * @returns: newly allocated sl_t of matching directories
- */
-sl_t *
-holding_get_directories(char *hdisk,
-                       sl_t *date_list,
-                        int fullpaths);
-
-/*
- * Holding files
+ * @returns: newly allocated GSList of matching disks
  */
+GSList *
+holding_get_disks(void);
 
 /* Get a list of holding files, optionally limited to a single holding
  * directory.  Can return a list either of full pathnames or of
  * bare file names.
  *
  * @param hdir: holding directory to enumerate, or NULL for all
- * @param date_list: Limit to thes timestamps.
  * @param fullpaths: if true, return full pathnames
- * @returns: newly allocated sl_t of matching files
+ * @returns: newly allocated GSList of matching files
  */
-sl_t *
+GSList *
 holding_get_files(char *hdir,
-                 sl_t *date_list,
                   int fullpaths);
 
+/* Get a list of holding files chunks in the given holding
+ * file.  Always returns full paths.
+ *
+ * @param hfile: holding file to enumerate
+ * @returns: newly allocated GSList of matching holding file chunks
+ */
+GSList *
+holding_get_file_chunks(char *hfile);
+
 /* Get a list of holding files that should be flushed, optionally
  * matching only certain datestamps.  This function filters out
  * files for host/disks that are no longer in the disklist.
  *
- * @param dateargs: sl_t of datestamps to dump, or NULL for all
- * @param interactive: if true, be interactive
- * @returns: a newly allocated sl_t listing all matching holding 
+ * @param dateargs: GSList of datestamps expressions to dump, or NULL 
+ * for all
+ * @returns: a newly allocated GSList listing all matching holding
  * files
  */
-sl_t *
-holding_get_files_for_flush(sl_t *dateargs, 
-                            int interactive);
+GSList *
+holding_get_files_for_flush(GSList *dateargs);
+
+/* Get a list of all datestamps for which dumps are in the holding
+ * disk.  This scans all dumps and takes the union of their
+ * datestamps (some/all of which may actually be timestamps, 
+ * depending on the setting of config option usetimestamps)
+ *
+ * @returns: a newly allocated GSList listing all datestamps
+ */
+GSList *
+holding_get_all_datestamps(void);
 
-/* Get the total size of a holding file, including all holding 
+/* Get the total size of a holding file, including all holding
  * file chunks, in kilobytes.
  *
  * @param holding_file: full pathname of holding file
@@ -128,8 +112,8 @@ holding_get_files_for_flush(sl_t *dateargs,
  * total size
  * @returns: total size of the holding file, or -1 in an error
  */
-off_t 
-holding_file_size(char *holding_file, 
+off_t
+holding_file_size(char *holding_file,
                   int strip_headers);
 
 /* Unlink a holding file, including all holding file chunks.
@@ -137,29 +121,9 @@ holding_file_size(char *holding_file,
  * @param holding_file: full pathname of holding file
  * @returns: 1 on success, else 0
  */
-int 
+int
 holding_file_unlink(char *holding_file);
 
-/* Given a pathname of a holding file, extract the hostname, diskname,
- * level, and filetype from the header.
- *
- * Caller is responsible for freeing memory for hostname and diskname.
- * None of the result parameters can be NULL.
- *
- * @param fname: full pathname of holding file
- * @param hostname: (result) hostname
- * @param diskname: (result) diskname
- * @param level: (result) level
- * @param datestamp: (result) datestamp of the dump
- * @returns: filetype (see common-src/fileheader.h)
- */
-filetype_t 
-holding_file_read_header(char *fname,
-                         char **hostname,
-                         char **diskname,
-                         int *level,
-                         char **datestamp);
-
 /* Given a pathname of a holding file, read the file header.
  * the result parameter may be altered even if an error is
  * returned.
@@ -168,73 +132,56 @@ holding_file_read_header(char *fname,
  * @param file: (result) dumpfile_t structure
  * @returns: 1 on success, else 0
  */
-int 
-holding_file_get_dumpfile(char *fname, 
+int
+holding_file_get_dumpfile(char *fname,
                           dumpfile_t *file);
 
 /*
- * Holding file chunks
+ * Maintenance
  */
 
-/* Get a list of holding files chunks in the given holding 
- * file.  Always returns full paths.
+/* Clean up all holding disks, restoring from a possible crash or
+ * other errors.  This function is intentionally opaque, as the
+ * details of holding disk are hidden from other applications.
  *
- * @param hfile: holding file to enumerate
- * @returns: newly allocated sl_t of matching holding file chunks
+ * All error and warning messages go to the debug log.
+ *
+ * @param corrupt_dle: function that is called for any DLEs for
+ * which corrupt dumps are found.
+ * @param verbose_output: if non-NULL, send progress messages to
+ * this file.
  */
-sl_t *
-holding_get_file_chunks(char *hfile);
+typedef void (*corrupt_dle_fn)(char *hostname, char *disk);
+void
+holding_cleanup(corrupt_dle_fn corrupt_dle,
+    FILE *verbose_output);
 
 /*
  * application-specific support
  */
 
-/* Allow the user to select a set of datestamps from those in
- * holding disks.
- *
- * @param verbose: verbose logging to stdout
- * @returns: a new sl_t listing all matching datestamps
- */
-sl_t *
-pick_datestamp(int verbose);
-
-/* Similar to pick_datestamp, but always select all available
- * datestamps.  Non-interactive, but outputs progress to stdout.
- *
- * @param verbose: verbose logging to stdout
- * @returns: a new sl_t listing all matching datestamps
- */
-sl_t *
-pick_all_datestamp(int verbose);
-
 /* Rename holding files from the temporary names used during
  * creation.
  *
+ * This is currently called by driver.c, but will disappear when
+ * holding is fully converted to the device API
+ *
  * @param holding_file: full pathname of holding file,
  * without '.tmp'
  * @param complete: if 0, set 'is_partial' to 1 in each file
  * @returns: 1 on success, else 0
  */
-int 
-rename_tmp_holding(char *holding_file, 
+int
+rename_tmp_holding(char *holding_file,
                    int complete);
 
-/* Remove any empty datestamp directories.
- *
- * @param diskdir: holding directory to clean
- * @param verbose: verbose logging to stdout
- */
-void 
-cleanup_holdingdisk(char *diskdir, 
-                    int verbose);
-
 /* Set up a holding directory and do basic permission
  * checks on it
  *
  * @param diskdir: holding directory to set up
  * @returns: 1 on success, else 0
  */
-int 
+int
 mkholdingdir(char *diskdir);
 
 #endif /* HOLDING_H */
index 6ceca7ef5f39e71bb2eec71a68c2ba71f1944dc1..43c652182f1efedf2aafb6fed1bcae55b8ca9d4a 100644 (file)
@@ -36,7 +36,6 @@
 
 static void zero_info(info_t *);
 
-#ifdef TEXTDB
   static char *infodir = (char *)0;
   static char *infofile = (char *)0;
   static char *newinfofile;
@@ -47,15 +46,6 @@ static void zero_info(info_t *);
   static int read_txinfofile(FILE *, info_t *);
   static int write_txinfofile(FILE *, info_t *);
   static int delete_txinfofile(char *, char *);
-#else
-#  define MAX_KEY 256
-/*#  define HEADER     (SIZEOF(info_t)-DUMP_LEVELS*SIZEOF(stats_t))*/
-
-  static DBM *infodb = NULL;
-  static lockfd = -1;
-#endif
-
-#ifdef TEXTDB
 
 static FILE *
 open_txinfofile(
@@ -159,7 +149,7 @@ read_txinfofile(
        amfree(line);
     }
     if (line == NULL) return -1;
-    rc = sscanf(line, "version: %d", &version);
+    rc = sscanf(line, _("version: %d"), &version);
     amfree(line);
     if(rc != 1) return -2;
 
@@ -169,7 +159,7 @@ read_txinfofile(
        amfree(line);
     }
     if (line == NULL) return -1;
-    rc = sscanf(line, "command: %u", &info->command);
+    rc = sscanf(line, _("command: %u"), &info->command);
     amfree(line);
     if(rc != 1) return -2;
 
@@ -229,10 +219,9 @@ read_txinfofile(
 
     for(rc = -2; (line = agets(infof)) != NULL; free(line)) {
        stats_t onestat;        /* one stat record */
-       time_t date = 0;
-        time_t *date_p = &date;
-        time_t *secs_p;
        int level = 0;
+       long long off_t_tmp;
+       intmax_t time_t_tmp;
 
        if (line[0] == '\0')
            continue;
@@ -263,40 +252,39 @@ read_txinfofile(
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onestat.size) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            break;
        }
+       onestat.size = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onestat.csize) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            break;
        }
+       onestat.csize = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-        secs_p = &onestat.secs;
-       if(ch == '\0' || sscanf((s - 1), TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)secs_p) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%jd", &time_t_tmp) != 1) {
            break;
        }
+        onestat.secs = (time_t)time_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)date_p) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%jd", &time_t_tmp) != 1) {
            break;
        }
+       onestat.date = (time_t)time_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
        if(ch != '\0') {
-           if(sscanf((s - 1), OFF_T_FMT,
-                       (OFF_T_FMT_TYPE *)&onestat.filenum) != 1) {
+           if(sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
                break;
            }
+           onestat.filenum = (off_t)off_t_tmp;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);
@@ -307,8 +295,6 @@ read_txinfofile(
            onestat.label[SIZEOF(onestat.label)-1] = '\0';
        }
 
-       onestat.date = date;    /* time_t not guarranteed to be long */
-
        if(level < 0 || level > DUMP_LEVELS-1)
            break;
 
@@ -331,13 +317,11 @@ read_txinfofile(
 
     for(rc = -2; (line = agets(infof)) != NULL; free(line)) {
        history_t onehistory;   /* one history record */
-       time_t date;
-       time_t *date_p = &date;
-        time_t *secs_p;
+       long long off_t_tmp;
+       intmax_t time_t_tmp;
 
        if (line[0] == '\0')
            continue;
-       date = 0L;
        if(line[0] == '/' && line[1] == '/') {
            info->history[nb_history].level = -2;
            rc = 0;
@@ -363,40 +347,37 @@ read_txinfofile(
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onehistory.size) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            amfree(line);
            break;
        }
+       onehistory.size = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&onehistory.csize) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%lld", &off_t_tmp) != 1) {
            amfree(line);
            break;
        }
+       onehistory.csize = (off_t)off_t_tmp;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-       if(ch == '\0' || sscanf((s - 1), TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)date_p) != 1) {
+       if(ch == '\0' || sscanf((s - 1), "%jd", &time_t_tmp) != 1) {
            amfree(line);
            break;
        }
+       onehistory.date = (time_t)time_t_tmp;
        skip_integer(s, ch);
 
-       onehistory.date = date; /* time_t not guaranteed to be long */
-
        onehistory.secs = (unsigned long)-1;
        skip_whitespace(s, ch);
-        secs_p = &onehistory.secs;
        if(ch != '\0') {
-           if(sscanf((s - 1), TIME_T_FMT,
-                               (TIME_T_FMT_TYPE *)secs_p) != 1) {
+           if(sscanf((s - 1), "%jd", &time_t_tmp) != 1) {
                amfree(line);
                break;
            }
+           onehistory.secs = (time_t)time_t_tmp;
            skip_integer(s, ch);
        }
 
@@ -425,65 +406,62 @@ write_txinfofile(
     perf_t *pp;
     int level;
 
-    fprintf(infof, "version: %d\n", 0);
+    g_fprintf(infof, _("version: %d\n"), 0);
 
-    fprintf(infof, "command: %u\n", info->command);
+    g_fprintf(infof, _("command: %u\n"), info->command);
 
     pp = &info->full;
 
-    fprintf(infof, "full-rate:");
+    g_fprintf(infof, "full-rate:");
     for(i=0; i<AVG_COUNT; i++)
        if(pp->rate[i] >= 0.0)
-           fprintf(infof, " %lf", pp->rate[i]);
-    fprintf(infof, "\n");
+           g_fprintf(infof, " %lf", pp->rate[i]);
+    g_fprintf(infof, "\n");
 
-    fprintf(infof, "full-comp:");
+    g_fprintf(infof, "full-comp:");
     for(i=0; i<AVG_COUNT; i++)
        if(pp->comp[i] >= 0.0)
-           fprintf(infof, " %lf", pp->comp[i]);
-    fprintf(infof, "\n");
+           g_fprintf(infof, " %lf", pp->comp[i]);
+    g_fprintf(infof, "\n");
 
     pp = &info->incr;
 
-    fprintf(infof, "incr-rate:");
+    g_fprintf(infof, "incr-rate:");
     for(i=0; i<AVG_COUNT; i++)
        if(pp->rate[i] >= 0.0)
-           fprintf(infof, " %lf", pp->rate[i]);
-    fprintf(infof, "\n");
+           g_fprintf(infof, " %lf", pp->rate[i]);
+    g_fprintf(infof, "\n");
 
-    fprintf(infof, "incr-comp:");
+    g_fprintf(infof, "incr-comp:");
     for(i=0; i<AVG_COUNT; i++)
        if(pp->comp[i] >= 0.0)
-           fprintf(infof, " %lf", pp->comp[i]);
-    fprintf(infof, "\n");
+           g_fprintf(infof, " %lf", pp->comp[i]);
+    g_fprintf(infof, "\n");
 
     for(level=0; level<DUMP_LEVELS; level++) {
        sp = &info->inf[level];
 
        if(sp->date < (time_t)0 && sp->label[0] == '\0') continue;
 
-       fprintf(infof, "stats: %d " OFF_T_FMT " " OFF_T_FMT
-               " " TIME_T_FMT " " OFF_T_FMT,
-               level, (OFF_T_FMT_TYPE)sp->size, (OFF_T_FMT_TYPE)sp->csize,
-               (TIME_T_FMT_TYPE)sp->secs, (OFF_T_FMT_TYPE)sp->date);
+       g_fprintf(infof, "stats: %d %lld %lld %jd %lld",
+               level, (long long)sp->size, (long long)sp->csize,
+               (intmax_t)sp->secs, (long long)sp->date);
        if(sp->label[0] != '\0')
-           fprintf(infof, " " OFF_T_FMT " %s",
-               (OFF_T_FMT_TYPE)sp->filenum, sp->label);
-       fprintf(infof, "\n");
+           g_fprintf(infof, " %lld %s", (long long)sp->filenum, sp->label);
+       g_fprintf(infof, "\n");
     }
 
-    fprintf(infof, "last_level: %d %d\n", info->last_level, info->consecutive_runs);
+    g_fprintf(infof, _("last_level: %d %d\n"), info->last_level, info->consecutive_runs);
 
     for(i=0;info->history[i].level > -1;i++) {
-       fprintf(infof, "history: %d " OFF_T_FMT " " OFF_T_FMT
-               " " TIME_T_FMT " " TIME_T_FMT "\n",
+       g_fprintf(infof, _("history: %d %lld %lld %jd %jd\n"),
                info->history[i].level,
-               (OFF_T_FMT_TYPE)info->history[i].size,
-               (OFF_T_FMT_TYPE)info->history[i].csize,
-               (TIME_T_FMT_TYPE)info->history[i].date,
-               (TIME_T_FMT_TYPE)info->history[i].secs);
+               (long long)info->history[i].size,
+               (long long)info->history[i].csize,
+               (intmax_t)info->history[i].date,
+               (intmax_t)info->history[i].secs);
     }
-    fprintf(infof, "//\n");
+    g_fprintf(infof, "//\n");
 
     return 0;
 }
@@ -518,66 +496,24 @@ delete_txinfofile(
 
     return rc;
 }
-#endif
-
-#ifndef TEXTDB
-static char *lockname = NULL;
-#endif
 
 int
 open_infofile(
     char *     filename)
 {
-#ifdef TEXTDB
     assert(infodir == (char *)0);
 
     infodir = stralloc(filename);
 
     return 0; /* success! */
-#else
-    /* lock the dbm file */
-
-    lockname = newstralloc2(lockname, filename, ".lck");
-    if((lockfd = open(lockname, O_CREAT|O_RDWR, 0644)) == -1)
-       return 2;
-
-    if(amflock(lockfd, "info") == -1) {
-       aclose(lockfd);
-       unlink(lockname);
-       return 3;
-    }
-
-    if(!(infodb = dbm_open(filename, O_CREAT|O_RDWR, 0644))) {
-       amfunlock(lockfd, "info");
-       aclose(lockfd);
-       unlink(lockname);
-       return 1;
-    }
-
-    return (infodb == NULL);   /* return 1 on error */
-#endif
 }
 
 void
 close_infofile(void)
 {
-#ifdef TEXTDB
     assert(infodir != (char *)0);
 
     amfree(infodir);
-#else
-    dbm_close(infodb);
-
-    if(amfunlock(lockfd, "info") == -1) {
-       error("could not unlock infofile: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-
-    aclose(lockfd);
-    lockfd = -1;
-
-    unlink(lockname);
-#endif
 }
 
 /* Convert a dump level to a GMT based time stamp */
@@ -599,7 +535,7 @@ get_dumpdate(
     }
 
     t = gmtime(&last);
-    snprintf(stamp, SIZEOF(stamp), "%d:%d:%d:%d:%d:%d",
+    g_snprintf(stamp, SIZEOF(stamp), "%d:%d:%d:%d:%d:%d",
                t->tm_year+1900, t->tm_mon+1, t->tm_mday,
                t->tm_hour, t->tm_min, t->tm_sec);
 
@@ -674,7 +610,6 @@ get_info(
     (void) zero_info(info);
 
     {
-#ifdef TEXTDB
        FILE *infof;
 
        infof = open_txinfofile(hostname, diskname, "r");
@@ -687,141 +622,18 @@ get_info(
 
            close_txinfofile(infof);
        }
-#else
-       datum k, d;
-
-       /* setup key */
-
-       k.dptr = vstralloc(hostname, ":", diskname, NULL);
-       k.dsize = strlen(k.dptr)+1;
-
-       /* lookup record */
-
-       d = dbm_fetch(infodb, k);
-       amfree(k.dptr);
-       if(d.dptr == NULL) {
-           rc = -1; /* record not found */
-       }
-       else {
-           memcpy(info, d.dptr, d.dsize);
-           rc = 0;
-       }
-#endif
     }
 
     return rc;
 }
 
 
-int
-get_firstkey(
-    char *     hostname,
-    int                hostname_size,
-    char *     diskname,
-    int                diskname_size)
-{
-#ifdef TEXTDB
-    (void)hostname;            /* Quiet unused parameter warning */
-    (void)hostname_size;       /* Quiet unused parameter warning */
-    (void)diskname;            /* Quiet unused parameter warning */
-    (void)diskname_size;       /* Quiet unused parameter warning */
-
-    assert(0);
-    return 0;
-#else
-    datum k;
-    int rc;
-    char *s, *fp;
-    int ch;
-
-    k = dbm_firstkey(infodb);
-    if(k.dptr == NULL) return 0;
-
-    s = k.dptr;
-    ch = *s++;
-
-    skip_whitespace(s, ch);
-    if(ch == '\0') return 0;
-    fp = hostname;
-    while(ch && ch != ':') {
-       if(fp >= hostname+hostname_size-1) {
-           fp = NULL;
-           break;
-       }
-       *fp = ch;
-       ch = *s++;
-    }
-    if(fp == NULL) return 0;
-    *fp = '\0';
-
-    if(ch != ':') return 0;
-    ch = *s++;
-    copy_string(s, ch, diskname, diskname_size, fp);
-    if(fp == NULL) return 0;
-
-    return 1;
-#endif
-}
-
-
-int
-get_nextkey(
-    char *     hostname,
-    int                hostname_size,
-    char *     diskname,
-    int                diskname_size)
-{
-#ifdef TEXTDB
-    (void)hostname;            /* Quiet unused parameter warning */
-    (void)hostname_size;       /* Quiet unused parameter warning */
-    (void)diskname;            /* Quiet unused parameter warning */
-    (void)diskname_size;       /* Quiet unused parameter warning */
-
-    assert(0);
-    return 0;
-#else
-    datum k;
-    int rc;
-    char *s, *fp;
-    int ch;
-
-    k = dbm_nextkey(infodb);
-    if(k.dptr == NULL) return 0;
-
-    s = k.dptr;
-    ch = *s++;
-
-    skip_whitespace(s, ch);
-    if(ch == '\0') return 0;
-    fp = hostname;
-    while(ch && ch != ':') {
-       if(fp >= hostname+hostname_size-1) {
-           fp = NULL;
-           break;
-       }
-       *fp = ch;
-       ch = *s++;
-    }
-    if(fp == NULL) return 0;
-    *fp = '\0';
-
-    if(ch != ':') return 0;
-    ch = *s++;
-    copy_string(s, ch, diskname, diskname_size, fp);
-    if(fp == NULL) return 0;
-
-    return 1;
-#endif
-}
-
-
 int
 put_info(
      char *    hostname,
      char *    diskname,
      info_t *  info)
 {
-#ifdef TEXTDB
     FILE *infof;
     int rc;
 
@@ -834,28 +646,6 @@ put_info(
     rc = rc || close_txinfofile(infof);
 
     return rc;
-#else
-    datum k, d;
-    int maxlev;
-
-    /* setup key */
-
-    k.dptr = vstralloc(hostname, ":", diskname, NULL);
-    k.dsize = strlen(k.dptr)+1;
-
-    d.dptr = (char *)info;
-    d.dsize = SIZEOF(info_t);
-
-    /* store record */
-
-    if(dbm_store(infodb, k, d, DBM_REPLACE) != 0) {
-       amfree(k.dptr);
-       return -1;
-    }
-
-    amfree(k.dptr);
-    return 0;
-#endif
 }
 
 
@@ -864,26 +654,7 @@ del_info(
     char *     hostname,
     char *     diskname)
 {
-#ifdef TEXTDB
     return delete_txinfofile(hostname, diskname);
-#else
-    char key[MAX_KEY];
-    datum k;
-
-    /* setup key */
-
-    k.dptr = vstralloc(hostname, ":", diskname, NULL);
-    k.dsize = strlen(key)+1;
-
-    /* delete key and record */
-
-    if(dbm_delete(infodb, k) != 0) {
-       amfree(k.dptr);
-       return -1;
-    }
-    amfree(k.dptr);
-    return 0;
-#endif
 }
 
 
@@ -898,29 +669,28 @@ dump_rec(
     int i;
     stats_t *sp;
 
-    printf("command word: %d\n", info->command);
-    printf("full dump rate (K/s) %5.1lf, %5.1lf, %5.1lf\n",
+    g_printf(_("command word: %d\n"), info->command);
+    g_printf(_("full dump rate (K/s) %5.1lf, %5.1lf, %5.1lf\n"),
           info->full.rate[0],info->full.rate[1],info->full.rate[2]);
-    printf("full comp rate %5.1lf, %5.1lf, %5.1lf\n",
+    g_printf(_("full comp rate %5.1lf, %5.1lf, %5.1lf\n"),
           info->full.comp[0]*100,info->full.comp[1]*100,info->full.comp[2]*100);
-    printf("incr dump rate (K/s) %5.1lf, %5.1lf, %5.1lf\n",
+    g_printf(_("incr dump rate (K/s) %5.1lf, %5.1lf, %5.1lf\n"),
           info->incr.rate[0],info->incr.rate[1],info->incr.rate[2]);
-    printf("incr comp rate %5.1lf, %5.1lf, %5.1lf\n",
+    g_printf(_("incr comp rate %5.1lf, %5.1lf, %5.1lf\n"),
           info->incr.comp[0]*100,info->incr.comp[1]*100,info->incr.comp[2]*100);
     for(i = 0; i < DUMP_LEVELS; i++) {
        sp = &info->inf[i];
        if( sp->size != -1) {
 
-           printf("lev %d date %ld tape %s filenum " OFF_T_FMT " size %ld csize %ld secs %ld\n",
+           g_printf(_("lev %d date %ld tape %s filenum %lld size %ld csize %ld secs %ld\n"),
                   i, (long)sp->date, sp->label, sp->filenum,
                   sp->size, sp->csize, sp->secs);
        }
     }
     putchar('\n');
-   printf("last_level: %d %d\n", info->last_level, info->consecutive_runs);
+    g_printf(_("last_level: %d %d\n"), info->last_level, info->consecutive_runs);
 }
 
-#ifdef TEXTDB
 void dump_db( char *host, char *disk);
 
 void
@@ -934,39 +704,9 @@ dump_db(
     if((rc = get_info(host, disk, &info)) == 0) {
        dump_rec(&info);
     } else {
-       printf("cannot fetch information for %s:%s rc=%d\n", host, disk, rc);
-    }
-}
-#else
-void
-dump_db(
-    char *     str)
-{
-    datum k,d;
-    int rec,r,num;
-    info_t info;
-
-
-    printf("info database %s:\n--------\n", str);
-    rec = 0;
-    k = dbm_firstkey(infodb);
-    while(k.dptr != NULL) {
-
-       printf("%3d: KEY %s =\n", rec, k.dptr);
-
-       d = dbm_fetch(infodb, k);
-       memset(&info, '\0', SIZEOF(info));
-       memcpy(&info, d.dptr, d.dsize);
-
-       num = (d.dsize-HEADER)/SIZEOF(stats_t);
-       dump_rec(&info);
-
-       k = dbm_nextkey(infodb);
-       rec++;
+       g_printf(_("cannot fetch information for %s:%s rc=%d\n"), host, disk, rc);
     }
-    puts("--------\n");
 }
-#endif
 
 int
 main(
@@ -974,8 +714,15 @@ main(
     char **    argv)
 {
   int i;
-  unsigned long malloc_hist_1, malloc_size_1;
-  unsigned long malloc_hist_2, malloc_size_2;
+
+  /*
+   * Configure program for internationalization:
+   *   1) Only set the message locale for now.
+   *   2) Set textdomain for all amanda related programs to "amanda"
+   *      We don't want to be forced to support dozens of message catalogs.
+   */  
+  setlocale(LC_MESSAGES, "C");
+  textdomain("amanda"); 
 
   safe_fd(-1, 0);
 
@@ -983,30 +730,17 @@ main(
 
   dbopen(DBG_SUBDIR_SERVER);
 
-  malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
   for(i = 1; i < argc; ++i) {
-#ifdef TEXTDB
     if(i+1 >= argc) {
-      fprintf(stderr,"usage: %s host disk [host disk ...]\n",argv[0]);
+      g_fprintf(stderr,_("usage: %s host disk [host disk ...]\n"),argv[0]);
       return 1;
     }
     open_infofile("curinfo");
     dump_db(argv[i], argv[i+1]);
     i++;
-#else
-    open_infofile(argv[i]);
-    dump_db(argv[i]);
-#endif
     close_infofile();
   }
 
-  malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-  if(malloc_size_1 != malloc_size_2) {
-    malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-  }
-
   return 0;
 }
 
index f8139f7ff8f9e8a2694c70b7a353a4d378a4c504..e1ce4829f32d28d79d888dffe4d2ab6c6f032ed4 100644 (file)
@@ -86,10 +86,6 @@ void close_infofile(void);
 char *get_dumpdate(info_t *info, int level);
 double perf_average(double *array, double def);
 int get_info(char *hostname, char *diskname, info_t *info);
-int get_firstkey(char *hostname, int hostname_size,
-                   char *diskname, int diskname_size);
-int get_nextkey(char *hostname, int hostname_size,
-                   char *diskname, int diskname_size);
 int put_info(char *hostname, char *diskname, info_t *info);
 int del_info(char *hostname, char *diskname);
 
index ccddd26aaa2bfd97807f8e3cc20737d375d00017..03cc5f65858078c4d107ccfa10df48de2395eeac 100644 (file)
@@ -42,7 +42,8 @@ char *logtype_str[] = {
     "ERROR", "WARNING",        "INFO", "SUMMARY",       /* information messages */
     "START", "FINISH",                            /* start/end of a run */
     "DISK",                                                     /* disk */
-    "SUCCESS", "PARTIAL", "FAIL", "STRANGE",       /* the end of a dump */
+    /* the end of a dump */
+    "DONE", "PART", "PARTPARTIAL", "SUCCESS", "PARTIAL", "FAIL", "STRANGE",
     "CHUNK", "CHUNKSUCCESS",                            /* ... continued */
     "STATS",                                              /* statistics */
     "MARKER",                                    /* marker for reporter */
@@ -89,7 +90,7 @@ printf_arglist_function2(char *log_genstring, logtype_t, typ, char *, pname, cha
     va_list argp;
     char *leader = NULL;
     char linebuf[STR_SIZE];
-
+    char *xlated_fmt = dgettext("C", format);
 
     /* format error message */
 
@@ -102,7 +103,7 @@ printf_arglist_function2(char *log_genstring, logtype_t, typ, char *, pname, cha
     }
 
     arglist_start(argp, format);
-    vsnprintf(linebuf, SIZEOF(linebuf)-1, format, argp);
+    g_vsnprintf(linebuf, SIZEOF(linebuf)-1, xlated_fmt, argp);
                                                /* -1 to allow for '\n' */
     arglist_end(argp);
     return(vstralloc(leader, linebuf, "\n", NULL));
@@ -113,10 +114,10 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     va_list argp;
     int saved_errout;
     char *leader = NULL;
+    char *xlated_fmt = gettext(format);
     char linebuf[STR_SIZE];
     size_t n;
 
-
     /* format error message */
 
     if((int)typ <= (int)L_BOGUS || (int)typ > (int)L_MARKER) typ = L_BOGUS;
@@ -128,7 +129,7 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     }
 
     arglist_start(argp, format);
-    vsnprintf(linebuf, SIZEOF(linebuf)-1, format, argp);
+    g_vsnprintf(linebuf, SIZEOF(linebuf)-1, xlated_fmt, argp);
                                                /* -1 to allow for '\n' */
     arglist_end(argp);
 
@@ -142,7 +143,7 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     if(multiline == -1) open_log();
 
     if (fullwrite(logfd, leader, strlen(leader)) < 0) {
-       error("log file write error: %s", strerror(errno));
+       error(_("log file write error: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -153,7 +154,7 @@ printf_arglist_function1(void log_add, logtype_t, typ, char *, format)
     linebuf[n] = '\0';
 
     if (fullwrite(logfd, linebuf, n) < 0) {
-       error("log file write error: %s", strerror(errno));
+       error(_("log file write error: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -195,16 +196,11 @@ log_rename(
 
     if(datestamp == NULL) datestamp = "error";
 
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     logfile = vstralloc(conf_logdir, "/log", NULL);
 
     for(seq = 0; 1; seq++) {   /* if you've got MAXINT files in your dir... */
-       snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
+       g_snprintf(seq_str, SIZEOF(seq_str), "%u", seq);
        fname = newvstralloc(fname,
                             logfile,
                             ".", datestamp,
@@ -214,7 +210,7 @@ log_rename(
     }
 
     if(rename(logfile, fname) == -1) {
-       error("could not rename \"%s\" to \"%s\": %s",
+       error(_("could not rename \"%s\" to \"%s\": %s"),
              logfile, fname, strerror(errno));
        /*NOTREACHED*/
     }
@@ -230,24 +226,24 @@ open_log(void)
 {
     char *conf_logdir;
 
-    conf_logdir = getconf_str(CNF_LOGDIR);
-    if (*conf_logdir == '/') {
-       conf_logdir = stralloc(conf_logdir);
-    } else {
-       conf_logdir = stralloc2(config_dir, conf_logdir);
-    }
+    /* now that we have a logfile, let the debug module know how to write
+     * error messages to it.  This is due to some rather obscure linking 
+     * problems. */
+    set_logerror(logerror);
+
+    conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     logfile = vstralloc(conf_logdir, "/log", NULL);
     amfree(conf_logdir);
 
     logfd = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0600);
 
     if(logfd == -1) {
-       error("could not open log file %s: %s", logfile, strerror(errno));
+       error(_("could not open log file %s: %s"), logfile, strerror(errno));
        /*NOTREACHED*/
     }
 
     if(amflock(logfd, "log") == -1) {
-       error("could not lock log file %s: %s", logfile, strerror(errno));
+       error(_("could not lock log file %s: %s"), logfile, strerror(errno));
        /*NOTREACHED*/
     }
 }
@@ -257,12 +253,12 @@ static void
 close_log(void)
 {
     if(amfunlock(logfd, "log") == -1) {
-       error("could not unlock log file %s: %s", logfile, strerror(errno));
+       error(_("could not unlock log file %s: %s"), logfile, strerror(errno));
        /*NOTREACHED*/
     }
 
     if(close(logfd) == -1) {
-       error("close log file: %s", strerror(errno));
+       error(_("close log file: %s"), strerror(errno));
        /*NOTREACHED*/
     }
 
@@ -270,7 +266,8 @@ close_log(void)
     amfree(logfile);
 }
 
-
+/* WARNING: Function accesses globals curstr, curlog, and curprog
+ * WARNING: Function has static member logline, returned via globals */
 int
 get_logline(
     FILE *     logf)
index ed5934728ad1120ff623a49c7e873af146de6884..22fb5f6fe9c00e18674d8021c7747cb8f21c42c6 100644 (file)
@@ -46,7 +46,8 @@ typedef enum logtype_e {
     L_ERROR, L_WARNING,        L_INFO, L_SUMMARY,       /* information messages */
     L_START, L_FINISH,                              /* start/end of run */
     L_DISK,                                                     /* disk */
-    L_SUCCESS, L_PARTIAL, L_FAIL, L_STRANGE,       /* the end of a dump */
+    /* End of a dump: */
+    L_DONE, L_PART, L_PARTPARTIAL, L_SUCCESS, L_PARTIAL, L_FAIL, L_STRANGE,
     L_CHUNK, L_CHUNKSUCCESS,                            /* ... continued */
     L_STATS,                                              /* statistics */
     L_MARKER,                                    /* marker for reporter */
@@ -68,10 +69,9 @@ extern char *curstr;
 extern char *program_str[];
 
 void logerror(char *);
-void log_add(logtype_t typ, char * format, ...)
-    __attribute__ ((format (printf, 2, 3)));
-char* log_genstring(logtype_t typ, char *pname, char * format, ...);
-/*    __attribute__ ((format (printf, 3, 4))); */
+void log_add(logtype_t typ, char * format, ...) G_GNUC_PRINTF(2, 3);
+char* log_genstring(logtype_t typ, char *pname, char * format, ...)
+                   G_GNUC_PRINTF(3, 4);
 void log_start_multiline(void);
 void log_end_multiline(void);
 void log_rename(char *datestamp);
index c0f7fc6bf656c993b947f5347e0942455d17d69a..a36fc6cf9a6abe9fdc5a217d26d87bcb1fba3578 100644 (file)
@@ -43,6 +43,7 @@
 #include "amfeatures.h"
 #include "server_util.h"
 #include "holding.h"
+#include "timestamp.h"
 
 #define planner_debug(i,x) do {                \
        if ((i) <= debug_planner) {     \
@@ -159,61 +160,66 @@ static int promote_hills(void);
 static void output_scheduleline(disk_t *dp);
 int main(int, char **);
 
-int main(int argc, char **argv)
+int
+main(
+    int                argc,
+    char **    argv)
 {
     disklist_t origq;
     disk_t *dp;
     int moved_one;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
+    int diskarg_offset;
     off_t initial_size;
     int i;
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_infofile;
     times_t section_start;
-    uid_t ruid;
     char *qname;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     int    nb_disk;
     char  *errstr = NULL;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
+    /* drop root privileges */
+    if (!set_root_privs(0)) {
+       error(_("planner must be run setuid root"));
+    }
 
     safe_fd(-1, 0);
 
-    setvbuf(stderr, (char *)NULL, (int)_IOLBF, 0);
+    set_pname("planner");
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
+    dbopen(DBG_SUBDIR_SERVER);
 
-    if (my_argc > 1) {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    } else {
-       char my_cwd[STR_SIZE];
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    }
+    if (argc > 1) 
+       cfg_opt = argv[1];
+
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
     safe_cd();
 
-    set_pname("planner");
+    check_running_as(RUNNING_AS_DUMPUSER);
 
-    dbopen(DBG_SUBDIR_SERVER);
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+    setvbuf(stderr, (char *)NULL, (int)_IOLBF, 0);
 
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
@@ -223,75 +229,47 @@ int main(int argc, char **argv)
     our_features = am_init_feature_set();
     our_feature_string = am_feature_to_string(our_features);
 
-    fprintf(stderr, "%s: pid %ld executable %s version %s\n",
-           get_pname(), (long) getpid(), my_argv[0], version());
+    g_fprintf(stderr, _("%s: pid %ld executable %s version %s\n"),
+           get_pname(), (long) getpid(), argv[0], version());
     for (i = 0; version_info[i] != NULL; i++)
-       fprintf(stderr, "%s: %s", get_pname(), version_info[i]);
+       g_fprintf(stderr, _("%s: %s"), get_pname(), version_info[i]);
+
+    diskarg_offset = 2;
+    if (argc > 3 && strcmp(argv[2], "--starttime") == 0) {
+       planner_timestamp = stralloc(argv[3]);
+       diskarg_offset += 2;
+    }
+
 
     /*
      * 1. Networking Setup
      *
-     * Planner runs setuid to get a priviledged socket for BSD security.
-     * We get the socket right away as root, then set euid to normal
-     * user. Keeping saved uid as root.
      */
 
     protocol_init();
 
-    ruid = getuid();
-    if(geteuid() == 0) {
-       seteuid(ruid);
-       setgid(getgid());
-    }
-
-    /*
-     * From this point on we are running under our real uid, so we don't
-     * have to worry about opening security holes below.  Make sure we
-     * are a valid user.
-     */
-
-    if(getpwuid(getuid()) == NULL) {
-       error("can't get login name for my uid %ld", (long)getuid());
-       /*NOTREACHED*/
-    }
-
     /*
      * 2. Read in Configuration Information
      *
      * All the Amanda configuration files are loaded before we begin.
      */
 
-    fprintf(stderr,"READING CONF FILES...\n");
-
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if(read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
-    report_bad_conf_arg();
+    g_fprintf(stderr,_("READING CONF INFO...\n"));
 
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     if (read_diskfile(conf_diskfile, &origq) < 0) {
-       error("could not load disklist \"%s\"", conf_diskfile);
+       error(_("could not load disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
     if(origq.head == NULL) {
-       error("empty disklist \"%s\"", conf_diskfile);
+       error(_("empty disklist \"%s\""), conf_diskfile);
        /*NOTREACHED*/
     }
 
-    errstr = match_disklist(&origq, my_argc-2, my_argv+2);
+    errstr = match_disklist(&origq, argc-diskarg_offset,
+                                   argv+diskarg_offset);
     if (errstr) {
-       fprintf(stderr,"%s",errstr);
+       g_fprintf(stderr,"%s",errstr);
        amfree(errstr);
     }
     nb_disk = 0;
@@ -305,31 +283,21 @@ int main(int argc, char **argv)
     }
 
     if(nb_disk == 0) {
-       error("no DLE to backup");
+       error(_("no DLE to backup"));
        /*NOTREACHED*/
     }
     amfree(conf_diskfile);
 
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
+       error(_("could not load tapelist \"%s\""), conf_tapelist);
        /*NOTREACHED*/
     }
     amfree(conf_tapelist);
 
-    conf_infofile = getconf_str(CNF_INFOFILE);
-    if (*conf_infofile == '/') {
-       conf_infofile = stralloc(conf_infofile);
-    } else {
-       conf_infofile = stralloc2(config_dir, conf_infofile);
-    }
+    conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if(open_infofile(conf_infofile)) {
-       error("could not open info db \"%s\"", conf_infofile);
+       error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
     if (check_infofile(conf_infofile, &origq, &errstr) == -1) {
@@ -349,18 +317,21 @@ int main(int argc, char **argv)
     conf_autoflush = getconf_boolean(CNF_AUTOFLUSH);
     conf_usetimestamps = getconf_boolean(CNF_USETIMESTAMPS);
 
-    amfree(planner_timestamp);
     today = time(0);
-    if(conf_usetimestamps == 0) {
-       planner_timestamp = construct_datestamp(NULL);
+    if (planner_timestamp) {
+       if (conf_usetimestamps == 0) {
+           planner_timestamp[8] = '\0';
+       }
+    } else if(conf_usetimestamps == 0) {
+       planner_timestamp = get_datestamp_from_time(0);
     }
     else {
-       planner_timestamp = construct_timestamp(NULL);
+       planner_timestamp = get_timestamp_from_time(0);
     }
-    log_add(L_START, "date %s", planner_timestamp);
-    printf("DATE %s\n", planner_timestamp);
+    log_add(L_START, _("date %s"), planner_timestamp);
+    g_printf("DATE %s\n", planner_timestamp);
     fflush(stdout);
-    fprintf(stderr, "%s: timestamp %s\n",
+    g_fprintf(stderr, _("%s: timestamp %s\n"),
                    get_pname(), planner_timestamp);
 
     /* some initializations */
@@ -380,7 +351,7 @@ int main(int argc, char **argv)
      * do some basic sanity checking
      */
      if(conf_tapecycle <= runs_per_cycle) {
-       log_add(L_WARNING, "tapecycle (%d) <= runspercycle (%d)",
+       log_add(L_WARNING, _("tapecycle (%d) <= runspercycle (%d)"),
                conf_tapecycle, runs_per_cycle);
      }
     
@@ -395,7 +366,7 @@ int main(int argc, char **argv)
     tt_blocksize_kb = (size_t)tapetype_get_blocksize(tape);
     tt_blocksize = tt_blocksize_kb * 1024;
 
-    fprintf(stderr, "%s: time %s: startup took %s secs\n",
+    g_fprintf(stderr, _("%s: time %s: startup took %s secs\n"),
                    get_pname(),
                    walltime_str(curclock()),
                    walltime_str(timessub(curclock(), section_start)));
@@ -407,36 +378,37 @@ int main(int argc, char **argv)
      * dump schedule.
      */
 
-    fprintf(stderr,"\nSENDING FLUSHES...\n");
+    g_fprintf(stderr,_("\nSENDING FLUSHES...\n"));
 
     if(conf_autoflush) {
-       dumpfile_t file;
-       sl_t *holding_list;
-       sle_t *holding_file;
+       dumpfile_t  file;
+       GSList *holding_list, *holding_file;
        char *qdisk, *qhname;
-       holding_list = holding_get_files_for_flush(NULL, 0);
-       for(holding_file=holding_list->first; holding_file != NULL;
+
+       /* get *all* flushable files in holding */
+       holding_list = holding_get_files_for_flush(NULL);
+       for(holding_file=holding_list; holding_file != NULL;
                                       holding_file = holding_file->next) {
-           holding_file_get_dumpfile(holding_file->name, &file);
+           holding_file_get_dumpfile((char *)holding_file->data, &file);
 
-           if (holding_file_size(holding_file->name, 1) <= 0) {
+           if (holding_file_size((char *)holding_file->data, 1) <= 0) {
                log_add(L_INFO, "%s: removing file with no data.",
-                       holding_file->name);
-               holding_file_unlink(holding_file->name);
+                       (char *)holding_file->data);
+               holding_file_unlink((char *)holding_file->data);
                continue;
            }
-           
+
            qdisk = quote_string(file.disk);
-           qhname = quote_string(holding_file->name);
+           qhname = quote_string((char *)holding_file->data);
            log_add(L_DISK, "%s %s", file.name, qdisk);
-           fprintf(stderr,
+           g_fprintf(stderr,
                    "FLUSH %s %s %s %d %s\n",
                    file.name,
                    qdisk,
                    file.datestamp,
                    file.dumplevel,
                    qhname);
-           fprintf(stdout,
+           g_fprintf(stdout,
                    "FLUSH %s %s %s %d %s\n",
                    file.name,
                    qdisk,
@@ -446,11 +418,11 @@ int main(int argc, char **argv)
            amfree(qdisk);
            amfree(qhname);
        }
-       free_sl(holding_list);
+       g_slist_free_full(holding_list);
        holding_list = NULL;
     }
-    fprintf(stderr, "ENDFLUSH\n");
-    fprintf(stdout, "ENDFLUSH\n");
+    g_fprintf(stderr, _("ENDFLUSH\n"));
+    g_fprintf(stdout, _("ENDFLUSH\n"));
     fflush(stdout);
 
     /*
@@ -461,7 +433,7 @@ int main(int argc, char **argv)
      * based on the curinfo database.
      */
 
-    fprintf(stderr,"\nSETTING UP FOR ESTIMATES...\n");
+    g_fprintf(stderr,_("\nSETTING UP FOR ESTIMATES...\n"));
     section_start = curclock();
 
     startq.head = startq.tail = NULL;
@@ -472,7 +444,7 @@ int main(int argc, char **argv)
        }
     }
 
-    fprintf(stderr, "%s: time %s: setting up estimates took %s secs\n",
+    g_fprintf(stderr, _("%s: time %s: setting up estimates took %s secs\n"),
                    get_pname(),
                    walltime_str(curclock()),
                    walltime_str(timessub(curclock(), section_start)));
@@ -487,7 +459,7 @@ int main(int argc, char **argv)
 
     /* go out and get the dump estimates */
 
-    fprintf(stderr,"\nGETTING ESTIMATES...\n");
+    g_fprintf(stderr,_("\nGETTING ESTIMATES...\n"));
     section_start = curclock();
 
     estq.head = estq.tail = NULL;
@@ -497,7 +469,7 @@ int main(int argc, char **argv)
 
     get_estimates();
 
-    fprintf(stderr, "%s: time %s: getting estimates took %s secs\n",
+    g_fprintf(stderr, _("%s: time %s: getting estimates took %s secs\n"),
                    get_pname(),
                    walltime_str(curclock()),
                    walltime_str(timessub(curclock(), section_start)));
@@ -521,7 +493,7 @@ int main(int argc, char **argv)
      * total expected size is accumulated as well.
      */
 
-    fprintf(stderr,"\nANALYZING ESTIMATES...\n");
+    g_fprintf(stderr,_("\nANALYZING ESTIMATES...\n"));
     section_start = curclock();
 
                        /* an empty tape still has a label and an endmark */
@@ -541,15 +513,15 @@ int main(int argc, char **argv)
     {
        disk_t *dp;
 
-       fprintf(stderr, "INITIAL SCHEDULE (size " OFF_T_FMT "):\n",
-               (OFF_T_FMT_TYPE)total_size);
+       g_fprintf(stderr, _("INITIAL SCHEDULE (size %lld):\n"),
+               (long long)total_size);
        for(dp = schedq.head; dp != NULL; dp = dp->next) {
            qname = quote_string(dp->name);
-           fprintf(stderr, "  %s %s pri %d lev %d nsize " OFF_T_FMT " csize " OFF_T_FMT "\n",
+           g_fprintf(stderr, _("  %s %s pri %d lev %d nsize %lld csize %lld\n"),
                    dp->host->hostname, qname, est(dp)->dump_priority,
                    est(dp)->dump_level,
-                   (OFF_T_FMT_TYPE)est(dp)->dump_nsize,
-                    (OFF_T_FMT_TYPE)est(dp)->dump_csize);
+                   (long long)est(dp)->dump_nsize,
+                    (long long)est(dp)->dump_csize);
            amfree(qname);
        }
     }
@@ -567,11 +539,10 @@ int main(int argc, char **argv)
      * until the dumps fit on the tape.
      */
 
-    fprintf(stderr, "\nDELAYING DUMPS IF NEEDED, total_size " OFF_T_FMT
-           ", tape length " OFF_T_FMT " mark " SIZE_T_FMT "\n",
-           (OFF_T_FMT_TYPE)total_size,
-           (OFF_T_FMT_TYPE)tape_length,
-           (SIZE_T_FMT_TYPE)tape_mark);
+    g_fprintf(stderr, _("\nDELAYING DUMPS IF NEEDED, total_size %lld, tape length %lld mark %zu\n"),
+           (long long)total_size,
+           (long long)tape_length,
+           tape_mark);
 
     initial_size = total_size;
 
@@ -579,7 +550,7 @@ int main(int argc, char **argv)
 
     /* XXX - why bother checking this? */
     if(empty(schedq) && total_size < initial_size) {
-       error("cannot fit anything on tape, bailing out");
+       error(_("cannot fit anything on tape, bailing out"));
        /*NOTREACHED*/
     }
 
@@ -602,8 +573,8 @@ int main(int argc, char **argv)
      * a big bump.
      */
 
-    fprintf(stderr,
-     "\nPROMOTING DUMPS IF NEEDED, total_lev0 %1.0lf, balanced_size %1.0lf...\n",
+    g_fprintf(stderr,
+     _("\nPROMOTING DUMPS IF NEEDED, total_lev0 %1.0lf, balanced_size %1.0lf...\n"),
            total_lev0, balanced_size);
 
     balance_threshold = balanced_size * PROMOTE_THRESHOLD;
@@ -613,18 +584,12 @@ int main(int argc, char **argv)
 
     moved_one = promote_hills();
 
-    fprintf(stderr, "%s: time %s: analysis took %s secs\n",
+    g_fprintf(stderr, _("%s: time %s: analysis took %s secs\n"),
                    get_pname(),
                    walltime_str(curclock()),
                    walltime_str(timessub(curclock(), section_start)));
 
 
-    /* done with prvileged ops, make sure root privilege is dropped */
-    if ( geteuid() == 0 ) {
-      setuid(ruid);
-      seteuid(ruid);
-    }
-
     /*
      * 9. Output Schedule
      *
@@ -632,30 +597,20 @@ int main(int argc, char **argv)
      * on stderr for the debug file.
      */
 
-    fprintf(stderr,"\nGENERATING SCHEDULE:\n--------\n");
+    g_fprintf(stderr,_("\nGENERATING SCHEDULE:\n--------\n"));
 
     while(!empty(schedq)) output_scheduleline(dequeue_disk(&schedq));
-    fprintf(stderr, "--------\n");
+    g_fprintf(stderr, _("--------\n"));
 
     close_infofile();
-    log_add(L_FINISH, "date %s time %s", planner_timestamp, walltime_str(curclock()));
+    log_add(L_FINISH, _("date %s time %s"), planner_timestamp, walltime_str(curclock()));
 
     clear_tapelist();
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     amfree(planner_timestamp);
-    amfree(config_dir);
-    amfree(config_name);
     amfree(our_feature_string);
     am_release_feature_set(our_features);
     our_features = NULL;
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     dbclose();
 
     return 0;
@@ -685,12 +640,12 @@ static void askfor(
     info_t *info)      /* info block for disk */
 {
     if(seq < 0 || seq >= MAX_LEVELS) {
-       error("error [planner askfor: seq out of range 0..%d: %d]",
+       error(_("error [planner askfor: seq out of range 0..%d: %d]"),
              MAX_LEVELS, seq);
        /*NOTREACHED*/
     }
     if(lev < -1 || lev >= DUMP_LEVELS) {
-       error("error [planner askfor: lev out of range -1..%d: %d]",
+       error(_("error [planner askfor: lev out of range -1..%d: %d]"),
              DUMP_LEVELS, lev);
        /*NOTREACHED*/
     }
@@ -705,7 +660,6 @@ static void askfor(
     ep->level[seq] = lev;
 
     ep->dumpdate[seq] = stralloc(get_dumpdate(info,lev));
-    malloc_mark(ep->dumpdate[seq]);
 
     ep->est_size[seq] = (off_t)-2;
 
@@ -725,7 +679,7 @@ setup_estimate(
     assert(dp && dp->host);
 
     qname = quote_string(dp->name);
-    fprintf(stderr, "%s: time %s: setting up estimates for %s:%s\n",
+    g_fprintf(stderr, _("%s: time %s: setting up estimates for %s:%s\n"),
                    get_pname(), walltime_str(curclock()),
                    dp->host->hostname, qname);
 
@@ -733,13 +687,12 @@ setup_estimate(
 
     if(get_info(dp->host->hostname, dp->name, &info)) {
        /* no record for this disk, make a note of it */
-       log_add(L_INFO, "Adding new disk %s:%s.", dp->host->hostname, dp->name);
+       log_add(L_INFO, _("Adding new disk %s:%s."), dp->host->hostname, dp->name);
     }
 
     /* setup working data struct for disk */
 
     ep = alloc(SIZEOF(est_t));
-    malloc_mark(ep);
     dp->up = (void *) ep;
     ep->state = DISK_READY;
     ep->dump_nsize = (off_t)-1;
@@ -765,13 +718,13 @@ setup_estimate(
             * now.
             */
            log_add(L_ERROR,
-                   "Cannot force full dump of %s:%s with no-full option.",
+                   _("Cannot force full dump of %s:%s with no-full option."),
                    dp->host->hostname, qname);
 
            /* clear force command */
            CLR(info.command, FORCE_FULL);
            if(put_info(dp->host->hostname, dp->name, &info)) {
-               error("could not put info record for %s:%s: %s",
+               error(_("could not put info record for %s:%s: %s"),
                      dp->host->hostname, qname, strerror(errno));
                /*NOTREACHED*/
            }
@@ -781,7 +734,7 @@ setup_estimate(
        else {
            ep->last_level = -1;
            ep->next_level0 = -conf_dumpcycle;
-           log_add(L_INFO, "Forcing full dump of %s:%s as directed.",
+           log_add(L_INFO, _("Forcing full dump of %s:%s as directed."),
                    dp->host->hostname, qname);
        }
     }
@@ -801,22 +754,23 @@ setup_estimate(
     if (ep->last_level > -1 && strlen(info.inf[0].label) > 0) {
        overwrite_runs = when_overwrite(info.inf[0].label);
        if(overwrite_runs == 0) {
-           log_add(L_WARNING, "Last full dump of %s:%s "
-                   "on tape %s overwritten on this run.",
+           log_add(L_WARNING, _("Last full dump of %s:%s "
+                   "on tape %s overwritten on this run."),
                    dp->host->hostname, qname, info.inf[0].label);
-       }
-       else if(overwrite_runs <= RUNS_REDZONE) {
-           log_add(L_WARNING, "Last full dump of %s:%s on "
-                   "tape %s overwritten in %d run%s.",
+       } else if(overwrite_runs <= RUNS_REDZONE) {
+           log_add(L_WARNING,
+                   plural(_("Last full dump of %s:%s on tape %s overwritten in %d run."),
+                          _("Last full dump of %s:%s on tape %s overwritten in %d runs."), overwrite_runs),
                    dp->host->hostname, qname, info.inf[0].label,
-                   overwrite_runs, overwrite_runs == 1? "" : "s");
+                   overwrite_runs);
        }
     }
 
     if(ep->next_level0 < 0) {
-       fprintf(stderr,"%s:%s overdue %d day%s for level 0\n",
-               dp->host->hostname, qname,
-               - ep->next_level0, ((- ep->next_level0) == 1) ? "" : "s");
+       g_fprintf(stderr,plural(_("%s:%s overdue %d day for level 0\n"),
+                             _("%s:%s overdue %d days for level 0\n"),
+                             (-ep->next_level0)),
+               dp->host->hostname, qname, (-ep->next_level0));
        ep->dump_priority -= ep->next_level0;
     }
     else if (ISSET(info.command, FORCE_FULL))
@@ -833,21 +787,21 @@ setup_estimate(
            ep->next_level0 += conf_dumpcycle;
            ep->last_level = 0;
            if(put_info(dp->host->hostname, dp->name, &info)) {
-               error("could not put info record for %s:%s: %s",
+               error(_("could not put info record for %s:%s: %s"),
                      dp->host->hostname, qname, strerror(errno));
                /*NOTREACHED*/
            }
-           log_add(L_INFO, "Skipping full dump of %s:%s today.",
+           log_add(L_INFO, _("Skipping full dump of %s:%s today."),
                    dp->host->hostname, qname);
-           fprintf(stderr,"%s:%s lev 0 skipped due to skip-full flag\n",
+           g_fprintf(stderr,_("%s:%s lev 0 skipped due to skip-full flag\n"),
                    dp->host->hostname, qname);
            /* don't enqueue the disk */
            askfor(ep, 0, -1, &info);
            askfor(ep, 1, -1, &info);
            askfor(ep, 2, -1, &info);
-           fprintf(stderr, "%s: SKIPPED %s %s 0 [skip-full]\n",
+           g_fprintf(stderr, _("%s: SKIPPED %s %s 0 [skip-full]\n"),
                    get_pname(), dp->host->hostname, qname);
-           log_add(L_SUCCESS, "%s %s %s 0 [skipped: skip-full]",
+           log_add(L_SUCCESS, _("%s %s %s 0 [skipped: skip-full]"),
                    dp->host->hostname, qname, planner_timestamp);
            amfree(qname);
            return;
@@ -859,7 +813,7 @@ setup_estimate(
        }
 
        if(ep->next_level0 == 1) {
-           log_add(L_WARNING, "Skipping full dump of %s:%s tomorrow.",
+           log_add(L_WARNING, _("Skipping full dump of %s:%s tomorrow."),
                    dp->host->hostname, qname);
        }
     }
@@ -869,9 +823,9 @@ setup_estimate(
        askfor(ep, 0, -1, &info);
        askfor(ep, 1, -1, &info);
        askfor(ep, 2, -1, &info);
-       log_add(L_FAIL, "%s %s 19000101 1 [Skipping incronly because no full dump were done]",
+       log_add(L_FAIL, _("%s %s 19000101 1 [Skipping incronly because no full dump were done]"),
                dp->host->hostname, qname);
-       fprintf(stderr,"%s:%s lev 1 skipped due to strategy incronly and no full dump were done\n",
+       g_fprintf(stderr,_("%s:%s lev 1 skipped due to strategy incronly and no full dump were done\n"),
                dp->host->hostname, qname);
        amfree(qname);
        return;
@@ -880,17 +834,17 @@ setup_estimate(
     /* handle "skip-incr" type archives */
 
     if(dp->skip_incr && ep->next_level0 > 0) {
-       fprintf(stderr,"%s:%s lev 1 skipped due to skip-incr flag\n",
+       g_fprintf(stderr,_("%s:%s lev 1 skipped due to skip-incr flag\n"),
                dp->host->hostname, qname);
        /* don't enqueue the disk */
        askfor(ep, 0, -1, &info);
        askfor(ep, 1, -1, &info);
        askfor(ep, 2, -1, &info);
 
-       fprintf(stderr, "%s: SKIPPED %s %s 1 [skip-incr]\n",
+       g_fprintf(stderr, _("%s: SKIPPED %s %s 1 [skip-incr]\n"),
                get_pname(), dp->host->hostname, qname);
 
-       log_add(L_SUCCESS, "%s %s %s 1 [skipped: skip-incr]",
+       log_add(L_SUCCESS, _("%s %s %s 1 [skipped: skip-incr]"),
                dp->host->hostname, qname, planner_timestamp);
        amfree(qname);
        return;
@@ -899,8 +853,8 @@ setup_estimate(
     if( ep->last_level == -1 && ep->next_level0 > 0 && 
        dp->strategy != DS_NOFULL && dp->strategy != DS_INCRONLY &&
        conf_reserve == 100) {
-       log_add(L_WARNING, "%s:%s mismatch: no tapelist record, "
-               "but curinfo next_level0: %d.",
+       log_add(L_WARNING, _("%s:%s mismatch: no tapelist record, "
+               "but curinfo next_level0: %d."),
                dp->host->hostname, qname, ep->next_level0);
        ep->next_level0 = 0;
     }
@@ -926,7 +880,7 @@ setup_estimate(
          ep->last_level == -1))) {
        if(info.command & FORCE_BUMP && ep->last_level == -1) {
            log_add(L_INFO,
-                 "Remove force-bump command of %s:%s because it's a new disk.",
+                 _("Remove force-bump command of %s:%s because it's a new disk."),
                    dp->host->hostname, qname);
        }
        switch (dp->strategy) {
@@ -934,13 +888,13 @@ setup_estimate(
        case DS_NOINC:
            askfor(ep, i++, 0, &info);
            if(dp->skip_full) {
-               log_add(L_INFO, "Ignoring skip_full for %s:%s "
-                       "because the strategy is NOINC.",
+               log_add(L_INFO, _("Ignoring skip_full for %s:%s "
+                       "because the strategy is NOINC."),
                        dp->host->hostname, qname);
            }
            if(info.command & FORCE_BUMP) {
                log_add(L_INFO,
-                "Ignoring FORCE_BUMP for %s:%s because the strategy is NOINC.",
+                _("Ignoring FORCE_BUMP for %s:%s because the strategy is NOINC."),
                        dp->host->hostname, qname);
            }
            
@@ -972,12 +926,12 @@ setup_estimate(
                if(curr_level > 0) { /* level 0 already asked for */
                    askfor(ep, i++, curr_level, &info);
                }
-               log_add(L_INFO,"Preventing bump of %s:%s as directed.",
+               log_add(L_INFO,_("Preventing bump of %s:%s as directed."),
                        dp->host->hostname, qname);
            } else if (ISSET(info.command, FORCE_BUMP)
                       && curr_level + 1 < DUMP_LEVELS) {
                askfor(ep, i++, curr_level+1, &info);
-               log_add(L_INFO,"Bumping of %s:%s at level %d as directed.",
+               log_add(L_INFO,_("Bumping of %s:%s at level %d as directed."),
                        dp->host->hostname, qname, curr_level+1);
            } else if (curr_level == 0) {
                askfor(ep, i++, 1, &info);
@@ -1005,18 +959,18 @@ setup_estimate(
 
     /* debug output */
 
-    fprintf(stderr, "setup_estimate: %s:%s: command %u, options: %s    "
+    g_fprintf(stderr, _("setup_estimate: %s:%s: command %u, options: %s    "
            "last_level %d next_level0 %d level_days %d    getting estimates "
-           "%d (" OFF_T_FMT ") %d (" OFF_T_FMT ") %d (" OFF_T_FMT ")\n",
+           "%d (%lld) %d (%lld) %d (%lld)\n"),
            dp->host->hostname, qname, info.command,
            dp->strategy == DS_NOFULL ? "no-full" :
                 dp->strategy == DS_INCRONLY ? "incr-only" :
                 dp->skip_full ? "skip-full" :
                 dp->skip_incr ? "skip-incr" : "none",
            ep->last_level, ep->next_level0, ep->level_days,
-           ep->level[0], (OFF_T_FMT_TYPE)ep->est_size[0],
-           ep->level[1], (OFF_T_FMT_TYPE)ep->est_size[1],
-           ep->level[2], (OFF_T_FMT_TYPE)ep->est_size[2]);
+           ep->level[0], (long long)ep->est_size[0],
+           ep->level[1], (long long)ep->est_size[1],
+           ep->level[2], (long long)ep->est_size[2]);
 
     assert(ep->level[0] != -1);
     enqueue_disk(&startq, dp);
@@ -1247,7 +1201,7 @@ static void get_estimates(void)
 
     while(!empty(waitq)) {
        disk_t *dp = dequeue_disk(&waitq);
-       est(dp)->errstr = "hmm, disk was stranded on waitq";
+       est(dp)->errstr = _("hmm, disk was stranded on waitq");
        enqueue_disk(&failq, dp);
     }
 
@@ -1257,12 +1211,12 @@ static void get_estimates(void)
        
        if(est(dp)->level[0] != -1 && est(dp)->est_size[0] < (off_t)0) {
            if(est(dp)->est_size[0] == (off_t)-1) {
-               log_add(L_WARNING, "disk %s:%s, estimate of level %d failed.",
+               log_add(L_WARNING, _("disk %s:%s, estimate of level %d failed."),
                        dp->host->hostname, qname, est(dp)->level[0]);
            }
            else {
                log_add(L_WARNING,
-                       "disk %s:%s, estimate of level %d timed out.",
+                       _("disk %s:%s, estimate of level %d timed out."),
                        dp->host->hostname, qname, est(dp)->level[0]);
            }
            est(dp)->level[0] = -1;
@@ -1271,12 +1225,12 @@ static void get_estimates(void)
        if(est(dp)->level[1] != -1 && est(dp)->est_size[1] < (off_t)0) {
            if(est(dp)->est_size[1] == (off_t)-1) {
                log_add(L_WARNING,
-                       "disk %s:%s, estimate of level %d failed.",
+                       _("disk %s:%s, estimate of level %d failed."),
                        dp->host->hostname, qname, est(dp)->level[1]);
            }
            else {
                log_add(L_WARNING,
-                       "disk %s:%s, estimate of level %d timed out.",
+                       _("disk %s:%s, estimate of level %d timed out."),
                        dp->host->hostname, qname, est(dp)->level[1]);
            }
            est(dp)->level[1] = -1;
@@ -1285,12 +1239,12 @@ static void get_estimates(void)
        if(est(dp)->level[2] != -1 && est(dp)->est_size[2] < (off_t)0) {
            if(est(dp)->est_size[2] == (off_t)-1) {
                log_add(L_WARNING,
-                       "disk %s:%s, estimate of level %d failed.",
+                       _("disk %s:%s, estimate of level %d failed."),
                        dp->host->hostname, qname, est(dp)->level[2]);
            }
            else {
                log_add(L_WARNING,
-                       "disk %s:%s, estimate of level %d timed out.",
+                       _("disk %s:%s, estimate of level %d timed out."),
                        dp->host->hostname, qname, est(dp)->level[2]);
            }
            est(dp)->level[2] = -1;
@@ -1303,7 +1257,7 @@ static void get_estimates(void)
        }
        else {
           est(dp)->errstr = vstralloc("disk ", qname,
-                                      ", all estimate timed out", NULL);
+                                      _(", all estimate timed out"), NULL);
           enqueue_disk(&failq, dp);
        }
        amfree(qname);
@@ -1350,7 +1304,7 @@ static void getsize(
        int has_config   = am_has_feature(hostp->features,
                                          fe_req_options_config);
 
-       snprintf(number, SIZEOF(number), "%d", hostp->maxdumps);
+       g_snprintf(number, SIZEOF(number), "%d", hostp->maxdumps);
        req = vstralloc("SERVICE ", "sendsize", "\n",
                        "OPTIONS ",
                        has_features ? "features=" : "",
@@ -1404,13 +1358,13 @@ static void getsize(
 
                    if(lev == -1) break;
 
-                   snprintf(level, SIZEOF(level), "%d", lev);
-                   snprintf(spindle, SIZEOF(spindle), "%d", dp->spindle);
+                   g_snprintf(level, SIZEOF(level), "%d", lev);
+                   g_snprintf(spindle, SIZEOF(spindle), "%d", dp->spindle);
                    if(am_has_feature(hostp->features,fe_sendsize_req_options)){
                        exclude1 = " OPTIONS |";
                        exclude2 = optionstr(dp, hostp->features, NULL);
                        if ( exclude2 == NULL ) {
-                         error("problem with option string, check the dumptype definition.\n");
+                         error(_("problem with option string, check the dumptype definition.\n"));
                        }
                        excludefree = exclude2;
                        includefree = NULL;
@@ -1448,7 +1402,7 @@ static void getsize(
 
                    if(dp->estimate == ES_CALCSIZE &&
                       !am_has_feature(hostp->features, fe_calcsize_estimate)) {
-                       log_add(L_WARNING,"%s:%s does not support CALCSIZE for estimate, using CLIENT.\n",
+                       log_add(L_WARNING,_("%s:%s does not support CALCSIZE for estimate, using CLIENT.\n"),
                                hostp->hostname, qname);
                        dp->estimate = ES_CLIENT;
                    }
@@ -1584,13 +1538,13 @@ static void getsize(
                        }
                    }
                }
-               fprintf(stderr,"%s time %s: got result for host %s disk %s:",
+               g_fprintf(stderr,_("%s time %s: got result for host %s disk %s:"),
                        get_pname(), walltime_str(curclock()),
                        dp->host->hostname, qname);
-               fprintf(stderr," %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K\n",
-                       est(dp)->level[0], (OFF_T_FMT_TYPE)est(dp)->est_size[0],
-                       est(dp)->level[1], (OFF_T_FMT_TYPE)est(dp)->est_size[1],
-                       est(dp)->level[2], (OFF_T_FMT_TYPE)est(dp)->est_size[2]);
+               g_fprintf(stderr,_(" %d -> %lldK, %d -> %lldK, %d -> %lldK\n"),
+                       est(dp)->level[0], (long long)est(dp)->est_size[0],
+                       est(dp)->level[1], (long long)est(dp)->est_size[1],
+                       est(dp)->level[2], (long long)est(dp)->est_size[2]);
                est(dp)->state = DISK_DONE;
                remove_disk(&startq, dp);
                enqueue_disk(&estq, dp);
@@ -1625,9 +1579,12 @@ static void getsize(
 
     secdrv = security_getdriver(hostp->disks->security_driver);
     if (secdrv == NULL) {
-       error("could not find security driver '%s' for host '%s'",
-           hostp->disks->security_driver, hostp->hostname);
-       /*NOTREACHED*/
+       hostp->up = HOST_DONE;
+       log_add(L_ERROR,
+               _("Could not find security driver '%s' for host '%s'"),
+               hostp->disks->security_driver, hostp->hostname);
+       amfree(req);
+       return;
     }
     hostp->up = HOST_ACTIVE;
 
@@ -1643,6 +1600,7 @@ static void getsize(
 
     protocol_sendreq(hostp->hostname, secdrv, amhost_get_security_conf, 
        req, timeout, handle_result, hostp);
+
     amfree(req);
 }
 
@@ -1678,14 +1636,14 @@ static void handle_result(
     int tch;
     char *qname;
     char *disk;
-    OFF_T_FMT_TYPE size_;
+    long long size_;
 
     hostp = (am_host_t *)datap;
     hostp->up = HOST_READY;
 
     if (pkt == NULL) {
-       errbuf = vstralloc("Request to ", hostp->hostname, " failed: ", 
-           security_geterror(sech), NULL);
+       errbuf = vstrallocf(_("Request to %s failed: %s"),
+                       hostp->hostname, security_geterror(sech));
        goto error_return;
     }
     if (pkt->type == P_NAK) {
@@ -1721,11 +1679,8 @@ static void handle_result(
                t += SIZEOF("features=")-1;
                am_release_feature_set(hostp->features);
                if((hostp->features = am_string_to_feature(t)) == NULL) {
-                   errbuf = vstralloc(hostp->hostname,
-                                      ": bad features value: ",
-                                      line,
-                                      "\n",
-                                      NULL);
+                   errbuf = vstrallocf(hostp->hostname,
+                                      _(": bad features value: %s\n"), line);
                    goto error_return;
                }
            }
@@ -1779,18 +1734,17 @@ static void handle_result(
        dp = lookup_hostdisk(hostp, disk);
        dp = lookup_hostdisk(hostp, disk);
        if(dp == NULL) {
-           log_add(L_ERROR, "%s: invalid reply from sendsize: `%s'\n",
+           log_add(L_ERROR, _("%s: invalid reply from sendsize: `%s'\n"),
                    hostp->hostname, line);
            goto bad_msg;
        }
 
        size = (off_t)-1;
        if (strncmp_const(t-1,"SIZE ") == 0) {
-           if (sscanf(t - 1, "SIZE " OFF_T_FMT ,
-                      (OFF_T_FMT_TYPE *)&size_) != 1) {
+           if (sscanf(t - 1, "SIZE %lld", &size_) != 1) {
                goto bad_msg;
            }
-           size = size_;
+           size = (off_t)size_;
        } else if (strncmp_const(t-1,"ERROR ") == 0) {
            skip_non_whitespace(t, tch);
            skip_whitespace(t, tch);
@@ -1830,8 +1784,7 @@ static void handle_result(
         * The client does not support the features list, so give it an
         * empty one.
         */
-       dbprintf(("%s: no feature set from host %s\n",
-                 debug_prefix_time(NULL), hostp->hostname));
+       dbprintf(_("no feature set from host %s\n"), hostp->hostname);
        hostp->features = am_set_default_feature_set();
     }
 
@@ -1864,43 +1817,43 @@ static void handle_result(
 
        qname = quote_string(dp->name);
        if(pkt->type == P_PREP) {
-               fprintf(stderr,"%s: time %s: got partial result for host %s disk %s:",
+               g_fprintf(stderr,_("%s: time %s: got partial result for host %s disk %s:"),
                        get_pname(), walltime_str(curclock()),
                        dp->host->hostname, qname);
-               fprintf(stderr," %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K\n",
-                       est(dp)->level[0], (OFF_T_FMT_TYPE)est(dp)->est_size[0],
-                       est(dp)->level[1], (OFF_T_FMT_TYPE)est(dp)->est_size[1],
-                       est(dp)->level[2], (OFF_T_FMT_TYPE)est(dp)->est_size[2]);
+               g_fprintf(stderr,_(" %d -> %lldK, %d -> %lldK, %d -> %lldK\n"),
+                       est(dp)->level[0], (long long)est(dp)->est_size[0],
+                       est(dp)->level[1], (long long)est(dp)->est_size[1],
+                       est(dp)->level[2], (long long)est(dp)->est_size[2]);
            enqueue_disk(&pestq, dp);
        }
        else if(pkt->type == P_REP) {
-               fprintf(stderr,"%s: time %s: got result for host %s disk %s:",
+               g_fprintf(stderr,_("%s: time %s: got result for host %s disk %s:"),
                        get_pname(), walltime_str(curclock()),
                        dp->host->hostname, qname);
-               fprintf(stderr," %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K, %d -> " OFF_T_FMT "K\n",
-                       est(dp)->level[0], (OFF_T_FMT_TYPE)est(dp)->est_size[0],
-                       est(dp)->level[1], (OFF_T_FMT_TYPE)est(dp)->est_size[1],
-                       est(dp)->level[2], (OFF_T_FMT_TYPE)est(dp)->est_size[2]);
+               g_fprintf(stderr,_(" %d -> %lldK, %d -> %lldK, %d -> %lldK\n"),
+                       est(dp)->level[0], (long long)est(dp)->est_size[0],
+                       est(dp)->level[1], (long long)est(dp)->est_size[1],
+                       est(dp)->level[2], (long long)est(dp)->est_size[2]);
                if((est(dp)->level[0] != -1 && est(dp)->est_size[0] > (off_t)0) ||
                   (est(dp)->level[1] != -1 && est(dp)->est_size[1] > (off_t)0) ||
                   (est(dp)->level[2] != -1 && est(dp)->est_size[2] > (off_t)0)) {
 
                    if(est(dp)->level[2] != -1 && est(dp)->est_size[2] < (off_t)0) {
                        log_add(L_WARNING,
-                               "disk %s:%s, estimate of level %d failed.",
+                               _("disk %s:%s, estimate of level %d failed."),
                                dp->host->hostname, qname, est(dp)->level[2]);
                        est(dp)->level[2] = -1;
                    }
                    if(est(dp)->level[1] != -1 && est(dp)->est_size[1] < (off_t)0) {
                        log_add(L_WARNING,
-                               "disk %s:%s, estimate of level %d failed.",
+                               _("disk %s:%s, estimate of level %d failed."),
                                dp->host->hostname, qname,
                                est(dp)->level[1]);
                        est(dp)->level[1] = -1;
                    }
                    if(est(dp)->level[0] != -1 && est(dp)->est_size[0] < (off_t)0) {
                        log_add(L_WARNING,
-                               "disk %s:%s, estimate of level %d failed.",
+                               _("disk %s:%s, estimate of level %d failed."),
                                dp->host->hostname, qname, est(dp)->level[0]);
                        est(dp)->level[0] = -1;
                    }
@@ -1909,18 +1862,16 @@ static void handle_result(
            else {
                enqueue_disk(&failq, dp);
                if(est(dp)->got_estimate) {
-                   est(dp)->errstr = vstralloc("disk ", qname,
-                                               ", all estimate failed", NULL);
+                   est(dp)->errstr = vstrallocf("disk %s, all estimate failed",
+                                                qname);
                }
                else {
-                   fprintf(stderr,
-                        "error result for host %s disk %s: missing estimate\n",
+                   g_fprintf(stderr,
+                        _("error result for host %s disk %s: missing estimate\n"),
                         dp->host->hostname, qname);
                    if (est(dp)->errstr == NULL) {
-                       est(dp)->errstr = vstralloc("missing result for ",
-                                                   qname, " in ",
-                                                   dp->host->hostname,
-                                                   " response", NULL);
+                       est(dp)->errstr = vstrallocf(_("missing result for %s in %s response"),
+                                                   qname, dp->host->hostname);
                    }
                }
            }
@@ -1928,39 +1879,42 @@ static void handle_result(
        amfree(qname);
     }
     getsize(hostp);
+    /* try to clean up any defunct processes, since Amanda doesn't wait() for
+       them explicitly */
+    while(waitpid(-1, NULL, WNOHANG)> 0);
     return;
 
  NAK_parse_failed:
 
-    errbuf = stralloc2(hostp->hostname, " NAK: [NAK parse failed]");
-    fprintf(stderr, "got strange nak from %s:\n----\n%s----\n\n",
+    errbuf = vstrallocf(_("%s NAK: [NAK parse failed]"), hostp->hostname);
+    g_fprintf(stderr, _("got strange nak from %s:\n----\n%s----\n\n"),
            hostp->hostname, pkt->body);
     goto error_return;
 
  bad_msg:
-    fprintf(stderr,"got a bad message, stopped at:\n");
+    g_fprintf(stderr,_("got a bad message, stopped at:\n"));
     /*@ignore@*/
-    fprintf(stderr,"----\n%s----\n\n", line);
-    errbuf = stralloc2("badly formatted response from ", hostp->hostname);
+    g_fprintf(stderr,_("----\n%s----\n\n"), line);
+    errbuf = stralloc2(_("badly formatted response from "), hostp->hostname);
     /*@end@*/
 
  error_return:
     i = 0;
     for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
-       if(est(dp)->state != DISK_ACTIVE) continue;
-       qname = quote_string(dp->name);
-       est(dp)->state = DISK_DONE;
-       if(est(dp)->state == DISK_ACTIVE) {
-           est(dp)->state = DISK_DONE;
-           remove_disk(&waitq, dp);
-           enqueue_disk(&failq, dp);
-           i++;
+       if (dp->todo) {
+           if(est(dp)->state == DISK_ACTIVE) {
+               qname = quote_string(dp->name);
+               est(dp)->state = DISK_DONE;
+               remove_disk(&waitq, dp);
+               enqueue_disk(&failq, dp);
+               i++;
 
-           est(dp)->errstr = stralloc(errbuf);
-           fprintf(stderr, "error result for host %s disk %s: %s\n",
-                   dp->host->hostname, qname, errbuf);
+               est(dp)->errstr = stralloc(errbuf);
+               g_fprintf(stderr, _("error result for host %s disk %s: %s\n"),
+                         dp->host->hostname, qname, errbuf);
+               amfree(qname);
+           }
        }
-       amfree(qname);
     }
     if(i == 0) {
        /*
@@ -1971,6 +1925,9 @@ static void handle_result(
     }
     hostp->up = HOST_DONE;
     amfree(errbuf);
+    /* try to clean up any defunct processes, since Amanda doesn't wait() for
+       them explicitly */
+    while(waitpid(-1, NULL, WNOHANG)> 0);
 }
 
 
@@ -1995,9 +1952,9 @@ static void analyze_estimate(
 
     ep = est(dp);
 
-    fprintf(stderr, "pondering %s:%s... ",
+    g_fprintf(stderr, _("pondering %s:%s... "),
            dp->host->hostname, qname);
-    fprintf(stderr, "next_level0 %d last_level %d ",
+    g_fprintf(stderr, _("next_level0 %d last_level %d "),
            ep->next_level0, ep->last_level);
 
     if(get_info(dp->host->hostname, dp->name, &info) == 0) {
@@ -2011,14 +1968,14 @@ static void analyze_estimate(
     if(ep->next_level0 <= 0 || (have_info && ep->last_level == 0
        && (info.command & FORCE_NO_BUMP))) {
        if(ep->next_level0 <= 0) {
-           fprintf(stderr,"(due for level 0) ");
+           g_fprintf(stderr,_("(due for level 0) "));
        }
        ep->dump_level = 0;
        ep->dump_nsize = est_size(dp, 0);
        ep->dump_csize = est_tape_size(dp, 0);
        if(ep->dump_csize <= (off_t)0) {
-           fprintf(stderr,
-                   "(no estimate for level 0, picking an incr level)\n");
+           g_fprintf(stderr,
+                   _("(no estimate for level 0, picking an incr level)\n"));
            ep->dump_level = pick_inclevel(dp);
            ep->dump_nsize = est_size(dp, ep->dump_level);
            ep->dump_csize = est_tape_size(dp, ep->dump_level);
@@ -2032,15 +1989,15 @@ static void analyze_estimate(
        else {
            total_lev0 += (double) ep->dump_csize;
            if(ep->last_level == -1 || dp->skip_incr) {
-               fprintf(stderr,"(%s disk, can't switch to degraded mode)\n",
-                       dp->skip_incr? "skip-incr":"new");
+               g_fprintf(stderr,_("(%s disk, can't switch to degraded mode)\n"),
+                       dp->skip_incr? "skip-incr":_("new"));
                ep->degr_level = -1;
                ep->degr_nsize = (off_t)-1;
                ep->degr_csize = (off_t)-1;
            }
            else {
                /* fill in degraded mode info */
-               fprintf(stderr,"(picking inclevel for degraded mode)");
+               g_fprintf(stderr,_("(picking inclevel for degraded mode)"));
                ep->degr_level = pick_inclevel(dp);
                ep->degr_nsize = est_size(dp, ep->degr_level);
                ep->degr_csize = est_tape_size(dp, ep->degr_level);
@@ -2050,15 +2007,15 @@ static void analyze_estimate(
                    ep->degr_csize = est_tape_size(dp, ep->degr_level);
                }
                if(ep->degr_csize == (off_t)-1) {
-                   fprintf(stderr,"(no inc estimate)");
+                   g_fprintf(stderr,_("(no inc estimate)"));
                    ep->degr_level = -1;
                }
-               fprintf(stderr,"\n");
+               g_fprintf(stderr,"\n");
            }
        }
     }
     else {
-       fprintf(stderr,"(not due for a full dump, picking an incr level)\n");
+       g_fprintf(stderr,_("(not due for a full dump, picking an incr level)\n"));
        /* XXX - if this returns -1 may be we should force a total? */
        ep->dump_level = pick_inclevel(dp);
        ep->dump_nsize = est_size(dp, ep->dump_level);
@@ -2081,9 +2038,9 @@ static void analyze_estimate(
        }
     }
 
-    fprintf(stderr,"  curr level %d nsize " OFF_T_FMT " csize " OFF_T_FMT " ",
-           ep->dump_level, (OFF_T_FMT_TYPE)ep->dump_nsize, 
-            (OFF_T_FMT_TYPE)ep->dump_csize);
+    g_fprintf(stderr,_("  curr level %d nsize %lld csize %lld "),
+           ep->dump_level, (long long)ep->dump_nsize, 
+            (long long)ep->dump_csize);
 
     insert_disk(&schedq, dp, schedule_order);
 
@@ -2100,50 +2057,29 @@ static void analyze_estimate(
        balanced_size += (double)(lev0size / (off_t)runs_per_cycle);
     }
 
-    fprintf(stderr,"total size " OFF_T_FMT " total_lev0 %1.0lf balanced-lev0size %1.0lf\n",
-           (OFF_T_FMT_TYPE)total_size, total_lev0, balanced_size);
+    g_fprintf(stderr,_("total size %lld total_lev0 %1.0lf balanced-lev0size %1.0lf\n"),
+           (long long)total_size, total_lev0, balanced_size);
     amfree(qname);
 }
 
 static void handle_failed(
     disk_t *dp)
 {
-    char *errstr;
+    char *errstr, *errstr1, *qerrstr;
     char *qname = quote_string(dp->name);
 
-/*
- * From George Scott <George.Scott@cc.monash.edu.au>:
- * --------
- * If a machine is down when the planner is run it guesses from historical
- * data what the size of tonights dump is likely to be and schedules a
- * dump anyway.  The dumper then usually discovers that that machine is
- * still down and ends up with a half full tape.  Unfortunately the
- * planner had to delay another dump because it thought that the tape was
- * full.  The fix here is for the planner to ignore unavailable machines
- * rather than ignore the fact that they are unavailable.
- * --------
- */
-
-#ifdef old_behavior
-    if(est(dp)->last_level != -1) {
-       log_add(L_WARNING,
-               "Could not get estimate for %s:%s, using historical data.",
-               dp->host->hostname, qname);
-       analyze_estimate(dp);
-       amfree(qname);
-       return;
-    }
-#endif
-
-    errstr = est(dp)->errstr? est(dp)->errstr : "hmm, no error indicator!";
+    errstr = est(dp)->errstr? est(dp)->errstr : _("hmm, no error indicator!");
+    errstr1 = vstralloc("[",errstr,"]", NULL);
+    qerrstr = quote_string(errstr1);
+    amfree(errstr1);
 
-fprintf(stderr,"errstr:%s:\n", errstr);
-    fprintf(stderr, "%s: FAILED %s %s %s 0 [%s]\n",
-       get_pname(), dp->host->hostname, qname, planner_timestamp, errstr);
+    g_fprintf(stderr, _("%s: FAILED %s %s %s 0 %s\n"),
+       get_pname(), dp->host->hostname, qname, planner_timestamp, qerrstr);
 
-    log_add(L_FAIL, "%s %s %s 0 [%s]", dp->host->hostname, qname, 
-           planner_timestamp, errstr);
+    log_add(L_FAIL, _("%s %s %s 0 %s"), dp->host->hostname, qname, 
+           planner_timestamp, qerrstr);
 
+    amfree(qerrstr);
     amfree(qname);
     /* XXX - memory leak with *dp */
 }
@@ -2183,13 +2119,13 @@ static int pick_inclevel(
 
     /* if last night was level 0, do level 1 tonight, no ifs or buts */
     if(base_level == 0) {
-       fprintf(stderr,"   picklev: last night 0, so tonight level 1\n");
+       g_fprintf(stderr,_("   picklev: last night 0, so tonight level 1\n"));
        return 1;
     }
 
     /* if no-full option set, always do level 1 */
     if(dp->strategy == DS_NOFULL) {
-       fprintf(stderr,"   picklev: no-full set, so always level 1\n");
+       g_fprintf(stderr,_("   picklev: no-full set, so always level 1\n"));
        return 1;
     }
 
@@ -2200,16 +2136,16 @@ static int pick_inclevel(
        base_size = est_size(dp, base_level+1);
        if(base_size > (off_t)0) /* FORCE_BUMP */
            return base_level+1;
-       fprintf(stderr,"   picklev: no estimate for level %d, so no incs\n", base_level);
+       g_fprintf(stderr,_("   picklev: no estimate for level %d, so no incs\n"), base_level);
        return base_level;
     }
 
     thresh = bump_thresh(base_level, est_size(dp, 0), dp->bumppercent, dp->bumpsize, dp->bumpmult);
 
-    fprintf(stderr,
-           "   pick: size " OFF_T_FMT " level %d days %d (thresh " OFF_T_FMT "K, %d days)\n",
-           (OFF_T_FMT_TYPE)base_size, base_level, est(dp)->level_days,
-           (OFF_T_FMT_TYPE)thresh, dp->bumpdays);
+    g_fprintf(stderr,
+           _("   pick: size %lld level %d days %d (thresh %lldK, %d days)\n"),
+           (long long)base_size, base_level, est(dp)->level_days,
+           (long long)thresh, dp->bumpdays);
 
     if(base_level == 9
        || est(dp)->level_days < dp->bumpdays
@@ -2221,17 +2157,17 @@ static int pick_inclevel(
 
     if(bump_size == (off_t)-1) return base_level;
 
-    fprintf(stderr, "   pick: next size " OFF_T_FMT "... ",
-           (OFF_T_FMT_TYPE)bump_size);
+    g_fprintf(stderr, _("   pick: next size %lld... "),
+           (long long)bump_size);
 
     if(base_size - bump_size < thresh) {
-       fprintf(stderr, "not bumped\n");
+       g_fprintf(stderr, _("not bumped\n"));
        return base_level;
     }
 
     qname = quote_string(dp->name);
-    fprintf(stderr, "BUMPED\n");
-    log_add(L_INFO, "Incremental of %s:%s bumped to level %d.",
+    g_fprintf(stderr, _("BUMPED\n"));
+    log_add(L_INFO, _("Incremental of %s:%s bumped to level %d."),
            dp->host->hostname, qname, bump_level);
     amfree(qname);
 
@@ -2309,16 +2245,14 @@ static void delay_dumps(void)
        if (full_size > tapetype_get_length(tape) * (off_t)avail_tapes) {
            char *qname = quote_string(dp->name);
            if (conf_runtapes > 1 && dp->tape_splitsize == (off_t)0) {
-               log_add(L_WARNING, "disk %s:%s, full dump (" OFF_T_FMT 
-                       "KB) will be larger than available tape space"
-                       ", you could define a splitsize",
+               log_add(L_WARNING, _("disk %s:%s, full dump (%lldKB) will be larger than available tape space"
+                       ", you could define a splitsize"),
                        dp->host->hostname, qname,
-                       (OFF_T_FMT_TYPE)full_size);
+                       (long long)full_size);
            } else {
-               log_add(L_WARNING, "disk %s:%s, full dump (" OFF_T_FMT 
-                       "KB) will be larger than available tape space",
+               log_add(L_WARNING, _("disk %s:%s, full dump (%lldKB) will be larger than available tape space"),
                        dp->host->hostname, qname,
-                       (OFF_T_FMT_TYPE)full_size);
+                       (long long)full_size);
            }
            amfree(qname);
        }
@@ -2329,36 +2263,36 @@ static void delay_dumps(void)
        }
 
        /* Format dumpsize for messages */
-       snprintf(est_kb, 20, OFF_T_FMT " KB,",
-                (OFF_T_FMT_TYPE)est(dp)->dump_csize);
+       g_snprintf(est_kb, 20, "%lld KB,",
+                (long long)est(dp)->dump_csize);
 
        if(est(dp)->dump_level == 0) {
            if(dp->skip_incr) {
                delete = 1;
-               message = "but cannot incremental dump skip-incr disk";
+               message = _("but cannot incremental dump skip-incr disk");
            }
            else if(est(dp)->last_level < 0) {
                delete = 1;
-               message = "but cannot incremental dump new disk";
+               message = _("but cannot incremental dump new disk");
            }
            else if(est(dp)->degr_level < 0) {
                delete = 1;
-               message = "but no incremental estimate";
+               message = _("but no incremental estimate");
            }
            else if (est(dp)->degr_csize > tapetype_get_length(tape)) {
                delete = 1;
-               message = "incremental dump also larger than tape";
+               message = _("incremental dump also larger than tape");
            }
            else {
                delete = 0;
-               message = "full dump delayed";
+               message = _("full dump delayed");
            }
        }
        else {
            delete = 1;
-           message = "skipping incremental";
+           message = _("skipping incremental");
        }
-       delay_one_dump(dp, delete, "dump larger than available tape space,",
+       delay_one_dump(dp, delete, _("dump larger than available tape space,"),
                       est_kb, message, NULL);
     }
 
@@ -2399,26 +2333,26 @@ static void delay_dumps(void)
        if(dp != preserve) {
 
            /* Format dumpsize for messages */
-           snprintf(est_kb, 20, OFF_T_FMT " KB,",
-                    (OFF_T_FMT_TYPE)est(dp)->dump_csize);
+           g_snprintf(est_kb, 20, "%lld KB,",
+                    (long long)est(dp)->dump_csize);
 
            if(dp->skip_incr) {
                delete = 1;
-               message = "but cannot incremental dump skip-incr disk";
+               message = _("but cannot incremental dump skip-incr disk");
            }
            else if(est(dp)->last_level < 0) {
                delete = 1;
-               message = "but cannot incremental dump new disk";
+               message = _("but cannot incremental dump new disk");
            }
            else if(est(dp)->degr_level < 0) {
                delete = 1;
-               message = "but no incremental estimate";
+               message = _("but no incremental estimate");
            }
            else {
                delete = 0;
-               message = "full dump delayed";
+               message = _("full dump delayed");
            }
-           delay_one_dump(dp, delete, "dumps too big,", est_kb,
+           delay_one_dump(dp, delete, _("dumps too big,"), est_kb,
                           message, NULL);
        }
     }
@@ -2433,26 +2367,26 @@ static void delay_dumps(void)
            if(est(dp)->dump_level == 0 && dp != preserve) {
 
                /* Format dumpsize for messages */
-               snprintf(est_kb, 20, OFF_T_FMT " KB,",
-                            (OFF_T_FMT_TYPE)est(dp)->dump_csize);
+               g_snprintf(est_kb, 20, "%lld KB,",
+                            (long long)est(dp)->dump_csize);
 
                if(dp->skip_incr) {
                    delete = 1;
-                   message = "but cannot incremental dump skip-incr disk";
+                   message = _("but cannot incremental dump skip-incr disk");
                }
                else if(est(dp)->last_level < 0) {
                    delete = 1;
-                   message = "but cannot incremental dump new disk";
+                   message = _("but cannot incremental dump new disk");
                }
                else if(est(dp)->degr_level < 0) {
                    delete = 1;
-                   message = "but no incremental estimate";
+                   message = _("but no incremental estimate");
                }
                else {
                    delete = 0;
-                   message = "full dump delayed";
+                   message = _("full dump delayed");
                }
-               delay_one_dump(dp, delete, "dumps too big,", est_kb,
+               delay_one_dump(dp, delete, _("dumps too big,"), est_kb,
                               message, NULL);
            }
        }
@@ -2474,13 +2408,13 @@ static void delay_dumps(void)
        if(est(dp)->dump_level != 0) {
 
            /* Format dumpsize for messages */
-           snprintf(est_kb, 20, OFF_T_FMT " KB,",
-                    (OFF_T_FMT_TYPE)est(dp)->dump_csize);
+           g_snprintf(est_kb, 20, "%lld KB,",
+                    (long long)est(dp)->dump_csize);
 
            delay_one_dump(dp, 1,
-                          "dumps way too big,",
+                          _("dumps way too big,"),
                           est_kb,
-                          "must skip incremental dumps",
+                          _("must skip incremental dumps"),
                           NULL);
        }
     }
@@ -2549,12 +2483,12 @@ static void delay_dumps(void)
 /*@i@*/ for(bi = biq.head; bi != NULL; bi = nbi) {
        nbi = bi->next;
        if(bi->deleted) {
-           fprintf(stderr, "%s: FAILED %s\n", get_pname(), bi->errstr);
+           g_fprintf(stderr, "%s: FAILED %s\n", get_pname(), bi->errstr);
            log_add(L_FAIL, "%s", bi->errstr);
        }
        else {
            dp = bi->dp;
-           fprintf(stderr, "  delay: %s now at level %d\n",
+           g_fprintf(stderr, _("  delay: %s now at level %d\n"),
                bi->errstr, est(dp)->dump_level);
            log_add(L_INFO, "%s", bi->errstr);
        }
@@ -2564,8 +2498,8 @@ static void delay_dumps(void)
        /*@end@*/
     }
 
-    fprintf(stderr, "  delay: Total size now " OFF_T_FMT ".\n",
-            (OFF_T_FMT_TYPE)total_size);
+    g_fprintf(stderr, _("  delay: Total size now %lld.\n"),
+            (long long)total_size);
 
     return;
 }
@@ -2586,6 +2520,7 @@ arglist_function1(
     char *sep;
     char *next;
     char *qname = quote_string(dp->name);
+    char *errstr, *qerrstr;
 
     arglist_start(argp, delete);
 
@@ -2609,18 +2544,23 @@ arglist_function1(
     bi->nsize = est(dp)->dump_nsize;
     bi->csize = est(dp)->dump_csize;
 
-    snprintf(level_str, SIZEOF(level_str), "%d", est(dp)->dump_level);
+    g_snprintf(level_str, SIZEOF(level_str), "%d", est(dp)->dump_level);
     bi->errstr = vstralloc(dp->host->hostname,
                           " ", qname,
                           " ", planner_timestamp ? planner_timestamp : "?",
                           " ", level_str,
                           NULL);
-    sep = " [";
+    errstr = NULL;
+    sep = "[";
     while ((next = arglist_val(argp, char *)) != NULL) {
-       bi->errstr = newvstralloc(bi->errstr, bi->errstr, sep, next, NULL);
+       vstrextend(&errstr, sep, next, NULL);
        sep = " ";
     }
-    strappend(bi->errstr, "]");
+    strappend(errstr, "]");
+    qerrstr = quote_string(errstr);
+    vstrextend(&bi->errstr, " ", qerrstr);
+    amfree(errstr);
+    amfree(qerrstr);
     arglist_end(argp);
 
     if (delete) {
@@ -2715,11 +2655,11 @@ static int promote_highest_priority_incremental(void)
        qname = quote_string(dp->name);
        if(!dp_promote || est(dp_promote)->promote < est(dp)->promote) {
            dp_promote = dp;
-           fprintf(stderr,"   try %s:%s %d %d %d = %d\n",
+           g_fprintf(stderr,"   try %s:%s %d %d %d = %d\n",
                    dp->host->hostname, qname, nb_same_day, nb_today, est(dp)->next_level0, est(dp)->promote);
        }
        else {
-           fprintf(stderr,"no try %s:%s %d %d %d = %d\n",
+           g_fprintf(stderr,"no try %s:%s %d %d %d = %d\n",
                    dp->host->hostname, qname, nb_same_day, nb_today, est(dp)->next_level0, est(dp)->promote);
        }
        amfree(qname);
@@ -2744,15 +2684,16 @@ static int promote_highest_priority_incremental(void)
        est(dp)->dump_csize = new_size;
        est(dp)->next_level0 = 0;
 
-       fprintf(stderr,
-             "   promote: moving %s:%s up, total_lev0 %1.0lf, total_size " OFF_T_FMT "\n",
+       g_fprintf(stderr,
+             _("   promote: moving %s:%s up, total_lev0 %1.0lf, total_size %lld\n"),
                dp->host->hostname, qname,
-               total_lev0, (OFF_T_FMT_TYPE)total_size);
+               total_lev0, (long long)total_size);
 
        log_add(L_INFO,
-               "Full dump of %s:%s promoted from %d day%s ahead.",
-               dp->host->hostname, qname,
-               check_days, (check_days == 1) ? "" : "s");
+               plural(_("Full dump of %s:%s promoted from %d day ahead."),
+                      _("Full dump of %s:%s promoted from %d days ahead."),
+                     check_days),
+               dp->host->hostname, qname, check_days);
        amfree(qname);
        return 1;
     }
@@ -2837,15 +2778,16 @@ static int promote_hills(void)
            est(dp)->dump_nsize = est_size(dp, 0);
            est(dp)->dump_csize = new_size;
 
-           fprintf(stderr,
-                   "   promote: moving %s:%s up, total_lev0 %1.0lf, total_size " OFF_T_FMT "\n",
+           g_fprintf(stderr,
+                   _("   promote: moving %s:%s up, total_lev0 %1.0lf, total_size %lld\n"),
                    dp->host->hostname, qname,
-                   total_lev0, (OFF_T_FMT_TYPE)total_size);
+                   total_lev0, (long long)total_size);
 
            log_add(L_INFO,
-                   "Full dump of %s:%s specially promoted from %d day%s ahead.",
-                   dp->host->hostname, qname,
-                   hill_days, (hill_days == 1) ? "" : "s");
+                   plural(_("Full dump of %s:%s specially promoted from %d day ahead."),
+                          _("Full dump of %s:%s specially promoted from %d days ahead."),
+                          hill_days),
+                   dp->host->hostname, qname, hill_days);
 
            amfree(qname);
            amfree(sp);
@@ -2892,11 +2834,11 @@ static void output_scheduleline(
 
     if(ep->dump_csize == (off_t)-1) {
        /* no estimate, fail the disk */
-       fprintf(stderr,
-               "%s: FAILED %s %s %s %d [no estimate]\n",
+       g_fprintf(stderr,
+               _("%s: FAILED %s %s %s %d \"[no estimate]\"\n"),
                get_pname(),
                dp->host->hostname, qname, planner_timestamp, ep->dump_level);
-       log_add(L_FAIL, "%s %s %s %d [no estimate]",
+       log_add(L_FAIL, _("%s %s %s %d [no estimate]"),
                dp->host->hostname, qname, planner_timestamp, ep->dump_level);
        amfree(qname);
        return;
@@ -2927,15 +2869,15 @@ static void output_scheduleline(
     }
 
     if(ep->dump_level == 0 && ep->degr_csize != (off_t)-1) {
-       snprintf(degr_level_str, sizeof(degr_level_str),
+       g_snprintf(degr_level_str, sizeof(degr_level_str),
                    "%d", ep->degr_level);
-       snprintf(degr_nsize_str, sizeof(degr_nsize_str),
-                   OFF_T_FMT, (OFF_T_FMT_TYPE)ep->degr_nsize);
-       snprintf(degr_csize_str, sizeof(degr_csize_str),
-                   OFF_T_FMT, (OFF_T_FMT_TYPE)ep->degr_csize);
-       snprintf(degr_time_str, sizeof(degr_time_str),
-                   OFF_T_FMT, (OFF_T_FMT_TYPE)degr_time);
-       snprintf(degr_kps_str, sizeof(degr_kps_str),
+       g_snprintf(degr_nsize_str, sizeof(degr_nsize_str),
+                   "%lld", (long long)ep->degr_nsize);
+       g_snprintf(degr_csize_str, sizeof(degr_csize_str),
+                   "%lld", (long long)ep->degr_csize);
+       g_snprintf(degr_time_str, sizeof(degr_time_str),
+                   "%lld", (long long)degr_time);
+       g_snprintf(degr_kps_str, sizeof(degr_kps_str),
                    "%.0lf", degr_kps);
        degr_str = vstralloc(" ", degr_level_str,
                             " ", degr_date,
@@ -2945,17 +2887,17 @@ static void output_scheduleline(
                             " ", degr_kps_str,
                             NULL);
     }
-    snprintf(dump_priority_str, SIZEOF(dump_priority_str),
+    g_snprintf(dump_priority_str, SIZEOF(dump_priority_str),
                "%d", ep->dump_priority);
-    snprintf(dump_level_str, SIZEOF(dump_level_str),
+    g_snprintf(dump_level_str, SIZEOF(dump_level_str),
                "%d", ep->dump_level);
-    snprintf(dump_nsize_str, sizeof(dump_nsize_str),
-               OFF_T_FMT, (OFF_T_FMT_TYPE)ep->dump_nsize);
-    snprintf(dump_csize_str, sizeof(dump_csize_str),
-               OFF_T_FMT, (OFF_T_FMT_TYPE)ep->dump_csize);
-    snprintf(dump_time_str, sizeof(dump_time_str),
-               OFF_T_FMT, (OFF_T_FMT_TYPE)dump_time);
-    snprintf(dump_kps_str, sizeof(dump_kps_str),
+    g_snprintf(dump_nsize_str, sizeof(dump_nsize_str),
+               "%lld", (long long)ep->dump_nsize);
+    g_snprintf(dump_csize_str, sizeof(dump_csize_str),
+               "%lld", (long long)ep->dump_csize);
+    g_snprintf(dump_time_str, sizeof(dump_time_str),
+               "%lld", (long long)dump_time);
+    g_snprintf(dump_kps_str, sizeof(dump_kps_str),
                "%.0lf", dump_kps);
     features = am_feature_to_string(dp->host->features);
     schedline = vstralloc("DUMP ",dp->host->hostname,
index 21c171c057227705cb4b43c048108ae2fdc49dc5..17497f897e5c6eed0dd25ab4d09334d9b5cd6cc9 100644 (file)
  * report format
  *     tape label message
  *     error messages
+ *     strange messages
  *     summary stats
  *     details for errors
+ *     details for strange
  *     notes
  *     success summary
  */
 
 #include "amanda.h"
 #include "conffile.h"
+#include "columnar.h"
 #include "tapefile.h"
 #include "diskfile.h"
 #include "infofile.h"
 #include "logfile.h"
 #include "version.h"
 #include "util.h"
+#include "timestamp.h"
+#include "holding.h"
 
 /* don't have (or need) a skipped type except internally to reporter */
 #define L_SKIPPED      L_MARKER
@@ -69,6 +74,7 @@ typedef struct timedata_s {
     double sec, kps;
     int filenum;
     char *tapelabel;
+    int totpart;
 } timedata_t;
 
 typedef struct repdata_s {
@@ -104,15 +110,16 @@ typedef struct taper_s {
 static taper_t *stats_by_tape = NULL;
 static taper_t *current_tape = NULL;
 
-typedef struct strange_s {
+typedef struct X_summary_s {
     char *hostname;
     char *diskname;
     int  level;
     char *str;
-    struct strange_s *next;
-} strange_t;
+    struct X_summary_s *next;
+} X_summary_t;
 
-static strange_t *first_strange=NULL, *last_strange=NULL;
+static X_summary_t *first_strange=NULL, *last_strange=NULL;
+static X_summary_t *first_failed=NULL, *last_failed=NULL;
 
 static double total_time, startup_time, planner_time;
 
@@ -127,6 +134,7 @@ static int degraded_mode = 0; /* defined in driverio too */
 static int normal_run = 0;
 static int amflush_run = 0;
 static int got_finish = 0;
+static int cmdlogfname = 0;
 static char *ghostname = NULL;
 
 static char *tapestart_error = NULL;
@@ -141,12 +149,13 @@ static disklist_t sortq;
 
 static line_t *errsum = NULL;
 static line_t *errdet = NULL;
+static line_t *strangedet = NULL;
 static line_t *notes = NULL;
 
 static char MaxWidthsRequested = 0;    /* determined via config data */
 
-char *displayunit;
-long int unitdivisor;
+static char *displayunit;
+static long int unitdivisor;
 
 /* local functions */
 int main(int argc, char **argv);
@@ -162,10 +171,11 @@ static int        ColWidth(int From, int To);
 static int     contline_next(void);
 static int     sort_by_name(disk_t *a, disk_t *b);
 static repdata_t *find_repdata(disk_t *dp, char *datestamp, int level);
-static repdata_t *handle_chunk(void);
+static repdata_t *handle_chunk(logtype_t logtype);
 static repdata_t *handle_success(logtype_t logtype);
 static void    addline(line_t **lp, char *str);
-static void    addtostrange(char *host, char *disk, int level, char *str);
+static void    addtoX_summary(X_summary_t **first, X_summary_t **last,
+                              char *host, char *disk, int level, char *str);
 static void    bogus_line(const char *);
 static void    CalcMaxWidth(void);
 static void    CheckFloatMax(ColumnInfo *cd, double d);
@@ -187,7 +197,7 @@ static void handle_strange(void);
 static void    handle_summary(void);
 static void    output_lines(line_t *lp, FILE *f);
 static void    output_stats(void);
-static void    output_strange(void);
+static void    output_X_summary(X_summary_t *first);
 static void    output_summary(void);
 static void    output_tapeinfo(void);
 static void    sort_disks(void);
@@ -237,7 +247,7 @@ TextRule(
     leng = (int)strlen(s);
     if(leng >= (RuleSpaceSize - cd->PrefixSpace))
        leng = RuleSpaceSize - cd->PrefixSpace - 1;
-    snprintf(RuleSpace, (size_t)RuleSpaceSize, "%*s%*.*s ", cd->PrefixSpace, "", 
+    g_snprintf(RuleSpace, (size_t)RuleSpaceSize, "%*s%*.*s ", cd->PrefixSpace, "", 
             leng, leng, s);
     txtlength = cd->PrefixSpace + leng + 1;
     nbrules = ColWidth(From,To) - txtlength;
@@ -256,10 +266,10 @@ sDivZero(
     ColumnInfo *cd= &ColumnData[cn];
     static char PrtBuf[256];
     if (!isnormal(b))
-       snprintf(PrtBuf, SIZEOF(PrtBuf),
+       g_snprintf(PrtBuf, SIZEOF(PrtBuf),
          "%*s", cd->Width, "-- ");
     else
-       snprintf(PrtBuf, SIZEOF(PrtBuf),
+       g_snprintf(PrtBuf, SIZEOF(PrtBuf),
          cd->Format, cd->Width, cd->Precision, a/b);
     return PrtBuf;
 }
@@ -272,10 +282,10 @@ contline_next(void)
     if ((ch = getc(logfile)) != EOF) {
            if (ungetc(ch, logfile) == EOF) {
                if (ferror(logfile)) {
-                   error("ungetc failed: %s\n", strerror(errno));
+                   error(_("ungetc failed: %s\n"), strerror(errno));
                    /*NOTREACHED*/
                }
-               error("ungetc failed: EOF\n");
+               error(_("ungetc failed: EOF\n"));
                /*NOTREACHED*/
            }
     }
@@ -308,7 +318,7 @@ addline(
 static void
 usage(void)
 {
-    error("Usage: amreport conf [-i] [-M address] [-f output-file] [-l logfile] [-p postscript-file] [-o configoption]*");
+    error(_("Usage: amreport conf [-i] [-M address] [-f output-file] [-l logfile] [-p postscript-file] [-o configoption]*"));
     /*NOTREACHED*/
 }
 
@@ -317,26 +327,32 @@ main(
     int                argc,
     char **    argv)
 {
-    char *conffile;
     char *conf_diskfile;
     char *conf_tapelist;
     char *conf_infofile;
     char *logfname, *psfname, *outfname, *subj_str = NULL;
     tapetype_t *tp;
     int opt;
-    unsigned long malloc_hist_1, malloc_size_1;
-    unsigned long malloc_hist_2, malloc_size_2;
     char *mail_cmd = NULL, *printer_cmd = NULL;
     extern int optind;
-    char my_cwd[STR_SIZE];
+    char * cwd = NULL;
     char *ColumnSpec = "";
     char *errstr = NULL;
     int cn;
     int mailout = 1;
     char *mailto = NULL;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
     char *lbl_templ = NULL;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
+
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
 
     safe_fd(-1, 0);
 
@@ -347,86 +363,85 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
     /* Process options */
     
     erroutput_type = ERR_INTERACTIVE;
     outfname = NULL;
     psfname = NULL;
     logfname = NULL;
+    cmdlogfname = 0;
 
-    if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-       error("cannot determine current working directory");
+    cwd = g_get_current_dir();
+    if (cwd == NULL) {
+       error(_("Cannot determine current working directory: %s"),
+             strerror(errno));
        /*NOTREACHED*/
     }
 
-    parse_conf(argc, argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
-
-    if (my_argc < 2) {
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    } else {
-       if (my_argv[1][0] == '-') {
+    if (argc >= 2) {
+       if (argv[1][0] == '-') {
            usage();
            return 1;
        }
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-       --my_argc; ++my_argv;
-       while((opt = getopt(my_argc, my_argv, "M:f:l:p:i")) != EOF) {
+
+       /* get the config name and move past it */
+       cfg_opt = argv[1];
+       --argc; ++argv;
+
+       cfg_ovr = new_config_overwrites(argc/2);
+       while((opt = getopt(argc, argv, "o:M:f:l:p:i")) != EOF) {
            switch(opt) {
            case 'i': 
                mailout = 0;
                break;
             case 'M':
                if (mailto != NULL) {
-                   error("you may specify at most one -M");
+                   error(_("you may specify at most one -M"));
                    /*NOTREACHED*/
                }
                 mailto = stralloc(optarg);
                if(!validate_mailto(mailto)) {
-                   error("mail address has invalid characters");
+                   error(_("mail address has invalid characters"));
                    /*NOTREACHED*/
                }
                 break;
             case 'f':
                if (outfname != NULL) {
-                   error("you may specify at most one -f");
+                   error(_("you may specify at most one -f"));
                    /*NOTREACHED*/
                }
                if (*optarg == '/') {
                     outfname = stralloc(optarg);
                } else {
-                    outfname = vstralloc(my_cwd, "/", optarg, NULL);
+                    outfname = vstralloc(cwd, "/", optarg, NULL);
                }
                 break;
             case 'l':
+               cmdlogfname = 1;
                if (logfname != NULL) {
-                   error("you may specify at most one -l");
+                   error(_("you may specify at most one -l"));
                    /*NOTREACHED*/
                }
                if (*optarg == '/') {
                    logfname = stralloc(optarg);
                } else {
-                    logfname = vstralloc(my_cwd, "/", optarg, NULL);
+                    logfname = vstralloc(cwd, "/", optarg, NULL);
                }
                 break;
             case 'p':
                if (psfname != NULL) {
-                   error("you may specify at most one -p");
+                   error(_("you may specify at most one -p"));
                    /*NOTREACHED*/
                }
                if (*optarg == '/') {
                     psfname = stralloc(optarg);
                } else {
-                    psfname = vstralloc(my_cwd, "/", optarg, NULL);
+                    psfname = vstralloc(cwd, "/", optarg, NULL);
                }
                 break;
+           case 'o':
+               add_config_overwrite_opt(cfg_ovr, optarg);
+               break;
             case '?':
                usage();
                return 1;
@@ -435,41 +450,37 @@ main(
            }
        }
 
-       my_argc -= optind;
-       my_argv += optind;
+       argc -= optind;
+       argv += optind;
     }
     if( !mailout && mailto ){
-       printf("You cannot specify both -i & -M at the same time\n");
+       g_printf(_("You cannot specify both -i & -M at the same time\n"));
        exit(1);
     }
 
+    amfree(cwd);
 
 #if !defined MAILER
     if(!outfname) {
-       printf("You must run amreport with '-f <output file>' because configure\n");
-       printf("didn't find a mailer.\n");
+       g_printf(_("You must run amreport with '-f <output file>' because configure\n"));
+       g_printf(_("didn't find a mailer.\n"));
        exit (1);
     }
 #endif
 
-    safe_cd();
-
     /* read configuration files */
 
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    /* Ignore error from read_conffile */
-    read_conffile(conffile);
-    amfree(conffile);
+    /* ignore any errors reading the config file (amreport can run without a config) */
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD, cfg_opt);
+    if (cfg_ovr) apply_config_overwrites(cfg_ovr);
+
+    check_running_as(RUNNING_AS_DUMPUSER);
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    report_bad_conf_arg();
-    conf_diskfile = getconf_str(CNF_DISKFILE);
-    if (*conf_diskfile == '/') {
-       conf_diskfile = stralloc(conf_diskfile);
-    } else {
-       conf_diskfile = stralloc2(config_dir, conf_diskfile);
-    }
+    safe_cd(); /* must be called *after* config_init() */
+
+    conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
     /* Ignore error from read_diskfile */
     read_diskfile(conf_diskfile, &diskq);
     amfree(conf_diskfile);
@@ -481,23 +492,13 @@ main(
                 }
     }
     
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
+    conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     /* Ignore error from read_tapelist */
     read_tapelist(conf_tapelist);
     amfree(conf_tapelist);
-    conf_infofile = getconf_str(CNF_INFOFILE);
-    if (*conf_infofile == '/') {
-       conf_infofile = stralloc(conf_infofile);
-    } else {
-       conf_infofile = stralloc2(config_dir, conf_infofile);
-    }
+    conf_infofile = config_dir_relative(getconf_str(CNF_INFOFILE));
     if(open_infofile(conf_infofile)) {
-       error("could not open info db \"%s\"", conf_infofile);
+       error(_("could not open info db \"%s\""), conf_infofile);
        /*NOTREACHED*/
     }
     amfree(conf_infofile);
@@ -506,7 +507,7 @@ main(
     unitdivisor = getconf_unit_divisor();
 
     ColumnSpec = getconf_str(CNF_COLUMNSPEC);
-    if(SetColumDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
+    if(SetColumnDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
        curlog = L_ERROR;
        curprog = P_REPORTER;
        curstr = errstr;
@@ -514,7 +515,7 @@ main(
         amfree(errstr);
        curstr = NULL;
        ColumnSpec = "";                /* use the default */
-       if(SetColumDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
+       if(SetColumnDataFromString(ColumnData, ColumnSpec, &errstr) < 0) {
            curlog = L_ERROR;
            curprog = P_REPORTER;
            curstr = errstr;
@@ -533,12 +534,7 @@ main(
     if(!logfname) {
        char *conf_logdir;
 
-       conf_logdir = getconf_str(CNF_LOGDIR);
-       if (*conf_logdir == '/') {
-           conf_logdir = stralloc(conf_logdir);
-       } else {
-           conf_logdir = stralloc2(config_dir, conf_logdir);
-       }
+       conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
        logfname = vstralloc(conf_logdir, "/", "log", NULL);
        amfree(conf_logdir);
     }
@@ -546,7 +542,7 @@ main(
     if((logfile = fopen(logfname, "r")) == NULL) {
        curlog = L_ERROR;
        curprog = P_REPORTER;
-       curstr = vstralloc("could not open log ",
+       curstr = vstralloc(_("could not open log "),
                           logfname,
                           ": ",
                           strerror(errno),
@@ -557,31 +553,34 @@ main(
 
     while(logfile && get_logline(logfile)) {
        switch(curlog) {
-       case L_START:   handle_start(); break;
-       case L_FINISH:  handle_finish(); break;
+       case L_START:        handle_start(); break;
+       case L_FINISH:       handle_finish(); break;
 
-       case L_INFO:    handle_note(); break;
-       case L_WARNING: handle_note(); break;
+       case L_INFO:         handle_note(); break;
+       case L_WARNING:      handle_note(); break;
 
-       case L_SUMMARY: handle_summary(); break;
-       case L_STATS:   handle_stats(); break;
+       case L_SUMMARY:      handle_summary(); break;
+       case L_STATS:        handle_stats(); break;
 
-       case L_ERROR:   handle_error(); break;
-       case L_FATAL:   handle_error(); break;
+       case L_ERROR:        handle_error(); break;
+       case L_FATAL:        handle_error(); break;
 
-       case L_DISK:    handle_disk(); break;
+       case L_DISK:         handle_disk(); break;
 
-       case L_SUCCESS: handle_success(curlog); break;
+       case L_DONE:         handle_success(curlog); break;
+       case L_SUCCESS:      handle_success(curlog); break;
        case L_CHUNKSUCCESS: handle_success(curlog); break;
-       case L_CHUNK:   handle_chunk(); break;
-       case L_PARTIAL: handle_partial(); break;
-       case L_STRANGE: handle_strange(); break;
-       case L_FAIL:    handle_failed(); break;
+       case L_PART:         handle_chunk(curlog); break;
+       case L_PARTPARTIAL:  handle_chunk(curlog); break;
+       case L_CHUNK:        handle_chunk(curlog); break;
+       case L_PARTIAL:      handle_partial(); break;
+       case L_STRANGE:      handle_strange(); break;
+       case L_FAIL:         handle_failed(); break;
 
        default:
            curlog = L_ERROR;
            curprog = P_REPORTER;
-           curstr = stralloc2("unexpected log line: ", curstr);
+           curstr = vstrallocf(_("unexpected log line: %s"), curstr);
            handle_error();
            amfree(curstr);
        }
@@ -611,11 +610,13 @@ main(
     if(outfname) {
        /* output to a file */
        if((mailf = fopen(outfname,"w")) == NULL) {
-           error("could not open output file: %s %s", outfname, strerror(errno));
+           error(_("could not open output file: %s %s"), outfname, strerror(errno));
            /*NOTREACHED*/
        }
-       fprintf(mailf, "To: %s\n", mailto);
-       fprintf(mailf, "Subject: %s\n\n", subj_str);
+        if (mailto != NULL) {
+               g_fprintf(mailf, "To: %s\n", mailto);
+               g_fprintf(mailf, "Subject: %s\n\n", subj_str);
+       }
 
     } else {
 #ifdef MAILER
@@ -624,15 +625,15 @@ main(
                             " -s", " \"", subj_str, "\"",
                             " ", mailto, NULL);
                if((mailf = popen(mail_cmd, "w")) == NULL) {
-               error("could not open pipe to \"%s\": %s",
+               error(_("could not open pipe to \"%s\": %s"),
                        mail_cmd, strerror(errno));
                /*NOTREACHED*/
                }
        }
        else {
                if(mailout) {
-                   printf("No mail sent! ");
-                  printf("No valid mail address has been specified in amanda.conf or on the commmand line\n");
+                   g_printf(_("No mail sent! "));
+                  g_printf(_("No valid mail address has been specified in amanda.conf or on the commmand line\n"));
                }
                mailf = NULL;
        }
@@ -651,11 +652,9 @@ main(
            if ((postscript = fopen(psfname, "w")) == NULL) {
                curlog = L_ERROR;
                curprog = P_REPORTER;
-               curstr = vstralloc("could not open ",
+               curstr = vstrallocf(_("could not open %s: %s"),
                                   psfname,
-                                  ": ",
-                                  strerror(errno),
-                                  NULL);
+                                  strerror(errno));
                handle_error();
                amfree(curstr);
            }
@@ -680,18 +679,15 @@ main(
            if ((postscript = popen(printer_cmd, "w")) == NULL) {
                curlog = L_ERROR;
                curprog = P_REPORTER;
-               curstr = vstralloc("could not open pipe to ",
-                                  printer_cmd,
-                                  ": ",
-                                  strerror(errno),
-                                  NULL);
+               curstr = vstrallocf(_("could not open pipe to %s: %s"),
+                                  printer_cmd, strerror(errno));
                handle_error();
                amfree(curstr);
            }
 #else
            curlog = L_ERROR;
            curprog = P_REPORTER;
-           curstr = stralloc("no printer command defined");
+           curstr = vstrallocf(_("no printer command defined"));
            handle_error();
            amfree(curstr);
 #endif
@@ -700,44 +696,57 @@ main(
 
     amfree(subj_str);
 
+    sort_disks();
+
     if(mailf) {
 
-       if(!got_finish) fputs("*** THE DUMPS DID NOT FINISH PROPERLY!\n\n", mailf);
+       if(!got_finish) fputs(_("*** THE DUMPS DID NOT FINISH PROPERLY!\n\n"), mailf);
 
        if (ghostname) {
-           fprintf(mailf, "Hostname: %s\n", ghostname);
-           fprintf(mailf, "Org     : %s\n", getconf_str(CNF_ORG));
-           fprintf(mailf, "Config  : %s\n", config_name);
-           fprintf(mailf, "Date    : %s\n",
+           g_fprintf(mailf, _("Hostname: %s\n"), ghostname);
+           g_fprintf(mailf, _("Org     : %s\n"), getconf_str(CNF_ORG));
+           g_fprintf(mailf, _("Config  : %s\n"), config_name);
+           g_fprintf(mailf, _("Date    : %s\n"),
                    nicedate(run_datestamp ? run_datestamp : "0"));
-           fprintf(mailf,"\n");
+           g_fprintf(mailf,"\n");
        }
 
        output_tapeinfo();
 
-       if(first_strange || errsum) {
-               fprintf(mailf,"\nFAILURE AND STRANGE DUMP SUMMARY:\n");
-               if(first_strange) output_strange();
+       if(first_failed || errsum) {
+               g_fprintf(mailf,_("\nFAILURE DUMP SUMMARY:\n"));
+               if(first_failed) output_X_summary(first_failed);
                if(errsum) output_lines(errsum, mailf);
        }
+       if(first_strange) {
+               g_fprintf(mailf,_("\nSTRANGE DUMP SUMMARY:\n"));
+               if(first_strange) output_X_summary(first_strange);
+       }
        fputs("\n\n", mailf);
        
        output_stats();
        
        if(errdet) {
-               fprintf(mailf,"\n\014\nFAILED AND STRANGE DUMP DETAILS:\n");
+               g_fprintf(mailf,"\n\f\n");
+               g_fprintf(mailf,_("FAILED DUMP DETAILS:\n"));
                output_lines(errdet, mailf);
        }
+       if(strangedet) {
+               g_fprintf(mailf,"\n\f\n");
+               g_fprintf(mailf,_("STRANGE DUMP DETAILS:\n"));
+               output_lines(strangedet, mailf);
+       }
        if(notes) {
-               fprintf(mailf,"\n\014\nNOTES:\n");
+               g_fprintf(mailf,"\n\f\n");
+               g_fprintf(mailf,_("NOTES:\n"));
                output_lines(notes, mailf);
        }
-       sort_disks();
        if(sortq.head != NULL) {
-               fprintf(mailf,"\n\014\nDUMP SUMMARY:\n");
+               g_fprintf(mailf,"\n\f\n");
+               g_fprintf(mailf,_("DUMP SUMMARY:\n"));
                output_summary();
        }
-       fprintf(mailf,"\n(brought to you by Amanda version %s)\n",
+       g_fprintf(mailf,_("\n(brought to you by Amanda version %s)\n"),
                version());
     }
 
@@ -753,7 +762,7 @@ main(
     }
     else {
        if (postscript != NULL && pclose(postscript) != 0) {
-           error("printer command failed: %s", printer_cmd);
+           error(_("printer command failed: %s"), printer_cmd);
            /*NOTREACHED*/
        }
        postscript = NULL;
@@ -764,8 +773,10 @@ main(
         afclose(mailf);
     }
     else if(mailf) {
-        if(pclose(mailf) != 0) {
-            error("mail command failed: %s", mail_cmd);
+       int exitcode;
+        if((exitcode = pclose(mailf)) != 0) {
+           char *exitstr = str_exit_status("mail command", exitcode);
+            error(exitstr);
            /*NOTREACHED*/
        }
         mailf = NULL;
@@ -773,22 +784,12 @@ main(
 
     clear_tapelist();
     free_disklist(&diskq);
-    free_new_argv(new_argc, new_argv);
-    free_server_config();
     amfree(run_datestamp);
     amfree(tape_labels);
-    amfree(config_dir);
-    amfree(config_name);
     amfree(printer_cmd);
     amfree(mail_cmd);
     amfree(logfname);
 
-    malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-    if(malloc_size_1 != malloc_size_2) {
-       malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-    }
-
     dbclose();
     return exit_status;
 }
@@ -805,21 +806,21 @@ main(
     do {                                           \
        double q = (b);                     \
        if (!isnormal(q))                   \
-           fprintf((fp),"  -- ");          \
+           g_fprintf((fp),"  -- ");        \
        else if ((q = (a)/q) >= 999.95)     \
-           fprintf((fp), "###.#");         \
+           g_fprintf((fp), "###.#");       \
        else                                \
-           fprintf((fp), "%5.1lf",q);      \
+           g_fprintf((fp), "%5.1lf",q);            \
     } while(0)
 #define divzero_wide(fp,a,b)               \
     do {                                           \
        double q = (b);                     \
        if (!isnormal(q))                   \
-           fprintf((fp),"    -- ");        \
+           g_fprintf((fp),"    -- ");      \
        else if ((q = (a)/q) >= 99999.95)   \
-           fprintf((fp), "#####.#");       \
+           g_fprintf((fp), "#####.#");     \
        else                                \
-           fprintf((fp), "%7.1lf",q);      \
+           g_fprintf((fp), "%7.1lf",q);            \
     } while(0)
 
 static void
@@ -856,142 +857,142 @@ output_stats(void)
     idle_time = (total_time - startup_time) - stats[2].taper_time;
     if(idle_time < 0) idle_time = 0.0;
 
-    fprintf(mailf,"STATISTICS:\n");
-    fprintf(mailf,
-           "                          Total       Full      Incr.\n");
-    fprintf(mailf,
-           "                        --------   --------   --------\n");
+    g_fprintf(mailf,_("STATISTICS:\n"));
+    g_fprintf(mailf,
+           _("                          Total       Full      Incr.\n"));
+    g_fprintf(mailf,
+           _("                        --------   --------   --------\n"));
 
-    fprintf(mailf,
-           "Estimate Time (hrs:min)   %2d:%02d\n", hrmn(planner_time));
+    g_fprintf(mailf,
+           _("Estimate Time (hrs:min)   %2d:%02d\n"), hrmn(planner_time));
 
-    fprintf(mailf,
-           "Run Time (hrs:min)        %2d:%02d\n", hrmn(total_time));
+    g_fprintf(mailf,
+           _("Run Time (hrs:min)        %2d:%02d\n"), hrmn(total_time));
 
-    fprintf(mailf,
-           "Dump Time (hrs:min)       %2d:%02d      %2d:%02d      %2d:%02d\n",
+    g_fprintf(mailf,
+           _("Dump Time (hrs:min)       %2d:%02d      %2d:%02d      %2d:%02d\n"),
            hrmn(stats[2].dumper_time), hrmn(stats[0].dumper_time),
            hrmn(stats[1].dumper_time));
 
-    fprintf(mailf,
-           "Output Size (meg)      %8.1lf   %8.1lf   %8.1lf\n",
+    g_fprintf(mailf,
+           _("Output Size (meg)      %8.1lf   %8.1lf   %8.1lf\n"),
            mb(stats[2].outsize), mb(stats[0].outsize), mb(stats[1].outsize));
 
-    fprintf(mailf,
-           "Original Size (meg)    %8.1lf   %8.1lf   %8.1lf\n",
+    g_fprintf(mailf,
+           _("Original Size (meg)    %8.1lf   %8.1lf   %8.1lf\n"),
            mb(stats[2].origsize), mb(stats[0].origsize),
            mb(stats[1].origsize));
 
-    fprintf(mailf, "Avg Compressed Size (%%)   ");
+    g_fprintf(mailf, _("Avg Compressed Size (%%)   "));
     divzero(mailf, pct(stats[2].coutsize),stats[2].corigsize);
-    fputs("      ", mailf);
+    fputs(_("      "), mailf);
     divzero(mailf, pct(stats[0].coutsize),stats[0].corigsize);
-    fputs("      ", mailf);
+    fputs(_("      "), mailf);
     divzero(mailf, pct(stats[1].coutsize),stats[1].corigsize);
 
-    if(stats[1].dumpdisks > 0) fputs("   (level:#disks ...)", mailf);
+    if(stats[1].dumpdisks > 0) fputs(_("   (level:#disks ...)"), mailf);
     putc('\n', mailf);
 
-    fprintf(mailf,
-           "Filesystems Dumped         %4d       %4d       %4d",
+    g_fprintf(mailf,
+           _("Filesystems Dumped         %4d       %4d       %4d"),
            stats[2].dumpdisks, stats[0].dumpdisks, stats[1].dumpdisks);
 
     if(stats[1].dumpdisks > 0) {
        first = 1;
        for(lv = 1; lv < 10; lv++) if(dumpdisks[lv]) {
-           fputs(first?"   (":" ", mailf);
+           fputs(first?_("   ("):_(" "), mailf);
            first = 0;
-           fprintf(mailf, "%d:%d", lv, dumpdisks[lv]);
+           g_fprintf(mailf, _("%d:%d"), lv, dumpdisks[lv]);
        }
        putc(')', mailf);
     }
     putc('\n', mailf);
 
-    fprintf(mailf, "Avg Dump Rate (k/s)     ");
+    g_fprintf(mailf, _("Avg Dump Rate (k/s)     "));
     divzero_wide(mailf, stats[2].outsize,stats[2].dumper_time);
-    fputs("    ", mailf);
+    fputs(_("    "), mailf);
     divzero_wide(mailf, stats[0].outsize,stats[0].dumper_time);
-    fputs("    ", mailf);
+    fputs(_("    "), mailf);
     divzero_wide(mailf, stats[1].outsize,stats[1].dumper_time);
     putc('\n', mailf);
 
     putc('\n', mailf);
-    fprintf(mailf,
-           "Tape Time (hrs:min)       %2d:%02d      %2d:%02d      %2d:%02d\n",
+    g_fprintf(mailf,
+           _("Tape Time (hrs:min)       %2d:%02d      %2d:%02d      %2d:%02d\n"),
            hrmn(stats[2].taper_time), hrmn(stats[0].taper_time),
            hrmn(stats[1].taper_time));
 
-    fprintf(mailf,
-           "Tape Size (meg)        %8.1lf   %8.1lf   %8.1lf\n",
+    g_fprintf(mailf,
+           _("Tape Size (meg)        %8.1lf   %8.1lf   %8.1lf\n"),
            mb(stats[2].tapesize), mb(stats[0].tapesize),
            mb(stats[1].tapesize));
 
-    fprintf(mailf, "Tape Used (%%)             ");
+    g_fprintf(mailf, _("Tape Used (%%)             "));
     divzero(mailf, pct(stats[2].tapesize+marksize*(stats[2].tapedisks+stats[2].tapechunks)),(double)tapesize);
-    fputs("      ", mailf);
+    fputs(_("      "), mailf);
     divzero(mailf, pct(stats[0].tapesize+marksize*(stats[0].tapedisks+stats[0].tapechunks)),(double)tapesize);
-    fputs("      ", mailf);
+    fputs(_("      "), mailf);
     divzero(mailf, pct(stats[1].tapesize+marksize*(stats[1].tapedisks+stats[1].tapechunks)),(double)tapesize);
 
-    if(stats[1].tapedisks > 0) fputs("   (level:#disks ...)", mailf);
+    if(stats[1].tapedisks > 0) fputs(_("   (level:#disks ...)"), mailf);
     putc('\n', mailf);
 
-    fprintf(mailf,
-           "Filesystems Taped          %4d       %4d       %4d",
+    g_fprintf(mailf,
+           _("Filesystems Taped          %4d       %4d       %4d"),
            stats[2].tapedisks, stats[0].tapedisks, stats[1].tapedisks);
 
     if(stats[1].tapedisks > 0) {
        first = 1;
        for(lv = 1; lv < 10; lv++) if(tapedisks[lv]) {
-           fputs(first?"   (":" ", mailf);
+           fputs(first?_("   ("):_(" "), mailf);
            first = 0;
-           fprintf(mailf, "%d:%d", lv, tapedisks[lv]);
+           g_fprintf(mailf, _("%d:%d"), lv, tapedisks[lv]);
        }
        putc(')', mailf);
     }
     putc('\n', mailf);
 
-    if(stats[1].tapechunks > 0) fputs("   (level:#chunks ...)", mailf);
+    if(stats[1].tapechunks > 0) fputs(_("   (level:#chunks ...)"), mailf);
     putc('\n', mailf);
 
-    fprintf(mailf,
-           "Chunks Taped               %4d       %4d       %4d",
+    g_fprintf(mailf,
+           _("Chunks Taped               %4d       %4d       %4d"),
            stats[2].tapechunks, stats[0].tapechunks, stats[1].tapechunks);
 
     if(stats[1].tapechunks > 0) {
        first = 1;
        for(lv = 1; lv < 10; lv++) if(tapechunks[lv]) {
-           fputs(first?"   (":" ", mailf);
+           fputs(first?_("   ("):_(" "), mailf);
            first = 0;
-           fprintf(mailf, "%d:%d", lv, tapechunks[lv]);
+           g_fprintf(mailf, _("%d:%d"), lv, tapechunks[lv]);
        }
        putc(')', mailf);
     }
     putc('\n', mailf);
 
-    fprintf(mailf, "Avg Tp Write Rate (k/s) ");
+    g_fprintf(mailf, _("Avg Tp Write Rate (k/s) "));
     divzero_wide(mailf, stats[2].tapesize,stats[2].taper_time);
-    fputs("    ", mailf);
+    fputs(_("    "), mailf);
     divzero_wide(mailf, stats[0].tapesize,stats[0].taper_time);
-    fputs("    ", mailf);
+    fputs(_("    "), mailf);
     divzero_wide(mailf, stats[1].tapesize,stats[1].taper_time);
     putc('\n', mailf);
 
     if(stats_by_tape) {
        int label_length = (int)strlen(stats_by_tape->label) + 5;
-       fprintf(mailf,"\nUSAGE BY TAPE:\n");
-       fprintf(mailf,"  %-*s  Time      Size      %%    Nb    Nc\n",
-               label_length, "Label");
+       g_fprintf(mailf,_("\nUSAGE BY TAPE:\n"));
+       g_fprintf(mailf,_("  %-*s  Time      Size      %%    Nb    Nc\n"),
+               label_length, _("Label"));
        for(current_tape = stats_by_tape; current_tape != NULL;
            current_tape = current_tape->next) {
-           fprintf(mailf, "  %-*s", label_length, current_tape->label);
-           fprintf(mailf, " %2d:%02d", hrmn(current_tape->taper_time));
-           fprintf(mailf, " %8.0lf%s  ", du(current_tape->coutsize), displayunit);
+           g_fprintf(mailf, _("  %-*s"), label_length, current_tape->label);
+           g_fprintf(mailf, _(" %2d:%02d"), hrmn(current_tape->taper_time));
+           g_fprintf(mailf, _(" %8.0lf%s  "), du(current_tape->coutsize), displayunit);
            divzero(mailf, pct(current_tape->coutsize + marksize *
                   (current_tape->tapedisks+current_tape->tapechunks)),
                   (double)tapesize);
-           fprintf(mailf, "  %4d", current_tape->tapedisks);
-           fprintf(mailf, "  %4d\n", current_tape->tapechunks);
+           g_fprintf(mailf, _("  %4d"), current_tape->tapedisks);
+           g_fprintf(mailf, _("  %4d\n"), current_tape->tapechunks);
        }
     }
 }
@@ -1007,22 +1008,55 @@ output_tapeinfo(void)
 
     if (last_run_tapes > 0) {
        if(amflush_run)
-           fprintf(mailf, "The dumps were flushed to tape%s %s.\n",
-                   last_run_tapes == 1 ? "" : "s",
+           g_fprintf(mailf,
+                   plural(_("The dumps were flushed to tape %s.\n"),
+                          _("The dumps were flushed to tapes %s.\n"),
+                          last_run_tapes),
                    tape_labels ? tape_labels : "");
        else
-           fprintf(mailf, "These dumps were to tape%s %s.\n",
-                   last_run_tapes == 1 ? "" : "s",
+           g_fprintf(mailf,
+                   plural(_("These dumps were to tape %s.\n"),
+                          _("These dumps were to tapes %s.\n"),
+                          last_run_tapes),
                    tape_labels ? tape_labels : "");
     }
 
     if(degraded_mode) {
-       fprintf(mailf,
-               "*** A TAPE ERROR OCCURRED: %s.\n", tapestart_error);
-       fputs("Some dumps may have been left in the holding disk.\n", mailf);
-       fprintf(mailf,
-               "Run amflush%s to flush them to tape.\n",
-               amflush_run ? " again" : "");
+       g_fprintf(mailf,
+               _("*** A TAPE ERROR OCCURRED: %s.\n"), tapestart_error);
+    }
+    if (cmdlogfname == 1) {
+       if(degraded_mode) {
+           fputs(_("Some dumps may have been left in the holding disk.\n"),
+                 mailf);
+           g_fprintf(mailf,"\n");
+       }
+    }  else {
+       GSList *holding_list, *holding_file;
+       off_t  h_size = 0, mh_size;
+
+       holding_list = holding_get_files_for_flush(NULL);
+       for(holding_file=holding_list; holding_file != NULL;
+                                      holding_file = holding_file->next) {
+           mh_size = holding_file_size((char *)holding_file->data, 1);
+           if (mh_size > 0)
+               h_size += mh_size;
+       }
+
+       if (h_size > 0) {
+           g_fprintf(mailf,
+                   _("There are %lld%s of dumps left in the holding disk.\n"),
+                   (long long)h_size, displayunit);
+           if (getconf_boolean(CNF_AUTOFLUSH)) {
+               g_fprintf(mailf, _("They will be flushed on the next run.\n"));
+           } else {
+               g_fprintf(mailf, _("Run amflush to flush them to tape.\n"));
+           }
+           g_fprintf(mailf,"\n");
+       } else if (degraded_mode) {
+           g_fprintf(mailf, _("No dumps are left in the holding disk. %lld%s\n"), (long long)h_size, displayunit);
+           g_fprintf(mailf,"\n");
+       }
     }
 
     tp = lookup_last_reusable_tape(skip);
@@ -1030,19 +1064,19 @@ output_tapeinfo(void)
     run_tapes = getconf_int(CNF_RUNTAPES);
 
     if (run_tapes == 1)
-       fputs("The next tape Amanda expects to use is: ", mailf);
+       fputs(_("The next tape Amanda expects to use is: "), mailf);
     else if(run_tapes > 1)
-       fprintf(mailf, "The next %d tapes Amanda expects to use are: ",
+       g_fprintf(mailf, _("The next %d tapes Amanda expects to use are: "),
                run_tapes);
     
     while(run_tapes > 0) {
        if(tp != NULL) {
-           fprintf(mailf, "%s", tp->label);
+           g_fprintf(mailf, "%s", tp->label);
        } else {
            if (run_tapes == 1)
-               fprintf(mailf, "a new tape");
+               g_fprintf(mailf, _("a new tape"));
            else
-               fprintf(mailf, "%d new tapes", run_tapes);
+               g_fprintf(mailf, _("%d new tapes"), run_tapes);
            run_tapes = 1;
        }
 
@@ -1065,42 +1099,43 @@ output_tapeinfo(void)
        }
        lasttp = lookup_tapepos(lookup_nb_tape());
        if(c == 1) {
-           fprintf(mailf, "The next new tape already labelled is: %s.\n",
+           g_fprintf(mailf, _("The next new tape already labelled is: %s.\n"),
                    lasttp->label);
        }
        else {
-           fprintf(mailf, "The next %d new tapes already labelled are: %s", c,
+           g_fprintf(mailf, _("The next %d new tapes already labelled are: %s"), c,
                    lasttp->label);
            lasttp = lasttp->prev;
            c--;
            while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-               fprintf(mailf, ", %s", lasttp->label);
+               g_fprintf(mailf, ", %s", lasttp->label);
                lasttp = lasttp->prev;
                c--;
            }
-           fprintf(mailf, ".\n");
+           g_fprintf(mailf, ".\n");
        }
     }
 }
 
 /* ----- */
 static void
-output_strange(void)
+output_X_summary(
+    X_summary_t *first)
 {
     size_t len_host=0, len_disk=0;
-    strange_t *strange;
+    X_summary_t *strange;
     char *str = NULL;
 
-    for(strange=first_strange; strange != NULL; strange = strange->next) {
+    for(strange=first; strange != NULL; strange = strange->next) {
        if(strlen(strange->hostname) > len_host)
            len_host = strlen(strange->hostname);
        if(strlen(strange->diskname) > len_disk)
            len_disk = strlen(strange->diskname);
     }
-    for(strange=first_strange; strange != NULL; strange = strange->next) {
+    for(strange=first; strange != NULL; strange = strange->next) {
        str = vstralloc("  ", prefixstrange(strange->hostname, strange->diskname, strange->level, len_host, len_disk),
                        "  ", strange->str, NULL);
-       fprintf(mailf, "%s\n", str);
+       g_fprintf(mailf, "%s\n", str);
        amfree(str);
     }
 }
@@ -1173,7 +1208,7 @@ CheckIntMax(
        char testBuf[200];
        int l;
 
-       snprintf(testBuf, SIZEOF(testBuf),
+       g_snprintf(testBuf, SIZEOF(testBuf),
          cd->Format, cd->Width, cd->Precision, n);
        l = (int)strlen(testBuf);
        if (cd->Width < l)
@@ -1189,7 +1224,8 @@ CheckFloatMax(
     if (cd->MaxWidth) {
        char testBuf[200];
        int l;
-       snprintf(testBuf, SIZEOF(testBuf),
+
+       g_snprintf(testBuf, SIZEOF(testBuf),
          cd->Format, cd->Width, cd->Precision, d);
        l = (int)strlen(testBuf);
        if (cd->Width < l)
@@ -1221,6 +1257,15 @@ CalcMaxWidth(void)
     double f;
     repdata_t *repdata;
     char *qdevname;
+    int i, l;
+
+    for (i=0;ColumnData[i].Name != NULL; i++) {
+       if (ColumnData[i].MaxWidth) {
+           l = (int)strlen(ColumnData[i].Title);
+           if (ColumnData[i].Width < l)
+               ColumnData[i].Width= l;
+       }
+    }
 
     for(dp = sortq.head; dp != NULL; dp = dp->next) {
       if(dp->todo) {
@@ -1241,18 +1286,18 @@ CalcMaxWidth(void)
                              (double)du(repdata->dumper.origsize));
                CheckFloatMax(&ColumnData[OutKB],
                              (double)du(repdata->dumper.outsize));
-               if(dp->compress == COMP_NONE)
+               if(abs(repdata->dumper.outsize - repdata->dumper.origsize)< 32)
                    f = 0.0;
                else 
                    f = repdata->dumper.origsize;
-               CheckStringMax(&ColumnData[Disk], 
+               CheckStringMax(&ColumnData[Compress], 
                        sDivZero(pct(repdata->dumper.outsize), f, Compress));
 
                if(!amflush_run)
-                   snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+                   g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                                "%3d:%02d", mnsc(repdata->dumper.sec));
                else
-                   snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+                   g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                                "N/A ");
                CheckStringMax(&ColumnData[DumpTime], TimeRateBuffer);
 
@@ -1265,10 +1310,10 @@ CalcMaxWidth(void)
            }
            if(repdata->taper.result == L_SUCCESS ||
               repdata->taper.result == L_CHUNKSUCCESS)
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer), 
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer), 
                  "%3d:%02d", mnsc(repdata->taper.sec));
            else
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                  "N/A ");
            CheckStringMax(&ColumnData[TapeTime], TimeRateBuffer);
 
@@ -1322,23 +1367,23 @@ output_summary(void)
     } else {
        h = (wDump-h)/2;
     }
-    fprintf(mailf, "%*s", w1+h, "");
-    fprintf(mailf, "%-*s", wDump-h, ds);
+    g_fprintf(mailf, "%*s", w1+h, "");
+    g_fprintf(mailf, "%-*s", wDump-h, ds);
     h = (int)strlen(ts);
     if (h > wTape) {
        h = 0;
     } else {
        h = (wTape-h)/2;
     }
-    fprintf(mailf, "%*s", h, "");
-    fprintf(mailf, "%-*s", wTape-h, ts);
+    g_fprintf(mailf, "%*s", h, "");
+    g_fprintf(mailf, "%-*s", wTape-h, ts);
     fputc('\n', mailf);
 
     /* print the titles */
     for (i=0; ColumnData[i].Name != NULL; i++) {
        char *fmt;
        ColumnInfo *cd= &ColumnData[i];
-       fprintf(mailf, "%*s", cd->PrefixSpace, "");
+       g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
        if (cd->Format[1] == '-')
            fmt= "%-*s";
        else
@@ -1353,7 +1398,7 @@ output_summary(void)
            cd->Title = stralloc("OUT-KB");
            cd->Title[4] = displayunit[0];
        }
-       fprintf(mailf, fmt, cd->Width, cd->Title);
+       g_fprintf(mailf, fmt, cd->Width, cd->Title);
     }
     fputc('\n', mailf);
 
@@ -1373,48 +1418,48 @@ output_summary(void)
            size_t devlen;
 
            cd= &ColumnData[HostName];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
-           fprintf(mailf, cd->Format, cd->Width, cd->Width, dp->host->hostname);
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, cd->Format, cd->Width, cd->Width, dp->host->hostname);
 
            cd= &ColumnData[Disk];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            devname = sanitize_string(dp->name);
            qdevname = quote_string(devname);
            devlen = strlen(qdevname);
            if (devlen > (size_t)cd->Width) {
                fputc('-', mailf); 
-               fprintf(mailf, cd->Format, cd->Width-1, cd->Precision-1,
+               g_fprintf(mailf, cd->Format, cd->Width-1, cd->Precision-1,
                        qdevname+devlen - (cd->Width-1) );
            }
            else
-               fprintf(mailf, cd->Format, cd->Width, cd->Width, qdevname);
+               g_fprintf(mailf, cd->Format, cd->Width, cd->Width, qdevname);
            amfree(devname);
            amfree(qdevname);
            cd= &ColumnData[Level];
            if (repdata->dumper.result == L_BOGUS &&
                repdata->taper.result  == L_BOGUS) {
              if(amflush_run){
-               fprintf(mailf, "%*s%s\n", cd->PrefixSpace+cd->Width, "",
+               g_fprintf(mailf, "%*s%s\n", cd->PrefixSpace+cd->Width, "",
                        tmp=TextRule(OrigKB, TapeRate, "NO FILE TO FLUSH"));
              } else {
-               fprintf(mailf, "%*s%s\n", cd->PrefixSpace+cd->Width, "",
+               g_fprintf(mailf, "%*s%s\n", cd->PrefixSpace+cd->Width, "",
                        tmp=TextRule(OrigKB, TapeRate, "MISSING"));
              }
              amfree(tmp);
              continue;
            }
            
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
-           fprintf(mailf, cd->Format, cd->Width, cd->Precision,repdata->level);
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, cd->Format, cd->Width, cd->Precision,repdata->level);
 
            if (repdata->dumper.result == L_SKIPPED) {
-               fprintf(mailf, "%s\n",
+               g_fprintf(mailf, "%s\n",
                        tmp=TextRule(OrigKB, TapeRate, "SKIPPED"));
                amfree(tmp);
                continue;
            }
            if (repdata->dumper.result == L_FAIL && (repdata->chunker.result != L_PARTIAL && repdata->taper.result  != L_PARTIAL)) {
-               fprintf(mailf, "%s\n",
+               g_fprintf(mailf, "%s\n",
                        tmp=TextRule(OrigKB, TapeRate, "FAILED"));
                amfree(tmp);
                exit_status |= STATUS_FAILED;
@@ -1443,21 +1488,21 @@ output_summary(void)
                outsize  = repdata->dumper.outsize;
 
            cd= &ColumnData[OrigKB];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            if(isnormal(origsize))
-               fprintf(mailf, cd->Format, cd->Width, cd->Precision, du(origsize));
+               g_fprintf(mailf, cd->Format, cd->Width, cd->Precision, du(origsize));
            else
-               fprintf(mailf, "%*.*s", cd->Width, cd->Width, "N/A");
+               g_fprintf(mailf, "%*.*s", cd->Width, cd->Width, "N/A");
 
            cd= &ColumnData[OutKB];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
 
-           fprintf(mailf, cd->Format, cd->Width, cd->Precision, du(outsize));
+           g_fprintf(mailf, cd->Format, cd->Width, cd->Precision, du(outsize));
                
            cd= &ColumnData[Compress];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
 
-           if(dp->compress == COMP_NONE)
+           if(abs(outsize - origsize) < 32)
                f = 0.0;
            else if(origsize < 1.0)
                f = 0.0;
@@ -1467,28 +1512,28 @@ output_summary(void)
            fputs(sDivZero(pct(outsize), f, Compress), mailf);
 
            cd= &ColumnData[DumpTime];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            if(repdata->dumper.result == L_SUCCESS ||
               repdata->dumper.result == L_CHUNKSUCCESS)
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                  "%3d:%02d", mnsc(repdata->dumper.sec));
            else
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                  "N/A ");
-           fprintf(mailf, cd->Format, cd->Width, cd->Width, TimeRateBuffer);
+           g_fprintf(mailf, cd->Format, cd->Width, cd->Width, TimeRateBuffer);
 
            cd= &ColumnData[DumpRate];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            if(repdata->dumper.result == L_SUCCESS ||
                    repdata->dumper.result == L_CHUNKSUCCESS)
-               fprintf(mailf, cd->Format, cd->Width, cd->Precision, repdata->dumper.kps);
+               g_fprintf(mailf, cd->Format, cd->Width, cd->Precision, repdata->dumper.kps);
            else
-               fprintf(mailf, "%*s", cd->Width, "N/A ");
+               g_fprintf(mailf, "%*s", cd->Width, "N/A ");
 
            cd= &ColumnData[TapeTime];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            if(repdata->taper.result == L_FAIL) {
-               fprintf(mailf, "%s\n",
+               g_fprintf(mailf, "%s\n",
                        tmp=TextRule(TapeTime, TapeRate, "FAILED "));
                amfree(tmp);
                continue;
@@ -1497,26 +1542,26 @@ output_summary(void)
            if(repdata->taper.result == L_SUCCESS || 
               repdata->taper.result == L_PARTIAL ||
               repdata->taper.result == L_CHUNKSUCCESS)
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                  "%3d:%02d", mnsc(repdata->taper.sec));
            else
-               snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
+               g_snprintf(TimeRateBuffer, SIZEOF(TimeRateBuffer),
                  "N/A ");
-           fprintf(mailf, cd->Format, cd->Width, cd->Width, TimeRateBuffer);
+           g_fprintf(mailf, cd->Format, cd->Width, cd->Width, TimeRateBuffer);
 
            cd= &ColumnData[TapeRate];
-           fprintf(mailf, "%*s", cd->PrefixSpace, "");
+           g_fprintf(mailf, "%*s", cd->PrefixSpace, "");
            if(repdata->taper.result == L_SUCCESS || 
               repdata->taper.result == L_PARTIAL ||
               repdata->taper.result == L_CHUNKSUCCESS)
-               fprintf(mailf, cd->Format, cd->Width, cd->Precision, repdata->taper.kps);
+               g_fprintf(mailf, cd->Format, cd->Width, cd->Precision, repdata->taper.kps);
            else
-               fprintf(mailf, "%*s", cd->Width, "N/A ");
+               g_fprintf(mailf, "%*s", cd->Width, "N/A ");
 
            if (repdata->chunker.result == L_PARTIAL)
-               fprintf(mailf, " PARTIAL");
+               g_fprintf(mailf, " PARTIAL");
            else if(repdata->taper.result == L_PARTIAL)
-               fprintf(mailf, " TAPE-PARTIAL");
+               g_fprintf(mailf, " TAPE-PARTIAL");
 
            fputc('\n', mailf);
        }
@@ -1528,8 +1573,14 @@ static void
 bogus_line(
     const char *err_text)
 {
-    printf("line %d of log is bogus: <%s>\n", curlinenum, curstr);
-    printf("  Scan failed at: <%s>\n", err_text);
+    char * s;
+    s = g_strdup_printf(_("line %d of log is bogus: <%s %s %s>\n"),
+                        curlinenum, 
+                        logtype_str[curlog], program_str[curprog], curstr);
+    g_printf("%s\n", s);
+    g_printf(_("  Scan failed at: <%s>\n"), err_text);
+    addline(&errsum, s);
+    amfree(s);
 }
 
 
@@ -1546,9 +1597,20 @@ nicedate(
     static char nice[64];
     char date[9];
     int  numdate;
-    static char *months[13] = { "BogusMonth",
-       "January", "February", "March", "April", "May", "June",
-       "July", "August", "September", "October", "November", "December"
+    static char *months[13] = {
+               T_("BogusMonth"),
+               T_("January"),
+               T_("February"),
+               T_("March"),
+               T_("April"),
+               T_("May"),
+               T_("June"),
+               T_("July"),
+               T_("August"),
+               T_("September"),
+               T_("October"),
+               T_("November"),
+               T_("December")
     };
     int year, month, day;
 
@@ -1561,7 +1623,7 @@ nicedate(
     if (month > 12 )
        month = 0;
 
-    snprintf(nice, SIZEOF(nice), "%s %d, %d", months[month], day, year);
+    g_snprintf(nice, SIZEOF(nice), "%s %d, %d", _(months[month]), day, year);
 
     return nice;
 }
@@ -1678,7 +1740,7 @@ handle_start(void)
     if(amflush_run && normal_run) {
        amflush_run = 0;
        addline(&notes,
-     "  reporter: both amflush and planner output in log, ignoring amflush.");
+     _("  reporter: both amflush and planner output in log, ignoring amflush."));
     }
 }
 
@@ -1739,7 +1801,7 @@ handle_stats(void)
 {
     char *s, *fp;
     int ch;
-    char *hostname, *diskname, *datestamp;
+    char *hostname, *diskname, *datestamp, *qdiskname;
     int level = 0;
     double sec, kps, nbytes, cbytes;
     repdata_t *repdata;
@@ -1788,10 +1850,11 @@ handle_stats(void)
                amfree(hostname);
                return;
            }
-           fp = s - 1;
-           skip_non_whitespace(s, ch);
+
+           qdiskname = s - 1;
+           skip_quoted_string(s, ch);
            s[-1] = '\0';
-           diskname = stralloc(fp);
+           diskname = unquote_string(qdiskname);
            s[-1] = (char)ch;
 
            skip_whitespace(s, ch);
@@ -1806,8 +1869,8 @@ handle_stats(void)
            s[-1] = '\0';
            datestamp = stralloc(fp);
            s[-1] = (char)ch;
-
            skip_whitespace(s, ch);
+
            if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
                bogus_line(s - 1);
                amfree(hostname);
@@ -1836,8 +1899,9 @@ handle_stats(void)
 
            dp = lookup_disk(hostname, diskname);
            if(dp == NULL) {
-               addtostrange(hostname, diskname, level,
-                            "ERROR [not in disklist]");
+               addtoX_summary(&first_failed, &last_failed,
+                              hostname, diskname, level,
+                              _("ERROR [not in disklist]"));
                exit_status |= STATUS_FAILED;
                amfree(hostname);
                amfree(diskname);
@@ -1869,7 +1933,7 @@ handle_note(void)
 {
     char *str = NULL;
 
-    str = vstralloc("  ", program_str[curprog], ": ", curstr, NULL);
+    str = vstrallocf("  %s: %s", program_str[curprog], curstr);
     addline(&notes, str);
     amfree(str);
 }
@@ -1904,8 +1968,8 @@ handle_error(void)
        }
        /* else some other tape error, handle like other errors */
     }
-    s = vstralloc("  ", program_str[curprog], ": ",
-                 logtype_str[curlog], " ", curstr, NULL);
+    s = vstrallocf("  %s: %s %s", program_str[curprog],
+                 logtype_str[curlog], curstr);
     addline(&errsum, s);
     amfree(s);
 }
@@ -1981,7 +2045,8 @@ handle_disk(void)
  * for a split chunk of the overall dumpfile.
  */
 static repdata_t *
-handle_chunk(void)
+handle_chunk(
+    logtype_t logtype)
 {
     disk_t *dp;
     double sec, kps, kbytes;
@@ -1994,6 +2059,9 @@ handle_chunk(void)
     repdata_t *repdata;
     int level, chunk;
     char *datestamp;
+    char *label = NULL;
+    int fileno;
+    int totpart;
     
     if(curprog != P_TAPER) {
        bogus_line(curstr);
@@ -2002,12 +2070,36 @@ handle_chunk(void)
     
     s = curstr;
     ch = *s++;
-    
+
     skip_whitespace(s, ch);
     if(ch == '\0') {
        bogus_line(s - 1);
        return NULL;
     }
+
+    if (logtype == L_PART || logtype == L_PARTPARTIAL) {
+       fp = s - 1;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       label = stralloc(fp);
+       s[-1] = (char)ch;
+    
+       skip_whitespace(s, ch);
+       if(ch == '\0' || sscanf(s - 1, "%d", &fileno) != 1) {
+           bogus_line(s - 1);
+           amfree(label);
+           return NULL;
+       }
+       skip_integer(s, ch);
+       skip_whitespace(s, ch);
+       if(ch == '\0') {
+           bogus_line(s - 1);
+           amfree(label);
+           return NULL;
+       }
+       amfree(label);
+    }
+
     fp = s - 1;
     skip_non_whitespace(s, ch);
     s[-1] = '\0';
@@ -2049,6 +2141,18 @@ handle_chunk(void)
     }
     skip_integer(s, ch);
 
+    if (ch != '\0' && s[-1] == '/') {
+       s++; ch = s[-1];
+       if (sscanf(s - 1, "%d", &totpart) != 1) {
+           bogus_line(s - 1);
+           amfree(hostname);
+           amfree(diskname);
+           amfree(datestamp);
+           return NULL;
+       }
+       skip_integer(s, ch);
+    }
+
     skip_whitespace(s, ch);
     if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
        bogus_line(s - 1);
@@ -2082,9 +2186,8 @@ handle_chunk(void)
     if(dp == NULL) {
        char *str = NULL;
        
-       str = vstralloc("  ", prefix(hostname, diskname, level),
-                       " ", "ERROR [not in disklist]",
-                       NULL);
+       str = vstrallocf(_("  %s ERROR [not in disklist]"),
+                       prefix(hostname, diskname, level));
        addline(&errsum, str);
        amfree(str);
        amfree(hostname);
@@ -2135,8 +2238,11 @@ handle_success(
     char *diskname = NULL;
     repdata_t *repdata;
     int level = 0;
+    int totpart = 0;
     char *datestamp;
 
+    (void)logtype;
+
     if(curprog != P_TAPER && curprog != P_DUMPER && curprog != P_PLANNER &&
        curprog != P_CHUNKER) {
        bogus_line(curstr);
@@ -2181,12 +2287,32 @@ handle_success(
     datestamp = stralloc(fp);
     s[-1] = (char)ch;
 
-    if(strlen(datestamp) < 3) {
-       level = atoi(datestamp);
+    //datestamp is optional
+    if(strlen(datestamp) < 6) {
+       totpart = atoi(datestamp);
        datestamp = newstralloc(datestamp, run_datestamp);
     }
     else {
        skip_whitespace(s, ch);
+       if(ch == '\0' || sscanf(s - 1, "%d", &totpart) != 1) {
+           bogus_line(s - 1);
+           amfree(hostname);
+           amfree(diskname);
+           amfree(datestamp);
+           return NULL;
+       }
+       skip_integer(s, ch);
+    }
+
+    skip_whitespace(s, ch);
+
+    //totpart is optional
+    if (*(s-1) == '"')
+       s++;
+    if (*(s-1) == '[') {
+       level = totpart;
+       totpart = -1;
+    } else {
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
            bogus_line(s - 1);
            amfree(hostname);
@@ -2195,8 +2321,10 @@ handle_success(
            return NULL;
        }
        skip_integer(s, ch);
+       skip_whitespace(s, ch);
     }
 
+
     if(level < 0 || level > 9) {
        amfree(hostname);
        amfree(diskname);
@@ -2204,7 +2332,6 @@ handle_success(
        return NULL;
     }
 
-    skip_whitespace(s, ch);
                                /* Planner success messages (for skipped
                                   dumps) do not contain statistics */
     if(curprog != P_PLANNER) {
@@ -2232,7 +2359,8 @@ handle_success(
 
     dp = lookup_disk(hostname, diskname);
     if(dp == NULL) {
-       addtostrange(hostname, qdiskname, level, "ERROR [not in disklist]");
+       addtoX_summary(&first_failed, &last_failed, hostname, qdiskname, level,
+                      _("ERROR [not in disklist]"));
        exit_status |= STATUS_FAILED;
        amfree(hostname);
        amfree(diskname);
@@ -2282,7 +2410,8 @@ handle_success(
 
     if (curprog == P_DUMPER &&
        (sp->result == L_FAIL || sp->result == L_PARTIAL)) {
-       addtostrange(hostname, qdiskname, level, "was successfully retried");
+       addtoX_summary(&first_failed, &last_failed, hostname, qdiskname, level,
+                      _("was successfully retried"));
     }
 
     amfree(hostname);
@@ -2298,33 +2427,29 @@ handle_success(
 
     if(curprog == P_TAPER) {
        if(current_tape == NULL) {
-           error("current_tape == NULL");
+           error(_("current_tape == NULL"));
            /*NOTREACHED*/
        }
        stats[i].taper_time += sec;
        sp->filenum = ++tapefcount;
        sp->tapelabel = current_tape->label;
+       sp->totpart = totpart;
        tapedisks[level] +=1;
        stats[i].tapedisks +=1;
        stats[i].tapesize += kbytes;
        sp->outsize = kbytes;
        if(!isnormal(repdata->chunker.outsize) && isnormal(repdata->dumper.outsize)) { /* dump to tape */
            stats[i].outsize += kbytes;
-           if(dp->compress != COMP_NONE) {
+           if (abs(kbytes - origkb) >= 32) {
                stats[i].coutsize += kbytes;
            }
        }
-       if (logtype == L_SUCCESS || logtype== L_PARTIAL) {
-           current_tape->taper_time += sec;
-           current_tape->coutsize += kbytes;
-       }
-       current_tape->corigsize += origkb;
        current_tape->tapedisks += 1;
     }
 
     if(curprog == P_DUMPER) {
        stats[i].dumper_time += sec;
-       if(dp->compress == COMP_NONE) {
+       if (abs(kbytes - origkb) < 32) {
            sp->origsize = kbytes;
        }
        else {
@@ -2338,7 +2463,7 @@ handle_success(
     if(curprog == P_CHUNKER) {
        sp->outsize = kbytes;
        stats[i].outsize += kbytes;
-       if(dp->compress != COMP_NONE) {
+       if (abs(kbytes - origkb) >= 32) {
            stats[i].coutsize += kbytes;
        }
     }
@@ -2378,12 +2503,10 @@ handle_strange(void)
 
     qdisk = quote_string(repdata->disk->name);
 
-    addline(&errdet,"");
-    str = vstralloc("/-- ", prefix(repdata->disk->host->hostname, 
-                                  qdisk, repdata->level),
-                   " ", "STRANGE",
-                   NULL);
-    addline(&errdet, str);
+    addline(&strangedet,"");
+    str = vstrallocf("/-- %s STRANGE",
+               prefix(repdata->disk->host->hostname, qdisk, repdata->level));
+    addline(&strangedet, str);
     amfree(str);
 
     while(contline_next()) {
@@ -2393,12 +2516,13 @@ handle_strange(void)
        if(strncmp_const_skip(curstr, "sendbackup: warning ", s, ch) == 0) {
            strangestr = newstralloc(strangestr, s);
        }
-       addline(&errdet, curstr);
+       addline(&strangedet, curstr);
     }
-    addline(&errdet,"\\--------");
+    addline(&strangedet,"\\--------");
 
-    str = vstralloc("STRANGE", " ", strangestr, NULL);
-    addtostrange(repdata->disk->host->hostname, qdisk, repdata->level, str);
+    str = vstrallocf("STRANGE %s", strangestr? strangestr : _("(see below)"));
+    addtoX_summary(&first_strange, &last_strange,
+                  repdata->disk->host->hostname, qdisk, repdata->level, str);
     exit_status |= STATUS_STRANGE;
     amfree(qdisk);
     amfree(str);
@@ -2486,7 +2610,8 @@ handle_failed(void)
     dp = lookup_disk(hostname, diskname);
     amfree(diskname);
     if(dp == NULL) {
-       addtostrange(hostname, qdiskname, level, "ERROR [not in disklist]");
+       addtoX_summary(&first_failed, &last_failed, hostname, qdiskname, level,
+                      _("ERROR [not in disklist]"));
     } else {
        repdata = find_repdata(dp, datestamp, level);
 
@@ -2499,16 +2624,16 @@ handle_failed(void)
     }
     amfree(datestamp);
 
-    str = vstralloc("FAILED", " ", errstr, NULL);
-    addtostrange(hostname, qdiskname, level, str);
+    str = vstrallocf(_("FAILED %s"), errstr);
+    addtoX_summary(&first_failed, &last_failed, hostname, qdiskname, level,
+                  str);
     amfree(str);
 
     if(curprog == P_DUMPER) {
        addline(&errdet,"");
-       str = vstralloc("/-- ", prefix(hostname, qdiskname, level),
-                       " ", "FAILED",
-                       " ", errstr,
-                       NULL);
+       str = vstrallocf("/-- %s FAILED %s",
+                       prefix(hostname, qdiskname, level), 
+                       errstr);
        addline(&errdet, str);
        amfree(str);
        while(contline_next()) {
@@ -2531,7 +2656,8 @@ generate_missing(void)
     for(dp = diskq.head; dp != NULL; dp = dp->next) {
        if(dp->todo && data(dp) == NULL) {
            qdisk = quote_string(dp->name);
-           addtostrange(dp->host->hostname, qdisk, -987, "RESULTS MISSING");
+           addtoX_summary(&first_failed, &last_failed, dp->host->hostname,
+                          qdisk, -987, _("RESULTS MISSING"));
            exit_status |= STATUS_MISSING;
            amfree(qdisk);
        }
@@ -2563,30 +2689,30 @@ generate_bad_estimate(void)
                        outsize  = repdata->dumper.outsize;
 
                    if(repdata->est_csize * 0.9 > outsize) {
-                       snprintf(s, 1000,
-                               "  big estimate: %s %s %d",
+                       g_snprintf(s, 1000,
+                               _("  big estimate: %s %s %d"),
                                 repdata->disk->host->hostname,
                                 repdata->disk->name,
                                 repdata->level);
                        s[999] = '\0';
                        addline(&notes, s);
-                       snprintf(s, 1000,
-                                "                est: %.0lf%s    out %.0lf%s",
+                       g_snprintf(s, 1000,
+                                _("                est: %.0lf%s    out %.0lf%s"),
                                 du(repdata->est_csize), displayunit,
                                 du(outsize), displayunit);
                        s[999] = '\0';
                        addline(&notes, s);
                    }
                    else if(repdata->est_csize * 1.1 < outsize) {
-                       snprintf(s, 1000,
-                               "  small estimate: %s %s %d",
+                       g_snprintf(s, 1000,
+                               _("  small estimate: %s %s %d"),
                                 repdata->disk->host->hostname,
                                 repdata->disk->name,
                                 repdata->level);
                        s[999] = '\0';
                        addline(&notes, s);
-                       snprintf(s, 1000,
-                                "                  est: %.0lf%s    out %.0lf%s",
+                       g_snprintf(s, 1000,
+                                _("                  est: %.0lf%s    out %.0lf%s"),
                                 du(repdata->est_csize), displayunit,
                                 du(outsize), displayunit);
                        s[999] = '\0';
@@ -2604,16 +2730,18 @@ prefix (
     char *     disk,
     int                level)
 {
-    char number[NUM_STR_SIZE];
     static char *str = NULL;
 
-    snprintf(number, SIZEOF(number), "%d", level);
-    str = newvstralloc(str,
-                      " ", host ? host : "(host?)",
-                      " ", disk ? disk : "(disk?)",
-                      level != -987 ? " lev " : "",
-                      level != -987 ? number : "",
-                      NULL);
+    if (level == -987) {
+       str = newvstrallocf(str, " %s %s",
+                       host ? host : _("(host?)"),
+                       disk ? disk : _("(disk?)"));
+    } else {
+       str = newvstrallocf(str, " %s %s lev %d",
+                       host ? host : _("(host?)"),
+                       disk ? disk : _("(disk?)"),
+                       level);
+    }
     return str;
 }
 
@@ -2628,15 +2756,13 @@ prefixstrange (
 {
     char *h, *d;
     size_t l;
-    char number[NUM_STR_SIZE];
     static char *str = NULL;
 
-    snprintf(number, SIZEOF(number), "%d", level);
     h=alloc(len_host+1);
     if(host) {
        strncpy(h, host, len_host);
     } else {
-       strncpy(h, "(host?)", len_host);
+       strncpy(h, _("(host?)"), len_host);
     }
     h[len_host] = '\0';
     for(l = strlen(h); l < len_host; l++) {
@@ -2646,18 +2772,17 @@ prefixstrange (
     if(disk) {
        strncpy(d, disk, len_disk);
     } else {
-       strncpy(d, "(disk?)", len_disk);
+       strncpy(d, _("(disk?)"), len_disk);
     }
     d[len_disk] = '\0';
     for(l = strlen(d); l < len_disk; l++) {
        d[l] = ' ';
     }
-    str = newvstralloc(str,
-                      h,
-                      "  ", d,
-                      level != -987 ? "  lev " : "",
-                      level != -987 ? number : "",
-                      NULL);
+    if (level == -987) {
+       str = newvstrallocf(str, " %s %s", h, d);
+    } else {
+       str = newvstrallocf(str, " %s %s lev %d", h, d, level);
+    }
     amfree(h);
     amfree(d);
     return str;
@@ -2665,30 +2790,31 @@ prefixstrange (
 
 
 static void
-addtostrange (
-    char *     host,
-    char *     disk,
-    int                level,
-    char *     str)
+addtoX_summary (
+    X_summary_t **first,
+    X_summary_t **last,
+    char        *host,
+    char        *disk,
+    int                  level,
+    char        *str)
 {
-    strange_t *strange;
+    X_summary_t *X_summary;
 
-    strange = alloc(SIZEOF(strange_t));
-    strange->hostname = stralloc(host);
-    strange->diskname = stralloc(disk);
-    strange->level    = level;
-    strange->str      = stralloc(str);
-    strange->next = NULL;
-    if(first_strange == NULL) {
-       first_strange = strange;
+    X_summary = alloc(SIZEOF(X_summary_t));
+    X_summary->hostname = stralloc(host);
+    X_summary->diskname = stralloc(disk);
+    X_summary->level    = level;
+    X_summary->str      = stralloc(str);
+    X_summary->next = NULL;
+    if (*first == NULL) {
+       *first = X_summary;
     }
     else {
-        last_strange->next = strange;
+        (*last)->next = X_summary;
     }
-    last_strange = strange;
+    *last = X_summary;
 }
 
-
 static void
 copy_template_file(
     char *     lbl_templ)
@@ -2697,19 +2823,12 @@ copy_template_file(
   int fd;
   ssize_t numread;
 
-  if (strchr(lbl_templ, '/') == NULL) {
-    lbl_templ = stralloc2(config_dir, lbl_templ);
-  } else {
-    lbl_templ = stralloc(lbl_templ);
-  }
+  lbl_templ = config_dir_relative(lbl_templ);
   if ((fd = open(lbl_templ, 0)) < 0) {
     curlog = L_ERROR;
     curprog = P_REPORTER;
-    curstr = vstralloc("could not open PostScript template file ",
-                      lbl_templ,
-                      ": ",
-                      strerror(errno),
-                      NULL);
+    curstr = vstrallocf(_("could not open PostScript template file %s: %s"),
+                      lbl_templ, strerror(errno));
     handle_error();
     amfree(curstr);
     amfree(lbl_templ);
@@ -2720,11 +2839,8 @@ copy_template_file(
     if (fwrite(buf, (size_t)numread, 1, postscript) != 1) {
       curlog = L_ERROR;
       curprog = P_REPORTER;
-      curstr = vstralloc("error copying PostScript template file ",
-                        lbl_templ,
-                        ": ",
-                        strerror(errno),
-                        NULL);
+      curstr = vstrallocf(_("error copying PostScript template file %s: %s"),
+                        lbl_templ, strerror(errno));
       handle_error();
       amfree(curstr);
       amfree(lbl_templ);
@@ -2735,11 +2851,8 @@ copy_template_file(
   if (numread < 0) {
     curlog = L_ERROR;
     curprog = P_REPORTER;
-    curstr = vstralloc("error reading PostScript template file ",
-                      lbl_templ,
-                      ": ",
-                      strerror(errno),
-                      NULL);
+    curstr = vstrallocf(_("error reading PostScript template file %s: %s"),
+                      lbl_templ, strerror(errno));
     handle_error();
     amfree(curstr);
     amfree(lbl_templ);
@@ -2811,28 +2924,28 @@ do_postscript_output(void)
            return;
 
        /* generate a few elements */
-       fprintf(postscript,"(%s) DrawDate\n\n",
+       g_fprintf(postscript,"(%s) DrawDate\n\n",
                    nicedate(run_datestamp ? run_datestamp : "0"));
-       fprintf(postscript,"(Amanda Version %s) DrawVers\n",version());
-       fprintf(postscript,"(%s) DrawTitle\n", current_tape->label);
+       g_fprintf(postscript,_("(Amanda Version %s) DrawVers\n"),version());
+       g_fprintf(postscript,"(%s) DrawTitle\n", current_tape->label);
 
        /* Stats */
-       fprintf(postscript, "(Total Size:        %6.1lf MB) DrawStat\n",
+       g_fprintf(postscript, "(Total Size:        %6.1lf MB) DrawStat\n",
              mb(current_tape->coutsize));
-       fprintf(postscript, "(Tape Used (%%)       ");
+       g_fprintf(postscript, _("(Tape Used (%%)       "));
        divzero(postscript, pct(current_tape->coutsize + 
                                marksize * (current_tape->tapedisks + current_tape->tapechunks)),
                                (double)tapesize);
-       fprintf(postscript," %%) DrawStat\n");
-       fprintf(postscript, "(Compression Ratio:  ");
+       g_fprintf(postscript," %%) DrawStat\n");
+       g_fprintf(postscript, _("(Compression Ratio:  "));
        divzero(postscript, pct(current_tape->coutsize),current_tape->corigsize);
-       fprintf(postscript," %%) DrawStat\n");
-       fprintf(postscript,"(Filesystems Taped: %4d) DrawStat\n",
+       g_fprintf(postscript," %%) DrawStat\n");
+       g_fprintf(postscript,_("(Filesystems Taped: %4d) DrawStat\n"),
                  current_tape->tapedisks);
 
        /* Summary */
 
-       fprintf(postscript,
+       g_fprintf(postscript,
              "(-) (%s) (-) (  0) (      32) (      32) DrawHost\n",
              current_tape->label);
 
@@ -2861,13 +2974,13 @@ do_postscript_output(void)
                if (repdata->taper.result == L_SUCCESS ||
                    repdata->taper.result == L_PARTIAL) {
                    if(isnormal(origsize)) {
-                       fprintf(postscript,"(%s) (%s) (%d) (%3.0d) (%8.0lf) (%8.0lf) DrawHost\n",
+                       g_fprintf(postscript,"(%s) (%s) (%d) (%3.0d) (%8.0lf) (%8.0lf) DrawHost\n",
                            dp->host->hostname, dp->name, repdata->level,
                            repdata->taper.filenum, origsize, 
                            outsize);
                    }
                    else {
-                       fprintf(postscript,"(%s) (%s) (%d) (%3.0d) (%8s) (%8.0lf) DrawHost\n",
+                       g_fprintf(postscript,"(%s) (%s) (%d) (%3.0d) (%8s) (%8.0lf) DrawHost\n",
                            dp->host->hostname, dp->name, repdata->level,
                            repdata->taper.filenum, "N/A", 
                            outsize);
@@ -2876,6 +2989,6 @@ do_postscript_output(void)
            }
        }
        
-       fprintf(postscript,"\nshowpage\n");
+       g_fprintf(postscript,"\nshowpage\n");
     }
 }
index 95e57b3cf024a61d61887b91a85dfbb844977ff5..7c6c3231c83ee993e144a4f4ba992bf6fa2a16f4 100644 (file)
@@ -42,9 +42,12 @@ const char *cmdstr[] = {
     "START", "FILE-DUMP", "PORT-DUMP", "CONTINUE", "ABORT",/* dumper cmds */
     "FAILED", "TRY-AGAIN", "NO-ROOM", "RQ-MORE-DISK",  /* dumper results */
     "ABORT-FINISHED", "BAD-COMMAND",                   /* dumper results */
-    "START-TAPER", "FILE-WRITE", "PORT-WRITE",         /* taper cmds */
-    "PORT", "TAPE-ERROR", "TAPER-OK", "SPLIT-NEEDNEXT", /* taper results */
-    "SPLIT-CONTINUE",
+    "START-TAPER", "FILE-WRITE", "NEW-TAPE", "NO-NEW-TAPE",
+     
+    "PARTDONE", "PORT-WRITE", "DUMPER-STATUS",             /* taper cmds */
+    "PORT", "TAPE-ERROR", "TAPER-OK",                   /* taper results */
+    "REQUEST-NEW-TAPE",
+    "LAST_TOK",
     NULL
 };
 
@@ -59,9 +62,9 @@ getcmd(
     assert(cmdargs != NULL);
 
     if (isatty(0)) {
-       printf("%s> ", get_pname());
+       g_printf("%s> ", get_pname());
        fflush(stdout);
-        line = readline(NULL);
+        line = agets(stdin);
     } else {
         line = agets(stdin);
     }
@@ -71,14 +74,15 @@ getcmd(
 
     cmdargs->argc = split(line, cmdargs->argv,
        (int)(sizeof(cmdargs->argv) / sizeof(cmdargs->argv[0])), " ");
+    dbprintf(_("getcmd: %s\n"), line);
     amfree(line);
 
 #if DEBUG
     {
        int i;
-       fprintf(stderr,"argc = %d\n", cmdargs->argc);
+       g_fprintf(stderr,_("argc = %d\n"), cmdargs->argc);
        for (i = 0; i < cmdargs->argc+1; i++)
-           fprintf(stderr,"argv[%d] = \"%s\"\n", i, cmdargs->argv[i]);
+           g_fprintf(stderr,_("argv[%d] = \"%s\"\n"), i, cmdargs->argv[i]);
     }
 #endif
 
@@ -97,8 +101,9 @@ printf_arglist_function1(void putresult, cmd_t, result, const char *, format)
     va_list argp;
 
     arglist_start(argp, format);
-    printf("%s ",cmdstr[result]);
-    vprintf(format, argp);
+    dbprintf(_("putresult: %d %s\n"), result, cmdstr[result]);
+    g_printf("%s ", cmdstr[result]);
+    g_vprintf(format, argp);
     fflush(stdout);
     arglist_end(argp);
 }
@@ -172,15 +177,19 @@ int check_infofile(
                }
                if (other_dle_match == 0) {
                    if(mkpdir(infofile, (mode_t)02755, (uid_t)-1,
-                             (gid_t)-1) == -1) 
+                             (gid_t)-1) == -1)  {
                        *errmsg = vstralloc("Can't create directory for ",
                                            infofile, NULL);
                        return -1;
+                   }
                    if(copy_file(infofile, old_infofile, errmsg) == -1) 
                        return -1;
                }
            }
        }
+       amfree(diskdir);
+       amfree(hostinfodir);
+       amfree(infofile);
     }
     return 0;
 }
index 92beadea4a0389196718bde61268cfa47fd1e74b..a758ad1b477745965e37821c8bc68a90f01b0da5 100644 (file)
@@ -45,9 +45,10 @@ enum {
     START, FILE_DUMP, PORT_DUMP, CONTINUE, ABORT,      /* dumper cmds */
     FAILED, TRYAGAIN, NO_ROOM, RQ_MORE_DISK,           /* dumper results */
     ABORT_FINISHED, BAD_COMMAND,                       /* dumper results */
-    START_TAPER, FILE_WRITE, PORT_WRITE,               /* taper cmds */
-    PORT, TAPE_ERROR, TAPER_OK,        SPLIT_NEEDNEXT,         /* taper results */
-    SPLIT_CONTINUE,
+    START_TAPER, FILE_WRITE, NEW_TAPE, NO_NEW_TAPE,     /* taper... */
+    PARTDONE, PORT_WRITE, DUMPER_STATUS,                /* ... cmds */
+    PORT, TAPE_ERROR, TAPER_OK,                                /* taper results */
+    REQUEST_NEW_TAPE,
     LAST_TOK
 };
 extern const char *cmdstr[];
@@ -59,8 +60,7 @@ struct cmdargs {
 
 cmd_t getcmd(struct cmdargs *cmdargs);
 cmd_t getresult(int fd, int show, int *result_argc, char **result_argv, int max_arg);
-void putresult(cmd_t result, const char *, ...)
-     __attribute__ ((format (printf, 2, 3)));
+void putresult(cmd_t result, const char *, ...) G_GNUC_PRINTF(2, 3);
 int taper_cmd(cmd_t cmd, void *ptr, char *destname, int level, char *datestamp);
 
 struct disk_s;
index 157d65381bae3c67c7d198a0cc6177f80636ef8e..ce120d06647ed2e0ae3016d93aea93a23b0d0b89 100644 (file)
@@ -92,14 +92,14 @@ write_tapelist(
     }
 
     for(tp = tape_list; tp != NULL; tp = tp->next) {
-       fprintf(tapef, "%s %s", tp->datestamp, tp->label);
-       if(tp->reuse) fprintf(tapef, " reuse");
-       else fprintf(tapef, " no-reuse");
-       fprintf(tapef, "\n");
+       g_fprintf(tapef, "%s %s", tp->datestamp, tp->label);
+       if(tp->reuse) g_fprintf(tapef, " reuse");
+       else g_fprintf(tapef, " no-reuse");
+       g_fprintf(tapef, "\n");
     }
 
     if (fclose(tapef) == EOF) {
-       fprintf(stderr,"error [closing %s: %s]", newtapefile, strerror(errno));
+       g_fprintf(stderr,_("error [closing %s: %s]"), newtapefile, strerror(errno));
        amfree(newtapefile);
        return 1;
     }
diff --git a/server-src/taper-disk-port-source.c b/server-src/taper-disk-port-source.c
new file mode 100644 (file)
index 0000000..58f13d3
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define selfp (self->_priv)
+
+#include "taper-disk-port-source.h"
+#include "taper-mem-port-source.h"
+
+struct _TaperDiskPortSourcePrivate {
+    gboolean retry_mode;
+    int buffer_fd;
+    TaperSource * fallback;
+    gboolean disk_problem;
+    guint64 disk_buffered_bytes;
+    
+    /* This is for extra data we picked up by accident. */
+    char * excess_buffer;
+    size_t excess_buffer_size;
+
+    guint64 retry_data_written;
+};
+
+/* here are local prototypes */
+static void taper_disk_port_source_init (TaperDiskPortSource * o);
+static void taper_disk_port_source_class_init (TaperDiskPortSourceClass * c);
+static ssize_t taper_disk_port_source_read (TaperSource * pself, void * buf,
+                                            size_t count);
+static gboolean taper_disk_port_source_seek_to_part_start
+    (TaperSource * pself);
+static void taper_disk_port_source_start_new_part (TaperSource * pself);
+static gboolean taper_disk_port_source_get_end_of_data(TaperSource * pself);
+static gboolean taper_disk_port_source_get_end_of_part(TaperSource * pself);
+static int taper_disk_port_source_predict_parts(TaperSource * pself);
+
+/* pointer to the class of our parent */
+static TaperSourceClass * source_parent_class = NULL;
+static TaperPortSourceClass *parent_class = NULL;
+
+GType taper_disk_port_source_get_type (void) {
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TaperDiskPortSourceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) taper_disk_port_source_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TaperDiskPortSource),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) taper_disk_port_source_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TAPER_TYPE_PORT_SOURCE,
+                                       "TaperDiskPortSource", &info,
+                                       (GTypeFlags)0);
+    }
+    
+    return type;
+}
+
+static void taper_disk_port_source_dispose(GObject * obj_self) {
+    TaperDiskPortSource *self = TAPER_DISK_PORT_SOURCE (obj_self);
+    if (G_OBJECT_CLASS (parent_class)->dispose)
+        (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
+    
+    if(self->_priv->fallback) {
+        g_object_unref (self->_priv->fallback);
+    }
+}
+
+static void
+taper_disk_port_source_finalize(GObject *obj_self)
+{
+    TaperDiskPortSource *self = TAPER_DISK_PORT_SOURCE (obj_self);
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+
+    amfree(self->buffer_dir_name);
+    amfree(self->_priv->excess_buffer);
+    amfree(self->_priv);
+}
+
+static void 
+taper_disk_port_source_init (TaperDiskPortSource * o G_GNUC_UNUSED)
+{
+        o->_priv = malloc(sizeof(TaperDiskPortSourcePrivate));
+       o->_priv->retry_mode = FALSE;
+        o->_priv->buffer_fd = -1;
+       o->_priv->fallback = NULL;
+        o->_priv->disk_problem = FALSE;
+        o->_priv->disk_buffered_bytes = 0;
+        o->_priv->excess_buffer = NULL;
+        o->_priv->excess_buffer_size = 0;
+}
+
+static void 
+taper_disk_port_source_class_init (TaperDiskPortSourceClass * c G_GNUC_UNUSED)
+{
+    GObjectClass *g_object_class = (GObjectClass*) c;
+    TaperSourceClass *taper_source_class = (TaperSourceClass *)c;
+    
+    parent_class = g_type_class_ref (TAPER_TYPE_PORT_SOURCE);
+    source_parent_class = (TaperSourceClass*)parent_class;
+    
+    taper_source_class->read = taper_disk_port_source_read;
+    taper_source_class->seek_to_part_start =
+        taper_disk_port_source_seek_to_part_start;
+    taper_source_class->start_new_part = taper_disk_port_source_start_new_part;
+    taper_source_class->get_end_of_data =
+        taper_disk_port_source_get_end_of_data;
+    taper_source_class->get_end_of_part =
+        taper_disk_port_source_get_end_of_part;
+    taper_source_class->predict_parts = taper_disk_port_source_predict_parts;
+
+    g_object_class->dispose = taper_disk_port_source_dispose;
+    g_object_class->finalize = taper_disk_port_source_finalize;
+}
+
+
+static gboolean taper_disk_port_source_get_end_of_data(TaperSource * pself) {
+    TaperDiskPortSource * self = TAPER_DISK_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, TRUE);
+
+    if (self->_priv->fallback != NULL) {
+        return taper_source_get_end_of_data(self->_priv->fallback);
+    } else {
+        return (source_parent_class->get_end_of_data)(pself);
+    }
+}
+static gboolean taper_disk_port_source_get_end_of_part(TaperSource * pself) {
+    TaperDiskPortSource * self = TAPER_DISK_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, TRUE);
+
+    if (self->_priv->fallback != NULL) {
+        return taper_source_get_end_of_part(self->_priv->fallback);
+    } else {
+        return (source_parent_class->get_end_of_part)(pself);
+    }
+}
+  
+static int taper_disk_port_source_predict_parts(TaperSource * pself) {
+    TaperDiskPortSource * self = TAPER_DISK_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, -1);
+
+    return -1;
+}
+
+static TaperSource * make_fallback_source(TaperDiskPortSource * self) {
+    TaperSource * rval;
+    TaperPortSource * port_rval;
+    rval = (TaperSource*)
+        g_object_new(TAPER_TYPE_MEM_PORT_SOURCE, NULL);
+    port_rval = (TaperPortSource*)rval;
+    
+    if (rval == NULL)
+        return NULL;
+
+    port_rval->socket_fd = ((TaperPortSource*)self)->socket_fd;
+    rval->max_part_size = self->fallback_buffer_size;
+
+    return rval;
+}
+
+/* Open the buffer file. We create the file and then immediately
+   unlink it, to improve security and ease cleanup. */
+static gboolean open_buffer_file(TaperDiskPortSource * self) {
+    int fd;
+    char * filename;
+    mode_t old_umask;
+
+    g_return_val_if_fail(self != NULL, FALSE);
+    g_return_val_if_fail(self->buffer_dir_name != NULL, FALSE);
+
+    filename = g_strdup_printf("%s/amanda-split-buffer-XXXXXX",
+                               self->buffer_dir_name);
+    /* This is not thread-safe. :-( */
+    old_umask = umask(0);
+    fd = g_mkstemp(filename);
+    umask(old_umask);
+    if (fd < 0) {
+        g_fprintf(stderr, "Couldn't open temporary file with template %s: %s\n",
+                filename, strerror(errno));
+        return FALSE;
+    }
+
+    /* If it fails, that's annoying, but no great loss. */
+    if (unlink(filename) != 0) {
+        g_fprintf(stderr, "Unlinking %s failed: %s\n", filename,
+                strerror(errno));
+    }
+
+    free(filename);
+    selfp->buffer_fd = fd;
+    return TRUE;
+}
+
+/* An error has occured with the disk buffer; store the extra data in
+   memory until we can recover. */
+static void store_excess(TaperDiskPortSource * self, char * buf,
+                         size_t attempted_size, size_t disk_size) {
+    TaperSource * pself = (TaperSource*)self;
+    g_return_if_fail(attempted_size > 0);
+    g_return_if_fail(disk_size < attempted_size);
+    g_return_if_fail(buf != NULL);
+    g_return_if_fail(selfp->excess_buffer == NULL);
+
+    selfp->excess_buffer_size = attempted_size - disk_size;
+    selfp->excess_buffer = malloc(selfp->excess_buffer_size);
+    memcpy(selfp->excess_buffer, buf + disk_size, attempted_size - disk_size);
+
+    selfp->disk_buffered_bytes += disk_size;
+    pself->max_part_size = MIN(pself->max_part_size,
+                               selfp->disk_buffered_bytes);
+}
+
+/* Handle the output of the small amount of saved in-memory data. */
+static size_t handle_excess_buffer_read(TaperDiskPortSource * self,
+                                        void * buf, size_t count) {
+    TaperSource * pself = (TaperSource*)self;
+    guint64 offset;
+
+    /* First, do we have anything left? */
+    if (selfp->retry_data_written >=
+        (selfp->disk_buffered_bytes + selfp->excess_buffer_size)) {
+        pself->end_of_part = TRUE;
+        return 0;
+    }
+    
+    count = MIN(count,
+                (selfp->disk_buffered_bytes + selfp->excess_buffer_size)
+                - selfp->retry_data_written);
+
+    offset = selfp->disk_buffered_bytes + selfp->excess_buffer_size
+        - selfp->retry_data_written;
+    g_assert(offset + count <= selfp->excess_buffer_size);
+    memcpy(buf, selfp->excess_buffer + offset, count);
+
+    selfp->retry_data_written += count;
+
+    return count;
+}
+    
+/* Write data out to the disk buffer, and handle any problems that
+   crop up along the way. */
+static ssize_t write_disk_buffer(TaperDiskPortSource * self, char * buf,
+                                 size_t read_size) {
+    size_t bytes_written = 0;
+    while (bytes_written < read_size) {
+        int write_result = write(selfp->buffer_fd, buf + bytes_written,
+                                 read_size - bytes_written);
+        if (write_result > 0) {
+            bytes_written += write_result;
+            continue;
+        } else if (write_result == 0) {
+            g_fprintf(stderr, "Writing disk buffer: Wrote 0 bytes.\n");
+            continue;
+        } else {
+            if (0
+#ifdef EAGAIN
+                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                || errno == EINTR
+#endif
+                ) {
+                /* Try again. */
+                continue;
+            } else if (0
+#ifdef EFBIG
+                       || errno == EFBIG
+#endif
+#ifdef ENOSPC
+                       || errno == ENOSPC
+#endif
+                       ) {
+                /* Out of space */
+                store_excess(self, buf, read_size, bytes_written);
+                return read_size;
+            } else {
+                /* I/O error. */
+                store_excess(self, buf, read_size, bytes_written);
+                selfp->disk_problem = TRUE;
+                TAPER_SOURCE(self)->end_of_part = TRUE;
+                return read_size;
+            }
+        }
+        g_assert_not_reached();
+    }
+
+    selfp->disk_buffered_bytes += bytes_written;
+    return read_size;
+}
+
+static ssize_t 
+taper_disk_port_source_read (TaperSource * pself, void * buf, size_t count) {
+    TaperDiskPortSource * self = (TaperDiskPortSource*)pself;
+
+    g_return_val_if_fail (self != NULL, -1);
+    g_return_val_if_fail (TAPER_IS_DISK_PORT_SOURCE (self), -1);
+    g_return_val_if_fail (buf != NULL, -1);
+    g_return_val_if_fail (count > 0, -1);
+    g_assert(selfp->disk_buffered_bytes <= pself->max_part_size);
+       
+    if (selfp->fallback != NULL) {
+        return taper_source_read(selfp->fallback, buf, count);
+    } else if (selfp->buffer_fd < 0) {
+        if (!open_buffer_file(self)) {
+            /* Buffer file failed; go immediately to failover mode. */
+            selfp->fallback = make_fallback_source(self);
+            if (selfp->fallback != NULL) {
+                return taper_source_read(selfp->fallback, buf, count);
+            } else {
+                /* Even the fallback source failed! */
+                return -1;
+            }
+        }
+    }
+
+    if (selfp->retry_mode) {
+        /* Read from disk buffer. */
+
+        if (selfp->retry_data_written < selfp->disk_buffered_bytes) {
+            /* Read from disk. */
+            int result;
+            count = MIN(count, selfp->disk_buffered_bytes -
+                               selfp->retry_data_written);
+            result = read(selfp->buffer_fd, buf, count);
+            if (result <= 0) {
+                /* This should not happen. */
+                return -1;
+            } else {
+                selfp->retry_data_written += result;
+                return result;
+            }
+        } else if (selfp->excess_buffer != NULL) {
+            /* We are writing out the last bit of buffer. Handle that. */
+            return handle_excess_buffer_read(self, buf, count);
+        } else {
+            /* No more data. */
+            pself->end_of_part = TRUE;
+            return 0;
+        }
+        
+        g_assert_not_reached();
+    } else {
+        /* Read from port. */
+        int read_result;
+        count = MIN(count, pself->max_part_size - selfp->disk_buffered_bytes);
+        if (count == 0) /* It was nonzero before. */ {
+            pself->end_of_part = TRUE;
+            return 0;
+        }
+        
+        read_result = source_parent_class->read(pself, buf, count);
+        /* Parent handles EOF and other goodness. */
+        if (read_result <= 0) {
+            return read_result;
+        }
+        /* Now write to disk buffer. */
+        return write_disk_buffer(self, buf, read_result);
+    }
+}
+
+/* Try seeking back to byte 0. If that fails, then we mark ourselves
+   as having a disk problem. Returns FALSE in that case. */
+static gboolean try_rewind(TaperDiskPortSource * self) {
+    gint64 result;
+    result = lseek(selfp->buffer_fd, 0, SEEK_SET);
+    if (result != 0) {
+        g_fprintf(stderr, "Couldn't seek split buffer: %s\n", strerror(errno));
+        selfp->disk_problem = TRUE;
+        return FALSE;
+    } else {
+        return TRUE;
+    }
+}
+
+static gboolean 
+taper_disk_port_source_seek_to_part_start (TaperSource * pself) {
+    TaperDiskPortSource * self = (TaperDiskPortSource*)pself;
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (TAPER_IS_DISK_PORT_SOURCE (pself), FALSE);
+    g_return_val_if_fail (selfp->disk_buffered_bytes
+                          + selfp->excess_buffer_size > 0, FALSE);
+    
+    if (self->_priv->fallback != NULL) {
+        return taper_source_seek_to_part_start(selfp->fallback);
+    }
+
+    if (selfp->disk_problem && selfp->disk_buffered_bytes) {
+        /* The disk buffer is screwed; nothing to do. */
+        return FALSE;
+    }
+
+    if (!selfp->disk_problem) {
+        if (!try_rewind(self)) {
+            return FALSE;
+        }
+    }
+
+    selfp->retry_mode = TRUE;
+    selfp->retry_data_written = 0;
+
+    if (source_parent_class->seek_to_part_start) {
+        return source_parent_class->seek_to_part_start(pself);
+    } else {
+        return TRUE;
+    }
+}
+
+static void 
+taper_disk_port_source_start_new_part (TaperSource * pself) {
+    TaperDiskPortSource * self = (TaperDiskPortSource*)pself;
+    g_return_if_fail (self != NULL);
+    g_return_if_fail (TAPER_IS_DISK_PORT_SOURCE (pself));
+       
+    if (self->_priv->fallback != NULL) {
+        taper_source_start_new_part(self->_priv->fallback);
+        return;
+    }
+
+    selfp->retry_mode = FALSE;
+    if (!selfp->disk_problem) {
+        try_rewind(self); /* If this fails it will set disk_problem to
+                             TRUE. */
+    }
+
+    if (selfp->disk_problem && selfp->fallback == NULL) {
+        selfp->fallback = make_fallback_source(self);
+    }
+    selfp->disk_buffered_bytes = 0;
+    amfree(selfp->excess_buffer);
+    selfp->excess_buffer_size = selfp->retry_data_written = 0;
+
+    if (source_parent_class->start_new_part) {
+        source_parent_class->start_new_part(pself);
+    }
+}
diff --git a/server-src/taper-disk-port-source.h b/server-src/taper-disk-port-source.h
new file mode 100644 (file)
index 0000000..ba83385
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* The taper disk port source is a taper source (see taper-source.h)
+   used for the case where we are reading directly from a client
+   (PORT-WRITE) and are using a disk buffer to hold split dump parts. */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "taper-port-source.h"
+
+#ifndef __TAPER_DISK_PORT_SOURCE_H__
+#define __TAPER_DISK_PORT_SOURCE_H__
+
+
+/*
+ * Type checking and casting macros
+ */
+#define TAPER_TYPE_DISK_PORT_SOURCE    (taper_disk_port_source_get_type())
+#define TAPER_DISK_PORT_SOURCE(obj)    G_TYPE_CHECK_INSTANCE_CAST((obj), taper_disk_port_source_get_type(), TaperDiskPortSource)
+#define TAPER_DISK_PORT_SOURCE_CONST(obj)      G_TYPE_CHECK_INSTANCE_CAST((obj), taper_disk_port_source_get_type(), TaperDiskPortSource const)
+#define TAPER_DISK_PORT_SOURCE_CLASS(klass)    G_TYPE_CHECK_CLASS_CAST((klass), taper_disk_port_source_get_type(), TaperDiskPortSourceClass)
+#define TAPER_IS_DISK_PORT_SOURCE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), taper_disk_port_source_get_type ())
+
+#define TAPER_DISK_PORT_SOURCE_GET_CLASS(obj)  G_TYPE_INSTANCE_GET_CLASS((obj), taper_disk_port_source_get_type(), TaperDiskPortSourceClass)
+
+/* Private structure type */
+typedef struct _TaperDiskPortSourcePrivate TaperDiskPortSourcePrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_TAPER_DISK_PORT_SOURCE__
+#define __TYPEDEF_TAPER_DISK_PORT_SOURCE__
+typedef struct _TaperDiskPortSource TaperDiskPortSource;
+#endif
+struct _TaperDiskPortSource {
+    TaperPortSource __parent__;
+    /*< private >*/
+    guint64 fallback_buffer_size;
+    char * buffer_dir_name;
+    TaperDiskPortSourcePrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _TaperDiskPortSourceClass TaperDiskPortSourceClass;
+struct _TaperDiskPortSourceClass {
+       TaperPortSourceClass __parent__;
+};
+
+/*
+ * Public methods
+ */
+GType  taper_disk_port_source_get_type (void);
+
+#endif
diff --git a/server-src/taper-file-source.c b/server-src/taper-file-source.c
new file mode 100644 (file)
index 0000000..65a75a9
--- /dev/null
@@ -0,0 +1,452 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define selfp (self->_priv)
+
+#include "taper-file-source.h"
+
+#include "fileheader.h"
+#include "holding.h"
+
+#define HOLDING_DISK_OPEN_FLAGS (O_NOCTTY | O_RDONLY)
+
+struct _TaperFileSourcePrivate {
+    /* How many bytes have we written from the current part? */
+    guint64 current_part_pos;
+    /* Information about the files at the start of this part. */
+    dumpfile_t part_start_chunk_header;
+    int part_start_chunk_fd;
+    /* Where is the start of this part with respect to the first chunk
+       of the part? */
+    guint64 part_start_chunk_offset;
+    /* These may be the same as their part_start_chunk_ counterparts. */
+    dumpfile_t current_chunk_header;
+    int current_chunk_fd;
+    /* Current position of current_chunk_fd. */
+    guint64 current_chunk_position;
+    /* Expected number of split parts. */
+    int predicted_splits;
+};
+/* here are local prototypes */
+static void taper_file_source_init (TaperFileSource * o);
+static void taper_file_source_class_init (TaperFileSourceClass * c);
+static ssize_t taper_file_source_read (TaperSource * pself, void * buf,
+                                            size_t count);
+static gboolean taper_file_source_seek_to_part_start (TaperSource * pself);
+static void taper_file_source_start_new_part (TaperSource * pself);
+static int taper_file_source_predict_parts(TaperSource * pself);
+static dumpfile_t * taper_file_source_get_first_header(TaperSource * pself);
+static gboolean first_time_setup(TaperFileSource * self);
+
+/* pointer to the class of our parent */
+static TaperSourceClass *parent_class = NULL;
+
+GType taper_file_source_get_type (void) {
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TaperFileSourceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) taper_file_source_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TaperFileSource),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) taper_file_source_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TAPER_TYPE_SOURCE, "TaperFileSource",
+                                       &info, (GTypeFlags)0);
+    }
+    
+    return type;
+}
+
+static void
+taper_file_source_finalize(GObject *obj_self)
+{
+    TaperFileSource *self = TAPER_FILE_SOURCE (obj_self);
+    gpointer priv G_GNUC_UNUSED = self->_priv;
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+    if(self->_priv->part_start_chunk_fd >= 0) {
+        close (self->_priv->part_start_chunk_fd);
+    }
+    if(self->_priv->current_chunk_fd >= 0) {
+        close (self->_priv->current_chunk_fd);
+    }
+}
+
+static void 
+taper_file_source_init (TaperFileSource * o G_GNUC_UNUSED)
+{
+    o->_priv = malloc(sizeof(TaperFileSourcePrivate));
+    o->_priv->part_start_chunk_fd = -1;
+    o->_priv->current_chunk_fd = -1;
+    o->_priv->predicted_splits = -1;
+    o->holding_disk_file = NULL;
+}
+
+static void  taper_file_source_class_init (TaperFileSourceClass * c) {
+    GObjectClass *g_object_class = (GObjectClass*) c;
+    TaperSourceClass *taper_source_class = (TaperSourceClass *)c;
+
+    parent_class = g_type_class_ref (TAPER_TYPE_SOURCE);
+
+    taper_source_class->read = taper_file_source_read;
+    taper_source_class->seek_to_part_start =
+        taper_file_source_seek_to_part_start;
+    taper_source_class->start_new_part = taper_file_source_start_new_part;
+    taper_source_class->get_first_header = taper_file_source_get_first_header;
+    taper_source_class->predict_parts = taper_file_source_predict_parts;
+
+    g_object_class->finalize = taper_file_source_finalize;
+}
+
+static void compute_splits(TaperFileSource * self) {
+    guint64 total_kb;
+    int predicted_splits;
+    TaperSource * pself = (TaperSource*)self;
+
+    if (selfp->predicted_splits > 0) {
+        return;
+    }
+
+    if (pself->max_part_size <= 0) {
+        selfp->predicted_splits = 1;
+        return;
+    }
+
+    total_kb = holding_file_size(self->holding_disk_file, TRUE);
+    if (total_kb <= 0) {
+        g_fprintf(stderr, "taper: %lld KB holding file makes no sense, not precalculating splits\n",
+               (long long)total_kb);
+        fflush(stderr);
+        selfp->predicted_splits = -1;
+        return;
+    }
+    
+    g_fprintf(stderr, "taper: Total dump size should be %jukb, part size is %jukb\n",
+            (uintmax_t)total_kb, (uintmax_t)pself->max_part_size);
+
+    predicted_splits = (total_kb * 1024) / pself->max_part_size;
+    if (predicted_splits == 0 ||
+        (0 != ((total_kb * 1024) % pself->max_part_size))) {
+        predicted_splits ++;
+    }
+    selfp->predicted_splits = predicted_splits;
+}
+
+static int taper_file_source_predict_parts(TaperSource * pself) {
+    TaperFileSource * self = TAPER_FILE_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, -1);
+
+    compute_splits(self);
+
+    return selfp->predicted_splits;
+}
+
+static dumpfile_t * taper_file_source_get_first_header(TaperSource * pself) {
+    TaperFileSource * self = TAPER_FILE_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, NULL);
+
+    first_time_setup(self);
+
+    if (parent_class->get_first_header) {
+        return (parent_class->get_first_header)(pself);
+    } else {
+        return NULL;
+    }
+}
+
+/* Open a holding disk and parse the header. Returns TRUE if
+   everything went OK. Writes the fd into fd_pointer and the header
+   into header_pointer. Both must be non-NULL. */
+static gboolean open_holding_file(char * filename, int * fd_pointer,
+                                  dumpfile_t * header_pointer) {
+    int fd;
+    int read_result;
+    char * header_buffer;
+
+    g_return_val_if_fail(filename != NULL, FALSE);
+    g_return_val_if_fail(fd_pointer != NULL, FALSE);
+    g_return_val_if_fail(header_pointer != NULL, FALSE);
+
+    fd = robust_open(filename, O_NOCTTY | O_RDONLY, 0);
+    if (fd < 0) {
+        g_fprintf(stderr, "Could not open holding disk file %s: %s\n",
+                filename, strerror(errno));
+        return FALSE;
+    }
+
+    header_buffer = malloc(DISK_BLOCK_BYTES);
+    read_result = fullread(fd, header_buffer, DISK_BLOCK_BYTES);
+    if (read_result < DISK_BLOCK_BYTES) {
+        g_fprintf(stderr,
+                "Could not read header from holding disk file %s: %s\n",
+                filename, strerror(errno));
+        aclose(fd);
+        return FALSE;
+    }
+    
+    parse_file_header(header_buffer, header_pointer, DISK_BLOCK_BYTES);
+    amfree(header_buffer);
+    
+    if (!(header_pointer->type == F_DUMPFILE ||
+          header_pointer->type == F_CONT_DUMPFILE)) {
+        g_fprintf(stderr, "Got strange header from file %s.\n",
+                filename);
+        aclose(fd);
+        return FALSE;
+    }
+    
+    *fd_pointer = fd;
+    return TRUE;
+}
+
+/* Copy fd and header information from first chunk fields to current
+   chunk. Returns FALSE if an error occurs (unlikely). */
+static gboolean copy_chunk_data(int * from_fd, int* to_fd,
+                                dumpfile_t * from_header,
+                                dumpfile_t * to_header) {
+    g_return_val_if_fail(from_fd != NULL, FALSE);
+    g_return_val_if_fail(to_fd != NULL, FALSE);
+    g_return_val_if_fail(from_header != NULL, FALSE);
+    g_return_val_if_fail(to_header != NULL, FALSE);
+    g_return_val_if_fail(*to_fd < 0, FALSE);
+    
+    *to_fd = dup(*from_fd);
+    if (*to_fd < 0) {
+        g_fprintf(stderr, "dup(%d) failed!\n", *from_fd);
+        return FALSE;
+    }
+
+    memcpy(to_header, from_header, sizeof(*to_header));
+
+    return TRUE;
+}
+
+
+static gboolean first_time_setup(TaperFileSource * self) {
+    TaperSource * pself = (TaperSource*)self;
+
+    if (selfp->part_start_chunk_fd >= 0) {
+        return TRUE;
+    }
+
+    g_return_val_if_fail(self->holding_disk_file != NULL, FALSE);
+
+    if (!open_holding_file(self->holding_disk_file, 
+                           &(selfp->part_start_chunk_fd),
+                           &(selfp->part_start_chunk_header))) {
+        return FALSE;
+    }
+
+    /* We are all set; just copy the "start chunk" datums into the
+       "current chunk" fields. */
+    if (!copy_chunk_data(&(selfp->part_start_chunk_fd),
+                         &(selfp->current_chunk_fd),
+                         &(selfp->part_start_chunk_header),
+                         &(selfp->current_chunk_header))) {
+        aclose(selfp->part_start_chunk_fd);
+        return FALSE;
+    }
+
+    pself->first_header = g_memdup(&(selfp->part_start_chunk_header),
+                                   sizeof(dumpfile_t));
+
+    /* Should not be necessary. You never know! */
+    selfp->current_part_pos = selfp->part_start_chunk_offset =
+        selfp->current_chunk_position = 0;
+
+    return TRUE;
+}
+
+static int retry_read(int fd, void * buf, size_t count) {
+    for (;;) {
+        int read_result = read(fd, buf, count);
+        if (read_result < 0 && (0
+#ifdef EAGAIN
+                                || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                                || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                                || errno == EINTR
+#endif
+                  )) {
+            /* Try again. */
+            continue;
+        } else {
+            if (read_result < 0) {
+                g_fprintf(stderr, "Error reading holding disk: %s\n",
+                        strerror(errno));
+            }
+            return read_result;
+        }
+    }
+}
+
+/* If another chunk is available, load it. Returns TRUE if there are
+   no more chunks or the next chunk is loaded, or FALSE if an error
+   occurs. */
+static gboolean get_next_chunk(TaperFileSource * self) {
+    char * cont_filename = NULL;
+
+    if (selfp->current_chunk_header.cont_filename[0] != '\0') {
+        cont_filename =
+            g_strdup(selfp->current_chunk_header.cont_filename);
+    } else {
+        /* No more data. */
+        aclose(selfp->current_chunk_fd);
+        bzero(&(selfp->current_chunk_header),
+              sizeof(selfp->current_chunk_header));
+        return TRUE;
+    }
+
+    /* More data. */
+
+    aclose(selfp->current_chunk_fd);
+
+    if (!open_holding_file(cont_filename,
+                           &(selfp->current_chunk_fd),
+                           &(selfp->current_chunk_header))) {
+        amfree(cont_filename);
+        bzero(&(selfp->current_chunk_header),
+              sizeof(selfp->current_chunk_header));
+        aclose(selfp->current_chunk_fd);
+        return FALSE;
+    }
+
+    amfree(cont_filename);
+    selfp->current_chunk_position = 0;
+
+    return TRUE;
+}
+
+static ssize_t 
+taper_file_source_read (TaperSource * pself, void * buf, size_t count) {
+    TaperFileSource * self = (TaperFileSource*) pself;
+    int read_result;
+
+    g_return_val_if_fail (self != NULL, -1);
+    g_return_val_if_fail (TAPER_IS_FILE_SOURCE (self), -1);
+    g_return_val_if_fail (buf != NULL, -1);
+    g_return_val_if_fail (count > 0, -1);
+    
+    if (!first_time_setup(self))
+        return -1;
+
+    if (pself->max_part_size > 0) {
+        count = MIN(count, pself->max_part_size - selfp->current_part_pos);
+    }
+    if (count <= 0) {
+        /* Was positive before. Thus we are at EOP. */
+        pself->end_of_part = TRUE;
+        return 0;
+    }
+
+    /* We don't use fullread, because we would rather return a partial
+     * read ASAP. */
+    read_result = retry_read(selfp->current_chunk_fd, buf, count);
+    if (read_result < 0) {
+        /* Nothing we can do. */
+        return read_result;
+    } else if (read_result == 0) {
+        if (!get_next_chunk(self)) {
+            return -1; 
+        }
+
+        if (selfp->current_chunk_fd >= 0) {
+            /* Try again with the next chunk. */
+            return taper_file_source_read(pself, buf, count);
+        } else {
+            pself->end_of_data = TRUE;
+            return 0;
+        }
+    } else {
+        /* Success. */
+        selfp->current_part_pos += read_result;
+        selfp->current_chunk_position += read_result;
+        return read_result;
+    }
+}
+
+static gboolean taper_file_source_seek_to_part_start (TaperSource * pself) {
+    TaperFileSource * self = (TaperFileSource*)pself;
+    off_t lseek_result;
+
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (TAPER_IS_FILE_SOURCE (self), FALSE);
+
+    aclose(selfp->current_chunk_fd);
+    if (!copy_chunk_data(&(selfp->part_start_chunk_fd),
+                         &(selfp->current_chunk_fd),
+                         &(selfp->part_start_chunk_header),
+                         &(selfp->current_chunk_header))) {
+        return FALSE;
+    }
+
+    selfp->current_chunk_position = selfp->part_start_chunk_offset;
+
+    lseek_result = lseek(selfp->current_chunk_fd,
+                         DISK_BLOCK_BYTES + selfp->current_chunk_position,
+                         SEEK_SET);
+    if (lseek_result < 0) {
+        g_fprintf(stderr, "Could not seek holding disk file: %s\n",
+                strerror(errno));
+        return FALSE;
+    }
+
+    selfp->current_part_pos = 0;
+
+    if (parent_class->seek_to_part_start)
+        return parent_class->seek_to_part_start(pself);
+    else
+        return TRUE;
+}
+
+static void taper_file_source_start_new_part (TaperSource * pself) {
+    TaperFileSource * self = (TaperFileSource*)pself;
+    g_return_if_fail (self != NULL);
+    g_return_if_fail (TAPER_IS_FILE_SOURCE (self));
+
+    aclose(selfp->part_start_chunk_fd);
+    if (!copy_chunk_data(&(selfp->current_chunk_fd),
+                         &(selfp->part_start_chunk_fd),
+                         &(selfp->current_chunk_header),
+                         &(selfp->part_start_chunk_header))) {
+        /* We can't return FALSE. :-( Instead, we set things up so
+           they will fail on the next read(). */
+        aclose(selfp->current_chunk_fd);
+        aclose(selfp->part_start_chunk_fd);
+        return;
+    }
+
+    selfp->part_start_chunk_offset = selfp->current_chunk_position;
+    selfp->current_part_pos = 0;
+
+    if (parent_class->start_new_part)
+        parent_class->start_new_part(pself);
+}
+    
diff --git a/server-src/taper-file-source.h b/server-src/taper-file-source.h
new file mode 100644 (file)
index 0000000..8d2830b
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* The taper file source is a taper source (see taper-source.h)
+   used for the case where we are reading from the holding disk
+   (FILE-WRITE mode). */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "taper-source.h" 
+
+#ifndef __TAPER_FILE_SOURCE_H__
+#define __TAPER_FILE_SOURCE_H__
+
+/*
+ * Type checking and casting macros
+ */
+#define TAPER_TYPE_FILE_SOURCE (taper_file_source_get_type())
+#define TAPER_FILE_SOURCE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), taper_file_source_get_type(), TaperFileSource)
+#define TAPER_FILE_SOURCE_CONST(obj)   G_TYPE_CHECK_INSTANCE_CAST((obj), taper_file_source_get_type(), TaperFileSource const)
+#define TAPER_FILE_SOURCE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), taper_file_source_get_type(), TaperFileSourceClass)
+#define TAPER_IS_FILE_SOURCE(obj)      G_TYPE_CHECK_INSTANCE_TYPE((obj), taper_file_source_get_type ())
+
+#define TAPER_FILE_SOURCE_GET_CLASS(obj)       G_TYPE_INSTANCE_GET_CLASS((obj), taper_file_source_get_type(), TaperFileSourceClass)
+
+/* Private structure type */
+typedef struct _TaperFileSourcePrivate TaperFileSourcePrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_TAPER_FILE_SOURCE__
+#define __TYPEDEF_TAPER_FILE_SOURCE__
+typedef struct _TaperFileSource TaperFileSource;
+#endif
+struct _TaperFileSource {
+    TaperSource __parent__;
+    /*< private >*/
+    char * holding_disk_file;
+    TaperFileSourcePrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _TaperFileSourceClass TaperFileSourceClass;
+struct _TaperFileSourceClass {
+    TaperSourceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  taper_file_source_get_type      (void);
+
+#endif
diff --git a/server-src/taper-mem-port-source.c b/server-src/taper-mem-port-source.c
new file mode 100644 (file)
index 0000000..0540845
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define selfp (self->_priv)
+
+#include "taper-mem-port-source.h"
+
+#include "physmem.h"
+
+struct _TaperMemPortSourcePrivate {
+    /* Actual size of this buffer is given by max_part_size in TaperSource. */
+    char * retry_buffer;
+    guint64 buffer_offset; /* Bytes read from buffer. */
+    guint64 buffer_len;    /* Bytes written to buffer. */
+    gboolean retry_mode;
+};
+/* here are local prototypes */
+static void taper_mem_port_source_init (TaperMemPortSource * o);
+static void taper_mem_port_source_class_init (TaperMemPortSourceClass * c);
+static ssize_t taper_mem_port_source_read (TaperSource * pself, void * buf,
+                                           size_t count);
+static gboolean taper_mem_port_source_seek_to_part_start (TaperSource * pself);
+static void taper_mem_port_source_start_new_part (TaperSource * pself);
+static int taper_mem_port_source_predict_parts(TaperSource * pself);
+
+/* pointer to the class of our parent */
+static TaperSourceClass * source_parent_class = NULL;
+static TaperPortSourceClass *parent_class = NULL;
+
+GType
+taper_mem_port_source_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TaperMemPortSourceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) taper_mem_port_source_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TaperMemPortSource),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) taper_mem_port_source_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TAPER_TYPE_PORT_SOURCE,
+                                       "TaperMemPortSource", &info,
+                                       (GTypeFlags)0);
+    }
+    
+    return type;
+}
+
+static void
+taper_mem_port_source_finalize(GObject *obj_self) {
+    TaperMemPortSource *self = TAPER_MEM_PORT_SOURCE (obj_self);
+    if(G_OBJECT_CLASS(parent_class)->finalize)
+        (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
+    amfree (self->_priv->retry_buffer);
+    amfree (self->_priv);
+}
+
+static void 
+taper_mem_port_source_init (TaperMemPortSource * o) {
+    o->_priv = malloc(sizeof(TaperMemPortSourcePrivate));
+    o->_priv->retry_buffer = NULL;
+    o->_priv->retry_mode = FALSE;
+    o->_priv->buffer_offset = o->_priv->buffer_len = 0;
+}
+
+static void 
+taper_mem_port_source_class_init (TaperMemPortSourceClass * c) {
+    GObjectClass *g_object_class = (GObjectClass*) c;
+    TaperSourceClass *taper_source_class = (TaperSourceClass *)c;
+    
+    parent_class = g_type_class_ref (TAPER_TYPE_PORT_SOURCE);
+    source_parent_class = (TaperSourceClass*)parent_class;
+    
+    taper_source_class->read = taper_mem_port_source_read;
+    taper_source_class->seek_to_part_start =
+        taper_mem_port_source_seek_to_part_start;
+    taper_source_class->start_new_part = taper_mem_port_source_start_new_part;
+    taper_source_class->predict_parts = taper_mem_port_source_predict_parts;
+
+    g_object_class->finalize = taper_mem_port_source_finalize;
+}
+
+static int taper_mem_port_source_predict_parts(TaperSource * pself) {
+    TaperMemPortSource * self = TAPER_MEM_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, -1);
+
+    return -1;
+}
+
+/* Allocate buffer space, if it hasn't been done yet. */
+static void setup_retry_buffer(TaperMemPortSource * self) {
+    guint64 alloc_size;
+    guint64 max_usage;
+    if (selfp->retry_buffer != NULL)
+        return;
+
+    alloc_size = TAPER_SOURCE(self)->max_part_size;
+    if (alloc_size > SIZE_MAX) {
+        g_fprintf(stderr, "Fallback split size of %lld is greater that system maximum of %lld.\n",
+                (long long)alloc_size, (long long)SIZE_MAX);
+        alloc_size = SIZE_MAX;
+    }
+    
+    max_usage = physmem_available() * .95;
+    if (alloc_size > max_usage) {
+        g_fprintf(stderr, "Fallback split size of %lld is greater than 95%% of available memory (%lld bytes).\n", (long long)alloc_size, (long long)max_usage);
+        alloc_size = max_usage;
+    }
+    
+    if (alloc_size < DISK_BLOCK_BYTES * 10) {
+        g_fprintf(stderr, "Fallback split size of %ju is smaller than 10 blocks (%u bytes).\n",
+                 (uintmax_t)alloc_size, DISK_BLOCK_BYTES * 10);
+        alloc_size = DISK_BLOCK_BYTES * 10;
+    }
+    
+    TAPER_SOURCE(self)->max_part_size = alloc_size;
+    selfp->retry_buffer = malloc(alloc_size);
+}
+
+static ssize_t 
+taper_mem_port_source_read (TaperSource * pself, void * buf, size_t count) {
+    TaperMemPortSource * self = (TaperMemPortSource*)pself;
+    g_return_val_if_fail (self != NULL, -1);
+    g_return_val_if_fail (TAPER_IS_MEM_PORT_SOURCE (self), -1);
+    g_return_val_if_fail (buf != NULL, -1);
+    g_return_val_if_fail (count > 0, -1);
+    
+    if (selfp->retry_mode) {
+        g_assert(selfp->retry_buffer != NULL && selfp->buffer_len > 0);
+        count = MIN(count, selfp->buffer_len - selfp->buffer_offset);
+
+        if (count == 0) {
+            /* It was not before. */
+            pself->end_of_part = TRUE;
+            return 0;
+        }
+
+        memcpy(buf, selfp->retry_buffer + selfp->buffer_offset, count);
+        selfp->buffer_offset += count;
+        return count;
+    } else {
+        int read_result;
+        if (selfp->retry_buffer == NULL) {
+            setup_retry_buffer(self);
+        }
+
+        count = MIN(count, pself->max_part_size - selfp->buffer_len);
+        if (count == 0) /* it was nonzero before */ {
+            pself->end_of_part = TRUE;
+            return 0;
+        }
+        
+        read_result = source_parent_class->read(pself, buf, count);
+        /* TaperPortSource handles EOF and other goodness. */
+        if (read_result <= 0) {
+            return read_result;
+        }
+
+        /* All's well in the world. */
+        memcpy(selfp->retry_buffer + selfp->buffer_len,
+               buf, read_result);
+        selfp->buffer_len += read_result;
+
+        return read_result;
+    }
+
+    g_assert_not_reached();
+}
+
+static gboolean 
+taper_mem_port_source_seek_to_part_start (TaperSource * pself) {
+    TaperMemPortSource * self = (TaperMemPortSource*)pself;
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (TAPER_IS_MEM_PORT_SOURCE (self), FALSE);
+    g_return_val_if_fail (selfp->buffer_len > 0, FALSE);
+
+    selfp->retry_mode = TRUE;
+    selfp->buffer_offset = 0;
+
+    if (source_parent_class->seek_to_part_start)
+        return source_parent_class->seek_to_part_start(pself);
+    else
+        return TRUE;
+}
+
+static void 
+taper_mem_port_source_start_new_part (TaperSource * pself) {
+    TaperMemPortSource * self = (TaperMemPortSource*)pself;
+    g_return_if_fail (self != NULL);
+    g_return_if_fail (TAPER_IS_MEM_PORT_SOURCE (self));
+
+    selfp->buffer_offset = selfp->buffer_len = 0;
+    selfp->retry_mode = FALSE;
+
+    if (source_parent_class->start_new_part)
+        source_parent_class->start_new_part(pself);
+}
diff --git a/server-src/taper-mem-port-source.h b/server-src/taper-mem-port-source.h
new file mode 100644 (file)
index 0000000..5aa02f5
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* The taper memory port source is a taper source (see taper-source.h)
+   used for the case where we are reading directly from a client
+   (PORT-WRITE) and are using an in-memory buffer to hold split dump parts. */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "taper-port-source.h"
+
+#ifndef __TAPER_MEM_PORT_SOURCE_H__
+#define __TAPER_MEM_PORT_SOURCE_H__
+
+
+/*
+ * Type checking and casting macros
+ */
+#define TAPER_TYPE_MEM_PORT_SOURCE     (taper_mem_port_source_get_type())
+#define TAPER_MEM_PORT_SOURCE(obj)     G_TYPE_CHECK_INSTANCE_CAST((obj), taper_mem_port_source_get_type(), TaperMemPortSource)
+#define TAPER_MEM_PORT_SOURCE_CONST(obj)       G_TYPE_CHECK_INSTANCE_CAST((obj), taper_mem_port_source_get_type(), TaperMemPortSource const)
+#define TAPER_MEM_PORT_SOURCE_CLASS(klass)     G_TYPE_CHECK_CLASS_CAST((klass), taper_mem_port_source_get_type(), TaperMemPortSourceClass)
+#define TAPER_IS_MEM_PORT_SOURCE(obj)  G_TYPE_CHECK_INSTANCE_TYPE((obj), taper_mem_port_source_get_type ())
+
+#define TAPER_MEM_PORT_SOURCE_GET_CLASS(obj)   G_TYPE_INSTANCE_GET_CLASS((obj), taper_mem_port_source_get_type(), TaperMemPortSourceClass)
+
+/* Private structure type */
+typedef struct _TaperMemPortSourcePrivate TaperMemPortSourcePrivate;
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_TAPER_MEM_PORT_SOURCE__
+#define __TYPEDEF_TAPER_MEM_PORT_SOURCE__
+typedef struct _TaperMemPortSource TaperMemPortSource;
+#endif
+struct _TaperMemPortSource {
+    TaperPortSource __parent__;
+    /*< private >*/
+    TaperMemPortSourcePrivate *_priv;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _TaperMemPortSourceClass TaperMemPortSourceClass;
+struct _TaperMemPortSourceClass {
+       TaperPortSourceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  taper_mem_port_source_get_type  (void);
+
+#endif
diff --git a/server-src/taper-port-source.c b/server-src/taper-port-source.c
new file mode 100644 (file)
index 0000000..e4666d4
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define selfp (self->_priv)
+
+#include "taper-port-source.h"
+
+/* here are local prototypes */
+static void taper_port_source_class_init (TaperPortSourceClass * c);
+static ssize_t taper_port_source_read (TaperSource * pself, void * buf,
+                                       size_t count);
+static void taper_port_source_init (TaperPortSource * self);
+static gboolean taper_port_source_is_partial(TaperSource * self);
+static int taper_port_source_predict_parts(TaperSource * pself);
+static dumpfile_t * taper_port_source_get_first_header(TaperSource * pself);
+
+
+/* pointer to the class of our parent */
+static TaperSourceClass *parent_class = NULL;
+
+GType
+taper_port_source_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TaperPortSourceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) taper_port_source_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TaperPortSource),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) taper_port_source_init,
+            NULL
+        };
+        
+        type = g_type_register_static (TAPER_TYPE_SOURCE, "TaperPortSource",
+                                       &info, (GTypeFlags)0);
+    }
+    
+    return type;
+}
+
+static void taper_port_source_finalize(GObject * obj_self) {
+    TaperPortSource *self = TAPER_PORT_SOURCE(obj_self);
+    if (self->socket_fd >= 0) {
+        aclose(self->socket_fd);
+    }
+    
+    G_OBJECT_CLASS (parent_class)->finalize (obj_self);
+}
+
+static void taper_port_source_class_init (TaperPortSourceClass * c) {
+    TaperSourceClass *taper_source_class = (TaperSourceClass *)c;
+    GObjectClass *g_object_class = (GObjectClass*)c;
+    
+    parent_class = g_type_class_ref (TAPER_TYPE_SOURCE);
+
+    taper_source_class->read = taper_port_source_read;
+    taper_source_class->is_partial = taper_port_source_is_partial;
+    taper_source_class->get_first_header = taper_port_source_get_first_header;
+    taper_source_class->predict_parts = taper_port_source_predict_parts;
+
+    g_object_class->finalize = taper_port_source_finalize;
+}
+
+/* Check if the header has been read; if not, read and parse it. */
+static void check_first_header(TaperPortSource * self) {
+    TaperSource * pself = (TaperSource*)self;
+    char buf[DISK_BLOCK_BYTES];
+    int result;
+    dumpfile_t * rval;
+    
+    if (G_LIKELY(pself->first_header != NULL)) {
+        return;
+    }
+    
+    result = fullread(self->socket_fd, buf, DISK_BLOCK_BYTES);
+    if (result != DISK_BLOCK_BYTES) {
+        return;
+    }
+    rval = malloc(sizeof(dumpfile_t));
+    parse_file_header(buf, rval, DISK_BLOCK_BYTES);
+    pself->first_header = rval;
+}
+
+static int taper_port_source_predict_parts(TaperSource * pself) {
+    TaperPortSource * self = TAPER_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, -1);
+
+    return 1;
+}
+
+static dumpfile_t * taper_port_source_get_first_header(TaperSource * pself) {
+    TaperPortSource * self = TAPER_PORT_SOURCE(pself);
+    g_return_val_if_fail(self != NULL, NULL);
+
+    check_first_header(self);
+    
+    if (parent_class->get_first_header) {
+        return (parent_class->get_first_header)(pself);
+    } else {
+        return NULL;
+    }
+}
+
+static void taper_port_source_init (TaperPortSource * self) {
+    /* Subclasses may do as they please, but if we are the final word,
+       then there will be no rewinding. */
+    if (G_TYPE_FROM_INSTANCE(self) == TAPER_TYPE_PORT_SOURCE) {
+        TAPER_SOURCE(self)->max_part_size = 0;
+    }
+    self->socket_fd = -1;
+}
+
+static ssize_t taper_port_source_read (TaperSource * pself, void * buf,
+                                       size_t count) {
+    TaperPortSource * self = (TaperPortSource*)pself;
+    int read_result;
+    g_return_val_if_fail (self != NULL, -1);
+    g_return_val_if_fail (TAPER_IS_PORT_SOURCE (pself), -1);
+    g_return_val_if_fail (buf != NULL, -1);
+    g_return_val_if_fail (count > 0, -1);
+    
+    check_first_header(self);
+
+    for (;;) {
+        read_result = read(self->socket_fd, buf, count);
+        if (read_result > 0) {
+            return read_result;
+        } else if (read_result == 0) {
+            pself->end_of_data = TRUE;
+            aclose(self->socket_fd);
+            return 0;
+        } else if (0
+#ifdef EAGAIN
+                   || errno == EAGAIN
+#endif
+#ifdef EWOULDBLOCK
+                   || errno == EWOULDBLOCK
+#endif
+#ifdef EINTR
+                   || errno == EINTR
+#endif
+                   ) {
+            /* Try again. */
+            continue;
+        } else {
+            /* Error occured. */
+            return read_result;
+        }
+    }
+    
+    g_assert_not_reached();
+}
+
+static gboolean
+taper_port_source_is_partial(TaperSource * pself) {
+    cmd_t cmd;
+    struct cmdargs cmdargs;
+    TaperPortSource * self = (TaperPortSource*)pself;
+
+    g_return_val_if_fail(self->socket_fd < 0, FALSE);
+
+    /* Query DRIVER about partial dump. */
+    putresult(DUMPER_STATUS, "%s\n", pself->driver_handle);
+    cmd = getcmd(&cmdargs);
+    if (cmd == FAILED) {
+        return TRUE;
+    } else if (cmd == DONE) {
+        return FALSE;
+    } else {
+        error("Driver gave invalid response "
+              "to query DUMPER-STATUS.\n");
+        g_assert_not_reached();
+    }
+}
diff --git a/server-src/taper-port-source.h b/server-src/taper-port-source.h
new file mode 100644 (file)
index 0000000..155fbf1
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* The taper port source is a taper source (see taper-source.h)
+   used for the case where we are reading directly from a client
+   (PORT-WRITE). */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "taper-source.h"
+
+#ifndef __TAPER_PORT_SOURCE_H__
+#define __TAPER_PORT_SOURCE_H__
+
+/*
+ * Type checking and casting macros
+ */
+#define TAPER_TYPE_PORT_SOURCE (taper_port_source_get_type())
+#define TAPER_PORT_SOURCE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), taper_port_source_get_type(), TaperPortSource)
+#define TAPER_PORT_SOURCE_CONST(obj)   G_TYPE_CHECK_INSTANCE_CAST((obj), taper_port_source_get_type(), TaperPortSource const)
+#define TAPER_PORT_SOURCE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), taper_port_source_get_type(), TaperPortSourceClass)
+#define TAPER_IS_PORT_SOURCE(obj)      G_TYPE_CHECK_INSTANCE_TYPE((obj), taper_port_source_get_type ())
+
+#define TAPER_PORT_SOURCE_GET_CLASS(obj)       G_TYPE_INSTANCE_GET_CLASS((obj), taper_port_source_get_type(), TaperPortSourceClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_TAPER_PORT_SOURCE__
+#define __TYPEDEF_TAPER_PORT_SOURCE__
+typedef struct _TaperPortSource TaperPortSource;
+#endif
+struct _TaperPortSource {
+    TaperSource __parent__;
+    /*< private >*/
+    int socket_fd; /* protected. */
+};
+
+/*
+ * Class definition
+ */
+typedef struct _TaperPortSourceClass TaperPortSourceClass;
+struct _TaperPortSourceClass {
+       TaperSourceClass __parent__;
+};
+
+
+/*
+ * Public methods
+ */
+GType  taper_port_source_get_type      (void);
+
+#endif
diff --git a/server-src/taper-source-test.c b/server-src/taper-source-test.c
new file mode 100644 (file)
index 0000000..ff731a6
--- /dev/null
@@ -0,0 +1,99 @@
+#include "taper-source.h"
+
+typedef struct {
+    guint64 tape_size;
+    guint64 tape_used;
+    ConsumerFunctor consumer;
+    gpointer consumer_data;
+} tape_info_t;
+
+/* A ConsumerFunctor. */
+static int size_limited_consumer(gpointer user_data, queue_buffer_t * buffer) {
+    tape_info_t * info = user_data;
+    int result;
+    
+    result = info->consumer(info->consumer_data, buffer);
+
+    info->tape_used += result;
+    if (info->tape_size < info->tape_used)
+        return -1;
+    else
+        return result;
+}
+
+int main(int argc, char ** argv) {
+    TaperSource * source;
+    tape_info_t info;
+    
+    g_type_init();
+
+    switch (argc) {
+    default:
+        g_fprintf(stderr, "USAGE: %16s volume-size ( holding-disk-file splitsize | \n"
+               "                                          "
+               "split-disk-buffer splitsize\n"
+               "                                          "
+               "fallback-splitsize )\n",
+               basename(argv[0]));
+        return EXIT_FAILURE;
+    case 4: {
+        /* FILE-WRITE */
+        guint64 splitsize = strtod(argv[3], NULL);
+        
+        source = taper_source_new("", FILE_WRITE, argv[2], -1, NULL, 
+                                  splitsize, 0);
+    }
+        break;
+    case 5: {
+        guint64 splitsize, fallback_splitsize;
+        splitsize = strtod(argv[3], NULL);
+        fallback_splitsize = strtod(argv[4], NULL);
+        
+        source = taper_source_new("", PORT_WRITE, NULL, STDIN_FILENO,
+                                  argv[2][0] == '\0' ? NULL : argv[2],
+                                  splitsize, fallback_splitsize);
+    }
+        break;
+    }
+
+    if (source == NULL)
+        return EXIT_FAILURE;
+
+    info.tape_used = 0;
+    info.tape_size = strtod(argv[1], NULL);
+    info.consumer = fd_write_consumer;
+    info.consumer_data = GINT_TO_POINTER(STDOUT_FILENO);
+
+    for (;;) {
+        gboolean success = do_consumer_producer_queue(taper_source_producer,
+                                                      source,
+                                                      size_limited_consumer,
+                                                      &info);
+
+        if (success) {
+            if (taper_source_get_end_of_data(source)) {
+                g_fprintf(stderr, "Got end of data.\n");
+                return EXIT_SUCCESS;
+            } else if (taper_source_get_end_of_part(source)) {
+                taper_source_start_new_part(source);
+                g_fprintf(stderr, "Finished part. Starting new one.\n");
+                continue;
+            } else {
+                g_fprintf(stderr, "Read error.\n");
+                return EXIT_FAILURE;
+            }
+        } else {
+            /* Write or read error. (we can't tell) */
+            info.tape_used = 0;
+            if (taper_source_seek_to_part_start(source)) {
+                g_fprintf(stderr, "Retrying a part.\n");
+                continue;
+            } else {
+                g_fprintf(stderr, "Couldn't seek. Dying.\n");
+                return EXIT_FAILURE;
+            }
+        }
+    }
+
+    g_assert_not_reached();
+}
diff --git a/server-src/taper-source.c b/server-src/taper-source.c
new file mode 100644 (file)
index 0000000..f0d3205
--- /dev/null
@@ -0,0 +1,365 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define selfp (self->_priv)
+
+#include "taper-source.h"
+#include "taper-file-source.h"
+#include "taper-port-source.h"
+#include "taper-disk-port-source.h"
+#include "taper-mem-port-source.h"
+
+/* here are local prototypes */
+static void taper_source_init (TaperSource * o);
+static void taper_source_class_init (TaperSourceClass * c);
+static void default_taper_source_start_new_part(TaperSource * self);
+static gboolean default_taper_source_is_partial(TaperSource * self);
+static gboolean default_taper_source_seek_to_part_start(TaperSource * self);
+static gboolean default_taper_source_get_end_of_data(TaperSource * self);
+static gboolean default_taper_source_get_end_of_part(TaperSource * self);
+static dumpfile_t * default_taper_source_get_first_header(TaperSource * self);
+
+/* pointer to the class of our parent */
+static GObjectClass *parent_class = NULL;
+
+GType
+taper_source_get_type (void)
+{
+    static GType type = 0;
+    
+    if G_UNLIKELY(type == 0) {
+        static const GTypeInfo info = {
+            sizeof (TaperSourceClass),
+            (GBaseInitFunc) NULL,
+            (GBaseFinalizeFunc) NULL,
+            (GClassInitFunc) taper_source_class_init,
+            (GClassFinalizeFunc) NULL,
+            NULL /* class_data */,
+            sizeof (TaperSource),
+            0 /* n_preallocs */,
+            (GInstanceInitFunc) taper_source_init,
+            NULL
+        };
+        
+        type = g_type_register_static (G_TYPE_OBJECT, "TaperSource", &info,
+                                       (GTypeFlags)G_TYPE_FLAG_ABSTRACT);
+    }
+    
+    return type;
+}
+
+static void taper_source_finalize(GObject * obj_self) {
+    TaperSource * self = TAPER_SOURCE(obj_self);
+    
+    if (G_OBJECT_CLASS(parent_class)->finalize)
+        G_OBJECT_CLASS(parent_class)->finalize(obj_self);
+
+    if (self->first_header)
+        amfree(self->first_header);
+
+    if (self->driver_handle)
+        amfree(self->driver_handle);
+}
+
+static void 
+taper_source_init (TaperSource * o) {
+    o->end_of_data = FALSE;
+    o->end_of_part = FALSE;
+    o->max_part_size = G_MAXUINT64;
+    o->first_header = NULL;
+}
+
+static void 
+taper_source_class_init (TaperSourceClass * c) {
+    GObjectClass *g_object_class = (GObjectClass*) c;
+
+    parent_class = g_type_class_ref (G_TYPE_OBJECT);
+
+    c->read = NULL;
+    c->seek_to_part_start = default_taper_source_seek_to_part_start;
+    c->start_new_part = default_taper_source_start_new_part;
+    c->is_partial = default_taper_source_is_partial;
+    c->get_end_of_data = default_taper_source_get_end_of_data;
+    c->get_end_of_part = default_taper_source_get_end_of_part;
+    c->get_first_header = default_taper_source_get_first_header;
+    c->predict_parts = NULL;
+
+    g_object_class->finalize = taper_source_finalize;
+}
+
+TaperSource * taper_source_new(char * handle,
+                               cmd_t mode, char * holding_disk_file,
+                               int socket_fd,
+                               char * split_disk_buffer,
+                               guint64 splitsize,
+                               guint64 fallback_splitsize) {
+    TaperSource * source_rval;
+    g_return_val_if_fail(mode == FILE_WRITE || mode == PORT_WRITE, NULL);
+    if (mode == FILE_WRITE) {
+        TaperFileSource * file_rval;
+        g_return_val_if_fail(holding_disk_file != NULL, NULL);
+        g_return_val_if_fail(holding_disk_file[0] != '\0', NULL);
+
+        /* Return a TaperFileSource. */
+        
+        source_rval = (TaperSource*)
+            g_object_new(TAPER_TYPE_FILE_SOURCE, NULL);
+        file_rval = (TaperFileSource*) source_rval;
+
+        if (file_rval == NULL)
+            return NULL;
+
+        file_rval->holding_disk_file = g_strdup(holding_disk_file);
+        source_rval->max_part_size = splitsize;
+    } else {
+        TaperPortSource * port_rval;
+        g_return_val_if_fail(socket_fd >= 0, NULL);
+
+        if (split_disk_buffer != NULL) {
+            TaperDiskPortSource * disk_rval;
+            g_return_val_if_fail(split_disk_buffer[0] != '\0', NULL);
+            g_return_val_if_fail(splitsize > 0, NULL);
+            
+            /* Return a TaperDiskPortSource. */
+            source_rval = (TaperSource*)
+                g_object_new(TAPER_TYPE_DISK_PORT_SOURCE, NULL);
+            disk_rval = (TaperDiskPortSource*) source_rval;
+            port_rval = (TaperPortSource*) source_rval;
+
+            if (disk_rval == NULL)
+                return NULL;
+
+            disk_rval->buffer_dir_name = g_strdup(split_disk_buffer);
+            disk_rval->fallback_buffer_size = fallback_splitsize;
+            source_rval->max_part_size = splitsize;
+        } else {
+            if (splitsize != 0) {
+                TaperMemPortSource * mem_rval;
+                /* Return a TaperMemPortSource. */
+                if (fallback_splitsize == 0)
+                    fallback_splitsize = splitsize;
+                source_rval = (TaperSource*)
+                    g_object_new(TAPER_TYPE_MEM_PORT_SOURCE, NULL);
+                mem_rval = (TaperMemPortSource*) source_rval;
+                port_rval = (TaperPortSource*) source_rval;
+
+                if (mem_rval == NULL)
+                    return NULL;
+                
+                source_rval->max_part_size = fallback_splitsize;
+            } else {
+                /* Return a TaperPortSource. */
+                source_rval = (TaperSource*)
+                    g_object_new(TAPER_TYPE_PORT_SOURCE, NULL);
+                port_rval = (TaperPortSource*) source_rval;
+
+                if (source_rval == NULL)
+                    return NULL;
+            } 
+        }
+        
+        port_rval->socket_fd = socket_fd;
+    }
+
+    /* If we got here, we have a return value. */
+    source_rval->driver_handle = strdup(handle);
+    return source_rval;
+}
+
+/* Default implementations of virtual functions. */
+static void
+default_taper_source_start_new_part(TaperSource * self) {
+    self->end_of_part = FALSE;
+}
+
+static gboolean
+default_taper_source_seek_to_part_start(TaperSource * self) {
+    self->end_of_data = self->end_of_part = FALSE;
+
+    return TRUE;
+}
+
+static gboolean
+default_taper_source_is_partial(TaperSource * self) {
+    return self->first_header->is_partial;
+}
+
+static gboolean default_taper_source_get_end_of_data(TaperSource * self) {
+    return self->end_of_data;
+}
+static gboolean default_taper_source_get_end_of_part(TaperSource * self) {
+    return self->end_of_part;
+}
+static dumpfile_t* default_taper_source_get_first_header(TaperSource * self) {
+    if (self->first_header == NULL)
+       return NULL;
+    return dumpfile_copy(self->first_header);
+}
+
+/* The rest of these functions are vtable dispatch stubs. */
+
+ssize_t 
+taper_source_read (TaperSource * self, void * buf, size_t count)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, (ssize_t )-1);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), (ssize_t )-1);
+    g_return_val_if_fail (buf != NULL, (ssize_t )-1);
+    g_return_val_if_fail (count > 0, (ssize_t )-1);
+
+    if (self->end_of_data || self->end_of_part) {
+        return 0;
+    }
+
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    if(klass->read)
+        return (*klass->read)(self,buf,count);
+    else
+        return (ssize_t )(-1);
+}
+
+gboolean 
+taper_source_get_end_of_data (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, TRUE);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), TRUE);
+
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    g_return_val_if_fail(klass->get_end_of_data != NULL, TRUE);
+
+    return (*klass->get_end_of_data)(self);
+}
+
+gboolean 
+taper_source_get_end_of_part (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, TRUE);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), TRUE);
+
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    g_return_val_if_fail(klass->get_end_of_part != NULL, TRUE);
+
+    return (*klass->get_end_of_part)(self);
+}
+
+dumpfile_t *
+taper_source_get_first_header (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, NULL);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), NULL);
+
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    g_return_val_if_fail(klass->get_first_header != NULL, NULL);
+
+    return (*klass->get_first_header)(self);
+}
+
+int taper_source_predict_parts(TaperSource * self) {
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, -1);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), -1);
+
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    if (klass->predict_parts != NULL) {
+        return (*klass->predict_parts)(self);
+    } else {
+        return -1;
+    }
+}
+
+gboolean 
+taper_source_seek_to_part_start (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, (gboolean )0);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), (gboolean )0);
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    if(klass->seek_to_part_start)
+        return (*klass->seek_to_part_start)(self);
+    else
+        return (gboolean )(0);
+}
+
+void 
+taper_source_start_new_part (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_if_fail (self != NULL);
+    g_return_if_fail (TAPER_IS_SOURCE (self));
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    if(klass->start_new_part)
+        (*klass->start_new_part)(self);
+}
+
+gboolean
+taper_source_is_partial (TaperSource * self)
+{
+    TaperSourceClass *klass;
+    g_return_val_if_fail (self != NULL, FALSE);
+    g_return_val_if_fail (TAPER_IS_SOURCE (self), FALSE);
+    g_return_val_if_fail (taper_source_get_end_of_data(self), FALSE);
+    klass = TAPER_SOURCE_GET_CLASS(self);
+    
+    if(klass->is_partial)
+        return (*klass->is_partial)(self);
+    else
+        return FALSE;
+}
+
+producer_result_t taper_source_producer(gpointer data,
+                                        queue_buffer_t * buffer,
+                                        int hint_size) {
+    TaperSource * source;
+    int result;
+
+    source = data;
+    g_assert(TAPER_IS_SOURCE(source));
+
+    buffer->offset = 0;
+    if (buffer->data == NULL) {
+        buffer->data = malloc(hint_size);
+        /* This allocation is more likely than most to fail. */
+        g_return_val_if_fail(buffer->data != NULL, PRODUCER_ERROR);
+        buffer->alloc_size = hint_size;
+    }
+
+    result = taper_source_read(source, buffer->data, buffer->alloc_size);
+    if (result > 0) {
+        buffer->data_size = result;
+        return PRODUCER_MORE;
+    } else if (result == 0) {
+        /* EOF or EOC? We are done here either way. */
+        return PRODUCER_FINISHED;
+    } else {
+        return PRODUCER_ERROR;
+    }
+
+    g_assert_not_reached();
+}
+
diff --git a/server-src/taper-source.h b/server-src/taper-source.h
new file mode 100644 (file)
index 0000000..37d0f7a
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 2006 Zmanda Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/* The taper source object abstracts the different ways that taper can
+ * retrieve and buffer data on its way to the device. It handles all
+ * splitting up and re-reading of split-tape parts, as well as all
+ * holding-disk related actions. */
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <amanda.h>
+#include "server_util.h"
+#include "fileheader.h"
+#include "queueing.h"
+
+#ifndef __TAPER_SOURCE_H__
+#define __TAPER_SOURCE_H__
+
+
+/*
+ * Type checking and casting macros
+ */
+#define TAPER_TYPE_SOURCE      (taper_source_get_type())
+#define TAPER_SOURCE(obj)      G_TYPE_CHECK_INSTANCE_CAST((obj), taper_source_get_type(), TaperSource)
+#define TAPER_SOURCE_CONST(obj)        G_TYPE_CHECK_INSTANCE_CAST((obj), taper_source_get_type(), TaperSource const)
+#define TAPER_SOURCE_CLASS(klass)      G_TYPE_CHECK_CLASS_CAST((klass), taper_source_get_type(), TaperSourceClass)
+#define TAPER_IS_SOURCE(obj)   G_TYPE_CHECK_INSTANCE_TYPE((obj), taper_source_get_type ())
+
+#define TAPER_SOURCE_GET_CLASS(obj)    G_TYPE_INSTANCE_GET_CLASS((obj), taper_source_get_type(), TaperSourceClass)
+
+/*
+ * Main object structure
+ */
+#ifndef __TYPEDEF_TAPER_SOURCE__
+#define __TYPEDEF_TAPER_SOURCE__
+typedef struct _TaperSource TaperSource;
+#endif
+struct _TaperSource {
+    GObject __parent__;
+    /*< private >*/
+    gboolean end_of_data; /* protected */
+    gboolean end_of_part; /* protected */
+    guint64 max_part_size; /* protected */
+    dumpfile_t * first_header;
+    char * driver_handle;
+};
+
+/*
+ * Class definition
+ */
+typedef struct _TaperSourceClass TaperSourceClass;
+struct _TaperSourceClass {
+    GObjectClass __parent__;
+    ssize_t (* read) (TaperSource * self, void * buf, size_t count);
+    gboolean (* seek_to_part_start) (TaperSource * self);
+    void (* start_new_part) (TaperSource * self);
+    gboolean (* is_partial) (TaperSource * self);
+    gboolean (* get_end_of_data)(TaperSource * self);
+    gboolean (* get_end_of_part)(TaperSource * self);
+    dumpfile_t * (* get_first_header)(TaperSource * self);
+    int (* predict_parts)(TaperSource * self);
+};
+
+
+/*
+ * Public methods
+ */
+GType  taper_source_get_type   (void);
+ssize_t        taper_source_read       (TaperSource * self,
+                                       void * buf,
+                                       size_t count);
+gboolean       taper_source_get_end_of_data    (TaperSource * self);
+gboolean       taper_source_get_end_of_part    (TaperSource * self);
+dumpfile_t *    taper_source_get_first_header   (TaperSource * self);
+/* Returns -1 for an unknown number of splits, or a positive integer if the
+ * number of splits is exactly known. Should never return zero. */
+int             taper_source_predict_parts      (TaperSource * self);
+
+/* You can only call this function (and expect to get an accurate
+   result) if taper_source_get_end_of_data() has already returned
+   TRUE. */
+gboolean        taper_source_is_partial         (TaperSource * self);
+
+gboolean       taper_source_seek_to_part_start (TaperSource * self);
+void   taper_source_start_new_part     (TaperSource * self);
+
+/* This function is how you get a taper source. Call it with the
+   relevant parameters, and the return value is yours to
+   keep. Arguments must be consistant (e.g., if you specify FILE_WRITE
+   mode, then you must provide a holding disk file). Input strings are
+   copied internally. */
+TaperSource * taper_source_new(char * handle,
+                               cmd_t mode, char * holding_disk_file,
+                               int socket_fd,
+                               char * split_disk_buffer,
+                               guint64 splitsize,
+                               guint64 fallback_splitsize);
+
+/* This function is a ProducerFunctor, as that type is defined in
+   device-src/queueing.h. */
+producer_result_t taper_source_producer(gpointer taper_source,
+                                        queue_buffer_t * buffer,
+                                        int hint_size);
+
+#endif
index 3a10efe8e5367e224e55aa48576c450a4c83652a..4b54430c2ee4add5766afc24ae42360d268eebba 100644 (file)
  * Authors: the Amanda Development Team.  Its members are listed in a
  * file named AUTHORS, in the root directory of this distribution.
  */
-/* $Id: taper.c,v 1.144 2006/08/24 11:23:32 martinea Exp $
+/* $Id: taper.c 6512 2007-05-24 17:00:24Z ian $
  *
  * moves files from holding disk to tape, or from a socket to tape
  */
 
-#include "amanda.h"
-#include "util.h"
-#include "conffile.h"
-#include "tapefile.h"
-#include "clock.h"
-#include "stream.h"
-#include "holding.h"
-#include "logfile.h"
-#include "tapeio.h"
-#include "changer.h"
-#include "version.h"
-#include "arglist.h"
-#include "token.h"
-#include "amfeatures.h"
-#include "fileheader.h"
-#include "server_util.h"
-#include "taperscan.c"
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#define taper_debug(i,x) do {          \
-       if ((i) <= debug_taper) {       \
-           dbprintf(x);                \
-       }                               \
-} while (0)
-
-#ifdef HAVE_LIBVTBLC
-#include <vtblc.h>
-#include <strings.h>
-#include <math.h>
-
-static int vtbl_no   = -1;
-static int len       =  0;
-static int offset    =  0;
-static char *datestr = NULL;
-static char start_datestr[20];
-static time_t raw_time;
-static struct tm tape_time;
-static struct tm backup_time;
-static struct tm *tape_timep = &tape_time;
-typedef struct vtbl_lbls {
-    u_int8_t  label[45];
-    u_int8_t  date[20];
-} vtbl_lbls;
-static vtbl_lbls vtbl_entry[MAX_VOLUMES];
-#endif /* HAVE_LIBVTBLC */
-
-/*
- * XXX update stat collection/printing
- * XXX advance to next tape first in next_tape
- * XXX label is being read twice?
- */
-static off_t splitsize = (off_t)0; /* max size of dumpfile before split (Kb) */
-static off_t mmap_splitsize = (off_t)0;
-static char *mmap_filename = NULL;
-static char *mmap_splitbuf = NULL;
-static char *mem_splitbuf = NULL;
-static char *splitbuf = NULL;
-static off_t mem_splitsize = (off_t)0;
-static char *splitbuf_wr_ptr = NULL; /* the number of Kb we've written into splitbuf */
-int orig_holdfile = -1;
-
-/* NBUFS replaced by conf_tapebufs */
-/* #define NBUFS               20 */
-static int conf_tapebufs;
-
-static off_t maxseek = (off_t)1 << ((SIZEOF(off_t) * 8) - 11);
-
-static char *holdfile_path = NULL;
-static char *holdfile_path_thischunk = NULL;
-static int num_holdfile_chunks = 0;
-static off_t holdfile_offset_thischunk = (off_t)0;
-static int mmap_splitbuffer_fd = -1;
-
-#define MODE_NONE 0
-#define MODE_FILE_WRITE 1
-#define MODE_PORT_WRITE 2
-
-static mode_t mode = MODE_NONE;
-
-/* This is now the number of empties, not full bufs */
-#define THRESHOLD      1
-
-#define CONNECT_TIMEOUT 2*60
-
-#define EMPTY 1
-#define FILLING 2
-#define FULL 3
-
-typedef struct buffer_s {
-    long status;
-    ssize_t size;
-    char *buffer;
-} buffer_t;
-
-#define nextbuf(p)    ((p) == buftable+conf_tapebufs-1? buftable : (p)+1)
-#define prevbuf(p)    ((p) == buftable? buftable+conf_tapebufs-1 : (p)-1)
-
-/* major modules */
-int main(int main_argc, char **main_argv);
-void file_reader_side(int rdpipe, int wrpipe);
-void tape_writer_side(int rdpipe, int wrpipe);
-void put_syncpipe_fault_result(char *handle);
-
-/* shared-memory routines */
-char *attach_buffers(size_t size);
-void detach_buffers(char *bufp);
-void destroy_buffers(void);
-#define REMOVE_SHARED_MEMORY() \
-    detach_buffers(buffers); \
-    if (strcmp(procname, "reader") == 0) { \
-       destroy_buffers(); \
-    }
-
-/* synchronization pipe routines */
-void syncpipe_init(int rd, int wr);
-void syncpipe_read_error(ssize_t rc, ssize_t expected);
-void syncpipe_write_error(ssize_t rc, ssize_t expected);
-int syncpipe_get(int *intp);
-int syncpipe_getint(void);
-char *syncpipe_getstr(void);
-int syncpipe_put(int ch, int intval);
-int syncpipe_putint(int i);
-int syncpipe_putstr(const char *str);
-
-/* tape manipulation subsystem */
-int first_tape(char *new_datestamp);
-int next_tape(int writerr);
-int end_tape(int writerr);
-int write_filemark(void);
-
-/* support crap */
-int seek_holdfile(int fd, buffer_t *bp, off_t kbytes);
-
-/* signal handling */
-static void install_signal_handlers(void);
-static void signal_handler(int);
-
-/* exit routine */
-static void cleanup(void);
-
-/*
- * ========================================================================
- * GLOBAL STATE
- *
- */
-int interactive;
-pid_t writerpid;
-times_t total_wait;
-
-char *buffers = NULL;
-buffer_t *buftable = NULL;
-int err;
-
-char *procname = "parent";
-
-char *taper_timestamp = NULL;
-char *label = NULL;
-int filenum;
-char *errstr = NULL;
-int tape_fd = -1;
-char *tapedev = NULL;
-char *tapetype = NULL;
-tapetype_t *tt = NULL;
-size_t tt_blocksize;
-size_t tt_blocksize_kb;
-size_t buffer_size;
-int tt_file_pad;
-static unsigned long malloc_hist_1, malloc_size_1;
-static unsigned long malloc_hist_2, malloc_size_2;
-dumpfile_t file;
-dumpfile_t *save_holdfile = NULL;
-off_t cur_span_chunkstart = (off_t)0; /* start of current split dump chunk (Kb) */
-char *holdfile_name;
-int num_splits = 0;
-int expected_splits = 0;
-int num_holdfiles = 0;
-times_t curdump_rt;
-
-am_feature_t *their_features = NULL;
-
-int runtapes, cur_tape, have_changer, tapedays;
-char *labelstr, *conf_tapelist;
-#ifdef HAVE_LIBVTBLC
-char *rawtapedev;
-int first_seg, last_seg;
-#endif /* HAVE_LIBVTBLC */
-
-/*
- * ========================================================================
- * MAIN PROGRAM
- *
- */
-int
-main(
-    int main_argc,
-    char **main_argv)
-{
-    int p2c[2], c2p[2];                /* parent-to-child, child-to-parent pipes */
-    char *conffile;
-    size_t size;
-    int i;
-    size_t j;
-    size_t page_size;
-    char *first_buffer;
-    int    new_argc,   my_argc;
-    char **new_argv, **my_argv;
-
-    safe_fd(-1, 0);
-
-    set_pname("taper");
-
-    dbopen("server");
-
-    /* Don't die when child closes pipe */
-    signal(SIGPIPE, SIG_IGN);
-
-    malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
-    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
-    my_argc = new_argc;
-    my_argv = new_argv;
-
-    fprintf(stderr, "%s: pid %ld executable %s version %s\n",
-           get_pname(), (long) getpid(), my_argv[0], version());
-    dbprintf(("%s: pid %ld executable %s version %s\n",
-           get_pname(), (long) getpid(), my_argv[0], version()));
-    fflush(stderr);
-
-    if (my_argc > 1 && my_argv[1][0] != '-') {
-       config_name = stralloc(my_argv[1]);
-       config_dir = vstralloc(CONFIG_DIR, "/", my_argv[1], "/", NULL);
-       my_argc--;
-       my_argv++;
-    } else {
-       char my_cwd[STR_SIZE];
-
-       if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-           error("cannot determine current working directory");
-           /*NOTREACHED*/
-       }
-       config_dir = stralloc2(my_cwd, "/");
-       if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-           config_name = stralloc(config_name + 1);
-       }
-    }
-
-    safe_cd();
-
-    install_signal_handlers();
-    atexit(cleanup);
-
-    /* print prompts and debug messages if running interactive */
-
-    interactive = (my_argc > 1 && strcmp(my_argv[1],"-t") == 0);
-    if (interactive) {
-       erroutput_type = ERR_INTERACTIVE;
-    } else {
-       erroutput_type = ERR_AMANDALOG;
-       set_logerror(logerror);
-    }
-
-    free_new_argv(new_argc, new_argv);
-
-    conffile = stralloc2(config_dir, CONFFILE_NAME);
-    if (read_conffile(conffile)) {
-       error("errors processing config file \"%s\"", conffile);
-       /*NOTREACHED*/
-    }
-    amfree(conffile);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
-    report_bad_conf_arg();
-
-    conf_tapelist = getconf_str(CNF_TAPELIST);
-    if (*conf_tapelist == '/') {
-       conf_tapelist = stralloc(conf_tapelist);
-    } else {
-       conf_tapelist = stralloc2(config_dir, conf_tapelist);
-    }
-    if (read_tapelist(conf_tapelist)) {
-       error("could not load tapelist \"%s\"", conf_tapelist);
-       /*NOTREACHED*/
-    }
-
-    tapedev    = getconf_str(CNF_TAPEDEV);
-    if (tapedev != NULL)
-       tapedev = stralloc(tapedev);
-    tapetype    = getconf_str(CNF_TAPETYPE);
-    tt         = lookup_tapetype(tapetype);
-#ifdef HAVE_LIBVTBLC
-    rawtapedev = stralloc(getconf_str(CNF_RAWTAPEDEV));
-#endif /* HAVE_LIBVTBLC */
-    tapedays   = getconf_int(CNF_TAPECYCLE);
-    labelstr   = getconf_str(CNF_LABELSTR);
-
-    runtapes   = getconf_int(CNF_RUNTAPES);
-    cur_tape   = 0;
-
-    conf_tapebufs = getconf_int(CNF_TAPEBUFS);
-
-    tt_blocksize_kb = (size_t)tapetype_get_blocksize(tt);
-    tt_blocksize = tt_blocksize_kb * 1024;
-    tt_file_pad = tapetype_get_file_pad(tt);
-
-    if (interactive) {
-       fprintf(stderr,"taper: running in interactive test mode\n");
-       dbprintf(("taper: running in interactive test mode\n"));
-       fflush(stderr);
-    }
-
-    /* create read/write syncronization pipes */
-
-    if (pipe(p2c)) {
-       error("creating sync pipes: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-    if (pipe(c2p)) {
-       error("creating sync pipes: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-
-    /* create shared memory segment */
-
-#if defined(HAVE_GETPAGESIZE)
-    page_size = (size_t)getpagesize();
-    fprintf(stderr, "%s: page size = " SIZE_T_FMT "\n",
-               get_pname(), (SIZE_T_FMT_TYPE)page_size);
-    dbprintf(("%s: page size = " SIZE_T_FMT "\n", get_pname(),
-               (SIZE_T_FMT_TYPE)page_size));
-#else
-    page_size = 1024;
-    fprintf(stderr, "%s: getpagesize() not available, using " SIZE_T_FMT "\n",
-           get_pname(), page_size);
-    dbprintf((stderr, "%s: getpagesize() not available, using " SIZE_T_FMT "\n",
-           get_pname(), page_size));
-#endif
-    buffer_size = am_round(tt_blocksize, page_size);
-    fprintf(stderr, "%s: buffer size is " SIZE_T_FMT "\n",
-           get_pname(), (SIZE_T_FMT_TYPE)buffer_size);
-    dbprintf(("%s: buffer size is " SIZE_T_FMT "\n",
-           get_pname(), (SIZE_T_FMT_TYPE)buffer_size));
-    while (conf_tapebufs > 0) {
-       size  = page_size;
-       size += conf_tapebufs * buffer_size;
-       size += conf_tapebufs * SIZEOF(buffer_t);
-       if ((buffers = attach_buffers(size)) != NULL) {
-           break;
-       }
-       log_add(L_INFO, "attach_buffers: (%d tapebuf%s: " SIZE_T_FMT " bytes) %s",
-                       conf_tapebufs,
-                       (conf_tapebufs == 1) ? "" : "s",
-                       size,
-                       strerror(errno));
-       conf_tapebufs--;
-    }
-    if (buffers == NULL) {
-       error("cannot allocate shared memory");
-       /*NOTREACHED*/
-    }
-
-    /* page boundary offset */
-    i = (int)((buffers - (char *)0) & (page_size - 1));
-    if (i != 0) {
-       first_buffer = buffers + page_size - i;
-       dbprintf(("%s: shared memory at %p, first buffer at %p\n",
-               get_pname(),
-               (void *)buffers,
-               (void *)first_buffer));
-    } else {
-       first_buffer = buffers;
-    }
-
-    /*LINTED  first_buffer, conf_tapebufs and buffer size are all * pagesize */
-    buftable = (buffer_t *)(first_buffer + (conf_tapebufs * buffer_size));
-    memset(buftable, 0, conf_tapebufs * SIZEOF(buffer_t));
-    if (conf_tapebufs < 10) {
-       j = 1;
-    } else if (conf_tapebufs < 100) {
-       j = 2;
-    } else {
-       j = 3;
-    }
-    for (i = 0; i < conf_tapebufs; i++) {
-       buftable[i].buffer = first_buffer + i * buffer_size;
-       dbprintf(("%s: buffer[%0*d] at %p\n",
-               get_pname(),
-               (int)j, i,
-               (void *)buftable[i].buffer));
-    }
-    dbprintf(("%s: buffer structures at %p for %d bytes\n",
-           get_pname(),
-           (void *)buftable,
-           (int)(conf_tapebufs * SIZEOF(buffer_t))));
-
-    /* fork off child writer process, parent becomes reader process */
-    switch(writerpid = fork()) {
-    case -1:
-       error("fork: %s", strerror(errno));
-       /*NOTREACHED*/
+/* FIXME: This file needs to use gettext. */
 
-    case 0:    /* child */
-       aclose(p2c[1]);
-       aclose(c2p[0]);
+#include <glib.h>
+#include "physmem.h"
 
-       tape_writer_side(p2c[0], c2p[1]);
-       error("tape writer terminated unexpectedly");
-       /*NOTREACHED*/
-
-    default:   /* parent */
-       aclose(p2c[0]);
-       aclose(c2p[1]);
-
-       file_reader_side(c2p[0], p2c[1]);
-       error("file reader terminated unexpectedly");
-       /*NOTREACHED*/
-    }
-
-    /*NOTREACHED*/
-    return 0;
-}
-
-
-/*
- * ========================================================================
- * FILE READER SIDE
- *
- */
-int read_file(int fd, char *handle,
-                 char *host, char *disk, char *datestamp, 
-                 int level);
-ssize_t taper_fill_buffer(int fd, buffer_t *bp, size_t buflen);
-void dumpbufs(char *str1);
-void dumpstatus(buffer_t *bp);
-ssize_t get_next_holding_file(int fd, buffer_t *bp, char **strclosing, size_t rc);
-int predict_splits(char *filename);
-void create_split_buffer(char *split_diskbuffer, size_t fallback_splitsize, char *id_string);
-void free_split_buffer(void);
-
-
-/*
- * Create a buffer, either in an mmapped file or in memory, where PORT-WRITE
- * dumps can buffer the current split chunk in case of retry.
- */
-void
-create_split_buffer(
-    char *split_diskbuffer,
-    size_t fallback_splitsize,
-    char *id_string)
-{
-    char *buff_err = NULL;
-    off_t offset;
-    char *splitbuffer_path = NULL;
-    
-    /* don't bother if we're not actually splitting */
-    if (splitsize <= (off_t)0) {
-       splitbuf = NULL;
-       splitbuf_wr_ptr = NULL;
-       return;
-    }
-
-#ifdef HAVE_MMAP
-#ifdef HAVE_SYS_MMAN_H
-    if (strcmp(split_diskbuffer, "NULL")) {
-       void *nulls = NULL;
-       char *quoted;
-       off_t c;
-
-       splitbuffer_path = vstralloc(split_diskbuffer,
-                                    "/splitdump_buffer",
-                                    NULL);
-       /* different file, munmap the previous */
-       if (mmap_filename && strcmp(mmap_filename, splitbuffer_path) != 0) {
-           dbprintf(("create_split_buffer: new file %s\n", splitbuffer_path));
-           munmap(splitbuf, (size_t)mmap_splitsize);
-           aclose(mmap_splitbuffer_fd);
-           mmap_splitbuf = NULL;
-           amfree(mmap_filename);
-           mmap_splitsize = 0;
-       }
-       if (!mmap_filename) {
-           dbprintf(("create_split_buffer: open file %s\n",
-                     splitbuffer_path));
-           mmap_splitbuffer_fd = open(splitbuffer_path, O_RDWR|O_CREAT, 0600);
-           if (mmap_splitbuffer_fd == -1) {
-               buff_err = newvstralloc(buff_err, "open of ", 
-                                       splitbuffer_path, "failed (",
-                                       strerror(errno), ")", NULL);
-               goto fallback;
-           }
-       }
-       offset = lseek(mmap_splitbuffer_fd, (off_t)0, SEEK_END) / 1024;
-       if (offset < splitsize) { /* Increase file size */
-           dbprintf(("create_split_buffer: increase file size of %s to "
-                     OFF_T_FMT "kb\n",
-                     splitbuffer_path, (OFF_T_FMT_TYPE)splitsize));
-           if (mmap_filename) {
-               dbprintf(("create_split_buffer: munmap old file %s\n",
-                         mmap_filename));
-               munmap(splitbuf, (size_t)mmap_splitsize);
-               mmap_splitsize = 0;
-               mmap_splitbuf = NULL;
-           }
-           nulls = alloc(1024); /* lame */
-           memset(nulls, 0, 1024);
-           for (c = offset; c < splitsize ; c += (off_t)1) {
-               if (fullwrite(mmap_splitbuffer_fd, nulls, 1024) < 1024) {
-                   buff_err = newvstralloc(buff_err, "write to ",
-                                           splitbuffer_path,
-                                           "failed (", strerror(errno),
-                                           ")", NULL);
-                   c -= 1;
-                   if (c <= (off_t)fallback_splitsize) {
-                       goto fallback;
-                   }
-                   splitsize = c;
-                   break;
-               }
-           }
-       }
-       amfree(nulls);
-
-       if (mmap_splitsize < splitsize*1024) {
-           mmap_splitsize = splitsize*1024;
-           mmap_filename = stralloc(splitbuffer_path);
-           dbprintf(("create_split_buffer: mmap file %s for " OFF_T_FMT "kb\n",
-                         mmap_filename,(OFF_T_FMT_TYPE)splitsize));
-            mmap_splitbuf = mmap(NULL, (size_t)mmap_splitsize,
-                                PROT_READ|PROT_WRITE,
-                                MAP_SHARED, mmap_splitbuffer_fd, (off_t)0);
-           if (mmap_splitbuf == (char*)-1) {
-               buff_err = newvstralloc(buff_err, "mmap failed (",
-                                       strerror(errno), ")", NULL);
-               aclose(mmap_splitbuffer_fd);
-               amfree(mmap_filename);
-               mmap_splitsize = 0;
-               mmap_splitbuf = NULL;
-               goto fallback;
-           }
-       }
-       quoted = quote_string(splitbuffer_path);
-       fprintf(stderr,
-               "taper: r: buffering " OFF_T_FMT
-               "kb split chunks in mmapped file %s\n",
-               (OFF_T_FMT_TYPE)splitsize, quoted);
-       dbprintf(("taper: r: buffering " OFF_T_FMT
-               "kb split chunks in mmapped file %s\n",
-               (OFF_T_FMT_TYPE)splitsize, quoted));
-       amfree(splitbuffer_path);
-       amfree(quoted);
-       amfree(buff_err);
-       splitbuf = mmap_splitbuf;
-       splitbuf_wr_ptr = splitbuf;
-       return;
-    } else {
-       buff_err = stralloc("no split_diskbuffer specified");
-    }
-#else
-    (void)split_diskbuffer;    /* Quite unused parameter warning */
-    buff_err = stralloc("mman.h not available");
-    goto fallback;
-#endif
-#else
-    (void)split_diskbuffer;    /* Quite unused parameter warning */
-    buff_err = stralloc("mmap not available");
-    goto fallback;
-#endif
-
-    /*
-      Buffer split dumps in memory, if we can't use a file.
-    */
-    fallback:
-       amfree(splitbuffer_path);
-        splitsize = (off_t)fallback_splitsize;
-       dbprintf(("create_split_buffer: fallback size " OFF_T_FMT "\n",
-                 (OFF_T_FMT_TYPE)splitsize));
-       log_add(L_INFO,
-               "%s: using fallback split size of " OFF_T_FMT "kb to buffer %s in-memory",
-               buff_err, (OFF_T_FMT_TYPE)splitsize, id_string);
-       amfree(buff_err);
-       if (splitsize > mem_splitsize) {
-           amfree(mem_splitbuf);
-           mem_splitbuf = alloc(fallback_splitsize * 1024);
-           mem_splitsize = fallback_splitsize;
-           dbprintf(("create_split_buffer: alloc buffer size " OFF_T_FMT "\n",
-                         (OFF_T_FMT_TYPE)splitsize *1024));
-       }
-       splitbuf = mem_splitbuf;
-       splitbuf_wr_ptr = splitbuf;
-}
-
-/*
- * Free up resources that create_split_buffer eats.
- */
-void
-free_split_buffer(void)
-{
-    if (mmap_splitbuffer_fd != -1) {
-#ifdef HAVE_MMAP
-#ifdef HAVE_SYS_MMAN_H
-       if (mmap_splitbuf != NULL) {
-           munmap(mmap_splitbuf, (size_t)mmap_splitsize);
-           mmap_splitbuf = NULL;
-       }
-#endif
-#endif
-       aclose(mmap_splitbuffer_fd);
-       amfree(mmap_filename);
-       mmap_splitsize = 0;
-    }
-    if (mem_splitbuf) {
-       amfree(mem_splitbuf);
-       mem_splitsize = 0;
-    }
-}
-
-void
-put_syncpipe_fault_result(
-    char *     handle)
-{
-    char *q;
-
-    if (handle == NULL)
-       handle = "<nohandle>";
-
-    q = squotef("[Taper syncpipe fault]");
-    putresult(TAPE_ERROR, "%s %s\n", handle, q);
-    log_add(L_ERROR, "tape-error %s %s", handle, q);
-    amfree(q);
-}
-
-void
-file_reader_side(
-    int rdpipe,
-    int wrpipe)
-{
-    cmd_t cmd;
-    struct cmdargs cmdargs;
-    char *handle = NULL;
-    char *filename = NULL;
-    char *qfilename = NULL;
-    char *hostname = NULL;
-    char *diskname = NULL;
-    char *qdiskname = NULL;
-    char *result = NULL;
-    char *datestamp = NULL;
-    char *split_diskbuffer = NULL;
-    char *id_string = NULL;
-    int tok;
-    char *q = NULL;
-    int level, fd;
-    in_port_t data_port;
-    int data_socket;
-    pid_t wpid;
-    char level_str[64];
-    struct stat stat_file;
-    int tape_started;
-    int a;
-    size_t fallback_splitsize = 0;
-    int tmpint;
-    char *c, *c1;
-
-    procname = "reader";
-    syncpipe_init(rdpipe, wrpipe);
-
-    /* must get START_TAPER before beginning */
-
-    startclock();
-    cmd = getcmd(&cmdargs);
-    total_wait = stopclock();
-
-    if (cmd != START_TAPER || cmdargs.argc != 2) {
-       error("error [file_reader_side cmd %d argc %d]", cmd, cmdargs.argc);
-       /*NOTREACHED*/
-    }
-
-    /* pass start command on to tape writer */
-
-    taper_timestamp = newstralloc(taper_timestamp, cmdargs.argv[2]);
-
-    if (tapedev == NULL) {
-       if (getconf_str(CNF_TPCHANGER) == NULL) {
-           putresult(TAPE_ERROR, "[No tapedev or tpchanger defined]\n");
-           log_add(L_ERROR, "No tapedev or tpchanger defined");
-           dbprintf(("taper: No tapedev or tpchanger defined\n"));
-           exit(1);
-       }
-    } else {
-       tapedev = stralloc(tapedev);
-    }
-
-    tape_started = 0;
-    if (syncpipe_put('S', 0) == -1) {
-       put_syncpipe_fault_result(NULL);
-    }
-
-    if (syncpipe_putstr(taper_timestamp) == -1) {
-       put_syncpipe_fault_result(NULL);
-    }
-
-    /* get result of start command */
-
-    tok = syncpipe_get(&tmpint);
-    switch(tok) {
-    case -1:
-       put_syncpipe_fault_result(NULL);
-       break;
-
-    case 'S':
-       putresult(TAPER_OK, "\n");
-       tape_started = 1;
-       /* start is logged in writer */
-       break;
-
-    case 'E':
-       /* no tape, bail out */
-       if ((result = syncpipe_getstr()) == NULL) {
-           put_syncpipe_fault_result(NULL);
-       } else {
-           q = squotef("[%s]", result);
-           putresult(TAPE_ERROR, "<nohandle> %s\n", q);
-           amfree(q);
-           log_add(L_ERROR,"no-tape [%s]", "No writable valid tape found");
-           c = c1 = result;
-           while (*c != '\0') {
-               if (*c == '\n') {
-                   *c = '\0';
-                   log_add(L_WARNING,"%s", c1);
-                   c1 = c+1;
-               }
-               c++;
-           }
-           if (strlen(c1) > 1 )
-               log_add(L_WARNING,"%s", c1);
-           amfree(result);
-           (void)syncpipe_put('e', 0);                 /* ACK error */
-       }
-       break;
-
-    case 'H': /* Syncpipe I/O error */
-       /* No ACK syncpipe is down just exit */
-        put_syncpipe_fault_result(handle);
-       break;
-
-    case 'X':
-       /*
-        * Pipe read error: Communications is severed at least
-        * back to us.  We send a blind 'Q' (quit) and we don't
-        * wait for a response...
-        */
-       syncpipe_put('Q', 0);                   /* ACK error */
-       error("error [communications pipe from writer severed]");
-       /*NOTREACHED*/
-
-    default:
-       q = squotef("[syncpipe sequence fault: Expected 'S' or 'E']");
-       putresult(TAPE_ERROR, "<nohandle> %s\n", q);
-       log_add(L_ERROR, "no-tape %s]", q);
-       amfree(q);
-    }
-
-    /* process further driver commands */
-    while (1) {
-       startclock();
-       cmd = getcmd(&cmdargs);
-       if (cmd != QUIT && !tape_started) {
-           error("error [file_reader_side cmd %d without tape ready]", cmd);
-           /*NOTREACHED*/
-       }
-       total_wait = timesadd(total_wait, stopclock());
-
-       switch(cmd) {
-       case PORT_WRITE:
-           /*
-            * PORT-WRITE
-            *   handle
-            *   hostname
-            *   features
-            *   diskname
-            *   level
-            *   datestamp
-            *   splitsize
-            *   split_diskbuffer
-            */
-           mode = MODE_PORT_WRITE;
-           cmdargs.argc++;                     /* true count of args */
-           a = 2;
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: handle]");
-               /*NOTREACHED*/
-           }
-           handle = newstralloc(handle, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: hostname]");
-               /*NOTREACHED*/
-           }
-           hostname = newstralloc(hostname, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: features]");
-               /*NOTREACHED*/
-           }
-           am_release_feature_set(their_features);
-           their_features = am_string_to_feature(cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: diskname]");
-               /*NOTREACHED*/
-           }
-           qdiskname = newstralloc(qdiskname, cmdargs.argv[a++]);
-           if (diskname != NULL)
-               amfree(diskname);
-           diskname = unquote_string(qdiskname);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: level]");
-               /*NOTREACHED*/
-           }
-           level = atoi(cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: datestamp]");
-               /*NOTREACHED*/
-           }
-           datestamp = newstralloc(datestamp, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: splitsize]");
-               /*NOTREACHED*/
-           }
-           splitsize = OFF_T_ATOI(cmdargs.argv[a++]);
-           if (SIZEOF_OFF_T == 4 && splitsize > 1048576) { /* 1G in 32 bits */
-               splitsize = 1048576;
-           }
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: split_diskbuffer]");
-               /*NOTREACHED*/
-           }
-           split_diskbuffer = newstralloc(split_diskbuffer, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper PORT-WRITE: not enough args: fallback_splitsize]");
-               /*NOTREACHED*/
-           }
-           /* Must fit in memory... */
-           fallback_splitsize = (size_t)atoi(cmdargs.argv[a++]);
-           if (SIZEOF_OFF_T == 4 && fallback_splitsize > 1048576) { /* 1G */
-               fallback_splitsize = 1048576;
-           }
-
-           if (a != cmdargs.argc) {
-               error("error [taper file_reader_side PORT-WRITE: too many args: %d != %d]",
-                     cmdargs.argc, a);
-               /*NOTREACHED*/
-           }
-
-           if (fallback_splitsize < 128 ||
-               fallback_splitsize > 64 * 1024 * 1024) {
-               error("error [bad value for fallback_splitsize]");
-               /*NOTREACHED*/
-           }
-           snprintf(level_str, SIZEOF(level_str), "%d", level);
-           id_string = newvstralloc(id_string, hostname, ":", qdiskname, ".",
-                                    level_str, NULL);
-
-           create_split_buffer(split_diskbuffer, fallback_splitsize, id_string);
-           amfree(id_string);
-
-           data_port = 0;
-           data_socket = stream_server(&data_port, 0, STREAM_BUFSIZE, 0);      
-           if (data_socket < 0) {
-               char *m;
-
-               m = vstralloc("[port create failure: ",
-                             strerror(errno),
-                             "]",
-                             NULL);
-               q = squote(m);
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-               amfree(m);
-               amfree(q);
-               break;
-           }
-           putresult(PORT, "%d\n", data_port);
-
-           if ((fd = stream_accept(data_socket, CONNECT_TIMEOUT,
-                                  0, STREAM_BUFSIZE)) == -1) {
-               q = squote("[port connect timeout]");
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-               aclose(data_socket);
-               amfree(q);
-               break;
-           }
-           expected_splits = -1;
-
-           while(read_file(fd, handle, hostname, qdiskname, datestamp, level))
-               (void)fd;  /* Quiet lint */
-
-           aclose(data_socket);
-           break;
-
-       case FILE_WRITE:
-           /*
-            * FILE-WRITE
-            *   handle
-            *   filename
-            *   hostname
-            *   features
-            *   diskname
-            *   level
-            *   datestamp
-            *   splitsize
-            */
-           mode = MODE_FILE_WRITE;
-           cmdargs.argc++;                     /* true count of args */
-           a = 2;
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: handle]");
-               /*NOTREACHED*/
-           }
-           handle = newstralloc(handle, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: filename]");
-               /*NOTREACHED*/
-           }
-           qfilename = newstralloc(qfilename, cmdargs.argv[a++]);
-           if (filename != NULL)
-               amfree(filename);
-           filename = unquote_string(qfilename);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: hostname]");
-               /*NOTREACHED*/
-           }
-           hostname = newstralloc(hostname, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: features]");
-               /*NOTREACHED*/
-           }
-           am_release_feature_set(their_features);
-           their_features = am_string_to_feature(cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: diskname]");
-               /*NOTREACHED*/
-           }
-           qdiskname = newstralloc(qdiskname, cmdargs.argv[a++]);
-           if (diskname != NULL)
-               amfree(diskname);
-           diskname = unquote_string(qdiskname);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: level]");
-               /*NOTREACHED*/
-           }
-           level = atoi(cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: datestamp]");
-               /*NOTREACHED*/
-           }
-           datestamp = newstralloc(datestamp, cmdargs.argv[a++]);
-
-           if (a >= cmdargs.argc) {
-               error("error [taper FILE-WRITE: not enough args: splitsize]");
-               /*NOTREACHED*/
-           }
-           splitsize = OFF_T_ATOI(cmdargs.argv[a++]);
-
-           if (a != cmdargs.argc) {
-               error("error [taper file_reader_side FILE-WRITE: too many args: %d != %d]",
-                     cmdargs.argc, a);
-               /*NOTREACHED*/
-           }
-           if (holdfile_name != NULL) {
-               filename = newstralloc(filename, holdfile_name);
-           }
-
-           if ((expected_splits = predict_splits(filename)) < 0) {
-               break;
-           }
-           if (stat(filename, &stat_file)!=0) {
-               q = squotef("[%s]", strerror(errno));
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-               amfree(q);
-               break;
-           }
-           if ((fd = open(filename, O_RDONLY)) == -1) {
-               q = squotef("[%s]", strerror(errno));
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-               amfree(q);
-               break;
-           }
-           holdfile_path = stralloc(filename);
-           holdfile_path_thischunk = stralloc(filename);
-           holdfile_offset_thischunk = (off_t)0;
-
-           while (read_file(fd,handle,hostname,qdiskname,datestamp,level)) {
-               if (splitsize > (off_t)0 && holdfile_path_thischunk)
-                   filename = newstralloc(filename, holdfile_path_thischunk);
-               if ((fd = open(filename, O_RDONLY)) == -1) {
-                   q = squotef("[%s]", strerror(errno));
-                   putresult(TAPE_ERROR, "%s %s\n", handle, q);
-                   amfree(q);
-                   break;
-               }
-           }
-           break;
-
-       case QUIT:
-           putresult(QUITTING, "\n");
-           fprintf(stderr,"taper: DONE [idle wait: %s secs]\n",
-                   walltime_str(total_wait));
-           fflush(stderr);
-           (void)syncpipe_put('Q', 0); /* tell writer we're exiting gracefully */
-           aclose(wrpipe);
-
-           if ((wpid = wait(NULL)) != writerpid) {
-               dbprintf(("taper: writer wait returned %u instead of %u: %s\n",
-                       (unsigned)wpid, (unsigned)writerpid, strerror(errno)));
-               fprintf(stderr,
-                       "taper: writer wait returned %u instead of %u: %s\n",
-                       (unsigned)wpid, (unsigned)writerpid, strerror(errno));
-               fflush(stderr);
-           }
-
-           free_split_buffer();
-           amfree(datestamp);
-           clear_tapelist();
-           amfree(taper_timestamp);
-           amfree(label);
-           amfree(errstr);
-           amfree(changer_resultstr);
-           amfree(tapedev);
-           amfree(filename);
-           amfree(conf_tapelist);
-           amfree(config_dir);
-           amfree(config_name);
-           amfree(holdfile_name);
-
-           malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-           if (malloc_size_1 != malloc_size_2) {
-               malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-           }
-           exit(0);
-           /*NOTREACHED*/
-
-       default:
-           if (cmdargs.argc >= 1) {
-               q = squote(cmdargs.argv[1]);
-           } else if (cmdargs.argc >= 0) {
-               q = squote(cmdargs.argv[0]);
-           } else {
-               q = stralloc("(no input?)");
-           }
-           putresult(BAD_COMMAND, "%s\n", q);
-           amfree(q);
-           break;
-       }
-    }
-    /* NOTREACHED */
-}
-
-void
-dumpbufs(
-    char *str1)
-{
-    int i,j;
-    long v;
-
-    fprintf(stderr, "%s: state", str1);
-    for (i = j = 0; i < conf_tapebufs; i = j+1) {
-       v = buftable[i].status;
-       for(j = i; j < conf_tapebufs && buftable[j].status == v; j++)
-           (void)j; /* Quiet lint */
-       j--;
-       if (i == j) {
-           fprintf(stderr, " %d:", i);
-       } else {
-           fprintf(stderr, " %d-%d:", i, j);
-       }
-       switch(v) {
-       case FULL:
-           fputc('F', stderr);
-           break;
-
-       case FILLING:
-           fputc('f', stderr);
-           break;
-
-       case EMPTY:
-           fputc('E', stderr);
-           break;
-
-       default:
-           fprintf(stderr, "%ld", v);
-           break;
-       }
-    }
-    fputc('\n', stderr);
-    fflush(stderr);
-}
-
-void
-dumpstatus(
-    buffer_t *bp)
-{
-    char pn[2];
-    char bt[NUM_STR_SIZE];
-    char status[NUM_STR_SIZE + 1];
-    char *str = NULL;
-
-    pn[0] = procname[0];
-    pn[1] = '\0';
-    snprintf(bt, SIZEOF(bt), "%d", (int)(bp-buftable));
-
-    switch(bp->status) {
-    case FULL:
-       snprintf(status, SIZEOF(status), "F" SIZE_T_FMT,
-               (SIZE_T_FMT_TYPE)bp->size);
-       break;
-
-    case FILLING:
-       snprintf(status, SIZEOF(status), "f");
-       break;
-
-    case EMPTY:
-       snprintf(status, SIZEOF(status), "E");
-       break;
-
-    default:
-       snprintf(status, SIZEOF(status), "%ld", bp->status);
-       break;
-    }
-
-    str = vstralloc("taper: ", pn, ": [buf ", bt, ":=", status, "]", NULL);
-    dumpbufs(str);
-    amfree(str);
-}
-
-/*
-  Handle moving to the next chunk of holding file, if any.  Returns -1 for
-  errors, 0 if there's no more file, or a positive integer for the amount of
-  stuff read that'll go into 'rc' (XXX That's fugly, maybe that should just
-  be another global.  What is rc anyway, 'read count?' I keep thinking it
-  should be 'return code')
-*/
-ssize_t
-get_next_holding_file(
-    int fd,
-    buffer_t *bp,
-    char **strclosing,
-    size_t rc)
-{
-    int save_fd;
-    ssize_t rc1;
-    struct stat stat_file;
-    ssize_t ret = -1;
-    
-    save_fd = fd;
-    close(fd);
-    
-    /* see if we're fresh out of file */
-    if (file.cont_filename[0] == '\0') {
-       err = 0;
-       ret = 0;
-    } else if (stat(file.cont_filename, &stat_file) != 0) {
-       err = errno;
-       ret = -1;
-       *strclosing = newvstralloc(*strclosing, "can't stat: ",
-                                  file.cont_filename, NULL);
-    } else if ((fd = open(file.cont_filename,O_RDONLY)) == -1) {
-       err = errno;
-       ret = -1;
-       *strclosing = newvstralloc(*strclosing, "can't open: ",
-                                  file.cont_filename, NULL);
-    } else if ((fd != save_fd) && dup2(fd, save_fd) == -1) {
-       err = errno;
-       ret = -1;
-       *strclosing = newvstralloc(*strclosing, "can't dup2: ",
-                                  file.cont_filename, NULL);
-    } else {
-       buffer_t bp1;
-       char *quoted;
-
-       holdfile_path = stralloc(file.cont_filename);
-       quoted = quote_string(holdfile_path);
-       fprintf(stderr, "taper: r: switching to next holding chunk '%s'\n",
-               quoted); 
-       amfree(quoted);
-       num_holdfile_chunks++;
-       
-       bp1.status = EMPTY;
-       bp1.size = DISK_BLOCK_BYTES;
-       bp1.buffer = alloc(DISK_BLOCK_BYTES);
-       
-       if (fd != save_fd) {
-           close(fd);
-           fd = save_fd;
-       }
-       
-       rc1 = taper_fill_buffer(fd, &bp1, DISK_BLOCK_BYTES);
-       if (rc1 <= 0) {
-           amfree(bp1.buffer);
-           err = (rc1 < 0) ? errno : 0;
-           ret = -1;
-           *strclosing = newvstralloc(*strclosing,
-                                      "Can't read header: ",
-                                      file.cont_filename,
-                                      NULL);
-       } else {
-           parse_file_header(bp1.buffer, &file, (size_t)rc1);
-           
-           amfree(bp1.buffer);
-           bp1.buffer = bp->buffer + rc;
-           
-           rc1 = taper_fill_buffer(fd, &bp1, (size_t)tt_blocksize - rc);
-           if (rc1 <= 0) {
-               err = (rc1 < 0) ? errno : 0;
-               ret = -1;
-               if (rc1 < 0) {
-                   *strclosing = newvstralloc(*strclosing,
-                                              "Can't read data: ",
-                                              file.cont_filename,
-                                              NULL);
-               }
-           } else {
-               ret = rc1;
-               num_holdfiles++;
-           }
-       }
-    }
-
-    return(ret);
-}
-
-
-int
-read_file(
-    int                fd,
-    char *     handle,
-    char *     hostname,
-    char *     qdiskname,
-    char *     datestamp,
-    int                level)
-{
-    buffer_t *bp;
-    int tok;
-    ssize_t rc;
-#ifdef ASSERTIONS
-    int opening;
-#endif
-    int closing, bufnum, need_closing, nexting;
-    off_t filesize;
-    times_t runtime;
-    char *strclosing = NULL;
-    char seekerrstr[STR_SIZE];
-    char *str;
-    int header_written = 0;
-    size_t buflen;
-    dumpfile_t first_file;
-    dumpfile_t cur_holdfile;
-    off_t kbytesread = (off_t)0;
-    int header_read = 0;
-    char *cur_filename = NULL;
-    int retry_from_splitbuf = 0;
-    char *splitbuf_rd_ptr = NULL;
-    char *q = NULL;
-
-#ifdef HAVE_LIBVTBLC
-    static char desc[45];
-    static char vol_date[20];
-    static char vol_label[45];
-#endif /* HAVE_LIBVTBLC */
-
-
-    /* initialize */
-    memset(&first_file, 0, SIZEOF(first_file));
-    memset(&cur_holdfile, 0, SIZEOF(cur_holdfile));
-
-    filesize = (off_t)0;
-    closing = 0;
-    need_closing = 0;
-    nexting = 0;
-    err = 0;
-
-    /* don't break this if we're still on the same file as a previous init */
-    if (cur_span_chunkstart <= (off_t)0) {
-       fh_init(&file);
-       header_read = 0;
-    } else if(mode == MODE_FILE_WRITE){
-       memcpy(&file, save_holdfile, SIZEOF(dumpfile_t));
-       memcpy(&cur_holdfile, save_holdfile, SIZEOF(dumpfile_t));
-    }
-
-    taper_debug(1, ("taper: r: start file\n"));
-
-    for (bp = buftable; bp < buftable + conf_tapebufs; bp++) {
-       bp->status = EMPTY;
-    }
-
-    bp = buftable;
-    if (interactive || debug_taper >= 1)
-       dumpstatus(bp);
-
-    if ((cur_span_chunkstart >= (off_t)0) && (splitsize > (off_t)0)) {
-        /* We're supposed to start at some later part of the file, not read the
-          whole thing. "Seek" forward to where we want to be. */
-       if (label)
-           putresult(SPLIT_CONTINUE, "%s %s\n", handle, label);
-        if ((mode == MODE_FILE_WRITE) && (cur_span_chunkstart > (off_t)0)) {
-           char *quoted = quote_string(holdfile_path_thischunk);
-           fprintf(stderr, "taper: r: seeking %s to " OFF_T_FMT " kb\n",
-                           quoted,
-                           (OFF_T_FMT_TYPE)holdfile_offset_thischunk);
-           fflush(stderr);
-
-           if (holdfile_offset_thischunk > maxseek) {
-               snprintf(seekerrstr, SIZEOF(seekerrstr), "Can't seek by "
-                       OFF_T_FMT " kb (compiled for %d-bit file offsets), "
-                       "recompile with large file support or "
-                       "set holdingdisk chunksize to <" OFF_T_FMT " Mb",
-                       (OFF_T_FMT_TYPE)holdfile_offset_thischunk,
-                       (int)(sizeof(off_t) * 8),
-                       (OFF_T_FMT_TYPE)(maxseek/(off_t)1024));
-               log_add(L_ERROR, "%s", seekerrstr);
-               fprintf(stderr, "taper: r: FATAL: %s\n", seekerrstr);
-               fflush(stderr);
-               if (syncpipe_put('X', 0) == -1) {
-                       put_syncpipe_fault_result(handle);
-               }
-               amfree(quoted);
-               return -1;
-           }
-           if (lseek(fd, holdfile_offset_thischunk*(off_t)1024, SEEK_SET) == (off_t)-1) {
-               fprintf(stderr, "taper: r: FATAL: seek_holdfile lseek error "
-                       "while seeking into %s by "
-                       OFF_T_FMT "kb: %s\n", quoted,
-                       (OFF_T_FMT_TYPE)holdfile_offset_thischunk,
-                       strerror(errno));
-               fflush(stderr);
-               if (syncpipe_put('X', 0) == -1) {
-                       put_syncpipe_fault_result(handle);
-               }
-               amfree(quoted);
-               return -1;
-           }
-           amfree(quoted);
-        } else if (mode == MODE_PORT_WRITE) {
-           fprintf(stderr, "taper: r: re-reading split dump piece from buffer\n");
-           fflush(stderr);
-           retry_from_splitbuf = 1;
-           splitbuf_rd_ptr = splitbuf;
-           if (splitbuf_rd_ptr >= splitbuf_wr_ptr)
-               retry_from_splitbuf = 0;
-        }
-        if (cur_span_chunkstart > (off_t)0)
-           header_read = 1; /* really initialized in prior run */
-    }
-
-    /* tell writer to open tape */
-
-#ifdef ASSERTIONS
-    opening = 1;
-#endif
-
-    if (syncpipe_put('O', 0) == -1) {
-       put_syncpipe_fault_result(handle);
-       return -1;
-    }
-    if (syncpipe_putstr(datestamp) == -1) {
-       put_syncpipe_fault_result(handle);
-       return -1;
-    }
-    if (syncpipe_putstr(hostname) == -1) {
-       put_syncpipe_fault_result(handle);
-       return -1;
-    }
-    if (syncpipe_putstr(qdiskname) == -1) {
-       put_syncpipe_fault_result(handle);
-       return -1;
-    }
-    if (syncpipe_putint(level) == -1) {
-       put_syncpipe_fault_result(handle);
-       return -1;
-    }
-
-    startclock();
-    
-    /* read file in loop */
-    
-    while (1) {
-       if ((tok = syncpipe_get(&bufnum)) == -1) {
-           put_syncpipe_fault_result(handle);
-           return -1;
-       }
-
-       switch(tok) {
-       case 'O':
-#ifdef ASSERTIONS
-           assert(opening);
-           opening = 0;
-#endif
-           err = 0;
-           break;
-           
-       case 'R':
-           taper_debug(1, ("taper: r: got R%d\n", bufnum));
-           
-           if (need_closing) {
-               if (syncpipe_put('C', 0) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               closing = 1;
-               need_closing = 0;
-               break;
-           }
-           
-           if (closing)
-               break;  /* ignore extra read tokens */
-           
-#ifdef ASSERTIONS
-           assert(!opening);
-#endif
-           if(bp->status != EMPTY || bufnum != (int)(bp - buftable)) {
-               /* XXX this SHOULD NOT HAPPEN.  Famous last words. */
-               fprintf(stderr,"taper: panic: buffer mismatch at ofs "
-                       OFF_T_FMT ":\n", (OFF_T_FMT_TYPE)filesize);
-               if(bufnum != (int)(bp - buftable)) {
-                   fprintf(stderr, "    my buf %d but writer buf %d\n",
-                           (int)(bp-buftable), bufnum);
-               } else {
-                   fprintf(stderr,"buf %d state %s (%ld) instead of EMPTY\n",
-                           (int)(bp-buftable),
-                           bp->status == FILLING? "FILLING" :
-                           bp->status == FULL? "FULL" : "EMPTY!?!?",
-                           (long)bp->status);
-               }
-               dumpbufs("taper");
-               sleep(1);
-               dumpbufs("taper: after 1 sec");
-               if (bp->status == EMPTY)
-                   fprintf(stderr, "taper: result now correct!\n");
-               fflush(stderr);
-               
-               errstr = newstralloc(errstr,
-                                    "[fatal buffer mismanagement bug]");
-               q = squote(errstr);
-               putresult(TRYAGAIN, "%s %s\n", handle, q);
-               cur_span_chunkstart = (off_t)0;
-               amfree(q);
-               log_add(L_INFO, "retrying %s:%s.%d on new tape due to: %s",
-                       hostname, qdiskname, level, errstr);
-               closing = 1;
-               if (syncpipe_put('X', 0) == -1) {/* X == buffer snafu, bail */
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               do {
-                   if ((tok = syncpipe_get(&bufnum)) == -1) {
-                       put_syncpipe_fault_result(handle);
-                       return (-1);
-                   }
-               } while (tok != 'x');
-               aclose(fd);
-               return -1;
-           } /* end 'if (bf->status != EMPTY || bufnum != (int)(bp-buftable))' */
-
-           bp->status = FILLING;
-           buflen = header_read ? (size_t)tt_blocksize : DISK_BLOCK_BYTES;
-           if (interactive || debug_taper >= 1)
-               dumpstatus(bp);
-           if (header_written == 0 &&
-                       (header_read == 1 || cur_span_chunkstart > (off_t)0)) {
-               /* for split dumpfiles, modify headers for the second - nth
-                  pieces that signify that they're continuations of the last
-                  normal one */
-               char *cont_filename;
-               file.type = F_SPLIT_DUMPFILE;
-               file.partnum = num_splits + 1;
-               file.totalparts = expected_splits;
-                cont_filename = stralloc(file.cont_filename);
-               file.cont_filename[0] = '\0';
-               build_header(bp->buffer, &file, tt_blocksize);
-  
-               if (cont_filename[0] != '\0') {
-                 file.type = F_CONT_DUMPFILE;
-                   strncpy(file.cont_filename, cont_filename,
-                           SIZEOF(file.cont_filename));
-                       }
-               memcpy(&cur_holdfile, &file, SIZEOF(dumpfile_t));
-  
-               if (interactive || debug_taper >= 1)
-                   dumpstatus(bp);
-               bp->size = (ssize_t)tt_blocksize;
-               rc = (ssize_t)tt_blocksize;
-               header_written = 1;
-               amfree(cont_filename);
-           } else if (retry_from_splitbuf) {
-               /* quietly pull dump data from our in-memory cache, and the
-                  writer side need never know the wiser */
-               memcpy(bp->buffer, splitbuf_rd_ptr, tt_blocksize);
-               bp->size = (ssize_t)tt_blocksize;
-               rc = (ssize_t)tt_blocksize;
-               splitbuf_rd_ptr += tt_blocksize;
-               if (splitbuf_rd_ptr >= splitbuf_wr_ptr)
-                   retry_from_splitbuf = 0;
-           } else if ((rc = taper_fill_buffer(fd, bp, buflen)) < 0) {
-               err = errno;
-               closing = 1;
-               strclosing = newvstralloc(strclosing,"Can't read data: ",
-                                         NULL);
-               if (syncpipe_put('C', 0) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-           }
-  
-           if (!closing) {
-               if (rc < (ssize_t)buflen) { /* switch to next holding file */
-                   ssize_t ret;
-
-                   if (file.cont_filename[0] != '\0') {
-                       cur_filename = newvstralloc(cur_filename, file.cont_filename, NULL);
-                   }
-                   ret = get_next_holding_file(fd, bp, &strclosing, (size_t)rc);
-                   if (ret <= 0) {
-                       need_closing = 1;
-                   } else {
-                       memcpy(&cur_holdfile, &file, SIZEOF(dumpfile_t));
-                       rc += ret;
-                       bp->size = rc;
-                   }
-               }
-               if (rc > 0) {
-                   bp->status = FULL;
-                   /* rebuild the header block, which might have CONT junk */
-                   if (header_read == 0) {
-                       char *cont_filename;
-                       /* write the "real" filename if the holding-file
-                          is a partial one */
-                       parse_file_header(bp->buffer, &file, (size_t)rc);
-                       parse_file_header(bp->buffer, &first_file, (size_t)rc);
-                       cont_filename = stralloc(file.cont_filename);
-                       file.cont_filename[0] = '\0';
-                       if (splitsize > (off_t)0) {
-                           file.type = F_SPLIT_DUMPFILE;
-                           file.partnum = 1;
-                           file.totalparts = expected_splits;
-                       }
-                       file.blocksize = tt_blocksize;
-                       build_header(bp->buffer, &file, tt_blocksize);
-                       file.type = F_CONT_DUMPFILE;
-                       /* add CONT_FILENAME back to in-memory header */
-                       strncpy(file.cont_filename, cont_filename, 
-                               SIZEOF(file.cont_filename));
-                       if (interactive || debug_taper >= 1)
-                           dumpstatus(bp);
-                       bp->size = (ssize_t)tt_blocksize; /* output a full tape block */
-                       /* save the header, we'll need it if we jump tapes */
-                       memcpy(&cur_holdfile, &file, SIZEOF(dumpfile_t));
-                       header_read = 1;
-                       header_written = 1;
-                       amfree(cont_filename);
-                   } else {
-                       filesize = kbytesread;
-                   }
-
-                   taper_debug(1, ("taper: r: put W%d\n",
-                                   (int)(bp-buftable)));
-                   if (syncpipe_put('W', (int)(bp-buftable)) == -1) {
-                       put_syncpipe_fault_result(handle);
-                       return (-1);
-                   }
-                   bp = nextbuf(bp);
-               }
-
-               if (((kbytesread + (off_t)(DISK_BLOCK_BYTES/1024)) >= splitsize)
-                       && (splitsize > (off_t)0) && !need_closing) {
-
-                   if (mode == MODE_PORT_WRITE) {
-                       splitbuf_wr_ptr = splitbuf;
-                       splitbuf_rd_ptr = splitbuf;
-                       memset(splitbuf, 0, SIZEOF(splitbuf));
-                       retry_from_splitbuf = 0;
-                   }
-
-                   fprintf(stderr,"taper: r: end %s.%s.%s.%d part %d, "
-                               "splitting chunk that started at "
-                               OFF_T_FMT "kb after " OFF_T_FMT
-                               "kb (next chunk will start at "
-                               OFF_T_FMT "kb)\n",
-                               hostname, qdiskname, datestamp, level,
-                               num_splits+1,
-                               (OFF_T_FMT_TYPE)cur_span_chunkstart,
-                               (OFF_T_FMT_TYPE)kbytesread,
-                               (OFF_T_FMT_TYPE)(cur_span_chunkstart+kbytesread));
-                   fflush(stderr);
-
-                   nexting = 1;
-                   need_closing = 1;
-               } /* end '(kbytesread >= splitsize && splitsize > 0)' */
-               if (need_closing && rc <= 0) {
-                   if (syncpipe_put('C', 0) == -1) {
-                       put_syncpipe_fault_result(handle);
-                       return (-1);
-                   }
-                   need_closing = 0;
-                   closing = 1;
-               }
-                kbytesread += (off_t)(rc / 1024);
-           } /* end the 'if (!closing)' (successful buffer fill) */
-           break;
-
-       case 'T':
-       case 'E':
-       case 'H':
-           if (syncpipe_put('e', 0) == -1) {   /* ACK error */
-               put_syncpipe_fault_result(handle);
-               return (-1);
-           }
-
-           if ((str = syncpipe_getstr()) == NULL) {
-               put_syncpipe_fault_result(handle);
-               return (-1);
-           }
-           
-           errstr = newvstralloc(errstr, "[", str, "]", NULL);
-           amfree(str);
-
-           q = squote(errstr);
-           if (tok == 'T') {
-               if (splitsize > (off_t)0) {
-                   /* we'll be restarting this chunk on the next tape */
-                   if (mode == MODE_FILE_WRITE) {
-                     aclose(fd);
-                   }
-
-                   putresult(SPLIT_NEEDNEXT, "%s " OFF_T_FMT "\n", handle,
-                               (OFF_T_FMT_TYPE)cur_span_chunkstart);
-                   log_add(L_INFO, "continuing %s:%s.%d on new tape from "
-                               OFF_T_FMT "kb mark: %s",
-                               hostname, qdiskname, level,
-                               (OFF_T_FMT_TYPE)cur_span_chunkstart, errstr);
-                   return 1;
-               } else {
-                   /* restart the entire dump (failure propagates to driver) */
-                   aclose(fd);
-                   putresult(TRYAGAIN, "%s %s\n", handle, q);
-                   cur_span_chunkstart = (off_t)0;
-                   log_add(L_INFO, "retrying %s:%s.%d on new tape due to: %s",
-                           hostname, qdiskname, level, errstr);
-               }
-           } else {
-               aclose(fd);
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-               log_add(L_FAIL, "%s %s %s %d [out of tape]",
-                       hostname, qdiskname, datestamp, level);
-               log_add(L_ERROR,"no-tape [%s]", "No more writable valid tape found");
-           }
-           amfree(q);
-           return 0;
-
-       case 'C':
-#ifdef ASSERTIONS
-           assert(!opening);
-#endif
-           assert(closing);
-
-           if (nexting) {
-             cur_span_chunkstart += kbytesread; /* XXX possibly wrong */
-             if (cur_filename)
-               holdfile_name = newvstralloc(holdfile_name, cur_filename,
-                                            NULL);
-             else
-               amfree(holdfile_name);
-
-             kbytesread = (off_t)0;
-             amfree(cur_filename);
-           }
-
-           if ((str = syncpipe_getstr()) == NULL) {
-               put_syncpipe_fault_result(handle);
-               return (-1);
-           }
-
-           label = newstralloc(label, str ? str : "(null)");
-           amfree(str);
-           if ((str = syncpipe_getstr()) == NULL) {
-               put_syncpipe_fault_result(handle);
-               return (-1);
-           }
-
-           filenum = atoi(str ? str : "-9876");        /* ??? */
-           amfree(str);
-           fprintf(stderr, "taper: reader-side: got label %s filenum %d\n",
-                   label, filenum);
-           fflush(stderr);
-
-           /* we'll need that file descriptor if we're gonna write more */
-           if (!nexting) {
-               aclose(fd);
-           }
-
-           runtime = stopclock();
-           if (nexting)
-               startclock();
-           if (err) {
-               if (strclosing) {
-                   errstr = newvstralloc(errstr,
-                                         "[input: ", strclosing, ": ",
-                                         strerror(err), "]", NULL);
-                   amfree(strclosing);
-               } else
-                   errstr = newvstralloc(errstr,
-                                         "[input: ", strerror(err), "]",
-                                         NULL);
-               q = squote(errstr);
-               putresult(TAPE_ERROR, "%s %s\n", handle, q);
-
-               amfree(q);
-               if (splitsize != (off_t)0) {
-                   log_add(L_FAIL, "%s %s %s.%d %d %s", hostname, qdiskname,
-                               datestamp, num_splits, level, errstr);
-               } else {
-                   log_add(L_FAIL, "%s %s %s %d %s",
-                               hostname, qdiskname, datestamp, level, errstr);
-               }
-               if ((str = syncpipe_getstr()) == NULL) {        /* reap stats */
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               amfree(str);
-                amfree(errstr);
-           } else {
-               char kb_str[NUM_STR_SIZE];
-               char kps_str[NUM_STR_SIZE];
-               double rt;
-
-               rt = (double)(runtime.r.tv_sec) +
-                    ((double)(runtime.r.tv_usec) / 1000000.0);
-               curdump_rt = timesadd(runtime, curdump_rt);
-               snprintf(kb_str, SIZEOF(kb_str), OFF_T_FMT,
-                       (OFF_T_FMT_TYPE)filesize);
-               snprintf(kps_str, SIZEOF(kps_str), "%3.1lf",
-                                 (isnormal(rt) ? (double)filesize / rt : 0.0));
-               if ((str = syncpipe_getstr()) == NULL) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               errstr = newvstralloc(errstr,
-                                     "[sec ", walltime_str(runtime),
-                                     " kb ", kb_str,
-                                     " kps ", kps_str,
-                                     " ", str,
-                                     "]",
-                                     NULL);
-               if (splitsize == (off_t)0) { /* Ordinary dump */
-                   q = squote(errstr);
-/*@i@*/                    if (first_file.is_partial) {
-                       putresult(PARTIAL, "%s %s %d %s\n",
-                                 handle, label, filenum, q);
-                       log_add(L_PARTIAL, "%s %s %s %d %s",
-                               hostname, qdiskname, datestamp, level, errstr);
-                   } else {
-                       putresult(DONE, "%s %s %d %s\n",
-                                 handle, label, filenum, q);
-                       log_add(L_SUCCESS, "%s %s %s %d %s",
-                               hostname, qdiskname, datestamp, level, errstr);
-                   }
-                   amfree(q);
-               } else { /* Chunked dump */
-                   num_splits++;
-                   if (mode == MODE_FILE_WRITE) {
-                       holdfile_path_thischunk = stralloc(holdfile_path);
-                       holdfile_offset_thischunk = (lseek(fd, (off_t)0, SEEK_CUR))/(off_t)1024;
-                       if(!save_holdfile){
-                           save_holdfile = alloc(SIZEOF(dumpfile_t));
-                       }
-                       memcpy(save_holdfile, &cur_holdfile,SIZEOF(dumpfile_t));
-                   }
-                   log_add(L_CHUNK, "%s %s %s %d %d %s", hostname, qdiskname,
-                           datestamp, num_splits, level, errstr);
-                   if (!nexting) { /* split dump complete */
-                       rt = (double)(curdump_rt.r.tv_sec) +
-                            ((double)(curdump_rt.r.tv_usec) / 1000000.0);
-                       snprintf(kb_str, SIZEOF(kb_str), OFF_T_FMT,
-                               (OFF_T_FMT_TYPE)(filesize + cur_span_chunkstart));
-                       snprintf(kps_str, SIZEOF(kps_str), "%3.1lf",
-                           isnormal(rt) ?
-                           ((double)(filesize+cur_span_chunkstart)) / rt :
-                           0.0);
-                        amfree(errstr);
-                       errstr = newvstralloc(errstr,
-                                             "[sec ", walltime_str(curdump_rt),
-                                             " kb ", kb_str,
-                                             " kps ", kps_str,
-                                             " ", str,
-                                             "]",
-                                             NULL);
-                        q = squote(errstr);
-                       putresult(DONE, "%s %s %d %s\n", handle, label,
-                                 filenum, q);
-                       log_add(L_CHUNKSUCCESS, "%s %s %s %d %s",
-                               hostname, qdiskname, datestamp, level, errstr);
-                       amfree(save_holdfile);
-                       amfree(holdfile_path_thischunk);
-                        amfree(q);
-                   }
-               }
-               amfree(str);
-
-               if (!nexting) {
-                   num_splits = 0;
-                   expected_splits = 0;
-                   amfree(holdfile_name);
-                   num_holdfiles = 0;
-                   cur_span_chunkstart = (off_t)0;
-                   curdump_rt = times_zero;
-               }
-               amfree(errstr);
-               
-#ifdef HAVE_LIBVTBLC
-               /* 
-                *  We have 44 characters available for the label string:
-                *  use max 20 characters for hostname
-                *      max 20 characters for diskname 
-                *             (it could contain a samba share or dos path)
-                *           2 for level
-                */
-               memset(desc, '\0', 45);
-
-               strncpy(desc, hostname, 20);
-
-               if ((len = strlen(hostname)) <= 20) {
-                   memset(desc + len, ' ', 1);
-                   offset = len + 1;
-               } else {
-                   memset(desc + 20, ' ', 1);
-                   offset = 21;
-               }
-
-               strncpy(desc + offset, qdiskname, 20);
-
-               if ((len = strlen(qdiskname)) <= 20) {
-                   memset(desc + offset + len, ' ', 1);
-                   offset = offset + len + 1;
-               } else {
-                   memset(desc + offset + 20, ' ', 1);
-                   offset = offset + 21;
-               }
-
-               sprintf(desc + offset, "%i", level);
-
-               strncpy(vol_label, desc, 44);
-               fprintf(stderr, "taper: added vtbl label string %i: \"%s\"\n",
-                       filenum, vol_label);
-               fflush(stderr);
-
-               /* pass label string on to tape writer */
-               if (syncpipe_put('L', filenum) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               if (syncpipe_putstr(vol_label) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-
-               /* 
-                * reformat datestamp for later use with set_date from vtblc 
-                */
-               strptime(datestamp, "%Y%m%d", &backup_time);
-               strftime(vol_date, 20, "%T %D", &backup_time);
-               fprintf(stderr, 
-                       "taper: reformatted vtbl date string: \"%s\"->\"%s\"\n",
-                       datestamp,
-                       vol_date);
-
-               /* pass date string on to tape writer */                
-               if (syncpipe_put('D', filenum) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-               if (syncpipe_putstr(vol_date) == -1) {
-                   put_syncpipe_fault_result(handle);
-                   return (-1);
-               }
-
-#endif /* HAVE_LIBVTBLC */
-           }
-           /* reset stuff that assumes we're on a new file */
-
-           if (!nexting)
-               return 0;
-
-#ifdef ASSERTIONS
-           opening = 1;
-#endif
-           nexting = 0;
-           closing = 0;
-           filesize = (off_t)0;
-           if (syncpipe_put('O', 0) == -1) {
-               put_syncpipe_fault_result(handle);
-               return -1;
-           }
-           if (syncpipe_putstr(datestamp) == -1) {
-               put_syncpipe_fault_result(handle);
-               return -1;
-           }
-           if (syncpipe_putstr(hostname) == -1) {
-               put_syncpipe_fault_result(handle);
-               return -1;
-           }
-           if (syncpipe_putstr(qdiskname) == -1) {
-               put_syncpipe_fault_result(handle);
-               return -1;
-           }
-           if (syncpipe_putint(level) == -1) {
-               put_syncpipe_fault_result(handle);
-               return -1;
-           }
-           for (bp = buftable; bp < buftable + conf_tapebufs; bp++) {
-               bp->status = EMPTY;
-           }
-           bp = buftable;
-           header_written = 0;
-           break;
-
-       case 'X':
-           /*
-            * Pipe read error: Communications is severed at least
-            * back to us.  We send a blind 'Q' (quit) and we don't
-            * wait for a response...
-            */
-           syncpipe_put('Q', 0);                       /* ACK error */
-           fprintf(stderr, "taper: communications pipe from reader severed\n");
-           return -1;
-
-       default:
-           q = squotef("[Taper syncpipe protocol error]");
-           putresult(TAPE_ERROR, "%s %s\n", handle, q);
-           log_add(L_ERROR, "tape-error %s %s", handle, q);
-           amfree(q);
-           return -1;
-       }
-    }
-    return 0;
-}
-
-ssize_t
-taper_fill_buffer(
-    int fd,
-    buffer_t *bp,
-    size_t buflen)
-{
-    char *curptr;
-    ssize_t cnt;
-
-    curptr = bp->buffer;
-
-    cnt = fullread(fd, curptr, buflen);
-    switch(cnt) {
-    case 0:    /* eof */
-       if (interactive)
-           fputs("r0", stderr);
-       bp->size = 0;
-       return (ssize_t)0;
-       /*NOTREACHED*/
-
-    case -1:   /* error on read, punt */
-       if (interactive)
-           fputs("rE", stderr);
-       bp->size = 0;
-       return -1;
-       /*NOTREACHED*/
-
-    default:
-       if ((mode == MODE_PORT_WRITE) && (splitsize > (off_t)0)) {
-           memcpy(splitbuf_wr_ptr, curptr, (size_t)cnt);
-           splitbuf_wr_ptr += cnt;
-       }
-       bp->size = cnt;
-       break;
-    }
+#include "changer.h"
+#include "clock.h"
+#include "conffile.h"
+#include "device.h"
+#include "logfile.h"
+#include "server_util.h"
+#include "stream.h"
+#include "tapefile.h"
+#include "taperscan.h"
+#include "taper-source.h"
+#include "timestamp.h"
+#include "token.h"
+#include "version.h"
 
-    if (interactive)
-       fputs("R", stderr);
-    return ((ssize_t)bp->size);
+/* FIXME: This should not be here. */
+#define CONNECT_TIMEOUT (2*60)
+
+/* Use this instead of global variables, so that we are reentrant. */
+typedef struct {
+    Device * device;
+    char * driver_start_time;
+    int    cur_tape;
+    char * next_tape_label;
+    char * next_tape_device;
+    taper_scan_tracker_t * taper_scan_tracker;
+} taper_state_t;
+
+typedef struct {
+    char * handle;
+    char * hostname;
+    char * diskname;
+    int level;
+    char * timestamp;
+    char * id_string;
+    TaperSource * source;
+    int current_part;
+    GTimeVal total_time;
+    guint64 total_bytes;
+} dump_info_t;
+
+static gboolean label_new_tape(taper_state_t * state, dump_info_t * dump_info);
+
+static void init_taper_state(taper_state_t* state) {
+    state->device = NULL;
+    state->driver_start_time = NULL;
+    state->taper_scan_tracker = taper_scan_tracker_new();
 }
 
-/* Given a dumpfile in holding, determine its size and figure out how many
- * times we'd have to split it.
- */
-int
-predict_splits(
-    char *filename)
-{
-    int splits = 0;
-    off_t total_kb = (off_t)0;
-    off_t adj_splitsize = splitsize - (off_t)(DISK_BLOCK_BYTES / 1024);
-
-    if (splitsize <= (off_t)0)
-       return(0);
-
-    if (adj_splitsize <= (off_t)0) {
-       error("Split size must be > " OFF_T_FMT "k",
-             (OFF_T_FMT_TYPE)(DISK_BLOCK_BYTES/1024));
-      /*NOTREACHED*/
+static void cleanup(taper_state_t * state) {
+    amfree(state->driver_start_time);
+    amfree(state->next_tape_label);
+    amfree(state->next_tape_device);
+    taper_scan_tracker_free(state->taper_scan_tracker);
+    if (state->device != NULL) {
+        g_object_unref(state->device);
+        state->device = NULL;
     }
+}
 
-    /* should only calculuate this once, not on retries etc */
-    if (expected_splits != 0)
-       return(expected_splits);
-
-    total_kb = holding_file_size(filename, 1);
-    
-    if (total_kb <= (off_t)0) {
-       fprintf(stderr, "taper: r: " OFF_T_FMT
-               " kb holding file makes no sense, setting splitsize to 0\n",
-               (OFF_T_FMT_TYPE)total_kb);
-       fflush(stderr);
-       splitsize = 0;  /* disabling split */
-       return(0);
+static void free_dump_info(dump_info_t * info) {
+    amfree(info->handle);
+    amfree(info->hostname);
+    amfree(info->diskname);
+    amfree(info->timestamp);
+    amfree(info->id_string);
+    if (info->source != NULL) {
+        g_object_unref(info->source);
+        info->source = NULL;
     }
-
-    fprintf(stderr, "taper: r: Total dump size should be " OFF_T_FMT
-               "kb, chunk size is " OFF_T_FMT "kb\n",
-               (OFF_T_FMT_TYPE)total_kb,
-               (OFF_T_FMT_TYPE)splitsize);
-    fflush(stderr);
-
-    splits = (int)(total_kb / adj_splitsize);
-    if ((splits == 0) || (total_kb % adj_splitsize))
-       splits++;
-
-
-    fprintf(stderr, "taper: r: Expecting to split into %d parts \n", splits);
-    fflush(stderr);
-
-    return(splits);
 }
 
-/*
- * ========================================================================
- * TAPE WRITER SIDE
- *
- */
-times_t idlewait, rdwait, wrwait, fmwait;
-unsigned long total_writes;
-off_t total_tape_used;
-int total_tape_fm;
-
-void write_file(void);
-int write_buffer(buffer_t *bp);
-
-void
-tape_writer_side(
-    int getp,
-    int putp)
-{
-    int tok;
-    int tape_started;
-    char *str;
-    char *hostname;
-    char *diskname;
-    char *datestamp;
-    int level;
-    int tmpint;
-
-#ifdef HAVE_LIBVTBLC
-    char *vol_label;
-    char *vol_date;
-#endif /* HAVE_LIBVTBLC */
-
-    procname = "writer";
-    syncpipe_init(getp, putp);
-    tape_started = 0;
-    idlewait = times_zero;
-    if (tapedev != NULL) {
-       tapedev = stralloc(tapedev);
+/* Validate that a command has the proper number of arguments, and
+   print a meaningful error message if not. It returns only if the
+   check is successful. */
+static void validate_args(cmd_t cmd, struct cmdargs * args,
+                          char ** argnames) {
+    int i;
+    
+    for (i = 0; argnames[i] != NULL; i ++) {
+        if (i > args->argc) {
+            error("error [taper %s: not enough args: %s]",
+                  cmdstr[cmd], argnames[i]);
+        }
     }
-
-    while (1) {
-       startclock();
-       if ((tok = syncpipe_get(&tmpint)) == -1) {
-           error("writer: Syncpipe failure before start");
-           /*NOTREACHED*/
-       }
-
-       idlewait = timesadd(idlewait, stopclock());
-       if (tok != 'S' && tok != 'Q' && !tape_started) {
-           error("writer: token '%c' before start", tok);
-           /*NOTREACHED*/
-       }
-
-       switch(tok) {
-       case 'H':               /* Reader read pipe side is down */
-           dbprintf(("writer: Communications with reader is down"));
-           error("writer: Communications with reader is down");
-           /*NOTREACHED*/
-           
-       case 'S':               /* start-tape */
-           if (tape_started) {
-               error("writer: multiple start requests");
-               /*NOTREACHED*/
-           }
-           if ((str = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure");
-               /*NOTREACHED*/
-           }
-           if (!first_tape(str ? str : "bad-datestamp")) {
-               if (tape_fd >= 0) {
-                   tapefd_close(tape_fd);
-                   tape_fd = -1;
-               }
-               if (syncpipe_put('E', 0) == -1) {
-                   error("writer: Syncpipe failure passing exit code");
-                   /*NOTREACHED*/
-               }
-               if (syncpipe_putstr(errstr) == -1) {
-                   error("writer: Syncpipe failure passing exit string");
-                   /*NOTREACHED*/
-               }
-               /* wait for reader to acknowledge error */
-               do {
-                   if ((tok = syncpipe_get(&tmpint)) == -1) {
-                       error("writer: Syncpipe failure waiting for error ack");
-                       /*NOTREACHED*/
-                   }
-                   if (tok != 'e') {
-                       error("writer: got '%c' unexpectedly after error", tok);
-                       /*NOTREACHED*/
-                   }
-               } while (tok != 'e');
-           } else {
-               if (syncpipe_put('S', 0) == -1) {
-                   error("writer: syncpipe failure while starting tape");
-                   /*NOTREACHED*/
-               }
-               tape_started = 1;
-           }
-           amfree(str);
-           break;
-
-       case 'O':               /* open-output */
-           if ((datestamp = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure during open");
-               /*NOTREACHED*/
-           }
-           tapefd_setinfo_datestamp(tape_fd, datestamp);
-           amfree(datestamp);
-
-           if ((hostname = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure fetching hostname");
-               /*NOTREACHED*/
-           }
-           tapefd_setinfo_host(tape_fd, hostname);
-           amfree(hostname);
-
-           if ((diskname = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure fetching diskname");
-               /*NOTREACHED*/
-           }
-           tapefd_setinfo_disk(tape_fd, diskname);
-           amfree(diskname);
-           if ((level = syncpipe_getint()) == -1) {
-               error("writer: Syncpipe failure fetching level");
-               /*NOTREACHED*/
-           }
-           tapefd_setinfo_level(tape_fd, level);
-           write_file();
-           break;
-
-#ifdef HAVE_LIBVTBLC
-       case 'L':               /* read vtbl label */
-           vtbl_no = tmpint;
-           if ((vol_label = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure fetching vrbl label");
-               /*NOTREACHED*/
-           }
-           fprintf(stderr, "taper: read label string \"%s\" from pipe\n", 
-                   vol_label);
-           strncpy(vtbl_entry[vtbl_no].label, vol_label, 45);
-           break;
-
-       case 'D':               /* read vtbl date */
-           vtbl_no = tmpint;
-           if ((vol_date = syncpipe_getstr()) == NULL) {
-               error("writer: Syncpipe failure fetching vrbl date");
-               /*NOTREACHED*/
-           }
-           fprintf(stderr, "taper: read date string \"%s\" from pipe\n", 
-                   vol_date);
-           strncpy(vtbl_entry[vtbl_no].date, vol_date, 20);
-           break;
-#endif /* HAVE_LIBVTBLC */
-
-       case 'Q':
-           end_tape(0);        /* XXX check results of end tape ?? */
-           clear_tapelist();
-           amfree(taper_timestamp);
-           amfree(label);
-           amfree(errstr);
-           amfree(changer_resultstr);
-           amfree(tapedev);
-           amfree(conf_tapelist);
-           amfree(config_dir);
-           amfree(config_name);
-
-           malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-           if (malloc_size_1 != malloc_size_2) {
-               malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-           }
-           exit(0);
-           /*NOTREACHED*/
-
-       default:
-           assert(0);
-       }
+    if (i < args->argc) {
+        error("error [taper %s: Too many args: Got %d, expected %d.]",
+              cmdstr[cmd], args->argc, i);
     }
 }
 
-void
-write_file(void)
-{
-    buffer_t *bp;
-    int full_buffers, i, bufnum;
-    int tok;
-    char number[NUM_STR_SIZE];
-    char *rdwait_str, *wrwait_str, *fmwait_str;
-    int tmpint;
+/* Open a socket to the dumper. Returns TRUE if everything is happy, FALSE
+   otherwise. */
+static gboolean open_read_socket(dump_info_t * info, char * split_diskbuffer,
+                             guint64 splitsize, guint64 fallback_splitsize) {
+    in_port_t port = 0;
+    int socket;
+    int fd;
+    int result;
+    struct addrinfo *res;
+
+    if ((result = resolve_hostname("localhost", 0, &res, NULL) != 0)) {
+        char *m;
+        char *q;
+       int save_errno = errno;
+        char *qdiskname = quote_string(info->diskname);
+
+        m = vstralloc("[localhost resolve failure: ",
+                      strerror(save_errno),
+                      "]",
+                      NULL);
+        q = squote(m);
+        putresult(TAPE_ERROR, "%s %s\n", info->handle, q);
+        log_add(L_FAIL, "%s %s %s %d %s",
+                info->hostname, qdiskname, info->timestamp,
+                info->level, q);
+        amfree(qdiskname);
+        amfree(m);
+        amfree(q);
+        return FALSE;
+    }
+
+    socket = stream_server(res->ai_family, &port, 0, STREAM_BUFSIZE, 0);
+    freeaddrinfo(res);
+
+    if (socket < 0) {
+        char *m;
+        char *q;
+       int save_errno = errno;
+        char *qdiskname = quote_string(info->diskname);
 
-    rdwait = wrwait = times_zero;
-    total_writes = 0;
+        m = vstralloc("[port create failure: ",
+                      strerror(save_errno),
+                      "]",
+                      NULL);
+        q = squote(m);
+        putresult(TAPE_ERROR, "%s %s\n", info->handle, q);
+        log_add(L_FAIL, "%s %s %s %d %s",
+                info->hostname, qdiskname, info->timestamp,
+                info->level, q);
+        amfree(qdiskname);
+        amfree(m);
+        amfree(q);
+        return FALSE;
+    }
 
-    bp = buftable;
-    full_buffers = 0;
-    tok = '?';
+    putresult(PORT, "%d\n", port);
 
-    taper_debug(1, ("taper: w: start file\n"));
+    fd = stream_accept(socket, CONNECT_TIMEOUT, 0, STREAM_BUFSIZE);
 
-    /*
-     * Tell the reader that the tape is open, and give it all the buffers.
-     */
-    if (syncpipe_put('O', 0) == -1) {
-       error("writer: Syncpipe failure starting write sequence");
-       /*NOTREACHED*/
-    }
-    for (i = 0; i < conf_tapebufs; i++) {
-       taper_debug(1, ("taper: w: put R%d\n", i));
-       if (syncpipe_put('R', i) == -1) {
-           error("writer: Syncpipe failure readying write buffers");
-           /*NOTREACHED*/
-       }
+    if (fd < 0) {
+        char *m, *q;
+       int save_errno = errno;
+        char *qdiskname = quote_string(info->diskname);
+        m = vstralloc("[port connect failure: ",
+                      strerror(save_errno),
+                      "]",
+                      NULL);
+        q = squote(m);
+        putresult(TAPE_ERROR, "%s %s\n", info->handle, q);
+        log_add(L_FAIL, "%s %s %s %d %s",
+                info->hostname, qdiskname, info->timestamp,
+                info->level, q);
+        amfree(qdiskname);
+        aclose(socket);
+        amfree(m);
+        amfree(q);
+        return FALSE;
+    } else {
+        aclose(socket);
     }
 
-    /*
-     * We write the filemark at the start of the file rather than at the end,
-     * so that it can proceed in parallel with the reader's initial filling
-     * up of the buffers.
-     */
-
-    startclock();
-    if (!write_filemark())
-       goto tape_error;
-    fmwait = stopclock();
-
-    filenum += 1;
-
-    do {
-
-       /*
-        * STOPPED MODE
-        *
-        * At the start of the file, or if the input can't keep up with the
-        * tape, we enter STOPPED mode, which waits for most of the buffers
-        * to fill up before writing to tape.  This maximizes the amount of
-        * data written in chunks to the tape drive, minimizing the number
-        * of starts/stops, which in turn saves tape and time.
-        */
-
-       if (interactive)
-           fputs("[WS]", stderr);
-       startclock();
-       while (full_buffers < conf_tapebufs - THRESHOLD) {
-           if ((tok = syncpipe_get(&bufnum)) == -1) {
-               error("writer: Syncpipe failure during buffer advance");
-               /*NOTREACHED*/
-           }
-           if (tok != 'W')
-               break;
-           taper_debug(1, ("taper: w: got W%d\n",bufnum));
-           full_buffers++;
-       }
-       rdwait = timesadd(rdwait, stopclock());
-
-       /*
-        * STARTING MODE
-        *
-        * We start output when sufficient buffers have filled up, or at
-        * end-of-file, whichever comes first.  Here we drain all the buffers
-        * that were waited on in STOPPED mode.  If more full buffers come
-        * in, then we will be STREAMING.
-        */
-
-       while (full_buffers) {
-           if (tt_file_pad && bp->size < (ssize_t)tt_blocksize) {
-               memset(bp->buffer+bp->size, 0, tt_blocksize - bp->size);
-               bp->size = (ssize_t)tt_blocksize;
-           }
-           if (!write_buffer(bp))
-               goto tape_error;
-           full_buffers--;
-           bp = nextbuf(bp);
-       }
-
-       /*
-        * STREAMING MODE
-        *
-        * With any luck, the input source is faster than the tape drive.  In
-        * this case, full buffers will appear in the circular queue faster
-        * than we can write them, so the next buffer in the queue will always
-        * be marked FULL by the time we get to it.  If so, we'll stay in
-        * STREAMING mode.
-        *
-        * On the other hand, if we catch up to the input and thus would have
-        * to wait for buffers to fill, we are then STOPPED again.
-        */
-
-       while (tok == 'W' && bp->status == FULL) {
-           if ((tok = syncpipe_get(&bufnum)) == -1) {
-               error("writer: Syncpipe failure advancing buffer");
-               /*NOTREACHED*/
-           }
-
-           if (tok == 'W') {
-               taper_debug(1, ("taper: w: got W%d\n",bufnum));
-               if(bufnum != (int)(bp - buftable)) {
-                   fprintf(stderr,
-                           "taper: tape-writer: my buf %d reader buf %d\n",
-                           (int)(bp-buftable), bufnum);
-                   fflush(stderr);
-                   if (syncpipe_put('E', 0) == -1) { 
-                       error("writer: Syncpipe failure putting error token");
-                       /*NOTREACHED*/
-                   }
-                   if (syncpipe_putstr("writer-side buffer mismatch") == -1) {
-                       error("writer: Syncpipe failure putting error messgae");
-                       /*NOTREACHED*/
-                   }
-                   goto error_ack;
-               }
-               if (tt_file_pad && bp->size < (ssize_t)tt_blocksize) {
-                   memset(bp->buffer+bp->size, 0, tt_blocksize - bp->size);
-                   bp->size = (ssize_t)tt_blocksize;
-               }
-               if (!write_buffer(bp))
-                   goto tape_error;
-               bp = nextbuf(bp);
-           } else if (tok == 'Q') {
-               return;
-           } else if (tok == 'X') {
-               goto reader_buffer_snafu;
-           } else {
-               error("writer-side not expecting token: %c", tok);
-               /*NOTREACHED*/
-           }
-       }
-    } while (tok == 'W');
+    info->source = taper_source_new(info->handle, PORT_WRITE, NULL, fd,
+                                    split_diskbuffer, splitsize,
+                                    fallback_splitsize);
+    /* FIXME: This should be handled properly. */
+    g_assert(info->source != NULL);
+    return TRUE;
+}
 
-    /* got close signal from reader, acknowledge it */
+typedef struct {
+    ConsumerFunctor next_consumer;
+    gpointer next_consumer_data;
+    guint64 bytes_written;
+} CountingConsumerData;
 
-    if (tok == 'X')
-       goto reader_buffer_snafu;
+/* A ConsumerFunctor. This consumer just passes its arguments on to a
+   second consumer, but counts the number of bytes successfully
+   written. */
+static int counting_consumer(gpointer user_data, queue_buffer_t * buffer) {
+    int result;
+    CountingConsumerData * data = user_data;
 
-    assert(tok == 'C');
-    if (syncpipe_put('C', 0) == -1) {
-       error("writer: Syncpipe failure putting close");
-       /*NOTREACHED*/
+    result = data->next_consumer(data->next_consumer_data, buffer);
+    
+    if (result > 0) {
+        data->bytes_written += result;
     }
 
-    /* tell reader the tape and file number */
+    return result;
+}
 
-    if (syncpipe_putstr(label) == -1) {
-       error("writer: Syncpipe failure putting label");
-       /*NOTREACHED*/
-    }
-    snprintf(number, SIZEOF(number), "%d", filenum);
-    if (syncpipe_putstr(number) == -1) {
-       error("writer: Syncpipe failure putting filenum");
-       /*NOTREACHED*/
+static gboolean boolean_prolong(void * data) {
+    if (data == NULL) {
+        return TRUE; /* Do not interrupt. */
+    } else {
+        return *(gboolean*)data;
     }
+}
+
+/* A (simpler) wrapper around taper_scan(). */
+static gboolean simple_taper_scan(taper_state_t * state,
+                                  gboolean* prolong, char ** error_message) {
+    char ** label = &(state->next_tape_label);
+    char ** device = &(state->next_tape_device);
+    char *timestamp = NULL;
+    int result;
+    result = taper_scan(NULL, label, &timestamp, device,
+                        state->taper_scan_tracker,
+                        CHAR_taperscan_output_callback,
+                        error_message, boolean_prolong, prolong);
+    if (prolong != NULL && !*prolong) {
+        g_fprintf(stderr, _("Cancelled taper scan.\n"));
+        return FALSE;
+    } else if (result < 0) {
+        g_fprintf(stderr, _("Failed taper scan: %s\n"), (*error_message)?(*error_message):_("(no error message)"));
+        amfree(timestamp);
+        return FALSE;
+    } else {
+        g_fprintf(stderr, _("taper: using label `%s' date `%s'\n"), *label,
+                state->driver_start_time);
+        if (result == 3) {
+            log_add(L_INFO,
+            _("Will write new label `%s' to new (previously non-amanda) tape"),
+                    *label);
+        }
 
-    snprintf(number, SIZEOF(number), "%lu", total_writes);
-    rdwait_str = stralloc(walltime_str(rdwait));
-    wrwait_str = stralloc(walltime_str(wrwait));
-    fmwait_str = stralloc(walltime_str(fmwait));
-    errstr = newvstralloc(errstr,
-                         "{wr:",
-                         " writers ", number,
-                         " rdwait ", rdwait_str,
-                         " wrwait ", wrwait_str,
-                         " filemark ", fmwait_str,
-                         "}",
-                         NULL);
-    amfree(rdwait_str);
-    amfree(wrwait_str);
-    amfree(fmwait_str);
-    if (syncpipe_putstr(errstr) == -1) {
-       error("writer: Syncpipe failure putting '%s'", errstr);
-       /*NOTREACHED*/
     }
+    amfree(timestamp);
+    return TRUE;
+}
 
-    /* XXX go to next tape if past tape size? */
+typedef struct {
+    taper_state_t * state;
+    gboolean prolong; /* scan stops when this is FALSE. */
+    char *errmsg;
+} tape_search_request_t;
 
-    return;
+/* A GThread that runs taper_scan. */
+static gpointer tape_search_thread(gpointer data) {
+    tape_search_request_t * request = data;
 
- tape_error:
-    if (errstr) 
-       dbprintf(("tape_error: %s\n", errstr));
-    /* got tape error */
-    if (next_tape(1)) {
-       if (syncpipe_put('T', 0) == -1) {   /* next tape in place, try again */
-           error("writer: Syncpipe failure during tape advance");
-           /*NOTREACHED*/
-       }
+    if (request->state->next_tape_label != NULL &&
+        request->state->next_tape_device != NULL) {
+        return GINT_TO_POINTER(TRUE);
     } else {
-       if (syncpipe_put('E', 0) == -1) {   /* no more tapes, fail */
-           error("writer: Syncpipe failure during tape error");
-           /*NOTREACHED*/
-       }
-    }
-    if (syncpipe_putstr(errstr) == -1) {
-       error("writer: Syncpipe failure putting '%s'", errstr);
-       /*NOTREACHED*/
+        amfree(request->state->next_tape_label);
+        amfree(request->state->next_tape_device);
     }
 
- error_ack:
-    /* wait for reader to acknowledge error */
-    do {
-       if ((tok = syncpipe_get(&tmpint)) == -1) {
-           error("writer: syncpipe failure waiting for error ack");
-           /*NOTREACHED*/
-       }
-
-       if (tok != 'W' && tok != 'C' && tok != 'e') {
-           error("writer: got '%c' unexpectedly after error", tok);
-           /*NOTREACHED*/
-       }
-    } while (tok != 'e');
-    return;
-
- reader_buffer_snafu:
-    if (syncpipe_put('x', 0) == -1) {
-       error("writer: syncpipe failure putting buffer snafu");
-       /*NOTREACHED*/
-    }
-    return;
+    return GINT_TO_POINTER
+        (simple_taper_scan(request->state,
+                           &(request->prolong),
+                          &(request->errmsg)));
 }
 
-int
-write_buffer(
-    buffer_t *bp)
-{
-    ssize_t rc;
-
-    assert(bp->status == FULL);
-
-    startclock();
-    rc = tapefd_write(tape_fd, bp->buffer, (size_t)bp->size);
-    if (rc == (ssize_t)bp->size) {
-#if defined(NEED_RESETOFS)
-       static double tape_used_modulus_2gb = 0;
-
-       /*
-        * If the next write will go over the 2 GByte boundary, reset
-        * the kernel concept of where we are to make sure it does not
-        * go silly on us.
-        */
-       tape_used_modulus_2gb += (double)rc;
-       if (tape_used_modulus_2gb + (double)rc > (double)0x7fffffff) {
-           tape_used_modulus_2gb = 0;
-           tapefd_resetofs(tape_fd);
-       }
-#endif
-       wrwait = timesadd(wrwait, stopclock());
-       total_writes += 1;
-       total_tape_used += (off_t)rc;
-       bp->status = EMPTY;
-       if (interactive || debug_taper >= 1)
-           dumpstatus(bp);
-       if (interactive)
-           fputs("W", stderr);
-
-       taper_debug(1, ("taper: w: put R%d\n", (int)(bp-buftable)));
-       if (syncpipe_put('R', (int)(bp-buftable)) == -1) {
-           error("writer: Syncpipe failure during advancing write bufffer");
-           /*NOTREACHED*/
-       }
-       return 1;
-    } else {
-       errstr = newvstralloc(errstr,
-                             "writing file: ",
-                             (rc != -1) ? "short write" : strerror(errno),
-                             NULL);
-       wrwait = timesadd(wrwait, stopclock());
-       if (interactive)
-           fputs("[WE]", stderr);
-       return 0;
+static void log_taper_scan_errmsg(char * errmsg) {
+    char *c, *c1;
+    if (errmsg == NULL)
+        return;
+
+    c = c1 = errmsg;
+    while (*c != '\0') {
+        if (*c == '\n') {
+            *c = '\0';
+            log_add(L_WARNING,"%s", c1);
+            c1 = c+1;
+        }
+        c++;
     }
+    if (strlen(c1) > 1 )
+        log_add(L_WARNING,"%s", c1);
+    amfree(errmsg);
 }
 
+/* If handle is NULL, then this function assumes that we are in startup mode.
+ * In that case it will wait for a command from driver. If handle is not NULL,
+ * this this function will ask for permission with REQUEST-NEW-TAPE. */
+static gboolean find_new_tape(taper_state_t * state, dump_info_t * dump) {
+    GThread * tape_search = NULL;
+    tape_search_request_t search_request;
+    gboolean use_threads;
+    cmd_t cmd;
+    struct cmdargs args;
 
-static void 
-cleanup(void)
-{
-    REMOVE_SHARED_MEMORY(); 
-}
-
+    if (state->device != NULL) {
+        return TRUE;
+    }
 
-/*
- * Cleanup shared memory segments 
- */
-static void 
-signal_handler(
-    int signum)
-{
-    log_add(L_INFO, "Received signal %d", signum);
+    /* We save the value here in case it changes while we're running. */
+    use_threads = g_thread_supported();
 
-    exit(1);
+    search_request.state = state;
+    search_request.prolong = TRUE;
+    search_request.errmsg = NULL;
+    if (use_threads) {
+        tape_search = g_thread_create(tape_search_thread,
+                                      &search_request, TRUE, NULL);
+    }
+    
+    putresult(REQUEST_NEW_TAPE, "%s\n", dump->handle);
+    cmd = getcmd(&args);
+    switch (cmd) {
+    default:
+        g_fprintf(stderr, "taper: Got odd message from driver, expected NEW-TAPE or NO-NEW-TAPE.\n");
+        /* FALLTHROUGH. */
+    case NEW_TAPE: {
+        gboolean search_result;
+        if (use_threads) {
+            search_result = GPOINTER_TO_INT(g_thread_join(tape_search));
+        } else {
+            search_result =
+                GPOINTER_TO_INT(tape_search_thread(&search_request));
+        }
+        if (search_result) {
+            /* We don't say NEW_TAPE until we actually write the label. */
+           amfree(search_request.errmsg);
+            return TRUE;
+        } else {
+            putresult(NO_NEW_TAPE, "%s\n", dump->handle);
+            log_taper_scan_errmsg(search_request.errmsg);
+            return FALSE;
+        }
+    }
+    case NO_NEW_TAPE:
+        search_request.prolong = FALSE;
+        if (use_threads) {
+            g_thread_join(tape_search);
+        }
+        return FALSE;
+    }
 }
 
+/* Returns TRUE if the old volume details are not the same as the new ones. */
+static gboolean check_volume_changed(Device * device,
+                                     char * old_label, char * old_timestamp) {
+    /* If one is NULL and the other is not, something changed. */
+    if ((old_label == NULL) != (device->volume_label == NULL))
+        return TRUE;
+    if ((old_timestamp == NULL) != (device->volume_time == NULL))
+        return TRUE;
+    /* If details were not NULL and is now different, we have a difference. */
+    if (old_label != NULL && strcmp(old_label, device->volume_label) != 0)
+        return TRUE;
+    if (old_timestamp != NULL &&
+        strcmp(old_timestamp, device->volume_time) != 0)
+        return TRUE;
+
+    /* If we got here, everything is cool. */
+    return FALSE;
+}
 
-/*
- * Installing signal handlers for signal whose default action is 
- * process termination so that we can clean up shared memory
- * segments
- */
-static void
-install_signal_handlers(void)
-{
-    struct sigaction act;
+/* Find and label a new tape, if one is not already open. Returns TRUE
+ * if a tape could be written. */
+static gboolean find_and_label_new_tape(taper_state_t * state,
+                                        dump_info_t * dump_info) {
+    if (state->device != NULL) {
+        return TRUE;
+    }
+    
+    if (!find_new_tape(state, dump_info)) {
+        return FALSE;
+    }
 
-    act.sa_handler = signal_handler;
-    act.sa_flags = 0;
-    sigemptyset(&act.sa_mask);
+    return label_new_tape(state, dump_info);
+}
 
-    signal(SIGPIPE, SIG_IGN);
+static gboolean label_new_tape(taper_state_t * state, dump_info_t * dump_info) {
+    char *tapelist_name;
+    char *tapelist_name_old;
+    char * old_volume_name;
+    char * old_volume_time;
 
-    if (sigaction(SIGINT, &act, NULL) != 0) {
-       error("taper: couldn't install SIGINT handler [%s]", strerror(errno));
-       /*NOTREACHED*/
-    }
+    /* If we got here, it means that we have found a tape to label and
+     * have gotten permission from the driver to write it. But we
+     * still can say NO-NEW-TAPE if a problem shows up, and must still
+     * say NEW-TAPE if one doesn't. */
 
-    if (sigaction(SIGHUP, &act, NULL) != 0) {
-       error("taper: couldn't install SIGHUP handler [%s]", strerror(errno));
-       /*NOTREACHED*/
+    state->device = device_open(state->next_tape_device);
+    amfree(state->next_tape_device);
+    if (state->device == NULL) {
+        amfree(state->next_tape_label);
+        return FALSE;
     }
-   
-    if (sigaction(SIGTERM, &act, NULL) != 0) {
-       error("taper: couldn't install SIGTERM handler [%s]", strerror(errno));
-       /*NOTREACHED*/
+    
+    device_set_startup_properties_from_config(state->device);
+    device_read_label(state->device);
+    old_volume_name = g_strdup(state->device->volume_label);
+    old_volume_time = g_strdup(state->device->volume_time);
+    
+    if (!device_start(state->device, ACCESS_WRITE, state->next_tape_label,
+                      state->driver_start_time)) {
+        gboolean tape_used;
+        /* Something broke, see if we can tell if the volume was erased or
+         * not. */
+        g_fprintf(stderr, "taper: Error writing label %s to device %s.\n",
+                state->next_tape_label, state->device->device_name);
+        device_finish(state->device);
+        device_read_label(state->device);
+        tape_used = check_volume_changed(state->device, old_volume_name, 
+                                         old_volume_time);
+        g_object_unref(state->device);
+        state->device = NULL;
+        amfree(state->next_tape_label);
+        /* If the volume was written, we tell the driver and then immediately
+         * try again. */
+        if (tape_used) {
+            putresult(NEW_TAPE, "%s %s\n", dump_info->handle,
+                     state->device->volume_label);
+            if (old_volume_name) {
+                log_add(L_WARNING, "Problem writing label to volume %s, "
+                        "volume may be erased.\n", old_volume_name);
+            } else {
+                log_add(L_WARNING, "Problem writing label %s to new volume, "
+                        "volume may be erased.\n", state->next_tape_label);
+            }
+            amfree(old_volume_name);
+            amfree(old_volume_time);
+            return find_and_label_new_tape(state, dump_info);
+        } else {
+            /* Otherwise, we grab a new tape without talking to the driver
+             * again. */
+            tape_search_request_t request;
+            gboolean search_result;
+            if (old_volume_name) {
+                log_add(L_WARNING, "Problem writing label to volume %s, "
+                        "old volume data intact\n", old_volume_name);
+            } else {
+                log_add(L_WARNING, "Problem writing label %s to new volume, "
+                        "old volume data intact\n", state->next_tape_label);
+            }
+            amfree(old_volume_name);
+            amfree(old_volume_time);
+            request.state = state;
+            request.prolong = TRUE;
+            request.errmsg = NULL;
+            search_result = GPOINTER_TO_INT(tape_search_thread(&request));
+            if (search_result) {
+                amfree(request.errmsg);
+                return label_new_tape(state, dump_info);
+            } else {
+                /* Problem finding a new tape! */
+                log_taper_scan_errmsg(request.errmsg);
+                putresult(NO_NEW_TAPE, "%s\n", dump_info->handle);
+                return FALSE;
+            }
+        }
+    } else {
+       amfree(old_volume_name);
+       amfree(old_volume_time);
     }
 
-    if (sigaction(SIGUSR1, &act, NULL) != 0) {
-       error("taper: couldn't install SIGUSR1 handler [%s]", strerror(errno));
-       /*NOTREACHED*/
+    amfree(state->next_tape_label);
+
+    tapelist_name = config_dir_relative(getconf_str(CNF_TAPELIST));
+    if (state->cur_tape == 0) {
+       tapelist_name_old = stralloc2(tapelist_name, ".yesterday");
+    } else {
+       char cur_str[NUM_STR_SIZE];
+       g_snprintf(cur_str, SIZEOF(cur_str), "%d", state->cur_tape - 1);
+       tapelist_name_old = vstralloc(tapelist_name,
+                                     ".today.", cur_str, NULL);
     }
 
-    if (sigaction(SIGUSR2, &act, NULL) != 0) {
-       error("taper: couldn't install SIGUSR2 handler [%s]", strerror(errno));
+    if (write_tapelist(tapelist_name_old)) {
+       error("could not write tapelist: %s", strerror(errno));
        /*NOTREACHED*/
     }
+    amfree(tapelist_name_old);
 
-    if (sigaction(SIGALRM, &act, NULL) != 0) {
-       error("taper: couldn't install SIGALRM handler [%s]", strerror(errno));
+    remove_tapelabel(state->device->volume_label);
+    add_tapelabel(state->driver_start_time,
+                  state->device->volume_label);
+    if (write_tapelist(tapelist_name)) {
+       error("could not write tapelist: %s", strerror(errno));
        /*NOTREACHED*/
     }
-}
-
-
-/*
- * ========================================================================
- * SHARED-MEMORY BUFFER SUBSYSTEM
- *
- */
+    amfree(tapelist_name);
+    state->cur_tape++;
 
-#ifdef HAVE_SYSVSHM
-
-int shmid = -1;
+    log_add(L_START, "datestamp %s label %s tape %d",
+            state->driver_start_time, state->device->volume_label,
+            state->cur_tape);
+    putresult(NEW_TAPE, "%s %s\n", dump_info->handle,
+             state->device->volume_label);
 
-char *
-attach_buffers(
-    size_t size)
-{
-    char *result;
+    return TRUE;
+}
 
-    shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0700);
-    if (shmid == -1) {
-       return NULL;
+/* Find out if the dump is PARTIAL or not, and set the proper driver
+   and logfile tags for the dump. */
+static void find_completion_tags(dump_info_t * dump_info, /* IN */
+                                 cmd_t * result_cmd,      /* OUT */
+                                 logtype_t * result_log   /* OUT */) {
+    if (taper_source_is_partial(dump_info->source)) {
+        *result_cmd = PARTIAL;
+        *result_log = L_PARTIAL;
+    } else {
+        *result_cmd = DONE;
+        *result_log = L_DONE;
     }
+}
 
-    result = (char *)shmat(shmid, (SHM_ARG_TYPE *)NULL, 0);
-
-    if (result == (char *)-1) {
-       int save_errno = errno;
-
-       destroy_buffers();
-       errno = save_errno;
-       error("shmat: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
+/* Put an L_PARTIAL message to the logfile. */
+static void put_partial_log(dump_info_t * dump_info, double dump_time,
+                            guint64 dump_kbytes) {
+    char * qdiskname = quote_string(dump_info->diskname);
 
-    return result;
+    log_add(L_PARTIAL, "%s %s %s %d %d [sec %f kb %ju kps %f] \"\"",
+            dump_info->hostname, qdiskname, dump_info->timestamp,
+            dump_info->current_part, dump_info->level, dump_time,
+            (uintmax_t)dump_kbytes, dump_kbytes / dump_time);
+    amfree(qdiskname);
 }
 
+/* Figure out what to do after a part attempt. Returns TRUE if another
+   attempt should proceed for this dump; FALSE if we are done. */
+static gboolean finish_part_attempt(taper_state_t * taper_state,
+                                    dump_info_t * dump_info,
+                                    queue_result_flags queue_result,
+                                    GTimeVal run_time, guint64 run_bytes) {
+    double part_time = g_timeval_to_double(run_time);
+    guint64 part_kbytes = run_bytes / 1024;
+    double part_kbps = run_bytes / (1024 * part_time);
+        
+    char * qdiskname = quote_string(dump_info->diskname);
+
+    if (queue_result == QUEUE_SUCCESS) {
+        dump_info->total_time = timesadd(run_time, dump_info->total_time);
+        dump_info->total_bytes += run_bytes;
+
+        log_add(L_PART, "%s %d %s %s %s %d/%d %d [sec %f kb %ju kps %f]",
+                taper_state->device->volume_label,
+                taper_state->device->file, dump_info->hostname, qdiskname,
+                dump_info->timestamp, dump_info->current_part,
+                taper_source_predict_parts(dump_info->source),
+                dump_info->level, part_time, (uintmax_t)part_kbytes, part_kbps);
+        putresult(PARTDONE, "%s %s %d %ju \"[sec %f kb %ju kps %f]\"\n",
+                  dump_info->handle, taper_state->device->volume_label,
+                  taper_state->device->file, (uintmax_t)part_kbytes, part_time,
+                 (uintmax_t)part_kbytes, part_kbps);
+        
+        if (taper_source_get_end_of_data(dump_info->source)) {
+            cmd_t result_cmd;
+            logtype_t result_log;
+            double dump_time = g_timeval_to_double(dump_info->total_time);
+            guint64 dump_kbytes = dump_info->total_bytes / 1024;
+            double dump_kbps = dump_info->total_bytes / (1024 * dump_time);
+
+            find_completion_tags(dump_info, &result_cmd, &result_log);
+
+            g_object_unref(dump_info->source);
+            dump_info->source = NULL;
+        
+            log_add(result_log, "%s %s %s %d %d [sec %f kb %ju kps %f]",
+                    dump_info->hostname, qdiskname, dump_info->timestamp,
+                    dump_info->current_part, dump_info->level, dump_time,
+                   (uintmax_t)dump_kbytes, dump_kbps);
+            putresult(result_cmd, "%s INPUT-GOOD TAPE-GOOD "
+                      "\"[sec %f kb %ju kps %f]\" \"\" \"\"\n",
+                      dump_info->handle, dump_time, (uintmax_t)dump_kbytes,
+                      dump_kbps);
+            
+            amfree(qdiskname);
+            return FALSE;
+        } else if (taper_source_get_end_of_part(dump_info->source)) {
+            taper_source_start_new_part(dump_info->source);
+            dump_info->current_part ++;
+            amfree(qdiskname);
+            return TRUE;
+        }
+        /* If we didn't read EOF or EOP, then an error
+           occured. But we read QUEUE_SUCCESS, so something is
+           b0rked. */
+        g_assert_not_reached();
+    } else {
+        char * volume_label = strdup(taper_state->device->volume_label);
+        int file_number = taper_state->device->file;
+        double dump_time, dump_kbps;
+        guint64 dump_kbytes;
+
+        /* A problem occured. */
+        if (queue_result & QUEUE_CONSUMER_ERROR) {
+            /* Close the device. */
+            device_finish(taper_state->device);
+            g_object_unref(taper_state->device);
+            taper_state->device = NULL;
+        }
+        
+        log_add(L_PARTPARTIAL,
+                "%s %d %s %s %s %d/%d %d [sec %f kb %ju kps %f] \"\"",
+                volume_label, file_number, dump_info->hostname, qdiskname,
+                dump_info->timestamp, dump_info->current_part,
+                taper_source_predict_parts(dump_info->source),
+                dump_info->level, part_time, (uintmax_t)part_kbytes, part_kbps);
+        amfree(volume_label);
+        
+        if ((queue_result & QUEUE_CONSUMER_ERROR) &&
+            (!(queue_result & QUEUE_PRODUCER_ERROR)) &&
+            taper_source_seek_to_part_start(dump_info->source)) {
+            /* It is recoverable. */
+            log_add(L_INFO, "Will request retry of failed split part.");
+            if (find_and_label_new_tape(taper_state, dump_info)) {
+                /* dump_info->current_part is unchanged. */
+                amfree(qdiskname);
+                return TRUE;
+            }
+        }
 
-void
-detach_buffers(
-    char *bufp)
-{
-    if ((bufp != NULL) &&
-        (shmdt((SHM_ARG_TYPE *)bufp) == -1)) {
-       error("shmdt: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
+        dump_info->total_time = timesadd(run_time, dump_info->total_time);
+        dump_info->total_bytes += run_bytes;
+        dump_time = g_timeval_to_double(dump_info->total_time);
+        dump_kbytes = dump_info->total_bytes / 1024;
+        dump_kbps = dump_info->total_bytes / (1024 * dump_time);
+        
+        putresult(PARTIAL,
+                  "%s INPUT-%s TAPE-%s "
+                  "\"[sec %f kb %ju kps %f]\" \"\" \"\"\n",
+                  dump_info->handle,
+                  (queue_result & QUEUE_PRODUCER_ERROR) ? "ERROR" : "GOOD",
+                  (queue_result & QUEUE_CONSUMER_ERROR) ? "ERROR" : "GOOD",
+                  dump_time, (uintmax_t)dump_kbytes, dump_kbps);
+        put_partial_log(dump_info, dump_time, dump_kbytes);
+    }
+
+    amfree(qdiskname);
+    return FALSE;
 }
 
-void
-destroy_buffers(void)
-{
-    if (shmid == -1)
-       return; /* nothing to destroy */
-    if (shmctl(shmid, IPC_RMID, NULL) == -1) {
-       error("shmctl: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-}
+/* Generate the actual header structure to write to tape. This means dropping
+ * bits related to the holding disk, and adding bits for split dumps. */
+static dumpfile_t * munge_headers(dump_info_t * dump_info) {
+    dumpfile_t * rval;
+    int expected_splits;
+    
+    rval = taper_source_get_first_header(dump_info->source);
 
-#else
-#ifdef HAVE_MMAP
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#ifndef MAP_ANON
-#  ifdef MAP_ANONYMOUS                 /* OSF/1-style */
-#    define MAP_ANON MAP_ANONYMOUS
-#  else                                        /* SunOS4-style */
-#    define MAP_ANON 0
-#    define ZERO_FILE "/dev/zero"
-#  endif
-#endif
-
-int shmfd = -1;
-size_t saved_size;
-
-char *
-attach_buffers(
-    size_t size)
-{
-    char *shmbuf;
-
-#ifdef ZERO_FILE
-    shmfd = open(ZERO_FILE, O_RDWR);
-    if (shmfd == -1) {
-       error("attach_buffers: could not open %s: %s",
-             ZERO_FILE,
-             strerror(errno));
-        /*NOTREACHED*/
+    if (rval == NULL) {
+        return NULL;
     }
-#endif
 
-    saved_size = size;
-    shmbuf = (char *) mmap((void *) 0,
-                          size,
-                          PROT_READ|PROT_WRITE,
-                          MAP_ANON|MAP_SHARED,
-                          shmfd, 0);
+    rval->cont_filename[0] = '\0';
 
-    return shmbuf;
-}
+    expected_splits = taper_source_predict_parts(dump_info->source);
 
-void
-detach_buffers(
-    char *bufp)
-{
-    if ((bufp != NULL) && 
-       (munmap((void *)bufp, saved_size) == -1)) {
-       error("detach_buffers: munmap: %s", strerror(errno));
-       /*NOTREACHED*/
+    if (expected_splits != 1) {
+        rval->type = F_SPLIT_DUMPFILE;
+        rval->partnum = dump_info->current_part;
+        rval->totalparts = expected_splits;
     }
 
-    if (shmfd != -1)
-       aclose(shmfd);
+    return rval;
 }
 
-void
-destroy_buffers(void)
-{
+/* We call this when we can't find a tape to write data to. This could
+   happen with the first (or only) part of a file, but it could also
+   happen with an intermediate part of a split dump. dump_bytes
+   is 0 if this is the first part of a dump. */
+static void bail_no_volume(dump_info_t * dump_info) {
+    if (dump_info->total_bytes > 0) {
+        /* Second or later part of a split dump, so PARTIAL message. */
+        double dump_time = g_timeval_to_double(dump_info->total_time);
+        guint64 dump_kbytes = dump_info->total_bytes / 1024;
+        double dump_kbps = dump_kbytes / dump_time;
+        putresult(PARTIAL,
+                  "%s INPUT-GOOD TAPE-ERROR "
+                  "\"[sec %f kb %ju kps %f]\" \"\" \"no new tape\"\n",
+                  dump_info->handle, 
+                  dump_time, (uintmax_t)dump_kbytes, dump_kbps);
+        put_partial_log(dump_info, dump_time, dump_kbytes);
+    } else {
+        char * qdiskname = quote_string(dump_info->diskname);
+        putresult(FAILED,
+                  "%s INPUT-GOOD TAPE-ERROR \"\" \"No new tape.\"\n",
+                  dump_info->handle);
+        log_add(L_FAIL, "%s %s %s %d \"No new tape.\"",
+                dump_info->hostname, qdiskname, dump_info->timestamp,
+                dump_info->level);
+       amfree(qdiskname);
+    }
 }
 
-#else
-#error: must define either HAVE_SYSVSHM or HAVE_MMAP!
-#endif
-#endif
-
-
+/* Link up the TaperSource with the Device, including retries etc. */
+static void run_device_output(taper_state_t * taper_state,
+                              dump_info_t * dump_info) {
+    GValue val;
+    guint file_number;
+    dump_info->current_part = 1;
+    dump_info->total_time.tv_sec = 0;
+    dump_info->total_time.tv_usec = 0;
+    dump_info->total_bytes = 0;
+
+    for (;;) {
+        GTimeVal start_time, end_time, run_time;
+        StreamingRequirement streaming_mode;
+        queue_result_flags queue_result;
+        CountingConsumerData consumer_data;
+        dumpfile_t *this_header;
+        size_t max_memory;
+        
+        this_header = munge_headers(dump_info);
+        if (this_header == NULL) {
+            char * qdiskname = quote_string(dump_info->diskname);
+            putresult(FAILED,
+             "%s INPUT-ERROR TAPE-GOOD \"Failed reading dump header.\" \"\"\n",
+                      dump_info->handle);
+            log_add(L_FAIL, "%s %s %s %d \"Failed reading dump header.\"",
+                    dump_info->hostname, qdiskname, dump_info->timestamp,
+                    dump_info->level);
+            amfree(qdiskname);
+            return;
+        }            
+
+        if (!find_and_label_new_tape(taper_state, dump_info)) {
+            bail_no_volume(dump_info);
+           amfree(this_header);
+            return;
+        }
 
-/*
- * ========================================================================
- * SYNC-PIPE SUBSYSTEM
- *
- */
+        if (!device_start_file(taper_state->device, this_header)) {
+            bail_no_volume(dump_info);
+           amfree(this_header);
+            return;
+        }
+       amfree(this_header);
+
+        bzero(&val, sizeof(val));
+        if (!device_property_get(taper_state->device, PROPERTY_STREAMING, &val)
+            || !G_VALUE_HOLDS(&val, STREAMING_REQUIREMENT_TYPE)) {
+            g_fprintf(stderr, "taper: Couldn't get streaming type!\n");
+            streaming_mode = STREAMING_REQUIREMENT_REQUIRED;
+        } else {
+            streaming_mode = g_value_get_enum(&val);
+        }
+    
+        file_number = taper_state->device->file;
+
+        consumer_data.next_consumer = device_write_consumer;
+        consumer_data.next_consumer_data = taper_state->device;
+        consumer_data.bytes_written = 0;
+
+        g_get_current_time(&start_time);
+
+        if (getconf_seen(CNF_DEVICE_OUTPUT_BUFFER_SIZE)) {
+            max_memory = getconf_size(CNF_DEVICE_OUTPUT_BUFFER_SIZE);
+            if (getconf_seen(CNF_TAPEBUFS)) {
+                g_fprintf(stderr,
+                        "Configuration directives 'device_output_buffer_size' "
+                        "and \n"
+                        "'tapebufs' are incompatible; using former.\n");
+            }
+        } else if (getconf_seen(CNF_TAPEBUFS)) {
+            max_memory = getconf_int(CNF_TAPEBUFS) *
+                device_write_max_size(taper_state->device);
+        } else {
+            /* Use default. */
+            max_memory = getconf_size(CNF_DEVICE_OUTPUT_BUFFER_SIZE);
+        }
 
-int getpipe, putpipe;
+        queue_result = do_consumer_producer_queue_full
+            (taper_source_producer,
+             dump_info->source,
+             counting_consumer,
+             &consumer_data,
+             device_write_max_size(taper_state->device), max_memory,
+             streaming_mode);
+
+        g_get_current_time(&end_time);
+        run_time = timesub(end_time, start_time);
+
+        /* The device_write_consumer may have closed the file with a short
+         * write, so we only finish here if it needs it. */
+        if (taper_state->device->in_file &&
+            !device_finish_file(taper_state->device)) {
+            queue_result = queue_result | QUEUE_CONSUMER_ERROR;
+        }
 
-void
-syncpipe_init(
-    int rd,
-    int wr)
-{
-    getpipe = rd;
-    putpipe = wr;
+        if (!finish_part_attempt(taper_state, dump_info, queue_result,
+                                 run_time, consumer_data.bytes_written)) {
+            break;
+        }
+    }
 }
 
-void
-syncpipe_read_error(
-    ssize_t    rc,
-    ssize_t    expected)
-{
-    char buf[sizeof(char) + sizeof(int)];
-
-    if (rc == 0) {
-       dbprintf(("syncpipe_get %s halting: Unexpected read EOF\n", procname));
-       fprintf(stderr, "syncpipe_get %s halting: Unexpected read EOF\n", procname);
-    } else if (rc < 0) {
-       dbprintf(("syncpipe_get %s halting: Read error - %s\n",
-                       procname, strerror(errno)));
-       fprintf(stderr, "syncpipe_get %s halting: Read error - %s\n",
-                       procname, strerror(errno));
-    } else {
-       dbprintf(("syncpipe_get %s halting: Read "
-               SSIZE_T_FMT " bytes short of " SSIZE_T_FMT "\n",
-               procname, (SSIZE_T_FMT_TYPE)(rc - expected),
-               (SSIZE_T_FMT_TYPE)expected));
-       fprintf(stderr, "syncpipe_get %s halting: Read "
-               SSIZE_T_FMT " bytes short of " SSIZE_T_FMT "\n",
-               procname, (SSIZE_T_FMT_TYPE)(rc - expected),
-               (SSIZE_T_FMT_TYPE)expected);
+/* Handle a PORT_WRITE command. */
+static void process_port_write(taper_state_t * state,
+                               struct cmdargs * cmdargs) {
+    dump_info_t dump_state;
+    guint64 splitsize;
+    guint64 fallback_splitsize;
+    char * split_diskbuffer;
+    char * argnames[] = {"command",               /* 1 */
+                        "handle",                /* 2 */
+                         "hostname",              /* 3 */
+                         "diskname",              /* 4 */
+                         "level",                 /* 5 */
+                         "datestamp",             /* 6 */
+                         "splitsize",             /* 7 */
+                         "split_diskbuffer",      /* 8 */
+                         "fallback_splitsize",    /* 9 */
+                          NULL };
+
+    validate_args(PORT_WRITE, cmdargs, argnames);
+
+    dump_state.handle = g_strdup(cmdargs->argv[2]);
+    dump_state.hostname = g_strdup(cmdargs->argv[3]);
+    dump_state.diskname = unquote_string(cmdargs->argv[4]);
+    
+    errno = 0;
+    dump_state.level = strtol(cmdargs->argv[5], NULL, 10);
+    if (errno != 0) {
+        error("error [taper PORT-WRITE: Invalid dump level %s]",
+              cmdargs->argv[5]);
+        g_assert_not_reached();
     }
-    /* Halt the other side if it's still alive */
-    buf[0] = 'H';
-    memset(&buf[1], 0, SIZEOF(int));
-    if (write(putpipe, buf, SIZEOF(buf)))
-       return;
-}
+    
+    dump_state.timestamp = strdup(cmdargs->argv[6]);
 
-void
-syncpipe_write_error(
-    ssize_t    rc,
-    ssize_t    expected)
-{
-    char buf[sizeof(char) + sizeof(int)];
-
-    if (rc == 0) {             /* EOF */
-       dbprintf(("syncpipe %s halting: Write EOF\n", procname));
-       fprintf(stderr, "syncpipe %s halting: Write EOF\n", procname);
-    } else if (rc < 0) {
-       dbprintf(("syncpipe %s halting: Write error - %s\n",
-                       procname, strerror(errno)));
-       fprintf(stderr, "syncpipe %s halting: Write error - %s\n",
-                       procname, strerror(errno));
+    errno = 0;
+    splitsize = g_ascii_strtoull(cmdargs->argv[7], NULL, 10);
+    if (errno != 0) {
+        error("error [taper PORT-WRITE: Invalid splitsize %s]",
+              cmdargs->argv[7]);
+        g_assert_not_reached();
+    }
+    
+    if (strcmp(cmdargs->argv[8], "NULL") == 0) {
+        split_diskbuffer = NULL;
     } else {
-       dbprintf(("syncpipe %s halting: Write "
-                       SSIZE_T_FMT " bytes short of " SSIZE_T_FMT "\n",
-                       procname, (SSIZE_T_FMT_TYPE)(rc - expected),
-                       (SSIZE_T_FMT_TYPE)expected));
-       fprintf(stderr, "syncpipe %s halting: Write "
-                       SSIZE_T_FMT " bytes short of " SSIZE_T_FMT "\n",
-                       procname, (SSIZE_T_FMT_TYPE)(rc - expected),
-                       (SSIZE_T_FMT_TYPE)expected);
+        split_diskbuffer = g_strdup(cmdargs->argv[8]);
     }
-    /* Halt the other side if it's still alive */
-    buf[0] = 'H';
-    memset(&buf[1], 0, SIZEOF(int));
-    if (write(putpipe, buf, SIZEOF(buf)))
-       return;
-}
-
-int
-syncpipe_get(
-    int *intp)
-{
-    ssize_t rc;
-    char buf[SIZEOF(char) + SIZEOF(int)];
-
-    memset(buf, 0, sizeof(buf));
-    rc = fullread(getpipe, buf, SIZEOF(buf));
-    if (rc != (ssize_t)sizeof(buf)) {
-       syncpipe_read_error(rc, (ssize_t)sizeof(buf));
-       return (-1);
+    
+    errno = 0;
+    fallback_splitsize = g_ascii_strtoull(cmdargs->argv[9], NULL, 10);
+    if (errno != 0) {
+        error("error [taper PORT-WRITE: Invalid fallback_splitsize %s]",
+              cmdargs->argv[9]);
+        g_assert_not_reached();
     }
 
-    if (debug_taper >= 1 && *buf != 'R' && *buf != 'W') {
-       taper_debug(1, ("taper: %c: getc %c\n", *procname, *buf));
+    dump_state.id_string = g_strdup_printf("%s:%s.%d", dump_state.hostname,
+                                           dump_state.diskname,
+                                          dump_state.level);
+    
+    if (!open_read_socket(&dump_state, split_diskbuffer, splitsize,
+                          fallback_splitsize)) {
+        free(split_diskbuffer);
+        return;
     }
+    free(split_diskbuffer);
 
-    memcpy(intp, &buf[1], SIZEOF(int));
-    return (int)buf[0];
-}
-
-int
-syncpipe_getint(void)
-{
-    ssize_t rc;
-    int i = 0;
+    run_device_output(state, &dump_state);
 
-    rc = fullread(getpipe, &i, SIZEOF(i));
-    if (rc != (ssize_t)sizeof(i)) {
-       syncpipe_read_error(rc, (ssize_t)sizeof(i));
-       return (-1);
-    }
-
-    return (i);
+    free_dump_info(&dump_state);
 }
 
-
-char *
-syncpipe_getstr(void)
-{
-    ssize_t rc;
-    int len;
-    char *str;
-
-    if ((len = syncpipe_getint()) <= 0) {
-       fprintf(stderr, "syncpipe %s halting: Protocol error - "
-                       "Invalid string length (%d)\n", procname, len);
-       syncpipe_put('H', 0); /* Halt the other side */
-       exit(1);
-       /*NOTREACHED*/
+/* Handle a FILE_WRITE command. */
+static void process_file_write(taper_state_t * state,
+                               struct cmdargs * cmdargs) {
+    dump_info_t dump_state;
+    char * holding_disk_file;
+    guint64 splitsize;
+    char * argnames[] = {"command",               /* 1 */
+                        "handle",                /* 2 */
+                         "filename",              /* 3 */
+                         "hostname",              /* 4 */
+                         "diskname",              /* 5 */
+                         "level",                 /* 6 */
+                         "datestamp",             /* 7 */
+                         "splitsize",             /* 8 */
+                          NULL };
+
+    validate_args(FILE_WRITE, cmdargs, argnames);
+
+    dump_state.handle = g_strdup(cmdargs->argv[2]);
+    holding_disk_file = unquote_string(cmdargs->argv[3]);
+    dump_state.hostname = g_strdup(cmdargs->argv[4]);
+    dump_state.diskname = unquote_string(cmdargs->argv[5]);
+    
+    errno = 0;
+    dump_state.level = strtol(cmdargs->argv[6], NULL, 10);
+    if (errno != 0) {
+        error("error [taper FILE-WRITE: Invalid dump level %s]",
+              cmdargs->argv[5]);
+        g_assert_not_reached();
     }
+    
+    dump_state.timestamp = strdup(cmdargs->argv[7]);
 
-    str = alloc((size_t)len);
-
-    rc = fullread(getpipe, str, (size_t)len);
-    if (rc != (ssize_t)len) {
-       syncpipe_read_error(rc, (ssize_t)len);
-       return (NULL);
+    errno = 0;
+    splitsize = g_ascii_strtoull(cmdargs->argv[8], NULL, 10);
+    if (errno != 0) {
+        error("error [taper FILE-WRITE: Invalid splitsize %s]",
+              cmdargs->argv[8]);
+        g_assert_not_reached();
     }
-    return (str);
-}
-
 
-int
-syncpipe_put(
-    int chi,
-    int intval)
-{
-    char buf[sizeof(char) + sizeof(int)];
-    ssize_t    rc;
+    dump_state.id_string = g_strdup_printf("%s:%s.%d", dump_state.hostname,
+                                           dump_state.diskname,
+                                          dump_state.level);
+    
+    dump_state.source = taper_source_new(dump_state.handle, FILE_WRITE,
+                                         holding_disk_file, -1,
+                                         NULL, splitsize, -1);
+    /* FIXME: This should be handled properly. */
+    g_assert(dump_state.source != NULL);
 
-    buf[0] = (char)chi;
-    memcpy(&buf[1], &intval, SIZEOF(int));
-    if (debug_taper >= 1 && buf[0] != 'R' && buf[0] != 'W') {
-       taper_debug(1, ("taper: %c: putc %c\n",*procname,buf[0]));
-    }
+    run_device_output(state, &dump_state);
 
-    rc = fullwrite(putpipe, buf, SIZEOF(buf));
-    if (rc != (ssize_t)sizeof(buf)) {
-       syncpipe_write_error(rc, (ssize_t)sizeof(buf));
-       return (-1);
-    }
-    return (0);
+    free_dump_info(&dump_state);
+    amfree(holding_disk_file);
 }
 
-int
-syncpipe_putint(
-    int i)
-{
-    ssize_t    rc;
-
-    rc = fullwrite(putpipe, &i, SIZEOF(i));
-    if (rc != (ssize_t)sizeof(i)) {
-       syncpipe_write_error(rc, (ssize_t)sizeof(i));
-       return (-1);
-       /* NOTREACHED */
-    }
-    return (0);
+/* Send QUITTING message to driver and associated logging. Always
+   returns false. */
+static gboolean send_quitting(taper_state_t * state) {
+    putresult(QUITTING, "\n");
+    g_fprintf(stderr,"taper: DONE\n");
+    cleanup(state);
+    return FALSE;
 }
 
-int
-syncpipe_putstr(
-    const char *str)
-{
-    ssize_t n, rc;
-
-    if(!str)
-       str = "UNKNOWN syncpipe_putstr STRING";
+/* This function recieves the START_TAPER command from driver, and
+   returns the attached timestamp. */
+static gboolean find_first_tape(taper_state_t * state) {
+    cmd_t cmd;
+    /* Note: cmdargs.argv is never freed. In the entire Amanda codebase. */
+    struct cmdargs cmdargs;
+    tape_search_request_t search_request;
+    GThread * tape_search = NULL;
+    gboolean use_threads;
 
-    n = (ssize_t)strlen(str) + 1;                      /* send '\0' as well */
-    syncpipe_putint((int)n);
+    /* We save the value here in case it changes while we're running. */
+    use_threads = g_thread_supported();
 
-    rc = fullwrite(putpipe, str, (size_t)n);
-    if (rc != n) {
-       syncpipe_write_error(rc, n);
-       return (-1);
-    }
-    return (0);
-}
-\f
-/*
- * ========================================================================
- * TAPE MANIPULATION SUBSYSTEM
- *
- */
-int label_tape(void);
-
-/* local functions */
-
-/* return 0 on success              */
-/* return 1 on error and set errstr */
-int
-label_tape(void)
-{  
-    char *conf_tapelist_old = NULL;
-    char *result;
-    static int first_call = 1;
-    char *timestamp;
-    char *error_msg = NULL;
-    char *s, *r;
-    int slot = -1;
-    int scan_result;
-
-    amfree(label);
-    amfree(tapedev);
-    if ((scan_result = taper_scan(NULL, &label, &timestamp, &tapedev, CHAR_taperscan_output_callback, &error_msg)) < 0) {
-       fprintf(stderr, "%s\n", error_msg);
-       errstr = error_msg;
-       error_msg = NULL;
-       amfree(timestamp);
-       return 0;
+    search_request.state = state;
+    search_request.prolong = TRUE;
+    search_request.errmsg = NULL;
+    
+    if (use_threads) {
+        tape_search = g_thread_create(tape_search_thread,
+                                      &search_request, TRUE, NULL);
     }
-    amfree(timestamp);
 
-    if(error_msg) {
-       s = error_msg; r = NULL;
-       while((s=strstr(s,"slot "))) { s += 5; r=s; };
-       if(r) {
-           slot = atoi(r);
-       }
-       amfree(error_msg);
+    cmd = getcmd(&cmdargs);
+
+    switch (cmd) {
+    case START_TAPER: {
+        gboolean search_result;
+        state->driver_start_time = strdup(cmdargs.argv[2]);
+        if (use_threads) {
+            search_result = GPOINTER_TO_INT(g_thread_join(tape_search));
+        } else {
+            search_result =
+                GPOINTER_TO_INT(tape_search_thread(&search_request));
+        }
+        if (search_result) {
+            putresult(TAPER_OK, "\n");
+        } else {
+            putresult(TAPE_ERROR, "Could not find a tape to use.\n");
+           log_add(L_ERROR, "no-tape [%s]", "Could not find a tape to use");
+           if (search_request.errmsg != NULL) {
+               char *c, *c1;
+               c = c1 = search_request.errmsg;
+               while (*c != '\0') {
+                   if (*c == '\n') {
+                       *c = '\0';
+                       log_add(L_WARNING,"%s", c1);
+                       c1 = c+1;
+                   }
+                   c++;
+               }
+               if (strlen(c1) > 1 )
+                   log_add(L_WARNING,"%s", c1);
+           }
+        }
+       amfree(search_request.errmsg);
+        return TRUE;
     }
-    if ((tape_fd = tape_open(tapedev, O_WRONLY)) == -1) {
-       if (errno == EACCES) {
-           errstr = newstralloc2(errstr,
-                                "writing label: tape is write protected or I don't have write permission on ", tapedev);
-       } else {
-           errstr = newstralloc2(errstr,
-                                 "writing label: ", strerror(errno));
-       }
-       return 0;
+    case QUIT:
+        search_request.prolong = FALSE;
+        if (use_threads) {
+            g_thread_join(tape_search);
+        }
+        return send_quitting(state);
+    default:
+        error("error [file_reader_side cmd %d argc %d]", cmd, cmdargs.argc);
     }
 
-    tapefd_setinfo_length(tape_fd, tapetype_get_length(tt));
-
-    tapefd_setinfo_datestamp(tape_fd, taper_timestamp);
-    tapefd_setinfo_disk(tape_fd, label);
-    result = tapefd_wrlabel(tape_fd, taper_timestamp, label, tt_blocksize);
-    if (result != NULL) {
-       errstr = newstralloc(errstr, result);
-       return 0;
-    }
+    g_assert_not_reached();
+}
 
-    /* Output a description of what we just did. A result of '3' from taper_scan
-     * means that a new tape was found and will be labeled. */
-    if (slot > -1) {
-       fprintf(stderr, _("taper: slot: %d wrote label `%s' date `%s'\n"), slot, label, taper_timestamp);
-       if (scan_result == 3)
-           log_add(L_INFO, _("Wrote new label `%s' to new (non-amanda) tape in slot %d"), label, slot);
-    } else {
-       fprintf(stderr, _("taper: wrote label `%s' date `%s'\n"), label, taper_timestamp);
-       if (scan_result == 3)
-           log_add(L_INFO, _("Wrote new label `%s' to new (non-amanda) tape"), label);
-    }
-    fflush(stderr);
-
-#ifdef HAVE_LIBVTBLC
-    /* store time for the first volume entry */
-    time(&raw_time);
-    tape_timep = localtime(&raw_time);
-    strftime(start_datestr, 20, "%T %D", tape_timep);
-    fprintf(stderr, "taper: got vtbl start time: %s\n", start_datestr);
-    fflush(stderr);
-#endif /* HAVE_LIBVTBLC */
-
-    if (strcmp(label, FAKE_LABEL) != 0) {
-       if (cur_tape == 0) {
-           conf_tapelist_old = stralloc2(conf_tapelist, ".yesterday");
-       } else {
-           char cur_str[NUM_STR_SIZE];
-
-           snprintf(cur_str, SIZEOF(cur_str), "%d", cur_tape - 1);
-           conf_tapelist_old = vstralloc(conf_tapelist,
-                                         ".today.", cur_str, NULL);
-       }
-
-       if (write_tapelist(conf_tapelist_old)) {
-           error("could not write tapelist: %s", strerror(errno));
-           /*NOTREACHED*/
-       }
-       amfree(conf_tapelist_old);
-
-       remove_tapelabel(label);
-       add_tapelabel(taper_timestamp, label);
-       if (write_tapelist(conf_tapelist)) {
-           error("could not write tapelist: %s", strerror(errno));
-           /*NOTREACHED*/
-       }
-    }
+/* In running mode (not startup mode), get a command from driver and
+   deal with it. */
+static gboolean process_driver_command(taper_state_t * state) {
+    cmd_t cmd;
+    struct cmdargs cmdargs;
+    char * q;
 
-    log_add(L_START, "datestamp %s label %s tape %d",
-           taper_timestamp, label, cur_tape);
-    if (first_call && strcmp(label, FAKE_LABEL) == 0) {
-       first_call = 0;
-       log_add(L_WARNING, "tapedev is %s, dumps will be thrown away", tapedev);
+    /* This will return QUIT if driver has died. */
+    cmd = getcmd(&cmdargs);
+    switch (cmd) {
+    case PORT_WRITE:
+        /*
+         * PORT-WRITE
+         *   handle
+         *   hostname
+         *   features
+         *   diskname
+         *   level
+         *   datestamp
+         *   splitsize
+         *   split_diskbuffer
+         */
+        process_port_write(state, &cmdargs);
+        break;
+        
+    case FILE_WRITE:
+        /*
+         * FILE-WRITE
+         *   handle
+         *   filename
+         *   hostname
+         *   features
+         *   diskname
+         *   level
+         *   datestamp
+         *   splitsize
+         */
+        process_file_write(state, &cmdargs);
+        break;
+        
+    case QUIT:
+        return send_quitting(state);
+    default:
+        if (cmdargs.argc >= 1) {
+            q = squote(cmdargs.argv[1]);
+        } else if (cmdargs.argc >= 0) {
+            q = squote(cmdargs.argv[0]);
+        } else {
+            q = stralloc("(no input?)");
+        }
+        putresult(BAD_COMMAND, "%s\n", q);
+        amfree(q);
+        break;
     }
 
-    total_tape_used=(off_t)0;
-    total_tape_fm = 0;
-
-    return 1;
+    return TRUE;
 }
 
-/* return 0 on error and set errstr */
-/* return 1 on success              */
-int
-first_tape(
-    char *new_datestamp)
-{
-    if ((have_changer = changer_init()) < 0) {
-       error("changer initialization failed: %s", strerror(errno));
-       /*NOTREACHED*/
-    }
-    changer_debug = 1;
+int main(int argc, char ** argv) {
+    char * tapelist_name;
+    int have_changer;
+    taper_state_t state;
+    config_overwrites_t *cfg_ovr = NULL;
+    char *cfg_opt = NULL;
 
-    taper_timestamp = newstralloc(taper_timestamp, new_datestamp);
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda");
+    
+    safe_fd(-1, 0);
+    set_pname("taper");
 
-    if (!label_tape())
-       return 0;
+    dbopen("server");
 
-    filenum = 0;
-    return 1;
-}
+    device_api_init();
+    init_taper_state(&state);
 
-int
-next_tape(
-    int writerror)
-{
-    end_tape(writerror);
+    /* Don't die when child closes pipe */
+    signal(SIGPIPE, SIG_IGN);
 
-    if (++cur_tape >= runtapes)
-       return 0;
+    g_fprintf(stderr, _("%s: pid %ld executable %s version %s\n"),
+           get_pname(), (long) getpid(), argv[0], version());
+    dbprintf(_("%s: pid %ld executable %s version %s\n"),
+              get_pname(), (long) getpid(), argv[0], version());
 
-    if (!label_tape()) {
-       return 0;
-    }
+    /* Process options */
 
-    filenum = 0;
-    return 1;
-}
+    cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
+    if(argc > 2) {
+        error("Too many arguments!\n");
+        g_assert_not_reached();
+    }
+    if (argc > 1)
+       cfg_opt = argv[1];
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL,
+               cfg_opt);
+    apply_config_overwrites(cfg_ovr);
 
-int
-end_tape(
-    int writerror)
-{
-    char *result;
-    int rc = 0;
-
-    if (tape_fd >= 0) {
-       log_add(L_INFO, "tape %s kb " OFF_T_FMT " fm %d %s", 
-               label,
-               (OFF_T_FMT_TYPE)((total_tape_used+(off_t)1023) / (off_t)1024),
-               total_tape_fm,
-               writerror? errstr : "[OK]");
-
-       fprintf(stderr, "taper: writing end marker. [%s %s kb "
-               OFF_T_FMT " fm %d]\n", label,
-               writerror? "ERR" : "OK",
-               (OFF_T_FMT_TYPE)((total_tape_used+(off_t)1023) / (off_t)1024),
-               total_tape_fm);
-       fflush(stderr);
-       if (! writerror) {
-           if (! write_filemark()) {
-               rc = 1;
-               goto common_exit;
-           }
+    safe_cd();
 
-           result = tapefd_wrendmark(tape_fd, taper_timestamp, tt_blocksize);
-           if (result != NULL) {
-               errstr = newstralloc(errstr, result);
-               rc = 1;
-               goto common_exit;
-           }
-       }
-    }
+    set_logerror(logerror);
 
-#ifdef HAVE_LINUX_ZFTAPE_H
-    if (tape_fd >= 0 && is_zftape(tapedev) == 1) {
-       /* rewind the tape */
-
-       if (tapefd_rewind(tape_fd) == -1 ) {
-           errstr = newstralloc2(errstr, "rewinding tape: ", strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       /* close the tape */
-
-       if (tapefd_close(tape_fd) == -1) {
-           errstr = newstralloc2(errstr, "closing tape: ", strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       tape_fd = -1;
-
-#ifdef HAVE_LIBVTBLC
-       /* update volume table */
-       fprintf(stderr, "taper: updating volume table ...\n");
-       fflush(stderr);
-    
-       if ((tape_fd = raw_tape_open(rawtapedev, O_RDWR)) == -1) {
-           if (errno == EACCES) {
-               errstr = newstralloc(errstr,
-                                    "updating volume table: tape is write protected");
-           } else {
-               errstr = newstralloc2(errstr,
-                                     "updating volume table: ", 
-                                     strerror(errno));
-           }
-           rc = 1;
-           goto common_exit;
-       }
-       /* read volume table */
-       if ((num_volumes = read_vtbl(tape_fd, volumes, vtbl_buffer,
-                                    &first_seg, &last_seg)) == -1 ) {
-           errstr = newstralloc2(errstr,
-                                 "reading volume table: ", 
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       /* set volume label and date for first entry */
-       vtbl_no = 0;
-       if (set_label(label, volumes, num_volumes, vtbl_no)) {
-           errstr = newstralloc2(errstr,
-                                 "setting label for entry 1: ",
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       /* date of start writing this tape */
-       if (set_date(start_datestr, volumes, num_volumes, vtbl_no)) {
-           errstr = newstralloc2(errstr,
-                                 "setting date for entry 1: ", 
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       /* set volume labels and dates for backup files */
-       for (vtbl_no = 1; vtbl_no <= num_volumes - 2; vtbl_no++) { 
-           fprintf(stderr,"taper: label %i: %s, date %s\n", 
-                   vtbl_no,
-                   vtbl_entry[vtbl_no].label,
-                   vtbl_entry[vtbl_no].date);
-           fflush(stderr);
-           if (set_label(vtbl_entry[vtbl_no].label, 
-                        volumes, num_volumes, vtbl_no)) {
-               errstr = newstralloc2(errstr,
-                                     "setting label for entry i: ", 
-                                     strerror(errno));
-               rc = 1;
-               goto common_exit;
-           }
-           if (set_date(vtbl_entry[vtbl_no].date, 
-                       volumes, num_volumes, vtbl_no)) {
-               errstr = newstralloc2(errstr,
-                                     "setting date for entry i: ",
-                                     strerror(errno));
-               rc = 1;
-               goto common_exit;
-           }
-       }
-       /* set volume label and date for last entry */
-       vtbl_no = num_volumes - 1;
-       if (set_label("AMANDA Tape End", volumes, num_volumes, vtbl_no)) {
-           errstr = newstralloc2(errstr,
-                                 "setting label for last entry: ", 
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       datestr = NULL; /* take current time */ 
-       if (set_date(datestr, volumes, num_volumes, vtbl_no)) {
-           errstr = newstralloc2(errstr,
-                                 "setting date for last entry 1: ", 
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }
-       /* write volume table back */
-       if (write_vtbl(tape_fd, volumes, vtbl_buffer, num_volumes, first_seg,
-                      op_mode == trunc)) {
-           errstr = newstralloc2(errstr,
-                                 "writing volume table: ", 
-                                 strerror(errno));
-           rc = 1;
-           goto common_exit;
-       }  
-
-       fprintf(stderr, "taper: updating volume table: done.\n");
-       fflush(stderr);
-#endif /* HAVE_LIBVTBLC */
-    }
-#endif /* !HAVE_LINUX_ZFTAPE_H */
+    check_running_as(RUNNING_AS_DUMPUSER);
 
-    /* close the tape and let the OS write the final filemarks */
+    dbrename(config_name, DBG_SUBDIR_SERVER);
 
-common_exit:
+    tapelist_name = config_dir_relative(getconf_str(CNF_TAPELIST));
 
-    if (tape_fd >= 0 && tapefd_close(tape_fd) == -1 && ! writerror) {
-       errstr = newstralloc2(errstr, "closing tape: ", strerror(errno));
-       rc = 1;
+    if (read_tapelist(tapelist_name) != 0) {
+        error("could not load tapelist \"%s\"", tapelist_name);
+        g_assert_not_reached();
     }
-    tape_fd = -1;
-    amfree(label);
-
-    return rc;
-}
+    amfree(tapelist_name);
 
+    have_changer = changer_init();
+    if (have_changer < 0) {
+        error("changer initialization failed: %s", strerror(errno));
+        g_assert_not_reached();
+    }
 
-int
-write_filemark(void)
-{
-    if (tapefd_weof(tape_fd, (off_t)1) == -1) {
-       errstr = newstralloc2(errstr, "writing filemark: ", strerror(errno));
-       return 0;
+    state.next_tape_label = NULL;
+    state.next_tape_device = NULL;
+    state.cur_tape = 0;
+    
+    if (!find_first_tape(&state)) {
+        return EXIT_SUCCESS;
     }
-    total_tape_fm++;
-    return 1;
+
+    while (process_driver_command(&state));
+    return EXIT_SUCCESS;
 }
index 63aa8bb807b957761397aaafd1de8c616bc08edb..8e7ae41ec14c369fc28295450fe39b1548aff9da 100644 (file)
@@ -2,9 +2,8 @@
  * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
  * 
  * This program is free software; you can 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.
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
  * 
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * interface information. */
 
 #include "amanda.h"
-#include "tapeio.h"
 #include "conffile.h"
 #include "changer.h"
 #include "tapefile.h"
+#include "device.h"
+#include "timestamp.h"
+#include "taperscan.h"
 
-int scan_read_label (char *dev, char *wantlabel,
+struct taper_scan_tracker_s {
+    GHashTable * scanned_slots;
+};
+
+int scan_read_label (char *dev, char * slot, char *wantlabel,
                        char** label, char** timestamp,
                        char**error_message);
 int changer_taper_scan (char *wantlabel, char** gotlabel, char** timestamp,
-                        char **tapedev, void (*)(void *data, char *msg),
-                       void *data);
+                        char **tapedev, taper_scan_tracker_t * tracker,
+                        TaperscanOutputFunctor output_functor,
+                        void *output_data,
+                        TaperscanProlongFunctor prolong_functor,
+                        void *prolong_data);
 int scan_slot (void *data, int rc, char *slotstr, char *device);
-int taper_scan (char* wantlabel, char** gotlabel, char** timestamp,
-               char** tapedev,
-               void taperscan_output_callback(void *data, char *msg),
-               void *data);
 char *find_brand_new_tape_label (void);
 void FILE_taperscan_output_callback (void *data, char *msg);
 void CHAR_taperscan_output_callback (void *data, char *msg);
@@ -61,86 +65,154 @@ void CHAR_taperscan_output_callback (void *data, char *msg);
  */
 
 /* This function checks the label of a single tape, which may or may not
- * have been loaded by the changer. With the addition of char *dev, it has
- * the same interface as taper_scan. 
+ * have been loaded by the changer. With the addition of char *dev, and *slot,
+ * it has the same interface as taper_scan. slot should be the slot where
+ * this tape is found, or NULL if no changer is in use.
  * Return value is the same as taper_scan.
  */
 int scan_read_label(
     char *dev,
+    char *slot,
     char *desired_label,
     char** label,
     char** timestamp,
     char** error_message)
 {
-    char *result = NULL;
+    Device * device;
+    char *labelstr;
+    ReadLabelStatusFlags label_status;
+
+    g_return_val_if_fail(dev != NULL, -1);
+
+    if (*error_message == NULL)
+       *error_message = stralloc("");
 
     *label = *timestamp = NULL;
-    result = tape_rdlabel(dev, timestamp, label);
-    if (result != NULL) {
-        if (CHECK_NOT_AMANDA_TAPE_MSG(result) &&
-            getconf_seen(CNF_LABEL_NEW_TAPES)) {
-            amfree(result);
-            
-            *label = find_brand_new_tape_label();
-            if (*label != NULL) {
-                *timestamp = stralloc("X");
-                vstrextend(error_message,
-                           "Found a non-amanda tape, will label it `",
-                           *label, "'.\n", NULL);
-                return 3;
-            }
-            vstrextend(error_message,
-                       "Found a non-amanda tape, but have no labels left.\n",
-                       NULL);
-            return -1;
-        }
+
+    device = device_open(dev);
+    if (device == NULL ) {
+        *error_message = newvstrallocf(*error_message,
+                                       _("%sError opening device %s.\n"),
+                                       *error_message, dev);
         amfree(*timestamp);
         amfree(*label);
-        vstrextend(error_message, result, "\n", NULL);
-        amfree(result);
         return -1;
     }
+
+    device_set_startup_properties_from_config(device);
+
+    label_status = device_read_label(device);
+    g_assert((device->volume_label != NULL) ==
+             (label_status == READ_LABEL_STATUS_SUCCESS));
     
-    if ((*label == NULL) || (*timestamp == NULL)) {
-       error("Invalid return from tape_rdlabel");
+    if (device->volume_label != NULL) { 
+        *label = g_strdup(device->volume_label);
+        *timestamp = strdup(device->volume_time);
+    } else if (label_status & READ_LABEL_STATUS_VOLUME_UNLABELED) {
+        g_object_unref(device);
+        if (!getconf_seen(CNF_LABEL_NEW_TAPES)) {
+            *error_message = newvstrallocf(*error_message,
+                                           _("%sFound a non-amanda tape.\n"),
+                                           *error_message);
+
+            return -1;
+        }
+        *label = find_brand_new_tape_label();
+        if (*label != NULL) {
+            *timestamp = stralloc("X");
+            *error_message = newvstrallocf(*error_message,
+                     _("%sFound a non-amanda tape, will label it `%s'.\n"),
+                                           *error_message, *label);
+
+            return 3;
+        }
+        *error_message = newvstrallocf(*error_message,
+                 _("%sFound a non-amanda tape, but have no labels left.\n"),
+                                       *error_message);
+
+        return -1;
+    } else {
+        char * label_errstr;
+        char ** label_strv =
+            g_flags_nick_to_strv(label_status, READ_LABEL_STATUS_FLAGS_TYPE);
+        
+        switch (g_strv_length(label_strv)) {
+        case 0:
+            label_errstr = g_strdup(_("Unknown error reading volume label.\n"));
+            break;
+
+        case 1:
+            label_errstr =
+                g_strdup_printf(_("Error reading volume label: %s\n"),
+                                *label_strv);
+           break;
+
+        default:
+            {
+                char * tmp_str = g_english_strjoinv(label_strv, "or");
+                label_errstr =
+                    g_strdup_printf(_("Error reading label: One of %s\n"),
+                                    tmp_str);
+                g_free(tmp_str);
+            }
+        }
+        
+        g_strfreev(label_strv);
+
+        *error_message = newvstralloc(*error_message, *error_message,
+                                      label_errstr, NULL);
+        g_free(label_errstr);
+        return -1;
     }
 
-    vstrextend(error_message, "read label `", *label, "', date `",
-               *timestamp, "'\n", NULL);
+    g_assert(*label != NULL && *timestamp != NULL);
+    g_object_unref(device);
+
+    *error_message = newvstrallocf(*error_message,
+                                   _("%sread label `%s', date `%s'.\n"),
+                                   *error_message, *label, *timestamp);
 
+    /* Register this with the barcode database, even if its not ours. */
+    if (slot != NULL) {
+        changer_label(slot, *label);
+    }
+    
     if (desired_label != NULL && strcmp(*label, desired_label) == 0) {
         /* Got desired label. */
         return 1;
     }
 
     /* Is this actually an acceptable tape? */
-    if (strcmp(*label, FAKE_LABEL) != 0) {
-        char *labelstr;
-        labelstr = getconf_str(CNF_LABELSTR);
-       if(!match(labelstr, *label)) {
-            vstrextend(error_message, "label ", *label,
-                       " doesn\'t match labelstr \"",
-                       labelstr, "\"\n", NULL);
-            return -1;
-       } else {
-            tape_t *tp;
-            if (strcmp(*timestamp, "X") == 0) {
-                /* new, labeled tape. */
-                return 1;
-            }
+    labelstr = getconf_str(CNF_LABELSTR);
+    if(!match(labelstr, *label)) {
+        *error_message = newvstrallocf(*error_message,
+                              _("%slabel \"%s\" doesn't match \"%s\".\n"),
+                                       *error_message, *label, labelstr);
 
-            tp = lookup_tapelabel(*label);
-         
-            if(tp == NULL) {
-                vstrextend(error_message, "label ", *label,
-                     " match labelstr but it not listed in the tapelist file.\n",
-                           NULL);
-                return -1;
-            } else if(tp != NULL && !reusable_tape(tp)) {
-                vstrextend(error_message, "cannot overwrite active tape ", *label,
-                           "\n", NULL);
-                return -1;
-            }
+        return -1;
+    } else {
+        tape_t *tp;
+        if (strcmp(*timestamp, "X") == 0) {
+            /* new, labeled tape. */
+            return 1;
+        }
+        
+        tp = lookup_tapelabel(*label);
+        
+        if(tp == NULL) {
+            *error_message =
+                newvstrallocf(*error_message, 
+                              _("%slabel \"%s\" matches labelstr but it is" 
+                                " not listed in the tapelist file.\n"),
+                              *error_message, *label);
+            return -1;
+        } else if(tp != NULL && !reusable_tape(tp)) {
+            *error_message = 
+                newvstrallocf(*error_message,
+                              _("%sTape with label %s is still active" 
+                                " and cannot be overwriten.\n"),
+                              *error_message, *label);
+            return -1;
         }
     }
   
@@ -148,19 +220,22 @@ int scan_read_label(
     return 2;
 }
 
-/* Interface is the same as taper_scan, with the addition of the tapedev
- * output. */
+/* Interface is the same as taper_scan, with some additional bookkeeping. */
 typedef struct {
     char *wantlabel;
     char **gotlabel;
     char **timestamp;
     char **error_message;
     char **tapedev;
+    char *slotstr; /* Best-choice slot number. */
     char *first_labelstr_slot;
     int backwards;
     int tape_status;
-    void (*taperscan_output_callback)(void *data, char *msg);
-    void *data;
+    TaperscanOutputFunctor output_callback;
+    void *output_data;
+    TaperscanProlongFunctor prolong_callback;
+    void * prolong_data;
+    taper_scan_tracker_t * persistent;
 } changertrack_t;
 
 int
@@ -174,32 +249,54 @@ scan_slot(
     changertrack_t *ct = ((changertrack_t*)data);
     int result;
 
+    if (ct->prolong_callback &&
+        !ct->prolong_callback(ct->prolong_data)) {
+        return 1;
+    }
+
+    if (ct->persistent != NULL) {
+        gpointer key;
+        gpointer value;
+        if (g_hash_table_lookup_extended(ct->persistent->scanned_slots,
+                                         slotstr, &key, &value)) {
+            /* We already returned this slot in a previous invocation,
+               skip it now. */
+            return 0;
+        }
+    }
+
+    if (*(ct->error_message) == NULL)
+       *(ct->error_message) = stralloc("");
+
     switch (rc) {
     default:
-       vstrextend(ct->error_message,
-                  "fatal changer error: slot ", slotstr, ": ",
-                  changer_resultstr, "\n", NULL);
+       *(ct->error_message) = newvstrallocf(*(ct->error_message),
+                  _("%sfatal changer error: slot %s: %s\n"),
+                  *(ct->error_message), slotstr, changer_resultstr);
         result = 1;
        break;
 
     case 1:
-       vstrextend(ct->error_message,
-                  "changer error: slot ", slotstr, ": ", changer_resultstr,
-                  "\n", NULL);
+       *(ct->error_message) = newvstrallocf(*(ct->error_message),
+                  _("%schanger error: slot %s: %s\n"),
+                  *(ct->error_message), slotstr, changer_resultstr);
         result = 0;
        break;
 
     case 0:
-       *(ct->error_message) = newvstralloc(*(ct->error_message), "slot ",
-                                           slotstr, ": ", NULL);
+       *(ct->error_message) = newvstrallocf(*(ct->error_message),
+                                       _("slot %s:"), slotstr);
        amfree(*ct->gotlabel);
        amfree(*ct->timestamp);
-        label_result = scan_read_label(device, ct->wantlabel, ct->gotlabel,
+        label_result = scan_read_label(device, slotstr,
+                                       ct->wantlabel, ct->gotlabel,
                                        ct->timestamp, ct->error_message);
         if (label_result == 1 || label_result == 3 ||
             (label_result == 2 && !ct->backwards)) {
             *(ct->tapedev) = stralloc(device);
             ct->tape_status = label_result;
+            amfree(ct->slotstr);
+            ct->slotstr = stralloc(slotstr);
             result = 1;
         } else {
            if ((label_result == 2) && (ct->first_labelstr_slot == NULL))
@@ -208,7 +305,7 @@ scan_slot(
        }
        break;
     }
-    ct->taperscan_output_callback(ct->data, *(ct->error_message));
+    ct->output_callback(ct->output_data, *(ct->error_message));
     amfree(*(ct->error_message));
     return result;
 }
@@ -217,20 +314,17 @@ static int
 scan_init(
     void *data,
     int rc,
-    int nslots,
+    G_GNUC_UNUSED int nslots,
     int backwards,
-    int searchable)
+    G_GNUC_UNUSED int searchable)
 {
     changertrack_t *ct = ((changertrack_t*)data);
-    
-    (void)nslots;      /* Quiet unused parameter warning */
-    (void)searchable;  /* Quiet unused parameter warning */
 
     if (rc) {
-       vstrextend(ct->error_message,
-                  "could not get changer info: ", changer_resultstr, "\n",
-                  NULL);
-       ct->taperscan_output_callback(ct->data, *(ct->error_message));
+       *(ct->error_message) = newvstrallocf(*(ct->error_message),
+               _("%scould not get changer info: %s\n"),
+               *(ct->error_message), changer_resultstr);
+       ct->output_callback(ct->output_data, *(ct->error_message));
        amfree(*(ct->error_message));
     }
 
@@ -244,8 +338,11 @@ changer_taper_scan(
     char **gotlabel,
     char **timestamp,
     char **tapedev,
-    void (*taperscan_output_callback)(void *data, char *msg),
-    void *data)
+    taper_scan_tracker_t * tracker,
+    TaperscanOutputFunctor taperscan_output_callback,
+    void *output_data,
+    TaperscanProlongFunctor prolong_callback,
+    void * prolong_data)
 {
     char *error_message = NULL;
     changertrack_t local_data;
@@ -261,40 +358,65 @@ changer_taper_scan(
     local_data.first_labelstr_slot = NULL;
     local_data.backwards = 0;
     local_data.tape_status = 0;
-    local_data.taperscan_output_callback  = taperscan_output_callback;
-    local_data.data = data;
+    local_data.output_callback  = taperscan_output_callback;
+    local_data.output_data = output_data;
+    local_data.prolong_callback = prolong_callback;
+    local_data.prolong_data = prolong_data;
+    local_data.persistent = tracker;
+    local_data.slotstr = NULL;
 
     changer_find(&local_data, scan_init, scan_slot, wantlabel);
     
     if (*(local_data.tapedev)) {
         /* We got it, and it's loaded. */
+        if (local_data.persistent != NULL && local_data.slotstr != NULL) {
+            g_hash_table_insert(local_data.persistent->scanned_slots,
+                                local_data.slotstr, NULL);
+        } else {
+            amfree(local_data.slotstr);
+        }
+       amfree(local_data.first_labelstr_slot);
         return local_data.tape_status;
     } else if (local_data.first_labelstr_slot) {
         /* Use plan B. */
-       result = changer_loadslot(local_data.first_labelstr_slot,
-                                 &outslotstr, tapedev);
-       amfree(outslotstr);
+        if (prolong_callback && !prolong_callback(prolong_data)) {
+            return -1;
+        }
+        result = changer_loadslot(local_data.first_labelstr_slot,
+                                  &outslotstr, tapedev);
+       amfree(local_data.first_labelstr_slot);
+        amfree(outslotstr);
         if (result == 0) {
-            result = scan_read_label(*tapedev, NULL, gotlabel, timestamp,
-                                    &error_message);
-           taperscan_output_callback(data, error_message);
-           amfree(error_message);
-           return result;
+           amfree(*gotlabel);
+           amfree(*timestamp);
+            result = scan_read_label(*tapedev, NULL, NULL,
+                                     gotlabel, timestamp,
+                                     &error_message);
+            taperscan_output_callback(output_data, error_message);
+            amfree(error_message);
+            if (result > 0 && local_data.persistent != NULL &&
+                local_data.slotstr != NULL) {
+                g_hash_table_insert(local_data.persistent->scanned_slots,
+                                    local_data.slotstr, NULL);
+            } else {
+                amfree(local_data.slotstr);
+            }
+            return result;
         }
     }
 
     /* Didn't find a tape. :-( */
     assert(local_data.tape_status <= 0);
-    taperscan_output_callback(data, "changer problem: ");
-    taperscan_output_callback(data, changer_resultstr);
     return -1;
 }
 
 int taper_scan(char* wantlabel,
                char** gotlabel, char** timestamp, char** tapedev,
-              void (*taperscan_output_callback)(void *data, char *msg),
-              void *data) {
-
+               taper_scan_tracker_t * tracker,
+               TaperscanOutputFunctor output_functor,
+               void *output_data,
+               TaperscanProlongFunctor prolong_functor,
+              void *prolong_data) {
     char *error_message = NULL;
     int result;
     *gotlabel = *timestamp = NULL;
@@ -309,19 +431,19 @@ int taper_scan(char* wantlabel,
 
     if (changer_init()) {
         result =  changer_taper_scan(wantlabel, gotlabel, timestamp,
-                                    tapedev,
-                                    taperscan_output_callback, data);
-    }
-    else {
+                                    tapedev, tracker,
+                                     output_functor, output_data,
+                                     prolong_functor, prolong_data);
+    } else {
+        /* Note that the tracker is not used in this case. */
        *tapedev = stralloc(getconf_str(CNF_TAPEDEV));
        if (*tapedev == NULL) {
            result = -1;
-           taperscan_output_callback(data, "No tapedev spefified");
+           output_functor(output_data, _("No tapedev specified"));
        } else {
-           *tapedev = stralloc(*tapedev);
-           result =  scan_read_label(*tapedev, wantlabel,
-                                     gotlabel, timestamp, &error_message);
-           taperscan_output_callback(data, error_message);
+           result =  scan_read_label(*tapedev, NULL, wantlabel, gotlabel,
+                                      timestamp, &error_message);
+            output_functor(output_data, error_message);
            amfree(error_message);
        }
     }
@@ -352,7 +474,7 @@ find_brand_new_tape_label(void)
     auto_len = -1; /* Only find the first '%' */
     while (*format != '\0') {
         if (label_len + 4 > AUTO_LABEL_MAX_LEN) {
-            fprintf(stderr, "Auto label format is too long!\n");
+            g_fprintf(stderr, _("Auto label format is too long!\n"));
             return NULL;
         }
 
@@ -381,17 +503,17 @@ find_brand_new_tape_label(void)
     }
 
     if (auto_pos == NULL) {
-        fprintf(stderr, "Auto label template contains no '%%'!\n");
+        g_fprintf(stderr, _("Auto label template contains no '%%'!\n"));
         return NULL;
     }
 
-    snprintf(tmpfmt, SIZEOF(tmpfmt), "%%0" SIZE_T_FMT "d",
-            (SIZE_T_FMT_TYPE)auto_len);
+    g_snprintf(tmpfmt, SIZEOF(tmpfmt), "%%0%zdd",
+            (size_t)auto_len);
 
     for (i = 1; i < INT_MAX; i ++) {
-        snprintf(tmpnum, SIZEOF(tmpnum), tmpfmt, i);
+        g_snprintf(tmpnum, SIZEOF(tmpnum), tmpfmt, i);
         if (strlen(tmpnum) != (size_t)auto_len) {
-            fprintf(stderr, "All possible auto-labels used.\n");
+            g_fprintf(stderr, _("All possible auto-labels used.\n"));
             return NULL;
         }
 
@@ -401,7 +523,7 @@ find_brand_new_tape_label(void)
         if (tp == NULL) {
             /* Got it. Double-check that this is a labelstr match. */
             if (!match(getconf_str(CNF_LABELSTR), newlabel)) {
-                fprintf(stderr, "New label %s does not match labelstr %s!\n",
+                g_fprintf(stderr, _("New label %s does not match labelstr %s from amanda.conf\n"),
                         newlabel, getconf_str(CNF_LABELSTR));
                 return 0;
             }
@@ -410,7 +532,7 @@ find_brand_new_tape_label(void)
     }
 
     /* Should not get here unless you have over two billion tapes. */
-    fprintf(stderr, "Taper internal error in find_brand_new_tape_label.");
+    g_fprintf(stderr, _("Taper internal error in find_brand_new_tape_label."));
     return 0;
 }
 
@@ -423,9 +545,9 @@ FILE_taperscan_output_callback(
     if(strlen(msg) == 0) return;
 
     if(data)
-       fprintf((FILE *)data, "%s", msg);
+       g_fprintf((FILE *)data, "%s", msg);
     else
-       printf("%s", msg);
+       g_printf("%s", msg);
 }
 
 void
@@ -443,3 +565,21 @@ CHAR_taperscan_output_callback(
     else
        *s = stralloc(msg);
 }
+
+taper_scan_tracker_t * taper_scan_tracker_new(void) {
+    taper_scan_tracker_t * rval = malloc(sizeof(*rval));
+    
+    rval->scanned_slots = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                                g_free, NULL);
+
+    return rval;
+}
+
+void taper_scan_tracker_free(taper_scan_tracker_t * tracker) {
+    if (tracker->scanned_slots != NULL) {
+        g_hash_table_destroy(tracker->scanned_slots);
+    }
+    
+    free(tracker);
+}
+
index fc0f7ca1124dc991f8d0b59032c19ae8bfea448a..301401815873a1d2d6cb5b66ff0f1cf9de510d0f 100644 (file)
@@ -2,9 +2,8 @@
  * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
  * 
  * This program is free software; you can 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.
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
  * 
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -30,6 +29,9 @@
 #ifndef TAPERSCAN_H
 #define TAPERSCAN_H
 
+#include <device.h>
+
+typedef struct taper_scan_tracker_s taper_scan_tracker_t;
 
 /* taper_scan(): Scans the changer to find a tape to use. Reads the tape
  *               label, or invents a new one if label_new_tapes is in use.
  *               re-read, because there may not actually exist a label
  *               on-tape (for WORM or newly-labeled media).
  *
+ *               This function may be run multiple times consecutively with
+ *               the same tracker; each run will return a different elegible
+ *               tape. The 
+ *
  * Inputs: wantlabel
  * Outputs: Returns: -1 if an error occured or no tape was found.
  *                    1 if the most desirable tape was found.
  *         timestamp: What the timestamp string on-tape was. May be "X".
  *     error_message: Debugging output.
  *           tapedev: What device to use from now on.
+ *           tracker: Pointer to an allocated taper_scan_tracker_t, used for
+ *                    persistance between runs.
  *
  * All returned strings are newly-allocated. */
 
+typedef void (*TaperscanOutputFunctor)(void * data, char * msg);
+typedef gboolean (*TaperscanProlongFunctor)(void *data);
+
 int taper_scan (char* wantlabel,
-                  char** gotlabel, char** timestamp,
-                  char **tapedev,
-                 void taperscan_output_callback(void *data, char *msg),
-                 void *data);
+                char** gotlabel, char** timestamp,
+                char **tapedev,
+                taper_scan_tracker_t* tracker,
+                TaperscanOutputFunctor output_functor,
+                void *output_data,
+                TaperscanProlongFunctor prolong_functor,
+                void *prolong_data
+                );
 void FILE_taperscan_output_callback(void *data, char *msg);
 void CHAR_taperscan_output_callback(void *data, char *msg);
 
+/* Returns a newly allocated tracker object. */
+taper_scan_tracker_t* taper_scan_tracker_new(void);
+
+/* Frees a tracker object. */
+void taper_scan_tracker_free(taper_scan_tracker_t*);
+
 #endif /* !TAPERSCAN_H */
index 68b48b5d587d455df9215dc26a9e0178fbb8976b..e12918bee3e9a4fd15028cbea766f162a01160cc 100644 (file)
@@ -1,13 +1,18 @@
 # Makefile for Amanda tape library.
 
+include $(top_srcdir)/config/automake/precompile.am
+
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
 
-lib_LTLIBRARIES =      libamtape.la
+amlib_LTLIBRARIES =    libamtape.la
 LIB_EXTENSION = la
 
 sbin_PROGRAMS=          ammt amdd amtapetype
@@ -19,6 +24,7 @@ libamtape_la_SOURCES =        output-file.c \
                        tapeio.c
 
 libamtape_la_LDFLAGS =  -release $(VERSION)
+libamtape_la_LIBADD = ../common-src/libamanda.$(LIB_EXTENSION)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -48,23 +54,9 @@ noinst_HEADERS =     \
                        output-tape.h \
                        tapeio.h
 
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS) $(amlibexec_SCRIPTS)
 
 amtapeio_SOURCES = amtapeio.test.c
 amtapeio_LDADD =       ../common-src/libamanda.$(LIB_EXTENSION) \
@@ -94,7 +86,7 @@ lint:
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index acdcd45246fe4d158826fdbe0d7edd2ec659adbc..456e0c340c8962cf9c8181d36a85b0bb2c6842b7 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006  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.
 
 # Makefile for Amanda tape library.
 
+# vim:ft=automake
+
 
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
@@ -41,49 +39,118 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in \
+       $(top_srcdir)/config/automake/precompile.am
 sbin_PROGRAMS = ammt$(EXEEXT) amdd$(EXEEXT) amtapetype$(EXEEXT)
 EXTRA_PROGRAMS = $(am__EXEEXT_1)
 subdir = tape-src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+am__aclocal_m4_deps =  \
+       $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \
+       $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \
+       $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \
+       $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \
+       $(top_srcdir)/config/macro-archive/xsltproc.m4 \
+       $(top_srcdir)/config/amanda/amplot.m4 \
+       $(top_srcdir)/config/amanda/bsd-security.m4 \
+       $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
+       $(top_srcdir)/config/amanda/bsdudp-security.m4 \
+       $(top_srcdir)/config/amanda/changer.m4 \
+       $(top_srcdir)/config/amanda/components.m4 \
+       $(top_srcdir)/config/amanda/compress.m4 \
+       $(top_srcdir)/config/amanda/config.m4 \
+       $(top_srcdir)/config/amanda/debugging.m4 \
+       $(top_srcdir)/config/amanda/defaults.m4 \
+       $(top_srcdir)/config/amanda/devprefix.m4 \
+       $(top_srcdir)/config/amanda/dirs.m4 \
+       $(top_srcdir)/config/amanda/documentation.m4 \
+       $(top_srcdir)/config/amanda/dumpers.m4 \
+       $(top_srcdir)/config/amanda/flags.m4 \
+       $(top_srcdir)/config/amanda/flock.m4 \
+       $(top_srcdir)/config/amanda/funcs.m4 \
+       $(top_srcdir)/config/amanda/getfsent.m4 \
+       $(top_srcdir)/config/amanda/i18n.m4 \
+       $(top_srcdir)/config/amanda/ipv6.m4 \
+       $(top_srcdir)/config/amanda/krb4-security.m4 \
+       $(top_srcdir)/config/amanda/krb5-security.m4 \
+       $(top_srcdir)/config/amanda/lfs.m4 \
+       $(top_srcdir)/config/amanda/libs.m4 \
+       $(top_srcdir)/config/amanda/net.m4 \
+       $(top_srcdir)/config/amanda/progs.m4 \
+       $(top_srcdir)/config/amanda/readdir.m4 \
+       $(top_srcdir)/config/amanda/readline.m4 \
+       $(top_srcdir)/config/amanda/rsh-security.m4 \
+       $(top_srcdir)/config/amanda/s3-device.m4 \
+       $(top_srcdir)/config/amanda/shmem.m4 \
+       $(top_srcdir)/config/amanda/ssh-security.m4 \
+       $(top_srcdir)/config/amanda/summary.m4 \
+       $(top_srcdir)/config/amanda/swig.m4 \
+       $(top_srcdir)/config/amanda/syshacks.m4 \
+       $(top_srcdir)/config/amanda/tape.m4 \
+       $(top_srcdir)/config/amanda/types.m4 \
+       $(top_srcdir)/config/amanda/userid.m4 \
+       $(top_srcdir)/config/amanda/version.m4 \
        $(top_srcdir)/config/gnulib/alloca.m4 \
        $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/base64.m4 \
        $(top_srcdir)/config/gnulib/eoverflow.m4 \
        $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/float_h.m4 \
+       $(top_srcdir)/config/gnulib/fsusage.m4 \
        $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gettimeofday.m4 \
        $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
-       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/include_next.m4 \
        $(top_srcdir)/config/gnulib/inet_ntop.m4 \
        $(top_srcdir)/config/gnulib/intmax_t.m4 \
-       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
-       $(top_srcdir)/config/gnulib/lib-ld.m4 \
-       $(top_srcdir)/config/gnulib/lib-link.m4 \
-       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
        $(top_srcdir)/config/gnulib/lock.m4 \
-       $(top_srcdir)/config/gnulib/longdouble.m4 \
        $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/malloc.m4 \
+       $(top_srcdir)/config/gnulib/mkdtemp.m4 \
        $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
        $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
-       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/physmem.m4 \
+       $(top_srcdir)/config/gnulib/safe-read.m4 \
+       $(top_srcdir)/config/gnulib/safe-write.m4 \
        $(top_srcdir)/config/gnulib/snprintf.m4 \
        $(top_srcdir)/config/gnulib/socklen.m4 \
        $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/ssize_t.m4 \
        $(top_srcdir)/config/gnulib/stdbool.m4 \
-       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/stdint.m4 \
+       $(top_srcdir)/config/gnulib/stdio_h.m4 \
+       $(top_srcdir)/config/gnulib/stdlib_h.m4 \
        $(top_srcdir)/config/gnulib/strdup.m4 \
        $(top_srcdir)/config/gnulib/string_h.m4 \
        $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_stat_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_time_h.m4 \
+       $(top_srcdir)/config/gnulib/tempname.m4 \
+       $(top_srcdir)/config/gnulib/ulonglong.m4 \
+       $(top_srcdir)/config/gnulib/unistd_h.m4 \
        $(top_srcdir)/config/gnulib/vasnprintf.m4 \
        $(top_srcdir)/config/gnulib/visibility.m4 \
-       $(top_srcdir)/config/gnulib/wchar_t.m4 \
-       $(top_srcdir)/config/gnulib/wint_t.m4 \
-       $(top_srcdir)/config/gnulib/xsize.m4 \
-       $(top_srcdir)/configure.in
+       $(top_srcdir)/config/gnulib/wchar.m4 \
+       $(top_srcdir)/config/gettext-macros/gettext.m4 \
+       $(top_srcdir)/config/gettext-macros/iconv.m4 \
+       $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-ld.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-link.m4 \
+       $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \
+       $(top_srcdir)/config/gettext-macros/longlong.m4 \
+       $(top_srcdir)/config/gettext-macros/nls.m4 \
+       $(top_srcdir)/config/gettext-macros/po.m4 \
+       $(top_srcdir)/config/gettext-macros/progtest.m4 \
+       $(top_srcdir)/config/gettext-macros/size_max.m4 \
+       $(top_srcdir)/config/gettext-macros/stdint_h.m4 \
+       $(top_srcdir)/config/gettext-macros/wchar_t.m4 \
+       $(top_srcdir)/config/gettext-macros/wint_t.m4 \
+       $(top_srcdir)/config/gettext-macros/xsize.m4 \
+       $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -95,13 +162,16 @@ am__vpath_adj = case $$p in \
     *) f=$$p;; \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libamtape_la_LIBADD =
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)"
+amlibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(amlib_LTLIBRARIES)
+libamtape_la_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION)
 am_libamtape_la_OBJECTS = output-file.lo output-null.lo output-rait.lo \
        output-tape.lo tapeio.lo
 libamtape_la_OBJECTS = $(am_libamtape_la_OBJECTS)
+libamtape_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libamtape_la_LDFLAGS) $(LDFLAGS) -o $@
 am__EXEEXT_1 = amtapeio$(EXEEXT)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(sbin_PROGRAMS)
@@ -128,17 +198,18 @@ amtapetype_LDADD = $(LDADD)
 amtapetype_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
-       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-       $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libamtape_la_SOURCES) amdd.c ammt.c $(amtapeio_SOURCES) \
        $(amtapetype_SOURCES)
 DIST_SOURCES = $(libamtape_la_SOURCES) amdd.c ammt.c \
@@ -147,15 +218,14 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
+AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@
 AMLINT = @AMLINT@
 AMLINTFLAGS = @AMLINTFLAGS@
 AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
@@ -163,14 +233,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
 AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
 AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
-AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
 ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BASH = @BASH@
 BINARY_OWNER = @BINARY_OWNER@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -181,20 +256,19 @@ CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
 CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
 COMPRESS = @COMPRESS@
-CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
 CONFIG_DIR = @CONFIG_DIR@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DB_EXT = @DB_EXT@
 DD = @DD@
+DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@
 DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
 DEFAULT_CONFIG = @DEFAULT_CONFIG@
-DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
 DEFAULT_SERVER = @DEFAULT_SERVER@
 DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
 DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
@@ -208,60 +282,169 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
-ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
 EOVERFLOW = @EOVERFLOW@
 EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
-GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
-GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+FLOAT_H = @FLOAT_H@
 GETCONF = @GETCONF@
-GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
-GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GETTEXT = @GETTEXT@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
-GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GZIP = @GZIP@
+HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
 HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_IO_H = @HAVE_IO_H@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRNDUP = @HAVE_STRNDUP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE__BOOL = @HAVE__BOOL@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
 LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
 LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
-LL_FMT = @LL_FMT@
-LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
-LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
@@ -271,10 +454,24 @@ MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
 NETINET_IN_H = @NETINET_IN_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -285,24 +482,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PCAT = @PCAT@
 PERL = @PERL@
+PERLEXTLIBS = @PERLEXTLIBS@
+PERL_INC = @PERL_INC@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
 PRINT = @PRINT@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
-REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
-REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
-REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
 SETUID_GROUP = @SETUID_GROUP@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
 SSH = @SSH@
 STDBOOL_H = @STDBOOL_H@
+STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SVN = @SVN@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
+SYS_TIME_H = @SYS_TIME_H@
+USE_NLS = @USE_NLS@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -314,59 +545,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@
 VRESTORE = @VRESTORE@
 VXDUMP = @VXDUMP@
 VXRESTORE = @VXRESTORE@
-WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
-WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
-WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
-WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
-WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
-WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
-WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
-WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
-WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
-WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
-WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
-WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
-WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
-WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
-WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
-WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
-WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
-WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
-WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
-WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
-WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
-WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
-WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
-WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+WCHAR_H = @WCHAR_H@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XSLREL = @XSLREL@
 XSLTPROC = @XSLTPROC@
 XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
-ac_c = @ac_c@
-ac_ct_AR = @ac_ct_AR@
+YFLAGS = @YFLAGS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_n = @ac_n@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__tar = @am__tar@
 am__untar = @am__untar@
+amincludedir = @amincludedir@
+amlibdir = @amlibdir@
+amlibexecdir = @amlibexecdir@
+amperldir = @amperldir@
 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@
 gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
@@ -375,32 +593,41 @@ 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@
 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_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/gnulib
 
+AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
-lib_LTLIBRARIES = libamtape.la
+amlib_LTLIBRARIES = libamtape.la
 LIB_EXTENSION = la
 libamtape_la_SOURCES = output-file.c \
                        output-null.c \
@@ -409,6 +636,7 @@ libamtape_la_SOURCES = output-file.c \
                        tapeio.c
 
 libamtape_la_LDFLAGS = -release $(VERSION)
+libamtape_la_LIBADD = ../common-src/libamanda.$(LIB_EXTENSION)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -432,6 +660,10 @@ noinst_HEADERS = \
                        output-tape.h \
                        tapeio.h
 
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) $(sbin_SCRIPTS) \
+       dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS) $(amlibexec_SCRIPTS)
+
 amtapeio_SOURCES = amtapeio.test.c
 amtapeio_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
                        libamtape.$(LIB_EXTENSION) \
@@ -441,7 +673,7 @@ all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -470,38 +702,38 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
-       test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)"
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          if test -f $$p; then \
            f=$(am__strip_dir) \
-           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+           echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \
          else :; fi; \
        done
 
-uninstall-libLTLIBRARIES:
+uninstall-amlibLTLIBRARIES:
        @$(NORMAL_UNINSTALL)
-       @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          p=$(am__strip_dir) \
-         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \
        done
 
-clean-libLTLIBRARIES:
-       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-amlibLTLIBRARIES:
+       -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES)
+       @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \
          dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          test "$$dir" != "$$p" || dir=.; \
          echo "rm -f \"$${dir}/so_locations\""; \
          rm -f "$${dir}/so_locations"; \
        done
 libamtape.la: $(libamtape_la_OBJECTS) $(libamtape_la_DEPENDENCIES) 
-       $(LINK) -rpath $(libdir) $(libamtape_la_LDFLAGS) $(libamtape_la_OBJECTS) $(libamtape_la_LIBADD) $(LIBS)
+       $(libamtape_la_LINK) -rpath $(amlibdir) $(libamtape_la_OBJECTS) $(libamtape_la_LIBADD) $(LIBS)
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
        @list='$(sbin_PROGRAMS)'; for p in $$list; do \
          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          if test -f $$p \
@@ -529,16 +761,16 @@ clean-sbinPROGRAMS:
        done
 amdd$(EXEEXT): $(amdd_OBJECTS) $(amdd_DEPENDENCIES) 
        @rm -f amdd$(EXEEXT)
-       $(LINK) $(amdd_LDFLAGS) $(amdd_OBJECTS) $(amdd_LDADD) $(LIBS)
+       $(LINK) $(amdd_OBJECTS) $(amdd_LDADD) $(LIBS)
 ammt$(EXEEXT): $(ammt_OBJECTS) $(ammt_DEPENDENCIES) 
        @rm -f ammt$(EXEEXT)
-       $(LINK) $(ammt_LDFLAGS) $(ammt_OBJECTS) $(ammt_LDADD) $(LIBS)
+       $(LINK) $(ammt_OBJECTS) $(ammt_LDADD) $(LIBS)
 amtapeio$(EXEEXT): $(amtapeio_OBJECTS) $(amtapeio_DEPENDENCIES) 
        @rm -f amtapeio$(EXEEXT)
-       $(LINK) $(amtapeio_LDFLAGS) $(amtapeio_OBJECTS) $(amtapeio_LDADD) $(LIBS)
+       $(LINK) $(amtapeio_OBJECTS) $(amtapeio_LDADD) $(LIBS)
 amtapetype$(EXEEXT): $(amtapetype_OBJECTS) $(amtapetype_DEPENDENCIES) 
        @rm -f amtapetype$(EXEEXT)
-       $(LINK) $(amtapetype_LDFLAGS) $(amtapetype_OBJECTS) $(amtapetype_LDADD) $(LIBS)
+       $(LINK) $(amtapetype_OBJECTS) $(amtapetype_LDADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -557,22 +789,22 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapetype.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
@@ -583,10 +815,6 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
 
-distclean-libtool:
-       -rm -f libtool
-uninstall-info-am:
-
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
@@ -636,22 +864,21 @@ 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)'; for file in $$list; do \
-         case $$file in \
-           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
-           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
-         esac; \
+       @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; \
-         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
-         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
-           dir="/$$dir"; \
-           $(mkdir_p) "$(distdir)$$dir"; \
-         else \
-           dir=''; \
-         fi; \
          if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
            if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
              cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
            fi; \
@@ -666,8 +893,8 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)"; do \
-         test -z "$$dir" || $(mkdir_p) "$$dir"; \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
 install-exec: install-exec-am
@@ -696,14 +923,14 @@ maintainer-clean-generic:
        @echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+clean-am: clean-amlibLTLIBRARIES 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-libtool distclean-tags
+       distclean-tags
 
 dvi: dvi-am
 
@@ -715,16 +942,22 @@ info: info-am
 
 info-am:
 
-install-data-am:
+install-data-am: install-amlibLTLIBRARIES
 
-install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
-       @$(NORMAL_INSTALL)
-       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-dvi: install-dvi-am
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-am
 
 install-info: install-info-am
 
 install-man:
 
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -745,41 +978,36 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
-       uninstall-sbinPROGRAMS
+uninstall-am: uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-       clean-libLTLIBRARIES clean-libtool clean-sbinPROGRAMS ctags \
-       distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-tags distdir dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-exec install-exec-am install-exec-hook \
-       install-info install-info-am install-libLTLIBRARIES \
-       install-man install-sbinPROGRAMS install-strip installcheck \
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+       clean-amlibLTLIBRARIES clean-generic clean-libtool \
+       clean-sbinPROGRAMS ctags distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-amlibLTLIBRARIES 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 uninstall uninstall-am uninstall-info-am \
-       uninstall-libLTLIBRARIES uninstall-sbinPROGRAMS
-
-
-install-exec-hook:
-       @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
-       @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
-       for p in $$list; do \
-               pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
-       done
+       tags uninstall uninstall-am uninstall-amlibLTLIBRARIES \
+       uninstall-sbinPROGRAMS
+
+
+# A rule to make precompiler output from C files.  This is not used during
+# ordinary builds, but but can very useful in debugging problems on strange
+# architectures.  With this rule, we can ask users to 'make foo.i' and send
+# the result to us.
+#
+# It touches some automake internals ($COMPILE), but since it's not
+# build-critical, that's OK.
+%.i : %.c
+       $(COMPILE) -E -o $@ $<
 
 amtapeio.test.c: $(srcdir)/tapeio.c
        echo '#define TEST' >$@
@@ -804,7 +1032,7 @@ lint:
                (cd ../common-src; make listlibsrc);                            \
                f="$$f "`cat ../common-src/listlibsrc.output`;                  \
                echo $(LINT) $$f;                                               \
-               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
                    $(INCLUDES) $$f;                                            \
                if [ $$? -ne 0 ]; then                                          \
                    exit 1;                                                     \
index 4c7ba6020a874be7c7418650dd8ecc48bddec4e4..8a9e391bfa2338ba2cc0b943c17a794d4db75905 100644 (file)
@@ -30,15 +30,15 @@ static void usage(void);
 static void
 usage(void)
 {
-    fprintf(stderr, "usage: %s ", pgm);
-    fprintf(stderr, " [-d]");
-    fprintf(stderr, " [-l length]");
-    fprintf(stderr, " [if=input]");
-    fprintf(stderr, " [of=output]");
-    fprintf(stderr, " [bs=blocksize]");
-    fprintf(stderr, " [count=count]");
-    fprintf(stderr, " [skip=count]");
-    fprintf(stderr, "\n");
+    g_fprintf(stderr, _("usage: %s "), pgm);
+    g_fprintf(stderr, _(" [-d]"));
+    g_fprintf(stderr, _(" [-l length]"));
+    g_fprintf(stderr, _(" [if=input]"));
+    g_fprintf(stderr, _(" [of=output]"));
+    g_fprintf(stderr, _(" [bs=blocksize]"));
+    g_fprintf(stderr, _(" [count=count]"));
+    g_fprintf(stderr, _(" [skip=count]"));
+    g_fprintf(stderr, _("\n"));
     exit(1);
 }
 
@@ -66,6 +66,17 @@ main(
     off_t length = (off_t)0;
     int have_length = 0;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
+    fprintf(stderr, _("amdd is deprecated\n"));
+
     if((pgm = strrchr(argv[0], '/')) != NULL) {
        pgm++;
     } else {
@@ -75,7 +86,7 @@ main(
        switch(ch) {
        case 'd':
            debug_amdd = 1;
-           fprintf(stderr, "debug mode!\n");
+           g_fprintf(stderr, _("debug mode!\n"));
            break;
 
 #ifndef __lint
@@ -115,33 +126,33 @@ main(
        if(0 == strncmp("if", argv[optind], (size_t)len)) {
            if((infd = tape_open(eq + 1, O_RDONLY, 0)) < 0) {
                save_errno = errno;
-               fprintf(stderr, "%s: %s: ", pgm, eq + 1);
+               g_fprintf(stderr, "%s: %s: ", pgm, eq + 1);
                errno = save_errno;
                perror("open");
                return 1;
            }
            read_func = tapefd_read;
             if(debug_amdd) {
-               fprintf(stderr, "input opened \"%s\", got fd %d\n",
+               g_fprintf(stderr, _("input opened \"%s\", got fd %d\n"),
                                eq + 1, infd);
            }
        } else if(0 == strncmp("of", argv[optind], (size_t)len)) {
            if((outfd = tape_open(eq + 1, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) {
                save_errno = errno;
-               fprintf(stderr, "%s: %s: ", pgm, eq + 1);
+               g_fprintf(stderr, "%s: %s: ", pgm, eq + 1);
                errno = save_errno;
                perror("open");
                return 1;
            }
            write_func = tapefd_write;
             if(debug_amdd) {
-               fprintf(stderr, "output opened \"%s\", got fd %d\n",
+               g_fprintf(stderr, _("output opened \"%s\", got fd %d\n"),
                                eq + 1, outfd);
            }
            if(have_length) {
                if(debug_amdd) {
-                   fprintf(stderr, "length set to " OFF_T_FMT "\n",
-                       (OFF_T_FMT_TYPE)length);
+                   g_fprintf(stderr, _("length set to %lld\n"),
+                       (long long)length);
                }
                tapefd_setinfo_length(outfd, length);
            }
@@ -156,37 +167,34 @@ main(
                }
            }
            if(debug_amdd) {
-               fprintf(stderr, "blocksize set to " SIZE_T_FMT "\n",
-                       (SIZE_T_FMT_TYPE)blocksize);
+               g_fprintf(stderr, _("blocksize set to %zu\n"), blocksize);
            }
        } else if(0 == strncmp("count", argv[optind], (size_t)len)) {
            count = OFF_T_ATOI(eq + 1);
            have_count = 1;
            if(debug_amdd) {
-               fprintf(stderr, "count set to " OFF_T_FMT "\n",
-                       (OFF_T_FMT_TYPE)count);
+               g_fprintf(stderr, _("count set to %lld\n"), (long long)count);
            }
        } else if(0 == strncmp("skip", argv[optind], (size_t)len)) {
            skip = OFF_T_ATOI(eq + 1);
            if(debug_amdd) {
-               fprintf(stderr, "skip set to " OFF_T_FMT "\n",
-                       (OFF_T_FMT_TYPE)skip);
+               g_fprintf(stderr, _("skip set to %lld\n"), (long long)skip);
            }
        } else {
-           fprintf(stderr, "%s: bad argument: \"%s\"\n", pgm, argv[optind]);
+           g_fprintf(stderr, _("%s: bad argument: \"%s\"\n"), pgm, argv[optind]);
            return 1;
        }
     }
 
     if(0 == (buf = malloc(blocksize))) {
        save_errno = errno;
-       fprintf(stderr, "%s: ", pgm);
+       g_fprintf(stderr, "%s: ", pgm);
        errno = save_errno;
-       perror("malloc error");
+       perror(_("malloc error"));
        return 1;
     }
 
-    eq = "read error";
+    eq = _("read error");
     pread = fread = pwrite = fwrite = 0;
     while(0 < (len = (*read_func)(infd, buf, blocksize))) {
        if((skip -= (off_t)1) > (off_t)0) {
@@ -199,7 +207,7 @@ main(
        }
        len = (*write_func)(outfd, buf, (size_t)len);
        if(len < 0) {
-           eq = "write error";
+           eq = _("write error");
            break;
        } else if((size_t)len == blocksize) {
            fwrite++;
@@ -215,27 +223,27 @@ main(
     }
     if(len < 0) {
        save_errno = errno;
-       fprintf(stderr, "%s: ", pgm);
+       g_fprintf(stderr, "%s: ", pgm);
        errno = save_errno;
        perror(eq);
        res = 1;
     }
-    fprintf(stderr, "%d+%d in\n%d+%d out\n", fread, pread, fwrite, pwrite);
+    g_fprintf(stderr, _("%d+%d in\n%d+%d out\n"), fread, pread, fwrite, pwrite);
     if(read_func == tapefd_read) {
        if(0 != tapefd_close(infd)) {
            save_errno = errno;
-           fprintf(stderr, "%s: ", pgm);
+           g_fprintf(stderr, "%s: ", pgm);
            errno = save_errno;
-           perror("input close");
+           perror(_("input close"));
            res = 1;
        }
     }
     if(write_func == tapefd_write) {
        if(0 != tapefd_close(outfd)) {
            save_errno = errno;
-           fprintf(stderr, "%s: ", pgm);
+           g_fprintf(stderr, "%s: ", pgm);
            errno = save_errno;
-           perror("output close");
+           perror(_("output close"));
            res = 1;
        }
     }
index 6f85ebc5ca3df9011fcf7c4bb56a21c6cf1cce07..6e73aa67f33e068a31a94f43f36156698e34c62b 100644 (file)
@@ -69,14 +69,13 @@ do_asf(
     int r;
 
     if(debug_ammt) {
-       fprintf(stderr, "calling tapefd_rewind()\n");
+       g_fprintf(stderr, _("calling tapefd_rewind()\n"));
     }
     if(0 != (r = tapefd_rewind(fd))) {
        return r;
     }
     if(debug_ammt) {
-       fprintf(stderr, "calling tapefd_fsf(" OFF_T_FMT ")\n",
-               (OFF_T_FMT_TYPE)count);
+       g_fprintf(stderr, _("calling tapefd_fsf(%lld)\n"), (long long)count);
     }
     return tapefd_fsf(fd, count);
 }
@@ -87,8 +86,7 @@ do_bsf(
     off_t      count)
 {
     if(debug_ammt) {
-       fprintf(stderr, "calling tapefd_fsf(" OFF_T_FMT ")\n", 
-               (OFF_T_FMT_TYPE)-count);
+       g_fprintf(stderr, _("calling tapefd_fsf(%lld)\n"), (long long)-count);
     }
     return tapefd_fsf(fd, -count);
 }
@@ -104,43 +102,43 @@ do_status(
     (void)count;       /* Quiet unused parameter warning */
 
     if(debug_ammt) {
-       fprintf(stderr, "calling tapefd_status()\n");
+       g_fprintf(stderr, _("calling tapefd_status()\n"));
     }
     if((ret = tapefd_status(fd, &stat)) != 0) {
        return ret;
     }
-    printf("%s status:", tapename);
+    g_printf(_("%s status:"), tapename);
     if(stat.online_valid) {
        if(stat.online) {
-           fputs(" ONLINE", stdout);
+           fputs(_(" ONLINE"), stdout);
        } else {
-           fputs(" OFFLINE", stdout);
+           fputs(_(" OFFLINE"), stdout);
        }
     }
     if(stat.bot_valid && stat.bot) {
-       fputs(" BOT", stdout);
+       fputs(_(" BOT"), stdout);
     }
     if(stat.eot_valid && stat.eot) {
-       fputs(" EOT", stdout);
+       fputs(_(" EOT"), stdout);
     }
     if(stat.protected_valid && stat.protected) {
-       fputs(" PROTECTED", stdout);
+       fputs(_(" PROTECTED"), stdout);
     }
     if(stat.device_status_valid) {
-       printf(" ds == 0x%0*lx",
+       g_printf(_(" ds == 0x%0*lx"),
               stat.device_status_size * 2,
               (unsigned long)stat.device_status);
     }
     if(stat.error_status_valid) {
-       printf(" er == 0x%0*lx",
+       g_printf(_(" er == 0x%0*lx"),
               stat.error_status_size * 2,
               (unsigned long)stat.error_status);
     }
     if(stat.fileno_valid) {
-       printf(" fileno == %ld", stat.fileno);
+       g_printf(_(" fileno == %ld"), stat.fileno);
     }
     if(stat.blkno_valid) {
-       printf(" blkno == %ld", stat.blkno);
+       g_printf(_(" blkno == %ld"), stat.blkno);
     }
 
     putchar('\n');
@@ -150,7 +148,7 @@ do_status(
 static void
 usage(void)
 {
-    fprintf(stderr, "usage: %s [-d] [-f|-t device] command [count]\n", pgm);
+    g_fprintf(stderr, _("usage: %s [-d] [-f|-t device] command [count]\n"), pgm);
     exit(1);
 }
 
@@ -167,6 +165,17 @@ main(
     int save_errno;
     char *s;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
+    fprintf(stderr, _("ammt is deprecated\n"));
+
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
@@ -180,7 +189,7 @@ main(
        switch(ch) {
        case 'd':
            debug_ammt = 1;
-           fprintf(stderr, "debug mode!\n");
+           g_fprintf(stderr, _("debug mode!\n"));
            break;
        case 'f':
        case 't':
@@ -217,7 +226,7 @@ main(
            cmd[i].min_chars++;
        }
        if(debug_ammt) {
-           fprintf(stderr, "syntax: %-20s -> %*.*s\n",
+           g_fprintf(stderr, _("syntax: %-20s -> %*.*s\n"),
                            cmd[i].name,
                            (int)cmd[i].min_chars,
                            (int)cmd[i].min_chars,
@@ -228,27 +237,27 @@ main(
     /*
      * Process the command.
      */
-    s = "unknown";
+    s = _("unknown");
     j = strlen(argv[optind]);
     for(i = 0; cmd[i].name; i++) {
        if(0 == strncmp(cmd[i].name, argv[optind], j)) {
            if(j >= cmd[i].min_chars) {
                break;
            }
-           s = "ambiguous";
+           s = _("ambiguous");
        }
     }
     if(0 == cmd[i].name) {
-       fprintf(stderr, "%s: %s command: %s\n", pgm, s, argv[optind]);
+       g_fprintf(stderr, _("%s: %s command: %s\n"), pgm, s, argv[optind]);
        exit(1);
     }
     optind++;
     if(0 == tapename) {
-       fprintf(stderr, "%s: -f device or -t device is required\n", pgm);
+       g_fprintf(stderr, _("%s: -f device or -t device is required\n"), pgm);
        exit(1);
     }
     if(debug_ammt) {
-       fprintf(stderr, "tapename is \"%s\"\n", tapename);
+       g_fprintf(stderr, _("tapename is \"%s\"\n"), tapename);
     }
 
     count = (off_t)1;
@@ -257,15 +266,15 @@ main(
     }
 
     if(debug_ammt) {
-       fprintf(stderr, "calling tape_open(\"%s\",%d)\n", tapename, cmd[i].flags);
+       g_fprintf(stderr, _("calling tape_open(\"%s\",%d)\n"), tapename, cmd[i].flags);
     }
     if((fd = tape_open(tapename, cmd[i].flags, 0)) < 0) {
        goto report_error;
     }
 
     if(debug_ammt) {
-       fprintf(stderr, "processing %s(" OFF_T_FMT ")\n",
-               cmd[i].name, (OFF_T_FMT_TYPE)count);
+       g_fprintf(stderr, _("processing %s(%lld)\n"),
+               cmd[i].name, (long long)count);
     }
     if(0 != (*cmd[i].func)(fd, count)) {
        goto report_error;
@@ -278,11 +287,11 @@ main(
 report_error:
 
     save_errno = errno;
-    fprintf(stderr, "%s %s", tapename, cmd[i].name);
+    g_fprintf(stderr, _("%s %s"), tapename, cmd[i].name);
     if(cmd[i].count) {
-       fprintf(stderr, " " OFF_T_FMT, (OFF_T_FMT_TYPE)count);
+       g_fprintf(stderr, " %lld", (long long)count);
     }
     errno = save_errno;
-    perror(" failed");
+    perror(_(" failed"));
     return (1); /* exit */
 }
index d4e4284d80c9af6fd2620e6241b66deb36f61f41..e99431c5ac37ebfc22e1f73100922067700119d6 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-file.c,v 1.14 2006/07/06 15:04:18 martinea Exp $
  *
@@ -151,7 +155,7 @@ check_online(
         */
 
        rc = (errno != ENOENT);
-       fprintf(stderr,"ERROR: %s (%s)\n", qname, strerror(errno));
+       g_fprintf(stderr,_("ERROR: %s (%s)\n"), qname, strerror(errno));
        goto common_exit;
     }
     while ((entry = readdir(tapedir)) != NULL) {
@@ -292,7 +296,7 @@ file_open(
                host = tapefd_getinfo_host(fd);
                disk = tapefd_getinfo_disk(fd);
                level = tapefd_getinfo_level(fd);
-               snprintf(number, SIZEOF(number), "%d", level);
+               g_snprintf(number, SIZEOF(number), "%d", level);
                if (host != NULL) {
                    f = stralloc(host);
                }
@@ -329,8 +333,8 @@ file_open(
            }
        }
        if (datafilename == NULL) {
-           snprintf(number, SIZEOF(number),
-                   "%05" OFF_T_RFMT, (OFF_T_FMT_TYPE)pos);
+           g_snprintf(number, SIZEOF(number),
+                   "%05lld", (long long)pos);
            datafilename = vstralloc(volume_info[fd].basename,
                                     number,
                                     DATA_INDICATOR,
@@ -355,15 +359,17 @@ file_open(
        if (volume_info[fd].fd >= 0 && fi->ri_count == 0 &&
                (rfd = open(recordfilename, O_RDONLY)) >= 0) {
            for (; (line = areads(rfd)) != NULL; free(line)) {
-                /* We play this game because OFF_T_FMT_TYPE is not
+                /* We play this game because long long is not
                    necessarily the same as off_t, and we need to cast the
                    actual value (not just the pointer. */
-                OFF_T_FMT_TYPE start_record_ = (OFF_T_FMT_TYPE)0;
-                OFF_T_FMT_TYPE end_record_ = (OFF_T_FMT_TYPE)0;
-               n = sscanf(line, OFF_T_FMT " " OFF_T_FMT " " SIZE_T_FMT,
-                           &start_record_, &end_record_, &record_size);
+                long long start_record_ = (long long)0;
+                long long end_record_ = (long long)0;
+               long record_size_ = (long)0;
+               n = sscanf(line, "%lld %lld %ld",
+                           &start_record_, &end_record_, &record_size_);
                 start_record = (off_t)start_record_;
                 end_record = (off_t)end_record_;
+                record_size = (size_t)record_size_;
 
                if (n == 3) {
                     ri_p = &fi->ri;
@@ -416,8 +422,8 @@ file_close(
                  NULL);
     fi = &volume_info[fd].fi[pos];
     if (fi->ri_altered) {
-       snprintf(number, SIZEOF(number),
-                "%05" OFF_T_RFMT, (OFF_T_FMT_TYPE)pos);
+       g_snprintf(number, SIZEOF(number),
+                "%05lld", (long long)pos);
        filename = vstralloc(volume_info[fd].basename,
                             number,
                             RECORD_INDICATOR,
@@ -427,10 +433,10 @@ file_close(
            goto common_exit;
        }
        for (r = 0; r < fi->ri_count; r++) {
-           fprintf(f, OFF_T_FMT " " OFF_T_FMT " " SIZE_T_FMT "\n",
-                   (OFF_T_FMT_TYPE)fi->ri[r].start_record,
-                   (OFF_T_FMT_TYPE)fi->ri[r].end_record,
-                   (SIZE_T_FMT_TYPE)fi->ri[r].record_size);
+           g_fprintf(f, "%lld %lld %zu\n",
+                   (long long)fi->ri[r].start_record,
+                   (long long)fi->ri[r].end_record,
+                   fi->ri[r].record_size);
        }
        afclose(f);
        fi->ri_altered = 0;
@@ -475,8 +481,8 @@ file_release(
                      10,
                      NULL);
        if (volume_info[fd].fi[pos].name != NULL) {
-           snprintf(number, SIZEOF(number),
-                    "%05" OFF_T_RFMT, (OFF_T_FMT_TYPE)pos);
+           g_snprintf(number, SIZEOF(number),
+                    "%05lld", (long long)pos);
            filename = vstralloc(volume_info[fd].basename,
                                 number,
                                 DATA_INDICATOR,
@@ -739,8 +745,8 @@ file_tapefd_read(
        volume_info[fd].at_bof = 0;
        if ((size_t)result < record_size) {
            if (lseek(file_fd, (off_t)(record_size-result), SEEK_CUR) == (off_t)-1) {
-               dbprintf(("file_tapefd_read: lseek failed: <%s>\n",
-                         strerror(errno)));
+               dbprintf(_("file_tapefd_read: lseek failed: <%s>\n"),
+                         strerror(errno));
            }
        }
        volume_info[fd].record_current += (off_t)1;
@@ -850,13 +856,13 @@ file_tapefd_write(
        off_t curpos;
 
        if ((curpos = lseek(file_fd, (off_t)0, SEEK_CUR)) < 0) {
-           dbprintf((": Can not determine current file position <%s>",
-               strerror(errno)));
+           dbprintf(_(": Can not determine current file position <%s>"),
+               strerror(errno));
            return -1;
        }
        if (ftruncate(file_fd, curpos) != 0) {
-           dbprintf(("ftruncate failed; Can not trim output file <%s>",
-               strerror(errno)));
+           dbprintf(_("ftruncate failed; Can not trim output file <%s>"),
+               strerror(errno));
            return -1;
        }
        volume_info[fd].at_bof = 0;
@@ -883,7 +889,6 @@ file_tapefd_close(
     int save_errno;
     char *line;
     size_t len;
-    char number[NUM_STR_SIZE];
     ssize_t result;
     struct file_info **fi_p;
     struct record_info **ri_p;
@@ -943,9 +948,8 @@ file_tapefd_close(
            errno = save_errno;
            return -1;
        }
-       snprintf(number, SIZEOF(number), "%05" OFF_T_RFMT,
-                (OFF_T_FMT_TYPE)volume_info[fd].file_current);
-       line = vstralloc("position ", number, "\n", NULL);
+       line = vstrallocf("position %05lld\n",
+                (long long)volume_info[fd].file_current);
        len = strlen(line);
        result = write(fd, line, len);
        amfree(line);
@@ -1209,16 +1213,16 @@ file_tapefd_weof(
 
        if ((curpos = lseek(file_fd, (off_t)0, SEEK_CUR)) < 0) {
            save_errno = errno;
-           dbprintf((": Can not determine current file position <%s>",
-               strerror(errno)));
+           dbprintf(_(": Can not determine current file position <%s>"),
+               strerror(errno));
            file_close(fd);
            errno = save_errno;
            return -1;
        }
        if (ftruncate(file_fd, curpos) != 0) {
            save_errno = errno;
-           dbprintf(("ftruncate failed; Can not trim output file <%s>",
-               strerror(errno)));
+           dbprintf(_("ftruncate failed; Can not trim output file <%s>"),
+               strerror(errno));
            file_close(fd);
            errno = save_errno;
            return -1;
index 62525802e2b1938c975528120c92c74ead54c0ed..f406cd84d384a3427433ed189babb937b320dc6e 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-file.h,v 1.6 2006/05/25 01:47:27 johnfranks Exp $
  *
index 45cdad774f907429d3e74fb56ec7deb140028647..1c361f498e223aeaee25aad789da8a595257ec72 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-null.c,v 1.9 2006/06/02 00:56:06 paddy_s Exp $
  *
index dd987be9b6f5562ccff68e7a7005a2280e68771c..d3b74b0e341eb74e953329fa2f280d3579097e67 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-null.h,v 1.6 2006/05/25 01:47:27 johnfranks Exp $
  *
index e094a59febf57a7cbe1290d22aff15836ce60057..b36e264974bad601cc900e1433ddec71dc1b9e71 100644 (file)
@@ -1,3 +1,7 @@
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 #ifdef NO_AMANDA
 #include <stdio.h>
 #include <stdlib.h>
@@ -103,16 +107,16 @@ char *tapeio_next_devname (char * dev_left,
 */
 
 #ifdef RAIT_DEBUG
-#define rait_debug(p) do {                                             \
+#define rait_debug(...) do {                                           \
   int save_errno = errno;                                              \
                                                                        \
-  if (0!=getenv("RAIT_DEBUG")) {                                       \
-    fprintf p;                                                         \
+  if (0 != getenv("RAIT_DEBUG")) {                                     \
+    dbprintf(__VA_ARGS__);                                             \
   }                                                                    \
   errno = save_errno;                                                  \
 } while (0)
 #else
-#define rait_debug(p)
+#define rait_debug(...)
 #endif
 
 static RAIT *rait_table = 0;           /* table to keep track of RAITS */
@@ -203,7 +207,7 @@ rait_open(
     RAIT **rait_table_p = &rait_table;
     int **fds_p;
 
-    rait_debug((stderr,"rait_open( %s, %d, %d )\n", dev, flags, mask));
+    rait_debug(stderr,_("rait_open( %s, %d, %d )\n"), dev, flags, mask);
 
     rait_flag = (0 != strchr(dev, '{'));
 
@@ -223,9 +227,9 @@ rait_open(
        fd = tape_open(dev,flags,mask);
     }
     if(-1 == fd) {
-       rait_debug((stderr, "rait_open:returning %d: %s\n",
+       rait_debug(stderr, _("rait_open:returning %d: %s\n"),
                            fd,
-                           strerror(errno)));
+                           strerror(errno));
        return fd;
     }
 
@@ -233,9 +237,9 @@ rait_open(
        save_errno = errno;
        (void)tapefd_close(fd);
        errno = save_errno;
-       rait_debug((stderr, "rait_open:returning %d: %s\n",
+       rait_debug(stderr, _("rait_open:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -250,15 +254,15 @@ rait_open(
        /* copy and parse the dev string so we can scribble on it */
        dev = stralloc(dev);
        if (0 == dev) {
-           rait_debug((stderr, "rait_open:returning %d: %s\n",
+           rait_debug(stderr, _("rait_open:returning %d: %s\n"),
                                -1,
-                               "out of stralloc memory"));
+                               _("out of stralloc memory"));
            return -1;
         }
         if (0 != tapeio_init_devname(dev, &dev_left, &dev_right, &dev_next)) {
-           rait_debug((stderr, "rait_open:returning %d: %s\n",
+           rait_debug(stderr, _("rait_open:returning %d: %s\n"),
                                -1,
-                               strerror(errno)));
+                               strerror(errno));
            return -1;
         }
 
@@ -277,8 +281,8 @@ rait_open(
                break;
            }
            res->fds[ res->nfds ] = tape_open(dev_real,flags,mask);
-           rait_debug((stderr,"rait_open:opening %s yields %d\n",
-                       dev_real, res->fds[res->nfds] ));
+           rait_debug(stderr,_("rait_open:opening %s yields %d\n"),
+                       dev_real, res->fds[res->nfds] );
            if ( res->fds[res->nfds] < 0 ) {
                save_errno = errno;
                (void)rait_close(fd);
@@ -326,10 +330,10 @@ rait_open(
        memset(res->readres, 0, res->nfds * SIZEOF(*res->readres));
     }
 
-    rait_debug((stderr, "rait_open:returning %d%s%s\n",
+    rait_debug(stderr, _("rait_open:returning %d%s%s\n"),
                        fd,
                        (fd < 0) ? ": " : "",
-                       (fd < 0) ? strerror(errno) : ""));
+                       (fd < 0) ? strerror(errno) : "");
 
     return fd;
 }
@@ -405,22 +409,22 @@ rait_close(
     pid_t kid;
     int **fds_p;
 
-    rait_debug((stderr,"rait_close( %d )\n", fd));
+    rait_debug(stderr,_("rait_close( %d )\n"), fd);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_close:returning %d: %s\n",
+       rait_debug(stderr, _("rait_close:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_close:returning %d: %s\n",
+       rait_debug(stderr, _("rait_close:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -488,10 +492,10 @@ rait_close(
     }
     pr->nopen = 0;
     errno = save_errno;
-    rait_debug((stderr, "rait_close:returning %d%s%s\n",
+    rait_debug(stderr, _("rait_close:returning %d%s%s\n"),
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
     return res;
 }
 
@@ -512,23 +516,23 @@ rait_lseek(
         total;                 /* total of results */
     RAIT *pr;                  /* RAIT slot in table */
 
-    rait_debug((stderr, "rait_lseek(%d," OFF_T_FMT ",%d)\n",
-               fd, (OFF_T_FMT_TYPE)pos, whence));
+    rait_debug(stderr, _("rait_lseek(%d, %lld, %d)\n"),
+               fd, (long long)pos, whence);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_lseek:returning %d: %s\n",
+       rait_debug(stderr, _("rait_lseek:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return (off_t)-1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_lseek:returning %d: %s\n",
+       rait_debug(stderr, _("rait_lseek:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return (off_t)-1;
     }
 
@@ -546,10 +550,10 @@ rait_lseek(
            total += res;
        }
     }
-    rait_debug((stderr, "rait_lseek:returning %ld%s%s\n",
+    rait_debug(stderr, _("rait_lseek:returning %ld%s%s\n"),
                        total,
                        (total < 0) ? ": " : "",
-                       (total < 0) ? strerror(errno) : ""));
+                       (total < 0) ? strerror(errno) : "");
     return total;
 }
 
@@ -574,22 +578,22 @@ rait_write(
     ssize_t total = 0;
     int data_fds;      /* number of data stream file descriptors */
 
-    rait_debug((stderr, "rait_write(%d,%lx,%d)\n",fd,(unsigned long)buf,len));
+    rait_debug(stderr, _("rait_write(%d,%lx,%d)\n"),fd,(unsigned long)buf,len);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_write:returning %d: %s\n",
+       rait_debug(stderr, _("rait_write:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_write:returning %d: %s\n",
+       rait_debug(stderr, _("rait_write:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -598,9 +602,9 @@ rait_write(
        data_fds = pr->nfds - 1;
        if (0 != len % data_fds) {
            errno = EDOM;
-           rait_debug((stderr, "rait_write:returning %d: %s\n",
+           rait_debug(stderr, _("rait_write:returning %d: %s\n"),
                                -1,
-                               strerror(errno)));
+                               strerror(errno));
            return -1;
        }
        /* each slice gets an even portion */
@@ -629,13 +633,13 @@ rait_write(
     /* write the chunks in the main buffer */
     for( i = 0; i < data_fds; i++ ) {
        res = tapefd_write(pr->fds[i], buf + len*i , len);
-       rait_debug((stderr, "rait_write: write(%d,%lx,%d) returns %d%s%s\n",
+       rait_debug(stderr, _("rait_write: write(%d,%lx,%d) returns %d%s%s\n"),
                        pr->fds[i],
                        (unsigned long)(buf + len*i),
                        len,
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
        if (res < 0) {
            total = res;
            break;
@@ -645,22 +649,22 @@ rait_write(
     if (total >= 0 && pr->nfds > 1) {
         /* write the sum, don't include it in the total bytes written */
        res = tapefd_write(pr->fds[i], pr->xorbuf, len);
-       rait_debug((stderr, "rait_write: write(%d,%lx,%d) returns %d%s%s\n",
+       rait_debug(stderr, _("rait_write: write(%d,%lx,%d) returns %d%s%s\n"),
                    pr->fds[i],
                    (unsigned long)pr->xorbuf,
                    len,
                    res,
                    (res < 0) ? ": " : "",
-                   (res < 0) ? strerror(errno) : ""));
+                   (res < 0) ? strerror(errno) : "");
        if (res < 0) {
            total = res;
        }
     }
 
-    rait_debug((stderr, "rait_write:returning %d%s%s\n",
+    rait_debug(stderr, _("rait_write:returning %d%s%s\n"),
                        total,
                        (total < 0) ? ": " : "",
-                       (total < 0) ? strerror(errno) : ""));
+                       (total < 0) ? strerror(errno) : "");
 
     return total;
 }
@@ -693,22 +697,22 @@ rait_read(
     ssize_t maxreadres = 0;
     int sum_mismatch = 0;
 
-    rait_debug((stderr, "rait_read(%d,%lx,%d)\n",fd,(unsigned long)buf,len));
+    rait_debug(stderr, _("rait_read(%d,%lx,%d)\n"),fd,(unsigned long)buf,len);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_read:returning %d: %s\n",
+       rait_debug(stderr, _("rait_read:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_read:returning %d: %s\n",
+       rait_debug(stderr, _("rait_read:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -720,9 +724,9 @@ rait_read(
        data_fds = pr->nfds - 1;
        if (0 != len % data_fds) {
            errno = EDOM;
-           rait_debug((stderr, "rait_read:returning %d: %s\n",
+           rait_debug(stderr, _("rait_read:returning %d: %s\n"),
                                -1,
-                               strerror(errno)));
+                               strerror(errno));
            return -1;
        }
        len = len / data_fds;
@@ -734,11 +738,11 @@ rait_read(
     /* count the eof/errors */
     for( i = 0; i < data_fds; i++ ) {
        pr->readres[i] = tapefd_read(pr->fds[i], buf + len*i , len);
-       rait_debug((stderr, "rait_read: read on fd %d returns %d%s%s\n",
+       rait_debug(stderr, _("rait_read: read on fd %d returns %d%s%s\n"),
                    pr->fds[i],
                    pr->readres[i],
                    (pr->readres[i] < 0) ? ": " : "",
-                   (pr->readres[i] < 0) ? strerror(errno) : ""));
+                   (pr->readres[i] < 0) ? strerror(errno) : "");
        if ( pr->readres[i] <= 0 ) {
            if ( pr->readres[i] == 0 ) {
                neofs++;
@@ -763,11 +767,11 @@ rait_read(
            pr->xorbuflen = len;
        }
        pr->readres[i] = tapefd_read(pr->fds[i], pr->xorbuf , len);
-       rait_debug((stderr, "rait_read: read on fd %d returns %d%s%s\n",
+       rait_debug(stderr, _("rait_read: read on fd %d returns %d%s%s\n"),
                    pr->fds[i],
                    pr->readres[i],
                    (pr->readres[i] < 0) ? ": " : "",
-                   (pr->readres[i] < 0) ? strerror(errno) : ""));
+                   (pr->readres[i] < 0) ? strerror(errno) : "");
     }
 
     /*
@@ -803,23 +807,23 @@ rait_read(
     */
 
     if (neofs == pr->nfds) {
-       rait_debug((stderr, "rait_read:returning 0\n"));
+       rait_debug(stderr, _("rait_read:returning 0\n"));
        return 0;
     }
 
     if (sum_mismatch) {
        errno = EDOM;
-       rait_debug((stderr, "rait_read:returning %d: %s\n",
+       rait_debug(stderr, _("rait_read:returning %d: %s\n"),
                            -1,
-                           "XOR block mismatch"));
+                           _("XOR block mismatch"));
        return -1;
     }
 
     if (nerrors > 1 || (pr->nfds <= 1 && nerrors > 0)) {
        errno = save_errno;
-       rait_debug((stderr, "rait_read:returning %d: %s\n",
+       rait_debug(stderr, _("rait_read:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -829,8 +833,8 @@ rait_read(
     */
     if (nerrors == 1 && pr->nfds > 1 && errorblock != pr->nfds-1) {
 
-       rait_debug((stderr, "rait_read: fixing data from fd %d\n",
-                           pr->fds[errorblock]));
+       rait_debug(stderr, _("rait_read: fixing data from fd %d\n"),
+                           pr->fds[errorblock]);
 
        /* the reads were all *supposed* to be the same size, so... */
        pr->readres[errorblock] = maxreadres;
@@ -858,10 +862,10 @@ rait_read(
        total += pr->readres[i];
     }
 
-    rait_debug((stderr, "rait_read:returning %d%s%s\n",
+    rait_debug(stderr, _("rait_read:returning %d%s%s\n"),
                        total,
                        (total < 0) ? ": " : "",
-                       (total < 0) ? strerror(errno) : ""));
+                       (total < 0) ? strerror(errno) : "");
 
     return total;
 }
@@ -878,22 +882,22 @@ rait_ioctl(
     RAIT *pr;
     int errors = 0;
 
-    rait_debug((stderr, "rait_ioctl(%d,%d)\n",fd,op));
+    rait_debug(stderr, _("rait_ioctl(%d,%d)\n"),fd,op);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_ioctl:returning %d: %s\n",
+       rait_debug(stderr, _("rait_ioctl:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_ioctl:returning %d: %s\n",
+       rait_debug(stderr, _("rait_ioctl:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -910,10 +914,10 @@ rait_ioctl(
        }
     }
 
-    rait_debug((stderr, "rait_ioctl: returning %d%s%s\n",
+    rait_debug(stderr, _("rait_ioctl: returning %d%s%s\n"),
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
 
     return res;
 }
@@ -935,22 +939,22 @@ rait_access(
     /* copy and parse the dev string so we can scribble on it */
     devname = stralloc(devname);
     if (0 == devname) {
-       rait_debug((stderr, "rait_access:returning %d: %s\n",
+       rait_debug(stderr, _("rait_access:returning %d: %s\n"),
                            -1,
-                           "out of stralloc memory"));
+                           _("out of stralloc memory"));
        return -1;
     }
     if ( 0 != tapeio_init_devname(devname, &dev_left, &dev_right, &dev_next)) {
-       rait_debug((stderr, "rait_access:returning %d: %s\n",
+       rait_debug(stderr, _("rait_access:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     while( 0 != (dev_real = tapeio_next_devname(dev_left, dev_right, &dev_next))) {
        res = tape_access(dev_real, flags);
-       rait_debug((stderr,"rait_access:access( %s, %d ) yields %d\n",
-               dev_real, flags, res ));
+       rait_debug(stderr,_("rait_access:access( %s, %d ) yields %d\n"),
+               dev_real, flags, res );
        amfree(dev_real);
        if (res < 0) {
            break;
@@ -958,10 +962,10 @@ rait_access(
     }
     amfree(devname);
 
-    rait_debug((stderr, "rait_access: returning %d%s%s\n",
+    rait_debug(stderr, _("rait_access: returning %d%s%s\n"),
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
 
     return res;
 }
@@ -983,22 +987,22 @@ rait_stat(
     /* copy and parse the dev string so we can scribble on it */
     devname = stralloc(devname);
     if (0 == devname) {
-       rait_debug((stderr, "rait_access:returning %d: %s\n",
+       rait_debug(stderr, _("rait_access:returning %d: %s\n"),
                            -1,
-                           "out of stralloc memory"));
+                           _("out of stralloc memory"));
        return -1;
     }
     if ( 0 != tapeio_init_devname(devname, &dev_left, &dev_right, &dev_next)) {
-       rait_debug((stderr, "rait_access:returning %d: %s\n",
+       rait_debug(stderr, _("rait_access:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     while( 0 != (dev_real = tapeio_next_devname(dev_left, dev_right, &dev_next))) {
        res = tape_stat(dev_real, buf);
-       rait_debug((stderr,"rait_stat:stat( %s ) yields %d (%s)\n",
-               dev_real, res, (res != 0) ? strerror(errno) : "no error" ));
+       rait_debug(stderr,_("rait_stat:stat( %s ) yields %d (%s)\n"),
+               dev_real, res, (res != 0) ? strerror(errno) : _("no error") );
        amfree(dev_real);
        if (res != 0) {
            break;
@@ -1006,10 +1010,10 @@ rait_stat(
     }
     amfree(devname);
 
-    rait_debug((stderr, "rait_access: returning %d%s%s\n",
+    rait_debug(stderr, _("rait_access: returning %d%s%s\n"),
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
 
     return res;
 }
@@ -1077,22 +1081,22 @@ rait_tapefd_ioctl(
     pid_t kid;
     int status = 0;
 
-    rait_debug((stderr, "rait_tapefd_ioctl(%d,%d)\n",fd,count));
+    rait_debug(stderr, _("rait_tapefd_ioctl(%d,%d)\n"),fd,count);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_tapefd_ioctl:returning %d: %s\n",
+       rait_debug(stderr, _("rait_tapefd_ioctl:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_tapefd_ioctl:returning %d: %s\n",
+       rait_debug(stderr, _("rait_tapefd_ioctl:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
@@ -1104,19 +1108,19 @@ rait_tapefd_ioctl(
     for( i = 0; i < pr->nfds ; i++ ) {
        if(tapefd_can_fork(pr->fds[i])) {
             if ((kid = fork()) < 1) {
-               rait_debug((stderr, "in kid, fork returned %d\n", kid));
+               rait_debug(stderr, _("in kid, fork returned %d\n"), kid);
                /* if we are the kid, or fork failed do the action */
                if (func0 != NULL) {
                    res = (*func0)(pr->fds[i]);
                } else {
                    res = (*func1)(pr->fds[i], count);
                }
-               rait_debug((stderr, "in kid, func (%d) returned %d errno %s\n",
-                               pr->fds[i], res, strerror(errno)));
+               rait_debug(stderr, _("in kid, func (%d) returned %d errno %s\n"),
+                               pr->fds[i], res, strerror(errno));
                if (kid == 0)
                    exit(res);
             } else {
-               rait_debug((stderr, "in parent, fork returned %d\n", kid));
+               rait_debug(stderr, _("in parent, fork returned %d\n"), kid);
                pr->readres[i] = (ssize_t)kid;
             }
        }
@@ -1134,14 +1138,14 @@ rait_tapefd_ioctl(
     }
     for( i = 0; i < pr->nfds ; i++ ) {
        if(tapefd_can_fork(pr->fds[i])) {
-            rait_debug((stderr, "in parent, waiting for %d\n", pr->readres[i]));
+            rait_debug(stderr, _("in parent, waiting for %d\n"), pr->readres[i]);
            waitpid((pid_t)pr->readres[i], &status, 0);
            if( WEXITSTATUS(status) != 0 ) {
                res = WEXITSTATUS(status);
                if( res == 255 )
                    res = -1;
             }
-            rait_debug((stderr, "in parent, return code was %d\n", res));
+            rait_debug(stderr, _("in parent, return code was %d\n"), res);
            if ( res != 0 ) {
                errors++;
                res = 0;
@@ -1152,10 +1156,10 @@ rait_tapefd_ioctl(
        res = -1;
     }
 
-    rait_debug((stderr, "rait_tapefd_ioctl: returning %d%s%s\n",
+    rait_debug(stderr, _("rait_tapefd_ioctl: returning %d%s%s\n"),
                        res,
                        (res < 0) ? ": " : "",
-                       (res < 0) ? strerror(errno) : ""));
+                       (res < 0) ? strerror(errno) : "");
 
     return res;
 }
@@ -1209,22 +1213,22 @@ rait_tapefd_status(
     int res = 0;
     int errors = 0;
 
-    rait_debug((stderr, "rait_tapefd_status(%d)\n",fd));
+    rait_debug(stderr, _("rait_tapefd_status(%d)\n"),fd);
 
     if ((fd < 0) || ((size_t)fd >= rait_table_count)) {
        errno = EBADF;
-       rait_debug((stderr, "rait_tapefd_status:returning %d: %s\n",
+       rait_debug(stderr, _("rait_tapefd_status:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
     pr = &rait_table[fd];
     if (0 == pr->nopen) {
        errno = EBADF;
-       rait_debug((stderr, "rait_tapefd_status:returning %d: %s\n",
+       rait_debug(stderr, _("rait_tapefd_status:returning %d: %s\n"),
                            -1,
-                           strerror(errno)));
+                           strerror(errno));
        return -1;
     }
 
index 21a573a80fa637ffadbf94b0d7725ba95a55bf73..a9ad743902545a5f1e35d9344591f712e908f297 100644 (file)
@@ -1,3 +1,7 @@
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 #ifndef RAIT_H
 
 #define RAIT_H
index cc8795788cbd7679a7fbb1ea5fde08100f092930..aad2bceec4e40b99fc27ec89f7fd488e1a9f16d8 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-tape.c,v 1.18 2006/08/22 14:19:39 martinea Exp $
  *
@@ -94,7 +98,7 @@ tape_tapefd_fsf(
 }
 #endif                                                                 /* } */
 
-#ifdef UWARE_TAPEIO                                                    /* { */
+#ifdef WANT_TAPE_UWARE                                                 /* { */
 
 #include <sys/tape.h>
 
@@ -165,7 +169,7 @@ tape_tapefd_weof(
 }
 
 #else                                                                  /* }{ */
-#ifdef AIX_TAPEIO                                                      /* { */
+#ifdef WANT_TAPE_AIX                                                   /* { */
 
 #include <sys/tape.h>
 
@@ -251,8 +255,8 @@ tape_tapefd_weof(
     return ioctl(fd, STIOCTOP, &st);
 }
 
-#else /* AIX_TAPEIO */                                                 /* }{ */
-#ifdef XENIX_TAPEIO                                                    /* { */
+#else /* WANT_TAPE_AIX */                                                      /* }{ */
+#ifdef WANT_TAPE_XENIX                                                 /* { */
 
 #include <sys/tape.h>
 
@@ -333,7 +337,7 @@ tape_tapefd_weof(
     return status;
 }
 
-#else  /* ! AIX_TAPEIO && !XENIX_TAPEIO */                             /* }{ */
+#else  /* ! WANT_TAPE_AIX && !WANT_TAPE_XENIX */                               /* }{ */
 
 #include <sys/mtio.h>
 
@@ -455,9 +459,9 @@ tape_tapefd_weof(
     return ioctl(fd, MTIOCTOP, &mt);
 }
 
-#endif /* !XENIX_TAPEIO */                                             /* } */
-#endif /* !AIX_TAPEIO */                                               /* } */
-#endif /* !UWARE_TAPEIO */                                             /* } */
+#endif /* !WANT_TAPE_XENIX */                                          /* } */
+#endif /* !WANT_TAPE_AIX */                                            /* } */
+#endif /* !WANT_TAPE_UWARE */                                          /* } */
 
 /*
  * At this point we have pulled in every conceivable #include file :-),
@@ -499,7 +503,7 @@ tape_tape_open(
            /*
             * Open failed completely: just return
             */
-           fprintf(stderr, "Opening tapedev %s: got error %s.\n",
+           g_fprintf(stderr, _("Opening tapedev %s: got error %s.\n"),
                        filename, strerror(errno));
            return -1;
        }
@@ -511,7 +515,7 @@ tape_tape_open(
        timeout -= delay;
        if (timeout <= 0) {
            /* Open failed: just return */
-           fprintf(stderr, "Opening tapedev %s: not ready.\n", filename);
+           g_fprintf(stderr, _("Opening tapedev %s: not ready.\n"), filename);
            return -1;
        }
 
@@ -530,14 +534,14 @@ tape_tape_open(
        memset(&mt, 0, SIZEOF(mt));
        if (ioctl(ret, MTIOCGET, &mt) < 0) {
            close(ret);
-           fprintf(stderr, "tapedev %s is not a tape device!\n", filename);
+           g_fprintf(stderr, _("tapedev %s is not a tape device!\n"), filename);
            return -1;
        }
 
 #ifdef GMT_ONLINE
        if (!GMT_ONLINE(mt.mt_gstat)) {
            close(ret);
-           fprintf(stderr, "tapedev %s is offline or has no loaded tape.\n",
+           g_fprintf(stderr, _("tapedev %s is offline or has no loaded tape.\n"),
                    filename);
            return -1;
        }
@@ -598,8 +602,8 @@ tape_tapefd_resetofs(
      * filesize limit (eg OSes with 2 GB filesize limits) on a long tape.
      */
     if (lseek(fd, (off_t)0, SEEK_SET) < 0) {
-       dbprintf(("tape_tapefd_resetofs: lseek failed: <%s>\n",
-                 strerror(errno)));
+       dbprintf(_("tape_tapefd_resetofs: lseek failed: <%s>\n"),
+                 strerror(errno));
     }
 }
 
index 3707c0f3cade1f94f41698c28ceed93e5598f00c..a0f5843e1c99c9d967a42eaa693e5d2c72f09184 100644 (file)
  *                        University of Maryland at College Park
  */
 
+/* NOTE: this driver is *deprecated* and should not be used.  See the Device API
+ * in device-src/ for the new implementation.
+ */
+
 /*
  * $Id: output-tape.h,v 1.6 2006/05/25 01:47:27 johnfranks Exp $
  *
index 07eeb7efb275cf651721cb969c1596708d116d73..69fdb5cac683d9602ed30515e363a171ceeaca30 100644 (file)
@@ -765,19 +765,14 @@ tape_rewind(
     char *r = NULL;
 
     if((fd = tape_open(devname, O_RDONLY)) < 0) {
-       r = errstr = newvstralloc(errstr,
-                                 "tape_rewind: tape open: ",
-                                 devname,
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+       r = errstr = newvstrallocf(errstr,
+                                 _("tape_rewind: tape open: %s: %s"),
+                                 devname, strerror(errno));
     } else if(tapefd_rewind(fd) == -1) {
-       r = errstr = newvstralloc(errstr,
-                                 "tape_rewind: rewinding tape: ",
+       r = errstr = newvstrallocf(errstr,
+                                 _("tape_rewind: rewinding tape: %s: %s"),
                                  devname,
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+                                 strerror(errno));
     }
     if(fd >= 0) {
        tapefd_close(fd);
@@ -793,19 +788,15 @@ tape_unload(
     char *r = NULL;
 
     if((fd = tape_open(devname, O_RDONLY)) < 0) {
-       r = errstr = newvstralloc(errstr,
-                                 "tape_unload: tape open: ",
+       r = errstr = newvstrallocf(errstr,
+                                 _("tape_unload: tape open: %s: %s"),
                                  devname,
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+                                 strerror(errno));
     } else if(tapefd_unload(fd) == -1) {
-       r = errstr = newvstralloc(errstr,
-                                 "tape_unload: unloading tape: ",
+       r = errstr = newvstrallocf(errstr,
+                                 _("tape_unload: unloading tape: %s: %s"),
                                  devname,
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+                                 strerror(errno));
     }
     if(fd >= 0) {
        tapefd_close(fd);
@@ -819,26 +810,19 @@ tape_fsf(
     off_t count)
 {
     int fd;
-    char count_str[NUM_STR_SIZE];
     char *r = NULL;
 
     if((fd = tape_open(devname, O_RDONLY)) < 0) {
-       r = errstr = newvstralloc(errstr,
-                                 "tape_fsf: tape open: ",
+       r = errstr = newvstrallocf(errstr,
+                                 _("tape_fsf: tape open: %s: %s"),
                                  devname,
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+                                 strerror(errno));
     } else if(tapefd_fsf(fd, count) == -1) {
-       snprintf(count_str, SIZEOF(count_str), OFF_T_FMT,
-                                (OFF_T_FMT_TYPE)count);
-       r = errstr = newvstralloc(errstr,
-                                 "tape_fsf: fsf ",
-                                 count_str,
-                                 "file", (count == 1) ? "" : "s",
-                                 ": ",
-                                 strerror(errno),
-                                 NULL);
+       r = errstr = newvstrallocf(errstr,
+                                 plural(_("tape_fsf: fsf %lld file: %s"),
+                                        _("tape_fsf: fsf %lld files: %s"),
+                                        count),
+                                 (long long)count, strerror(errno));
     }
     if(fd >= 0) {
        tapefd_close(fd);
@@ -871,19 +855,18 @@ tapefd_rdlabel(
        *datestamp = stralloc("X");
        *label = stralloc(FAKE_LABEL);
     } else if(tapefd_rewind(fd) == -1) {
-       r = stralloc2("rewinding tape: ", strerror(errno));
+       r = vstrallocf(_("rewinding tape: %s"), strerror(errno));
     } else if((rc = tapefd_read(fd, buffer, buflen)) == -1) {
-       r = vstralloc(NOT_AMANDA_TAPE_MSG, " (",
-                      strerror(errno), ")", NULL);
+       r = vstrallocf(_(NOT_AMANDA_TAPE_MSG "(%s)"), strerror(errno));
     } else if (rc == 0) {
-        r = stralloc2(NOT_AMANDA_TAPE_MSG, " (Read 0 bytes)");
+        r = vstrallocf(_(NOT_AMANDA_TAPE_MSG " (Read 0 bytes)"));
     } else {
        /* make sure buffer is null-terminated */
        buffer[rc] = '\0';
 
        parse_file_header(buffer, &file, (size_t)rc);
        if(file.type != F_TAPESTART) {
-           r = stralloc(NOT_AMANDA_TAPE_MSG);
+           r = vstrallocf(NOT_AMANDA_TAPE_MSG);
        } else {
            *datestamp = stralloc(file.datestamp);
            *label = stralloc(file.name);
@@ -891,7 +874,7 @@ tapefd_rdlabel(
     }
     amfree(buffer);
     if (r)
-       errstr = newvstralloc(errstr, r, NULL);
+       errstr = newvstrallocf(errstr, "%s", r);
     return r;
 }
 
@@ -905,11 +888,9 @@ tape_rdlabel(
     char *r = NULL;
 
     if((fd = tape_open(devname, O_RDONLY)) < 0) {
-       r = vstralloc("tape_rdlabel: tape open: ",
+       r = vstrallocf(_("tape_rdlabel: tape open: %s: %s"),
                       devname,
-                      ": ",
-                      strerror(errno),
-                      NULL);
+                      strerror(errno));
     } else
         r = tapefd_rdlabel(fd, datestamp, label);
 
@@ -917,7 +898,7 @@ tape_rdlabel(
         tapefd_close(fd);
     }
     if (r)
-       errstr = newvstralloc(errstr, r, NULL);
+       errstr = newvstrallocf(errstr, "%s", r);
     return r;
 }
 
@@ -934,7 +915,8 @@ tapefd_wrlabel(
     char *r = NULL;
 
     if(tapefd_rewind(fd) == -1) {
-       r = errstr = newstralloc2(errstr, "rewinding tape: ", strerror(errno));
+       r = errstr = newvstrallocf(errstr, _("rewinding tape: %s"),
+                       strerror(errno));
     } else {
        fh_init(&file);
        file.type = F_TAPESTART;
@@ -942,17 +924,19 @@ tapefd_wrlabel(
        file.datestamp[SIZEOF(file.datestamp) - 1] = '\0';
        strncpy(file.name, label, SIZEOF(file.name) - 1);
        file.name[SIZEOF(file.name) - 1] = '\0';
-       buffer = alloc(size);
        file.blocksize = size;
-       build_header(buffer, &file, size);
+        buffer = build_header(&file, size);
        tapefd_setinfo_host(fd, NULL);
        tapefd_setinfo_disk(fd, label);
        tapefd_setinfo_level(fd, -1);
        if((rc = tapefd_write(fd, buffer, size)) != (ssize_t)size) {
-           r = errstr = newstralloc2(errstr,
-                                     "writing label: ",
-                                     (rc != -1) ? "short write"
-                                                : strerror(errno));
+           if (rc != 1) {
+               r = errstr = newvstrallocf(errstr,
+                               _("writing label: short write"));
+           } else {
+               r = errstr = newvstrallocf(errstr,
+                               _("writing label: %s"), strerror(errno));
+           }
        }
        amfree(buffer);
     }
@@ -970,10 +954,13 @@ tape_wrlabel(
     char *r = NULL;
 
     if((fd = tape_open(devname, O_WRONLY)) < 0) {
-       r = errstr = newstralloc2(errstr,
-                                 "writing label: ",
-                                 (errno == EACCES) ? "tape is write-protected"
-                                                   : strerror(errno));
+       if (errno == EACCES) {
+           r = errstr = newvstrallocf(errstr,
+                                 _("writing label: tape is write-protected"));
+       } else {
+           r = errstr = newvstrallocf(errstr,
+                                 _("writing label: %s"), strerror(errno));
+       }
     } else if(tapefd_wrlabel(fd, datestamp, label, size) != NULL) {
        r = errstr;
     }
@@ -998,16 +985,20 @@ tapefd_wrendmark(
     file.type = F_TAPEEND;
     strncpy(file.datestamp, datestamp, SIZEOF(file.datestamp) - 1);
     file.datestamp[SIZEOF(file.datestamp) - 1] = '\0';
-    buffer = alloc(size);
     file.blocksize = size;
-    build_header(buffer, &file, size);
+    buffer = build_header(&file, size);
     tapefd_setinfo_host(fd, NULL);
     tapefd_setinfo_disk(fd, "TAPEEND");
     tapefd_setinfo_level(fd, -1);
 
     if((rc = tapefd_write(fd, buffer, size)) != (ssize_t)size) {
-       r = errstr = newstralloc2(errstr, "writing endmark: ",
-                                 (rc != -1) ? "short write" : strerror(errno));
+       if (rc != 1) {
+           r = errstr = newvstrallocf(errstr,
+                               _("writing endmark: short write"));
+       } else {
+           r = errstr = newvstrallocf(errstr,
+                               _("writing endmark: %s"), strerror(errno));
+       }
     }
     amfree(buffer);
 
@@ -1024,10 +1015,13 @@ tape_wrendmark(
     char *r = NULL;
 
     if((fd = tape_open(devname, O_WRONLY)) < 0) {
-       r = errstr = newstralloc2(errstr,
-                                 "writing endmark: ",
-                                 (errno == EACCES) ? "tape is write-protected"
-                                                   : strerror(errno));
+       if (errno == EACCES) {
+           r = errstr = newvstrallocf(errstr,
+                                 _("writing endmark: tape is write-protected"));
+       } else {
+           r = errstr = newvstrallocf(errstr,
+                                 _("writing endmark: %s"), strerror(errno));
+       }
     } else if(tapefd_wrendmark(fd, datestamp, size) != NULL) {
        r = errstr;
     }
@@ -1047,11 +1041,13 @@ tape_writable(
     /* first, make sure the file exists and the permissions are right */
 
     if(tape_access(devname, R_OK|W_OK) == -1) {
-       r = errstr = newstralloc(errstr, strerror(errno));
+       r = errstr = newvstrallocf(errstr, "%s", strerror(errno));
     } else if((fd = tape_open(devname, O_WRONLY)) < 0) {
-       r = errstr = newstralloc(errstr,
-                                (errno == EACCES) ? "tape write-protected"
-                                                  : strerror(errno));
+       if (errno == EACCES) {
+           r = errstr = newvstrallocf(errstr, _("tape is write-protected"));
+       } else {
+           r = errstr = newvstrallocf(errstr, "%s", strerror(errno));
+       }
     }
     if(fd >= 0) {
        tapefd_close(fd);
@@ -1059,6 +1055,24 @@ tape_writable(
     return r;
 }
 
+ssize_t
+getconf_readblocksize(void)
+{
+    tapetype_t *tape;
+    char       *conf_tapetype;
+
+    conf_tapetype = getconf_str(CNF_TAPETYPE);
+
+    if (!conf_tapetype || strlen(conf_tapetype) == 0)
+       return MAX_TAPE_BLOCK_KB;
+
+    tape = lookup_tapetype(conf_tapetype);
+    if (!tape)
+       return MAX_TAPE_BLOCK_KB;
+
+    return tapetype_get_readblocksize(tape);
+}
+
 #ifdef TEST
 
 /*
@@ -1083,20 +1097,20 @@ static char *pgm;
 static void
 do_help(void)
 {
-    fprintf(stderr, "  ?|help\n");
-    fprintf(stderr, "  open [\"file\"|$TAPE [\"mode\":O_RDONLY]]\n");
-    fprintf(stderr, "  read [\"records\":\"all\"]\n");
-    fprintf(stderr, "  write [\"records\":1] [\"file#\":\"+\"] [\"record#\":\"+\"] [\"host\"] [\"disk\"] [\"level\"]\n");
-    fprintf(stderr, "  eof|weof [\"count\":1]\n");
-    fprintf(stderr, "  fsf [\"count\":1]\n");
-    fprintf(stderr, "  rewind\n");
-    fprintf(stderr, "  unload\n");
+    g_fprintf(stderr, _("  ?|help\n"));
+    g_fprintf(stderr, _("  open [\"file\"|$TAPE [\"mode\":O_RDONLY]]\n"));
+    g_fprintf(stderr, _("  read [\"records\":\"all\"]\n"));
+    g_fprintf(stderr, _("  write [\"records\":1] [\"file#\":\"+\"] [\"record#\":\"+\"] [\"host\"] [\"disk\"] [\"level\"]\n"));
+    g_fprintf(stderr, _("  eof|weof [\"count\":1]\n"));
+    g_fprintf(stderr, _("  fsf [\"count\":1]\n"));
+    g_fprintf(stderr, _("  rewind\n"));
+    g_fprintf(stderr, _("  unload\n"));
 }
 
 static void
 usage(void)
 {
-    fprintf(stderr, "usage: %s [-c cmd [args] [%% cmd [args] ...]]\n", pgm);
+    g_fprintf(stderr, _("usage: %s [-c cmd [args] [%% cmd [args] ...]]\n"), pgm);
     do_help();
 }
 
@@ -1130,7 +1144,7 @@ do_open(void)
     if(token_count < 2
        || (token_count >= 2 && strcmp(token[1], "$TAPE") == 0)) {
        if((file = getenv("TAPE")) == NULL) {
-           fprintf(stderr, "tape_open: no file name and $TAPE not set\n");
+           g_fprintf(stderr, _("tape_open: no file name and $TAPE not set\n"));
            return;
        }
     } else {
@@ -1142,11 +1156,11 @@ do_open(void)
        mode = O_RDONLY;
     }
 
-    fprintf(stderr, "tapefd_open(\"%s\", %d): ", file, mode);
+    g_fprintf(stderr, _("tapefd_open(\"%s\", %d): "), file, mode);
     if((fd = tape_open(file, mode, 0644)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", fd);
+       g_fprintf(stderr, _("%d (OK)\n"), fd);
        if(have_length) {
            tapefd_setinfo_length(fd, length);
        }
@@ -1158,11 +1172,11 @@ do_close(void)
 {
     int        result;
 
-    fprintf(stderr, "tapefd_close(): ");
+    g_fprintf(stderr, _("tapefd_close(): "));
     if((result = tapefd_close(fd)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", result);
+       g_fprintf(stderr, _("%d (OK)\n"), result);
     }
 }
 
@@ -1186,12 +1200,12 @@ do_read(void)
 
     p = (int *)buf;
     for(i = 0; (! have_count) || (i < count); i++) {
-       fprintf(stderr, "tapefd_read(" OFF_T_FMT "): ", (OFF_T_FMT_TYPE)i);
+       g_fprintf(stderr, _("tapefd_read(%lld): "), (long long)i);
        if((result = tapefd_read(fd, buf, SIZEOF(buf))) < 0) {
            perror("");
            break;
        } else if(result == 0) {
-           fprintf(stderr,  SSIZE_T_FMT" (EOF)\n", result);
+           g_fprintf(stderr,  _("%zd (EOF)\n"), result);
            /*
             * If we were not given a count, EOF breaks the loop, otherwise
             * we keep trying (to test read after EOF handling).
@@ -1201,9 +1215,9 @@ do_read(void)
            }
        } else {
            if(result == (ssize_t)sizeof(buf)) {
-               s = "OK";
+               s = _("OK");
            } else {
-               s = "short read";
+               s = _("short read");
            }
 
            /*
@@ -1212,8 +1226,8 @@ do_read(void)
             * well screwed up at this point anyway so it is not worth
             * the effort to deal with.
             */
-           fprintf(stderr,
-                   SSIZE_T_FMT " (%s): file %d: record %d",
+           g_fprintf(stderr,
+                   _("%zd (%s): file %d: record %d"),
                    result,
                    s,
                    p[0],
@@ -1221,7 +1235,7 @@ do_read(void)
            if(show_timestamp) {
                then = p[2];
                tm = localtime(&then);
-               fprintf(stderr,
+               g_fprintf(stderr,
                        ": %04d/%02d/%02d %02d:%02d:%02d\n",
                        tm->tm_year + 1900,
                        tm->tm_mon + 1,
@@ -1279,24 +1293,24 @@ do_write(void)
     for(i = 0; i < count; i++, (current_record += (off_t)1)) {
        p[0] = current_file;
        p[1] = current_record;
-       fprintf(stderr, "tapefd_write(" OFF_T_FMT "): ", i);
+       g_fprintf(stderr, _("tapefd_write(%lld): "), i);
        if((result = tapefd_write(fd, write_buf, SIZEOF(write_buf))) < 0) {
            perror("");
            break;
        } else {
            if(result == (ssize_t)sizeof(write_buf)) {
-               s = "OK";
+               s = _("OK");
            } else {
-               s = "short write";
+               s = _("short write");
            }
-           fprintf(stderr,
-                   "%d (%s): file " OFF_T_FMT ": record " OFF_T_FMT,
+           g_fprintf(stderr,
+                   _("%d (%s): file %lld: record %lld"),
                    result,
                    s,
                    p[0],
                    p[1]);
            if(show_timestamp) {
-               fprintf(stderr,
+               g_fprintf(stderr,
                        ": %04d/%02d/%02d %02d:%02d:%02d\n",
                        tm->tm_year + 1900,
                        tm->tm_mon + 1,
@@ -1322,11 +1336,11 @@ do_fsf(void)
        count = (off_t)1;
     }
 
-    fprintf(stderr, "tapefd_fsf(" OFF_T_FMT "): ", (OFF_T_FMT_TYPE)count);
+    g_fprintf(stderr, _("tapefd_fsf(%lld): "), (long long)count);
     if((result = tapefd_fsf(fd, count)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", result);
+       g_fprintf(stderr, _("%d (OK)\n"), result);
        current_file += count;
        current_record = (off_t)0;
     }
@@ -1344,11 +1358,11 @@ do_weof(void)
        count = (off_t)1;
     }
 
-    fprintf(stderr, "tapefd_weof(" OFF_T_FMT "): ", count);
+    g_fprintf(stderr, _("tapefd_weof(%lld): "), count);
     if((result = tapefd_weof(fd, count)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", result);
+       g_fprintf(stderr, _("%d (OK)\n"), result);
        current_file += count;
        current_record = (off_t)0;
     }
@@ -1359,11 +1373,11 @@ do_rewind(void)
 {
     int        result;
 
-    fprintf(stderr, "tapefd_rewind(): ");
+    g_fprintf(stderr, _("tapefd_rewind(): "));
     if((result = tapefd_rewind(fd)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", result);
+       g_fprintf(stderr, _("%d (OK)\n"), result);
        current_file = (off_t)0;
        current_record = (off_t)0;
     }
@@ -1374,11 +1388,11 @@ do_unload(void)
 {
     int        result;
 
-    fprintf(stderr, "tapefd_unload(): ");
+    g_fprintf(stderr, _("tapefd_unload(): "));
     if((result = tapefd_unload(fd)) < 0) {
        perror("");
     } else {
-       fprintf(stderr, "%d (OK)\n", result);
+       g_fprintf(stderr, _("%d (OK)\n"), result);
        current_file = (off_t)-1;
        current_record = (off_t)-1;
     }
@@ -1405,8 +1419,8 @@ struct cmd {
 
 int
 main(
-    int argc,
-    char **argv)
+    int                argc,
+    char **    argv)
 {
     int ch;
     int cmdline = 0;
@@ -1416,6 +1430,15 @@ main(
     int j;
     time_t now;
 
+    /*
+     * Configure program for internationalization:
+     *   1) Only set the message locale for now.
+     *   2) Set textdomain for all amanda related programs to "amanda"
+     *      We don't want to be forced to support dozens of message catalogs.
+     */  
+    setlocale(LC_MESSAGES, "C");
+    textdomain("amanda"); 
+
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
@@ -1552,7 +1575,7 @@ main(
            }
        }
        if(cmd[i].name == NULL) {
-           fprintf(stderr, "%s: unknown command: %s\n", pgm, token[0]);
+           g_fprintf(stderr, _("%s: unknown command: %s\n"), pgm, token[0]);
            exit(1);
        }
        (*cmd[i].func)();
index 5111d5aedd5c9d26d1c4b47665754ba788054ff2..53db45a1a754e69895b9275f42a6e5faf5369c13 100644 (file)
@@ -148,4 +148,6 @@ char *tapeio_next_devname(char * dev_left,
 #define NOT_AMANDA_TAPE_MSG "not an amanda tape"
 #define CHECK_NOT_AMANDA_TAPE_MSG(x) (!BSTRNCMP(x, NOT_AMANDA_TAPE_MSG))
 
+ssize_t getconf_readblocksize(void);
+
 #endif /* ! TAPEIO_H */
index 385039eef8ea8805f08ae1c8def875c7cd2c6818..26077b1d90f156af2dd4e2bb99dedd8ee519ca6b 100644 (file)
@@ -174,15 +174,15 @@ writeblocks(
 static void
 usage(void)
 {
-  fputs("usage: ", stderr);
+  fputs(_("usage: "), stderr);
   fputs(sProgName, stderr);
-  fputs(" [-h]", stderr);
-  fputs(" [-c]", stderr);
-  fputs(" [-o]", stderr);
-  fputs(" [-b blocksize]", stderr);
-  fputs(" -e estsize", stderr);
-  fputs(" [-f tapedev]", stderr);
-  fputs(" [-t typename]", stderr);
+  fputs(_(" [-h]"), stderr);
+  fputs(_(" [-c]"), stderr);
+  fputs(_(" [-o]"), stderr);
+  fputs(_(" [-b blocksize]"), stderr);
+  fputs(_(" -e estsize"), stderr);
+  fputs(_(" [-f tapedev]"), stderr);
+  fputs(_(" [-t typename]"), stderr);
   fputc('\n', stderr);
 }
 
@@ -190,15 +190,15 @@ static void
 help(void)
 {
   usage();
-  fputs("-h                    display this message\n"
-       "-c                     run hardware compression detection test only\n"
-       "-o                     overwrite amanda tape\n"
-       "-b blocksize           record block size (default: 32k)\n"
-       "-e estsize             estimated tape size (No default!)\n"
-       "-f tapedev             tape device name (default: $TAPE)\n"
-       "-t typename            tapetype name (default: unknown-tapetype)\n"
-       "\n"
-       "Note: disable hardware compression when running this program.\n",
+  fputs(_("-h                  display this message\n"
+         "-c                   run hardware compression detection test only\n"
+         "-o                   overwrite amanda tape\n"
+         "-b blocksize         record block size (default: 32k)\n"
+         "-e estsize           estimated tape size (No default!)\n"
+         "-f tapedev           tape device name (default: $TAPE)\n"
+         "-t typename          tapetype name (default: unknown-tapetype)\n"
+         "\n"
+         "Note: disable hardware compression when running this program.\n"),
        stderr);
 }
 
@@ -210,10 +210,17 @@ show_progress(
     off_t *    blocks,
     off_t *    files)
 {
-  fprintf(stderr, "wrote " OFF_T_FMT " " SIZE_T_FMT "Kb block%s in " OFF_T_FMT " file%s",
-         (OFF_T_FMT_TYPE)*blocks,
-         (SIZE_T_FMT_TYPE)blockkb, (*blocks == (off_t)1) ? "" : "s",
-         (OFF_T_FMT_TYPE)*files, (*files == (off_t)1) ? "" : "s");
+    g_fprintf(stderr,
+           plural(_("wrote %lld %zu Kb block"),
+                  _("wrote %lld %zu Kb blocks"),
+                  *blocks),
+           (long long)*blocks,
+           blockkb);
+    g_fprintf(stderr,
+           plural(_(" in %lld file"),
+                  _(" in %lld files"),
+                  *files),
+           (long long)*files);
 }
 
 
@@ -229,13 +236,13 @@ do_pass(
   int save_errno;
 
   if (tapefd_rewind(fd) == -1) {
-    fprintf(stderr, "%s: could not rewind %s: %s\n",
+    g_fprintf(stderr, _("%s: could not rewind %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     exit(1);
   }
   if (((-1 == tapefd_close(fd)) ||
        (-1 == (fd = tape_open(tapedev, O_RDWR))))) {
-    fprintf(stderr, "%s: could not re-open %s: %s\n",
+    g_fprintf(stderr, "%s: could not re-open %s: %s\n",
            sProgName, tapedev, strerror(errno));
     exit(1);
   }
@@ -258,8 +265,8 @@ do_pass(
   time(&end);
 
   if (*blocks == (off_t)0) {
-    fprintf(stderr, "%s: could not write any data in this pass: %s\n",
-           sProgName, short_write ? "short write" : strerror(save_errno));
+    g_fprintf(stderr, _("%s: could not write any data in this pass: %s\n"),
+           sProgName, short_write ? _("short write") : strerror(save_errno));
     exit(1);
   }
 
@@ -276,9 +283,12 @@ do_pass(
     putc('\r', stderr);
   }
   show_progress(blocks, files);
-  fprintf(stderr, " in " TIME_T_FMT " second%s (%s)\n",
-         (TIME_T_FMT_TYPE)*seconds, (*seconds == 1) ? "" : "s",
-         short_write ? "short write" : strerror(save_errno));
+  g_fprintf(stderr,
+         plural(_(" in %jd second (%s)\n"),
+                _(" in %jd seconds (%s)\n"),
+                *seconds),
+         (intmax_t)*seconds,
+         short_write ? _("short write") : strerror(save_errno));
 }
 
 
@@ -293,7 +303,7 @@ do_pass0(
   int save_errno;
 
   if (dorewind  &&  tapefd_rewind(fd) == -1) {
-    fprintf(stderr, "%s: could not rewind %s: %s\n",
+    g_fprintf(stderr, _("%s: could not rewind %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     exit(1);
   }
@@ -301,7 +311,7 @@ do_pass0(
   if (dorewind &&
       ((-1 == tapefd_close(fd)) ||
        (-1 == (fd = tape_open(tapedev, O_RDWR))))) {
-    fprintf(stderr, "%s: could not re-open %s: %s\n",
+    g_fprintf(stderr, "%s: could not re-open %s: %s\n",
            sProgName, tapedev, strerror(errno));
     exit(1);
   }
@@ -317,8 +327,8 @@ do_pass0(
   time(&end);
 
   if (blks <= (off_t)0) {
-    fprintf(stderr, "%s: could not write any data in this pass: %s\n",
-           sProgName, short_write ? "short write" : strerror(save_errno));
+    g_fprintf(stderr, _("%s: could not write any data in this pass: %s\n"),
+           sProgName, short_write ? _("short write") : strerror(save_errno));
     exit(1);
   }
 
@@ -368,6 +378,14 @@ main(
   char *datestamp = NULL;
   char *label = NULL;
 
+  /*
+   * Configure program for internationalization:
+   *   1) Only set the message locale for now.
+   *   2) Set textdomain for all amanda related programs to "amanda"
+   *      We don't want to be forced to support dozens of message catalogs.
+   */  
+  setlocale(LC_MESSAGES, "C");
+  textdomain("amanda"); 
 
   if ((sProgName = strrchr(*argv, '/')) == NULL) {
     sProgName = *argv;
@@ -392,7 +410,7 @@ main(
        } else if (*suffix == 'g' || *suffix == 'G') {
          blockkb *= (1024 * 1024);
        } else {
-         fprintf(stderr, "%s: unknown size suffix \'%c\'\n",
+         g_fprintf(stderr, _("%s: unknown size suffix \'%c\'\n"),
                  sProgName, *suffix);
          return 1;
        }
@@ -406,7 +424,7 @@ main(
        } else if (*suffix == 'g' || *suffix == 'G') {
          estsize *= (off_t)(1024 * 1024);
        } else {
-         fprintf(stderr, "%s: unknown size suffix \'%c\'\n",
+         g_fprintf(stderr, _("%s: unknown size suffix \'%c\'\n"),
                  sProgName, *suffix);
          return 1;
        }
@@ -434,7 +452,7 @@ main(
       break;
 
     default:
-      fprintf(stderr, "%s: unknown option \'%c\'\n", sProgName, ch);
+      g_fprintf(stderr, _("%s: unknown option \'%c\'\n"), sProgName, ch);
       /*FALLTHROUGH*/
 
     case '?':
@@ -445,7 +463,7 @@ main(
   blocksize = blockkb * 1024;
 
   if (tapedev == NULL) {
-    fprintf(stderr, "%s: No tapedev specified\n", sProgName);
+    g_fprintf(stderr, _("%s: No tapedev specified\n"), sProgName);
     usage();
     return 1;
   }
@@ -458,7 +476,7 @@ main(
     if (comprtstonly) {
       estsize = (off_t)(1024 * 1024);          /* assume 1 GByte for now */
     } else {
-      fprintf(stderr, "%s: please specify estimated tape capacity (e.g. '-e 4g')\n", sProgName);
+      g_fprintf(stderr, _("%s: please specify estimated tape capacity (e.g. '-e 4g')\n"), sProgName);
       usage();
       return 1;
     }
@@ -470,7 +488,7 @@ main(
 
   fd = tape_open(tapedev, O_RDONLY, 0);
   if (fd == -1) {
-    fprintf(stderr, "%s: could not open %s: %s\n",
+    g_fprintf(stderr, _("%s: could not open %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     return 1;
   }
@@ -478,12 +496,12 @@ main(
   if((result = tapefd_rdlabel(fd, &datestamp, &label)) == NULL) {
     is_labeled = 1;
   }
-  else if (strcmp(result,"not an amanda tape") == 0) {
+  else if (strcmp(result,_("not an amanda tape")) == 0) {
     is_labeled = 2;
   }
 
   if(tapefd_rewind(fd) == -1) {
-    fprintf(stderr, "%s: could not rewind %s: %s\n",
+    g_fprintf(stderr, _("%s: could not rewind %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     tapefd_close(fd);
     return 1;
@@ -492,19 +510,19 @@ main(
   tapefd_close(fd);
 
   if(is_labeled == 1 && overwrite_label == 0) {
-    fprintf(stderr, "%s: The tape is an amanda tape, use -o to overwrite the tape\n",
+    g_fprintf(stderr, _("%s: The tape is an amanda tape, use -o to overwrite the tape\n"),
            sProgName);
     return 1;
   }
   else if(is_labeled == 2 && overwrite_label == 0) {
-    fprintf(stderr, "%s: The tape is already used, use -o to overwrite the tape\n",
+    g_fprintf(stderr, _("%s: The tape is already used, use -o to overwrite the tape\n"),
            sProgName);
     return 1;
   }
 
   fd = tape_open(tapedev, O_RDWR, 0);
   if (fd == -1) {
-    fprintf(stderr, "%s: could not open %s: %s\n",
+    g_fprintf(stderr, _("%s: could not open %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     return 1;
   }
@@ -521,7 +539,7 @@ main(
 
   initnotrandombytes();
 
-  fprintf(stderr, "Estimate phase 1...");
+  g_fprintf(stderr, _("Estimate phase 1..."));
   pass0size = (off_t)(8 * 1024 / blockkb);
   pass1time = 0;
   pass2time = 0;
@@ -548,16 +566,17 @@ main(
     do_pass0(pass0size, &pass2time, 1);
     do_pass0(pass0size, &pass1time, 0);
     if (pass0size >= (off_t)(10 * 1024 * 1024)) {
-      fprintf(stderr,
-       "\rTape device is too fast to detect hardware compression...\n");
+      g_fprintf(stderr, "\r");
+      g_fprintf(stderr,
+       _("Tape device is too fast to detect hardware compression...\n"));
       break;   /* avoid loops if tape is superfast or broken */
     }
   }
-  fprintf(stderr,
-       "\rWriting " OFF_T_FMT " Mbyte   compresseable data:  "
-       TIME_T_FMT " sec\n",
-       (OFF_T_FMT_TYPE)((off_t)blockkb * pass0size / (off_t)1024),
-       (TIME_T_FMT_TYPE)pass1time);
+  g_fprintf(stderr, "\r");
+  g_fprintf(stderr,
+       _("Writing %lld Mbyte   compresseable data:  %jd sec\n"),
+       (long long)((off_t)blockkb * pass0size / (off_t)1024),
+       (intmax_t)pass1time);
 
   /*
    * now generate uncompressable data and try again
@@ -566,13 +585,13 @@ main(
   srandom((unsigned)now);
   initrandombytes();
 
-  fprintf(stderr, "Estimate phase 2...");
+  g_fprintf(stderr, _("Estimate phase 2..."));
   do_pass0(pass0size, &pass2time, 1);  /* rewind and get drive streaming */
   do_pass0(pass0size, &pass2time, 0);
-  fprintf(stderr, "\rWriting " OFF_T_FMT
-       " Mbyte uncompresseable data:  " TIME_T_FMT " sec\n",
-       (OFF_T_FMT_TYPE)((off_t)blockkb * pass0size / (off_t)1024),
-       (TIME_T_FMT_TYPE)pass2time);
+  g_fprintf(stderr, "\r");
+  g_fprintf(stderr, _("Writing %lld Mbyte uncompresseable data: %jd sec\n"),
+       (long long)((off_t)blockkb * pass0size / (off_t)1024),
+       (intmax_t)pass2time);
 
   /*
    * Compute the time difference between writing the compressable and
@@ -589,22 +608,21 @@ main(
     timediff = pass2time - pass1time;
   }
   if (((100 * timediff) / pass2time) >= 20) {  /* 20% faster? */
-    fprintf(stderr, "WARNING: Tape drive has hardware compression enabled\n");
+    g_fprintf(stderr, _("WARNING: Tape drive has hardware compression enabled\n"));
     hwcompr = 1;
   }
 
   /*
    * Inform about estimated time needed to run the remaining of this program
    */
-  fprintf(stderr, "Estimated time to write 2 * %lu Mbyte: ", (unsigned long) (estsize / (off_t)1024));
+  g_fprintf(stderr, _("Estimated time to write 2 * %lu Mbyte: "), (unsigned long) (estsize / (off_t)1024));
   pass1time = (time_t)(2.0 * (double)pass2time * (double)estsize /
                (1.0 * (double)pass0size * (double)blockkb));
        /* avoid overflow and underflow by doing math in floating point */
-  fprintf(stderr, TIME_T_FMT " sec = ",
-         (TIME_T_FMT_TYPE)pass1time);
-  fprintf(stderr, TIME_T_FMT " h " TIME_T_FMT " min\n",
-         (TIME_T_FMT_TYPE)(pass1time/(time_t)3600),
-         (TIME_T_FMT_TYPE)((pass1time%(time_t)3600) / (time_t)60));
+  g_fprintf(stderr, _("%jd sec = %jd h %jd min\n"),
+         (intmax_t)pass1time,
+         (intmax_t)(pass1time/(time_t)3600),
+         (intmax_t)((pass1time%(time_t)3600) / (time_t)60));
 
   if (comprtstonly) {
        exit(hwcompr);
@@ -680,22 +698,22 @@ main(
   /*
    * Dump the tapetype.
    */
-  printf("define tapetype %s {\n", typename);
-  printf("    comment \"just produced by tapetype prog (hardware compression %s)\"\n",
-       hwcompr ? "on" : "off");
-  printf("    length " OFF_T_FMT " %s\n", (OFF_T_FMT_TYPE)size, sizeunits);
-  printf("    filemark " SIZE_T_FMT " kbytes\n", (SIZE_T_FMT_TYPE)filemark);
-  printf("    speed %lu kps\n", speed);
-  printf("}\n");
+  g_printf("define tapetype %s {\n", typename);
+  g_printf(_("    comment \"just produced by tapetype prog (hardware compression %s)\"\n"),
+       hwcompr ? _("on") : _("off"));
+  g_printf("    length %lld %s\n", (long long)size, sizeunits);
+  g_printf("    filemark %zu kbytes\n", filemark);
+  g_printf("    speed %lu kps\n", speed);
+  g_printf("}\n");
 
   if (tapefd_rewind(fd) == -1) {
-    fprintf(stderr, "%s: could not rewind %s: %s\n",
+    g_fprintf(stderr, _("%s: could not rewind %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     return 1;
   }
 
   if (tapefd_close(fd) == -1) {
-    fprintf(stderr, "%s: could not close %s: %s\n",
+    g_fprintf(stderr, _("%s: could not close %s: %s\n"),
            sProgName, tapedev, strerror(errno));
     return 1;
   }